Toolbar Manager

Discuss and share scripts and script files...
Post Reply

What do YOU think about this code/feature? Feedback please:

I go trying using that code, nice feature
3
60%
I will use that code as is, seems useful
2
40%
Good idea but ugly code, will code one myself
0
No votes
I have no use for this code/feature at all
0
No votes
I don't understand what this is good for
0
No votes
I don't know how to use this feature
0
No votes
This is from too limited use for me to bother with
0
No votes
I don't know how to use this code in XYplorer
0
No votes
I have no Xyplorer PRO version with scripting support
0
No votes
 
Total votes: 5

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Toolbar Manager

Post by Stefan »

Little script to work with toolbar settings, for the icons and CTB in the toolbar: save, load, set to default,...
(CTB=Customized Toolbar Button => user editable buttons)

With this script you can save the current toolbar-icons-setting to an file.
Then you can modify the toolbar by adding or removing icons for other working issues.
Later you can load the last setting or reset the toolbar to factory default.
Note that the scripts behind the CTB-Icons are stored in the XYplorer.ini.
Use "Read User Button..." to get the wanted script (copy and save them if you need)


ToolbarManager.xys Version 003 - (find a updated version below this code)

Code: Select all

// Version 001
// 11:56 Dienstag, 31. Mai 2011

// Version 002
// 07:45 01.06.2011
// convert to store settings to ini instead of single files

// Version 003
// 12:51 Samstag, 7. Januar 2012
// clean up the code


/*
How to use:
1.) Add an new CTB and add this script to it. 
2.) Save XY config via "File > Settings" to store this settings in XY ini.
3.) Execute "Save current toolbar" to store the current toolbar in user.ini.
-
4.) Modify the toolbar to suit your needs. Don't forget to add/leave an CTB with this script too.
5.) Save XY config via "File > Settings" to store this settings in XY ini.
6.) Execute "Save current toolbar" to store the current toolbar in user.ini.
-
7.) Go to 4.)
-
8.) Execute "Load saved toolbar..." to load one of the saved toolbars.
*/


"=== Toolbar Manager ==="
"Save current toolbar..."
     $myINIFile = "<xydata>\User.ini";
     
     $SectionCount = getkey( "Count", "Toolbars",  $myINIFile);
     if ($SectionCount == 20)
     {
         $iter=1;
         while($iter<$SectionCount)
         {
            $iter++;
              if (strlen($iter)==1){$iter = "0$iter";}
               $Date = getkey( $iter  . "_Date", "Toolbars",  $myINIFile);
               $Name = getkey( $iter  . "_Name", "Toolbars",  $myINIFile);
               $Valu = getkey( $iter  . "_Valu", "Toolbars",  $myINIFile);
            //---  
            $iter--;
              if (strlen($iter)==1){$iter = "0$iter";}
                  setkey($Date, $iter . "_Date",  "Toolbars", $myINIFile);
                  setkey($Comm, $iter . "_Name",  "Toolbars", $myINIFile);
                  setkey($Icon, $iter . "_Valu",  "Toolbars", $myINIFile);
            //---      
            $iter++; 
         }
         $SectionCount--;
      }
      
     $SectionCount++;
     if (strlen($SectionCount)==1){$SectionCount = "0$SectionCount";}
     $Date = "<date yyyy.mm.dd hh:nn> on %ComputerName%";
     $curTB = toolbar(); 
     $Name = Input("Save Toolbar", "Enter an NAME (or comment) for this toolbar (optional)",,"s","");
     If ($Name=="") {$Name="-";}
     
     //setkey value, key, section, [INIfile]
     setkey($SectionCount,  "count",                  "Toolbars", $myINIFile);
     setkey($Date,          $SectionCount . "_Date",  "Toolbars", $myINIFile);
     setkey($Name,          $SectionCount . "_Name",  "Toolbars", $myINIFile);
     setkey($curTB,         $SectionCount . "_Valu",  "Toolbars", $myINIFile);



