widget texmacs_window_widget (widget wid, tree geom) { int W, H; int w= geometry_w, h= geometry_h; int x= geometry_x, y= geometry_y; bool custom= is_tuple (geom) && N (geom) >= 2; #ifndef QTTEXMACS if (use_side_tools) { w += 200; h += 100; } #endif if (custom) { w= as_int (geom[0]); h= as_int (geom[1]); } gui_root_extents (W, H); W /= PIXEL; H /= PIXEL; if (x < 0) x= W + x + 1 - w; if (y < 0) y= H + y + 1 - h; string name= "TeXmacs"; name= unique_window_name (name); widget win= plain_window_widget (wid, name); SI xx= x * PIXEL, yy= -y * PIXEL; SI ww= w * PIXEL, hh= h * PIXEL; if (!custom) { get_preferred_position (name, xx, yy); get_preferred_size (name, ww, hh); } set_size (win, ww, hh); set_position (win, xx, yy); return win; }
void window_create (int win, widget wid, string name, bool plain) { widget pww; if (plain) pww= plain_window_widget (wid, name); else pww= popup_window_widget (wid, name); window_table (win)= pww; }
void tm_frame_rep::dialogue_start (string name, widget wid) { if (is_nil (dialogue_win)) { string lan= get_output_language (); if (lan == "russian") lan= "english"; name= translate (name, "english", lan); dialogue_wid= wid; dialogue_win= plain_window_widget (dialogue_wid, name); widget win= concrete_window () -> win; SI ox, oy, dx, dy, ex= 0, ey= 0; get_position (win, ox, oy); get_size (win, dx, dy); get_size (dialogue_win, ex, ey); ox += (dx - ex) >> 1; oy -= (dy - ey) >> 1; set_position (dialogue_win, ox, oy); set_visibility (dialogue_win, true); } }
void window_create (int win, widget wid, string name, command quit) { widget pww; pww= plain_window_widget (wid, name, quit); window_table (win)= pww; }