[SC]: Load custom layout

Features wanted...
Post Reply
binocular222
Posts: 1423
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

[SC]: Load custom layout

Post by binocular222 »

Something like:

Code: Select all

Layout("<xydata>\Columns\mylayout.txt", "load")
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [SC]: Load custom layout

Post by admin »

Yes, good idea.

binocular222
Posts: 1423
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: [SC]: Load custom layout

Post by binocular222 »

Just have a second thought.
Layout would be a bad name as it refer to position of Address Bar, Toolbar.
Combine into setcolumns("<xydata>\Columns\mylayout.txt", "flag=load") would make sense
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [SC]: Load custom layout

Post by admin »

Too late. Haven't you seen that I already added it?

Code: Select all

v14.00.0113 - 2014-05-11 20:52
    + Scripting got a new function.
      Name: ColumnLayout
      Action: Loads or saves a column layout.
      Syntax: columnlayout(file, [mode="load"])
        file:     File to save the column layout to, or to load it from.
                  Either full path or resolved relative to <xydata>\Columns\.
                  If missing you are prompted by a standard Windows dialog.
                  If no extension is passed the extension defaults to ".txt".
        mode:
          load = [Default] load columns from file
          save = save columns to file
        return:   The column loaded or saved.
      Examples:
        columnlayout("default"); //loads columns from <xydata>\Columns\Default.txt
        columnlayout("default", "save"); //saves columns to <xydata>\Columns\Default.txt
        columnlayout(); //loads columns, file is prompted
        columnlayout(, "save"); //saves columns, file is prompted

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [SC]: Load custom layout

Post by admin »

BTW, I added this simple script in a Catalog Item called "Column Layout". It allows me to quickly load a Column Layout from all Column Layouts I have saved so far:

Code: Select all

$cs = listfolder("<xydata>\Columns", "*.txt", 5);
  $cs = replace($cs, ".txt", "");
  $c = popupmenu($cs);
  if ($c) {columnlayout($c)};

FluxTorpedoe
Posts: 906
Joined: 05 Oct 2011 13:15

Re: [SC]: Load custom layout

Post by FluxTorpedoe »

Hi'
I just upgraded from v14 to v14.00.0116 — to see if there was a hidden MakeAlien( :bug: ) command… :mrgreen:
So sorry if I'm a little late with my question about Column Layouts (Menu and SC).

First I must stress that I'm a big fan of these features (an old wish if you recall ;) ).

That being said, I'm a bit surprised by the complete removal of the old "no-questions-asked" default layout management via Menu and #377.
I can understand that the previous Menu may have been confusing to some, but as powerful as the new Menu and SC are, they miss the straightforward access of #377 (with "transparent" loading for List and Search) — or am I missing something?

• "Default Column Layouts" and "Custom Column Layouts" are complementary, so could'nt they still coexist?
Via, e.g. (if you don't want to keep the old "Save/Load Column Layout"):
columnlayout() // No arguments = Load default (previous "Load Saved Column Layout")
columnlayout( , "save") // No file arguments = Save default (previous "Save Column Layout")
And their corresponding quick commands (the old #377 and #378).

• Bonus Wish
While we're at it, this would be great too: :wink:
columnlayout(file, [mode="load"], [type="file|value"])

Code: Select all

$Col = "Path.150,+Name.180";
columnlayout($Col, "save", "v");
columnlayout($Col, , "v");
Have a nice day & Thanks for your attention, 8)
Flux

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [SC]: Load custom layout

Post by admin »

Too much trouble over the years so I wanted to get rid of them. :)

Bonus wish: SetColumns is the command for this job.

FluxTorpedoe
Posts: 906
Joined: 05 Oct 2011 13:15

Re: [SC]: Load custom layout

Post by FluxTorpedoe »

admin wrote:Too much trouble over the years so I wanted to get rid of them.
Well, that's kind of a valid argument… ;)
I'll update my scripts then!

As for the SetColumns, of course!…
Which leads me to a related question: since it's possible to autosize specific columns, could there be way to store that in the full Columns info?
e.g. with a "?" after the dot instead of a number:
setcolumns("+Path.140,+Name.?,+Size.?", 3);

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [SC]: Load custom layout

Post by admin »

Interesting idea! Maybe something for later...


Post Reply