SUMO - Simulation of Urban MObility
GNEFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <iostream>
40 
41 #include "GNEFrame.h"
42 #include "GNEViewParent.h"
43 #include "GNEViewNet.h"
44 
45 // ===========================================================================
46 // method definitions
47 // ===========================================================================
48 
49 GNEFrame::GNEFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet, const std::string& frameLabel) :
50  FXVerticalFrame(horizontalFrameParent, GUIDesignAuxiliarFrame),
51  myViewNet(viewNet) {
52  // Create font
53  myFrameHeaderFont = new FXFont(getApp(), "Arial", 14, FXFont::Bold),
54 
55  // Create frame for header
56  myHeaderFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
57 
58  // Create frame for left elements of header (By default unused)
60  myHeaderLeftFrame->hide();
61 
62  // Create titel frame
63  myFrameHeaderLabel = new FXLabel(myHeaderFrame, frameLabel.c_str(), 0, GUIDesignLabelLeft);
64 
65  // Create frame for right elements of header (By default unused)
67  myHeaderRightFrame->hide();
68 
69  // Add separator
70  new FXHorizontalSeparator(this, GUIDesignHorizontalSeparator);
71 
72  // Create frame for contents
73  myScrollWindowsContents = new FXScrollWindow(this, GUIDesignContentsScrollWindow);
74 
75  // Create frame for contents
77 
78  // Set font of header
80 
81  // Hide Frame
82  FXVerticalFrame::hide();
83 }
84 
85 
87  delete myFrameHeaderFont;
88 }
89 
90 
91 void
93  myFrameHeaderLabel->setFocus();
94 }
95 
96 
97 void
99  // show scroll window
100  FXVerticalFrame::show();
101  // Show and update Frame Area in which this GNEFrame is placed
103 }
104 
105 
106 void
108  // hide scroll window
109  FXVerticalFrame::hide();
110  // Hide Frame Area in which this GNEFrame is placed
112 }
113 
114 
115 void
117  setWidth(width);
118  myScrollWindowsContents->setWidth(width);
119 }
120 
121 
122 GNEViewNet*
124  return myViewNet;
125 }
126 
127 
128 FXLabel*
130  return myFrameHeaderLabel;
131 }
132 
133 
134 FXFont*
136  return myFrameHeaderFont;
137 }
138 
139 
140 /****************************************************************************/
GNEFrame()
FOX needs this.
Definition: GNEFrame.h:92
void hideFramesArea()
hide frames area if all GNEFrames are hidden
FXLabel * getFrameHeaderLabel() const
get the label for the frame&#39;s header
Definition: GNEFrame.cpp:129
void setFrameWidth(int width)
set width of GNEFrame
Definition: GNEFrame.cpp:116
FXFont * myFrameHeaderFont
Font for the Header.
Definition: GNEFrame.h:98
FXHorizontalFrame * myHeaderRightFrame
fame for right header elements
Definition: GNEFrame.h:113
GNEViewParent * getViewParent() const
get the net object
void showFramesArea()
show frames area if at least a GNEFrame is showed
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog
Definition: GUIDesigns.h:253
FXScrollWindow * myScrollWindowsContents
scroll windows that holds the content frame
Definition: GNEFrame.h:117
FXFont * getFrameHeaderFont() const
get font of the header&#39;s frame
Definition: GNEFrame.cpp:135
FXHorizontalFrame * myHeaderFrame
fame for header elements
Definition: GNEFrame.h:107
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:123
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:95
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
Definition: GUIDesigns.h:241
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:281
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:104
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:244
#define GUIDesignContentsScrollWindow
design for the content frame of every frame
Definition: GUIDesigns.h:238
FXLabel * myFrameHeaderLabel
the label for the frame&#39;s header
Definition: GNEFrame.h:101
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:92
~GNEFrame()
destructor
Definition: GNEFrame.cpp:86
virtual void show()
show Frame
Definition: GNEFrame.cpp:98
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:107
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:144
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:110