1. frames respect update region (Tom Surace patch)

2. bitmap buttons don't lose bitmaps
3. attempt to reduce number of simultaneously default buttons in a panel


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-07-23 00:53:45 +00:00
parent c49245f8ba
commit 5d1d2d465d
3 changed files with 34 additions and 6 deletions

View File

@@ -153,16 +153,31 @@ wxSize wxButton::GetDefaultSize()
void wxButton::SetDefault()
{
wxWindow *parent = GetParent();
wxButton *btnOldDefault = NULL;
wxPanel *panel = wxDynamicCast(parent, wxPanel);
if ( panel )
{
btnOldDefault = panel->GetDefaultItem();
panel->SetDefaultItem(this);
}
if ( parent )
{
SendMessage(GetWinHwnd(parent), DM_SETDEFID, m_windowId, 0L);
}
SendMessage(GetHwnd(), BM_SETSTYLE, BS_DEFPUSHBUTTON, 1L);
if ( btnOldDefault )
{
// remove the BS_DEFPUSHBUTTON style from the other button
long style = GetWindowLong(GetHwndOf(btnOldDefault), GWL_STYLE);
style &= ~BS_DEFPUSHBUTTON;
SendMessage(GetHwndOf(btnOldDefault), BM_SETSTYLE, style, 1L);
}
// set this button as the default
long style = GetWindowLong(GetHwnd(), GWL_STYLE);
style |= BS_DEFPUSHBUTTON;
SendMessage(GetHwnd(), BM_SETSTYLE, style, 1L);
}
// ----------------------------------------------------------------------------