]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/keyboard/keyboard.cpp
don't use rand() for selecting the colour of the bitmaps to append, this results...
[wxWidgets.git] / samples / keyboard / keyboard.cpp
index ecece468d08c175e05cf28acbc35246309d4f3e5..a5d356a67cd30d3670198138c76cfebe1cf57b43 100644 (file)
@@ -98,7 +98,7 @@ public:
 
 private:
     // implement sink functions
-    virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t)
+    virtual void DoLog(wxLogLevel level, const wxString& szString, time_t t)
     {
         // don't put trace messages into listbox or we can get into infinite
         // recursion
@@ -162,6 +162,11 @@ protected:
     {
         wxPaintDC dc(this);
         dc.SetTextForeground(*wxWHITE);
+        wxFont font(*wxSWISS_FONT);
+        font.SetWeight(wxFONTWEIGHT_BOLD);
+        font.SetPointSize(font.GetPointSize() + 2);
+        dc.SetFont(font);
+
         dc.DrawLabel(_T("Press keys here"), GetClientRect(), wxALIGN_CENTER);
     }
 
@@ -240,6 +245,9 @@ IMPLEMENT_APP(MyApp)
 // 'Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
+    if ( !wxApp::OnInit() )
+        return false;
+
     // create the main application window
     MyFrame *frame = new MyFrame(_T("Keyboard wxWidgets App"),
                                  wxPoint(50, 50), wxSize(450, 340));
@@ -377,8 +385,6 @@ void TextWindow::LogEvent(const wxChar *name, wxKeyEvent& event)
         case WXK_MENU: key = _T("MENU"); break;
         case WXK_PAUSE: key = _T("PAUSE"); break;
         case WXK_CAPITAL: key = _T("CAPITAL"); break;
-        case WXK_PRIOR: key = _T("PRIOR"); break;
-        case WXK_NEXT: key = _T("NEXT"); break;
         case WXK_END: key = _T("END"); break;
         case WXK_HOME: key = _T("HOME"); break;
         case WXK_LEFT: key = _T("LEFT"); break;
@@ -447,7 +453,6 @@ void TextWindow::LogEvent(const wxChar *name, wxKeyEvent& event)
         case WXK_NUMPAD_UP: key = _T("NUMPAD_UP"); break;
         case WXK_NUMPAD_RIGHT: key = _T("NUMPAD_RIGHT"); break;
         case WXK_NUMPAD_DOWN: key = _T("NUMPAD_DOWN"); break;
-        case WXK_NUMPAD_PRIOR: key = _T("NUMPAD_PRIOR"); break;
         case WXK_NUMPAD_PAGEUP: key = _T("NUMPAD_PAGEUP"); break;
         case WXK_NUMPAD_PAGEDOWN: key = _T("NUMPAD_PAGEDOWN"); break;
         case WXK_NUMPAD_END: key = _T("NUMPAD_END"); break;