]> git.saurik.com Git - wxWidgets.git/commitdiff
Try to prevent users from forgetting to include wx.rc from their resources.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 26 Jan 2010 12:39:41 +0000 (12:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 26 Jan 2010 12:39:41 +0000 (12:39 +0000)
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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/wx/gdicmn.h
src/msw/cursor.cpp

index e8ae5f3451be03a15871363fbf0368b2a2013b0a..2c5d6a799455e4cc1a2c804cfd31a1a01f6464ae 100644 (file)
@@ -58,7 +58,14 @@ enum wxPolygonFillMode
 };
 
 /**
 };
 
 /**
-    Standard cursors. See wxCursor.
+    Standard cursors.
+
+    Notice that under wxMSW some of these cursors are defined in @c wx.rc file
+    and not by the system itself so you should include this file from your own
+    resource file (possibly creating a trivial resource file just containing a
+    single include line if you don't need it otherwise) to be able to use them.
+
+    See wxCursor.
 */
 enum wxStockCursor
 {
 */
 enum wxStockCursor
 {
index fbcf62dd75eb14d145e72c83acab157ea3358ff8..dec1344042635a7a098052156087d84973d9d633 100644 (file)
@@ -349,6 +349,15 @@ void wxCursor::InitFromStock(wxStockCursor idCursor)
 
     if ( !hcursor )
     {
 
     if ( !hcursor )
     {
+        if ( !stdCursor.isStd )
+        {
+            // it may be not obvious to the programmer why did loading fail,
+            // try to help by pointing to the by far the most probable reason
+            wxFAIL_MSG(wxT("Loading a cursor defined by wxWidgets failed, ")
+                       wxT("did you include include/wx/msw/wx.rc file from ")
+                       wxT("your resource file?"));
+        }
+
         wxLogLastError(wxT("LoadCursor"));
     }
     else
         wxLogLastError(wxT("LoadCursor"));
     }
     else