按钮控件 更多...
#include <Button.h>
类 GFt::Widget::Button 继承关系图:Public 成员函数 | |
| Button (const iRect &rect, Block *parent=nullptr, int zIndex=0) | |
| Button (const std::wstring &text, const iRect &rect, Block *parent=nullptr, int zIndex=0) | |
| 构造函数 | |
| virtual | ~Button () |
| Color & | backgroundColor () |
| 按钮背景颜色 | |
| const Color & | backgroundColor () const |
| 按钮背景颜色 | |
| BrushSet & | brushSet () |
| 画刷设置 | |
| const BrushSet & | brushSet () const |
| 画刷设置 | |
| Color & | disabledColor () |
| 按钮禁用颜色 | |
| const Color & | disabledColor () const |
| 按钮禁用颜色 | |
| Color & | hoverColor () |
| 按钮悬停颜色 | |
| const Color & | hoverColor () const |
| 按钮悬停颜色 | |
| bool | isDisabled () const |
| 获取按钮禁用状态 | |
| Color & | pressedColor () |
| 按钮按下颜色 | |
| const Color & | pressedColor () const |
| 按钮按下颜色 | |
| void | setEnable (bool disabled) |
| 设置按钮禁用状态 | |
| std::wstring & | text () |
| 按钮文本 | |
| const std::wstring & | text () const |
| 按钮文本 | |
| Color & | textColor () |
| 按钮文本颜色 | |
| const Color & | textColor () const |
| 按钮文本颜色 | |
| TextSet & | textSet () |
| 文本设置 | |
| const TextSet & | textSet () 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) |
Public 属性 | |
| Signal< void > | onClicked |
| 按钮点击信号 | |
| Signal< void > | onReleased |
| 按钮释放信号 | |
| Signal< bool > | onStatusChanged |
| 按钮状态改变信号 | |
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 |
Protected 成员函数 | |
| void | onDraw (Graphics &g) override |
| 此函数用于绘制内容 | |
| void | onMouseButtonPress (MouseButtonPressEvent *event) override |
| 此函数用于处理鼠标按钮按下事件 | |
| void | onMouseButtonRelease (MouseButtonReleaseEvent *event) override |
| 此函数用于处理鼠标按钮释放事件 | |
Protected 成员函数 继承自 GFt::Block | |
| void | onKeyPress (KeyPressEvent *event) override |
| 此函数用于处理键盘按键按下事件 | |
| void | onKeyRelease (KeyReleaseEvent *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 | |
按钮控件
| GFt::Widget::Button::Button | ( | const std::wstring & | text, |
| const iRect & | rect, | ||
| Block * | parent = nullptr, | ||
| int | zIndex = 0 ) |
构造函数
| text | 按钮文本 |
| rect | 按钮矩形区域 |
| parent | 父控件 |
| zIndex | 控件层级 |
|
virtual |
| Color & GFt::Widget::Button::backgroundColor | ( | ) |
按钮背景颜色
| const Color & GFt::Widget::Button::backgroundColor | ( | ) | const |
按钮背景颜色
| BrushSet & GFt::Widget::Button::brushSet | ( | ) |
画刷设置
| const BrushSet & GFt::Widget::Button::brushSet | ( | ) | const |
画刷设置
| Color & GFt::Widget::Button::disabledColor | ( | ) |
按钮禁用颜色
| const Color & GFt::Widget::Button::disabledColor | ( | ) | const |
按钮禁用颜色
| Color & GFt::Widget::Button::hoverColor | ( | ) |
按钮悬停颜色
| const Color & GFt::Widget::Button::hoverColor | ( | ) | const |
按钮悬停颜色
| bool GFt::Widget::Button::isDisabled | ( | ) | const |
获取按钮禁用状态
|
overrideprotectedvirtual |
此函数用于绘制内容
| g | 绘图设备对象 |
此函数会在每一帧绘制时被调用, 用于绘制内容
重载 GFt::Block .
|
overrideprotectedvirtual |
此函数用于处理鼠标按钮按下事件
此函数存在默认行为:当此对象被点击时捕获焦点
| event | 鼠标按钮按下事件 |
重载 GFt::Block .
|
overrideprotectedvirtual |
| Color & GFt::Widget::Button::pressedColor | ( | ) |
按钮按下颜色
| const Color & GFt::Widget::Button::pressedColor | ( | ) | const |
按钮按下颜色
| void GFt::Widget::Button::setEnable | ( | bool | disabled | ) |
设置按钮禁用状态
| std::wstring & GFt::Widget::Button::text | ( | ) |
按钮文本
| const std::wstring & GFt::Widget::Button::text | ( | ) | const |
按钮文本
| Color & GFt::Widget::Button::textColor | ( | ) |
按钮文本颜色
| const Color & GFt::Widget::Button::textColor | ( | ) | const |
按钮文本颜色
| TextSet & GFt::Widget::Button::textSet | ( | ) |
文本设置
| Signal<void> GFt::Widget::Button::onClicked |
按钮点击信号
| Signal<void> GFt::Widget::Button::onReleased |
按钮释放信号
| Signal<bool> GFt::Widget::Button::onStatusChanged |
按钮状态改变信号