GUI Function Glossary
ABORT_ON_ERROR
C: ABORT_ON_ERROR
4th: ABORT_ON_ERROR
Type: Constant
Return Value: Integer
The name of a GUI Toolkit property that causes the Panel-Touch QVGA Controller to disable interrupts, stop multitasking, and send a verbose message to serial 1 when a GUI Toolkit error occurs. The error message identifies the calling method and parameters that triggered the error. Possible values of the ABORT_ON_ERROR
property are the booleans GUI_TRUE
and GUI_FALSE
. ABORT_ON_ERROR
is initialized to GUI_FALSE
by Initialize_GUI
.
Set_Property( GUI_TOOLKIT, ABORT_ON_ERROR, GUI_TRUE );
GUI_TOOLKIT ABORT_ON_ERROR GUI_TRUE Set_Property
Libraries: library.c
, library.4th
Add_Data()
C: void Add_Data ( uint plot_reference, uint data )
4th: Add_Data( u1 \ u2 – <html>|</html> u1 = plot_reference, u2 = data )
Type: Function
Input Parameters:
plot_reference
– A 16 bit reference to a plot object.data
– A 16 bit unsigned integer to be added to the plot object. Valid values are from 0 to the height of the plot object in pixels. The data represents the distance in pixels as measured from the top edge of the plot. The origin of a plot is the upper left corner of the plot object.
A method that adds a single data value into a plot object. Data is added to the next position in the circular plot buffer. The data value represents the distance in pixels as measured from the top edge of the plot (the y coordinate). The x coordinate is the position of the data value in the buffer. The x coordinate can not be changed or specified. Refresh
must be called after data is added to re-render the plot. The plot is rendered from left to right like an oscilloscope trace. Possible errors include: INVALID_PLOT
and DATA_OUT_OF_RANGE
.
Add_Data( plotVoltage, 12 );
plotVoltage @ 12 Add_Data
Libraries: library.c
, library.4th
AVAILABLE_HEAP_SPACE
C: AVAILABLE_HEAP_SPACE
4th: AVAILABLE_HEAP_SPACE
Type: Constant
Return Value: Integer
The name of a GUI Toolkit property that returns the available bytes remaining in the GUI Heap. This property is read only.
longHeapSpace = Get_Property(GUI_TOOLKIT,AVAILABLE_HEAP_SPACE);
GUI_TOOLKIT AVAILABLE_HEAP_SPACE Get_Property heapSpace 2!
Libraries: library.c
, library.4th
BACKLIGHT_ON
C: BACKLIGHT_ON
4th: BACKLIGHT_ON
Type: Constant
Return Value: Integer
The name of a display property that controls the backlight on the monochrome display. This property has no effect on EL displays. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. BACKLIGHT_ON
is initialized to GUI_TRUE
by Initialize_GUI
.
Set_Property(GUI_DISPLAY,BACKLIGHT_ON,GUI_FALSE);
GUI_DISPLAY BACKLIGHT_ON GUI_FALSE Set_Property
Libraries: library.c
, library.4th
BEEP_ON_PRESS
C: BEEP_ON_PRESS
4th: BEEP_ON_PRESS
Type: Constant
Return Value: Integer
The name of a button property that beeps the buzzer when the button is pressed. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. BEEP_ON_PRESS
is initialized to GUI_TRUE
when a button is instantiated.
Set_Property ( buttonPause, BEEP_ON_PRESS, GUI_TRUE );
buttonPause @ BEEP_ON_PRESS GUI_TRUE Set_Property
Libraries: library.c
, library.4th
See also BEEP_ON_RELEASE BEEP_ON_HOLD
BEEP_ON_HOLD
C: BEEP_ON_HOLD
4th: BEEP_ON_HOLD
Type: Constant
Return Value: Integer
The name of a button property that beeps the buzzer when a button is held. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. BEEP_ON_HOLD
is initialized to GUI_FALSE
when a button is instantiated.
Set_Property ( buttonDelete, BEEP_ON_HOLD, GUI_TRUE );
ButtonDelete @ BEEP_ON_HOLD GUI_TRUE Set_Property
Libraries: library.c
, library.4th
See also BEEP_ON_RELEASE BEEP_ON_PRESS
BEEP_ON_RELEASE
C: BEEP_ON_RELEASE
4th: BEEP_ON_RELEASE
Type: Constant
Return Value: Integer
The name of a button property that beeps the buzzer when the button is released. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. BEEP_ON_RELEASE
is initialized to GUI_FALSE
when a button is instantiated.
Set_Property ( buttonPause, BEEP_ON_RELEASE, GUI_TRUE );
buttonPause @ BEEP_ON_RELEASE GUI_TRUE Set_Property
Libraries: library.c
, library.4th
See also BEEP_ON_PRESS BEEP_ON_HOLD
BEEP_TIME
C: BEEP_TIME
4th: BEEP_TIME
Type: Constant
Return Value: Integer
The name of a buzzer property that controls the length of time of a beep. The length of the BEEP_TIME
is measured using the 16-bit free running counter accessible via the register named TCNT. The units of BEEP_TIME
are in counts that are 2 microseconds long. The default BEEP_TIME
is 2 milliseconds or 1000 counts. The range of BEEP_TIME
is from 0 to 65535 or 0 to 131 milliseconds. For longer duration beeps, manually turn the buzzer on and off using the BUZZER_ON
property.
Set_Property(GUI_BUZZER, BEEP_TIME, (ulong) 2000);
GUI_BUZZER BEEP_TIME 2000 u>d Set_Property
Libraries: library.c
, library.4th
See also BUZZER_ON
BLANK_DISPLAY
C: BLANK_DISPLAY
4th: BLANK_DISPLAY
Type: Constant
Return Value: Integer
The name of a display property that blanks the display. This does not clear or unload objects from the visible screen. This is useful as a screen saver for the EL display. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. BLANK_DISPLAY
is initialized to GUI_FALSE
by Initialize_GUI
.
Set_Property(GUI_DISPLAY, BLANK_DISPLAY, GUI_TRUE);
GUI_DISPLAY BLANK_DISPLAY GUI_TRUE Set_Property
Libraries: library.c
, library.4th
BLOCK_ON_HOLD
C: BLOCK_ON_HOLD
4th: BLOCK_ON_HOLD
Type: Constant
Return Value: Integer
The name of a button property that when set, disables the servicing touchscreen events until a RELEASE_EVENT
occurs. Use this button property for repeating buttons. The final line of the hold event procedure should re-enable the servicing of events by setting the GUI_TOOLKIT
property SERVICE_EVENTS
to GUI_TRUE
.
void Delete_Event_Procedure ( void ) { ''%%//%% The Delete Button Event Procedure code would go here. ''%%//%% Reset SERVICE_EVENTS to GUI_TRUE to re-enable event servicing. ''%%//%% This should be the last thing done by the event procedure. Set_Property( GUI_TOOLKIT, SERVICE_EVENTS, GUI_TRUE); } ''%%//%% We need to capture the addresses of the event procedures which are ''%%//%% used in Set_Property to set the event procedures of buttons. #include "begin_event_procedure_pointers.h" xaddr (*delete_event_procedure_ptr)(void) = Delete_Event_Procedure; #include "end_event_procedure_pointers.h" ''%%//%% This is an example of a repeating button. buttonDelete = New_Object ( BUTTON ); Set_Property ( buttonDelete, DRAW_GRAPHIC, (long) graphicDelete); Set_Property ( buttonDelete, PRESS_GRAPHIC, (long) graphicPress ); Set_Property ( buttonDelete, RELEASE_GRAPHIC, (long) graphicDelete); Set_Property ( buttonDelete, BLOCK_ON_PRESS, GUI_TRUE ); Set_Property ( buttonDelete, BLOCK_ON_HOLD, GUI_TRUE ); Set_Property ( buttonDelete, BEEP_ON_HOLD, GUI_TRUE ); Set_Property ( buttonDelete, PRESS_EVENT_PROCEDURE, (long) delete_event_procedure_ptr ); Set_Property ( buttonDelete, HELD_EVENT_PROCEDURE, (long) delete_event_procedure_ptr );
: Delete_Event_Procedure ( %%--%% ) \ The Delete Button Event Procedure code would go here. … … … … \ Reset SERVICE_EVENTS to GUI_TRUE to re-enable event servicing. \ This should be the last thing done by the event procedure. GUI_TOOLKIT SERVICE_EVENTS GUI_TRUE Set_Property ; \ This is an example of a repeating button. BUTTON new_object buttonDelete ! buttonDelete @ DRAW_GRAPHIC graphicDelete @ u>d Set_Property buttonDelete @ PRESS_GRAPHIC graphicPress @ u>d Set_Property buttonDelete @ RELEASE_GRAPHIC graphicDelete @ u>d Set_Property buttonDelete @ BEEP_ON_HOLD GUI_TRUE Set_Property buttonDelete @ BLOCK_ON_PRESS GUI_TRUE Set_Property buttonDelete @ BLOCK_ON_HOLD GUI_TRUE Set_Property buttonDelete @ PRESS_EVENT_PROCEDURE cfa.FOR Delete_Event_Procedure Set_Property buttonDelete @ HELD_EVENT_PROCEDURE cfa.FOR Delete_Event_Procedure Set_Property
Libraries: library.c
, library.4th
See also BLOCK_ON_PRESS, BLOCK_ON_RELEASE, SERVICE_EVENTS
BORDER
C: BORDER
4th: BORDER
Type: Constant
Return Value: Integer
The name of a textbox or plot property that draws or erases a one pixel border around the object. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. BOARDER
is initialized to GUI_FALSE
when a plot or a textbox is instantiated.
Set_Property(textboxMessage, BORDER, GUI_TRUE);
textboxMessage @ BORDER GUI_TRUE Set_Property
Libraries: library.c
, library.4th
BUFFER_SIZE
C: BUFFER_SIZE
4th: BUFFER_SIZE
Type: Constant
Return Value: Integer
The name of a plot property that contains the size of the plot’s circular data buffer in bytes. The size of the buffer is limited by the amount of heap space of GUI Toolkit or 65,535, whatever is smaller. The size of the buffer must also be larger than or equal to the pixel width of the plot object. BUFFER_SIZE
is initialized to 240 when a plot is instantiated.
Set_Property(plotVoltage, BUFFER_SIZE, (ulong) 300);
plotVoltage @ BUFFER_SIZE 300 u>d Set_Property
Libraries: library.c
, library.4th
BUFFER_SIZE_OUT_OF_RANGE
C: BUFFER_SIZE_OUT_OF_RANGE
4th: BUFFER_SIZE_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates the size of a buffer for a plot object must be greater than or equal to the width of the plot in pixels.
Set_Property(plotVoltage, BUFFER_SIZE, (ulong) 200); if(Read_Error() %%==%% BUFFER_SIZE_OUT_OF_RANGE) { printf("Buffer size must be >= plot width in pixels.\n"); Clear_Error(); }
plotVoltage @ BUFFER_SIZE 200 u>d Set_Property Read_Error BUFFER_SIZE_OUT_OF_RANGE = IF CR ." Buffer size must be >= plot width in pixels." Clear_Error ENDIF
Libraries: library.c
, library.4th
BUTTON
C: BUTTON
4th: BUTTON
Type: Constant
Return Value: Integer
The name of an object type used to create a new button object. New button objects have their BEEP_ON_PRESS
property set to GUI_TRUE
.
buttonStop = New_Object( BUTTON );
BUTTON New_Object buttonStop !
Libraries: library.c
, library.4th
BUTTON_TEXTBOX
C: BUTTON_TEXTBOX
4th: BUTTON_TEXTBOX
Type: Constant
Return Value: Integer
The name of a button property that contains the textbox object reference for the button. The upper left corner of button is the same as the upper left corner of the textbox. BUTTON_TEXTBOX
is uninitialized when a button is instantiated.
Set_Property(buttonStop, BUTTON_TEXTBOX, (ulong) textboxInfo);
buttonStop @ BUTTON_TEXTBOX textboxInfo @ u>d Set_Property
Libraries: library.c
, library.4th
Buzz()
C: void Buzz ( void )
4th: Buzz ( – )
Type: Function
A method that turns on the piezo electric buzzer for a certain length of time as specified by the BEEP_TIME
property of the buzzer object. The default length is 2 milliseconds.
Buzz();
Libraries: library.c
, library.4th
See also BEEP_TIME
BUZZER_ON
C: BUZZER_ON
4th: BUZZER_ON
Type: Constant
Return Value: Integer
The name of a buzzer property used to control the buzzer. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. BUZZER_ON
is initialized to GUI_FALSE
by Initialize_GUI
.
Set_Property(GUI_BUZZER, BUZZER_ON, GUI_FALSE);
GUI_BUZZER BUZZER_ON GUI_FALSE Set_Property
Libraries: library.c
, library.4th
CAL_COORDS
C: CAL_COORDS
4th: CAL_COORDS
Type: Constant
Return Value: Integer
The name of a touchscreen property that contains the coordinates of the last touchscreen event. The y-coordinate is located in the most significant 16 bits and the x-coordinate is located in the least significant 16 bits.
longCoords = Get_Property(GUI_TOUCHSCREEN, CAL_COORDS);
GUI_TOUCHSCREEN CAL_COORDS Get_Property coords 2!
Libraries: library.c
, library.4th
Calibrate()
C: void Calibrate ( ulong point1, ulong point2, ulong point3 )
4th: Calibrate( ud1 \ ud2 \ ud3 – <html>|</html> ud1 = point1, ud2 = point2, ud3 = point3 )
Type: Function
Input Parameters:
point0
– A 32 bit number with the raw touchscreen readings from a press at point (34,19). The raw y value is located in the most significant 16 bits and the raw x value is located in the least significant 16 bits.point1
– A 32 bit number with the raw touchscreen readings from a press at point (290,123). The raw y value is located in the most significant 16 bits and the raw x value is located in the least significant 16 bits.point2
– A 32 bit number with the raw touchscreen readings from a press at point (162,219). The raw y value is located in the most significant 16 bits and the raw x value is located in the least significant 16 bits.
A method that calibrates the analog touchscreen using the raw touchscreen readings of three points. The raw touchscreen readings are obtained with the Get_Property
method and the RAW_COORDS
property. The points are chosen to avoid non-linearities (points that are not too close to the edge), minimize scaling errors (points that are not too close to each other), and yield non-redundant simultaneous equations. The raw touchscreen readings are turned into coefficients that are applied to raw touchscreen readings each time the touchscreen is pressed. The coefficients are stored into flash and an error occurs if the flash memory is write protected. Errors include: FLASH_NOT_PROGRAMMABLE
.
Calibrate( longPoint1, longPoint2, longPoint3 );
point1 2@ point2 2@ point3 2@ Calibrate
Libraries: library.c
, library.4th
Clear()
C: void Clear( uint object_reference )
4th: Clear( u – <html>|</html> u = object reference )
Type: Function
Input Parameters:
object_reference
– A 16 bit number that refers to a textbox, plot, or screen object.
A method that clears all data in the specified textbox, plot, or screen. If the object is a textbox, writes ASCII space to all positions in the textbox and sets the refresh flag to true so the textbox will be re-rendered the next time Refresh
is called. If the object is a plot, sets each cell of the plot buffer to zero and sets the refresh flag to true. so the plot will be re-rendered the next time Refresh
is called If the object is a screen, erases and unloads all objects in the screen. Refresh
does not have to be called after clearing a screen. Errors include: INVALID_OBJECT
.
Clear( GUI_SCREEN0 );
GUI_SCREEN0 Clear
Libraries: library.c
, library.4th
Clear_Error()
C: void Clear_Error ( void )
4th: Clear_Error ( – )
Type: Function
A method that sets the last reported error to NO_ERROR
. Clear_Error
should be called after Read_Error
to prevent servicing the same error more than once.
Clear_Error();
Clear_Error
Libraries: library.c
, library.4th
COLUMN_OUT_OF_RANGE
C: COLUMN_OUT_OF_RANGE
4th: COLUMN_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates the column is out of the range for the textbox used in the methods STRING_TO_TEXTBOX
and Textbox_To_String
. If this error occurs, the methods do not read or write the string to the textbox. This error also indicates that the value passed to Set_Property
when changing the number of columns in a textbox creates a textbox larger than the screen. If this error occurs, Set_Property
recovers from the error by setting number of columns to its maximum value (the screen width in pixels divided by the font width in pixels). An unchecked error occurs when a textbox that is already loaded into a screen is resized beyond the width of the screen.
Set_Property(textboxInfo, COLUMNS, (ulong) 50); if(Read_Error() %%==%% COLUMN_OUT_OF_RANGE) { printf("Column value is out of range.\n"); Clear_Error(); }
textboxInfo @ COLUMNS 50 u>d Set_Property Read_Error COLUMN_OUT_OF_RANGE = IF CR ." Column value is out of range" Clear_Error ENDIF
Libraries: library.c
, library.4th
COLUMNS
C: COLUMNS
4th: COLUMNS
Type: Constant
Return Value: Integer
The name of a textbox property that contains the number of columns in the textbox. The maximum number of columns a textbox can have is equal to the screen width in pixels divided by the font width in pixels. If a textbox uses the GUI_FONT
, which has a width of 8 pixels, the maximum number of columns the textbox can have is 40 since the screen width is 320 pixels.
Set_Property(textboxInfo, COLUMNS, (ulong) 10);
textboxInfo @ COLUMNS 10 u>d Set_Property
Libraries: library.c
, library.4th
CONTRAST
C: CONTRAST
4th: CONTRAST
Type: Constant
Return Value: Integer
The name of a display property that sets the contrast of a monochrome display. Valid values are 0 to 31. Values less than 0 and greater than 31 saturate at 0 and 31 respectively and have no additional effect on the contrast. The initial value of the contrast after Initialize_GUI
is called is 16. For larger contrast adjustments use the hardware potentiometer. This property has no effect on EL displays.
Set_Property(GUI_DISPLAY, CONTRAST, (ulong) 1);
GUI_DISPLAY CONTRAST 1 u>d Set_Property
Libraries: library.c
, library.4th
DATA_OUT_OF_RANGE
C: DATA_OUT_OF_RANGE
4th: DATA_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates the data value added to a plot object is out of range. The valid data range of a plot is from 0 to the height of the plot object in pixels. If this error occurs, the Add_Data
method recovers from the error by storing a value equal to the height of the plot object in pixels.
Add_Data(plotVoltage, 300); If(Read_Error() %%==%% DATA_OUT_OF_RANGE) { printf("Data value is out of range of the plot.\n"); Clear_Error(); }
plotVoltage @ 300 Add_Data Read_Error DATA_OUT_OF_RANGE = IF CR ." Data value is out of range of the plot." Clear_Error ENDIF
Libraries: library.c
, library.4th
DISPLAY_INITIALIZATION_FAILURE
C: DISPLAY_INITIALIZATION_FAILURE
4th: DISPLAY_INITIALIZATION_FAILURE
Type: Constant
Return Value: Integer
The name of an error that indicates there was an error initializing the display controller. This error indicates there was a hardware failure. Please contact Mosaic Industries for a Return Material Authorization.
Initialize_GUI(START_GUI_HEAP, END_GUI_HEAP); If (Read_Error() %%==%% DISPLAY_INITIALIZATION_FAILURE) { printf("Display initialization failure.\n"); Clear_Error(); }
START_GUI_HEAP END_GUI_HEAP Initialize_GUI Read_Error DISPLAY_INITIALIZATION_FAILURE = IF CR ." Display initialization failure." Clear_Error ENDIF
Libraries: library.c
, library.4th
Draw()
C: void Draw ( uint x_coordinate, uint y_coordinate )
4th: Draw ( u1 \ u2 – <html>|</html> u1 = x coordinate, u2 = y coordinate )
Type: Function
Input Parameters:
x-coordinate
– A 16 bit number that specifies the x-coordinate of the point to draw.y-coordinate
– A 16 bit number that specifies the y-coordinate of the point to draw.
A method that draws a point or line onto a screen. The screen to draw to, the type of object to draw (point or line), and the option to draw or erase, a point or a line are properties of the GUI_PEN
. To draw a line, set the LAST_COORDS
property of the GUI_PEN
as the first end point and use the coordinates passed to Draw as the second end point. Errors include: X_OUT_OF_RANGE
and Y_OUT_OF_RANGE
.
Draw(45, 63);
45 63 Draw
Libraries: library.c
, library.4th
DRAW_GRAPHIC
C: DRAW_GRAPHIC
4th: DRAW_GRAPHIC
Type: Constant
Return Value: Integer
The name of a button property that contains a reference to a graphic object that is drawn on a screen when the button is loaded. DRAW_GRAPHIC
is uninitialized when a button is instantiated.
Set_Property(buttonStop, DRAW_GRAPHIC, (ulong) graphicStop);
buttonStop @ DRAW_GRAPHIC graphicStop @ u>d Set_Property
Libraries: library.c
, library.4th
See also PRESS_GRAPHIC, RELEASE_GRAPHIC
FLASH_NOT_PROGRAMMABLE
C: FLASH_NOT_PROGRAMMABLE
4th: FLASH_NOT_PROGRAMMABLE
Type: Constant
Return Value: Integer
The name of an error that indicates there was an error writing the calibration values into flash memory. Be sure the flash is not write-protected when Calibrate
is called.
Calibrate( longPoint1, longPoint2, longPoint3); If(Read_Error() %%==%% FLASH_NOT_PROGRAMMABLE) { printf("Can’t calibrate touchscreen; flash is write-protected.\n"); Clear_Error(); }
point1 2@ point2 2@ point3 2@ Calibrate Read_Error FLASH_NOT_PROGRAMMABLE = IF CR ." Can’t calibrate touchscreen; flash is write-protected." Clear_Error ENDIF
Libraries: library.c
, library.4th
FONT
C: FONT
4th: FONT
Type: Constant
Return Value: Integer
The name of an object type used to create a new font object. Before the font is associated with a textbox, its IMAGE
must be set using the Set_Property
method.
fontTimes = New_Object( FONT );
FONT New_Object fontTimes !
Libraries: library.c
, library.4th
Get_Property()
C: ulong Get_Property ( uint object_reference, uint property )
4th: Get_Property( u1 \ u2 -- ud <html>|</html> u1 = object reference, u2 = property, ud = value )
Type: Function
Input Parameters:
object_reference
– A 16 bit number that refers to the object whose property is to be read.property
– A 16 bit number that specifies the property to get.
Return Value: A 32 bit number that contains the value of the property. All property values are 32 bits.
A method used to read the value of a property of an object. Errors include: INVALID_OBJECT
and INVALID_PROPERTY
.
longHeight = Get_Property(GUI_DISPLAY, HEIGHT_IN_PIXELS);
GUI_DISPLAY HEIGHT_IN_PIXELS Get_Property height 2!
Libraries: library.c
, library.4th
See also Set_Property
GRAPHIC
C: GRAPHIC
4th: GRAPHIC
Type: Constant
Return Value: Integer
The name of an object type used to create new graphic objects. Before a graphic is loaded into a screen or associated with a button, its IMAGE
must be set using the Set_Property
method.
graphicStop = New_Object ( GRAPHIC );
GRAPHIC New_Object graphicStop !
Libraries: library.c
, library.4th
GUI_BUZZER
C: GUI_BUZZER
4th: GUI_BUZZER
Type: Constant
Return Value: Integer
The name used to refer to the buzzer of the GUI Toolkit.
Set_Property(GUI_BUZZER, BUZZER_ON, GUI_TRUE);
GUI_BUZZER BUZZER_ON GUI_TRUE Set_Property
Libraries: library.c
, library.4th
GUI_DISPLAY
C: GUI_DISPLAY
4th: GUI_DISPLAY
Type: Constant
Return Value: Integer
The name used to refer to the display of the GUI Toolkit.
longHeight = Get_Property(GUI_DISPLAY,HEIGHT_IN_PIXELS);
GUI_DISPLAY HEIGHT_IN_PIXELS Get_Property height 2!
Libraries: library.c
, library.4th
GUI_EXISTS
C: GUI_EXISTS
4th: GUI_EXISTS
Type: Constant
Return Value: Integer
The name of an error that indicates Initialize_GUI
was called more than once.
Initialize_GUI( START_GUI_HEAP, END_GUI_HEAP); If(Read_Error() %%==%% GUI_EXISTS) { printf("Don’t initialize the GUI Toolkit more than once!\n"); Clear_Error(); }
START_GUI_HEAP END_GUI_HEAP Initialize_GUI Read_Error GUI_EXISTS = IF CR ." Don’t initialize the GUI Toolkit more than once!" Clear_Error ENDIF
Libraries: library.c
, library.4th
GUI_FALSE
C: GUI_FALSE
4th: GUI_FALSE
Type: Constant
Return Value: Long
A 32 bit constant equal to 0.
Set_Property(GUI_DISPLAY, BACKLIGHT_ON, GUI_FALSE);
GUI_DISPLAY BACKLIGHT_ON GUI_FALSE Set_Property
Libraries: library.c
, library.4th
See also GUI_TRUE
GUI_FONT
C: GUI_FONT
4th: GUI_FONT
Type: Constant
Return Value: Integer
The name used to refer to the default font of the GUI Toolkit. When Initialize_GUI
is called, the GUI Toolkit property STANDARD_FONT
is set to GUI_FONT
which is Courier New with a width of 8 pixels and a height of 10 pixels.
longWidth = Get_Property(GUI_FONT, WIDTH_IN_PIXELS);
GUI_FONT WIDTH_IN_PIXELS Get_Property fontWidth 2!
Libraries: library.c
, library.4th
GUI_PEN
C: GUI_PEN
4th: GUI_PEN
Type: Constant
Return Value: Integer
The name used to refer to the pen of the GUI Toolkit.
Set_Property(GUI_PEN, SHAPE, LINE);
GUI_PEN SHAPE LINE Set_Property
Libraries: library.c
, library.4th
GUI_resource
C: GUI_resource
4th: GUI_resource
Type: Variable
The resource variable associated with the GUI Toolkit. The resource variable should only be accessed by the functions GET
, TRY_TO_GET
, and RELEASE
. The resource variable is initialized to zero by Initialize_GUI
. This resource variable should be used if multiple tasks in an application need to use the GUI Toolkit.
Get( GUI_resource );
GUI_resource GET
Libraries: library.c
, library.4th
GUI_SCREEN0
C: GUI_SCREEN0
4th: GUI_SCREEN0
Type: Constant
Return Value: Integer
The name used to refer to screen 0 of the GUI Toolkit. The GUI Toolkit has six standard screens named GUI_SCREEN0
to GUI_SCREEN5
.
Clear( GUI_SCREEN0 );
GUI_SCREEN0 Clear
Libraries: library.c
, library.4th
GUI_SCREEN1
C: GUI_SCREEN1
4th: GUI_SCREEN1
Type: Constant
Return Value: Integer
The name used to refer to screen 1 of the GUI Toolkit. The GUI Toolkit has six standard screens named GUI_SCREEN0
to GUI_SCREEN5
.
Clear( GUI_SCREEN1 );
GUI_SCREEN1 Clear
Libraries: library.c
, library.4th
GUI_SCREEN2
C: GUI_SCREEN2
4th: GUI_SCREEN2
Type: Constant
Return Value: Integer
The name used to refer to screen 2 of the GUI Toolkit. The GUI Toolkit has six standard screens named GUI_SCREEN0
to GUI_SCREEN5
.
Clear( GUI_SCREEN2 );
GUI_SCREEN2 Clear
Libraries: library.c
, library.4th
GUI_SCREEN3
C: GUI_SCREEN3
4th: GUI_SCREEN3
Type: Constant
Return Value: Integer
The name used to refer to screen 3 of the GUI Toolkit. The GUI Toolkit has six standard screens named GUI_SCREEN0
to GUI_SCREEN5
.
Clear( GUI_SCREEN3 );
GUI_SCREEN3 Clear
Libraries: library.c
, library.4th
GUI_SCREEN4
C: GUI_SCREEN4
4th: GUI_SCREEN4
Type: Constant
Return Value: Integer
The name used to refer to screen 4 of the GUI Toolkit. The GUI Toolkit has six standard screens named GUI_SCREEN0
to GUI_SCREEN5
.
Clear( GUI_SCREEN4 );
GUI_SCREEN4 Clear
Libraries: library.c
, library.4th
GUI_SCREEN5
C: GUI_SCREEN5
4th: GUI_SCREEN5
Type: Constant
Return Value: Integer
The name used to refer to screen 5 of the GUI Toolkit. The GUI Toolkit has six standard screens named GUI_SCREEN0
to GUI_SCREEN5
.
Clear( GUI_SCREEN5 );
GUI_SCREEN5 Clear
Libraries: library.c
, library.4th
GUI_TOOLKIT
C: GUI_TOOLKIT
4th: GUI_TOOLKIT
Type: Constant
Return Value: Integer
The name used to refer to the GUI Toolkit.
Set_Property(GUI_TOOLKIT, ABORT_ON_ERROR, GUI_TRUE);
GUI_TOOLKIT ABORT_ON_ERROR GUI_TRUE Set_Property
Libraries: library.c
, library.4th
GUI_TOUCHSCREEN
C: GUI_TOUCHSCREEN
4th: GUI_TOUCHSCREEN
Type: Constant
Return Value: Integer
The name used to refer to the touchscreen of the GUI Toolkit.
longCoords = Get_Property(GUI_TOUCHSCREEN, CAL_COORDS);
GUI_TOUCHSCREEN CAL_COORDS Get_Property coords 2!
Libraries: library.c
, library.4th
GUI_TRUE
C: GUI_TRUE
4th: GUI_TRUE
Type: Constant
Return Value: Long
A 32 bit constant equal to 0xFFFFFFFF.
Set_Property(GUI_TOOLKIT, ABORT_ON_ERROR, GUI_TRUE);
GUI_TOOLKIT ABORT_ON_ERROR GUI_TRUE Set_Property
Libraries: library.c
, library.4th
See also GUI_FALSE
HEAP_FULL
C: HEAP_FULL
4th: HEAP_FULL
Type: Constant
Return Value: Integer
The name of an error that indicates the heap of the GUI Toolkit is full. No new objects can be created and existing objects can not be resized.
graphicStop = New_Object( GRAPHIC ); If(Read_Error() %%==%% HEAP_FULL) { printf("Can’t create new object, heap is full.\n"); Clear_Error(); }
GRAPHIC New_Object graphicStop ! Read_Error HEAP_FULL = IF CR ." Can’t create new object, heap is full" Clear_Error ENDIF
Libraries: library.c
, library.4th
HEIGHT_IN_PIXELS
C: HEIGHT_IN_PIXELS
4th: HEIGHT_IN_PIXELS
Type: Constant
Return Value: Integer
The name of a property that contains the height in pixels of an object.
longHeight = Get_Property(GUI_DISPLAY, HEIGHT_IN_PIXELS);
GUI_DISPLAY HEIGHT_IN_PIXELS Get_Property height 2!
Libraries: library.c
, library.4th
See also WIDTH_IN_PIXELS
HEIGHT_OUT_OF_RANGE
C: HEIGHT_OUT_OF_RANGE
4th: HIGHT_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates the height passed to Set_Property
when changing the height of a plot, creates a plot taller than the screen. If the error occurs, Set_Property
recovers from the error by setting the height of the plot equal to the height of the screen. An unchecked error occurs when a plot that is already loaded into a screen is resized beyond the height of the screen.
Set_Property(plotVoltage, HEIGHT_IN_PIXELS, (ulong) 500); If(Read_Error() %%==%% HEIGHT_OUT_OF_RANGE) { printf("Height of the plot is greater than the height of screen.\n"); Clear_Error(); }
plotVoltage @ HEIGHT_IN_PIXELS 500 u>d Set_Property Read_Error HEIGHT_OUT_OF_RANGE = IF CR ." Height of the plot is greater than the height of the screen." Clear_Error ENDIF
Libraries: library.c
, library.4th
HELD_EVENT
C: HELD_EVENT
4th: HELD_EVENT
Type: Constant
Return Value: Long
The name of a value of the touchscreen property LAST_EVENT
that indicates a user has touched the touchscreen and continues to hold it down.
If(Get_Property(GUI_TOUCHSCREEN, LAST_EVENT)%%==%%HELD_EVENT) { printf("Last touchscreen event was a held event.\n"); }
GUI_TOUCHSCREEN LAST_EVENT Get_Property HELD_EVENT d= IF CR ." Last touchscreen event was a held event." ENDIF
Libraries: library.c
, library.4th
See also PRESS_EVENT, RELEASE_EVENT, NO_EVENT
HELD_EVENT_PROCEDURE
C: HELD_EVENT_PROCEDURE
4th: HELD_EVENT_PROCEDURE
Type: Constant
Return Value: Integer
The name of a button property that contains the xcfa of a user defined held event procedure. The held event procedure is called each time the button receives a held event. Held event procedures can not take or return any parameters, but they can modify variables. HELD_EVENT_PROCEDURE
is uninitialized when a button is instantiated.
Set_Property(buttonInc, HELD_EVENT_PROCEDURE, Increment_Count)
buttonInc @ HELD_EVENT_PROCEDURE cfa.FOR Increment_Count Set_Property
Libraries: library.c
, library.4th
See also PRESS_EVENT_PROCEDURE, RELEASE_EVENT_PROCEDURE
HORIZONTAL_SNAP_TO_GRID
C: HORIZONTAL_SNAP_TO_GRID
4th: HORIZONTAL_SNAP_TO_GRID
Type: Constant
Return Value: Integer
The name of a property of the GUI Toolkit that aligns objects loaded onto a screen onto an 8 pixel horizontal grid. For speed purposes, this property can not be changed so all objects must be loaded onto 8 pixel boundaries. The only possible value of this property is the boolean GUI_TRUE
.
longFlag = Get_Property(GUI_TOOLKIT, HORIZONTAL_SNAP_TO_GRID);
GUI_TOOLKIT HORIZONTAL_SNAP_TO_GRID Get_Property flag 2!
Libraries: library.c
, library.4th
See also VERTICAL_SNAP_TO_GRID
IMAGE
C: IMAGE
4th: IMAGE
Type: Constant
Return Value: Integer
The name of a property of a graphic or font object that contains the address of the image data. The address of the image data is generated by the Mosaic’s Image Conversion Program and stored in the Image Header File.
Set_Property(graphicSTOP, IMAGE, STOP_BMP);
graphicStop @ IMAGE STOP_BMP Set_Property
Libraries: library.c
, library.4th
IN_DISPLAY
C: IN_DISPLAY
4th: IN_DISPLAY
Type: Constant
Return Value: Integer
The name of a screen property that indicates the location of the screen’s data buffer (where images are drawn into) is in the display controller. All GUI Toolkit screens have their data buffers located in the display controller. All other screens have their data buffers located in the GUI Heap. This property is read only. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
.
longFlag = Get_Property(GUI_SCREEN2, IN_DISPLAY);
GUI_SCREEN2 IN_DISPLAY Get_Property flag 2!
Libraries: library.c
, library.4th
Initialize_GUI()
C: void Initialize_GUI ( xaddr heap start, xaddr heap end )
4th: Initialize_GUI ( xaddr1 \ xaddr2 -- <html>|</html> xaddr1 = heap start, xaddr2 = heap end )
Type: Function
Input Parameters:
heap_start
– A 32 bit number that specifies the starting location of the GUI Heap. The heap must reside at a valid RAM location.heap_end
– A 32 bit number that specifies the ending location of the GUI Heap.
Initializes the GUI Toolkit by: setting up a heap for the GUI Toolkit; setting up and activating a task for the GUI Toolkit; and, configuring the display, touchscreen, GUI Screens, GUI Font, and pen objects. Error checking is performed to assure that Initialize_GUI
has not already been called. Calling any other GUI Toolkit method before calling Initialize_GUI
will crash the QVGA Controller. Errors include: GUI_EXISTS
.
Initialize_GUI( START_GUI_HEAP, END_GUI_HEAP);
START_GUI_HEAP END_GUI_HEAP Initialize_GUI
Libraries: library.c
, library.4th
INVALID_FONT
C: INVALID_FONT
4th: INVALID_FONT
Type: Constant
Return Value: Integer
The name of an error that indicates the font object associated with a textbox or the GUI Toolkit is not valid.
Set_Property(textboxMesg, TEXTBOX_FONT, (ulong) graphicStop); If (Read_Error() %%==%% INVALID_FONT) { printf("Attempted to use an invalid font for textboxMesg.\n"); Clear_Error(); }
textboxMesg @ TEXTBOX_FONT graphicStop @ u>d Set_Property Read_Error INVALID_FONT = IF CR ." Attempted to use an invalid font for textboxMesg." Clear_Error ENDIF
Libraries: library.c
, library.4th
INVALID_GRAPHIC
C: INVALID_GRAPHIC
4th: INVALID_GRAPHIC
Type: Constant
Return Value: Integer
The name of an error that indicates the graphic object associated with a button is not valid.
Set_Property(buttonStop, PRESS_GRAPHIC, (ulong) fontLarge); If (Read_Error() %%==%% INVALID_GRAPHIC) { printf("Attempted to use an invalid graphic in buttonStop.\n"); Clear_Error(); }
buttonStop @ PRESS_GRAPHIC fontLarge @ u>d Set_Property Read_Error INVALID_GRAPHIC = IF CR ." Attempted to use an invalid graphic in buttonStop." Clear_Error ENDIF
Libraries: library.c
, library.4th
INVALID_IMAGE
C: INVALID_IMAGE
4th: INVALID_IMAGE
Type: Constant
Return Value: Integer
The name of an error that indicates the address of the image data is not valid.
Set_Property(graphicStop, IMAGE, GUI_FALSE); If (Read_Error() %%==%% INVALID_IMAGE) { printf("Image for graphicStop is not valid.\n"); Clear_Error(); }
graphicStop @ IMAGE GUI_FALSE Set_Property Read_Error INVALID_IMAGE = IF CR ." Image for graphicStop is not valid." Clear_Error ENDIF
Libraries: library.c
, library.4th
INVALID_OBJECT
C: INVALID_OBJECT
4th: INVALID_OBJECT
Type: Constant
Return Value: Integer
The name of an error that indicates the object reference is not valid.
Set_Property(invalidObj, IMAGE, STOP_BMP); If (Read_Error() %%==%% INVALID_OBJECT) { printf("Attempted to set a property for an invalid object.\n"); Clear_Error(); }
invalidObject @ IMAGE STOP_BMP Set_Property Read_Error INVALID_OBJECT = IF CR ." Attempted to set a property for an invalid object." Clear_Error ENDIF
Libraries: library.c
, library.4th
INVALID_PLOT
C: INVALID_PLOT
4th: INVALID_PLOT
Type: Constant
Return Value: Integer
The name of an error that indicates the plot object reference is not valid.
Add_Data(graphicStop, 14); If (Read_Error() %%==%% INVALID_PLOT) { printf("Attempted to add data to an invalid plot object.\n"); Clear_Error(); }
graphicStop @ 14 Add_Data Read_Error INVALID_PLOT = IF CR ." Attempted to add data to an invalid plot object." Clear_Error ENDIF
Libraries: library.c
, library.4th
INVALID_PROPERTY
C: INVALID_PROPERTY
4th: INVALID_PROPERTY
Type: Constant
Return Value: Integer
The name of an error that indicates the property is not valid.
Set_Property(graphicStop, TEXTBOX_FONT, STOP_BMP); If (Read_Error() %%==%% INVALID_PROPERTY) { printf("Attempted to set an invalid property for graphicStop.\n"); Clear_Error(); }
graphicStop @ TEXTBOX_FONT STOP_BMP Set_Property Read_Error INVALID_PROPERTY = IF CR ." Attempted to set an invalid property for graphicStop." Clear_Error ENDIF
Libraries: library.c
, library.4th
INVALID_SCREEN
C: INVALID_SCREEN
4th: INVALID_SCREEN
Type: Constant
Return Value: Integer
The name of an error that indicates the screen object reference is not valid.
Load(invalidObj, graphicStop, 0, 0); If (Read_Error() %%==%% INVALID_SCREEN) { printf("Attempted to load a graphic into an invalid screen.\n"); Clear_Error(); }
invalidObj @ graphicStop @ 0 0 Load Read_Error INVALID_SCREEN = IF CR ." Attempted to load a graphic into an invalid screen." Clear_Error ENDIF
Libraries: library.c
, library.4th
INVALID_TEXTBOX
C: INVALID_TEXTBOX
4th: INVALID_TEXTBOX
Type: Constant
Return Value: Integer
The name of an error that indicates the textbox object reference is not valid.
STRING_TO_TEXTBOX(invalidObj, "hello", 0, 0); If (Read_Error() %%==%% INVALID_TEXTBOX) { printf("Attempted to write a string into an invalid textbox.\n"); Clear_Error(); }
invalidObj @ " hello" 0 0 String_To_Textbox Read_Error INVALID_TEXTBOX = IF CR ." Attempted to write a string into an invalid textbox." Clear_Error ENDIF
Libraries: library.c
, library.4th
INVERT_DISPLAY
C: INVERT_DISPLAY
4th: INVERT_DISPLAY
Type: Constant
Return Value: Integer
The name of a display property that inverts all pixels on the display. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. INVERT_DISPLAY
is set to GUI_FALSE
by Initialize_GUI
.
Set_Property(GUI_DISPLAY, INVERT_DISPLAY, GUI_TRUE);
GUI_DISPLAY INVERT_DISPLAY GUI_TRUE Set_Property
Libraries: library.c
, library.4th
LAST_COORDS
C: LAST_COORDS
4th: LAST_COORDS
Type: Constant
Return Value: Integer
The name of a pen property that contains the x and y-coordinates used with the previous call of Draw
. The y-coordinate is located in the most significant 16 bits and the x-coordinate is located in the least significant 16 bits. The contents of this property are used as the first end point of a line drawn with the Draw
method. The x and y coordinates passed to the Draw
method supply the second end point for the line.
longCoords = Get_Property(GUI_PEN, LAST_COORDS);
GUI_PEN LAST_COORDS Get_Property coords 2!
Libraries: library.c
, library.4th
LAST_EVENT
C: LAST_EVENT
4th: LAST_EVENT
Type: Constant
Return Value: Integer
The name of a touchscreen property that contains the last touchscreen event. This property is read only. Possible values of this property are NO_EVENT
, PRESS_EVENT
, HELD_EVENT
, and RELEASE_EVENT
.
longEvent = Get_Property(GUI_TOUCHSCREEN, LAST_EVENT);
GUI_TOUCHSCREEN LAST_EVENT Get_Property event 2!
Libraries: library.c
, library.4th
See also NO_EVENT, PRESS_EVENT, HELD_EVENT, RELEASE_EVENT
LINE
C: LINE
4th: LINE
Type: Constant
Return Value: Long
The name of a value of the SHAPE
property of the GUI_PEN
object. When the SHAPE
property of the GUI_PEN
object is set to LINE
, the Draw
method draws a line between the LAST_COORDS
stored in the GUI_PEN
and the specified x and y parameters.
Set_Property(GUI_PEN, SHAPE, LINE);
GUI_PEN SHAPE LINE Set_Property
Libraries: library.c
, library.4th
See also POINT
Load()
C: void Load ( uint screen_reference, uint object_reference, uint x_coordinate, uint y_coordinate )
4th: Load ( u1 \ u2 \ u3 \ u4 – <html>|</html> u1 = screen reference, u2 = object reference, u3 = x coord, u4 = y coord )
Type: Function
Input Parameters:
screen_reference
– A 16 bit variable that refers to the screen that the object specified by object_reference will be loaded into.object_reference
– A 16 bit variable that refers to an object to be loaded onto a screen.x_coordinate
– A 16 bit number that specifies the location of the left edge of the object in the horizontal direction relative to the left edge of the screen. For speed, the x-coordinate must fall on an 8 pixel boundary. The valid range for the x-coordinate depends on the width of the object. The x-coordinate must be specified so that the entire object is between 0 and 319 pixels. The origin of a screen is it’s upper left corner.y_coordinate
– A 16 bit number that specifies the location of the top of the object in the vertical direction relative to the top edge of the screen. The valid range of the y-coordinate depends on the height of the object. The y-coordinate must be specified so that the entire object is between 0 and 239 pixels. The origin of a screen is it’s upper left corner.
A method that loads an object into a screen at a specified location and renders the image of the object onto the screen. Errors include: HEAP_FULL
, INVALID_SCREEN
, INVALID_OBJECT
, X_OUT_OF_RANGE
, and Y_OUT_OF_RANGE
.
Load( GUI_SCREEN0, buttonStop, 0, 0);
GUI_SCREEN0 buttonStop @ 0 0 Load
Libraries: library.c
, library.4th
See also Un_Load
New_Object()
C: uint New_Object ( uint object_type )
4th: New_Object( u1 -- u2 <html>|</html> u1 = object type, u2 = object reference )
Type: Function
Input Parameters:
object_type
– A 16 bit number that refers to an object type. Valid object types areGRAPHIC
,FONT
,TEXTBOX
,PLOT
, andBUTTON
.
Return Value: A 16 bit number that refers to the newly created object. This number should be stored into an object reference variable which can later be used to set the properties of the object, get the properties of the object, load the object into a screen, or unload the object from a screen.
A method that creates new objects. Errors include: HEAP_FULL
and INVALID_OBJECT
.
graphicStop = New_Object( GRAPHIC );
GRAPHIC New_Object graphicStop !
Libraries: library.c
, library.4th
NO_ERROR
C: NO_ERROR
4th: NO_ERROR
Type: Constant
Return Value: Integer
The name of a constant that indicates there was no error.
Initialize_GUI(START_GUI_HEAP, END_GUI_HEAP); If(Read_Error() %%==%% NO_ERROR) { printf("No error was found.\n"); }
START_GUI_HEAP END_GUI_HEAP Initialize_GUI Read_Error NO_ERROR = IF CR ." No error was found." ENDIF
Libraries: library.c
, library.4th
NO_EVENT
C: NO_EVENT
4th: NO_EVENT
Type: Constant
Return Value: Long
The name of a value of the touchscreen property LAST_EVENT
that indicates there was no touchscreen event.
If(Get_Property(GUI_TOUCHSCREEN, LAST_EVENT)%%==%%NO_EVENT) { printf("Last touchscreen event was no event.\n"); }
GUI_TOUCHSCREEN LAST_EVENT Get_Property NO_EVENT d= IF CR ." Last touchscreen event was no event." ENDIF
Libraries: library.c
, library.4th
See also PRESS_EVENT, HELD_EVENT, RELEASE_EVENT
NUM_OBJECTS
C: NUM_OBJECTS
4th: NUM_OBJECTS
Type: Constant
Return Value: Integer
The name of a screen property that contains the number of objects currently loaded into a screen. This property is read only.
longNumObjects = Get_Property(GUI_SCREEN0, NUM_OBJECTS);
GUI_SCREEN0 NUM_OBJECTS Get_Property numObjects 2!
Libraries: library.c
, library.4th
PEN_TYPE
C: PEN_TYPE
4th: PEN_TYPE
Type: Constant
Return Value: Integer
The name of a pen property that determines whether the current shape (either a POINT
or a LINE
) is drawn or erased. Possible contents of this property include SET
and UNSET
. PEN_TYPE
is initialized to SET
by Initialize_GUI
.
Set_Property(GUI_PEN, PEN_TYPE, SET);
GUI_PEN PEN_TYPE SET Set_Property
Libraries: library.c
, library.4th
PLOT
C: PLOT
4th: PLOT
Type: Constant
Return Value: Integer
The name of an object type used to create a new plot object. New plot objects have a width of 240 pixels, a height of 120 pixels, and a buffer size for its data of 240 bytes. Plot objects can be resized using the Set_Property
method along with the WIDTH_IN_PIXELS
, HEIGHT_IN_PIXELS
, or BUFFER_SIZE
properties. Data is added to a plot buffer using the Add_Data
method. The data is rendered onto a screen from the buffer when Refresh
is called.
plotVoltage = New_Object( PLOT );
PLOT New_Object plotVoltage !
Libraries: library.c
, library.4th
POINT
C: POINT
4th: POINT
Type: Constant
Return Value: Long
The name of a value of the SHAPE
property of the GUI_PEN
object. When the SHAPE
property of the GUI_PEN
object is set to POINT
, the Draw
method draws a point or single pixel at the specified x and y location.
Set_Property(GUI_PEN, SHAPE, POINT);
GUI_PEN SHAPE POINT Set_Property
Libraries: library.c
, library.4th
See also LINE
PRESS_EVENT
C: PRESS_EVENT
4th: PRESS_EVENT
Type: Constant
Return Value: Long
The name of a value of the touchscreen property LAST_EVENT
that indicates a user has just touched the touchscreen.
If(Get_Property(GUI_TOUCHSCREEN, LAST_EVENT)%%==%%PRESS_EVENT) { printf("Last touchscreen event was a press event.\n"); }
GUI_TOUCHSCREEN LAST_EVENT Get_Property PRESS_EVENT d= IF CR ." Last touchscreen event was a press event." ENDIF
Libraries: library.c
, library.4th
See also HELD_EVENT, RELEASE_EVENT
PRESS_EVENT_PROCEDURE
C: PRESS_EVENT_PROCEDURE
4th: PRESS_EVENT_PROCEDURE
Type: Constant
Return Value: Integer
The name of a button property that contains the xcfa of a user defined press event procedure. The press event procedure is called each time the button receives a press event. Press event procedures can not take or return any parameters, but they can modify variables. PRESS_EVENT_PROCEDURE
is uninitialized when a button is instantiated.
Set_Property( buttonStop, PRESS_EVENT_PROCEDURE, Stop_Process )
buttonStop @ PRESS_EVENT_PROCEDURE cfa.FOR Stop_Process Set_Property
Libraries: library.c
, library.4th
See also HELD_EVENT_PROCEDURE, RELEASE_EVENT_PROCEDURE
PRESS_GRAPHIC
C: PRESS_GRAPHIC
4th: PRESS_GRAPHIC
Type: Constant
Return Value: Integer
The name of a button property that contains a reference to a graphic object that is drawn on a screen when the button receives a press event. PRESS_GRAPHIC
is uninitialized when a button is instantiated.
Set_Property(buttonStop, PRESS_GRAPHIC, (ulong) graphicPress);
buttonStop @ PRESS_GRAPHIC graphicPress @ u>d Set_Property
Libraries: library.c
, library.4th
See also DRAW_GRAPHIC, RELEASE_GRAPHIC
RAW_COORDS
C: RAW_COORDS
4th: RAW_COORDS
Type: Constant
Return Value: Integer
The name of a touchscreen property that contains the uncalibrated touchscreen readings of the last event. The raw coordinates are used by Calibrate
to calibrate the touchscreen. The raw y value is located in the most significant 16 bits and the raw x value is located in the least significant 16 bits. This property is read only.
longCoords = Get_Property(GUI_TOUCHSCREEN, RAW_COORDS);
GUI_TOUCHSCREEN RAW_COORDS Get_Property coords 2!
Libraries: library.c
, library.4th
Read_Error()
C: uint Read_Error ( void )
4th: Read_Error ( – u <html>|</html> u = error code )
Type: Function
Return Value: A 16 bit number that represents the last reported error.
A method that returns the last reported error. Clear_Error
should be called after this method to prevent servicing the same error more than once.
graphicStop = New_Object( GRAPHIC ); If(Read_Error() %%==%% HEAP_FULL) { printf("Can’t create new object, heap is full.\n"); Clear_Error(); }
GRAPHIC New_Object graphicStop ! Read_Error HEAP_FULL = IF CR ." Can’t create new object, heap is full." Clear_Error ENDIF
Libraries: library.c
, library.4th
Redraw()
C: void Redraw ( uint screen_reference )
4th: Redraw( u – <html>|</html> u = screen reference )
Type: Function
Input Parameters:
screen_reference
– A 16 bit number that refers to the screen object to be redrawn.
A method that redraws each object currently loaded into a screen. Does not read or modify the refresh flag of textboxes or plots. Errors include: INVALID_SCREEN
.
Redraw( GUI_SCREEN0 );
GUI_SCREEN0 Redraw
Libraries: library.c
, library.4th
Refresh()
C: void Refresh ( uint screen_reference )
4th: Refresh ( u – <html>|</html> u = screen reference )
Type: Function
Input Parameters:
screen_reference
– A 16 bit number that refers to the screen object to be refreshed.
A method that redraws only textboxes or plots loaded into the specified screen which have their refresh property set to true. The refresh property of a textbox or plot is set to true when data is added to a textbox or plot or the textbox or plot is resized or cleared. Sets the refresh flag of the textbox or plot to false once the objects have been redrawn. Errors include: INVALID_SCREEN
.
Refresh( GUI_SCREEN0 );
GUI_SCREEN0 Refresh
Libraries: library.c
, library.4th
RELEASE_EVENT
C: RELEASE_EVENT
4th: RELEASE_EVENT
Type: Constant
Return Value: Long
The name of a value of the touchscreen property LAST_EVENT
that indicates a user has just removed their finger from the touchscreen.
If(Get_Property(GUI_TOUCHSCREEN,LAST_EVENT)%%==%%RELEASE_EVENT) { printf("Last touchscreen event was a release event.\n"); }
GUI_TOUCHSCREEN LAST_EVENT Get_Property RELEASE_EVENT d= IF CR ." Last touchscreen event was a release event." ENDIF
Libraries: library.c
, library.4th
See also HELD_EVENT, PRESS_EVENT
RELEASE_EVENT_PROCEDURE
C: RELEASE_EVENT_PROCEDURE
4th: RELEASE_EVENT_PROCEDURE
Type: Constant
Return Value: Integer
The name of a button property that contains the xcfa of a user defined release event procedure. The release event procedure is called each time the button receives a release event. Release event procedures can not take or return any parameters, but they can modify variables. RELEASE_EVENT_PROCEUDRE
is uninitialized when a button is instantiated.
Set_Property( buttonRun, RELEASE_EVENT_PROCEDURE, Run_Process )
buttonRun @ RELEASE_EVENT_PROCEDURE cfa.FOR Run_Process Set_Property
Libraries: library.c
, library.4th
See also HELD_EVENT_PROCEDURE, PRESS_EVENT_PROCEDURE
RELEASE_GRAPHIC
C: RELEASE_GRAPHIC
4th: RELEASE_GRAPHIC
Type: Constant
Return Value: Integer
The name of a button property that contains a reference to a graphic object that is drawn on a screen when the button receives a release event. RELEASE_GRAPHIC
is uninitialized when a button is instantiated.
Set_Property(buttonStop, RELEASE_GRAPHIC, (ulong) graphicStop);
buttonStop @ RELEASE_GRAPHIC graphicStop @ u>d Set_Property
Libraries: library.c
, library.4th
See also DRAW_GRAPHIC, PRESS_GRAPHIC
ROW_OUT_OF_RANGE
C: ROW_OUT_OF_RANGE
4th: ROW_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates the row is out of the range for the textbox used in the methods STRING_TO_TEXTBOX
and Textbox_To_String
. If this error occurs, the methods do not read or write the string to the textbox. This error also indicates that the value passed to Set_Property
when changing the number of rows in a textbox creates a textbox taller than the screen. If this error occurs, Set_Property
recovers from the error by setting number of rows to its maximum value (the screen height in pixels divided by the font height in pixels). An unchecked error occurs when a textbox that is already loaded into a screen is resized beyond the height of the screen.
Set_Property(textboxInfo, ROWS, (ulong) 30); if(Read_Error() %%==%% ROW_OUT_OF_RANGE) { printf("Row value is out of range.\n"); Clear_Error(); }
textboxInfo @ ROWS 30 u>d Set_Property Read_Error ROW_OUT_OF_RANGE = IF CR ." Row value is out of range." Clear_Error ENDIF
Libraries: library.c
, library.4th
ROWS
C: ROWS
4th: ROWS
Type: Constant
Return Value: Integer
The name of a textbox property that contains the number of rows in the textbox. The maximum number of rows a textbox can have is equal to the screen height in pixels divided by the font height in pixels. If a textbox uses the GUI_FONT
, which has a height of 10 pixels, the maximum number of rows the textbox can have is 24 since the screen height is 240 pixels.
Set_Property(textboxInfo, ROWS, (ulong) 10);
textboxInfo @ ROWS 10 u>d Set_Property
Libraries: library.c
, library.4th
SCREEN_ADDRESS
C: SCREEN_ADDRESS
4th: SCREEN_ADDRESS
Type: Constant
Return Value: Integer
The name of a screen property that contains the extended address of the screen’s data buffer where images are drawn into. This property is read only.
longAddress = Get_Property(GUI_SCREEN0, SCREEN_ADDRESS);
GUI_SCREEN0 SCREEN_ADDRESS Get_Property address 2!
Libraries: library.c
, library.4th
SERVICE_EVENTS
C: SERVICE_EVENTS
4th: SERVICE_EVENTS
Type: Constant
Return Value: Integer
The name of a GUI Toolkit property that determines if touchscreen events are serviced and event procedures are called. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. SERVICE_EVENTS
is set to GUI_TRUE
by Initialize_GUI
.
Set_Property(GUI_TOOLKIT, SERVICE_EVENTS, GUI_FALSE);
GUI_TOOLKIT SERVICE_EVENTS GUI_FALSE Set_Property
Libraries: library.c
, library.4th
Service_GUI_Events()
C: void Service_GUI_Events ( void )
4th: Service_GUI_Events ( – )
Type: Function
A method that executes the user defined event procedures of controls. In a typical application, this method must be included in a task, separate from the GUI Toolkit’s task, as part of the tasks infinite loop to service events generated from the touchscreen.
Service_GUI_Events();
Service_GUI_Events
Libraries: library.c
, library.4th
SET
C: SET
4th: SET
Type: Constant
Return Value: Long
The name of a value of the PEN_TYPE
property of the GUI_PEN
object. When the PEN_TYPE
property of the GUI_PEN
object is SET
, the Draw
method draws (as opposed to erases) a point or a line.
Set_Property(GUI_PEN, PEN_TYPE, SET);
GUI_PEN PEN_TYPE SET Set_Property
Libraries: library.c
, library.4th
See also UNSET
Set_Property()
C: void Set_Property ( uint object_reference, uint property, ulong value )
4th: Set_Property( u1 \ u2 \ ud – <html>|</html> u1 = object reference, u2 = property, ud = value )
Type: Function
Input Parameters:
object_reference
– A 16 bit variable that refers to the object whose property is being set.property
– A 16 bit number that specifies the property to be set.value
– A 32 bit number that specifies the value of the property. All property values are 32 bits.
A method used to set the value of a property of an object. Possible errors include: INVALID_HEADER
, INVALID_OBJECT
, INVALID_PROPERTY
, INVALID_GRAPHIC
, INVALID_FONT
, INVALID_TEXTBOX
, HEIGHT_OUT_OF_RANGE
, WIDTH_OUT_OF_RANGE
, COLUMN_OUT_OF_RANGE
, and ROW_OUT_OF_RANGE
.
Set_Property(GUI_PEN, PEN_TYPE, SET);
GUI_PEN PEN_TYPE SET Set_Property
Libraries: library.c
, library.4th
See also Get_Property
SHAPE
C: SHAPE
4th: SHAPE
Type: Constant
Return Value: Integer
The name of a pen property that specifies the current shape drawn or erased by the Draw
method. Possible contents of this property are POINT
and LINE
. SHAPE
is initialized to POINT
by Initialize_GUI
.
Set_Property(GUI_PEN, SHAPE, LINE);
GUI_PEN SHAPE LINE Set_Property
Libraries: library.c
, library.4th
STANDARD_FONT
C: STANDARD_FONT
4th: STANDARD_FONT
Type: Constant
Return Value: Integer
The name of a GUI Toolkit property that contains the object reference for the font used to render textboxes. When Initialize_GUI
is called, STANDARD_FONT
is set GUI_FONT
which is Courier New with a width of 8 pixels and a height of 10 pixels. By changing the value of STANDARD_FONT
, all subsequently created textboxes will use the new font to render text (the value of the TEXTBOX_FONT
property will be set to use the new font).
Set_Property(GUI_TOOLKIT, STANDARD_FONT, (ulong) fontCustom);
GUI_TOOLKIT STANDARD_FONT fontCustom @ u>d Set_Property
Libraries: library.c
, library.4th
STRING_LENGTH_OUT_OF_RANGE
C: STRING_LENGTH_OUT_OF_RANGE
4th: STRING_LENGTH_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates the length of the string is longer than the width of the textbox for the STRING_TO_TEXTBOX
method. If this error occurs, STRING_TO_TEXTBOX
does not write any string into the textbox. This error may also indicate that the length of the string requested from the textbox is longer than 40 characters or goes beyond the end of the textbox for the Textbox_To_String
method. If this error occurs, the method recovers from the error by returning all of the characters from the specified starting row and column to the end of the textbox, up to 40 characters.
STRING_TO_TEXTBOX(textboxInfo,"A very long string",0,35); if(Read_Error() %%==%% STRING_LENGTH_OUT_OF_RANGE) { printf("String length is out of range.\n"); Clear_Error(); }
textboxInfo @ " A very long string" 0 35 String_To_Textbox Read_Error STRING_LENGTH OUT_OF_RANGE = IF CR ." String length is out of range." Clear_Error ENDIF
Libraries: library.c
, library.4th
STRING_TO_TEXTBOX()
C: void STRING_TO_TEXTBOX ( uint object_reference, char *string, uint row_of_textbox, uint column_of_textbox )
4th: String_To_Textbox ( u1 \ x$addr \ u2 \ u3 – <html>|</html> u1 = object reference, x$addr = string to write into textbox, u2 = row of textbox, u3 = column of textbox )
Type: Macro Function
Input Parameters:
object_reference
– A 16 bit value referring to the textbox that the string is written to.string
– Pointer to a character string that is to be written into the textbox.end-of-c-Libraries: string The extended string address of the string that is to be written into the textbox.row
– A 16 bit number that specifies the row of the textbox that the string is written to. The valid range of the row parameter for a textbox using theGUI_FONT
is from 0 to the number of rows of the textbox minus one. The maximum number of rows a textbox can have is 24 since the height of theGUI_FONT
is 10 pixels and the maximum height of a textbox is 240 pixels.column
– A 16 bit number that specifies the column of the textbox that the string is written to. The valid range of the column parameter for a textbox using theGUI_FONT
is from 0 to the number of columns of the textbox minus one. The maximum number of columns a textbox can have is 40 since the width of theGUI_FONT
is 8 pixels and the maximum width of a textbox is 320 pixels.
A method that writes a string into a textbox at a specified row and column location. Errors include: INVALID_TEXTBOX
, STRING_LENGTH_OUT_OF_RANGE
, ROW_OUT_OF_RANGE
, COLUMN_OUT_OF_RANGE
.
STRING_TO_TEXTBOX(textboxInfo,"Hello World",0,0);
textboxInfo @ " Hello World" 0 0 String_To_Textbox
Libraries: library.c
, library.4th
See also Textbox_To_String
TARGET_SCREEN
C: TARGET_SCREEN
4th: TARGET_SCREEN
Type: Constant
Return Value: Integer
The name of a pen property that contains the screen that the pen object renders to with the Draw
method. TARGET_SCREEN
is initialized to GUI_SCREEN0
by Initialize_GUI
.
Set_Property(GUI_PEN, TARGET_SCREEN, (ulong) GUI_SCREEN1);
GUI_PEN TARGET_SCREEN GUI_SCREEN1 u>d Set_Property
Libraries: library.c
, library.4th
TEXTBOX
C: TEXTBOX
4th: TEXTBOX
Type: Constant
Return Value: Integer
The name of an object type used to create a new textbox object. New textbox objects have 10 columns and 2 rows and use the STANDARD_FONT
to render text. Textbox objects can be resized using the Set_Property
method along with the COLUMNS
or ROWS
properties. The font of a textbox can be changed using the Set_Property
method with the TEXTBOX_FONT
property.
textboxInfo = New_Object ( TEXTBOX );
TEXTBOX New_Object textboxInfo !
Libraries: library.c
, library.4th
TEXTBOX_FONT
C: TEXTBOX_FONT
4th: TEXTBOX_FONT
Type: Constant
Return Value: Integer
The name of a textbox property that contains the object reference to the font used to render ASCII string data in a textbox onto a screen. TEXTBOX_FONT
is initialized to the STANDARD_FONT
when a textbox is instantiated. The STANDARD_FONT
is initialized to the GUI_FONT
by Initialize_GUI
. The GUI_FONT
is Courier New with a width of 8 pixels and a height of 10 pixels. Changing the STANDARD_FONT
to a custom font causes the custom font to be used as the textbox font for all subsequently created textboxes. Use this property to change the font of only one textbox.
Set_Property(textboxInfo, TEXTBOX_FONT, (ulong) fontCustom);
textboxInfo @ TEXTBOX_FONT fontCustom @ u>d Set_Property
Libraries: library.c
, library.4th
Textbox_To_String()
C: char *Textbox_To_String ( uint object_reference, uint count, uint row, uint col )
4th: Textbox_To_String ( u1 \ u2 \ u3 \ u4 -- x$addr <html>|</html> u1 = object reference, u2 = length of string, u3 = row of textbox, u4 = column of textbox )
Type: Function
Input Parameters:
object_reference
– A 16 bit variable that refers to the textbox that the string is read from.count
– The number of characters to read from the textbox. 40 is the maximum number of characters that can be read from a textbox.row
– A 16 bit number that specifies the row of the textbox that the string is read from. The valid range of the row parameter for a textbox using theGUI_FONT
is from 0 to the number of rows of the textbox minus one. The maximum number of rows a textbox can have is 24 since the height of theGUI_FONT
is 10 pixels and the maximum height of a textbox is 240 pixels.column
– A 16 bit number that specifies the column of the textbox that the string is read from. The valid range of the column parameter for a textbox using theGUI_FONT
is from 0 to the number of columns of the textbox minus one. The maximum number of columns a textbox can have is 40 since the width of theGUI_FONT
is 8 pixels and the maximum width of a textbox is 320 pixels.
Return Value: The pointer to a character string of the specified length from the row and column of the specified textbox.end-of-c-Libraries: The extended string address of the string requested from the textbox.
A method that reads up to 40 characters from a textbox at a specified row and column location. The string can wrap around the end of a line as long as it does not go beyond the last character of the last row. Errors include: INVALID_TEXTBOX
, STRING_LENGTH_OUT_OF_RANGE
, ROW_OUT_OF_RANGE
, COLUMN_OUT_OF_RANGE
.
intSetting = atoi(Textbox_To_String( textboxInfo, 4, 0, 0%%))%%;
textboxInfo @ 4 0 0 Textbox_To_String $>f \ convert string into floating point number IF \ if the conversion was successful, f. \ print out the floating point number ENDIF
Libraries: library.c
, library.4th
See also STRING_TO_TEXTBOX
UNSET
C: UNSET
4th: UNSET
Type: Constant
Return Value: Long
The name of a value of the PEN_TYPE
property of the GUI_PEN
object. When the PEN_TYPE
property of the GUI_PEN
object is UNSET
, the Draw
method erases a point or a line from a screen.
Set_Property(GUI_PEN, PEN_TYPE, UNSET);
GUI_PEN PEN_TYPE UNSET Set_Property
Libraries: library.c
, library.4th
See also SET
Un_Load()
C: void Un_Load ( uint screen_reference, uint object_reference, uint x, uint y )
4th: Un_Load ( u1 \ u2 \ u3 \ u4 – <html>|</html> u1 = screen reference, u2 = object reference, u3 = x coordinate, u4 = y coordinate )
Type: Function
Input Parameters:
screen_reference
– A 16 bit variable that refers to the screen object that the object specified by object_reference will be unloaded from.object_reference
– A 16 bit variable that refers to the object that will be unloaded from the screen.x_coordinate
– A 16 bit number that specifies the location of the left edge of the object in the horizontal direction relative to the left edge of the screen. The x-coordinate must be the same coordinate used with the Load method.y_coordinate
– A 16 bit number that specifies the location of the top of the object in the vertical direction relative to the top edge of the screen. The y-coordinate must be the same coordinate used with the Load method.
A method that unloads an object from a screen and erases the image of the object from the screen. The x and y coordinates must be the same x and y coordinates that were used to load the object into the screen. Errors include: INVALID_SCREEN
, INVALID_OBJECT
, X_OUT_OF_RANGE
, and Y_OUT_OF_RANGE
.
Un_Load(GUI_SCREEN0, buttonStop, 0, 0);
GUI_SCREEN0 buttonStop @ 0 0 Un_Load
Libraries: library.c
, library.4th
See also Load
VERTICAL_SNAP_TO_GRID
C: VERTICAL_SNAP_TO_GRID
4th: VERTICAL_SNAP_TO_GRID
Type: Constant
Return Value: Integer
The name of a property of the GUI Toolkit that aligns objects loaded onto a screen onto an 8 pixel vertical grid. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. VERTICAL_SNAP_TO_GRID
is initialized to GUI_FALSE
by Initialize_GUI
.
Set_Property(GUI_TOOLKIT, VERTICAL_SNAP_TO_GRID, GUI_FALSE);
GUI_TOOLKIT VERTICAL_SNAP_TO_GRID GUI_FALSE Set_Property
Libraries: library.c
, library.4th
See also HORIZONTAL_SNAP_TO_GRID
VISIBLE
C: VISIBLE
4th: VISIBLE
Type: Constant
Return Value: Integer
The name of a screen property that indicates if the screen is shown on the display. Only one screen can be visible at a time. Possible contents of this property are the booleans GUI_TRUE
and GUI_FALSE
. GUI_SCREEN0
is the visible screen after Initialize_GUI
is called.
Set_Property(GUI_SCREEN1, VISIBLE, GUI_TRUE);
GUI_SCREEN1 VISIBLE GUI_TRUE Set_Property
Libraries: library.c
, library.4th
WIDTH_IN_PIXELS
C: WIDTH_IN_PIXELS
4th: WIDTH_IN_PIXELS
Type: Constant
Return Value: Integer
The name of a property that contains the width in pixels of an object.
longWidth = Get_Property(GUI_DISPLAY, WIDTH_IN_PIXELS);
GUI_DISPLAY WIDTH_IN_PIXELS Get_Property displayWidth 2!
Libraries: library.c
, library.4th
See also HEIGHT_IN_PIXELS
WIDTH_OUT_OF_RANGE
C: WIDTH_OUT_OF_RANGE
4th: WIDTH_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates the width passed to Set_Property
when changing the width of a plot, creates a plot wider than the screen. If the error occurs, Set_Property
recovers from the error by setting the width of the plot equal to the width of the screen. An unchecked error occurs if a plot that has already been loaded into a screen is resized beyond the width of the screen.
Set_Property(plotVoltage, WIDTH_IN_PIXELS, (ulong) 400); If(Read_Error() %%==%% WIDTH_OUT_OF_RANGE) { printf("Width of plot is greater than width of screen.\n"); Clear_Error(); }
plotVoltage @ WIDTH_IN_PIXELS 400 u>d Set_Property Read_Error WIDTH_OUT_OF_RANGE = IF CR ." Width of plot is greater than width of screen." Clear_Error ENDIF
Libraries: library.c
, library.4th
X_OUT_OF_RANGE
C: X_OUT_OF_RANGE
4th: X_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates that the x-coordinate passed to Draw
is greater than the width of the screen or the x-coordinate passed to Load
or Un_Load
plus the width of the object is greater than the width of the screen. If the error occurs, the method recovers from the error by setting the x-coordinate to the largest possible value. For the Draw
method, the x-coordinate is set to 319. For the Load
and Un_Load
methods, the x-coordinate is set to 319 minus the width of the object.
Draw( 400, 15 ); If(Read_Error() %%==%% X_OUT_OF_RANGE) { printf("X is greater than the width of the screen.\n"); Clear_Error(); }
400 15 Draw Read_Error X_OUT_OF_RANGE = IF CR ." X is greater than the width of the screen." Clear_Error ENDIF
Libraries: library.c
, library.4th
Y_OUT_OF_RANGE
C: Y_OUT_OF_RANGE
4th: Y_OUT_OF_RANGE
Type: Constant
Return Value: Integer
The name of an error that indicates that the y-coordinate passed to Draw
is greater than the height of the screen or the y-coordinate passed to Load
or Un_Load
plus the height of the object is greater than the height of the screen. If the error occurs, the method recovers from the error by setting the y-coordinate to the largest possible value. For the Draw
method, the y-coordinate is set to 239. For the Load
and Un_Load
methods, the y-coordinate is set to 239 minus the height of the object.
Draw( 40, 300 ); If(Read_Error() %%==%% Y_OUT_OF_RANGE) { printf("Y is greater than the height of the screen.\n"); Clear_Error(); }
40 300 Draw Read_Error Y_OUT_OF_RANGE = IF CR ." Y is greater than the height of the screen." Clear_Error ENDIF
Libraries: library.c
, library.4th