+void MyFrame::OnCaretMove(wxCommandEvent& WXUNUSED(event))
+{
+ m_canvas->MoveCaret(10, 10);
+}
+
+void MyFrame::OnSetBlinkTime(wxCommandEvent& WXUNUSED(event))
+{
+ long blinkTime = wxGetNumberFromUser
+ (
+ wxT("The caret blink time is the time between two blinks"),
+ wxT("Time in milliseconds:"),
+ wxT("wxCaret sample"),
+ wxCaret::GetBlinkTime(), 0, 10000,
+ this
+ );
+ if ( blinkTime != -1 )
+ {
+ wxCaret::SetBlinkTime((int)blinkTime);
+ m_canvas->CreateCaret();
+ wxLogStatus(this, wxT("Blink time set to %ld milliseconds."), blinkTime);
+ }
+}
+
+void MyFrame::OnSetFontSize(wxCommandEvent& WXUNUSED(event))
+{
+ long fontSize = wxGetNumberFromUser
+ (
+ wxT("The font size also determines the caret size so\nthis demonstrates resizing the caret."),
+ wxT("Font size (in points):"),
+ wxT("wxCaret sample"),
+ 12, 1, 100,
+ this
+ );
+
+ if ( fontSize != -1 )
+ {
+ m_canvas->SetFontSize((int)fontSize);
+ }
+}