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

对话框 更多...

#include <gCtrlMsgBox.h>

继承自 GCtrlForm .

Public 类型

enum  enumBtn { Btn_Ok =0, Btn_Cancel =1 }
 这个enum用于索引对话框中的按钮。如果需要更多的按钮,请直接使用从2开始的数字来索引你自定义的按钮。 更多...
 
enum  enumFocusMode { Auto_Focus =0, Manual_Focus =1 }
 在处理键盘按键事件时,窗体能够管理控件焦点,管理控件焦点的模式有手动、自动两种 更多...
 

Public 成员函数

 GCtrlMsgBox (const GString &strTitle, const GString &strInfo, int nBtnNums, GCtrlForm *parent=0, const char *name=0)
 构造一个对话框 更多...
 
virtual ~GCtrlMsgBox ()
 
void setBtnCaption (enumBtn btn, GString strCaption)
 设置按钮的文字标题 更多...
 
enumBtn exec ()
 启动对话框的事件循环;除非用户通过点击按钮来关闭对话框,否则本函数将永远阻塞。 更多...
 
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 ()
 返回当前具有焦点的控件 更多...
 

Protected 属性

GCtrlText m_txtTitle
 
GCtrlText m_txtInfo
 
unsigned int m_nBtnNums
 
GPtrList< GCtrlButtonm_btnList
 

详细描述

对话框

作者
明心
版本
1.0.0
日期
2019-2-4

成员枚举类型说明

这个enum用于索引对话框中的按钮。如果需要更多的按钮,请直接使用从2开始的数字来索引你自定义的按钮。

枚举值
Btn_Ok 

确定按钮,值为0

Btn_Cancel 

取消按钮,值为1

enum GCtrlForm::enumFocusMode
inherited

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

枚举值
Auto_Focus 

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

Manual_Focus 

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

构造及析构函数说明

GCtrlMsgBox::GCtrlMsgBox ( const GString strTitle,
const GString strInfo,
int  nBtnNums,
GCtrlForm parent = 0,
const char *  name = 0 
)

构造一个对话框

参数
strTitle标题
strInfo内容
nBtnNums按钮数量
parent...
name...
virtual GCtrlMsgBox::~GCtrlMsgBox ( )
virtual

成员函数说明

void GCtrlForm::appendItem ( GMItem )
inherited

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

参数
...
返回
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 重载.

enumBtn GCtrlMsgBox::exec ( )

启动对话框的事件循环;除非用户通过点击按钮来关闭对话框,否则本函数将永远阻塞。

返回
GCtrlMsgBox::enumBtn 代表被用户点击的那个按钮
bool GCtrlForm::fwGestureScroll ( GGestureScrollEvent e)
inherited
bool GCtrlForm::fwKeyPress ( GKeyEvent e)
inherited
bool GCtrlForm::fwMousePress ( GMouseEvent e)
inherited
bool GCtrlForm::fwSwipe ( GSwipeEvent e)
inherited
bool GCtrlForm::fwTap ( GTapEvent e)
inherited
virtual bool GCtrlForm::gestureScrollEvent ( GGestureScrollEvent )
protectedvirtualinherited
DLL_LOCAL QCtrlDefaultAppStyle* GCtrlForm::getDefaultAppStyle ( )
inherited

获取默认的app style

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

返回当前具有焦点的控件

返回
GMCtrlItem*
enumFocusMode GCtrlForm::getFocusMode ( )
inherited

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

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

获取窗体是否具有焦点

返回
bool
int GCtrlForm::height ( ) const
inherited

获取窗体的高度

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

隐藏窗体。相当于:

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

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

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

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

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

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

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

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

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

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

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

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

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

获取对象名称

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

获取对象的parent

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

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

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

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

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

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

返回
void
void GCtrlMsgBox::setBtnCaption ( enumBtn  btn,
GString  strCaption 
)

设置按钮的文字标题

参数
btnenumBtn
strCaption标题
返回
void
void GCtrlForm::setFocus ( )
inherited

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

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

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

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

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

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

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

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

设置窗体的高度

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

设置窗体的背景颜色

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

设置窗体的位置

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

设置窗体的大小

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

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

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

设置窗体的宽度

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

设置窗体的x坐标

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

设置窗体的y坐标

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

设置窗体的z坐标

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

显示窗体。相当于:

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

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

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

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

返回
void
int GCtrlForm::width ( ) const
inherited

获取窗体的宽度

返回
int
int GCtrlForm::x ( ) const
inherited

获取窗体的x坐标

返回
int
int GCtrlForm::y ( ) const
inherited

获取窗体的y坐标

返回
int
int GCtrlForm::z ( ) const
inherited

获取窗体的z坐标

返回
int

类成员变量说明

GPtrList<GCtrlButton> GCtrlMsgBox::m_btnList
protected
unsigned int GCtrlMsgBox::m_nBtnNums
protected
GCtrlText GCtrlMsgBox::m_txtInfo
protected
GCtrlText GCtrlMsgBox::m_txtTitle
protected
GSignal<void(void)> GObject::sigDestroyed
inherited

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


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