Giveda® Embedded Midware  1.2.0
本文档受《版权法》、《版权公约》保护。深圳技达®版权所有
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
Public 类型 | Public 成员函数 | 静态 Public 成员函数 | Public 属性 | Protected 成员函数 | 友元 | 所有成员列表
GCtrlForm类 参考

窗体、窗口、window;GUI软件由若干个窗口组成, GCtrlForm 类代表窗口;窗口可以包含任意数目的控件 GMItem ;如果没有窗口,控件将无法显示。 更多...

#include <gCtrlForm.h>

继承自 GObject .

GCtrlMsgBox 继承.

Public 类型

enum  enumFocusMode { Auto_Focus =0, Manual_Focus =1 }
 在处理键盘按键事件时,窗体能够管理控件焦点,管理控件焦点的模式有手动、自动两种 更多...
 

Public 成员函数

 GCtrlForm (GCtrlForm *parent=0, const char *name=0)
 构建一个窗体 更多...
 
virtual ~GCtrlForm ()
 
void setX (int x)
 设置窗体的x坐标 更多...
 
void setY (int y)
 设置窗体的y坐标 更多...
 
void setZ (int z)
 设置窗体的z坐标 更多...
 
void setWidth (int w)
 设置窗体的宽度 更多...
 
void setHeight (int h)
 设置窗体的高度 更多...
 
int x () const
 获取窗体的x坐标 更多...
 
int y () const
 获取窗体的y坐标 更多...
 
int z () const
 获取窗体的z坐标 更多...
 
int width () const
 获取窗体的宽度 更多...
 
int height () const
 获取窗体的高度 更多...
 
GRect rect () const
 获取窗体所占用的矩形区域 更多...
 
void setPosition (int x, int y)
 设置窗体的位置 更多...
 
void setSize (int w, int h)
 设置窗体的大小 更多...
 
void setGeometry (int x, int y, int w, int h)
 设置窗体所占用的矩形区域,位置及大小 更多...
 
void moveBy (int x, int y)
 移动窗体;将窗体沿X轴移动 x 像素,沿Y轴移动 y 像素 更多...
 
void setPaletteBackgroundColor (const GColor &c)
 设置窗体的背景颜色 更多...
 
void loadBackgroundPixmap (const uint16_t imgID)
 加载一个图片作为窗体的背景 更多...
 
void loadBackgroundPixmap (const GImage &px)
 加载一个图片作为窗体的背景 更多...
 
void setFocus ()
 让窗体获得焦点;窗体获得焦点后,能够接收到各种输入事件(比如键盘、鼠标、触摸等输入事件) 更多...
 
void update (GRect r)
 更新给定的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。 更多...
 
void update ()
 更新窗体所在的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。 更多...
 
void repaint (GRect r)
 更新给定的矩形区域;这个函数会立刻进行重新绘制。 更多...
 
void repaint ()
 更新窗体所在的矩形区域;这个函数会立刻进行重新绘制 更多...
 
bool isVisible ()
 返回窗体当前是否可见;show() 之后可见, hide() 之后不可见 更多...
 
