]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grideditors.cpp
Set initial window size as its minimal size.
[wxWidgets.git] / src / generic / grideditors.cpp
index 1ece439bf7749e83f3c2d1ded181e1622a1c789b..c07eb137223ddc713d4f725c07fdf4c3ec0987b8 100644 (file)
@@ -485,7 +485,10 @@ void wxGridCellTextEditor::DoBeginEdit(const wxString& startValue)
     Text()->SetFocus();
 }
 
-bool wxGridCellTextEditor::EndEdit(const wxString& WXUNUSED(oldval),
+bool wxGridCellTextEditor::EndEdit(int WXUNUSED(row),
+                                   int WXUNUSED(col),
+                                   const wxGrid* WXUNUSED(grid),
+                                   const wxString& WXUNUSED(oldval),
                                    wxString *newval)
 {
     wxCHECK_MSG( m_control, false,
@@ -601,7 +604,7 @@ void wxGridCellTextEditor::SetParameters(const wxString& params)
         }
         else
         {
-            wxLogDebug( _T("Invalid wxGridCellTextEditor parameter string '%s' ignored"), params.c_str() );
+            wxLogDebug( wxT("Invalid wxGridCellTextEditor parameter string '%s' ignored"), params.c_str() );
         }
     }
 }
@@ -663,7 +666,7 @@ void wxGridCellNumberEditor::BeginEdit(int row, int col, wxGrid* grid)
         wxString sValue = table->GetValue(row, col);
         if (! sValue.ToLong(&m_value) && ! sValue.empty())
         {
-            wxFAIL_MSG( _T("this cell doesn't have numeric value") );
+            wxFAIL_MSG( wxT("this cell doesn't have numeric value") );
             return;
         }
     }
@@ -681,7 +684,10 @@ void wxGridCellNumberEditor::BeginEdit(int row, int col, wxGrid* grid)
     }
 }
 
-bool wxGridCellNumberEditor::EndEdit(const wxString& oldval, wxString *newval)
+bool wxGridCellNumberEditor::EndEdit(int WXUNUSED(row),
+                                     int WXUNUSED(col),
+                                     const wxGrid* WXUNUSED(grid),
+                                     const wxString& oldval, wxString *newval)
 {
     long value = 0;
     wxString text;
@@ -802,11 +808,11 @@ void wxGridCellNumberEditor::SetParameters(const wxString& params)
     else
     {
         long tmp;
-        if ( params.BeforeFirst(_T(',')).ToLong(&tmp) )
+        if ( params.BeforeFirst(wxT(',')).ToLong(&tmp) )
         {
             m_min = (int)tmp;
 
-            if ( params.AfterFirst(_T(',')).ToLong(&tmp) )
+            if ( params.AfterFirst(wxT(',')).ToLong(&tmp) )
             {
                 m_max = (int)tmp;
 
@@ -815,7 +821,7 @@ void wxGridCellNumberEditor::SetParameters(const wxString& params)
             }
         }
 
-        wxLogDebug(_T("Invalid wxGridCellNumberEditor parameter string '%s' ignored"), params.c_str());
+        wxLogDebug(wxT("Invalid wxGridCellNumberEditor parameter string '%s' ignored"), params.c_str());
     }
 }
 
@@ -877,7 +883,7 @@ void wxGridCellFloatEditor::BeginEdit(int row, int col, wxGrid* grid)
         {
             if ( !value.ToDouble(&m_value) )
             {
-                wxFAIL_MSG( _T("this cell doesn't have float value") );
+                wxFAIL_MSG( wxT("this cell doesn't have float value") );
                 return;
             }
         }
@@ -886,7 +892,10 @@ void wxGridCellFloatEditor::BeginEdit(int row, int col, wxGrid* grid)
     DoBeginEdit(GetString());
 }
 
-bool wxGridCellFloatEditor::EndEdit(const wxString& oldval, wxString *newval)
+bool wxGridCellFloatEditor::EndEdit(int WXUNUSED(row),
+                                    int WXUNUSED(col),
+                                    const wxGrid* WXUNUSED(grid),
+                                    const wxString& oldval, wxString *newval)
 {
     const wxString text(Text()->GetValue());
 
@@ -944,7 +953,7 @@ void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event)
     bool is_decimal_point = ( strbuf ==
        wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER) );
 #else
-    bool is_decimal_point = ( strbuf == _T(".") );
+    bool is_decimal_point = ( strbuf == wxT(".") );
 #endif
 
     if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-'
