demonstrates SetCursor() now too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -204,7 +204,7 @@ bool MyApp::OnInit()
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl)
|
BEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl)
|
||||||
EVT_KEY_DOWN(MyTextCtrl::OnKeyDown)
|
EVT_KEY_DOWN(MyTextCtrl::OnKeyDown)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
|
void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
|
||||||
@@ -301,55 +301,55 @@ const int ID_SLIDER = 181;
|
|||||||
const int ID_SPIN = 182;
|
const int ID_SPIN = 182;
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
||||||
EVT_SIZE ( MyPanel::OnSize)
|
EVT_SIZE ( MyPanel::OnSize)
|
||||||
EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, MyPanel::OnPageChanged)
|
EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, MyPanel::OnPageChanged)
|
||||||
EVT_LISTBOX (ID_LISTBOX, MyPanel::OnListBox)
|
EVT_LISTBOX (ID_LISTBOX, MyPanel::OnListBox)
|
||||||
EVT_LISTBOX_DCLICK(ID_LISTBOX, MyPanel::OnListBoxDoubleClick)
|
EVT_LISTBOX_DCLICK(ID_LISTBOX, MyPanel::OnListBoxDoubleClick)
|
||||||
EVT_BUTTON (ID_LISTBOX_SEL_NUM, MyPanel::OnListBoxButtons)
|
EVT_BUTTON (ID_LISTBOX_SEL_NUM, MyPanel::OnListBoxButtons)
|
||||||
EVT_BUTTON (ID_LISTBOX_SEL_STR, MyPanel::OnListBoxButtons)
|
EVT_BUTTON (ID_LISTBOX_SEL_STR, MyPanel::OnListBoxButtons)
|
||||||
EVT_BUTTON (ID_LISTBOX_CLEAR, MyPanel::OnListBoxButtons)
|
EVT_BUTTON (ID_LISTBOX_CLEAR, MyPanel::OnListBoxButtons)
|
||||||
EVT_BUTTON (ID_LISTBOX_APPEND, MyPanel::OnListBoxButtons)
|
EVT_BUTTON (ID_LISTBOX_APPEND, MyPanel::OnListBoxButtons)
|
||||||
EVT_BUTTON (ID_LISTBOX_DELETE, MyPanel::OnListBoxButtons)
|
EVT_BUTTON (ID_LISTBOX_DELETE, MyPanel::OnListBoxButtons)
|
||||||
EVT_BUTTON (ID_LISTBOX_FONT, MyPanel::OnListBoxButtons)
|
EVT_BUTTON (ID_LISTBOX_FONT, MyPanel::OnListBoxButtons)
|
||||||
EVT_CHECKBOX (ID_LISTBOX_ENABLE, MyPanel::OnListBoxButtons)
|
EVT_CHECKBOX (ID_LISTBOX_ENABLE, MyPanel::OnListBoxButtons)
|
||||||
EVT_CHOICE (ID_CHOICE, MyPanel::OnChoice)
|
EVT_CHOICE (ID_CHOICE, MyPanel::OnChoice)
|
||||||
EVT_BUTTON (ID_CHOICE_SEL_NUM, MyPanel::OnChoiceButtons)
|
EVT_BUTTON (ID_CHOICE_SEL_NUM, MyPanel::OnChoiceButtons)
|
||||||
EVT_BUTTON (ID_CHOICE_SEL_STR, MyPanel::OnChoiceButtons)
|
EVT_BUTTON (ID_CHOICE_SEL_STR, MyPanel::OnChoiceButtons)
|
||||||
EVT_BUTTON (ID_CHOICE_CLEAR, MyPanel::OnChoiceButtons)
|
EVT_BUTTON (ID_CHOICE_CLEAR, MyPanel::OnChoiceButtons)
|
||||||
EVT_BUTTON (ID_CHOICE_APPEND, MyPanel::OnChoiceButtons)
|
EVT_BUTTON (ID_CHOICE_APPEND, MyPanel::OnChoiceButtons)
|
||||||
EVT_BUTTON (ID_CHOICE_DELETE, MyPanel::OnChoiceButtons)
|
EVT_BUTTON (ID_CHOICE_DELETE, MyPanel::OnChoiceButtons)
|
||||||
EVT_BUTTON (ID_CHOICE_FONT, MyPanel::OnChoiceButtons)
|
EVT_BUTTON (ID_CHOICE_FONT, MyPanel::OnChoiceButtons)
|
||||||
EVT_CHECKBOX (ID_CHOICE_ENABLE, MyPanel::OnChoiceButtons)
|
EVT_CHECKBOX (ID_CHOICE_ENABLE, MyPanel::OnChoiceButtons)
|
||||||
EVT_COMBOBOX (ID_COMBO, MyPanel::OnCombo)
|
EVT_COMBOBOX (ID_COMBO, MyPanel::OnCombo)
|
||||||
EVT_BUTTON (ID_COMBO_SEL_NUM, MyPanel::OnComboButtons)
|
EVT_BUTTON (ID_COMBO_SEL_NUM, MyPanel::OnComboButtons)
|
||||||
EVT_BUTTON (ID_COMBO_SEL_STR, MyPanel::OnComboButtons)
|
EVT_BUTTON (ID_COMBO_SEL_STR, MyPanel::OnComboButtons)
|
||||||
EVT_BUTTON (ID_COMBO_CLEAR, MyPanel::OnComboButtons)
|
EVT_BUTTON (ID_COMBO_CLEAR, MyPanel::OnComboButtons)
|
||||||
EVT_BUTTON (ID_COMBO_APPEND, MyPanel::OnComboButtons)
|
EVT_BUTTON (ID_COMBO_APPEND, MyPanel::OnComboButtons)
|
||||||
EVT_BUTTON (ID_COMBO_DELETE, MyPanel::OnComboButtons)
|
EVT_BUTTON (ID_COMBO_DELETE, MyPanel::OnComboButtons)
|
||||||
EVT_BUTTON (ID_COMBO_FONT, MyPanel::OnComboButtons)
|
EVT_BUTTON (ID_COMBO_FONT, MyPanel::OnComboButtons)
|
||||||
EVT_CHECKBOX (ID_COMBO_ENABLE, MyPanel::OnComboButtons)
|
EVT_CHECKBOX (ID_COMBO_ENABLE, MyPanel::OnComboButtons)
|
||||||
EVT_RADIOBOX (ID_RADIOBOX, MyPanel::OnRadio)
|
EVT_RADIOBOX (ID_RADIOBOX, MyPanel::OnRadio)
|
||||||
EVT_BUTTON (ID_RADIOBOX_SEL_NUM, MyPanel::OnRadioButtons)
|
EVT_BUTTON (ID_RADIOBOX_SEL_NUM, MyPanel::OnRadioButtons)
|
||||||
EVT_BUTTON (ID_RADIOBOX_SEL_STR, MyPanel::OnRadioButtons)
|
EVT_BUTTON (ID_RADIOBOX_SEL_STR, MyPanel::OnRadioButtons)
|
||||||
EVT_BUTTON (ID_RADIOBOX_FONT, MyPanel::OnRadioButtons)
|
EVT_BUTTON (ID_RADIOBOX_FONT, MyPanel::OnRadioButtons)
|
||||||
EVT_CHECKBOX (ID_RADIOBOX_ENABLE, MyPanel::OnRadioButtons)
|
EVT_CHECKBOX (ID_RADIOBOX_ENABLE, MyPanel::OnRadioButtons)
|
||||||
EVT_BUTTON (ID_SET_FONT, MyPanel::OnSetFont)
|
EVT_BUTTON (ID_SET_FONT, MyPanel::OnSetFont)
|
||||||
EVT_SLIDER (ID_SLIDER, MyPanel::OnSliderUpdate)
|
EVT_SLIDER (ID_SLIDER, MyPanel::OnSliderUpdate)
|
||||||
EVT_SPIN (ID_SPIN, MyPanel::OnSpinUpdate)
|
EVT_SPIN (ID_SPIN, MyPanel::OnSpinUpdate)
|
||||||
EVT_BUTTON (ID_PASTE_TEXT, MyPanel::OnPasteFromClipboard)
|
EVT_BUTTON (ID_PASTE_TEXT, MyPanel::OnPasteFromClipboard)
|
||||||
EVT_BUTTON (ID_COPY_TEXT, MyPanel::OnCopyToClipboard)
|
EVT_BUTTON (ID_COPY_TEXT, MyPanel::OnCopyToClipboard)
|
||||||
EVT_BUTTON (ID_MOVE_END_ZONE, MyPanel::OnMoveToEndOfText)
|
EVT_BUTTON (ID_MOVE_END_ZONE, MyPanel::OnMoveToEndOfText)
|
||||||
EVT_BUTTON (ID_MOVE_END_ENTRY, MyPanel::OnMoveToEndOfEntry)
|
EVT_BUTTON (ID_MOVE_END_ENTRY, MyPanel::OnMoveToEndOfEntry)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
||||||
: wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ),
|
: wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ),
|
||||||
m_text(NULL), m_notebook(NULL)
|
m_text(NULL), m_notebook(NULL)
|
||||||
{
|
{
|
||||||
// SetBackgroundColour("cadet blue");
|
// SetBackgroundColour("cadet blue");
|
||||||
|
|
||||||
m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
|
m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
|
||||||
// m_text->SetBackgroundColour("wheat");
|
// m_text->SetBackgroundColour("wheat");
|
||||||
|
|
||||||
m_notebook = new wxNotebook( this, ID_NOTEBOOK, wxPoint(0,0), wxSize(200,150) );
|
m_notebook = new wxNotebook( this, ID_NOTEBOOK, wxPoint(0,0), wxSize(200,150) );
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
m_notebook->SetImageList(imagelist);
|
m_notebook->SetImageList(imagelist);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// No images for now
|
// No images for now
|
||||||
#define Image_List -1
|
#define Image_List -1
|
||||||
#define Image_Choice -1
|
#define Image_Choice -1
|
||||||
#define Image_Combo -1
|
#define Image_Combo -1
|
||||||
@@ -421,6 +421,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
|
|
||||||
panel = new wxPanel(m_notebook);
|
panel = new wxPanel(m_notebook);
|
||||||
m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 5, choices );
|
m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 5, choices );
|
||||||
|
m_listbox->SetCursor(*wxCROSS_CURSOR);
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
m_listbox->SetToolTip( "This is a list box" );
|
m_listbox->SetToolTip( "This is a list box" );
|
||||||
#endif // wxUSE_TOOLTIPS
|
#endif // wxUSE_TOOLTIPS
|
||||||
@@ -465,22 +466,22 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
m_notebook->AddPage(panel, "wxComboBox", FALSE, Image_Combo);
|
m_notebook->AddPage(panel, "wxComboBox", FALSE, Image_Combo);
|
||||||
|
|
||||||
panel = new wxPanel(m_notebook);
|
panel = new wxPanel(m_notebook);
|
||||||
m_textentry = new MyTextCtrl( panel, -1, "Some text.", wxPoint(10,10), wxSize(320,28),
|
m_textentry = new MyTextCtrl( panel, -1, "Some text.", wxPoint(10,10), wxSize(320,28), //0);
|
||||||
//0);
|
|
||||||
wxTE_PROCESS_ENTER);
|
wxTE_PROCESS_ENTER);
|
||||||
(*m_textentry) << " Appended.";
|
(*m_textentry) << " Appended.";
|
||||||
m_textentry->SetInsertionPoint(0);
|
m_textentry->SetInsertionPoint(0);
|
||||||
m_textentry->WriteText( "Prepended. " );
|
m_textentry->WriteText( "Prepended. " );
|
||||||
|
|
||||||
m_multitext = new MyTextCtrl( panel, ID_TEXT, "Some text.", wxPoint(10,50), wxSize(320,70),
|
m_multitext = new MyTextCtrl( panel, ID_TEXT, "Some text.", wxPoint(10,50), wxSize(320,70), wxTE_MULTILINE );
|
||||||
wxTE_MULTILINE );
|
|
||||||
(*m_multitext) << " Appended.";
|
(*m_multitext) << " Appended.";
|
||||||
m_multitext->SetInsertionPoint(0);
|
m_multitext->SetInsertionPoint(0);
|
||||||
m_multitext->WriteText( "Prepended. " );
|
m_multitext->WriteText( "Prepended. " );
|
||||||
m_multitext->AppendText( "\nPress function keys to test different \nwxTextCtrl functions." );
|
m_multitext->AppendText( "\nPress function keys to test different wxTextCtrl functions." );
|
||||||
|
|
||||||
new MyTextCtrl( panel, -1, "This one is with wxTE_PROCESS_TAB style.",
|
(*m_multitext) << "\nDoes it have cross cursor?";
|
||||||
wxPoint(10,120), wxSize(320,70), wxTE_MULTILINE | wxTE_PROCESS_TAB);
|
m_multitext->SetCursor(*wxCROSS_CURSOR);
|
||||||
|
|
||||||
|
new MyTextCtrl( panel, -1, "This one is with wxTE_PROCESS_TAB style.", wxPoint(10,120), wxSize(320,70), wxTE_MULTILINE | wxTE_PROCESS_TAB);
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
m_multitext->AppendText( "\nThis ctrl has a tooltip. " );
|
m_multitext->AppendText( "\nThis ctrl has a tooltip. " );
|
||||||
m_multitext->SetToolTip("Press F1 here.");
|
m_multitext->SetToolTip("Press F1 here.");
|
||||||
@@ -887,18 +888,18 @@ MyPanel::~MyPanel()
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||||
EVT_MENU(MINIMAL_QUIT, MyFrame::OnQuit)
|
EVT_MENU(MINIMAL_QUIT, MyFrame::OnQuit)
|
||||||
EVT_MENU(MINIMAL_ABOUT, MyFrame::OnAbout)
|
EVT_MENU(MINIMAL_ABOUT, MyFrame::OnAbout)
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
EVT_MENU(MINIMAL_SET_TOOLTIP_DELAY, MyFrame::OnSetTooltipDelay)
|
EVT_MENU(MINIMAL_SET_TOOLTIP_DELAY, MyFrame::OnSetTooltipDelay)
|
||||||
EVT_MENU(MINIMAL_ENABLE_TOOLTIPS, MyFrame::OnToggleTooltips)
|
EVT_MENU(MINIMAL_ENABLE_TOOLTIPS, MyFrame::OnToggleTooltips)
|
||||||
#endif // wxUSE_TOOLTIPS
|
#endif // wxUSE_TOOLTIPS
|
||||||
EVT_SIZE(MyFrame::OnSize)
|
EVT_SIZE(MyFrame::OnSize)
|
||||||
EVT_IDLE(MyFrame::OnIdle)
|
EVT_IDLE(MyFrame::OnIdle)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h)
|
MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h)
|
||||||
: wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
|
: wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
|
||||||
{
|
{
|
||||||
CreateStatusBar(2);
|
CreateStatusBar(2);
|
||||||
|
|
||||||
@@ -912,8 +913,12 @@ void MyFrame::OnQuit (wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
|
wxBeginBusyCursor();
|
||||||
|
|
||||||
wxMessageDialog dialog(this, "This is a control sample", "About Controls", wxOK );
|
wxMessageDialog dialog(this, "This is a control sample", "About Controls", wxOK );
|
||||||
dialog.ShowModal();
|
dialog.ShowModal();
|
||||||
|
|
||||||
|
wxEndBusyCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
|
Reference in New Issue
Block a user