This may be a 6 blush question, but hopefully I won't be researching it at 1am tomorrow morning.
As everything we do is SDI I'm being tripped up trying to add a contextmenu to a ccjgrid. I do have the basic commandbar classes in my precompiled header as I wanted SkinFramework but haven't found a satisfactory way to make a default CommandBarSystemObject that is connectable. As often happens I find the help a little counter-intuitive until I've read it half a dozen times.
Code:
Property Handle CommandBarSystemObject
Object oCommandBarSystem is a cCJCommandBarSystem
Set pbTimerUpdate to True
Procedure OnCreateCommandBars
Handle hoOptions
Get OptionsObject to hoOptions
Forward Send OnCreateCommandBars
Set CommandBarSystemObject to oCommandBarSystem
End_Procedure
Object oStatusBar is a cCJStatusBar
Object oStatusTime is a cCJStatusBarPane
Set piWidth to 120
Set pbStyleNoBorders to True
End_Object
...
Object oTimer is a DFTimer
Set Timer_Active_State to True
Procedure OnTimer
Set psText of oStatusTime to (Mid(CurrentDateTime(),19,1))
End_Procedure
End_Object
End_Object
End_Object
and
Code:
Object oContextMenu is a cCJContextMenu
Object oShowMenuItem is a cCJMenuItem
Set psCaption to 'Mark as Read'
Procedure onExecute Variant vCommandBarControl
String sUser HH MM
Handle hoCommandBar
Get CommandBarSystemObject to hoCommandBar
Forward Send OnExecute vCommandBarControl
Get psLogonName of oApplication to sUser
Reread USERMsg
Move 1 to USERMsg.Read
Sysdate USERMsg.Read_Date hh mm
Move (HH * 100 + MM) to UserMsg.Read_Time
SaveRecord UserMsg
Unlock
End_Procedure
End_Object
etc etc...
Always throws a Context Menu not attached to CommandBars 4402
Also as everything we do is SDI I see all the discussions about contextmenus happened many years ago and I wasn't interested enough to join in
I get most of what's being talked about in the help, but I suppose my question is what's the simplest way to add an instance of a commandbarsystem that will work with a contextmenu