void setVisible (bool b)
 设置窗体是否可见;(用户改变窗体的可见属性之后,需要调用 update()repaint()更多...
 
virtual void show ()
 显示窗体。相当于:
更多...
 
virtual void hide ()
 隐藏窗体。相当于:
更多...
 
bool hasFocus ()
 获取窗体是否具有焦点 更多...
 
void setFocusMode (enumFocusMode mode)
 设置窗体处理键盘事件时所使用的控件焦点模式 更多...
 
enumFocusMode getFocusMode ()
 获取窗体处理键盘事件时所使用的控件焦点模式 更多...
 
bool isFocusEnabled ()
 获取窗体焦点是否被禁用;窗体焦点被禁用后,窗体将不能获得焦点 ,不能处理各种输入事件。 更多...
 
void setFocusEnabled (bool b)
 设置是否禁用窗体的焦点;窗体焦点被禁用后,窗体将不能获得焦点 ,不能处理各种输入事件。 更多...
 
void loseFocus ()
 
void getFocus ()
 
void appendItem (GMItem *)
 将指定的控件添加到窗体中 更多...
 
bool fwKeyPress (GKeyEvent *e)
 
bool fwMousePress (GMouseEvent *e)
 
bool fwTap (GTapEvent *e)
 
bool fwSwipe (GSwipeEvent *e)
 
bool fwGestureScroll (GGestureScrollEvent *e)
 
DLL_LOCAL QCtrlDefaultAppStyle * getDefaultAppStyle ()
 获取默认的app style 更多...
 
virtual void paintEvent ()
 
const char * name () const
 获取对象名称 更多...
 
GObjectparent () const
 获取对象的parent 更多...
 
virtual bool event (GEvent *)
 开发者可以在子类中覆盖此函数,处理自己需要的事件 更多...
 

静态 Public 成员函数

template<class Receiver , typename... Args>
static int connect (GObject *sender, GSignal< void(Args...)> &signal, Receiver *receiver, void(Receiver::*SlotFunc)(Args...))
 将信号和槽建立连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。 更多...
 
template<class Receiver , typename... Args>
static int disconnect (GObject *sender, GSignal< void(Args...)> &signal, Receiver *receiver, void(Receiver::*SlotFunc)(Args...))
 将信号和槽断开连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。 更多...
 
static bool isObjectExist (GObject *obj)
 判断对象是否已经被析构掉了。 更多...
 

Public 属性

GSignal< void(void)> sigDestroyed
 当对象被析构时,会发射此信号 更多...
 

Protected 成员函数

virtual bool keyPressEvent (GKeyEvent *)
 
virtual bool tapEvent (GTapEvent *)
 
virtual bool swipeEvent (GSwipeEvent *)
 
virtual bool gestureScrollEvent (GGestureScrollEvent *)
 
GMCtrlItemgetFocusItem ()
 返回当前具有焦点的控件 更多...
 

友元

class GMItem
 
class GMCtrlItem
 

详细描述

窗体、窗口、window;GUI软件由若干个窗口组成, GCtrlForm 类代表窗口;窗口可以包含任意数目的控件 GMItem ;如果没有窗口,控件将无法显示。

成员枚举类型说明

在处理键盘按键事件时,窗体能够管理控件焦点,管理控件焦点的模式有手动、自动两种

枚举值
Auto_Focus 

由窗体自动管理控件焦点,窗体会使用键盘的上下左右方向键来自动切换控件焦点

Manual_Focus 

由用户来管理控件焦点,用户须自己处理事件,调用控件的 GMCtrlItem::setFocus 等焦点管理函数

构造及析构函数说明

GCtrlForm::GCtrlForm ( GCtrlForm parent = 0,
const char *  name = 0 
)

构建一个窗体

参数
parent...
name...
virtual GCtrlForm::~GCtrlForm ( )
virtual

成员函数说明

void GCtrlForm::appendItem ( GMItem )

将指定的控件添加到窗体中

参数
...
返回
void
template<class Receiver , typename... Args>
int GObject::connect ( GObject sender,
GSignal< void(Args...)> &  signal,
Receiver *  receiver,
void(Receiver::*)(Args...)  SlotFunc 
)
staticinherited

将信号和槽建立连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。

参数
sender指向发射者的指针
signal指向信号的引用。
receiver指向接收者的指针
SlotFunc指向槽函数的指针
返回
0代表成功;非0代表失败
template<class Receiver , typename... Args>
int GObject::disconnect ( GObject sender,
GSignal< void(Args...)> &  signal,
Receiver *  receiver,
void(Receiver::*)(Args...)  SlotFunc 
)
staticinherited

将信号和槽断开连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。

参数
sender指向发射者的指针
signal指向信号的引用。
receiver指向接收者的指针
SlotFunc指向槽函数的指针
返回
0代表成功;非0代表失败
virtual bool GObject::event ( GEvent )
virtualinherited

开发者可以在子类中覆盖此函数,处理自己需要的事件

参数
...
返回
bool

GTcpSocket, GTimer, GUdpSocket , 以及 GTcpServer 重载.

bool GCtrlForm::fwGestureScroll ( GGestureScrollEvent e)
bool GCtrlForm::fwKeyPress ( GKeyEvent e)
bool GCtrlForm::fwMousePress ( GMouseEvent e)
bool GCtrlForm::fwSwipe ( GSwipeEvent e)
bool GCtrlForm::fwTap ( GTapEvent e)
virtual bool GCtrlForm::gestureScrollEvent ( GGestureScrollEvent )
protectedvirtual
DLL_LOCAL QCtrlDefaultAppStyle* GCtrlForm::getDefaultAppStyle ( )

获取默认的app style

返回
QCtrlDefaultAppStyle*
void GCtrlForm::getFocus ( )
GMCtrlItem* GCtrlForm::getFocusItem ( )
protected

返回当前具有焦点的控件

返回
GMCtrlItem*
enumFocusMode GCtrlForm::getFocusMode ( )

获取窗体处理键盘事件时所使用的控件焦点模式

返回
GCtrlForm::enumFocusMode
bool GCtrlForm::hasFocus ( )

获取窗体是否具有焦点

返回
bool
int GCtrlForm::height ( ) const

获取窗体的高度

返回
int
virtual void GCtrlForm::hide ( )
virtual

隐藏窗体。相当于:

setVisible (false);
update();
返回
void
bool GCtrlForm::isFocusEnabled ( )

获取窗体焦点是否被禁用;窗体焦点被禁用后,窗体将不能获得焦点 ,不能处理各种输入事件。

返回
bool
static bool GObject::isObjectExist ( GObject obj)
staticinherited

判断对象是否已经被析构掉了。

参数
obj...
返回
bool true表示对象健在,false表示对象已经被析构掉了
bool GCtrlForm::isVisible ( )

返回窗体当前是否可见;show() 之后可见, hide() 之后不可见

返回
bool
virtual bool GCtrlForm::keyPressEvent ( GKeyEvent )
protectedvirtual
void GCtrlForm::loadBackgroundPixmap ( const uint16_t  imgID)

加载一个图片作为窗体的背景

参数
imgID图片的数字ID
返回
void
void GCtrlForm::loadBackgroundPixmap ( const GImage px)

加载一个图片作为窗体的背景

参数
px...
返回
void
void GCtrlForm::loseFocus ( )
void GCtrlForm::moveBy ( int  x,
int  y 
)

移动窗体;将窗体沿X轴移动 x 像素,沿Y轴移动 y 像素

参数
x...
y...
返回
void
const char* GObject::name ( ) const
inherited

获取对象名称

返回
const char*
virtual void GCtrlForm::paintEvent ( )
virtual
GObject* GObject::parent ( ) const
inherited

获取对象的parent

返回
GObject*
GRect GCtrlForm::rect ( ) const

获取窗体所占用的矩形区域

返回
GRect
void GCtrlForm::repaint ( GRect  r)

更新给定的矩形区域;这个函数会立刻进行重新绘制。

参数
r需要更新的矩形区域
返回
void
void GCtrlForm::repaint ( )

更新窗体所在的矩形区域;这个函数会立刻进行重新绘制

返回
void
void GCtrlForm::setFocus ( )

让窗体获得焦点;窗体获得焦点后,能够接收到各种输入事件(比如键盘、鼠标、触摸等输入事件)

返回
void
void GCtrlForm::setFocusEnabled ( bool  b)

设置是否禁用窗体的焦点;窗体焦点被禁用后,窗体将不能获得焦点 ,不能处理各种输入事件。

参数
b...
返回
void
void GCtrlForm::setFocusMode ( enumFocusMode  mode)

设置窗体处理键盘事件时所使用的控件焦点模式

参数
mode...
返回
void
void GCtrlForm::setGeometry ( int  x,
int  y,
int  w,
int  h 
)

设置窗体所占用的矩形区域,位置及大小

参数
x...
y...
w...
h...
返回
void
void GCtrlForm::setHeight ( int  h)

设置窗体的高度

参数
h...
返回
void
void GCtrlForm::setPaletteBackgroundColor ( const GColor c)

设置窗体的背景颜色

参数
c...
返回
void
void GCtrlForm::setPosition ( int  x,
int  y 
)

设置窗体的位置

参数
x...
y...
返回
void
void GCtrlForm::setSize ( int  w,
int  h 
)

设置窗体的大小

参数
w...
h...
返回
void
void GCtrlForm::setVisible ( bool  b)

设置窗体是否可见;(用户改变窗体的可见属性之后,需要调用 update()repaint()

参数
b...
返回
void
void GCtrlForm::setWidth ( int  w)

设置窗体的宽度

参数
w...
返回
void
void GCtrlForm::setX ( int  x)

设置窗体的x坐标

参数
x...
返回
void
void GCtrlForm::setY ( int  y)

设置窗体的y坐标

参数
y...
返回
void
void GCtrlForm::setZ ( int  z)

设置窗体的z坐标

参数
z...
返回
void
virtual void GCtrlForm::show ( )
virtual

显示窗体。相当于:

setVisible (true);
update();
返回
void
virtual bool GCtrlForm::swipeEvent ( GSwipeEvent )
protectedvirtual
virtual bool GCtrlForm::tapEvent ( GTapEvent )
protectedvirtual
void GCtrlForm::update ( GRect  r)

更新给定的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。

参数
r需要更新的矩形区域
返回
void
void GCtrlForm::update ( )

更新窗体所在的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。

返回
void
int GCtrlForm::width ( ) const

获取窗体的宽度

返回
int
int GCtrlForm::x ( ) const

获取窗体的x坐标

返回
int
int GCtrlForm::y ( ) const

获取窗体的y坐标

返回
int
int GCtrlForm::z ( ) const

获取窗体的z坐标

返回
int

友元及相关函数文档

friend class GMCtrlItem
friend
friend class GMItem
friend

类成员变量说明

GSignal<void(void)> GObject::sigDestroyed
inherited

当对象被析构时,会发射此信号


该类的文档由以下文件生成: