FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Save Multi-TAB to "re-build"
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Save Multi-TAB to "re-build"
Posted: 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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Save Multi-TAB to "re-build"
Posted: Mon Dec 26, 2022 02:18 PM

Something like this?

[TAB1]

StartLeft=C:\

StartRight=R:\

ImageLeft=NO

ImageRight=NO

VIEWLeft=1

VIEWRight=1

IcoLarge=256

IcoSmall=32

[TAB2]

...

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Save Multi-TAB to "re-build"
Posted: Mon Dec 26, 2022 04: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
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Save Multi-TAB to "re-build"
Posted: Tue Dec 27, 2022 07: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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Save Multi-TAB to "re-build"
Posted: Tue Dec 27, 2022 09:35 AM
Here you have a working example, please review Class TFolder Method AddItem() for more parameters to use:
Code (fw): Select all Collapse
#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
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Save Multi-TAB to "re-build"
Posted: 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
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Save Multi-TAB to "re-build"
Posted: 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 (fw): Select all Collapse
  XBROWSER "STATES.DBF" COLUMNS "NAME" FASTEDIT ;
   SETUP (  oBrw:bRecSelData     := { || FIELD->CODE }, ;
            oBrw:bRecSelHeader   := "CODE", ;
            oBrw:nRecSelWidth    := "CODE" )
Code (fw): Select all Collapse
  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.08 with Harbour
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Save Multi-TAB to "re-build"
Posted: Tue Dec 27, 2022 02: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

Continue the discussion