]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
Implemented HasContainerColumns() for GTK+
[wxWidgets.git] / src / generic / grid.cpp
index d700d5b2a752b4d883d6946bc5315682dc314752..47fc186875cd1bfe75bf5a38a5d299d0d11fb308 100644 (file)
@@ -642,21 +642,29 @@ void wxGridCellTextEditor::Create(wxWindow* parent,
                                   wxWindowID id,
                                   wxEvtHandler* evtHandler)
 {
-    m_control = new wxTextCtrl(parent, id, wxEmptyString,
-                               wxDefaultPosition, wxDefaultSize
+    DoCreate(parent, id, evtHandler);
+}
+
+void wxGridCellTextEditor::DoCreate(wxWindow* parent,
+                                    wxWindowID id,
+                                    wxEvtHandler* evtHandler,
+                                    long style)
+{
 #if defined(__WXMSW__)
-                               ,
-                               wxTE_PROCESS_ENTER |
-                               wxTE_PROCESS_TAB |
-                               wxTE_AUTO_SCROLL |
-                               wxNO_BORDER
+    style |= wxTE_PROCESS_ENTER |
+             wxTE_PROCESS_TAB |
+             wxTE_AUTO_SCROLL |
+             wxNO_BORDER;
 #endif
-                              );
+
+    m_control = new wxTextCtrl(parent, id, wxEmptyString,
+                               wxDefaultPosition, wxDefaultSize,
+                               style);
 
     // set max length allowed in the textctrl, if the parameter was set
-    if (m_maxChars != 0)
+    if ( m_maxChars != 0 )
     {
-        ((wxTextCtrl*)m_control)->SetMaxLength(m_maxChars);
+        Text()->SetMaxLength(m_maxChars);
     }
 
     wxGridCellEditor::Create(parent, id, evtHandler);
@@ -4213,6 +4221,7 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id,
 
     Create();
     SetInitialSize(size);
+    CalcDimensions();
 
     return true;
 }
@@ -6945,8 +6954,11 @@ void wxGrid::Refresh(bool eraseb, const wxRect* rect)
 
 void wxGrid::OnSize(wxSizeEvent& WXUNUSED(event))
 {
-    // update our children window positions and scrollbars
-    CalcDimensions();
+    if (m_targetWindow != this) // check whether initialisation has been done
+    {
+        // update our children window positions and scrollbars
+        CalcDimensions();
+    }
 }
 
 void wxGrid::OnKeyDown( wxKeyEvent& event )