xsharp.eu • Flipper Graph
Page 1 of 2

Flipper Graph

Posted: Wed Sep 11, 2019 6:38 am
by GlenT
Hi,
I am using FlipperGraph in my VO application and I need/want to know when the FlipperGraph control has focus. I've tried FocusChange and ControlFocusChange but to no avail. Anyone got any ideas?

Cheers

Glen Townsley

Flipper Graph

Posted: Wed Sep 11, 2019 9:11 pm
by Jamal
Hi Glen,

Does the ActiveX control have an event that you may hook into?

The FocusChange and ControlFocusChange only work with native VO controls and would not handle ActiveX controls.

BTW, just noticed the Flipper Graph control is discontinued.

Flipper Graph

Posted: Wed Sep 11, 2019 10:18 pm
by GlenT
Hi Jamal,

It doesn't surprise me that it is discontinued. Its in a legacy application that I need to support for a few more years until we can get the rewrite done.

The ActiveX doesn't seem to have anything methods I could use. I think I'll have to use MouseClick in the DataWindow to try and simulate focus. I suspect that it in not actually getting focus which is where my problem lies.

Cheers

Glen

Flipper Graph

Posted: Thu Sep 12, 2019 3:13 am
by Jamal
I am not sure how you are placing the activex control on the window.

Have you tried?

Code: Select all

self:oDCYourActiveControl:SetFocus()     // change accordingly
  
?  self:oDCCurrentControl:Name

to see if it gets focus.

Jamal

Flipper Graph

Posted: Thu Sep 12, 2019 4:24 am
by GlenT
Jamal,

I dropping an OLE object onto the window designer and then inheriting from FlipperGraph.

I have now worked out that I can give the graph focus by setting the TabStop property to true and tabbing through the controls. The issue therefore seems to be that the ocx is trapping the mouseclick so VO doesn't see it at all.

I've discovered an event hat may give me what I want but if it is firing, I can seem to receive it. The help for the event is attached.

I've constructed a method in the specific DashBoardWin class:

METHOD ocxCashflowGraph_FoundObject( oGrf, uID, nID, oObf, nBtn ) CLASS DashboardWin

SELF:symFocusedControl := #ocxCashFlowGraph
AltD()

RETURN NIL

where ocxCashFlowGraph is the ole object and self:symFocusedControl is the variable I want to set but it doesn't seem to get called so I assume I am not constructing it correctly.

Cheers

Glen

Flipper Graph

Posted: Thu Sep 12, 2019 6:27 am
by Meinhard
Hi Glen,

please try to add a

METHOD __OCXDefEventCallback( pszEventProtoType, ptrControlHandle) CLASS <YourWindowClass>

and see if you get any calls here. This method is called by default if the OCX fires an event.

Regards
Meinhard

Flipper Graph

Posted: Thu Sep 12, 2019 5:16 pm
by Jamal
Hi Meinhard,

I think that should help. I tested it on an activex control and I got all kinds of events.

Glen, look at this. You may want to test for cEventName

Code: Select all

METHOD __OCXDEFEVENTCALLBACK( pszEventProtoType, ptrControlHandle)  CLASS  <YourWindowClass>

        LOCAL cEventProtoType as STRING
        LOCAL cEventName as STRING
        
        cEventProtoType := Psz2String(pszEventProtoType) 
        cEventName := SubStr(cEventProtoType,1, At("(", cEventProtoType) -1 ) 
        // ? cEventName, cEventProtoType  
        
        // for example:
        if cEventName == "DblClick" 
        	  self:DoSomething()
        endif
      
RETURN self      

Flipper Graph

Posted: Thu Sep 12, 2019 10:35 pm
by GlenT
Thanks Jamal and Meinhard,

I've added the method

METHOD __OCXDEFEVENTCALLBACK( pszEventProtoType, ptrControlHandle ) CLASS DashboardWin
LOCAL cEventProtoType AS STRING
LOCAL cEventName AS STRING

cEventProtoType := Psz2String( pszEventProtoType )
cEventName := SubStr3( cEventProtoType,1, At( "(", cEventProtoType ) -1 )
// ? cEventName, cEventProtoType
AltD()
// for example:
// IF cEventName == "DblClick"
// SELF:DoSomething()
// ENDIF

RETURN SELF

but it does not get called. I am thinking that the method I selected in FlipperGraph itn't doing what I had hoped.

Thanks

Flipper Graph

Posted: Thu Sep 12, 2019 11:38 pm
by GlenT
Jamal and Meinhard,

I've tries a different approach and I can see that the Dispatch of the window that owns the FipperGraph control receives a message when I left mouse click in the graph control.

The event:Message is 32 which I think is a WM_SETCURSOR but I don't understand what the wParam and lParam are.

Cheers

Glen

Flipper Graph

Posted: Fri Sep 13, 2019 4:31 pm
by Jamal
Glen,

In your PostInit(), are you using ?

self:ODCocxCashFlowGraph :CreateEmbedding("Your Control Prog ID", "Your License Key")

If the OCX is a "normal" control, the __OCXDEFEVENTCALLBACK should work, otherwise, I am running out of ideas.

Jamal