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

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


en:documentation:movebutton_about

About

The ModifyDialogs plugin is intended for minor cosmetic changes to the look of the Total Commander dialogs.

In the first versions, the plugin (formely called MoveButton) worked only with the copy/move window. Currently, up to 32 dialogs can be tracked and processed, each of which can contain up to 16 different classes of controls and up to 32 controls for each class.

For dialogs you can perform the following actions: moving and resizing the dialog itself, moving and resizing dialog controls, centering dialogs relative to the main or parent window, saving and loading dialog positions and sizes.

Please note that the plugin may not work in all dialogs (for example, it does not work in the file search dialog).

Basics

The plugin can work in two modes — simple and advanced. In simple mode, only two dialogs are corrected — copy and move. To use simple mode, just call one ModifyDialogs command, optionally with a parameter.

When working in the advanced mode, you can set an arbitrary dialog from the ones that Total Commander have. To set the dialog processing, you must first call the AddDialog command, and then one or several AddControl commands to add controls. To add the next dialog, call AddDialog with the parameters of the next dialog and add controls for it.

If you only need to perform actions on the dialog (position saving or centering), then you can skip adding controls.

After the end of adding dialogs, you need to call the ModifyDialogs command without parameters.

Since the 32-bit and 64-bit versions of Total Commander use different classes of controls, to support both versions you need to make two sets in the Autorun configuration and load it depending on the version of the program.

To define classes, instances of controls and visible text for a filter, it is convenient to use the Au3Info program from the Autoit3 distribution. To view the dialog structure and performing basic tests over controls, you can use InqSoft Window Scanner. Of course, this is just for example, you can use your favorite tools.

Some examples of using the plugin in the advanced mode can be found on the examples page.

Filtering by condition

In order for the plugin to work with different dialogs that have the same class, it is possible to add additional conditions using the AddCondition command. Unfortunately, it is not always possible to reliably establish differences programmatically, such dialogues will be treated as one and the same dialog.

When using several dialogs with one class to which conditions are applied, it must be remembered that if for some dialogue it was not possible to find a condition, it must be set after dialogs for which there are conditions are set. Then if none of the conditions in the previous dialogs work, the dialogue without a condition will be used.

Conditions for different dialogs should be selected in such a way that they distinguish the dialogue from others to the maximum extent. Ambiguity arises when a condition, explicitly defined for one dialogue, can be explicitly or implicitly fulfilled for another, which is higher.

An example of ambiguity in the use of conditions:

# Filter dialog: 
AddDialog "TCOMBOINPUT" 
AddCondition /TEXT "" 0 "Total Commander" 

# Create folder dialog: 
AddDialog "TCOMBOINPUT" 
AddCondition /EXISTS:0 "TButton" 3

In this code, the second dialog will always be treated as a filter dialog, since it also has the title «Total Commander». To eliminate ambiguity, you need to add the condition of the button existence to the first dialog, or swap the dialogs.

# Filter dialog: 
AddDialog "TCOMBOINPUT" 
AddCondition /TEXT "" 0 "Total Commander" 
AddCondition /EXISTS:1 "TButton" 3

# Create folder dialog: 
AddDialog "TCOMBOINPUT" 
AddCondition /EXISTS:0 "TButton" 3

Now, the filter dialog will be found only if in addition to the «Total Commander» header there is a button TButton3. Accordingly, the second dialog will also be found, since the TButton3 button does not exist in it. The title search condition does not matter in this case, but it may be necessary if a third dialog with the TCOMBOINPUT class will be added.

# Create folder dialog: 
AddDialog "TCOMBOINPUT" 
AddCondition /EXISTS:0 "TButton" 3

# Filter dialog: 
AddDialog "TCOMBOINPUT" 
AddCondition /TEXT "" 0 "Total Commander" 

In this embodiment, the directory creation dialog will be found, since the TButton3 button does not exist in it, and it exists in the filter dialog.

en/documentation/movebutton_about.txt · Последние изменения: 2019/06/20 16:38 (внешнее изменение)

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