行布局类 更多...
#include <RowLayout.h>
类 GFt::RowLayout 继承关系图:Public 成员函数 | |
| RowLayout (const iRect &rect, Block *parent=nullptr, int zIndex=0) | |
| 构造函数 | |
| ~RowLayout () override | |
| void | addItem (Block *block, float widthProportion=1.f) |
| 添加参与布局的块对象 | |
| int | getSpace () const |
| 获取布局之间的间隔宽度 | |
| void | removeItem (Block *block) |
| 移除参与布局的块对象 | |
| void | setSpace (int space) |
| 设置布局之间的间隔宽度 | |
Public 成员函数 继承自 GFt::Layout | |
| Layout ()=default | |
| virtual | ~Layout ()=default |
| int | getBottomPadding () const |
| 获取下边距 | |
| int | getLeftPadding () const |
| 获取左边距 | |
| int | getRightPadding () const |
| 获取右边距 | |
| int | getTopPadding () const |
| 获取上边距 | |
| void | setBottomPadding (int bottom) |
| 设置下边距 | |
| void | setLeftPadding (int left) |
| 设置左边距 | |
| void | setPadding (int left, int top, int right, int bottom) |
| 设置边距 | |
| void | setPadding (int leftright, int topbottom) |
| 设置边距 | |
| void | setPadding (int padding) |
| 设置边距 | |
| void | setRightPadding (int right) |
| 设置右边距 | |
| void | setShouldUpdateLayout (bool shouldUpdateLayout=true) |
| 标记是否需要更新布局 | |
| void | setTopPadding (int top) |
| 设置上边距 | |
| bool | shouldUpdateLayout () 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 |
| 重写onDraw方法,刷新布局 | |
Protected 成员函数 继承自 GFt::Block | |
| void | onKeyPress (KeyPressEvent *event) override |
| 此函数用于处理键盘按键按下事件 | |
| void | onKeyRelease (KeyReleaseEvent *event) override |
| 此函数用于处理键盘按键释放事件 | |
| void | onMouseButtonPress (MouseButtonPressEvent *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 |
静态 Public 属性 继承自 GFt::Layout | |
| static constexpr float | Fixed = -1.f |
| 固定宽度占位值 | |
行布局类
构造函数
| rect | 布局的矩形区域 |
| parent | 父对象 |
| zIndex | 所在层级 |
|
overridedefault |
| void GFt::RowLayout::addItem | ( | Block * | block, |
| float | widthProportion = 1.f ) |
添加参与布局的块对象
| block | 块对象 |
| widthProportion | 块的宽度占比,默认1.f,如果为 Layout::Fixed (或其它非正数值)则表示该块宽度为初始化时的固定值 |
| int GFt::RowLayout::getSpace | ( | ) | const |
获取布局之间的间隔宽度
|
overrideprotectedvirtual |
重写onDraw方法,刷新布局
重载 GFt::Block .
| void GFt::RowLayout::removeItem | ( | Block * | block | ) |
移除参与布局的块对象
| block | 块对象 |
| void GFt::RowLayout::setSpace | ( | int | space | ) |
设置布局之间的间隔宽度
| space | 间隔宽度 |