1
0
Fork 0
mirror of https://github.com/leozide/leocad synced 2025-01-26 19:58:08 +01:00
leocad/common/lc_instructionsdialog.h

187 lines
3.9 KiB
C
Raw Normal View History

2020-05-31 18:46:36 -07:00
#pragma once
2021-01-05 18:48:12 -08:00
#include "lc_instructions.h"
2020-05-31 18:46:36 -07:00
2021-01-14 18:19:58 -08:00
class lcInstructionsPropertiesWidget;
2021-01-15 14:24:44 -08:00
class lcInstructionsStepImageItem : public QGraphicsPixmapItem
2021-01-14 18:19:58 -08:00
{
public:
lcInstructionsStepImageItem(QGraphicsItem* Parent, lcInstructions* Instructions, lcModel* Model, lcStep Step);
2021-01-15 14:24:44 -08: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 14:24:44 -08:00
protected:
lcInstructions* mInstructions = nullptr;
2021-01-15 14:24:44 -08:00
lcModel* mModel = nullptr;
lcStep mStep = 1;
int mWidth = 1;
int mHeight = 1;
2021-01-15 14:24:44 -08:00
};
class lcInstructionsStepNumberItem : public QGraphicsSimpleTextItem
{
public:
lcInstructionsStepNumberItem(QGraphicsItem* Parent, lcInstructions* Instructions, lcModel* Model, lcStep Step);
2021-01-15 14:24:44 -08:00
lcModel* GetModel() const
{
return mModel;
}
lcStep GetStep() const
{
return mStep;
}
2021-01-14 18:19:58 -08:00
void Update();
2021-01-14 18:19:58 -08:00
protected:
lcInstructions* mInstructions = nullptr;
2021-01-15 14:24:44 -08:00
lcModel* mModel = nullptr;
lcStep mStep = 1;
2021-01-14 18:19:58 -08:00
};
2021-01-16 14:43:24 -08: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-05-31 18:46:36 -07:00
class lcInstructionsPageWidget : public QGraphicsView
{
Q_OBJECT
public:
2021-01-15 14:43:31 -08:00
lcInstructionsPageWidget(QWidget* Parent, lcInstructions* Instructions, lcInstructionsPropertiesWidget* PropertiesWidget);
void SetCurrentPage(const lcInstructionsPage* Page);
2020-05-31 18:46:36 -07:00
2021-01-15 14:43:31 -08:00
protected slots:
void StepSettingsChanged(lcModel* Model, lcStep Step);
2021-01-15 14:43:31 -08:00
void SelectionChanged();
2021-01-07 11:48:43 -08:00
protected:
lcInstructions* mInstructions;
2021-01-15 14:43:31 -08:00
lcInstructionsPropertiesWidget* mPropertiesWidget;
2020-05-31 18:46:36 -07:00
};
2021-01-06 14:06:15 -08:00
class lcInstructionsPageListWidget : public QDockWidget
{
Q_OBJECT
public:
2021-01-07 10:46:57 -08:00
lcInstructionsPageListWidget(QWidget* Parent, lcInstructions* Instructions);
2021-01-06 14:06:15 -08:00
2021-01-07 10:46:57 -08:00
protected slots:
void ShowPageSetupDialog();
2021-01-06 17:45:38 -08:00
2021-01-07 10:46:57 -08: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-06 17:45:38 -08:00
2021-01-06 14:06:15 -08:00
QListWidget* mThumbnailsWidget = nullptr;
2021-01-07 10:46:57 -08:00
protected:
lcInstructions* mInstructions;
2021-01-06 14:06:15 -08:00
};
2021-01-14 18:19:58 -08:00
class lcInstructionsPropertiesWidget : public QDockWidget
{
Q_OBJECT
public:
lcInstructionsPropertiesWidget(QWidget* Parent, lcInstructions* Instructions);
2021-01-15 15:37:28 -08:00
void SelectionChanged(QGraphicsItem* FocusItem);
2021-01-14 18:19:58 -08:00
protected:
2021-01-17 11:05:50 -08:00
void AddBoolProperty(lcInstructionsPropertyType Type);
2021-01-15 18:28:41 -08:00
void AddColorProperty(lcInstructionsPropertyType Type);
void AddFontProperty(lcInstructionsPropertyType Type);
2021-01-15 14:43:31 -08:00
2021-01-14 18:19:58 -08:00
lcCollapsibleWidget* mWidget = nullptr;
2021-01-15 18:28:41 -08:00
QGridLayout* mPropertiesLayout = nullptr;
2021-01-14 18:19:58 -08:00
lcInstructions* mInstructions = nullptr;
QGraphicsItem* mFocusItem = nullptr;
2021-01-15 18:28:41 -08:00
lcModel* mModel = nullptr;
lcStep mStep = 1;
2021-01-14 18:19:58 -08:00
};
2020-05-31 18:46:36 -07:00
class lcInstructionsDialog : public QMainWindow
{
Q_OBJECT
public:
lcInstructionsDialog(QWidget* Parent, Project* Project);
protected slots:
void ShowPrintDialog();
2021-01-05 18:48:12 -08:00
void UpdatePageSettings();
2020-05-31 18:46:36 -07:00
void CurrentThumbnailChanged(int Index);
protected:
void Print(QPrinter* Printer);
2021-01-05 18:48:12 -08:00
Project* mProject = nullptr;
2020-05-31 18:46:36 -07:00
int mCurrentPageNumber;
2021-01-14 18:19:58 -08:00
lcInstructions* mInstructions;
2020-05-31 18:46:36 -07:00
2021-01-06 14:06:15 -08:00
lcInstructionsPageWidget* mPageWidget = nullptr;
lcInstructionsPageListWidget* mPageListWidget = nullptr;
2021-01-14 18:19:58 -08:00
lcInstructionsPropertiesWidget* mPropertiesWidget = nullptr;
2021-01-05 18:48:12 -08:00
QToolBar* mPageSettingsToolBar = nullptr;
QAction* mPrintAction = nullptr;
2021-01-05 18:48:12 -08:00
QAction* mVerticalPageAction = nullptr;
QAction* mHorizontalPageAction = nullptr;
QSpinBox* mRowsSpinBox = nullptr;
QSpinBox* mColumnsSpinBox = nullptr;
2020-05-31 18:46:36 -07:00
};