X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7d943a71cff6dda4888e7c5aa6a084d787ac843..0cc1991e2a3ae8df8f716d5a9bf1a59e2a17d0b3:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index 2e1eee3839..07f1f084bb 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -408,7 +408,7 @@ public: void Centre(int dir = wxBOTH) { DoCentre(dir); } void Center(int dir = wxBOTH) { DoCentre(dir); } - // centre with respect to the the parent window + // centre with respect to the parent window void CentreOnParent(int dir = wxBOTH) { DoCentre(dir); } void CenterOnParent(int dir = wxBOTH) { CentreOnParent(dir); } @@ -446,7 +446,7 @@ public: // Call these to override what GetBestSize() returns. This - // method is only virtual because it is overriden in wxTLW + // method is only virtual because it is overridden in wxTLW // as a different API for SetSizeHints(). virtual void SetMinSize(const wxSize& minSize); virtual void SetMaxSize(const wxSize& maxSize); @@ -480,7 +480,7 @@ public: // windows this is just the client area of the window, but for // some like scrolled windows it is more or less independent of // the screen window size. You may override the DoXXXVirtual - // methods below for classes where that is is the case. + // methods below for classes where that is the case. void SetVirtualSize( const wxSize &size ) { DoSetVirtualSize( size.x, size.y ); } void SetVirtualSize( int x, int y ) { DoSetVirtualSize( x, y ); } @@ -525,12 +525,7 @@ public: // tells the item how much more space there is available in the opposite // direction (-1 if unknown). virtual bool - InformFirstDirection(int WXUNUSED(direction), - int WXUNUSED(size), - int WXUNUSED(availableOtherDir)) - { - return false; - } + InformFirstDirection(int direction, int size, int availableOtherDir); // sends a size event to the window using its current size -- this has an // effect of refreshing the window layout @@ -803,6 +798,13 @@ public: bool ProcessWindowEvent(wxEvent& event) { return GetEventHandler()->ProcessEvent(event); } + // Call GetEventHandler()->ProcessEventLocally(): this should be used + // instead of calling ProcessEventLocally() directly on the window + // itself as this wouldn't take any pushed event handlers into account + // correctly + bool ProcessWindowEventLocally(wxEvent& event) + { return GetEventHandler()->ProcessEventLocally(event); } + // Process an event by calling GetEventHandler()->ProcessEvent() and // handling any exceptions thrown by event handlers. It's mostly useful // when processing wx events when called from C code (e.g. in GTK+ @@ -830,6 +832,7 @@ protected: // The same holds for all other wxEvtHandler functions. using wxEvtHandler::ProcessEvent; + using wxEvtHandler::ProcessEventLocally; #if wxUSE_THREADS using wxEvtHandler::ProcessThreadEvent; #endif @@ -886,16 +889,16 @@ public: // dialog units translations // ------------------------- - wxPoint ConvertPixelsToDialog( const wxPoint& pt ); - wxPoint ConvertDialogToPixels( const wxPoint& pt ); - wxSize ConvertPixelsToDialog( const wxSize& sz ) + wxPoint ConvertPixelsToDialog( const wxPoint& pt ) const; + wxPoint ConvertDialogToPixels( const wxPoint& pt ) const; + wxSize ConvertPixelsToDialog( const wxSize& sz ) const { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); } - wxSize ConvertDialogToPixels( const wxSize& sz ) + wxSize ConvertDialogToPixels( const wxSize& sz ) const { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); @@ -1139,7 +1142,8 @@ public: // simply return the id of the selected item or wxID_NONE without // generating any events - int GetPopupMenuSelectionFromUser(wxMenu& menu, const wxPoint& pos) + int GetPopupMenuSelectionFromUser(wxMenu& menu, + const wxPoint& pos = wxDefaultPosition) { return DoGetPopupMenuSelectionFromUser(menu, pos.x, pos.y); } int GetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y) { return DoGetPopupMenuSelectionFromUser(menu, x, y); } @@ -1361,10 +1365,11 @@ public: // virtual function for implementing internal idle // behaviour - virtual void OnInternalIdle() {} + virtual void OnInternalIdle(); - // call internal idle recursively -// void ProcessInternalIdle() ; + // Send idle event to window and all subwindows + // Returns true if more idle time is requested. + virtual bool SendIdleEvents(wxIdleEvent& event); // get the handle of the window for the underlying window system: this // is only used for wxWin itself or for user code which wants to call @@ -1653,7 +1658,7 @@ protected: // (GetBorderSize() will be used to add them) virtual wxSize DoGetBestClientSize() const { return wxDefaultSize; } - // this is the virtual function to be overriden in any derived class which + // this is the virtual function to be overridden in any derived class which // wants to change how SetSize() or Move() works - it is called by all // versions of these functions in the base class virtual void DoSetSize(int x, int y, @@ -1671,8 +1676,9 @@ protected: // of the left and the right border in the x component of the returned size // and the sum of the heights of the top and bottom borders in the y one // - // NB: this is currently only implemented by wxMSW and wxUniv so far and - // simply asserts in the other ports + // NB: this is currently only implemented properly for wxMSW, wxGTK and + // wxUniv and doesn't behave correctly in the presence of scrollbars in + // the other ports virtual wxSize DoGetBorderSize() const; // move the window to the specified location and resize it: this is called @@ -1736,6 +1742,8 @@ private: // explicitly disabled with SetAutoLayout(false) void InternalOnSize(wxSizeEvent& event); + // base for dialog unit conversion, i.e. average character size + wxSize GetDlgUnitBase() const; // the stack of windows which have captured the mouse static struct WXDLLIMPEXP_FWD_CORE wxWindowNext *ms_winCaptureNext;