From: Michael on
Hi All,

I'm using SEMenuXP w VO2.8 on Vista. It's working great for the
toolbars and the menus. Now I want to place images on a treeview
contextmenu.

Is there anybody who is willing to share how to do this? If the way
to do this is in the SE Help file, it is eluding me.

Any help is greatly appreciated,

Michael


From: Geoff Schaller on
Michael.

There is no secret. Just assign the context menu as usual. If you want a
different context menu for different treeview branches then at runtime,
use the Treeviewselectionchanged handler to re-assign it. Somehting like
I've done below.

Cheers,

Geoff

METHOD TreeViewSelectionChanged(oTreeViewSelectionEvent) CLASS
SQLSplitWindow

LOCAL oTVI AS TreeViewItem
LOCAL cDatabase AS STRING
LOCAL symItem AS SYMBOL

SUPER:TreeViewSelectionChanged(oTreeViewSelectionEvent)

oTVI := SELF:oObjectTV:GetSelectedItem()
IF oTVI != NULL_OBJECT
DebugOutputNoTrace("Treeview selection changed")
symItem := oTreeViewSelectionEvent:NewTreeviewItem:Value
IF SELF:oObjectTV:ContextMenu != NULL_OBJECT
SELF:oObjectTV:ContextMenu:Destroy()
SELF:oObjectTV:ContextMenu := NULL_OBJECT
ENDIF

DO CASE
CASE symItem = TV_SERVER
SELF:oObjectTV:ContextMenu := ServerContextMenu{}
IF SELF:oCurrConnection:FixedDatabase
SELF:oObjectTV:ContextMenu:DeleteItem(#AttachDatabase)
SELF:oObjectTV:ContextMenu:DeleteItem(#DetachDatabase)
SELF:oObjectTV:ContextMenu:DeleteItem(#DuplicateDatabase)
ENDIF

CASE symItem = TV_DB
cDatabase := oTVI:TextValue
SELF:oObjectTV:ContextMenu := DatabaseContextMenu{}