tlaButton
Process Enhanced Button Actions

CodeWright® - API Macro - Royalty Free - 2005.01.01 17:15
Send Comments

Purpose

Process Enhanced Button Actions.

This function adds new capabilities to CodeWrightn.

This function is designed to be assigned to multiple buttons.

Operation

Avail

When tlaButton("avail") is invoked, an error message is dispalyed in the message area and the system console beeps.

Comp

If the Compact button is struck in the distributed version of CodeWright the active window will be placed in Compact mode if Routines has been run against the buffer. If you strike the button a second time, nothing happens. To return to Normal mode you must hit the Esc key.

When tlaButton("comp") is invoked it checks the current mode of the display and if it is in Compact mode it is set to Normal and if in Hexadecimal or Normal mode it runs Routines and then sets the display to Compact.

You can continue to use the Starbase (Routines function) and (Esc key) if you prefer.

With tlaButton("comp") assigned to a button, strike the button ...

  • If the display was in Compact mode it will be changed to Normal mode.
  • If the display was in Hexadecimal or Normal mode, Routines will be run against the buffer and the window will be changed to Compact mode.

Hex

If the Hex button is struck in the distributed version of CodeWright the active window will be placed in Hexadecimal mode. If you strike the button a second time, nothing happens. To return to Normal mode you must hit the Esc key.

When tlaButton("hex") is invoked it checks the current mode of the display and if it is in Hexadecimal mode it is set to Normal and if in Compact or Normal mode it is set to Hexadecimal.

You can continue to use the Starbase (Esc key) if you prefer.

With tlaButton("hex") assigned to a button, strike the button ...

  • If the display was in Hexadecimal mode it will be changed to Normal mode.
  • If the display was in Compact or Normal mode it will be changed to Hexadecimal mode.

Line or Numb

tlaButton("line") or tlaButton("line") toggles the display of line numbers in the current buffer. If the line numbers are shown in the current buffer they are hidden. If the line numbers are hidden in the current buffer they are shown.

Tab

tlaButton("tab") toggles the display between the "new" Tabbed mode and the traditional MDI mode.

Vis

tlaButton("vis") toggles the display of invisible characters in the current buffer. If the invisible characters are shown in the current buffer they are hidden. If invisible characters are hidden in the current buffer they are shown.

WYSIWYG

tlaButton("wysiwyg") toggles the display of WYSIWYG "toolbar" in the current buffer. If the "toolbar" was not originally displayed it is made visible (just as if you had hit an F5 key). If the "toolbar" is displayed the "change bit" is checked in the buffer. If the "change bit" is on you are prompted for permission to write the buffer to disk. The "toolbar is then made invisible.

Note that the DLL version of this function will maintain the window size and location in addition to the cursor position within the window. This functionality is (unfortunately) not available in the API macro version.

Example

tlaButton( "avail" )
tlaButton( "comp" )
tlaButton( "hex" )
tlaButton( "line" )
tlaButton( "numb" )
tlaButton( "tab" )
tlaButton( "vis" )
tlaButton( "wysiwyg" )

Input Parameters

Parm Name Code Meaning
1 Type "avail" Issue 'unassigned" error message.
"comp" Toggle Compact mode.
"hex" Toggle Hexadecimal mode.
"line" Toggle Line Numbers.
"numb" Toggle Line Numbers.
"tab" Toggle Tabbed Display.
"vis" Toggle Inviisble Characters.
"wysiwyg" Toggle WYSIWYG "toolbar".

Return Codes

Mode Message
WinDisplayMode "comp" and "hex" normal completion
WinSysFlags "line" or "numb" normal completion
SysFlags "tab" normal completion
0 "vis" normal completion
-1 tlaButton: No function assigned.
-1 tlaButton: no paramater present.
-1 tlaButton: Paramater not "avail", "comp", "hex", "line", "numb", "tab", "vis", or "wysiwyg".
-1 tlaButton: Paramater not "avail" or "vis".

Reference

This function calls tlaError.

Compatibility

Current version verified under:

  • CodeWright 7.5.2
  • CodeWright for .NET 7.0 does not support some of the functions.

CodeWright for .NET Restriction

Only "avail" and "vis" are supported by CodeWright for .NET.

Installation

There are three primary methods for installing this macro on your system. Method A uses the tlaMDE tool available for purchase from this website. Method B manipulates the macro repository directly. Method C uses the API Macro... tool provided in every copy of CodeWright (but not CodeWright for .NET).

Method A - tlaMDE - CodeWright or CodeWright for .NET

  • Select the Code button on this page.
  • When the second window opens, select all the text in the text box.
  • Issue Ctl-C (copy).
  • Create a new file in CodeWright or CodeWright for .NET.
  • Issue Ctl-V (paste).
  • Issue tlaMDE C (save and compile).

Method B - Copy to Repository - CodeWright or CodeWright for .NET

  • Select the Code button on this page.
  • When the second window opens, select all the text in the text box for a macro.
  • Issue Ctl-C (copy).
  • Load the macro repository "cwright.mac" from your CodeWright or CodeWright for .NET root:
  • issue Ctl-End to go to the end of file.
  • Issue Ctl-V (paste).
  • Close the file and respond yes to the write request.

Method C - API Macro ... - CodeWright Only

  • Select the Code button on this page.
  • When the second window opens, select text from the text box for a macro:
    • Do not select the [API Macro ... header line.
    • Select all other lines in the macro.
  • Issue Ctl-C (copy).
  • Open the CodeWright Tools | API Macros... dialog.
  • Press the New button.
  • Select the Edit box.
  • Issue Ctl-V (paste).
  • Double-click on the function name in the header of the macro.
  • Issue Ctl-C (copy).
  • Select the Name box.
  • Issue Ctl-V (paste).
  • Delete the trailing blank from the name.
  • Select the Save button.
  • Select the Close button.
  • Repeat this process for each macro in the text box.

Purchase

tlaTools is a Dynamic Link Library that contains most of the API macros on this website in a single easy to install package. The tlaTools DLL can be purchased by selecting the Buy button on this page.

tlaButton is included as a function in tlaTools.

Copyright © 1993-2005 Thom Little Associates, Ltd. revised 2005.01.01 17:15
One Central Square, Keene, NH 03431-3787 phone 603-357-7567