Words of guidance would be appreciated - thanks.
An application I'm writing has a secondary mode which for the most
part I want hidden. When the special mode is enabled, the main
window reveals the control panel for that mode.
Don't mind if the reveal is to the side or below the main window.
What is the easiest mechanism to achieve this?
In article <5cf61ef6a3bob@sick-of-spam.invalid>,
Bob Latham <bob@sick-of-spam.invalid> wrote:
Words of guidance would be appreciated - thanks.
An application I'm writing has a secondary mode which for the most
part I want hidden. When the special mode is enabled, the main
window reveals the control panel for that mode.
How is the 'special mode' enabled?
A button in the window, or some setting elsewhere?
Don't mind if the reveal is to the side or below the main window.
What is the easiest mechanism to achieve this?
Just set up the full window as you want, with reveal to right or
underneath, and just use the 'special setting' to determine the size
of the visible window when you use Wimp_OpenWindow
This perhaps assuming that there are no scroll bars enabled!
Words of guidance would be appreciated - thanks.
An application I'm writing has a secondary mode which for the most
part I want hidden. When the special mode is enabled, the main window
reveals the control panel for that mode.
Don't mind if the reveal is to the side or below the main window.
What is the easiest mechanism to achieve this?
Otherwise, I may have to create another window for these controls but
I'm not keen on that idea.
Thanks.
Bob.
Would the easiest option is to have 2 versions of the window, one
with the basic options and one with the full options, just close
the one you don't want amd open the other one in it's place?
Words of guidance would be appreciated - thanks.
An application I'm writing has a secondary mode which for the most
part I want hidden. When the special mode is enabled, the main window
reveals the control panel for that mode.
Don't mind if the reveal is to the side or below the main window.
What is the easiest mechanism to achieve this?
Otherwise, I may have to create another window for these controls but
I'm not keen on that idea.
Thanks.
Bob.
I don't know what the best thing to do is... stumped.
How are you implementing your basic control, is it a pane or
separate window.
I did wonder whether you could create your basic, and advanced
controls as individual panes, which you could open and close as
needed.
The other way I could see it being done is design a window the
maximum size for all the controls - then resize it to hide the
advanced controls, then resize to reveal the other controls.
Final thought is have all the controls on screen with them greyed
out - this might be the simplest option
Wimp_SetExtent is your frind in this case. Adjust the data block
for Wimp_OpenWindow (including the scroll offsets), call
Wimp_OpenWindow, then call Wimp_SetExtent. Make sure that you don't
set the extent to less than you have asked to be visible through Wimp_OpenWindow.
I know you're a BASIC and Assembler person,
but I don't think that any of my BASIC programs use variable sized
windows. However, if you can read enough C to be able to work out
the parameters (it's all OSLib, so all of the Wimp block entries
are named sensibly), you can see how Puzzles adjusts its index
window extent here:
https://github.com/steve-fryatt/puzzles/blob/3308390778ca2fdd37ca4057311c8b97bc20a101/src/index_window.c#L826-L853
In article <mpro.thz9x000u4xlm03ow.news@stevefryatt.org.uk>,
Steve Fryatt <news@stevefryatt.org.uk> wrote:
I know you're a BASIC and Assembler person,
Almost all assembler but yes, I wish I wasn't if I'm honest, I feel the constant need to apologise for it.
I think part of the problem is that unlike other languages and systems,
I've never seen a *very* simple wimp application created in bits using the ROOL kit, so I have no starter examples.
I'll try. You gave similar advice last year about scrolling text in a
window. I couldn't understand the code but you did point me in the right direction and I was then able to succeed. Trusty, very dated PRMs.
On 11 Jul, Bob Latham wrote in message
<5cf6a6ba64bob@sick-of-spam.invalid>:
In article <mpro.thz9x000u4xlm03ow.news@stevefryatt.org.uk>,
Steve Fryatt <news@stevefryatt.org.uk> wrote:
I'm not suggesting that you read it (although if it's useful,
that's great), but I should probably mention this guide. It starts
with a very simple BASIC example in Chapter 1, then converts it to
C in Chapter 2 and goes on from there. The target audience was
people who knew C, had maybe written Wimp applications in BASIC,
but hadn't used C for the Wimp.
It's now got to 35 chapters (and still hasn't yet got to
Wimp_SetExtent)...
https://www.stevefryatt.org.uk/risc-os/wimp-prog
You'll need a "recent-ish" version of the DDE, though.
I've just searched for Wimp_SetExtent in my project folders on the off-chance, and it's pointed me to this:
https://www.stevefryatt.org.uk/risc-os/panes/moving-the-furniture
which is a sort-of sibling to the tutorial above (there's other
references in the following chapter, too). It's about panes, but it
does show Wimp_SetExtent in use in BASIC -- the pane tutorial is
all in BASIC for accessibility.
Unfortunately, I couldn't find any applications of mine in BASIC
which use Wimp_SetExtent and that I'd consider a good example to
suggest looking at (it's all code that I wrote in the 1990s, before
I had any idea what I was doing -- if I even do now...).
In article <8f5e44f65c.Kevin@Kevsoft>,
Would the easiest option is to have 2 versions of the window, one
with the basic options and one with the full options, just close
the one you don't want amd open the other one in it's place?
That's a sneaky idea I do admit. The only issue I can see with that
is I'd have two window handles wouldn't I?
On 10 Jul 2026 as I do recall,
Bob Latham wrote:
In article <8f5e44f65c.Kevin@Kevsoft>,
Would the easiest option is to have 2 versions of the window,
one with the basic options and one with the full options, just
close the one you don't want amd open the other one in it's
place?
That's a sneaky idea I do admit. The only issue I can see with
that is I'd have two window handles wouldn't I?
Have a 'current' window handle in a variable, and set its value to
either of the two versions according to which one you currently
want your application to be using? (Or use an array(handle%,
version%) and adjust the value of version%, but that would probably
be harder to edit in to your existing program and more difficult to
read thereafter....)
In article <8f5e44f65c.Kevin@Kevsoft>,
Would the easiest option is to have 2 versions of the window, one
with the basic options and one with the full options, just close
the one you don't want amd open the other one in it's place?
That's a sneaky idea I do admit. The only issue I can see with that
is I'd have two window handles wouldn't I?
Thanks.
Bob.
In article <14c133f75c.harriet@bazleyfamily.co.uk>,
Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:
On 10 Jul 2026 as I do recall,
Bob Latham wrote:
I'd have two window handles wouldn't I?
Have a 'current' window handle in a variable, and set its value to
either of the two versions according to which one you currently
want your application to be using? (Or use an array(handle%,
version%) and adjust the value of version%, but that would probably
be harder to edit in to your existing program and more difficult to
read thereafter....)
So at the point of swap over, I close one window, open the other in
same position hopefully and change the current window handle, is that
about it?
Not sure how fixed and embedded the window handle is in my code, I'll
need to have a look.
On 10 Jul, Bob Latham wrote in message
<5cf627bdb6bob@sick-of-spam.invalid>:
I don't know what the best thing to do is... stumped.
Wimp_SetExtent is your frind in this case. Adjust the data block for Wimp_OpenWindow (including the scroll offsets), call Wimp_OpenWindow, then call Wimp_SetExtent. Make sure that you don't set the extent to less than
you have asked to be visible through Wimp_OpenWindow.
It's easier than messing around with two different windows.
In message <5cf6579ccbbob@sick-of-spam.invalid>
Bob Latham <bob@sick-of-spam.invalid> wrote:
I'd have two window handles wouldn't I?
You could have 3 window handles, one say called main%, main1% and main2.
main% would always point to the one in use.
On 10 Jul, Bob Latham wrote in message
<5cf627bdb6bob@sick-of-spam.invalid>:
Adjust the data block for Wimp_OpenWindow (including the scroll
offsets),
call Wimp_OpenWindow,
then call Wimp_SetExtent.
In article <mpro.thz9x000u4xlm03ow.news@stevefryatt.org.uk>,
Steve Fryatt <news@stevefryatt.org.uk> wrote:
On 10 Jul, Bob Latham wrote in message
<5cf627bdb6bob@sick-of-spam.invalid>:
My extra panel is at the bottom of the window. So I assume this is
the minimum y settings.
So I create a window in WinEd that contains all elements including
the icons at the bottom which are usually hidden.
Okay done that.
Adjust the data block for Wimp_OpenWindow (including the scroll
offsets),
Adjust which parameters? What am I trying to achieve doing this?
call Wimp_OpenWindow,
Okay.
then call Wimp_SetExtent.
To do what?
What am I trying to achieve doing this?
Sorry to be thick but I can't understand the principle of what
you're telling me to do. I need to understand before I can code
something.
In article <5cf93cf94dbob@sick-of-spam.invalid>,
Bob Latham <bob@sick-of-spam.invalid> wrote:
In article <mpro.thz9x000u4xlm03ow.news@stevefryatt.org.uk>,
Steve Fryatt <news@stevefryatt.org.uk> wrote:
On 10 Jul, Bob Latham wrote in message
<5cf627bdb6bob@sick-of-spam.invalid>:
Sorry to be thick but I can't understand the principle of what
you're telling me to do. I need to understand before I can code
something.
I am confused as well!
If you have a fixed main window area, but
sometimes you want to display another fixed area at the bottom of
it, then I would think you need to alter the Visible Area
displayed, not the Work Area (which Wimp_SetExtent does).
The change in Visible Area is done with a Wimp_GetWindowState, then
change just the visible min Y value and nothing else, then issue an Wimp_OpenWindow.
However, if the main part of the window is of variable height,
and/or you need the scroll bars, then this simple way will not
work, as the extra bottom icons will need to move to the bottom of
the window if the top part changes size.
In article <5cf94257c7News04@avisoft.f9.co.uk>,
Martin <News04@avisoft.f9.co.uk> wrote:
In article <5cf93cf94dbob@sick-of-spam.invalid>,
Bob Latham <bob@sick-of-spam.invalid> wrote:
If you have a fixed main window area, but sometimes you want to
display another fixed area at the bottom of it, then I would
think you need to alter the Visible Area displayed, not the Work
Area (which Wimp_SetExtent does).
That makes sense to me, I understand that.
Surely, if you reduce the Extent then you reduce the work area and
therefore remove from the window definition all the items in the
area you've chopped.
[Snip]
The change in Visible Area is done with a Wimp_GetWindowState,
then change just the visible min Y value and nothing else, then
issue an Wimp_OpenWindow.
Yes, I understand that too.
However, if the main part of the window is of variable height,
and/or you need the scroll bars, then this simple way will not
work, as the extra bottom icons will need to move to the bottom of
the window if the top part changes size.
Brain just exploded again. I can't understand that.
I think the problem is that the vertical scroll bar will be able, at
any time to reveal the hidden bottom section. I also think that
changing the extent is designed to fix that issue but I don't
understand exactly how.
I think the problem is that the vertical scroll bar will be able, at
any time to reveal the hidden bottom section. I also think that
changing the extent is designed to fix that issue but I don't
understand exactly how.
On 16 Jul 2026 as I do recall,
Bob Latham wrote:
In theory, if you change the maximum size of the window work area
then the scrollbars can no longer scroll beyond that. (And since
it's possible for icons to be located outside the edge of the
window - no sanity checks! - changing it back should reveal the
icons down at the bottom again, in the position in which they were
originally created.)
I haven't tested this....
In article <mpro.thz9x000u4xlm03ow.news@stevefryatt.org.uk>,Is it a window with an internal toolbar?
Steve Fryatt <news@stevefryatt.org.uk> wrote:
On 10 Jul, Bob Latham wrote in message
<5cf627bdb6bob@sick-of-spam.invalid>:
My extra panel is at the bottom of the window. So I assume this is
the minimum y settings.
So I create a window in WinEd that contains all elements including
the icons at the bottom which are usually hidden.
Okay done that.
Adjust the data block for Wimp_OpenWindow (including the scroll
offsets),
Adjust which parameters? What am I trying to achieve doing this?
call Wimp_OpenWindow,
Okay.
then call Wimp_SetExtent.
To do what?
What am I trying to achieve doing this?
Sorry to be thick but I can't understand the principle of what you're
telling me to do. I need to understand before I can code something.
Thanks.--
Bob.
Is it a window with an internal toolbar?
On 12 Jul, Kevin Wells wrote in message
<cd6264f75c.Kevin@Kevsoft>:
In message <5cf6579ccbbob@sick-of-spam.invalid>
Bob Latham <bob@sick-of-spam.invalid> wrote:
I'd have two window handles wouldn't I?
You could have 3 window handles, one say called main%, main1% and main2.
main% would always point to the one in use.
Wouldn't that be 2 window handles: main1% and main2%? The main% variable >would then be a copy of the value of whichever one was in use?
Use Wimp_SetExtent and have one window... it's a *lot* less messy and >confusing.
:-)
On 16 Jul 2026 as I do recall,
Bob Latham wrote:
[snip]
I think the problem is that the vertical scroll bar will be able,
at any time to reveal the hidden bottom section. I also think
that changing the extent is designed to fix that issue but I
don't understand exactly how.
In theory, if you change the maximum size of the window work area
then the scrollbars can no longer scroll beyond that. (And since
it's possible for icons to be located outside the edge of the
window - no sanity checks! - changing it back should reveal the
icons down at the bottom again, in the position in which they were
originally created.)
I haven't tested this....
Not at all sure what to do about the scroll bar...
In article <5cfa679cf3bob@sick-of-spam.invalid>,
Why do you need the scroll bar?
Is the main window height larger than can be displayed on the screen
easily?
If not, just remove the scroll bar.
Then you would not need to mess about with SetExtent.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 74 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 47:44:37 |
| Calls: | 1,100 |
| Files: | 1,339 |
| Messages: | 275,630 |