]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grideditors.cpp
Use PBM_SETMARQUEE to implement indeterminate mode in wxMSW wxGauge.
[wxWidgets.git] / src / generic / grideditors.cpp
index c07eb137223ddc713d4f725c07fdf4c3ec0987b8..a3cf424363a65df3ff89d969d4ce96f89d918008 100644 (file)
@@ -399,7 +399,10 @@ void wxGridCellTextEditor::DoCreate(wxWindow* parent,
                                     wxEvtHandler* evtHandler,
                                     long style)
 {
-    style |= wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB | wxNO_BORDER;
+    // Use of wxTE_RICH2 is a strange hack to work around the bug #11681: a
+    // plain text control seems to lose its caret somehow when we hide it and
+    // show it again for a different cell.
+    style |= wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB | wxNO_BORDER | wxTE_RICH2;
 
     m_control = new wxTextCtrl(parent, id, wxEmptyString,
                                wxDefaultPosition, wxDefaultSize,
@@ -1027,13 +1030,8 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event)
     if ( wxGridCellEditor::IsAcceptedKey(event) )
     {
         const int keycode = event.GetKeyCode();
-        if ( isascii(keycode) )
+        if ( wxIsascii(keycode) )
         {
-            char tmpbuf[2];
-            tmpbuf[0] = (char) keycode;
-            tmpbuf[1] = '\0';
-            wxString strbuf(tmpbuf, *wxConvCurrent);
-
 #if wxUSE_INTL
             const wxString decimalPoint =
                 wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER);