54 FXIMPLEMENT(
GUIDialog_GLObjChooser, FXMainWindow, GUIDialog_GLObjChooserMap, ARRAYNUMBER(GUIDialog_GLObjChooserMap))
79 myParent->getParent()->addChild(
this);
100 int selected =
myList->getCurrentItem();
119 if (
myList->getNumItems() > 0) {
126 myList->makeItemVisible(
id);
128 myList->setCurrentItem(
id,
true);
136 int current =
myList->getCurrentItem();
137 if (current >= 0 &&
myList->isItemSelected(current)) {
147 FXEvent*
event = (FXEvent*)ptr;
148 switch (event->code) {
162 std::vector<GUIGlID> selectedGlIDs;
163 const int numItems =
myList->getNumItems();
164 for (
int i = 0; i < numItems; i++) {
167 selectedGlIDs.push_back(glID);
201 int i =
myList->getCurrentItem();
205 myList->setItemIcon(i,
nullptr);
207 myList->setItemIcon(i, flag);
void show()
sets the focus after the window is created to work-around bug in libfox
GUISUMOAbstractView * getView() const
long onCmdFilter(FXObject *, FXSelector, void *)
Callback: Hides unselected items if pressed.
void toggleSelection(GUIGlID id)
Toggles selection of an object.
#define GUIDesignChooserDialog
virtual void toggleSelection(int listIndex)
toggle selection (handled differently in NETEDIT)
virtual ~GUIDialog_GLObjChooser()
Destructor.
long onCmdCenter(FXObject *, FXSelector, void *)
Callback: The selected item shall be centered within the calling view.
FXDEFMAP(GUIDialog_GLObjChooser) GUIDialog_GLObjChooserMap[]
long onCmdText(FXObject *, FXSelector, void *)
Callback: Selects to current item if enter is pressed.
long onCmdToggleSelection(FXObject *, FXSelector, void *)
Callback: Toggle selection status of current object.
const unsigned char flag[]
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
#define GUIDesignHorizontalSeparator
#define GUIDesignChooserLayoutList
design for Chooser Layout list
GUIMainWindow * getParent()
Returns the main window.
virtual std::string getObjectName(GUIGlObject *o) const
retrieve name for the given object
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
FXList * myList
The list that holds the ids.
#define GUIDesignChooserLayoutLeft
design for Chooser Layout left
GUIGlChildWindow * myParent
The parent window.
#define GUIDesignChooserButtons
design for Chooser buttons
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
A storage for of displayed objects via their numerical id.
void refreshList(const std::vector< GUIGlID > &ids)
update the list with the given ids
#define GUIDesignChooserLayoutRight
design for Chooser Layout right
long onCmdClose(FXObject *, FXSelector, void *)
Callback: The dialog shall be closed.
void setView(GUIGlID id)
Centers the view onto the given artifact.
void removeChild(FXMainWindow *child)
#define GUIDesignChooserTextField
design for Chooser TextField
GUIGlID getGlID() const
Returns the numerical id of the object.
FXButton * myCenterButton
The button that triggers centering on the select object.
virtual bool isSelected(GUIGlObject *o) const
true if the object is selected (may include extra logic besides calling gSelected) ...
std::set< GUIGlID > myIDs
myList contains (void) pointers to elements of myIDs instead of the more
void unblockObject(GUIGlID id)
Marks an object as unblocked.
#define GUIDesignChooserListSingle
design for Chooser List
long onListKeyPress(FXObject *, FXSelector, void *)
Callback: Selects to current item if enter is pressed.
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
GUISelectedStorage gSelected
A global holder of selected objects.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXTextField * myTextEntry
The text field.
long onChgText(FXObject *, FXSelector, void *)
Callback: Something has been typed into the the field.