@@ -970,11 +979,11 @@ void wxGridCellFloatEditor::SetParameters(const wxString& params)
     else
     {
         long tmp;
-        if ( params.BeforeFirst(_T(',')).ToLong(&tmp) )
+        if ( params.BeforeFirst(wxT(',')).ToLong(&tmp) )
         {
             m_width = (int)tmp;
 
-            if ( params.AfterFirst(_T(',')).ToLong(&tmp) )
+            if ( params.AfterFirst(wxT(',')).ToLong(&tmp) )
             {
                 m_precision = (int)tmp;
 
@@ -983,7 +992,7 @@ void wxGridCellFloatEditor::SetParameters(const wxString& params)
             }
         }
 
-        wxLogDebug(_T("Invalid wxGridCellFloatEditor parameter string '%s' ignored"), params.c_str());
+        wxLogDebug(wxT("Invalid wxGridCellFloatEditor parameter string '%s' ignored"), params.c_str());
     }
 }
 
@@ -993,21 +1002,21 @@ wxString wxGridCellFloatEditor::GetString() const
     if ( m_precision == -1 && m_width != -1)
     {
         // default precision
-        fmt.Printf(_T("%%%d.f"), m_width);
+        fmt.Printf(wxT("%%%d.f"), m_width);
     }
     else if ( m_precision != -1 && m_width == -1)
     {
         // default width
-        fmt.Printf(_T("%%.%df"), m_precision);
+        fmt.Printf(wxT("%%.%df"), m_precision);
     }
     else if ( m_precision != -1 && m_width != -1 )
     {
-        fmt.Printf(_T("%%%d.%df"), m_width, m_precision);
+        fmt.Printf(wxT("%%%d.%df"), m_width, m_precision);
     }
     else
     {
         // default width/precision
-        fmt = _T("%f");
+        fmt = wxT("%f");
     }
 
     return wxString::Format(fmt, m_value);
@@ -1029,7 +1038,7 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event)
             const wxString decimalPoint =
                 wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER);
 #else
-            const wxString decimalPoint(_T('.'));
+            const wxString decimalPoint(wxT('.'));
 #endif
 
             // accept digits, 'e' as in '1e+6', also '-', '+', and '.'
@@ -1056,7 +1065,7 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event)
 // ----------------------------------------------------------------------------
 
 // the default values for GetValue()
-wxString wxGridCellBoolEditor::ms_stringValues[2] = { _T(""), _T("1") };
+wxString wxGridCellBoolEditor::ms_stringValues[2] = { wxT(""), wxT("1") };
 
 void wxGridCellBoolEditor::Create(wxWindow* parent,
                                   wxWindowID id,
@@ -1174,7 +1183,7 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid)
             // because we'll still overwrite it with something different and
             // this risks to be very surprising for the user code, let them
             // know about it
-            wxFAIL_MSG( _T("invalid value for a cell with bool editor!") );
+            wxFAIL_MSG( wxT("invalid value for a cell with bool editor!") );
         }
     }
 
@@ -1182,7 +1191,10 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid)
     CBox()->SetFocus();
 }
 
-bool wxGridCellBoolEditor::EndEdit(const wxString& WXUNUSED(oldval),
+bool wxGridCellBoolEditor::EndEdit(int WXUNUSED(row),
+                                   int WXUNUSED(col),
+                                   const wxGrid* WXUNUSED(grid),
+                                   const wxString& WXUNUSED(oldval),
                                    wxString *newval)
 {
     bool value = CBox()->GetValue();
@@ -1370,7 +1382,10 @@ void wxGridCellChoiceEditor::BeginEdit(int row, int col, wxGrid* grid)
     }
 }
 
-bool wxGridCellChoiceEditor::EndEdit(const wxString& WXUNUSED(oldval),
+bool wxGridCellChoiceEditor::EndEdit(int WXUNUSED(row),
+                                     int WXUNUSED(col),
+                                     const wxGrid* WXUNUSED(grid),
+                                     const wxString& WXUNUSED(oldval),
                                      wxString *newval)
 {
     const wxString value = Combo()->GetValue();
@@ -1417,7 +1432,7 @@ void wxGridCellChoiceEditor::SetParameters(const wxString& params)
 
     m_choices.Empty();
 
-    wxStringTokenizer tk(params, _T(','));
+    wxStringTokenizer tk(params, wxT(','));
     while ( tk.HasMoreTokens() )
     {
         m_choices.Add(tk.GetNextToken());
@@ -1488,7 +1503,10 @@ void wxGridCellEnumEditor::BeginEdit(int row, int col, wxGrid* grid)
 
 }
 
-bool wxGridCellEnumEditor::EndEdit(const wxString& WXUNUSED(oldval),
+bool wxGridCellEnumEditor::EndEdit(int WXUNUSED(row),
+                                   int WXUNUSED(col),
+                                   const wxGrid* WXUNUSED(grid),
+                                   const wxString& WXUNUSED(oldval),
                                    wxString *newval)
 {
     long idx = Combo()->GetSelection();