As yet unsuccessful attempt to set the focus to the choice control.
Also removed unnecessary border style setting code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -76,6 +76,9 @@ public:
|
|||||||
|
|
||||||
virtual bool DeleteAllPages();
|
virtual bool DeleteAllPages();
|
||||||
|
|
||||||
|
// returns the choice control
|
||||||
|
wxChoice* GetChoiceCtrl() const { return m_choice; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxWindow *DoRemovePage(size_t page);
|
virtual wxWindow *DoRemovePage(size_t page);
|
||||||
|
|
||||||
|
@@ -71,8 +71,6 @@ public:
|
|||||||
long style = wxDEFAULT_DIALOG_STYLE,
|
long style = wxDEFAULT_DIALOG_STYLE,
|
||||||
const wxString& name = wxDialogNameStr);
|
const wxString& name = wxDialogNameStr);
|
||||||
|
|
||||||
void Init();
|
|
||||||
|
|
||||||
//// Accessors
|
//// Accessors
|
||||||
|
|
||||||
// Set and get the notebook
|
// Set and get the notebook
|
||||||
@@ -100,11 +98,18 @@ public:
|
|||||||
// Adds the book control to the inner sizer.
|
// Adds the book control to the inner sizer.
|
||||||
virtual void AddBookCtrl(wxSizer* sizer);
|
virtual void AddBookCtrl(wxSizer* sizer);
|
||||||
|
|
||||||
|
// Set the focus
|
||||||
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxBookCtrlBase* m_bookCtrl;
|
wxBookCtrlBase* m_bookCtrl;
|
||||||
wxSizer* m_innerSizer; // sizer for extra space
|
wxSizer* m_innerSizer; // sizer for extra space
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog)
|
DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog)
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_PROPDLG_H_
|
#endif // _WX_PROPDLG_H_
|
||||||
|
@@ -39,13 +39,14 @@
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPropertySheetDialog, wxDialog)
|
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,
|
bool wxPropertySheetDialog::Create(wxWindow* parent, wxWindowID id, const wxString& title,
|
||||||
const wxPoint& pos, const wxSize& sz, long style,
|
const wxPoint& pos, const wxSize& sz, long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
|
|
||||||
style = wxNO_BORDER;
|
|
||||||
#endif
|
|
||||||
if (!wxDialog::Create(parent, id, title, pos, sz, style, name))
|
if (!wxDialog::Create(parent, id, title, pos, sz, style, name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -80,6 +81,10 @@ void wxPropertySheetDialog::LayoutDialog()
|
|||||||
GetSizer()->Fit(this);
|
GetSizer()->Fit(this);
|
||||||
Centre(wxBOTH);
|
Centre(wxBOTH);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__SMARTPHONE__)
|
||||||
|
if (m_bookCtrl)
|
||||||
|
m_bookCtrl->SetFocus();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates the buttons, if any
|
// Creates the buttons, if any
|
||||||
@@ -123,3 +128,21 @@ void wxPropertySheetDialog::AddBookCtrl(wxSizer* sizer)
|
|||||||
#endif
|
#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();
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user