stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Just made an IDE for MQL4
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=627
Page 15 of 32
Author:  tritom [ Sat Jul 21, 2012 4:31 am ]
Post subject:  Re: Just made an IDE for MQL4

w633,

the IDE is really fantastic - I discovered it today (it's very well hidden) - my long time fellow crapEditor flew out of my windows few hours ago.. a big big THANK YOU for the efforts.

Unfortunately, I wasn't able to put the RefreshCrapT4 thingy to work.. I'm an extremely miserable wannabe coder and can't live without recompiling every few lines. Browsing through your sources the cause became clear; my crim doesn't enclose the [Symbol, TF] part in the title bar into square brackets thus can't pass your exam :) I have removed the brackets and rebuilt the thing, it works like charm now.

I've been thinking about two things - firstly, it would be probably better to bash the title bar whatsoever and determine the Empty4 windows by querying for filename (obviously looking for terminal.exe):

Code: Select all

// let's examine a window with handle hWnd (in the enum callback procedure)

DWORD pID;
HANDLE hP;
GetWindowThreadProcessId(hWnd, &pID);
hP = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pID);
TCHAR CrapT4Path[255];
GetModuleFileNameEx(hP, NULL, CrapT4Path, 255);
PathStripPath(CrapT4Path); 

// now, if the examined wnd belongs to Empty4, 
// the CrapT4Path contains "terminal.exe")
Secondly, I'm not sure if it's a good idea to force all running crapT4s to refresh.. even if the terminals reload only if the ex4 (mqlcache.dat) has changed, there are people using shared folders (symlinks, also discussed in a thread here I think) for more instances. Comparing own path with the path of the found terminal can simply tell you that's "your" Empty4 and act only on that instance.

I'm pretty sure this IDE will grow and beat any alternative (UE, Notepad++) very soon :) at least for me it's the discovery of this year so far! Best of luck, and don't forget to add a donation link to your site ;)
Author:  w633 [ Sat Jul 21, 2012 4:40 am ]
Post subject:  Re: Just made an IDE for MQL4

garyfritz wrote:Minor annoyance: Alt-F opens the File menu. I use this all the time. But when you use Ctrl-F to search, Alt-F turns into "search again." The search dialog also grabs other menu Alt-keys, such as Alt-E, Alt-V, etc.

Alt-F is "File" in almost every Windows application, and we already have F3 defined to "search again." Could we remove the "search dialog steals Alt keys" behavior?
good observation, but it's not easy to change the behavior. when you press "CTRL+F", the search strip will show and focus is now on the strip instead of the main editor window, so when you press "ALT+F" there actually it's like accessing the shortcut key of the "Find Next" button (as you can see the F is underlined). i would say this behavior is legitimate.

there are currently two ways around it. the first one is, instead of press "F" while holding "ALT", we press "ALT" first, release it, and make the focus goes to the menu then press "F" to bring out the file menu. the second way is to press "ESC" to make search strip disappear and press ALT+F
Author:  w633 [ Sat Jul 21, 2012 6:06 am ]
Post subject:  Re: Just made an IDE for MQL4

tritom wrote: the IDE is really fantastic - I discovered it today (it's very well hidden) - my long time fellow crapEditor flew out of my windows few hours ago.. a big big THANK YOU for the efforts.
you are welcome, glad to see you like it. :)
tritom wrote: Unfortunately, I wasn't able to put the RefreshCrapT4 thingy to work.. I'm an extremely miserable wannabe coder and can't live without recompiling every few lines. Browsing through your sources the cause became clear; my crim doesn't enclose the [Symbol, TF] part in the title bar into square brackets thus can't pass your exam :) I have removed the brackets and rebuilt the thing, it works like charm now.

I've been thinking about two things - firstly, it would be probably better to bash the title bar whatsoever and determine the Empty4 windows by querying for filename (obviously looking for terminal.exe):

Code: Select all

--
you seem to be a more than competent coder to me! :o this is a great idea, i should've done it but was too lazy so i settled with the title one. i'll include your change to next version.
tritom wrote: Secondly, I'm not sure if it's a good idea to force all running crapT4s to refresh.. even if the terminals reload only if the ex4 (mqlcache.dat) has changed, there are people using shared folders (symlinks, also discussed in a thread here I think) for more instances. Comparing own path with the path of the found terminal can simply tell you that's "your" Empty4 and act only on that instance.
this is where it gets tricky. i have a feeling that parsing & guessing path is kinda unreliable, there's the x86/x64 "program files" folder thing to take care of, and also with win7 there's the "VirtualStore" folder, people could be editing files in this directory but Empty4 instance is in its installed directory (this is me). however the biggest issue is if people are using symbolic path, the path where source code resides could be different than the conventional folder right? for example, the guy could put all his source in "c:\source\experts" and put a symlink to "program files\whatever trader\experts". so while the person is editing source in "c:\source\experts", we have no way to know it's actually linked to which instance.

i totally agree with your point, but i just don't know a good solution to this problem yet. the only feasible solution i can think of is to make a gui and let people select which ones to send notification... but i don't know if people gonna like this idea or not. any suggestions are certainly welcome!
tritom wrote: I'm pretty sure this IDE will grow and beat any alternative (UE, Notepad++) very soon :) at least for me it's the discovery of this year so far! Best of luck, and don't forget to add a donation link to your site ;)
thank you for the compliment ;)
Author:  tritom [ Sat Jul 21, 2012 2:44 pm ]
Post subject:  Re: Just made an IDE for MQL4

