#include <label.h>
Inherits Rectangle.
Inheritance diagram for Label:
Public Types | |
enum | Alignment { LEFT, CENTER, RIGHT } |
Public Member Functions | |
Label (Monitor *monitor, Window window, Alignment align, GC gc) | |
~Label () | |
void | setText (string text) |
string | text () const |
void | update (unsigned long background, unsigned long text, unsigned long shine, unsigned long shadow, bool shineBorder=false, bool shadowBorder=false) |
void | setAlignment (const Alignment align) |
unsigned int | adjustWidth () |
unsigned int | textWidth () |
Private Attributes | |
Alignment | align_ |
GC | gc_ |
Monitor * | monitor_ |
string | text_ |
Window | window_ |
WFont * | font_ |
This widget is capable of using old style PCF fonts and new style XFT fonts.
Definition at line 28 of file label.h.
enum Label::Alignment |
void Label::setText | ( | string | text | ) |
Definition at line 100 of file label.cpp.
References text_.
Referenced by StatusBar::calculateMetersWidth(), StatusBar::calculateWorkspaceWidth(), StatusBar::illuminate(), Menu::illuminate(), InputBar::illuminate(), Frame::illuminate(), ClientBar::illuminate(), Client::illuminate(), Thing::illuminateBorder(), Menu::manage(), Box::setText(), ClientBar::updateClientInfo(), ClientBar::updateClientPager(), StatusBar::updateInputModeButton(), ClientBar::updateMenuButton(), StatusBar::updateMeters(), ClientBar::updateModeButton(), StatusBar::updateStatus(), and StatusBar::updateWorkspacePager().
void Label::update | ( | unsigned long | background, | |
unsigned long | text, | |||
unsigned long | shine, | |||
unsigned long | shadow, | |||
bool | shineBorder = false , |
|||
bool | shadowBorder = false | |||
) |
Updates this label.
leftBorder | if true a left border will be drawn. | |
rightBorder | if true a right border will be drawn. |
Definition at line 41 of file label.cpp.
References align_, WFont::ascent(), CENTER, Draw::drawShadowBorder(), Draw::drawShineBorder(), WFont::drawText(), font_, gc_, WFont::height(), Rectangle::height(), LEFT, LOGDEBUG, RIGHT, Util::shortenString(), text_, textWidth(), Rectangle::width(), window_, Rectangle::x(), XCORE, and Rectangle::y().
Referenced by StatusBar::illuminate(), Menu::illuminate(), InputBar::illuminate(), Frame::illuminate(), ClientBar::illuminate(), Client::illuminate(), Box::illuminate(), Thing::illuminateBorder(), ClientBar::updateClientInfo(), ClientBar::updateClientPager(), StatusBar::updateMeters(), StatusBar::updateStatus(), and StatusBar::updateWorkspacePager().
Here is the call graph for this function:
void Label::setAlignment | ( | const Alignment | align | ) |
Definition at line 108 of file label.cpp.
References align_.
Referenced by StatusBar::calculateMetersWidth(), StatusBar::illuminate(), InputBar::illuminate(), StatusBar::updateMeters(), and StatusBar::updateStatus().
unsigned int Label::adjustWidth | ( | ) |
Adjusts label width with the currently set text. Returns the adjusted width.
Definition at line 32 of file label.cpp.
References Rectangle::setWidth(), textWidth(), and Rectangle::width().
Referenced by StatusBar::calculateWorkspaceWidth(), InputBar::illuminate(), Client::illuminate(), Box::setText(), and StatusBar::updateMeters().
Here is the call graph for this function:
unsigned int Label::textWidth | ( | ) |
Helper method for adjustWidth, also useful for menu and bar stuff.
Definition at line 37 of file label.cpp.
References font_, WFont::height(), text_, and WFont::textWidth().
Referenced by adjustWidth(), StatusBar::calculateMetersWidth(), Menu::manage(), update(), ClientBar::updateClientInfo(), and ClientBar::updateClientPager().
Here is the call graph for this function:
Alignment Label::align_ [private] |
GC Label::gc_ [private] |
Monitor* Label::monitor_ [private] |
string Label::text_ [private] |
Window Label::window_ [private] |
WFont* Label::font_ [private] |