Edit Component


INTRODUCTION

The Edit component will enable you to create a single-line editor in your programs.


api92::EditComponent
  • Parameters :
    A0.l : Address of an api92_Edit structure
    A1.l : Address of the buffer
  • Return Values :
    D0.w : 0 if error. Else number of chars entered.
    D1.w : Value given in api92CB_edKeyDown function
    No other register modified

The api92_Edit structure

Format of the api92_Edit structure :

$00.w : X position
$02.w : Y position
$04.w : Max length
$06.b : Mask byte
$07.b : Flags
$08.l : If not null, address of an api92CB_edKeyDown
$0C.l : If not null, address of an api92CB_edKeyUp


$00.w ; 02.w : X Position ; Y Position
It is the (X,Y) position on the top-left corner of the Edit component, in pixels.
$04.w : Max Length
It is the maximum number of chars entered.
$06.b : Mask Byte
If this byte is not null, the edition will be masked with that byte.
$07.b : Flags
Flags enables you to use or not some caracteristics of the component. Each bit of that byte have a consequence :
xxxxxxx1 : If bit set convert in lowercase
xxxxxx1x : If bit set convert in uppercase
xxxxx1xx : If set, allow only decimal numbers

$08.l : Address of an api92CB_edKeyDown function
If this long word is not null, it must the address of an api92CB_edKeyDown callback function that will be called each time a key is pressed.

  • Parameters :
    D0.w : Scancode of key pressed
    A0.l : Address of buffer
    A6.l : Address of current api92_Edit structure used
  • Return Values :
    D0.w : If d0.w = 0, ignore that key hit. Else char to insert in the buffer
    D1.w : If d1.w = 0 continue. Else exit component

$0C.l : Address of an api92CB_edKeyUp function
If this long word is not null, it must the address of an api92CB_edKeyUp callback function that
Will be called each time a key is pressed, after insertion in the buffer.

  • Parameters :
    D0.w : Scancode of key pressed
    A0.l : Address of buffer
    A6.l : Address of current api92_Edit structure used