// static data
// ----------------------------------------------------------------------------
+#if defined(__WXPM__)
+int wxWindowBase::ms_lastControlId = 2000;
+#else
int wxWindowBase::ms_lastControlId = -200;
+#endif
IMPLEMENT_ABSTRACT_CLASS(wxWindowBase, wxEvtHandler)
//else: do nothing if we have no children
}
+// fits virtual size (ie. scrolled area etc.) around children
+void wxWindowBase::FitInside()
+{
+ if ( GetChildren().GetCount() > 0 )
+ {
+ SetVirtualSize( GetBestVirtualSize() );
+ }
+}
+
// return the size best suited for the current window
wxSize wxWindowBase::DoGetBestSize() const
{
m_maxVirtualWidth = maxW;
m_minVirtualHeight = minH;
m_maxVirtualHeight = maxH;
-
- SetVirtualSize( GetClientSize() );
}
void wxWindowBase::DoSetVirtualSize( int x, int y )
void wxWindowBase::PushEventHandler(wxEvtHandler *handler)
{
- handler->SetNextHandler(GetEventHandler());
- GetEventHandler()->SetPreviousHandler(handler);
+ wxEvtHandler *handlerOld = GetEventHandler();
+
+ handler->SetNextHandler(handlerOld);
+
+ if ( handlerOld )
+ GetEventHandler()->SetPreviousHandler(handler);
+
SetEventHandler(handler);
}
{
wxEvtHandler *handlerB = handlerA->GetNextHandler();
handlerA->SetNextHandler((wxEvtHandler *)NULL);
- handlerB->SetPreviousHandler((wxEvtHandler *)NULL);
+
+ if ( handlerB )
+ handlerB->SetPreviousHandler((wxEvtHandler *)NULL);
SetEventHandler(handlerB);
+
if ( deleteHandler )
{
delete handlerA;
#if wxUSE_TEXTCTRL
wxTextCtrl *text = wxDynamicCast(control, wxTextCtrl);
if ( text )
- text->SetValue(event.GetText());
+ {
+ if ( event.GetText() != text->GetValue() )
+ text->SetValue(event.GetText());
+ }
else
#endif // wxUSE_TEXTCTRL
- control->SetLabel(event.GetText());
+ {
+ if ( event.GetText() != control->GetLabel() )
+ control->SetLabel(event.GetText());
+ }
}
}
if ( winOld )
{
((wxWindowBase*) winOld)->DoReleaseMouse();
-
+
// save it on stack
wxWindowNext *item = new wxWindowNext;
item->win = winOld;
if ( ms_winCaptureNext )
{
((wxWindowBase*)ms_winCaptureNext->win)->DoCaptureMouse();
-
+
wxWindowNext *item = ms_winCaptureNext;
ms_winCaptureNext = item->next;
delete item;