void start_aktion(char *str, bool inter, long max) { int d; GRECT r1, r2; if (aktion == NULL) { rsrc_gaddr(R_TREE, AKTION, &aktion); fix_dial(aktion); } max_value = max(max, 1); set_string(aktion, ATEXT, str); aktion[ABOX2].ob_width = 1; set_flag(aktion, AESC, HIDETREE, !inter); interupt = inter; /* Zentrieren, nur beim ersten Mal */ if (aktion[0].ob_x == 0 && aktion[0].ob_y == 0) form_center(aktion, &d, &d, &d, &d); r1.g_x = aktion[0].ob_x; r1.g_y = aktion[0].ob_y; r1.g_w = aktion[0].ob_width; r1.g_h = aktion[0].ob_height; wind_calc_grect(WC_BORDER, (NAME|MOVER|BACKDROP), &r1, &r2); akt_handle = wind_create_grect((NAME|MOVER|BACKDROP), &r1); if (akt_handle > 0) { /* Men� abschalten */ disable_menu(); wind_set_str(akt_handle, WF_NAME, " qed "); wind_open_grect(akt_handle, &r2); } }
void open_settings(void) { if (h_aes_win == 0) { GRECT curr, area; struct gemtk_wm_scroll_info_s *slid; uint32_t kind = CLOSER | NAME | MOVER | VSLIDE | HSLIDE | UPARROW | DNARROW | LFARROW | RTARROW | SIZER | FULLER; dlgtree = gemtk_obj_get_tree(SETTINGS); area.g_x = area.g_y = 0; area.g_w = MIN(dlgtree->ob_width, desk_area.g_w); area.g_h = MIN(dlgtree->ob_height, desk_area.g_h); wind_calc_grect(WC_BORDER, kind, &area, &area); h_aes_win = wind_create_grect(kind, &area); wind_set_str(h_aes_win, WF_NAME, "Settings"); settings_guiwin = gemtk_wm_add(h_aes_win, GEMTK_WM_FLAG_DEFAULTS, on_aes_event); curr.g_w = MIN(dlgtree->ob_width, desk_area.g_w); curr.g_h = MIN(dlgtree->ob_height, desk_area.g_h-64); curr.g_x = 1; curr.g_y = (desk_area.g_h / 2) - (curr.g_h / 2); wind_calc_grect(WC_BORDER, kind, &curr, &curr); dlgtree->ob_x = curr.g_x; dlgtree->ob_y = curr.g_y; /* set current config values: */ display_settings(); wind_open_grect(h_aes_win, &curr); gemtk_wm_set_form(settings_guiwin, dlgtree, 0); gemtk_wm_set_scroll_grid(settings_guiwin, 32, 32); gemtk_wm_get_grect(settings_guiwin, GEMTK_WM_AREA_CONTENT, &area); slid = gemtk_wm_get_scroll_info(settings_guiwin); gemtk_wm_set_content_units(settings_guiwin, (dlgtree->ob_width/slid->x_unit_px), (dlgtree->ob_height/slid->y_unit_px)); gemtk_wm_update_slider(settings_guiwin, GEMTK_WM_VH_SLIDER); } }