Opened 4 years ago

Closed 4 years ago

#11424 closed enhancement (fixed)

Cursor loading does nothing if wx.rc is not included (MSW)

Reported by: triton Owned by:
Priority: low Milestone:
Component: wxMSW Version: stable-latest
Keywords: cursor loading manifest doc Cc:
Blocked By: Blocking:
Patch: yes

Description

I was trying to set a custom cursor and it didn't work. After some searching I found out I needed to include the "wx/msw/wx.rc" resource file. So I thought it would be a good idea to add this to the docs so in the future, people like me who didn't know this was needed, don't need to search.

See the attached patch. This is my first time generating a patch, so hope everything is in order.

Attachments (1)

cursor-doc.patch download (412 bytes) - added by triton 4 years ago.
Cursor behaviour doc patch

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by triton

Cursor behaviour doc patch

comment:1 Changed 4 years ago by vadz

  • Status changed from new to confirmed
  • Summary changed from Cursor loading does nothing if manifest is not included (MSW) to Cursor loading does nothing if wx.rc is not included (MSW)

The patch is good, thanks, but I don't actually think this is correct. Most of the standard cursors are defined by Windows, only a few of them are in wx.rc. I guess we should mention that in the docs or at least say that "some of the cursors require wx.rc to be included"?

OTOH including wx.rc is always the right thing to do, even if you don't use cursors, as it contains other important definitions. So I wonder if we shouldn't have an assert on app startup checking that it is loaded?

Finally, we could at least give a more useful error message in wxCursor::InitFromStock() pointing to wx.rc too (as nobody reads the documentation anyhow...).

comment:2 Changed 4 years ago by triton

vadz, asserting when wx.rc isn't included sounds like a good idea to me, especially since some stuff won't work and then people will not know why.

comment:3 Changed 4 years ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [63276]) Try to prevent users from forgetting to include wx.rc from their resources.

Document that some of the standard cursors are defined in this file.

Also add a (hopefully) helpful assert if loading one of such cursors failed.

Closes #11424.

Note: See TracTickets for help on using tickets.