diff options
Diffstat (limited to 'client/widgets/checkgroupbox.h')
-rw-r--r-- | client/widgets/checkgroupbox.h | 58 |
1 files changed, 38 insertions, 20 deletions
diff --git a/client/widgets/checkgroupbox.h b/client/widgets/checkgroupbox.h index 9b6dcdc..5dfa7fb 100644 --- a/client/widgets/checkgroupbox.h +++ b/client/widgets/checkgroupbox.h @@ -28,14 +28,32 @@ #ifndef __PRACRO_CHECKGROUPBOX_H__ #define __PRACRO_CHECKGROUPBOX_H__ -#include "widget.h" +#include "checkbox.h" + #include <QDomNode> +#include <QCheckBox> + +#ifdef LUA_CLASS +#undef LUA_CLASS +#endif +#define LUA_CLASS "CheckGroupBox" /*** * Checkable GroupBox Widget * @tag checkgroupbox * @extends checkbox - * @screenshot + * @screenshot Example 1: type="framed" + * <checkgroupbox name="example" caption="Example" type="framed" layout="vbox" + * truevalue="true" falsevalue="false" value="true"> + * <lineedit name="dims" value="Contained widget 1"/> + * <lineedit name="dims" value="Contained widget 2"/> + * </checkgroupbox> + * @screenshot Example 2: type="simple" + * <checkgroupbox name="example" caption="Example" type="simple" layout="vbox" + * truevalue="true" falsevalue="false" value="true"> + * <lineedit name="dims" value="Contained widget 1"/> + * <lineedit name="dims" value="Contained widget 2"/> + * </checkgroupbox> * @container * @att layout The layout used in the groupbox. Can be one of 'vbox' or 'hbox'. * @att type Defines the type of the checkbox. It can be one of 'framed' or @@ -44,39 +62,39 @@ * to the right of it. Default is 'framed'. */ -class QGroupBox; -class QCheckBox; -class CheckGroupBox : public Widget +class CheckGroupBox : public CheckBox { Q_OBJECT public: CheckGroupBox(QDomNode &node, MacroWindow *macrowindow); ~CheckGroupBox(); - QString value(); - void setValue(QString value, QString source = ""); - - void setWdgValid(bool valid); - - bool checked(); - void setChecked(bool checked); + //void setWdgValid(bool valid); bool setKeyboardFocus(); public slots: - void state_change(bool); + void cgb_state_change(); private: - QString truevalue; - QString falsevalue; - QString type; - bool changedByUser; - - QGroupBox *groupbox; + QCheckBox *checkbox; - QWidget *container; }; +const struct luaL_Reg chkgrpbox_meths[] = + { WDG_METHS, CHKBOX_METHS, {NULL, NULL} }; + +inline void register_checkgroupbox(lua_State *L) +{ + register_widget(L); + + luaL_newmetatable(L, LUA_CLASS); + lua_pushliteral(L, "__index"); + lua_pushvalue(L, -2); + lua_rawset(L, -3); + luaL_register(L, NULL, chkgrpbox_meths); +} + #endif/*__PRACRO_CHECKGROUPBOX_H__*/ |