Page tree
Skip to end of metadata
Go to start of metadata

Introduction

A Toolbox is a set of buttons, ordered by columns and rows.
It is similar to the Dialogs Checkboxes control, but in a Toolbox only one button at a time can be active.

See also: Dialogs Statebox, Dialogs Checkboxes

Usage

The only way to read the status of a toolbox control is via the VBS User Interface Event Handlers.

Properties

Only properties unique to this control type are listed. For general properties, see the Properties page.

Properties
Name Type Remark Script
type Integer must be 6 (or CT_TOOLBOX, if using constants) -
style Integer (constant) Display options:
  • 0 (ST_LEFT)  : Text is left-aligned.
  • 1 (ST_RIGHT)  : Text is right-aligned.
  • 2 (ST_CENTER)  : Text is centered.
-
colorText Color Color of text when not selected. -
colorTextSelect Color Color of the text when selected. -
colorTextDisable Color No effect, but must be present. -
color Color Color of the selection box when the control isn't active.
No effect in V2.x+
-
colorSelect Color Color of the selection box when the control is active.
No effect in V2.x+
-
colorDisable Color Color of the selection box when the control is disabled.
No effect in V2.x+
-
rows Integer Number of rows to display. -
columns Integer Number of columns to display. -
strings Array of String Text for each toolbox entry. -

Example

Will create example as shown at top of this page.

Open with createDialog "Dlg"

class Dlg {
  idd = 20000;
  movingEnable = 1;

  class controls {
    class TOOLBOX {
      type = 6; // CT_TOOLBOX
      style = 2; // ST_LEFT
      idc = 20000;
    
      x = 0.8; y = 0.15;
      w = 0.2; h = 0.15;
      
      colorText[] = {1, 0, 0, 1};
      colorTextSelect[] = {0, 1, 0, 1};
      color[] = {0, 1, 1, 1};   
      colorSelect[] = {0, 0, 1, 1};
      colorTextDisable[] = {0, 0, 0, 0};
      colorDisable[] = {0.4, 0.4, 0.4, 1};
    	
      font = "TahomaB";
      sizeEx = 0.02;
    	
      rows = 3;
      columns = 2;
      strings[] = {"Entry 1","Entry 2","Entry 3","Entry 4","Entry 5","Entry 6"};
    
      onToolBoxSelChanged = "hint format[""Toolbox change:\n%1\nEntry#:%2"",(_this select 0),(_this select 1)];"
    };
  };  
};