void video_create(video_t *m) { int i,x,y; memset(m,0,sizeof(video_t)); m->info.type = G_WINDOW; x = m->info.x = 15; y = m->info.y = 40; m->info.w = 220; m->info.h = 110; m->info.draw = (drawfunc_t)video_draw; m->info.event = (eventfunc_t)video_event; button_create(&m->donebtn,"Done",x+m->info.w-(6*6)+2,136,0); radiogroup_create(&m->filter,x+2,y+12,"Video Filter",config.filter,filter_caps,changed_filter); if(config.windowed == 0) i = config.fullscreen + 4; else i = config.windowscale - 1; radiogroup_create(&m->videomode,x+2+84,y+12,"Video Mode",i,videomode_caps,changed_videomode); m->filter.user = m; x += 3; y += 2 + 11; }
int main( int argc, char *argv[] ) { layout_t *lt, *lt2, *lt3, *lt4; bounds_t *b; object_t *rg, *btn, *fr; claro_base_init( ); claro_graphics_init( ); log_fd_set_level( CL_DEBUG, stderr ); clog( CL_INFO, "%s running using Claro!", __FILE__ ); b = new_bounds( 100, 100, 460, 230 ); w = window_widget_create( 0, b, 0 ); object_addhandler( w, "destroy", window_closed ); window_set_title( w, "Radio button example" ); lt = layout_create( w, "[][_<|set1|<|set3|<][][_<|set2|<|set4|<][]", *b, 10, 10 ); /* create a frame */ b = lt_bounds(lt,"set1"); fr = frame_widget_create_with_label( w, b, 0, "Group 1" ); lt2 = layout_create( fr, "[r1][r2][r3][_]", *b, 20, 20 ); rg = radiogroup_create( fr, 0 ); btn = radiobutton_widget_create( fr, rg, lt_bounds(lt2,"r1"), "Button 1", 0 ); btn = radiobutton_widget_create( fr, rg, lt_bounds(lt2,"r2"), "Button 2", 0 ); btn = radiobutton_widget_create( fr, rg, lt_bounds(lt2,"r3"), "Button 3", 0 ); /* create a frame */ b = lt_bounds(lt,"set2"); fr = frame_widget_create_with_label( w, b, 0, "Group 2" ); lt3 = layout_create( fr, "[r1][r2][r3][_]", *b, 20, 20 ); rg = radiogroup_create( fr, 0 ); btn = radiobutton_widget_create( fr, rg, lt_bounds(lt3,"r1"), "Button 1", 0 ); btn = radiobutton_widget_create( fr, rg, lt_bounds(lt3,"r2"), "Button 2", 0 ); btn = radiobutton_widget_create( fr, rg, lt_bounds(lt3,"r3"), "Button 3", 0 ); /* create a frame */ b = lt_bounds(lt,"set3"); fr = frame_widget_create_with_label( w, b, 0, "Group 3" ); lt4 = layout_create( fr, "[r1][r2][r3][_]", *b, 20, 20 ); btn = checkbox_widget_create_with_label( fr, lt_bounds(lt4,"r1"), 0, "Button 1" ); btn = checkbox_widget_create_with_label( fr, lt_bounds(lt4,"r2"), 0, "Button 2" ); btn = checkbox_widget_create_with_label( fr, lt_bounds(lt4,"r3"), 0, "Button 3" ); window_show( w ); window_focus( w ); block_heap_loginfo( ); claro_loop( ); return 0; }
void options_create(options_t *m) { int x,y; memset(m,0,sizeof(options_t)); m->info.type = G_WINDOW; x = m->info.x = 20; y = m->info.y = 40; m->info.w = 200; m->info.h = 100; m->info.draw = (drawfunc_t)options_draw; m->info.event = (eventfunc_t)options_event; button_create(&m->donebtn,"Done",x+m->info.w-(6*6),124,0); radiogroup_create(&m->fdsbios,x+3,y+12,"CD Bios",/*config.cdbios*/0,cdbios_caps,changed_cdbios); checkbox_create(&m->showinfo,x+3,y+40,"Show ROM Name/FPS at top",config.showinfo,click_showinfo); x += 3; y += 2 + 11; }
int main(int argc, char ** argv) { object_t *w, *f; layout_t *lt, *lt2; bounds_t *b, *b2; object_t *btnSetText, *rbLeftJustify, *rbCenterJustify, *rbRightJustify, *rbFillJustify; object_t *rg, *btnQuit; int y = 10, x= 10; claro_base_init(); claro_graphics_init(); // create objects w = window_widget_create(0, new_bounds(100,100,500, 200) , 0); lt = layout_create(w, "[{10}]" "[{35}text|(5)|set]" "[{5}]" "[{35}lj|cj|rj|fj]" "[{5}]" "[{50}fr]" "[{5}]" "[{35}quit]" "[{10}]" , *b, 10,10); txtEntry = textbox_widget_create(w, lt_bounds(lt, "text"), 0); btnSetText = button_widget_create_with_label(w, lt_bounds(lt, "set"), 0,"Set Text"); b2 = lt_bounds(lt, "fr"); f = frame_widget_create_with_label(w, b2, 0, "Label Test Area"); lt2 = layout_create(f, "[{5}][_label][{5}]", *b2, 10,10); lblText = label_widget_create(f, lt_bounds(lt2, "label"), 0); rg = radiogroup_create(w,0); rbLeftJustify = radiobutton_widget_create(w, rg, lt_bounds(lt, "lj"), "Left Justify",0); rbCenterJustify = radiobutton_widget_create(w, rg, lt_bounds(lt, "cj"), "Center Justify",0); rbRightJustify = radiobutton_widget_create(w, rg, lt_bounds(lt, "rj"), "Right Justify",0); rbFillJustify = radiobutton_widget_create(w, rg, lt_bounds(lt, "fj"), "Fill Justify",0); btnQuit = button_widget_create_with_label(w, lt_bounds(lt, "quit"), 0, "Quit"); // set up handlers object_addhandler(w, "destroy", window_closed); object_addhandler(btnQuit, "pushed", window_closed); object_addhandler(btnSetText, "pushed", handle_set_text); object_addhandler_interface(rbLeftJustify, "selected", handle_justify, (void*)cLabelLeft); object_addhandler_interface(rbCenterJustify, "selected", handle_justify, (void*)cLabelCenter); object_addhandler_interface(rbRightJustify, "selected", handle_justify, (void*)cLabelRight); object_addhandler_interface(rbFillJustify, "selected", handle_justify, (void*)cLabelFill); // set things window_set_title(w, "Label Test"); window_show(w); window_focus(w); claro_loop(); return 0; }