]> git.saurik.com Git - wxWidgets.git/commitdiff
OS/2 loads bitmap resources via integer ID, not via a string filename
authorDavid Webster <Dave.Webster@bhmi.com>
Mon, 8 Jul 2002 03:41:27 +0000 (03:41 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Mon, 8 Jul 2002 03:41:27 +0000 (03:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cshelp.cpp
src/common/resource.cpp

index f25d0943e75469a3ee10348cd67beba1de15dcbf..4d173898bc8e01dd7b324f4358b47183fa379cbc 100644 (file)
@@ -170,7 +170,7 @@ bool wxContextHelp::EndContextHelp()
 bool wxContextHelp::EventLoop()
 {
     m_inHelp = TRUE;
-    
+
     while ( m_inHelp )
     {
         if (wxTheApp->Pending())
@@ -182,7 +182,7 @@ bool wxContextHelp::EventLoop()
             wxTheApp->ProcessIdle();
         }
     }
-    
+
     return TRUE;
 }
 
@@ -225,9 +225,9 @@ bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt)
     {
         wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ;
         helpEvent.SetEventObject(this);
-        
+
         eventProcessed = win->GetEventHandler()->ProcessEvent(helpEvent);
-        
+
         // Go up the window hierarchy until the event is handled (or not).
         // I.e. keep submitting ancestor windows until one is recognised
         // by the app code that processes the ids and displays help.
@@ -275,8 +275,15 @@ wxContextHelpButton::wxContextHelpButton(wxWindow* parent,
                                          const wxPoint& pos,
                                          const wxSize& size,
                                          long style)
+#if defined(__WXPM__)
+                   : wxBitmapButton(parent, id, wxBitmap(wxCSQUERY_BITMAP
+                                                         ,wxBITMAP_TYPE_RESOURCE
+                                                        ),
+                                    pos, size, style)
+#else
                    : wxBitmapButton(parent, id, wxBITMAP(csquery),
                                     pos, size, style)
+#endif
 {
 }
 
index 782e63157c09d86f22a605006aad24080d89cb5b..4ba466c395044e5e42fdff085fcd3523dbb1c74e 100644 (file)
@@ -335,7 +335,14 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
                 ((wxItemResource*) childResource)->SetBitmap(bitmap);
             }
             if (!bitmap.Ok())
+#if defined(__WXPM__)
+                //
+                // OS/2 uses integer id's to access resources, not file name strings
+                //
+                bitmap.LoadFile(wxCROSS_BITMAP, wxBITMAP_TYPE_BMP_RESOURCE);
+#else
                 bitmap.LoadFile("cross_bmp", wxBITMAP_TYPE_BMP_RESOURCE);
+#endif
             control = new wxBitmapButton(parent, id, bitmap, pos, size,
                 childResource->GetStyle() | wxBU_AUTODRAW, wxDefaultValidator, childResource->GetName());
         }
@@ -2477,7 +2484,11 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
             }
         default:
             {
+#if defined(__WXPM__)
+                return wxNullBitmap;
+#else
                 return wxBitmap(name, (wxBitmapType)bitmapType);
+#endif
             }
         }
 #ifndef __WXGTK__