void liqcell_child_selectnone_recursive(liqcell *self,int autoremove) { //liqcell_child_selectnone(self); liqcell *c = liqcell_getlinkchild_visual(self); while(c) { liqcell *d=liqcell_getlinknext_visual(c); liqcell_child_selectnone_recursive(c,autoremove); c=d; } if(liqcell_getselected(self)) { liqcell_setselected(self,0); if(autoremove) { liqcell_setvisible(self,0); liqcell *par = liqcell_getlinkparent(self); if(par) { liqcell_child_remove(par,self); //liqcell_child_arrange_autoflow(par); } } } }
static int liqcell_child_arrange_easytile_hero(liqcell *self) { // arrange the contents of self like a hero would. int sgw = self->w; int sgh = self->h; liqcell *par = liqcell_getlinkparent(self); sgw = par->w; liqcell_setsize(self, par->w, par->h ); int res=0; int cnt = liqcell_child_countvisible(self); if(cnt<=1) { res = liqcell_child_arrange_easytile(self); } else if(cnt<=2) { res = liqcell_child_arrange_makegrid(self, 1,2); } else if(cnt<=3) { res = liqcell_child_arrange_makegrid(self, 1,3); } else if(cnt<=4) { res = liqcell_child_arrange_makegrid(self, 2,2); } else if(cnt<=5) { res = liqcell_child_arrange_makegrid(self, 2,3); } else if(cnt<=8) { res = liqcell_child_arrange_makegrid(self, 2,cnt-1); } else { res = liqcell_child_arrange_makegrid(self, 2,8); } // res = liqcell_child_arrange_easytile(self); liqcell_setrect(self, 0,0, sgw, self->h ); return res; }
/** Ip Submit Button Action */ static int ip_submit_click(liqcell *self, liqcelleventargs *args, liqcell *ipbar) { // get ip liqcell *ip_textbox = liqcell_child_lookup(ipbar, "ip_textbox"); char *ip_addr = liqcell_getcaption(ip_textbox); // create new monitor cell liqcell *zachmon = liqcell_getlinkparent(ipbar); Monitor_Cell_Init(zachmon, ip_addr); return 1; }
/** Simplebar Submit Button Action */ static int simplebar_submit_click(liqcell *self, liqcelleventargs *args, liqcell *simplebar) { // get textbox caption liqcell *textbox = liqcell_child_lookup(simplebar, "simple_textbox"); char *caption = liqcell_getcaption(textbox); // set the caption of body liqcell *app = liqcell_getlinkparent(simplebar); liqcell *body = liqcell_child_lookup(app, "body"); liqcell_setcaption(body, caption); return 1; }