OI Bug in WINMSG event / FOCUS property?? (OpenInsight)
At 02 AUG 2001 05:25:33PM Robert Lee wrote:
I have a simple test form with only two controls. A PUSHBUTTON (BUTTON_1) and a PUSHBMP with 6 images (BUTTON_2). BUTTON_1 is first in the tabbing order. I have a Create Event with the following code:
declare function send_message
Equ True$ to 1
Equ WM_MOUSEMOVE$ to 512 ;* \0200\
x=send_message(@window, "QUALIFY_EVENT", WM_MOUSEMOVE$, TRUE$)
RETURN 0
The following code is in the WINMSG event:
$insert logical
Button.Size=.BUTTON_2-]SIZE
xPos=BitAnd(lParam, 65535)
yPos=BitAnd(lParam / 65535, 65535)
Over=False$
if xPos + Button.Size and xPos ]= Button.Size then
if yPos + Button.Size and yPos ]= Button.Size then/* we're in the button area */Over=True$endend
IF over=True$ THEN
x=set_property(@WINDOW : '.BUTTON_2', "FOCUS", 1)END ELSE
x=set_Property(@window : '.BUTTON_1', "FOCUS", 1)END
RETURN 1
The code works perfectly to change the bitmap image number displayed from 1 to 5 when the mouse hovers over BUTTON_2 EXCEPT when you approach the button from either the top or the left. If your mouse approaches the button from the right or bottom, it works perfectly.
If you change the last four lines to the following line, it behaves perfectly when approached from all four directions.
x=set_property(@WINDOW : '.BUTTON_2', "ENABLED", Over)
Unfortunately, we need to use both the ENABLED property and the FOCUS property to do what we want.
If this is a bug, can it please be repaired in OI 3.7.5? It would be very much appreciated.
Robert Lee
At 02 AUG 2001 05:53PM Oystein Reigem wrote:
Robert,
You qualify a mousemove event for the window, but as long as the mouse is over the PUSHBMP mousemove doesn't go further. No mousemove reaches the window.
It's different with a BITMAP control.
The reason something happens at all is the following: The area you check when you set the Over variable is slightly larger than the PUSHBMP - 1 pixel on the right and bottom side. The mousemove your WINMSG handler detects is when you move the mouse over these narrow strips of pixels in the window.
- Oystein -
At 02 AUG 2001 08:56PM Robert Lee wrote:
By golly Oystein you are a genius! Forgive me RevSoft for daring to suggest it could have been a bug in OI. This one had me foxed and you explained it very well.
Robert Lee
At 03 AUG 2001 03:26AM Oystein Reigem wrote:
Robert,
I'm just a part-time genius. I do some really stupid things some times.
![]()
- Oystein -