]> git.saurik.com Git - wxWidgets.git/commitdiff
More updates for gdi
authorDavid Webster <Dave.Webster@bhmi.com>
Fri, 19 Apr 2002 21:40:05 +0000 (21:40 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Fri, 19 Apr 2002 21:40:05 +0000 (21:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/os2/dc.h
include/wx/os2/textctrl.h
include/wx/os2/window.h
src/os2/bitmap.cpp
src/os2/checkbox.cpp
src/os2/dc.cpp
src/os2/dcmemory.cpp
src/os2/textctrl.cpp
src/os2/wx23.def

index 87d00092a235072983cef044010bb0ca1f1aa40a..c3d383cd2a78796baa77bac5370df84d17a0799b 100644 (file)
@@ -202,7 +202,7 @@ public:
 #endif
 
 protected:
-    virtual void DoFloodFill( wxCoord         vX
+    virtual bool DoFloodFill( wxCoord         vX
                              ,wxCoord         vY
                              ,const wxColour& rCol
                              ,int             nStyle = wxFLOOD_SURFACE
index 8770ddbda25ab094d3cd2fbb3ab2f6e5ec216370..b7a701274ff621bc2ccf62be72d49a74c0f6499b 100644 (file)
@@ -118,6 +118,7 @@ public:
                               ,long lTo
                              );
     virtual void SetEditable(bool bEditable);
+    virtual void SetFocus(void);
     virtual void SetWindowStyleFlag(long lStyle);
 
     //
index 64e0c1e674d6a5205658cf647b5aca1e96a1c23e..33ac3ce48baf5fe63d9f922b58219e34add3ba44 100644 (file)
@@ -390,8 +390,12 @@ public:
     bool HandleSysCommand( WXWPARAM wParam
                           ,WXLPARAM lParam
                          );
-    bool HandlePaletteChanged();
+    bool HandlePaletteChanged(void);
+    bool HandleQueryNewPalette(void);
     bool HandleSysColorChange(void);
+    bool HandleDisplayChange(void);
+    bool HandleCaptureChanged(WXHWND hBainedCapture);
+
     bool HandleCtlColor(WXHBRUSH* hBrush);
     bool HandleSetFocus(WXHWND hWnd);
     bool HandleKillFocus(WXHWND hWnd);
index d722dd5ce8a1f20b5cb4c5646e06a0ccebc91545..3b86f1c669577a4ee9151f12cd870ed9c8f1fd69 100644 (file)
@@ -63,9 +63,10 @@ wxBitmapRefData::wxBitmapRefData()
 
 void wxBitmapRefData::Free()
 {
-    wxASSERT_MSG( !m_pSelectedInto,
-                  wxT("deleting bitmap still selected into wxMemoryDC") );
-
+    if ( m_pSelectedInto )
+    {
+        wxLogLastError("GpiDeleteBitmap(hbitmap)");
+    }
     if (m_hBitmap)
     {
         if (!::GpiDeleteBitmap((HBITMAP)m_hBitmap))
@@ -699,15 +700,6 @@ bool wxBitmap::CreateFromImage (
     //
     if (rImage.HasMask())
     {
-        hBmp = ::GpiCreateBitmap( hPS
-                                 ,&vHeader
-                                 ,0L
-                                 ,NULL
-                                 ,NULL
-                               );
-        memset(&vHeader, '\0', sizeof(BITMAPINFOHEADER2));
-        hBmpOld = ::GpiSetBitmap(hPS, hBmp);
-
         vHeader.cbFix     =  sizeof(BITMAPINFOHEADER2);
         vHeader.cx        = nWidth;
         vHeader.cy        = nHeight;
@@ -719,6 +711,7 @@ bool wxBitmap::CreateFromImage (
                                  ,NULL
                                  ,NULL
                                 );
+        hBmpOld = ::GpiSetBitmap(hPS, hBmp);
         if (nNumDIB == 1)
             nHeight = nBmpHeight;
         else
@@ -905,6 +898,7 @@ wxImage wxBitmap::ConvertToImage() const
                                 ,NULL
                                 ,NULL
                                );
+    ::GpiSetBitmap(hPSMem, hBitmap);
     lScans = ::GpiQueryBitmapBits( hPSMem
                                   ,0L
                                   ,(LONG)nHeight
@@ -931,6 +925,7 @@ wxImage wxBitmap::ConvertToImage() const
         }
         ptbits += nPadding;
     }
+    ::GpiSetBitmap(hPSMem, NULLHANDLE);
 
     //
     // Similarly, set data according to the possible mask bitmap
@@ -956,12 +951,14 @@ wxImage wxBitmap::ConvertToImage() const
                                                           );
         ::GpiSetColor(hMemPS, OS2RGB(0, 0, 0));
         ::GpiSetBackColor(hMemPS, OS2RGB(255, 255, 255) );
+        ::GpiSetBitmap(hMemPS, hBitmap);
         ::GpiQueryBitmapBits( hPSMem
                              ,0L
                              ,(LONG)nHeight
                              ,(PBYTE)lpBits
                              ,&vDIBInfo
                             );
+        ::GpiSetBitmap(hMemPS, NULLHANDLE);
         ::GpiDestroyPS(hMemPS);
         ::DevCloseDC(hMemDC);
 
@@ -1041,7 +1038,7 @@ wxBitmap wxBitmap::GetSubBitmap(
     HPS                             hPSSrc = ::GpiCreatePS(vHabmain, hDCSrc, &vSize, PU_PELS | GPIA_ASSOC);
     HPS                             hPSDst = ::GpiCreatePS(vHabmain, hDCDst, &vSize, PU_PELS | GPIA_ASSOC);
     POINTL                          vPoint[4] = { 0, 0, rRect.width, rRect.height,
-                                                  rRect.x, rRect.y
+                                                  rRect.x, rRect.y,
                                                   rRect.x + rRect.width, rRect.y + rRect.height
                                                 };
 
index 720eff958e818448211d80c52e614bbd08cd97ac..40eac8c61495ed9172a89239a1c52f9791778518 100644 (file)
@@ -70,7 +70,7 @@ bool wxCheckBox::Create(
                        ,rSize
                        ,lStyle
 #if wxUSE_VALIDATORS
-                       ,wxDefaultValidator
+                       ,rValidator
 #endif
                        ,rsName
                       ))
index 97828b4acfd8ba1635e8bf8601249115700a508d..0d89f00d9f0b02c55ac1b338699c77c8df12034c 100644 (file)
@@ -557,7 +557,7 @@ void wxDC::Clear()
     ::GpiErase(m_hPS);
 } // end of wxDC::Clear
 
-void wxDC::DoFloodFill(
+bool wxDC::DoFloodFill(
   wxCoord                           vX
 , wxCoord                           vY
 , const wxColour&                   rCol
@@ -567,6 +567,8 @@ void wxDC::DoFloodFill(
     POINTL                          vPtlPos;
     LONG                            lColor;
     LONG                            lOptions;
+    LONG                            lHits;
+    bool                            bSuccess = FALSE;
 
     vPtlPos.x = vX;             // Loads x-coordinate
     vPtlPos.y = OS2Y(vY,0);     // Loads y-coordinate
@@ -576,8 +578,9 @@ void wxDC::DoFloodFill(
     if(wxFLOOD_SURFACE == nStyle)
         lOptions = FF_SURFACE;
 
-    ::GpiFloodFill(m_hPS, lOptions, lColor);
-
+    if ((lHits = ::GpiFloodFill(m_hPS, lOptions, lColor)) != GPI_ERROR)
+        bSuccess = TRUE;
+    return TRUE;
 } // end of wxDC::DoFloodFill
 
 bool wxDC::DoGetPixel(
@@ -975,7 +978,14 @@ void wxDC::DoDrawRectangle(
     LONG                            lBorderColor;
     int                             nIsTRANSPARENT = 0;
 
-    vY = OS2Y(vY,vHeight);
+    //
+    // Might be a memory DC with no Paint rect
+    //
+    if (!(m_vRclPaint.yTop == 0 &&
+          m_vRclPaint.yBottom == 0 &&
+          m_vRclPaint.xRight == 0 &&
+          m_vRclPaint.xLeft == 0))
+        vY = OS2Y(vY,vHeight);
 
     wxCoord                         vX2 = vX + vWidth;
     wxCoord                         vY2 = vY + vHeight;
@@ -1030,6 +1040,17 @@ void wxDC::DoDrawRectangle(
                  ,0L
                  ,0L
                 );
+        //
+        // Debug testing:
+        //
+        for (int i = 0; i < vHeight; i++)
+        {
+            for (int j = 0; j < vHeight; j++)
+            {
+                vPoint[0].x = j; vPoint[0].y = i;
+                lColor = ::GpiQueryPel(m_hPS, &vPoint[0]);
+            }
+        }
     }
     CalcBoundingBox(vX, vY);
     CalcBoundingBox(vX2, vY2);
index a6af12eb9090e97f42e27fc0da6c0d30bccb2915..456e93e3d36c259529495c3042361f4d84b3365f 100644 (file)
@@ -55,6 +55,7 @@ void wxMemoryDC::Init()
         // DrawText() to OPAQUE as required, otherwise always TRANSPARENT
         ::GpiSetBackMix( GetHPS(), BM_LEAVEALONE );
     }
+    memset(&m_vRclPaint, 0, sizeof(m_vRclPaint));
 } // end of wxMemoryDC::Init
 
 bool wxMemoryDC::CreateCompatible(
@@ -147,7 +148,7 @@ void wxMemoryDC::SelectObject(
 
     m_vSelectedBitmap = rBitmap;
 
-    WXHBITMAP                       hBmp = m_vSelectedBitmap.GetHBITMAP();
+    WXHBITMAP                       hBmp = rBitmap.GetHBITMAP();
 
     if (!hBmp)
         return;
index b99d13006c242d2f9bdbcbcee4bacb971bb6f0d4..f375a3888662a05ae03507ebf7dc37eaf327b822 100644 (file)
@@ -1066,6 +1066,15 @@ void wxTextCtrl::OnChar(
     rEvent.Skip();
 } // end of wxTextCtrl::OnChar
 
+void wxTextCtrl::SetFocus()
+{
+    wxTextCtrlBase::SetFocus();
+    if ( !HasFlag(wxTE_MULTILINE) )
+    {
+        SetSelection(-1, -1);
+    }
+} // end of wxTextCtrl::SetFocus
+
 bool wxTextCtrl::OS2Command(
   WXUINT                            uParam
 , WXWORD                            WXUNUSED(vId)
index c4f7f11547cb50d9bd35a270c42bf740416e5e05..4fdc09a93db16dace9573fd8e509db9857fab8f4 100644 (file)
@@ -4,7 +4,7 @@ DATA MULTIPLE NONSHARED READWRITE LOADONCALL
 CODE LOADONCALL
 
 EXPORTS
-;From library:  F:\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
@@ -1925,7 +1925,7 @@ EXPORTS
       wxEVT_NC_LEFT_DCLICK
       wxEVT_INIT_DIALOG
       wxEVT_COMMAND_SET_FOCUS
-  ;From object file:  F:\DEV\WX2\WXWINDOWS\src\common\extended.c
+  ;From object file:  H:\DEV\WX2\WXWINDOWS\src\common\extended.c
     ;PUBDEFs (Symbols available from object file):
       ConvertToIeeeExtended
       ConvertFromIeeeExtended
@@ -6027,7 +6027,7 @@ EXPORTS
       Read32__17wxTextInputStreamFv
       ;wxTextInputStream::SkipIfEndOfLine(char)
       SkipIfEndOfLine__17wxTextInputStreamFc
-  ;From object file:  F:\DEV\WX2\WXWINDOWS\src\common\unzip.c
+  ;From object file:  H:\DEV\WX2\WXWINDOWS\src\common\unzip.c
     ;PUBDEFs (Symbols available from object file):
       unzReadCurrentFile
       unzGetCurrentFileInfo
@@ -6240,6 +6240,8 @@ EXPORTS
       __ct__15wxTextValidatorFlP8wxString
       ;wxTextValidator::Validate(wxWindow*)
       Validate__15wxTextValidatorFP8wxWindow
+      ;wxTextValidator::IsNotInCharExcludeList(const wxString&)
+      IsNotInCharExcludeList__15wxTextValidatorFRC8wxString
       ;wxConstructorForwxTextValidator()
       wxConstructorForwxTextValidator__Fv
       ;wxTextValidator::sm_eventTable
@@ -6249,6 +6251,8 @@ EXPORTS
       ;wxTextValidator::SetIncludeList(const wxStringList&)
       SetIncludeList__15wxTextValidatorFRC12wxStringList
       __vft15wxTextValidator8wxObject
+      ;wxTextValidator::IsInCharIncludeList(const wxString&)
+      IsInCharIncludeList__15wxTextValidatorFRC8wxString
       ;wxTextValidator::SetExcludeList(const wxStringList&)
       SetExcludeList__15wxTextValidatorFRC12wxStringList
       ;wxTextValidator::OnChar(wxKeyEvent&)
@@ -7927,7 +7931,8 @@ EXPORTS
       wxConstructorForwxGridEditorCreatedEvent__Fv
       ;wxConstructorForwxGridCornerLabelWindow()
       wxConstructorForwxGridCornerLabelWindow__Fv
-      __vft24wxGridCellStringRenderer16wxGridCellWorker
+      __vft22wxGridCellNumberEditor21wxClientDataContainer
+      __vft22wxGridCellBoolRenderer21wxClientDataContainer
       ;wxGrid::~wxGrid()
       __dt__6wxGridFv
       ;wxGridCellWithAttrArray::~wxGridCellWithAttrArray()
@@ -8118,9 +8123,11 @@ EXPORTS
       ;wxGridCellBoolRenderer::ms_sizeCheckMark
       ms_sizeCheckMark__22wxGridCellBoolRenderer
       __vft6wxGrid14wxScrollHelper
-      __vft24wxGridCellNumberRenderer16wxGridCellWorker
-      __vft22wxGridCellBoolRenderer16wxGridCellWorker
-      __vft20wxGridCellTextEditor16wxGridCellWorker
+      __vft22wxGridCellChoiceEditor21wxClientDataContainer
+      __vft22wxGridCellAttrProvider21wxClientDataContainer
+      __vft21wxGridCellFloatEditor21wxClientDataContainer
+      __vft20wxGridCellTextEditor21wxClientDataContainer
+      __vft15wxGridTableBase21wxClientDataContainer
       ;wxGridCellAttrProvider::~wxGridCellAttrProvider()
       __dt__22wxGridCellAttrProviderFv
       ;wxGridTypeRegistry::~wxGridTypeRegistry()
@@ -8315,11 +8322,9 @@ EXPORTS
       wxConstructorForwxGridRowLabelWindow__Fv
       ;wxGridCellEditorEvtHandler::sm_classwxGridCellEditorEvtHandler
       sm_classwxGridCellEditorEvtHandler__26wxGridCellEditorEvtHandler
-      __vft22wxGridCellNumberEditor16wxGridCellWorker
-      __vft22wxGridCellAttrProvider
-      __vft21wxGridCellFloatEditor16wxGridCellWorker
-      __vft20wxGridCellBoolEditor16wxGridCellWorker
-      __vft16wxGridCellWorker
+      __vft24wxGridCellStringRenderer21wxClientDataContainer
+      __vft24wxGridCellNumberRenderer21wxClientDataContainer
+      __vft20wxGridCellBoolEditor21wxClientDataContainer
       ;wxGridStringTable::~wxGridStringTable()
       __dt__17wxGridStringTableFv
       ;wxGridWindow::~wxGridWindow()
@@ -8503,7 +8508,8 @@ EXPORTS
       __dt__16wxGridCellEditorFv
       ;wxConstructorForwxGridStringTable()
       wxConstructorForwxGridStringTable__Fv
-      __vft16wxGridCellEditor16wxGridCellWorker
+      __vft17wxGridStringTable21wxClientDataContainer
+      __vft16wxGridCellEditor21wxClientDataContainer
       ;wxGridStringTable::wxGridStringTable()
       __ct__17wxGridStringTableFv
       ;wxGrid::ShowCellEditControl()
@@ -8689,8 +8695,8 @@ EXPORTS
       wxConstructorForwxGridColLabelWindow__Fv
       ;wxGridCellEditorEvtHandler::sm_eventTableEntries
       sm_eventTableEntries__26wxGridCellEditorEvtHandler
-      __vft23wxGridCellFloatRenderer16wxGridCellWorker
-      __vft22wxGridCellChoiceEditor16wxGridCellWorker
+      __vft23wxGridCellFloatRenderer21wxClientDataContainer
+      __vft16wxGridCellWorker21wxClientDataContainer
       ;wxGridRowOrColAttrData::~wxGridRowOrColAttrData()
       __dt__22wxGridRowOrColAttrDataFv
       ;wxGridCellCoordsArray::~wxGridCellCoordsArray()
@@ -8779,11 +8785,12 @@ EXPORTS
       Draw__22wxGridCellEnumRendererFR6wxGridR14wxGridCellAttrR4wxDCRC6wxRectiT5Ul
       ;wxGridCellDateTimeRenderer::wxGridCellDateTimeRenderer(wxString,wxString)
       __ct__26wxGridCellDateTimeRendererF8wxStringT1
+      __vft20wxGridCellEnumEditor21wxClientDataContainer
       ;wxGridCellDateTimeRenderer::Draw(wxGrid&,wxGridCellAttr&,wxDC&,const wxRect&,int,int,unsigned long)
       Draw__26wxGridCellDateTimeRendererFR6wxGridR14wxGridCellAttrR4wxDCRC6wxRectiT5Ul
       ;wxGridCellAutoWrapStringRenderer::GetBestSize(wxGrid&,wxGridCellAttr&,wxDC&,int,int)
       GetBestSize__32wxGridCellAutoWrapStringRendererFR6wxGridR14wxGridCellAttrR4wxDCiT4
-      __vft32wxGridCellAutoWrapStringRenderer16wxGridCellWorker
+      __vft22wxGridCellEnumRenderer21wxClientDataContainer
       ;wxGridCellDateTimeRenderer::SetParameters(const wxString&)
       SetParameters__26wxGridCellDateTimeRendererFRC8wxString
       ;wxGridCellEnumRenderer::SetParameters(const wxString&)
@@ -8796,8 +8803,8 @@ EXPORTS
       Draw__32wxGridCellAutoWrapStringRendererFR6wxGridR14wxGridCellAttrR4wxDCRC6wxRectiT5Ul
       ;wxGridCellDateTimeRenderer::Clone() const
       Clone__26wxGridCellDateTimeRendererCFv
-      __vft22wxGridCellEnumRenderer16wxGridCellWorker
-      __vft20wxGridCellEnumEditor16wxGridCellWorker
+      __vft30wxGridCellAutoWrapStringEditor21wxClientDataContainer
+      __vft26wxGridCellDateTimeRenderer21wxClientDataContainer
       ;wxGridCellDateTimeRenderer::GetString(wxGrid&,int,int)
       GetString__26wxGridCellDateTimeRendererFR6wxGridiT2
       ;wxGridCellEnumRenderer::GetString(wxGrid&,int,int)
@@ -8814,8 +8821,7 @@ EXPORTS
       GetTextLines__32wxGridCellAutoWrapStringRendererFR6wxGridR4wxDCR14wxGridCellAttrRC6wxRectiT5
       ;wxGridCellEnumRenderer::Clone() const
       Clone__22wxGridCellEnumRendererCFv
-      __vft30wxGridCellAutoWrapStringEditor16wxGridCellWorker
-      __vft26wxGridCellDateTimeRenderer16wxGridCellWorker
+      __vft32wxGridCellAutoWrapStringRenderer21wxClientDataContainer
   ;From object file:  ..\generic\gridsel.cpp
     ;PUBDEFs (Symbols available from object file):
       ;wxGridSelection::SelectBlock(int,int,int,int,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long)
@@ -14271,6 +14277,8 @@ EXPORTS
       Copy__10wxTextCtrlFv
       ;wxTextCtrl::SetStyle(long,long,const wxTextAttr&)
       SetStyle__10wxTextCtrlFlT1RC10wxTextAttr
+      ;wxTextCtrl::SetFocus()
+      SetFocus__10wxTextCtrlFv
       ;wxTextCtrl::CanRedo() const
       CanRedo__10wxTextCtrlCFv
       ;wxTextCtrl::OS2GetStyle(long,unsigned long*) const
@@ -14763,6 +14771,8 @@ EXPORTS
       HandleEraseBkgnd__8wxWindowFUl
       ;wxWindow::HandleCreate(void*,unsigned long*)
       HandleCreate__8wxWindowFPvPUl
+      ;wxWindow::HandleChar(void*,void*,unsigned long)
+      HandleChar__8wxWindowFPvT1Ul
       ;wxWindow::DoGetPosition(int*,int*) const
       DoGetPosition__8wxWindowCFPiT1
       ;wxCharCodeOS2ToWX(int)
@@ -14987,8 +14997,6 @@ EXPORTS
       FindItemByHWND__8wxWindowCFUlT1
       ;wxWindow::HandleKeyUp(void*,void*)
       HandleKeyUp__8wxWindowFPvT1
-      ;wxWindow::HandleChar(void*,void*,unsigned long)
-      HandleChar__8wxWindowFPvT1Ul
       ;wxWindow::DoMoveWindow(int,int,int,int)
       DoMoveWindow__8wxWindowFiN31
       ;wxWindow::DoClientToScreen(int*,int*) const