static WORD do_deskmenu(WORD item) { WORD done, touchob; OBJECT *tree, *obj; done = FALSE; switch(item) { case ABOUITEM: display_free_stack(); tree = G.a_trees[ADDINFO]; /* draw the form */ show_hide(FMD_START, tree); while(!done) { touchob = form_do(tree, 0); touchob &= 0x7fff; if (touchob == DEICON) { #if CONF_WITH_EASTER_EGG int i; for (i = 0; i < 23; i++) { sound(TRUE, freq[i], dura[i]); evnt_timer(dura[i]*64, 0); } #endif } else done = TRUE; } obj = tree + DEOK; obj->ob_state = NORMAL; show_hide(FMD_FINISH, tree); done = FALSE; break; } return done; }
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: ustaw((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 1: show_hide((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break; case 2: on_pushButton_clicked(); break; case 3: stop(); break; case 4: showInfo((*reinterpret_cast< MessageObject*(*)>(_a[1]))); break; default: ; } _id -= 5; } return _id; }
WORD insa_dial(LONG tree, WORD nicon, WORD numics) { WORD firstslot, nstate, ystate, i; WORD touchob, oicon, value; WORD mx, my, kret, bret, cont; BYTE *pstr, doctype[4]; GRECT pt; /* draw the form */ show_hide(FMD_START, tree); /* init for while loop by forcing initial fs_newdir call */ cont = TRUE; while ( cont ) { firstslot = 6; for (i = 0; i < firstslot; i++) { pstr = &doctype[0]; inf_sget(tree, APDFTYPE+i, pstr); if (*pstr == '\0') firstslot = i; } touchob = form_do((OBJECT FAR *)tree, APDFTYPE+firstslot); graf_mkstate(&mx, &my, &kret, &bret); value = nstate = ystate = 0; touchob &= 0x7fff; switch ( touchob ) { case APINST: case APREMV: case APCNCL: cont = FALSE; break; case APFUPARO: value = -1; break; case APFDNARO: value = 1; break; case APGEM: nstate = SELECTED; ystate = DISABLED; break; case APDOS: case APPARMS: nstate = LWGET(OB_STATE(APNMEM)); ystate = LWGET(OB_STATE(APYMEM)); if ( ystate == DISABLED ) { nstate = SELECTED; ystate = NORMAL; } break; case APFSVSLI: ob_actxywh(tree, APFSVELE, &pt); pt.g_x -= 3; pt.g_w += 6; if ( rc_inside(&pt, mx, my) ) goto dofelev; value = (my <= pt.g_y) ? -1 : 1; break; case APFSVELE: dofelev: wind_update(3); ob_relxywh(tree, APFSVSLI, &pt); pt.g_x += 3; pt.g_w -= 6; LWSET(OB_X(APFSVSLI), pt.g_x); LWSET(OB_WIDTH(APFSVSLI), pt.g_w); value = graf_slidebox((OBJECT FAR *)tree, APFSVSLI, APFSVELE, TRUE); pt.g_x -= 3; pt.g_w += 6; LWSET(OB_X(APFSVSLI), pt.g_x); LWSET(OB_WIDTH(APFSVSLI), pt.g_w); wind_update(2); #if M68000 value = (WORD)((LONG)value * (LONG)(numics-1) / 1000) - nicon; #else value = mul_div(value, numics-1, 1000) - nicon; #endif break; } if (nstate != ystate) { LWSET(OB_STATE(APNMEM), nstate); LWSET(OB_STATE(APYMEM), ystate); draw_fld(tree, APMEMBOX); } if (value) { oicon = nicon; nicon += value; if (nicon < 0) nicon = 0; if (nicon >= numics) nicon = numics - 1; if (oicon != nicon) { insa_elev(tree, nicon, numics); draw_fld(tree, APFTITLE); draw_fld(tree, APFSVSLI); draw_fld(tree, APFILEBO); } } } /* undraw the form */ show_hide(FMD_FINISH, tree); return(nicon); }
/* * Routine that creates a new directory in the specified window/path */ WORD fun_mkdir(WNODE *pw_node) { PNODE *pp_node; OBJECT *tree; WORD i, len, err; BYTE fnew_name[LEN_ZFNAME], unew_name[LEN_ZFNAME], *ptmp; BYTE path[MAXPATHLEN]; tree = G.a_trees[ADMKDBOX]; pp_node = pw_node->w_path; ptmp = path; strcpy(ptmp, pp_node->p_spec); i = 0; while (*ptmp++) { if (*ptmp == '\\') i++; } if (i > MAX_LEVEL) { fun_alert(1, STFO8DEE); return FALSE; } while(1) { fnew_name[0] = '\0'; inf_sset(tree, MKNAME, fnew_name); show_hide(FMD_START, tree); form_do(tree, 0); if (inf_what(tree, MKOK, MKCNCL) == 0) break; inf_sget(tree, MKNAME, fnew_name); unfmt_str(fnew_name, unew_name); if (unew_name[0] == '\0') break; ptmp = add_fname(path, unew_name); err = dos_mkdir(path); if (err == 0) /* mkdir succeeded */ { fun_rebld(pw_node); break; } /* * if we're getting a BIOS (rather than GEMDOS) error, the * critical error handler has already issued a message, so * just quit */ if (IS_BIOS_ERROR(err)) break; len = strlen(path); /* before we restore old path */ restore_path(ptmp); /* restore original path */ if (len >= LEN_ZPATH-3) { fun_alert(1,STDEEPPA); break; } /* * mkdir failed with a recoverable error: * prompt for Cancel or Retry */ if (fun_alert(2,STFOFAIL) == 1) /* Cancel */ break; } show_hide(FMD_FINISH, tree); return TRUE; }