Also made it easier to derive from wxWizard and override behaviour.
- Made wxSizer::Fit() set the client size of the target window
- Add support for wxDatePickerCtrl in wxGenericValidator (Herry Ayen Yang)
+- Added wxWindow::HasFocus().
wxGTK:
\wxheading{See also}
-\helpref{wxWindow::SetFocus}{wxwindowsetfocus}
+\helpref{wxWindow::SetFocus}{wxwindowsetfocus},
+\helpref{wxWindow::HasFocus}{wxwindowhasfocus}
Returns \texttt{true} if the window has the given \arg{flag} bit set.
+\membersection{wxWindow::HasFocus}\label{wxwindowhasfocus}
+
+\constfunc{virtual bool}{HasFocus}{\void}
+
+Returns \true if the window (or in case of composite controls, its main
+child window) has focus.
+
+\wxheading{See also}
+
+\helpref{FindFocus}{wxwindowfindfocus}
+
+
\membersection{wxWindow::HasMultiplePages}\label{wxwindowhasmultiplepages}
\constfunc{virtual bool}{HasMultiplePages}{\void}
\wxheading{See also}
-\helpref{wxFocusEvent}{wxfocusevent}
-\helpref{wxPanel::SetFocus}{wxpanelsetfocus}
+\helpref{HasFocus}{wxwindowhasfocus},
+\helpref{wxFocusEvent}{wxfocusevent},
+\helpref{wxPanel::SetFocus}{wxpanelsetfocus},
\helpref{wxPanel::SetFocusIgnoringChildren}{wxpanelsetfocusignoringchildren}
static wxWindow *DoFindFocus() /* = 0: implement in derived classes */;
+ // return true if the window has focus (handles composite windows
+ // correctly - returns true if GetMainWindowOfCompositeControl()
+ // has focus)
+ virtual bool HasFocus() const;
+
// can this window have focus in principle?
//
// the difference between AcceptsFocus[FromKeyboard]() and CanAcceptFocus
return win ? win->GetMainWindowOfCompositeControl() : NULL;
}
+bool wxWindowBase::HasFocus() const
+{
+ wxWindowBase *win = DoFindFocus();
+ return win == this ||
+ win == wxConstCast(this, wxWindowBase)->GetMainWindowOfCompositeControl();
+}
+
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------