Hiding and Re-organizing elements

This forum is for eXpress++ general support.
Post Reply
Message
Author
Andy Edward
Posts: 103
Joined: Fri Sep 17, 2010 2:58 am

Hiding and Re-organizing elements

#1 Post by Andy Edward »

Hi,

Is there a way to re-organize elements after hiding one of the elements?
Untitled-1.png
Untitled-1.png (11.9 KiB) Viewed 5050 times
In my attached image, you can see that the white box after B is hidden, and I want the elements after B (C,D,E,etc) to occupy the immediate space directly under B after hiding the white box.

Code: Select all

@ 3,0 DCSTATIC ;
        TYPE XBPSTATIC_TYPE_TEXT ;
        OBJECT oStatic ;
        SIZE 30,nHEIGHT ;
        COLOR nil, COLOR_BUTTONS_BG ;
        PARENT oDlg 
        
@ 1,2 DCPUSHBUTTONXP ;
        OBJECT oInventoryButton ;
        CAPTION "A" ;
        PARENT oStatic ;
        SIZE 30-4,  1 ;
        FONT '12.Arial' ;
        COLOR COLOR_TITLE_FG, COLOR_TITLE_BG ;
        GRADIENT 2 ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y
        
@ 2,2 DCTREEROOT ;
        OBJECT oTreeRootInventory ;
        PARENT oStatic ;
        SIZE  30-4, 5  ;
        HASLINES ;
        HASBUTTONS ;
        ITEMSELECTED {|a,b,o|TreeItemSelected(o)} ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y

@ 7,2 DCPUSHBUTTONXP  ;
        OBJECT oPurchaseButton ;
        CAPTION "B" ;
        PARENT oStatic ;
        ACTION {|a,b,o| hideTreeRoot('oTreeRootPurchase',oStatic)};
        SIZE 30-4,  1 ;                   
        FONT '12.Arial' ;
        COLOR COLOR_TITLE_FG, COLOR_TITLE_BG ;
        GRADIENT 2 ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y
        
@ 8,2 DCTREEROOT ;
        OBJECT oTreeRootPurchase ;
        PARENT oStatic ;
        SIZE  30-4, 5  ;
        HASLINES ;
        HASBUTTONS ;
        ITEMSELECTED {|a,b,o|TreeItemSelected(o)} ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y    

@ 13,2 DCPUSHBUTTONXP STATIC ;
        OBJECT oAdminButton ;
        CAPTION "C" ;
        PARENT oStatic ;
        SIZE 30-4,  1 ;
        FONT '12.Arial' ;
        COLOR COLOR_TITLE_FG, COLOR_TITLE_BG ;
        GRADIENT 2 ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y
        
@ 14,2 DCTREEROOT ;
        OBJECT oTreeRootAdmin ;
        PARENT oStatic ;
        SIZE  30-4, 5  ;
        HASLINES ;
        HASBUTTONS ;
        ITEMSELECTED {|a,b,o|TreeItemSelected(o)} ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y

@ 19,2 DCPUSHBUTTONXP ;
        OBJECT oSalesButton ;
        CAPTION "D" ;
        PARENT oStatic ;
        SIZE 30-4,  1 ;
        FONT '12.Arial' ;
        COLOR COLOR_TITLE_FG, COLOR_TITLE_BG ;
        GRADIENT 2 ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y
        
@ 20,2 DCTREEROOT ;
        OBJECT oTreeRootSales ;
        PARENT oStatic ;
        SIZE  30-4, 5  ;
        HASLINES ;
        HASBUTTONS ;
        ITEMSELECTED {|a,b,o|TreeItemSelected(o)} ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y

@ 25,2 DCPUSHBUTTONXP ;
        OBJECT oCreditorsButton ;
        CAPTION "E" ;
        PARENT oStatic ;
        SIZE 30-4,  1 ;
        FONT '12.Arial' ;
        COLOR COLOR_TITLE_FG, COLOR_TITLE_BG ;
        GRADIENT 2 ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y
        
@ 26,2 DCTREEROOT ;
        OBJECT oTreeRootCreditors ;
        PARENT oStatic ;
        SIZE  30-4, 5  ;
        HASLINES ;
        HASBUTTONS ;
        ITEMSELECTED {|a,b,o|TreeItemSelected(o)} ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y 

@ 31,2 DCPUSHBUTTONXP ;
        OBJECT oDebtorsButton ;
        CAPTION "F" ;
        PARENT oStatic ;
        SIZE 30-4,  1 ;
        FONT '12.Arial' ;
        COLOR COLOR_TITLE_FG, COLOR_TITLE_BG ;
        GRADIENT 2 ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y
        
@ 32,2 DCTREEROOT ;
        OBJECT oTreeRootDebtors ;
        PARENT oStatic ;
        SIZE  30-4, 5  ;
        HASLINES ;
        HASBUTTONS ;
        ITEMSELECTED {|a,b,o|TreeItemSelected(o)} ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y 

@ 37,2 DCPUSHBUTTONXP ;
        OBJECT oCashButton ;
        CAPTION "G" ;
        PARENT oStatic ;
        SIZE 30-4,  1 ;
        FONT '12.Arial' ;
        COLOR COLOR_TITLE_FG, COLOR_TITLE_BG ;
        GRADIENT 2 ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y
        
@ 38,2 DCTREEROOT ;
        OBJECT oTreeRootCash ;
        PARENT oStatic ;
        SIZE  30-4, 5  ;
        HASLINES ;
        HASBUTTONS ;
        ITEMSELECTED {|a,b,o|TreeItemSelected(o)} ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y  

@ 43,2 DCPUSHBUTTONXP ;
        OBJECT oGLButton ;
        CAPTION "H" ;
        PARENT oStatic ;
        SIZE 30-4,  1 ;
        FONT '12.Arial' ;
        COLOR COLOR_TITLE_FG, COLOR_TITLE_BG ;
        GRADIENT 2 ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y
        
@ 44,2 DCTREEROOT ;
        OBJECT oTreeRootGL ;
        PARENT oStatic ;
        SIZE  30-4, 5  ;
        HASLINES ;
        HASBUTTONS ;
        ITEMSELECTED {|a,b,o|TreeItemSelected(o)} ;
        RESIZE DCGUI_RESIZE_REPOSONLY_Y 

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Hiding and Re-organizing elements

#2 Post by rdonnay »

I recommend looking at the Xbase++ docs for this.
XBase Parts -> XbpTreeViewItem
XBase Parts -> XbpTreeView

Add the following debugging to your app to see the heirarchy.

DCREAD GUI .. EVAL {|o|DC_ArrayView(o)}

There is no HIDE for a tree item.
You will need to use the :delItem() and :addItem() methods to manage your tree.
The eXpress train is coming - and it has more cars.

Post Reply