X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Floadmode.C;h=76f30465909b969dc2987dcd4b90a79f1727996d;hp=3458f2905b07735ae156cae1a57f81dd4adc065f;hb=2e48b660e37eb5c661264d601211e16cb6cd6e89;hpb=7eab9fed092089a34fb4d4b2496283795235e62c diff --git a/cinelerra-5.1/cinelerra/loadmode.C b/cinelerra-5.1/cinelerra/loadmode.C index 3458f290..76f30465 100644 --- a/cinelerra-5.1/cinelerra/loadmode.C +++ b/cinelerra-5.1/cinelerra/loadmode.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "clip.h" @@ -47,7 +47,7 @@ LoadModeItem::LoadModeItem(const char *text, int value) } -LoadMode::LoadMode(MWindow *mwindow, BC_WindowBase *window, +LoadMode::LoadMode(MWindow *mwindow, BC_WindowBase *window, int x, int y, int *output, int use_nothing) { this->mwindow = mwindow; @@ -87,7 +87,7 @@ char* LoadMode::mode_to_text() { for(int i = 0; i < load_modes.total; i++) { - if(load_modes.values[i]->value == *output) + if(load_modes.values[i]->value == *output) return load_modes.values[i]->get_text(); } return _("Unknown"); @@ -101,7 +101,7 @@ int LoadMode::create_objects() window->add_subwindow(title = new BC_Title(x, y, _("Insertion strategy:"))); y += title->get_h(); - window->add_subwindow(textbox = new BC_TextBox(x, y, + window->add_subwindow(textbox = new BC_TextBox(x, y, mwindow->theme->loadmode_w, 1, default_text)); x += textbox->get_w(); window->add_subwindow(listbox = new LoadModeListBox(window, this, x, y)); @@ -135,16 +135,16 @@ int LoadMode::reposition_window(int x, int y) y += 20; textbox->reposition_window(x, y); x += textbox->get_w(); - listbox->reposition_window(x, - y, + listbox->reposition_window(x, + y, mwindow->theme->loadmode_w); return 0; } -LoadModeListBox::LoadModeListBox(BC_WindowBase *window, - LoadMode *loadmode, - int x, +LoadModeListBox::LoadModeListBox(BC_WindowBase *window, + LoadMode *loadmode, + int x, int y) : BC_ListBox(x, y, @@ -168,10 +168,10 @@ LoadModeListBox::~LoadModeListBox() int LoadModeListBox::handle_event() { - if(get_selection(0, 0) >= 0) - { - loadmode->textbox->update(get_selection(0, 0)->get_text()); - *(loadmode->output) = ((LoadModeItem*)get_selection(0, 0))->value; + LoadModeItem *item = (LoadModeItem *)get_selection(0, 0); + if( item ) { + loadmode->textbox->update(item->get_text()); + *(loadmode->output) = item->value; } return 1; }