Disliked{quote} Hi hdn. I know a little about programming. I added PanelSubW by myself. I tried to move the buttons to the subwindow. But as soon as I tried, they did not work Now the indicator you sent also does not work when it is moved to the sub window The buttons are easy to move around in the main window, but when you click on one button, it erases the lines created by other buttons. Editing it was not easy for me, that's why I put it here. Thank you for tryingIgnored
I am very happy that you know programming
I hope you are successful in this direction
Are you sure that my program is not working?
I tested it.
Of course, there is one point.
Please open a window, for example RSI
Then enter the number of the window in the new program settings
In this case, the buttons will be moved to the bottom window.
But in your code, I changed the button creation function.
I use this function.
Inserted Code
//|==================================================================|// //| |// //|==================================================================|// bool ButtonCreate(const long chart_ID=0, // chart's ID const string name="Button", // button name const int sub_window=0, // subwindow index const int x=0, // X coordinate const int y=0, // Y coordinate const int width=50, // button width const int height=18, // button height const ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER, // chart corner for anchoring const string text="Button", // text const string font="Arial", // font const int font_size=10, // font size const color clr=clrBlack, // text color const color back_clr=C'236,233,216', // background color const color border_clr=clrNONE, // border color const bool state=false, // pressed/released const bool back=false, // in the background const bool selection=false, // highlight to move const bool hidden=true, // hidden in the object list const long z_order=0) // priority for mouse click { //--- reset the error value ResetLastError(); //--- create the button if(!ObjectCreate(chart_ID,name,OBJ_BUTTON,sub_window,0,0)) { Print(__FUNCTION__, ": failed to create the button! Error code = ",GetLastError()); return(false); } //--- set button coordinates ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x); ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y); //--- set button size ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width); ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height); //--- set the chart's corner, relative to which point coordinates are defined ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner); //--- set the text ObjectSetString(chart_ID,name,OBJPROP_TEXT,text); //--- set text font ObjectSetString(chart_ID,name,OBJPROP_FONT,font); //--- set font size ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size); //--- set text color ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); //--- set background color ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr); //--- set border color ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,border_clr); //--- display in the foreground (false) or background (true) ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back); //--- set button state ObjectSetInteger(chart_ID,name,OBJPROP_STATE,state); //--- enable (true) or disable (false) the mode of moving the button by mouse ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection); //--- hide (true) or display (false) graphical object name in the object list ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden); //--- set the priority for receiving the event of a mouse click in the chart ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order); //--- successful execution return(true); }
If you need help. just quote me ^.* I will come soon.
1