[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi/tableview
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2004-11-19 15:46:26
Message-ID: 20041119154626.ECC6016DB7 () office ! kde ! org
[Download RAW message or body]

CVS commit by staniek: 

Table View
- fixed repainting visible rows below a deleted row 
  (required if no confirmation box is displayed)
- record navigator's rec # indicator field:
-- fixed value valition on entering
-- fixed focus out


  M +27 -11    kexitableview.cpp   1.182


--- koffice/kexi/tableview/kexitableview.cpp  #1.181:1.182
@@ -405,5 +405,5 @@ void KexiTableView::setupNavigator()
         d->navRowNumber->setFocusPolicy(ClickFocus);
 //      d->navRowNumber->setFixedWidth(fw);
-        d->navRowNumberValidator = new QIntValidator(1, 1, this);
+        d->navRowNumberValidator = new QIntValidator(1, INT_MAX, this);
         d->navRowNumber->setValidator(d->navRowNumberValidator);
         d->navRowNumber->installEventFilter(this);
@@ -483,9 +483,9 @@ void KexiTableView::setNavRowNumber(int 
         else
                 n = " ";
-        if (d->navRowNumber->text().length() != n.length()) {//resize
-                d->navRowNumber->setFixedWidth(
-                        d->nav1DigitWidth*QMAX( \
                QMAX(n.length(),2)+1,d->navRowCount->text().length()+1)+6 
-                );
-        }
+//      if (d->navRowNumber->text().length() != n.length()) {//resize
+//              d->navRowNumber->setFixedWidth(
+//                      d->nav1DigitWidth*QMAX( \
QMAX(n.length(),2)+1,d->navRowCount->text().length()+1)+6  +//              );
+//      }
         d->navRowNumber->setText(n);
         d->navRowCount->deselect();
@@ -510,4 +510,8 @@ void KexiTableView::setNavRowCount(int n
                 }
         }
+        //update row number widget's width
+        const int w = d->nav1DigitWidth*QMAX( \
QMAX(n.length(),2)+1,d->navRowNumber->text().length()+1)+6; +        if \
(d->navRowNumber->width()!=w) //resize +                \
d->navRowNumber->setFixedWidth(w);  
         d->navRowCount->setText(n);
@@ -822,10 +826,16 @@ void KexiTableView::slotRowDeleted()
                 d->pVerticalHeader->removeLabel();
                 //get last visible row
-                int r = rowAt(clipper()->height());
+                int r = rowAt(clipper()->height()+contentsY());
                 if (r==-1) {
                         r = rows()+1+(isInsertingEnabled()?1:0);
                 }
                 //update all visible rows below 
-                updateContents( contentsX(), rowPos(d->curRow), clipper()->width(), \
d->rowHeight*(r - d->curRow)); +//              updateContents( contentsX(), \
rowPos(d->curRow)-contentsY(),  +        //              clipper()->width(), \
d->rowHeight*(r - d->curRow)); +
+                int leftcol = d->pTopHeader->sectionAt( d->pTopHeader->offset() );
+                int row = d->curRow;
+                updateContents( columnPos( leftcol ), rowPos(row), 
+                        clipper()->width(), clipper()->height() - (rowPos(row) - \
contentsY()) );  
                 //update navigator's data
@@ -4013,12 +4023,12 @@ void KexiTableView::navRowNumber_lostFoc
         int r = validRowNumber(d->navRowNumber->text());
         setNavRowNumber(r);
-//      d->navRowNumber->setText( QString::number( r+1 ) );
         selectRow( r );
+        //setFocus();
 }
 
 void KexiTableView::updateRowCountInfo()
 {
-        d->navRowNumberValidator->setRange(1,rows()+(isInsertingEnabled()?1:0));
-        kdDebug() << QString("updateRowCountInfo(): d->navRowNumberValidator: \
bottom=%1 top=%2").arg(d->navRowNumberValidator->bottom()).arg(d->navRowNumberValidator->top()) \
<< endl; +//      d->navRowNumberValidator->setRange(1,rows()+(isInsertingEnabled()?1:0));
 +//      kdDebug() << QString("updateRowCountInfo(): d->navRowNumberValidator: \
bottom=%1 top=%2").arg(d->navRowNumberValidator->bottom()).arg(d->navRowNumberValidator->top()) \
<< endl;  setNavRowCount(rows());
 //      d->navRowCount->setText(QString::number(rows()));
@@ -4099,4 +4109,10 @@ bool KexiTableView::eventFilter( QObject
                                         return true;
                         }
+                        else if ((k==Key_Tab || k==(SHIFT|Key_Tab)) && \
o==d->navRowNumber) { +                                //tab key focuses tv
+                                ke->accept();
+                                setFocus();
+                                return true;
+                        }
                 }
         }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic