[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-06-17 10:10:30
Message-ID: 20040617101030.DFC279974 () office ! kde ! org
[Download RAW message or body]

CVS commit by staniek: 

KexiTableView
- Combobox's button is now in "toggle" mode; popping up is now better
hidden/shown


  M +5 -0      kexicomboboxpopup.cpp   1.6
  M +2 -0      kexicomboboxpopup.h   1.4
  M +12 -2     kexicomboboxtableedit.cpp   1.23


--- koffice/kexi/tableview/kexicomboboxpopup.cpp  #1.5:1.6
@@ -198,4 +198,8 @@ void KexiComboBoxPopup::slotTVItemAccept
 bool KexiComboBoxPopup::eventFilter( QObject *o, QEvent *e )
 {
+        if (e->type()==QEvent::MouseButtonPress) {
+                kdDebug() << "QEvent::MousePress" << endl;
+        }
+
         if (o==d->tv) {
                 if (e->type()==QEvent::KeyPress) {

--- koffice/kexi/tableview/kexicomboboxpopup.h  #1.3:1.4
@@ -76,4 +76,6 @@ class KexiComboBoxPopup : public QFrame
 
                 KexiComboBoxPopupPrivate *d;
+
+                friend class KexiComboBoxTableEdit;
 };
 

--- koffice/kexi/tableview/kexicomboboxtableedit.cpp  #1.22:1.23
@@ -36,5 +36,8 @@ class KDownArrowPushButton : public KPus
         public:
                 KDownArrowPushButton( QWidget *parent )
-                 : KPushButton(parent) {}
+                 : KPushButton(parent)
+                {
+                        setToggleButton(true);
+                }
         protected:
                 /**
@@ -284,10 +287,15 @@ void KexiComboBoxTableEdit::setupContent
 void KexiComboBoxTableEdit::slotButtonClicked()
 {
-        if (!m_popup || !m_popup->isVisible()) {
+        kdDebug() << "KexiComboBoxTableEdit::slotButtonClicked()" << endl;
+//      if (!m_popup || !m_popup->isVisible()) {
+        if (!m_popup || m_button->isOn()) {
+                kdDebug() << "SHOW POPUP" << endl;
                 showPopup();
+                m_button->setOn(true);
         }
         else {
                 m_popup->hide();
                 //TODO: cancel selection
+                m_button->setOn(false);
         }
 }
@@ -343,4 +351,5 @@ void KexiComboBoxTableEdit::hide()
         if (m_popup)
                 m_popup->hide();
+        m_button->setOn(false);
 //      m_button->hide();
 }
@@ -350,4 +359,5 @@ void KexiComboBoxTableEdit::show()
         KexiInputTableEdit::show();
         m_button->show();
+        m_button->setOn(false);
 }
 


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

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