Missclicks after MT5 to MT4 EA conversion with graphical user interface (with BitmapLabelCreate)

Back to topics list To post a new topic, please log in or register
avatar
9
angreeee 2015.02.19 14:08
 


I created Indicator/EA for MT5 and it works fine. The problem occured when i converted it to MT4. I used same exact libraries that i used for MT5 versions like:

a) MT5 - https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_bitmap_label

b) MT4 - https://docs.mql4.com/constants/objectconstants/enum_object/obj_bitmap_label


MT5 code fragment for button creation:

StringConcatenate(nazwa_w, numer_buttona, "button_text_", i1);
BitmapLabelCreate(0,nazwa_w,0,poz_x+(0.25*((32*gfx_multi)/div))+(i1*((16*gfx_multi)/div)),poz_y+(0.125*((32*gfx_multi)/div)),nazwa_plik_inv,nazwa_plik,((16*gfx_multi)/div),((24*gfx_multi)/div),numer_fonta*((16*gfx_multi)/div),(nr_koloru*((24*gfx_multi)/div)),clicked_copy,CORNER_LEFT_UPPER,ANCHOR_LEFT_UPPER,clrRed,STYLE_SOLID,1,false,false,false,1);

MT5 code for button click press check:

      bool returned_click = false;
      for(int i1 = 0; i1<dlugosc_nazwy ; i1++ ) {
         StringConcatenate(nazwa_w, numer_buttona, "button_text_", i1);
         testint=ObjectGetInteger(0,nazwa_w,OBJPROP_STATE,0);
         if(testint==true) {
            returned_click = true;
         }
      }   


MT4 version for button creation:

nazwa_w = StringConcatenate(numer_buttona, "button_text_", i1);
BitmapLabelCreate(0,nazwa_w,0,poz_x+(0.25*((32*gfx_multi)/div))+(i1*((16*gfx_multi)/div)),poz_y+(0.125*((32*gfx_multi)/div)),nazwa_plik_inv,nazwa_plik,((16*gfx_multi)/div),((24*gfx_multi)/div),numer_fonta*((16*gfx_multi)/div),(nr_koloru*((24*gfx_multi)/div)),clicked_copy,CORNER_LEFT_UPPER,ANCHOR_LEFT_UPPER,clrRed,STYLE_SOLID,1,false,false,false,1);


MT4 version checking the click:

      bool returned_click = false;
      for(int i1 = 0; i1<dlugosc_nazwy ; i1++ ) {
         nazwa_w = StringConcatenate(numer_buttona, "button_text_", i1);
         testint=ObjectGetInteger(0,nazwa_w,OBJPROP_STATE,0);
         if(testint==true) {
            returned_click = true;
         }
      }   


As you can see they are almost exactly the same, but the SringConcatenate yet the results in MT4 version are crazy.

Only first 2 buttons work as they should, others - see for yourself on the movie: (even clicking outside any button activates them)

https://www.youtube.com/watch?v=MyulEve5988&feature=youtu.be


avatar
9
angreeee 2015.02.21 11:20 #
 

does anyone has any idea what is going on? :/

I cannot get to the root of this. I made other EA that uses Bitmap Labels in Mt4 and it works fine. (sometimes it also generate clicks in the wrong places, but only if clicking too quickly - but here missclicks are a rule) Please help

avatar
13009
WHRoeder 2015.02.21 13:43 #
 
angreeee: does anyone has any idea what is going on? :/
Are your books one column but two feet wide? No because that is unreadable. They are 6 inches, sometimes two columns, so you can read it easily. So should be your code. I'm not going to go scrolling back and forth trying to read it. Edit the post with formatted code and you might get additional help.
Back to topics list  

To add comments, please log in or register