Added accelerator handling for buttons and infrastructure to do the same for
other controls (patch 893580). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,6 +50,8 @@ public:
|
|||||||
,const wxString& rsName = wxControlNameStr
|
,const wxString& rsName = wxControlNameStr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
virtual void SetLabel(const wxString& rsLabel);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Simulates an event
|
// Simulates an event
|
||||||
//
|
//
|
||||||
|
@@ -51,6 +51,9 @@ bool wxButton::Create(
|
|||||||
, const wxString& rsName
|
, const wxString& rsName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
wxString sLabel = ::wxPMTextToLabel(rsLabel);
|
||||||
|
|
||||||
SetName(rsName);
|
SetName(rsName);
|
||||||
#if wxUSE_VALIDATORS
|
#if wxUSE_VALIDATORS
|
||||||
SetValidator(rValidator);
|
SetValidator(rValidator);
|
||||||
@@ -73,7 +76,7 @@ bool wxButton::Create(
|
|||||||
|
|
||||||
m_hWnd = (WXHWND)::WinCreateWindow( GetHwndOf(pParent) // Parent handle
|
m_hWnd = (WXHWND)::WinCreateWindow( GetHwndOf(pParent) // Parent handle
|
||||||
,WC_BUTTON // A Button class window
|
,WC_BUTTON // A Button class window
|
||||||
,(PSZ)rsLabel.c_str() // Button text
|
,(PSZ)sLabel.c_str() // Button text
|
||||||
,lStyle // Button style
|
,lStyle // Button style
|
||||||
,0, 0, 0, 0 // Location and size
|
,0, 0, 0, 0 // Location and size
|
||||||
,GetHwndOf(pParent) // Owner handle
|
,GetHwndOf(pParent) // Owner handle
|
||||||
|
@@ -240,6 +240,15 @@ WXDWORD wxControl::OS2GetStyle(
|
|||||||
return dwStyle;
|
return dwStyle;
|
||||||
} // end of wxControl::OS2GetStyle
|
} // end of wxControl::OS2GetStyle
|
||||||
|
|
||||||
|
void wxControl::SetLabel(
|
||||||
|
const wxString& rsLabel
|
||||||
|
)
|
||||||
|
{
|
||||||
|
wxString sLabel = ::wxPMTextToLabel(rsLabel);
|
||||||
|
|
||||||
|
::WinSetWindowText(GetHwnd(), sLabel.c_str());
|
||||||
|
} // end of wxControl::SetLabel
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// global functions
|
// global functions
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user