LibreCAD
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
linepatternselect.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cad/document/document.h>
4 
5 #include <QComboBox>
6 
7 #include <cad/meta/dxflinepattern.h>
11 #include <cadmdichild.h>
12 
13 #define BY_BLOCK "ByBlock"
14 #define BY_LAYER "ByLayer"
15 #define NEW_LP "New line pattern"
16 #define MANAGE_LP "Manage line patterns"
17 
18 namespace lc {
19  namespace ui {
23  class LinePatternSelect : public QComboBox {
24  Q_OBJECT
25 
26  public:
34  LinePatternSelect(lc::Document_SPtr document = nullptr, QWidget* parent = 0, bool showByLayer = false,
35  bool showByBlock = false);
36 
44  LinePatternSelect(CadMdiChild* mdiChild = nullptr, QWidget* parent = 0, bool showByLayer = false,
45  bool showByBlock = false);
46 
51  void setDocument(lc::Document_SPtr document = nullptr);
52 
57  void setMdiChild(CadMdiChild* mdiChild = nullptr);
58 
63  lc::DxfLinePattern_CSPtr linePattern();
64 
65  public slots:
66 
72  void onLayerChanged(lc::Layer_CSPtr layer);
73 
74  private slots:
75 
76  void onActivated(const QString& text);
77 
78  private:
79  void createEntries();
80 
81  QIcon generateQIcon(lc::DxfLinePatternByValue_CSPtr linePattern);
82 
83  QSize qIconSize;
84 
87 
88  lc::Document_SPtr _document;
89  lc::ui::MetaInfoManager_SPtr _metaInfoManager;
90 
91  void on_addLinePatternEvent(const lc::AddLinePatternEvent&);
92  void on_removeLinePatternEvent(const lc::RemoveLinePatternEvent&);
93  void on_replaceLinePatternEvent(const lc::ReplaceLinePatternEvent&);
94  };
95  }
96 }
void on_removeLinePatternEvent(const lc::RemoveLinePatternEvent &)
void onLayerChanged(lc::Layer_CSPtr layer)
Event when a new layer is selected.
void setMdiChild(CadMdiChild *mdiChild=nullptr)
Set the window on which line pattern is applied.
void setDocument(lc::Document_SPtr document=nullptr)
Change document.
void onActivated(const QString &text)
LinePatternSelect(lc::Document_SPtr document=nullptr, QWidget *parent=0, bool showByLayer=false, bool showByBlock=false)
Create widget.
void on_replaceLinePatternEvent(const lc::ReplaceLinePatternEvent &)
lc::Document_SPtr _document
lc::ui::MetaInfoManager_SPtr _metaInfoManager
QIcon generateQIcon(lc::DxfLinePatternByValue_CSPtr linePattern)
lc::DxfLinePattern_CSPtr linePattern()
Return selected line pattern.
Dropdown select for DxfLinePatterns.
void on_addLinePatternEvent(const lc::AddLinePatternEvent &)