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 #ifdef HAVE_VERSION_H
31 #include <version.h>
32 #endif
33 
34 #include <iostream>
44 
45 #include "GNEFrame.h"
46 #include "GNEViewParent.h"
47 #include "GNEViewNet.h"
48 
49 #ifdef CHECK_MEMORY_LEAKS
50 #include <foreign/nvwa/debug_new.h>
51 #endif // CHECK_MEMORY_LEAKS
52 
53 // ===========================================================================
54 // method definitions
55 // ===========================================================================
56 
57 GNEFrame::GNEFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet, const std::string& frameLabel) :
58  FXVerticalFrame(horizontalFrameParent, GUIDesignFrame),
59  myViewNet(viewNet) {
60  // Create font
61  myFrameHeaderFont = new FXFont(getApp(), "Arial", 14, FXFont::Bold),
62 
63  // Create frame for header
64  myHeaderFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame);
65 
66  // Create frame for left elements of header (By default unused)
68  myHeaderLeftFrame->hide();
69 
70  // Create titel frame
71  myFrameHeaderLabel = new FXLabel(myHeaderFrame, frameLabel.c_str(), 0, GUIDesignLabelLeft);
72 
73  // Create frame for right elements of header (By default unused)
75  myHeaderRightFrame->hide();
76 
77  // Add separator
78  new FXHorizontalSeparator(this, GUIDesignHorizontalSeparator);
79 
80  // Create frame for contents
81  myScrollWindowsContents = new FXScrollWindow(this, GUIDesignContentsScrollWindow);
82 
83  // Create frame for contents
85 
86  // Set font of header
88 
89  // Hide Frame
90  FXVerticalFrame::hide();
91 }
92 
93 
95  delete myFrameHeaderFont;
96 }
97 
98 
99 void
101  // show scroll window
102  FXVerticalFrame::show();
103  // Show and update Frame Area in which this GNEFrame is placed
105 }
106 
107 
108 void
110  // hide scroll window
111  FXVerticalFrame::hide();
112  // Hide Frame Area in which this GNEFrame is placed
114 }
115 
116 
117 void
119  setWidth(width);
120  myScrollWindowsContents->setWidth(width);
121 }
122 
123 
124 GNEViewNet*
126  return myViewNet;
127 }
128 
129 
130 FXLabel*
132  return myFrameHeaderLabel;
133 }
134 
135 
136 FXFont*
138  return myFrameHeaderFont;
139 }
140 
141 
142 /****************************************************************************/
GNEFrame()
FOX needs this.
Definition: GNEFrame.h:89
#define GUIDesignHorizontalFrame
Definition: GUIDesigns.h:186
void hideFramesArea()
hide frames area if all GNEFrames are hidden
void setFrameWidth(int width)
set width of GNEFrame
Definition: GNEFrame.cpp:118
FXFont * myFrameHeaderFont
Font for the Header.
Definition: GNEFrame.h:95
FXHorizontalFrame * myHeaderRightFrame
fame for right header elements
Definition: GNEFrame.h:110
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:235
FXScrollWindow * myScrollWindowsContents
scroll windows that holds the content frame
Definition: GNEFrame.h:114
FXHorizontalFrame * myHeaderFrame
fame for header elements
Definition: GNEFrame.h:104
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:983
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:92
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:266
#define GUIDesignFrame
design for all frames
Definition: GUIDesigns.h:238
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:101
#define GUIDesignContentsScrollWindow
design for the content frame of every frame
Definition: GUIDesigns.h:220
FXLabel * myFrameHeaderLabel
the label for the frame&#39;s header
Definition: GNEFrame.h:98
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:125
~GNEFrame()
destructor
Definition: GNEFrame.cpp:94
virtual void show()
show Frame
Definition: GNEFrame.cpp:100
FXLabel * getFrameHeaderLabel() const
get the label for the frame&#39;s header
Definition: GNEFrame.cpp:131
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:109
FXFont * getFrameHeaderFont() const
get font of the header&#39;s frame
Definition: GNEFrame.cpp:137
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:139
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:107