]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/event.h
Relax wxMessageDialog style checks, assume wxOK by default.
[wxWidgets.git] / interface / wx / event.h
index ecd376d200d6aa8f007c22c3d4c865473ff0a718..73f66d5fe98e5a871cddbdbcf1a553e1264532ac 100644 (file)
@@ -1393,11 +1393,11 @@ public:
         codes.
 
         Note that this method returns a meaningful value only for special
-        non-alphanumeric keys or if the user entered a character that can be
-        represented in current locale's default charset. Otherwise, e.g. if the
-        user enters a Japanese character in a program not using Japanese
-        locale, this method returns @c WXK_NONE and GetUnicodeKey() should be
-        used to obtain the corresponding Unicode character.
+        non-alphanumeric keys or if the user entered a Latin-1 character (this
+        includes ASCII and the accented letters found in Western European
+        languages but not letters of other alphabets such as e.g. Cyrillic).
+        Otherwise it simply method returns @c WXK_NONE and GetUnicodeKey()
+        should be used to obtain the corresponding Unicode character.
 
         Using GetUnicodeKey() is in general the right thing to do if you are
         interested in the characters typed by the user, GetKeyCode() should be
@@ -1406,12 +1406,23 @@ public:
         @code
             void MyHandler::OnChar(wxKeyEvent& event)
             {
-                if ( event.GetUnicodeKey() != WXK_NONE )
+                wxChar uc = event.GetUnicodeKey();
+                if ( uc != WXK_NONE )
                 {
-                    // It's a printable character
-                    wxLogMessage("You pressed '%c'", event.GetUnicodeKey());
+                    // It's a "normal" character. Notice that this includes
+                    // control characters in 1..31 range, e.g. WXK_RETURN or
+                    // WXK_BACK, so check for them explicitly.
+                    if ( uc >= 32 )
+                    {
+                        wxLogMessage("You pressed '%c'", uc);
+                    }
+                    else
+                    {
+                        // It's a control character
+                        ...
+                    }
                 }
-                else
+                else // No Unicode equivalent.
                 {
                     // It's a special key, deal with all the known ones:
                     switch ( GetKeyCode() )
@@ -1444,6 +1455,9 @@ public:
     //@{
     /**
         Obtains the position (in client coordinates) at which the key was pressed.
+
+        Notice that this position is simply the current mouse pointer position
+        and has no special relationship to the key event itself.
     */
     wxPoint GetPosition() const;
     void GetPosition(long* x, long* y) const;
@@ -1502,11 +1516,15 @@ public:
 
     /**
         Returns the X position (in client coordinates) of the event.
+
+        @see GetPosition()
     */
     wxCoord GetX() const;
 
     /**
         Returns the Y position (in client coordinates) of the event.
+
+        @see GetPosition()
     */
     wxCoord GetY() const;
 
@@ -2159,8 +2177,8 @@ public:
     text was copied or cut.
 
     @note
-    These events are currently only generated by wxTextCtrl under GTK+.
-    They are generated by all controls under Windows.
+    These events are currently only generated by wxTextCtrl in wxGTK and wxOSX
+    but are also generated by wxComboBox without wxCB_READONLY style in wxMSW.
 
     @beginEventTable{wxClipboardTextEvent}
     @event{EVT_TEXT_COPY(id, func)}
@@ -4543,6 +4561,7 @@ wxEventType wxEVT_COMMAND_ENTER;
 wxEventType wxEVT_HELP;
 wxEventType wxEVT_DETAILED_HELP;
 wxEventType wxEVT_COMMAND_TEXT_UPDATED;
+wxEventType wxEVT_COMMAND_TEXT_ENTER;
 wxEventType wxEVT_COMMAND_TOOL_CLICKED;
 wxEventType wxEVT_WINDOW_MODAL_DIALOG_CLOSED;