void rem_account() { cleardevice(); outer_function_screen("REMOVE ACCOUNT"); draw_button(220,225,425,255,1,"Remove Account"); draw_button(220,285,425,315,1," EXIT"); showmouseptr(); while(1) { getmousepos(&button,&corx,&cory); if((button&1)==1) { if((corx>220&&corx<425)&&(cory>225&&cory<255)) { hidemouseptr(); rm_menu(); return; } if((corx>220&&corx<425)&&(cory>285&&cory<315)) { hidemouseptr(); showadminmenu(); exit(0); } } } }
void create_system_info_screen (void) { uint16_t addr; tft_clrscr(TFT_COLOR_LIGHTGRAY); // White before printf_tft_P( TFT_COLOR_BLUE, TFT_COLOR_WHITE, PSTR("Nut/OS %s "), NutVersionString()); printf_tft_P( TFT_COLOR_BLUE, TFT_COLOR_WHITE, PSTR("Firmware V%d.%d"), pgm_read_byte_far((char*)&bootlodrinfo.app_version +1), pgm_read_byte_far((char*)&bootlodrinfo.app_version)); printf_tft_P( TFT_COLOR_GREEN, TFT_COLOR_WHITE, PSTR("Build %s at %s"), __DATE__, __TIME__); addr = eib_get_device_address(EIB_DEVICE_CHANNEL); printf_tft_P( TFT_COLOR_RED, TFT_COLOR_WHITE, PSTR("Phys. Addr %d.%d.%d"), (addr >> 4) & 0x0f, addr & 0x0f, (addr >> 8) & 0xff ); if (display_orientation == DISPLAY_ORIENTATION_HOR) printf_tft_P( TFT_COLOR_BLACK, TFT_COLOR_WHITE, PSTR("Horizontal")); else if (display_orientation == DISPLAY_ORIENTATION_90L) printf_tft_P( TFT_COLOR_BLACK, TFT_COLOR_WHITE, PSTR("90 left")); else if (display_orientation == DISPLAY_ORIENTATION_90R) printf_tft_P( TFT_COLOR_BLACK, TFT_COLOR_WHITE, PSTR("90 right")); else if (display_orientation == DISPLAY_ORIENTATION_UPSIDE) printf_tft_P( TFT_COLOR_BLACK, TFT_COLOR_WHITE, PSTR("180")); if (eib_get_status() == EIB_NORMAL) printf_tft_P( TFT_COLOR_BLACK, TFT_COLOR_WHITE, PSTR("EIB online")); else printf_tft_P( TFT_COLOR_RED, TFT_COLOR_WHITE, PSTR("EIB offline")); printf_tft_P (TFT_COLOR_BLACK, TFT_COLOR_WHITE, PSTR("TFT Ctrl = %d, R00=%4.4x"), controller_type, controller_id); draw_button (ERASE_BUTTON_XPOS, ERASE_BUTTON_YPOS, BUTTON_WIDTH, "Erase Flash"); // added by sh draw_button (MONITOR_BUTTON_XPOS, MONITOR_BUTTON_YPOS, BUTTON_WIDTH, "Monitor"); draw_button (DOWNLOAD_BUTTON_XPOS, DOWNLOAD_BUTTON_YPOS, BUTTON_WIDTH, "Download"); draw_button (EXIT_BUTTON_XPOS, EXIT_BUTTON_YPOS, BUTTON_WIDTH, "Exit"); system_page_active = SYSTEM_PAGE_MAIN; }
int changepassword() { cleardevice(); outer_function_screen("CHANGE PASSWORD"); draw_button(225,225,395,255,1,"Administrator"); draw_button(225,285,395,315,1,"Customer"); draw_button(225,345,395,375,1,"Exit"); showmouseptr(); while(1) { showmouseptr(); getmousepos(&button,&corx,&cory); if((button&1)==1) { if((corx>225&&corx<395)&&(cory>225&&cory<255)) { hidemouseptr(); return(ch_pass(0)); } if((corx>225&&corx<395)&&(cory>285&&cory<315)) { hidemouseptr(); return(ch_pass(1)); } if((corx>225&&corx<395)&&(cory>345&&cory<375)) { hidemouseptr(); closegraph(); exit(0); } } } }
static void change_spin_mode(Button *m) { change_mode(m); arrange_a3d_menu(); draw_button(&a3d_g2_sel); draw_button(&a3d_g3_sel); }
static void change_ado_mode(Button *m) { change_mode(m); arrange_a3d_menu(); a3d_disables(); draw_button(&a3d_g0_sel); draw_button(&a3d_g4_sel); }
static void change_size_mode(Button *m) { change_mode(m); arrange_a3d_menu(); draw_button(&a3d_g2_sel); draw_button(&a3d_g3_sel); draw_button(&a3d_g4_sel); draw_buttontop(&a3d_sz_ratio); }
/* * Set the state of a toggle button. 0=off, 1=on */ void LUI_ButtonSetState( LUI_NEWBUTTON *b, int state ) { if (b && b->toggle) { b->state = state; draw_button( b ); } }
static void clear_track(void) { switch (vs.ado_mode) { case ADO_SPIN: default_center(&vs.move3.spin_center); pj_copy_structure(&default_vs.move3.spin_axis, &vs.move3.spin_axis, sizeof(Short_xyz) ); pj_copy_structure(&default_vs.move3.spin_theta, &vs.move3.spin_theta, sizeof(Short_xyz) ); iscale_theta(); break; case ADO_SIZE: pj_copy_words(&default_vs.move3.xp, &vs.move3.xp, 6); default_center(&vs.move3.size_center); break; case ADO_MOVE: pj_copy_structure(&default_vs.move3.move, &vs.move3.move, sizeof(Short_xyz) ); break; case ADO_PATH: pj_delete(ppoly_name); a3d_disables(); break; } draw_button(&a3d_g0_sel); }
static void change_rot_scale(Button *m) { change_mode(m); arrange_a3d_menu(); draw_button(&a3d_g2_sel); }
static Errcode new_drawer(void) { Errcode err; err = get_full_path(fq_drawer, fq_drawer); if (err < Success) return err; init_fscroller(); init_stq_string(&drawer_stringq); draw_buttontop(&fdrawer_sel); draw_button(&fmu_dev_hanger); draw_button(&fmu_topdev_hanger); redraw_fscroller(); return(Success); }
void test_gfx(int argc, char **argv) { int delay = 1000; Screen* screen = switch_to_vga(); fill_screen(screen, color_make(2, 0, 0)); draw_button(screen); sleep(delay); test_lines(screen); sleep(delay); test_circles(screen); sleep(delay); test_rects(screen); sleep(delay); test_triangles(screen); sleep(delay); test_text(screen); sleep(delay); draw_julia(screen); sleep(delay); draw_mandelbrot(screen); sleep(delay); gfx_teardown(screen); switch_to_text(); }
static void csame_spin(Button *m) { pj_copy_structure(&vs.move3.spin_center, &vs.move3.size_center, sizeof(Short_xyz) ); draw_button(&a3d_g2_sel); }
static HRESULT draw_background(uxgtk_theme_t *theme, cairo_t *cr, int part_id, int state_id, int width, int height) { button_theme_t *button_theme = impl_from_uxgtk_theme_t(theme); switch (part_id) { case BP_PUSHBUTTON: return draw_button(button_theme, cr, state_id, width, height); case BP_RADIOBUTTON: return draw_radio(button_theme, cr, state_id); case BP_CHECKBOX: return draw_checkbox(button_theme, cr, state_id); case BP_GROUPBOX: /* GNOME applications don't draw a group box. Return some error code * to avoid useless painting operations. */ return E_ABORT; } FIXME("Unsupported button part %d.\n", part_id); return E_NOTIMPL; }
static void fq_redraw_new_wild(void) /* Redraw parts of menu that need it whenever the wildcard changes. */ { draw_buttontop(&fwild_sel); init_fscroller(); redraw_fscroller(); draw_button(&fmu_sdots_sel); /* re hilite wild buttons */ }
void select_button(uint16_t x, uint16_t y) { button_col = BLUE; button_posx = x; button_posy = y; draw_button(x, y); display_color(BLACK,button_col); draw_flag(x,y); }
void submenuitem::draw(bool selected, float x, float y, float width, float height, unsigned char alpha) { draw_button(selected, name, x, y, width, height, alpha); glBegin(GL_TRIANGLES); glVertex3f(x + 0.01f, y + 0.03f, 0.0f); glVertex3f(x + 0.01f, y + 0.12f, 0.0f); glVertex3f(x + 0.045f, y + 0.075f, 0.0f); glEnd(); }
void quit_button(){ //draws and labels the quit button draw_button(1110,850,40,100); draw_Q(1115,855,30); draw_U(1142,855,30); draw_I(1164,855,30); draw_T(1190,855,30); }
static void render_volume_slider(struct button *b) { struct mixer_control *c = (struct mixer_control *)b->user_data; long v=mixer_get_value(c); draw_button(b); fillrect(b->x+2, b->y+b->h-2, b->x+b->w-2, b->y + b->h -2 - (b->h* v)/(c->max-c->min),4); }
void deselect_button(int16_t x, int16_t y) { if (x >= 0 && y >= 0 && button_arr[x][y].state == 0){ button_col = def_button_col; button_posx = x; button_posy = y; draw_button(x, y); display_color(BLACK, def_button_col); draw_flag(x,y); } }
static void render_tracks(struct button *b) { draw_button(b); int i; for(i=0;songs[i].filename;i++) { int y=i*30; if(y>b->h) return; if(i==current_track) { fillrect(b->x+2,b->y+y+2,b->x+b->w-2,b->y+y+30-2,5); } put_string(b->x+20,b->y+y +8 ,songs[i].filename,1); } }
/* * Set the "on" color for a button. */ void LUI_ButtonColor( LUI_NEWBUTTON *b, double red, double green, double blue ) { if (b->color!=LUI_Color_white/*darkgray*/) { LUI_FreeColor( b->color ); /* XFreeColors( LUI_Display, LUI_Colormap, &b->color, 1, 0 );*/ } b->red = red; b->green = green; b->blue =blue; b->color = LUI_AllocateColor( red, green, blue ); if (b->state) { draw_button(b); } }
static void feel_numqdim(Button *b) { #define VAL (*(SHORT *)(((Numq *)(b->datme))->val)) feel_numq(b); if(VAL < 2) { softerr(Err_nogood, "!%d", "low_dim", 2); VAL = 2; draw_buttontop(b); } draw_button(b->children->group); #undef VAL }
void INFO_PANEL::draw(SDL_Surface* scr, bool upd) { if(relY < 0) { SDL_Rect clip = gfx.SetClip(0, 0-relY, ibg->w, ibg->h+relY); gfx.AddSurface(relX, 0, ibg, scr, &clip); } else { gfx.AddSurface(relX, relY, ibg, scr, NULL); } draw_status(scr, false); draw_button(scr, false, false); if (upd) if(relY < 0) gfx.Update(scr, relX, 0, ibg->w, ibg->h+relY); else gfx.Update(scr, relX, relY, ibg->w, ibg->h); }
void togglemenuitem::draw(bool selected, float x, float y, float width, float height, unsigned char alpha) { draw_button(selected, name, x, y, width, height, alpha); textquad tq(x + width - toggle_dist_from_back, y + (height - font_size) * 0.5f, 0.0f, x + width - toggle_dist_from_back, y + (height + font_size) * 0.5f, 0.0f, 0.05f, 0.0f, 0.0f); if(state) { glColor4ub(0,255,0,alpha); draw_str(tq, (char*)"ON"); } else { glColor4ub(255,0,0,alpha); draw_str(tq, (char*)"OFF"); } }
void render_buttons(void) { BUTTONPTR currentptr = bfirstptr; do { if((currentptr->bdata.bflags & BVISIBLE)) { draw_button(currentptr); if((currentptr->bdata.bflags & BLPRESSED) && !(currentptr->bdata.bflags & BLRELEASED)) remove_bflags_on_button(currentptr, BLRELEASED | BRPRESSED | BRRELEASED | BMRELEASED | BMPRESSED | BDRAW | BMOUSEOVER); else remove_bflags_on_button(currentptr, BLPRESSED | BLRELEASED | BMRELEASED | BMPRESSED | BRPRESSED | BRRELEASED | BDRAW | BMOUSEOVER); } } while((currentptr = currentptr->nextbutton) != bfirstptr); }
/* **************************************************************** * Desenha a janela de mensagens * **************************************************************** */ void draw_msg_win (void) { const WINDATA *wp = &msg; int font_x, font_y, box_x, box_y, box_width, box_height; draw_shadow ( wp->win, wp->triple.top_gc, wp->triple.bottom_gc, 0, 0, wp->width, wp->height ); if (msg_len == 0) return; if (msg_type != GOOD_MSG) draw_button (wp, &empty_dir_triple, 0, 0, wp->width, wp->height); font_x = MENU_BORDER + SHADOW; font_y = MENU_BORDER + 1 * (wp->font_height + 2 * SHADOW) - (wp->font_descent + SHADOW); box_x = font_x + (msg_len + 2) * wp->font_width; box_y = BOX_Y; box_width = 7 * wp->font_width; box_height = BOX_HEIGHT; XDrawString ( display, wp->win, wp->text_gc, font_x, font_y, msg_text, msg_len ); /* * Se pede a confirmação, ... */ if (msg_type == QUESTION_MSG) { XMapWindow (display, msg_yes.win); XMapWindow (display, msg_no.win); } } /* end draw_msg_win */
static void set_axis(Button *m) { vs.move3.spin_axis.x = vs.move3.spin_axis.y = vs.move3.spin_axis.z = 0; switch (m->identity) { case 0: vs.move3.spin_axis.x = 100; break; case 1: vs.move3.spin_axis.y = 100; break; case 2: vs.move3.spin_axis.z = 100; break; } draw_button(&a3d_g2_sel); }
static HRESULT draw_background(uxgtk_theme_t *theme, cairo_t *cr, int part_id, int state_id, int width, int height) { combobox_theme_t *combobox_theme = impl_from_uxgtk_theme_t(theme); switch (part_id) { case 0: case CP_BORDER: return draw_border(combobox_theme, cr, state_id, width, height); case CP_DROPDOWNBUTTON: case CP_DROPDOWNBUTTONLEFT: case CP_DROPDOWNBUTTONRIGHT: return draw_button(combobox_theme, cr, part_id, state_id, width, height); } FIXME("Unsupported combobox part %d.\n", part_id); return E_NOTIMPL; }
void draw_interface(interface_drawer * i_drawer) { glPushMatrix(); glDisable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, 1000.0, 0, 600.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); int i; for (i = 0; i < i_drawer->num_buttons; i++) { if (i_drawer->butt[i].visible) { draw_button(i_drawer->butt[i]); } } glPopMatrix(); }
void draw_view(View* view) { if (!view) return; //inform subviews that we're being redrawn //dirtied = 1; //fill view with its background color draw_rect(view->layer, rect_make(point_zero(), view->frame.size), view->background_color, THICKNESS_FILLED); //draw any bmps this view has for (int i = 0; i < view->bmps->size; i++) { Bmp* bmp = (Bmp*)array_m_lookup(view->bmps, i); if (bmp) { draw_bmp(view->layer, bmp); } } //draw any labels this view has for (int i = 0; i < view->labels->size; i++) { Label* label = (Label*)array_m_lookup(view->labels, i); draw_label(view->layer, label); } //draw buttons for (int i = 0; i < view->buttons->size; i++) { Button* button = (Button*)array_m_lookup(view->buttons, i); if (button) { draw_button(view->layer, button); } } //draw each subview of this view for (int i = 0; i < view->subviews->size; i++) { View* subview = (View*)array_m_lookup(view->subviews, i); draw_view(subview); blit_layer(view->layer, subview->layer, rect_make(subview->frame.origin, subview->layer->size), rect_make(point_zero(), subview->layer->size)); } view->needs_redraw = 0; }