Eclipse SUMO - Simulation of Urban MObility
MFXIconComboBox.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2006-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 //
16 /****************************************************************************/
17 
18 #ifndef MFXIconComboBox_h
19 #define MFXIconComboBox_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <fx.h>
28 
29 
33 class MFXListItem : public FXListItem {
34  FXDECLARE(MFXListItem)
35 
36 public:
38  MFXListItem(const FXString& text, FXIcon* ic, FXColor _bgColor, void* ptr = NULL):
39  FXListItem(text, ic, ptr),
40  bgColor(_bgColor) {}
41  FXColor bgColor;
42 
43 
44  void draw(const FXList* list, FXDC& dc, FXint x, FXint y, FXint w, FXint h);
45 
46 protected:
47  MFXListItem(): FXListItem("", nullptr) {}
48 
49 };
50 
54 class MFXIconComboBox : public FXComboBox {
55 protected:
56  // FOX stuff
57  FXDECLARE(MFXIconComboBox)
59 public:
60 
62  MFXIconComboBox(FXComposite* p, FXint cols, FXObject* tgt = nullptr, FXSelector sel = 0, FXuint opts = COMBOBOX_NORMAL, FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0, FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD);
63 
65  virtual ~MFXIconComboBox() {};
66 
67  FXint appendIconItem(const FXString& text, FXIcon* icon, FXColor bgColor = FXRGBA(0, 0, 0, 0), void* ptr = NULL);
68 
69 };
70 
71 
72 
73 
74 #endif
MFXListItem(const FXString &text, FXIcon *ic, FXColor _bgColor, void *ptr=NULL)
Construct new item with given text, icon, and user-data.
virtual ~MFXIconComboBox()
Destructor.
FXColor bgColor
void draw(const FXList *list, FXDC &dc, FXint x, FXint y, FXint w, FXint h)