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);
63 void updateContentWidget(FeaturePtr theFeature);
64 // Enables / disables "ok" ("accept") button
65 void setAcceptEnabled(bool);
67 // Makes the given widget active, highlights it and removes
68 // highlighting from the previous active widget
69 // emits widgetActivated(theWidget) signal
70 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
73 /// Signal about the point 2d set to the feature
74 /// \param the feature
75 /// \param the attribute of the feature
76 //void storedPoint2D(ObjectPtr theFeature, const std::string& theAttribute);
80 QWidget* myCustomWidget;
81 QList<ModuleBase_ModelWidget*> myWidgets;
82 QVBoxLayout* myMainLayout;
83 ModuleBase_ModelWidget* myActiveWidget;
86 #endif /* XGUI_PROPERTYPANEL_H_ */