hi all
function DrawButton( Text, x1, y1, x2, y2, BorderColor, BackColor , textcolor , fnt, fntsize, fntweight )
{
GfxSetOverlayMode( 0 );
GfxSelectFont( "Tahoma", 9, 800 );
GfxSelectFont( "fnt", fntsize, fntweight, 0, 0, 0 );
GfxSelectPen( BorderColor ,3);
GfxSetBkMode( 1 );
GfxSelectSolidBrush( BackColor );
GfxSetBkColor( BackColor );
GfxSetTextColor( textcolor );
GfxRectangle( x1, y1, x2, y2 );
GfxDrawText( Text, x1, y1, x2, y2, 32 | 1 | 4 );
}
DT_VCENTER = 4 | 32;
// format: 0 left, 1 center, 2 right
procedure GfxLabel(text, x, y, width, height, textcolor , fnt, fntsize, fntweight)
{
GfxSelectFont( "fnt", fntsize, fntweight, 0, 0, 0 );
GfxSetTextColor( textcolor );
GfxDrawText( text, x, y, x+width, y+height, textcolor );
}
x = Param("x_origin", 0 , 1980, -20);
y = Param("y_origin", 0, 0, 1024, 20);
GfxSelectPen( colorYellow, 3 );
GfxSelectSolidBrush( colorBlack );
GfxRectangle( 590, 340, 5, 100 );
GfxSelectFont( "Arial", 10, 900, False );
GfxSetTextColor( colorWhite );
GfxSetTextAlign(0);
DrawButton(""+c, 40 , 210 , 100 , 190, IIf( NumToStr(SelectedValue(C), 1.2)>NumToStr(SelectedValue(Ref(C,-1)), 1.2), colorRed,colorGreen), IIf( NumToStr(SelectedValue(C), 1.2)>NumToStr(SelectedValue(Ref(C,-1)), 1.2), colorRed,colorGreen) , IIf( NumToStr(SelectedValue(C), 1.2)>NumToStr(SelectedValue(Ref(C,-1)), 1.2), colorRed,colorGreen) , "Tahoma", 10, 800 );
GfxLabel(" C : "+c, 0, 20, 980, 200, IIf( NumToStr(SelectedValue(C), 1.2)<NumToStr(SelectedValue(Ref(C,-1)), 1.2), colorWhite,colorGreen) , "Tahoma", 20, 800 ); //////////
GfxLabel(" S 2 ", X+60, Y+70, 180, Y+200, IIf( NumToStr(SelectedValue(C), 1.2)>NumToStr(SelectedValue(Ref(C,-1)), 1.2), colorRed,colorGreen) , "Tahoma", 9, 800 );///////////
DrawButton("", x+105 , Y+195 , x+115 , Y+205, colorYellow, IIf( NumToStr(SelectedValue(C), 1.2)>NumToStr(SelectedValue(Ref(C,-1)), 1.2), colorRed,colorGreen) , colorBlack , "Tahoma", 10, 800 );
GfxLabel(" S 3 ",X+ -20, Y+70, 180, 200, colorYellow , "Tahoma", 9, 800 ); ////////// when changing color it will change the location
when changing color it will change the location for GfxLabel
is there a beter way to code it
thank you