From b1175cefcd9d9e67ee0f9e1b0b91bb8360b510b7 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 10 Sep 2008 08:52:38 +0000 Subject: Added enable/disable methods on frame and groupbox. --- client/widgetbuilder.cc | 2 ++ client/widgets/frame.cc | 9 +++++++++ client/widgets/frame.h | 3 +++ client/widgets/groupbox.cc | 10 ++++++++++ client/widgets/groupbox.h | 3 +++ 5 files changed, 27 insertions(+) (limited to 'client') diff --git a/client/widgetbuilder.cc b/client/widgetbuilder.cc index 99294f6..a6b815c 100644 --- a/client/widgetbuilder.cc +++ b/client/widgetbuilder.cc @@ -42,9 +42,11 @@ QVector< Widget* > widgetBuilder(QDomNode xml_node, QWidget *parent, MacroWindow } else if(xml_elem.tagName() == "frame") { if(xml_elem.hasAttribute("caption")) { GroupBox *frame = new GroupBox(xml_elem, macrowindow); + widgets.push_back(frame); widget = frame; } else { Frame *frame = new Frame(xml_elem, macrowindow); + widgets.push_back(frame); widget = frame; } diff --git a/client/widgets/frame.cc b/client/widgets/frame.cc index 872c3fc..79e060b 100644 --- a/client/widgets/frame.cc +++ b/client/widgets/frame.cc @@ -39,3 +39,12 @@ Frame::Frame(QDomNode &node, MacroWindow *macrowindow) layout()->setContentsMargins(0,0,0,0); } +void Frame::enable() +{ + setEnabled(true); +} + +void Frame::disable() +{ + setEnabled(false); +} diff --git a/client/widgets/frame.h b/client/widgets/frame.h index 33ccc29..4fabd40 100644 --- a/client/widgets/frame.h +++ b/client/widgets/frame.h @@ -35,6 +35,9 @@ class Frame : public QFrame, public Widget { public: Frame(QDomNode &node, MacroWindow *macrowindow); + + void enable(); + void disable(); }; #endif/*__PRACRO_FRAME_H__*/ diff --git a/client/widgets/groupbox.cc b/client/widgets/groupbox.cc index 2bf696f..c3947a7 100644 --- a/client/widgets/groupbox.cc +++ b/client/widgets/groupbox.cc @@ -44,3 +44,13 @@ GroupBox::GroupBox(QDomNode &node, MacroWindow *macrowindow) setTitle(elem.attribute("caption")); } } + +void GroupBox::enable() +{ + setEnabled(true); +} + +void GroupBox::disable() +{ + setEnabled(false); +} diff --git a/client/widgets/groupbox.h b/client/widgets/groupbox.h index aa3e61f..99e05ce 100644 --- a/client/widgets/groupbox.h +++ b/client/widgets/groupbox.h @@ -35,6 +35,9 @@ class GroupBox : public QGroupBox, public Widget { public: GroupBox(QDomNode &node, MacroWindow *macrowindow); + + void enable(); + void disable(); }; #endif/*__PRACRO_GROUPBOX_H__*/ -- cgit v1.2.3