class to create and handle labels.
More...
#include <Labels.H>
|
Labels & | operator<< (std::string str) |
|
Labels & | operator<< (const char *str) |
|
Labels & | operator<< (LabelFuncData nf) |
|
GtkWidget * | getWidget (void) |
| returns the current GtkWidget* in the list More...
|
|
void | pangoMarkup (const char *str) |
| Set the pango markup of the currently displayed text. Allows you to set the current text to different pango text styles, specified in str. Specify only the pango styles here. For example, to set the colour to red we require str="foreground='#ffffa5a50000'", Which we can generate like so: More...
|
|
void | pangoMarkup (Pango &p) |
| Set the pango markup of the currently displayed text. The Pango class is used to setup the label. More...
|
|
GtkWidget * | setAlignment (float xalign, float yalign) |
|
Labels & | operator<< (Pango &p) |
|
void | setLabelsFont (PangoFontDescription *pangoFontDescription) |
|
void | setAngle (double angle) |
|
void | setText (const char *text) |
|
const char * | getText (void) |
|
Labels & | operator= (string text) |
|
Labels & | operator= (const char *text) |
|
| LinkList (void) |
| Initialiser This is for the first element - links to itself. More...
|
|
virtual | ~LinkList (void) |
| Small cleanup ... More...
|
|
void | add (GtkWidget * newElement) |
| Adds as the current element ... Added to the next of the current lug. More...
|
|
GtkWidget * | change (GtkWidget * changeElement) |
| exchange lugs The current lug is replaced with this lug. More...
|
|
GtkWidget * | remove (void) |
| remove the current lug from the LinkList The current lug is removed form the list and passed back to the caller. More...
|
|
GtkWidget * | current (void) |
| return a pointer to the current lug More...
|
|
GtkWidget * | next (void) |
| Return a pointer to the next lug and move on to that lug Increments according to dir (either forward or backwards). More...
|
|
GtkWidget * | prev (void) |
| Return a pointer to the previous lug and move to that lug Increments against dir (either forward or backwards). More...
|
|
GtkWidget * | grab (int i) |
| returns the i'th lug in the chain irrespective of direction More...
|
|
int | getCount (void) |
|
GtkWidget * | getEnd () |
|
class to create and handle labels.
Generally you use istream operators as follows :
labels<<"label 1"<<"label 2";
topWindow << vBox;
You can also do the same thing inline :
You can have clickable labels like so :
gboolean labelCallback(GtkWidget *widget, GdkEventButton *event, gpointer data){
}
- Examples:
- AlignmentTest.C, InlineTest.C, LabelsTest.C, LabelsTest2.C, LabelsTest3.C, PangoTest.C, PangoTest2.C, ProgressBarTest.C, and SeparatorTest.C.
Definition at line 58 of file Labels.H.
◆ getText()
const char* Labels::getText |
( |
void |
| ) |
|
|
inline |
Set the labels text
- Parameters
-
text | The new text for the label |
Definition at line 194 of file Labels.H.
◆ getWidget()
GtkWidget* Labels::getWidget |
( |
void |
| ) |
|
|
inline |
returns the current GtkWidget* in the list
- Returns
- GtkWidget* The current GtkWidget* in the list
Definition at line 102 of file Labels.H.
◆ operator<<() [1/4]
Labels& Labels::operator<< |
( |
std::string |
str | ) |
|
|
inline |
Create a label from a string
- Parameters
-
str | The string to show as the label |
- Returns
- A reference to this Labels class for further overloading
Definition at line 65 of file Labels.H.
◆ operator<<() [2/4]
Labels& Labels::operator<< |
( |
const char * |
str | ) |
|
|
inline |
Create a label from a string
- Parameters
-
str | The char * string to show as the label |
- Returns
- A reference to this Labels class for further overloading
Definition at line 73 of file Labels.H.
◆ operator<<() [3/4]
Add a label with an event box. This creates a label with a clickable eventBox, which will call a callback.
- Parameters
-
nf | The labelFuncData which specifies the label string, the callback function and the data to pass to the callback function. |
- Returns
- A reference to this Labels class for further overloading
Definition at line 86 of file Labels.H.
◆ operator<<() [4/4]
Create a label from a Pango markup class
- Parameters
-
p | The Pango class which contains the formatting |
- Returns
- A reference to this Labels class for further overloading
Definition at line 155 of file Labels.H.
◆ operator=() [1/2]
Labels& Labels::operator= |
( |
string |
text | ) |
|
|
inline |
Set the labels text
- Parameters
-
text | The new text for the label |
Definition at line 202 of file Labels.H.
◆ operator=() [2/2]
Labels& Labels::operator= |
( |
const char * |
text | ) |
|
|
inline |
Set the labels text
- Parameters
-
text | The new text for the label |
Definition at line 210 of file Labels.H.
◆ pangoMarkup() [1/2]
void Labels::pangoMarkup |
( |
const char * |
str | ) |
|
|
inline |
Set the pango markup of the currently displayed text. Allows you to set the current text to different pango text styles, specified in str. Specify only the pango styles here. For example, to set the colour to red we require str="foreground='#ffffa5a50000'", Which we can generate like so:
gchar *gdkCString=gdk_color_to_string(&cls.
colour);
string pangoColour("foreground='"); pangoColour=pangoColour+gdkCString+"'";
g_free(gdkCString);
- Parameters
-
Definition at line 121 of file Labels.H.
◆ pangoMarkup() [2/2]
void Labels::pangoMarkup |
( |
Pango & |
p | ) |
|
|
inline |
Set the pango markup of the currently displayed text. The Pango class is used to setup the label.
- Parameters
-
p | The pango marked up string to set (see Pango) |
Definition at line 134 of file Labels.H.
◆ setAlignment()
GtkWidget* Labels::setAlignment |
( |
float |
xalign, |
|
|
float |
yalign |
|
) |
| |
|
inline |
Set the alignment of the label for parents.
- Parameters
-
xalign | the x alignment (0.0 for left, 1.0 for right) |
yalign | the y alignment (0.0 for top, 1.0 for bottom) |
- Returns
- the current label which was adjusted, NULL if there are no labels
Definition at line 143 of file Labels.H.
◆ setAngle()
void Labels::setAngle |
( |
double |
angle | ) |
|
|
inline |
Set the label's angle. The angle setting for the label is ignored if the label is selectable, wrapped, or ellipsized.
- Parameters
-
angle | An angle of 90 reads from from bottom to top, an angle of 270, from top to bottom. |
Definition at line 178 of file Labels.H.
◆ setLabelsFont()
void Labels::setLabelsFont |
( |
PangoFontDescription * |
pangoFontDescription | ) |
|
|
inline |
Given a PangoFontDescription, set a label's font.
Labels lablel<<
"Text I want to Bold";
Definition at line 169 of file Labels.H.
◆ setText()
void Labels::setText |
( |
const char * |
text | ) |
|
|
inline |
Set the labels text
- Parameters
-
text | The new text for the label |
Definition at line 186 of file Labels.H.
The documentation for this class was generated from the following file: