]> git.saurik.com Git - wxWidgets.git/commitdiff
More OS/2 update to fix some owner drawn things
authorDavid Webster <Dave.Webster@bhmi.com>
Tue, 3 Sep 2002 22:26:53 +0000 (22:26 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Tue, 3 Sep 2002 22:26:53 +0000 (22:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/os2/checklst.h
include/wx/os2/control.h
include/wx/os2/listbox.h
include/wx/os2/window.h
src/os2/checklst.cpp
src/os2/listbox.cpp
src/os2/window.cpp
src/os2/wx23.def

index 335e8c07edcccff3bd7bda2f63d44496025a1278..cbecae5fedf6e8649403bb2b41c02f1cc1ba2082 100644 (file)
@@ -24,7 +24,7 @@ class wxCheckListBoxItem; // fwd decl, define in checklst.cpp
 class WXDLLEXPORT wxCheckListBox : public wxListBox
 {
 public:
-    // 
+    //
     // Ctors
     //
     wxCheckListBox();
@@ -41,7 +41,7 @@ public:
                    ,const wxString&    rsName = wxListBoxNameStr
                   );
 
-    // 
+    //
     // Override base class virtuals
     //
     virtual void Delete(int n);
@@ -52,7 +52,7 @@ public:
 
     virtual bool SetFont(const wxFont &rFont);
 
-    // 
+    //
     // Items may be checked
     //
     bool IsChecked(size_t uiIndex) const;
@@ -60,20 +60,20 @@ public:
                ,bool   bCheck = TRUE
               );
 
-    // 
+    //
     // Accessors
     //
     size_t GetItemHeight(void) const { return m_nItemHeight; }
 
 protected:
-    // 
+    //
     // We create our items ourselves and they have non-standard size,
     // so we need to override these functions
     //
     virtual wxOwnerDrawn* CreateItem(size_t n);
-    virtual bool          OS2OnMeasure(WXMEASUREITEMSTRUCT* pItem);
+    virtual long          OS2OnMeasure(WXMEASUREITEMSTRUCT* pItem);
 
-    // 
+    //
     // Pressing space or clicking the check box toggles the item
     //
     void OnChar(wxKeyEvent& rEvent);
@@ -89,7 +89,7 @@ private:
                                   ,const wxItemResource*  pParentResource
                                   ,const wxResourceTable* pTable = (const wxResourceTable *) NULL
                                  )
