evaluator:applicable_contexts:functions:dynamic_state

You can use the evaluator with the various command modifiers that affect the state of toolbar buttons:

  • @hideif / @showif - dynamically hide or show the button
  • @disableif / @enableif - dynamically disable or enable the button
  • @toggle - control whether the button appears checked/selected or unchecked/unselected

Note that these modifiers can also be used without the evaluator, so to use the evaluator you must begin the expression with a = character.

A number of variables are available to the evaluator in this context. Note that some are only applicable to toolbars in the standalone image viewer, and some only apply to Lister toolbars.

Variable Type Description

dest

path

The current destination path.

dest_shell

bool

True if the destination is a shell (virtual) folder hosted by Explorer, otherwise false.

expanded

uint

Returns the number of expanded directories.

fullscreen

bool

Viewer only. True if the viewer is fullscreen, otherwise false.

key_repeat

bool

True if the function was launched from a repeated key press (i.e. the key was held down).

seldirs

uint

Returns the number of selected directories.

selfiles

uint

Returns the number of selected files.

selimage

bool

Viewer only. True if an area of the image has been selected, false otherwise.

selitems

uint

Returns the total number of selected items.

source

path

The current source path.

source_shell

bool

True if the source is a shell (virtual) folder hosted by Explorer, otherwise false.

totaldirs

uint

Returns the total number of directories.

totalfiles

uint

Returns the total number of files.

totalitems

uint

Returns the total number of items.

viewmode

str

Returns the current view mode in the file display. Values are largeicons, smallicons, list, details, power, thumbnails and tiles.

As well as the above variables, you can also use evaluator functions like IsChecked and IsEnabled to query other information about the state of the Lister.

The return value from the evaluation expression will be used to determine the state. The meaning depends on the modifier in question:

  • @hideif - return true to hide the button, false to show it
  • @showif - return true to show the button, false to hide it
  • @disableif - return true to disable the button, false to enable it
  • @enableif - return true to enable the button, false to disable it
  • @toggle - return true if the button should be checked/selected, false otherwise