Hierarchical menu suggestion (OpenInsight 64-bit)
At 15 JUN 2023 04:20:48PM Bruce Cameron wrote:
Hello,
Are there any examples of how to make/create
improved hierarchical menus in OI 10
AKA
Thank,
b. cameron
603-433-0014
At 16 JUN 2023 05:05AM Carl Pates wrote:
HI Bruce,
The image you refer to shows a Windows "TreeView" control. OI10 doesn't expose this control yet (maybe 10.3?) but you can use a "TreeListBox" control to achieve something very similar - the only thing it doesn't support is drawing the lines between the nodes, but it does support the expand collapse boxes/arrows (TreeButtons property), in-place editing (ReadOnly property) and styling of individual items (colors, fonts, images etc).
Basically the TreeListBox is an enhanced version of the v9 Hierarchical ListBox, so building it is the same - you insert items prefixed by an indent number and image index. So, with that in mind, what specifically are you looking for?
Cheers
At 16 JUN 2023 03:38PM Bruce Cameron wrote:
Thanks Captain,
Windows TreeView control will be a nice addition. I do like the lines between nodes.
I am using TreeListBox now.
I also like Multi Level Navigation.
I like how you are doing it in the IDE with THE ToolBox panel. Is there and example code on how to reproduce that type?
(Side note I can never get it to 'Float').
Thanks,
Bruce
At 18 JUN 2023 05:26AM Carl Pates wrote:
Hi Bruce,
Is there and example code on how to reproduce that type?It's basically the same as a normal TreeListBox with image and indent prefixes to the items. The "header" effect is done by using an indent of "H".
It uses an ImageLIstand also uses individual images where needed (for OLE controls) (see the ITEMIMAGEX method calls at the end).
Here's the code from the toolbox (it was all done it code because it was written before the FormDes was written as such…). You'll need to look at PS_TREELISTBOX_EQUATES for some of the constants used… let me know if you need any more info.
* // Now we construct the LISTX property to put the controls into the * // toolbox, and we build a list of images that we're going to have * // to set after we've loaded the list listTypeIDs = "" listIdx = 0 listEx = "" imgList = "" catCount = fieldCount( catIDs, @fm ) for catIdx = 1 to catCount listIdx += 1; listEx<listIdx> = "0-H:" : catIDs<catIdx> * // Now we add the POINTER type at the top of each category so it's * // always handy ... listIdx += 1; listTypeIDs<listIdx> = OIW_TBX_POINTER_TYPE$ listEx<listIdx> = OIW_TBX_IMGIDX_POINTER$ : "-2:" : OIW_TBX_POINTER_LABEL$ catTypes = catList<catIdx> typeCount = fieldCount( catTypes, @vm ) for typeIdx = 1 to typeCount typeData = catTypes<0,typeIdx> listIdx += 1; listTypeIDs<listIdx> = typeData<0,0,1> listEx<listIdx> = typeData<0,0,3> : "-2:" : typeData<0,0,2> if bLen( typeData<0,0,4> ) then imgList<listIdx> = typeData<0,0,4> : @vm : typeData<0,0,5> end next next objxArray = atWindow : ".TLB_CONTROLS" propArray = "INITCOLLAPSED" dataArray = TRUE$ objxArray := @rm : atWindow : ".TLB_CONTROLS" propArray := @rm : "HOTTRACK" dataArray := @rm : TRUE$ objxArray := @rm : atWindow : ".TLB_CONTROLS" propArray := @rm : "TREEBUTTONS" dataArray := @rm : PSTRBN_ARROWS$ objxArray := @rm : atWindow : ".TLB_CONTROLS" propArray := @rm : "SHOWHEADERBUTTONS" dataArray := @rm : PSTRBN_ARROWS$ objxArray := @rm : atWindow : ".TLB_CONTROLS" propArray := @rm : "BUTTONINDENTALWAYS" dataArray := @rm : FALSE$ objxArray := @rm : atWindow : ".TLB_CONTROLS" propArray := @rm : "PADDING" dataArray := @rm : 3 objxArray := @rm : atWindow : ".TLB_CONTROLS.IMAGELIST" propArray := @rm : "COUNT" dataArray := @rm : ilRec<3> tmp = ilRec<2> if bLen( tmp ) then objxArray := @rm : atWindow : ".TLB_CONTROLS.IMAGELIST" propArray := @rm : "COLORKEY" dataArray := @rm : tmp end tmp = ilRec<1> convert @vm to @fm in tmp objxArray := @rm : atWindow : ".TLB_CONTROLS.IMAGELIST" propArray := @rm : "FILENAMES" dataArray := @rm : tmp objxArray := @rm : atWindow : ".TLB_CONTROLS" propArray := @rm : "LISTX" dataArray := @rm : listEx objxArray := @rm : atWindow : ".TLB_CONTROLS" propArray := @rm : "VALUESX" dataArray := @rm : listTypeIDs call ps_Set_Property( objxArray, propArray, dataArray, "", TRUE$ ) imgCount = fieldCount( imgList, @fm ) for imgIdx = 1 to imgCount imgInfo = imgList<imgIdx> if bLen( imgInfo ) then tmp = imgInfo<0,1> convert @tm to @vm in tmp call exec_Method( atWindow : ".TLB_CONTROLS", | "ITEMIMAGEX", | imgIdx, | LBIS_NORMAL$, | tmp : @fm : imgInfo<0,2> ) end next call exec_Method( atWindow : ".TLB_CONTROLS", "EXPAND", 1, 1 )
At 18 JUN 2023 05:31PM Barry Stevens wrote:
Thanks Captain,
Windows TreeView control will be a nice addition. I do like the lines between nodes.
I am using TreeListBox now.
I also like Multi Level Navigation.
I like how you are doing it in the IDE with THE ToolBox panel. Is there and example code on how to reproduce that type?
(Side note I can never get it to 'Float').
Thanks,
Bruce
@BruceCameron
Where is what you are refering to?