Инструменты пользователя

Инструменты сайта


en:documentation:movebutton_examples

Examples

This page contains various examples of using the plugin.

Copy/Move Dialog modificatons

An example of defining a move with switching for a 32-bit and 64-bit system, as in the default scheme in TC 9.5.x:

If %AUTORUN_TCARCH% = 32 Then 
AddDialog DIALOG_COPYMOVE
# TButton1 visible only in the copy/move dialogs
# add condition to exclude link create dialog
# and dialogs of plugins load/unload and FTP
AddCondition /VISIBLE:1 "TButton" 1
AddControl /X:17 /Y:-74 /W:-20 "TButton" 2
AddControl /X:109 "TButton" 1
AddControl /X:109 "TButton" 3 
AddControl /X:109 "TButton" 4 
AddControl /X:109 "TButton" 5 

AddDialog DIALOG_COPYMOVE_PINNED
AddControl /X:109 "TButton" 1
AddControl /X:109 "TButton" 3 
AddControl /X:109 "TButton" 4 
AddControl /X:109 "TButton" 5 

Else

AddDialog DIALOG_COPYMOVE
AddCondition /EXISTS:1 "Button" 7
AddControl /X:17 /Y:-73 /W:-20 "Button" 3
AddControl /X:109 "Button" 7
AddControl /X:109 "Button" 2 
AddControl /X:109 "Button" 6 
AddControl /X:109 "Button" 5 

AddDialog DIALOG_COPYMOVE_PINNED
AddControl /X:109 "Button" 12
AddControl /X:109 "Button" 7 
AddControl /X:109 "Button" 11 
AddControl /X:109 "Button" 10 
Endif 

ModifyDialogs

Example of specifying a move, as in the scheme with the /NARROW option (only for TC9.2.x 32-bit version):

AddDialog /X:58 /W:-116 DIALOG_COPYMOVE
AddCondition /VISIBLE:1 "TButton" 2
AddControl /X:-93 /Y:-74 /W:-20 "TButton" 3
AddControl /X:-116 /Y:1 "TButton" 1
AddControl /W:-116 "TMyComboBox" 1
AddControl /W:-114 "TMyComboBox" 2
AddControl /X:-111 "TMyCheckBox" 1
AddControl /W:-101 "TMyCheckBox" 3
AddControl /W:-114 "TMyGroupBox" 1

AddDialog DIALOG_COPYMOVE_POST
AddControl /W:-114 "TMyComboBox" 1
AddControl /W:-114 "TCheckBox" 1
AddControl /W:-114 "TCheckBox" 2
AddControl /W:-114 "TCheckBox" 3

AddDialog /X:58 /W:-116 DIALOG_COPYMOVE_PINNED
AddControl /W:-113 "TMyGroupBox" 1
AddControl /W:-113 "TMyComboBox" 1
AddControl /W:-116 "TMyComboBox" 2
AddControl /W:-113 "TMyComboBox" 3
AddControl /X:-116 /Y:1 "TButton" 1
AddControl /X:-110 "TMyCheckBox" 1
AddControl /W:-113 "TCheckBox" 1
AddControl /W:-113 "TCheckBox" 2
AddControl /W:-113 "TCheckBox" 3

ModifyDialogs

With buttons evenly distributed across the width of the dialog (TC 9.5.x, 32-bit version) (by BeTeP):

AddDialog DIALOG_COPYMOVE 
AddControl /X:0 /Y:-1 /W:-11 "TMyComboBox" 2 
AddControl /X:0 /Y:-1 /W:-11 "TMyComboBox" 1 
AddControl /X:-1 /Y:-1 /W:17 "TButton" 5 
AddCondition /VISIBLE:1 "TButton" 1 
AddControl /X:17 /Y:-1 /W:17 "TButton" 1 
AddControl /X:36 /Y:-1 /W:35 "TButton" 4 
AddControl /X:72 /Y:-1 /W:37 "TButton" 3 
AddControl /X:-35 /Y:-75 /W:-10 "TButton" 2 
AddControl /X:0 /Y:1 "TMyCheckBox" 2 
AddControl /X:-79 /Y:1 "TMyCheckBox" 1 
AddControl /X:4 /W:-5 "TMyGroupBox" 1 
AddDialog DIALOG_COPYMOVE_POST 
AddControl /W:-10 "TMyComboBox" 1 
AddDialog DIALOG_COPYMOVE_PINNED 
AddControl /X:0 /Y:-1 /W:-11 "TMyComboBox" 3 
AddControl /X:0 /Y:-1 /W:-11 "TMyComboBox" 2 
AddControl /X:-1 /Y:-1 /W:17 "TButton" 5 
AddControl /X:17 /Y:-1 /W:17 "TButton" 1 
AddControl /X:36 /Y:-1 /W:35 "TButton" 4 
AddControl /X:72 /Y:-1 /W:37 "TButton" 3 
AddControl /X:0 /Y:1 TMyCheckBox 2 
AddControl /X:-79 /Y:1 "TMyCheckBox" 1 
AddControl /X:4 /W:-5 "TMyGroupBox" 1 
AddControl /W:-10 "TMyComboBox" 1

