JUCE Designer
 All Classes Functions Variables
juced_Window.cpp
1 /*
2  ==============================================================================
3 
4  juced_Window.cpp
5  Created: 2 Mar 2013 6:43:07pm
6  Author: admin
7 
8  ==============================================================================
9 */
10 
11 #include "juced_Window.h"
12 
13 int juced_Window::_numObjects = 0;
14 
15 juced_Window::juced_Window() : DocumentWindow ("juced_Window",
16  Colours::lightgrey,
17  DocumentWindow::allButtons)
18 {
19  minWidth = 150;
20  minHeight = 150;
21 
22  centreWithSize (getWidth(), getHeight());
23  setVisible (true);
24  removeMouseListener(this);
25 
26  setName("Window");
27  setProperty(Attributes::objectType, "Window");
28  setProperty(Attributes::height, getHeight());
29  setProperty(Attributes::width, getWidth());
30  setProperty(Attributes::backgroundColour, findColour(backgroundColourId).toDisplayString(true));
31  setProperty(Attributes::name, getName());
32  ++_numObjects;
33  setProperty(Attributes::varName, getName() + String(_numObjects));
34  setProperty(Attributes::className, "DocumentWindow");
35  setProperty(Attributes::toolName, "juced_Window");
36  setProperty(Attributes::contentOwner, true);
37  setProperty(Attributes::titleBarHeight, getTitleBarHeight());
38  setProperty(Attributes::titleBarButtons, 7);
39  setProperty(Attributes::titleBarButtonsOnLeft, false);
40  setProperty(Attributes::titleBarTextCentered, true);
41  setProperty(Attributes::declareExtended, false);
42  setComponentID(Uuid().toString());
43  setProperty(Attributes::ID, getComponentID());
44  setProperty(Attributes::usingNativeTitleBar, false);
45 
46 }
47 
48 void juced_Window::closeButtonPressed ()
49 {
50  //JUCEApplication::getInstance()->systemRequestedQuit();
51 
52 }
53 
54 void juced_Window::minimizeButtonPressed ()
55 {
56 
57 }
58 
59 void juced_Window::maximizeButtonPressed ()
60 {
61 
62 }
63 
64 void juced_Window::setContentOwned (Component *newContentComponent, bool resizeToFitWhenContentChangesSize)
65 {
66  Rectangle<int> r (getLocalBounds());
67  newContentComponent->setBounds(0, 0, r.getWidth(), r.getHeight() - getTitleBarHeight());
68  DocumentWindow::setContentOwned(newContentComponent, resizeToFitWhenContentChangesSize);
69 }
70 
71 void juced_Window::mouseUp (const MouseEvent& event) {}
72 void juced_Window::mouseDrag (const MouseEvent& event) {}
73 void juced_Window::mouseDoubleClick (const MouseEvent& event) {}
74 void juced_Window::mouseMove (const MouseEvent& event) {}
75 void juced_Window::mouseDown (const MouseEvent& event) {}
76 void juced_Window::mouseEnter (const MouseEvent& event) {}
77 void juced_Window::mouseExit (const MouseEvent& event) {}
78 void juced_Window::mouseWheelMove (const MouseEvent &event, const MouseWheelDetails &wheel) {}