Author Topic: Move tab to left/right on the same Panel - shortcut  (Read 16897 times)

vsudakou

  • Newbie
  • *
  • Posts: 7
    • View Profile
Move tab to left/right on the same Panel - shortcut
« on: April 10, 2017, 13:58:59 »
Hi,

Currently changing of order of tabs on the same Panel can be done using mouse (drag&drop).

Is it possible to move active tab to left/right relatively to nearby tabs by shortcut?

Thanks.

AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: Move tab to left/right on the same Panel - shortcut
« Reply #1 on: April 10, 2017, 16:03:24 »
Does this reply to your earlier question not work for this situation?

http://forum.multicommander.com/forum/index.php/topic,1969.0.html

vsudakou

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Move tab to left/right on the same Panel - shortcut
« Reply #2 on: April 10, 2017, 19:11:45 »
Does this reply to your earlier question not work for this situation?

http://forum.multicommander.com/forum/index.php/topic,1969.0.html

@AlanJB, yes - I didn't find appropriate command between "Custom Commands". And I didn't find any hint in documentation whether it's possible to change an order of tabs in panel using scripting...
Maybe there is some not documented way to achieve that?

Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 555
  • Old Skull
    • View Profile
Re: Move tab to left/right on the same Panel - shortcut
« Reply #3 on: April 10, 2017, 19:39:54 »
vsudakou
If it's impossible to reorder, you may swap paths of two tabs.

1. Get current path (e.g. path1)
2. Switch to next (prev) tab and get its path (e.g. path2)
3. Set current tab's path to path1
4. Get back to prev tab and set it's path to path2
5. Go again to next tab if needed.

Maybe it's not as beautiful as it could be, but must be enough as a temp. solution

vsudakou

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Move tab to left/right on the same Panel - shortcut
« Reply #4 on: April 10, 2017, 20:18:00 »
vsudakou
If it's impossible to reorder, you may swap paths of two tabs.

1. Get current path (e.g. path1)
2. Switch to next (prev) tab and get its path (e.g. path2)
3. Set current tab's path to path1
4. Get back to prev tab and set it's path to path2
5. Go again to next tab if needed.

Maybe it's not as beautiful as it could be, but must be enough as a temp. solution

@Jungle, thank you. That works. Here is script in case someone else needs it...

move_tab_to_right:
Code: [Select]
@var $spath1 = GetSourcePath();
MC.SetActiveTab PANEL=ACTIVE TAB=NEXT
@var $spath2 = GetSourcePath();
MC.Explorer.Goto SOURCE="{$spath1}"
MC.SetActiveTab PANEL=ACTIVE TAB=PREV
MC.Explorer.Goto SOURCE="{$spath2}"
MC.SetActiveTab PANEL=ACTIVE TAB=NEXT

move_tab_to_left
Code: [Select]
@var $spath1 = GetSourcePath();
MC.SetActiveTab PANEL=ACTIVE TAB=PREV
@var $spath2 = GetSourcePath();
MC.Explorer.Goto SOURCE="{$spath1}"
MC.SetActiveTab PANEL=ACTIVE TAB=NEXT
MC.Explorer.Goto SOURCE="{$spath2}"
MC.SetActiveTab PANEL=ACTIVE TAB=PREV