leocad/common/lc_instructionsdialog.h

187 lines
3.9 KiB
C
Raw Normal View History

2020-06-01 03:46:36 +02:00
#pragma once
2021-01-06 03:48:12 +01:00
#include "lc_instructions.h"
2020-06-01 03:46:36 +02:00
2021-01-15 03:19:58 +01:00
class lcInstructionsPropertiesWidget;
2021-01-15 23:24:44 +01:00
class lcInstructionsStepImageItem : public QGraphicsPixmapItem
2021-01-15 03:19:58 +01:00
{
public:
lcInstructionsStepImageItem(QGraphicsItem* Parent, lcInstructions* Instructions, lcModel* Model, lcStep Step);
2021-01-15 23:24:44 +01:00
lcModel* GetModel() const
{
return mModel;
}
lcStep GetStep() const
{
return mStep;
}
void SetImageSize(int Width, int Height)
{
mWidth = Width;
mHeight = Height;
}
void Update();
2021-01-15 23:24:44 +01:00
protected:
lcInstructions* mInstructions = nullptr;
2021-01-15 23:24:44 +01:00
lcModel* mModel = nullptr;
lcStep mStep = 1;
int mWidth = 1;
int mHeight = 1;
2021-01-15 23:24:44 +01:00
};
class lcInstructionsStepNumberItem : public QGraphicsSimpleTextItem
{
public:
lcInstructionsStepNumberItem(QGraphicsItem* Parent, lcInstructions* Instructions, lcModel* Model, lcStep Step);
2021-01-15 23:24:44 +01:00
lcModel* GetModel() const
{
return mModel;
}
lcStep GetStep() const
{
return mStep;
}
2021-01-15 03:19:58 +01:00
void Update();
2021-01-15 03:19:58 +01:00
protected:
lcInstructions* mInstructions = nullptr;
2021-01-15 23:24:44 +01:00
lcModel* mModel = nullptr;
lcStep mStep = 1;
2021-01-15 03:19:58 +01:00
};
2021-01-16 23:43:24 +01:00
class lcInstructionsPartsListItem : public QGraphicsPixmapItem
{
public:
lcInstructionsPartsListItem(QGraphicsItem* Parent, lcInstructions* Instructions, lcModel* Model, lcStep Step);
lcModel* GetModel() const
{
return mModel;
}
lcStep GetStep() const
{
return mStep;
}
void Update();
protected:
lcInstructions* mInstructions = nullptr;
lcModel* mModel = nullptr;
lcStep mStep = 1;
};
2020-06-01 03:46:36 +02:00
class lcInstructionsPageWidget : public QGraphicsView
{
Q_OBJECT
public:
2021-01-15 23:43:31 +01:00
lcInstructionsPageWidget(QWidget* Parent, lcInstructions* Instructions, lcInstructionsPropertiesWidget* PropertiesWidget);
void SetCurrentPage(const lcInstructionsPage* Page);
2020-06-01 03:46:36 +02:00
2021-01-15 23:43:31 +01:00
protected slots:
void StepSettingsChanged(lcModel* Model, lcStep Step);
2021-01-15 23:43:31 +01:00
void SelectionChanged();
2021-01-07 20:48:43 +01:00
protected:
lcInstructions* mInstructions;
2021-01-15 23:43:31 +01:00
lcInstructionsPropertiesWidget* mPropertiesWidget;
2020-06-01 03:46:36 +02:00
};
2021-01-06 23:06:15 +01:00
class lcInstructionsPageListWidget : public QDockWidget
{
Q_OBJECT
public:
2021-01-07 19:46:57 +01:00
lcInstructionsPageListWidget(QWidget* Parent, lcInstructions* Instructions);
2021-01-06 23:06:15 +01:00
2021-01-07 19:46:57 +01:00
protected slots:
void ShowPageSetupDialog();
2021-01-07 02:45:38 +01:00
2021-01-07 19:46:57 +01:00
public:
//protected:
// QComboBox* mSizeComboBox = nullptr;
// QLineEdit* mWidthEdit = nullptr;
// QLineEdit* mHeightEdit = nullptr;
//
// QRadioButton* mPortraitButton = nullptr;
// QRadioButton* mLandscapeButton = nullptr;
//
// QLineEdit* mLeftMarginEdit = nullptr;
// QLineEdit* mRightMarginEdit = nullptr;
// QLineEdit* mTopMarginEdit = nullptr;
// QLineEdit* mBottomMarginEdit = nullptr;
//
// QComboBox* mUnitsComboBox = nullptr;
2021-01-07 02:45:38 +01:00
2021-01-06 23:06:15 +01:00
QListWidget* mThumbnailsWidget = nullptr;
2021-01-07 19:46:57 +01:00
protected:
lcInstructions* mInstructions;
2021-01-06 23:06:15 +01:00
};
2021-01-15 03:19:58 +01:00
class lcInstructionsPropertiesWidget : public QDockWidget
{
Q_OBJECT
public:
lcInstructionsPropertiesWidget(QWidget* Parent, lcInstructions* Instructions);
2021-01-16 00:37:28 +01:00
void SelectionChanged(QGraphicsItem* FocusItem);
2021-01-15 03:19:58 +01:00
protected:
2021-01-17 20:05:50 +01:00
void AddBoolProperty(lcInstructionsPropertyType Type);
2021-01-16 03:28:41 +01:00
void AddColorProperty(lcInstructionsPropertyType Type);
void AddFontProperty(lcInstructionsPropertyType Type);
2021-01-15 23:43:31 +01:00
2021-01-15 03:19:58 +01:00
lcCollapsibleWidget* mWidget = nullptr;
2021-01-16 03:28:41 +01:00
QGridLayout* mPropertiesLayout = nullptr;
2021-01-15 03:19:58 +01:00
lcInstructions* mInstructions = nullptr;
QGraphicsItem* mFocusItem = nullptr;
2021-01-16 03:28:41 +01:00
lcModel* mModel = nullptr;
lcStep mStep = 1;
2021-01-15 03:19:58 +01:00
};
2020-06-01 03:46:36 +02:00
class lcInstructionsDialog : public QMainWindow
{
Q_OBJECT
public:
lcInstructionsDialog(QWidget* Parent, Project* Project);
protected slots:
void ShowPrintDialog();
2021-01-06 03:48:12 +01:00
void UpdatePageSettings();
2020-06-01 03:46:36 +02:00
void CurrentThumbnailChanged(int Index);
protected:
void Print(QPrinter* Printer);
2021-01-06 03:48:12 +01:00
Project* mProject = nullptr;
2020-06-01 03:46:36 +02:00
int mCurrentPageNumber;
2021-01-15 03:19:58 +01:00
lcInstructions* mInstructions;
2020-06-01 03:46:36 +02:00
2021-01-06 23:06:15 +01:00
lcInstructionsPageWidget* mPageWidget = nullptr;
lcInstructionsPageListWidget* mPageListWidget = nullptr;
2021-01-15 03:19:58 +01:00
lcInstructionsPropertiesWidget* mPropertiesWidget = nullptr;
2021-01-06 03:48:12 +01:00
QToolBar* mPageSettingsToolBar = nullptr;
QAction* mPrintAction = nullptr;
2021-01-06 03:48:12 +01:00
QAction* mVerticalPageAction = nullptr;
QAction* mHorizontalPageAction = nullptr;
QSpinBox* mRowsSpinBox = nullptr;
QSpinBox* mColumnsSpinBox = nullptr;
2020-06-01 03:46:36 +02:00
};