Eclipse SUMO - Simulation of Urban MObility
GUICursorSubSys.cpp
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3
// Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials
5
// are made available under the terms of the Eclipse Public License v2.0
6
// which accompanies this distribution, and is available at
7
// http://www.eclipse.org/legal/epl-v20.html
8
// SPDX-License-Identifier: EPL-2.0
9
/****************************************************************************/
15
// Helper for cursors loading and usage
16
/****************************************************************************/
17
18
19
// ===========================================================================
20
// included modules
21
// ===========================================================================
22
#include <
config.h
>
23
24
#include <fx.h>
25
#include <cassert>
26
#include "
GUICursors.h
"
27
#include "
GUICursorSubSys.h
"
28
31
// ===========================================================================
32
// static member variable definitions
33
// ===========================================================================
34
35
GUICursorSubSys
*
GUICursorSubSys::myInstance
=
nullptr
;
36
37
// ===========================================================================
38
// member definitions
39
// ===========================================================================
40
41
GUICursorSubSys::GUICursorSubSys
(FXApp* a) {
42
// already created cursor
43
myCursors
[
SUMOCURSOR_DEFAULT
] = a->getDefaultCursor(DEF_ARROW_CURSOR);
44
myCursors
[
SUMOCURSOR_MOVE
] = a->getDefaultCursor(DEF_MOVE_CURSOR);
45
46
/*
47
myCursors[CURSOR_SUMO] = new FXXPMCursor(a, sumo_icon64_xpm);
48
49
// ... and create them
50
for (int i = 0; i < CURSOR_MAX; i++) {
51
if (myCursors[i] != nullptr) {
52
myCursors[i]->create();
53
}
54
}
55
*/
56
}
57
58
59
GUICursorSubSys::~GUICursorSubSys
() {
60
/*
61
for (int i = 0; i < CURSOR_MAX; i++) {
62
delete myCursors[i];
63
}
64
*/
65
}
66
67
68
void
69
GUICursorSubSys::initCursors
(FXApp* a) {
70
assert(
myInstance
== 0);
71
myInstance
=
new
GUICursorSubSys
(a);
72
}
73
74
75
FXCursor*
76
GUICursorSubSys::getCursor
(
GUICursor
which) {
77
return
myInstance
->
myCursors
[which];
78
}
79
80
81
void
82
GUICursorSubSys::close
() {
83
delete
myInstance
;
84
myInstance
=
nullptr
;
85
}
86
87
88
/****************************************************************************/
89
GUICursorSubSys.h
GUICursorSubSys::myInstance
static GUICursorSubSys * myInstance
instance of GUICursorSubSys
Definition:
GUICursorSubSys.h:56
GUICursorSubSys::initCursors
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
Definition:
GUICursorSubSys.cpp:69
GUICursorSubSys::getCursor
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
Definition:
GUICursorSubSys.cpp:76
GUICursorSubSys::~GUICursorSubSys
~GUICursorSubSys()
destructor
Definition:
GUICursorSubSys.cpp:59
GUICursors.h
GUICursor
GUICursor
An enumeration of cursors used by the gui applications.
Definition:
GUICursors.h:34
SUMOCURSOR_DEFAULT
default cursor
Definition:
GUICursors.h:36
SUMOCURSOR_MOVE
move cursor
Definition:
GUICursors.h:39
GUICursorSubSys::close
static void close()
close GUICursorSubSys
Definition:
GUICursorSubSys.cpp:82
GUICursorSubSys::myCursors
FXCursor * myCursors[CURSOR_MAX]
vector with the icons
Definition:
GUICursorSubSys.h:59
GUICursorSubSys::GUICursorSubSys
GUICursorSubSys(FXApp *a)
constructor is private because is called by the static function init(FXApp* a)
Definition:
GUICursorSubSys.cpp:41
config.h
GUICursorSubSys
Definition:
GUICursorSubSys.h:33
src
utils
gui
cursors
GUICursorSubSys.cpp
Generated on Wed Jan 15 2020 15:04:13 for Eclipse SUMO - Simulation of Urban MObility by
1.8.16