thanks :) yes now I see the path troubles looming :shock: With the IDE installed inside the Empty4 folder replacing metaeditor (the most common setup), it would always be fine comparing the terminal path with the own path of the executable via GetModuleFileName(NULL,....) - should be the same without the "/other/" bit, regardless of the OS used etc.

But it's not a universal solution - if the IDE is placed somewhere else (or symlinked to the Empty4 folder somehow.. if it goes at all), there's no other way than a user preset - maybe a txt config file with user-specified path(s) and a "refresh all" option would be just fine. But the more I'm thinking about it, the more I'm sure I do overcomplicate it and it's totally ok to notify all instances. Only a fool like me could be running a live EA from shared location and recompile the same thing in a dev platform. Anyone doing this deserves the consequences :lol:

Btw if you don't need the terminal path for further comparison, another (much simpler) way of somewhat reliable "are-you-Empty4" check could be a GetClassName(hWnd,...,...) call. Seems to always return "MetaQuotes::Empty4::4.00" with any crim. The title bar text is totally unreliable; look at these two screenshots:

this is normal:
Image

.. after being left in background for some time, the chart symbol disappears:
Image
Author:  garyfritz [ Sat Jul 21, 2012 4:49 pm ]
Post subject:  Re: Just made an IDE for MQL4

w633 wrote:there are currently two ways around it. the first one is, instead of press "F" while holding "ALT", we press "ALT" first, release it, and make the focus goes to the menu then press "F" to bring out the file menu. the second way is to press "ESC" to make search strip disappear and press ALT+F
That's what I've been doing. :) But the Alt-F habit is ingrained very deeply, so I always end up "finding again" before I remember to do the Alt, F, or Esc. Like I said, just an annoyance. I think they really screwed up their UI design on this point, but it won't kill me.
Author:  tritom [ Sat Jul 21, 2012 8:58 pm ]
Post subject:  Re: Just made an IDE for MQL4

I'm too getting stuck with the F key but in another way: I'm used to hit <AltGr><F> which in fact is <Ctrl><Alt><F> to type the right square bracket since ages (unlike pro coders, I have the silly habit of using the stupid czech keyboard all the time). The shortcut is set to fold/unfold all. I found the 'Ctrl+Alt+F|IDM_TOGGLE_FOLDALL|' line in global properties, redefined, OK, works.. but as the F key keeps invoking the "find" command as long as the search strip is open, I have to switch to EN keyboard to get the damn [ into the find/replace field while getting the other creatures like ]\${}| via <AltGr> as usual :( If there was a possibility to switch off the shortcut completely, and let the F key behave the default way.. that would be great. I'm joining the "kill the F steal" camp. If not, nevermind.. habits are here to change ;)
Author:  SteveHopwood [ Sat Jul 21, 2012 10:04 pm ]
Post subject:  Re: Just made an IDE for MQL4

Re the recent posts, welcome to my world w633. I know how you feel right at this moment. :lol:

Hang on in there feller, and trust me on this: you are doing a truly great thingy here. You have revolutionised my coding life. Should you make no further changes to your ide (but I know you will) you have already earned my undying gratitude.

I repeat, and will do so from time to time: if the only result of starting my own forum had been the introduction of your ide, it would have made the exercise well worthwhile.

Doesn't make your task any easier right now, I know, but it is good to feel valued.

:D
Author:  Jimdandy [ Sun Jul 22, 2012 9:09 pm ]
Post subject:  Re: Just made an IDE for MQL4

Whew! I made it to the 15th page! I was anxious to immediately go and download the IDE but I made myself read the whole evolution to this point.... I'm chomping at the bit now... I've gotta see this baby! Not that I'll know how to use it as I am a novice at the code anyway.. and I can only play the piano by ear.... So Steve is one up on me.... Thanks in advance for your work on this project W633.... I think I'm going to like what I see from all the others comments I've been reading up to this point.... Here I go to check it out.... I can hardly wait to come back here and join the whiners club with the first item on my wish list.... PipPip..........JimDandy....
Author:  SteveHopwood [ Sun Jul 22, 2012 9:22 pm ]
Post subject:  Re: Just made an IDE for MQL4

Jimdandy wrote:and I can only play the piano by ear.... So Steve is one up on me....
Actually, that makes us about even. I cannot play anything but the most simple thingy by ear. :lol:
Thanks in advance for your work on this project W633.... I think I'm going to like what I see from all the others comments I've been reading up to this point.... Here I go to check it out.... I can hardly wait to come back here and join the whiners club with the first item on my wish list.... PipPip..........JimDandy....
Poor w633 is already screaming, "Noooooooooo. Not another bugger with a wish list...." :lol:

:D
Author:  w633 [ Mon Jul 23, 2012 6:11 am ]
Post subject:  Re: Just made an IDE for MQL4

Hello guys,

I updated again to version 1.4.2. The only 2 changes are some improvement on EA update program and change request made by Gary & Tritom, now "Find Next" will not interfere with ALT+F anymore. The shortcut key has been moved to "I".

For other people who do not care about the ALT+F issue it's not necessary to change to this version.
All times are UTC Page 15 of 32