Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #302

Re: Toolbox Mouse position

Subject Re: Toolbox Mouse position
Newsgroups comp.sys.acorn.programmer
From Tank <webmaster@tankstage.co.uk>
Message-ID <19c91fd351.tank@tankstage.co.uk> (permalink)
References <a9bd1414-f078-4e4c-af3b-2d7a3ee84705@e13g2000vbo.googlegroups.com> <88a93ecb-a883-48c6-abd2-76ab95f20cc7@cu4g2000vbb.googlegroups.com>
Organization virginmedia.com
Date 2011-05-14 07:44 +0100

Show all headers | View raw


In message <88a93ecb-a883-48c6-abd2-76ab95f20cc7@cu4g2000vbb.googlegro 
ups.com>
          Mister Ron <mrronman@googlemail.com> wrote:


> Thanks guys for the info.
> I tried Martin's method then Rik's.
> I'm now saving the position of the click in the click event. Then in
> the menu_click event find the ComponentId.

> However some of my displayfields are greyed out and
> window_wimp_to_toolbox seem to return -1 for these icons.

> I'm now trying to calculate the window position again so I can work
> out which icon i'm over with the following:

>   /* Find window Y coords */
>    WimpGetWindowInfoBlock block;
>    block.window_handle = mouse_click_position.window_handle;
>    e=wimp_get_window_info( &block );  if(e) raise_error(e);

> This doesn't seem to error  but crashes later with an ** unrecoverable
> error in run time system : free failed

> Does this look right or is there a better method to use.

> Ta
> MrRon

A longer winded (so slower to return), but portable method is,

1. Get the number of gadgets in the window with 
"Window_EnumerateGadgets"
2. Loop getting the gadget flags with "Toolbox_MiscOp" (r2=64)
3. If the gadget is faded change it to unfaded with "Toolbox_MiscOp" 
(r2=65)
4. Get the pointer info with "Window_GetPointerInfo" r4=gadget number
5. If you changed the faded flag, change it back

I have done this in Basic.

Tank

-- 
webmaster@tankstage.co.uk   Iyonix PC

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


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