Mawdraw problem (easyptr4)
- Giorgio Garabello
- Gold Card
- Posts: 277
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Mawdraw problem (easyptr4)
Hi, do you think it is possible to format a single item of an application window menu so that it always appears as a single element but divided into two lines? I tried to insert chr $ (10) inside an element of an arrray like this: a $ (0) = "Hi" & chr $ (10) & "For" but it does not work, only "Hi" is displayed .
Regards
Giorgio
Regards
Giorgio
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
- Giorgio Garabello
- Gold Card
- Posts: 277
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Re: Mawdraw problem (easyptr4)
Giorgio Garabello wrote:Hi, do you think it is possible to format a single item of an application window menu so that it always appears as a single element but divided into two lines? I tried to insert chr $ (10) inside an element of an arrray like this: a $ (0) = "Hi" & chr $ (10) & "John" but it does not work, only "Hi" is displayed .
Regards
Giorgio
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
Re: Mawdraw problem (easyptr4)
Giorgio,
the simplest way to achieve that is to create a bitmap of that two lines of text and put the bitmap in the menu.
There are probably better ways to do that, though.
Tobias
the simplest way to achieve that is to create a bitmap of that two lines of text and put the bitmap in the menu.
There are probably better ways to do that, though.
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
- Giorgio Garabello
- Gold Card
- Posts: 277
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Re: Mawdraw problem (easyptr4)
the problem is that is not a fixed text but came frim a file, it change every time.tofro wrote:Giorgio,
the simplest way to achieve that is to create a bitmap of that two lines of text and put the bitmap in the menu.
There are probably better ways to do that, though.
Tobias
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
- Giorgio Garabello
- Gold Card
- Posts: 277
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Re: Mawdraw problem (easyptr4)
Giorgio Garabello wrote:Hi, do you think it is possible to format a single item of an application window menu so that it always appears as a single element but divided into two lines? I tried to insert chr $ (10) inside an element of an arrray like this: a $ (0) = "Hi" & chr $ (10) & "John" but it does not work, only "Hi" is displayed .
Regards
Giorgio
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
Re: Mawdraw problem (easyptr4)
I havent tried this, but you could try making the element box the size you want (MAWDRAW#ch,,,,,xsz%, ysz%) then, using MWINDOW, print the lines into the box.Giorgio Garabello wrote:Hi, do you think it is possible to format a single item of an application window menu so that it always appears as a single element but divided into two lines? I tried to insert chr $ (10) inside an element of an arrray like this: a $ (0) = "Hi" & chr $ (10) & "For" but it does not work, only "Hi" is displayed .
Still, the most flexible method, to my mind would be my third suggestion of last night: Once you have your menu window up and running, with a suitable Application window inside, bypass Wman and fake the usual Wman interaction using only PI. To make the routine fast and smoothe, dont bother faking the selection outline, but use highlighting instead. BYpassing Wman constraints in this way opens the door many other interesting effects which are currently impossible under Wman.
Per
dont be happy. worry
- ?
dont be happy. worry
- ?
- Giorgio Garabello
- Gold Card
- Posts: 277
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Re: Mawdraw problem (easyptr4)
I've just tried but seems dont work
MWINDOW #3,65537
Print #3, "hallo" dont print in the furst menu element but in the cirner of the MAW
MWINDOW #3,65537
Print #3, "hallo" dont print in the furst menu element but in the cirner of the MAW
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
Re: Mawdraw problem (easyptr4)
Are you sure?Giorgio Garabello wrote:I've just tried but seems dont work
MWINDOW #3,65537
Print #3, "hallo" dont print in the furst menu element but in the cirner of the MAW
In my test I did the same, the string was nicely printed in each of the 4 menu items when hit:
:
rep loop
num= mcall (#c3%,0): awn= 65536
select on num
= -1 : stop : rem >>> esc
= -3 : mawdraw #c3%\1 : rem >>> wake, restores original aw$
=awn +1 : mwindow #c3%,awn +1: print #c3%;aw$(0,0)
=awn *2 +1 : mwindow #c3%,awn *2 +1: print #c3%;aw$(0,1)
=awn *3 +1 : mwindow #c3%,awn *3 +1: print #c3%;aw$(1,0)
=awn *4 +1 : mwindow #c3%,awn *4 +1: print #c3%;aw$(1,1)
end select
end rep
:
aw$ is the original array for MAWSETUP, containing a LF between two strings.
MAWDRAW and MAWITEM will only show the first part but PRINT will use the LF to move to the next line.
Remember that the y-size of each cell must be enough to hold the lines.
Also any justification used in MAWDRAW will have no effect after MWINDOW and may need to be fixed with AT or CURSOR commands.
You could use a loop to go through all visible aw$ items to check if any LF is there and then do a MWINDOW/PRINT to replace that cell. However depending on the number of visible cells this may be a slow process.
Beware that if the string before the LF is too long for the cell width, the rest will move one line down too.
Bob
- Giorgio Garabello
- Gold Card
- Posts: 277
- Joined: Tue Jun 30, 2015 8:39 am
- Location: Turin, Italy
- Contact:
Re: Mawdraw problem (easyptr4)
I'm trying to do something different, you print the string after clicking, I need to present a list in which each element is divided into several lines, to scroll through this list and eventually select an elementBSJR wrote:Are you sure?Giorgio Garabello wrote:I've just tried but seems dont work
MWINDOW #3,65537
Print #3, "hallo" dont print in the furst menu element but in the cirner of the MAW
In my test I did the same, the string was nicely printed in each of the 4 menu items when hit:
:
rep loop
num= mcall (#c3%,0): awn= 65536
select on num
= -1 : stop : rem >>> esc
= -3 : mawdraw #c3%\1 : rem >>> wake, restores original aw$
=awn +1 : mwindow #c3%,awn +1: print #c3%;aw$(0,0)
=awn *2 +1 : mwindow #c3%,awn *2 +1: print #c3%;aw$(0,1)
=awn *3 +1 : mwindow #c3%,awn *3 +1: print #c3%;aw$(1,0)
=awn *4 +1 : mwindow #c3%,awn *4 +1: print #c3%;aw$(1,1)
end select
end rep
:
aw$ is the original array for MAWSETUP, containing a LF between two strings.
MAWDRAW and MAWITEM will only show the first part but PRINT will use the LF to move to the next line.
Remember that the y-size of each cell must be enough to hold the lines.
Also any justification used in MAWDRAW will have no effect after MWINDOW and may need to be fixed with AT or CURSOR commands.
You could use a loop to go through all visible aw$ items to check if any LF is there and then do a MWINDOW/PRINT to replace that cell. However depending on the number of visible cells this may be a slow process.
Beware that if the string before the LF is too long for the cell width, the rest will move one line down too.
Bob
Giorgio
Quantum Technology
http://www.hunggartorino.it/ql/language/en/
http://www.hunggartorino.it/ql/language/en/
Re: Mawdraw problem (easyptr4)
This is just a proof of concept. I have not tested what happens when a list needs to scroll up or down.I'm trying to do something different, you print the string after clicking, I need to present a list in which each element is divided into several lines, to scroll through this list and eventually select an element
Giorgio
If it's a single column list you want, you could adopt what I do in SuQcess with Viewing a record with subfields.
The list can be scrolled (set the main window to a minimum) and each line is a field or a subfield and can be clicked on.
In a separate array I keep track of which field that line belongs to so the correct field is taken to act upon.
Bob