7 #define _(String) gettext(String)
8 #define gettext_noop(String) String
9 #define N_(String) gettext_noop (String)
12 LoadModeItem::LoadModeItem(char *text, int value)
13 : BC_ListBoxItem(text)
19 LoadMode::LoadMode(MWindow *mwindow,
20 BC_WindowBase *window,
26 this->mwindow = mwindow;
27 this->window = window;
30 this->output = output;
31 this->use_nothing = use_nothing;
32 if(use_nothing) load_modes.append(new LoadModeItem(_("Insert nothing"), LOAD_NOTHING));
33 load_modes.append(new LoadModeItem(_("Replace current project"), LOAD_REPLACE));
34 load_modes.append(new LoadModeItem(_("Replace current project and concatenate tracks"), LOAD_REPLACE_CONCATENATE));
35 load_modes.append(new LoadModeItem(_("Append in new tracks"), LOAD_NEW_TRACKS));
36 load_modes.append(new LoadModeItem(_("Concatenate to existing tracks"), LOAD_CONCATENATE));
37 load_modes.append(new LoadModeItem(_("Paste at insertion point"), LOAD_PASTE));
38 load_modes.append(new LoadModeItem(_("Create new resources only"), LOAD_RESOURCESONLY));
46 for(int i = 0; i < load_modes.total; i++)
47 delete load_modes.values[i];
51 char* LoadMode::mode_to_text()
53 for(int i = 0; i < load_modes.total; i++)
55 if(load_modes.values[i]->value == *output)
56 return load_modes.values[i]->get_text();
61 int LoadMode::create_objects()
63 int x = this->x, y = this->y;
65 default_text = mode_to_text();
67 window->add_subwindow(title = new BC_Title(x, y, _("Insertion strategy:")));
69 window->add_subwindow(textbox = new BC_TextBox(x,
71 mwindow->theme->loadmode_w,
74 x += textbox->get_w();
75 window->add_subwindow(listbox = new LoadModeListBox(window, this, x, y));
80 int LoadMode::reposition_window(int x, int y)
82 title->reposition_window(x, y);
84 textbox->reposition_window(x, y);
85 x += textbox->get_w();
86 listbox->reposition_window(x,
88 mwindow->theme->loadmode_w);
93 LoadModeListBox::LoadModeListBox(BC_WindowBase *window,
99 loadmode->mwindow->theme->loadmode_w,
102 (ArrayList<BC_ListBoxItem *>*)&loadmode->load_modes,
109 this->window = window;
110 this->loadmode = loadmode;
113 LoadModeListBox::~LoadModeListBox()
117 int LoadModeListBox::handle_event()
119 //printf("LoadModeListBox::handle_event 1 %d\n", get_selection(0, 0));
120 if(get_selection(0, 0) >= 0)
122 //printf("LoadModeListBox::handle_event 2 %s\n", get_selection(0, 0)->get_text());
123 loadmode->textbox->update(get_selection(0, 0)->get_text());
124 *(loadmode->output) = ((LoadModeItem*)get_selection(0, 0))->value;