Пример #1
0
/**
 * Create a numberbox ui component
 * @param caption The caption
 * @param datafefault Data caption
 * @return liqcell* The new numberbox
 */
liqcell *uinumberbox_create(const char *caption, const char *datadefault)
{
	
	liqcell *self = liqcell_quickcreatewidget(caption,"uinumberbox", 800,80);
	
	if(self)
	{

		liqcell_propsets(  self,  "backcolor", "rgb(0,0,0)" );
		
			liqcell *body = liqcell_quickcreatevis("body","frame", 10,10,   200,60);
			liqcell_setfont(   body,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
			liqcell_propsets(  body,  "backcolor", "rgb(40,40,40)" );
			liqcell_propsets(  body,  "textcolor", "rgb(255,255,255)" );
			liqcell_setcaption(body,  caption );
		liqcell_child_insert( self, body );
		
		
			liqcell *data = liqcell_quickcreatevis("data","frame", 220,5,   560,70);
			liqcell_setfont(   data,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (42), 0) );
			liqcell_propsets(  data,  "backcolor", "rgb(220,220,255)" );
			liqcell_propsets(  data,  "textcolor", "rgb(0,0,0)" );
			liqcell_setcaption(data,  datadefault );
		
		
		liqcell_child_insert( self, data );
	}
	return self;
}
Пример #2
0
/**
 * Create a txtmsgbox ui component, this is the development function
 * @param caption Body Caption
 * @param datadefault Caption of the data
 * @return liqcell* The new textbox
 */
liqcell *uitxtmsgbox_create(const char *caption, const char *datadefault)
{
	
	liqcell *self = liqcell_quickcreatewidget(caption,"txtmsgbox", 800,220);
	
	if(self)
	{

		liqcell_propsets(  self,  "backcolor", "rgb(0,0,0)" );
		
			liqcell *body = liqcell_quickcreatevis("body","frame", 10,10,   200,60);
			liqcell_setfont(   body,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
			liqcell_propsets(  body,  "backcolor", "rgb(40,40,40)" );
			liqcell_propsets(  body,  "textcolor", "rgb(255,255,255)" );
			liqcell_setcaption(body,  caption );
		liqcell_child_insert( self, body );
		
		
			liqcell *data = liqcell_quickcreatevis("data","textbox", 220,5,   560,210);
			liqcell_setfont(   data,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (64), 0) );
			liqcell_propsets(  data,  "backcolor", "rgb(220,255,220)" );
			liqcell_propsets(  data,  "textcolor", "rgb(0,0,0)" );
			liqcell_propseti(  data,  "wordwrap", 1 );
			liqcell_propseti(  data,  "maxlength",  140 );
			liqcell_handleradd_withcontext(data, "captionchange", (void*)uitxtmsgbox_captionchange ,self);

			liqcell_setcaption(data,  datadefault );
		liqcell_child_insert( self, data );

	}
	return self;
}
Пример #3
0
/**	
 * create a new liqtasks_new widget
 */	
liqcell *liqtasks_new_create()
{
	liqcell *self = liqcell_quickcreatewidget("liqtasks_new", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'liqtasks_new'"); return NULL;  } 
	
	// Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
	// Optimization:  use only what you NEED to get an effect
	// Optimization:  Minimal layers and complexity
	// Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
	// Optimization:  defaults: text, white, very fast rendering
	//############################# editor:label
	liqcell *editor = liqcell_quickcreatevis("editor", "label", 0, 0, 800, 480);
	liqcell_setfont(	editor, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
	liqcell_setcaption(editor, "backplane" );
	liqcell_propsets(  editor, "textcolor", "rgb(255,0,0)" );
	liqcell_propsets(  editor, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  editor, "textalign", 2 );
	liqcell_propseti(  editor, "textaligny", 2 );
	liqcell_child_append(  self, editor);
	//############################# title:label
	liqcell *title = liqcell_quickcreatevis("title", "label", 0, 0, 800, 52);
	liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(title, "New Task" );
	liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  title, "backcolor", "xrgb(128,128,128)" );
	liqcell_propseti(  title, "textalign", 0 );
	liqcell_propseti(  title, "textaligny", 0 );
	liqcell_child_append(  self, title);
	//############################# cmdsave:label
	liqcell *cmdsave = liqcell_quickcreatevis("cmdsave", "label", 594, 432, 206, 48);
	liqcell_setfont(	cmdsave, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdsave, "Save" );
	liqcell_propsets(  cmdsave, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdsave, "backcolor", "xrgb(0,64,0)" );
	liqcell_propsets(  cmdsave, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdsave, "textalign", 2 );
	liqcell_propseti(  cmdsave, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdsave, "click", (void*)cmdsave_click, self );
	liqcell_child_append(  self, cmdsave);
	//liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	//liqcell_setimage(  self ,  liqimage_cache_getfile( "/usr/share/liqbase/liqtasks/media/liqtasks_new_back.png",0,0,0) );
	liqcell_handleradd_withcontext(self, "filter",		 (void*)liqtasks_new_filter ,self);
	liqcell_handleradd_withcontext(self, "refresh",		(void*)liqtasks_new_refresh ,self);
	liqcell_handleradd_withcontext(self, "shown",		  (void*)liqtasks_new_shown ,self);
	liqcell_handleradd_withcontext(self, "resize",	  (void*)liqtasks_new_resize ,self);
	liqcell_handleradd_withcontext(self, "layout",	  (void*)liqtasks_new_layout ,self);
	//liqcell_handleradd_withcontext(self, "keypress",	(void*)liqtasks_new_keypress,self );
	//liqcell_handleradd_withcontext(self, "keyrelease", (void*)liqtasks_new_keyrelease ,self);
	//liqcell_handleradd_withcontext(self, "mouse",		(void*)liqtasks_new_mouse,self );
	//liqcell_handleradd_withcontext(self, "click",		(void*)liqtasks_new_click ,self);
	//liqcell_handleradd_withcontext(self, "paint",		(void*)liqtasks_new_paint ,self); // use only if required, heavyweight
	liqcell_handleradd_withcontext(self, "dialog_open",  (void*)liqtasks_new_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", (void*)liqtasks_new_dialog_close ,self);
	return self;
}
Пример #4
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;
}
Пример #5
0
/**
 * Create a colorbox ui component
 * @param caption The caption
 * @param datafefault Data caption
 * @return liqcell* The new colorbox
 */
liqcell *uicolorbox_create(const char *caption, const char *datadefault)
{
	
	liqcell *self = liqcell_quickcreatewidget(caption,"uicolorbox", 800,150);
	
	if(self)
	{

		liqcell_propsets(  self,  "backcolor", "rgb(0,0,0)" );
		
			liqcell *body = liqcell_quickcreatevis("body","frame", 10,10,   200,130);
			liqcell_setfont(   body,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
			liqcell_propsets(  body,  "backcolor", "rgb(40,40,40)" );
			liqcell_propsets(  body,  "textcolor", "rgb(255,255,255)" );
			liqcell_setcaption(body,  caption );
		liqcell_child_insert( self, body );	
		
			liqcell *data = liqcell_quickcreatevis("data","frame", 270,5,   460,140);
			liqcell_propsets(  data,  "backcolor", datadefault );
			
			
		liqcell_handleradd_withcontext(data, "click", (void*)uicolorbox_click, self );


		liqcell_child_insert( self, data );
	}
	return self;
}
Пример #6
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;
}
Пример #7
0
/**
 * Create a infobar ui component
 * @param infotext Caption of the bar
 * @return liqcell* The new infobar
 */
liqcell *uiinfobar_create(const char *key, const char *infotext)
{
	
	liqcell *self = liqcell_quickcreatewidget(key,"uiinfobar", 800,80);
	
	if(self)
	{

		liqcell_propsets(  self,  "backcolor", "rgb(0,0,0)" );
	
			liqcell *body = liqcell_quickcreatevis("body","frame", 10,10,   780,60);
			liqcell_setfont(   body,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (36), 0) );
			liqcell_propsets(  body,  "backcolor", "rgb(40,40,40)" );
			liqcell_propsets(  body,  "textcolor", "rgb(220,220,255)" );
			liqcell_setcaption(body,  infotext );
			
			
			//liqcell_propseti(  body,  "selstart",  5 );
			//liqcell_propseti(  body,  "sellength", 12 );
			//liqcell_propseti(  body,  "cursorpos", 17 );
			
			//liqcell_handleradd(body,    "mouse",      textbox_mouse);
			//liqcell_handleradd(body,    "keypress",   textbox_keypress);
			//liqcell_handleradd(body,    "keyrelease", textbox_keyrelease);
			
			
		
		
		liqcell_child_insert( self, body );
	}
	return self;
}
Пример #8
0
/**
 * Create a titlebar ui component
 * @param key Name of the widget
 * @param title Title to display
 * @param description Describe what this titlebar is for
 * @return liqcell* The new titlebar
 */
liqcell *uititlebar_create(const char *key, const char *title, const char *description)
{
	
	liqcell *self = liqcell_quickcreatewidget(key,"section", 800,100);
	
	if(self)
	{
		liqcell_propsets(  self,  "backcolor", "rgb(0,0,0)" );
		
		//texturestrip_blu.jpg
		liqcell_setimage(  self,  liqimage_cache_getfile( "/usr/share/liqbase/libliqbase/media/texturestrip_dark.jpg",0,0,0) );
		liqcell_propseti(self,"lockaspect",0);
		//liqcell_propsets(  self,  "backcolor", "xrgb(0,0,64)" );
	
		
		liqcell_child_append( self, liqcell_quickcreatevis("app_icon",   "icon",    5   ,10  ,    90, 80 )    );
		liqcell_child_append( self, liqcell_quickcreatevis("app_title",  "label",   100 ,0  ,   700, 55 )    );
		liqcell_child_append( self, liqcell_quickcreatevis("app_desc",   "label",   100 ,55 ,   700, 40 )    );

		liqcell_setimage(  liqcell_child_lookup( self,"app_icon"),  liqimage_cache_getfile( "/usr/share/liqbase/libliqbase/media/sun.png",0,0,1) );
		liqcell_setfont(   liqcell_child_lookup( self,"app_title"), liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (40), 0) );
		liqcell_setfont(   liqcell_child_lookup( self,"app_desc"),  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (18), 0) );


		liqcell_propsets(  liqcell_child_lookup( self,"app_title"), "textcolor", "rgb(255,255,255)" );
		liqcell_propsets(  liqcell_child_lookup( self,"app_desc"),  "textcolor", "rgb(0,100,0)" );

		liqcell_setcaption(liqcell_child_lookup( self,"app_title"), title );
		liqcell_setcaption(liqcell_child_lookup( self,"app_desc"), description );

/*
			liqcell *clock = liqcell_quickcreatevis("clock",   "time",   500,0,   200,100 );
			//char buf[80];
			//liqapp_format_strftime(buf,80,"%H:%M:%S");
			//liqcell_setcaption(   clock, buf);
			liqcell_propsets(     clock,"timeformat","%H:%M:%S");
			liqcell_propseti(     clock,"textalign",2);
			liqcell_propseti(     clock,"textaligny",2);
			liqcell_propsets(     clock,"fontname", "/usr/share/fonts/nokia/nosnb.ttf" );
			liqcell_propseti(     clock,"fontsize", 32 );
			liqcell_propsets(     clock, "textcolor", "rgb(255,255,255)" );
		//	liqcell_handleradd(self,    "mouse",   widget_mouse);
			liqcell_child_append( self, clock    );
 */
	}
	return self;
}
Пример #9
0
/**	Construct a simplebar */
liqcell *simplebar_create()
{
	liqcell *self = liqcell_quickcreatewidget("simplebar", "form", 600, 50);
	
	// exit if fail create
	if(!self)
	{
		liqapp_log("liqcell error not create 'simplebar'"); 
		return NULL;
	}
	
	// create label
	liqcell *simple_label = liqcell_quickcreatevis("simple_label", "label", 20, 7, 200, 36);
	liqcell_setfont(simple_label, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0));
	liqcell_setcaption(simple_label, "Body Caption:");
	liqcell_propsets(simple_label, "textcolor", GREEN);
	liqcell_propseti(simple_label, "textalign", 1);
	liqcell_child_append(self, simple_label);
	
	// create textbox
	liqcell *simple_textbox = liqcell_quickcreatevis("simple_textbox", "textbox", 220, 7, 200, 36);
	liqcell_setfont(simple_textbox, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(simple_textbox, "");
	liqcell_propsets(simple_textbox, "textcolor", WHITE);
	liqcell_propsets(simple_textbox, "backcolor", BLACK);
	liqcell_propsets(simple_textbox, "bordercolor", GREEN);
	liqcell_propseti(simple_textbox, "textalign", 0);
	liqcell_propseti(simple_textbox, "textaligny", 2);
	liqcell_child_append(self, simple_textbox);
	
	// create buttom: Submit
	liqcell *simple_submit = liqcell_quickcreatevis("simple_submit", "commandbutton", 460, 7, 76, 32);
	liqcell_setfont(simple_submit, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(simple_submit, "Submit");
	liqcell_propsets(simple_submit, "textcolor", GREEN);
	liqcell_propsets(simple_submit, "backcolor", BLACK);
	liqcell_handleradd_withcontext(simple_submit, "click", simplebar_submit_click, self);
	liqcell_propseti(simple_submit, "textalign", 1);
	liqcell_child_append(self, simple_submit);
	
	return self;
}
Пример #10
0
/**	
 * uienumbox_node_setformat
 * set the display formatting for this item - whether selected or not
 */	
static int uienumbox_node_setformat(liqcell *node,int isselected)
{

		if(isselected)
		{
			liqcell_setfont(   node,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (32), 0) );
			liqcell_propsets(  node,  "backcolor", "rgb(220,220,255)" );
			liqcell_propsets(  node,  "textcolor", "rgb(0,0,0)" );
			liqcell_propsets(  node,  "bordercolor", "rgb(255,255,255)" );
			liqcell_setselected(node, 1);
		}
		else
		{
			liqcell_setfont(   node,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
			liqcell_propsets(  node,  "backcolor", "rgb(200,200,205)" );
			liqcell_propsets(  node,  "textcolor", "rgb(30,30,30)" );
			liqcell_propsets(  node,  "bordercolor", "rgb(128,128,128)" );
			liqcell_setselected(node, 0);					
		}

	return 0;
}
Пример #11
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;
}
Пример #12
0
/**	
 * uitxtmsgbox.captionchange clicked
 */	