-    { 
+    {
         return(wxWindowBase::CreateItem( pChildResource
                                         ,pParentResource
                                         ,pTable
index 55602617a4956dd728847b514b465716ffbaf929..fbbb0410c603362d4c6c26630366fb7371f2d20a 100644 (file)
@@ -73,7 +73,7 @@ public:
     // For ownerdraw items
     //
     virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* WXUNUSED(pItem)) { return FALSE; };
-    virtual bool OS2OnMeasure(WXMEASUREITEMSTRUCT* WXUNUSED(pItem)) { return FALSE; };
+    virtual long OS2OnMeasure(WXMEASUREITEMSTRUCT* WXUNUSED(pItem)) { return 0L; };
 
     wxArrayLong&     GetSubcontrols() { return m_aSubControls; }
     void             OnEraseBackground(wxEraseEvent& rEvent);
index ffe2719d88df2998b178c21faa4e9acf2bbd14e6..a198afb55be16c557291a09e33fa57297e483a91 100644 (file)
@@ -121,7 +121,7 @@ public:
     // wxCheckListBox support
     //
 #if wxUSE_OWNER_DRAWN
-    bool                  OS2OnMeasure(WXMEASUREITEMSTRUCT *item);
+    long                  OS2OnMeasure(WXMEASUREITEMSTRUCT *item);
     bool                  OS2OnDraw(WXDRAWITEMSTRUCT *item);
 
     virtual wxOwnerDrawn* CreateItem(size_t n);
index a64f5ae222b02921a8c1988b8989b06e6901dbcc..c690cd1dfbc17d8f4bb0aa8b71f86ab198533930 100644 (file)
@@ -367,7 +367,7 @@ public:
     virtual bool OS2OnDrawItem( int               nId
                                ,WXDRAWITEMSTRUCT* pItem
                               );
-    virtual bool OS2OnMeasureItem( int                  nId
+    virtual long OS2OnMeasureItem( int                  nId
                                   ,WXMEASUREITEMSTRUCT* pItem
                                  );
 
index f3a639ff6a8aeda38d4b85a47def8d1d2dd9de0e..5f6282c54eb4b6890567ebba1bfb27f793955e2f 100644 (file)
@@ -112,6 +112,9 @@ bool wxCheckListBoxItem::OnDrawItem (
 {
     wxRect                          vRect = rRect;
 
+    ::WinQueryWindowRect( m_pParent->GetHWND()
+                         ,&rDc.m_vRclPaint
+                        );
     if (IsChecked())
         eStat = (wxOwnerDrawn::wxODStatus)(eStat | wxOwnerDrawn::wxODChecked);
 
@@ -141,9 +144,6 @@ bool wxCheckListBoxItem::OnDrawItem (
         m_pParent->GetSize( NULL
                            ,&nParentHeight
                           );
-        ::WinQueryWindowRect( m_pParent->GetHWND()
-                             ,&rDc.m_vRclPaint
-                            );
 
         nY = nParentHeight - nY - nCheckHeight;
         vPenBack = wxPen(vColour, 1, wxSOLID);
@@ -372,7 +372,7 @@ wxOwnerDrawn* wxCheckListBox::CreateItem (
 // Return item size
 // ----------------
 //
-bool wxCheckListBox::OS2OnMeasure (
+long wxCheckListBox::OS2OnMeasure (
   WXMEASUREITEMSTRUCT*             pItem
 )
 {
@@ -391,9 +391,9 @@ bool wxCheckListBox::OS2OnMeasure (
         // Add place for the check mark
         //
         pStruct->rclItem.xRight += wxOwnerDrawn::GetDefaultMarginWidth();
-        return TRUE;
+        return long(MRFROM2SHORT((USHORT)m_nItemHeight, (USHORT)(pStruct->rclItem.xRight - pStruct->rclItem.xLeft)));
     }
-    return FALSE;
+    return 0L;
 } // end of wxCheckListBox::CreateItem
 
 //
index 5621ec8cd3c20eb2105e33bf6abc0dc65663f206..9f9f1de5d28afada32461669d3806eed61b5c756 100644 (file)
@@ -279,6 +279,9 @@ int wxListBox::DoAppend(
     if (m_windowStyle & wxLB_OWNERDRAW)
     {
         wxOwnerDrawn*               pNewItem = CreateItem(nIndex); // dummy argument
+        wxScreenDC                  vDc;
+        wxCoord                     vHeight;
+
 
         pNewItem->SetName(rsItem);
         m_aItems.Insert(pNewItem, nIndex);
@@ -809,7 +812,7 @@ bool wxListBox::OS2Command(
 //
 #define OWNER_DRAWN_LISTBOX_EXTRA_SPACE    (1)
 
-bool wxListBox::OS2OnMeasure(
+long wxListBox::OS2OnMeasure(
   WXMEASUREITEMSTRUCT*              pItem
 )
 {
@@ -827,21 +830,21 @@ bool wxListBox::OS2OnMeasure(
     vDc.SetFont(GetFont());
 
     wxCoord                         vHeight;
+    wxCoord                         vWidth;
+
+    GetSize( &vWidth
+            ,NULL
+           );
 
-    pMeasureStruct->rclItem.xRight = 0;
+    pMeasureStruct->rclItem.xRight = (USHORT)vWidth;
     pMeasureStruct->rclItem.xLeft  = 0;
     pMeasureStruct->rclItem.yTop   = 0;
     pMeasureStruct->rclItem.yBottom = 0;
 
     vHeight = vDc.GetCharHeight() * 2.5;
-    pMeasureStruct->rclItem.yTop  = vHeight;
+    pMeasureStruct->rclItem.yTop  = (USHORT)vHeight;
 
-    ::WinSendMsg( GetHWND()
-                 ,LM_SETITEMHEIGHT
-                 ,MPFROMLONG(vHeight)
-                 ,MPFROMLONG(pMeasureStruct->idItem)
-                );
-    return TRUE;
+    return long(MRFROM2SHORT((USHORT)vHeight, (USHORT)vWidth));
 } // end of wxListBox::OS2OnMeasure
 
 bool wxListBox::OS2OnDraw (
index 951bf17e8c797136775a92746d48cb37ba26aca9..ce34797831607c4a650dbb6e9572c1e65aba87b1 100644 (file)
@@ -2841,8 +2841,9 @@ MRESULT wxWindowOS2::OS2WindowProc(
                 }
                 else
                 {
-                    bProcessed = OS2OnMeasureItem(nIdCtrl,
-                                                 (WXMEASUREITEMSTRUCT *)lParam);
+                    return MRFROMLONG(OS2OnMeasureItem( nIdCtrl
+                                                       ,(WXMEASUREITEMSTRUCT *)lParam
+                                                      ));
                 }
 
                 if ( bProcessed )
@@ -3807,7 +3808,7 @@ bool wxWindowOS2::OS2OnDrawItem(
     return FALSE;
 } // end of wxWindowOS2::OS2OnDrawItem
 
-bool wxWindowOS2::OS2OnMeasureItem(
+long wxWindowOS2::OS2OnMeasureItem(
   int                               lId
 , WXMEASUREITEMSTRUCT*              pItemStruct
 )
@@ -3833,13 +3834,16 @@ bool wxWindowOS2::OS2OnMeasureItem(
                                          ,&nHeight
                                         ))
             {
+                MRESULT             mRc;
+
                 pMeasureStruct->rclItem.xRight  = nWidth;
                 pMeasureStruct->rclItem.xLeft   = 0L;
                 pMeasureStruct->rclItem.yTop    = nHeight;
                 pMeasureStruct->rclItem.yBottom = 0L;
-                return TRUE;
+                mRc = MRFROM2SHORT(nHeight, nWidth);
+                return LONGFROMMR(mRc);
             }
-            return FALSE;
+            return 0L;
         }
     }
     wxWindow*                      pItem = FindItem(lId);
index 329b08b4375f1a1de71ee1322fb0f5ca23bf3d1c..67a5e1ad80274539f02f369d37dfe4fdfb38de04 100644 (file)
@@ -4,7 +4,7 @@ DATA MULTIPLE NONSHARED READWRITE LOADONCALL
 CODE LOADONCALL
 
 EXPORTS
-;From library:  H:\Dev\Wx2\WxWindows\lib\wx.lib
+;From library:  H:\DEV\WX2\WXWINDOWS\LIB\wx.lib
   ;From object file:  dummy.cpp
     ;PUBDEFs (Symbols available from object file):
       wxDummyChar
@@ -11902,6 +11902,8 @@ EXPORTS
       SetFont__14wxCheckListBoxFRC6wxFont
       ;wxCheckListBox::OnLeftClick(wxMouseEvent&)
       OnLeftClick__14wxCheckListBoxFR12wxMouseEvent
+      ;wxCheckListBox::OS2OnMeasure(void**)
+      OS2OnMeasure__14wxCheckListBoxFPPv
   ;From object file:  ..\os2\choice.cpp
     ;PUBDEFs (Symbols available from object file):
       ;wxChoice::DoGetItemClientData(int) const
@@ -14230,11 +14232,19 @@ EXPORTS
       GetValue__10wxSpinCtrlCFv
   ;From object file:  ..\os2\statbmp.cpp
     ;PUBDEFs (Symbols available from object file):
+      ;wxStaticBitmap::OnPaint(wxPaintEvent&)
+      OnPaint__14wxStaticBitmapFR12wxPaintEvent
+      ;wxStaticBitmap::sm_eventTable
+      sm_eventTable__14wxStaticBitmap
+      ;wxStaticBitmap::sm_eventTableEntries
+      sm_eventTableEntries__14wxStaticBitmap
       __vft14wxStaticBitmap8wxObject
       ;wxStaticBitmap::Free()
       Free__14wxStaticBitmapFv
       ;wxStaticBitmap::Create(wxWindow*,int,const wxGDIImage&,const wxPoint&,const wxSize&,long,const wxString&)
       Create__14wxStaticBitmapFP8wxWindowiRC10wxGDIImageRC7wxPointRC6wxSizelRC8wxString
+      ;wxStaticBitmap::GetEventTable() const
+      GetEventTable__14wxStaticBitmapCFv
       ;wxStaticBitmap::sm_classwxStaticBitmap
       sm_classwxStaticBitmap__14wxStaticBitmap
       ;wxStaticBitmap::SetImage(const wxGDIImage&)