Corrected button width (for 32-bit version) (by Flasher):

AddDialog /W:-6 DIALOG_COPYMOVE 
AddCondition /VISIBLE:1 "TButton" 1 
AddControl /X:-3 /W:-3 TMyComboBox 2 
AddControl /X:-3 /W:-3 TMyComboBox 1 
AddControl /X:-3 TMyCheckBox 2 
AddControl /X:1 TMyCheckBox 1 
AddControl /X:-3 /Y:-2 /W:-8 TButton 5 
AddControl /X:-11 /Y:-2 /W:-8 TButton 1 
AddControl /X:-19 /Y:-2 /W:11 TButton 4 
AddControl /X:-99 /Y:-2 /W:-9 TButton 2 
AddControl /X:95 /Y:-2 /W:12 TButton 3 
AddControl /X:1 /W:-4 TMyGroupBox 1 
AddDialog DIALOG_COPYMOVE_POST 
AddControl /X:1 TBitBtn 1 
AddControl /W:-3 TMyComboBox 1 
AddDialog /W:-6 DIALOG_COPYMOVE_PINNED 
AddControl /X:-3 /W:-3 TMyComboBox 2 
AddControl /X:-3 /W:-3 TMyComboBox 3 
AddControl /X:-3 TMyCheckBox 2 
AddControl /W:-3 TMyComboBox 1 
AddControl /X:2 TMyCheckBox 1 
AddControl /X:-6 TMyCheckBox 3 
AddControl /X:-3 /Y:-3 /W:-8 TButton 5 
AddControl /X:-11 /Y:-3 /W:-8 TButton 1 
AddControl /X:-19 /Y:-3 /W:11 TButton 4 
AddControl /X:95 /Y:-3 /W:12 TButton 3 
AddControl /X:1 /W:-4 TMyGroupBox 1 
AddControl /X:1 TBitBtn 1

Other dialogs

An example of correcting the dialogue by Shift + F4 to swap the Tree and OK buttons. For TC 9.2.x, 32 and 64 bit versions.

If %AUTORUN_TCARCH% = 32 Then 
AddDialog "TCOMBOINPUT"
AddCondition /TEXT "TButton" 1 "Tree"
AddControl /X:132 /W:-20 "TButton" 1
AddControl /X:-124 "TButton" 3
Else
AddDialog "TCOMBOINPUT"
AddCondition /TEXT "Button" 1 "Tree"
AddControl /X:134 /W:-20 "Button" 1
AddControl /X:-124 "Button" 3
Endif

ModifyDialogs

Different dialogs example. Demonstrate:

  • use conditions for dialogs with the same class;
  • reading text that used for filtering from the language files;
  • possible save settings.

Code for TC 9.2.x 32-bit version. (by Flasher):

IniRead /R LNG %COMMANDER_INI% Configuration LanguageIni
If %LNG% = '' Then 
  Set ExpandSelection "Expand selection" 
  Set CustomFields "Custom fields by file type" 
  Set ListerPlugins "Lister plugins" 
  Set ContentPlugins "Content plugins" 
  Set IntAssoc "Internal Associations" 
  Set Tree Tree 
  Set Edit "Edit/View"
  Set Plugins Plugins 
  Set Packer Packer
  Set Font Font 
  Set DefineColors "Define colors by file type" 
  Set FSplugins "File system plugins" 
