From: Stefan Neis Date: Wed, 4 Jan 2006 22:46:06 +0000 (+0000) Subject: Fixed label handling (translating for accelerator handling only for relevant X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/37ac8a5f21efd729eac6bf494d1b0f151ecc0c93 Fixed label handling (translating for accelerator handling only for relevant classes) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/os2/control.h b/include/wx/os2/control.h index 12faf42fae..41ba89cc41 100644 --- a/include/wx/os2/control.h +++ b/include/wx/os2/control.h @@ -123,6 +123,7 @@ private: int m_nYComp; wxString m_label; + WXDWORD m_dwStyle; DECLARE_EVENT_TABLE() }; // end of wxControl diff --git a/src/os2/control.cpp b/src/os2/control.cpp index 30e0e90977..69a1a79243 100644 --- a/src/os2/control.cpp +++ b/src/os2/control.cpp @@ -120,14 +120,20 @@ 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; 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 +236,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