4 * Created on: Apr 29, 2014
8 #ifndef XGUI_PROPERTYPANEL_H_
9 #define XGUI_PROPERTYPANEL_H_
13 #include <ModuleBase_ModelWidget.h>
14 #include <ModuleBase_IPropertyPanel.h>
21 const static char* PROP_PANEL = "property_panel_dock";
22 const static char* PROP_PANEL_OK = "property_panel_ok";
23 const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
25 class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
31 XGUI_PropertyPanel(QWidget* theParent);
32 virtual ~XGUI_PropertyPanel();
34 /// Returns main widget of the property panel, which children will be created
35 /// by WidgetFactory using the XML definition
36 QWidget* contentWidget();
38 /// Brings back all widget created by widget factory for signal/slot
39 /// connections and further processing
40 void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
42 /// Returns all property panel's widget created by WidgetFactory
43 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
45 /// Removes all widgets in the widget area of the property panel
48 /// Returns currently active widget
49 virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
51 /// Activate the next widget in the property panel
52 /// \param theWidget a widget. The next widget should be activated
53 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
55 /// Activate the next from current widget in the property panel
56 virtual void activateNextWidget();
58 void setStretchEnabled(bool isEnabled);
61 void updateContentWidget(FeaturePtr theFeature);
62 // Enables / disables "ok" ("accept") button
63 void setAcceptEnabled(bool);
65 // Makes the given widget active, highlights it and removes
66 // highlighting from the previous active widget
67 // emits widgetActivated(theWidget) signal
68 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
71 /// Signal about the point 2d set to the feature
72 /// \param the feature
73 /// \param the attribute of the feature
74 //void storedPoint2D(ObjectPtr theFeature, const std::string& theAttribute);
78 QWidget* myCustomWidget;
79 QList<ModuleBase_ModelWidget*> myWidgets;
80 QVBoxLayout* myMainLayout;
81 ModuleBase_ModelWidget* myActiveWidget;
84 #endif /* XGUI_PROPERTYPANEL_H_ */