46 #ifdef CHECK_MEMORY_LEAKS
48 #endif // CHECK_MEMORY_LEAKS
72 const FXString& title,
74 const std::vector<
GUIGlID>& ids,
76 FXMainWindow(parent->getApp(), title, icon, NULL, DECOR_ALL, 20, 20, 300, 300),
81 FXVerticalFrame* layout1 =
new FXVerticalFrame(hbox, LAYOUT_FILL_X | LAYOUT_FILL_Y | LAYOUT_TOP, 0, 0, 0, 0, 4, 4, 4, 4);
83 FXVerticalFrame* style1 =
new FXVerticalFrame(layout1, LAYOUT_FILL_X | LAYOUT_FILL_Y | LAYOUT_TOP | FRAME_THICK | FRAME_SUNKEN, 0, 0, 0, 0, 0, 0, 0, 0);
84 myList =
new FXList(style1,
this,
MID_CHOOSER_LIST, LAYOUT_FILL_X | LAYOUT_FILL_Y | LIST_SINGLESELECT | FRAME_SUNKEN | FRAME_THICK);
85 for (std::vector<GUIGlID>::const_iterator i = ids.begin(); i != ids.end(); ++i) {
91 bool selected = myParent->isSelected(o);
94 myList->appendItem(name.c_str(), icon, (
void*) & (*myIDs.find(o->
getGlID())));
95 glStorage.unblockObject(*i);
98 FXVerticalFrame* layout =
new FXVerticalFrame(hbox, LAYOUT_TOP, 0, 0, 0, 0, 4, 4, 4, 4);
100 this,
MID_CHOOSER_CENTER, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED,
101 0, 0, 0, 0, 4, 4, 4, 4);
102 new FXHorizontalSeparator(layout, SEPARATOR_GROOVE | LAYOUT_FILL_X);
104 this,
MID_CHOOSER_FILTER, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED,
105 0, 0, 0, 0, 4, 4, 4, 4);
106 new FXHorizontalSeparator(layout, SEPARATOR_GROOVE | LAYOUT_FILL_X);
108 this,
MID_CANCEL, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED,
109 0, 0, 0, 0, 4, 4, 4, 4);
111 myParent->getParent()->addChild(
this);
112 myTextEntry->setFocus();
123 int selected =
myList->getCurrentItem();
145 myList->makeItemVisible(
id);
147 myList->setCurrentItem(
id,
true);
154 int current =
myList->getCurrentItem();
155 if (current >= 0 &&
myList->isItemSelected(current)) {
165 FXEvent*
event = (FXEvent*)ptr;
166 switch (event->code) {
180 std::vector<GUIGlID> selectedGlIDs;
181 std::vector<FXString> selectedMicrosimIDs;
182 const int numItems =
myList->getNumItems();
183 for (
int i = 0; i < numItems; i++) {
186 selectedGlIDs.push_back(glID);
187 selectedMicrosimIDs.push_back(
myList->getItemText(i));
191 const int numSelected = (
const int)selectedGlIDs.size();
192 for (
int i = 0; i < numSelected; i++) {
193 myList->appendItem(selectedMicrosimIDs[i], flag, (
void*) & (*
myIDs.find(selectedGlIDs[i])));