Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MFXMenuCheckIcon.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2004-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18//
19/****************************************************************************/
20
21#pragma once
22#include <config.h>
23
24
25#include "fxheader.h"
26#include <string>
27
36class MFXMenuCheckIcon : public FXMenuCommand {
38 FXDECLARE(MFXMenuCheckIcon)
39
40public:
42 MFXMenuCheckIcon(FXComposite* p, const std::string& text, const std::string& shortcut, const std::string& info, const FXIcon* icon, FXObject* tgt = NULL, FXSelector sel = 0, FXuint opts = 0);
43
45 virtual FXint getDefaultWidth();
46
48 virtual FXint getDefaultHeight();
49
51 void setCheck(FXbool s = TRUE);
52
54 FXbool getCheck() const;
55
57 FXColor getBoxColor() const;
58
60 void setBoxColor(FXColor clr);
61
63 virtual void save(FXStream& store) const;
64
66 virtual void load(FXStream& store);
67
70 long onPaint(FXObject*, FXSelector, void*);
71 long onButtonPress(FXObject*, FXSelector, void*);
72 long onButtonRelease(FXObject*, FXSelector, void*);
73 long onKeyPress(FXObject*, FXSelector, void*);
74 long onKeyRelease(FXObject*, FXSelector, void*);
75 long onHotKeyPress(FXObject*, FXSelector, void*);
76 long onHotKeyRelease(FXObject*, FXSelector, void*);
77 long onCheck(FXObject*, FXSelector, void*);
78 long onUncheck(FXObject*, FXSelector, void*);
79 long onUnknown(FXObject*, FXSelector, void*);
80 long onCmdSetValue(FXObject*, FXSelector, void*);
81 long onCmdSetIntValue(FXObject*, FXSelector, void*);
82 long onCmdGetIntValue(FXObject*, FXSelector, void*);
83 long onCmdAccel(FXObject*, FXSelector, void*);
85
86protected:
89
91 const FXIcon* myIcon;
92
94 FXuchar myCheck;
95
97 FXColor myBoxColor;
98
99private:
102
105};
long onHotKeyPress(FXObject *, FXSelector, void *)
long onUnknown(FXObject *, FXSelector, void *)
long onKeyRelease(FXObject *, FXSelector, void *)
void setBoxColor(FXColor clr)
Set the box background color.
virtual void load(FXStream &store)
Load menu from a stream.
MFXMenuCheckIcon()
default constructor
long onCheck(FXObject *, FXSelector, void *)
long onCmdSetIntValue(FXObject *, FXSelector, void *)
virtual FXint getDefaultWidth()
Return default width.
long onHotKeyRelease(FXObject *, FXSelector, void *)
FXColor myBoxColor
Box color.
long onCmdAccel(FXObject *, FXSelector, void *)
long onButtonPress(FXObject *, FXSelector, void *)
const FXIcon * myIcon
Icon.
long onCmdSetValue(FXObject *, FXSelector, void *)
FXColor getBoxColor() const
Get the box background color.
MFXMenuCheckIcon(const MFXMenuCheckIcon &)=delete
Invalidated copy constructor.
FXuchar myCheck
State of menu.
long onUncheck(FXObject *, FXSelector, void *)
long onKeyPress(FXObject *, FXSelector, void *)
long onPaint(FXObject *, FXSelector, void *)
virtual void save(FXStream &store) const
Save menu to a stream.
MFXMenuCheckIcon & operator=(const MFXMenuCheckIcon &)=delete
Invalidated assignment operator.
FXbool getCheck() const
Get check state (TRUE, FALSE or MAYBE)
long onCmdGetIntValue(FXObject *, FXSelector, void *)
virtual FXint getDefaultHeight()
Return default height.
long onButtonRelease(FXObject *, FXSelector, void *)
void setCheck(FXbool s=TRUE)
Set check state (TRUE, FALSE or MAYBE)