Flipper Graph

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Jamal
Posts: 315
Joined: Mon Jul 03, 2017 7:02 pm

Flipper Graph

Post by Jamal »

I don't think the wparam or lparam help here, I've only used them to trap function keys and character input.

May be you need to look for WM_MOUSEACTIVATE message:

Code: Select all

METHOD Dispatch(oEvent) CLASS <Your Flipper OLE Control Class>
	LOCAL msg := oEvent:Message as DWORD    
	LOCAL hwndChild as ptr
   
	
	do case  
	case msg == WM_SETCURSOR
		  ? "WM_SETCURSOR" 
		 		   
	case msg == WM_MOUSEACTIVATE
		 ? "WM_MOUSEACTIVATE"
		 hwndChild := GetWindow(hwnd, GW_CHILD)
		IF (hwndChild != null_ptr)
			SetFocus(hwndChild)
		ENDIF
	otherwise
		   ? msg
	endcase		


	RETURN SUPER:Dispatch(oEvent)
However, it will all depend on what messages the OCX is sending to the dispatch method.

Edit: reference for messages list: https://wiki.winehq.org/List_Of_Windows_Messages
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post by GlenT »

Jamal and Meinhard,

I think I have a working solution. I subclassed the Flipper Control and added a Dispatch to the subclass:

METHOD Dispatch( oEvent ) CLASS FlipperDashboardCashFlowGraph
LOCAL uMsg AS LONG
LOCAL wParam AS DWORD
LOCAL lParam AS LONG

uMsg := oEvent:Message
wParam := oEvent:wParam
lParam := oEvent:lParam

DO CASE
CASE uMsg == WM_SETCURSOR .AND. lParam == 33619969
SELF:Owner:symFocusedControl := #ocxCashFlowGraph
ENDCASE
RETURN SUPER:Dispatch( oEvent )

This seems to work reliably (subject to more testing though). Thanks for all your help and suggestions. I don't think I would have got there without them.

Cheers

Glen
User avatar
robert
Posts: 4259
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Flipper Graph

Post by robert »

Glen,
Can I add one suggestion:
Change the start of the method to
METHOD Dispatch( uEvent ) CLASS FlipperDashboardCashFlowGraph
LOCAL oEvent := uEvent as Event
LOCAL uMsg AS LONG

and the code will perform better. That removes late binding from the method.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post by GlenT »

Thank you Robert. I've made that change.

Cheers

Glen
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post by GlenT »

Robert,

As an after thought, would you recommend that I make the same change to the various Data, Dialog and DataDialog windows I have in the application?

Cheers

Glen
User avatar
robert
Posts: 4259
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Flipper Graph

Post by robert »

Glen,
If you do that then the code will be early bound and the compiler can help you find typos in your code and will produce better code.
I would recommend this in particular for methods that are executed a lot, like the Dispatch method that you were showing.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post by GlenT »

Thanks Robert
Post Reply