20#include "tkcombobox.h"
25#include <tqdrawutil.h>
27#include <tdeapplication.h>
29TKComboBox::TKComboBox(TQWidget* parent, const char* name)
30: TQComboBox(false,parent, name)
35TKComboBox::TKComboBox( bool isEditable, TQWidget* parent, const char* name )
36: TQComboBox(isEditable,parent, name)
40TKComboBox::~TKComboBox()
44void TKComboBox::paintEvent(TQPaintEvent*)
49#warning "Left out for now, lacking a style expert (Werner)"
52 r = TQRect(4, 2, width()-height()-2, height()-4);
54 r = TQRect(4, 2, width()-height()-2, height()-4);
57 int bx = r.x() + r.width();
58 int bw = width() - bx - 2;
62 const TQColorGroup& g = colorGroup();
64 TQRect fr(2,2,width()-4,height()-4);
67 p.fillRect( fr, g.brush( TQColorGroup::Highlight ) );
69 p.fillRect( fr, g.brush( TQColorGroup::Base ) );
72 TQRect r1(1,1,width()-1,height()-1);
73 qDrawShadePanel( &p, r1, g, true, 1 );
75 static const char* arrow_down[] = {
87 TQPixmap pixmap(arrow_down);
90 style().drawControl( TQStyle::CE_PushButton, &p, this, TQRect( bx, by, bw, bh ), colorGroup() );
91 style().drawItem( &p, TQRect( bx, by, bw, bh), AlignCenter, colorGroup(), isEnabled(), &pixmap, TQString() );
94 style().drawPrimitive( TQStyle::PE_FocusRect, &p, fr, g );
100 p.setBackgroundColor( g.background() );
102 if ( listBox()->item(currentItem()) ) {
103 TQListBoxItem * item = listBox()->item(currentItem());
104 const TQPixmap *pix = item->pixmap();
105 TQString text = item->text();
108 p.drawPixmap( x, r.y() + ( r.height() - pix->height() ) / 2 +1, *pix );
112 p.drawText( x, r.y(), r.width()-x, r.height(), AlignLeft|AlignVCenter|SingleLine, text );
118void TKComboBox::activate()
120 emit activated(currentItem());
123#include "tkcombobox.moc"
const char * name(StdAction id)
|