X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/743e24aa72ed41a56884698802e3b31ca9f26b31..ee92941afca091bf72d17e96ac8388545700d1fc:/src/os2/control.cpp?ds=sidebyside diff --git a/src/os2/control.cpp b/src/os2/control.cpp index 30e0e90977..51eff786ee 100644 --- a/src/os2/control.cpp +++ b/src/os2/control.cpp @@ -12,15 +12,17 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/control.h" + #ifndef WX_PRECOMP -#include "wx/event.h" -#include "wx/app.h" -#include "wx/dcclient.h" -#include "wx/scrolwin.h" -#include "wx/log.h" + #include "wx/event.h" + #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" IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) @@ -33,15 +35,13 @@ wxControl::wxControl() { } // end of wxControl::wxControl -bool wxControl::Create( - wxWindow* pParent -, wxWindowID vId -, const wxPoint& rPos -, const wxSize& rSize -, long lStyle -, const wxValidator& rValidator -, const wxString& rsName -) +bool wxControl::Create( wxWindow* pParent, + wxWindowID vId, + const wxPoint& rPos, + const wxSize& rSize, + long lStyle, + const wxValidator& rValidator, + const wxString& rsName ) { bool bRval = wxWindow::Create( pParent ,vId @@ -120,14 +120,23 @@ bool wxControl::OS2CreateControl( const wxChar* zClassname, zClass = WC_NOTEBOOK; else if ((wxStrcmp(zClassname, _T("CONTAINER"))) == 0) zClass = WC_CONTAINER; - dwStyle |= WS_VISIBLE; + if ((zClass == WC_STATIC) || (zClass == WC_BUTTON)) + dwStyle |= DT_MNEMONIC; + m_dwStyle = dwStyle; m_label = rsLabel; - wxString label = ::wxPMTextToLabel(m_label); + wxString label; + if (dwStyle & DT_MNEMONIC) + label = ::wxPMTextToLabel(m_label); + else + label = m_label; + + // clipping siblings does not yet work + dwStyle &= ~WS_CLIPSIBLINGS; m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle ,(PSZ)zClass // Window class - ,(PSZ)label.c_str() // Initial Text + ,(PSZ)label.c_str() // Initial Text ,(ULONG)dwStyle // Style flags ,(LONG)0 // X pos of origin ,(LONG)0 // Y pos of origin @@ -230,7 +239,11 @@ void wxControl::SetLabel( const wxString& rsLabel ) if(rsLabel != m_label) { m_label = rsLabel; - wxString label = ::wxPMTextToLabel(rsLabel); + wxString label; + if (m_dwStyle & DT_MNEMONIC) + label = ::wxPMTextToLabel(m_label); + else + label = m_label; ::WinSetWindowText(GetHwnd(), (PSZ)label.c_str()); } } // end of wxControl::SetLabel