Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #5963
| Subject | Re: Finding location of current menu |
|---|---|
| Newsgroups | comp.sys.acorn.programmer |
| From | Alan Adams <alan@adamshome.org.uk> |
| Date | 2020-02-02 20:12 +0000 |
| Message-ID | <ad09273c58.Alan.Adams@ArmX6.adamshome.org.uk> (permalink) |
| References | <30e2ae3a58.Matthew@sinenomine.freeserve.co.uk> <ae07e9e3-7e1f-43de-a6c3-83b8e2b1bbac@googlegroups.com> <ac3f013c58.Matthew@sinenomine.freeserve.co.uk> |
| Organization | Orpheus Internet Services |
In message <ac3f013c58.Matthew@sinenomine.freeserve.co.uk>
Matthew Phillips <spam2011m@yahoo.co.uk> wrote:
> In message <ae07e9e3-7e1f-43de-a6c3-83b8e2b1bbac@googlegroups.com>
> on 31 Jan 2020 news@sprow.co.uk wrote:
>> On Thursday, 30 January 2020 23:43:19 UTC, Matthew Phillips wrote:
>>> Menus are implemented as windows, but handled by the Wimp, as I
>>> understand it.
>>>
>>> In RiscOSM you can open a menu to view web pages relating to the item on
>>> the map. The software used to open the menu straight away, just showing
>>> the links we could calculated direct from the map data. A few versions
>>> ago we enhanced it to look up the map item in Wikidata and obtain a wider
>>> range of web links from there. This came at a price: the menu does not
>>> open immediately because the Wikidata API has to be called and return its
>>> results, so we have a timeout (defaulting to five seconds) after which
>>> the basic links appear and the Wikidata lookup is abandoned.
>>
>> If it's just a single flat menu (no submenus) could you, having noted that
>> the Wimp constructs menus from windows and icons just the same as any
>> other, create your own menu handling routines which create it as a normal
>> window? You'd then be free to manipulate it as a normal window.
> Yes, that would be an option. Hilary changed the bookmarks menu in RiscOSM
> recently to implement it as a window that looks like a menu. This allowed her
> to add an edit and a delete icon next to each menu item to make it easier to
> change the bookmarks.
I have done something similar to allow keyboard navigation of my menus.
The "menu" is a window I created, and the icons can have input focus,
allowing keypresses to be returned. The selected item changes with for
example the up and down arrow keys, done by toggling flags in the icons.
In my case I don't use the toolbox, but the Wimp_ calls directly. For
normal menus, not the "fake" ones, the important thing is to understand
that the menu structure passed to the wimp to create the menu is used
subsequently by the wimp, so you can't mess with it while the menu is
open. (You can change things, but you need to understand what can be
changed.) Submenus can be changed on the fly, i.e. as the pointer moves
over the submenu arrow, the wimp calls your application, and at that point
the menu structure is created and Wimp_CreateSubMenu called.
As only one menu can be open at a time, you only need a single memory
block for the main menu, and one for the submenu.
--
Alan Adams, from Northamptonshire
alan@adamshome.org.uk
http://www.nckc.org.uk/
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Finding location of current menu Matthew Phillips <spam2011m@yahoo.co.uk> - 2020-01-30 23:43 +0000
Re: Finding location of current menu druck <news@druck.org.uk> - 2020-01-31 08:10 +0000
Re: Finding location of current menu news@sprow.co.uk - 2020-01-31 00:55 -0800
Re: Finding location of current menu Matthew Phillips <spam2011m@yahoo.co.uk> - 2020-02-02 13:19 +0000
Re: Finding location of current menu Alan Adams <alan@adamshome.org.uk> - 2020-02-02 20:12 +0000
Re: Finding location of current menu Steve Fryatt <news@stevefryatt.org.uk> - 2020-01-31 22:45 +0000
Re: Finding location of current menu Jean-Michel <jmc.bruck@orange.fr> - 2020-02-01 20:38 +0100
Re: Finding location of current menu Matthew Phillips <spam2011m@yahoo.co.uk> - 2020-02-02 13:17 +0000
Re: Finding location of current menu Terry Kelly <tk@cestriant.plus.com> - 2020-02-02 16:45 +0000
Re: Finding location of current menu Steve Fryatt <news@stevefryatt.org.uk> - 2020-02-02 19:44 +0000
Re: Finding location of current menu svrsig <chris@svrsig.org> - 2020-02-14 06:48 -0800
Re: Finding location of current menu Matthew Phillips <spam2011m@yahoo.co.uk> - 2020-02-14 22:03 +0000
Re: Finding location of current menu svrsig <chris@svrsig.org> - 2020-02-19 10:45 -0800
csiph-web