+
+CreateBD_FormatItem::CreateBD_FormatItem(CreateBD_Format *popup,
+ int standard, const char *name)
+ : BC_MenuItem(name)
+{
+ this->popup = popup;
+ this->standard = standard;
+}
+
+CreateBD_FormatItem::~CreateBD_FormatItem()
+{
+}
+
+int CreateBD_FormatItem::handle_event()
+{
+ const char *text = get_text();
+ int standard = this->standard;
+ if( standard < 0 ) {
+ BC_SubMenu *submenu = get_submenu();
+ CreateBD_FormatItem *sub_item0 =
+ (CreateBD_FormatItem *)submenu->get_item(0);
+ standard = sub_item0->standard;
+ text = sub_item0->get_text();
+ }
+ popup->gui->thread->use_standard = standard;
+ popup->set_text(text);
+ int n = strlen(text)-1;
+ int not_standard = n >= 0 && text[n] == '*' ? 1 : 0;
+ popup->gui->non_standard->update(not_standard ? _("* non-standard format") : "", 0);
+ return popup->handle_event();
+}
+
+
+CreateBD_Format::CreateBD_Format(CreateBD_GUI *gui, int x, int y)
+ : BC_PopupMenu(x, y, 180, bd_formats[gui->thread->use_standard].name, 1)
+{
+ this->gui = gui;
+}
+
+CreateBD_Format::~CreateBD_Format()
+{
+}
+
+void CreateBD_Format::create_objects()
+{
+ BC_SubMenu *submenu = 0;
+ CreateBD_FormatItem *item = 0;
+ int ww = 0, hh = 0;
+ for( int i=0; i<(int)(sizeof(bd_formats)/sizeof(bd_formats[0])); ++i ) {
+ if( ww != bd_formats[i].w || hh != bd_formats[i].h ) {
+ ww = bd_formats[i].w; hh = bd_formats[i].h;
+ char string[BCSTRLEN];
+ sprintf(string, "%dx%d", ww,hh);
+ add_item(item = new CreateBD_FormatItem(this, -1, string));
+ item->add_submenu(submenu = new BC_SubMenu());
+ }
+ submenu->add_submenuitem(new CreateBD_FormatItem(this, i, bd_formats[i].name));
+ }
+}
+
+int CreateBD_Format::handle_event()
+{
+ gui->thread->option_presets();
+ gui->update();
+ return 1;
+}
+
+
+CreateBD_ScaleItem::CreateBD_ScaleItem(CreateBD_Scale *popup,
+ int scale, const char *text)
+ : BC_MenuItem(text)
+{
+ this->popup = popup;
+ this->scale = scale;
+}
+
+CreateBD_ScaleItem::~CreateBD_ScaleItem()
+{
+}
+
+int CreateBD_ScaleItem::handle_event()
+{
+ popup->gui->thread->use_scale = scale;
+ popup->set_value(scale);
+ return popup->handle_event();
+}
+
+
+CreateBD_Scale::CreateBD_Scale(CreateBD_GUI *gui, int x, int y)
+ : BC_PopupMenu(x, y, 100, "", 1)
+{
+ this->gui = gui;
+}
+
+CreateBD_Scale::~CreateBD_Scale()
+{
+}
+
+void CreateBD_Scale::create_objects()
+{
+
+ for( int i=0; i<(int)Rescale::n_scale_types; ++i ) {
+ add_item(new CreateBD_ScaleItem(this, i, Rescale::scale_types[i]));
+ }
+ set_value(gui->thread->use_scale);
+}
+
+int CreateBD_Scale::handle_event()
+{
+ gui->update();
+ return 1;
+}
+
+
+CreateBD_MediaSize::CreateBD_MediaSize(CreateBD_GUI *gui, int x, int y)
+ : BC_PopupTextBox(gui, 0, 0, x, y, 70,50)
+{
+ this->gui = gui;
+}
+
+CreateBD_MediaSize::~CreateBD_MediaSize()
+{
+}
+
+int CreateBD_MediaSize::handle_event()
+{
+ gui->disk_space->update();
+ return 1;
+}
+