X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b9b1d6c8ddc0e923c368529efb0e011edeec44e6..bb24c68f3502746147337c3f502cc1c957bcfb35:/src/os2/control.cpp diff --git a/src/os2/control.cpp b/src/os2/control.cpp index 61fd7206cf..3e97f4a862 100644 --- a/src/os2/control.cpp +++ b/src/os2/control.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 09/17/99 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -21,6 +21,7 @@ #include "wx/app.h" #include "wx/dcclient.h" #include "wx/scrolwin.h" +#include "wx/log.h" #endif #include "wx/os2/private.h" #include "wx/control.h" @@ -46,9 +47,7 @@ bool wxControl::Create( , const wxPoint& rPos , const wxSize& rSize , long lStyle -#if wxUSE_VALIDATORS , const wxValidator& rValidator -#endif , const wxString& rsName ) { @@ -105,10 +104,7 @@ bool wxControl::OS2CreateControl( ) { 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 // @@ -120,7 +116,8 @@ bool wxControl::OS2CreateControl( // All controls should have these styles (wxWindows creates all controls // visible by default) // - dwStyle |= WS_VISIBLE; + if (m_isShown ) + dwStyle |= WS_VISIBLE; wxWindow* pParent = GetParent(); PSZ zClass; @@ -134,6 +131,10 @@ bool wxControl::OS2CreateControl( zClass = WC_STATIC; else if ((strcmp(zClassname, "BUTTON")) == 0) zClass = WC_BUTTON; + else if ((strcmp(zClassname, "NOTEBOOK")) == 0) + zClass = WC_NOTEBOOK; + else if ((strcmp(zClassname, "CONTAINER")) == 0) + zClass = WC_CONTAINER; dwStyle |= WS_VISIBLE; m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle @@ -168,8 +169,13 @@ bool wxControl::OS2CreateControl( // Controls use the same font and colours as their parent dialog by default // InheritAttributes(); - if (nW == 0 || nH == 0) - SetBestSize(rSize); + SetXComp(0); + SetYComp(0); + SetSize( rPos.x + ,rPos.y + ,rSize.x + ,rSize.y + ); return TRUE; } // end of wxControl::OS2CreateControl