Download MetaTrader 5
To add comments, please log in or register
Do you know C++? MQL5 has much in common with it. Just try it yourself!
MetaQuotes Software Corp.
Moderator
181005
MetaQuotes Software Corp. 2009.09.10 06:39 

GetPaneHeights:

This function calculates the heights in pixel of all panes in a window.

Author: kartz

fai
67
fai 2009.09.11 06:53  

Hi,kartz.

It's wonderful.

Can you allow the use of this library source code in my indicator code ?
I do not want to split into two files are.
Because it will cause careless mistake for many people, so I prefer static link.

kartz
4
kartz 2009.09.11 08:53  
fai:
Can you allow the use of this library source code in my indicator code ?

I do not want to split into two files are.
Because it will cause careless mistake for many people, so I prefer static link.

Hi fai,

Thank you.
You mean you want to "embed" (not #include or #import) GetPaneHeights() in your source code, right?
Sure you can.

MQL4 Comments
16319
MQL4 Comments 2009.09.13 17:22  

Hello Kartz,

I'm trying to use the function GetPaneHeights as you described above in a "custom indicator" program. When i load my CI, nothing happen and i can see error message as below in the "expert" card of the client terminal:

2009.09.13 23:12:14 GetPaneHeights EURUSD,Daily: dll calls are not allowed; 'user32.dll'-'GetClientRect'

Do you know how to solve it?



kartz
4
kartz 2009.09.13 18:01  
kleinmat:

I'm trying to use the function GetPaneHeights as you described above in a "custom indicator" program. When i load my CI, nothing happen and i can see error message as below in the "expert" card of the client terminal:

2009.09.13 23:12:14 GetPaneHeights EURUSD,Daily: dll calls are not allowed; 'user32.dll'-'GetClientRect'

Hi kleinmat,

Please try this: right click on a chart, select "Indicators List (Ctrl+I)", select your CI, select Common tab, and then check the both of "Allow DLL imports" and "Allow external experts (EX4) imports."

MQL4 Comments
16319
MQL4 Comments 2009.09.14 18:17  

Tx Kartz

Indeed it's working now.

However i can't get what i want, i.e arrow to be really "sticked" on the graph. Using "GetHeightPane", i still have problem when the scale of the graph is changing for example, or when i'm changing it manually by moving the Y coordinates on the right.

A good example of what im searching for is the indicator "Fractals": whatever the scale is or the zoom performed, arrow will always stay same distance to the low/bottom. Problem is we can't load by default indicator in MetaEditor ... pity

I guess i need to practice more ehehe

Mat

gino pilotino
18
gino pilotino 2011.02.07 23:59  

is it possible to get the width as well ? it could be usefule if you want to programatically take screenshot that spans the whole main chart window

(afaik you must hardcode dimension with the current library screenshot function)

/
To add comments, please log in or register