Buttons & Textfields on mt4 chart possible now - page 4

 

I've tried tbIsChecked but does not work. I have 2 checkboxes. I would like to uncheck DayTradechk if SwingTradechk is checked and vice versa.

if(tbIsChecked(SwingTradechk)) {tbSetChecked(DayTradechk, false);}
else {tbSetChecked(SwingTradechk, false);}

What's the problem in my code?

 

Good Afton I don’t understand nothing about programing. Can anyone explain to me how to do Buttons & Text fields on mt4 chart possible step by step?

Thanks in advance

 
Ghost: this bug has been fixed in newest mt4gui version yet. i ll update website tomorrow with it. newest mt4gui has several differences i have to explain here.
 

Here is update about newest version 0.1.08 (which is v0.8):

Main changes are that definition of functions has been extended by hwnd as first parameter, colors are supported with all objects (text,label,button,checkbox,list). Also tbSetChecked bug has been solved. Due to many questions we have included all sample files and their dependencies (libtrade.mqh and libvisual.mqh) into .zip file.

Here is latest definition:

#import "mt4gui.dll"   
   string tbVersion();       
   
   // objects "button","checkbox","list","label","text"
   int tbPutObject(int,string,int,int,int,int,string); // hwnd,type,x,y,w,h,label   
   
   // colors
   int tbSetBgColor(int,int,int); // hwnd,object,bgcolor
   int tbSetTextColor(int,int,int); // hwnd,object,color
   
   // removing objects
   int tbRemove(int,int);  // hwnd,handle
   int tbRemoveAll(int); // hwnd
   
   // events
   bool tbIsClicked( int,int ); // hwnd,object
   bool tbIsChecked(int,int); // hwnd,object
   // properties
   int tbSetText(int,int,string,int,string); // hwnd,object,text,fontsize,fontname   
   string tbGetText(int,int); // hwnd,object   
   int tbSetChecked(int,int,bool); // hwnd,object,true|false      
   int tbEnable(int,int,int); // hwnd, object, 0|1   
   
   // listbox 
   int tbAddListItem(int,int,string); // hwnd,object,item
   int tbGetListSel(int,int); // hwnd,object
   int tbSetListSel(int,int,int); // hwnd,object,index
   
#import

also tbPutObject function has been described in detail inside wiki http://www.fx1.net/wiki/pmwiki.php/MT4GUI/MT4GUI
 

fx1.net:

- tbSetChecked does not work, I can't set checkbox status to checked in the init function

- how can I detect whether an object is exist or not? I would like to add the active trades to the chart as checkboxes but don't want to create the objects again and again.

 
#import "mt4gui.dll"   
   string tbVersion();       
   
   // objects "button","checkbox","list","label","text"
   int tbPutObject(int,string,int,int,int,int,string); // hwnd,type,x,y,w,h,label   
   
   // colors
   int tbSetBgColor(int,int,int); // hwnd,object,bgcolor
   int tbSetTextColor(int,int,int); // hwnd,object,color
   
   // removing objects
   int tbRemove(int,int);  // hwnd,handle
   int tbRemoveAll(int); // hwnd
   
   // events
   bool tbIsClicked( int,int ); // hwnd,object
   bool tbIsChecked(int,int); // hwnd,object
   // properties
   int tbSetText(int,int,string,int,string); // hwnd,object,text,fontsize,fontname   
   string tbGetText(int,int); // hwnd,object   
   int tbSetChecked(int,int,int); // hwnd,object,0|1
   int tbEnable(int,int,int); // hwnd, object, 0|1   
   
   // listbox 
   int tbAddListItem(int,int,string); // hwnd,object,item
   int tbGetListSel(int,int); // hwnd,object
   int tbSetListSel(int,int,int); // hwnd,object,index
   


   // obj management
   int tbSetName(int,int,string); // hwnd,object,name
   string tbGetName(int,int); // hwnd,object
   int tbGetObjectsCount(int); // hwnd
   int tbGetByNum(int,int); // hwnd,pos
   int tbGetType(int,int); // hwnd,obj
   int tbGetByName(int,string); // hwnd,name
   
#import
Thats new definition. Current version on server already supports that. See obj management functions. tbSetChecked has been updated to be int,int,int and third parameter 0|1 defines check state.
 

Hello,

Where can I find the latest build? Only Version 0.1.08 is available on your homepage.

 
fx1.net:
Thats new definition. Current version on server already supports that. See obj management functions. tbSetChecked has been updated to be int,int,int and third parameter 0|1 defines check state.


Using your buttons, incredible add-on for MT4.

As for setting colors, I notice the buttons are mandatory rectangular, with classic windows shading/borders.

Will it be possible in the future to change those border colors. I have buttons with images as "font" that are round, and would like to make invisible the button "behind it". Being able to set the tbBGColor is helpful, but if it will be possible also to set border tbBorderShadowColor and tbBorderHighlightColor,

or perhaps a flag to enable/disable the "3D" border aspect (i.e. to make a flat button with no visible edges, as I mentioned, using only the font text/symbol as the clickable component.

Thank you again for your work. Did you say you are creating this in C++? Wish I knew it well enough to code.

Jim Bentz.

 

yes such code is only doable in low level coding language like c++ and good old windows mfc. we keep developing on this project, i dont post everything here.

tx to everyone

 
Hi,

how do you do List menu? (Screen on 21.05.2011 16:15 this thread)

How is using function:


string tbAddListItem(int hwnd,int object,string item)
string tbGetListSel(int hwnd,int object)
string tbSetListSel(int hwnd,int object,int index)
Listbox ("list") object related functions

some example please? Thank you.