1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
6 * Created on: Apr 29, 2014
10 #ifndef XGUI_PROPERTYPANEL_H_
11 #define XGUI_PROPERTYPANEL_H_
15 #include <ModuleBase_ModelWidget.h>
16 #include <ModuleBase_IPropertyPanel.h>
23 const static char* PROP_PANEL = "property_panel_dock";
24 const static char* PROP_PANEL_OK = "property_panel_ok";
25 const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
27 class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
33 XGUI_PropertyPanel(QWidget* theParent);
34 virtual ~XGUI_PropertyPanel();
36 /// Returns main widget of the property panel, which children will be created
37 /// by WidgetFactory using the XML definition
38 QWidget* contentWidget();
40 /// Brings back all widget created by widget factory for signal/slot
41 /// connections and further processing
42 void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
44 /// Returns all property panel's widget created by WidgetFactory
45 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
47 /// Removes all widgets in the widget area of the property panel
50 /// Returns currently active widget
51 virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
53 /// Activate the next widget in the property panel
54 /// \param theWidget a widget. The next widget should be activated
55 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
57 /// Activate the next from current widget in the property panel
58 virtual void activateNextWidget();
60 void setStretchEnabled(bool isEnabled);
62 /// Set Enable/Disable state of Ok button
63 virtual void setOkEnabled(bool theEnabled);
65 /// Returns state of Ok button
66 virtual bool isOkEnabled() const;
68 /// Set Enable/Disable state of Ok button
69 virtual void setCancelEnabled(bool theEnabled);
71 /// Returns state of Ok button
72 virtual bool isCancelEnabled() const;
75 void updateContentWidget(FeaturePtr theFeature);
76 // Enables / disables "ok" ("accept") button
77 void setAcceptEnabled(bool);
79 // Makes the given widget active, highlights it and removes
80 // highlighting from the previous active widget
81 // emits widgetActivated(theWidget) signal
82 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
85 /// Signal about the point 2d set to the feature
86 /// \param the feature
87 /// \param the attribute of the feature
88 //void storedPoint2D(ObjectPtr theFeature, const std::string& theAttribute);
92 QWidget* myCustomWidget;
93 QList<ModuleBase_ModelWidget*> myWidgets;
94 QVBoxLayout* myMainLayout;
95 ModuleBase_ModelWidget* myActiveWidget;
98 #endif /* XGUI_PROPERTYPANEL_H_ */