"Load saved toolbar..."
     $myINIFile = "<xydata>\User.ini";

     $iter=1; 
     $SectionCount = getkey( "Count", "Toolbars",  $myINIFile);
     $array="";
     while($iter <= $SectionCount)
     {
       if (strlen($iter)==1){$iter = "0$iter";}
       $Date  = getkey( $iter . "_Date", "Toolbars",  $myINIFile);
       $Name  = getkey( $iter . "_Name", "Toolbars",  $myINIFile);
       $Valu  = getkey( $iter . "_Valu", "Toolbars",  $myINIFile);
       $array = $array . "$iter; $Date; $Name; $Valu|";
       $iter++;
     }
     
     $newTB = inputselect("Select ONE stored toolbar to load as current:",$array,,2);
     end ($newTB==""); // IF [OK] without selection==Quit, or [Cancel]==Quit
     
     $newTB = gettoken($newTB, 1, ";");
     $newTB = getkey( $newTB . "_Valu", "Toolbars",  $myINIFile);

     $TBsize = confirm("OK: <tab>big icons<crlf>Cancel: <tab>small icons") ? 1 : 0;

     toolbar("$newTB", $TBsize);

     //msg "Done. Go and save XYplorer settings via File > Settings > Save";
 

################# U P D A T E
aurumdigitus wrote:Suppose an already saved TB has had several button changes made and those changes are to be kept.
When clicking Save Current Toolbar the dialog box shows the value for $DefaultDescription.
What it ought to show is the name of the current TB (assuming it was already saved) OR $DefaultDescription.
Then the user could replace the original with an overwrite or save under a new name.
Maybe the Menu should have a Save As command which is a standard in Windows.
03 Apr 2013
I had an try, please see if this will work:
- use "Save as..." to save as new TB
- use "Update..." to Update a saved TB
aurumdigitus wrote:Is there anyway XY could display the name of the one currently in use?
I see there no way right now.
But since you work with TBs you can maybe add an icon
which represents the current used TB to each TB to load this script?
e.g. the icon on ToolBar1 could show a "TB 1" icon to load this script,
and the icon on ToolBar2 could show a "TB 2" icon to load this script,...
For the moment you can utilize "Update TB..." to see which TB is currently loaded.

ToolbarManager.xys Version 006 aurumdigitus edition
I still want to clean up the whole code and change variable names.... its a mess now.
Well, if I find some time on winter season ;-)

Code: Select all

//http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=6538&p=72090
//http://www.xyplorer.com/xyfc/viewtopic.php?p=67359#p67359

// Version 001  // 11:56 Dienstag, 31. Mai 2011
// Version 002  // 07:45 01.06.2011 // convert to store settings to ini instead of single files
// Version 003  // 12:51 Samstag, 7. Januar 2012 // clean up the code
// version 004  // 20:49 Freitag, 27. Januar 2012 ++ 25.03.2013 22:47 for  aurumdigitus
// "Delete saved toolbar..." which would invoke:"Select one or more stored toolbar(s) to DELETE:"
// >>see > http://www.xyplorer.com/xyfc/viewtopic.php?f=5&t=7436&p=67549&hilit=toolbar+manager#p67549
// version 005  // 28.03.2013 23:38 // cleaned up the code
// version 006  // 03.04.2013 19:15 // added "Update current toolbar..."

"=== Toolbar Manager ==="
"_INIT"
//// USER SETTINGS - Common settings for all scripts below:
    global $TBINIFile, $DateFormat, $DefaultDescription, $SectionName, $DateName, $NameName, $ValuName;
    global $ShowMessageAfterAction, $BackupIniBeforeDelete, $OpenIniAfterAction;
    // ---------------------------------------------------
    //Set ini file to store Toolbars:
    $TBINIFile   = "<xydata>\User.ini";
    //Use your own descriptions for Section and value lines:
    $SectionName = "Toolbars"; //name of the section of the ini
    $DateName    = "_Date";    //name of the line with the date of saving
    $NameName    = "_Name";    //name of the line with the name or description of the saving
    $ValuName    = "_Valu";    //name of the line with the value (the toolbar items)
    //Set format of date, time and hostname for saved toolbar:
    $DateFormat  = "<date yyyy.mm.dd hh:nn> on %ComputerName% as %UserName%";
    //Set default description for saved toolbar:
    $DefaultDescription = "-";
    // ---------------------------------------------------
    //Show message box after action: True/False
    $ShowMessageAfterAction = true;
    //Backup ini file before deleting items (debug mode): True/False
    $BackupIniBeforeDelete = True;
    //Open ini file after action (debug mode): True/False
    $OpenIniAfterAction = TRUE;
    // ---------------------------------------------------




//// ==================================================================================
//// ==================================================================================
//// ==================================================================================
//// THE CODE, DO NOT TOUCH if you do not know how
       
