From: Vadim Zeitlin Date: Fri, 23 Jul 1999 00:53:45 +0000 (+0000) Subject: 1. frames respect update region (Tom Surace patch) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5d1d2d465d9a6ce219df35fd97c02a37aba40d03?ds=inline 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 --- diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 03e9351758..daa665f297 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -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); } // ---------------------------------------------------------------------------- diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index db3bd68269..f3123bd1d4 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -878,10 +878,7 @@ bool wxFrame::HandlePaint() } else { - wxPaintEvent event(m_windowId); - event.m_eventObject = this; - - return GetEventHandler()->ProcessEvent(event); + return wxWindow::HandlePaint(); } } else diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index d94b86b315..6c0c06db8e 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -424,7 +424,23 @@ void wxNotebook::OnSelChange(wxNotebookEvent& event) { // is it our tab control? 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 event.Skip();