文本标签控件 更多...
#include <Label.h>
类 GFt::Widget::Label 继承关系图:Public 成员函数 | |
| Label (const iRect &rect, Block *parent=nullptr, int zIndex=0) | |
| Label (const std::wstring &text, const iRect &rect, Block *parent=nullptr, int zIndex=0) | |
| 构造函数 | |
| ~Label () override=default | |
| int & | bottomPadding () |
| 下边距 | |
| int | bottomPadding () const |
| BrushSet & | brushSet () |
| 画刷集 | |
| const BrushSet & | brushSet () const |
| int & | leftPadding () |
| 左边距 | |
| int | leftPadding () const |
| int & | rightPadding () |
| 右边距 | |
| int | rightPadding () const |
| void | setPadding (int left, int right, int top, int bottom) |
| 设置边距 | |
| void | setPadding (int leftRight, int topBottom) |
| 设置边距 | |
| void | setPadding (int padding) |
| 设置边距 | |
| std::wstring & | text () |
| 文本内容 | |
| const std::wstring & | text () const |
| int & | textAlignment () |
| 文本对齐方式 | |
| int | textAlignment () const |
| TextSet & | textSet () |
| 文本集 | |
| const TextSet & | textSet () const |
| int & | topPadding () |
| 上边距 | |
| int | topPadding () const |
Public 成员函数 继承自 GFt::Block | |
| Block (const iRect &rect, Block *parent=nullptr, int zIndex=0) | |
| 构造函数 | |
| virtual | ~Block () |
| iPoint | absolutePosition () const |
| 计算相对于屏幕的绝对坐标 | |
| void | addChild (Block *child) |
| 添加子对象 | |
| Block * | getParent () const |
| 获取父对象 | |
| int | getZIndex () const |
| 获取层级 | |
| void | hide () |
| 隐藏块对象 | |
| bool | isHide () const |
| 获取块当前是否被隐藏 | |
| iPoint | relativePosFrom (Block *block) const |
| 计算相对于指定对象的相对坐标 | |
| void | removeChild (Block *child) |
| 移除子对象 | |
| void | setParent (Block *parent) |
| 设置父对象 | |
| void | setZIndex (int zIndex) |
| 设置层级 | |
| void | show () |
| 显示块对象 | |
Public 成员函数 继承自 GFt::GraphInterface | |
| GraphInterface (iRect rect) | |
| 构造函数 | |
| virtual | ~GraphInterface () |
| const iRect & | rect () const |
| void | setHeight (int height) |
| void | setPosition (const iPoint &pos) |
| void | setRect (const iRect &rect) |
| void | setSize (const iSize &size) |
| void | setWidth (int width) |
| void | setX (int x) |
| void | setY (int y) |
Protected 成员函数 | |
| void | onDraw (Graphics &g) override |
| 此函数用于绘制内容 | |
| void | onMouseButtonPress (MouseButtonPressEvent *event) override |
| 此函数用于处理鼠标按钮按下事件 | |
Protected 成员函数 继承自 GFt::Block | |
| void | onKeyPress (KeyPressEvent *event) override |
| 此函数用于处理键盘按键按下事件 | |
| void | onKeyRelease (KeyReleaseEvent *event) override |
| 此函数用于处理键盘按键释放事件 | |
| void | onMouseButtonRelease (MouseButtonReleaseEvent *event) override |
| 此函数用于处理鼠标按钮释放事件 | |
| void | onMouseMove (MouseMoveEvent *event) override |
| 此函数用于处理鼠标移动事件 | |
| void | onMouseWheel (MouseWheelEvent *event) override |
| 此函数用于处理鼠标滚轮事件 | |
| void | onTextInput (TextInputEvent *event) override |
| 此函数用于处理文本输入事件 | |
Protected 成员函数 继承自 GFt::GraphInterface | |
Protected 成员函数 继承自 GFt::MouseButtonPressEventMonitor | |
Protected 成员函数 继承自 GFt::MouseButtonReleaseEventMonitor | |
Protected 成员函数 继承自 GFt::MouseMoveEventMonitor | |
Protected 成员函数 继承自 GFt::MouseWheelEventMonitor | |
Protected 成员函数 继承自 GFt::KeyPressEventMonitor | |
Protected 成员函数 继承自 GFt::KeyReleaseEventMonitor | |
Protected 成员函数 继承自 GFt::TextInputEventMonitor | |
额外继承的成员函数 | |
Public 属性 继承自 GFt::Block | |
| Signal< Block * > | FocusOff |
| 当该对象失去焦点时触发该信号 | |
| Signal< Block * > | FocusOn |
| 当该对象获得焦点时触发该信号 | |
| Signal< Block * > | HoverOff |
| 当鼠标移开该对象时之上时触发该信号 | |
| Signal< Block * > | HoverOn |
| 当鼠标悬停该对象时之上时触发该信号 | |
| Signal< bool > | ViewChanged |
| 当该对象显示状态变化时触发该信号 | |
Public 属性 继承自 GFt::GraphInterface | |
| Signal< const iPoint & > | onPositionChanged |
| Signal< const iSize & > | onSizeChanged |
文本标签控件
| GFt::Widget::Label::Label | ( | const std::wstring & | text, |
| const iRect & | rect, | ||
| Block * | parent = nullptr, | ||
| int | zIndex = 0 ) |
构造函数
| text | 文本内容 |
| rect | 位置大小 |
| parent | 父控件 |
| zIndex | 层级 |
|
overridedefault |
| int & GFt::Widget::Label::bottomPadding | ( | ) |
下边距
| int GFt::Widget::Label::bottomPadding | ( | ) | const |
| BrushSet & GFt::Widget::Label::brushSet | ( | ) |
画刷集
| const BrushSet & GFt::Widget::Label::brushSet | ( | ) | const |
| int & GFt::Widget::Label::leftPadding | ( | ) |
左边距
| int GFt::Widget::Label::leftPadding | ( | ) | const |
|
overrideprotectedvirtual |
此函数用于绘制内容
| g | 绘图设备对象 |
此函数会在每一帧绘制时被调用, 用于绘制内容
重载 GFt::Block .
|
overrideprotectedvirtual |
此函数用于处理鼠标按钮按下事件
此函数存在默认行为:当此对象被点击时捕获焦点
| event | 鼠标按钮按下事件 |
重载 GFt::Block .
| int & GFt::Widget::Label::rightPadding | ( | ) |
右边距
| int GFt::Widget::Label::rightPadding | ( | ) | const |
| void GFt::Widget::Label::setPadding | ( | int | left, |
| int | right, | ||
| int | top, | ||
| int | bottom ) |
设置边距
| left | 左边距 |
| right | 右边距 |
| top | 上边距 |
| bottom | 下边距 |
| void GFt::Widget::Label::setPadding | ( | int | leftRight, |
| int | topBottom ) |
设置边距
| leftRight | 左右边距 |
| topBottom | 上下边距 |
| void GFt::Widget::Label::setPadding | ( | int | padding | ) |
设置边距
| padding | 统一设置边距 |
| std::wstring & GFt::Widget::Label::text | ( | ) |
文本内容
| const std::wstring & GFt::Widget::Label::text | ( | ) | const |
| int & GFt::Widget::Label::textAlignment | ( | ) |
文本对齐方式
| int GFt::Widget::Label::textAlignment | ( | ) | const |
| TextSet & GFt::Widget::Label::textSet | ( | ) |
文本集
| int & GFt::Widget::Label::topPadding | ( | ) |
上边距
| int GFt::Widget::Label::topPadding | ( | ) | const |