20#include "kexicomboboxdropdownbutton.h"
22#include <tdepopupmenu.h>
27#include <tqapplication.h>
29KexiComboBoxDropDownButton::KexiComboBoxDropDownButton( TQWidget *parent )
32 m_paintedCombo = new KComboBox( this);
33 m_paintedCombo->hide();
34 m_paintedCombo->setEditable( true);
36 setToggleButton( true);
38 m_paintedCombo->move(0,0);
39 m_paintedCombo->setFixedSize(size());
42KexiComboBoxDropDownButton::~KexiComboBoxDropDownButton()
48 int flags = TQStyle::Style_Enabled | TQStyle::Style_HasFocus;
50 flags |= TQStyle::Style_Down;
52 KPushButton::drawButton(p);
55 r.setHeight(r.height()+m_fixForHeight);
56 if (m_drawComplexControl) {
61 style().drawComplexControl( TQStyle::CC_ComboBox, p,
62 m_fixForHeight>0 ? ( const TQWidget*) m_paintedCombo : this, r, colorGroup(),
63 flags, (uint)(TQStyle::SC_ComboBoxArrow), TQStyle::SC_None );
66 r.setWidth(r.width()+2);
67 style().drawPrimitive( TQStyle::PE_ArrowDown, p, r, colorGroup(), flags);
74 if (tqstricmp(style().name(), "thinkeramik")==0) {
80 m_drawComplexControl =
81 (style().inherits( "TDEStyle") && tqstricmp(style().name(), "qtcurve")!=0)
82 || tqstricmp(style().name(), "platinum")==0;
83 if (m_fixForHeight==0)
84 setFixedWidth( style().querySubControlMetrics( TQStyle::CC_ComboBox,
85 ( const TQWidget*) m_paintedCombo, TQStyle::SC_ComboBoxArrow ).width() +1 );
86 KPushButton::styleChange(oldStyle);
|