EASYPTR4 - Minimum menu size

Anything QL Software or Programming Related.
User avatar
Giorgio Garabello
Gold Card
Posts: 299
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, Italy
Contact:

Re: EASYPTR4 - Minimum menu size

Post by Giorgio Garabello »

pjw wrote:Hi Giorgio,

I sent a reply to ql-users, but it takes forever for my mails to arrive there, so I'll copy it here, in case you need this info now:

Well, then you need to PEEK the window definition [WD] rather than the window working definition [WWD]. EasyPtr prepends its own header to the WD. I think its always 28b long, in which case the standard/minimum size can be found at

WD = APPA(<menu name>)
minx = PEEK_W(WD + 28): miny = PEEK_W(WD + 30)

This is not a universal formula, mind you, as more than one layout may be defined (the menu designer will know). However, I'll leave that as an excercise for now.. Check out the excellent QPTR manual for details, and use EasySource to dissemble your EasyMen menus.

Per

It seems to work, but it needs a _app files, I'm looking for something that works both with _cde, _app and _men files


User avatar
pjw
QL Wafer Drive
Posts: 1608
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: EASYPTR4 - Minimum menu size

Post by pjw »

Giorgio,

Try:

Code: Select all

ch = fopen('con')

rem Get the WD directly via the WWD
adr = mwdef(#ch): madr = peek_l(adr + 4)
xmin% = peek_w(madr): ymin% = peek_w(madr + 2)

..
mdraw#ch; 'my_menu',..
Arguments and provisos as previously noted.

Per


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
Giorgio Garabello
Gold Card
Posts: 299
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, Italy
Contact:

Re: EASYPTR4 - Minimum menu size

Post by Giorgio Garabello »

pjw wrote:Giorgio,

Try:

Code: Select all

ch = fopen('con')

rem Get the WD directly via the WWD
adr = mwdef(#ch): madr = peek_l(adr + 4)
xmin% = peek_w(madr): ymin% = peek_w(madr + 2)

..
mdraw#ch; 'my_menu',..
Arguments and provisos as previously noted.


Per

This solution is exactly what I wanted.
Thanks to everyone for their time and commitment .


Giorgio


Post Reply