kstars
InfoBox Class Reference
InfoBoxencapsulates a lightweight floating "window" to be drawn directly on a pixmap. More...
#include <infobox.h>

Public Types | |
enum | AnchorType { AnchorNone = 0x0000, AnchorRight = 0x0001, AnchorBottom = 0x0002, AnchorBoth = AnchorRight | AnchorBottom } |
Signals | |
void | moved (QPoint p) |
void | shaded (bool s) |
Public Member Functions | |
bool | anchorBottom () const |
int | anchorFlag () const |
bool | anchorRight () const |
bool | constrain (QRect r, bool inside=true) |
void | draw (QPainter &p, QColor BGColor, unsigned int BGMode) |
int | height () const |
InfoBox (QPoint p, bool shade, QString t1="", QString t2="", QString t3="") | |
InfoBox (int x, int y, bool shade, QString t1="", QString t2="", QString t3="") | |
InfoBox () | |
bool | isVisible () const |
void | move (QPoint p) |
void | move (int x, int y) |
int | padx () const |
int | pady () const |
QPoint | pos () const |
QRect | rect () const |
void | resize (QSize s) |
void | resize (int w, int h) |
void | setAnchorBottom (const bool ab) |
void | setAnchorFlag (const int af) |
void | setAnchorRight (const bool ar) |
void | setText1 (QString newt) |
void | setText2 (QString newt) |
void | setText3 (QString newt) |
void | setVisible (bool t) |
QSize | size () const |
QString | text1 () const |
QString | text2 () const |
QString | text3 () const |
bool | toggleShade () |
void | updateSize () |
int | width () const |
int | x () const |
int | y () const |
~InfoBox () |
Detailed Description
InfoBoxencapsulates a lightweight floating "window" to be drawn directly on a pixmap.The window contains three lines of text, and it can be "shaded" to show only the top line. The window resizes itself automatically to contain the text within it.
- Version:
- 1.0
Definition at line 38 of file infobox.h.
Member Enumeration Documentation
enum InfoBox::AnchorType |
Constructor & Destructor Documentation
InfoBox::InfoBox | ( | ) |
default constructor.
Creates an infobox with empty text string and default geometry
Definition at line 23 of file infobox.cpp.
General constructor.
Specify The text string, x,y position and size.
- Parameters:
-
x the X-coordinate for the box y the Y-coordinate for the box shade if TRUE, apply text shading as well t1 The first line of text t2 The second line of text t3 The third line of text
Definition at line 39 of file infobox.cpp.
General constructor.
Specify The text string, x,y position and size. This behaves just like the above function. It differs only in the data types of its arguments.
- Parameters:
-
p The (x,y) position of the box shade if TRUE, apply text shading as well t1 The first line of text t2 The second line of text t3 The third line of text
Definition at line 55 of file infobox.cpp.
InfoBox::~InfoBox | ( | ) |
Member Function Documentation
bool InfoBox::anchorBottom | ( | ) | const [inline] |
int InfoBox::anchorFlag | ( | ) | const [inline] |
bool InfoBox::anchorRight | ( | ) | const [inline] |
bool InfoBox::constrain | ( | QRect | r, | |
bool | inside = true | |||
) |
Make sure the InfoBox is inside (or outside) the QRect r.
- Returns:
- true if the function was able to obey the constraint.
- Parameters:
-
r the Rect which the box must lie completely inside/outside of. inside if TRUE (the default), the box must lie inside the rect r. Otherwise, the box must lie *outside* rect r.
Definition at line 100 of file infobox.cpp.
Draw the InfoBox.
First calls updateSize() and constrain() to make sure the box is onscreen and the correct size.
- Parameters:
-
p reference to the QPainter on which to draw the box BGColor the background color to be used BGMode the background mode (0=none; 1=semi-transparent; 2=opaque)
Definition at line 123 of file infobox.cpp.
int InfoBox::height | ( | ) | const [inline] |
bool InfoBox::isVisible | ( | ) | const [inline] |
void InfoBox::move | ( | QPoint | p | ) |
Reset the x,y position.
Check the edge anchors. This function behaves just like the above function. It differs only in the data type of its arguments.
- Parameters:
-
p the new (X,Y) position
Definition at line 172 of file infobox.cpp.
void InfoBox::move | ( | int | x, | |
int | y | |||
) |
Reset the x,y position.
Check the edge anchors.
- Parameters:
-
x the new X-position y the new Y-position
Definition at line 168 of file infobox.cpp.
void InfoBox::moved | ( | QPoint | p | ) | [signal] |
QPoint InfoBox::pos | ( | ) | const [inline] |
QRect InfoBox::rect | ( | ) | const |
void InfoBox::resize | ( | QSize | s | ) | [inline] |
void InfoBox::resize | ( | int | w, | |
int | h | |||
) | [inline] |
void InfoBox::setAnchorBottom | ( | const bool | ab | ) |
void InfoBox::setAnchorFlag | ( | const int | af | ) | [inline] |
void InfoBox::setAnchorRight | ( | const bool | ar | ) |
void InfoBox::setText1 | ( | QString | newt | ) | [inline] |
void InfoBox::setText2 | ( | QString | newt | ) | [inline] |
void InfoBox::setText3 | ( | QString | newt | ) | [inline] |
void InfoBox::setVisible | ( | bool | t | ) | [inline] |
void InfoBox::shaded | ( | bool | s | ) | [signal] |
Signal emitted when the box's shaded-state is toggled.
- Parameters:
-
s the new shaded state
- See also:
- InfoBox::toggleShade()
QSize InfoBox::size | ( | ) | const [inline] |
QString InfoBox::text1 | ( | ) | const [inline] |
QString InfoBox::text2 | ( | ) | const [inline] |
QString InfoBox::text3 | ( | ) | const [inline] |
bool InfoBox::toggleShade | ( | ) |
void InfoBox::updateSize | ( | ) |
Set the size of the box to fit the current displayed text.
Definition at line 92 of file infobox.cpp.
int InfoBox::width | ( | ) | const [inline] |
int InfoBox::x | ( | ) | const [inline] |
int InfoBox::y | ( | ) | const [inline] |
The documentation for this class was generated from the following files: