BBC BASIC for Windows
Programming >> User Interface >> Double clicks and multi windows
http://bb4w.conforums.com/index.cgi?board=ui&action=display&num=1466876253

Double clicks and multi windows
Post by KenDown on Jun 25th, 2016, 5:37pm

I'm playing around with using double clicks in one of my programs and have managed to get it to work in a test program.

Feeling pleased with myself I then transferred the snippets of code to all the right places in the actual program and I can't get double-clicks. If I trap @msg% with a value of 513 - which appears to be a single click - that works fine. If I use the value 515 (for double clicks) nothing.

The problem appears to be that my program uses multiple output windows. I have guessed that I need to alter the @hwnd% in the initialisation code to the handle of the window that I want to accept the double-clicks, but whether using hw2% or !hw2%, the double-clicks remain unrecognised.

Can anyone tell me whether multiple windows can accept double-clicks? Also whether I do need to change @hwnd%?

Many thanks.
Re: Double clicks and multi windows
Post by Zaphod on Jun 26th, 2016, 12:44am

It looks as if Multiwin.bbc library does not pass on that interrupt.
However it would also appear that it would be easy to modify to add in your required value.
Code:
      mov eax,[esp+8]
      cmp eax,15:jz near T%
      cmp eax,2 :jz D%
      cmp eax,&200:jz V%
      cmp eax,&100:jz F%
      cmp eax,&104:jz F%
      cmp eax,&201:jz F%
      cmp eax,&204:jz F%
      cmp eax,&207:jz F%
      cmp eax,&403:jz F%
      cmp eax,&111:jz F%
      cmp eax,&114:jz F%
      cmp eax,&115:jz F%
      jmp "DefWindowProc"
 

Just add your interrupt to the list, you want &203.
Re: Double clicks and multi windows
Post by KenDown on Jun 26th, 2016, 08:12am

Wow! Brilliant! Now my program works as I want - the only downside is that now, if I share it with anyone, I'll have to share the modified MultiWin library - I know the libraries are incorporated in the compiled executable, but not if I share the code.

Thanks again.
Re: Double clicks and multi windows
Post by Zaphod on Jun 26th, 2016, 3:30pm

Quote:
the only downside is that now, if I share it with anyone, I'll have to share the modified MultiWin library

I don't see that as a problem.
You can just copy the modified library code into your into your program rather than install it. Indeed that would be better so you don't forget that it needs the modified version. And since BB4W and thus Multiwin isn't going to get updated any time soon, if ever, it should remain up to date.

Glad it works for you anyway.


Re: Double clicks and multi windows
Post by KenDown on Jun 26th, 2016, 6:02pm

Just in case anyone is wondering what I wanted it for, it's my "PowerPoint" improvement. I use the right-mouse button to underline, so it always draws a perfect horizontal line.

Recently my laser pointer cum remote gave up the ghost and I found a nice one on Amazon that was an "air mouse" as well as pointer and remote. Great, I thought, now I can underline without having to stoop to the mouse on the table.

No, the button which gives you a right click is tiny and hard to operate, and as soon as you press it the air mouse stops working - you can't move the pointer at all. Grrrr.

So now I simply double click and hold, then move the air mouse and get a perfect underline again.

Thanks once more.