22 #include <kstatusbar.h>
23 #include <tdeconfig.h>
24 #include <tdeglobal.h>
27 KStatusBarLabel::KStatusBarLabel(
const TQString& text,
int _id,
29 TQLabel( parent,
name)
43 setFrameStyle (TQFrame::NoFrame);
45 setAlignment( AlignHCenter | AlignVCenter | SingleLine );
47 connect (
this, TQ_SIGNAL(itemPressed(
int)), parent, TQ_SIGNAL(pressed(
int)));
48 connect (
this, TQ_SIGNAL(itemReleased(
int)), parent, TQ_SIGNAL(released(
int)));
51 void KStatusBarLabel::mousePressEvent (TQMouseEvent *)
53 emit itemPressed (
id);
56 void KStatusBarLabel::mouseReleaseEvent (TQMouseEvent *)
58 emit itemReleased (
id);
62 : TQStatusBar( parent, name )
67 TQString group(config->
group());
68 config->
setGroup(TQString::fromLatin1(
"StatusBar style"));
69 bool grip_enabled = config->
readBoolEntry(TQString::fromLatin1(
"SizeGripEnabled"),
false);
70 setSizeGripEnabled(grip_enabled);
81 kdDebug() <<
"KStatusBar::insertItem: item id " <<
id <<
" already exists." <<
endl;
84 l->setFixedHeight(fontMetrics().height()+2);
86 addWidget (l, stretch, permanent);
100 kdDebug() <<
"KStatusBar::removeItem: bad item id: " <<
id <<
endl;
118 if(l->minimumWidth () != l->maximumWidth ())
124 kdDebug() <<
"KStatusBar::changeItem: bad item id: " <<
id <<
endl;
132 l->setAlignment(align);
135 kdDebug() <<
"KStatusBar::setItemAlignment: bad item id: " <<
id <<
endl;
144 w=fontMetrics().boundingRect(l->text()).width()+3;
149 kdDebug() <<
"KStatusBar::setItemFixed: bad item id: " <<
id <<
endl;
152 #include "kstatusbar.moc"
Internal label class for use in KStatusBar.
void removeItem(int id)
Removes an item.
bool hasItem(int id) const
KStatusBar(TQWidget *parent=0L, const char *name=0L)
Constructs a status bar.
void changeItem(const TQString &text, int id)
Changes the text in a status bar field.
void setItemAlignment(int id, int align)
Sets the alignment of item id.
void setItemFixed(int id, int width=-1)
Sets item id to have fixed width.
void insertItem(const TQString &text, int id, int stretch=0, bool permanent=false)
Inserts a text label into the status bar.
bool readBoolEntry(const TQString &pKey, bool bDefault=false) const
void setGroup(const TQString &group)
static TDEConfig * config()
kndbgstream & endl(kndbgstream &s)
kdbgstream kdDebug(int area=0)
TQString name(StdAccel id)