Removed wxWS_EX_NO_AUTOFOCUS (use AcceptsFocus instead)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-10-04 14:33:20 +00:00
parent 08793a6da9
commit 4f43043985
4 changed files with 4 additions and 7 deletions

View File

@@ -897,9 +897,6 @@ enum wxStretch
// descend into all subwindows // descend into all subwindows
#define wxWS_EX_VALIDATE_RECURSIVELY 0x00000001 #define wxWS_EX_VALIDATE_RECURSIVELY 0x00000001
// Don't automatically set the focus when left-clicking on the window
#define wxWS_EX_NO_AUTOFOCUS 0x10000000
/* /*
* wxFrame/wxDialog style flags * wxFrame/wxDialog style flags
*/ */

View File

@@ -407,6 +407,9 @@ public:
// Do the toolbar button updates (check for EVT_UPDATE_UI handlers) // Do the toolbar button updates (check for EVT_UPDATE_UI handlers)
virtual void DoToolbarUpdates(); virtual void DoToolbarUpdates();
// Don't want toolbars to accept the focus
bool AcceptsFocus() const { return FALSE; }
protected: protected:
// to implement in derived classes // to implement in derived classes
// ------------------------------- // -------------------------------

View File

@@ -205,9 +205,6 @@ bool wxToolBar::Create(wxWindow *parent,
long style, long style,
const wxString& name) const wxString& name)
{ {
// Don't want to grab the focus when we left click
SetExtraStyle(GetExtraStyle() | wxWS_EX_NO_AUTOFOCUS);
// common initialisation // common initialisation
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE; return FALSE;

View File

@@ -1897,7 +1897,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
// set focus to this window // set focus to this window
if ((GetExtraStyle() & wxWS_EX_NO_AUTOFOCUS) != wxWS_EX_NO_AUTOFOCUS) if (AcceptsFocus())
SetFocus(); SetFocus();
// fall through // fall through