int d_abitmap_radio_proc (int msg, DIALOG *d, int c) { if (msg == MSG_DRAW) { int b = d->flags & D_SELECTED ? B_RADIO_DOWN : B_RADIO; int bi = d->flags & D_SELECTED ? B_RADIO_ITEM_DOWN : B_RADIO_ITEM; abitmap_draw_box (d, b); abitmap_draw_area (d, bi, 0, 0, 12, 12, 0, 1); abitmap_draw_text (d, b, 14, 0, 0, 0, 1); return D_O_K; } return d_radio_proc (msg, d, c); }
/* d1 used for group number. */ int d_agtk_radio_proc(int msg, DIALOG *d, int c) { if (msg == MSG_DRAW) { BITMAP *bmp = gui_get_screen(); draw_base(bmp, d); draw_sprite(bmp, (d->flags & D_SELECTED) ? radio_down_bmp : radio_up_bmp, d->x+3, d->y+d->h/2-5); if (d->dp) { gui_textout_ex(bmp, (char *)d->dp, d->x+18, d->y+d->h/2-text_height(font)/2, (d->flags & D_DISABLED) ? nshadow : black, -1, FALSE); } return D_O_K; } return d_radio_proc(msg, d, c); }
int d_aase_radio_proc(int msg, DIALOG *d, int c) { if (msg == MSG_DRAW) { int y = d->y+d->h/2, rtm; int size = 12; ase_rectbox(screen, d->x, y-size/2, d->x+size-1, y-size/2+size-1, d->flags); rtm = text_mode(-1); gui_textout(screen, (char *)d->dp, d->x+size+4, y-text_height(font)/2, ((d->flags & D_DISABLED)? makecol(128, 128, 128): makecol(0, 0, 0)), FALSE); text_mode(rtm); return D_O_K; } return d_radio_proc(msg, d, c); }
/* d1 used for group number. */ int d_aphoton_radio_proc(int msg, DIALOG *d, int c) { if (msg == MSG_DRAW) { draw_base(screen, d); if (d->flags & D_SELECTED) blit(radio_sel_bmp, screen, 0, 0, d->x+3, d->y+d->h/2-7, radio_sel_bmp->w, radio_sel_bmp->h); else blit(radio_bmp, screen, 0, 0, d->x+3, d->y+d->h/2-7, radio_bmp->w, radio_bmp->h); if (d->dp) photon_textout(screen, (char *)d->dp, d->x+20, d->y+d->h/2-text_height(font)/2, d->flags, FALSE); return D_O_K; } return d_radio_proc(msg, d, c); }
int d_seltext_proc(int msg, DIALOG *d, int c) { int acolor = makecol(0,255,0); int icolor = makecol(0,100,0); int ret = D_O_K; if (msg != MSG_DRAW) ret = d_radio_proc(msg, d, c); // if (msg == MSG_GOTFOCUS) // { // ret = d_radio_proc(MSG_KEY, d, c); // } switch (msg) { case MSG_START: d->w = text_length(fnt_andrus_4, ((char *)d->dp)); d->h = text_height(fnt_andrus_4); break; case MSG_DRAW: if (d->flags & D_SELECTED) { char *t = strdup((char *)d->dp); dialog_textout(ustrupr(t),d->x, d->y , acolor); free(t); } else { char *t = strdup((char *)d->dp); dialog_textout(ustrlwr(t),d->x, d->y , icolor); free(t); } break; } return ret; }
int option_element_proc(int msg, DIALOG *d, int c) { OPTION_ELEMENT *option_element = (OPTION_ELEMENT *) d->dp3; // make element_name point to struct pointed by d->dp3; switch (msg) { case MSG_START: case MSG_REFRESH: switch (d->d1) { case 0: if (option_element->option_value == system_of_measurements) // if the element should be selected d->flags |= D_SELECTED; else d->flags &= ~D_SELECTED; break; case 1: if (option_element->option_value == comport.number) d->flags |= D_SELECTED; else d->flags &= ~D_SELECTED; break; case 2: if (option_element->option_value == comport.baud_rate) d->flags |= D_SELECTED; else d->flags &= ~D_SELECTED; break; case 3: if (option_element->option_value == (display_mode & WINDOWED_MODE)) d->flags |= D_SELECTED; // make it selected else d->flags &= ~D_SELECTED; if (((option_element->option_value == WINDOWED_MODE) && !(display_mode & WINDOWED_MODE_SUPPORTED)) || ((option_element->option_value == FULL_SCREEN_MODE) && !(display_mode & FULLSCREEN_MODE_SUPPORTED))) d->flags |= D_DISABLED; else d->flags &= ~D_DISABLED; break; } if (msg == MSG_REFRESH) msg = MSG_DRAW; break; case MSG_SAVE_OPTIONS: if (d->flags & D_SELECTED) // if the element is selected, switch (d->d1) { case 0: system_of_measurements = option_element->option_value; break; case 1: comport.number = option_element->option_value; break; case 2: comport.baud_rate = option_element->option_value; break; case 3: display_mode &= ~WINDOWED_MODE; display_mode |= option_element->option_value; break; } break; case MSG_END: d->flags &= ~D_SELECTED; // deselect d->flags &= ~D_DISABLED; // and enable the element break; } return d_radio_proc(msg, d, c); }