]> git.saurik.com Git - wxWidgets.git/commitdiff
Removed wxWS_EX_NO_AUTOFOCUS (use AcceptsFocus instead)
authorJulian Smart <julian@anthemion.co.uk>
Wed, 4 Oct 2000 14:33:20 +0000 (14:33 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 4 Oct 2000 14:33:20 +0000 (14:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
include/wx/tbarbase.h
src/msw/tbar95.cpp
src/msw/window.cpp

index d92fe25fb820613818590c424d170023c0371c1a..b850a396d0253990213d6e218102dc53cad23adc 100644 (file)
@@ -897,9 +897,6 @@ enum wxStretch
 // descend into all subwindows
 #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
  */
index aa19f52861e9ab70b892c69f421d8e49587ead7c..94d46d65890359c2b933daac73e95e1bded2ee41 100644 (file)
@@ -407,6 +407,9 @@ public:
     // Do the toolbar button updates (check for EVT_UPDATE_UI handlers)
     virtual void DoToolbarUpdates();
 
+    // Don't want toolbars to accept the focus
+    bool AcceptsFocus() const { return FALSE; }
+
 protected:
     // to implement in derived classes
     // -------------------------------
index 57dc3bd15b6b0fe09017e5cd77d61d4958c3e8d0..2a1a5e7ce19cd523c15aff0514068fd71ecf353e 100644 (file)
@@ -205,9 +205,6 @@ bool wxToolBar::Create(wxWindow *parent,
                        long style,
                        const wxString& name)
 {
-    // Don't want to grab the focus when we left click
-    SetExtraStyle(GetExtraStyle() | wxWS_EX_NO_AUTOFOCUS);
-
     // common initialisation
     if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
         return FALSE;
index 507019bbf8bc167790449d0b9d43535f753d6808..e6d0d10345b81ea45c4d4a20275a8ab98e465762 100644 (file)
@@ -1897,7 +1897,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
 
         case WM_LBUTTONDOWN:
            // set focus to this window
-           if ((GetExtraStyle() & wxWS_EX_NO_AUTOFOCUS) != wxWS_EX_NO_AUTOFOCUS)
+           if (AcceptsFocus())
                 SetFocus();
 
            // fall through