Announcement

Collapse
No announcement yet.

Smaller buttons and/or RGB value for light green

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Smaller buttons and/or RGB value for light green

    Hi,
    I want to have two buttons (up and down) so they are the size of the text box together. When I make them smaller I lose the webdings for the up and down.

    So I did them without Text.BUTTON and overlaped them. It works but I have a white background. So I need the RGB value for the light green that the defult chart background is.

    Thanks
    tom


    function preMain() {
    setPriceStudy(false);
    setStudyTitle("CCI");
    setCursorLabelName("CCI",0);
    setCursorLabelName("CCI last",1);
    setDefaultBarFgColor(Color.blue,0);
    setDefaultBarThickness(2,0);
    }
    var text_flags = "Text.BOLD | Text.ONTOP | Text.RIGHT | Text.RELATIVETORIGHT | Text.RELATIVETOTOP"
    var font_size = 12;
    var font = null;
    var BCP_X = 20;
    var BCP_Y = 20;
    var F_X = 100;
    var F_Y = 20;
    var Buy_quantitiy =10;
    var Flatten_quantitiy = 10;
    function main() {
    displayBuySellButtons();
    return;
    }
    function displayBuySellButtons()
    {
    drawTextPixel(BCP_X+71, BCP_Y+3, "\u0035 @URL=EFS:Buy_Quantitiy_up", Color.black, Color.white ,
    Text.BOLD | Text.ONTOP | Text.LEFT | Text.RELATIVETOTOP | Text.BUTTON,
    "Webdings",14,"EFS:buy_quantitiy_up",12,12);
    drawTextPixel(BCP_X+71, BCP_Y+20, "\u0036 @URL=EFS:Buy_Quantitiy_dn", Color.black, Color.white ,
    Text.BOLD | Text.ONTOP | Text.CENTER| Text.BUTTON ,
    "Webdings",14,"EFS:buy_quantitiy_dn",12,12);
    Display_Buy_Quantity()
    drawTextPixel(F_X+70, F_Y-4, "\u0035 @URL=EFS:Flatten_Quantitiy_up", Color.black, Color.white ,
    Text.BOLD | Text.ONTOP | Text.LEFT | Text.RELATIVETOTOP ,
    "Webdings",14,"EFS:flatten_quantitiy_up",12,12 );
    drawTextPixel(F_X+70, F_Y+5, "\u0036 @URL=EFS:Flatten_Quantitiy_dn", Color.black, Color.white ,
    Text.BOLD | Text.ONTOP | Text.LEFT | Text.RELATIVETOTOP ,
    "Webdings",14,"EFS:flatten_quantitiy_dn",12,12 );
    Display_Flatten_Quantity()
    return;
    }
    function Display_Flatten_Quantity() {
    drawTextPixel(F_X+52,F_Y, Flatten_quantitiy, Color.black, Color.white, text_flags | Text.FRAME , font, font_size,"EFS:flatten_quanty");
    return;
    }
    function Display_Buy_Quantity() {
    drawTextPixel(BCP_X+54, BCP_Y+10, Buy_quantitiy, Color.black, Color.white, text_flags | Text.FRAME, font, font_size,"EFS:buy_quantitiy");
    return;
    }
    function Buy_Quantitiy_up(nButtonPressed) {
    if ( getButtonPressed( nButtonPressed ) == 1 ) {
    Buy_quantitiy ++;
    Display_Buy_Quantity();
    }
    return;
    }
    function Buy_Quantitiy_dn(nButtonPressed) {
    if ( getButtonPressed( nButtonPressed ) == 1 ) {
    Buy_quantitiy --;
    Display_Buy_Quantity();
    }
    return;
    }
    function Flatten_Quantitiy_up(nButtonPressed) {
    if ( getButtonPressed( nButtonPressed ) == 1 ) {
    Flatten_quantitiy ++;
    Display_Flatten_Quantity();
    }
    return;
    }
    function Flatten_Quantitiy_dn(nButtonPressed) {
    if ( getButtonPressed( nButtonPressed ) == 1 ) {
    Flatten_quantitiy --;
    Display_Flatten_Quantity();
    }
    return;
    }
    function getButtonPressed(nButtonPressed) {
    if(nButtonPressed == BUTTON_LEFT) {return(1);}
    if(nButtonPressed == BUTTON_RIGHT) {return(2);}
    if(nButtonPressed == BUTTON_LEFTDBLCLK) {return(3);}
    else {return(0);}
    }


    Last edited by windswepttom; 02-16-2007, 03:36 PM.

  • #2
    Tom
    If you are trying to determine the RGB values of the chart background then do the following
    - right click the chart and select Properties
    - In the Chart Properties dialog box select Background, click the color selector and click the More Colors... button
    - In the Colors dialog box select the Custom tab where you will find the RGB values
    Alex

    Comment


    • #3
      Thank You Alexis

      I was so close to the color, If I had clicked on "custom", I would have it. The new and improved buttons for the ones without Text.BUTTON:



      drawTextPixel(F_X+70, F_Y-6, "\u0035 @URL=EFS:Flatten_Quantitiy_up", Color.black, Color.RGB(120,155,127) ,
      Text.BOLD | Text.ONTOP | Text.LEFT | Text.RELATIVETOTOP ,
      "Webdings",14,"EFS:flatten_quantitiy_up",12,12 );
      drawTextPixel(F_X+70, F_Y+3, "\u0036 @URL=EFS:Flatten_Quantitiy_dn", Color.black, Color.RGB(120,155,127) ,
      Text.BOLD | Text.ONTOP | Text.LEFT | Text.RELATIVETOTOP ,
      "Webdings",14,"EFS:flatten_quantitiy_dn",12,12 );

      Comment


      • #4
        Tom
        You are most welcome
        Alex

        Comment

        Working...
        X