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);}
}
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);}
}
Comment