Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #292
| From | Rik Griffin <nospam@denbridgemarine.com> |
|---|---|
| Newsgroups | comp.sys.acorn.programmer |
| Subject | Re: Toolbox Mouse position |
| Message-ID | <24d725d251.rik-news@iyonix.elements> (permalink) |
| References | <a9bd1414-f078-4e4c-af3b-2d7a3ee84705@e13g2000vbo.googlegroups.com> |
| Date | 2011-05-12 10:14 +0100 |
In message <a9bd1414-f078-4e4c-af3b-2d7a3ee84705@e13g2000vbo.googlegroups.com>
Mister Ron <mrronman@googlemail.com> wrote:
> Hello again
>
> I've got a toolbox application window in which i dynamically create
> display_fields.
>
> When i select an entry from a menu belonging to the window, How can I
> determine the position of where the menu was created so I can decide
> which displayfield I was over to operate on.
When you click on your window, you'll get a Wimp_EMouseClick event,
assuming you've set the window background button type to ButtonType_Click
(3).
In the wimp event block delivered to your application, there's a window
handle and an icon handle. Use Window_WimpToToolbox to find which toolbox
gadget the icon handle belongs to, this is the component ID of your display
field.
Note - for other gadget types this is slightly more complicated.
ScrollList and TextArea gadgets won't return a Wimp_EMouseClick event, but
your window's menu will still open.
Tabs gadgets will return Wimp_EMouseClick if you click over the tab, but
what you get when you click over a window nested in the gadget depends on
the flags for that window.
TreeView gadgets will return an event if you click Menu over them, but not
for Select or Adjust, unless the TreeView_AllEvents flag is set. TreeView
gadgets can have their own menu, so your window's menu won't be shown,
although you can listen for the Wimp_EMouseClick with the component ID of
the TreeView, and open the menu yourself.
Tabs and TreeViews will also return the correct component ID in the IDBlock
returned for click events.
These differences are because these "complex" gadgets are implemented using
nested windows, rather than Wimp icons.
Sorry, I kind of went off on one there, but anyway, I hope I answered your
original question! :)
--
Rik Griffin
Standard disclaimer, not speaking for anyone but myself, blah blah
(Reply-To may be broken: use rik dot griffin at denbridge marine dot com)
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Toolbox Mouse position Mister Ron <mrronman@googlemail.com> - 2011-05-10 13:50 -0700
Re: Toolbox Mouse position Alan <alan_baa@hotmail.com> - 2011-05-11 04:36 -0700
Re: Toolbox Mouse position Mister Ron <mrronman@googlemail.com> - 2011-05-11 13:15 -0700
Re: Toolbox Mouse position Martin Wuerthner <spamtrap@mw-software.com> - 2011-05-11 22:59 +0200
Re: Toolbox Mouse position Rik Griffin <nospam@denbridgemarine.com> - 2011-05-12 10:14 +0100
Re: Toolbox Mouse position Mister Ron <mrronman@googlemail.com> - 2011-05-13 13:28 -0700
Re: Toolbox Mouse position Rik Griffin <rik.griffin@btinternet.com> - 2011-05-14 00:58 +0100
Re: Toolbox Mouse position Tank <webmaster@tankstage.co.uk> - 2011-05-14 07:44 +0100
csiph-web