From: David Webster Date: Fri, 22 Feb 2002 23:30:31 +0000 (+0000) Subject: Style updates X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b9b1d6c8ddc0e923c368529efb0e011edeec44e6 Style updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/os2/button.h b/include/wx/os2/button.h index d4f92f470d..ebfe1c1a35 100644 --- a/include/wx/os2/button.h +++ b/include/wx/os2/button.h @@ -80,8 +80,11 @@ class WXDLLEXPORT wxButton: public wxButtonBase protected: - bool SendClickEvent(void); - virtual wxSize DoGetBestSize(void) const; + bool SendClickEvent(void); + virtual wxSize DoGetBestSize(void) const; + virtual WXDWORD OS2GetStyle( long style + ,WXDWORD* exstyle + ) const; private: DECLARE_DYNAMIC_CLASS(wxButton) }; // end of CLASS wxButton diff --git a/include/wx/os2/control.h b/include/wx/os2/control.h index 661efc7b06..55602617a4 100644 --- a/include/wx/os2/control.h +++ b/include/wx/os2/control.h @@ -112,15 +112,14 @@ public: virtual wxSize DoGetBestSize(void) const; - bool OS2CreateControl( wxWindow* pParent - ,wxWindowID lId - ,const wxPoint& rPos - ,const wxSize& rSize - ,long lStyle -#if wxUSE_VALIDATORS - ,const wxValidator& rValidator -#endif - ,const wxString& rsName + // + // Create the control of the given PM class + // + bool OS2CreateControl( const wxChar* zClassname + ,const wxString& rsLabel + ,const wxPoint& rPos + ,const wxSize& rSize + ,long lStyle ); // // Create the control of the given class with the given style, returns FALSE @@ -135,10 +134,11 @@ public: ); // - // Determine the extended styles combination for this window (may slightly - // modify styl parameter) + // Default style for the control include WS_TABSTOP if it AcceptsFocus() // - WXDWORD GetExStyle(WXDWORD& rStyle) const; + virtual WXDWORD OS2GetStyle( long lStyle + ,WXDWORD* pdwExstyle + ) const; inline int GetXComp(void) const {return m_nXComp;} inline int GetYComp(void) const {return m_nYComp;} diff --git a/include/wx/os2/cursor.h b/include/wx/os2/cursor.h index e261d2cc07..688539c46d 100644 --- a/include/wx/os2/cursor.h +++ b/include/wx/os2/cursor.h @@ -39,6 +39,7 @@ public: // Copy constructors inline wxCursor(const wxCursor& cursor) { Ref(cursor); } + wxCursor(const wxImage& rImage); wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, const char maskBits[] = NULL); diff --git a/include/wx/os2/statline.h b/include/wx/os2/statline.h index a0142e87b6..3b2ff75484 100644 --- a/include/wx/os2/statline.h +++ b/include/wx/os2/statline.h @@ -74,6 +74,13 @@ protected: inline wxSize DoGetBestSize(void) const { return (AdjustSize(wxDefaultSize)); } + // + // Usually overridden base class virtuals + // + virtual WXDWORD OS2GetStyle( long lStyle + ,WXDWORD* pdwExstyle + ) const; + private: DECLARE_DYNAMIC_CLASS(wxStaticLine) }; // end of CLASS wxStaticLine diff --git a/include/wx/os2/textctrl.h b/include/wx/os2/textctrl.h index b9f7a81a44..48800d842f 100644 --- a/include/wx/os2/textctrl.h +++ b/include/wx/os2/textctrl.h @@ -117,6 +117,7 @@ public: ,long lTo ); virtual void SetEditable(bool bEditable); + virtual void SetWindowStyleFlag(long lStyle); // // Implementation from now on @@ -171,6 +172,9 @@ protected: virtual wxSize DoGetBestSize(void) const; virtual bool OS2ShouldPreProcessMessage(WXMSG* pMsg); + virtual WXDWORD OS2GetStyle( long lStyle + ,WXDWORD* dwExstyle + ) const; private: bool m_bIsMLE; DECLARE_EVENT_TABLE() diff --git a/include/wx/os2/toplevel.h b/include/wx/os2/toplevel.h index a54b9d9602..c52efb6642 100644 --- a/include/wx/os2/toplevel.h +++ b/include/wx/os2/toplevel.h @@ -124,13 +124,11 @@ protected: ) const; // - // Get the OS/2 window flags corresponding to wxWindows ones + // Translate wxWindows flags into OS flags // - // The functions returns the flags (WS_XXX) directly and puts the ext - // (WS_EX_XXX) flags into the provided pointer if not NULL - // - long OS2GetCreateWindowFlags(long* lExflags) const; - + virtual WXDWORD OS2GetStyle( long lFlag + ,WXDWORD* pdwExstyle + ) const; // // Is the frame currently iconized? // diff --git a/include/wx/os2/window.h b/include/wx/os2/window.h index 3580d86bca..bffba1d0b3 100644 --- a/include/wx/os2/window.h +++ b/include/wx/os2/window.h @@ -106,6 +106,7 @@ public: virtual void Freeze(void); virtual void Update(void); virtual void Thaw(void); + virtual void SetWindowStyleFlag(long lStyle); virtual bool SetCursor(const wxCursor& rCursor); virtual bool SetFont(const wxFont& rFont); virtual int GetCharHeight(void) const; @@ -253,6 +254,23 @@ public: // PM only: TRUE if this control is part of the main control virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; }; + // translate wxWindows style flags for this control into the PM style + // and optional extended style for the corresponding native control + // + // this is the function that should be overridden in the derived classes, + // but you will mostly use OS2GetCreateWindowFlags() below + virtual WXDWORD OS2GetStyle( long lFlags + ,WXDWORD* pdwExstyle = NULL + ) const; + + // get the MSW window flags corresponding to wxWindows ones + // + // the functions returns the flags (WS_XXX) directly and puts the ext + // (WS_EX_XXX) flags into the provided pointer if not NULL + WXDWORD OS2GetCreateWindowFlags(WXDWORD* pdwExflags = NULL) const + { return OS2GetStyle(GetWindowStyle(), pdwExflags); } + + // returns TRUE if the window has been created bool OS2Create( PSZ zClass ,const char* zTitle @@ -526,7 +544,7 @@ protected: virtual void DoCaptureMouse(void); virtual void DoReleaseMouse(void); - + // move the window to the specified location and resize it: this is called // from both DoSetSize() and DoSetClientSize() and would usually just call // ::WinSetWindowPos() except for composite controls which will want to arrange diff --git a/src/os2/choice.cpp b/src/os2/choice.cpp index a39235977d..a1cdd262b1 100644 --- a/src/os2/choice.cpp +++ b/src/os2/choice.cpp @@ -39,16 +39,16 @@ bool wxChoice::Create( { long lSstyle; - if (!OS2CreateControl( pParent - ,vId - ,rPos - ,rSize - ,lStyle + if (!CreateControl( pParent + ,vId + ,rPos + ,rSize + ,lStyle #if wxUSE_VALIDATORS - ,rValidator + ,rValidator #endif - ,rsName - )) + ,rsName + )) return FALSE; lSstyle = CBS_DROPDOWNLIST | WS_TABSTOP | diff --git a/src/os2/combobox.cpp b/src/os2/combobox.cpp index 8b0980688b..bea8d0e3de 100644 --- a/src/os2/combobox.cpp +++ b/src/os2/combobox.cpp @@ -102,7 +102,7 @@ bool wxComboBox::Create( ) { - if (!OS2CreateControl( pParent + if (!CreateControl( pParent ,vId ,rPos ,rSize diff --git a/src/os2/control.cpp b/src/os2/control.cpp index 3ed6d787a0..61fd7206cf 100644 --- a/src/os2/control.cpp +++ b/src/os2/control.cpp @@ -74,35 +74,25 @@ wxControl::~wxControl() } bool wxControl::OS2CreateControl( - wxWindow* pParent -, wxWindowID vId + const wxChar* zClassname +, const wxString& rsLabel , const wxPoint& rPos , const wxSize& rSize , long lStyle -#if wxUSE_VALIDATORS -, const wxValidator& rValidator -#endif -, const wxString& rsName ) { - // - // Even if it's possible to create controls without parents in some port, - // it should surely be discouraged because it doesn't work at all under - // Windows - // - if (!CreateBase( pParent - ,vId - ,rPos - ,rSize - ,lStyle -#if wxUSE_VALIDATORS - ,rValidator -#endif - ,rsName - )) - return FALSE; - pParent->AddChild(this); - return TRUE; + WXDWORD dwExstyle; + WXDWORD dwStyle = OS2GetStyle( lStyle + ,&dwExstyle + ); + + return OS2CreateControl( zClassname + ,dwStyle + ,rPos + ,rSize + ,rsLabel + ,dwExstyle + ); } // end of wxControl::OS2CreateControl bool wxControl::OS2CreateControl( @@ -114,17 +104,23 @@ bool wxControl::OS2CreateControl( , WXDWORD dwExstyle ) { - int nX = rPos.x == -1 ? 0 : rPos.x; - int nY = rPos.y == -1 ? 0 : rPos.y; - int nW = rSize.x == -1 ? 0 : rSize.x; - int nH = rSize.y == -1 ? 0 : rSize.y; + bool bWant3D = FALSE; + int nX = rPos.x == -1 ? 0 : rPos.x; + int nY = rPos.y == -1 ? 0 : rPos.y; + int nW = rSize.x == -1 ? 0 : rSize.x; + int nH = rSize.y == -1 ? 0 : rSize.y; // // Doesn't do anything at all under OS/2 // if (dwExstyle == (WXDWORD)-1) { - dwExstyle = GetExStyle(dwStyle); + dwExstyle = Determine3DEffects(WS_EX_CLIENTEDGE, &bWant3D); } + // + // All controls should have these styles (wxWindows creates all controls + // visible by default) + // + dwStyle |= WS_VISIBLE; wxWindow* pParent = GetParent(); PSZ zClass; @@ -237,17 +233,21 @@ void wxControl::OnEraseBackground( ::WinFillRect(hPS, &vRect, GetBackgroundColour().GetPixel()); } // end of wxControl::OnEraseBackground -WXDWORD wxControl::GetExStyle( - WXDWORD& rStyle +WXDWORD wxControl::OS2GetStyle( + long lStyle +, WXDWORD* pdwExstyle ) const { - // - // Meaningless under OS/2, just return what was sent - // - WXDWORD exStyle = rStyle; + long dwStyle = wxWindow::OS2GetStyle( lStyle + ,pdwExstyle + ); - return exStyle; -} // end of wxControl::GetExStyle + if (AcceptsFocus()) + { + dwStyle |= WS_TABSTOP; + } + return dwStyle; +} // end of wxControl::OS2GetStyle // --------------------------------------------------------------------------- // global functions diff --git a/src/os2/cursor.cpp b/src/os2/cursor.cpp index 6490f0279e..df148e17a3 100644 --- a/src/os2/cursor.cpp +++ b/src/os2/cursor.cpp @@ -23,6 +23,7 @@ #endif #include "wx/os2/private.h" +#include "wx/image.h" #include "assert.h" @@ -52,6 +53,39 @@ wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSE { } +wxCursor::wxCursor( + const wxImage& rImage +) +{ + wxImage vImage32 = rImage.Scale(32,32); + int nWidth = vImage32.GetWidth(); + int nHeight = vImage32.GetHeight(); + + // + // Need a bitmap handle somehow + // + HBITMAP hBitmap = wxBitmap(vImage32).GetHBITMAP(); + int nHotSpotX = vImage32.GetOptionInt(wxCUR_HOTSPOT_X); + int nHotSpotY = vImage32.GetOptionInt(wxCUR_HOTSPOT_Y); + + if (nHotSpotX < 0 || nHotSpotX >= nWidth) + nHotSpotX = 0; + if (nHotSpotY < 0 || nHotSpotY >= nHeight) + nHotSpotY = 0; + + + wxCursorRefData* pRefData = new wxCursorRefData; + + m_refData = pRefData; + pRefData->m_hCursor = (WXHCURSOR) ::WinCreatePointer( HWND_DESKTOP + ,hBitmap + ,TRUE + ,nHotSpotY + ,nHotSpotX + ); + +} // end of wxCursor::wxCursor + wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY) { m_refData = new wxCursorRefData; diff --git a/src/os2/makefile.va b/src/os2/makefile.va index 3ab391d99e..e8c55fb4d0 100644 --- a/src/os2/makefile.va +++ b/src/os2/makefile.va @@ -1165,7 +1165,7 @@ clean_tiff: nmake -f makefile.va clean cd $(WXDIR)\src\os2 -clean: $(PERIPH_CLEAN_TARGET) clean_png clean_zlib clean_jpeg clean_xpm clean_tiff +clean: $(PERIPH_CLEAN_TARGET) clean_png clean_zlib clean_jpeg clean_tiff erase /N $(GENDIR)\$D\*.obj erase /N $(COMMDIR)\$D\*.obj erase /N $(HTMLDIR)\$D\*.obj diff --git a/src/os2/radiobox.cpp b/src/os2/radiobox.cpp index 8fa3845bae..4e97989340 100644 --- a/src/os2/radiobox.cpp +++ b/src/os2/radiobox.cpp @@ -283,16 +283,16 @@ bool wxRadioBox::Create( // // Common initialization // - if (!OS2CreateControl( pParent - ,vId - ,rPos - ,rSize - ,lStyle + if (!CreateControl( pParent + ,vId + ,rPos + ,rSize + ,lStyle #if wxUSE_VALIDATORS - ,rVal + ,rVal #endif - ,rsName - )) + ,rsName + )) diff --git a/src/os2/statbox.cpp b/src/os2/statbox.cpp index 61f5db74d6..571107c39b 100644 --- a/src/os2/statbox.cpp +++ b/src/os2/statbox.cpp @@ -34,16 +34,16 @@ bool wxStaticBox::Create( , const wxString& rsName ) { - if(!OS2CreateControl( pParent - ,vId - ,rPos - ,rSize - ,lStyle + if(!CreateControl( pParent + ,vId + ,rPos + ,rSize + ,lStyle #if wxUSE_VALIDATORS - ,wxDefaultValidator + ,wxDefaultValidator #endif - ,rsName - )) + ,rsName + )) { return FALSE; } @@ -61,6 +61,11 @@ bool wxStaticBox::Create( return FALSE; } + // + // To be transparent we should have the same colour as the parent as well + // + SetBackgroundColour(GetParent()->GetBackgroundColour()); + wxColour vColour; vColour.Set(wxString("BLACK")); diff --git a/src/os2/statline.cpp b/src/os2/statline.cpp index a91dfa300b..effb7de350 100644 --- a/src/os2/statline.cpp +++ b/src/os2/statline.cpp @@ -49,46 +49,42 @@ bool wxStaticLine::Create( , const wxString& rsName ) { - if (!CreateBase( pParent - ,vId - ,rPos - ,rSize - ,lStyle - ,wxDefaultValidator - ,rsName - )) - return FALSE; - - pParent->AddChild(this); - - wxSize vSizeReal = AdjustSize(rSize); + wxSize vSize = AdjustSize(rSize); - m_hWnd = (WXHWND)::WinCreateWindow( GetWinHwnd(pParent) - ,WC_STATIC - ,"" - ,WS_VISIBLE | SS_TEXT | DT_VCENTER | DT_CENTER - ,0 - ,0 - ,0 - ,0 - ,GetWinHwnd(pParent) - ,HWND_TOP - ,(ULONG)m_windowId - ,NULL - ,NULL - ); - if ( !m_hWnd ) - { - wxLogDebug(wxT("Failed to create static control")); + if ( !CreateControl( pParent + ,vId + ,rPos + ,vSize + ,lStyle + ,wxDefaultValidator + ,rsName + )) return FALSE; - } - SubclassWin(m_hWnd); - SetSize( rPos.x - ,rPos.y - ,rSize.x - ,rSize.y - ); - return TRUE; + return OS2CreateControl( _T("STATIC") + ,_T("") + ,rPos + ,vSize + ,lStyle + ); } // end of wxStaticLine::Create +WXDWORD wxStaticLine::OS2GetStyle( + long lStyle +, WXDWORD* pdwExstyle +) const +{ + // + // We never have border + // + lStyle &= ~wxBORDER_MASK; + lStyle |= wxBORDER_NONE; + + WXDWORD dwStyle = wxControl::OS2GetStyle( lStyle + ,pdwExstyle + ); + // + // Add our default styles + // + return dwStyle | WS_CLIPSIBLINGS; +} #endif // wxUSE_STATLINE diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index 87c8150bac..c663907618 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -252,6 +252,58 @@ void wxTextCtrl::AdoptAttributesFromHWND() } } // end of wxTextCtrl::AdoptAttributesFromHWND +WXDWORD wxTextCtrl::OS2GetStyle( + long lStyle +, WXDWORD* pdwExstyle +) const +{ + // + // Default border for the text controls is the sunken one + // + if ((lStyle & wxBORDER_MASK) == wxBORDER_DEFAULT ) + { + lStyle |= wxBORDER_SUNKEN; + } + + long dwStyle = wxControl::OS2GetStyle( lStyle + ,pdwExstyle + ); + + dwStyle = WS_VISIBLE | WS_TABSTOP; + + // + // Single and multiline edit fields are two different controls in PM + // + if ( m_windowStyle & wxTE_MULTILINE ) + { + dwStyle |= MLS_BORDER | MLS_WORDWRAP; + if ((m_windowStyle & wxTE_NO_VSCROLL) == 0) + dwStyle |= MLS_VSCROLL; + if (m_windowStyle & wxHSCROLL) + dwStyle |= MLS_HSCROLL; + if (m_windowStyle & wxTE_READONLY) + dwStyle |= MLS_READONLY; + } + else + { + dwStyle |= ES_LEFT | ES_AUTOSCROLL | ES_MARGIN; + if (m_windowStyle & wxHSCROLL) + dwStyle |= ES_AUTOSCROLL; + if (m_windowStyle & wxTE_READONLY) + dwStyle |= ES_READONLY; + if (m_windowStyle & wxTE_PASSWORD) // hidden input + dwStyle |= ES_UNREADABLE; + } + return dwStyle; +} // end of wxTextCtrl::OS2GetStyle + +void wxTextCtrl::SetWindowStyleFlag( + long lStyle +) +{ + wxControl::SetWindowStyleFlag(lStyle); +} // end of wxTextCtrl::SetWindowStyleFlag + void wxTextCtrl::SetupColours() { wxColour vBkgndColour; diff --git a/src/os2/toplevel.cpp b/src/os2/toplevel.cpp index a24707edd1..a77cb0a375 100644 --- a/src/os2/toplevel.cpp +++ b/src/os2/toplevel.cpp @@ -112,22 +112,24 @@ void wxTopLevelWindowOS2::Init() memset(&m_vSwpClient, 0, sizeof(SWP)); } // end of wxTopLevelWindowIOS2::Init -long wxTopLevelWindowOS2::OS2GetCreateWindowFlags( - long* plExflags +WXDWORD wxTopLevelWindowOS2::OS2GetStyle( + long lStyle +, WXDWORD* pdwExflags ) const { - long lStyle = GetWindowStyle(); - long lMsflags = 0; + long lMsflags = wxWindow::OS2GetStyle( (lStyle & ~wxBORDER_MASK) | wxBORDER_NONE + ,pdwExflags + ); if (lStyle == wxDEFAULT_FRAME_STYLE) - lMsflags = FCF_SIZEBORDER | FCF_TITLEBAR | FCF_SYSMENU | - FCF_MINMAX | FCF_TASKLIST; + lMsflags |= FCF_SIZEBORDER | FCF_TITLEBAR | FCF_SYSMENU | + FCF_MINMAX | FCF_TASKLIST; else { if ((lStyle & wxCAPTION) == wxCAPTION) - lMsflags = FCF_TASKLIST; + lMsflags |= FCF_TASKLIST; else - lMsflags = FCF_NOMOVEWITHOWNER; + lMsflags |= FCF_NOMOVEWITHOWNER; if ((lStyle & wxVSCROLL) == wxVSCROLL) lMsflags |= FCF_VERTSCROLL; @@ -156,7 +158,7 @@ long wxTopLevelWindowOS2::OS2GetCreateWindowFlags( if ((lStyle & wxTHICK_FRAME) == 0) lMsflags |= FCF_BORDER; if (lStyle & wxFRAME_TOOL_WINDOW) - *plExflags = kFrameToolWindow; + *pdwExflags = kFrameToolWindow; if (lStyle & wxSTAY_ON_TOP) lMsflags |= FCF_SYSMODAL; @@ -303,8 +305,8 @@ bool wxTopLevelWindowOS2::CreateFrame( , const wxSize& rSize ) { - long lExflags; - long lFlags = OS2GetCreateWindowFlags(&lExflags); + WXDWORD lExflags; + WXDWORD lFlags = OS2GetCreateWindowFlags(&lExflags); long lStyle = GetWindowStyleFlag(); int nX = rPos.x; int nY = rPos.y; diff --git a/src/os2/window.cpp b/src/os2/window.cpp index feea40e3c5..fd71c44b76 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -130,18 +130,6 @@ void wxAssociateWinWithHandle( HWND hWnd ); wxWindow* wxFindWinFromHandle(WXHWND hWnd); -// -// This magical function is used to translate VK_APPS key presses to right -// mouse clicks -// -// Unused? -#if 0 -static void TranslateKbdEventToMouse( wxWindow* pWin - ,int* pX - ,int* pY - ,MPARAM* pFlags - ); -#endif // // get the current state of SHIFT/CTRL keys // @@ -376,6 +364,19 @@ bool wxWindowOS2::Create( wxCHECK_MSG(pParent, FALSE, wxT("can't create wxWindow without parent")); +#if wxUSE_STATBOX + // + // wxGTK doesn't allow to create controls with static box as the parent so + // this will result in a crash when the program is ported to wxGTK - warn + // about it + // + // the correct solution is to create the controls as siblings of the + // static box + // + wxASSERT_MSG( !wxDynamicCast(pParent, wxStaticBox), + _T("wxStaticBox can't be used as a window parent!") ); +#endif // wxUSE_STATBOX + if ( !CreateBase( pParent ,vId ,rPos @@ -404,39 +405,16 @@ bool wxWindowOS2::Create( // set in those class create procs. PM's basic windows styles are // very limited. // - ulCreateFlags |= WS_VISIBLE; + ulCreateFlags |= WS_VISIBLE | OS2GetCreateWindowFlags(&dwExStyle); #ifdef __WXUNIVERSAL__ // no 3d effects, we draw them ourselves WXDWORD exStyle = 0; -#else // !wxUniversal - if (lStyle & wxCLIP_SIBLINGS) - ulCreateFlags |= WS_CLIPSIBLINGS; - - if (lStyle & wxCLIP_CHILDREN ) - ulCreateFlags |= WS_CLIPCHILDREN; - - // - // - // - bool bWant3D; - dwExStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &bWant3D); - -#endif - - // - // Add the simple border style as we'll use this to draw borders - // - if (lStyle & wxSIMPLE_BORDER) - dwExStyle |= wxSIMPLE_BORDER; - +#endif // !wxUniversal if (lStyle & wxPOPUP_WINDOW) { // a popup window floats on top of everything -//TODO: fix this... -// exStyle |= WS_EX_TOPMOST | WS_EX_TOOLWINDOW; - // it is also created hidden as other top level windows ulCreateFlags &= ~WS_VISIBLE; m_isShown = FALSE; @@ -1050,6 +1028,69 @@ bool wxCheckWindowWndProc( return(fnWndProc == (WXFARPROC)vCls.pfnWindowProc); } // end of WinGuiBase_CheckWindowWndProc +void wxWindowOS2::SetWindowStyleFlag( + long lFlags +) +{ + long lFlagsOld = GetWindowStyleFlag(); + + if (lFlags == lFlagsOld) + return; + + // + // Update the internal variable + // + wxWindowBase::SetWindowStyleFlag(lFlags); + + // + // Now update the Windows style as well if needed - and if the window had + // been already created + // + if (!GetHwnd()) + return; + + WXDWORD dwExstyle; + WXDWORD dwExstyleOld; + long lStyle = OS2GetStyle( lFlags + ,&dwExstyle + ); + long lStyleOld = OS2GetStyle( lFlagsOld + ,&dwExstyleOld + ); + + if (lStyle != lStyleOld) + { + // + // Some flags (e.g. WS_VISIBLE or WS_DISABLED) should not be changed by + // this function so instead of simply setting the style to the new + // value we clear the bits which were set in styleOld but are set in + // the new one and set the ones which were not set before + // + long lStyleReal = ::WinQueryWindowULong(GetHwnd(), QWL_STYLE); + + lStyleReal &= ~lStyleOld; + lStyleReal |= lStyle; + + ::WinSetWindowULong(GetHwnd(), QWL_STYLE, lStyleReal); + } +} // end of wxWindowOS2::SetWindowStyleFlag + +WXDWORD wxWindowOS2::OS2GetStyle( + long lFlags +, WXDWORD* pdwExstyle +) const +{ + WXDWORD dwStyle = 0L; + + if (lFlags & wxCLIP_CHILDREN ) + dwStyle |= WS_CLIPCHILDREN; + + if (lFlags & wxCLIP_SIBLINGS ) + dwStyle |= WS_CLIPSIBLINGS; + + return dwStyle; +} // end of wxWindowMSW::MSWGetStyle + // // Make a Windows extended style from the given wxWindows window style // diff --git a/src/os2/wx23.def b/src/os2/wx23.def index 8f05577557..4c284cf302 100644 --- a/src/os2/wx23.def +++ b/src/os2/wx23.def @@ -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 @@ -856,6 +856,147 @@ EXPORTS __ls__18wxDataOutputStreamFi ;wxDataOutputStream::operator<<(const wxString&) __ls__18wxDataOutputStreamFRC8wxString + ;From object file: ..\common\dbtable.cpp + ;PUBDEFs (Symbols available from object file): + ;wxDbTable::bindParams(unsigned long) + bindParams__9wxDbTableFUl + ;wxDbTable::ClearMemberVar(unsigned short,unsigned long) + ClearMemberVar__9wxDbTableFUsUl + ;wxDbTable::BuildSelectStmt(char*,int,unsigned long) + BuildSelectStmt__9wxDbTableFPciUl + ;wxDbTable::GetNewCursor(unsigned long,unsigned long) + GetNewCursor__9wxDbTableFUlT1 + __vft9wxDbTable + ;wxDbTable::operator--(int) + __mm__9wxDbTableFi + ;wxDbTable::GetCol(const int) const + GetCol__9wxDbTableCFCi + ;wxDbTable::wxDbTable(wxDb*,const wxString&,const unsigned short,const wxString&,unsigned long,const wxString&) + __ct__9wxDbTableFP4wxDbRC8wxStringCUsT2UlT2 + ;wxDbTable::SetCursor(void**) + SetCursor__9wxDbTableFPPv + ;wxDbTable::CreateIndex(const wxString&,unsigned long,unsigned short,wxDbIdxDef*,unsigned long) + CreateIndex__9wxDbTableFRC8wxStringUlUsP10wxDbIdxDefT2 + ;wxDbTable::query(int,unsigned long,unsigned long,const wxString&) + query__9wxDbTableFiUlT2RC8wxString + ;wxDbTable::SetRowMode(const wxDbTable::rowmode_t) + SetRowMode__9wxDbTableFCQ2_9wxDbTable9rowmode_t + ;wxDbTable::Open(unsigned long,unsigned long) + Open__9wxDbTableFUlT1 + TablesInUse + ;wxDbTable::Query(unsigned long,unsigned long) + Query__9wxDbTableFUlT1 + ;wxDbTable::QueryMatching(unsigned long,unsigned long) + QueryMatching__9wxDbTableFUlT1 + ;wxDbColDef::wxDbColDef() + __ct__10wxDbColDefFv + ;wxDbTable::cleanup() + cleanup__9wxDbTableFv + ;wxDbTable::~wxDbTable() + __dt__9wxDbTableFv + ;wxDbTable::GetLast() + GetLast__9wxDbTableFv + ;wxDbTable::DeleteMatching() + DeleteMatching__9wxDbTableFv + ;wxDbTable::CanUpdByROWID() + CanUpdByROWID__9wxDbTableFv + ;wxDbTable::BuildDeleteStmt(char*,int,const wxString&) + BuildDeleteStmt__9wxDbTableFPciRC8wxString + ;wxDbTable::Update(const wxString&) + Update__9wxDbTableFRC8wxString + ;wxDbTable::UpdateWhere(const wxString&) + UpdateWhere__9wxDbTableFRC8wxString + ;wxDbTable::SetColDefs(unsigned short,const wxString&,int,void*,short,int,unsigned long,unsigned long,unsigned long,unsigned long) + SetColDefs__9wxDbTableFUsRC8wxStringiPvsT3UlN37 + ;wxDbTable::SetColDefs(wxDbColInf*,unsigned short) + SetColDefs__9wxDbTableFP10wxDbColInfUs + ;wxDbTable::DeleteWhere(const wxString&) + DeleteWhere__9wxDbTableFRC8wxString + ;wxDbTable::BuildSelectStmt(wxString&,int,unsigned long) + BuildSelectStmt__9wxDbTableFR8wxStringiUl + ;wxDbTable::SetColNull(const wxString&,unsigned long) + SetColNull__9wxDbTableFRC8wxStringUl + ;wxDbTable::CreateTable(unsigned long) + CreateTable__9wxDbTableFUl + ;wxDbTable::ClearMemberVars(unsigned long) + ClearMemberVars__9wxDbTableFUl + ;wxDbTable::QueryOnKeyFields(unsigned long,unsigned long) + QueryOnKeyFields__9wxDbTableFUlT1 + ;wxDbTable::SetKey(const GenericKey&) + SetKey__9wxDbTableFRC10GenericKey + ;wxDbColDef::Initialize() + Initialize__10wxDbColDefFv + ;wxDbTable::initialize(wxDb*,const wxString&,const unsigned short,const wxString&,unsigned long,const wxString&) + initialize__9wxDbTableFP4wxDbRC8wxStringCUsT2UlT2 + ;wxDbTable::bindCols(void*) + bindCols__9wxDbTableFPv + ;wxDbTable::Update() + Update__9wxDbTableFv + ;wxDbTable::IsCursorClosedOnCommit() + IsCursorClosedOnCommit__9wxDbTableFv + ;wxDbTable::GetRowNum() + GetRowNum__9wxDbTableFv + ;wxDbTable::GetPrev() + GetPrev__9wxDbTableFv + ;wxDbTable::execUpdate(const wxString&) + execUpdate__9wxDbTableFRC8wxString + ;wxDbTable::IsColNull(unsigned short) const + IsColNull__9wxDbTableCFUs + ;wxDbTable::DropIndex(const wxString&) + DropIndex__9wxDbTableFRC8wxString + ;wxDbTable::SetColNull(unsigned short,unsigned long) + SetColNull__9wxDbTableFUsUl + lastTableID + ;wxDbTable::SetCol(const int,const wxVariant) + SetCol__9wxDbTableFCiC9wxVariant + ;wxDbTable::SetOrderByColNums(unsigned short,...) + SetOrderByColNums__9wxDbTableFUse + ;wxDbTable::wxDbTable(wxDb*,const wxString&,const unsigned short,const char*,unsigned long,const wxString&) + __ct__9wxDbTableFP4wxDbRC8wxStringCUsPCcUlT2 + ;wxDbTable::bindUpdateParams() + bindUpdateParams__9wxDbTableFv + ;wxDbTable::Refresh() + Refresh__9wxDbTableFv + ;wxDbTable::Insert() + Insert__9wxDbTableFv + ;wxDbTable::DeleteCursor(void**) + DeleteCursor__9wxDbTableFPPv + ;wxDbTable::CanSelectForUpdate() + CanSelectForUpdate__9wxDbTableFv + ;wxDbTable::BuildDeleteStmt(wxString&,int,const wxString&) + BuildDeleteStmt__9wxDbTableFR8wxStringiRC8wxString + ;wxDbTable::Count(const wxString&) + Count__9wxDbTableFRC8wxString + ;wxDbTable::BuildUpdateStmt(char*,int,const wxString&) + BuildUpdateStmt__9wxDbTableFPciRC8wxString + ;wxDbTable::BuildWhereClause(wxString&,int,const wxString&,unsigned long) + BuildWhereClause__9wxDbTableFR8wxStringiRC8wxStringUl + ;wxDbTable::SetQueryTimeout(unsigned long) + SetQueryTimeout__9wxDbTableFUl + ;wxDbTable::BuildWhereClause(char*,int,const wxString&,unsigned long) + BuildWhereClause__9wxDbTableFPciRC8wxStringUl + ;csstrncpyt(char*,const char*,int) + csstrncpyt__FPcPCci + ;wxDbTable::bindInsertParams() + bindInsertParams__9wxDbTableFv + ;wxDbTable::GetKey() + GetKey__9wxDbTableFv + ;wxDbTable::GetFirst() + GetFirst__9wxDbTableFv + ;wxDbTable::DropTable() + DropTable__9wxDbTableFv + ;wxDbTable::Delete() + Delete__9wxDbTableFv + ;wxDbTable::CloseCursor(void*) + CloseCursor__9wxDbTableFPv + ;wxDbTable::getRec(unsigned short) + getRec__9wxDbTableFUs + ;wxDbTable::execDelete(const wxString&) + execDelete__9wxDbTableFRC8wxString + ;wxDbTable::QueryBySqlStmt(const wxString&) + QueryBySqlStmt__9wxDbTableFRC8wxString + ;wxDbTable::BuildUpdateStmt(wxString&,int,const wxString&) + BuildUpdateStmt__9wxDbTableFR8wxStringiRC8wxString ;From object file: ..\common\dcbase.cpp ;PUBDEFs (Symbols available from object file): ;wxDCBase::DoDrawCheckMark(int,int,int,int) @@ -1777,7 +1918,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 @@ -4612,10 +4753,10 @@ EXPORTS ;From object file: ..\common\sckaddr.cpp ;PUBDEFs (Symbols available from object file): __vft13wxSockAddress8wxObject - ;wxIPV4address::AnyAddress() - AnyAddress__13wxIPV4addressFv ;wxIPV4address::Hostname() Hostname__13wxIPV4addressFv + ;wxIPV4address::AnyAddress() + AnyAddress__13wxIPV4addressFv ;wxSockAddress::SetAddress(_GAddress*) SetAddress__13wxSockAddressFP9_GAddress ;wxSockAddress::operator=(const wxSockAddress&) @@ -4642,6 +4783,8 @@ EXPORTS __ct__13wxIPV4addressFv ;wxIPV4address::Service() Service__13wxIPV4addressFv + ;wxIPV4address::Clone() const + Clone__13wxIPV4addressCFv ;wxSockAddress::wxSockAddress(const wxSockAddress&) __ct__13wxSockAddressFRC13wxSockAddress __vft13wxIPV4address8wxObject @@ -5810,7 +5953,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 @@ -9025,6 +9168,8 @@ EXPORTS Thaw__10wxListCtrlFv ;wxListCtrl::SetItem(long,int,const wxString&,int) SetItem__10wxListCtrlFliRC8wxStringT2 + ;wxListMainWindow::SetFocus() + SetFocus__16wxListMainWindowFv ;wxListMainWindow::InitScrolling() InitScrolling__16wxListMainWindowFv ;wxListItemData::GetY() const @@ -9717,8 +9862,6 @@ EXPORTS ;PUBDEFs (Symbols available from object file): ;wxSplitterWindow::OnNavigationKey(wxNavigationKeyEvent&) OnNavigationKey__16wxSplitterWindowFR20wxNavigationKeyEvent - ;wxSplitterWindow::OnUnsplitEvent(wxSplitterEvent&) - OnUnsplitEvent__16wxSplitterWindowFR15wxSplitterEvent ;wxSplitterWindow::OnSize(wxSizeEvent&) OnSize__16wxSplitterWindowFR11wxSizeEvent ;wxSplitterWindow::OnChildFocus(wxChildFocusEvent&) @@ -9739,12 +9882,12 @@ EXPORTS OnFocus__16wxSplitterWindowFR12wxFocusEvent wxEVT_COMMAND_SPLITTER_UNSPLIT __vft16wxSplitterWindow8wxObject - ;wxSplitterWindow::OnSetCursor(wxSetCursorEvent&) - OnSetCursor__16wxSplitterWindowFR16wxSetCursorEvent ;wxSplitterWindow::DoSplit(wxSplitMode,wxWindow*,wxWindow*,int) DoSplit__16wxSplitterWindowF11wxSplitModeP8wxWindowT2i ;wxSplitterWindow::SetMinimumPaneSize(int) SetMinimumPaneSize__16wxSplitterWindowFi + ;wxSplitterWindow::OnSashPositionChange(int) + OnSashPositionChange__16wxSplitterWindowFi ;wxSplitterWindow::DrawSashTracker(int,int) DrawSashTracker__16wxSplitterWindowFiT1 ;wxConstructorForwxSplitterWindow() @@ -9754,16 +9897,14 @@ EXPORTS ;wxSplitterWindow::SetFocus() SetFocus__16wxSplitterWindowFv wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING - ;wxSplitterWindow::OnSashPosChanged(wxSplitterEvent&) - OnSashPosChanged__16wxSplitterWindowFR15wxSplitterEvent ;wxSplitterEvent::sm_classwxSplitterEvent sm_classwxSplitterEvent__15wxSplitterEvent + ;wxSplitterWindow::OnDoubleClickSash(int,int) + OnDoubleClickSash__16wxSplitterWindowFiT1 ;wxSplitterWindow::GetWindowSize() const GetWindowSize__16wxSplitterWindowCFv ;wxSplitterWindow::SizeWindows() SizeWindows__16wxSplitterWindowFv - ;wxSplitterWindow::SendUnsplitEvent(wxWindow*) - SendUnsplitEvent__16wxSplitterWindowFP8wxWindow ;wxSplitterWindow::sm_eventTableEntries sm_eventTableEntries__16wxSplitterWindow ;wxSplitterWindow::OnPaint(wxPaintEvent&) @@ -9771,12 +9912,14 @@ EXPORTS wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED ;wxSplitterWindow::OnIdle(wxIdleEvent&) OnIdle__16wxSplitterWindowFR11wxIdleEvent - ;wxSplitterWindow::OnDoubleClick(wxSplitterEvent&) - OnDoubleClick__16wxSplitterWindowFR15wxSplitterEvent ;wxSplitterWindow::DoSetSashPosition(int) DoSetSashPosition__16wxSplitterWindowFi + ;wxSplitterWindow::ConvertSashPosition(int) const + ConvertSashPosition__16wxSplitterWindowCFi ;wxSplitterWindow::Init() Init__16wxSplitterWindowFv + ;wxSplitterWindow::SetResizeCursor() + SetResizeCursor__16wxSplitterWindowFv ;wxSplitterWindow::GetEventTable() const GetEventTable__16wxSplitterWindowCFv ;wxSplitterWindow::Create(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxString&) @@ -9796,12 +9939,16 @@ EXPORTS SetSashPosition__16wxSplitterWindowFiUl ;wxSplitterWindow::SashHitTest(int,int,int) SashHitTest__16wxSplitterWindowFiN21 + ;wxSplitterWindow::OnSashPositionChanging(int) + OnSashPositionChanging__16wxSplitterWindowFi ;wxConstructorForwxSplitterEvent() wxConstructorForwxSplitterEvent__Fv ;wxSplitterWindow::DrawSash(wxDC&) DrawSash__16wxSplitterWindowFR4wxDC ;wxSplitterWindow::Unsplit(wxWindow*) Unsplit__16wxSplitterWindowFP8wxWindow + ;wxSplitterWindow::OnUnsplit(wxWindow*) + OnUnsplit__16wxSplitterWindowFP8wxWindow ;From object file: ..\generic\statusbr.cpp ;PUBDEFs (Symbols available from object file): ;wxStatusBar::GetFieldRect(int,wxRect&) const @@ -9967,6 +10114,8 @@ EXPORTS OnOK__17wxTextEntryDialogFR14wxCommandEvent ;wxTextEntryDialog::sm_classwxTextEntryDialog sm_classwxTextEntryDialog__17wxTextEntryDialog + ;wxTextEntryDialog::SetValue(const wxString&) + SetValue__17wxTextEntryDialogFRC8wxString ;wxTextEntryDialog::GetEventTable() const GetEventTable__17wxTextEntryDialogCFv ;wxTextEntryDialog::sm_eventTableEntries @@ -11629,16 +11778,16 @@ EXPORTS ;PUBDEFs (Symbols available from object file): ;wxControl::OnEraseBackground(wxEraseEvent&) OnEraseBackground__9wxControlFR12wxEraseEvent + ;wxControl::OS2GetStyle(long,unsigned long*) const + OS2GetStyle__9wxControlCFlPUl ;wxControl::sm_eventTable sm_eventTable__9wxControl ;wxControl::OS2CreateControl(const char*,unsigned long,const wxPoint&,const wxSize&,const wxString&,unsigned long) OS2CreateControl__9wxControlFPCcUlRC7wxPointRC6wxSizeRC8wxStringT2 - ;wxControl::GetExStyle(unsigned long&) const - GetExStyle__9wxControlCFRUl - ;wxControl::sm_eventTableEntries - sm_eventTableEntries__9wxControl ;wxControl::sm_classwxControl sm_classwxControl__9wxControl + ;wxControl::sm_eventTableEntries + sm_eventTableEntries__9wxControl ;wxControl::DoGetBestSize() const DoGetBestSize__9wxControlCFv ;wxControl::Create(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxValidator&,const wxString&) @@ -11651,15 +11800,17 @@ EXPORTS __ct__9wxControlFv ;wxControl::GetEventTable() const GetEventTable__9wxControlCFv + ;wxControl::OS2CreateControl(const char*,const wxString&,const wxPoint&,const wxSize&,long) + OS2CreateControl__9wxControlFPCcRC8wxStringRC7wxPointRC6wxSizel ;wxFindMaxSize(unsigned long,_RECTL*) wxFindMaxSize__FUlP6_RECTL __vft9wxControl8wxObject ;wxControl::~wxControl() __dt__9wxControlFv - ;wxControl::OS2CreateControl(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxValidator&,const wxString&) - OS2CreateControl__9wxControlFP8wxWindowiRC7wxPointRC6wxSizelRC11wxValidatorRC8wxString ;From object file: ..\os2\cursor.cpp ;PUBDEFs (Symbols available from object file): + ;wxCursor::wxCursor(const wxImage&) + __ct__8wxCursorFRC7wxImage ;wxCursorRefData::~wxCursorRefData() __dt__15wxCursorRefDataFv ;wxCursor::wxCursor(const wxString&,long,int,int) @@ -13866,8 +14017,11 @@ EXPORTS ;PUBDEFs (Symbols available from object file): ;wxStaticLine::sm_classwxStaticLine sm_classwxStaticLine__12wxStaticLine + ;wxStaticLine::OS2GetStyle(long,unsigned long*) const + OS2GetStyle__12wxStaticLineCFlPUl ;wxConstructorForwxStaticLine() wxConstructorForwxStaticLine__Fv + __vft12wxStaticLine8wxObject ;wxStaticLine::Create(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxString&) Create__12wxStaticLineFP8wxWindowiRC7wxPointRC6wxSizelRC8wxString ;From object file: ..\os2\tabctrl.cpp @@ -14039,13 +14193,17 @@ EXPORTS SetStyle__10wxTextCtrlFlT1RC10wxTextAttr ;wxTextCtrl::CanRedo() const CanRedo__10wxTextCtrlCFv - ;wxTextCtrl::SetEditable(unsigned long) - SetEditable__10wxTextCtrlFUl + ;wxTextCtrl::OS2GetStyle(long,unsigned long*) const + OS2GetStyle__10wxTextCtrlCFlPUl ;wxTextCtrl::sm_classwxTextCtrl sm_classwxTextCtrl__10wxTextCtrl __vft10wxTextCtrl8wxObject ;wxTextCtrl::ShowPosition(long) ShowPosition__10wxTextCtrlFl + ;wxTextCtrl::SetWindowStyleFlag(long) + SetWindowStyleFlag__10wxTextCtrlFl + ;wxTextCtrl::SetEditable(unsigned long) + SetEditable__10wxTextCtrlFUl ;wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent&) OnUpdateCopy__10wxTextCtrlFR15wxUpdateUIEvent ;wxTextCtrl::OnCut(wxCommandEvent&) @@ -14348,6 +14506,8 @@ EXPORTS hwndTT__9wxToolTip ;From object file: ..\os2\toplevel.cpp ;PUBDEFs (Symbols available from object file): + ;wxTopLevelWindowOS2::OS2GetStyle(long,unsigned long*) const + OS2GetStyle__19wxTopLevelWindowOS2CFlPUl __vft19wxTopLevelWindowOS28wxObject ;wxTopLevelWindowOS2::CreateFrame(const wxString&,const wxPoint&,const wxSize&) CreateFrame__19wxTopLevelWindowOS2FRC8wxStringRC7wxPointRC6wxSize @@ -14363,8 +14523,6 @@ EXPORTS Init__19wxTopLevelWindowOS2Fv ;wxTopLevelWindowOS2::m_sbInitialized m_sbInitialized__19wxTopLevelWindowOS2 - ;wxTopLevelWindowOS2::OS2GetCreateWindowFlags(long*) const - OS2GetCreateWindowFlags__19wxTopLevelWindowOS2CFPl ;wxTopLevelWindowOS2::Iconize(unsigned long) Iconize__19wxTopLevelWindowOS2FUl ;wxTopLevelWindowOS2::DoSetClientSize(int,int) @@ -14517,6 +14675,8 @@ EXPORTS UnpackActivate__8wxWindowFPvT1PUsPUl ;wxWindow::SubclassWin(unsigned long) SubclassWin__8wxWindowFUl + ;wxWindow::SetWindowStyleFlag(long) + SetWindowStyleFlag__8wxWindowFl ;wxWindow::HandleInitDialog(unsigned long) HandleInitDialog__8wxWindowFUl ;wxWindow::HandleGetMinMaxInfo(_SWP*) @@ -14743,6 +14903,8 @@ EXPORTS ScrollWindow__8wxWindowFiT1PC6wxRect ;wxWindow::OnIdle(wxIdleEvent&) OnIdle__8wxWindowFR11wxIdleEvent + ;wxWindow::OS2GetStyle(long,unsigned long*) const + OS2GetStyle__8wxWindowCFlPUl ;wxWindow::HandleActivate(int,unsigned long) HandleActivate__8wxWindowFiUl ;wxWindow::FindItemByHWND(unsigned long,unsigned long) const