"Save as..."
    load "*", "_INIT";
    global $TBINIFile, $DateFormat, $DefaultDescription, $SectionName, $DateName, $NameName, $ValuName;
    global $ShowMessageAfterAction, $BackupIniBeforeDelete, $OpenIniAfterAction;
    $CurrentUsedTBNumb = getkey("CurrentlyUsedIndex", $SectionName, $TBINIFile);
      if($CurrentUsedTBNumb==""){
         $CurrentUsedTBName=$DefaultDescription;
      }else{
         $CurrentUsedTBName = getkey($CurrentUsedTBNumb . $NameName, $SectionName,  $TBINIFile);
         }
    $SectionCount = getkey("Count", $SectionName,  $TBINIFile);
         $SectionCount++;
         if(strlen($SectionCount)==1){$SectionCount = "0$SectionCount";}
    $Date = $DateFormat;
    $Name = Input("Save as new Toolbar", "Enter an description for this toolbar (optional)",$CurrentUsedTBName,"s","UserCancelled");
         end($Name=="UserCancelled"); // IF [OK] without selection==Quit, or [Cancel]==Quit
         //some value is mandatory!!!, otherwise the whole line is not written
         if($Name==""){$Name="-";}
    $Valu = toolbar();
    $index = $SectionCount;
    setkey $SectionCount,  "Count"                 , $SectionName, $TBINIFile,2;
    setkey $index  ,"CurrentlyUsedIndex",              $SectionName, $TBINIFile,2;
    setkey $Date        , $index . $DateName, $SectionName, $TBINIFile,2;
    setkey $Name        , $index . $NameName, $SectionName, $TBINIFile,2;
    setkey $Valu        , $index . $ValuName, $SectionName, $TBINIFile,2;
    if($OpenIniAfterAction){run notepad $TBINIFile;}

"Update..."
    load "*", "_INIT";
    global $TBINIFile, $DateFormat, $DefaultDescription, $SectionName, $DateName, $NameName, $ValuName;
    global $ShowMessageAfterAction, $BackupIniBeforeDelete, $OpenIniAfterAction;
    $CurrentUsedTBNumb = getkey("CurrentlyUsedIndex", $SectionName, $TBINIFile);
      if($CurrentUsedTBNumb==""){
         $CurrentUsedTBName=$DefaultDescription;
      }else{
         $CurrentUsedTBName = getkey($CurrentUsedTBNumb . $NameName, $SectionName,  $TBINIFile);
         }
   
         if(strlen($CurrentUsedTBNumb)==1){$CurrentUsedTBNumb = "0$SectionCount";}
    $Date = $DateFormat;
    $Topic = "Update Toolbar $CurrentUsedTBNumb, $CurrentUsedTBName";
    $Notes = "Timestamp and value will be updated, you may want to modify the description too?";
    $Name = Input($Topic, $Notes,$CurrentUsedTBName,"s","UserCancelled");
         end($Name=="UserCancelled"); // IF [OK] without selection==Quit, or [Cancel]==Quit
         //some value is mandatory!!!, otherwise the whole line is not written
         if($Name==""){$Name="-";}
    $Valu = getkey($CurrentUsedTBNumb . $ValuName  , $SectionName, $TBINIFile);
    $index = $CurrentUsedTBNumb;
    setkey $index  ,"CurrentlyUsedIndex",              $SectionName, $TBINIFile,2;
    setkey $Date        , $index . $DateName, $SectionName, $TBINIFile,2;
    setkey $Name        , $index . $NameName, $SectionName, $TBINIFile,2;
    setkey $Valu        , $index . $ValuName, $SectionName, $TBINIFile,2;
    if($OpenIniAfterAction){run notepad $TBINIFile;}
       
