]> git.saurik.com Git - wxWidgets.git/commitdiff
Added fixes for Unicode compilation.
authorRobert Roebling <robert@roebling.de>
Fri, 28 May 1999 16:10:01 +0000 (16:10 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 28 May 1999 16:10:01 +0000 (16:10 +0000)
  Added WXK_ALT incl test.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
locale/de.po
samples/controls/controls.cpp
src/generic/progdlgg.cpp
src/gtk/app.cpp
src/gtk/dcclient.cpp
src/gtk/window.cpp
src/gtk1/app.cpp
src/gtk1/dcclient.cpp
src/gtk1/window.cpp

index cad71f42467b286f9879ac815ce72e4caf8579c6..9f4da9c1a38565930422e125dbb5f86ba83a02d6 100644 (file)
@@ -829,6 +829,7 @@ enum wxKeyCode
   WXK_MBUTTON,
   WXK_CLEAR,
   WXK_SHIFT,
+  WXK_ALT,
   WXK_CONTROL,
   WXK_MENU,
   WXK_PAUSE,
index f1488f30a319d08e3d405af1477b6ecfb05f5f97..a1c0a1c5bce037e1e5b9e284c7e9c3a3fd0d4aea 100644 (file)
@@ -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
index 282a5ef86c71ccb7a0226c218c6266eacd786082..675230b2d89c10f633fb8007ddff7f45035cedda 100644 (file)
@@ -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();
 }
index e12b7f5616dc68b17a79d84a5c9443df2734ed91..137a4be73c3f39b4a850ca5a0642d929a97e09c1 100644 (file)
@@ -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);
index a6b21a616b7886bab13ce5a59fa8bfd6e9c4dd6d..32d5963bd81e7a376d6eadae0f1fc67982385446 100644 (file)
@@ -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. */
index dd1751a16dfcd3755d4aea059b1d3fc0ec72f061..93f34e9fe7f078dede0cd09dce8a38dfe79bf600 100644 (file)
@@ -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;
        }
     }
index 433694c88ce6a4f689c1463b33c2843bbe26eb1c..93cb0f3c647acc87ddcae2cea7eff61b9d076b24 100644 (file)
@@ -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;
index a6b21a616b7886bab13ce5a59fa8bfd6e9c4dd6d..32d5963bd81e7a376d6eadae0f1fc67982385446 100644 (file)
@@ -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. */
index dd1751a16dfcd3755d4aea059b1d3fc0ec72f061..93f34e9fe7f078dede0cd09dce8a38dfe79bf600 100644 (file)
@@ -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;
        }
     }
index 433694c88ce6a4f689c1463b33c2843bbe26eb1c..93cb0f3c647acc87ddcae2cea7eff61b9d076b24 100644 (file)
@@ -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;