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() void wxButton::SetDefault()
{ {
wxWindow *parent = GetParent(); wxWindow *parent = GetParent();
wxButton *btnOldDefault = NULL;
wxPanel *panel = wxDynamicCast(parent, wxPanel); wxPanel *panel = wxDynamicCast(parent, wxPanel);
if ( panel ) if ( panel )
{
btnOldDefault = panel->GetDefaultItem();
panel->SetDefaultItem(this); panel->SetDefaultItem(this);
}
if ( parent ) if ( parent )
{ {
SendMessage(GetWinHwnd(parent), DM_SETDEFID, m_windowId, 0L); 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);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -878,10 +878,7 @@ bool wxFrame::HandlePaint()
} }
else else
{ {
wxPaintEvent event(m_windowId); return wxWindow::HandlePaint();
event.m_eventObject = this;
return GetEventHandler()->ProcessEvent(event);
} }
} }
else else

View File

@@ -424,7 +424,23 @@ void wxNotebook::OnSelChange(wxNotebookEvent& event)
{ {
// is it our tab control? // is it our tab control?
if ( event.GetEventObject() == this ) if ( event.GetEventObject() == this )
ChangePage(event.GetOldSelection(), event.GetSelection()); {
// don't call ChangePage() here because it will generate redundant
// notification events
int sel = event.GetOldSelection();
if ( sel != -1 )
m_aPages[sel]->Show(FALSE);
sel = event.GetSelection();
if ( sel != -1 )
{
wxNotebookPage *pPage = m_aPages[sel];
pPage->Show(TRUE);
pPage->SetFocus();
}
m_nSelection = sel;
}
// we want to give others a chance to process this message as well // we want to give others a chance to process this message as well
event.Skip(); event.Skip();