// ----------------------------------------------------------------------------
// the default initialization
// ----------------------------------------------------------------------------
// the default initialization
{
// no window yet, no parent nor children
m_parent = (wxWindow *)NULL;
{
// no window yet, no parent nor children
m_parent = (wxWindow *)NULL;
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
long style,
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
long style,
}
bool wxWindowBase::Close(bool force)
{
wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
event.SetEventObject(this);
}
bool wxWindowBase::Close(bool force)
{
wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
event.SetEventObject(this);
- wxASSERT_MSG( child, wxT("children list contains empty nodes") );
-
- child->Show(FALSE);
+ // note that we really want to call delete and not ->Destroy() here
+ // because we want to delete the child immediately, before we are
+ // deleted, and delayed deletion would result in problems as our (top
+ // level) child could outlive its parent
delete child;
wxASSERT_MSG( !GetChildren().Find(child),
wxT("child didn't remove itself using RemoveChild()") );
}
delete child;
wxASSERT_MSG( !GetChildren().Find(child),
wxT("child didn't remove itself using RemoveChild()") );
}
wxEvtHandler *handlerPrev = NULL,
*handlerCur = GetEventHandler();
wxEvtHandler *handlerPrev = NULL,
*handlerCur = GetEventHandler();
bool wxWindowBase::SetBackgroundColour( const wxColour &colour )
{
if ( !colour.Ok() || (colour == m_backgroundColour) )
bool wxWindowBase::SetBackgroundColour( const wxColour &colour )
{
if ( !colour.Ok() || (colour == m_backgroundColour) )
}
bool wxWindowBase::SetForegroundColour( const wxColour &colour )
{
if ( !colour.Ok() || (colour == m_foregroundColour) )
}
bool wxWindowBase::SetForegroundColour( const wxColour &colour )
{
if ( !colour.Ok() || (colour == m_foregroundColour) )
return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
}
return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
}
+void wxWindowBase::ClearBackground()
+{
+ // wxGTK uses its own version, no need to add never used code
+#ifndef __WXGTK__
+ wxClientDC dc((wxWindow *)this);
+ wxBrush brush(GetBackgroundColour(), wxSOLID);
+ dc.SetBackground(brush);
+ dc.Clear();
+#endif // __WXGTK__
+}
+
// ----------------------------------------------------------------------------
// find child window by id or name
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// find child window by id or name
// ----------------------------------------------------------------------------
wxValidator *validator = child->GetValidator();
if ( validator && !validator->Validate((wxWindow *)this) )
{
wxValidator *validator = child->GetValidator();
if ( validator && !validator->Validate((wxWindow *)this) )
{
// nop warning here because the application is supposed to give
// one itself - we don't know here what might have gone wrongly
// nop warning here because the application is supposed to give
// one itself - we don't know here what might have gone wrongly
- constr->left.SetDone(FALSE);
- constr->top.SetDone(FALSE);
- constr->right.SetDone(FALSE);
- constr->bottom.SetDone(FALSE);
- constr->width.SetDone(FALSE);
- constr->height.SetDone(FALSE);
- constr->centreX.SetDone(FALSE);
- constr->centreY.SetDone(FALSE);
+ constr->left.SetDone(false);
+ constr->top.SetDone(false);
+ constr->right.SetDone(false);
+ constr->bottom.SetDone(false);
+ constr->width.SetDone(false);
+ constr->height.SetDone(false);
+ constr->centreX.SetDone(false);
+ constr->centreY.SetDone(false);
//else: stack is empty, no previous capture
wxLogTrace(_T("mousecapture"),
//else: stack is empty, no previous capture
wxLogTrace(_T("mousecapture"),
// Can only use the validator of the window which
// is receiving the event
if ( event.GetEventObject() == this )
// Can only use the validator of the window which
// is receiving the event
if ( event.GetEventObject() == this )
bool wxWindowBase::TryParent(wxEvent& event)
{
// carry on up the parent-child hierarchy if the propgation count hasn't
bool wxWindowBase::TryParent(wxEvent& event)
{
// carry on up the parent-child hierarchy if the propgation count hasn't
// Can return either a child object, or an integer
// representing the child element, starting from 1.
// Can return either a child object, or an integer
// representing the child element, starting from 1.
-wxAccStatus wxWindowAccessible::HitTest(const wxPoint& pt, int* childId, wxAccessible** childObject)
+wxAccStatus wxWindowAccessible::HitTest(const wxPoint& WXUNUSED(pt), int* WXUNUSED(childId), wxAccessible** WXUNUSED(childObject))
// Navigates from fromId to toId/toObject.
wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
// Navigates from fromId to toId/toObject.
wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
// or > 0 (the action for a child).
// Return wxACC_NOT_SUPPORTED if there is no default action for this
// window (e.g. an edit control).
// or > 0 (the action for a child).
// Return wxACC_NOT_SUPPORTED if there is no default action for this
// window (e.g. an edit control).
// The retrieved string describes the action that is performed on an object,
// not what the object does as a result. For example, a toolbar button that prints
// a document has a default action of "Press" rather than "Prints the current document."
// The retrieved string describes the action that is performed on an object,
// not what the object does as a result. For example, a toolbar button that prints
// a document has a default action of "Press" rather than "Prints the current document."
// If childId is 0 and child is NULL, no object in
// this subhierarchy has the focus.
// If this object has the focus, child should be 'this'.
// If childId is 0 and child is NULL, no object in
// this subhierarchy has the focus.
// If this object has the focus, child should be 'this'.
// - an integer representing the selected child element,
// or 0 if this object is selected (GetType() == wxT("long")
// - a "void*" pointer to a wxAccessible child object
// - an integer representing the selected child element,
// or 0 if this object is selected (GetType() == wxT("long")
// - a "void*" pointer to a wxAccessible child object