"Load..."
    load "*", "_INIT";
    global $TBINIFile, $SectionName, $DateName, $NameName, $ValuName;
    global $ShowMessageAfterAction, $BackupIniBeforeDelete, $OpenIniAfterAction;
    end( exists($TBINIFile)==0), "The set ini file is not found:<crlf 2> $TBINIFile" ;
    //-----------------Load Section:     
    $SectionCount = getkey("Count", $SectionName,  $TBINIFile);
    $loop = 1;
    $SectionList = "";
    while($loop <= $SectionCount){
        if (strlen($loop)==1){$loop = "0$loop";}
        $Date  = getkey($loop . $DateName, $SectionName,  $TBINIFile);
        $Name  = getkey($loop . $NameName, $SectionName,  $TBINIFile);
        $Valu  = getkey($loop . $ValuName, $SectionName,  $TBINIFile);
        $SectionList = $SectionList . "$loop;$Date;$Name;$Valu|";
        $loop++;
    }
    $WantedTB = inputselect("Select ONE stored toolbar to load as current:",$SectionList,,2);
    end ($WantedTB==""); // IF [OK] without selection==Quit, or [Cancel]==Quit
    $WantedTB = gettoken($WantedTB, 1, ";");
    setkey $WantedTB, "CurrentlyUsedIndex",       $SectionName,  $TBINIFile,2;
    $WantedTB = getkey($WantedTB . $ValuName, $SectionName,  $TBINIFile);
    $TBsize = confirm("Icon size?<crlf 2>OK: <tab>big icons<crlf>Cancel: <tab>small icons") ? 1 : 0;
    toolbar("$WantedTB", $TBsize);
    if($ShowMessageAfterAction){msg "Done. To keep this toolbar, be sure to save XYplorer settings.";}
   
