8000 edited widget modules for css efficiency by captain-nemo-10994 · Pull Request #59 · LightSys/centrallix · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

edited widget modules for css efficiency #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions centrallix/htmlgen/htdrv_chart.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ static struct
int idcnt;
} HTCHT;

int htchtSetup(pHtSession s)
{
htrAddStylesheetItem_va(s, "\t.chtChart { POSITION:absolute; VISIBILITY:inherit; }\n");
return 0;
}

int
htchtCheckBrowserSupport(pHtSession session)
{
Expand Down Expand Up @@ -328,7 +334,7 @@ htchtGenHTML(pHtSession session, pWgtrNode tree, int z)

htchtGetCanvasId(tree, buf, sizeof(buf));

htrAddBodyItem_va(session,"<DIV ID=\"%STR&SYMdiv\"><CANVAS ID=\"%STR&SYM\" width=\"%POS\" height=\"%POS\">\n",
htrAddBodyItem_va(session,"<DIV ID=\"%STR&SYMdiv\" class=\"chtChart\"><CANVAS ID=\"%STR&SYM\" width=\"%POS\" height=\"%POS\">\n",
buf,
buf,
htchtGetWidth(tree),
Expand All @@ -338,7 +344,7 @@ htchtGenHTML(pHtSession session, pWgtrNode tree, int z)
htrAddBodyItem(session,"<P>CHART HERE</P>\n");
htrAddBodyItem(session,"</CANVAS></DIV>\n");

htrAddStylesheetItem_va(session, "\t#%STR&SYMdiv { POSITION:absolute; VISIBILITY:inherit; LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; HEIGHT:%POSpx; Z-INDEX:%POS; } \n",
htrAddStylesheetItem_va(session, "\t#%STR&SYMdiv { LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; HEIGHT:%POSpx; Z-INDEX:%POS; } \n",
buf,
htchtGetX(tree),
htchtGetY(tree),
Expand Down Expand Up @@ -391,6 +397,7 @@ htchtInitialize()
strcpy(drv->Name, "DHTML Chart Driver");
strcpy(drv->WidgetName, "chart");
drv->Render = htchtRender;
drv->Setup = htchtSetup;
xaAddItem(&(drv->PseudoTypes), "chart-axis");
xaAddItem(&(drv->PseudoTypes), "chart-series");

Expand Down
12 changes: 10 additions & 2 deletions centrallix/htmlgen/htdrv_checkbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ static struct {
int idcnt;
} HTCB;

int htcbSetup(pHtSession s)
{
htrAddStylesheetItem_va(s,"\t.cbMain { POSITION:absolute; VISIBILITY:inherit; HEIGHT:13px; WIDTH:13px; }\n");
return 0;
}


int htcbRender(pHtSession s, pWgtrNode tree, int z) {
char fieldname[HT_FIELDNAME_SIZE];
Expand Down < 8000 tool-tip id="tooltip-82771e94-7b47-4535-a54e-9368293759d1" for="expand-up-link-13-diff-7e90bd74fda8ca83f5da7a5fb7a398a7ace662b160852c9c9d4fc39d0d67f91b" popover="manual" data-direction="ne" data-type="label" data-view-component="true" class="sr-only position-absolute">Expand Up @@ -92,7 +98,7 @@ int htcbRender(pHtSession s, pWgtrNode tree, int z) {
htrAddWgtrObjLinkage_va(s, tree, "cb%INTmain", id);

/** Ok, write the style header items. **/
htrAddStylesheetItem_va(s,"\t#cb%POSmain { POSITION:absolute; VISIBILITY:inherit; LEFT:%INTpx; TOP:%INTpx; HEIGHT:13px; WIDTH:13px; Z-INDEX:%POS; }\n",id,x,y,z);
htrAddStylesheetItem_va(s,"\t#cb%POSmain { LEFT:%INTpx; TOP:%INTpx; Z-INDEX:%POS; }\n",id,x,y,z);
htrAddScriptInclude(s,"/sys/js/htdrv_checkbox.js",0);
htrAddScriptInclude(s,"/sys/js/ht_utils_hints.js",0);

Expand All @@ -106,7 +112,8 @@ int htcbRender(pHtSession s, pWgtrNode tree, int z) {
htrAddScriptInit_va(s," checkbox_init({layer:wgtrGetNodeRef(ns,\"%STR&SYM\"), fieldname:\"%STR&JSSTR\", checked:%INT, enabled:%INT, form:\"%STR&JSSTR\"});\n", name, fieldname,checked,enabled,form);

/** HTML body <DIV> element for the layers. **/
htrAddBodyItemLayerStart(s, 0, "cb%POSmain", id, NULL);
htrAddBodyItemLayerStart(s, 0, "cb%POSmain", id, "cbMain");
//htrAddBodyItem_va(s, "<DIV id=\"cb%POSmain\" class=\"cbMain\">\n");
switch(checked)
{
case 1:
Expand Down Expand Up @@ -144,6 +151,7 @@ int htcbInitialize() {
strcpy(drv->Name,"DHTML Checkbox Driver");
strcpy(drv->WidgetName,"checkbox");
drv->Render = htcbRender;
drv->Setup = htcbSetup;

/** Events **/
htrAddEvent(drv,"Click");
Expand Down
21 changes: 15 additions & 6 deletions centrallix/htmlgen/htdrv_datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ static struct
}
HTDT;

int htdtSetup(pHtSession s)
{
htrAddStylesheetItem_va(s,"\t.dtAbsHid { OVERFLOW: hidden; POSITION:absolute;}\n");
htrAddStylesheetItem_va(s,"\t.dtBtn { VISIBILITY:inherit; cursor:default; border:1px outset #e0e0e0;}\n");
htrAddStylesheetItem_va(s,"\t.dtCon1 { VISIBILITY:inherit; LEFT:1px; TOP:1px; }\n");
htrAddStylesheetItem_va(s,"\t.dtCon2 { VISIBILITY:hidden; LEFT:1px; TOP:1px; }\n");
return 0;
}

/*** htdtRender - generate the HTML code for the page.
***/
Expand Down Expand Up @@ -201,9 +209,9 @@ htdtRender(pHtSession s, pWgtrNode tree, int z)
strcpy(fgcolor,"black");

/** Ok, write the style header items. **/
htrAddStylesheetItem_va(s,"\t#dt%POSbtn { OVERFLOW:hidden; POSITION:absolute; VISIBILITY:inherit; LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; HEIGHT:%POSpx; Z-INDEX:%POS; cursor:default; border:1px outset #e0e0e0; %STR }\n",id,x,y,w,h,z, bgcolor);
htrAddStylesheetItem_va(s,"\t#dt%POScon1 { OVERFLOW:hidden; POSITION:absolute; VISIBILITY:inherit; LEFT:1px; TOP:1px; WIDTH:%POSpx; HEIGHT:%POSpx; Z-INDEX:%POS; }\n",id,w-20,h-2,z+1);
htrAddStylesheetItem_va(s,"\t#dt%POScon2 { OVERFLOW:hidden; POSITION:absolute; VISIBILITY:hidden; LEFT:1px; TOP:1px; WIDTH:%POSpx; HEIGHT:%POSpx; Z-INDEX:%POS; }\n",id,w-20,h-2,z+1);
htrAddStylesheetItem_va(s,"\t#dt%POSbtn { LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; HEIGHT:%POSpx; Z-INDEX:%POS; %STR }\n",id,x,y,w,h,z, bgcolor);
htrAddStylesheetItem_va(s,"\t#dt%POScon1 { WIDTH:%POSpx; HEIGHT:%POSpx; Z-INDEX:%POS; }\n",id,w-20,h-2,z+1);
htrAddStylesheetItem_va(s,"\t#dt%POScon2 { WIDTH:%POSpx; HEIGHT:%POSpx; Z-INDEX:%POS; }\n",id,w-20,h-2,z+1);

/** Write named global **/
htrAddScriptGlobal(s, "dt_current", "null", 0);
Expand All @@ -230,7 +238,7 @@ htdtRender(pHtSession s, pWgtrNode tree, int z)
date_only, default_time);

/** HTML body <DIV> elements for the layers. **/
htrAddBodyItem_va(s,"<DIV ID=\"dt%POSbtn\">\n"
htrAddBodyItem_va(s,"<DIV ID=\"dt%POSbtn\" class=\"dtBtn dtAbsHid\">\n"
"<IMG SRC=\"/sys/images/ico17.gif\" style=\"float:right;\">\n", id);
/*htrAddBodyItem_va(s,"<TABLE width=%POS cellspacing=0 cellpadding=0 border=0>\n",w);
htrAddBodyItem(s, " <TR><TD><IMG SRC=/sys/images/white_1x1.png></TD>\n");
Expand All @@ -243,8 +251,8 @@ htdtRender(pHtSession s, pWgtrNode tree, int z)
htrAddBodyItem_va(s," <TD><IMG SRC=/sys/images/dkgrey_1x1.png height=1 width=%POS></TD>\n",w-2);
htrAddBodyItem(s, " <TD><IMG SRC=/sys/images/dkgrey_1x1.png></TD></TR>\n");
htrAddBodyItem(s, "</TABLE>\n");*/
htrAddBodyItem_va(s,"<DIV ID=\"dt%POScon1\"></DIV>\n",id);
htrAddBodyItem_va(s,"<DIV ID=\"dt%POScon2\"></DIV>\n",id);
htrAddBodyItem_va(s,"<DIV ID=\"dt%POScon1\" class=\"dtCon1 dtAbsHid\"></DIV>\n",id);
htrAddBodyItem_va(s,"<DIV ID=\"dt%POScon2\" class=\"dtCon2 dtAbsHid\"></DIV>\n",id);
htrAddBodyItem(s, "</DIV>\n");

/** Add the event handling scripts **/
Expand Down Expand Up @@ -277,6 +285,7 @@ htdtInitialize()
strcpy(drv->Name,"HTML Date/Time Widget Driver");
strcpy(drv->WidgetName,"datetime");
drv->Render = htdtRender;
drv->Setup = htdtSetup;

/** Register events **/
htrAddEvent(drv,"Click");
Expand Down
22 changes: 15 additions & 7 deletions centrallix/htmlgen/htdrv_dropdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ static struct {
int idcnt;
} HTDD;


int htddSetup(pHtSession s)
{
htrAddStylesheetItem_va(s,"\t.ddHidAbs { OVERFLOW:hidden; POSITION:absolute; }\n");
htrAddStylesheetItem_va(s,"\t.ddBtn { VISIBILITY:inherit; cursor:default; border:1px outset #e0e0e0;}\n");
htrAddStylesheetItem_va(s,"\t.ddCon1 { VISIBILITY:inherit; LEFT:1px; TOP:1px; WIDTH:1024px; HEIGHT:%POSpx; Z-INDEX:%POS; }\n");
htrAddStylesheetItem_va(s,"\t.ddCon2 { VISIBILITY:hidden; LEFT:1px; TOP:1px; WIDTH:1024px; HEIGHT:%POSpx; Z-INDEX:%POS; }\n");
return 0;
}
/*
htddRender - generate the HTML code for the page.
*/
Expand Down Expand Up @@ -138,9 +145,9 @@ int htddRender(pHtSession s, pWgtrNode tree, int z) {
strtcpy(name,ptr,sizeof(name));

/** Ok, write the style header items. **/
htrAddStylesheetItem_va(s,"\t#dd%POSbtn { OVERFLOW:hidden; POSITION:absolute; VISIBILITY:inherit; LEFT:%INTpx; TOP:%INTpx; HEIGHT:%POSpx; WIDTH:%POSpx; Z-INDEX:%POS; cursor:default; background-color: %STR&CSSVAL; border:1px outset #e0e0e0;}\n",id,x,y,h,w,z,bgstr);
htrAddStylesheetItem_va(s,"\t#dd%POScon1 { OVERFLOW:hidden; POSITION:absolute; VISIBILITY:inherit; LEFT:1px; TOP:1px; WIDTH:1024px; HEIGHT:%POSpx; Z-INDEX:%POS; }\n",id,h-2,z+1);
htrAddStylesheetItem_va(s,"\t#dd%POScon2 { OVERFLOW:hidden; POSITION:absolute; VISIBILITY:hidden; LEFT:1px; TOP:1px; WIDTH:1024px; HEIGHT:%POSpx; Z-INDEX:%POS; }\n",id,h-2,z+1);
htrAddStylesheetItem_va(s,"\t#dd%POSbtn { LEFT:%INTpx; TOP:%INTpx; HEIGHT:%POSpx; WIDTH:%POSpx; Z-INDEX:%POS; background-color: %STR&CSSVAL;}\n",id,x,y,h,w,z,bgstr);
htrAddStylesheetItem_va(s,"\t#dd%POScon1 { HEIGHT:%POSpx; Z-INDEX:%POS; }\n",id,h-2,z+1);
htrAddStylesheetItem_va(s,"\t#dd%POScon2 { HEIGHT:%POSpx; Z-INDEX:%POS; }\n",id,h-2,z+1);

htrAddScriptGlobal(s, "dd_current", "null", 0);
htrAddScriptGlobal(s, "dd_lastkey", "null", 0);
Expand Down Expand Up @@ -190,7 +197,7 @@ int htddRender(pHtSession s, pWgtrNode tree, int z) {
htrAddScriptInit_va(s," dd_init({layer:wgtrGetNodeRef(ns,\"%STR&SYM\"), c1:htr_subel(wgtrGetNodeRef(ns,\"%STR&SYM\"), \"dd%POScon1\"), c2:htr_subel(wgtrGetNodeRef(ns,\"%STR&SYM\"), \"dd%POScon2\"), background:'%STR&JSSTR', highlight:'%STR&JSSTR', fieldname:'%STR&JSSTR', numDisplay:%INT, mode:%INT, sql:'%STR&JSSTR', width:%INT, height:%INT, form:'%STR&JSSTR', osrc:'%STR&JSSTR', qms:%INT, ivs:%INT, popup_width:%INT});\n", name, name, id, name, id, bgstr, hilight, fieldname, num_disp, mode, sql?sql:"", w, h, form, osrc, query_multiselect, invalid_select_default, pop_w);

/** HTML body <DIV> element for the layers. **/
htrAddBodyItem_va(s,"<DIV ID=\"dd%POSbtn\">\n"
htrAddBodyItem_va(s,"<DIV ID=\"dd%POSbtn\" class=\"ddBtn ddHidAbs\">\n"
"<IMG SRC=\"/sys/images/ico15b.gif\" style=\"float:right;\">\n", id);
/*htrAddBodyItem_va(s,"<TABLE width=%POS cellspacing=0 cellpadding=0 border=0>\n",w);
htrAddBodyItem(s, " <TR><TD><IMG SRC=/sys/images/white_1x1.png></TD>\n");
Expand All @@ -203,8 +210,8 @@ int htddRender(pHtSession s, pWgtrNode tree, int z) {
htrAddBodyItem_va(s," <TD><IMG SRC=/sys/images/dkgrey_1x1.png height=1 width=%POS></TD>\n",w-2);
htrAddBodyItem(s, " <TD><IMG SRC=/sys/images/dkgrey_1x1.png></TD></TR>\n");
htrAddBodyItem(s, "</TABLE>\n");*/
htrAddBodyItem_va(s,"<DIV ID=\"dd%POScon1\"></DIV>\n",id);
htrAddBodyItem_va(s,"<DIV ID=\"dd%POScon2\"></DIV>\n",id);
htrAddBodyItem_va(s,"<DIV ID=\"dd%POScon1\" class=\"ddCon1 ddHidAbs\"></DIV>\n",id);
htrAddBodyItem_va(s,"<DIV ID=\"dd%POScon2\" class=\"ddCon2 ddHidAbs\"></DIV>\n",id);
htrAddBodyItem(s, "</DIV>\n");

/* Read and initialize the dropdown items */
Expand Down Expand Up @@ -376,6 +383,7 @@ int htddInitialize() {
strcpy(drv->Name,"DHTML Drop Down Widget Driver");
strcpy(drv->WidgetName,"dropdown");
drv->Render = htddRender;
drv->Setup = htddSetup;
xaAddItem(&(drv->PseudoTypes), "dropdownitem");

/** Register events **/
Expand Down
19 changes: 13 additions & 6 deletions centrallix/htmlgen/htdrv_editbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ static struct
}
HTEB;

int htebSetup(pHtSession s)
{
htrAddStylesheetItem_va(s,"\t.ebBase { POSITION:absolute; VISIBILITY:inherit; overflow:hidden; border-style:solid; border-width:1px; }\n");
htrAddStylesheetItem_va(s,"\t.ebCon1 { VISIBILITY:inherit; border:none; }\n");
return 0;
}

/*** htebRender - generate the HTML code for the editbox widget.
***/
Expand Down Expand Up @@ -149,8 +155,8 @@ htebRender(pHtSession s, pWgtrNode tree, int z)
box_offset = 0;

/** Ok, write the style header items. **/
htrAddStylesheetItem_va(s,"\t#eb%POSbase { POSITION:absolute; VISIBILITY:inherit; LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; Z-INDEX:%POS; overflow:hidden; }\n",id,x,y,w-2*box_offset,z);
htrAddStylesheetItem_va(s,"\t#eb%POScon1 { VISIBILITY:inherit; LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; Z-INDEX:%POS; border:none; }\n",id,5,0,w-10,z+1);
htrAddStylesheetItem_va(s,"\t#eb%POSbase { LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; Z-INDEX:%POS; }\n",id,x,y,w-2*box_offset,z);
htrAddStylesheetItem_va(s,"\t#eb%POScon1 { LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; Z-INDEX:%POS; }\n",id,5,0,w-10,z+1);

/** Write named global **/
htrAddWgtrObjLinkage_va(s, tree, "eb%POSbase",id);
Expand Down Expand Up @@ -179,19 +185,19 @@ htebRender(pHtSession s, pWgtrNode tree, int z)
tooltip, descfg, descr);

/** HTML body <DIV> element for the base layer. **/
htrAddBodyItem_va(s, "<DIV ID=\"eb%POSbase\">\n",id);
htrAddBodyItem_va(s, "<DIV ID=\"eb%POSbase\" class=\"ebBase\">\n",id);

/** Use CSS border for drawing **/
if (is_raised)
htrAddStylesheetItem_va(s,"\t#eb%POSbase { border-style:solid; border-width:1px; border-color: white gray gray white; %STR }\n",id, main_bg);
htrAddStylesheetItem_va(s,"\t#eb%POSbase { border-color: white gray gray white; %STR }\n",id, main_bg);
else
htrAddStylesheetItem_va(s,"\t#eb%POSbase { border-style:solid; border-width:1px; border-color: gray white white gray; %STR }\n",id, main_bg);
htrAddStylesheetItem_va(s,"\t#eb%POSbase { border-color: gray white white gray; %STR }\n",id, main_bg);
if (h >= 0)
htrAddStylesheetItem_va(s,"\t#eb%POSbase { height:%POSpx; }\n\t#eb%POScon1 { height:%POSpx; }\n", id, h-2*box_offset, id, h-2*box_offset-2);

//htrAddBodyItem_va(s, "<table border='0' cellspacing='0' cellpadding='0' width='%POS'><tr><td align='left' valign='middle' height='%POS'><img name='l' src='/sys/images/eb_edg.gif'></td><td>&nbsp;</td><td align='right' valign='middle'><img name='r' src='/sys/images/eb_edg.gif'></td></tr></table>\n", w-2, h-2);
//htrAddBodyItem_va(s, "<DIV ID=\"eb%POScon1\"></DIV>\n",id);
htrAddBodyItem_va(s, "<img name=\"l\" src=\"/sys/images/eb_edg.gif\" style=\"vertical-align:10%%\" /><input id=\"eb%POScon1\" /><img name=\"r\" src=\"/sys/images/eb_edg.gif\" style=\"vertical-align:10%%\" />\n",id);
htrAddBodyItem_va(s, "<img name=\"l\" src=\"/sys/images/eb_edg.gif\" style=\"vertical-align:10%%\" /><input id=\"eb%POScon1\" class=\"ebCon1\" /><img name=\"r\" src=\"/sys/images/eb_edg.gif\" style=\"vertical-align:10%%\" />\n",id);

/** Check for more sub-widgets **/
for (i=0;i<xaCount(&(tree->Children));i++)
Expand Down Expand Up @@ -221,6 +227,7 @@ htebInitialize()
strcpy(drv->Name,"DHTML Single-line Editbox Driver");
strcpy(drv->WidgetName,"editbox");
drv->Render = htebRender;
drv->Setup = htebSetup;

/** Events **/
htrAddEvent(drv,"Click");
Expand Down
9 changes: 7 additions & 2 deletions centrallix/htmlgen/htdrv_fileupload.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ static struct
}
HTFU;

int htfuSetup(pHtSession s)
{
htrAddStylesheetItem_va(s,".fuBase { POSITION:absolute; VISIBILITY:hidden; }\n");
return 0;
}
/*** htfuRender - generate the HTML code for the fileupload widget
***/
int
Expand Down Expand Up @@ -94,8 +99,7 @@ htfuRender(pHtSession s, pWgtrNode tree, int z)
htrAddScriptInit_va(s, " fu_init({layer:wgtrGetNodeRef(ns,'%STR&SYM'), pane:document.getElementById(\"fu%POSform\"), input:document.getElementById(\"fu%POSinput\"), iframe:document.getElementById(\"fu%POSiframe\"), target:\"%STR&JSSTR\"});\n", name, id, id, id, target);

/** style header items **/
htrAddStylesheetItem_va(s,"#fu%POSbase { POSITION:absolute; VISIBILITY:hidden; }\n", id);
htrAddBodyItem_va(s,"<DIV ID=\"fu%POSbase\"><FORM ID=\"fu%POSform\" METHOD=\"post\" ENCTYPE=\"multipart/form-data\" TARGET=\"fu%POSiframe\"><iframe ID=\"fu%POSiframe\" NAME=\"fu%POSiframe\"></iframe><INPUT ID=\"fu%POSinput\" TYPE=\"file\" NAME=\"fu%POSinput\" %STR/></FORM></DIV>", id, id, id, id, id, id, id, multiselect?"MULTIPLE":"");
htrAddBodyItem_va(s,"<DIV ID=\"fu%POSbase\" class=\"fuBase\"><FORM ID=\"fu%POSform\" METHOD=\"post\" ENCTYPE=\"multipart/form-data\" TARGET=\"fu%POSiframe\"><iframe ID=\"fu%POSiframe\" NAME=\"fu%POSiframe\"></iframe><INPUT ID=\"fu%POSinput\" TYPE=\"file\" NAME=\"fu%POSinput\" %STR/></FORM></DIV>", id, id, id, id, id, id, id, multiselect?"MULTIPLE":"");

/** Check for more sub-widgets **/
for (i=0;i<xaCount(&(tree->Children));i++)
Expand All @@ -121,6 +125,7 @@ htfuInitialize()
strcpy(drv->Name,"DHTML File Upload Driver");
strcpy(drv->WidgetName,"fileupload");
drv->Render = htfuRender;
drv->Setup = htfuSetup;

/** Add actions **/
htrAddAction(drv,"Reset");
Expand Down
14 changes: 10 additions & 4 deletions centrallix/htmlgen/htdrv_formstatus.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ static struct {
int idcnt;
} HTFS;

int htfsSetup(pHtSession s)
{
htrAddStylesheetItem_va(s,"\t.fsMain { POSITION:absolute; VISIBILITY:inherit; HEIGHT:13px; }\n");
return 0;
}

/*
htfsRender - generate the HTML code for the page.
Expand Down Expand Up @@ -89,7 +94,7 @@ int htfsRender(pHtSession s, pWgtrNode tree, int z) {
htrAddWgtrObjLinkage_va(s, tree, "fs%POSmain", id);

/** Ok, write the style header items. **/
htrAddStylesheetItem_va(s,"\t#fs%POSmain { POSITION:absolute; VISIBILITY:inherit; LEFT:%INTpx; TOP:%INTpx; HEIGHT:13px; WIDTH:%POSpx; Z-INDEX:%POS; }\n",id,x,y,w,z);
htrAddStylesheetItem_va(s,"\t#fs%POSmain { LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; Z-INDEX:%POS; }\n",id,x,y,w,z);

htrAddScriptInclude(s, "/sys/js/htdrv_formstatus.js", 0);

Expand All @@ -99,11 +104,11 @@ int htfsRender(pHtSession s, pWgtrNode tree, int z) {

/** HTML body <DIV> element for the layers. **/
if (!strcmp(style,"large"))
htrAddBodyItem_va(s," <DIV ID=\"fs%POSmain\"><IMG SRC=/sys/images/formstatL05.png></DIV>\n", id);
htrAddBodyItem_va(s," <DIV ID=\"fs%POSmain\" class=\"fsMain\"><IMG SRC=/sys/images/formstatL05.png></DIV>\n", id);
else if (!strcmp(style,"largeflat"))
htrAddBodyItem_va(s," <DIV ID=\"fs%POSmain\"><IMG SRC=/sys/images/formstatLF05.png></DIV>\n", id);
htrAddBodyItem_va(s," <DIV ID=\"fs%POSmain\" class=\"fsMain\"><IMG SRC=/sys/images/formstatLF05.png></DIV>\n", id);
else
htrAddBodyItem_va(s," <DIV ID=\"fs%POSmain\"><IMG SRC=/sys/images/formstat05.gif></DIV>\n", id);
htrAddBodyItem_va(s," <DIV ID=\"fs%POSmain\" class=\"fsMain\"><IMG SRC=/sys/images/formstat05.gif></DIV>\n", id);

htrAddEventHandlerFunction(s,"document","MOUSEDOWN","fs","fs_mousedown");
htrAddEventHandlerFunction(s,"document","MOUSEUP", "fs","fs_mouseup");
Expand Down Expand Up @@ -133,6 +138,7 @@ int htfsInitialize() {
strcpy(drv->Name,"DHTML Form Status Driver");
strcpy(drv->WidgetName,"formstatus");
drv->Render = htfsRender;
drv->Setup = htfsSetup;

htrAddEvent(drv,"Click");
htrAddEvent(drv,"MouseUp");
Expand Down
17 changes: 11 additions & 6 deletions centrallix/htmlgen/htdrv_imagebutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ static struct
}
HTIBTN;


int htibtnSetup(pHtSession s)
{
htrAddStylesheetItem_va(s,"\t.ibtnPane { POSITION:absolute; VISIBILITY:inherit; cursor:pointer; }\n");
return 0;
}
/*** htibtnRender - generate the HTML code for the page.
***/
int
Expand Down Expand Up @@ -137,7 +141,7 @@ htibtnRender(pHtSession s, pWgtrNode tree, int z)
button_repeat = htrGetBoolean(tree, "repeat", 0);

/** Ok, write the style header items. **/
htrAddStylesheetItem_va(s,"\t#ib%POSpane { POSITION:absolute; VISIBILITY:inherit; LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; Z-INDEX:%POS; cursor:pointer; }\n",id,x,y,w,z);
htrAddStylesheetItem_va(s,"\t#ib%POSpane { LEFT:%INTpx; TOP:%INTpx; WIDTH:%POSpx; Z-INDEX:%POS; }\n",id,x,y,w,z);

htrAddScriptGlobal(s, "ib_cur_img", "null", 0);
htrAddWgtrObjLinkage_va(s, tree, "ib%POSpane", id);
Expand All @@ -158,14 +162,14 @@ htibtnRender(pHtSession s, pWgtrNode tree, int z)
/** HTML body <DIV> elements for the layers. **/
if (h < 0)
if(is_enabled)
htrAddBodyItem_va(s,"<DIV ID=\"ib%POSpane\"><IMG SRC=\"%STR&HTE\" border=\"0\"></DIV>\n",id,n_img);
htrAddBodyItem_va(s,"<DIV ID=\"ib%POSpane\" class=\"ibtnPane\"><IMG SRC=\"%STR&HTE\" border=\"0\"></DIV>\n",id,n_img);
else
htrAddBodyItem_va(s,"<DIV ID=\"ib%POSpane\"><IMG SRC=\"%STR&HTE\" border=\"0\"></DIV>\n",id,d_img);
htrAddBodyItem_va(s,"<DIV ID=\"ib%POSpane\" class=\"ibtnPane\"><IMG SRC=\"%STR&HTE\" border=\"0\"></DIV>\n",id,d_img);
else
if(is_enabled)
htrAddBodyItem_va(s,"<DIV ID=\"ib%POSpane\"><IMG SRC=\"%STR&HTE\" border=\"0\" width=\"%POS\" height=\"%POS\"></DIV>\n",id,n_img,w,h);
htrAddBodyItem_va(s,"<DIV ID=\"ib%POSpane\" class=\"ibtnPane\"><IMG SRC=\"%STR&HTE\" border=\"0\" width=\"%POS\" height=\"%POS\"></DIV>\n",id,n_img,w,h);
else
htrAddBodyItem_va(s,"<DIV ID=\"ib%POSpane\"><IMG SRC=\"%STR&HTE\" border=\"0\" width=\"%POS\" height=\"%POS\"></DIV>\n",id,d_img,w,h);
htrAddBodyItem_va(s,"<DIV ID=\"ib%POSpane\" class=\"ibtnPane\"><IMG SRC=\"%STR&HTE\" border=\"0\" width=\"%POS\" height=\"%POS\"></DIV>\n",id,d_img,w,h);

/** Add the event handling scripts **/
htrAddEventHandlerFunction(s, "document", "MOUSEDOWN", "ib", "ib_mousedown");
Expand Down Expand Up @@ -199,6 +203,7 @@ htibtnInitialize()
strcpy(drv->Name,"HTML ImageButton Widget Driver");
strcpy(drv->WidgetName,"imagebutton");
drv->Render = htibtnRender;
drv->Setup = htibtnSetup;

htrAddAction(drv,"Enable");
htrAddAction(drv,"Disable");
Expand Down
Loading
0