You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Tree Design Interface (PRIM_TREE.ITreeDesign)
Interface allowing Tree to communicate with its design instances
Ancestors - None

Details


The Tree design interface is a specific requirement for all Tree design reusable parts.
It provides a set of methods that can be executed by the containing Tree control, allowing the reusable part to respond to changes in the Tree.

Example


Below is a simple Tree item that populates labels with the 2 fields that are mapped in when an entry is added via *ListFields. The values are used to populate labels on the design when the OnAdd method is executed.
If an image is assigned to the item, the OnItemImageChanged method is executed, and the image for the item can be used on the design.
If the item's parent is set the item indents by 16 pixels for each level of nesting.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_PANL *implements #Prim_Tree.iTreeDesign *ListFields #ListFields) Displayposition(1) Height(52) Layoutmanager(#Table) Left(0) Tabposition(1) Top(0) Width(301)

  • Fields mapped in when the entry is added to the Tree
    Group_By Name(#ListFields) Fields(#Field1 #Field2)
    Define_Com Class(#PRIM_PANL) Name(#ImagePanel) Displayposition(1) Image(#xImageImage32) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Width(48)
    Define_Com Class(#PRIM_LABL) Name(#Title) Caption('Title') Displayposition(2) Ellipses(Word) Height(20) Left(48) Marginleft(2) Parent(#COM_OWNER) Style(#xDemoStyles) Tabposition(2) Tabstop(False) Top(0) Verticalalignment(Center) Width(251) Wordwrap(False)
    Define_Com Class(#PRIM_LABL) Name(#Caption) Caption('Caption') Displayposition(3) Ellipses(Word) Height(30) Left(48) Marginleft(2) Parent(#COM_OWNER) Tabposition(3) Tabstop(False) Top(20) Width(251)
    Define_Com Class(#Prim_tblo) Name(#Table)
    Define_Com Class(#Prim_tblo.Column) Name(#Column1) Parent(#Table) Units(Pixels) Width(48) Displayposition(1)
    Define_Com Class(#Prim_tblo.Column) Name(#Column2) Parent(#Table) Displayposition(2)
    Define_Com Class(#Prim_tblo.Row) Name(#Row1) Height(20) Parent(#Table) Units(Pixels) Displayposition(1)
    Define_Com Class(#Prim_tblo.Row) Name(#Row2) Parent(#Table) Displayposition(2)
    Define_Com Class(#Prim_tblo.item) Name(#Item1) Column(#Column1) Manage(#ImagePanel) Parent(#Table) Row(#Row1) Rowspan(2)
    Define_Com Class(#Prim_tblo.item) Name(#Item2) Column(#Column2) Manage(#Title) Parent(#Table) Row(#Row1)
    Define_Com Class(#Prim_tblo.item) Name(#Item3) Column(#Column2) Manage(#Caption) Parent(#Table) Row(#Row2)
    Mthroutine Name(OnAdd) Options(*Redefine)
    #Title := #Field1
    #Title := #Field2
    Endroutine
    Mthroutine Name(OnItemImageChanged) Help('Executed when the item "Image" property is set') Options(*redefine)
    #Image.Image <= #TreeItem.Image *As #prim_bmp
    Endroutine
    Mthroutine Name(OnItemGotParent) Help('Executed when the item "Parent" property is set') Options(*redefine)
    #TreeItem.MarginLeft := (#TreeItem.Level - 1) * 16
    Endroutine
    End_Com

    Methods

    Name

    Description

    OnAdd

    Executed when an item is added TreeItem

    OnDelete

    Executed when an item is deleted TreeItem

    OnFind

    Executed when the Find method is used Result, TreeItem, Key

    OnItemCollapsed

    Executed when the item is collapsed TreeItem

    OnItemExpanding

    Executed when the item is expanded TreeItem

    OnItemGotFocus

    Executed when the item becomes the focus item TreeItem

    OnItemGotParent

    Executed when a parent item is assigned to the item TreeItem

    OnItemGotReference

    Executed whenever a related reference is assigned to the item via the RelatedReference property TreeItem

    OnItemGotSelection

    Executed when the item becomes selected TreeItem

    OnItemImageChanged

    Executed when the item Image property is modified TreeItem

    OnItemLostFocus

    Executed when focus is assigned to another item TreeItem

    OnItemLostSelection

    Executed when the item loses selection TreeItem

    OnItemRealizing

    Executed whenever the design enters the on screen portion of the control TreeItem

    OnSort

    Executed when the Sort method is invoked on the parent list Result, TreeItem, CompareTo, Key

    OnUpdate

    Executed when the associated list entry is updated TreeItem

    See also

    All Component Classes
    Technical Reference
  • No labels