//----------------------------------------------------------------------------- // $Id: QtRpl/RplBlockPanel.hpp 2017/07/23 16:20:45 philw $ // Editor panel (with menubar construction) for RplBlock objects. //----------------------------------------------------------------------------- // // class RplBlockPanel : public QFrame, public RplObjPanel // //-- #pragma once #ifndef RplBlockPanelINCLUDED #define RplBlockPanelINCLUDED #ifndef RplBaseDlgINCLUDED #include "RplBaseDlg.hpp" #endif #ifndef RplBlockINCLUDED #include "RplBlock.hpp" #endif #ifndef RplObjPanelINCLUDED #include "RplObjPanel.hpp" #endif class Ui_RplBlockPanelWidgets; class RplBlockMenus; class RplFrame; class RowOToggles; #include #include //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- class RplBlockPanel : public QFrame, public RplObjPanel { Q_OBJECT public: RplBlockPanel(RplBaseDlg* parent, RplBlock*); virtual void completeInit() override; virtual void installMenuBar() override; virtual RplBlockPanel* instance() override {return this;} ~RplBlockPanel(); virtual bool update() override; virtual bool updateDescr() override; virtual bool updateNotes() override; virtual bool updateLoadStatus() override; virtual bool rebuild() override; virtual void selectRplStatement(RplStatement* statement) override; virtual void showDescription(bool) override; virtual void showNotes(bool) override; virtual void selectStringInDescription( const Rpl::SearchSpec& searchSpec) override; virtual void selectStringInNotes( const Rpl::SearchSpec& searchSpec) override; public slots: virtual void updateEditActions() override; virtual void scrollToDebugCursor() override; private slots: // Dialog GUI elements void rplSetTypeIconButton_clicked(); void rplGroupTypeIconButton_clicked(); void preDmiHandler(); void postDmiHandler(); void togglePreDmiObj(); void togglePostDmiObj(); void showOptionalFrames(); void setBreakBeforeExec(bool doBreak); void setBreakAfterExec(bool doBreak); void stopOnNaNHandler(bool stop); void updateDescriptionToggleRelevance(); void updateNotesToggleRelevance(); void updateExecConstraintToggleRelevance(); void updateCommentsToggleRelevance(); void visibilityToggleChangedHandler(int toggleIndex, bool on); void setValueFlagChangedHandler(int index); private: // Initialization and updates void initConnections(); void initWidgets(); void initVisibilityToggles(); void initForApplication(); void loadSettings(); void saveSettings() const; void updateDmiDisplay(); public: virtual RplObj *getRplObj() const override { return _rplBlock; }; virtual QString nameEditorText() const override; virtual void updateExternalDocButton() override; virtual void debuggerStateChanged() override {} // not implemented private: // Containing QMainWindow dialog RplBaseDlg* _dlg; bool _initialized; // RPL elements RplBlock *_rplBlock; // GUI elements Ui_RplBlockPanelWidgets* _ui; RplBlockMenus* _mu; RplFrame *_bodyRplFrame; RplFrame *_constraintRplFrame; QUndoStack _undoStack; RowOToggles* _toggles; int _showDescriptionToggleIndex; int _showNotesToggleIndex; int _showExecConstraintToggleIndex; int _showCommentsToggleIndex; public slots: void aboutToShowEditMenu(); void aboutToShowViewMenu(); void aboutToShowRuleMenu(); void showCommentsChangedHandler(bool show); }; #endif // RplBlockPanelINCLUDED //--- (end RplBlockPanel.hpp) ---