Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Reusable consists of a combo box with a client layout item attachment
    Define_Com Class(#PRIM_CMBX) Name(#SECT_CBX) Displayposition(1) Fixedheight(False) Height(68) Left(0) Parent(#COM_OWNER) Tabposition(1) Top(0) Width(224)
    Define_Com Class(#PRIM_CBCL) Name(#CBCL_1) Displayposition(1) Parent(#SECT_CBX) Source(#SECTION) Width(20)
    Define_Com Class(#PRIM_ATLM) Name(#ATLM_1)
    Define_Com Class(#PRIM_ATLI) Name(#ATLI_1) Attachment(Center) Manage(#SECT_CBX) Parent(#ATLM_1)
    Define_Pty Name(Section) Get(Get_Section) Set(Set_Section)
    Evtroutine Handling(#COM_OWNER.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
  • Select all entries from PSLMST and add to our combo box
    Select Fields(#SECTION) From_File(PSLMST)
    Add_Entry To_List(#SECT_CBX)
    Endselect
    Endroutine
    Ptyroutine Name(Get_Section)
    Define_Map For(*output) Class(#SECTION) Name(#o_section)
  • Default property Get.
  • Get_Entry on the combo box focus item and set the return value
    If_Ref Com(#SECT_CBX.focusitem) Is_Not(*NULL)
    Change Field(#STD_NUM) To('#SECT_CBX.FOCUSITEM.ENTRY')
    Get_Entry Number(#STD_NUM)
    Endif
    Set Com(#o_section) Value(#SECTION)
    Endroutine
    Ptyroutine Name(Set_Section)
    Define_Map For(*input) Class(#SECTION) Name(#i_section)
  • Default property Set.
  • Select_List on Combo and set focus to mathing item from input
    Selectlist Named(#SECT_CBX)
    If Cond('#SECTION *ne #I_SECTION')
    Continue
    Endif
    Set Com(#SECT_CBX.currentitem) Focus(true) Selected(true)
    Endselect
    Endroutine
    End_Com
    Form Source
    Function Options(*DIRECT)
    Begin_Com Role(*EXTENDS #PRIM_FORM) Clientheight(147) Clientwidth(492) Height(174) Left(369) Top(152)
    Define_Com Class(#PRIM_GRID) Name(#GRID) Captionnoblanklines(True) Columnbuttonheight(17) Componentversion(1) Displayposition(2) Height(128) Left(40) Parent(#COM_OWNER) Showbuttonselection(True) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(2) Top(8) Width(344)
    Define_Com Class(#PRIM_GDCL) Name(#GDCL) Displayappearance(Edit) Displayposition(1) Editappearance(ReusablePart) Editorpart(#SECTIONR) Parent(#GRID) Readonly(False) Source(#SECTION) Width(30)
    Define_Com Class(#SECTIONR) Name(#SECTIONR) Height(17) Left(8) Parent(#COM_OWNER) Tabstop(False) Top(8) Width(25)
    Evtroutine Handling(#COM_OWNER.CreateInstance) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
    Select Fields(#SECTION) From_File(PSLMST)
    Add_Entry To_List(#GRID)
    Endselect
    Endroutine
    End_Com
    Appearance Image Removed

Image Added

Note:
To allow for a section reusable part that is filtered by department you can add an event handler for the Grid.Changed event. This handler can then access another property on the reusable part that takes the department to filter by. The reusable part can then respond by updating its contents.
&<img src="../resources/images/opentoc-dark.png" title="Open Contents List" border="0"&>