Save Multi-TAB to "re-build"

Save Multi-TAB to "re-build"

Postby Jimmy » Mon Dec 26, 2022 12:18 pm

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:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Enrico Maria Giordano » Mon Dec 26, 2022 2:18 pm

Something like this?

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

[TAB2]
...
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Antonio Linares » Mon Dec 26, 2022 4:19 pm

Dear Jimmy,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Jimmy » Tue Dec 27, 2022 7:50 am

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() )
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Antonio Linares » Tue Dec 27, 2022 9:35 am

Here you have a working example, please review Class TFolder Method AddItem() for more parameters to use:
Code: Select all  Expand view
#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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Jimmy » Tue Dec 27, 2022 10:15 am

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
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Marc Venken » Tue Dec 27, 2022 12:03 pm

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


Code: Select all  Expand view
 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.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1425
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

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

Postby Antonio Linares » Tue Dec 27, 2022 2:58 pm

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 36 guests