]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/propdlg.cpp
GetParent() was always used in test for wxHSCROLL checked in in last commit; use...
[wxWidgets.git] / src / generic / propdlg.cpp
index f94ec74a3045e92810faa0e4ce9ab8e7756ea76b..ecbaf34ed363c673a7f18dad14d9b17a152d4d65 100644 (file)
 
 IMPLEMENT_DYNAMIC_CLASS(wxPropertySheetDialog, wxDialog)
 
+BEGIN_EVENT_TABLE(wxPropertySheetDialog, wxDialog)
+    EVT_ACTIVATE(wxPropertySheetDialog::OnActivate)
+END_EVENT_TABLE()
+
 bool wxPropertySheetDialog::Create(wxWindow* parent, wxWindowID id, const wxString& title, 
                                        const wxPoint& pos, const wxSize& sz, long style,
                                        const wxString& name)
 {
-#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
-    style = wxNO_BORDER;
-#endif    
     if (!wxDialog::Create(parent, id, title, pos, sz, style, name))
         return false;
     
@@ -80,6 +81,10 @@ void wxPropertySheetDialog::LayoutDialog()
     GetSizer()->Fit(this);
     Centre(wxBOTH);
 #endif
+#if defined(__SMARTPHONE__)
+    if (m_bookCtrl)
+        m_bookCtrl->SetFocus();
+#endif
 }
 
 // Creates the buttons, if any
@@ -123,3 +128,21 @@ void wxPropertySheetDialog::AddBookCtrl(wxSizer* sizer)
 #endif
 }
 
+void wxPropertySheetDialog::OnActivate(wxActivateEvent& event)
+{
+#if defined(__SMARTPHONE__)
+    // Attempt to focus the choice control: not yet working, but might
+    // be a step in the right direction. OnActivate overrides the default
+    // handler in toplevel.cpp that sets the focus for the first child of
+    // of the dialog (the choicebook).
+    if (event.GetActive())
+    {
+        wxChoicebook* choiceBook = wxDynamicCast(GetBookCtrl(), wxChoicebook);     
+        if (choiceBook)
+            choiceBook->SetFocus();
+    }
+    else
+#endif
+        event.Skip();
+}
+