+void MyFrame::OnJustify(wxRibbonToolBarEvent& evt)
+{
+ long style = m_logwindow->GetWindowStyle() &
+ ~(wxTE_LEFT | wxTE_CENTER | wxTE_RIGHT);
+ switch(evt.GetId())
+ {
+ case wxID_JUSTIFY_LEFT:
+ m_logwindow->SetWindowStyle(style | wxTE_LEFT);
+ break;
+ case wxID_JUSTIFY_CENTER:
+ m_logwindow->SetWindowStyle(style | wxTE_CENTER);
+ break;
+ case wxID_JUSTIFY_RIGHT:
+ m_logwindow->SetWindowStyle(style | wxTE_RIGHT);
+ break;
+ }
+}
+
+void MyFrame::OnJustifyUpdateUI(wxUpdateUIEvent& evt)
+{
+ switch(evt.GetId())
+ {
+ case wxID_JUSTIFY_LEFT:
+ evt.Check(!m_logwindow->HasFlag(wxTE_CENTER | wxTE_RIGHT));
+ break;
+ case wxID_JUSTIFY_CENTER:
+ evt.Check(m_logwindow->HasFlag(wxTE_CENTER));
+ break;
+ case wxID_JUSTIFY_RIGHT:
+ evt.Check(m_logwindow->HasFlag(wxTE_RIGHT));
+ break;
+ }
+}
+