+ load_modes.remove_all_objects();
+ for( int i=0; i<TOTAL_LOADMODES; ++i ) delete mode[i];
+}
+
+const char *LoadMode::mode_to_text()
+{
+ for( int i=0; i<load_modes.total; ++i ) {
+ if( load_modes[i]->value == *output )
+ return load_modes[i]->get_text();
+ }
+ return _("Unknown");
+}
+
+void LoadMode::load_mode_geometry(BC_WindowBase *gui, Theme *theme,
+ int use_nothing, int use_nested, int line_wrap,
+ int *pw, int *ph)
+{
+ int pad = 5;
+ const char *title_text = _("Insertion strategy:");
+ int mw = BC_Title::calculate_w(gui, title_text);
+ int mh = BC_Title::calculate_h(gui, title_text);
+ int ix = mw + 2*pad, iy = 0, x1 = ix;
+ int ww = theme->loadmode_w + 24;
+ if( mw < ww ) mw = ww;
+
+ for( int i=0; i<TOTAL_LOADMODES; ++i ) {
+ if( i == LOADMODE_NOTHING && !use_nothing) continue;
+ if( i == LOADMODE_NESTED && !use_nested) continue;
+ int text_line, w, h, toggle_x, toggle_y;
+ int text_x, text_y, text_w, text_h;
+ BC_Toggle::calculate_extents(gui,
+ theme->get_image_set(mode_images[i]), 0,
+ &text_line, &w, &h, &toggle_x, &toggle_y,
+ &text_x, &text_y, &text_w, &text_h, 0, MEDIUMFONT);
+ if( line_wrap && ix+w > ww ) { ix = x1; iy += h+pad; }
+ if( (ix+=w) > mw ) mw = ix;
+ if( (h+=iy) > mh ) mh = h;
+ ix += pad;
+ }
+
+ ix = 0; iy = mh+pad;
+ mh = iy + BC_TextBox::calculate_h(gui, MEDIUMFONT, 1, 1);
+ if( pw ) *pw = mw;
+ if( ph ) *ph = mh;