// control ids
enum
{
- TextPage_Reset = 100,
+ TextPage_Reset = wxID_HIGHEST,
TextPage_Set,
TextPage_Add,
{
public:
// ctor(s) and dtor
- TextWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist);
+ TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~TextWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_text; }
+ virtual void RecreateWidget() { CreateText(); }
+
+ // lazy creation of the content
+ virtual void CreateContent();
protected:
// create an info text contorl
// implementation
// ============================================================================
-IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"));
+#if defined(__WXX11__)
+ #define FAMILY_CTRLS NATIVE_CTRLS
+#elif defined(__WXUNIVERSAL__)
+ #define FAMILY_CTRLS UNIVERSAL_CTRLS
+#else
+ #define FAMILY_CTRLS NATIVE_CTRLS
+#endif
+
+IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"),
+ FAMILY_CTRLS | EDITABLE_CTRLS
+ );
// ----------------------------------------------------------------------------
// TextWidgetsPage creation
// ----------------------------------------------------------------------------
-TextWidgetsPage::TextWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist)
- : WidgetsPage(book)
+TextWidgetsPage::TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist)
+ : WidgetsPage(book, imaglist, text_xpm)
{
- imaglist->Add(wxBitmap(text_xpm));
-
// init everything
#ifdef __WXMSW__
m_radioKind =
m_posLast =
m_selFrom =
m_selTo = -2; // not -1 which means "no selection"
+}
+void TextWidgetsPage::CreateContent()
+{
// left pane
static const wxString modes[] =
{
void TextWidgetsPage::CreateText()
{
- int flags = 0;
+ int flags = ms_defaultFlags;
switch ( m_radioTextLines->GetSelection() )
{
default:
break;
case WrapStyle_Char:
- flags |= wxTE_LINEWRAP;
+ flags |= wxTE_CHARWRAP;
break;
case WrapStyle_Best: