From: Robert Roebling Date: Fri, 28 May 1999 16:10:01 +0000 (+0000) Subject: Added fixes for Unicode compilation. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/861ccde48164e232a7486e6084db4727faf50e0a Added fixes for Unicode compilation. Added WXK_ALT incl test. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/defs.h b/include/wx/defs.h index cad71f4246..9f4da9c1a3 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -829,6 +829,7 @@ enum wxKeyCode WXK_MBUTTON, WXK_CLEAR, WXK_SHIFT, + WXK_ALT, WXK_CONTROL, WXK_MENU, WXK_PAUSE, diff --git a/locale/de.po b/locale/de.po index f1488f30a3..a1c0a1c5bc 100644 --- a/locale/de.po +++ b/locale/de.po @@ -41,7 +41,7 @@ msgstr " (Fehler %ld: %s)" #: ../src/common/date.cpp:385 ../src/common/date.cpp:400 #: src/common/date.cpp:384 src/common/date.cpp:399 msgid " B.C." -msgstr " B.C." +msgstr " v.Chr." #: ../src/common/resourc2.cpp:265 ../src/common/resourc2.cpp:1334 #: ../src/common/resource.cpp:1630 ../src/common/resource.cpp:2704 diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 282a5ef86c..675230b2d8 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -83,8 +83,8 @@ public: void OnChar(wxKeyEvent& event); private: - static inline char GetChar(bool on, char c) { return on ? c : '-'; } - void LogEvent(const char *name, wxKeyEvent& event) const; + static inline wxChar GetChar(bool on, wxChar c) { return on ? c : _T('-'); } + void LogEvent(const wxChar *name, wxKeyEvent& event) const; DECLARE_EVENT_TABLE() }; @@ -231,12 +231,12 @@ BEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl) EVT_CHAR(MyTextCtrl::OnChar) END_EVENT_TABLE() -void MyTextCtrl::LogEvent(const char *name, wxKeyEvent& event) const +void MyTextCtrl::LogEvent(const wxChar *name, wxKeyEvent& event) const { wxString key; long keycode = event.KeyCode(); - if ( isprint((int)keycode) ) - key.Printf("'%c'", (char)keycode); + if ( wxIsprint((int)keycode) ) + key.Printf( _T("'%c'") , (char)keycode); else { switch ( keycode ) @@ -254,6 +254,7 @@ void MyTextCtrl::LogEvent(const char *name, wxKeyEvent& event) const case WXK_MBUTTON: key = "MBUTTON"; break; case WXK_CLEAR: key = "CLEAR"; break; case WXK_SHIFT: key = "SHIFT"; break; + case WXK_ALT: key = "ALT"; break; case WXK_CONTROL: key = "CONTROL"; break; case WXK_MENU: key = "MENU"; break; case WXK_PAUSE: key = "PAUSE"; break; @@ -343,30 +344,30 @@ void MyTextCtrl::LogEvent(const char *name, wxKeyEvent& event) const case WXK_NUMPAD_DECIMAL: key = "NUMPAD_DECIMAL"; break; default: - key.Printf("unknown (%ld)", keycode); + key.Printf( _T("unknown (%ld)"), keycode); } } wxLogMessage( _T("%s event: %s (flags = %c%c%c%c)"), name, key.c_str(), - GetChar(event.ControlDown(), 'C'), - GetChar(event.AltDown(), 'A'), - GetChar(event.ShiftDown(), 'S'), - GetChar(event.MetaDown(), 'M')); + GetChar( event.ControlDown(), _T('C') ), + GetChar( event.AltDown(), _T('A') ), + GetChar( event.ShiftDown(), _T('S') ), + GetChar( event.MetaDown(), _T('M') ) ); } void MyTextCtrl::OnChar(wxKeyEvent& event) { - LogEvent("Char", event); + LogEvent( _T("Char"), event); event.Skip(); } void MyTextCtrl::OnKeyUp(wxKeyEvent& event) { - LogEvent("Key up", event); + LogEvent( _("Key up"), event); event.Skip(); } @@ -405,7 +406,7 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) break; } - LogEvent("Key down", event); + LogEvent( _("Key down"), event); event.Skip(); } diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index e12b7f5616..137a4be73c 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -122,8 +122,8 @@ wxProgressDialog::wxProgressDialog(wxString const &title, bool wxProgressDialog::Update(int value, const wxString& newmsg) { - wxASSERT_MSG( value == -1 || m_gauge, "can't update non existent dialog" ); - wxASSERT_MSG( value < m_maximum, "invalid progress value" ); + wxASSERT_MSG( value == -1 || m_gauge, _T("can't update non existent dialog") ); + wxASSERT_MSG( value < m_maximum, _T("invalid progress value") ); if( m_gauge ) m_gauge->SetValue(value + 1); diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index a6b21a616b..32d5963bd8 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -213,7 +213,7 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) ) void wxapp_install_idle_handler() { - wxASSERT_MSG( wxTheApp->m_idleTag == 0, "attempt to install idle handler twice" ); + wxASSERT_MSG( wxTheApp->m_idleTag == 0, _T("attempt to install idle handler twice") ); /* this routine gets called by all event handlers indicating that the idle is over. */ diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index dd1751a16d..93f34e9fe7 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -111,11 +111,11 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_owner = (wxWindow *)NULL; m_isMemDC = FALSE; - wxASSERT_MSG( window, "DC needs a window" ); + wxASSERT_MSG( window, _T("DC needs a window") ); GtkWidget *widget = window->m_wxwindow; - wxASSERT_MSG( widget, "DC needs a widget" ); + wxASSERT_MSG( widget, _T("DC needs a widget") ); m_window = widget->window; @@ -1025,7 +1025,7 @@ void wxWindowDC::SetLogicalFunction( int function ) #endif default: { - wxFAIL_MSG( "unsupported logical function" ); + wxFAIL_MSG( _T("unsupported logical function") ); break; } } diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 433694c88c..93cb0f3c64 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -216,6 +216,12 @@ static long map_to_unmodified_wx_keysym( KeySym keysym ) case GDK_Shift_R: key_code = WXK_SHIFT; break; case GDK_Control_L: case GDK_Control_R: key_code = WXK_CONTROL; break; + case GDK_Meta_L: + case GDK_Meta_R: + case GDK_Alt_L: + case GDK_Alt_R: + case GDK_Super_L: + case GDK_Super_R: key_code = WXK_ALT; break; case GDK_Menu: key_code = WXK_MENU; break; case GDK_Help: key_code = WXK_HELP; break; case GDK_BackSpace: key_code = WXK_BACK; break; diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index a6b21a616b..32d5963bd8 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -213,7 +213,7 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) ) void wxapp_install_idle_handler() { - wxASSERT_MSG( wxTheApp->m_idleTag == 0, "attempt to install idle handler twice" ); + wxASSERT_MSG( wxTheApp->m_idleTag == 0, _T("attempt to install idle handler twice") ); /* this routine gets called by all event handlers indicating that the idle is over. */ diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index dd1751a16d..93f34e9fe7 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -111,11 +111,11 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_owner = (wxWindow *)NULL; m_isMemDC = FALSE; - wxASSERT_MSG( window, "DC needs a window" ); + wxASSERT_MSG( window, _T("DC needs a window") ); GtkWidget *widget = window->m_wxwindow; - wxASSERT_MSG( widget, "DC needs a widget" ); + wxASSERT_MSG( widget, _T("DC needs a widget") ); m_window = widget->window; @@ -1025,7 +1025,7 @@ void wxWindowDC::SetLogicalFunction( int function ) #endif default: { - wxFAIL_MSG( "unsupported logical function" ); + wxFAIL_MSG( _T("unsupported logical function") ); break; } } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 433694c88c..93cb0f3c64 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -216,6 +216,12 @@ static long map_to_unmodified_wx_keysym( KeySym keysym ) case GDK_Shift_R: key_code = WXK_SHIFT; break; case GDK_Control_L: case GDK_Control_R: key_code = WXK_CONTROL; break; + case GDK_Meta_L: + case GDK_Meta_R: + case GDK_Alt_L: + case GDK_Alt_R: + case GDK_Super_L: + case GDK_Super_R: key_code = WXK_ALT; break; case GDK_Menu: key_code = WXK_MENU; break; case GDK_Help: key_code = WXK_HELP; break; case GDK_BackSpace: key_code = WXK_BACK; break;