Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
UppHub
Status & Roadmap
FAQ
Authors & License
Forums
Funding U++
Search on this site











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord Logo

Static widgets

 

StaticText

 

class StaticText : public Ctrl, public LabelBase

Static text.

 

 

Public Method List

 

StaticText& SetFont(Font font)

Sets the font of text.

 


 

StaticText& SetInk(Color color)

Sets the color of text.

 


 

StaticText& SetAlign(int align)

Sets alignment align. Allowed values are ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT.

 


 

StaticText& AlignLeft()

Same as SetAlign(ALIGN_LEFT).

 


 

StaticText& AlignCenter()

Same as SetAlign(ALIGN_CENTER).

 


 

StaticText& AlignRight()

Same as SetAlign(ALIGN_RIGHT).

 


 

StaticText& SetVAlign(int align)

StaticText& AlignTop()

StaticText& AlignVCenter()

StaticText& AlignBottom()

Sets vertical alignment of label text.

 


 

StaticText& SetImage(const Image& img, int spc = 0)

Sets the Image to be displayed before the text. spc is space between the text and Image.

 


 

StaticText& SetText(const char *text)

StaticText& operator=(const char *s)

Sets text. "\1" at the beginning of text activates QTF.

 

 


 

String GetText() const

Returns the text.

 


 

Font GetFont() const

Returns the font.

 


 

Color GetInk() const

Returns the text color.

 


 

int GetAlign() const

Returns the alignment.

 


 

int GetVAlign() const

Returns the vertical alignment. .

 


 

Image GetImage() const

Returns the image.

 

 

Label

 

class Label : public StaticText

Generally used to label other widgets. Differs from StaticText by implementing hotkey processing. Hotkeys are assigned automatically by U++ library, however they can also by preassigned using '&' character.

 

 

Public Method List

 

Label& SetText(const char *text)

Label& operator=(const char *s)

Sets the text. Ignores '&' used to mark hotkeys.

 


 

Label& SetLabel(const char *lbl)

Sets the text, '&' marks hotkeys.

 

 

 

 

LabelBox

 

class LabelBox : public Label

Rectangular static widget used to visually group other widgets.

 

 

Public Method List

 

virtual LabelBox& operator=(const char *s)

Assigns the text of LabelBox.

 


 

LabelBox& SetColor(Color c)

Sets the color of LabelBox.

 

 

 

ParentCtrl

 

class ParentCtrl : public Ctrl

This class is supposed to be used as logical parent in situation when more widgets are to be grouped together. The only difference from Ctrl is that ParentCtrl activates Transparent in constructor.

 

 

 

 

StaticRect

 

class StaticRect : public Ctrl

Widget completely filled with single color.

 

 

Public Method List

 

StaticRect& Color(class Color c)

The color. Default is SColorFace.

 

 

 

 

ImageCtrl

 

class ImageCtrl : public Ctrl

Display raster Image. Image is centered in the widget rectangle.

 

 

Public Method List

 

ImageCtrl& SetImage(const Image& _img)

Sets the image.

 

 

 

 

DrawingCtrl

 

class DrawingCtrl : public Ctrl

Displays Drawing.

 

 

Public Method List

 

DrawingCtrl& Background(Color color)

Sets background color. Default is white.

 


 

Drawing Get() const

Returns Drawing assigned to Picture.

 


 

DrawingCtrl& KeepRatio(bool keep = true)

If active, Picture keeps the aspect ratio of Drawing. Default is on.

 


 

DrawingCtrl& NoKeepRatio()

Do not keep aspect ratio.

 


 

DrawingCtrl& Set(const Drawing& _picture)

DrawingCtrl& operator=(const Drawing& _picture)

Assigns the Drawing.

 


 

DrawingCtrl& operator=(const Painting& _picture)

Assigns _picture, converted to Drawing.

 

 

 

SeparatorCtrl

 

class SeparatorCtrl : public Ctrl

Horizontal or vertical separator line. Direction depends on aspect ratio.

 

 

Public Method List

 

SeparatorCtrl& Margin(int w)

Sets the left-right (for horizontal separator) or top-bottom margin. Default value is 2.

 


 

SeparatorCtrl& Margin(int l, int r)

Sets the top-right (for horizontal separator) or top-bottom to l and r, in that order. Default value is 2.

 


 

SeparatorCtrl& SetSize(int w)

Sets the size returned by GetMinSize - included to affect the way how widget is treated in BarCtrl. Default value is 7.

 


 

SeparatorCtrl& SetStyle(const Style& s)

Sets the visual style to SeparatorCtrl::Style s. The style is a simple structure with two fields:

l1

the first margin

l2

the second margin

 

 

Do you want to contribute?