Else 
  LngRead ExpandSelection 18 '%COMMANDER_PATH%\Language\%LNG%' 
  LngRead CustomFields 1589 
  LngRead ListerPlugins 1593 
  LngRead ContentPlugins 1595 
  LngRead IntAssoc 1722 
  LngRead Tree 5002 
  LngRead Edit 5102 
  StrPart Packer "%Edit%" \n 9   
  StrPart Edit "%Edit%" \n 5 
  LngRead Plugins 5360 
  LngRead Font 5844 
  StrTrim Font %Font% 
  LngRead DefineColors 6501 
  LngRead FSplugins 6841 
EndIf 

# Saving sizes of "Custom fields by file type":
AddDialog /CENTER:7 /SAVE:12 TDlgCustomColors 
AddCondition /TEXT "" 0 %CustomFields% 
# Saving sizes of "Define colors by file type": 
AddDialog /CENTER:7 /SAVE:12 TDlgCustomColors 
AddCondition /TEXT "" 0 %DefineColors% 
# Saving sizes of "Internal Associations": 
AddDialog /CENTER:3 /SAVE:12 TDlgCustomColors 
AddCondition /TEXT "" 0 %IntAssoc% 
# Centering "Font" relatively to "Settings" with items modification:  
AddDialog /CENTER:7 "#32770" 
AddCondition /Text "" 0 %Font% 
AddCondition /VISIBLE:0 Static 4 
AddControl /H:342 ComboBox 1 
AddControl /H:50 ComboBox 2 
AddControl /H:164 ComboBox 3 
AddControl /Y:26 /H:-40 /W:-84 Button 4 
AddControl /W:0 /X:600 /Y:30 Static 6 
AddControl /Y:30 Static 7 
AddControl /Y:30 ComboBox 5 
AddControl /X:194 /Y:-20 SysLink 1 
# Increasing and saving height of "Expand selection": 
AddDialog /CENTER:2 /H:600 TCOMBOINPUT 
AddCondition /TEXT "" 0 %ExpandSelection% 
AddControl /H:600 TMyListBox 1 
AddControl /Y:600 TButton 1 
AddControl /Y:600 TButton 2 
AddControl /Y:600 TButton 3 
# Swap buttons Tree and OK in the create file dialog (Shift+F4): 
AddDialog TCOMBOINPUT 
AddCondition /TEXT TButton 1 %Tree% 
AddControl /X:132 /W:-20 TButton 1 
AddControl /X:-124 TButton 3 
# Don't change dialog of directory creation: 
AddDialog TCOMBOINPUT 
AddCondition /EXISTS:0 TButton 3 
# Changing height of "Filter..." dialog:  
AddDialog /CENTER:2 /H:600 TCOMBOINPUT 
AddCondition /TEXT "" 0 "Total Commander" 
AddControl /H:600 TMyListBox 1 
AddControl /Y:600 TButton 1 
AddControl /Y:600 TButton 2 
AddControl /Y:600 TButton 3 
# Saving sizes of "Choose command": 
AddDialog /WAIT:40 /SAVE:15 TCmdSelForm 
# Saving sizes of "File Associations":  
AddDialog /CENTER:7 /SAVE:12 TASSOCIATEDLG 
AddCondition /TEXT /PARENT TMyPanel 1 %Plugins% 
AddDialog /CENTER:7 /SAVE:12 TASSOCIATEDLG 
AddCondition /TEXT /PARENT TMyPanel 1 %Packer% 
AddDialog /CENTER:7 /SAVE:12 TASSOCIATEDLG 
AddCondition /TEXT /PARENT TMyPanel 1 %Edit% 
AddDialog /CENTER:7 /SAVE:12 TASSOCIATEDLG 
# Saving sizes of "File system plugins" 
AddDialog /CENTER:7 /SAVE:12 TFsPluginConfigForm 
AddCondition /TEXT "" 0 %FSplugins% 
# Saving sizes of "Lister plugins" 
AddDialog /CENTER:7 /SAVE:12 TFsPluginConfigForm 
AddCondition /TEXT "" 0 %ListerPlugins% 
# Saving sizes of "Content plugins" 
AddDialog /CENTER:7 /SAVE:12 TFsPluginConfigForm 
AddCondition /TEXT "" 0 %ContentPlugins% 

ModifyDialogs
en/documentation/movebutton_examples.txt · Последние изменения: 2020/05/31 16:30 — loopback

Инструменты страницы