diff --git a/docs/html/_intelli_color_picker_8cpp_source.html b/docs/html/_intelli_color_picker_8cpp_source.html index f7131a1..02695a7 100644 --- a/docs/html/_intelli_color_picker_8cpp_source.html +++ b/docs/html/_intelli_color_picker_8cpp_source.html @@ -100,11 +100,11 @@ $(document).ready(function(){initNavTree('_intelli_color_picker_8cpp_source.html
12  std::swap(firstColor, secondColor);
13 }
14 
-
15 QColor IntelliColorPicker::getFirstColor(){
+
15 QColor IntelliColorPicker::getFirstColor() const {
16  return this->firstColor;
17 }
18 
-
19 QColor IntelliColorPicker::getSecondColor(){
+
19 QColor IntelliColorPicker::getSecondColor() const {
20  return this->secondColor;
21 }
22 
@@ -122,12 +122,12 @@ $(document).ready(function(){initNavTree('_intelli_color_picker_8cpp_source.html
34 }
+
IntelliColorPicker::getFirstColor
QColor getFirstColor() const
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:15
IntelliColorPicker::~IntelliColorPicker
virtual ~IntelliColorPicker()
IntelliColorPicker destructor clears up his used memory, if there is some.
Definition: IntelliColorPicker.cpp:7
IntelliColorPicker::setSecondColor
void setSecondColor(QColor Color)
A function to set the secondary color.
Definition: IntelliColorPicker.cpp:27
-
IntelliColorPicker::getSecondColor
QColor getSecondColor()
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:19
+
IntelliColorPicker::getSecondColor
QColor getSecondColor() const
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:19
IntelliColorPicker.h
IntelliColorPicker::setFirstColor
void setFirstColor(QColor Color)
A function to set the primary color.
Definition: IntelliColorPicker.cpp:23
-
IntelliColorPicker::getFirstColor
QColor getFirstColor()
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:15
IntelliColorPicker::swapColors
void swapColors()
A function switching primary and secondary color.
Definition: IntelliColorPicker.cpp:11
IntelliColorPicker::IntelliColorPicker
IntelliColorPicker()
IntelliColorPicker constructor, setting 2 preset colors, be careful, theese color may change in produ...
Definition: IntelliColorPicker.cpp:3
diff --git a/docs/html/_intelli_color_picker_8h_source.html b/docs/html/_intelli_color_picker_8h_source.html index ea836cf..b9fbf6a 100644 --- a/docs/html/_intelli_color_picker_8h_source.html +++ b/docs/html/_intelli_color_picker_8h_source.html @@ -124,11 +124,11 @@ $(document).ready(function(){initNavTree('_intelli_color_picker_8h_source.html',
73 #endif
+
IntelliColorPicker::getFirstColor
QColor getFirstColor() const
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:15
IntelliColorPicker::~IntelliColorPicker
virtual ~IntelliColorPicker()
IntelliColorPicker destructor clears up his used memory, if there is some.
Definition: IntelliColorPicker.cpp:7
IntelliColorPicker::setSecondColor
void setSecondColor(QColor Color)
A function to set the secondary color.
Definition: IntelliColorPicker.cpp:27
-
IntelliColorPicker::getSecondColor
QColor getSecondColor()
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:19
+
IntelliColorPicker::getSecondColor
QColor getSecondColor() const
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:19
IntelliColorPicker::setFirstColor
void setFirstColor(QColor Color)
A function to set the primary color.
Definition: IntelliColorPicker.cpp:23
-
IntelliColorPicker::getFirstColor
QColor getFirstColor()
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:15
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:14
UnitTest
Definition: mainUnitTest.cpp:8
IntelliColorPicker::swapColors
void swapColors()
A function switching primary and secondary color.
Definition: IntelliColorPicker.cpp:11
diff --git a/docs/html/_intelli_photo_gui_8cpp.html b/docs/html/_intelli_photo_gui_8cpp.html index ace1645..db1e96f 100644 --- a/docs/html/_intelli_photo_gui_8cpp.html +++ b/docs/html/_intelli_photo_gui_8cpp.html @@ -88,6 +88,8 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp.html',''); ini
#include "IntelliPhotoGui.h"
#include "Layer/PaintingArea.h"
+#include "QEvent"
+#include "QCloseEvent"

Go to the source code of this file.

diff --git a/docs/html/_intelli_photo_gui_8cpp_source.html b/docs/html/_intelli_photo_gui_8cpp_source.html index 9658796..94da67a 100644 --- a/docs/html/_intelli_photo_gui_8cpp_source.html +++ b/docs/html/_intelli_photo_gui_8cpp_source.html @@ -91,866 +91,869 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp_source.html','
3 #include "IntelliPhotoGui.h"
4 #include "Layer/PaintingArea.h"
5 
-
6 // IntelliPhotoGui constructor
-
7 IntelliPhotoGui::IntelliPhotoGui(){
-
8  // create Gui elements and lay them out
-
9  createGui();
-
10  // Create actions
-
11  createActions();
-
12  // create Menus
-
13  createMenus();
-
14  // set style of the gui
-
15  setIntelliStyle();
-
16  // Size the app
-
17  resize(600,600);
-
18  showMaximized();
-
19  setDefaultToolValue();
-
20 }
-
21 
-
22 // User tried to close the app
-
23 void IntelliPhotoGui::closeEvent(QCloseEvent*event){
-
24  // If they try to close maybeSave() returns true
-
25  // if no changes have been made and the app closes
-
26  if (maybeSave()) {
-
27  event->accept();
-
28  } else {
-
29  // If there have been changes ignore the event
-
30  event->ignore();
-
31  }
-
32 }
-
33 
-
34 // Check if the current image has been changed and then
-
35 // open a dialog to open a file
-
36 void IntelliPhotoGui::slotOpen(){
-
37  // Check if changes have been made since last save
-
38  // maybeSave() returns true if no changes have been made
-
39  if (maybeSave()) {
-
40 
-
41  // Get the file to open from a dialog
-
42  // tr sets the window title to Open File
-
43  // QDir opens the current dirctory
-
44  QString fileName = QFileDialog::getOpenFileName(this,
-
45  tr("Open File"), QDir::currentPath(), nullptr, nullptr, QFileDialog::DontUseNativeDialog);
-
46 
-
47  // If we have a file name load the image and place
-
48  // it in the paintingArea
-
49  if (!fileName.isEmpty()) {
-
50  paintingArea->open(fileName);
-
51  UpdateGui();
-
52  }
-
53  }
-
54 }
-
55 
-
56 // Called when the user clicks Save As in the menu
-
57 void IntelliPhotoGui::slotSave(){
-
58  // A QAction represents the action of the user clicking
-
59  QAction*action = qobject_cast<QAction*>(sender());
-
60 
-
61  // Stores the array of bytes of the users data
-
62  QByteArray fileFormat = action->data().toByteArray();
+
6 #include "QEvent"
+
7 #include "QCloseEvent"
+
8 
+
9 // IntelliPhotoGui constructor
+
10 IntelliPhotoGui::IntelliPhotoGui(){
+
11  // create Gui elements and lay them out
+
12  createGui();
+
13  // Create actions
+
14  createActions();
+
15  // create Menus
+
16  createMenus();
+
17  // set style of the gui
+
18  setIntelliStyle();
+
19  // Size the app
+
20  resize(600,600);
+
21  showMaximized();
+
22  setDefaultToolValue();
+
23 }
+
24 
+
25 // User tried to close the app
+
26 void IntelliPhotoGui::closeEvent(QCloseEvent*event){
+
27  // If they try to close maybeSave() returns true
+
28  // if no changes have been made and the app closes
+
29  if (maybeSave()) {
+
30  event->accept();
+
31  } else {
+
32  // If there have been changes ignore the event
+
33  event->ignore();
+
34  }
+
35 }
+
36 
+
37 // Check if the current image has been changed and then
+
38 // open a dialog to open a file
+
39 void IntelliPhotoGui::slotOpen(){
+
40  // Check if changes have been made since last save
+
41  // maybeSave() returns true if no changes have been made
+
42  if (maybeSave()) {
+
43 
+
44  // Get the file to open from a dialog
+
45  // tr sets the window title to Open File
+
46  // QDir opens the current dirctory
+
47  QString fileName = QFileDialog::getOpenFileName(this,
+
48  tr("Open File"), QDir::currentPath(), nullptr, nullptr, QFileDialog::DontUseNativeDialog);
+
49 
+
50  // If we have a file name load the image and place
+
51  // it in the paintingArea
+
52  if (!fileName.isEmpty()) {
+
53  paintingArea->open(fileName);
+
54  UpdateGui();
+
55  }
+
56  }
+
57 }
+
58 
+
59 // Called when the user clicks Save As in the menu
+
60 void IntelliPhotoGui::slotSave(){
+
61  // A QAction represents the action of the user clicking
+
62  QAction*action = qobject_cast<QAction*>(sender());
63 
-
64  // Pass it to be saved
-
65  saveFile(fileFormat);
-
66 }
-
67 
-
68 // Opens a dialog that allows the user to create a New RASTER Layer
-
69 void IntelliPhotoGui::slotCreateNewRasterLayer(){
-
70  // Stores button value
-
71  bool ok1, ok2;
-
72 
-
73  // "New Layer" is the title of the window
-
74  // the next tr is the text to display
-
75  // Define the standard Value, min, max, step and ok button
-
76  int width = IntelliInputDialog::getInt("New Raster Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
-
77 
-
78  int height = IntelliInputDialog::getInt("New Raster Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
-
79 
-
80  // Create New Layer
-
81  if (ok1&&ok2) {
-
82  paintingArea->addLayer(width,height,0,0,IntelliImage::ImageType::RASTERIMAGE);
-
83  UpdateGui();
-
84  }
-
85 }
-
86 
-
87 // Opens a dialog that allows the user to create a New SHAPED Layer
-
88 void IntelliPhotoGui::slotCreateNewShapedLayer(){
-
89  // Stores button value
-
90  bool ok1, ok2;
-
91 
-
92  // "New Layer" is the title of the window
-
93  // the next tr is the text to display
-
94  // Define the standard Value, min, max, step and ok button
-
95  int width = IntelliInputDialog::getInt("New Shaped Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
-
96 
-
97  int height = IntelliInputDialog::getInt("New Shaped Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
-
98 
-
99  // Create New Layer
-
100  if (ok1&&ok2) {
-
101  paintingArea->addLayer(width, height, 0, 0, IntelliImage::ImageType::SHAPEDIMAGE);
-
102  UpdateGui();
-
103  }
-
104 }
-
105 
-
106 // Opens a dialog that allows the user to change Dimension
-
107 void IntelliPhotoGui::slotChangeDim(){
-
108  // Stores button value
-
109  bool ok1, ok2;
-
110 
-
111  // "change Dimension" is the title of the window
-
112  // the next tr is the text to display
-
113  // Define the standard Value, min, step and ok button
-
114  int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000, 1, &ok1);
-
115 
-
116  int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
-
117 
-
118  // Change dimension
-
119  if (ok1&&ok2) {
-
120  paintingArea->setLayerDimensions(width,height);
-
121  UpdateGui();
-
122  }
-
123 }
-
124 
-
125 // Opens a dialog that allows the user to delete a Layer
-
126 void IntelliPhotoGui::slotDeleteLayer(){
+
64  // Stores the array of bytes of the users data
+
65  QByteArray fileFormat = action->data().toByteArray();
+
66 
+
67  // Pass it to be saved
+
68  saveFile(fileFormat);
+
69 }
+
70 
+
71 // Opens a dialog that allows the user to create a New RASTER Layer
+
72 void IntelliPhotoGui::slotCreateNewRasterLayer(){
+
73  // Stores button value
+
74  bool ok1, ok2;
+
75 
+
76  // "New Layer" is the title of the window
+
77  // the next tr is the text to display
+
78  // Define the standard Value, min, max, step and ok button
+
79  int width = IntelliInputDialog::getInt("New Raster Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
+
80 
+
81  int height = IntelliInputDialog::getInt("New Raster Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
+
82 
+
83  // Create New Layer
+
84  if (ok1&&ok2) {
+
85  paintingArea->addLayer(width,height,0,0,IntelliImage::ImageType::RASTERIMAGE);
+
86  UpdateGui();
+
87  }
+
88 }
+
89 
+
90 // Opens a dialog that allows the user to create a New SHAPED Layer
+
91 void IntelliPhotoGui::slotCreateNewShapedLayer(){
+
92  // Stores button value
+
93  bool ok1, ok2;
+
94 
+
95  // "New Layer" is the title of the window
+
96  // the next tr is the text to display
+
97  // Define the standard Value, min, max, step and ok button
+
98  int width = IntelliInputDialog::getInt("New Shaped Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
+
99 
+
100  int height = IntelliInputDialog::getInt("New Shaped Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
+
101 
+
102  // Create New Layer
+
103  if (ok1&&ok2) {
+
104  paintingArea->addLayer(width, height, 0, 0, IntelliImage::ImageType::SHAPEDIMAGE);
+
105  UpdateGui();
+
106  }
+
107 }
+
108 
+
109 // Opens a dialog that allows the user to change Dimension
+
110 void IntelliPhotoGui::slotChangeDim(){
+
111  // Stores button value
+
112  bool ok1, ok2;
+
113 
+
114  // "change Dimension" is the title of the window
+
115  // the next tr is the text to display
+
116  // Define the standard Value, min, step and ok button
+
117  int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000, 1, &ok1);
+
118 
+
119  int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
+
120 
+
121  // Change dimension
+
122  if (ok1&&ok2) {
+
123  paintingArea->setLayerDimensions(width,height);
+
124  UpdateGui();
+
125  }
+
126 }
127 
-
128  bool ok1;
-
129  // "delete Layer" is the title of the window
-
130  // the next tr is the text to display
-
131  // Define the standard Value, min, max, step and ok button
-
132  int layerNumber = IntelliInputDialog::getInt("Delete Layer", "Number:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
-
133 
-
134  // Create New Layer
-
135  if(ok1) {
-
136  paintingArea->deleteLayer(layerNumber - 1);
-
137  UpdateGui();
-
138  }
-
139 }
-
140 
-
141 void IntelliPhotoGui::slotSetActiveAlpha(){
-
142 
-
143  bool ok1, ok2;
-
144  // "Layer to set on" is the title of the window
-
145  // the next tr is the text to display
-
146  // Define the standard Value, min, max, step and ok button
-
147 
-
148  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
-
149 
-
150  // "New Alpha" is the title of the window
-
151  int alpha = IntelliInputDialog::getInt("Layer to set on", "Alpha:", 255, 0, 255, 1, &ok2);
+
128 // Opens a dialog that allows the user to delete a Layer
+
129 void IntelliPhotoGui::slotDeleteLayer(){
+
130 
+
131  bool ok1;
+
132  // "delete Layer" is the title of the window
+
133  // the next tr is the text to display
+
134  // Define the standard Value, min, max, step and ok button
+
135  int layerNumber = IntelliInputDialog::getInt("Delete Layer", "Number:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
+
136 
+
137  // Create New Layer
+
138  if(ok1) {
+
139  paintingArea->deleteLayer(layerNumber - 1);
+
140  UpdateGui();
+
141  }
+
142 }
+
143 
+
144 void IntelliPhotoGui::slotSetActiveAlpha(){
+
145 
+
146  bool ok1, ok2;
+
147  // "Layer to set on" is the title of the window
+
148  // the next tr is the text to display
+
149  // Define the standard Value, min, max, step and ok button
+
150 
+
151  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
152 
-
153  if (ok1&&ok2)
-
154  {
-
155  paintingArea->setLayerAlpha(layer - 1,alpha);
-
156  UpdateGui();
-
157  }
-
158 }
-
159 
-
160 void IntelliPhotoGui::slotSetPolygon(){
-
161  // Stores button value
-
162  bool ok1;
-
163 
-
164  // "Layer to set on" is the title of the window
-
165  // the next tr is the text to display
-
166  // Define the standard Value, min, max, step and ok button
-
167  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
-
168 
-
169  if (ok1)
-
170  {
-
171  paintingArea->setPolygon(layer - 1);
-
172  UpdateGui();
-
173  }
-
174 }
-
175 
-
176 void IntelliPhotoGui::slotPositionMoveUp(){
-
177  paintingArea->movePositionActive(0,-20);
-
178  update();
-
179 }
-
180 
-
181 void IntelliPhotoGui::slotPositionMoveDown(){
-
182  paintingArea->movePositionActive(0,20);
-
183  update();
-
184 }
-
185 
-
186 void IntelliPhotoGui::slotPositionMoveLeft(){
-
187  paintingArea->movePositionActive(-20,0);
-
188  update();
-
189 }
-
190 
-
191 void IntelliPhotoGui::slotPositionMoveRight(){
-
192  paintingArea->movePositionActive(20,0);
-
193  update();
-
194 }
-
195 
-
196 void IntelliPhotoGui::slotMoveLayerUp(){
-
197  paintingArea->moveActiveLayer(1);
-
198  update();
-
199 }
-
200 
-
201 void IntelliPhotoGui::slotMoveLayerDown(){
-
202  paintingArea->moveActiveLayer(-1);
-
203  update();
-
204 }
-
205 
-
206 void IntelliPhotoGui::slotSetActiveLayer(){
-
207  bool ok1;
-
208  // "Layer to set on" is the title of the window
-
209  // the next tr is the text to display
-
210  // Define the standard Value, min, max, step and ok button
-
211  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
-
212 
-
213  if(ok1) {
-
214  paintingArea->setLayerActive(layer - 1);
-
215  UpdateGui();
-
216  }
-
217 }
-
218 
-
219 void IntelliPhotoGui::slotUpdateRenderSettingsOn(){
-
220  paintingArea->setRenderSettings(true);
-
221  UpdateGui();
-
222 }
-
223 
-
224 void IntelliPhotoGui::slotUpdateRenderSettingsOff(){
-
225  paintingArea->setRenderSettings(false);
-
226  UpdateGui();
-
227 }
-
228 
-
229 void IntelliPhotoGui::slotSetFirstColor(){
-
230  paintingArea->colorPickerSetFirstColor();
-
231  UpdateGui();
-
232 }
-
233 
-
234 void IntelliPhotoGui::slotSetSecondColor(){
-
235  paintingArea->colorPickerSetSecondColor();
-
236  UpdateGui();
-
237 }
-
238 
-
239 void IntelliPhotoGui::slotSwapColor(){
-
240  paintingArea->colorPickerSwapColors();
-
241  UpdateGui();
-
242 }
-
243 
-
244 void IntelliPhotoGui::slotCreatePenTool(){
-
245  PenButton->setChecked(true);
-
246  paintingArea->createPenTool();
-
247 }
-
248 
-
249 void IntelliPhotoGui::slotCreatePlainTool(){
-
250  PlainButton->setChecked(true);
-
251  paintingArea->createPlainTool();
-
252 }
-
253 
-
254 void IntelliPhotoGui::slotCreateLineTool(){
-
255  LineButton->setChecked(true);
-
256  paintingArea->createLineTool();
-
257 }
-
258 
-
259 void IntelliPhotoGui::slotCreateRectangleTool(){
-
260  RectangleButton->setChecked(true);
-
261  paintingArea->createRectangleTool();
-
262 }
-
263 
-
264 void IntelliPhotoGui::slotCreateCircleTool(){
-
265  CircleButton->setChecked(true);
-
266  paintingArea->createCircleTool();
-
267 }
-
268 
-
269 void IntelliPhotoGui::slotCreatePolygonTool(){
-
270  PolygonButton->setChecked(true);
-
271  paintingArea->createPolygonTool();
-
272 }
-
273 
-
274 void IntelliPhotoGui::slotCreateFloodFillTool(){
-
275  FloodFillButton->setChecked(true);
-
276  paintingArea->createFloodFillTool();
-
277 }
-
278 
-
279 // Open an about dialog
-
280 void IntelliPhotoGui::slotAboutDialog(){
-
281  // Window title and text to display
-
282  QMessageBox::about(this, tr("About Painting"),
-
283  tr("<p><b>IntelliPhoto - </b>A Pretty basic editor.</p> <br>Developed by Team 7."));
-
284 }
-
285 
-
286 void IntelliPhotoGui::slotEnterPressed(){
-
287  QString string = EditLineWidth->text();
-
288  if(string.toInt() > 50) {
-
289  EditLineWidth->setText("50");
-
290  }
-
291  paintingArea->Toolsettings.setLineWidth(string.toInt());
-
292  string = EditLineInnerAlpha->text();
-
293  if(string.toInt() > 255) {
-
294  EditLineInnerAlpha->setText("255");
-
295  }
-
296  paintingArea->Toolsettings.setInnerAlpha(string.toInt());
-
297 }
-
298 
-
299 void IntelliPhotoGui::slotResetTools(){
-
300  CircleButton->setChecked(false);
-
301  FloodFillButton->setChecked(false);
-
302  LineButton->setChecked(false);
-
303  PenButton->setChecked(false);
-
304  PlainButton->setChecked(false);
-
305  PolygonButton->setChecked(false);
-
306  RectangleButton->setChecked(false);
-
307 }
-
308 
-
309 void IntelliPhotoGui::slotSetWidth(){
-
310  bool ok1;
-
311  int temp = IntelliInputDialog::getInt("Toolsettings", "Width:", 5, 1, 50, 1, &ok1);
-
312  if(ok1) {
-
313  paintingArea->Toolsettings.setLineWidth(temp);
-
314  EditLineWidth->setText(QString("%1").arg(temp));
-
315  }
-
316 }
-
317 
-
318 void IntelliPhotoGui::slotSetInnerAlpha(){
-
319  bool ok1;
-
320  int temp = IntelliInputDialog::getInt("Toolsettings", "Alpha:", 5, 1, 50, 1, &ok1);
-
321  if(ok1) {
-
322  paintingArea->Toolsettings.setInnerAlpha(temp);
-
323  EditLineInnerAlpha->setText(QString("%1").arg(temp));
-
324  }
-
325 }
-
326 
-
327 // Define menu actions that call functions
-
328 void IntelliPhotoGui::createActions(){
-
329  // Get a list of the supported file formats
-
330  // QImageWriter is used to write images to files
-
331  foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
-
332  QString text = tr("%1...").arg(QString(format).toUpper());
-
333 
-
334  // Create an action for each file format
-
335  QAction*action = new QAction(text, this);
+
153  // "New Alpha" is the title of the window
+
154  int alpha = IntelliInputDialog::getInt("Layer to set on", "Alpha:", 255, 0, 255, 1, &ok2);
+
155 
+
156  if (ok1&&ok2)
+
157  {
+
158  paintingArea->setLayerAlpha(layer - 1,alpha);
+
159  UpdateGui();
+
160  }
+
161 }
+
162 
+
163 void IntelliPhotoGui::slotSetPolygon(){
+
164  // Stores button value
+
165  bool ok1;
+
166 
+
167  // "Layer to set on" is the title of the window
+
168  // the next tr is the text to display
+
169  // Define the standard Value, min, max, step and ok button
+
170  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
+
171 
+
172  if (ok1)
+
173  {
+
174  paintingArea->setPolygon(layer - 1);
+
175  UpdateGui();
+
176  }
+
177 }
+
178 
+
179 void IntelliPhotoGui::slotPositionMoveUp(){
+
180  paintingArea->movePositionActive(0,-20);
+
181  update();
+
182 }
+
183 
+
184 void IntelliPhotoGui::slotPositionMoveDown(){
+
185  paintingArea->movePositionActive(0,20);
+
186  update();
+
187 }
+
188 
+
189 void IntelliPhotoGui::slotPositionMoveLeft(){
+
190  paintingArea->movePositionActive(-20,0);
+
191  update();
+
192 }
+
193 
+
194 void IntelliPhotoGui::slotPositionMoveRight(){
+
195  paintingArea->movePositionActive(20,0);
+
196  update();
+
197 }
+
198 
+
199 void IntelliPhotoGui::slotMoveLayerUp(){
+
200  paintingArea->moveActiveLayer(1);
+
201  update();
+
202 }
+
203 
+
204 void IntelliPhotoGui::slotMoveLayerDown(){
+
205  paintingArea->moveActiveLayer(-1);
+
206  update();
+
207 }
+
208 
+
209 void IntelliPhotoGui::slotSetActiveLayer(){
+
210  bool ok1;
+
211  // "Layer to set on" is the title of the window
+
212  // the next tr is the text to display
+
213  // Define the standard Value, min, max, step and ok button
+
214  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
+
215 
+
216  if(ok1) {
+
217  paintingArea->setLayerActive(layer - 1);
+
218  UpdateGui();
+
219  }
+
220 }
+
221 
+
222 void IntelliPhotoGui::slotUpdateRenderSettingsOn(){
+
223  paintingArea->setRenderSettings(true);
+
224  UpdateGui();
+
225 }
+
226 
+
227 void IntelliPhotoGui::slotUpdateRenderSettingsOff(){
+
228  paintingArea->setRenderSettings(false);
+
229  UpdateGui();
+
230 }
+
231 
+
232 void IntelliPhotoGui::slotSetFirstColor(){
+
233  paintingArea->colorPickerSetFirstColor();
+
234  UpdateGui();
+
235 }
+
236 
+
237 void IntelliPhotoGui::slotSetSecondColor(){
+
238  paintingArea->colorPickerSetSecondColor();
+
239  UpdateGui();
+
240 }
+
241 
+
242 void IntelliPhotoGui::slotSwapColor(){
+
243  paintingArea->colorPickerSwapColors();
+
244  UpdateGui();
+
245 }
+
246 
+
247 void IntelliPhotoGui::slotCreatePenTool(){
+
248  PenButton->setChecked(true);
+
249  paintingArea->createPenTool();
+
250 }
+
251 
+
252 void IntelliPhotoGui::slotCreatePlainTool(){
+
253  PlainButton->setChecked(true);
+
254  paintingArea->createPlainTool();
+
255 }
+
256 
+
257 void IntelliPhotoGui::slotCreateLineTool(){
+
258  LineButton->setChecked(true);
+
259  paintingArea->createLineTool();
+
260 }
+
261 
+
262 void IntelliPhotoGui::slotCreateRectangleTool(){
+
263  RectangleButton->setChecked(true);
+
264  paintingArea->createRectangleTool();
+
265 }
+
266 
+
267 void IntelliPhotoGui::slotCreateCircleTool(){
+
268  CircleButton->setChecked(true);
+
269  paintingArea->createCircleTool();
+
270 }
+
271 
+
272 void IntelliPhotoGui::slotCreatePolygonTool(){
+
273  PolygonButton->setChecked(true);
+
274  paintingArea->createPolygonTool();
+
275 }
+
276 
+
277 void IntelliPhotoGui::slotCreateFloodFillTool(){
+
278  FloodFillButton->setChecked(true);
+
279  paintingArea->createFloodFillTool();
+
280 }
+
281 
+
282 // Open an about dialog
+
283 void IntelliPhotoGui::slotAboutDialog(){
+
284  // Window title and text to display
+
285  QMessageBox::about(this, tr("About Painting"),
+
286  tr("<p><b>IntelliPhoto - </b>A Pretty basic editor.</p> <br>Developed by Team 7."));
+
287 }
+
288 
+
289 void IntelliPhotoGui::slotEnterPressed(){
+
290  QString string = EditLineWidth->text();
+
291  if(string.toInt() > 50) {
+
292  EditLineWidth->setText("50");
+
293  }
+
294  paintingArea->Toolsettings.setLineWidth(string.toInt());
+
295  string = EditLineInnerAlpha->text();
+
296  if(string.toInt() > 255) {
+
297  EditLineInnerAlpha->setText("255");
+
298  }
+
299  paintingArea->Toolsettings.setInnerAlpha(string.toInt());
+
300 }
+
301 
+
302 void IntelliPhotoGui::slotResetTools(){
+
303  CircleButton->setChecked(false);
+
304  FloodFillButton->setChecked(false);
+
305  LineButton->setChecked(false);
+
306  PenButton->setChecked(false);
+
307  PlainButton->setChecked(false);
+
308  PolygonButton->setChecked(false);
+
309  RectangleButton->setChecked(false);
+
310 }
+
311 
+
312 void IntelliPhotoGui::slotSetWidth(){
+
313  bool ok1;
+
314  int temp = IntelliInputDialog::getInt("Toolsettings", "Width:", 5, 1, 50, 1, &ok1);
+
315  if(ok1) {
+
316  paintingArea->Toolsettings.setLineWidth(temp);
+
317  EditLineWidth->setText(QString("%1").arg(temp));
+
318  }
+
319 }
+
320 
+
321 void IntelliPhotoGui::slotSetInnerAlpha(){
+
322  bool ok1;
+
323  int temp = IntelliInputDialog::getInt("Toolsettings", "Alpha:", 5, 1, 50, 1, &ok1);
+
324  if(ok1) {
+
325  paintingArea->Toolsettings.setInnerAlpha(temp);
+
326  EditLineInnerAlpha->setText(QString("%1").arg(temp));
+
327  }
+
328 }
+
329 
+
330 // Define menu actions that call functions
+
331 void IntelliPhotoGui::createActions(){
+
332  // Get a list of the supported file formats
+
333  // QImageWriter is used to write images to files
+
334  foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
+
335  QString text = tr("%1...").arg(QString(format).toUpper());
336 
-
337  // Set an action for each file format
-
338  action->setData(format);
+
337  // Create an action for each file format
+
338  QAction*action = new QAction(text, this);
339 
-
340  // When clicked call IntelliPhotoGui::save()
-
341  connect(action, SIGNAL(triggered()), this, SLOT(slotSave()));
+
340  // Set an action for each file format
+
341  action->setData(format);
342 
-
343  // Attach each file format option menu item to Save As
-
344  actionSaveAs.append(action);
-
345  }
-
346 
-
347  //set exporter to actions
-
348  QAction*pngSaveAction = new QAction("PNG-8", this);
-
349  pngSaveAction->setData("PNG");
-
350  // When clicked call IntelliPhotoGui::save()
-
351  connect(pngSaveAction, SIGNAL(triggered()), this, SLOT(slotSave()));
-
352  // Attach each PNG in save Menu
-
353  actionSaveAs.append(pngSaveAction);
-
354  pngSaveAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_S));
-
355 
-
356  // Create exit action and tie to IntelliPhotoGui::close()
-
357  actionExit = new QAction(tr("&Exit"), this);
-
358  actionExit->setShortcuts(QKeySequence::Quit);
-
359  connect(actionExit, SIGNAL(triggered()), this, SLOT(close()));
-
360 
-
361  actionOpen = new QAction(tr("&Open"), this);
-
362  actionOpen->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
-
363  connect(actionOpen, SIGNAL(triggered()), this, SLOT(slotOpen()));
-
364 
-
365  // Create New RASTER Layer action and tie to IntelliPhotoGui::newLayer()
-
366  actionCreateNewRasterLayer = new QAction(tr("&Raster Image"), this);
-
367  actionCreateNewRasterLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
-
368  connect(actionCreateNewRasterLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewRasterLayer()));
-
369 
-
370 
-
371  // Create New SHAPED Layer action and tie to IntelliPhotoGui::newLayer()
-
372  actionCreateNewShapedLayer = new QAction(tr("&Shaped Image"), this);
-
373  actionCreateNewShapedLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N + Qt::ALT));
-
374  connect(actionCreateNewShapedLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewShapedLayer()));
-
375 
-
376  // Delete New Layer action and tie to IntelliPhotoGui::deleteLayer()
-
377  actionDeleteLayer = new QAction(tr("&Delete Layer..."), this);
-
378  actionDeleteLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D));
-
379  connect(actionDeleteLayer, SIGNAL(triggered()), this, SLOT(slotDeleteLayer()));
-
380 
-
381  actionChangeDim = new QAction(tr("&Change Dimension"), this);
-
382  actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X));
-
383  connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim()));
-
384  connect(dimCanvas, SIGNAL(clicked()), this, SLOT(slotChangeDim()));
-
385 
-
386  actionSetActiveLayer = new QAction(tr("&set Active"), this);
-
387  actionSetActiveLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
-
388  connect(actionSetActiveLayer, SIGNAL(triggered()), this, SLOT(slotSetActiveLayer()));
-
389 
-
390  actionSetActiveAlpha = new QAction(tr("&set Alpha"), this);
-
391  actionSetActiveAlpha->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_A));
-
392  connect(actionSetActiveAlpha, SIGNAL(triggered()), this, SLOT(slotSetActiveAlpha()));
-
393 
-
394  actionSetPolygon = new QAction(tr("&set new Polygondata"), this);
-
395  actionSetPolygon->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_P));
-
396  connect(actionSetPolygon, SIGNAL(triggered()), this, SLOT(slotSetPolygon()));
-
397 
-
398  actionMovePositionUp = new QAction(tr("&move Up"), this);
-
399  actionMovePositionUp->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Up));
-
400  connect(actionMovePositionUp, SIGNAL(triggered()), this, SLOT(slotPositionMoveUp()));
-
401 
-
402  actionMovePositionDown = new QAction(tr("&move Down"), this);
-
403  actionMovePositionDown->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Down));
-
404  connect(actionMovePositionDown, SIGNAL(triggered()), this, SLOT(slotPositionMoveDown()));
-
405 
-
406  actionMovePositionLeft = new QAction(tr("&move Left"), this);
-
407  actionMovePositionLeft->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Left));
-
408  connect(actionMovePositionLeft, SIGNAL(triggered()), this, SLOT(slotPositionMoveLeft()));
-
409 
-
410  actionMovePositionRight = new QAction(tr("&move Right"), this);
-
411  actionMovePositionRight->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Right));
-
412  connect(actionMovePositionRight, SIGNAL(triggered()), this, SLOT(slotPositionMoveRight()));
-
413 
-
414  actionMoveLayerUp = new QAction(tr("&move Layer Up"), this);
-
415  actionMoveLayerUp->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Up));
-
416  connect(actionMoveLayerUp, SIGNAL(triggered()), this, SLOT(slotMoveLayerUp()));
-
417 
-
418  actionMoveLayerDown = new QAction(tr("&move Layer Down"), this);
-
419  actionMoveLayerDown->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Down));
-
420  connect(actionMoveLayerDown, SIGNAL(triggered()), this, SLOT(slotMoveLayerDown()));
-
421 
-
422  //Create Update RenderSettings Actions here
-
423  actionUpdateRenderSettingsOn = new QAction(tr("&On"), this);
-
424  actionUpdateRenderSettingsOn->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_A));
-
425  connect(actionUpdateRenderSettingsOn, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOn()));
-
426 
-
427  actionUpdateRenderSettingsOff = new QAction(tr("&Off"), this);
-
428  actionUpdateRenderSettingsOff->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_D));
-
429  connect(actionUpdateRenderSettingsOff, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOff()));
-
430 
-
431  //Create Color Actions here
-
432  actionColorPickerFirstColor = new QAction(tr("&Main"), this);
-
433  actionColorPickerFirstColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_N));
-
434  connect(actionColorPickerFirstColor, SIGNAL(triggered()), this, SLOT(slotSetFirstColor()));
-
435  connect(FirstColorButton, SIGNAL(clicked()), this, SLOT(slotSetFirstColor()));
-
436 
-
437  actionColorPickerSecondColor = new QAction(tr("&Secondary"), this);
-
438  actionColorPickerSecondColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_M));
-
439  connect(actionColorPickerSecondColor, SIGNAL(triggered()), this, SLOT(slotSetSecondColor()));
-
440  connect(SecondColorButton, SIGNAL(clicked()), this, SLOT(slotSetSecondColor()));
-
441 
-
442  actionColorSwap = new QAction(tr("&Switch"), this);
-
443  actionColorSwap->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_S));
-
444  connect(actionColorSwap, SIGNAL(triggered()), this, SLOT(slotSwapColor()));
-
445  connect(SwitchColorButton, SIGNAL(clicked()), this, SLOT(slotSwapColor()));
-
446 
-
447  //Create Tool actions down here
-
448  actionCreatePlainTool = new QAction(tr("&Plain"), this);
-
449  actionCreatePlainTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_P));
-
450  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
-
451  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotCreatePlainTool()));
-
452 
-
453 
-
454  actionCreatePenTool = new QAction(tr("&Pen"),this);
-
455  actionCreatePenTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_S));
-
456  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
-
457  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotCreatePenTool()));
-
458 
-
459  actionCreateLineTool = new QAction(tr("&Line"), this);
-
460  actionCreateLineTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_L));
-
461  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
-
462  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotCreateLineTool()));
-
463 
-
464  actionCreateCircleTool = new QAction(tr("&Circle"), this);
-
465  actionCreateCircleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_C));
-
466  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
-
467  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotCreateCircleTool()));
-
468 
-
469  actionCreateRectangleTool = new QAction(tr("&Rectangle"), this);
-
470  actionCreateRectangleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_R));
-
471  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
-
472  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotCreateRectangleTool()));
-
473 
-
474  actionCreatePolygonTool = new QAction(tr("&Polygon"), this);
-
475  actionCreatePolygonTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_V));
-
476  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
-
477  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotCreatePolygonTool()));
-
478 
-
479  actionCreateFloodFillTool = new QAction(tr("&FloodFill"), this);
-
480  actionCreateFloodFillTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_F));
-
481  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
-
482  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotCreateFloodFillTool()));
-
483 
-
484  // Create about action and tie to IntelliPhotoGui::about()
-
485  actionAboutDialog = new QAction(tr("&About"), this);
-
486  actionAboutDialog->setShortcut(Qt::Key_F2);
-
487  connect(actionAboutDialog, SIGNAL(triggered()), this, SLOT(slotAboutDialog()));
-
488 
-
489  // Create about Qt action and tie to IntelliPhotoGui::aboutQt()
-
490  actionAboutQtDialog = new QAction(tr("About &Qt"), this);
-
491  actionAboutQtDialog->setShortcut(Qt::Key_F3);
-
492  connect(actionAboutQtDialog, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-
493 
-
494  connect(EditLineWidth, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
-
495  connect(EditLineInnerAlpha, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
+
343  // When clicked call IntelliPhotoGui::save()
+
344  connect(action, SIGNAL(triggered()), this, SLOT(slotSave()));
+
345 
+
346  // Attach each file format option menu item to Save As
+
347  actionSaveAs.append(action);
+
348  }
+
349 
+
350  //set exporter to actions
+
351  QAction*pngSaveAction = new QAction("PNG-8", this);
+
352  pngSaveAction->setData("PNG");
+
353  // When clicked call IntelliPhotoGui::save()
+
354  connect(pngSaveAction, SIGNAL(triggered()), this, SLOT(slotSave()));
+
355  // Attach each PNG in save Menu
+
356  actionSaveAs.append(pngSaveAction);
+
357  pngSaveAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_S));
+
358 
+
359  // Create exit action and tie to IntelliPhotoGui::close()
+
360  actionExit = new QAction(tr("&Exit"), this);
+
361  actionExit->setShortcuts(QKeySequence::Quit);
+
362  connect(actionExit, SIGNAL(triggered()), this, SLOT(close()));
+
363 
+
364  actionOpen = new QAction(tr("&Open"), this);
+
365  actionOpen->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
+
366  connect(actionOpen, SIGNAL(triggered()), this, SLOT(slotOpen()));
+
367 
+
368  // Create New RASTER Layer action and tie to IntelliPhotoGui::newLayer()
+
369  actionCreateNewRasterLayer = new QAction(tr("&Raster Image"), this);
+
370  actionCreateNewRasterLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
+
371  connect(actionCreateNewRasterLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewRasterLayer()));
+
372 
+
373 
+
374  // Create New SHAPED Layer action and tie to IntelliPhotoGui::newLayer()
+
375  actionCreateNewShapedLayer = new QAction(tr("&Shaped Image"), this);
+
376  actionCreateNewShapedLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N + Qt::ALT));
+
377  connect(actionCreateNewShapedLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewShapedLayer()));
+
378 
+
379  // Delete New Layer action and tie to IntelliPhotoGui::deleteLayer()
+
380  actionDeleteLayer = new QAction(tr("&Delete Layer..."), this);
+
381  actionDeleteLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D));
+
382  connect(actionDeleteLayer, SIGNAL(triggered()), this, SLOT(slotDeleteLayer()));
+
383 
+
384  actionChangeDim = new QAction(tr("&Change Dimension"), this);
+
385  actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X));
+
386  connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim()));
+
387  connect(dimCanvas, SIGNAL(clicked()), this, SLOT(slotChangeDim()));
+
388 
+
389  actionSetActiveLayer = new QAction(tr("&set Active"), this);
+
390  actionSetActiveLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
+
391  connect(actionSetActiveLayer, SIGNAL(triggered()), this, SLOT(slotSetActiveLayer()));
+
392 
+
393  actionSetActiveAlpha = new QAction(tr("&set Alpha"), this);
+
394  actionSetActiveAlpha->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_A));
+
395  connect(actionSetActiveAlpha, SIGNAL(triggered()), this, SLOT(slotSetActiveAlpha()));
+
396 
+
397  actionSetPolygon = new QAction(tr("&set new Polygondata"), this);
+
398  actionSetPolygon->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_P));
+
399  connect(actionSetPolygon, SIGNAL(triggered()), this, SLOT(slotSetPolygon()));
+
400 
+
401  actionMovePositionUp = new QAction(tr("&move Up"), this);
+
402  actionMovePositionUp->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Up));
+
403  connect(actionMovePositionUp, SIGNAL(triggered()), this, SLOT(slotPositionMoveUp()));
+
404 
+
405  actionMovePositionDown = new QAction(tr("&move Down"), this);
+
406  actionMovePositionDown->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Down));
+
407  connect(actionMovePositionDown, SIGNAL(triggered()), this, SLOT(slotPositionMoveDown()));
+
408 
+
409  actionMovePositionLeft = new QAction(tr("&move Left"), this);
+
410  actionMovePositionLeft->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Left));
+
411  connect(actionMovePositionLeft, SIGNAL(triggered()), this, SLOT(slotPositionMoveLeft()));
+
412 
+
413  actionMovePositionRight = new QAction(tr("&move Right"), this);
+
414  actionMovePositionRight->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Right));
+
415  connect(actionMovePositionRight, SIGNAL(triggered()), this, SLOT(slotPositionMoveRight()));
+
416 
+
417  actionMoveLayerUp = new QAction(tr("&move Layer Up"), this);
+
418  actionMoveLayerUp->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Up));
+
419  connect(actionMoveLayerUp, SIGNAL(triggered()), this, SLOT(slotMoveLayerUp()));
+
420 
+
421  actionMoveLayerDown = new QAction(tr("&move Layer Down"), this);
+
422  actionMoveLayerDown->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Down));
+
423  connect(actionMoveLayerDown, SIGNAL(triggered()), this, SLOT(slotMoveLayerDown()));
+
424 
+
425  //Create Update RenderSettings Actions here
+
426  actionUpdateRenderSettingsOn = new QAction(tr("&On"), this);
+
427  actionUpdateRenderSettingsOn->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_A));
+
428  connect(actionUpdateRenderSettingsOn, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOn()));
+
429 
+
430  actionUpdateRenderSettingsOff = new QAction(tr("&Off"), this);
+
431  actionUpdateRenderSettingsOff->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_D));
+
432  connect(actionUpdateRenderSettingsOff, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOff()));
+
433 
+
434  //Create Color Actions here
+
435  actionColorPickerFirstColor = new QAction(tr("&Main"), this);
+
436  actionColorPickerFirstColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_N));
+
437  connect(actionColorPickerFirstColor, SIGNAL(triggered()), this, SLOT(slotSetFirstColor()));
+
438  connect(FirstColorButton, SIGNAL(clicked()), this, SLOT(slotSetFirstColor()));
+
439 
+
440  actionColorPickerSecondColor = new QAction(tr("&Secondary"), this);
+
441  actionColorPickerSecondColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_M));
+
442  connect(actionColorPickerSecondColor, SIGNAL(triggered()), this, SLOT(slotSetSecondColor()));
+
443  connect(SecondColorButton, SIGNAL(clicked()), this, SLOT(slotSetSecondColor()));
+
444 
+
445  actionColorSwap = new QAction(tr("&Switch"), this);
+
446  actionColorSwap->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_S));
+
447  connect(actionColorSwap, SIGNAL(triggered()), this, SLOT(slotSwapColor()));
+
448  connect(SwitchColorButton, SIGNAL(clicked()), this, SLOT(slotSwapColor()));
+
449 
+
450  //Create Tool actions down here
+
451  actionCreatePlainTool = new QAction(tr("&Plain"), this);
+
452  actionCreatePlainTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_P));
+
453  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
+
454  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotCreatePlainTool()));
+
455 
+
456 
+
457  actionCreatePenTool = new QAction(tr("&Pen"),this);
+
458  actionCreatePenTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_S));
+
459  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
+
460  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotCreatePenTool()));
+
461 
+
462  actionCreateLineTool = new QAction(tr("&Line"), this);
+
463  actionCreateLineTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_L));
+
464  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
+
465  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotCreateLineTool()));
+
466 
+
467  actionCreateCircleTool = new QAction(tr("&Circle"), this);
+
468  actionCreateCircleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_C));
+
469  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
+
470  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotCreateCircleTool()));
+
471 
+
472  actionCreateRectangleTool = new QAction(tr("&Rectangle"), this);
+
473  actionCreateRectangleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_R));
+
474  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
+
475  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotCreateRectangleTool()));
+
476 
+
477  actionCreatePolygonTool = new QAction(tr("&Polygon"), this);
+
478  actionCreatePolygonTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_V));
+
479  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
+
480  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotCreatePolygonTool()));
+
481 
+
482  actionCreateFloodFillTool = new QAction(tr("&FloodFill"), this);
+
483  actionCreateFloodFillTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_F));
+
484  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
+
485  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotCreateFloodFillTool()));
+
486 
+
487  // Create about action and tie to IntelliPhotoGui::about()
+
488  actionAboutDialog = new QAction(tr("&About"), this);
+
489  actionAboutDialog->setShortcut(Qt::Key_F2);
+
490  connect(actionAboutDialog, SIGNAL(triggered()), this, SLOT(slotAboutDialog()));
+
491 
+
492  // Create about Qt action and tie to IntelliPhotoGui::aboutQt()
+
493  actionAboutQtDialog = new QAction(tr("About &Qt"), this);
+
494  actionAboutQtDialog->setShortcut(Qt::Key_F3);
+
495  connect(actionAboutQtDialog, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
496 
-
497  connect(CircleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
-
498  connect(CircleButton, SIGNAL(clicked()), this, SLOT(slotCreateCircleTool()));
+
497  connect(EditLineWidth, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
+
498  connect(EditLineInnerAlpha, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
499 
-
500  connect(FloodFillButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
-
501  connect(FloodFillButton, SIGNAL(clicked()), this, SLOT(slotCreateFloodFillTool()));
+
500  connect(CircleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
+
501  connect(CircleButton, SIGNAL(clicked()), this, SLOT(slotCreateCircleTool()));
502 
-
503  connect(LineButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
-
504  connect(LineButton, SIGNAL(clicked()), this, SLOT(slotCreateLineTool()));
+
503  connect(FloodFillButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
+
504  connect(FloodFillButton, SIGNAL(clicked()), this, SLOT(slotCreateFloodFillTool()));
505 
-
506  connect(PenButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
-
507  connect(PenButton, SIGNAL(clicked()), this, SLOT(slotCreatePenTool()));
+
506  connect(LineButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
+
507  connect(LineButton, SIGNAL(clicked()), this, SLOT(slotCreateLineTool()));
508 
-
509  connect(PlainButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
-
510  connect(PlainButton, SIGNAL(clicked()), this, SLOT(slotCreatePlainTool()));
+
509  connect(PenButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
+
510  connect(PenButton, SIGNAL(clicked()), this, SLOT(slotCreatePenTool()));
511 
-
512  connect(PolygonButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
-
513  connect(PolygonButton, SIGNAL(clicked()), this, SLOT(slotCreatePolygonTool()));
+
512  connect(PlainButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
+
513  connect(PlainButton, SIGNAL(clicked()), this, SLOT(slotCreatePlainTool()));
514 
-
515  connect(RectangleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
-
516  connect(RectangleButton, SIGNAL(clicked()), this, SLOT(slotCreateRectangleTool()));
+
515  connect(PolygonButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
+
516  connect(PolygonButton, SIGNAL(clicked()), this, SLOT(slotCreatePolygonTool()));
517 
-
518  actionSetWidth = new QAction(tr("&Set Width"),this);
-
519  actionSetWidth->setShortcut(QKeySequence(Qt::ALT + Qt::Key_W));
-
520  connect(actionSetWidth, SIGNAL(triggered()), this, SLOT(slotSetWidth()));
-
521 
-
522  actionSetInnerAlpha = new QAction(tr("&Set Inner Alpha"),this);
-
523  actionSetInnerAlpha->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A));
-
524  connect(actionSetInnerAlpha, SIGNAL(triggered()), this, SLOT(slotSetInnerAlpha()));
-
525 }
-
526 
-
527 // Create the menubar
-
528 void IntelliPhotoGui::createMenus(){
-
529  // Create Save As option and the list of file types
-
530  saveAsMenu = new QMenu(tr("&Save As"), this);
-
531  foreach (QAction * action, actionSaveAs)
-
532  saveAsMenu->addAction(action);
-
533 
-
534  // Attach all actions to File
-
535  fileMenu = new QMenu(tr("&File"), this);
-
536  fileMenu->addAction(actionOpen);
-
537  fileMenu->addMenu(saveAsMenu);
-
538  fileMenu->addSeparator();
-
539  fileMenu->addAction(actionExit);
-
540 
-
541  //Attach all actions to Render Settings
-
542  renderMenu = new QMenu(tr("&Fast Renderer"), this);
-
543  renderMenu->addAction(actionUpdateRenderSettingsOn);
-
544  renderMenu->addAction(actionUpdateRenderSettingsOff);
-
545 
-
546  //Attach all Layer Creations to Menu
-
547  layerCreationMenu = new QMenu(tr("&Create new Layer"), this);
-
548  layerCreationMenu->addAction(actionCreateNewRasterLayer);
-
549  layerCreationMenu->addAction(actionCreateNewShapedLayer);
-
550  // Attach all actions to Layer
-
551  layerMenu = new QMenu(tr("&Layer"), this);
-
552  layerMenu->addMenu(layerCreationMenu);
-
553  layerMenu->addSeparator();
-
554  layerMenu->addAction(actionSetActiveAlpha);
-
555  layerMenu->addAction(actionSetActiveLayer);
-
556  layerMenu->addAction(actionSetPolygon);
-
557  layerMenu->addSeparator();
-
558  layerMenu->addAction(actionMovePositionUp);
-
559  layerMenu->addAction(actionMovePositionDown);
-
560  layerMenu->addAction(actionMovePositionLeft);
-
561  layerMenu->addAction(actionMovePositionRight);
-
562  layerMenu->addAction(actionMoveLayerUp);
-
563  layerMenu->addAction(actionMoveLayerDown);
-
564  layerMenu->addSeparator();
-
565  layerMenu->addAction(actionDeleteLayer);
-
566 
-
567  //Attach all Color Options
-
568  colorMenu = new QMenu(tr("&Color"), this);
-
569  colorMenu->addAction(actionColorPickerFirstColor);
-
570  colorMenu->addAction(actionColorPickerSecondColor);
-
571  colorMenu->addAction(actionColorSwap);
-
572 
-
573  //Attach all Tool Creation Actions
-
574  toolCreationMenu = new QMenu(tr("&Drawingtools"), this);
-
575  toolCreationMenu->addAction(actionCreateCircleTool);
-
576  toolCreationMenu->addAction(actionCreateFloodFillTool);
-
577  toolCreationMenu->addAction(actionCreateLineTool);
-
578  toolCreationMenu->addAction(actionCreatePenTool);
-
579  toolCreationMenu->addAction(actionCreatePlainTool);
-
580  toolCreationMenu->addAction(actionCreatePolygonTool);
-
581  toolCreationMenu->addAction(actionCreateRectangleTool);
-
582 
-
583  //Attach all Tool Setting Actions
-
584  toolSettingsMenu = new QMenu(tr("&Toolsettings"), this);
-
585  toolSettingsMenu->addAction(actionSetWidth);
-
586  toolSettingsMenu->addAction(actionSetInnerAlpha);
-
587 
-
588  //Attach all Tool Options
-
589  toolMenu = new QMenu(tr("&Tools"), this);
-
590  toolMenu->addMenu(toolCreationMenu);
-
591  toolMenu->addMenu(toolSettingsMenu);
-
592  toolMenu->addSeparator();
-
593  toolMenu->addMenu(colorMenu);
-
594 
-
595  // Attach all actions to Options
-
596  optionMenu = new QMenu(tr("&Options"), this);
-
597  optionMenu->addMenu(layerMenu);
-
598  optionMenu->addMenu(toolMenu);
-
599  optionMenu->addSeparator();
-
600  optionMenu->addMenu(renderMenu);
-
601  optionMenu->addAction(actionChangeDim);
-
602 
-
603  // Attach all actions to Help
-
604  helpMenu = new QMenu(tr("&Help"), this);
-
605  helpMenu->addAction(actionAboutDialog);
-
606  helpMenu->addAction(actionAboutQtDialog);
-
607 
-
608  // Add menu items to the menubar
-
609  menuBar()->addMenu(fileMenu);
-
610  menuBar()->addMenu(optionMenu);
-
611  menuBar()->addMenu(helpMenu);
-
612 }
-
613 
-
614 void IntelliPhotoGui::createGui(){
-
615  // create a central widget to work on
-
616  centralGuiWidget = new QWidget(this);
-
617  setCentralWidget(centralGuiWidget);
-
618 
-
619  // create the grid for the layout
-
620  mainLayout = new QGridLayout(centralGuiWidget);
-
621  centralGuiWidget->setLayout(mainLayout);
-
622 
-
623  // create Gui elements
-
624  // get and set max width and height
-
625  paintingArea = new PaintingArea(1280, 720);
-
626  paintingArea->DummyGui = this;
-
627 
-
628  preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg");
-
629  CircleButton = new QPushButton();
-
630  CircleButton->setFixedSize(Buttonsize);
-
631  CircleButton->setIcon(preview);
-
632  CircleButton->setIconSize(Buttonsize);
-
633  CircleButton->setCheckable(true);
-
634 
-
635  preview = QPixmap(":/Icons/Buttons/icons/flood-fill-tool.svg");
-
636  FloodFillButton = new QPushButton();
-
637  FloodFillButton->setFixedSize(Buttonsize);
-
638  FloodFillButton->setIcon(preview);
-
639  FloodFillButton->setIconSize(Buttonsize);
-
640  FloodFillButton->setCheckable(true);
-
641 
-
642  preview = QPixmap(":/Icons/Buttons/icons/line-tool.svg");
-
643  LineButton = new QPushButton();
-
644  LineButton->setFixedSize(Buttonsize);
-
645  LineButton->setIcon(preview);
-
646  LineButton->setIconSize(Buttonsize);
-
647  LineButton->setCheckable(true);
-
648 
-
649  preview = QPixmap(":/Icons/Buttons/icons/pen-tool.svg");
-
650  PenButton = new QPushButton();
-
651  PenButton->setFixedSize(Buttonsize);
-
652  PenButton->setIcon(preview);
-
653  PenButton->setIconSize(Buttonsize);
-
654  PenButton->setCheckable(true);
-
655 
-
656  preview = QPixmap(":/Icons/Buttons/icons/plain-tool.svg");
-
657  PlainButton = new QPushButton();
-
658  PlainButton->setFixedSize(Buttonsize);
-
659  PlainButton->setIcon(preview);
-
660  PlainButton->setIconSize(Buttonsize);
-
661  PlainButton->setCheckable(true);
-
662 
-
663  preview = QPixmap(":/Icons/Buttons/icons/polygon-tool.svg");
-
664  PolygonButton = new QPushButton();
-
665  PolygonButton->setFixedSize(Buttonsize);
-
666  PolygonButton->setIcon(preview);
-
667  PolygonButton->setIconSize(Buttonsize);
-
668  PolygonButton->setCheckable(true);
-
669 
-
670  preview = QPixmap(":/Icons/Buttons/icons/rectangle-tool.svg");
-
671  RectangleButton = new QPushButton();
-
672  RectangleButton->setFixedSize(Buttonsize);
-
673  RectangleButton->setIcon(preview);
-
674  RectangleButton->setIconSize(Buttonsize);
-
675  RectangleButton->setCheckable(true);
-
676 
-
677  WidthLine = new QLabel();
-
678  WidthLine->setText("Width");
-
679  WidthLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
-
680 
-
681  EditLineWidth = new QLineEdit();
-
682  EditLineWidth->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
-
683  EditLineWidth->setText("5");
-
684  ValidatorLineWidth = new QIntValidator();
-
685  ValidatorLineWidth->setTop(99);
-
686  ValidatorLineWidth->setBottom(1);
-
687  EditLineWidth->setValidator(ValidatorLineWidth);
-
688 
-
689  innerAlphaLine = new QLabel();
-
690  innerAlphaLine->setText("Inner Alpha");
-
691  innerAlphaLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
-
692 
-
693  EditLineInnerAlpha = new QLineEdit();
-
694  EditLineInnerAlpha->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
-
695  EditLineInnerAlpha->setText("255");
-
696  ValidatorInnerAlpha = new QIntValidator();
-
697  ValidatorInnerAlpha->setTop(999);
-
698  ValidatorInnerAlpha->setBottom(0);
-
699  EditLineInnerAlpha->setValidator(ValidatorInnerAlpha);
-
700 
-
701  FirstColorButton = new QPushButton();
-
702  FirstColorButton->setFixedSize(Buttonsize);
+
518  connect(RectangleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
+
519  connect(RectangleButton, SIGNAL(clicked()), this, SLOT(slotCreateRectangleTool()));
+
520 
+
521  actionSetWidth = new QAction(tr("&Set Width"),this);
+
522  actionSetWidth->setShortcut(QKeySequence(Qt::ALT + Qt::Key_W));
+
523  connect(actionSetWidth, SIGNAL(triggered()), this, SLOT(slotSetWidth()));
+
524 
+
525  actionSetInnerAlpha = new QAction(tr("&Set Inner Alpha"),this);
+
526  actionSetInnerAlpha->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A));
+
527  connect(actionSetInnerAlpha, SIGNAL(triggered()), this, SLOT(slotSetInnerAlpha()));
+
528 }
+
529 
+
530 // Create the menubar
+
531 void IntelliPhotoGui::createMenus(){
+
532  // Create Save As option and the list of file types
+
533  saveAsMenu = new QMenu(tr("&Save As"), this);
+
534  foreach (QAction * action, actionSaveAs)
+
535  saveAsMenu->addAction(action);
+
536 
+
537  // Attach all actions to File
+
538  fileMenu = new QMenu(tr("&File"), this);
+
539  fileMenu->addAction(actionOpen);
+
540  fileMenu->addMenu(saveAsMenu);
+
541  fileMenu->addSeparator();
+
542  fileMenu->addAction(actionExit);
+
543 
+
544  //Attach all actions to Render Settings
+
545  renderMenu = new QMenu(tr("&Fast Renderer"), this);
+
546  renderMenu->addAction(actionUpdateRenderSettingsOn);
+
547  renderMenu->addAction(actionUpdateRenderSettingsOff);
+
548 
+
549  //Attach all Layer Creations to Menu
+
550  layerCreationMenu = new QMenu(tr("&Create new Layer"), this);
+
551  layerCreationMenu->addAction(actionCreateNewRasterLayer);
+
552  layerCreationMenu->addAction(actionCreateNewShapedLayer);
+
553  // Attach all actions to Layer
+
554  layerMenu = new QMenu(tr("&Layer"), this);
+
555  layerMenu->addMenu(layerCreationMenu);
+
556  layerMenu->addSeparator();
+
557  layerMenu->addAction(actionSetActiveAlpha);
+
558  layerMenu->addAction(actionSetActiveLayer);
+
559  layerMenu->addAction(actionSetPolygon);
+
560  layerMenu->addSeparator();
+
561  layerMenu->addAction(actionMovePositionUp);
+
562  layerMenu->addAction(actionMovePositionDown);
+
563  layerMenu->addAction(actionMovePositionLeft);
+
564  layerMenu->addAction(actionMovePositionRight);
+
565  layerMenu->addAction(actionMoveLayerUp);
+
566  layerMenu->addAction(actionMoveLayerDown);
+
567  layerMenu->addSeparator();
+
568  layerMenu->addAction(actionDeleteLayer);
+
569 
+
570  //Attach all Color Options
+
571  colorMenu = new QMenu(tr("&Color"), this);
+
572  colorMenu->addAction(actionColorPickerFirstColor);
+
573  colorMenu->addAction(actionColorPickerSecondColor);
+
574  colorMenu->addAction(actionColorSwap);
+
575 
+
576  //Attach all Tool Creation Actions
+
577  toolCreationMenu = new QMenu(tr("&Drawingtools"), this);
+
578  toolCreationMenu->addAction(actionCreateCircleTool);
+
579  toolCreationMenu->addAction(actionCreateFloodFillTool);
+
580  toolCreationMenu->addAction(actionCreateLineTool);
+
581  toolCreationMenu->addAction(actionCreatePenTool);
+
582  toolCreationMenu->addAction(actionCreatePlainTool);
+
583  toolCreationMenu->addAction(actionCreatePolygonTool);
+
584  toolCreationMenu->addAction(actionCreateRectangleTool);
+
585 
+
586  //Attach all Tool Setting Actions
+
587  toolSettingsMenu = new QMenu(tr("&Toolsettings"), this);
+
588  toolSettingsMenu->addAction(actionSetWidth);
+
589  toolSettingsMenu->addAction(actionSetInnerAlpha);
+
590 
+
591  //Attach all Tool Options
+
592  toolMenu = new QMenu(tr("&Tools"), this);
+
593  toolMenu->addMenu(toolCreationMenu);
+
594  toolMenu->addMenu(toolSettingsMenu);
+
595  toolMenu->addSeparator();
+
596  toolMenu->addMenu(colorMenu);
+
597 
+
598  // Attach all actions to Options
+
599  optionMenu = new QMenu(tr("&Options"), this);
+
600  optionMenu->addMenu(layerMenu);
+
601  optionMenu->addMenu(toolMenu);
+
602  optionMenu->addSeparator();
+
603  optionMenu->addMenu(renderMenu);
+
604  optionMenu->addAction(actionChangeDim);
+
605 
+
606  // Attach all actions to Help
+
607  helpMenu = new QMenu(tr("&Help"), this);
+
608  helpMenu->addAction(actionAboutDialog);
+
609  helpMenu->addAction(actionAboutQtDialog);
+
610 
+
611  // Add menu items to the menubar
+
612  menuBar()->addMenu(fileMenu);
+
613  menuBar()->addMenu(optionMenu);
+
614  menuBar()->addMenu(helpMenu);
+
615 }
+
616 
+
617 void IntelliPhotoGui::createGui(){
+
618  // create a central widget to work on
+
619  centralGuiWidget = new QWidget(this);
+
620  setCentralWidget(centralGuiWidget);
+
621 
+
622  // create the grid for the layout
+
623  mainLayout = new QGridLayout(centralGuiWidget);
+
624  centralGuiWidget->setLayout(mainLayout);
+
625 
+
626  // create Gui elements
+
627  // get and set max width and height
+
628  paintingArea = new PaintingArea(1280, 720);
+
629  paintingArea->DummyGui = this;
+
630 
+
631  preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg");
+
632  CircleButton = new QPushButton();
+
633  CircleButton->setFixedSize(Buttonsize);
+
634  CircleButton->setIcon(preview);
+
635  CircleButton->setIconSize(Buttonsize);
+
636  CircleButton->setCheckable(true);
+
637 
+
638  preview = QPixmap(":/Icons/Buttons/icons/flood-fill-tool.svg");
+
639  FloodFillButton = new QPushButton();
+
640  FloodFillButton->setFixedSize(Buttonsize);
+
641  FloodFillButton->setIcon(preview);
+
642  FloodFillButton->setIconSize(Buttonsize);
+
643  FloodFillButton->setCheckable(true);
+
644 
+
645  preview = QPixmap(":/Icons/Buttons/icons/line-tool.svg");
+
646  LineButton = new QPushButton();
+
647  LineButton->setFixedSize(Buttonsize);
+
648  LineButton->setIcon(preview);
+
649  LineButton->setIconSize(Buttonsize);
+
650  LineButton->setCheckable(true);
+
651 
+
652  preview = QPixmap(":/Icons/Buttons/icons/pen-tool.svg");
+
653  PenButton = new QPushButton();
+
654  PenButton->setFixedSize(Buttonsize);
+
655  PenButton->setIcon(preview);
+
656  PenButton->setIconSize(Buttonsize);
+
657  PenButton->setCheckable(true);
+
658 
+
659  preview = QPixmap(":/Icons/Buttons/icons/plain-tool.svg");
+
660  PlainButton = new QPushButton();
+
661  PlainButton->setFixedSize(Buttonsize);
+
662  PlainButton->setIcon(preview);
+
663  PlainButton->setIconSize(Buttonsize);
+
664  PlainButton->setCheckable(true);
+
665 
+
666  preview = QPixmap(":/Icons/Buttons/icons/polygon-tool.svg");
+
667  PolygonButton = new QPushButton();
+
668  PolygonButton->setFixedSize(Buttonsize);
+
669  PolygonButton->setIcon(preview);
+
670  PolygonButton->setIconSize(Buttonsize);
+
671  PolygonButton->setCheckable(true);
+
672 
+
673  preview = QPixmap(":/Icons/Buttons/icons/rectangle-tool.svg");
+
674  RectangleButton = new QPushButton();
+
675  RectangleButton->setFixedSize(Buttonsize);
+
676  RectangleButton->setIcon(preview);
+
677  RectangleButton->setIconSize(Buttonsize);
+
678  RectangleButton->setCheckable(true);
+
679 
+
680  WidthLine = new QLabel();
+
681  WidthLine->setText("Width");
+
682  WidthLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
+
683 
+
684  EditLineWidth = new QLineEdit();
+
685  EditLineWidth->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
+
686  EditLineWidth->setText("5");
+
687  ValidatorLineWidth = new QIntValidator();
+
688  ValidatorLineWidth->setTop(99);
+
689  ValidatorLineWidth->setBottom(1);
+
690  EditLineWidth->setValidator(ValidatorLineWidth);
+
691 
+
692  innerAlphaLine = new QLabel();
+
693  innerAlphaLine->setText("Inner Alpha");
+
694  innerAlphaLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
+
695 
+
696  EditLineInnerAlpha = new QLineEdit();
+
697  EditLineInnerAlpha->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
+
698  EditLineInnerAlpha->setText("255");
+
699  ValidatorInnerAlpha = new QIntValidator();
+
700  ValidatorInnerAlpha->setTop(999);
+
701  ValidatorInnerAlpha->setBottom(0);
+
702  EditLineInnerAlpha->setValidator(ValidatorInnerAlpha);
703 
-
704  SecondColorButton = new QPushButton();
-
705  SecondColorButton->setFixedSize(Buttonsize);
+
704  FirstColorButton = new QPushButton();
+
705  FirstColorButton->setFixedSize(Buttonsize);
706 
-
707  preview = QPixmap(":/Icons/Buttons/icons/Wechselpfeile.png");
-
708  SwitchColorButton = new QPushButton();
-
709  SwitchColorButton->setFixedSize(Buttonsize.width() * 2,Buttonsize.height());
-
710  SwitchColorButton->setIcon(preview);
-
711  SwitchColorButton->setIconSize(QSize(Buttonsize.width() * 2,Buttonsize.height()));
-
712 
-
713  ActiveLayerLine = new QLabel();
-
714  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
-
715  ActiveLayerLine->setText(string);
-
716  ActiveLayerLine->setFixedSize(Buttonsize.width() * 2 + 10,(Buttonsize.height() * 2) / 3);
-
717 
-
718  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
-
719  if(activePicture) {
-
720  preview = preview.fromImage(activePicture->getImageData());
-
721  }else{
-
722  QImage tmp(1,1,QImage::Format_ARGB32);
-
723  tmp.fill(Qt::transparent);
-
724  preview = preview.fromImage(tmp);
-
725  }
-
726 
-
727  ActiveLayerImageLabel = new QLabel();
-
728  ActiveLayerImageLabel->setFixedSize(Buttonsize * 2);
-
729  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
-
730 
-
731  dimActive = new QPushButton();
-
732  dimActive->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
-
733  dimActive->setText("0x0");
-
734 
-
735  dimCanvas = new QPushButton();
-
736  dimCanvas->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
-
737  QString String = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
-
738  dimCanvas->setText(String);
-
739 
-
740  // set gui elements
-
741  mainLayout->addWidget(paintingArea,1,1,20,1);
-
742  mainLayout->addWidget(CircleButton,1,2,1,1);
-
743  mainLayout->addWidget(FloodFillButton,1,3,1,1);
-
744  mainLayout->addWidget(LineButton,2,2,1,1);
-
745  mainLayout->addWidget(PenButton,2,3,1,1);
-
746  mainLayout->addWidget(PlainButton,3,2,1,1);
-
747  mainLayout->addWidget(PolygonButton,3,3,1,1);
-
748  mainLayout->addWidget(RectangleButton,4,2,1,1);
-
749  mainLayout->addWidget(WidthLine,5,2,1,2);
-
750  mainLayout->addWidget(EditLineWidth,6,2,1,2);
-
751  mainLayout->addWidget(innerAlphaLine,7,2,1,2);
-
752  mainLayout->addWidget(EditLineInnerAlpha,8,2,1,2);
-
753  mainLayout->addWidget(FirstColorButton,9,2,1,1);
-
754  mainLayout->addWidget(SecondColorButton,9,3,1,1);
-
755  mainLayout->addWidget(SwitchColorButton,10,2,1,2);
-
756  mainLayout->addWidget(ActiveLayerLine,11,2,1,2);
-
757  mainLayout->addWidget(ActiveLayerImageLabel,12,2,1,2);
-
758  mainLayout->addWidget(dimActive,13,2,1,2);
-
759  mainLayout->addWidget(dimCanvas,14,2,1,2);
-
760  mainLayout->setHorizontalSpacing(0);
-
761 }
-
762 
-
763 void IntelliPhotoGui::setIntelliStyle(){
-
764  // Set the title
-
765  setWindowTitle("IntelliPhoto Prototype");
-
766  // Set style sheet
-
767  this->setStyleSheet("color: white;" "background-color: rgb(64, 64, 64);" "selection-color: rgb(200, 10, 10);" "selection-background-color: rgb(64, 64, 64);");
-
768 
-
769  QString string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
-
770  FirstColorButton->setStyleSheet(string);
-
771  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
-
772  SecondColorButton->setStyleSheet(string);
-
773 }
-
774 
-
775 bool IntelliPhotoGui::maybeSave(){
-
776  // Check for changes since last save
+
707  SecondColorButton = new QPushButton();
+
708  SecondColorButton->setFixedSize(Buttonsize);
+
709 
+
710  preview = QPixmap(":/Icons/Buttons/icons/Wechselpfeile.png");
+
711  SwitchColorButton = new QPushButton();
+
712  SwitchColorButton->setFixedSize(Buttonsize.width() * 2,Buttonsize.height());
+
713  SwitchColorButton->setIcon(preview);
+
714  SwitchColorButton->setIconSize(QSize(Buttonsize.width() * 2,Buttonsize.height()));
+
715 
+
716  ActiveLayerLine = new QLabel();
+
717  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
+
718  ActiveLayerLine->setText(string);
+
719  ActiveLayerLine->setFixedSize(Buttonsize.width() * 2 + 10,(Buttonsize.height() * 2) / 3);
+
720 
+
721  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
+
722  if(activePicture) {
+
723  preview = preview.fromImage(activePicture->getImageData());
+
724  }else{
+
725  QImage tmp(1,1,QImage::Format_ARGB32);
+
726  tmp.fill(Qt::transparent);
+
727  preview = preview.fromImage(tmp);
+
728  }
+
729 
+
730  ActiveLayerImageLabel = new QLabel();
+
731  ActiveLayerImageLabel->setFixedSize(Buttonsize * 2);
+
732  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
+
733 
+
734  dimActive = new QPushButton();
+
735  dimActive->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
+
736  dimActive->setText("0x0");
+
737 
+
738  dimCanvas = new QPushButton();
+
739  dimCanvas->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
+
740  QString String = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
+
741  dimCanvas->setText(String);
+
742 
+
743  // set gui elements
+
744  mainLayout->addWidget(paintingArea,1,1,20,1);
+
745  mainLayout->addWidget(CircleButton,1,2,1,1);
+
746  mainLayout->addWidget(FloodFillButton,1,3,1,1);
+
747  mainLayout->addWidget(LineButton,2,2,1,1);
+
748  mainLayout->addWidget(PenButton,2,3,1,1);
+
749  mainLayout->addWidget(PlainButton,3,2,1,1);
+
750  mainLayout->addWidget(PolygonButton,3,3,1,1);
+
751  mainLayout->addWidget(RectangleButton,4,2,1,1);
+
752  mainLayout->addWidget(WidthLine,5,2,1,2);
+
753  mainLayout->addWidget(EditLineWidth,6,2,1,2);
+
754  mainLayout->addWidget(innerAlphaLine,7,2,1,2);
+
755  mainLayout->addWidget(EditLineInnerAlpha,8,2,1,2);
+
756  mainLayout->addWidget(FirstColorButton,9,2,1,1);
+
757  mainLayout->addWidget(SecondColorButton,9,3,1,1);
+
758  mainLayout->addWidget(SwitchColorButton,10,2,1,2);
+
759  mainLayout->addWidget(ActiveLayerLine,11,2,1,2);
+
760  mainLayout->addWidget(ActiveLayerImageLabel,12,2,1,2);
+
761  mainLayout->addWidget(dimActive,13,2,1,2);
+
762  mainLayout->addWidget(dimCanvas,14,2,1,2);
+
763  mainLayout->setHorizontalSpacing(0);
+
764 }
+
765 
+
766 void IntelliPhotoGui::setIntelliStyle(){
+
767  // Set the title
+
768  setWindowTitle("IntelliPhoto Prototype");
+
769  // Set style sheet
+
770  this->setStyleSheet("color: white;" "background-color: rgb(64, 64, 64);" "selection-color: rgb(200, 10, 10);" "selection-background-color: rgb(64, 64, 64);");
+
771 
+
772  QString string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
+
773  FirstColorButton->setStyleSheet(string);
+
774  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
+
775  SecondColorButton->setStyleSheet(string);
+
776 }
777 
-
778  // TODO insert variable for modified status here to make an save exit message
-
779  if (false) {
-
780  QMessageBox::StandardButton ret;
-
781 
-
782  // Painting is the title of the window
-
783  // Add text and the buttons
-
784  ret = QMessageBox::warning(this, tr("Painting"),
-
785  tr("The image has been modified.\n"
-
786  "Do you want to save your changes?"),
-
787  QMessageBox::Save | QMessageBox::Discard
-
788  | QMessageBox::Cancel);
-
789 
-
790  // If save button clicked call for file to be saved
-
791  if (ret == QMessageBox::Save) {
-
792  return saveFile("png");
-
793 
-
794  // If cancel do nothing
-
795  } else if (ret == QMessageBox::Cancel) {
-
796  return false;
-
797  }
+
778 bool IntelliPhotoGui::maybeSave(){
+
779  // Check for changes since last save
+
780 #ifdef QT_NO_DEBUG
+
781  QMessageBox::StandardButton ret;
+
782 
+
783  // Painting is the title of the window
+
784  // Add text and the buttons
+
785  ret = QMessageBox::warning(this, tr("Painting"),
+
786  tr("The image has been modified.\n"
+
787  "Do you want to save your changes?"),
+
788  QMessageBox::Save | QMessageBox::Discard
+
789  | QMessageBox::Cancel);
+
790 
+
791  // If save button clicked call for file to be saved
+
792  if (ret == QMessageBox::Save) {
+
793  return saveFile("png");
+
794 
+
795  // If cancel do nothing
+
796  } else if (ret == QMessageBox::Cancel) {
+
797  return false;
798  }
-
799  return true;
-
800 }
-
801 
-
802 bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){
-
803  // Define path, name and default file type
-
804  QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
-
805 
-
806  // Get selected file from dialog
-
807  // Add the proper file formats and extensions
-
808  QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
-
809  initialPath,
-
810  tr("%1 Files (*.%2);;All Files (*)")
-
811  .arg(QString::fromLatin1(fileFormat.toUpper()))
-
812  .arg(QString::fromLatin1(fileFormat)), nullptr, QFileDialog::DontUseNativeDialog);
-
813 
-
814  // If no file do nothing
-
815  if (fileName.isEmpty()) {
-
816  return false;
-
817  } else {
-
818  // Call for the file to be saved
-
819  return paintingArea->save(fileName, fileFormat.constData());
-
820  }
-
821 }
-
822 
-
823 void IntelliPhotoGui::setDefaultToolValue(){
-
824  slotEnterPressed();
-
825 }
-
826 
-
827 void IntelliPhotoGui::setToolWidth(int value){
-
828  if(value < 1) {
-
829  value = 1;
-
830  }else if(value > 50) {
-
831  value = 50;
-
832  }
-
833  EditLineWidth->setText(QString("%1").arg(value));
-
834 }
-
835 
-
836 void IntelliPhotoGui::UpdateGui(){
-
837  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
-
838  ActiveLayerLine->setText(string);
-
839 
-
840  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
-
841  if(activePicture) {
-
842  preview = preview.fromImage(activePicture->getImageData());
-
843  }else{
-
844  QImage tmp(1,1,QImage::Format_ARGB32);
-
845  tmp.fill(Qt::transparent);
-
846  preview = preview.fromImage(tmp);
-
847  }
-
848  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
-
849 
-
850  string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
-
851  FirstColorButton->setStyleSheet(string);
-
852  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
-
853  SecondColorButton->setStyleSheet(string);
-
854 
-
855  string = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
-
856  dimCanvas->setText(string);
-
857 
-
858  if(paintingArea->layerBundle.size() != 0) {
-
859  string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast<unsigned long long>(paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast<unsigned long long>(paintingArea->getNumberOfActiveLayer())].height);
-
860  dimActive->setText(string);
-
861  }
-
862  else{
-
863  dimActive->setText("0x0");
+
799 #endif
+
800  return true;
+
801 }
+
802 
+
803 bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){
+
804  // Define path, name and default file type
+
805  QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
+
806 
+
807  // Get selected file from dialog
+
808  // Add the proper file formats and extensions
+
809  QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
+
810  initialPath,
+
811  tr("%1 Files (*.%2);;All Files (*)")
+
812  .arg(QString::fromLatin1(fileFormat.toUpper()))
+
813  .arg(QString::fromLatin1(fileFormat)), nullptr, QFileDialog::DontUseNativeDialog);
+
814 
+
815  // If no file do nothing
+
816  if (fileName.isEmpty()) {
+
817  return false;
+
818  } else {
+
819  // Call for the file to be saved
+
820  return paintingArea->save(fileName, fileFormat.constData());
+
821  }
+
822 }
+
823 
+
824 void IntelliPhotoGui::setDefaultToolValue(){
+
825  slotEnterPressed();
+
826 }
+
827 
+
828 void IntelliPhotoGui::setToolWidth(int value){
+
829  if(value < 1) {
+
830  value = 1;
+
831  }else if(value > 50) {
+
832  value = 50;
+
833  }
+
834  EditLineWidth->setText(QString("%1").arg(value));
+
835 }
+
836 
+
837 void IntelliPhotoGui::UpdateGui(){
+
838  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
+
839  ActiveLayerLine->setText(string);
+
840 
+
841  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
+
842  if(activePicture) {
+
843  preview = preview.fromImage(activePicture->getImageData());
+
844  }else{
+
845  QImage tmp(1,1,QImage::Format_ARGB32);
+
846  tmp.fill(Qt::transparent);
+
847  preview = preview.fromImage(tmp);
+
848  }
+
849  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
+
850 
+
851  string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
+
852  FirstColorButton->setStyleSheet(string);
+
853  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
+
854  SecondColorButton->setStyleSheet(string);
+
855 
+
856  string = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
+
857  dimCanvas->setText(string);
+
858 
+
859  if(paintingArea->layerBundle.size() != 0) {
+
860  string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast<size_t>
+
861  (paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast<size_t>
+
862  (paintingArea->getNumberOfActiveLayer())].height);
+
863  dimActive->setText(string);
864  }
-
865 }
+
865  else{
+
866  dimActive->setText("0x0");
+
867  }
+
868 }
PaintingArea::createCircleTool
void createCircleTool()
Definition: PaintingArea.cpp:221
@@ -964,9 +967,8 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp_source.html','
PaintingArea::setLayerActive
void setLayerActive(int idx)
The setLayerToActive method marks a specific layer as active.
Definition: PaintingArea.cpp:103
PaintingArea::getMaxHeight
int getMaxHeight()
Definition: PaintingArea.cpp:247
PaintingArea::deleteLayer
void deleteLayer(int idx, bool isTool=false)
The deleteLayer method removes a layer at a given idx.
Definition: PaintingArea.cpp:81
-
IntelliColorPicker::getSecondColor
QColor getSecondColor()
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:19
PaintingArea::createPlainTool
void createPlainTool()
Definition: PaintingArea.cpp:206
-
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
Definition: IntelliPhotoGui.cpp:7
+
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
Definition: IntelliPhotoGui.cpp:10
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:53
PaintingArea::createPenTool
void createPenTool()
Definition: PaintingArea.cpp:201
IntelliColorPicker::getSecondColor
QColor getSecondColor() const
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:19
@@ -977,18 +979,17 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp_source.html','
IntelliPhotoGui.h
PaintingArea::getNumberOfActiveLayer
int getNumberOfActiveLayer()
Definition: PaintingArea.cpp:412
IntelliImage::ImageType::SHAPEDIMAGE
@ SHAPEDIMAGE
-
IntelliPhotoGui::closeEvent
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
Definition: IntelliPhotoGui.cpp:23
+
IntelliPhotoGui::closeEvent
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
Definition: IntelliPhotoGui.cpp:26
IntelliImage::getImageData
virtual QImage getImageData()
getImageData returns the data of the current image (Note: It will allways return a ARGB32bit QImage!...
Definition: IntelliImage.cpp:134
-
IntelliPhotoGui::setToolWidth
void setToolWidth(int value)
Definition: IntelliPhotoGui.cpp:827
+
IntelliPhotoGui::setToolWidth
void setToolWidth(int value)
Definition: IntelliPhotoGui.cpp:828
PaintingArea::open
bool open(const QString &filePath)
The open method is used for loading a picture into the current layer.
Definition: PaintingArea.cpp:129
PaintingArea::createPolygonTool
void createPolygonTool()
Definition: PaintingArea.cpp:225
PaintingArea::moveActiveLayer
void moveActiveLayer(int idx)
The moveActiveLayer moves the active layer to a specific position in the layer stack.
Definition: PaintingArea.cpp:170
PaintingArea::colorPicker
IntelliColorPicker colorPicker
Definition: PaintingArea.h:202
PaintingArea.h
-
IntelliColorPicker::getFirstColor
QColor getFirstColor()
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:15
PaintingArea::createFloodFillTool
void createFloodFillTool()
Definition: PaintingArea.cpp:230
IntelliToolsettings::setInnerAlpha
void setInnerAlpha(int innerAlpha)
Definition: IntelliToolsettings.cpp:32
-
IntelliPhotoGui::UpdateGui
void UpdateGui()
Definition: IntelliPhotoGui.cpp:836
+
IntelliPhotoGui::UpdateGui
void UpdateGui()
Definition: IntelliPhotoGui.cpp:837
IntelliImage::ImageType::RASTERIMAGE
@ RASTERIMAGE
PaintingArea::Toolsettings
IntelliToolsettings Toolsettings
Definition: PaintingArea.h:201
PaintingArea::setPolygon
void setPolygon(int idx)
setPolygon is used for setting polygondata, it only works on RASTER images
Definition: PaintingArea.cpp:117
diff --git a/docs/html/_intelli_photo_gui_8h_source.html b/docs/html/_intelli_photo_gui_8h_source.html index e75e8b8..5a4d433 100644 --- a/docs/html/_intelli_photo_gui_8h_source.html +++ b/docs/html/_intelli_photo_gui_8h_source.html @@ -290,13 +290,13 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8h_source.html','')
IntelliInputDialog.h
IntelliPhotoGui
The IntelliPhotoGui base class handles the graphical user interface and events for the intelliPhoto p...
Definition: IntelliPhotoGui.h:32
-
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
Definition: IntelliPhotoGui.cpp:7
+
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
Definition: IntelliPhotoGui.cpp:10
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:53
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
-
IntelliPhotoGui::closeEvent
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
Definition: IntelliPhotoGui.cpp:23
-
IntelliPhotoGui::setToolWidth
void setToolWidth(int value)
Definition: IntelliPhotoGui.cpp:827
+
IntelliPhotoGui::closeEvent
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
Definition: IntelliPhotoGui.cpp:26
+
IntelliPhotoGui::setToolWidth
void setToolWidth(int value)
Definition: IntelliPhotoGui.cpp:828
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:14
-
IntelliPhotoGui::UpdateGui
void UpdateGui()
Definition: IntelliPhotoGui.cpp:836
+
IntelliPhotoGui::UpdateGui
void UpdateGui()
Definition: IntelliPhotoGui.cpp:837
UnitTest
Definition: mainUnitTest.cpp:8
@@ -171,7 +171,7 @@ Protected Member Functions

The closeEvent function handles closing events.

-

Definition at line 23 of file IntelliPhotoGui.cpp.

+

Definition at line 26 of file IntelliPhotoGui.cpp.

@@ -191,7 +191,7 @@ Protected Member Functions
-

Definition at line 827 of file IntelliPhotoGui.cpp.

+

Definition at line 828 of file IntelliPhotoGui.cpp.

@@ -210,7 +210,7 @@ Protected Member Functions
-

Definition at line 836 of file IntelliPhotoGui.cpp.

+

Definition at line 837 of file IntelliPhotoGui.cpp.

diff --git a/docs/html/tst__unittest_8cpp_source.html b/docs/html/tst__unittest_8cpp_source.html index 572e3bf..c3292b4 100644 --- a/docs/html/tst__unittest_8cpp_source.html +++ b/docs/html/tst__unittest_8cpp_source.html @@ -1803,7 +1803,6 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
IntelliColorPicker::setSecondColor
void setSecondColor(QColor Color)
A function to set the secondary color.
Definition: IntelliColorPicker.cpp:27
IntelliToolPlainTool
The IntelliToolPlainTool class represents a tool to fill the whole canvas with one color.
Definition: IntelliToolPlain.h:13
IntelliShapedImage
The IntelliShapedImage manages a Shapedimage.
Definition: IntelliShapedImage.h:13
-
IntelliColorPicker::getSecondColor
QColor getSecondColor()
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:19
UnitTest::UnitTest
UnitTest()
Definition: mainUnitTest.cpp:95
IntelliToolFloodFill.h
PaintingArea::createPlainTool
void createPlainTool()
Definition: PaintingArea.cpp:206
@@ -1826,7 +1825,6 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
PaintingArea::moveActiveLayer
void moveActiveLayer(int idx)
The moveActiveLayer moves the active layer to a specific position in the layer stack.
Definition: PaintingArea.cpp:170
PaintingArea::colorPicker
IntelliColorPicker colorPicker
Definition: PaintingArea.h:202
PaintingArea.h
-
IntelliColorPicker::getFirstColor
QColor getFirstColor()
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:15
PaintingArea::createFloodFillTool
void createFloodFillTool()
Definition: PaintingArea.cpp:230
IntelliImage::ImageType::RASTERIMAGE
@ RASTERIMAGE
UnitTest
Definition: mainUnitTest.cpp:8