2 #include "awindowgui.h"
7 #include "localsession.h"
8 #include "mainsession.h"
10 #include "mwindowgui.h"
12 #include "vwindowgui.h"
16 LabelEdit::LabelEdit(MWindow *mwindow, AWindow *awindow, VWindow *vwindow)
19 this->mwindow = mwindow;
20 this->awindow = awindow;
21 this->vwindow = vwindow;
25 LabelEdit::~LabelEdit()
29 void LabelEdit::edit_label(Label *label)
31 // Allow more than one window so we don't have to delete the clip in handle_event
45 LabelEditWindow *window = new LabelEditWindow(mwindow, this);
46 window->create_objects();
47 int result = window->run_window();
49 if (awindow) awindow->gui->async_update_assets();
59 LabelEditWindow::LabelEditWindow(MWindow *mwindow, LabelEdit *thread)
60 : BC_Window(PROGRAM_NAME ": Label Info",
61 mwindow->gui->get_abs_cursor_x(1) - 400 / 2,
62 mwindow->gui->get_abs_cursor_y(1) - 350 / 2,
71 this->mwindow = mwindow;
72 this->thread = thread;
75 LabelEditWindow::~LabelEditWindow()
80 void LabelEditWindow::create_objects()
82 this->label = thread->label;
90 add_subwindow(title = new BC_Title(x1, y, _("Label Text:")));
91 y += title->get_h() + 5;
92 add_subwindow(textbox = new LabelEditComments(this,
96 BC_TextBox::pixels_to_rows(this, MEDIUMFONT, get_h() - 10 - 40 - y)));
99 add_subwindow(new BC_OKButton(this));
100 add_subwindow(new BC_CancelButton(this));
110 LabelEditComments::LabelEditComments(LabelEditWindow *window, int x, int y, int w, int rows)
111 : BC_TextBox(x, y, w, rows, window->label->textstr)
113 this->window = window;
116 int LabelEditComments::handle_event()
118 strcpy(window->label->textstr, get_text());