CheckBox Component


The CheckBox component draw nice checkboxes, checked or unchecked.

  • Parameters :
    A0.l : Address of an api92_CheckBox structure
  • Return Values :
    No register modified

The api92_CheckBox structure

Format of the api92_CheckBox structure :

$00.b : 1 = Checked / 0 = unchecked
$01.b : Style Index
$02.b : X position
$03.b : Y position
(…) : 0-terminated string

$00.b : Checked or not checked
If set to 1, it will be checked, if set to 0, if will be unchecked
$01.b : Style index
The api92 offers currently four different styles. So this byte can be 0, 1, 2, or 3.
$02.b ; 03.b : X Position ; Y Position
It is the (X,Y) position on the top-left corner of the Menu component, in pixels.
$04.x : 0-terminated string
It is the string to draw with the checkbox sprite


You will find a very simple example in the file graphics\checkbox.asm.

;--------------------- Includes ---------------------

          include "tios.h"
          include "api92.h"
          include "api92cst.h"

;------------ Start of assembly program -------------

          xdef _main
          xdef _comment

_main:    moveq.w #1,d0
          jsr api92::SetFont

          lea cb_1(PC),a0
          jsr api92::CheckBoxComponent

          jsr api92::WaitKey


;------------------- Program Data -------------------

cb_1:     dc.b   1,0,10,20,"Style 1",0

_comment  dc.b   "CheckBoxes Examples",0

;-------------------- End of program ------------------