Ejemplo n.º 1
0
/** Create the IP Address Input Bar */
liqcell *ipbar_create()
{
	liqcell *self = liqcell_quickcreatewidget("ipbar","ipbar", 800, 50);
	
	if(self)
	{	
		// decorate the bar
		liqcell *data = liqcell_quickcreatevis("data","frame", 210, 0, 580, 40);
		liqcell_setfont(self,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0));
		liqcell_propsets(self, "backcolor", "rgb(100,255,150)");
		liqcell_propsets(self, "textcolor", "rgb(20,30,40)");
		liqcell_propsets(self, "bordercolor", "rgb(255,255,255)");


		// set props
		liqcell_propseti(self, "selstart",  0);
		liqcell_propseti(self, "sellength", 0);
		liqcell_propseti(self, "cursorpos", 0);

		// add handlers
		liqcell_handleradd(self, "mouse", textbox_mouse);
		liqcell_handleradd(self, "keypress", textbox_keypress);
		liqcell_handleradd(self, "keyrelease", textbox_keyrelease);	
	}
	return self;
}
Ejemplo n.º 2
0
/**
 * Create a textbox ui component
 * @return liqcell* The new textbox
 */
liqcell *textbox_create()
{
	
	liqcell *self = liqcell_quickcreatewidget("textbox","form", 600,50);
	
	if(self)
	{
			
		liqcell_setfont(   self,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
		//liqcell_propsets(  self,  "backcolor", "rgb(100,255,150)" );
		//liqcell_propsets(  self,  "textcolor", "rgb(20,30,40)" );
		//liqcell_propsets(  self,  "bordercolor", "rgb(255,255,255)" );

        liqcell_propsets(  self,  "textcolor", "rgb(0,0,0)" );
		//liqcell_setimage(  self,  liqimage_cache_getfile("/usr/share/liqbase/onedotzero/media/2_text_back.png", 0,0,1) );
        liqcell_setimage(  self,  liqimage_cache_getfile("/usr/share/liqbase/onedotzero/media/2.message/message_input_field.png", 0,0,1) );
		liqcell_propseti(  self,  "lockaspect",  0 );
		//liqcell_propremoves(  self,  "bordercolor" );
		//liqcell_propremoves(  self,  "backcolor" );
				
		liqcell_propseti(  self,  "maxlength",  140 );

		liqcell_propseti(  self,  "selstart",  0 );
		liqcell_propseti(  self,  "sellength", 0 );
		liqcell_propseti(  self,  "cursorpos", 0 );
			
		liqcell_handleradd(self,    "mouse",      textbox_mouse);
		liqcell_handleradd(self,    "keypress",   textbox_keypress);
		liqcell_handleradd(self,    "keyrelease", textbox_keyrelease);
		
		liqcell_handleradd(self,    "resize",   textbox_resize);
	
			
		// add vkbd
		liqcell *vkbd_command = liqcell_quickcreatevis("vkbd_command" , "commandbutton", 0, 0, 0, 0);
		liqcell_handleradd_withcontext(vkbd_command, "click", keyboard_show_button_click, self);
		liqcell_setfont(vkbd_command, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0));
		liqcell_setcaption(vkbd_command, "ABC");
		liqcell_propsets(vkbd_command, "backcolor", CYAN);
		liqcell_propsets(vkbd_command, "textcolor", BLACK);
		liqcell_propseti(vkbd_command, "textalign", 2);
		liqcell_propseti(vkbd_command, "textaligny", 2);
		liqcell_propseti(vkbd_command, "lockaspect", 1);
		
		liqcell_setvisible(vkbd_command,0);		// Wed Aug 19 19:08:20 2009 lcuk : proper way would be checking for no keyboard..
		
		liqcell_child_insert(self, vkbd_command);
	}
	return self;
}
Ejemplo n.º 3
0
liqcell *textbox_create()
{
	
	liqcell *self = liqcell_quickcreatewidget("textbox","textbox", 800,50);
	
	if(self)
	{

		
			liqcell *data = liqcell_quickcreatevis("data","frame", 210,0,   580,40);
			liqcell_setfont(   self,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
			liqcell_propsets(  self,  "backcolor", "rgb(100,255,150)" );
			liqcell_propsets(  self,  "textcolor", "rgb(20,30,40)" );
			liqcell_propsets(  self,  "bordercolor", "rgb(255,255,255)" );
			//liqcell_setcaption(data,  datadefault );
		//liqcell_child_insert( self, data );

			liqcell_propseti(  self,  "selstart",  0 );
			liqcell_propseti(  self,  "sellength", 0 );
			liqcell_propseti(  self,  "cursorpos", 0 );


			//liqcell_propseti(  data,  "selstart",  5 );
			//liqcell_propseti(  data,  "sellength", 12 );
			//liqcell_propseti(  data,  "cursorpos", 17 );
			
			liqcell_handleradd(self,    "mouse",      textbox_mouse);
			liqcell_handleradd(self,    "keypress",   textbox_keypress);
			liqcell_handleradd(self,    "keyrelease", textbox_keyrelease);



//liqcell *liqkeyboard_create();

	//		liqcell *kb = liqcell_quickcreatevis("data","liqkeyboard", 500,0,   60,20);
			//liqcell_setfont(   kb,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (36), 0) );
			//liqcell_propsets(  kb,  "backcolor", "rgb(220,255,220)" );
			//liqcell_propsets(  kb,  "textcolor", "rgb(0,0,0)" );
			//liqcell_setcaption(kb,  datadefault );

	//	liqcell_child_insert( self, kb );



		
		
	}
	return self;
}
Ejemplo n.º 4
0
liqcell *liqsketchedit_create(char *name,int l,int t,int w,int h)
{
		
		liqcell *c = liqcell_quickcreatevis(name,  NULL,   l,t,w,h );
		
		liqcell_propseti(c,"sketchediting",1);		// mark it as editing :)
		
			// give us something to draw onto
			liqsketch *s = liqsketch_new();
					s->pixelwidth =liqcell_getw(c);
					s->pixelheight=liqcell_geth(c);
					s->dpix=225;	// damn, dont like using this here
					s->dpiy=225;
			liqcell_setsketch( c, s );
			
			
		liqcell_handleradd(c,    "mouse",   sketchedit_mouse);
	return c;	
}
Ejemplo n.º 5
0
liqcell *liqrecentusers_create()
{
	liqcell *self = liqcell_quickcreatewidget("liqrecentusers","form", 800,480);

	if(self)
	{

		
		
		liqcell *body = liqcell_quickcreatevis("body",NULL,0 ,0,   self->w,self->h);

		//liqcell_scan_folder_for_images(body,widgetpath);

		liqcell_scan_folder_for_images(body,"/usr/share/liqbase/media/avatars");


		liqcell_child_insert( self, body );

		int cnt=0;
		liqcell *c=liqcell_lastchild(body);
		//liqcell *c=liqcell_getlinkchild(body);
		while(c)
		{
			if(liqcell_getvisible(c))
			{
				// work it!
				if(cnt++<9)
				{
					c->visible=1;
				}
				else
				{
				//	c->visible=0;
				}



			}
			//c=liqcell_getlinknext(c);
			c=liqcell_getlinkprev(c);
		}
		if(cnt>=9)
			liqcell_child_arrange_makegrid(body,4,4);
		else
			liqcell_child_arrange_easytile(body);
		// only show the most recent 12?

		c=liqcell_lastchild(body);
		//liqcell *c=liqcell_getlinkchild(self);
		while(c)
		{
			if(liqcell_getvisible(c))
			{
				// work it!


					liqcell *e = editoverlay_create(c->w,c->h*0.2);
					liqcell_setpos(e, 0, c->h*0.8);
					liqcell_child_insert( c, e );

			}
			//c=liqcell_getlinknext(c);
			c=liqcell_getlinkprev(c);
		}

		liqcell_handleradd(body,    "mouse",   liqcell_easyhandler_kinetic_mouse );	
		liqcell_handleradd_withcontext(self,    "filter",   liqrecentusers_filter,self);

	}

	return self;
}
Ejemplo n.º 6
0
static int liqcell_scan_folder_for_images(liqcell *self,char *path)
{
		char *widgetpath = path;
		DIR           *	dir_p;
		struct dirent *	dir_entry_p;
		char 			fn[FILENAME_MAX+1];
		char          * ft;
		dir_p = opendir( widgetpath );
		if(!dir_p)
		{
			liqapp_log("liqcell_scan_folder_for_images opendir failed: '%s'",widgetpath);
			return self;			// heh thanks kot :)
		}
		while( NULL != (dir_entry_p = readdir(dir_p)))
		{
			if( dir_entry_p->d_name[0]=='.' )
				continue;

			ft=dir_entry_p->d_name;

			snprintf(fn , FILENAME_MAX , "%s/%s", widgetpath , ft);

			struct stat     statbuf;
			if(stat(fn, &statbuf) == -1)
			{
				liqapp_log("liqcell_scan_folder_for_images stat failed: '%s'",fn);
				return self;
			}
			// got the information we need
			if ( S_ISREG(statbuf.st_mode) )
			{
				char *ext=liqapp_filename_walktoextension(ft);
				if(!ext || !*ext)
				{
					// nothing to see here..
				}
				else
				if(
					strcasecmp(ext,"png")==0  ||
					strcasecmp(ext,"jpg")==0  ||
					strcasecmp(ext,"jpeg")==0
				  )
				{


					liqcell *c = liqcell_quickcreatevis(ft,   "picture",   1,1,1,1    );
					liqcell_propseti(c,"lockaspect",1);
					liqcell_propsets(c,"imagefilename",fn);
					//liqcell_handleradd(c,    "mouse",   widget_mouse);
					liqcell_handleradd(c,    "click",   widget_click);


					liqcell_child_insertsorted( self, c );




				}

			}
		}
		closedir(dir_p);

}
Ejemplo n.º 7
0
liqcell *liqrecentphotos_create()
{
	liqcell *self = liqcell_quickcreatewidget("liqrecentphotos","form", 800,480);

	if(self)
	{
	//	liqcell_propseti(self,"idle_lazyrun_wanted",1);			 // :)
	//	liqcell_propseti(self,"multitouch_test_range",5);
	
	liqcell_handleradd_withcontext(self, "layout2", liqrecentphotos_layout2 ,self);

/*
		//############################# title:titlebar
		liqcell *title = liqcell_quickcreatevis("title", "titlebar", 0,0, 800, 50);
		liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
		liqcell_setcaption(title, "Recent photos and pictures" );
		liqcell_propsets(  title, "imagefilename", "/usr/share/liqbase/media/titlebanner_left.png" );
		liqcell_propsets(  title, "textcolor", "rgb(255,255,0)" );
		//liqcell_propsets(  title, "backcolor", "rgb(0,0,60)" );
		liqcell_propseti(  title, "lockaspect", 0 );
		liqcell_propseti(  title, "textalign", 0 );
		liqcell_child_append(  self, title);


			//############################# cmddraw:label
			liqcell *cmddraw = liqcell_quickcreatevis("cmddraw", "label", 580, 0, 86, 48);
			liqcell_setfont(	cmddraw, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
			liqcell_setcaption(cmddraw, "draw" );
			liqcell_propsets(  cmddraw, "textcolor", "rgb(255,255,255)" );
			liqcell_propsets(  cmddraw, "backcolor", "rgb(0,64,64)" );
			liqcell_propsets(  cmddraw, "bordercolor", "rgb(200,100,100)" );
			liqcell_propseti(  cmddraw, "textalign", 2 );
			//liqcell_handleradd_withcontext(cmddraw, "click", cmddraw_click, self );
			liqcell_child_append(  title, cmddraw);
			//############################# cmdzoom:label
			liqcell *cmdzoom = liqcell_quickcreatevis("cmdzoom", "label", 492, 0, 86, 48);
			liqcell_setfont(	cmdzoom, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
			liqcell_setcaption(cmdzoom, "zoom" );
			liqcell_propsets(  cmdzoom, "textcolor", "rgb(255,255,255)" );
			liqcell_propsets(  cmdzoom, "backcolor", "rgb(0,64,64)" );
			liqcell_propsets(  cmdzoom, "bordercolor", "rgb(200,100,100)" );
			liqcell_propseti(  cmdzoom, "textalign", 2 );
			//liqcell_handleradd_withcontext(cmdzoom, "click", cmdzoom_click, self );
			liqcell_child_append(  title, cmdzoom);
			//############################# cmdsel:label
			liqcell *cmdsel = liqcell_quickcreatevis("cmdsel", "label", 404, 0, 86, 48);
			liqcell_setfont(	cmdsel, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
			liqcell_setcaption(cmdsel, "sel" );
			liqcell_propsets(  cmdsel, "textcolor", "rgb(255,255,255)" );
			liqcell_propsets(  cmdsel, "backcolor", "rgb(0,64,64)" );
			liqcell_propsets(  cmdsel, "bordercolor", "rgb(200,100,100)" );
			liqcell_propseti(  cmdsel, "textalign", 2 );
			//liqcell_handleradd_withcontext(cmdsel, "click", cmdsel_click, self );
			liqcell_child_append(  title, cmdsel);

 */



		liqcell *body = liqcell_quickcreatevis("body","frame",0 ,0,   self->w,self->h);

			// create a headskip blank
//			liqcell *headskip = liqcell_quickcreatevis("__headskip", NULL, 0, 0, liqcell_getw(title),liqcell_geth(title));
//			liqcell_child_append(  body, headskip);
			
			
		liqcell_child_insert( self, body );

	

			char buf[FILENAME_MAX];		
										snprintf(buf,sizeof(buf),"%s/MyDocs/.images",app.homepath);
			liqcell_scan_folder_for_images(self,buf);
	
										snprintf(buf,sizeof(buf),"%s/MyDocs/.camera",app.homepath);
			liqcell_scan_folder_for_images(self,buf);
	
										snprintf(buf,sizeof(buf),"%s/MyDocs/DCIM",app.homepath);
			liqcell_scan_folder_for_images(self,buf);

										snprintf(buf,sizeof(buf),"%s/.liqbase/sketches",app.homepath); 
			liqcell_scan_folder_for_images(self,buf);

			//							snprintf(buf,sizeof(buf),"/home/user/MyDocs/.camera");
			//liqcell_scan_folder_for_images(self,buf);
	
			//							snprintf(buf,sizeof(buf),"/home/user/MyDocs/.images");
			//liqcell_scan_folder_for_images(self,buf);
		
		
		
		liqcell_handlerrun(self,"layout2",NULL);
		
		
		
		liqcell_propsets(  self, "monitorpath" , buf);
		//liqcell_propsets(  self, "watchpattern" , "liq.*");

		int cnt=0;
		liqcell *c=NULL;

		//liqcell_child_arrange_makegrid(body,3,3);
		

		c=liqcell_lastchild(body);

		liqcell_handleradd(body,    "mouse",   liqcell_easyhandler_kinetic_mouse );
		
		
		//liqcell_handleradd(self,    "click",   float_click);

//#ifdef USE_INOTIFY
		//############################# timer1:liqtimer
		liqcell *timer1=liqcell_quickcreatevis("timer1",   "liqtimer",   0,0,   0,0 );
		// store ourselves on the tag for use later
		// this does feel like a workaround, but hell, it works!
		//liqcell_settag(timer1,liqcell_hold(self));
		liqcell_propseti(timer1,"timerinterval", 1 );
		liqcell_handleradd_withcontext(timer1,"timertick",timer_tick,self);
		liqcell_setenabled(timer1,1);
		liqcell_child_insert( self,timer1);
//#endif		


        liqcell_handleradd(self,    "filter",   liqrecentphotos_filter);

	}
	
	return self;
}
Ejemplo n.º 8
0
static int liqcell_scan_folder_for_images(liqcell *self,char *path)
{
	liqcell *body= liqcell_child_lookup(self, "body");
	
		char *widgetpath = path;
		DIR           *	dir_p;
		struct dirent *	dir_entry_p;
		char 			fn[FILENAME_MAX+1];
		char          * ft;
		
		struct pagefilename pfn;
		
		dir_p = opendir( widgetpath );			
		if(!dir_p)
		{
			liqapp_log("liqcell_scan_folder_for_images opendir failed: '%s'",widgetpath);
			return -1;			// heh thanks kot :)
		}				
		while( NULL != (dir_entry_p = readdir(dir_p)))
		{
			if( dir_entry_p->d_name[0]=='.' )
				continue;
			
			ft=dir_entry_p->d_name;
			
			snprintf(fn , FILENAME_MAX , "%s/%s", widgetpath , ft);
			
			struct stat     statbuf;
			if(stat(fn, &statbuf) == -1)
			{
				liqapp_log("liqcell_scan_folder_for_images stat failed: '%s'",fn);
				return -1;
			}
			// got the information we need
			if ( S_ISDIR(statbuf.st_mode) )
			{
				//printf(" DIR  ");
				liqcell_scan_folder_for_images(self,fn);	
			}
			else
			// got the information we need
			if ( S_ISREG(statbuf.st_mode) )
			{
				char *ext=liqapp_filename_walktoextension(ft);
				if(!ext || !*ext)
				{
					// nothing to see here..
				}

				
				else
				if(
					strcasecmp(ext,"png")==0  ||
					strcasecmp(ext,"jpg")==0  ||
					strcasecmp(ext,"jpeg")==0
				  )
				
				{
					
					
					
					// what i need to know is if this image has a thumbnail
					// ignore it if not
					char imagethumb[ FILENAME_MAX ];
					
					//int liqimage_find_thumbnail_for(char *resultbuffer,int resultsize,char *bigimagefilename);
					
					if( liqimage_find_thumbnail_for(imagethumb,sizeof(imagethumb),fn) == 0 )
					{
						// w00t!   (hello btw)
					}
					else
					{
						snprintf(imagethumb,"%s",fn);
					}

					{
					
					
					
										
						struct tm     *pictm;
						pictm = localtime(&statbuf.st_mtime);
						char   picdate[64];
						strftime(picdate,sizeof(picdate), "%Y%m%d_%H%M%S",pictm);
						
						
						char pickey[FILENAME_MAX];
						snprintf(pickey,sizeof(pickey),"%s_%s",picdate,ft);


						liqcell *c = liqcell_quickcreatevis(pickey,   "picture",   1,1,1,1    );
						liqcell_propseti(c,"lockaspect",1);
						liqcell_propsets(c,"imagefilename",imagethumb);
						//liqcell_handleradd(c,    "mouse",   widget_mouse);
						liqcell_handleradd(c,    "shown",         liqrecentphotos_item_shown);
						liqcell_handleradd(c,    "click",         liqrecentphotos_item_click);
					//	liqcell_handleradd(c,    "imageloaded",   liqrecentphotos_item_imageloaded);
						liqcell_handleradd_withcontext(c, "dialog_open", liqrecentphotos_item_dialog_open ,self);
						liqcell_handleradd_withcontext(c, "dialog_close", liqrecentphotos_item_dialog_close ,self);


						liqcell_child_insertsortedbyname( body, c, 0 );

					}


				}
			}
		}
		closedir(dir_p);
}
Ejemplo n.º 9
0
static int liqrecentphotos_item_add(liqcell *self,char *filenamebuffer)
{
	// 20090528_215559 lcuk : first attempt at runtime expansion
	// 20090528_215639 lcuk : its a hack because i should be using the filemonitor class elsewhere
	// 20090528_215654 lcuk : and it should be automatic
	// 20090528_215943 lcuk : class should be pre-tested or something here
	// 20090528_215951 lcuk : this runtime function would obviously be too slow for normal use

	liqapp_log("adding %s",filenamebuffer);

	//struct pagefilename pfn;
	//if(	(pagefilename_breakapart(&pfn,filenamebuffer) == 0) )
    
	{
		
		
		//char buf[FILENAME_MAX];			snprintf(buf,sizeof(buf),"%s%s",pfn.filedate,pfn.filetitle);

		liqcell *body = liqcell_child_lookup( self,"body");


			struct stat     statbuf;
			if(stat(filenamebuffer, &statbuf) == -1)
			{
				liqapp_log("liqrecentphotos_item_add stat failed: '%s'",filenamebuffer);
				return -1;
			}
                
						struct tm     *pictm;
						pictm = localtime(&statbuf.st_mtime);
						char   picdate[64];
						strftime(picdate,sizeof(picdate), "%Y%m%d_%H%M%S",pictm);
                        
                        
						char pickey[FILENAME_MAX];
						snprintf(pickey,sizeof(pickey),"%s_%s", picdate, liqapp_filename_walkoverpath(filenamebuffer) );
                        
                        
                        

	
						liqcell *c = liqcell_quickcreatevis(pickey,   "picture",   1,1,1,1    );
						liqcell_propseti(c,"lockaspect",1);
						liqcell_propsets(c,"imagefilename",filenamebuffer);
						
						liqcell_handleradd(c,    "shown",         liqrecentphotos_item_shown);
						liqcell_handleradd(c,    "click",         liqrecentphotos_item_click);
						liqcell_handleradd(c,    "imageloaded",   liqrecentphotos_item_imageloaded);

						liqcell_handleradd_withcontext(c, "dialog_open", liqrecentphotos_item_dialog_open ,self);
						liqcell_handleradd_withcontext(c, "dialog_close", liqrecentphotos_item_dialog_close ,self);


						liqcell_child_insertsortedbyname( body, c,0);
						
						
						
						liqcell_handlerrun(self,"layout",NULL);
						
						
						
						
						//liqcell_setsize(body,self->w,self->h);
						//liqcell_child_arrange_makegrid(body,3,3);
	}					
}
Ejemplo n.º 10
0
/**
 * define a tool column  (not tested, just an idea)
 *
 */
liqcell *uitoolcol_create(char *key,char *caption, ...)
{
	

	liqcell *self = liqcell_quickcreatewidget(key,"form", 56,480);

	if(self)
	{


		if(caption && *caption) liqcell_setcaption(   self, caption );
		//liqcell_setimage(  self,  liqimage_cache_getfile( "/usr/share/liqbase/liqtutor/media/texturestrip_dark.jpg",0,0,0) );
		liqcell_setimage(  self,  liqimage_cache_getfile( "/usr/share/liqbase/liqtutor/media/toolcol_background.png",0,0,0) );
		liqcell_propseti(  self ,  "lockaspect",0 );


		// main background
		liqcell *back = liqcell_quickcreatevis("background",   "background",   0,0,   800,56 );

			int cnt=0;
			va_list arg;
			va_start(arg, caption);
			while(1)
			{
				liqcell *c = va_arg(arg, liqcell *);
				if(!c)break;
				liqcell_child_append(back,c);
				cnt++;
			};
			//liqcell_child_multiinserta(self,arg);
			va_end(arg);
			
			
			int ch = self->h / cnt;
			// extra validation
			if((ch*cnt)>self->h)ch--;		
			
			liqcell *c=liqcell_getlinkchild(back);
			while(c)
			{
				//...
				if(liqcell_getvisible(c))
				{
					liqcell_setsize(c,56,ch);
				}
				c=liqcell_getlinknext(c);
			}
			liqcell_child_arrange_easycol(back);

			liqcell_child_append(self,back);
		
		
		// divider
		//liqcell *sep = liqcell_quickcreatevis("sep",   "sep",   0,0,  1,480 );
		//	liqcell_propsets(     sep,	"backcolor", "rgb(191,217,56)"  );
		//	liqcell_child_append(self,sep);
		
		// layout
		
		liqcell_child_arrange_easyrow(self);
		
		liqcell_handleradd(   self,   "resize",   uitoolcol_resize);
		
		
	}
	return self;
}
Ejemplo n.º 11
0
/**   
 * create a new desktopmanage widget
 */   
liqcell *desktopmanage_create()
{
	

	liqcell *self = liqcell_quickcreatewidget("desktopmanage", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'desktopmanage'"); return NULL;  } 
/*	
	//############################# buttonback:commandbutton
	liqcell *buttonback = liqcell_quickcreatevis("buttonback", "commandbutton", 0, 480-56, 56, 56);
	liqcell_setfont(   buttonback, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(buttonback, "Back" );
	//liqcell_propsets(  buttonback, "textcolor", "rgb(0,0,0)" );
	//liqcell_propsets(  buttonback, "backcolor", "rgb(235,233,237)" );
	liqcell_propseti(  buttonback, "textalign", 2 );
	liqcell_child_append(  self, buttonback);
 */	

/*	//############################# icon:label
	liqcell *icon = liqcell_quickcreatevis("icon", "label", 56, 0, 56, 56);
	liqcell_setfont(   icon, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
	liqcell_setcaption(icon, "icon" );
	liqcell_propsets(  icon, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  icon, "backcolor", "rgb(0,0,0)" );
	liqcell_propsets(  icon, "bordercolor", "rgb(200,100,100)" );
	liqcell_propseti(  icon, "textalign", 2 );
	liqcell_child_append(  self, icon);
 */

/*
	//############################# title:label
	liqcell *title = liqcell_quickcreatevis("title", "label", 120, 8, 396, 40);
	liqcell_setfont(   title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(title, "Available items" );
	//liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
	//liqcell_propsets(  title, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  title, "textalign", 0 );
	liqcell_child_append(  self, title);
 

 */
	/*	liqcell *tbar = uitoolcol_create("tools","tools",
				uitoolitem_create( "reset",     "reset",         "../media/quickicons/stock_refresh.png",    toolitem_click),
				uitoolitem_create( "delete", "delete",     "../media/quickicons/gtk-remove.png",           toolitem_click),
				uitoolitem_create( "add",    "add",        "../media/quickicons/add.png",              toolitem_click),
				uitoolitem_create( "edit", "edit",     "../media/quickicons/package_graphics.png",           toolitem_click),
				//uitoolitem_create( "close",  "close",      "../media/quickicons/gtk-close.png",    toolitem_click),
				uitoolitem_create( "back",   "back",       "../media/quickicons/back.png",              toolitem_click),
				NULL);

		liqcell_child_append( self, tbar );
	*/
	

	//############################# list1:picturebox
	liqcell *list1 = liqcell_quickcreatevis("list1", "picturebox", 0,0, 800, 480);
	//liqcell_setfont(	list1, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
	//liqcell_propsets(  list1, "textcolor", "rgb(0,0,0)" );
	//liqcell_propsets(  list1, "backcolor", "rgb(0,0,0)" );
	//liqcell_propsets(  list1, "bordercolor", "rgb(200,100,100)" );
	
	
		//############################# backplane:picturebox
		liqcell *backplane = liqcell_quickcreatevis("backplane", "picturebox", 0, 0, list1->w, list1->h);
		//liqcell_setfont(	backplane, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
		//liqcell_propsets(  backplane, "textcolor", "rgb(0,0,0)" );
		//liqcell_propsets(  backplane, "backcolor", "rgb(0,0,0)" );
		//liqcell_propsets(  backplane, "bordercolor", "rgb(200,100,100)" );			
	
			// now, we fill the list
			dllcacheitem *dllcache = NULL;
			int           dllcache_used = 0;
			
			dllcache = dllcache_getbase();
			if(!dllcache)
			{
				liqapp_log("could not init dllcache");
				return NULL;
			}
			
			
			dllcache_used = dllcache_getused();
			
			int idx=0;
			for(idx=0;idx<dllcache_used;idx++)
			{
				dllcacheitem * dllcacheitem = &dllcache[ idx ];
                
                
                if( strcasecmp(dllcacheitem->key,"liqtimer")==0) continue;
                if( strcasecmp(dllcacheitem->key,"textbox")==0) continue;
                if( strcasecmp(dllcacheitem->key,"desktopmanage")==0) continue;
                if( strcasecmp(dllcacheitem->key,"liqbase-playground")==0) continue;
               

				//############################# listitem:picturebox
				liqcell *listitem = liqcell_quickcreatevis(dllcacheitem->key, NULL, 0, 0, list1->w, 100);

				//liqcell_setfont(	listitem, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
				//liqcell_propsets(  listitem, "textcolor", "rgb(0,0,0)" );
                

				//liqcell_propsets(  listitem, "bordercolor", "rgb(200,100,100)" );
					//############################# listitemtick:checkbox
					liqcell *listitemtick = liqcell_quickcreatevis("listitemtick", "checkbox", 0, 20, 60, 60);
					liqcell_setfont(	listitemtick, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (34), 0) );
					
					// set to YN depending on if this is directly on the playground
                    
                    
				//	liqcell_setcaption(listitemtick, "Y" );
				//	liqcell_propsets(  listitemtick, "textcolor", "rgb(0,255,0)" );
                    
					liqcell_setcaption(listitemtick, "N" );
					liqcell_propsets(  listitemtick, "textcolor", "rgb(255,0,0)" );
                    
					liqcell_propsets(  listitemtick, "backcolor", "rgb(40,40,40)" );
					liqcell_propseti(  listitemtick, "textalign",  2 );
					liqcell_propseti(  listitemtick, "textaligny", 2 );
					liqcell_handleradd(listitemtick, "click", listitemtick_click );
					liqcell_child_append(  listitem, listitemtick);
					
					
					//############################# listitemicon:picturebox
					char buf[FILENAME_MAX];
					liqcell_historystore_historythumb_getfilename(buf,sizeof(buf), dllcacheitem->key);

					liqcell *listitemicon = liqcell_quickcreatevis("listitemicon", "icon", 60, 5, 130, 90);
					liqcell_setcaption(listitemicon, dllcacheitem->key );
					liqcell_propsets(  listitemicon, "imagefilename", buf );
					liqcell_propseti(  listitemicon, "aspectlock", 1 );
					//liqcell_setfont(	listitemicon, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
					//liqcell_propsets(  listitemicon, "textcolor", "rgb(0,0,0)" );
					liqcell_propsets(  listitemicon, "backcolor", "rgb(100,150,200)" );
					liqcell_propsets(  listitemicon, "bordercolor", "rgb(200,100,100)" );
					liqcell_handleradd_withcontext(listitemicon, "click", listitemicon_click ,self);
					liqcell_child_append(  listitem, listitemicon);
					
					//############################# listitemname:label
					liqcell *listitemname = liqcell_quickcreatevis("listitemname", "label", 200, 0, 400, 60);
					liqcell_setfont(	listitemname, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (35), 0) );
					liqcell_setcaption(listitemname, dllcacheitem->key );
					liqcell_propsets(  listitemname, "textcolor", "rgb(255,255,100)" );
					//liqcell_propsets(  listitemname, "backcolor", "rgb(0,64,0)" );
					//liqcell_handleradd(listitemname, "click", listitemname_click );
					liqcell_propseti(  listitemname, "textalign", 0 );
					liqcell_child_append(  listitem, listitemname);
				// 20090503_232751 lcuk : move this here
				//liqcell_handleradd(listitem, "click", listitemname_click );	
				// 20090503_233423 lcuk : moved it back again
				
					//############################# listitemfilename:label
					liqcell *listitemfilename = liqcell_quickcreatevis("listitemfilename", "label", 210, 60, 590, 40);
					liqcell_setfont(	listitemfilename, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
					liqcell_setcaption(listitemfilename, dllcacheitem->filename );
					//liqcell_propsets(  listitemfilename, "textcolor", "rgb(255,255,255)" );
					//liqcell_propsets(  listitemfilename, "backcolor", "rgb(0,64,0)" );
					liqcell_propseti(  listitemfilename, "textalign", 0 );
					liqcell_child_append(  listitem, listitemfilename);
										
					//############################# listitemversion:label
					liqcell *listitemversion = liqcell_quickcreatevis("listitemversion", "label", 600, 0,200,30);
					liqcell_setfont(	listitemversion, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (18), 0) );
					liqcell_setcaption(listitemversion, "1.0" );
					//liqcell_propsets(  listitemversion, "textcolor", "rgb(255,255,255)" );
					//liqcell_propsets(  listitemversion, "backcolor", "rgb(0,64,0)" );
					liqcell_propseti(  listitemversion, "textalign", 1 );
					liqcell_child_append(  listitem, listitemversion);

					
					//############################# listitemlive:label
					liqcell *listitemlive = liqcell_quickcreatevis("listitemlive", "label", 750, 30,50,50);
					liqcell_setfont(	listitemlive, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (18), 0) );
					liqcell_setcaption(listitemlive, "N" );
					liqcell_propsets(  listitemlive, "textcolor", "rgb(255,0,0)" );
                    
					liqcell_propsets(  listitemlive, "backcolor", "rgb(40,40,40)" );

					//liqcell_propsets(  listitemlive, "textcolor", "rgb(255,255,255)" );
					//liqcell_propsets(  listitemlive, "backcolor", "rgb(0,64,0)" );
					liqcell_propseti(  listitemlive, "textalign", 1 );
					liqcell_handleradd_withcontext(listitemlive, "click", listitemlive_click,self );
					liqcell_child_append(  listitem, listitemlive);

					

					
					
				liqcell_child_insertsorted(  backplane, listitem);
			}
			//liqcell_child_arrange_easycol(  backplane );
            
            
            
            // now add the backcolorization in order
            {
                liqcell *c=liqcell_getlinkchild_visual(backplane);
                int idx=0;
                while(c)
                {
                    if(idx & 1)
                    {
                        liqcell_propsets(  c, "backcolor", "rgb(0,0,0)" );
                    }
                    else
                    {
                        liqcell_propsets(  c, "backcolor", "rgb(30,0,30)" );
                    }
                    c=liqcell_getlinknext_visual(c);
                    idx++;
                }
            }
            
            

			
			liqcell_child_arrange_autoflow( backplane );
            backplane->h+=40;
			
			
			liqcell_handleradd(backplane,    "mouse",   liqcell_easyhandler_kinetic_mouse );
			liqcell_child_append(  list1, backplane);
		
		liqcell_child_append(  self, list1);


	//############################# buttonaccept:commandbutton
	liqcell *buttonaccept = liqcell_quickcreatevis("buttonaccept", "commandbutton", 574, 418, 226, 62);
	liqcell_setfont(   buttonaccept, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(buttonaccept, "Update" );
	liqcell_propsets(  buttonaccept, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  buttonaccept, "backcolor", "xrgb(0,64,0)" );
	liqcell_propsets(  buttonaccept, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  buttonaccept, "textalign", 2 );
    liqcell_propseti(  buttonaccept, "textaligny", 2 );
	liqcell_handleradd_withcontext(buttonaccept, "click", buttonaccept_click,self );
	liqcell_child_append(  self, buttonaccept);
	
//	liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );

	liqcell_handleradd_withcontext(self, "dialog_open", desktopmanage_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", desktopmanage_dialog_close ,self);
    liqcell_handleradd_withcontext(self, "shown", desktopmanage_dialog_close ,self);

	liqcell_handleradd_withcontext(self,    "filter",   desktopmanage_filter,self);
	return self;
}
Ejemplo n.º 12
0
liqcell *liqui_create()
{
	
	liqcell *self = liqcell_quickcreatewidget("liqui","form", 800,480);
	
	if(self)
	{


			liqcell *body = liqcell_quickcreatewidget("body","frame", 800,480);
			
			liqcell_child_append( body,  uititlebar_create(   "ui", "User Interface test1", "The very first UI example I've tried" ) );	
			liqcell_child_append( body,  uiinfobar_create(    "head", "this is a user interface test") );
			liqcell_child_append( body,  uitextbox_create(    "nickname", "lcuk" ) );
			liqcell_child_append( body,  uicolorbox_create(   "favoritecolor", "rgb(50,150,50)" ) );
			liqcell_child_append( body,  uienumbox_create(    "level", "High", "Low;Medium;High;Godlike" ) );
			liqcell_child_append( body,  uitextbox_create(    "fullname", "Gary Birkett" ) );
			liqcell_child_append( body,  uitextbox_create(    "email", "*****@*****.**" ) );
			liqcell_child_append( body,  uipicturebox_create( "avatar", "/usr/share/liqbase/libliqbase/media/lcuk_avatar.jpg" ) );
			liqcell_child_append( body,  uinumberbox_create(  "karmabonus", "35" ) );
			liqcell_child_append( body,  uitextbox_create(    "karmarating", "Excellent" ) );
			liqcell_child_append( body,  uitextbox_create(    "homepage", "http://liqbase.net" ) );
			liqcell_child_append( body,  uitextbox_create(    "gender", "male" ) );
			//liqcell_child_append( body,  uibuttonstrip_create("options", "help,cancel,save" ) );
		
			liqcell_child_append( body,  uitextbox_create(    "title", "Fluid motion" ) );
			liqcell_child_append( body,  uitextbox_create(    "author", "Gary Birkett" ) );
			liqcell_child_append( body,  uitextbox_create(    "email", "*****@*****.**" ) );
			
			liqcell_child_append( body,  uicolorbox_create(   "pencolor", "rgb(255,255,0)" ) );
			liqcell_child_append( body,  uienumbox_create(    "pentrail", "Short", "Off;Short;Medium;Long" ) );
			
			liqcell_child_append( body,  uienumbox_create(    "backstyle", "Colored", "Blank;Colored;Textured" ) );
			liqcell_child_append( body,  uicolorbox_create(   "backcolor", "rgb(0,30,0)" ) );
			liqcell_child_append( body,  uipicturebox_create( "backimage", "/usr/share/liqbase/libliqbase/media/lcuk_avatar.jpg" ) );


			liqcell_child_append( body,  uienumbox_create(    "starcount", "200", "50;100;150;200;300;400;500" ) );
			liqcell_child_append( body,  uienumbox_create(    "starsize", "Medium", "Small;Medium;Large" ) );
			liqcell_child_append( body,  uipicturebox_create( "starimage", "/usr/share/liqbase/libliqbase/media/lcuk_avatar.jpg" ) );
			
			liqcell_child_append( body,  uienumbox_create(    "gravity", "Medium", "None;Light;Medium;Strong" ) );
				
			liqcell_child_arrange_autoflow(body);
			
			body->h += 60 + 10;	// make sure it can extend enough to fit the accept button
			
			liqcell_handleradd(body,    "mouse",   (void*)liqcell_easyhandler_kinetic_mouse);
			
		
		liqcell_child_append( self, body );


		//############################# cmdaccept:label
		liqcell *cmdaccept = liqcell_quickcreatevis("cmdaccept", "label", 580, 420, 210, 60);
		liqcell_setfont(	cmdaccept, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
		liqcell_setcaption(cmdaccept, "Save" );
		liqcell_propsets(  cmdaccept, "textcolor", "rgb(255,255,255)" );
		liqcell_propsets(  cmdaccept, "backcolor", "xrgb(0,64,0)" );
		liqcell_propsets(  cmdaccept, "bordercolor", "rgb(255,255,255)" );
		liqcell_propseti(  cmdaccept, "textalign", 2 );
		liqcell_propseti(  cmdaccept, "textaligny", 2 );
		liqcell_handleradd_withcontext(cmdaccept, "click", (void*)liqui_cmdaccept_click, self );
		liqcell_child_append(  self, cmdaccept);
		
		
	}


	return self;
}