static int uitxtmsgbox_captionchange(liqcell *self,liqcelleventargs *args, liqcell *uitxtmsgbox)
{

	int tl = strlen(liqcell_getcaption(self));
    

    //liqcell *messageremain = liqcell_child_lookup(uitxtmsgbox, "messageremain");
    //liqcell_setcaption_printf(messageremain,"%i",50-tl);
	
	if(tl>100)
	{
		liqcell_setfont(	self, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	}
	else
	if(tl>80)
	{
		liqcell_setfont(	self, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (34), 0) );
	}
	else
	if(tl>60)
	{
		liqcell_setfont(	self, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (40), 0) );
	}
	else
	if(tl>40)
	{
		liqcell_setfont(	self, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (48), 0) );
	}
	else
	if(tl>20)
	{
		liqcell_setfont(	self, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (56), 0) );
	}
	else
	{
		liqcell_setfont(	self, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (64), 0) );
	}
    
    

	return 0;
}
Пример #13
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;
}
Пример #14
0
/**
 * create a new liqmap widget
 */
liqcell *liqmap_create()
{
    liqcell *self = liqcell_quickcreatewidget("liqmap", "form", 800, 480);
    if(!self) {
        liqapp_log("liqcell error not create 'liqmap'");
        return NULL;
    }

    // Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
    // Optimization:  use only what you NEED to get an effect
    // Optimization:  Minimal layers and complexity
    // Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
    // Optimization:  defaults: text, white, very fast rendering
    //############################# liqmapzoom1:liqmapzoom
    liqcell *liqmapzoom1 = liqcell_quickcreatevis("liqmapzoom1", "liqmapzoom", 0, 56, 800, 480-56);
    liqcell_child_append(  self, liqmapzoom1);

    //############################# title:label
    liqcell *title = liqcell_quickcreatevis("title", "label", 0, 0, 800, 56);
    liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
    liqcell_setcaption(title, "liqmap viewer" );
    liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
    liqcell_propsets(  title, "backcolor", "xrgb(128,128,128)" );
    liqcell_propseti(  title, "textalign", 0 );
    liqcell_propseti(  title, "textaligny", 0 );
    liqcell_child_append(  self, title);
    //############################# cmdreset:label
    liqcell *cmdreset = liqcell_quickcreatevis("cmdreset", "label", 434, 0, 146, 56);
    liqcell_setfont(	cmdreset, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
    liqcell_setcaption(cmdreset, "reset" );
    liqcell_propsets(  cmdreset, "textcolor", "rgb(255,255,255)" );
    liqcell_propsets(  cmdreset, "backcolor", "xrgb(0,64,64)" );
    liqcell_propsets(  cmdreset, "bordercolor", "rgb(255,255,255)" );
    liqcell_propseti(  cmdreset, "textalign", 2 );
    liqcell_propseti(  cmdreset, "textaligny", 2 );
    liqcell_handleradd_withcontext(cmdreset, "click", cmdreset_click, self );
    liqcell_child_append(  self, cmdreset);
    //############################# cmdchange:label
    liqcell *cmdchange = liqcell_quickcreatevis("cmdchange", "label", 582, 0, 148, 56);
    liqcell_setfont(	cmdchange, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
    liqcell_setcaption(cmdchange, "change" );
    liqcell_propsets(  cmdchange, "textcolor", "rgb(255,255,255)" );
    liqcell_propsets(  cmdchange, "backcolor", "xrgb(0,64,0)" );
    liqcell_propsets(  cmdchange, "bordercolor", "rgb(255,255,255)" );
    liqcell_propseti(  cmdchange, "textalign", 2 );
    liqcell_propseti(  cmdchange, "textaligny", 2 );
    liqcell_handleradd_withcontext(cmdchange, "click", cmdchange_click, self );
    liqcell_child_append(  self, cmdchange);

    //liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
    //liqcell_setimage(  self ,  liqimage_cache_getfile( "/usr/share/liqbase/liqmap/media/liqmap_back.png",0,0,0) );
//	liqcell_handleradd_withcontext(self, "filter", liqmap_filter ,self);
    liqcell_handleradd_withcontext(self, "refresh", liqmap_refresh ,self);
    liqcell_handleradd_withcontext(self, "shown", liqmap_shown ,self);
    //liqcell_handleradd_withcontext(self, "resize", liqmap_resize ,self);
    //liqcell_handleradd_withcontext(self, "keypress", liqmap_keypress,self );
    //liqcell_handleradd_withcontext(self, "keyrelease", liqmap_keyrelease ,self);
    //liqcell_handleradd_withcontext(self, "mouse", liqmap_mouse,self );
    //liqcell_handleradd_withcontext(self, "click", liqmap_click ,self);
    //liqcell_handleradd_withcontext(self, "paint", liqmap_paint ,self); // use only if required, heavyweight
    liqcell_handleradd_withcontext(self, "dialog_open", liqmap_dialog_open ,self);
    liqcell_handleradd_withcontext(self, "dialog_close", liqmap_dialog_close ,self);
    return self;
}
Пример #15
0
/**	
 * create a new invar_calibrate widget
 */	
liqcell *invar_calibrate_create()
{
	liqcell *self = liqcell_quickcreatewidget("invar_calibrate", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'invar_calibrate'"); return NULL;  } 
	
	// Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
	// Optimization:  use only what you NEED to get an effect
	// Optimization:  Minimal layers and complexity
	// Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
	// Optimization:  defaults: text, white, very fast rendering
	//############################# label1:label
	liqcell *label1 = liqcell_quickcreatevis("label1", "label", 142, 430, 422, 36);
	liqcell_setfont(	label1, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(label1, "Calibration incomplete" );
	liqcell_propsets(  label1, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  label1, "backcolor", "rgb(255,0,0)" );
	liqcell_propseti(  label1, "textalign", 2 );
	liqcell_propseti(  label1, "textaligny", 2 );
	liqcell_child_append(  self, label1);
	//############################# label3:label
	liqcell *label3 = liqcell_quickcreatevis("label3", "label", 0, 86, 800, 30);
	liqcell_setfont(	label3, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
	liqcell_setcaption(label3, "Place device in each corner of the detection range and click corrposponding button" );
	liqcell_propsets(  label3, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  label3, "backcolor", "rgb(0,64,0)" );
	liqcell_propseti(  label3, "textalign", 2 );
	liqcell_propseti(  label3, "textaligny", 2 );
	liqcell_child_append(  self, label3);

	//############################# cmdsave:label
	liqcell *cmdsave = liqcell_quickcreatevis("cmdsave", "label", 574, 418, 226, 62);
	liqcell_setfont(	cmdsave, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdsave, "Save" );
	liqcell_propsets(  cmdsave, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdsave, "backcolor", "xrgb(0,64,0)" );
	liqcell_propsets(  cmdsave, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdsave, "textalign", 2 );
	liqcell_propseti(  cmdsave, "textaligny", 2 );
	liqcell_setenabled(  cmdsave, 0 );
	liqcell_handleradd_withcontext(cmdsave, "click", (void*)cmdsave_click, self );
	liqcell_child_append(  self, cmdsave);
	//############################# title:label
	liqcell *title = liqcell_quickcreatevis("title", "label", 0, 0, 800, 56);
	liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(title, "invar :: calibration utility" );
	liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  title, "backcolor", "xrgb(64,64,0)" );
	liqcell_propseti(  title, "textalign", 0 );
	liqcell_propseti(  title, "textaligny", 0 );
	liqcell_child_append(  self, title);
	
	
	
	//############################# lblbackground:label
	liqcell *lblbackground = liqcell_quickcreatevis("lblbackground", "label", 98, 130, 586, 272);
	liqcell_setfont(	lblbackground, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
	liqcell_setcaption(lblbackground, "Label4" );
	liqcell_propsets(  lblbackground, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  lblbackground, "backcolor", "rgb(235,233,237)" );
	liqcell_propseti(  lblbackground, "textalign", 0 );
	liqcell_propseti(  lblbackground, "textaligny", 0 );
	liqcell_child_append(  self, lblbackground);
	//############################# cmdbottomright:label
	liqcell *cmdbottomright = liqcell_quickcreatevis("cmdbottomright", "label", 536, 334, 144, 64);
	liqcell_setfont(	cmdbottomright, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(cmdbottomright, "bottom right" );
	liqcell_propsets(  cmdbottomright, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdbottomright, "backcolor", "xrgb(64,0,0)" );
	liqcell_propseti(  cmdbottomright, "textalign", 2 );
	liqcell_propseti(  cmdbottomright, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdbottomright, "click", (void*)cmdbottomright_click, self );
	liqcell_child_append(  self, cmdbottomright);
	//############################# cmdtopleft:label
	liqcell *cmdtopleft = liqcell_quickcreatevis("cmdtopleft", "label", 102, 134, 144, 64);
	liqcell_setfont(	cmdtopleft, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(cmdtopleft, "top left" );
	liqcell_propsets(  cmdtopleft, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdtopleft, "backcolor", "xrgb(64,0,0)" );
	liqcell_propseti(  cmdtopleft, "textalign", 2 );
	liqcell_propseti(  cmdtopleft, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdtopleft, "click", (void*)cmdtopleft_click, self );
	liqcell_child_append(  self, cmdtopleft);
	//############################# cmdtopright:label
	liqcell *cmdtopright = liqcell_quickcreatevis("cmdtopright", "label", 536, 134, 144, 64);
	liqcell_setfont(	cmdtopright, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(cmdtopright, "top right" );
	liqcell_propsets(  cmdtopright, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdtopright, "backcolor", "xrgb(64,0,0)" );
	liqcell_propseti(  cmdtopright, "textalign", 2 );
	liqcell_propseti(  cmdtopright, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdtopright, "click", (void*)cmdtopright_click, self );
	liqcell_child_append(  self, cmdtopright);
	//############################# cmdbottomleft:label
	liqcell *cmdbottomleft = liqcell_quickcreatevis("cmdbottomleft", "label", 102, 334, 144, 64);
	liqcell_setfont(	cmdbottomleft, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(cmdbottomleft, "bottom left" );
	liqcell_propsets(  cmdbottomleft, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdbottomleft, "backcolor", "xrgb(64,0,0)" );
	liqcell_propseti(  cmdbottomleft, "textalign", 2 );
	liqcell_propseti(  cmdbottomleft, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdbottomleft, "click", (void*)cmdbottomleft_click, self );
	liqcell_child_append(  self, cmdbottomleft);
	
	
	//############################# label2:label
	liqcell *label2 = liqcell_quickcreatevis("label2", "label", 0, 56, 800, 30);
	liqcell_setfont(	label2, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
	liqcell_setcaption(label2, "Calibration tool for Inverted AR positioning system" );
	liqcell_propsets(  label2, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  label2, "backcolor", "rgb(0,64,0)" );
	liqcell_propseti(  label2, "textalign", 2 );
	liqcell_propseti(  label2, "textaligny", 2 );
	liqcell_child_append(  self, label2);

	//liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	//liqcell_setimage(  self ,  liqimage_cache_getfile( "/usr/share/liqbase/invar/media/invar_calibrate_back.png",0,0,0) );
	liqcell_handleradd_withcontext(self, "filter",		 (void*)invar_calibrate_filter ,self);
	liqcell_handleradd_withcontext(self, "refresh",		(void*)invar_calibrate_refresh ,self);
	liqcell_handleradd_withcontext(self, "shown",		  (void*)invar_calibrate_shown ,self);
	//liqcell_handleradd_withcontext(self, "resize",	  (void*)invar_calibrate_resize ,self);
	//liqcell_handleradd_withcontext(self, "keypress",	(void*)invar_calibrate_keypress,self );
	//liqcell_handleradd_withcontext(self, "keyrelease", (void*)invar_calibrate_keyrelease ,self);
	//liqcell_handleradd_withcontext(self, "mouse",		(void*)invar_calibrate_mouse,self );
	//liqcell_handleradd_withcontext(self, "click",		(void*)invar_calibrate_click ,self);
	//liqcell_handleradd_withcontext(self, "paint",		(void*)invar_calibrate_paint ,self); // use only if required, heavyweight
	liqcell_handleradd_withcontext(self, "dialog_open",  (void*)invar_calibrate_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", (void*)invar_calibrate_dialog_close ,self);
	return self;
}
Пример #16
0
/**	
 * create a new onetouchslide widget
 */	
liqcell *onetouchslide_create()
{
	liqcell *self = liqcell_quickcreatewidget("onetouchslide", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'onetouchslide'"); return NULL;  } 
	
	// Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
	// Optimization:  use only what you NEED to get an effect
	// Optimization:  Minimal layers and complexity
	// Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
	// Optimization:  defaults: text, white, very fast rendering
	//############################# slidebar1:slidebar
	liqcell *slidebar1 = liqcell_quickcreatevis("slidebar1", "slidebar", 184, 172, 524, 64);
	liqcell_child_append(  self, slidebar1);
	//############################# slidebar2:slidebar
	liqcell *slidebar2 = liqcell_quickcreatevis("slidebar2", "slidebar", 182, 250, 524, 64);
	liqcell_child_append(  self, slidebar2);
	//############################# slidebar3:slidebar
	liqcell *slidebar3 = liqcell_quickcreatevis("slidebar3", "slidebar", 182, 328, 524, 64);
	liqcell_child_append(  self, slidebar3);
	//############################# cmdsave:label
	liqcell *cmdsave = liqcell_quickcreatevis("cmdsave", "label", 586, 420, 198, 60);
	liqcell_setfont(	cmdsave, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdsave, "reset" );
	//liqcell_propsets(  cmdsave, "textcolor", "rgb(255,255,255)" );
	//liqcell_propsets(  cmdsave, "backcolor", "rgb(0,0,128)" );
	//liqcell_propsets(  cmdsave, "bordercolor", "rgb(200,100,100)" );	
	//liqcell_propseti(  cmdsave, "textalign", 2 );
	
	
		liqcell_propsets(  cmdsave, "textcolor", "rgb(0,0,0)" );
		//liqcell_propsets(  knob, "backcolor", "rgb(0,0,128)" );
		//liqcell_propsets(  knob, "bordercolor", "rgb(200,100,100)" );
		liqcell_propseti(  cmdsave, "textalign", 2 );
		liqcell_propseti(  cmdsave, "textaligny", 2 );
		liqcell_propsets(  cmdsave, "imagefilename",  "/usr/share/liqbase/onedotzero/media/button_back.png" );
		liqcell_propseti(  cmdsave,  "lockaspect",  0 );

	
	liqcell_handleradd_withcontext(cmdsave, "click", cmdsave_click, self );
	liqcell_child_append(  self, cmdsave);
	//############################# label4:label
	liqcell *label4 = liqcell_quickcreatevis("label4", "label", 62, 342, 100, 36);
	liqcell_setfont(	label4, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
	liqcell_setcaption(label4, "size" );
	liqcell_propsets(  label4, "textcolor", "rgb(255,255,255)" );
	//liqcell_propsets(  label4, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  label4, "textalign", 0 );
	liqcell_child_append(  self, label4);
	//############################# label3:label
	liqcell *label3 = liqcell_quickcreatevis("label3", "label", 26, 100, 762, 40);
	liqcell_setfont(	label3, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
	liqcell_setcaption(label3, "Watch the projector to see the results." );
	liqcell_propsets(  label3, "textcolor", "rgb(255,255,0)" );
	//liqcell_propsets(  label3, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  label3, "textalign", 0 );
	liqcell_child_append(  self, label3);
	//############################# label2:label
	liqcell *label2 = liqcell_quickcreatevis("label2", "label", 26, 56, 762, 40);
	liqcell_setfont(	label2, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
	liqcell_setcaption(label2, "Use your finger to change the slide bars." );
	liqcell_propsets(  label2, "textcolor", "rgb(255,255,0)" );
	//liqcell_propsets(  label2, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  label2, "textalign", 0 );
	liqcell_child_append(  self, label2);
	//############################# label1:label
	liqcell *label1 = liqcell_quickcreatevis("label1", "label", 62, 264, 100, 36);
	liqcell_setfont(	label1, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
	liqcell_setcaption(label1, "down" );
	liqcell_propsets(  label1, "textcolor", "rgb(255,255,255)" );
	//liqcell_propsets(  label1, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  label1, "textalign", 0 );
	liqcell_child_append(  self, label1);
	//############################# onetouchslide:label
	liqcell *onetouchslide = liqcell_quickcreatevis("onetouchslide", "label", 64, 184, 100, 40);
	liqcell_setfont(	onetouchslide, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
	liqcell_setcaption(onetouchslide, "across" );
	liqcell_propsets(  onetouchslide, "textcolor", "rgb(255,255,255)" );
	//liqcell_propsets(  onetouchslide, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  onetouchslide, "textalign", 0 );
	liqcell_child_append(  self, onetouchslide);
	//############################# title:label
	liqcell *title = liqcell_quickcreatevis("title", "label", 0, 0, 800, 46);
	liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(title, "onedotzero :: touch" );
	liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  title, "backcolor", "rgb(128,128,128)" );
	liqcell_propseti(  title, "textalign", 0 );
	liqcell_child_append(  self, title);
	//liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	liqcell_handleradd_withcontext(self, "refresh", onetouchslide_refresh ,self);
	liqcell_handleradd_withcontext(self, "shown", onetouchslide_shown ,self);
	liqcell_handleradd_withcontext(self, "resize", onetouchslide_resize ,self);
	liqcell_handleradd_withcontext(self, "keypress", onetouchslide_keypress,self );
	liqcell_handleradd_withcontext(self, "keyrelease", onetouchslide_keyrelease ,self);
	liqcell_handleradd_withcontext(self, "mouse", onetouchslide_mouse,self );
	liqcell_handleradd_withcontext(self, "click", onetouchslide_click ,self);
	//liqcell_handleradd_withcontext(self, "paint", onetouchslide_paint ,self); // use only if required, heavyweight
	liqcell_handleradd_withcontext(self, "dialog_open", onetouchslide_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", onetouchslide_dialog_close ,self);


	liqapp_log("app codepath = '%s'",app.codepath);
	char fnbuf[FILENAME_MAX];  snprintf(fnbuf,sizeof(fnbuf),"%s/onedotzero/media/motion_blur.png",app.codepath);
	liqcell_propsets( self ,  "imagefilename", fnbuf );
	liqcell_propseti( self ,  "lockaspect", 0 );
	liqcell_propsets( self ,  "imagefloat", "0,0,0,0" );	// a bit of magic if it works..


	slidebar_setvalue( slidebar1, 50 );
	slidebar_setvalue( slidebar2, 50 );
	slidebar_setvalue( slidebar3, 50 );

	return self;
}
Пример #17
0
/**
 * Create an enumbox ui component
 * @param caption The caption
 * @param datafefault the default to select
 * @param choices semicolon delim list of items (only a short qty the paradigm is only for simple choices)
 * @return liqcell* The new enumbox
 */
liqcell *uienumbox_create(const char *caption, const char *datadefault, const char *choices)
{
	
	liqcell *self = liqcell_quickcreatewidget(caption,"uienumbox", 800,80);
	
	if(self)
	{

		liqcell_propsets(  self,  "backcolor", "rgb(0,0,0)" );
		
			liqcell *body = liqcell_quickcreatevis("body","frame", 10,10,   200,60);
			liqcell_setfont(   body,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
			liqcell_propsets(  body,  "backcolor", "rgb(40,40,40)" );
			liqcell_propsets(  body,  "textcolor", "rgb(255,255,255)" );
			liqcell_setcaption(body,  caption );
		liqcell_child_insert( self, body );
		
		
			liqcell *data = liqcell_quickcreatevis("data","frame", 220,5,   560,70);
			//liqcell_setfont(   data,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (42), 0) );
			liqcell_propsets(  data,  "backcolor", "rgb(255,255,255)" );
			//liqcell_propsets(  data,  "textcolor", "rgb(0,0,0)" );
			liqcell_setcaption(data,  datadefault );


			char *allchoices = strdup(choices);
			char *onechoice;
			onechoice = strtok(allchoices, ";");
			while( onechoice )
			{
				//
				liqcell *node = liqcell_quickcreatevis(onechoice,"frame", 220,5,   560,70);
				if(datadefault && (strcmp(onechoice,datadefault)==0) )
				{
					uienumbox_node_setformat(node,1);
				}
				else
				{
					uienumbox_node_setformat(node,0);				
				}
				liqcell_propseti(     node,"textalign",2);
				liqcell_propseti(     node,"textaligny",2);
				liqcell_setcaption(node,  onechoice );
				liqcell_handleradd_withcontext(node, "click", (void*)uienumbox_node_click, self );
				liqcell_child_append( data, node );
				
				onechoice = strtok(NULL, ";");
				
			}
			free(allchoices);
			
			liqcell_child_arrange_makegrid(data, liqcell_child_countvisible(data)  , 1);



		
		
		liqcell_child_insert( self, data );
	}
	return self;
}
Пример #18
0
/**
 * create a new oneconfigure widget
 */
liqcell *oneconfigure_create()
{
    liqcell *self = liqcell_quickcreatewidget("oneconfigure", "form", 800, 480);
    if(!self) {
        liqapp_log("liqcell error not create 'oneconfigure'");
        return NULL;
    }

    // Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
    // Optimization:  use only what you NEED to get an effect
    // Optimization:  Minimal layers and complexity
    // Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
    // Optimization:  defaults: text, white, very fast rendering
    //############################# scsserver:textbox
    liqcell *scsserver = liqcell_quickcreatevis("scsserver", "textbox", 18, 300, 764, 58);
    liqcell_setfont(	scsserver, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
    liqcell_setcaption(scsserver, "SCS_server" );
    //liqcell_propsets(  scsserver, "textcolor", "rgb(255,255,255)" );
    //liqcell_propsets(  scsserver, "backcolor", "rgb(64,64,0)" );
    //liqcell_propsets(  scsserver, "bordercolor", "rgb(200,100,100)" );
    liqcell_propseti(  scsserver, "textalign", 0 );
    liqcell_child_append(  self, scsserver);
    //############################# twitterpassword:textbox
    liqcell *twitterpassword = liqcell_quickcreatevis("twitterpassword", "textbox", 18, 188, 764, 60);
    liqcell_setfont(	twitterpassword, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
    liqcell_setcaption(twitterpassword, "twitter_password" );
    liqcell_propseti(  twitterpassword, "textispassword", 1 );
    //liqcell_propsets(  twitterpassword, "textcolor", "rgb(255,255,255)" );
    //liqcell_propsets(  twitterpassword, "backcolor", "rgb(64,64,0)" );
    //liqcell_propsets(  twitterpassword, "bordercolor", "rgb(200,100,100)" );
    liqcell_propseti(  twitterpassword, "textalign", 0 );
    liqcell_child_append(  self, twitterpassword);
    //############################# twitterusername:textbox
    liqcell *twitterusername = liqcell_quickcreatevis("twitterusername", "textbox", 18, 86, 764, 54);
    liqcell_setfont(	twitterusername, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
    liqcell_setcaption(twitterusername, "twitter_username" );
    //liqcell_propsets(  twitterusername, "textcolor", "rgb(255,255,255)" );
    //liqcell_propsets(  twitterusername, "backcolor", "rgb(64,64,0)" );
    //liqcell_propsets(  twitterusername, "bordercolor", "rgb(200,100,100)" );
    liqcell_propseti(  twitterusername, "textalign", 0 );
    liqcell_child_append(  self, twitterusername);
    //############################# label3:label
    liqcell *label3 = liqcell_quickcreatevis("label3", "label", 18, 262, 700, 30);
    liqcell_setfont(	label3, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
    liqcell_setcaption(label3, "SCS server:   scs servr receives strokes when drawn in liqflow.  leave blank." );
    liqcell_propsets(  label3, "textcolor", "rgb(255,255,255)" );
    //liqcell_propsets(  label3, "backcolor", "rgb(64,64,64)" );
    liqcell_propseti(  label3, "textalign", 0 );
    liqcell_child_append(  self, label3);
    //############################# label2:label
    liqcell *label2 = liqcell_quickcreatevis("label2", "label", 18, 150, 326, 30);
    liqcell_setfont(	label2, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
    liqcell_setcaption(label2, "Twitter Password:"******"textcolor", "rgb(255,255,255)" );
    //liqcell_propsets(  label2, "backcolor", "rgb(64,64,64)" );
    liqcell_propseti(  label2, "textalign", 0 );
    liqcell_child_append(  self, label2);
    //############################# title:label
    liqcell *title = liqcell_quickcreatevis("title", "label", 0, 0, 800, 38);
    liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
    liqcell_setcaption(title, "onedotzero :: configure accounts" );
    liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
    liqcell_propsets(  title, "backcolor", "rgb(0,64,64)" );
    liqcell_propseti(  title, "textalign", 0 );
    liqcell_child_append(  self, title);
    //############################# label1:label
    liqcell *label1 = liqcell_quickcreatevis("label1", "label", 18, 48, 326, 30);
    liqcell_setfont(	label1, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
    liqcell_setcaption(label1, "Twitter Username:"******"textcolor", "rgb(255,255,255)" );
    //liqcell_propsets(  label1, "backcolor", "rgb(64,64,64)" );
    liqcell_propseti(  label1, "textalign", 0 );
    liqcell_child_append(  self, label1);
    //############################# cmdsave:label
    liqcell *cmdsave = liqcell_quickcreatevis("cmdsave", "label", 586, 392, 198, 80);
    liqcell_setfont(	cmdsave, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
    liqcell_setcaption(cmdsave, "save" );
    //liqcell_propsets(  cmdsave, "textcolor", "rgb(255,255,255)" );
    //liqcell_propsets(  cmdsave, "backcolor", "rgb(0,128,0)" );
    //liqcell_propsets(  cmdsave, "bordercolor", "rgb(200,100,100)" );
    //liqcell_propseti(  cmdsave, "textalign", 2 );
    liqcell_handleradd_withcontext(cmdsave, "click", cmdsave_click, self );
    liqcell_child_append(  self, cmdsave);

    liqcell_propsets(  cmdsave, "textcolor", "rgb(0,0,0)" );
    //liqcell_propsets(  cmdsave, "backcolor", "rgb(0,128,0)" );
    //liqcell_propsets(  cmdsave, "bordercolor", "rgb(200,100,100)" );
    liqcell_setimage(  cmdsave,  liqimage_cache_getfile("/usr/share/liqbase/onedotzero/media/button_back.png", 0,0,1) );
    liqcell_propseti(  cmdsave, "textalign", 2 );
    liqcell_propseti(  cmdsave, "textaligny", 2 );
    liqcell_propseti(  cmdsave,  "lockaspect",  0 );





    liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
    liqcell_handleradd_withcontext(self, "refresh", oneconfigure_refresh ,self);
    liqcell_handleradd_withcontext(self, "shown", oneconfigure_shown ,self);
    liqcell_handleradd_withcontext(self, "resize", oneconfigure_resize ,self);
    liqcell_handleradd_withcontext(self, "keypress", oneconfigure_keypress,self );
    liqcell_handleradd_withcontext(self, "keyrelease", oneconfigure_keyrelease ,self);
    liqcell_handleradd_withcontext(self, "mouse", oneconfigure_mouse,self );
    liqcell_handleradd_withcontext(self, "click", oneconfigure_click ,self);
    //liqcell_handleradd_withcontext(self, "paint", oneconfigure_paint ,self); // use only if required, heavyweight
    liqcell_handleradd_withcontext(self, "dialog_open", oneconfigure_dialog_open ,self);
    liqcell_handleradd_withcontext(self, "dialog_close", oneconfigure_dialog_close ,self);

    //liqapp_pref_setvalue( "scsserver", liqcell_getcaption(scsserver) );
    //liqapp_pref_setvalue( "twitname",  liqcell_getcaption(twitterusername) );
    //liqapp_pref_setvalue( "twitpass",  liqcell_getcaption(twitterpassword) );

    liqcell_setcaption(scsserver,        liqapp_pref_getvalue_def("scsserver","") );
    liqcell_setcaption(twitterusername,  liqapp_pref_getvalue_def("twitname","") );
    liqcell_setcaption(twitterpassword,  liqapp_pref_getvalue_def("twitpass","") );

    return self;
}
Пример #19
0
/**	
 * create a new liqaccelview widget
 */	
liqcell *liqaccelview_create()
{
	liqcell *self = liqcell_quickcreatewidget("liqaccelview", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'liqaccelview'"); return NULL;  } 
	
	//############################# buttonchannels:commandbutton
	//liqcell *buttonchannels = liqcell_quickcreatevis("buttonchannels", "commandbutton", 328, 432, 178, 42);
	//liqcell_setfont(	buttonchannels, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	//liqcell_setcaption(buttonchannels, "list channels" );
	//liqcell_propsets(  buttonchannels, "backcolor", "rgb(235,233,237)" );
	//liqcell_child_append(  self, buttonchannels);
	//############################# buttonback:commandbutton
	//liqcell *buttonback = liqcell_quickcreatevis("buttonback", "commandbutton", 8, 432, 202, 42);
	//liqcell_setfont(	buttonback, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	//liqcell_setcaption(buttonback, "Back" );
	//liqcell_propsets(  buttonback, "backcolor", "rgb(235,233,237)" );
	//liqcell_child_append(  self, buttonback);


	
/*
	//############################# title:label
	liqcell *title = liqcell_quickcreatevis("title", "label", 66, 8, 728, 40);
	liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(title, "accelerometer test" );
	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);
	//############################# icon:label
	liqcell *icon = liqcell_quickcreatevis("icon", "label", 6, 8, 52, 40);
	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);

 */
	//############################# bx:picturebox
	liqcell *bx = liqcell_quickcreatevis("bx", "label", 100, 100, 600, 100);
	liqcell_setfont(	bx, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (32), 0) );
	liqcell_propsets(  bx, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  bx, "backcolor", "rgb(200,0,0)" );
	liqcell_propseti(  bx, "textalign", 2 );
	liqcell_propseti(  bx, "textaligny",2 );
	//liqcell_propsets(  bx, "bordercolor", "rgb(200,100,100)" );
	liqcell_child_append(  self, bx);
	
	//############################# by:picturebox
	liqcell *by = liqcell_quickcreatevis("by", "label", 100, 220, 600, 100);
	liqcell_setfont(	by, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (32), 0) );
	liqcell_propsets(  by, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  by, "backcolor", "rgb(0,200,0)" );
	//liqcell_propsets(  by, "bordercolor", "rgb(200,100,100)" );
	liqcell_propseti(  by, "textalign", 2 );
	liqcell_propseti(  by, "textaligny",2 );
	
	liqcell_child_append(  self, by);

	//############################# bz:picturebox
	liqcell *bz = liqcell_quickcreatevis("bz", "label", 100, 340, 600, 100);
	liqcell_setfont(	bz, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (32), 0) );
	liqcell_propsets(  bz, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  bz, "backcolor", "rgb(0,0,200)" );
	//liqcell_propsets(  bz, "bordercolor", "rgb(200,100,100)" );
	liqcell_propseti(  bz, "textalign", 2 );
	liqcell_propseti(  bz, "textaligny",2 );
	liqcell_child_append(  self, bz);






	//############################# label3:label
	liqcell *lbllastmessage = liqcell_quickcreatevis("label3", "label", 12, 0, 772, 40);
	liqcell_setfont(	lbllastmessage, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
	liqcell_propsets(  lbllastmessage, "textcolor", "rgb(255,255,0)" );
	//liqcell_propsets(  label3, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  lbllastmessage, "textalign", 0 );
	liqcell_child_append(  self, lbllastmessage);

/*
	//############################# 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", 25 );
	liqcell_handleradd(timer1,"timertick",timer_tick);
	liqcell_setenabled(timer1,1);
	liqcell_child_insert( self,timer1);
 */
	liqcell_handleradd_withcontext(self,    "paint", liqaccelview_paint,self);

	//liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	return self;
}
Пример #20
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;
}
/**	
 * create a new sheepdrawing_pictureselect widget
 */	
liqcell *sheepdrawing_pictureselect_create()
{
	liqcell *self = liqcell_quickcreatewidget("sheepdrawing_pictureselect", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'sheepdrawing_pictureselect'"); return NULL;  } 
	
	// Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
	// Optimization:  use only what you NEED to get an effect
	// Optimization:  Minimal layers and complexity
	// Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
	// Optimization:  defaults: text, white, very fast rendering


	//############################# title:label
	liqcell *title = liqcell_quickcreatevis("title", "label", 0, 0, 800, 56);
	liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(title, "select image" );
	liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  title, "backcolor", "xrgb(0,0,0)" );
	liqcell_propseti(  title, "textalign", 0 );
	liqcell_child_append(  self, title);
	//############################# sheepdrawing_picturegrid:liqrecentphotos
	liqcell *sheepdrawing_picturegrid = liqcell_quickcreatevis("sheepdrawing_picturegrid", "sheepdrawing_picturegrid", 0, 58, 800, 420);
	liqcell_child_append(  self, sheepdrawing_picturegrid);
    //############################# cmdselect:commandbutton
	liqcell *cmdselect = liqcell_quickcreatevis("cmdselect", "commandbutton", 580, 420, 220, 60);
	liqcell_setfont(	cmdselect, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdselect, "Select" );
	liqcell_propsets(  cmdselect, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdselect, "backcolor", "xrgb(0,64,0)" );
	liqcell_propsets(  cmdselect, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdselect, "textalign", 2 );
	liqcell_handleradd_withcontext(cmdselect, "click", cmdselect_click, self );
    //liqcell_setenabled(cmdselect,0);
	liqcell_child_append(  self, cmdselect);
    
    
		liqcell *search = liqcell_quickcreatevis("search","textbox",200 ,self->h-40,   350, 60);
		liqcell_setfont(   search,  liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (32), 0) );
		liqcell_setcaption(search, "" );
		liqcell_propsets(  search, "textcolor",   "rgb(255,255,255)" );
		liqcell_propsets(  search, "backcolor",   "xrgb(100,140,100)" );
		liqcell_handleradd_withcontext( search,    "click",           search_click,  self );
		liqcell_handleradd_withcontext( search,    "captionchange",   search_change, self );
		liqcell_setvisible(search,0);		// watch this!
		liqcell_child_append( self, search );
		
		//liqcell_handleradd_withcontext(body,    "keypress",   sheepdrawing_pictureselect_keypress,  self);
		//liqcell_handleradd_withcontext(body,    "keyrelease", sheepdrawing_pictureselect_keyrelease,self);
		liqcell_handleradd_withcontext(self,    "keypress",   sheepdrawing_pictureselect_keypress,  self);
		liqcell_handleradd_withcontext(self,    "keyrelease", sheepdrawing_pictureselect_keyrelease,self);
 		liqcell_handleradd_withcontext(self,    "paint",      sheepdrawing_pictureselect_paint,  	self);
        
    
    //liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	liqcell_handleradd_withcontext(self, "refresh", sheepdrawing_pictureselect_refresh ,self);
	liqcell_handleradd_withcontext(self, "shown", sheepdrawing_pictureselect_shown ,self);
	liqcell_handleradd_withcontext(self, "resize", sheepdrawing_pictureselect_resize ,self);
	//liqcell_handleradd_withcontext(self, "keypress", sheepdrawing_pictureselect_keypress,self );
	//liqcell_handleradd_withcontext(self, "keyrelease", sheepdrawing_pictureselect_keyrelease ,self);
	liqcell_handleradd_withcontext(self, "mouse", sheepdrawing_pictureselect_mouse,self );
	liqcell_handleradd_withcontext(self, "click", sheepdrawing_pictureselect_click ,self);
	//liqcell_handleradd_withcontext(self, "paint", sheepdrawing_pictureselect_paint ,self); // use only if required, heavyweight
	liqcell_handleradd_withcontext(self, "dialog_open", sheepdrawing_pictureselect_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", sheepdrawing_pictureselect_dialog_close ,self);
	return self;
}
liqcell *liqrecentsketches_tagging_create()
{
	liqcell *self = liqcell_quickcreatewidget("liqrecentsketches_tagging","form", 800,480);

	if(self)
	{
	//	liqcell_propsets(  self, "backcolor", "rgb(255,255,255)" );

		//liqcell_propseti(self,"autorotate",1);



{
	
	
	liqcell *backplane = liqcell_quickcreatevis("backplane","frame",self->w*0.1 ,0,   self->w*0.7,self->h);
	liqcell_child_insert( self, backplane );
		liqcell *body = liqcell_quickcreatevis("body","frame",0 ,0,   backplane->w,self->h);
		liqcell_child_insert( backplane, body );
		
	//	liqcell_scan_folder_for_images(self,buf);
		
		//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_withcontext(body,    "mouse",   liqcell_easyhandler_kinetic_mouse, self );
		liqcell_handleradd_withcontext(body,    "move",    liqrecentsketches_body_move,       self );
		//liqcell_handleradd(self,    "click",   float_click);
		

	//############################# scroller:label
	liqcell *scroller = liqcell_quickcreatevis("scroller", "label", 0,56, self->w*0.1, self->h-56);
	//liqcell_setfont(	scroller, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	//liqcell_setcaption(scroller, "Scroller" );
	//liqcell_propsets(  scroller, "imagefilename", "media/titlebanner_left.png" );
	//liqcell_propsets(  scroller, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  scroller, "backcolor", "rgb(0,0,60)" );
	liqcell_propseti(  scroller, "textalign", 0 );
	
	liqcell_handleradd_withcontext(scroller,    "mouse",   liqrecentsketches_scroller_mouse , self );

	liqcell_child_append(  self, scroller);

		//############################# knob:label
		liqcell *knob = liqcell_quickcreatevis("knob", "label", 0,0, 200, 50);
		//liqcell_setfont(	knob, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
		//liqcell_setcaption(knob, "knob" );
		liqcell_propsets(  knob, "imagefilename", "media/blob.png" );
		liqcell_propsets(  knob, "textcolor", "rgb(255,255,0)" );
		liqcell_propsets(  knob, "backcolor", "rgb(0,60,0)" );
		liqcell_propseti(  knob, "textalign", 0 );

		
		liqcell_child_append(  scroller, knob);

		






// 20090619_221734 lcuk : VERY strange, if I compile with this block in place, when run from the console its ok
// 20090619_221809 lcuk : but when run from the icon the app closes and does not run
// 20090619_221830 lcuk : very curious


//#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,0);
		liqcell_child_insert( self,timer1);
//#endif



		//############################# cmdselclear:button
		liqcell *cmdselclear = liqcell_quickcreatevis("cmdselclear", "button", self->w*0.8,self->h-56-56-244-56-28, self->w*0.05, 28);
		liqcell_setfont(	cmdselclear, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (15), 0) );
		liqcell_setcaption(cmdselclear, "Clear" );
		//liqcell_propsets(  cmdselclear, "imagefilename", "media/titlebanner_left.png" );
		liqcell_propsets(  cmdselclear, "textcolor", "rgb(255,255,0)" );
		liqcell_propsets(  cmdselclear, "backcolor", "xrgb(0,60,60)" );
		liqcell_propseti(  cmdselclear, "textalign", 2 );
		liqcell_propseti(  cmdselclear, "textaligny", 2 );
		liqcell_child_append(  self, cmdselclear);
		liqcell_handleradd_withcontext(cmdselclear,    "click",   liqrecentsketches_clear_click , self );

		//############################# cmdselinv:button
		liqcell *cmdselinv = liqcell_quickcreatevis("cmdselinv", "button", self->w*0.95,self->h-56-56-244-56-28, self->w*0.05, 28);
		liqcell_setfont(	cmdselinv, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (15), 0) );
		liqcell_setcaption(cmdselinv, "Inv" );
		//liqcell_propsets(  cmdselinv, "imagefilename", "media/titlebanner_left.png" );
		liqcell_propsets(  cmdselinv, "textcolor", "rgb(255,255,0)" );
		liqcell_propsets(  cmdselinv, "backcolor", "xrgb(60,0,60)" );
		liqcell_propseti(  cmdselinv, "textalign", 2 );
		liqcell_propseti(  cmdselinv, "textaligny", 2 );
		liqcell_child_append(  self, cmdselinv);
		//liqcell_handleradd_withcontext(cmdselinv,    "click",   liqrecentsketches_clear_click , self );


		liqcell_setvisible(cmdselinv,0);


		//############################# selecttitle:textbox
		liqcell *selecttitle = liqcell_quickcreatevis("selecttitle", "textbox", self->w*0.8,self->h-56-56-244-56, self->w*0.1, 56);
		liqcell_setfont(	selecttitle, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
		liqcell_setcaption(selecttitle, "" );
		//liqcell_propsets(  selecttitle, "imagefilename", "media/titlebanner_left.png" );
		liqcell_propsets(  selecttitle, "textcolor", "rgb(255,255,255)" );
		liqcell_propsets(  selecttitle, "backcolor", "rgb(0,60,0)" );
		liqcell_propsets(  selecttitle, "bordercolor", "xrgb(255,255,255)" );
		liqcell_propseti(  selecttitle, "textalign", 2 );
		liqcell_propseti(  selecttitle, "textaligny", 2 );
		liqcell_child_append(  self, selecttitle);


		//############################# selectgroup:box
		liqcell *selectgroup = liqcell_quickcreatevis("selectgroup", "box", self->w*0.8,self->h-56-56-244, self->w*0.1, 244);
		liqcell_propsets(  selectgroup, "backcolor", "xrgb(0,40,0)" );
		liqcell_propsets(  selectgroup, "bordercolor", "xrgb(255,255,255)" );
		liqcell_child_append(  self, selectgroup);
		
			//############################# selectbackplane:box
			liqcell *selectbackplane = liqcell_quickcreatevis("selectbackplane", "box", self->w*0.8,self->h-56-56-244, self->w*0.1, 244);
			//liqcell_propsets(  selectbackplane, "backcolor", "xrgb(0,40,0)" );
			//liqcell_propsets(  selectbackplane, "bordercolor", "xrgb(255,255,255)" );
			liqcell_child_append(  selectgroup, selectbackplane);

			liqcell_handleradd_withcontext(selectbackplane,    "mouse",   liqcell_easyhandler_kinetic_mouse, self );


		//############################# selectcount:label
		liqcell *selectcount = liqcell_quickcreatevis("selectcount", "label", self->w*0.8,self->h-56-56, self->w*0.1, 56);
		liqcell_setfont(	selectcount, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (20), 0) );
		liqcell_setcaption(selectcount, "0 items" );
		//liqcell_propsets(  selectcount, "imagefilename", "media/titlebanner_left.png" );
		liqcell_propsets(  selectcount, "textcolor", "rgb(255,255,255)" );
		liqcell_propsets(  selectcount, "backcolor", "rgb(0,0,0)" );
		liqcell_propsets(  selectcount, "bordercolor", "xrgb(255,255,255)" );
		liqcell_propseti(  selectcount, "textalign", 2 );
		liqcell_propseti(  selectcount, "textaligny", 2 );
		liqcell_child_append(  self, selectcount);

		//############################# cmdedit:button
		liqcell *cmdedit = liqcell_quickcreatevis("cmdedit", "button", self->w*0.8,self->h-56, self->w*0.1, 56);
		liqcell_setfont(	cmdedit, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (20), 0) );
		liqcell_setcaption(cmdedit, "Save" );
		//liqcell_propsets(  cmdedit, "imagefilename", "media/titlebanner_left.png" );
		liqcell_propsets(  cmdedit, "textcolor", "rgb(255,255,0)" );
		liqcell_propsets(  cmdedit, "backcolor", "xrgb(0,0,60)" );
		liqcell_propseti(  cmdedit, "textalign", 2 );
		liqcell_propseti(  cmdedit, "textaligny", 2 );
		liqcell_child_append(  self, cmdedit);
		liqcell_handleradd_withcontext(cmdedit,    "click",   liqrecentsketches_save_click , self );




}



		liqcell_handleradd_withcontext(self, "shown", widget_shown ,self);


	}
	
	return self;
}
liqcell *liqrecentsketches_classic_create()
{
	liqcell *self = liqcell_quickcreatewidget("liqrecentsketches_classic","form", 800,480);

	if(self)
	{
	//	liqcell_propsets(  self, "backcolor", "rgb(255,255,255)" );

		//liqcell_propseti(self,"autorotate",1);


		char buf[FILENAME_MAX];    snprintf(buf,sizeof(buf),"%s/sketches",app.userdatapath);


if(liqapp_pathexists(buf))
{
	
	liqapp_log("recent sketches buf=%s",buf);
	
	liqcell *backplane = liqcell_quickcreatevis("backplane","frame",self->w*0.1 ,0,   self->w*0.9,self->h);
	liqcell_child_insert( self, backplane );
		liqcell *body = liqcell_quickcreatevis("body","frame",0 ,0,   self->w*0.9,self->h);

		
		
		liqcell_child_insert( backplane, body );
		
		liqcell_scan_folder_for_images(self,buf);
		
		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_withcontext(body,    "mouse",   liqcell_easyhandler_kinetic_mouse, self );
		liqcell_handleradd_withcontext(body,    "move",   liqrecentsketches_body_move, self );
		//liqcell_handleradd(self,    "click",   float_click);
		

	//############################# scroller:label
	liqcell *scroller = liqcell_quickcreatevis("scroller", "label", 0,56, self->w*0.1, self->h-56);
	//liqcell_setfont(	scroller, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	//liqcell_setcaption(scroller, "Scroller" );
	//liqcell_propsets(  scroller, "imagefilename", "media/titlebanner_left.png" );
	//liqcell_propsets(  scroller, "textcolor", "rgb(255,255,0)" );
	
	liqcell_propsets(  scroller, "backcolor", "rgb(0,0,60)" );
	//liqcell_propseti(  scroller, "textalign", 0 );


	//	if(!liqcell_getcontent(scroller))
			//liqcell_setcontent(scroller, body  );
			// amusing effect and shows entire wall but really slugs it up
			// to be usable it should just cache the picture in this case
			// since the data changes rarely but navigation is frequent
			

	
	liqcell_handleradd_withcontext(scroller,    "mouse",   liqrecentsketches_scroller_mouse , self );

	liqcell_child_append(  self, scroller);

		//############################# knob:label
		liqcell *knob = liqcell_quickcreatevis("knob", "label", 0,0, 200, 50);
		//liqcell_setfont(	knob, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
		//liqcell_setcaption(knob, "knob" );
//		liqcell_propsets(  knob, "imagefilename", "media/blob.png" );
		//liqcell_propsets(  knob, "textcolor", "rgb(255,255,0)" );
		liqcell_propsets(  knob, "backcolor", "rgba(0,60,0,128)" );
		liqcell_propseti(  knob, "textalign", 0 );


		liqcell_child_append( scroller, knob);


		liqcell_setpos(body,0,-(body->h-backplane->h));




// 20090619_221734 lcuk : VERY strange, if I compile with this block in place, when run from the console its ok
// 20090619_221809 lcuk : but when run from the icon the app closes and does not run
// 20090619_221830 lcuk : very curious


//#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

		//############################# cmdnew:label
		liqcell *cmdnew = liqcell_quickcreatevis("cmdnew", "button", self->w*0.8,self->h-56, self->w*0.1, 56);
		liqcell_setfont(	cmdnew, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
		liqcell_setcaption(cmdnew, "New" );
		//liqcell_propsets(  cmdnew, "imagefilename", "media/titlebanner_left.png" );
		liqcell_propsets(  cmdnew, "textcolor", "rgb(255,255,255)" );
		liqcell_propsets(  cmdnew, "backcolor", "xrgb(0,60,0)" );
		liqcell_propsets(  cmdnew, "bordercolor", "xrgb(255,255,255)" );
		liqcell_propseti(  cmdnew, "textalign", 2 );
		liqcell_propseti(  cmdnew, "textaligny", 2 );
		liqcell_child_append(  self, cmdnew);
		liqcell_handleradd_withcontext(cmdnew,    "click",   liqrecentsketches_new_click , self );

		//############################# cmdedit:label
		liqcell *cmdedit = liqcell_quickcreatevis("cmdedit", "button", self->w*0.9,self->h-56, self->w*0.1, 56);
		liqcell_setfont(	cmdedit, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
		liqcell_setcaption(cmdedit, "Edit" );
		//liqcell_propsets(  cmdedit, "imagefilename", "media/titlebanner_left.png" );
		liqcell_propsets(  cmdedit, "textcolor", "rgb(255,255,255)" );
		liqcell_propsets(  cmdedit, "backcolor", "xrgb(0,0,60)" );
		liqcell_propsets(  cmdedit, "bordercolor", "xrgb(255,255,255)" );
		liqcell_propseti(  cmdedit, "textalign", 2 );
		liqcell_propseti(  cmdedit, "textaligny", 2 );
				liqcell_child_append(  self, cmdedit);
		liqcell_handleradd_withcontext(cmdedit,    "click",   liqrecentsketches_edit_click , self );

}

/*
		//############################# title:label
		liqcell *title = liqcell_quickcreatevis("title", "label", 0,0, 200, 50);
		liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
		liqcell_setcaption(title, "Sketches" );
		liqcell_propsets(  title, "imagefilename", "media/titlebanner_left.png" );
		liqcell_propsets(  title, "textcolor", "rgb(255,255,0)" );
		//liqcell_propsets(  title, "backcolor", "rgb(0,0,60)" );
		liqcell_propseti(  title, "textalign", 0 );
		liqcell_child_append(  self, title);
*/

	}
	
	return self;
}
Пример #24
0
/**	
 * create a new sheepdog_levelplay widget
 */	
liqcell *sheepdog_levelplay_create()
{
	liqcell *self = liqcell_quickcreatewidget("sheepdog_levelplay", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'sheepdog_levelplay'"); return NULL;  } 
	
	// Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
	// Optimization:  use only what you NEED to get an effect
	// Optimization:  Minimal layers and complexity
	// Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
	// Optimization:  defaults: text, white, very fast rendering
	//############################# backplane:label
	liqcell *backplane = liqcell_quickcreatevis("backplane", "label", 0, 0, 800, 480);
	liqcell_setfont(	backplane, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
	liqcell_setcaption(backplane, "backplane" );
	liqcell_propsets(  backplane, "textcolor", "rgb(255,0,0)" );
	liqcell_propsets(  backplane, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  backplane, "textalign", 2 );
	liqcell_propseti(  backplane, "textaligny", 2 );
	liqcell_child_append(  self, backplane);
	//############################# countdown:label
	liqcell *countdown = liqcell_quickcreatevis("countdown", "label", 278, 2, 176, 34);
	liqcell_setfont(	countdown, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
	liqcell_setcaption(countdown, "30 seconds left" );
	liqcell_propsets(  countdown, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  countdown, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  countdown, "textalign", 0 );
	liqcell_propseti(  countdown, "textaligny", 0 );
	liqcell_child_append(  self, countdown);
	//############################# gameover:label
	liqcell *gameover = liqcell_quickcreatevis("gameover", "label", 178, 238, 424, 46);
	liqcell_setfont(	gameover, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(gameover, "Game Over" );
	liqcell_propsets(  gameover, "textcolor", "rgb(255,0,0)" );
	liqcell_propsets(  gameover, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  gameover, "textalign", 2 );
	liqcell_propseti(  gameover, "textaligny", 2 );
	liqcell_setvisible(  gameover, 0 );
	liqcell_child_append(  self, gameover);
	//############################# score:label
	liqcell *score = liqcell_quickcreatevis("score", "label", 622, 2, 176, 34);
	liqcell_setfont(	score, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
	liqcell_setcaption(score, "80 points" );
	liqcell_propsets(  score, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  score, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  score, "textalign", 0 );
	liqcell_propseti(  score, "textaligny", 0 );
	liqcell_child_append(  self, score);
	//liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	//liqcell_setimage(  self ,  liqimage_cache_getfile( "/usr/share/liqbase/sheepdog/media/sheepdog_levelplay_back.png",0,0,0) );
	liqcell_handleradd_withcontext(self, "filter", sheepdog_levelplay_filter ,self);
	liqcell_handleradd_withcontext(self, "refresh", sheepdog_levelplay_refresh ,self);
	liqcell_handleradd_withcontext(self, "shown", sheepdog_levelplay_shown ,self);
	//liqcell_handleradd_withcontext(self, "resize", sheepdog_levelplay_resize ,self);
	//liqcell_handleradd_withcontext(self, "keypress", sheepdog_levelplay_keypress,self );
	//liqcell_handleradd_withcontext(self, "keyrelease", sheepdog_levelplay_keyrelease ,self);
	//liqcell_handleradd_withcontext(self, "mouse", sheepdog_levelplay_mouse,self );
	//liqcell_handleradd_withcontext(self, "click", sheepdog_levelplay_click ,self);
	//liqcell_handleradd_withcontext(self, "paint", sheepdog_levelplay_paint ,self); // use only if required, heavyweight
	liqcell_handleradd_withcontext(self, "dialog_open", sheepdog_levelplay_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", sheepdog_levelplay_dialog_close ,self);
	return self;
}
	static int liqrecentsketches_sketch_insert(liqcell *self,char *filenamebuffer)
	{
		liqcell *backplane = liqcell_child_lookup( self,"backplane");
		liqcell *body = liqcell_child_lookup( backplane,"body");

		//liqapp_log("gary: [[%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);
		
			//liqapp_log("ins 1 %s",filenamebuffer);
			// valid file		
			char b[255]={0};
			snprintf(b,5,"%s",pfn.filedate); b[4]='\0';
			liqcell *xy=liqcell_child_lookup(body,b);
			if(!xy)
			{
				//liqapp_log("ins 2 %s",filenamebuffer);
				xy=liqcell_quickcreatevis(b,"year",  0,0, (backplane->w),backplane->h/15);
				liqcell_child_insertsortedbyname(body,xy,0);
				//snprintf(b,5,"%s",pfn.filedate); b[4]='\0';
				//brk=addframe(xy,b,(self->w),self->h/15);				// year break tile
				//brk->style=odd;
			}
		
			//liqapp_log("ins 3 %s",filenamebuffer);
		
		
				snprintf(b,3,"%s",&pfn.filedate[4]); b[2]='\0';
				liqcell *xm=liqcell_child_lookup(xy,b);
				if(!xm)
				{
					//liqapp_log("ins 4 %s",filenamebuffer);
					xm=liqcell_quickcreatevis(b,"month",  0,0, (backplane->w),backplane->h/15);
					liqcell_child_insertsortedbyname(xy,xm,0);
					//snprintf(b,7,"%s",pfn.filedate); b[6]='\0';
					//brk=addframe(xm,b,(self->w),self->h/15);			// month break tile
					//brk->style=odd;
				}
			
				//liqapp_log("ins 5 %s",filenamebuffer);
			
					snprintf(b,3,"%s",&pfn.filedate[6]); b[2]='\0';
					liqcell *xd=liqcell_child_lookup(xm,b);
					if(!xd)
					{
						//liqapp_log("ins 6 %s",filenamebuffer);
						xd=liqcell_quickcreatevis(b,"day",  0,0, (backplane->w),backplane->h/15);
						liqcell_child_insertsortedbyname(xm,xd,0);
					
						//liqapp_log("ins 7 %s",filenamebuffer);
						// add title header

						snprintf(b,10,"_%s",pfn.filedate); b[9]='\0';
						liqcell *brk=liqcell_quickcreatevis(b,"label",  0,0, (backplane->w),backplane->h/15);


						liqcell_setfont(	brk, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0) );
					
						snprintf(b,9,"%s",pfn.filedate); b[8]='\0';
					
						liqcell_setcaption(brk, b );
						liqcell_propsets(  brk, "textcolor", "rgb(255,255,255)" );
						liqcell_propsets(  brk, "backcolor", "rgb(0,0,100)");
						liqcell_propseti(  brk, "textalign", 0 );

						liqcell_child_append(xd,brk);
					}
				
					//liqapp_log("ins 8 %s",filenamebuffer);
				

					liqcell *c = liqcell_quickcreatevis(buf,   "sketch",   0,0,(backplane->w/5),(backplane->h/4)    );
					liqcell_propseti(c,"lockaspect",1);
					liqcell_propsets(c,"sketchfilename",filenamebuffer);
					liqcell_handleradd_withcontext(c,"click",liqrecentsketches_sketchitem_click,self);
				
						//	liqcell_propseti(c,"autorotate",1);

				
				
					liqcell_child_insertsortedbyname( xd, c,0);
				
					//liqapp_log("ins 9 %s",filenamebuffer);
				
					liqcell_setsize(xd, backplane->w, backplane->h/15 );
					liqcell_child_arrange_autoflow(xd);
				liqcell_child_arrange_easycol(xm);			
			liqcell_child_arrange_easycol(xy);
				
			liqcell_child_arrange_easycol(body);
			//liqcell_setsize(body,body->w,body->h-700);	
			liqcell_setsize(body,body->w,body->h);			// hmm random offset needed only for huge number of sketches.
		
		}
	}
Пример #26
0
/**	
 * create a new myclock_cover widget
 */	
liqcell *myclock_cover_create()
{
	liqcell *self = liqcell_quickcreatewidget("myclock_cover", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'myclock_cover'"); return NULL;  } 
	
	// Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
	// Optimization:  use only what you NEED to get an effect
	// Optimization:  Minimal layers and complexity
	// Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
	// Optimization:  defaults: text, white, very fast rendering
	//############################# label3:label
	liqcell *label3 = liqcell_quickcreatevis("label3", "label", 14, 446, 764, 30);
	liqcell_setfont(	label3, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
	liqcell_setcaption(label3, "open source comes from the heart.  please donate to all projects." );
	liqcell_propsets(  label3, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  label3, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  label3, "textalign", 2 );
	liqcell_propseti(  label3, "textaligny", 2 );
	liqcell_setvisible(label3,0);
	liqcell_child_append(  self, label3);
	//############################# lbltitle:label
	liqcell *lbltitle = liqcell_quickcreatevis("lbltitle", "label", 0, 0, 800, 80);
	liqcell_setfont(	lbltitle, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (58), 0) );
	liqcell_setcaption(lbltitle, "My Clock" );
	liqcell_propsets(  lbltitle, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  lbltitle, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  lbltitle, "textalign", 0 );
	liqcell_propseti(  lbltitle, "textaligny", 0 );
	liqcell_child_append(  self, lbltitle);
	//############################# author:label
	liqcell *author = liqcell_quickcreatevis("author", "label", 24, 84, 696, 48);
	liqcell_setfont(	author, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(author, "written by Gary Birkett." );
	liqcell_propsets(  author, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  author, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  author, "textalign", 0 );
	liqcell_propseti(  author, "textaligny", 0 );
	liqcell_child_append(  self, author);
	//############################# slidetext3:label
	liqcell *slidetext3 = liqcell_quickcreatevis("slidetext3", "label", 26, 224, 442, 30);
	liqcell_setfont(	slidetext3, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
	liqcell_setcaption(slidetext3, "Distinctive analogue design." );
	liqcell_propsets(  slidetext3, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  slidetext3, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  slidetext3, "textalign", 0 );
	liqcell_propseti(  slidetext3, "textaligny", 0 );
	liqcell_child_append(  self, slidetext3);
	//############################# slidetext2:label
	liqcell *slidetext2 = liqcell_quickcreatevis("slidetext2", "label", 26, 182, 442, 30);
	liqcell_setfont(	slidetext2, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
	liqcell_setcaption(slidetext2, "Unique hand written digital" );
	liqcell_propsets(  slidetext2, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  slidetext2, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  slidetext2, "textalign", 0 );
	liqcell_propseti(  slidetext2, "textaligny", 0 );
	liqcell_child_append(  self, slidetext2);
	//############################# slidetext1:label
	liqcell *slidetext1 = liqcell_quickcreatevis("slidetext1", "label", 26, 142, 442, 30);
	liqcell_setfont(	slidetext1, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (19), 0) );
	liqcell_setcaption(slidetext1, "A personal clock." );
	liqcell_propsets(  slidetext1, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  slidetext1, "backcolor", "rgb(0,0,0)" );
	liqcell_propseti(  slidetext1, "textalign", 0 );
	liqcell_propseti(  slidetext1, "textaligny", 0 );
	liqcell_child_append(  self, slidetext1);
	//############################# cmdclockfacecreate:label
	liqcell *cmdclockfacecreate = liqcell_quickcreatevis("cmdclockfacecreate", "label", 32, 264, 340, 80);
	liqcell_setfont(	cmdclockfacecreate, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdclockfacecreate, "Create Clock Face" );
	liqcell_propsets(  cmdclockfacecreate, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdclockfacecreate, "backcolor", "xrgb(0,64,0)" );
	liqcell_propsets(  cmdclockfacecreate, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdclockfacecreate, "textalign", 2 );
	liqcell_propseti(  cmdclockfacecreate, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdclockfacecreate, "click", (void*)cmdclockfacecreate_click, self );
	liqcell_child_append(  self, cmdclockfacecreate);
	//############################# cmdclockfacemanage:label
	liqcell *cmdclockfacemanage = liqcell_quickcreatevis("cmdclockfacemanage", "label", 32, 354, 340, 80);
	liqcell_setfont(	cmdclockfacemanage, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdclockfacemanage, "View History" );
	liqcell_propsets(  cmdclockfacemanage, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdclockfacemanage, "backcolor", "xrgb(0,64,0)" );
	liqcell_propsets(  cmdclockfacemanage, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdclockfacemanage, "textalign", 2 );
	liqcell_propseti(  cmdclockfacemanage, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdclockfacemanage, "click", (void*)cmdclockfacemanage_click, self );
	liqcell_child_append(  self, cmdclockfacemanage);
	//############################# preview:image
	liqcell *preview = liqcell_quickcreatevis("preview", "image", 456, 148, 264, 256);
	liqcell_propseti(preview,"lockaspect",1);
		liqcell *myclock1 = liqcell_quickcreatevis("myclock1", "myclock.myclock_run", 0,0, 0,0);
		liqcell_handleradd_withcontext(myclock1,    "dirty",   myclock_dirty, self );
	liqcell_setcontent(preview, myclock1 );
	

	//liqcell_propsets(  preview, "imagefilename", "/usr/share/liqbase/myclock/media/myclock_cover.preview.png" );
	liqcell_child_append(  self, preview);
	//liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	//liqcell_setimage(  self ,  liqimage_cache_getfile( "/usr/share/liqbase/myclock/media/myclock_cover_back.png",0,0,0) );
	liqcell_handleradd_withcontext(self, "filter",		 (void*)myclock_cover_filter ,self);
	liqcell_handleradd_withcontext(self, "refresh",		(void*)myclock_cover_refresh ,self);
	liqcell_handleradd_withcontext(self, "shown",		  (void*)myclock_cover_shown ,self);
	//liqcell_handleradd_withcontext(self, "resize",	  (void*)myclock_cover_resize ,self);
	//liqcell_handleradd_withcontext(self, "keypress",	(void*)myclock_cover_keypress,self );
	//liqcell_handleradd_withcontext(self, "keyrelease", (void*)myclock_cover_keyrelease ,self);
	//liqcell_handleradd_withcontext(self, "mouse",		(void*)myclock_cover_mouse,self );
	//liqcell_handleradd_withcontext(self, "click",		(void*)myclock_cover_click ,self);
	//liqcell_handleradd_withcontext(self, "paint",		(void*)myclock_cover_paint ,self); // use only if required, heavyweight
	liqcell_handleradd_withcontext(self, "dialog_open",  (void*)myclock_cover_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", (void*)myclock_cover_dialog_close ,self);
	return self;
}
Пример #27
0
int liqdialog_askv(const char *key,const char *question,const char *description,const char *footingnotes,int defaultoption,int answercount,const char ** answers)
{
int result;
	
	if(answercount==0)
	{
		const char **a=answers;
		while(*a++) 
		{
			if(answercount>20)break;		// for now, lets not get stuck...
			answercount++;
		}
	}
	
	if(!footingnotes)footingnotes="contact [email protected], lcuk on #maemo";
	
	liqapp_log("Running Dialog with %i options",answercount);






	//##################################################### 
	liqcell *self = liqcell_quickcreatewidget("testcode","form", 800,480);
	if(!self)
	{
		liqapp_log("could not allocate 'testcode'");
		return 0;
	}
	liqcell *b = NULL;
	liqcell *c = NULL;


	

	//##################################################### label1 :: label
	//# This is the main widget constructor for this node
	b = liqcell_quickcreatevis("question","label",  	0,0,  800,112 );
	    liqcell_setcaption(b,       question);
	    liqcell_setfont(   b, 	liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	    liqcell_propsets(  b,    	"bordercolor",	"rgb(100,100,100)" );
	    liqcell_propsets(  b,    	"textcolor",		"rgb(255,255,255)" );
	    liqcell_propseti(  b,    	"textalign",		0 );
	    liqcell_propseti(  b,    	"textaligny",		2 );
	    //liqcell_handleradd_withcontext(b,"click",         	(void*)label1_click, self);
	    //liqcell_handleradd_withcontext(b,"mouse",         	(void*)label1_mouse, self);
	liqcell_child_append( self, b );

	//##################################################### panel1 :: panel
	//# This is the main widget constructor for this panel
	b = liqcell_quickcreatevis("panel1","panel",  	0,112,  800,480-112-56 );
	    liqcell_propsets(  b,    	"bordercolor",	"rgb(100,100,100)" );



		//##################################################### 
		int a;
		for(a=0;a<answercount;a++)
		{

			//############################# toolname:button
			liqcell *bt = liqcell_quickcreatevis(answers[a], "button", 0,0, 100, 56);
			liqcell_setfont(	bt, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (32), 0) );
			liqcell_setcaption(bt, answers[a] );
			liqcell_propsets(  bt, "textcolor",   "rgb(255,255,255)" );
			if(a==defaultoption)
				liqcell_propsets(  bt, "backcolor",   "xrgb(50,160,50)");
			else
				liqcell_propsets(  bt, "backcolor",   "xrgb(50,100,50)");
			liqcell_propsets(  bt, "bordercolor", "rgb(255,255,255)" );
			liqcell_propseti(  bt, "textalign",   2 );
			liqcell_propseti(  bt, "textaligny",  2 );
			
			liqcell_handleradd_withcontext(bt,    "click",   (void*)dialogbutton_click, self);
			liqcell_handleradd_withcontext(bt,    "mouse",   (void*)dialogbutton_mouse, self);
			

			liqcell_child_append( b, bt );
		}

		liqcell_child_arrange_easytile( b );
		
	liqcell_child_append( self, b );

	//##################################################### label2 :: label
	//# This is the main widget constructor for this node
	b = liqcell_quickcreatevis("footer","label",  	0,424,  800,56 );
	    liqcell_setcaption(b,       footingnotes);
	    liqcell_setfont(   b, 	liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	    liqcell_propsets(  b,    	"bordercolor",	"rgb(100,100,100)" );
	    liqcell_propsets(  b,    	"textcolor",		"rgb(255,255,255)" );
	    liqcell_propseti(  b,    	"textalign",		2 );
	    liqcell_propseti(  b,    	"textaligny",		2 );
	    //liqcell_handleradd_withcontext(b,"click",         	(void*)label2_click, self);
	    //liqcell_handleradd_withcontext(b,"mouse",         	(void*)label2_mouse, self);
	liqcell_child_append( self, b );






	
	liqcell_propseti(self,"dialog_zoomed",1  );
	liqcell_easyrun(self);
	liqcell_release(self);	
	return result;
}
Пример #28
0
/**	
 * create a new liqcalc_run widget
 */	
liqcell *liqcalc_run_create()
{
	liqcell *self = liqcell_quickcreatewidget("liqcalc_run", "form", 480, 800);
	if(!self) {liqapp_log("liqcell error not create 'liqcalc_run'"); return NULL;  } 
	
	// Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
	// Optimization:  use only what you NEED to get an effect
	// Optimization:  Minimal layers and complexity
	// Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
	// Optimization:  defaults: text, white, very fast rendering
	//############################# title:label
	liqcell *title = liqcell_quickcreatevis("title", "label", 0, 0, 480, 56);
	liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(title, "liqcalc" );
	liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  title, "backcolor", "xrgb(128,128,0)" );
	liqcell_propseti(  title, "textalign", 0 );
	liqcell_propseti(  title, "textaligny", 0 );
	liqcell_child_append(  self, title);
	//############################# calclcd:textbox
	liqcell *calclcd = liqcell_quickcreatevis("calclcd", "label", 94, 64, 330, 88);
	liqcell_setfont(	calclcd, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (60), 0) );
	liqcell_setcaption(calclcd, "12345678" );
	liqcell_propsets(  calclcd, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  calclcd, "backcolor", "rgb(255,255,255)" );
	liqcell_propsets(  calclcd, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  calclcd, "textalign", 1 );
	liqcell_propseti(  calclcd, "textaligny", 1 );
	liqcell_propseti(  calclcd, "solarbrightness", 255 );
	liqcell_child_append(  self, calclcd);
	//############################# solarcell:label
	liqcell *solarcell = liqcell_quickcreatevis("solarcell", "label", 208, 166, 254, 50);
	liqcell_setfont(	solarcell, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (32), 0) );
	liqcell_setcaption(solarcell, "SOLAR CELL" );
	liqcell_propsets(  solarcell, "textcolor", "rgb(128,128,128)" );
	liqcell_propsets(  solarcell, "backcolor", "rgb(64,64,64)" );
	liqcell_propseti(  solarcell, "textalign", 2 );
	liqcell_propseti(  solarcell, "textaligny", 2 );
	liqcell_handleradd_withcontext(solarcell, "mouse", (void*)solarcell_mouse, self );
	liqcell_child_append(  self, solarcell);
	//############################# cmdplusminus:label
	liqcell *cmdplusminus = liqcell_quickcreatevis("cmdplusminus", "label", 384, 232, 78, 42);
	liqcell_setfont(	cmdplusminus, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	liqcell_setcaption(cmdplusminus, "±" );
	liqcell_propsets(  cmdplusminus, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdplusminus, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmdplusminus, "textalign", 2 );
	liqcell_propseti(  cmdplusminus, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdplusminus, "click", (void*)cmdplusminus_click, self );
	liqcell_child_append(  self, cmdplusminus);
	//############################# label21:label
	liqcell *label21 = liqcell_quickcreatevis("label21", "label", 50, 116, 44, 36);
	liqcell_setfont(	label21, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	liqcell_setcaption(label21, "E" );
	liqcell_propsets(  label21, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  label21, "backcolor", "rgb(255,255,255)" );
	liqcell_propseti(  label21, "textalign", 2 );
	liqcell_propseti(  label21, "textaligny", 2 );
	liqcell_child_append(  self, label21);
	//############################# label4:label
	liqcell *label4 = liqcell_quickcreatevis("label4", "label", 50, 64, 44, 36);
	liqcell_setfont(	label4, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	liqcell_setcaption(label4, "M" );
	liqcell_propsets(  label4, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  label4, "backcolor", "rgb(255,255,255)" );
	liqcell_propseti(  label4, "textalign", 2 );
	liqcell_propseti(  label4, "textaligny", 2 );
	liqcell_child_append(  self, label4);
	//############################# label26:label
	liqcell *label26 = liqcell_quickcreatevis("label26", "label", 50, 88, 44, 36);
	liqcell_setfont(	label26, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	liqcell_setcaption(label26, "-" );
	liqcell_propsets(  label26, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  label26, "backcolor", "rgb(255,255,255)" );
	liqcell_propseti(  label26, "textalign", 2 );
	liqcell_propseti(  label26, "textaligny", 2 );
	liqcell_child_append(  self, label26);
	//############################# cmdsqr:label
	liqcell *cmdsqr = liqcell_quickcreatevis("cmdsqr", "label", 296, 232, 78, 42);
	liqcell_setfont(	cmdsqr, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	liqcell_setcaption(cmdsqr, "^2" );
	liqcell_propsets(  cmdsqr, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdsqr, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmdsqr, "textalign", 2 );
	liqcell_propseti(  cmdsqr, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdsqr, "click", (void*)cmdsqr_click, self );
	liqcell_child_append(  self, cmdsqr);
	//############################# cmdmrc:label
	liqcell *cmdmrc = liqcell_quickcreatevis("cmdmrc", "label", 20, 232, 78, 42);
	liqcell_setfont(	cmdmrc, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	liqcell_setcaption(cmdmrc, "MRC" );
	liqcell_propsets(  cmdmrc, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdmrc, "backcolor", "xrgb(0,0,128)" );
	liqcell_propseti(  cmdmrc, "textalign", 2 );
	liqcell_propseti(  cmdmrc, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdmrc, "click", (void*)cmdmrc_click, self );
	liqcell_child_append(  self, cmdmrc);
	//############################# cmdmneg:label
	liqcell *cmdmneg = liqcell_quickcreatevis("cmdmneg", "label", 106, 232, 78, 42);
	liqcell_setfont(	cmdmneg, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	liqcell_setcaption(cmdmneg, "M-" );
	liqcell_propsets(  cmdmneg, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdmneg, "backcolor", "xrgb(0,0,128)" );
	liqcell_propseti(  cmdmneg, "textalign", 2 );
	liqcell_propseti(  cmdmneg, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdmneg, "click", (void*)cmdmneg_click, self );
	liqcell_child_append(  self, cmdmneg);
	//############################# cmdmplus:label
	liqcell *cmdmplus = liqcell_quickcreatevis("cmdmplus", "label", 192, 232, 78, 42);
	liqcell_setfont(	cmdmplus, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (26), 0) );
	liqcell_setcaption(cmdmplus, "M+" );
	liqcell_propsets(  cmdmplus, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdmplus, "backcolor", "xrgb(0,0,128)" );
	liqcell_propseti(  cmdmplus, "textalign", 2 );
	liqcell_propseti(  cmdmplus, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdmplus, "click", (void*)cmdmplus_click, self );
	liqcell_child_append(  self, cmdmplus);
	//############################# cmddivide:label
	liqcell *cmddivide = liqcell_quickcreatevis("cmddivide", "label", 370, 292, 92, 86);
	liqcell_setfont(	cmddivide, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmddivide, "÷" );
	liqcell_propsets(  cmddivide, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmddivide, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmddivide, "textalign", 2 );
	liqcell_propseti(  cmddivide, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmddivide, "click", (void*)cmddivide_click, self );
	liqcell_child_append(  self, cmddivide);
	//############################# cmdac:label
	liqcell *cmdac = liqcell_quickcreatevis("cmdac", "label", 20, 292, 92, 86);
	liqcell_setfont(	cmdac, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdac, "AC" );
	liqcell_propsets(  cmdac, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdac, "backcolor", "xrgb(128,64,0)" );
	liqcell_propseti(  cmdac, "textalign", 2 );
	liqcell_propseti(  cmdac, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdac, "click", (void*)cmdac_click, self );
	liqcell_child_append(  self, cmdac);
	//############################# cmdc:label
	liqcell *cmdc = liqcell_quickcreatevis("cmdc", "label", 140, 292, 92, 86);
	liqcell_setfont(	cmdc, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdc, "C" );
	liqcell_propsets(  cmdc, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdc, "backcolor", "xrgb(128,64,0)" );
	liqcell_propseti(  cmdc, "textalign", 2 );
	liqcell_propseti(  cmdc, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdc, "click", (void*)cmdc_click, self );
	liqcell_child_append(  self, cmdc);
	//############################# cmdpercent:label
	liqcell *cmdpercent = liqcell_quickcreatevis("cmdpercent", "label", 256, 292, 92, 86);
	liqcell_setfont(	cmdpercent, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdpercent, "%" );
	liqcell_propsets(  cmdpercent, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdpercent, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmdpercent, "textalign", 2 );
	liqcell_propseti(  cmdpercent, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdpercent, "click", (void*)cmdpercent_click, self );
	liqcell_child_append(  self, cmdpercent);
	//############################# cmdmul:label
	liqcell *cmdmul = liqcell_quickcreatevis("cmdmul", "label", 370, 394, 92, 86);
	liqcell_setfont(	cmdmul, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdmul, "X" );
	liqcell_propsets(  cmdmul, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdmul, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmdmul, "textalign", 2 );
	liqcell_propseti(  cmdmul, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdmul, "click", (void*)cmdmul_click, self );
	liqcell_child_append(  self, cmdmul);
	//############################# cmdminus:label
	liqcell *cmdminus = liqcell_quickcreatevis("cmdminus", "label", 370, 496, 92, 86);
	liqcell_setfont(	cmdminus, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdminus, "-" );
	liqcell_propsets(  cmdminus, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdminus, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmdminus, "textalign", 2 );
	liqcell_propseti(  cmdminus, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdminus, "click", (void*)cmdminus_click, self );
	liqcell_child_append(  self, cmdminus);
	//############################# cmdplus:label
	liqcell *cmdplus = liqcell_quickcreatevis("cmdplus", "label", 370, 596, 92, 190);
	liqcell_setfont(	cmdplus, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdplus, "+" );
	liqcell_propsets(  cmdplus, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdplus, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmdplus, "textalign", 2 );
	liqcell_propseti(  cmdplus, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdplus, "click", (void*)cmdplus_click, self );
	liqcell_child_append(  self, cmdplus);
	//############################# cmd7:label
	liqcell *cmd7 = liqcell_quickcreatevis("cmd7", "label", 20, 394, 92, 86);
	liqcell_setfont(	cmd7, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd7, "7" );
	liqcell_propsets(  cmd7, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd7, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd7, "textalign", 2 );
	liqcell_propseti(  cmd7, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd7, "click", (void*)cmd7_click, self );
	liqcell_child_append(  self, cmd7);
	//############################# cmd8:label
	liqcell *cmd8 = liqcell_quickcreatevis("cmd8", "label", 140, 394, 92, 86);
	liqcell_setfont(	cmd8, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd8, "8" );
	liqcell_propsets(  cmd8, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd8, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd8, "textalign", 2 );
	liqcell_propseti(  cmd8, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd8, "click", (void*)cmd8_click, self );
	liqcell_child_append(  self, cmd8);
	//############################# cmd9:label
	liqcell *cmd9 = liqcell_quickcreatevis("cmd9", "label", 256, 394, 92, 86);
	liqcell_setfont(	cmd9, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd9, "9" );
	liqcell_propsets(  cmd9, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd9, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd9, "textalign", 2 );
	liqcell_propseti(  cmd9, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd9, "click", (void*)cmd9_click, self );
	liqcell_child_append(  self, cmd9);
	//############################# cmd4:label
	liqcell *cmd4 = liqcell_quickcreatevis("cmd4", "label", 20, 496, 92, 86);
	liqcell_setfont(	cmd4, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd4, "4" );
	liqcell_propsets(  cmd4, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd4, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd4, "textalign", 2 );
	liqcell_propseti(  cmd4, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd4, "click", (void*)cmd4_click, self );
	liqcell_child_append(  self, cmd4);
	//############################# cmd5:label
	liqcell *cmd5 = liqcell_quickcreatevis("cmd5", "label", 140, 496, 92, 86);
	liqcell_setfont(	cmd5, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd5, "5" );
	liqcell_propsets(  cmd5, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd5, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd5, "textalign", 2 );
	liqcell_propseti(  cmd5, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd5, "click", (void*)cmd5_click, self );
	liqcell_child_append(  self, cmd5);
	//############################# cmd6:label
	liqcell *cmd6 = liqcell_quickcreatevis("cmd6", "label", 256, 496, 92, 86);
	liqcell_setfont(	cmd6, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd6, "6" );
	liqcell_propsets(  cmd6, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd6, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd6, "textalign", 2 );
	liqcell_propseti(  cmd6, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd6, "click", (void*)cmd6_click, self );
	liqcell_child_append(  self, cmd6);
	//############################# cmd1:label
	liqcell *cmd1 = liqcell_quickcreatevis("cmd1", "label", 20, 598, 92, 86);
	liqcell_setfont(	cmd1, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd1, "1" );
	liqcell_propsets(  cmd1, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd1, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd1, "textalign", 2 );
	liqcell_propseti(  cmd1, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd1, "click", (void*)cmd1_click, self );
	liqcell_child_append(  self, cmd1);
	//############################# cmd2:label
	liqcell *cmd2 = liqcell_quickcreatevis("cmd2", "label", 140, 598, 92, 86);
	liqcell_setfont(	cmd2, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd2, "2" );
	liqcell_propsets(  cmd2, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd2, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd2, "textalign", 2 );
	liqcell_propseti(  cmd2, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd2, "click", (void*)cmd2_click, self );
	liqcell_child_append(  self, cmd2);
	//############################# cmd3:label
	liqcell *cmd3 = liqcell_quickcreatevis("cmd3", "label", 256, 598, 92, 86);
	liqcell_setfont(	cmd3, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd3, "3" );
	liqcell_propsets(  cmd3, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd3, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd3, "textalign", 2 );
	liqcell_propseti(  cmd3, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd3, "click", (void*)cmd3_click, self );
	liqcell_child_append(  self, cmd3);
	//############################# cmd0:label
	liqcell *cmd0 = liqcell_quickcreatevis("cmd0", "label", 20, 700, 92, 86);
	liqcell_setfont(	cmd0, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmd0, "0" );
	liqcell_propsets(  cmd0, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmd0, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmd0, "textalign", 2 );
	liqcell_propseti(  cmd0, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmd0, "click", (void*)cmd0_click, self );
	liqcell_child_append(  self, cmd0);
	//############################# cmddot:label
	liqcell *cmddot = liqcell_quickcreatevis("cmddot", "label", 140, 700, 92, 86);
	liqcell_setfont(	cmddot, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmddot, "." );
	liqcell_propsets(  cmddot, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmddot, "backcolor", "xrgb(64,64,64)" );
	liqcell_propseti(  cmddot, "textalign", 2 );
	liqcell_propseti(  cmddot, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmddot, "click", (void*)cmddot_click, self );
	liqcell_child_append(  self, cmddot);
	//############################# cmdequals:label
	liqcell *cmdequals = liqcell_quickcreatevis("cmdequals", "label", 256, 700, 92, 86);
	liqcell_setfont(	cmdequals, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (33), 0) );
	liqcell_setcaption(cmdequals, "=" );
	liqcell_propsets(  cmdequals, "textcolor", "rgb(255,255,0)" );
	liqcell_propsets(  cmdequals, "backcolor", "xrgb(0,128,0)" );
	liqcell_propseti(  cmdequals, "textalign", 2 );
	liqcell_propseti(  cmdequals, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdequals, "click", (void*)cmdequals_click, self );
	liqcell_child_append(  self, cmdequals);

	//liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	//liqcell_setimage(  self ,  liqimage_cache_getfile( "/usr/share/liqbase/liqcalc/media/liqcalc_run_back.png",0,0,0) );
	liqcell_handleradd_withcontext(self, "filter",		 (void*)liqcalc_run_filter ,self);
	liqcell_handleradd_withcontext(self, "refresh",		(void*)liqcalc_run_refresh ,self);
	liqcell_handleradd_withcontext(self, "shown",		  (void*)liqcalc_run_shown ,self);
	liqcell_handleradd_withcontext(self, "resize",	  (void*)liqcalc_run_resize ,self);
	//liqcell_handleradd_withcontext(self, "keypress",	(void*)liqcalc_run_keypress,self );
	//liqcell_handleradd_withcontext(self, "keyrelease", (void*)liqcalc_run_keyrelease ,self);
	//liqcell_handleradd_withcontext(self, "mouse",		(void*)liqcalc_run_mouse,self );
	//liqcell_handleradd_withcontext(self, "click",		(void*)liqcalc_run_click ,self);
	liqcell_handleradd_withcontext(self, "paint",		(void*)liqcalc_run_paint ,self); // use only if required, heavyweight
	liqcell_handleradd_withcontext(self, "dialog_open",  (void*)liqcalc_run_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", (void*)liqcalc_run_dialog_close ,self);
	
	
	liqcell_child_append( self, liqcell_quickcreatenameclass("calcstack","stack") );
	
	liqcalc_clearall(self);
	return self;
}
Пример #29
0
/**	
 * create a new liqpostcard widget
 */	
liqcell *liqpostcard_create()
{
	liqcell *self = liqcell_quickcreatewidget("liqpostcard", "form", 800, 480);
	if(!self) {liqapp_log("liqcell error not create 'liqpostcard'"); return NULL;  } 
	
	// Optimization:  The aim is to REDUCE the number of drawn layers and operations called.
	// Optimization:  use only what you NEED to get an effect
	// Optimization:  Minimal layers and complexity
	// Optimization:  defaults: background, prefer nothing, will be shown through if there is a wallpaper
	// Optimization:  defaults: text, white, very fast rendering
	//############################# tweetmessage:textbox
	liqcell *tweetmessage = liqcell_quickcreatevis("tweetmessage", "textbox", 56, 424, 502, 50);
	liqcell_setfont(	tweetmessage, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (32), 0) );
	liqcell_setcaption(tweetmessage, "" );
	liqcell_propsets(  tweetmessage, "textcolor", "rgb(0,0,0)" );
	liqcell_propsets(  tweetmessage, "backcolor", "rgb(255,255,255)" );
	liqcell_propsets(  tweetmessage, "bordercolor", "rgb(200,100,100)" );
	liqcell_propseti(  tweetmessage, "textalign", 0 );
	liqcell_child_append(  self, tweetmessage);
	//############################# picfront:picturebox
	liqcell *picfront = liqcell_quickcreatevis("picfront", "picturebox", 20, 112, 368, 186);
	//liqcell_setfont(	picfront, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
	//liqcell_propsets(  picfront, "textcolor", "rgb(0,0,0)" );
	//liqcell_propsets(  picfront, "backcolor", "rgb(64,0,0)" );
	liqcell_propsets(  picfront, "bordercolor", "rgb(200,100,100)" );
    liqcell_handleradd_withcontext(picfront, "click", cmdpicchoose_click, self );
	liqcell_child_append(  self, picfront);
	//############################# messageback:picturebox
	liqcell *messageback = liqcell_quickcreatevis("messageback", "picturebox", 418, 112, 368, 186);
	//liqcell_setfont(	messageback, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (12), 0) );
    liqcell_propsets(  messageback, "imagefilename",  "/usr/share/liqbase/liqpostcard/media/liqpostcard_template.png" );
	//liqcell_propsets(  messageback, "textcolor", "rgb(0,0,0)" );
	//liqcell_propsets(  messageback, "backcolor", "rgb(64,0,0)" );
	liqcell_propsets(  messageback, "bordercolor", "rgb(200,100,100)" );
    liqcell_handleradd_withcontext(messageback, "click", cmdmessagedraw_click, self );
	liqcell_child_append(  self, messageback);
 /*   
	//############################# cmdmessagewrite:label
	liqcell *cmdmessagewrite = liqcell_quickcreatevis("cmdmessagewrite", "label", 418, 300, 176, 52);
	liqcell_setfont(	cmdmessagewrite, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdmessagewrite, "Write" );
	liqcell_propsets(  cmdmessagewrite, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdmessagewrite, "backcolor", "xrgb(0,0,64)" );
	liqcell_propsets(  cmdmessagewrite, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdmessagewrite, "textalign", 2 );
	liqcell_handleradd_withcontext(cmdmessagewrite, "click", cmdmessagewrite_click, self );
	liqcell_child_append(  self, cmdmessagewrite);
 */  
	//############################# label5:label
	liqcell *label5 = liqcell_quickcreatevis("label5", "label", 56, 390, 368, 32);
	liqcell_setfont(	label5, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(label5, "Message" );
	liqcell_propsets(  label5, "textcolor", "rgb(255,255,255)" );
	//liqcell_propsets(  label5, "backcolor", "xrgb(0,64,64)" );
	liqcell_propseti(  label5, "textalign", 0 );
	liqcell_child_append(  self, label5);
    
	//############################# cmdmessagedraw:label
	liqcell *cmdmessagedraw = liqcell_quickcreatevis("cmdmessagedraw", "label", 514, 300, 176, 52);
	liqcell_setfont(	cmdmessagedraw, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdmessagedraw, "Draw" );
	liqcell_propsets(  cmdmessagedraw, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdmessagedraw, "backcolor", "xrgb(0,0,64)" );
	liqcell_propsets(  cmdmessagedraw, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdmessagedraw, "textalign", 2 );
	liqcell_propseti(  cmdmessagedraw, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdmessagedraw, "click", cmdmessagedraw_click, self );
	liqcell_child_append(  self, cmdmessagedraw);
    
	//############################# cmdpicchoose:label
	liqcell *cmdpicchoose = liqcell_quickcreatevis("cmdpicchoose", "label", 112, 300, 176, 52);
	liqcell_setfont(	cmdpicchoose, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdpicchoose, "Choose" );
	liqcell_propsets(  cmdpicchoose, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdpicchoose, "backcolor", "xrgb(0,0,64)" );
	liqcell_propsets(  cmdpicchoose, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdpicchoose, "textalign", 2 );
	liqcell_propseti(  cmdpicchoose, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdpicchoose, "click", cmdpicchoose_click, self );
	liqcell_child_append(  self, cmdpicchoose);
    
	//############################# cmdsend:label
	liqcell *cmdsend = liqcell_quickcreatevis("cmdsend", "label", 574, 418, 226, 62);
	liqcell_setfont(	cmdsend, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdsend, "Send" );
	liqcell_propsets(  cmdsend, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdsend, "backcolor", "xrgb(0,64,0)" );
	liqcell_propsets(  cmdsend, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdsend, "textalign", 2 );
	liqcell_propseti(  cmdsend, "textaligny", 2 );
    liqcell_setenabled(  cmdsend, 0 );
	liqcell_handleradd_withcontext(cmdsend, "click", cmdsend_click, self );
	liqcell_child_append(  self, cmdsend);
    
	//############################# pichead:label
	liqcell *pichead = liqcell_quickcreatevis("pichead", "label", 20, 74, 368, 36);
	liqcell_setfont(	pichead, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(pichead, "Picture" );
	liqcell_propsets(  pichead, "textcolor", "rgb(255,255,255)" );
	//liqcell_propsets(  pichead, "backcolor", "xrgb(0,64,64)" );
	liqcell_propseti(  pichead, "textalign", 0 );
	liqcell_child_append(  self, pichead);
    
	//############################# messagehead:label
	liqcell *messagehead = liqcell_quickcreatevis("messagehead", "label", 418, 74, 368, 36);
	liqcell_setfont(	messagehead, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(messagehead, "Sketch" );
	liqcell_propsets(  messagehead, "textcolor", "rgb(255,255,255)" );
	//liqcell_propsets(  messagehead, "backcolor", "xrgb(0,64,64)" );
	liqcell_propseti(  messagehead, "textalign", 0 );
	liqcell_child_append(  self, messagehead);
    
	//############################# title:label
	liqcell *title = liqcell_quickcreatevis("title", "label", 0, 0, 800, 56);
	liqcell_setfont(	title, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(title, "postcard :: say hello." );
	liqcell_propsets(  title, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  title, "backcolor", "xrgb(0,0,0)" );
	liqcell_propseti(  title, "textalign", 0 );
	liqcell_child_append(  self, title);
    
	//liqcell_propsets(  self, "backcolor", "rgb(0,0,0)" );
	liqcell_handleradd_withcontext(self, "refresh", liqpostcard_refresh ,self);
	liqcell_handleradd_withcontext(self, "shown", liqpostcard_shown ,self);
	liqcell_handleradd_withcontext(self, "resize", liqpostcard_resize ,self);
	liqcell_handleradd_withcontext(self, "keypress", liqpostcard_keypress,self );
	liqcell_handleradd_withcontext(self, "keyrelease", liqpostcard_keyrelease ,self);
	liqcell_handleradd_withcontext(self, "mouse", liqpostcard_mouse,self );
	liqcell_handleradd_withcontext(self, "click", liqpostcard_click ,self);
	//liqcell_handleradd_withcontext(self, "paint", liqpostcard_paint ,self); // use only if required, heavyweight
	liqcell_handleradd_withcontext(self, "dialog_open", liqpostcard_dialog_open ,self);
	liqcell_handleradd_withcontext(self, "dialog_close", liqpostcard_dialog_close ,self);


	//############################# cmdconfigure:label
	liqcell *cmdconfigure = liqcell_quickcreatevis("cmdconfigure", "label", 508, 0, 226, 56);
	liqcell_setfont(	cmdconfigure, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (29), 0) );
	liqcell_setcaption(cmdconfigure, "configure" );
	liqcell_propsets(  cmdconfigure, "textcolor", "rgb(255,255,255)" );
	liqcell_propsets(  cmdconfigure, "backcolor", "xrgb(0,64,0)" );
	liqcell_propsets(  cmdconfigure, "bordercolor", "rgb(255,255,255)" );
	liqcell_propseti(  cmdconfigure, "textalign", 2 );
	liqcell_propseti(  cmdconfigure, "textaligny", 2 );
	liqcell_handleradd_withcontext(cmdconfigure, "click", cmdconfigure_click, self );
	liqcell_child_append(  self, cmdconfigure);

    
    
    //########## major sideways hack.  classes need declarations and header files.
    int dialog_selectimage_getfirstphoto_filename(liqcell *self,char *buffer,int bufferlen);
    char selfn[FILENAME_MAX]={0};
    liqcell *dialog_selectimage = liqcell_quickcreatevis("liqpostcard.choose","dialog_selectimage",0,0,-1,-1);
    dialog_selectimage_getfirstphoto_filename(dialog_selectimage,selfn,sizeof(selfn) );
    if(selfn && *selfn)
    {
        liqcell_propsets(  picfront, "imagefilename", selfn  );
    }
    liqcell_release(dialog_selectimage);
    
    
    
    liqcell_handlerrun(self,"refresh",NULL);
    
	return self;
}
Пример #30
0
/**	Creat an IP Address Input Bar */
liqcell *ipbar_create()
{
	liqcell *self = liqcell_quickcreatewidget("ipbar", "form", 600, 50);
	
	// exit if fail create
	if(!self)
	{
		liqapp_log("liqcell error not create 'ipbar'"); 
		return NULL;
	}
	
	
	// create label: Enter IP Address:
	liqcell *ip_label = liqcell_quickcreatevis("ip_label", "label", 20, 7, 200, 36);
	liqcell_setfont(ip_label, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0));
	liqcell_setcaption(ip_label, "Quick Connect:");
	liqcell_propsets(ip_label, "textcolor", CYAN); //liqcell_propsets(ip_label, "backcolor", "rgb(0,0,0)");
	liqcell_propseti(ip_label, "textalign", 1);
	liqcell_child_append(self, ip_label);
	
	
	// create textbox
	liqcell *ip_textbox = liqcell_quickcreatevis("ip_textbox", "textbox", 226, 7, 200, 36);
	liqcell_setfont(ip_textbox, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(ip_textbox, "");
	liqcell_propsets(ip_textbox, "textcolor", WHITE);
	liqcell_propsets(ip_textbox, "backcolor", BLACK);
	liqcell_propsets(ip_textbox, "bordercolor", CYAN);
	liqcell_propseti(ip_textbox, "textalign", 0);
	liqcell_propseti(ip_textbox, "textaligny", 2);
	liqcell_child_append(self, ip_textbox);
	
	/*
	
	// add vkbd
	liqcell *vkbd = liqcell_quickcreatevis("vkbd", "liqkeyboard", 0, 0, 0, 0);
	liqcell_setdata(vkbd, ip_textbox);
	
	
	liqcell *wrap = liqcell_quickcreatevis("vkbd_wrap" ,NULL, 425, 7, 32, 32);
	liqcell_handleradd(wrap, "click", widget_click);
	liqcell_setfont(wrap, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (24), 0));
	liqcell_setcaption(wrap, "");
	liqcell_propsets(wrap, "backcolor", CYAN);
	liqcell_propsets(wrap, "textcolor", BLACK);
	liqcell_propseti(wrap, "textalign", 2);
	liqcell_propseti(wrap, "textaligny", 2);
	liqcell_setcontent(wrap, vkbd);
	liqcell_propseti(wrap, "lockaspect", 1);
	liqcell_child_append(self, wrap);
	
	*/
	
	// create buttom: Submit
	liqcell *ip_submit = liqcell_quickcreatevis("ip_submit", "commandbutton", 460, 7, 76, 32);
	liqcell_setfont(ip_submit, liqfont_cache_getttf("/usr/share/fonts/nokia/nosnb.ttf", (22), 0) );
	liqcell_setcaption(ip_submit, "Submit");
	liqcell_propsets(ip_submit, "textcolor", CYAN);
	liqcell_propsets(ip_submit, "backcolor", BLACK);
	liqcell_handleradd_withcontext(ip_submit, "click", ip_submit_click, self);
	liqcell_propseti(ip_submit, "textalign", 1);
	liqcell_child_append(self, ip_submit);
	
	
	
	
	
	return self;
}