X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6045bb81d13ef3e9c36c78db8687d0390e3c6b7..c0db962623bc3a6b7301bfd8b0894758835d14bc:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index ec5d8f7502..a45a930fae 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "windowbase.h" #endif @@ -114,7 +114,6 @@ void wxWindowBase::InitBase() // no window yet, no parent nor children m_parent = (wxWindow *)NULL; m_windowId = -1; - m_children.DeleteContents( FALSE ); // don't auto delete node data // no constraints on the minimal window size m_minWidth = @@ -203,14 +202,9 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), long style, - const wxValidator& validator, + const wxValidator& wxVALIDATOR_PARAM(validator), const wxString& name) { - // m_isWindow is set to TRUE in wxWindowBase::Init() as well as many other - // member variables - check that it has been called (will catch the case - // when a new ctor is added which doesn't call InitWindow) - wxASSERT_MSG( m_isWindow, wxT("Init() must have been called before!") ); - #if wxUSE_STATBOX // wxGTK doesn't allow to create controls with static box as the parent so // this will result in a crash when the program is ported to wxGTK so warn @@ -268,18 +262,27 @@ wxWindowBase::~wxWindowBase() // Just in case we've loaded a top-level window via LoadNativeDialog but // we weren't a dialog class - wxTopLevelWindows.DeleteObject(this); + wxTopLevelWindows.DeleteObject((wxWindow*)this); wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") ); + // reset the dangling pointer our parent window may keep to us + if ( m_parent ) + { + if ( m_parent->GetDefaultItem() == this ) + { + m_parent->SetDefaultItem(NULL); + } + + m_parent->RemoveChild(this); + } + #if wxUSE_CARET - if ( m_caret ) - delete m_caret; + delete m_caret; #endif // wxUSE_CARET #if wxUSE_VALIDATORS - if ( m_windowValidator ) - delete m_windowValidator; + delete m_windowValidator; #endif // wxUSE_VALIDATORS #if wxUSE_CONSTRAINTS @@ -295,35 +298,24 @@ wxWindowBase::~wxWindowBase() delete m_constraints; m_constraints = NULL; } - #endif // wxUSE_CONSTRAINTS if ( m_containingSizer ) m_containingSizer->Detach( (wxWindow*)this ); - if ( m_windowSizer ) - delete m_windowSizer; + delete m_windowSizer; #if wxUSE_DRAG_AND_DROP - if ( m_dropTarget ) - delete m_dropTarget; + delete m_dropTarget; #endif // wxUSE_DRAG_AND_DROP #if wxUSE_TOOLTIPS - if ( m_tooltip ) - delete m_tooltip; + delete m_tooltip; #endif // wxUSE_TOOLTIPS #if wxUSE_ACCESSIBILITY - if ( m_accessible ) - delete m_accessible; + delete m_accessible; #endif - - // reset the dangling pointer our parent window may keep to us - if ( m_parent && m_parent->GetDefaultItem() == this ) - { - m_parent->SetDefaultItem(NULL); - } } bool wxWindowBase::Destroy() @@ -337,9 +329,6 @@ bool wxWindowBase::Close(bool force) { wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId); event.SetEventObject(this); -#if WXWIN_COMPATIBILITY - event.SetForce(force); -#endif // WXWIN_COMPATIBILITY event.SetCanVeto(!force); // return FALSE if window wasn't closed because the application vetoed the @@ -349,7 +338,7 @@ bool wxWindowBase::Close(bool force) bool wxWindowBase::DestroyChildren() { - wxWindowList::Node *node; + wxWindowList::compatibility_iterator node; for ( ;; ) { // we iterate until the list becomes empty @@ -359,9 +348,10 @@ bool wxWindowBase::DestroyChildren() wxWindow *child = node->GetData(); - 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), @@ -525,7 +515,7 @@ wxSize wxWindowBase::DoGetBestSize() const int maxX = 0, maxY = 0; - for ( wxWindowList::Node *node = GetChildren().GetFirst(); + for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() ) { @@ -559,7 +549,7 @@ wxSize wxWindowBase::DoGetBestSize() const int maxX = 0, maxY = 0; - for ( wxWindowList::Node *node = GetChildren().GetFirst(); + for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() ) { @@ -713,9 +703,9 @@ void wxWindowBase::AddChild(wxWindowBase *child) // this should never happen and it will lead to a crash later if it does // because RemoveChild() will remove only one node from the children list // and the other(s) one(s) will be left with dangling pointers in them - wxASSERT_MSG( !GetChildren().Find(child), _T("AddChild() called twice") ); + wxASSERT_MSG( !GetChildren().Find((wxWindow*)child), _T("AddChild() called twice") ); - GetChildren().Append(child); + GetChildren().Append((wxWindow*)child); child->SetParent(this); } @@ -723,8 +713,8 @@ void wxWindowBase::RemoveChild(wxWindowBase *child) { wxCHECK_RET( child, wxT("can't remove a NULL child") ); - GetChildren().DeleteObject(child); - child->SetParent((wxWindow *)NULL); + GetChildren().DeleteObject((wxWindow *)child); + child->SetParent(NULL); } bool wxWindowBase::Reparent(wxWindowBase *newParent) @@ -743,7 +733,7 @@ bool wxWindowBase::Reparent(wxWindowBase *newParent) } else { - wxTopLevelWindows.DeleteObject(this); + wxTopLevelWindows.DeleteObject((wxWindow *)this); } // add it to the new one @@ -753,7 +743,7 @@ bool wxWindowBase::Reparent(wxWindowBase *newParent) } else { - wxTopLevelWindows.Append(this); + wxTopLevelWindows.Append((wxWindow *)this); } return TRUE; @@ -822,7 +812,9 @@ bool wxWindowBase::RemoveEventHandler(wxEvtHandler *handler) { handlerNext->SetPreviousHandler ( handlerPrev ); } + handler->SetNextHandler(NULL); + handler->SetPreviousHandler(NULL); return TRUE; } @@ -983,6 +975,17 @@ bool wxWindowBase::IsExposed(int x, int y, int w, int h) const 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 // ---------------------------------------------------------------------------- @@ -993,7 +996,7 @@ wxWindow *wxWindowBase::FindWindow( long id ) return (wxWindow *)this; wxWindowBase *res = (wxWindow *)NULL; - wxWindowList::Node *node; + wxWindowList::compatibility_iterator node; for ( node = m_children.GetFirst(); node && !res; node = node->GetNext() ) { wxWindowBase *child = node->GetData(); @@ -1009,7 +1012,7 @@ wxWindow *wxWindowBase::FindWindow( const wxString& name ) return (wxWindow *)this; wxWindowBase *res = (wxWindow *)NULL; - wxWindowList::Node *node; + wxWindowList::compatibility_iterator node; for ( node = m_children.GetFirst(); node && !res; node = node->GetNext() ) { wxWindow *child = node->GetData(); @@ -1065,7 +1068,7 @@ wxWindow *wxFindWindowRecursively(const wxWindow *parent, return (wxWindow *)parent; // It wasn't, so check all its children - for ( wxWindowList::Node * node = parent->GetChildren().GetFirst(); + for ( wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst(); node; node = node->GetNext() ) { @@ -1095,7 +1098,7 @@ wxWindow *wxFindWindowHelper(const wxWindow *parent, } // start at very top of wx's windows - for ( wxWindowList::Node * node = wxTopLevelWindows.GetFirst(); + for ( wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) { @@ -1147,7 +1150,7 @@ void wxWindowBase::MakeModal(bool modal) // Disable all other windows if ( IsTopLevel() ) { - wxWindowList::Node *node = wxTopLevelWindows.GetFirst(); + wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst(); while (node) { wxWindow *win = node->GetData(); @@ -1164,7 +1167,7 @@ bool wxWindowBase::Validate() #if wxUSE_VALIDATORS bool recurse = (GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) != 0; - wxWindowList::Node *node; + wxWindowList::compatibility_iterator node; for ( node = m_children.GetFirst(); node; node = node->GetNext() ) { wxWindowBase *child = node->GetData(); @@ -1189,7 +1192,7 @@ bool wxWindowBase::TransferDataToWindow() #if wxUSE_VALIDATORS bool recurse = (GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) != 0; - wxWindowList::Node *node; + wxWindowList::compatibility_iterator node; for ( node = m_children.GetFirst(); node; node = node->GetNext() ) { wxWindowBase *child = node->GetData(); @@ -1223,7 +1226,7 @@ bool wxWindowBase::TransferDataFromWindow() #if wxUSE_VALIDATORS bool recurse = (GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) != 0; - wxWindowList::Node *node; + wxWindowList::compatibility_iterator node; for ( node = m_children.GetFirst(); node; node = node->GetNext() ) { wxWindow *child = node->GetData(); @@ -1414,15 +1417,15 @@ void wxWindowBase::AddConstraintReference(wxWindowBase *otherWin) { if ( !m_constraintsInvolvedIn ) m_constraintsInvolvedIn = new wxWindowList; - if ( !m_constraintsInvolvedIn->Find(otherWin) ) - m_constraintsInvolvedIn->Append(otherWin); + if ( !m_constraintsInvolvedIn->Find((wxWindow *)otherWin) ) + m_constraintsInvolvedIn->Append((wxWindow *)otherWin); } // REMOVE back-pointer to other windows we're involved with. void wxWindowBase::RemoveConstraintReference(wxWindowBase *otherWin) { if ( m_constraintsInvolvedIn ) - m_constraintsInvolvedIn->DeleteObject(otherWin); + m_constraintsInvolvedIn->DeleteObject((wxWindow *)otherWin); } // Reset any constraints that mention this window @@ -1430,7 +1433,7 @@ void wxWindowBase::DeleteRelatedConstraints() { if ( m_constraintsInvolvedIn ) { - wxWindowList::Node *node = m_constraintsInvolvedIn->GetFirst(); + wxWindowList::compatibility_iterator node = m_constraintsInvolvedIn->GetFirst(); while (node) { wxWindow *win = node->GetData(); @@ -1449,8 +1452,8 @@ void wxWindowBase::DeleteRelatedConstraints() constr->centreY.ResetIfWin(this); } - wxWindowList::Node *next = node->GetNext(); - delete node; + wxWindowList::compatibility_iterator next = node->GetNext(); + m_constraintsInvolvedIn->Erase(node); node = next; } @@ -1564,7 +1567,7 @@ bool wxWindowBase::DoPhase(int phase) int noChanges = 0; // loop over all children setting their constraints - for ( wxWindowList::Node *node = GetChildren().GetFirst(); + for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() ) { @@ -1617,7 +1620,7 @@ void wxWindowBase::ResetConstraints() constr->centreY.SetDone(FALSE); } - wxWindowList::Node *node = GetChildren().GetFirst(); + wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); while (node) { wxWindow *win = node->GetData(); @@ -1659,7 +1662,7 @@ void wxWindowBase::SetConstraintSizes(bool recurse) if ( recurse ) { - wxWindowList::Node *node = GetChildren().GetFirst(); + wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); while (node) { wxWindow *win = node->GetData(); @@ -1775,42 +1778,46 @@ void wxWindowBase::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags) co // do Update UI processing for child controls // ---------------------------------------------------------------------------- -// TODO: should this be implemented for the child window rather -// than the parent? Then you can override it e.g. for wxCheckBox -// to do the Right Thing rather than having to assume a fixed number -// of control classes. -void wxWindowBase::UpdateWindowUI() +void wxWindowBase::UpdateWindowUI(long flags) { -#if wxUSE_CONTROLS wxUpdateUIEvent event(GetId()); event.m_eventObject = this; if ( GetEventHandler()->ProcessEvent(event) ) { - if ( event.GetSetEnabled() ) - Enable(event.GetEnabled()); + DoUpdateWindowUI(event); + } - if ( event.GetSetText() ) + if (flags & wxUPDATE_UI_RECURSE) + { + wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); + while (node) { - wxControl *control = wxDynamicCastThis(wxControl); - if ( control ) - { -#if wxUSE_TEXTCTRL - wxTextCtrl *text = wxDynamicCast(control, wxTextCtrl); - if ( text ) - { - if ( event.GetText() != text->GetValue() ) - text->SetValue(event.GetText()); - } - else -#endif // wxUSE_TEXTCTRL - { - if ( event.GetText() != control->GetLabel() ) - control->SetLabel(event.GetText()); - } - } + wxWindow* child = (wxWindow*) node->GetData(); + child->UpdateWindowUI(flags); + node = node->GetNext(); } + } +} +// do the window-specific processing after processing the update event +// TODO: take specific knowledge out of this function and +// put in each control's base class. Unfortunately we don't +// yet have base implementation files for wxCheckBox and wxRadioButton. +void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event) +{ + if ( event.GetSetEnabled() ) + Enable(event.GetEnabled()); + +#if wxUSE_CONTROLS + if ( event.GetSetText() ) + { + wxControl *control = wxDynamicCastThis(wxControl); + if ( control ) + { + if ( event.GetText() != control->GetLabel() ) + control->SetLabel(event.GetText()); + } #if wxUSE_CHECKBOX wxCheckBox *checkbox = wxDynamicCastThis(wxCheckBox); if ( checkbox ) @@ -1828,9 +1835,26 @@ void wxWindowBase::UpdateWindowUI() radiobtn->SetValue(event.GetChecked()); } #endif // wxUSE_RADIOBTN + } +#endif +} + +#if 0 +// call internal idle recursively +// may be obsolete (wait until OnIdle scheme stabilises) +void wxWindowBase::ProcessInternalIdle() +{ + OnInternalIdle(); + + wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); + while (node) + { + wxWindow *child = node->GetData(); + child->ProcessInternalIdle(); + node = node->GetNext(); } -#endif // wxUSE_CONTROLS } +#endif // ---------------------------------------------------------------------------- // dialog units translations @@ -1869,7 +1893,7 @@ wxPoint wxWindowBase::ConvertDialogToPixels(const wxPoint& pt) // propagate the colour change event to the subwindows void wxWindowBase::OnSysColourChanged(wxSysColourChangedEvent& event) { - wxWindowList::Node *node = GetChildren().GetFirst(); + wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); while ( node ) { // Only propagate to non-top-level windows @@ -1885,10 +1909,15 @@ void wxWindowBase::OnSysColourChanged(wxSysColourChangedEvent& event) } } -// the default action is to populate dialog with data when it's created +// the default action is to populate dialog with data when it's created, +// and nudge the UI into displaying itself correctly in case +// we've turned the wxUpdateUIEvents frequency down low. void wxWindowBase::OnInitDialog( wxInitDialogEvent &WXUNUSED(event) ) { TransferDataToWindow(); + + // Update the UI at this point + UpdateWindowUI(wxUPDATE_UI_RECURSE); } // process Ctrl-Alt-mclick @@ -1986,6 +2015,7 @@ wxAccessible* wxWindowBase::CreateAccessible() #endif +#if !wxUSE_STL // ---------------------------------------------------------------------------- // list classes implementation // ---------------------------------------------------------------------------- @@ -1994,14 +2024,15 @@ void wxWindowListNode::DeleteData() { delete (wxWindow *)GetData(); } +#endif // ---------------------------------------------------------------------------- // borders // ---------------------------------------------------------------------------- -wxBorder wxWindowBase::GetBorder() const +wxBorder wxWindowBase::GetBorder(long flags) const { - wxBorder border = (wxBorder)(m_windowStyle & wxBORDER_MASK); + wxBorder border = (wxBorder)(flags & wxBORDER_MASK); if ( border == wxBORDER_DEFAULT ) { border = GetDefaultBorder(); @@ -2088,6 +2119,24 @@ void wxWindowBase::ReleaseMouse() GetCapture()); } +#if wxUSE_HOTKEY + +bool +wxWindowBase::RegisterHotKey(int WXUNUSED(hotkeyId), + int WXUNUSED(modifiers), + int WXUNUSED(keycode)) +{ + // not implemented + return false; +} + +bool wxWindowBase::UnregisterHotKey(int WXUNUSED(hotkeyId)) +{ + // not implemented + return false; +} + +#endif // wxUSE_HOTKEY void wxWindowBase::SendDestroyEvent() { @@ -2101,10 +2150,9 @@ void wxWindowBase::SendDestroyEvent() // event processing // ---------------------------------------------------------------------------- -#if wxUSE_VALIDATORS - -bool wxWindowBase::TryValidator(wxEvent& event) +bool wxWindowBase::TryValidator(wxEvent& wxVALIDATOR_PARAM(event)) { +#if wxUSE_VALIDATORS // Can only use the validator of the window which // is receiving the event if ( event.GetEventObject() == this ) @@ -2112,21 +2160,19 @@ bool wxWindowBase::TryValidator(wxEvent& event) wxValidator *validator = GetValidator(); if ( validator && validator->ProcessEvent(event) ) { - return TRUE; + return true; } } +#endif // wxUSE_VALIDATORS - return FALSE; + return false; } -#endif // wxUSE_VALIDATORS - bool wxWindowBase::TryParent(wxEvent& event) { - // Carry on up the parent-child hierarchy, but only if event is a command - // event: it wouldn't make sense for a parent to receive a child's size - // event, for example - if ( event.IsCommandEvent() ) + // carry on up the parent-child hierarchy if the propgation count hasn't + // reached zero yet + if ( event.ShouldPropagate() ) { // honour the requests to stop propagation at this window: this is // used by the dialogs, for example, to prevent processing the events @@ -2136,7 +2182,11 @@ bool wxWindowBase::TryParent(wxEvent& event) { wxWindow *parent = GetParent(); if ( parent && !parent->IsBeingDeleted() ) + { + wxPropagateOnce propagateOnce(event); + return parent->GetEventHandler()->ProcessEvent(event); + } } } @@ -2162,7 +2212,7 @@ wxWindow* wxGetTopLevelParent(wxWindow *win) // 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)) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2187,7 +2237,7 @@ wxAccStatus wxWindowAccessible::GetLocation(wxRect& rect, int elementId) { if (elementId <= (int) GetWindow()->GetChildren().GetCount()) { - win = (wxWindow*) GetWindow()->GetChildren().Nth(elementId-1)->GetData(); + win = GetWindow()->GetChildren().Item(elementId-1)->GetData(); } else return wxACC_FAIL; @@ -2205,7 +2255,7 @@ wxAccStatus wxWindowAccessible::GetLocation(wxRect& rect, int elementId) // Navigates from fromId to toId/toObject. wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId, - int* toId, wxAccessible** toObject) + int* WXUNUSED(toId), wxAccessible** toObject) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2235,7 +2285,8 @@ wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId, case wxNAVDIR_DOWN: case wxNAVDIR_NEXT: { - wxWindowList::Node *node = NULL; + wxWindowList::compatibility_iterator node = + wxWindowList::compatibility_iterator(); if (fromId == 0) { // Can't navigate to sibling of this window @@ -2248,12 +2299,12 @@ wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId, else { if (fromId <= (int) GetWindow()->GetChildren().GetCount()) - node = (wxWindowList::Node*) GetWindow()->GetChildren().Nth(fromId-1); + node = GetWindow()->GetChildren().Item(fromId-1); } if (node && node->GetNext()) { - wxWindow* nextWindow = (wxWindow*) node->GetNext()->Data(); + wxWindow* nextWindow = node->GetNext()->GetData(); *toObject = nextWindow->GetOrCreateAccessible(); return wxACC_OK; } @@ -2264,7 +2315,8 @@ wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId, case wxNAVDIR_UP: case wxNAVDIR_PREVIOUS: { - wxWindowList::Node *node = NULL; + wxWindowList::compatibility_iterator node = + wxWindowList::compatibility_iterator(); if (fromId == 0) { // Can't navigate to sibling of this window @@ -2277,12 +2329,12 @@ wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId, else { if (fromId <= (int) GetWindow()->GetChildren().GetCount()) - node = (wxWindowList::Node*) GetWindow()->GetChildren().Nth(fromId-1); + node = GetWindow()->GetChildren().Item(fromId-1); } if (node && node->GetPrevious()) { - wxWindow* previousWindow = (wxWindow*) node->GetPrevious()->Data(); + wxWindow* previousWindow = node->GetPrevious()->GetData(); *toObject = previousWindow->GetOrCreateAccessible(); return wxACC_OK; } @@ -2355,7 +2407,7 @@ wxAccStatus wxWindowAccessible::GetChild(int childId, wxAccessible** child) if (childId > (int) GetWindow()->GetChildren().GetCount()) return wxACC_FAIL; - wxWindow* childWindow = (wxWindow*) GetWindow()->GetChildren().Nth(childId-1)->GetData(); + wxWindow* childWindow = GetWindow()->GetChildren().Item(childId-1)->GetData(); *child = childWindow->GetOrCreateAccessible(); if (*child) return wxACC_OK; @@ -2390,7 +2442,7 @@ wxAccStatus wxWindowAccessible::GetParent(wxAccessible** parent) // 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). -wxAccStatus wxWindowAccessible::DoDefaultAction(int childId) +wxAccStatus wxWindowAccessible::DoDefaultAction(int WXUNUSED(childId)) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2405,7 +2457,7 @@ wxAccStatus wxWindowAccessible::DoDefaultAction(int childId) // 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." -wxAccStatus wxWindowAccessible::GetDefaultAction(int childId, wxString* actionName) +wxAccStatus wxWindowAccessible::GetDefaultAction(int WXUNUSED(childId), wxString* WXUNUSED(actionName)) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2415,7 +2467,7 @@ wxAccStatus wxWindowAccessible::GetDefaultAction(int childId, wxString* actionNa } // Returns the description for this object or a child. -wxAccStatus wxWindowAccessible::GetDescription(int childId, wxString* description) +wxAccStatus wxWindowAccessible::GetDescription(int WXUNUSED(childId), wxString* description) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2431,7 +2483,7 @@ wxAccStatus wxWindowAccessible::GetDescription(int childId, wxString* descriptio } // Returns help text for this object or a child, similar to tooltip text. -wxAccStatus wxWindowAccessible::GetHelpText(int childId, wxString* helpText) +wxAccStatus wxWindowAccessible::GetHelpText(int WXUNUSED(childId), wxString* helpText) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2448,7 +2500,7 @@ wxAccStatus wxWindowAccessible::GetHelpText(int childId, wxString* helpText) // Returns the keyboard shortcut for this object or child. // Return e.g. ALT+K -wxAccStatus wxWindowAccessible::GetKeyboardShortcut(int childId, wxString* shortcut) +wxAccStatus wxWindowAccessible::GetKeyboardShortcut(int WXUNUSED(childId), wxString* WXUNUSED(shortcut)) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2484,7 +2536,9 @@ wxAccStatus wxWindowAccessible::GetRole(int childId, wxAccRole* role) *role = wxROLE_SYSTEM_CLIENT; return wxACC_OK; + #if 0 return wxACC_NOT_IMPLEMENTED; + #endif } // Returns a state constant. @@ -2514,12 +2568,14 @@ wxAccStatus wxWindowAccessible::GetState(int childId, long* state) *state = 0; return wxACC_OK; + #if 0 return wxACC_NOT_IMPLEMENTED; + #endif } // Returns a localized string representing the value for the object // or child. -wxAccStatus wxWindowAccessible::GetValue(int childId, wxString* strValue) +wxAccStatus wxWindowAccessible::GetValue(int WXUNUSED(childId), wxString* WXUNUSED(strValue)) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2529,7 +2585,7 @@ wxAccStatus wxWindowAccessible::GetValue(int childId, wxString* strValue) } // Selects the object or child. -wxAccStatus wxWindowAccessible::Select(int childId, wxAccSelectionFlags selectFlags) +wxAccStatus wxWindowAccessible::Select(int WXUNUSED(childId), wxAccSelectionFlags WXUNUSED(selectFlags)) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2542,7 +2598,7 @@ wxAccStatus wxWindowAccessible::Select(int childId, wxAccSelectionFlags selectFl // 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'. -wxAccStatus wxWindowAccessible::GetFocus(int* childId, wxAccessible** child) +wxAccStatus wxWindowAccessible::GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child)) { wxASSERT( GetWindow() != NULL ); if (!GetWindow()) @@ -2559,7 +2615,7 @@ wxAccStatus wxWindowAccessible::GetFocus(int* childId, wxAccessible** child) // - 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 -wxAccStatus wxWindowAccessible::GetSelections(wxVariant* selections) +wxAccStatus wxWindowAccessible::GetSelections(wxVariant* WXUNUSED(selections)) { wxASSERT( GetWindow() != NULL ); if (!GetWindow())