Statics and events (OpenInsight Specific)
At 22 NOV 1999 05:16:04AM Oystein Reigem wrote:
I didn't think static text controls had any events until I accidentally shift-clicked one. And found SUBMIT and WINMSG.
What is SUBMIT?
Since statics have WINMSG, can one qualify events for them?
- Oystein -
At 22 NOV 1999 07:50AM Mike Ruane, WinWin Solutions Inc. wrote:
Oystein-
Submit is for the Internet options.
I'm pretty sure Static controls can answer to WinMSG- Mouseover, for one.
Hope this helps-
Mike Ruane
WinWin Solutions Inc.
WWW.WinWinSol.Com
At 22 NOV 1999 08:41AM Oystein Reigem wrote:
Mike,
Submit is for the Internet options.
Of course. My excuse: Haven't used SUBMIT event since early experiments with HTML Publisher. Written my html from scratch since then. And it's not in the Reference where I expected it to be. Found it now in the Internet Publ chapter of Guide to App Devel and see it can be used for links.
I'm pretty sure Static controls can answer to WinMSG- Mouseover, for one. Tried now and can't get it to work. There's no Mouseover in my docs but assume you mean WM_MOUSEMOVE. Tried with WM_MOUSEMOVE and WM_LBUTTONDOWN. Both work in an edit box but not in a static. Found that BITMAPs have WINMSG too, but no more luck than with statics. Dead as doornails both of them. Probably need some hoodoo to bring them alive.
- Oystein - </QUOTE> —- === At 22 NOV 1999 10:44AM Don Miller - C3 Inc. wrote: === <QUOTE>Oystein .. Static controls respond to WINMSG events so a QUALIFY_EVENT in the Create Property certainly will work to capture such things as mouse clicks and the like. We have also successfully used this technique to plug in event processing that is not normally allowed on a particular control - for example double-click on an EditLine control. Don Miller C3 Inc. </QUOTE> —- === At 22 NOV 1999 12:40PM Oystein Reigem wrote: === <QUOTE>Don, Very strange indeed. I've scrutinized both your posting and my window/code to find that obvious misunderstanding or mistake. But with no luck. Here's what I got: One non-bound window called "TEST_WINMSG" with three controls: First one static text named "STATIC". Then one bitmap named "BITMAP". Finally one edit box named (you guessed it) "EDITBOX". The window's got the following CREATE handler, pregnant with qualified events: <code> equ WM_MOUSEMOVE to 512 /* 512=$0200=mouse move */ equ WM_LBUTTONDOWN to 513 /* 513=$0201=left button down */ equ WM_LBUTTONUP to 514 /* 514=$0202=left button up */ equ WM_KEYDOWN to 256 /* 256=$0100=key down */ equ WM_KEYUP to 257 /* 257=$0101=key up */ equ WM_CHAR to 258 /* 258=$0102=char */ declare function Send_Message unUsed=Send_Message( @Window : ".STATIC", 'QUALIFY_EVENT', WM_MOUSEMOVE, 1 ) unUsed=Send_Message( @Window : ".STATIC", 'QUALIFY_EVENT', WM_LBUTTONDOWN, 1 ) unUsed=Send_Message( @Window : ".STATIC", 'QUALIFY_EVENT', WM_LBUTTONUP, 1 ) unUsed=Send_Message( @Window : ".STATIC", 'QUALIFY_EVENT', WM_KEYDOWN, 1 ) unUsed=Send_Message( @Window : ".STATIC", 'QUALIFY_EVENT', WM_KEYUP, 1 ) unUsed=Send_Message( @Window : ".STATIC", 'QUALIFY_EVENT', WM_CHAR, 1 ) unUsed=Send_Message( @Window : ".BITMAP", 'QUALIFY_EVENT', WM_MOUSEMOVE, 1 ) unUsed=Send_Message( @Window : ".BITMAP", 'QUALIFY_EVENT', WM_LBUTTONDOWN, 1 ) unUsed=Send_Message( @Window : ".BITMAP", 'QUALIFY_EVENT', WM_LBUTTONUP, 1 ) unUsed=Send_Message( @Window : ".BITMAP", 'QUALIFY_EVENT', WM_KEYDOWN, 1 ) unUsed=Send_Message( @Window : ".BITMAP", 'QUALIFY_EVENT', WM_KEYUP, 1 ) unUsed=Send_Message( @Window : ".BITMAP", 'QUALIFY_EVENT', WM_CHAR, 1 ) unUsed=Send_Message( @Window : ".EDITBOX", 'QUALIFY_EVENT', WM_MOUSEMOVE, 1 ) unUsed=Send_Message( @Window : ".EDITBOX", 'QUALIFY_EVENT', WM_LBUTTONDOWN, 1 ) unUsed=Send_Message( @Window : ".EDITBOX", 'QUALIFY_EVENT', WM_LBUTTONUP, 1 ) unUsed=Send_Message( @Window : ".EDITBOX", 'QUALIFY_EVENT', WM_KEYDOWN, 1 ) unUsed=Send_Message( @Window : ".EDITBOX", 'QUALIFY_EVENT', WM_KEYUP, 1 ) unUsed=Send_Message( @Window : ".EDITBOX", 'QUALIFY_EVENT', WM_CHAR, 1 ) RETURN 0 </code> All three controls have got the exact same user event handler: <code> $insert Logical equ WM_MOUSEMOVE to 512 /* 512=$0200=mouse move */ equ WM_LBUTTONDOWN to 513 /* 513=$0201=left button down */ equ WM_LBUTTONUP to 514 /* 514=$0202=left button up */ equ WM_KEYDOWN to 256 /* 256=$0100=key down */ equ WM_KEYUP to 257 /* 257=$0101=key up */ equ WM_CHAR to 258 /* 258=$0102=char */ declare function Set_Property declare function Get_Property begin case case Message=WM_LBUTTONUP Y=int(lParam / 65536) X=lParam - Y * 65536 call msg( @Window, "(WM_LBUTTONUP " : X : "," : Y : ")" ) case Message=WM_MOUSEMOVE Y=int(lParam / 65536) X=lParam - Y * 65536 call msg( @Window, "(WM_MOUSEMOVE " : X : "," : Y : ")" ) end case RETURN 0 </code> (Obviously the leftbuttonup won't get much chance to run with that mousemove bringing up a message box all the time. I could have simplified for clarity but at least now it's exactly as I ran it.) I use OI 3.61. - Oystein - </QUOTE> —- === At 22 NOV 1999 01:01PM Don Miller - C3 Inc. wrote: === <QUOTE>Oystein .. Maybe I'm fouled up on my response, but here is what I do to get mouse actions on a control that doesn't normally recognize a double-click (in this case an EditLine): * first the Mouse_Equates INSERT: compile insert Mouse_Equates * standard Windows API mouse equivalencies equ WM_MOUSEMOVE$ to "0x200";* MOVE equ WM_LBUTTONDOWN$ to "0x201";* LEFT BUTTON ACTIONS equ WM_LBUTTONUP$ to "0x202" equ WM_LBUTTONDBLCLK$ to "0x203" equ WM_RBUTTONDOWN$ to "0x204";* RIGHT BUTTON ACTIONS equ WM_RBUTTONUP$ to "0x205" equ WM_RBUTTONDBLCLK$ to "0x206" equ WM_MBUTTONDOWN$ to "0x207";* MIDDLE BUTTON ACTIONS equ WM_MBUTTONUP$ to "0x208" equ WM_MBUTTONDBLCLK$ to "0x209" * * now for the form (a simple one to catch a double_click on an * editline - assuming the initialization in the create event contains * what is needed Null=QUALIFY_EVENT(@WINDOW:".EDITLINE_START_TIME",WM_LBUTTONDBLCLK$,1) * * In the WINMSG Event for EDITLINE_START_TIME, script is SAVE=CtrlEntId ;* this is in case it gets trashed in the routine VAR=TIMEBOX ;* this function will return a time set up properly for * my app which understands the difference between * 00:00 and 24:00 If LEN(VAR) then SET_PROPERTY(SAVE,"DEFPROP",VAR) return 1 Is this what you mean, or am I completely off-base? Don Miller C3 Inc. </QUOTE> —- === At 22 NOV 1999 01:06PM Oystein Reigem wrote: === <QUOTE>Don, I'm just on my way out the door. Just browsed your reply. I know one can get e.g an edit line to respond to more events. But can you get a static text (middle choice in upper line in Form Designer's Controls tool) to react to any events at all? - Oystein - </QUOTE> —- === At 22 NOV 1999 01:15PM Don Miller - C3 Inc. wrote: === <QUOTE>Oystein .. Not that I see what you're driving at, I'm not sure you can in a direct way. I've done a similar thing though by putting a transparent bitmap control (push-button, for example) over a static and then catching that. I have a calendar matrix that consists of symbolic data arranged in a 7 x 7 matrix. I have transparent push buttons over each one and a subroutine that activates a dialog box to allow for modification of the underlying data. I would have loved to be able to dispense with the additional controls and just catch the double click with the mouse location at pixel coordinates. Don Miller C3 Inc. </QUOTE> —- === At 23 NOV 1999 03:28AM Oystein Reigem wrote: === <QUOTE>Don, My starting point was: I didn't think statics and plain bitmaps could have events at all. Then I accidentally discovered they had a WINMSG event. Which made me think one could qualify events for them. But it doesn't seem to work. So my question now is: What are those WINMSG events for? I haven't got a specific problem I need a solution for right now. And I realize there are substitutes. If one e.g needs a clickable static one can always make a read-only edit line look like a static and use that instead. And instead of bitmaps one can use pushbmps. - Oystein - </QUOTE> —- === At 24 NOV 1999 05:30AM Barry Stevens wrote: === <QUOTE>Don In WINMSG event, how do you test for each mouse action. Barry </QUOTE> —- === At 24 NOV 1999 06:22AM Oystein Reigem wrote: === <QUOTE>Barry, In case Don isn't up yet/still…
In the WINMSG event for the control have a case sentence checking for each of the events you qualified. E.g equ WM_LBUTTONDOWN to 513 /* 513=$0201=left button down */ equ WM_LBUTTONDOWN to 513 /* 513=$0201=left button down */ declare function Set_Property declare function Get_Property begin case case Message=WM_LBUTTONUP Y=int(lParam / 65536) X=lParam - Y * 65536 call msg( @Window, "(You clicked in position (" : X : "," : Y : ")" ) case Message=WM_LBUTTONDOWN … case Message=… … end case RETURN 0 - Oystein - </QUOTE> —- === At 24 NOV 1999 07:11PM Barry Stevens wrote: === <QUOTE> </QUOTE> View this thread on the forum...