Page 1 of 1

Save Multi-TAB to "re-build"

Posted: Mon Dec 26, 2022 12:18 pm
by Jimmy
Hi,

i use CONFIG.INI to "Store"
[STARTPATH]
StartLeft=C:\
StartRight=R:\
ImageLeft=NO
ImageRight=NO
VIEWLeft=1
VIEWRight=1
IcoLarge=256
IcoSmall=32
this are for 1st TAB on Left and Right

now when have Multi-TAB i like to "Store" them for "re-Build" ... what Way to use :?:
DBF or INI :?:
other Solution :?:

need a Idea :idea:

Re: Save Multi-TAB to "re-build"

Posted: Mon Dec 26, 2022 2:18 pm
by Enrico Maria Giordano
Something like this?

[TAB1]
StartLeft=C:\
StartRight=R:\
ImageLeft=NO
ImageRight=NO
VIEWLeft=1
VIEWRight=1
IcoLarge=256
IcoSmall=32

[TAB2]
...

Re: Save Multi-TAB to "re-build"

Posted: Mon Dec 26, 2022 4:19 pm
by Antonio Linares
Dear Jimmy,

Please post an image for a Multi-TAB, I don't know what you mean as a Multi-TAB exactly

Re: Save Multi-TAB to "re-build"

Posted: Tue Dec 27, 2022 7:50 am
by Jimmy
hi Antonio,

when talk about "Multi-TAB" i mean TFolder() and (Add)Item of it
i can dynamic AddItem() and want to "save" it when exit App.

i do "load" CONFIG.INI at Start and "write" before exit App
but how to use [TAB1] , [TAB2] ... no Idea how to use it

---

in my Sample it is for Left and Right but i can open n-Dim on Right while have only 1 x Left ...
so i need a new Concept how to "save" and "restore" TAB ( TFolder() )

Re: Save Multi-TAB to "re-build"

Posted: Tue Dec 27, 2022 9:35 am
by Antonio Linares
Here you have a working example, please review Class TFolder Method AddItem() for more parameters to use:

Code: Select all | Expand

#include "FiveWin.ch"

function Main()

    local oDlg, oFld

    DEFINE DIALOG oDlg SIZE 400, 400

    @ 1, 1 FOLDER oFld OF oDlg PROMPTS "" SIZE 190, 180 

    ACTIVATE DIALOG oDlg CENTER ;
        ON INIT ( oFld:DelItemPos( 1 ), oFld:AddItem( "One" ), oFld:AddItem( "Two" ), oFld:AddItem( "Three" ) )

return nil

Re: Save Multi-TAB to "re-build"

Posted: Tue Dec 27, 2022 10:15 am
by Jimmy
hi Antonio,

thx for Answer.

i got AddItem() "dynamic" working which also need to "fill" Grid after Create()
your Sample show how "Static" Item can be used at ON INIT but i can have n-Dim Items

---

as i want to "save" last Session i ask which is the best Way to "load" it again at Start.

CONFIG.INI
Pro : can be edit using Notepad
Contra : might be very "big"

DBF
Pro : not limited in Size (for this Project)
Contra : need DBU to "Edit"

XML & Co ... not sure if i will be "better" for what i need

Re: Save Multi-TAB to "re-build"

Posted: Tue Dec 27, 2022 12:03 pm
by Marc Venken
I Prefer DBF and use Xbrowser("dbffile") to edit. No dbu needed.
With dbf you can organise, filter etc... the settings like you want.
Just my way of setting things up.

Code: Select all | Expand

  XBROWSER "STATES.DBF" COLUMNS "NAME" FASTEDIT ;
   SETUP (  oBrw:bRecSelData     := { || FIELD->CODE }, ;
            oBrw:bRecSelHeader   := "CODE", ;
            oBrw:nRecSelWidth    := "CODE" )

Code: Select all | Expand

  netopen("brwsetup","Code","TempXb")
  select TempXB
  set filter to brwnaam = cData
  tempXB->(dbgotop())
  hBrw:= FW_RecToHash()  // Start using Hash for all system variables  // or start using a tDatabase opject so that you can use this.

   cDbf = alltrim(hBrw["database"])  //  all var's are in this single Hash and can be used easy with names   ? hBrw["Path"] etc...

 
You know how to use them. I do it like above.

Re: Save Multi-TAB to "re-build"

Posted: Tue Dec 27, 2022 2:58 pm
by Antonio Linares
Dear Jimmy,

You could save the info into a json file and later on reload the json as a hash and use it to properly built it

You can use XBrowser( hInfo ) to easily edit it