Widgets_BorderDouble,
Widgets_BorderDefault,
+ Widgets_LayoutDirection,
+
Widgets_GlobalBusyCursor,
Widgets_BusyCursor,
TextEntry_DisableAutoComplete = TextEntry_Begin,
TextEntry_AutoCompleteFixed,
TextEntry_AutoCompleteFilenames,
+ TextEntry_AutoCompleteDirectories,
TextEntry_AutoCompleteCustom,
TextEntry_SetHint,
void OnEnable(wxCommandEvent& event);
void OnSetBorder(wxCommandEvent& event);
+ void OnToggleLayoutDirection(wxCommandEvent& event);
+
void OnToggleGlobalBusyCursor(wxCommandEvent& event);
void OnToggleBusyCursor(wxCommandEvent& event);
void OnDisableAutoComplete(wxCommandEvent& event);
void OnAutoCompleteFixed(wxCommandEvent& event);
void OnAutoCompleteFilenames(wxCommandEvent& event);
+ void OnAutoCompleteDirectories(wxCommandEvent& event);
void OnAutoCompleteCustom(wxCommandEvent& event);
void OnSetHint(wxCommandEvent& event);
EVT_MENU_RANGE(Widgets_BorderNone, Widgets_BorderDefault,
WidgetsFrame::OnSetBorder)
+ EVT_MENU(Widgets_LayoutDirection, WidgetsFrame::OnToggleLayoutDirection)
+
EVT_MENU(Widgets_GlobalBusyCursor, WidgetsFrame::OnToggleGlobalBusyCursor)
EVT_MENU(Widgets_BusyCursor, WidgetsFrame::OnToggleBusyCursor)
EVT_MENU(TextEntry_DisableAutoComplete, WidgetsFrame::OnDisableAutoComplete)
EVT_MENU(TextEntry_AutoCompleteFixed, WidgetsFrame::OnAutoCompleteFixed)
EVT_MENU(TextEntry_AutoCompleteFilenames, WidgetsFrame::OnAutoCompleteFilenames)
+ EVT_MENU(TextEntry_AutoCompleteDirectories, WidgetsFrame::OnAutoCompleteDirectories)
EVT_MENU(TextEntry_AutoCompleteCustom, WidgetsFrame::OnAutoCompleteCustom)
EVT_MENU(TextEntry_SetHint, WidgetsFrame::OnSetHint)
title += wxT("wxMAC");
#elif defined(__WXMOTIF__)
title += wxT("wxMOTIF");
-#elif defined(__WXPALMOS5__)
- title += wxT("wxPALMOS5");
-#elif defined(__WXPALMOS6__)
- title += wxT("wxPALMOS6");
#else
title += wxT("wxWidgets");
#endif
menuBorders->AppendRadioItem(Widgets_BorderSunken, wxT("S&unken\tCtrl-Shift-5"));
menuWidget->AppendSubMenu(menuBorders, wxT("Set &border"));
+ menuWidget->AppendSeparator();
+ menuWidget->AppendCheckItem(Widgets_LayoutDirection,
+ "Toggle &layout direction\tCtrl-L");
+
menuWidget->AppendSeparator();
menuWidget->AppendCheckItem(Widgets_GlobalBusyCursor,
wxT("Toggle &global busy cursor\tCtrl-Shift-U"));
wxT("Fixed-&list auto-completion"));
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFilenames,
wxT("&Files names auto-completion"));
+ menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteDirectories,
+ wxT("&Directories names auto-completion"));
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteCustom,
wxT("&Custom auto-completion"));
menuTextEntry->AppendSeparator();
(*it)->SetFont(m_font);
(*it)->Refresh();
}
+
+ // The best size of the widget could have changed after changing its font,
+ // so re-layout to show it correctly.
+ page->Layout();
#else
wxLogMessage(wxT("Font selection dialog not available in current build."));
#endif
page->RecreateWidget();
}
+void WidgetsFrame::OnToggleLayoutDirection(wxCommandEvent& event)
+{
+ wxLayoutDirection dir = event.IsChecked() ? wxLayout_RightToLeft
+ : wxLayout_LeftToRight;
+
+ const Widgets widgets = CurrentPage()->GetWidgets();
+ for ( Widgets::const_iterator it = widgets.begin();
+ it != widgets.end();
+ ++it )
+ {
+ (*it)->SetLayoutDirection(dir);
+ (*it)->Refresh();
+ }
+}
+
void WidgetsFrame::OnToggleGlobalBusyCursor(wxCommandEvent& event)
{
if ( event.IsChecked() )
}
}
+void WidgetsFrame::OnAutoCompleteDirectories(wxCommandEvent& WXUNUSED(event))
+{
+ wxTextEntryBase *entry = CurrentPage()->GetTextEntry();
+ wxCHECK_RET( entry, "menu item should be disabled" );
+
+ if ( entry->AutoCompleteDirectories() )
+ {
+ wxLogMessage("Enabled auto completion of directories.");
+ }
+ else
+ {
+ wxLogMessage("AutoCompleteDirectories() failed.");
+ }
+}
+
void WidgetsFrame::OnAutoCompleteCustom(wxCommandEvent& WXUNUSED(event))
{
wxTextEntryBase *entry = CurrentPage()->GetTextEntry();