]> git.saurik.com Git - wxWidgets.git/commitdiff
some appearance fixes from Michael Bedward
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Jul 1999 20:48:05 +0000 (20:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Jul 1999 20:48:05 +0000 (20:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2952 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/gridg.cpp

index 5798ad501e2346f77adac3de8397c9871d4874ea..38fdcebe051a11a8f78de5e0b8a8f6744c3126f8 100644 (file)
@@ -1445,8 +1445,30 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col)
 
   if ( m_editable && m_editInPlace )
     {
-      m_inPlaceTextItem->SetSize( m_currentRect.x-2, m_currentRect.y-2,
-                                  m_currentRect.width+4, m_currentRect.height+4 );
+      int x, y, width, height;
+      if ( m_currentRect.x <= 0 )
+        {
+          x = 0;
+          width = m_currentRect.width + 2;
+        }
+      else
+        {
+          x = m_currentRect.x - 2;
+          width = m_currentRect.width + 4;
+        }
+
+      if ( m_currentRect.y <= 0 )
+        {
+          y = 0;
+          height = m_currentRect.height + 2;
+        }
+      else
+        {
+          y = m_currentRect.y - 2;
+          height = m_currentRect.height + 4;
+        }
+
+      m_inPlaceTextItem->SetSize( x, y, width, height );
 
       if ( cell )
         {