"Delete..."
    load "*", "_INIT";
    global $TBINIFile, $SectionName, $DateName, $NameName, $ValuName;
    global $ShowMessageAfterAction, $BackupIniBeforeDelete, $OpenIniAfterAction;
    end(exists($TBINIFile)==0), "The set ini file is not found:<crlf 2> $TBINIFile" ;
    //-----------------Load Section:
    $SectionCount = getkey( "Count", $SectionName,  $TBINIFile);
    end($SectionCount < 1),"No items found in ini file:<crlf 2>$TBINIFile";
    $loop  = 1;
    $SectionList = "";
    while($loop <= $SectionCount){
        if (strlen($loop)==1){$loop = "0$loop";}
        $Date  = getkey($loop . $DateName, $SectionName,  $TBINIFile);
        $Name  = getkey($loop . $NameName, $SectionName,  $TBINIFile);
        $Valu  = getkey($loop . $ValuName, $SectionName,  $TBINIFile);
        $SectionList = $SectionList . "$loop;$Date;$Name;$Valu|";
        $loop++;
    }
    //-----------------Ask User which entry to delete:
    $DeleteList = inputselect("Select one or more stored toolbar(s) to DELETE:",$SectionList,,2);//"|"
    end($DeleteList==""); // IF [OK] without selection==Quit, or [Cancel]==Quit
    $DeleteCount = gettoken($DeleteList, "count", "|");
    //-----------------Get list of indices to delete
    $UserConfirmList = "";
    $DeleteIndexList = "";
    $loop = 1;
    while($loop <= $DeleteCount){
        $currLine = gettoken($DeleteList,$loop,"|");
        $pos = 0; $pos = strpos($currLine,";", $pos)+1;
        $DeleteIndexList = $DeleteIndexList . substr($currLine,0 ,$pos) . "|";
        $pos = strpos($currLine,";", $pos)+1;
        $pos = strpos($currLine,";", $pos)+1;
        $out = substr($currLine,0, $pos);
        $UserConfirmList = $UserConfirmList . $out . "<crlf>";
        $loop++;
    }
    //-----------------Let User confirm selected entries (last change to cancel):
    msg "OK, we will delete now $DeleteCount toolbars:<crlf>$UserConfirmList",1;
    if($BackupIniBeforeDelete){copyitem $TBINIFile; //automatically backup current ini}
    //-----------------Write entries to keep back to section but with new index
    $loop = 1;
    $newIndex = 0;
    while($loop <= $SectionCount){
        $currLine = gettoken($SectionList, $loop, "|");
        $currIndex = substr($currLine,0 ,2);
        if(strpos($DeleteIndexList,$currIndex) == -1){
            //current line index is not in IndexList, so keep this line
            $Date = gettoken($currLine, 2, ";");
            $Comm = gettoken($currLine, 3, ";");
            $Icon = gettoken($currLine, 4, ";");
            $newIndex++;
            if (strlen($newIndex)==1){$newIndex = "0$newIndex";}
            setkey $Date, $newIndex . $DateName, $SectionName, $TBINIFile,2;
            setkey $Comm, $newIndex . $NameName, $SectionName, $TBINIFile,2;
            setkey $Icon, $newIndex . $ValuName, $SectionName, $TBINIFile,2;
        }
        $loop++;
    }
    setkey $newIndex, "Count", $SectionName, $TBINIFile,2;
    //-----------------Delete remaining, no more needed lines from section
    while($newIndex <= $SectionCount){
        $newIndex++;
        if(strlen($newIndex)==1){$newIndex = "0$newIndex";}
        setkey "", $newIndex . $DateName, $SectionName, $TBINIFile,2;
        setkey "", $newIndex . $NameName, $SectionName, $TBINIFile,2;
        setkey "", $newIndex . $ValuName, $SectionName, $TBINIFile,2;
    }   
    if($ShowMessageAfterAction){msg "Done.  $DeleteCount toolbars deleted.";}
    if($OpenIniAfterAction){run notepad $TBINIFile;}
   
-
"Cancel"
-
"Edit this &script"
    self $ScriptFile, file;
    OpenWith "<xypath>\Tools\NotePad2\Notepad2.exe", ,$ScriptFile;
    //OpenWith "Notepad", ,$ScriptFile;
//EOF



Right click the tool bar and choose "Customize Toolbar..."
Then add an free "User Button #nn" and customize it like this:
Example how to set up an Toolbar button
Example how to set up an Toolbar button
ToolbarManager_CTB-Setup_c16.png (3.17 KiB) Viewed 4212 times
ToolbarManager.ico.XYS
The new ToolbarManager ICO (remove the ".XYS" extension. Forum limitation)
(9.44 KiB) Downloaded 347 times

New screen shot of the ToolbarManager
New screen shot of the ToolbarManager
ToolbarManager_002_c16.png (27.01 KiB) Viewed 4212 times


-

Notes:
you don't have to modify anything, just save the script to an *.xys file and load it from XYplorer.
But you can modify if you want this settings:
$myINIFile = "<xydata>\User.ini"; //the file to store the settings. You may want to edit this to "toolbars.ini" for example.
$Date = "<date yyyy.mm.dd hh:nn> %ComputerName%"; //add or remove parts of info as you like.


EDIT: add a few more infos what's about.
.
Last edited by Stefan on 13 May 2013 17:09, edited 5 times in total.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Toolbar Manager

Post by Stefan »

Toolbar Manager Add-Ons

Code: Select all

"Toggle toolbar icon size" 
    //I miss something like>    get("ToolBarIconSize");

"Set toolbar icons to small size"
    toolbar( toolbar() , 0);

"Set toolbar icons to big size"
    toolbar( toolbar() , 1);


Code: Select all


"See current toolbar as text"
    text toolbar();


"Resets toolbar to factory default"
     msg "We will go overwriting your current toolbar!
          <crlf 2>Have you saved it? Click cancel to save it first.
          <crlf 2>Click OK to reset the tool bar to factory default.",1;
     $TBsize = confirm("OK: <tab>big icons<crlf>Cancel: <tab>small icons") ? 1 : 0;
     toolbar("", $TBsize);




Code: Select all


"Add new button by an snippet"
     //http://www.xyplorer.com/xyfc/viewtopic.php?p=51737#p51737

     $a = "The following command will look for the next free user button,<crlf>
      then add it to the right end of the toolbar, and define it<crlf>
      according to the snippet from the next dialog.";
     end (confirm($a)?0:1);

     $b = <<<TEXTHEREDOC
Snip: CTB 1
  XYplorer 9.50.0002, 13.09.2010 09:00:10
Action
  NewUserButton
Name
  Various Mini Trees
Icon
  :minitree
ScriptL
  "Just two drives|:minitree" loadtree "C:|D:";
  "Just scripts|:minitree" loadtree "<xydata>\scripts";
  "Tree number three|:minitree" loadtree "%programfiles%|%temp%|<xypath>";
ScriptR

FireClick
  1
TEXTHEREDOC;

     $b = input("Enter Snippet for new toolbar button", , $b, "m");
     snippet $b;



Code: Select all


"Read user button..."
     $TB = toolbar(); $b="";
     foreach($i, $TB, ","){ if ( substr($i,0,3)=="ctb") {$b=$b$i|;} }
     $readBTN = inputselect("Select ONE:",$b,,2);
     if ( strlen($readBTN) > 5) {msg "Please select one only!"; end 1;}
     $readBTN = substr( $readBTN ,3);
     text getkey( $readBTN, "CustomButtons" );


"Read all user buttons"
     $amount = getkey( "Count", "CustomButtons" );
     $array=""; $i=1;
     while( $i <= $amount)
     {
       $array = $array . "$i=" . getkey( $i, "CustomButtons" ) . "<crlf>";
       $i++;
     }
     //text $array;
     writefile("%tmp%\XYToolBar_UserButtons.txt", $array);
     run notepad "%tmp%\XYToolBar_UserButtons.txt";


Toolbar Manager Add-Ons
Toolbar Manager Add-Ons
ToolbarManager_Add-Ons.PNG (58.91 KiB) Viewed 4413 times



.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Toolbar Manager

Post by aurumdigitus »

Had occasion to use this today maybe for the first time this year and it is no longer functioning. With recent changes to scripting has something broken?

Problem 1: Any save overwrites existing saves. Only one is kept in user.ini.

Problem 2: With Load Saved Toolbar the dialog box is empty, not even the one save bar's name shows. :(

Note - change icon size still okay.

BTW: If you can get the problem fixed did you ever think about adding a Delete operation as we once discussed?

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Toolbar Manager

Post by Stefan »

aurumdigitus wrote:BTW: If you can get the problem fixed did you ever think about adding a Delete operation as we once discussed?
Good timing :biggrin: ... a few free days now :wink: ... if i only had the fun to do this task :whistle: :mrgreen:
But i THINK every week on this todo and get an bad feeling because i am not able to get myself up and running..




aurumdigitus wrote:Had occasion to use this today maybe for the first time this year and it is no longer functioning. With recent changes to scripting has something broken?

Problem 1: Any save overwrites existing saves. Only one is kept in user.ini.
Problem 2: With Load Saved Toolbar the dialog box is empty, not even the one save bar's name shows. :(
Yes, it seems getkey() work case-sensitive now?

It seems, getkey() work case-sensitive now?
It seems, getkey() work case-sensitive now?
getkey case-sensitive.PNG (72.79 KiB) Viewed 4120 times


Perhaps because of the work with
v10.90.0105 - 2012-03-17 20:19
v10.90.0102 - 2012-03-14 13:36
?



To make the script working again change the the case of "Count" to the same
at all getkey() / setkey() places in the script.
Basically it should be one line only:

Code: Select all

setkey($SectionCount,  "count",                  "Toolbars", $myINIFile);
to:

Code: Select all

setkey($SectionCount,  "Count",                  "Toolbars", $myINIFile);



And change the case of 'count' in the user.ini as well.



Thanks for the feedback.

.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Toolbar Manager

Post by aurumdigitus »

You have my deep gratitude for your rapid detective work and then solution. You may have guessed then when the script was needed for the first time in months it was needed rather badly for some "mission critical" work. :D

It seems a shame that such a trivial (to a non-programer) change can bring things crashing down.

One question: When using Load Saved Toolbar the dialog box displays " #; date; assigned name; the toolbar pieces themselves". My recollection is that previously only the name appeared or is this just wishful thinking?

Will look forward to Delete as your time and temperament permit. :biggrin:

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Toolbar Manager

Post by Stefan »

aurumdigitus wrote:One question:

When using Load Saved Toolbar the dialog box displays " #; date; assigned name; the toolbar pieces themselves".

My recollection is that previously only the name appeared or is this just wishful thinking?
It's "wishful thinking" i guess since there was no change in the code.

This is the (cropped) relevant piece of the code:

Code: Select all

"Load saved toolbar..."
       $array = $array . "$iter; $Date; $Name; $Valu|";
As you may see, for the dialog, the index ($iter), the $Date, the $Name and the $Value are collected to provide you an meaningful dialog.



But from them only the index is really needed, as that is the part taken to get the wanted entry from the user.ini

Code: Select all

     $newTB = gettoken($newTB, 1, ";");

Well, i guess for an human the $Name -part is a good identification part also :)

So, as far my code needs the index and you wants the name, you may change this piece of code
from

Code: Select all

       $array = $array . "$iter; $Date; $Name; $Valu|";
to

Code: Select all

       $array = $array . "$iter; $Name|";
Untested, but should do the trick for you.



Take care of the trailing | as this is needed as separator in the $array for the inputselect() command.

Code: Select all

$newTB = inputselect("Select ONE stored toolbar to load as current:",$array,,2);

.

Post Reply