+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();
+}
+
+// Resize dialog if necessary
+void wxPropertySheetDialog::OnIdle(wxIdleEvent& event)
+{
+ event.Skip();
+
+ if ((GetSheetStyle() & wxPROPSHEET_SHRINKTOFIT) && GetBookCtrl())
+ {
+ int sel = GetBookCtrl()->GetSelection();
+ if (sel != -1 && sel != m_selectedPage)
+ {
+ GetBookCtrl()->InvalidateBestSize();
+ InvalidateBestSize();
+ SetSizeHints(-1, -1, -1, -1);
+
+ m_selectedPage = sel;
+ LayoutDialog(0);
+ }
+ }
+}
+
+// Override function in base
+wxWindow* wxPropertySheetDialog::GetContentWindow() const
+{
+ return GetBookCtrl();
+}
+
+#endif // wxUSE_BOOKCTRL