X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..f901941933f6bad712e855476b90c169315f9391:/samples/caret/caret.cpp diff --git a/samples/caret/caret.cpp b/samples/caret/caret.cpp index a1f025a653..a9c44ca2f9 100644 --- a/samples/caret/caret.cpp +++ b/samples/caret/caret.cpp @@ -27,11 +27,12 @@ #include "wx/numdlg.h" // ---------------------------------------------------------------------------- -// ressources +// resources // ---------------------------------------------------------------------------- + // the application icon -#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) - #include "mondrian.xpm" +#ifndef wxHAS_IMAGES_IN_RESOURCES + #include "../sample.xpm" #endif // ---------------------------------------------------------------------------- @@ -206,7 +207,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size) { // set the frame icon - SetIcon(wxICON(mondrian)); + SetIcon(wxICON(sample)); // create a menu bar wxMenu *menuFile = new wxMenu; @@ -215,7 +216,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) menuFile->Append(Caret_SetFontSize, wxT("&Font size...\tCtrl-S")); menuFile->Append(Caret_Move, wxT("&Move caret\tCtrl-C")); menuFile->AppendSeparator(); - menuFile->Append(Caret_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); + menuFile->Append(Caret_About, wxT("&About\tCtrl-A"), wxT("Show about dialog")); menuFile->AppendSeparator(); menuFile->Append(Caret_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); @@ -225,7 +226,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); - + m_canvas = new MyCanvas(this); #if wxUSE_STATUSBAR @@ -424,10 +425,17 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxChar ch = CharAt(x, y); if ( !ch ) ch = wxT(' '); +#ifdef __WXOSX__ + dc.DrawText(ch, m_xMargin + x * m_widthChar, + m_yMargin + y * m_heightChar ); +#else line += ch; +#endif } +#ifndef __WXOSX__ dc.DrawText( line, m_xMargin, m_yMargin + y * m_heightChar ); +#endif } }