hi
how to change the color of (n's)
a=50;
b=2;
ttt= a/b ;
procedure SetOrigin(x0, y0) {
global _x0, _y0;
_x0 = x0; _y0 = y0;
}
procedure GfxSetColors(fgColor, bgColor) {
GfxSetTextColor(fgColor); GfxSetBkColor(bgColor);
GfxSelectPen(fgColor); GfxSelectSolidBrush(bgColor);
}
procedure GfxFrame(titl,hheight, x, y, width, height, textColor, bgColor) {
global _x0, _y0;
x = x+_x0; y = y+_y0;
GfxSetColors(textColor, bgColor);
GfxRoundRect(x, y+0.5*hheight, x+width, y+height, 5, 5);
if (titl != "") {
w = GfxGetTextWidth(titl)*0.68; m = x+width*0.5;
// GfxRectangle(m-w, y+1, m+w, y+hheight-1);
GfxRoundRect(m-w, y+1, m+w, y+hheight-1, 5, 5);
GfxDrawText(titl, x, y, x+width, y+hheight, 1|4|32);
}
}
// Gui* part - Edit control
function SetNumber(idEdit, Value, x, y, width, height, textColor, bgColor) {
global _x0, _y0;
local rc;
x = x+_x0; y = y+_y0;
rc = GuiEdit( idEdit, x, y, width, height, 0);
GuiSetValue(idEdit, Value );
GuiSetColors( idEdit, idEdit, 1, textColor, bgColor, textColor);
return Value;
}
/*
Then modify all lines (replace EditNumber by SetNumber) starting from n3:
n3 = SetNumber(3, (n2+n)/2, 180, 150, 80, 25, colorBlue, colorYellow);
// etc
*/
function EditNumber(idEdit, initialValue, x, y, width, height, textColor, bgColor) {
global _x0, _y0;
local rc;
x = x+_x0; y = y+_y0;
rc = GuiEdit( idEdit, x, y, width, height, 0);
if( rc == guiNew ) GuiSetValue(idEdit, initialValue );
GuiSetColors( idEdit, idEdit, 1, textColor, bgColor, textColor);
return GuiGetValue(idEdit);
}
DT_VCENTER = 4 | 32;
// format: 0 left, 1 center, 2 right
procedure GfxLabel(text, x, y, width, height, format) {
global _x0, _y0;
x = x+_x0; y = y+_y0;
GfxDrawText( text, x, y, x+width, y+height, format | DT_VCENTER );
}
procedure GuiDemos(x,y) {
local n,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,
n12,n13,n14,n15,n16,n17,n18,n19,n20
,n21,n22,txt,textColor , bgColor;
// GfxSelectFont("Arial", 9); GuiSetFont("Arial", 10);
SetOrigin(x,y);
GfxFrame(" Third Of Tidal Trading System", 30, 0, 30, 600, 600, colorWhite, colorblack); // 30, 0, 30, 700, 180, colorWhite, colorblack(30, 0, 30, WITDTH, HIGHT, colorWhite, colorblack )
SetOrigin(x+20,y+30);
n = SetNumber(1, ttt, 10, 70, 30, 25, IIf(ttt> 10,colorBlue,colorDefault), IIf(ttt> 10,colorBlue,colorDefault));//textbox # , formula , LIFT / RIGHT , HIGHT/LOW , WIDTH OF THE TEXT BOX , HIGHT OF THE TEXT BOX.
n1 = SetNumber(2, (10)/2, 50, 70, 30, 25, colorBlue, colorYellow);
n2 = SetNumber(3, (10)/2, 90, 70, 30, 25, colorBlue, colorYellow);
n3 = SetNumber(4, (10)/2, 130, 70, 30, 25, colorBlue, colorYellow);
n4 = SetNumber(5, (12)/2, 170, 40, 30, 25, colorBlue, colorYellow);
n5 = SetNumber(6, (10)/2, 210, 70, 30, 25, colorBlue, colorYellow);
n6 = SetNumber(7, (10)/2, 250, 70, 30, 25, colorBlue, colorYellow);
n7 = SetNumber(8, (10)/2, 290, 70, 30, 25, colorBlue, colorYellow);
n8 = SetNumber(9, (10)/2, 330, 70, 30, 25, colorBlue, colorYellow);
GfxLabel(" ......................................................................................................... ", 20, 100, 140, 30, 1);
n9 = SetNumber(10,(14)/2, 10, 150, 30, 25, colorBlue, colorYellow);
n10 = SetNumber(11,(14)/2, 50, 150, 30, 25, colorBlue, colorYellow);
n11 = SetNumber(12,(14)/2, 90, 150, 30, 25, colorBlue, colorYellow);
n12 = SetNumber(13,(14)/2, 130, 150, 30, 25, colorBlue, colorYellow);
n13 = SetNumber(14, (16)/2, 170, 130, 30, 25, colorBlue, colorYellow);
n14 = SetNumber(15, (14)/2, 210, 150, 30, 25, colorBlue, colorYellow);
n15 = SetNumber(16, (14)/2, 250, 150, 30, 25, colorBlue, colorYellow);
n16 = SetNumber(17, (14)/2, 290, 150, 30, 25, colorBlue, colorYellow);
n17 = SetNumber(18, (14)/2, 330, 150, 30, 25, colorBlue, colorYellow);
}
x = Param("x_origin", 20, 0, 1980, 20);
y = Param("y_origin", 20, 0, 1024, 20);
demo = ParamToggle("Show Demo", "No|Yes", 1);
if (demo) {
GuiDemos(x+80, y+80);
}
thank you