+
+
+wxMenu *
+wxLayoutWindow::MakeFormatMenu()
+{
+ wxMenu *m = new wxMenu(_("Layout Menu"));
+
+ m->Append(WXLOWIN_MENU_LARGER ,_("&Larger"),_("Switch to larger font."), false);
+ m->Append(WXLOWIN_MENU_SMALLER ,_("&Smaller"),_("Switch to smaller font."), false);
+ m->AppendSeparator();
+ m->Append(WXLOWIN_MENU_UNDERLINE_ON, _("&Underline on"),_("Activate underline mode."), false);
+ m->Append(WXLOWIN_MENU_UNDERLINE_OFF,_("&Underline off"),_("Deactivate underline mode."), false);
+ m->Append(WXLOWIN_MENU_BOLD_ON ,_("&Bold on"),_("Activate bold mode."), false);
+ m->Append(WXLOWIN_MENU_BOLD_OFF ,_("&Bold off"),_("Deactivate bold mode."), false);
+ m->Append(WXLOWIN_MENU_ITALICS_ON ,_("&Italics on"),_("Activate italics mode."), false);
+ m->Append(WXLOWIN_MENU_ITALICS_OFF ,_("&Italics off"),_("Deactivate italics mode."), false);
+ m->AppendSeparator();
+ m->Append(WXLOWIN_MENU_ROMAN ,_("&Roman"),_("Switch to roman font."), false);
+ m->Append(WXLOWIN_MENU_TYPEWRITER,_("&Typewriter"),_("Switch to typewriter font."), false);
+ m->Append(WXLOWIN_MENU_SANSSERIF ,_("&Sans Serif"),_("Switch to sans serif font."), false);
+ return m;
+}
+
+void wxLayoutWindow::OnMenu(wxCommandEvent& event)
+{
+ switch (event.GetId())
+ {
+ case WXLOWIN_MENU_LARGER:
+ m_llist->SetFontLarger(); break;
+ case WXLOWIN_MENU_SMALLER:
+ m_llist->SetFontSmaller(); break;
+ case WXLOWIN_MENU_UNDERLINE_ON:
+ m_llist->SetFontUnderline(true); break;
+ case WXLOWIN_MENU_UNDERLINE_OFF:
+ m_llist->SetFontUnderline(false); break;
+ case WXLOWIN_MENU_BOLD_ON:
+ m_llist->SetFontWeight(wxBOLD); break;
+ case WXLOWIN_MENU_BOLD_OFF:
+ m_llist->SetFontWeight(wxNORMAL); break;
+ case WXLOWIN_MENU_ITALICS_ON:
+ m_llist->SetFontStyle(wxITALIC); break;
+ case WXLOWIN_MENU_ITALICS_OFF:
+ m_llist->SetFontStyle(wxNORMAL); break;
+ case WXLOWIN_MENU_ROMAN:
+ m_llist->SetFontFamily(wxROMAN); break;
+ case WXLOWIN_MENU_TYPEWRITER:
+ m_llist->SetFontFamily(wxFIXED); break;
+ case WXLOWIN_MENU_SANSSERIF:
+ m_llist->SetFontFamily(wxSWISS); break;
+ }
+}
+
+void
+wxLayoutWindow::OnSetFocus(wxFocusEvent &ev)
+{
+ m_HaveFocus = true;
+ DoPaint(); // to repaint the cursor
+}
+
+void
+wxLayoutWindow::OnKillFocus(wxFocusEvent &ev)
+{
+ m_HaveFocus = false;
+ DoPaint(); // to repaint the cursor
+}