ODIN
ldrblockwidget.h
1 /***************************************************************************
2  ldrblockwidget.h - description
3  -------------------
4  begin : Mon Aug 5 2005
5  copyright : (C) 2000-2021 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef LDRBLOCKWIDGET_H
19 #define LDRBLOCKWIDGET_H
20 
21 #include <qgroupbox.h>
22 
23 #include "odinqt.h"
24 
25 #include <odinpara/ldrblock.h>
26 
27 class LDRwidgetDialog; // forward declaration
28 
30 
31 class LDRblockGrid : public QWidget {
32 
33  Q_OBJECT
34 
35  public:
36  LDRblockGrid(LDRblock& block,unsigned int columns=1,QWidget *parent=0,const char* omittext="");
37 
38  signals:
39  // public:
40  void valueChanged();
41 
42  // private:
43  void updateSubWidget();
44  void deleteSubDialogs();
45 
46  public slots:
47  void updateWidget();
48  void deleteDialogs();
49  void swapSliderTracking() {}
50  void emitValueChanged() {emit valueChanged();}
51 
52 
53  private:
54  friend class LDRblockScrollView;
55 
56  void createDialog();
57 
58  GuiGridLayout* grid;
59 
60  LDRblock& val;
61  STD_list<LDRwidgetDialog*> subdialogs;
62 
63 };
64 
66 
67 class LDRblockScrollView : public QObject {
68  Q_OBJECT
69 
70  public:
71  LDRblockScrollView(LDRblock& block, unsigned int columns=1, QWidget *parent=0, const char* omittext="");
72  ~LDRblockScrollView();
73 
74 // QSize gridsize() const {return ldrgrid->frameSize();}
75 
76  QWidget* get_widget() {return scroll->get_widget();}
77 
78  signals:
79  void valueChanged();
80 
81  public slots:
82  void updateWidget() {ldrgrid->updateWidget();}
83  void deleteDialogs() {ldrgrid->deleteDialogs();}
84  void swapSliderTracking() {ldrgrid->swapSliderTracking();}
85  void emitValueChanged() {emit valueChanged();}
86 
87  private:
88  friend class LDRblockWidget;
89 
90  void createDialog() {ldrgrid->createDialog();}
91 
92  GuiScroll* scroll;
93  LDRblockGrid* ldrgrid;
94 
95 };
96 
98 
99 class LDRblockWidget : public QGroupBox {
100 
101  Q_OBJECT
102 
103  public:
104  LDRblockWidget(LDRblock& ldrblock,unsigned int columns=1,QWidget *parent=0,bool doneButton=false,bool is_dialog=false,const char* omittext="", bool storeLoadButtons=false, bool readonly=false);
105  ~LDRblockWidget();
106 
107 // QSize gridsize() const {if(ldrscroll) return ldrscroll->gridsize(); else return QSize();}
108 
109  signals:
110  void valueChanged();
111  void doneButtonPressed();
112 
113 
114  public slots:
115  void updateWidget() {if(ldrscroll) ldrscroll->updateWidget();}
116  void deleteDialogs() {if(ldrscroll) ldrscroll->deleteDialogs();}
117  void swapSliderTracking() {if(ldrscroll) ldrscroll->swapSliderTracking();}
118  void createDialog();
119  void emitValueChanged() {emit valueChanged();}
120 
121  private slots:
122  void emitDone();
123  void storeBlock();
124  void loadBlock();
125 
126  private:
127 
128  GuiGridLayout *grid;
129  GuiButton *pb_done;
130  GuiButton *pb_edit;
131  GuiButton *pb_store;
132  GuiButton *pb_load;
133 
134  LDRblock& parblock;
135 
136  LDRblockScrollView* ldrscroll;
137 
138  GuiListView* noeditlist;
139  STD_vector<GuiListItem*> noedititems;
140 };
141 
143 
144 
145 
146 
147 
148 class LDRwidgetDialog : public QObject, public GuiDialog {
149  Q_OBJECT
150 public:
151  LDRwidgetDialog(LDRblock& ldr,unsigned int columns=1,QWidget *parent=0, bool modal=false, bool readonly=false);
152  ~LDRwidgetDialog();
153 
154  public slots:
155  void updateWidget();
156  void emitChanged();
157 
158  private:
159  GuiGridLayout *grid;
160  LDRblockWidget *ldrwidget;
161 
162 
163 private slots:
164  void callDone();
165 
166 signals:
167  void finished();
168  void valueChanged();
169 
170 
171 };
172 
173 
174 #endif