Flipper Graph

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post 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
Jamal
Posts: 314
Joined: Mon Jul 03, 2017 7:02 pm

Flipper Graph

Post 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.
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post 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
Jamal
Posts: 314
Joined: Mon Jul 03, 2017 7:02 pm

Flipper Graph

Post 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
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post 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
Attachments
flipper.png
flipper.png (58.71 KiB) Viewed 377 times
User avatar
Meinhard
Posts: 81
Joined: Thu Oct 01, 2015 4:51 pm

Flipper Graph

Post 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
Jamal
Posts: 314
Joined: Mon Jul 03, 2017 7:02 pm

Flipper Graph

Post 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      
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post 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
User avatar
GlenT
Posts: 33
Joined: Fri Sep 25, 2015 7:35 pm

Flipper Graph

Post 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
Jamal
Posts: 314
Joined: Mon Jul 03, 2017 7:02 pm

Flipper Graph

Post 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
Post Reply