GUIX User Guide PDF
GUIX User Guide PDF
User Guide
Version 5
All rights reserved. This document and the associated GUIX software are the sole property of Express Logic, Inc. Each contains
proprietary information of Express Logic, Inc. Reproduction or duplication by any means of any portion of this document without the
prior written consent of Express Logic, Inc. is expressly forbidden.
Express Logic, Inc. reserves the right to make changes to the specifications described herein at any time and without notice in order
to improve design or reliability of GUIX. The information in this document has been carefully checked for accuracy; however,
Express Logic, Inc. makes no warranty pertaining to the correctness of this document.
Trademarks
GUIX is a trademark of Express Logic, Inc. ThreadX is a registered trademark of Express Logic, Inc. All other product and company
names are trademarks or registered trademarks of their respective holders.
Warranty Limitations
Express Logic, Inc. makes no warranty of any kind that the GUIX products will meet the USER’s requirements, or will operate in the
manner specified by the USER, or that the operation of the GUIX products will operate uninterrupted or error free, or that any
defects that may exist in the GUIX products will be corrected after the warranty period. Express Logic, Inc. makes no warranties of
any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and fitness for a particular
purpose, with respect to the GUIX products. No oral or written information or advice given by Express Logic, Inc., its dealers,
distributors, agents, or employees shall create any other warranty or in any way increase the scope of this warranty, and
licensee may not rely on any such information or advice.
ii
Table of Contents
Organization
Chapter 1 Introduces GUIX
Chapter 2 Gives the basic steps to install and use GUIX with your
ThreadX application
Boldface Typeface denotes file names, key words, and further emphasizes
important words and variables.
The following is a list of GUIX service call data types and their associated meanings:
INT Basic signed integer. This type is mapped to the most convenient
signed data type.
ULONG Unsigned long type. This type must support 32-bit unsigned data.
Additional data types are used within the GUIX source. They are located in either the tx_port.h or
gx_port.h files.
Visit the Express Logic web site and select the “Support” menu option to find the latest online support
information, including information about the latest GUIX product releases.
2. A detailed description of any changes to the application and/or GUIX that preceded the
problem.
3. The contents of the _tx_version_id and _gx_version_id strings found in the tx_port.h
and gx_port.h files of your distribution. These strings will provide us valuable Information
regarding your run-time environment.
_tx_build_options
_gx_system_build_options
These variables will give us information on how your ThreadX and GUIX libraries were
built.
_gx_system_last_error
_gx_system_error_count
6. A trace buffer captured immediately after the problem was detected. This is
accomplished by building the ThreadX and GUIX libraries with
TX_ENABLE_EVENT_TRACE and calling tx_trace_enable with the trace buffer
information. Refer to the TraceX User Guide for details.
GUIX Benefits
Improved Responsiveness
Software Maintenance
Increased Throughput
Processor Isolation
Ease of Use
Having the source code also allows for application specific modifications. Although not recommended, it
is certainly beneficial to have the ability to modify the GUI if it is required. These features are especially
comforting to developers accustomed to working with in-house or public domain products. They expect to
have source code and the ability to modify it. GUIX is the ultimate GUI software for such developers.
Embedded GUI applications are applications that have a user interface requirement and execute on
microprocessors hidden inside products such as cellular phones, communication equipment, automotive
engines, laser printers, medical devices, and so forth. Such applications almost always have some
memory and performance constraints. Another distinction of embedded GUI is that their software and
hardware have a dedicated purpose.
Improved Responsiveness
The high-performance GUIX product enables applications to respond faster than ever before. This is
especially important for embedded applications that either have a significant volume of visual information
or strict timing requirements on displaying such information.
Software Maintenance
Using GUIX allows developers to easily partition the GUI aspects of their embedded application. This
partitioning makes the entire development process easy and significantly enhances future software
maintenance.
Increased Throughput
GUIX provides the highest-performance GUI available, which directly transfers to the embedded
application. GUIX applications are able to process user interface information faster than non-GUIX
applications!
Processor Isolation
GUIX provides a robust, processor-independent interface between the application and the underlying
processor and display hardware. This allows developers to concentrate on the high-level aspects of the
user interface rather than spending extra time dealing with display hardware issues.
Ease of Use
GUIX is designed with the application developer in mind. The GUIX architecture and service call interface
are easy to understand. As a result, GUIX developers can quickly use its advanced features.
Host Considerations
Target Considerations
Product Distribution
GUIX Installation
Using GUIX
Troubleshooting
Configuration Options
GUIX Version ID
Usually the target download is done from within the development tool's debugger. After download, the
debugger is responsible for providing target execution control (go, halt, breakpoint, etc.) as well as access
to memory and processor registers.
Most development tool debuggers communicate with the target hardware via on-chip debug (OCD)
connections such as JTAG (IEEE 1149.1) and Background Debug Mode (BDM). Debuggers also
communicate with target hardware through In-Circuit Emulation (ICE) connections. Both OCD and ICE
connections provide robust solutions with minimal intrusion on the target resident software.
As for resources used on the host, the source code for GUXI is delivered in ASCII format and requires
approximately 30 Mbytes of space on the host computer’s hard disk.
Review the supplied readme_guix_generic.txt file for additional host system considerations and
options.
Target Considerations
GUIX requires between 5 KBytes and 80 Kbytes of Read-Only Memory (ROM) on the target. Another 5 to
10KBytes of the target’s Random Access Memory (RAM) are required for the GUIX thread stack and
other global data structures.
In addition, GUIX requires the use of a ThreadX timer and a ThreadX mutex object. These facilities are
used for periodic processing needs and thread protection inside GUIX.
Product Distribution
Two types of GUIX packages are available—standard and premium. The standard package includes
minimal source code, while the premium package contains complete GUIX source code. Either package
is shipped on a single CD. The exact contents of the distribution CD depends on the target processor,
development tools, and the GUIX package purchased. Following is a list of the important files common to
most product distributions:
readme_guix_generic.txt This file contains specific information about the GUIX release.
gx_api.h This C header file contains all system equates, data structures,
and service prototypes.
gx.a (or gx.lib) This is the binary version of the GUIX C library. It is distributed
with the standard package.
Step 1: Backup the GUIX distribution disk and store it in a safe location.
Step 2: On the host hard drive, copy all the files of the GUIX distribution into the
previously created and installed ThreadX directory.
Application software needs access to the GUIX library file, usually called
gx.a (or gx.lib), and the C include files gx_api.h and gx_port.h. This is
accomplished either by setting the appropriate path for the development
tools or by copying these files into the application development area.
Using GUIX
Using GUIX is easy. Basically, the application code must include gx_api.h during compilation and link
with the GUIX library gx.a (or gx.lib).
Step 1: Include the gx_api.h file in all application files that use GUIX services or data
structures.
Step 3: Create a display instance, create a canvas for the display, and create the root
window and any other windows or widgets necessary.
Step 4: Compile application source and link with the GUIX runtime library gx.a (or
gx.lib). The resulting image can be downloaded to the target and executed!
Troubleshooting
Each GUIX port is delivered with a demonstration application that executes on specific display hardware.
The same basic demonstration is delivered with all versions of GUIX. It is always a good idea to get the
demonstration system running first.
See the readme_guix_generic.txt file supplied with the distribution for more specific details
regarding the demonstration system.
Follow the procedures outlined in the section titled “What We Need From You” to send the information
gathered from the troubleshooting steps.
Configuration Options
There are several configuration options when building the GUIX library and the application using GUIX.
The options below can be defined in the application source, on the command line, or within the
gx_user.h include file.
Review the readme_guix_generic.txt file for additional options for your specific version of GUIX. The
following sections describe configuration options available in GUIX.
Define Meaning
GX_THREAD_STACK_SIZE stack size, in bytes, of the internal GUIX thread created at system startup.
GX_SYSTEM_TIMER_TICKS defines the GUIX timer rate as a multiple of the ThreadX tick interrupt
rate.
GX_TICKS_SECOND useful definition for application logic, must correlate with the
GX_SYSTEM_TIMER_TICKS definition.
GX_CONST compiler specific definition of the “const” data type, usually just “const”.
GX_UTF8_SUPPORT this definition enables internal support for UTF8 format string encoding.
Application software can also obtain release information from the constants shown below defined in
gx_api.h. These constants identify the current product release by name and the product major and minor
version.
#define __PRODUCT_GUIX__
#define __GUIX_MAJOR_VERSION__
#define __GUIX_MINOR_VERSION__
Execution Overview
Initialization
Application Interface Calls
Internal GUIX Thread
Event Processing
Drawing
User Input
Modal Dialog Execution
Periodic Processing
Display Driver
Memory Usage
Static Memory Usage
Dynamic Memory Usage
GUIX Components
GUIX System Component
Initialization
Thread Processing
Multithread Safety
Periodic Processing
Widget Defaults
Scrollbar Appearance
Skinning
System Error Handling
GUIX Canvas Component
Canvas Creation
Canvas Control Block
Canvas Alpha Channel
Color Depth
Transitions
GUIX Display Component
Display Creation
Display Control Block
Installing Themes
Drawing APIs
Root Window
Anti-Aliasing
Clipping
Views
Display Driver Interface
GUIX Widget Component
GUIX applications define the user interface by calling GUIX API functions to create
windows and child widgets, and customize the appearance of these widgets by calling
additional API functions used to define colors, styles, fonts, and various other attributes
of each window or widget type. If you are using GUIX Studio to create the appearance
of your user-interface screens, much of this work of calling GUIX API functions to create
your display is done for you by the GUIX Studio application.
GUIX applications interact with the system user and with external business logic by
handling events retrieved from the GUIX event queue. These events are usually
produced by GUIX widgets, but they can also be created by external threads. When a
typical GUIX button is pushed, that button sends an event to the button’s parent
window. Your application program will act on that button push by providing a handler for
the button push event.
Additional GUIX threads are often created for things such as input drivers. A typical
touch screen input driver is executed as a standalone thread external to the main GUIX
thread. The touch input driver sends touch information into the GUIX thread by sending
events into the GUIX event queue.
The vast majority of the GUIX software is independent of any hardware dependencies.
The framework does require hardware-specific input drivers and hardware-specific
graphics drivers. The details of how these hardware specific drivers are implemented
are deferred to chapter 5.
GUIX assumes the existence of ThreadX and depends on its thread execution,
suspension, periodic timers, and mutual exclusion facilities.
Initialization
The service gx_system_initialize must be called before any other GUIX service is
called. GUIX system initialization can be called from the ThreadX
tx_application_define routine (initialization context) or from application threads.
For the most part, processing intensive activities are deferred to the internal GUIX
thread, including all event processing and widget/window drawing.
The GUIX API functions can be called from any thread at any time. However it is usually
considered to be better architecture to separate your time-critical business logic from
your user interface logic. Since the user interface drawing operations can sometimes
take a long time depending on your display size and CPU performance, you normally
would not want to have time-critical threads delayed waiting for a drawing operation to
complete.
The internal GUIX thread execution loop is composed of three actions. First, GUIX
retrieves events from the GUIX event queue and dispatches those events for
processing by the GUIX windows and widgets. Events are typically pushed into the
GUIX event queue by periodic timers, input devices such as a touch screen or keypad,
and by GUIX widgets themselves as they process user input. Next, after all events have
been processed, GUIX determines if a screen refresh is needed, and if so performs the
processing necessary to update the display graphics data, mainly by calling the drawing
functions of those windows and widgets which have been marked as dirty. Finally, GUIX
suspends the GUIX thread until a new input event or events arrive.
Keypad events are sent to the window/widget that has input focus. Input focus status is
maintained by the GUIX gx_system component.
Timer events are always dispatched to the window or widget that owns the timer for
processing.
Internally generated events, such as button click events or slider value change events,
are always sent to the parent of the widget generating the event. If the parent does not
process the event, it is passed up the chain similar to touch or pen input events.
Drawing
Once all the event processing is complete, the GUIX internal thread determines if any
display update is needed and if so the appropriate window/widget drawing functions are
called. When drawing is complete, the GUIX internal thread simply waits on its event
queue for the next GUIX event to process.
GUIX implements the concept of “dirty areas” for each widget and canvas. A widget can
only draw to areas that have previously been marked as dirty. When a widget drawing
function is called, all drawing operations are internally clipped to the previously defined
dirty rectangle. Attempts to draw outside of this area are ignored.
Widgets and windows mark themselves as dirty by calling the API function
gx_system_dirty_mark. This function marks the entire widget or window as needing to
be redrawn. A second function, gx_system_dirty_partial_add, can be invoked as an
alternative to mark only a portion of a window or widget as dirty.
This model of marking widgets as dirty, or needing to be re-drawn, and then redrawing
those widgets only when all input events have been processed is referred to as
deferred drawing. The GUIX deferred drawing algorithm and dirty list maintenance is
designed to improve drawing efficiency. Since drawing operations are typically
expensive, GUIX works hard to prevent unnecessary drawing.
Actions associated with these devices are translated into events that are processed by
the internal GUIX thread. Driver level software written to support a touch screen must
prepare and send to the GUIX event queue events for pen-down, pen-up, and pen-drag
operations. Similarly a keypad input driver must generate events for key press and key
release input.
Modal dialogs are triggered by the application software by first creating the window in
the normal way by calling gx_window_create, and then calling the GUIX API function
gx_window_execute.
When the gx_window_execute function is called, GUIX enters a local event processing
loop. The gx_window_execute function does not return to the caller until the dialog
window is closed, either by user input or by calling gx_window_close. For this reason,
it is very important never to call the gx_window_execute function from any thread
other than the GUIX internal thread.
Note that the GUIX timer frequency is expressed in ThreadX timer ticks. Typically,
a ThreadX timer tick is 10ms, so the default value of
GX_SYSTEM_TIMER_FREQUENCY is 5, yielding 50ms. However, if the ThreadX
timer tick represents a different value, the GUIX timer frequency must be adjusted
accordingly.
Display Driver
Display drivers are responsible for providing a set of drawing functions to the core GUIX
code. The implementation of each of these drawing functions is determined by the
driver, and when possible the implementation will leverage hardware acceleration
support. In general the drawing function works by writing pixel data to a memory buffer,
which may be the physical frame buffer or it may be a secondary buffer depending on
the driver architecture. Many drivers implement double buffering using two frame
buffers, and these buffers are toggled by invoking the buffer toggle function. GUIX calls
these functions internally at the appropriate times. Or the drawing functions may only
write to a memory frame buffer.
A typical hardware display driver is implemented by first creating the default GUIX
display driver for the required color depth and format. Then the hardware driver will
replace those functions that need to be optimized or customized for the particular
hardware implementation.
GUIX support pixel color formats ranging from 1-bpp monochrome to 32-bpp a:r:g:b
format. GUIX also supports many variations within each broad color-depth category,
such as r:g:b versus b:g:r byte order, packed pixel versus word-aligned pixel formats,
and alpha channels. There are currently 25 distinct color formats supported, but this list
grows as hardware vendors deliver new variations.
Display Display
Driver GRAM
Serial/Parallel
In the model above, no memory for a frame buffer exists in memory local to the CPU. All
graphics data is stored in an external GRAM which is incorporated into the display itself.
The interface to the external GRAM can be parallel or serial. This type of architecture is
very low cost; however it can exhibit unwanted tearing effect when the graphics data is
updated.
In this model, memory for the graphics data is allocated from a random-access memory
that is directly accessible the CPU. Dedicated hardware must be present to repeatedly
transmit the graphics data (along with timing signals) from the local memory to the
display. This model differs from model 1 in that the graphics memory is a block of the
local SRAM or DRAM available to the CPU. This may be the same memory in which
stack and program variables live.
Model 3 is a combination of the first two. In this model, sufficient local memory exists to
hold one frame buffer. In addition, the display device provides an external GRAM and
automatically refreshes itself using the data provided in the GRAM. This architecture
benefits from improved update efficiency because we can transfer the modified portion
of the local frame buffer to the external GRAM in one block transfer, often utilizing on-
Frame
Buffer
Display Display
Driver
Frame
Buffer
In model 4, sufficient memory is present to provide two local frame buffers. In this case,
GUIX treats one frame buffer as the active frame buffer, and the other as the working
frame buffer. When a display update or drawing operation is in progress, it takes place
in the working buffer. When the drawing operation completes, the buffers are toggled,
and the working buffer becomes the active buffer and the active buffer becomes the
working buffer. This model also eliminates screen flicker and tearing that can be
observed in a single buffered system.
Composite
A
Software
Canvas Display
Software
Canvas
Software
Canvas
Software
Canvas
Model 6 is a slight variation on Model 5, in which only one composite buffer is required
and the composite buffer is then transferred to external GRAM. This model also
supports full screen blending and overlays.
Memory Usage
GUIX resides along with the application program. As a result, the static memory (or
fixed memory) usage of GUIX is determined by the development tools; e.g., the
compiler, linker, and locator. Dynamic memory (or run-time memory) usage is under
direct control of the application.
The instruction area contains all of the program’s processor instructions. This area is
often located in ROM.
GUIX pixelmaps and fonts typically require large amounts of constant data storage.
These large static data areas are normally kept in ROM or FLASH.
The GUIX thread stack is defined within the uninitialized data area (as a global variable)
in gx_system.h file as follows:
_gx_system_thread_stack[GX_THREAD_STACK_SIZE];
The size of the GUIX thread stack is defined in gx_port.h, but may be overridden by the
application by changing gx_user.h or via project options or command line parameters.
The stack size must be large enough to handle the worst-case event handling and
drawing nested calls.
For example, suppose a target hardware environment has both fast memory and slow
memory. If the application needs extra performance for drawing, the canvas memory
can be explicitly placed in the high-speed memory area for best performance.
GUIX Components
The GUIX APIs are divided and organized into several basic groups which correspond
to fundamental components of the GUIX system. The fundamental components include:
GX_WIDGET: The basic visible widget object and associated APIs. All
GUIX widget types are based on or derived from the basic
GX_WIDGET type.
In addition to these basic components, GUIX includes APIs unique to each type of
widget provided in the library. These APIs are described in the API manual.
RTOS Binding
The GUIX system component is by default configured to utilize the ThreadX real time
operating system for services such as thread services, event queue services, and timer
services. GUIX can easily be ported to other operating systems by using the pre-
processor directive GX_DISABLE_THREADX_BINDING and re-building the GUIX
library. This removes the ThreadX dependencies from the GUIX source code, and
allows the application developer to implement the required operating system services
using whatever RTOS is proviced by the target system. Appendix F, GUIX RTOS
Binding Services, describes the services that need to be implemented to port GUIX to
an operating system other than the ThreadX operating system.
Initialization
While you can manually create your application string table, most often the system
string table is defined by the GUIX Studio application as part of your project resource
file. The available languages are also defined in the resource header file. The system
string table is a multi-column table of pointers to UTF8 encoded application strings.
Each column of the string table represents one language supported by the application. If
your application supports only one language, for example English, then your string table
will have only one column. Still, you can add support for additional languages at any
time without modifying your application software.
GUIX optionally supports UTF8 format string encoding. Support for UTF8 string
encoding is enabled by defining the value GX_UTF8_SUPPORT in the gx_user.h
header file. If this definition is not enabled, GUIX will internally use only standard 8-bit
ASCII plus Latin-1 code page character encoding.
ASCII strings take no more storage space than standard 7-bit ASCII
encoding.
Most ANSI-C string functions work with UTF8 string encoding without
modification.
All active character sets in the world, including Kanji character sets, can be represented
using UTF8 string encoding.
Thread Processing
The internal GUIX thread – created during initialization – is responsible for most of the
processing in GUIX. The processing in this thread first completes any additional
initialization required by the underlying display driver. Once this is complete, the GUIX
thread enters a loop which first processes all events present in the GUIX event queue
and then refreshes the screen if required. The screen refresh executes the necessary
GUIX drawing functions, based on what is visible and has been marked as dirty
meaning it needs to be redrawn. When there are no events and nothing left to refresh
on the display, the GUIX thread will suspend, waiting for the next GUIX event to arrive.
Multithread Safety
The GUIX API is available from the GUIX thread context as well as other application
threads. Application threads can interact with the GUIX thread by sending and receiving
events, by access to shared variables, and through use of the GUIX API functions.
GUIX uses an internal ThreadX mutex for multi-thread resource protection. In addition,
GUIX prevents the internal structure of visible widgets from being modified once a
screen refresh operation has begun. APIs which would modify the tree of visible objects
are blocked while drawing operations are in progress, and released once the screen
refresh is complete.
Periodic Processing
GUIX provides the application with periodic timers, which are often used for periodic
update of data displayed in GUIX windows. This is accomplished via a ThreadX periodic
timer, which is also used to perform GUIX system-level effects like screen fade in/out,
etc.
The application can create timers and utilize the same timer facility that is used
internally by GUIX. Of course the application can also directly create and use ThreadX
timers if required. The advantage of the GUIX timers is that they are very easy to use
and are pre-configured to work within the GUIX event-driven processing system.
To create and start a GUIX timer, the application should invoke the function
gx_system_timer_start. The parameters to this function include a pointer to the calling
widget, the timer id (allowing one widget to start many timers), and the initial and
reschedule timeout values. If the reschedule timeout value is 0, the timer will only run
one time and will delete itself from the active timer list once it expires.
UINT _gx_system_last_error;
ULONG _gx_system_error_count;
If the GUIX application is behaving strangely, it is useful to look at the error count
variable in the debugger. If it is set, a good way to troubleshoot the problem is to set a
breakpoint in the _gx_system_error_process function and see when/where it is being
called from.
All GUIX drawing takes place on a canvas. In simpler or memory constrained systems,
there will likely be only one canvas which might be directly linked to the visible frame
buffer, whereas systems with more memory and more advanced graphics requirements
might require multiple canvases. Making multiple canvases available for one display
enables features such as screen and window fade-in and fade-out effects. Canvases
can be one of two main types, simple or managed.
A simple canvas is an off-screen drawing area used by the application. GUIX does
nothing directly with a simple canvas, but the application can use a simple canvas to
render complex drawing to an off-screen buffer, and then use this off-screen buffer to
refresh the visible canvas when needed.
For architectures other than the simplest single canvas/single frame buffer organization,
the size of a canvas is determined by the application and may be different than the fixed
size of a frame buffer. It may also be at an offset selected by the application. Other
information, such as Z-order is maintained within the canvas. When the canvas drawing
is complete, the contents of the canvas are transferred to the physical display by the
display driver. In some systems that don’t have enough memory for a separate canvas
and frame buffer memory areas, the canvas update is actually made directly to the
physical display via the display driver.
Canvas Creation
A canvas object can be created during initialization or anytime during the execution of
application threads. There is no limit on the number of canvas objects that can be
created by an application. Most applications, however, will create only one canvas
object for all GUIX drawing.
The alpha value of a canvas is used when there are multiple canvases which are
composited together for display within the frame buffer. If the canvas Z-order is such
that a canvas is above other canvases, then the canvas alpha value can be set to blend
the canvas with those that lie behind. Rapidly modifying the alpha value of a canvas is
used to provide “fade in” screen transition effects, but the canvas alpha can be used in
many ways.
Canvas Drawing
The GUIX canvas component provides a full drawing API to the application. Before the
drawing APIs such as gx_canvas_line_draw() or gx_canvas_pixelmap_draw() can be
invoked, the target canvas must be opened for drawing by invoking the
gx_canvas_drawing_initiate() API function. This function prepares a canvas for drawing.
When GUIX invokes the window and widget drawing functions as part of a deferred
canvas refresh operation, the target canvas is opened for drawing prior to calling the
widget drawing function(s). Therefore the standard widget drawing functions are not
required to open the target canvas, this has been done for them.
In some cases the application may want to force immediate drawing to a canvas. In this
case, the application can perform the following steps:
Color Depth
GUIX supports color depths up to 32-bpp as well as monochrome and grayscale. The
type of color depth support largely determined by the capabilities of the underlying
physical display and also has an impact on how much memory is required for the
canvas drawing area. The following is a list of color depth support along with a brief
description of the variations within that color depth.
Display Creation
A display object can be created during initialization or anytime during the execution of
application threads. Typically an application creates one display object to manage each
physical screen. If you have used GUIX Studio to define your application and the
physical displays available, you will use the gx_studio_display_configure API function to
create and initialize each of your displays.
Resource Management
Resources are UI components that are needed by the application, but they are not
application code. Resources are application data and are usually statically defined.
Resource types include pixelmaps, fonts, colors, and strings. These resources can be
changed at any time, usually without changing any application software. It is important
to keep the storage of and references to resources separated from the application
software to allow changing UI appearance without changing application code since
changes to the application software usually require the associated re-testing and
verification of that software.
The GUIX display module provides resource management facilities for all resources
that are dependent on the color depth and format of the display. These facilities include
maintaining the active pixelmap table, active font table, and active color table. The string
The application software references resources by their resource Id, which is an index
into the corresponding resource table. This allows the table to be changed, for example
the color table might be changed when a product changes from “day mode” to “night
mode”, but the color ID values to remain the same.
Your application resources are written to a resource file (or set of resource files) by the
GUIX Studio application. Default colors, pixelmaps, and fonts are provided automatically
when you create a new GUIX Studio project, but these defaults are easily replaced as
you define the look and feel of your application.
It is important to note that Resource IDs for colors, fonts, and pixelmaps cannot be
resolved to their actual color, font, or pixelmap values until the active Display
component is known. Since the GUIX architecture supports multiple active displays,
Resource IDs can only be resolved to resource values when a widget and its associated
Resource ID can be resolved to a specific display. This property is known as dynamic
binding. The Resource ID for a property such as a text color, for example the resource
ID GX_COLOR_ID_TEXT, might resolve to a 16-bit R:G:B value for white when used
on one display, but the same color ID might resolve to a monochrome black color value
when used on another display.
In practice this dynamic binding of Resources IDs to resource values means that
application software and GUIX internal components should most often only resolve
Resource IDs to resource values within an active drawing context. An active drawing
context specifies the currently active display, which allows GUIX to resolve each
Resource ID to a specific resource value. If the application software is required to find a
specific resource value outside of a drawing context, this can also be done for visible
widgets. Visible widgets are linked to a root window which can also be used to resolve
the active canvas and display for that widget.
If a widget has been created but not yet displayed (i.e., has not been linked to any root
window or other visible parent), any resource IDs associated with that widget cannot be
resolved to a specific resource value other than by directly indexing into the resource
table assigned to a specific display. This direct access to a specific resource table can
safely be done by the application software, but is never done in the internal GUIX library
software.
Widget Defaults
The GUIX display component also provides default definitions for various widget
attributes. Unless otherwise specified by the application, widgets/windows are created
with these system attributes. These system attributes are mainly composed of fonts,
colors, and bitmaps maintained in the system resource tables. Additional attributes for
default scrollbar appearance are also maintained by the GUIX display component.
These color ID values are mapped to a specific color value as defined by the color table
assigned to each display. These defaults can be changed as a group for one display by
calling the gx_display_color_table_set() API function. If you are using GUIX Studio,
the display color table is automatically initialized when your application calls the
gx_studio_display_configure() function.
The GUIX display component also maintains a default font table. The default font table
defines the font used by each widget type unless specifically specified by the
application. The pre-defined display font table IDs include:
Scrollbar Appearance
GUIX Display also maintains default scrollbar appearance settings for that display.
These settings are defined by the GX_SCROLLBAR_APPEARANCE structure which is
defined below. GUIX Display maintains one scrollbar appearance structure for vertical
scrollbars and a second structure for horizontal scroll bars. The application can modify
the default scrollbar appearance for any display by initializing a
GX_SCROLLBAR_APPEARANCE structure and invoking the API function
gx_display_scroll_appearance_set.
typedef struct GX_SCROLLBAR_APPEARANCE_STRUCT
{
INT gx_scroll_width;
INT gx_scroll_thumb_width;
INT gx_scroll_thumb_travel_min;
INT gx_scroll_thumb_travel_max;
GX_RESOURCE_ID gx_scroll_fill_pixelmap;
GX_RESOURCE_ID gx_scroll_thumb_pixelmap;
GX_RESOURCE_ID gx_scroll_up_pixelmap;
GX_RESOURCE_ID gx_scroll_down_pixelmap;
GX_COLOR gx_scroll_fill_color;
GX_COLOR gx_scroll_button_color;
} GX_SCROLLBAR_APPEARANCE;
In addition to these default settings for fonts, color, and styles, the application may
specify any of the parameters on a case by case basis as desired using API provided by
each widget type.
Re-skinning your GUIX application requires that you supply a new color, font and or
pixelmap table to the GUIX Display resource tables. Since all GUIX widgets refer to
their color, bitmap, or font by resource ID, providing a new resource table automatically
causes all GUIX widgets to begin using your new colors and pixelmaps when they draw
themselves to the desired display.
A new set of fonts, colors, and pixelmaps that are designed to work together to provide
an attractive appearance is called a Theme. A theme defines a set of resource tables
and the size of each resource table. Any number of themes can be defined for any
display using the GUIX Studio application. You must pass the starting theme index to
the GUIX Studio generated function gx_studio_display_configure(), which installs the
initial theme into the created display. The active theme for any display can be changed
at any time by calling the function gx_display_theme_install().
Hardware Initialization
Draw Arc
Draw basic line
Draw Circle
Draw Ellipse
Draw Glyph
Draw Pie
Draw horizontal line
Draw vertical line
Draw Rectangle
Draw Polygon
Draw Text
Draw pixelmap
Blend pixelmap
Tile pixelmap
Draw pixel
Blend pixel
Buffer Toggle
Canvas copy
Canvas blend
Block Move
The drawing API is invoked via the GUIX Canvas API, and all drawing is done using
gx_canvas_xxx() API functions. Drawing is done using the current brush in the current
drawing context. Any of the shape drawing functions above can be outlined, solid color
filled, or pixelmap filled as defined by the current brush. To modify the shape outline
width, color, or fill, use the gx_context_brush_xxx API functions to define the brush
within the current drawing context.
The above application level drawing APIs don’t do actual drawing to the canvas, but
instead verify the caller’s parameters before invoking the display driver level drawing
function. The driver level drawing function actually writes pixel data into the canvas
memory.
GUIX provides stock display driver drawing functions for various color depths, including
1, 2, 4, 8, 16, 24, and 32 bits per pixel (bpp). In some cases, the default software
drawing implementation is replaced by hardware-accelerated implementations for those
hardware targets that provide a 2D drawing accelerator.
Anti-Aliasing
Anti-Aliasing is an optional feature in GUIX that is used to smooth lines, curves, and
fonts. Anti-aliasing is only supported when running with a display driver utilizing 16-bpp
or higher color depth.
Clipping
Clipping is supported internally by the GUIX display component, and at the window and
widget layers by the parent-child architecture maintained by GUIX widgets. No window
or widget is ever allowed to draw outside of that widget’s area, and a widget is never
allowed to draw outside of the area of that widget’s parent.
This also prevents widgets from drawing at pixel coordinates that lay outside of the
canvas memory which likely lead to memory corruption or a system failure. Widgets are
not allowed to draw outside of the widget’s area, the widget’s parent area, or beyond the
canvas extent.
In addition, widgets can only draw to areas that have previously been marked as dirty.
This prevents an entire window being drawn, for example, when only a corner of the
window has been revealed. Only the portion of the window that actually needs to be
refreshed is marked as dirty, and so the window drawing function only truly refreshes
pixels in the dirty area.
Views
GUIX always maintains a set of views for each root window and each child window of
the root window. Views are a dynamic, run-time determined clipping area that changes
as window position and Z-order are modified. GUIX uses views to prevent a window or
widget in the background from drawing on top of a window or widget in the foreground.
Views enforce Z-order discipline. In addition, views are important for efficiency in that
they prevent a window in the background from drawing to any area of the canvas that
cannot be seen. If a window is completely covered by another window, the covered
window will not be allowed to draw to the canvas at all, even if it is attempting to do so.
Once initialization is complete, the display driver is responsible for any direct drawing
that can be done in the physical display hardware. Finally, the display driver is
responsible for displaying the frame buffer.
GUIX widgets are implemented in an object oriented manner with full support of
inheritance. This is accomplished using ANSI C, which results in the smallest possible
memory and processing requirements. When we speak of one particular widget, such
as GX_BUTTON, being derived from another widget, such as the base GX_WIDGET,
what we mean is that the GX_BUTTON control structure contains all of the member
variables and function pointers of GX_WIDGET, with some additional variables that are
specific to GX_BUTTON. GUIX builds up layers of widgets in this fashion, so that more
complex widgets are always based on a simpler widget before them. This hierarchical
model of derivation makes it easier to learn the APIs used to modify widget parameters.
If you want to modify the color of a button, you use the same API you use to modify the
color of a widget, namely gx_widget_fill_color_set.
Widget Creation
A widget object can be created during initialization or anytime during the execution of
application threads. There is no limit on the number of widget objects that can be
created by an application. There is also no limit on the number of children any widget
may have, within the memory limits of your target hardware.
Each widget type has its own create function, such as gx_button_create or
gx_prompt_create. The first three parameters to these functions are always the same,
namely a pointer to the widget control structure, a string pointer to the widget name, and
a pointer to the widget’s parent. Each create function may have any number of
additional parameters depending on the requirements of that particular widget type.
Dynamic widget allocation is most often employed within your Studio generated
application specifications file, when you select the “dynamically allocated” option in the
Studio widget properties field. However, you can also use dynamic control block
allocation within your application. If you use dynamic control block allocation within your
application, you should invoke the gx_widget_allocate(GX_WIDGET **widget, ULONG
memsize) API function to allocate the widget control block. Next, when you create the
widget, make certain you pass the
GX_WIDGET_STYLE_DYNAMICALLY_ALLOCATED style flag (along with any other
needed style flags) to the widget create function. This flag is used to mark the widget as
being dynamically allocated in the widget status field. When and if the widget is later
deleted using gx_widget_delete(), GUIX will check this status field and automatically call
your memory de-allocator function to insure there are no memory leaks.
A widget created using a dynamically allocated control block must be created with
the GX_WIDGET_STYLE_DYNAMICALLY_ALLOCATED style flag to prevent
memory loss.
Types
GUIX provides a rich, fully functional set of built-in widgets. As mentioned previously, all
specialized widgets are derived from the base widget. Following is a list of the built-in
widgets in GUIX:
GX_TYPE_WIDGET
GX_TYPE_SLIDER
GX_TYPE_PIXELMAP_SLIDER
GX_TYPE_VERTICAL_SCROLL
GX_TYPE_HORIZONTAL_SCROLL
GX_TYPE_PROGRESS_BAR
GX_TYPE_PROMPT
GX_TYPE_PIXELMAP_PROMPT
GX_TYPE_SINGLE_LINE_TEXT_INPUT
GX_TYPE_PIXELMAP_TEXT_INPUT
GX_TYPE_MULTI_LINE_TEXT_VIEW
GX_TYPE_MULTI_LINE_TEXT_INPUT
GX_TYPE_WINDOW
GX_TYPE_ROOT_WINDOW
GX_TYPE_VERTICAL_LIST
GX_TYPE_HORIZONTAL_LIST
GX_TYPE_DROPLIST
GX_TYPE_DIALOG
GX_TYPE_KEYBOARD
Styles
Widget styles consist of things like border properties (raised, recessed, thin, thick, or no
boarder at all) as well as properties for specific widget types, as listed previously. The
widget style flags offer the simplest method for modifying the appearance of any widget.
The initial widget style is always a parameter passed to the widget type specific create
function.
Widgets draw themselves using colors defined in the system color table. Color IDs are
defined for canvas background, default widget fill color, button fill color, text widget fill
color, window fill color, and several other default color values. In addition,
GX_WINDOW objects support displaying a bitmap or wallpaper as the window client is
filled.
The simplest method of changing the default color scheme is to use GUIX Studio and
create or define a color scheme that meets your requirements. You can also define your
color scheme manually by creating an array of GX_COLOR values and invoking the
gx_system_color_table_set API function.
Event Notification
GUIX events are requests made to one or more widgets to perform a particular action
and notifications to notify widgets of user input and internal system status changes. For
example, when a widget gains focus, the GX_EVENT_FOCUS_GAINED is sent to the
widget via the gx_system_event_send API service.
Events are passed through the GUIX event queue, and each event is an instance of the
GX_EVENT data structure. The GX_EVENT data structure is defined in gx_api.h,
however the most important fields of the structure are the gx_event_type,
gx_event_sender, gx_event_target, and gx_event_payload.
The gx_event_type field is used to identify the particular event class. The event type
indicates if this is, for example, a GX_EVENT_PEN_DOWN event or a
GX_EVENT_TIMER event. The gx_event_payload is a union of various data fields,
and they are not all valid for every event type. You use the event type field first, before
examining the other event data fields.
The gx_event_sender field contains the ID of the widget that generated the event if the
event is a child-widget notification.
GX_EVENT_ANIMATION_COMPLETE
GX_EVENT_CLICKED
GX_EVENT_CLOSE
GX_EVENT_DESELECTED
GX_EVENT_DESTROY
GX_EVENT_FOCUS_GAINED
GX_EVENT_FOCUS_LOST
GX_EVENT_HIDE
GX_EVENT_HORIZONTAL_FLICK
GX_EVENT_HORIZONTAL_SCROLL
GX_EVENT_KEY_DOWN
GX_EVENT_KEY_PRESS
GX_EVENT_KEY_RELEASE
GX_EVENT_KEY_UP
GX_EVENT_LANGUAGE_CHANGE
GX_EVENT_LIST_SELECT
GX_EVENT_MOVE
GX_EVENT_PARENT_SIZED
GX_EVENT_PEN_DOWN
GX_EVENT_PEN_DRAG
GX_EVENT_PEN_UP
GX_EVENT_RADIO_DESELECT
GX_EVENT_RADIO_SELECT
GX_EVENT_REDRAW
GX_EVENT_RESIZE
GX_EVENT_RESOURCE_CHANGE
GX_EVENT_SELECTED
GX_EVENT_SHOW
GX_EVENT_SLIDE
GX_EVENT_SLIDER_VALUE
GX_EVENT_SPRITE_COMPLETE
GX_EVENT_TERMINATE
GX_EVENT_TEXT_EDIT
GX_EVENT_TEXT_EDIT_COMPLETE
GX_EVENT_TEXT_EDITED
GX_EVENT_TIMER
GX_EVENT_TOGGLE_OFF
GX_EVENT_TOGGLE_ON
GX_EVENT_VERTICAL_FLICK
GX_EVENT_VERTICAL_SCROLL
GX_EVENT_ZOOM_IN
GX_EVENT_ZOOM_OUT
The application can also add its own custom events, starting numerically after the
constant GX_FIRST_APP_EVENT. All event numbers after this constant are reserved
for the application’s use. Of course, the application’s widget event handler must have
processing for such application events.
Application event processing functions can take advantage (i.e., not duplicate the
processing) of the default processing by simply calling the default
gx_widget_event_process processing directly.
Event processing is called exclusively from the context of the internal GUIX system
thread. In this way, the stack requirements to process the event handling only applies to
the GUIX thread.
switch(event_ptr->gx_event_type)
{
/* this is an example for catching events from a child button */
case GX_SIGNAL(IDB_CHILD_BUTTON, GX_EVENT_CLICKED):
/* insert your button handler code here */
break;
case GX_EVENT_SHOW:
/* add functionality to the show event handler */
/* first, do default processing */
status = gx_window_event_process(main_screen, event_ptr); /* note 1 */
default:
/* pass all other events to base processing function */
status = gx_window_event_process(main_screen, event_ptr); /* note 1 */
break;
}
return status;
}
In the example above, it is important to notice that for system events like
GX_EVENT_SHOW (events generated internally to notify a widget of a status change),
the application must pass those events to the base widget event processing function to
insure that the normal processing occurs. The application can then add additional logic
as desired. All events that are not handled by the application (the default case above)
should also be passed to the base event processing function. Since this example was
for a top-level screen based on GX_WINDOW, the default event processing function is
gx_window_event_process.
Drawing Function
All widget drawing is performed separately from the event handling. This is more
efficient because drawing is usually expensive in terms of CPU cycles. By implementing
a deferred drawing algorithm, all of the outstanding events and associated display
changes can be completed before any drawing is done, thus eliminating wasted
drawing. Similar to event processing, there is a default widget drawing function for most
widgets, named gx_xxx_draw, where xxx is the widget type. In most cases, the
application won’t need to worry about the drawing function of any given widget.
However, in situations where the application requires custom or supplemental drawing,
the application may override the default drawing function with its own via the GUIX API
gx_widget_draw_set. This function allows the application to provide its own
customized drawing function for any widget. This further allows the application to define
entire new widget types.
Widget drawing is called exclusively from the context of the internal GUIX system
thread. In this way, the timing and stack requirements to perform the drawing only apply
to the GUIX thread.
For this example, let’s assume that you want to customize the appearance of a button.
The button will look very much like a GX_TEXT_BUTTON, but we will add drawing a
small green “LED_ON” bitmap in the middle-right portion of the button when the button
is pressed, and small “LED_OFF” bitmap when the button is not pressed. We want to
create a button that looks like this:
gx_widget_style_get(button, &button_style);
if (map)
{
/* draw it 20 pixels in from right edge */
xpos = button->gx_widget_size.gx_rectangle_right;
xpos -= map->gx_pixelmap_width + 20;
The gx_brush_pixelmap defines a pixelmap to use for rectangle and polygon fills. This
member is not used unless the gx_brush_style is includes the
GX_BRUSH_PIXELMAP style.
The gx_brush_font member defines the font used for text drawing. The
gx_brush_line_pattern member defines the pattern used for dashed lines.
The gx_brush_style member is a set of style flags that can be OR’d together to fully
define the brush attributes. The available brush style flags include:
GX_BRUSH_OUTLINE
GX_BRUSH_SOLID_FILL
GX_BRUSH_PIXELMAP
GX_BRUSH_ALIAS
GX_BRUSH_UNDERLINE
GX_BRUSH_ROUND
GX_BRUSH_PATTERN
The gx_brush_width member defines the line with for line drawing, or the outline width
for outlined shape drawing.
The gx_brush_line_color member defines the foreground color for line drawing and for
text drawing.
The gx_brush_fill_color member defines the solid fill color used for shape filling.
The GUIX context component provides a set of APIs designed to make it very easy to
modify the current brush within the active context. These APIs include
gx_context_brush_define, gx_context_line_color_set, gx_context_fill_color_set,
gx_context_font_set, and many others.
The draw context of a parent object is inherited by the objects children. Actually, a clone
of the parent drawing context is inherited by the child objects when their drawing
functions are invoked. The child can modify the context without affecting the parent
drawing, but it can also inherit information from the parent such as brush color and style
if desired.
GUIX windows extend the functionality of the GUIX widget primarily by adding support
for horizontal and vertical scrolling. GUIX window objects can automatically create and
display scroll bars and respond to scroll bar input. Movable windows also have built in
event handling to allow the window to be moved or dragged based on pen input events.
Finally, GUIX window responds to receiving input focus by moving the window to the
front of the window Z-order.
GUIX window maintains the concept of client area, which is the inner portion of the
window once the window borders and non-client objects such as scrollbars are removed
from the available area. Client area child widgets are clipped to the window client area,
while non-client children such as scroll bars are allowed to draw outside of the client
area, but are still clipped to the window outer dimensions.
Window Creation
A window object can be created during initialization or anytime during the execution of
application threads. There is no limit on the number of window objects that can be
created by an application. There is also no limit on the number of children any window
may have.
Root Window
GUIX requires what is called a root window for each canvas. The root window is border-
less and has the same dimensions as the canvas to which it is attached. It is used
primarily as a container for all first-level widgets and windows. The root window is
typically created by the application via the API gx_window_root_create, shortly after
the creation of the screen and canvas. If you use the Studio generated function
gx_studio_display_configure, the address of the root window can be returned in the
location passed as the last parameter to this function.
If a root window is moveable, it moves not by changing its position on the canvas as a
child window would do, but by moving the canvas itself. This feature allows the GUIX
root window to leverage hardware that supports multiple frame buffers with hardware
offset registers.
Background
Window backgrounds are either solid colors or bitmap images. There is a default
window background at the system level which provides the default for the initial set of
windows. Of course, any window background can be changed via the GUIX API.
Scrolling
GUIX supports standard window scrolling when area required to display the window
children exceeds the current size of the window – horizontally and/or vertically. To
enable scrolling, the application must create the desired scroll bars and attach them to
the window.
The GUIX window component provides a default scrolling implementation based on the
size of the window client area and the extent of the all child widgets. Applications can
also provide their own scrolling implementation and interpretation by overriding the
gx_window_scroll_info_get function for a particular window.
The application can also add its own custom events, starting numerically after the
constant GX_FIRST_APP_EVENT. All event numbers after this constant are reserved
for the application’s use. Of course, the application’s window event handler must have
processing for such application events.
Event Processing
Just like all other widget types, there is a default window event processing function for
every window, named gx_window_event_process. You will usually override this event
handling function with your own event handler in the windows that you create. This is
how you will respond to events and take action based on events generated by the
window child controls.
Application event processing functions can take advantage (i.e., not duplicate the
processing) of the default processing by simply calling the default
gx_window_event_process directly.
Event processing is called exclusively from the context of the internal GUIX system
thread. In this way, the stack requirements to process the event handling only applies to
the GUIX thread.
Note that for the vast majority of GUIX applications, the GUIX Image Reader component
is not required. Most applications rely on the GUIX Studio application to convert JPEG
If raw format JPEG or PNG images are passed to the gx_canvas_pixelmap_draw API
function, GUIX dynamically decompresses and draws the JPEG or PNG data. Note that
this will have a significant negative impact on runtime drawing speed, and passing RAW
format image data to the gx_canvas_pixelmap_draw function is not recommended
unless you are using a hardware target that supports hardware assisted JPEG or PNG
decompression.
As an alternative, raw JPEG and PNG data may be converted to GX_PIXELMAP format
at runtime using the Image Reader component. Pixelmaps produced in this way can be
used and drawn just like pixelmaps produced by Studio and contained within your
resource file. This allows your application to perform the image decompression,
dithering, and color space conversion one time (usually during program startup) rather
than performing these operations each time the image is drawn.
gx_image_reader_create
gx_image_reader_palette_set
gx_image_reader_start
To support fade in and fade out type animations, the GUIX Animation component
requires that a canvas be created that is used strictly for the animation effect. The GUIX
Animation component provides the API service gx_animation_canvas_define for this
purpose. Other animation types do not require a separate canvas, but they will utilize it
The variables controlling an animation are defined by two control blocks. First, the
GX_ANIMATION control block which defines the animation controller. The animation
controller is the driving engine that executes the animation sequence you define. A
single animation controller can be re-used many times to run many different animation
sequences. If you need to run multiple animation sequences simultaneously, you can
create multiple GX_ANIMATION animation controllers.
} GX_ANIMATION_INFO;
The gx_animation_target member defines the target widget that the animation
controller will act upon.
The gx_animation_parent member defines the parent widget, if any, to which the
target widget will be attached when the animation sequence is complete.
The gx_animation_start_alpha field defines the starting canvas alpha value for fade
type animations.
The gx_animation_end_alpha field defines the ending canvas alpha value for fade
type animations.
The gx_animation_steps field defines how many steps the controller should execute
between the start and end position or alpha value.
The gx_animation_end_position defines the top-left ending position for the target
widget for slide type animations.
The gx_animation_delay field defines the number of GUIX timer ticks (a multiple of the
underlying OS tick rate) to delay between each frame of the animation sequence.
gx_pixelmap_transparent_detect
gx_utlity_ltoa
gx_utility_math_acos
gx_utility_math_asin
gx_utility_math_cos
gx_utility_math_sin
gx_utility_math_sqrt
gx_utility_pixelmap_resize
gx_utility_pixelmap_rotate
gx_utility_pixelmap_simple_rotate
gx_utility_rectangle_center
gx_utility_rectangle_center_find
gx_utility_rectangle_combine
gx_utility_rectangle_compare
gx_utility_rectangle_define
gx_utility_rectangle_grow
gx_utility_rectangle_inside_detect
gx_utility_rectangle_overlap_detect
gx_utility_rectangle_point_detect
Prototype
Description
Parameters
Return Values
Allowed From
Example
gx_animation_canvas_define(animation, width, height, display, memory, memsize)
/* If status is GX_SUCCESS the new canvas was successfully created and initialized. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_ANIMATION animation;
gx_animation_create(&animation);
/* If status is GX_SUCCESS the new animation controller was successfully created and initialized. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_ANIMATION animation;
gx_animation_delete(&animation);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_ANIMATION_INFO params;
params.gx_animation_type = GX_ANIMATION_SLIDE_OUT;
params.gx_animation_target = &my_window;
params.gx_animation_parent = root_window;
params.gx_animation_start_alpha = 255;
params.gx_animation_steps = 10;
params.gx_animation_delay = 2;
gx_animation_start(&animation, ¶ms);
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_ANIMATION animation;
gx_animation_stop(&animation);
See Also
Prototype
Description
This service sets the brush for the current context to the system
default value.
Parameters
Return Values
Allowed From
Example
/*Reset the brush to its default value. */
status = gx_brush_default(&my_brush);
/* If status is GX_SUCCESS the brush was successfully reset to its default value. */
See Also
gx_brush_define
Prototype
Description
This service defines a brush with the specified line color, fill color
and style.
Parameters
Return Values
Allowed From
See Also
gx_brush_default
Prototype
Description
Parameters
Return Values
Allowed From
Example
custom_button_draw()
{
/* Draw button background. */
status = gx_button_background_draw(&my_stop_button);
/* If status is GX_SUCCESS the stop button background was successfully drawn. */
/* Add your custom drawing here */
}
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
gx_button_background_draw, gx_button_deselect, gx_button_draw,
gx_button_event_process, gx_button_select, gx_radio_button_create,
gx_radio_button_draw, gx_icon_button_create, gx_pixelmap_button_create,
gx_pixelmap_button_draw, gx_text_button_create, gx_text_button_color_set,
gx_text_button_draw
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Deselect button. */
status = gx_button_deselect(&my_stop_button);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw button. */
status = gx_button_draw(&my_stop_button);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_radio_button_create, gx_radio_button_draw
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Select button. */
status = gx_button_select(&my_stop_button);
See Also
Prototype
Description
This service sets the alpha-blend value for the specified canvas.
Canvas alpha values can range from 0 (transparent) to 255 (fully
opague). Canvas alpha values are used when an application creates
a canvas with GX_CANVAS_COMPOSITE style, into which all other
managed canvases are composited prior to final display. This API is
only supported when using a screen driver of 16-bpp or higher color
depth.
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
This service draws a circle arc on the canvas using the current
brush. The circle arc is clipped to the canvas invalid region.
Parameters
Return Values
Allowed From
Example
See Also
Fixme: not sure whether the following included APIs are right.
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
This service draws a circle on the canvas using the current brush.
The circle is clipped to the canvas invalid region.
Parameters
Return Values
Allowed From
Example
See Also
Fixme: not sure whether the following included APIs are right.
Prototype
Description
This service creates the canvas with the specified properties and
associated memory.
Parameters
Return Values
Allowed From
Example
/* Define global canvas memory area. */
GX_COLOR my_canvas_memory[272*480];
/* Create “my_canvas”. */
status = gx_canvas_create(&my_canvas, "my canvas", &my_display,
(GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE),
272, 480,
default_canvas_memory, sizeof(default_canvas_memory));
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Delete “my_canvas”. */
status = gx_canvas_delete (&my_canvas);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Complete drawing on “my_canvas” and flush to display. */
status = gx_canvas_drawing_complete(&my_canvas, GX_TRUE);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
This service draws an ellipse on the canvas using the current brush.
The ellipse is clipped to the canvas invalid region.
Parameters
Return Values
Allowed From
Example
/* Draw an ellipse of semi-major radius 100, semi-minor radious 50 and centered at (200, 200). */
status = gx_canvas_ellipse_draw(200, 200, 100, 50);
See Also
Prototype
Description
This service draws a line on the canvas using the current brush. The
line is clipped to the canvas invalid region.
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
This service draws a pie into the canvas using the current brush.
The pie is clipped to the canvas invalid region.
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
This service assigns an x,y display offset for the specified canvas.
This controls the position at which the canvas is composited into the
visible frame buffer, and is often used when the canvas is smaller
than the physical display.
Parameters
Return Values
Allowed From
Example
/* Set display offset for “my_canvas”. */
status = gx_canvas_offset_set(&my_canvas, 20, 30);
/* If status is GX_SUCCESS the canvas drawing is now offset from position 20,30. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw pixelmap on active canvas */
GX_PIXELMAP *map;
gx_system_pixelmap_get(ID_MY_PIXELMAP, &map);
/* If status is GX_SUCCESS the pixelmap has been blended onto the current canvas. */
See Also
Prototype
Description
This service draws a pixel on the canvas using the line color of the
current drawing context brush.
Parameters
Return Values
Allowed From
Example
/* get my canvas: */
gx_widget_canvas_get(win, &mycanvas);
/* draw a pixel: */
gx_canvas_pixel_draw(point);
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the rotated pixelmap “my_pixelmap” has been drawn on “my_canvas”. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_canvas_block_move, gx_canvas_pixelmap_blend,
gx_canvas_pixelmap_draw,
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Shift canvas “my_canvas”. */
status = gx_canvas_shift(&my_canvas, 10, 15);
/* If status is GX_SUCCESS the canvas has been shifted by 10 pixels on the X axis and 15 on the Y
axis. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw “my_checkbox”. */
status = gx_checkbox_draw(&my_checkbox);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Process “my_event” for the checkbox “my_checkbox”. */
status = gx_checkbox_event_process(&my_checkbox, &my_event);
/* If status is GX_SUCCESS the event for checkbox “my_checkbox” has been processed. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Select “my_checkbox”. */
status = gx_checkbox_select(&my_checkbox);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
INT current_angle;
/* If status is GX_SUCCESS the current needle angle of “my_gauge” has been retireved. */
See Also
gx_circular_gauge_angle_set, gx_circular_gauge_animation_set,
gx_circular_gauge_background_draw, gx_circular_gauge_create,
gx_circular_gauge_draw, gx_circular_gauge_event_process
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Set target angle of “my_gauge” to 180. */
status = gx_circular_gauge_angle_set(&my_gauge, 180);
See Also
gx_circular_gauge_angle_get, gx_circular_gauge_animation_set,
gx_circular_gauge_background_draw, gx_circular_gauge_create,
gx_circular_gauge_draw, gx_circular_gauge_event_process
Prototype
Description
This service sets animation steps and delay time for a circular gauge
widget.
Parameters
Return Values
Allowed From
Example
/* Set animation steps and delay time of circular gauge “my_gauge” to 30 and 1,
the needle of “my_gauge” will rotate from current angle to target angle by 30 steps
with 1 tick delay between every step. */
status = gx_circular_gauge_animation_set(&my_gauge, 30, 1);
/* If status is GX_SUCCESS the steps and delay time of “my_gauge” has been set. */
See Also
gx_circular_gauge_angle_get, gx_circular_gauge_angle_set,
gx_circular_gauge_background_draw, gx_circular_gauge_create,
gx_circular_gauge_draw, gx_circular_gauge_event_process
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw circular gauge background. */
status = gx_circular_gauge_background_draw(&my_circular_gauge);
See Also
gx_circular_gauge_angle_get, gx_circular_gauge_angle_set,
gx_circular_gauge_animation_set, gx_circular_gauge_create,
gx_circular_gauge_draw, gx_circular_gauge_event_process
Prototype
Description
Parameters
/* Rotation center. */
GX_VALUE gx_circular_gauge_info_needle_xcor;
GX_VALUE gx_circular_gauge_info_needle_ycor;
GX_RESOURCE_ID gx_circular_gauge_info_needle_pixelmap;
} GX_CIRCULAR_GAUGE_INFO;
The xpos, ypos pair determine the distance the top left corner of the
gauge widget to the center-of-rotation of the gauge needle.
The xcor, ycor pair determine the distance from the top left corner of
the needle image to to the center-of-rotation of the needle image.
The needle pixelmap ID defines the source image which will be used
to draw the gauge needle. This image will be rotated as needed by
the gauge widget to display the gauge needle in any position.
Return Values
Allowed From
Example
/* Create “my_gauge”. */
status = gx_circular_gauge_create(&my_gauge, “my_gauge”, &my_parent,
&gauge_info, MY_PIXELMAP_RESOURCE_ID, GX_NULL, MY_ICON_ID, 5, 30);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw circular gauge. */
status = gx_circular_gauge_draw(&my_circular_gauge);
See Also
gx_circular_gauge_angle_get, gx_circular_gauge_angle_set,
gx_circular_gauge_animation_set, gx_circular_gauge_background_draw,
gx_circular_gauge_create, gx_circular_gauge_event_process
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_circular_gauge_angle_get, gx_circular_gauge_angle_set,
gx_circular_gauge_animation_set, gx_circular_gauge_background_draw,
gx_circular_gauge_create, gx_circular_gauge_draw
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Select “my_context” as the current context. */
status = gx_context_brush_default(&my_context);
/* If status is GX_SUCCESS the context “my_context” has been set as the default. */
See Also
Prototype
Description
Parameters
gx_canvas_rectangle_draw or
gx_canvas_polygon_draw. This
style indicates the shape should be
outlined, in addtional to optionally
being fill. If the
GX_BRUSH_OUTLINE style is set
and the GX_BRUSH_SOLID_FILL
flag is clear, the shape is only
outlined.
Return Values
Allowed From
/* If status is GX_SUCCESS the brush of the current context has been defined. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_BRUSH *my_brush;
/* If status is GX_SUCCESS the brush of the current context has been retrieved. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the brush of the current context has been set. */
See Also
Prototype
Description
This service sets the brush pattern of the current screen context.
The brush pattern is used for drawing dashed lines or dashed
outlines.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the brush of the current context has been set to the specified pattern. */
See Also
Prototype
Description
This service sets the brush style of the current screen context.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the brush style of the current context has been set. */
See Also
Prototype
Description
This service sets the width of the active brush in the current drawing
context.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the brush width of the current context has been set to 10. */
See Also
Prototype
Description
This service retrieves the color value associated with the indicated
color ID. The color value is returned in the color format of the active
context display.
Parameters
Return Values
Allowed From
Example
GX_COLOR color_value;
See Also
Prototype
Description
This service sets the fill color of the active brush in the current
drawing context.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the fill color of the current context has been set to black. */
See Also
Prototype
Description
This service retrieves the font pointer associated with the indicated
font ID. This service should only be called from within an active
drawing operation.
Parameters
Return Values
Allowed From
Example
GX_FONT *my_font;
See Also
Prototype
Description
This service sets the font in the active brush of the current drawing
context.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the font of the current context has been set. */
See Also
Prototype
Description
This service sets the line color of the active brush in the current
drawing context.
Parameters
Return Values
Allowed From
Example
/* Set the line color of the current context to black. */
status = gx_context_line_color_set(GX_COLOR_BLACK_ID);
/* If status is GX_SUCCESS the line color of the current context has been set to black. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_PIXELMAP *map;
See Also
Prototype
Description
This service assign the pixelmap of the active brush in the current
drawing context.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the pixelmap of the current context has been set. */
See Also
Prototype
Description
This service defines the raw brush of the current screen context.
Raw definitions are used when 32-bit ARGB color values are to be
passed into the brush rather than color IDs. Raw color definitions
are useful when the desired color is not present in the current
system color table or when the RGB color value is computed at
runtime.
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS the raw brush of the current context has been defined. */
See Also
Prototype
Description
This service sets the raw fill color of the current screen context. The
line_color parameter is a 32-bit ARGB format raw color value, rather
than a color ID value. Raw color definitions are useful when the
desired color is not present in the current system color table or when
the RGB color value is computed at runtime.
Parameters
Return Values
Allowed From
Example
/* Set the raw fill color of the current context. */
status = gx_context_raw_fill_color_set(GX_COLOR_BLACK);
/* If status is GX_SUCCESS the raw fill color of the current context has been set. */
See Also
Prototype
Description
This service sets the line color of the active brush in the current
drawing context. The line_color parameter is a 32-bit ARGB format
raw color value, rather than a color ID value. Raw color definitions
are useful when the desired color is not present in the current
system color table or when the RGB color value is computed at
runtime.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the raw line color of the current context has been set. */
See Also
Prototype
This service re-assigns the color value associated with the specified
color ID. This can be used to modify the color table of a display
without providing an entirely new color table. The color value
provided must be in the native format supported by the display.
Parameters
Return Values
Allowed From
Example
See Also
gx_display_color_table_set
Prototype
Parameters
Return Values
Allowed From
Example
GX_COLOR default_table[32] = { … };
See Also
gx_display_color_set
Prototype
Parameters
Return Values
Allowed From
See Also
gx_display_destroy
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
This service re-assigns the font table to be used by the display. This
service is normally invoked by the Studio generated display
configuration function, but can also be called by the application
software.
Parameters
Return Values
Allowed From
Example
GX_FONT *font_table[32] = { … };
See Also
Prototype
Parameters
Return Values
Allowed From
Example
GX_PIXELMAP *pixelmap_table[32] = { … };
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Close a drop list */
status = gx_drop_list_close(&drop_list);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
GX_DROP_LIST my_drop_list;
VOID create_list_widget(GX_VERTICAL_LIST *list, GX_WIDGET *row, INT index);
GX_RECTANGLE size;
gx_drop_list_create(&my_drop_list,
"my drop list", GX_NULL,
10, 100, create_list_widget,
GX_STYLE_BORDER_RECESSED | GX_STYLE_ENABLED,
ID_DROP_LIST, &size)
See Also:
gx_drop_list_close, gx_drop_list_event_process, gx_drop_list_open,
gx_drop_list_pixelmap_set, gx_drop_list_popup_get
Prototype
UINT gx_drop_list_event_process(GX_DROP_LIST *list, GX_EVENT *event);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the event for drop list “my_list” has been processed. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_DROP_LIST mylist;
gx_drop_list_open(&mylist);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_DROP_LIST mylist;
See Also:
Prototype
Description
This service retrieves the popup list from the drop list.
Parameters
Return Values
Allowed From
Example
GX_DROP_LIST drop_list;
GX_VERTICAL_LIST *vertical_list;
gx_drop_list_popup_get(&drop_list, &vertical_list)
See Also:
gx_drop_list_close, gx_drop_list_create, gx_drop_list_open,
gx_drop_list_pixelmap_set
Prototype
UINT gx_horizontal_list_children_position(GX_HORIZONTAL_LIST
*horizontal_list)
Description
This function positions the children for the horizontal list. This
function is called automatically when the list receives the
GX_EVENT_SHOW event, but should be called directly if the list is
modified after it has been made visible.
Parameters
Return Values
Allowed From
Example
See Also
gx_horizontal_list_create, gx_horizontal_list_event_process,
gx_horizontal_list_page_index_set, gx_horizontal_list_selected_index_get,
gx_horinzontal_list_selected_widget_get, gx_horizontal_list_selected_set,
gx_horizontal_list_total_columns_set
Prototype
UINT gx_horizontal_list_create(GX_HORIZONTAL_LIST
*horizontal_list,
GX_CONST GX_CHAR *name, GX_WIDGET *parent,
INT total_columns,
VOID (*callback)(GX_HORIZONTAL_LIST *, GX_WIDGET *, INT),
ULONG style, USHORT horizontal_list_id,
GX_CONST GX_RECTANGLE *size);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_horizontal_list_children_position, gx_horizontal_list_event_process,
gx_horizontal_list_page_index_set, gx_horizontal_list_selected_index_get,
gx_horinzontal_list_selected_widget_get, gx_horizontal_list_selected_set,
gx_horizontal_list_total_columns_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the event for horizontal list “my_list” has been processed. */
See Also
gx_horizontal_list_children_position, gx_horizontal_list_create,
gx_horizontal_list_page_index_set, gx_horizontal_list_selected_index_get,
gx_horinzontal_list_selected_widget_get, gx_horizontal_list_selected_set,
gx_horizontal_list_total_columns_set
Prototype
Description
This service sets the starting index for the horizontal list.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the starting page index of “m_list” has been set. */
See Also
gx_horizontal_list_children_position, gx_horizontal_list_create,
gx_horizontal_list_event_process, gx_horizontal_list_selected_index_get,
gx_horinzontal_list_selected_widget_get, gx_horizontal_list_selected_set,
gx_horizontal_list_total_columns_set
Prototype
UINT gx_horizontal_list_selected_index_get(GX_horizobntal_LIST
*horizontal_list,
INT *return_index);
Description
This service returns the selected list entry index of the horizontal list.
Parameters
Return Values
Allowed From
Example
/* Get the list entry at the current index of horizontal list “my_list”. */
status = gx_horizontal_list_selected_index_get(&my_list, ¤t_index_entry);
See Also
gx_horizontal_list_children_position, gx_horizontal_list_create,
gx_horizontal_list_event_process, gx_horizontal_list_page_index_set,
gx_horinzontal_list_selected_widget_get, gx_horizontal_list_selected_set,
gx_horizontal_list_total_columns_set
Prototype
UINT gx_horizontal_list_selected_widget_get(GX_horizobntal_LIST
*horizontal_list,
GX_WIDGET **return_list_entry);
Description
This service returns the selected list entry of the horizontal list. Note
that if the horizontal list has more rows than child widgets, and the
selected entry has been scrolled from view, this API will return
GX_NULL because the child widgets are re-used as the list content
is scrolled. The gx_horizontal_list_selected_index_get function will
reliably return the index of the selected item, even if that item has
been scrolled from view.
Parameters
Return Values
Allowed From
Example
/* Get the list entry at the current index of horizontal list “my_list”. */
status = gx_horizontal_list_selected_widget_get(&my_list, ¤t_list_entry);
gx_horizontal_list_children_position, gx_horizontal_list_create,
gx_horizontal_list_event_process, gx_horizontal_list_page_index_set,
gx_horizontal_list_selected_index_get, gx_horizontal_list_selected_set,
gx_horizontal_list_total_columns_set
Prototype
UINT gx_horizontal_list_selected_set(GX_HORIZONATAL_LIST
*horizontal_list,
GX_WIDGET *list_entry);
Description
Parameters
Return Values
Allowed From
Example
/* Set the list entry at the current index of horizontal list “my_list”. */
status = gx_horizontal_list_selected_set(&my_list, &my_entry);
See Also
gx_horizontal_list_children_position, gx_horizontal_list_create,
gx_horizontal_list_event_process, gx_horizontal_list_page_index_set,
gx_horizontal_list_selected_index_get, gx_horinzontal_list_selected_widget_get,
gx_horizontal_list_total_columns_set
Prototype
UINT gx_horizontal_list_total_columns_set(GX_horizobntal_LIST
*horizontal_list,
INT count);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_horizontal_list_children_position, gx_horizontal_list_create,
gx_horizontal_list_event_process, gx_horizontal_list_page_index_set,
gx_horizontal_list_selected_index_get, gx_horinzontal_list_selected_widget_get,
gx_horizontal_list_selected_set
Prototype
Description
Parameters
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Example
/* Create “my_icon_button”. */
status = gx_icon_button_create(&my_icon_button, “my_icon_button”, &my_parent,
MY_ICON_RESOURCE_ID, GX_STYLE_BORDER_RAISED,
MY_ICON_BUTTON_ID,
&size);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Create “my_icon_button”. */
status = gx_icon_button_create(&my_icon_button, “my_icon_button”, &my_parent,
MY_ICON_RESOURCE_ID, GX_STYLE_BORDER_RAISED,
MY_ICON_BUTTON_ID,
&size);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Create “my_icon_button”. */
status = gx_icon_button_create(&my_icon_button, “my_icon_button”, &my_parent,
MY_ICON_RESOURCE_ID, GX_STYLE_BORDER_RAISED,
MY_ICON_BUTTON_ID,
&size);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
/* Create “my_icon”. */
status = gx_icon_create(&my_icon, “my_icon”, &my_parent,
MY_PIXELMAP_RESOURCE_ID, GX_STYLE_BORDER_RAISED,
MY_ICON_ID,
5, 30);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw “my_icon”. */
status = gx_icon_draw(&my_icon);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
switch(event_ptr->gx_event_type)
{
case GX_EVENT_SHOW:
/* Do default handling. */
status = gx_icon_event_process(icon, event_ptr);
See Also
Prototype
Description
This service sets the pixelmap for the specified icon widget.
Parameters
Return Values
Allowed From
Example
See Also
Prototype
UINT gx_image_reader_colorspace_convert(
GX_IMAGE_READER *image_reader,
GX_PIXELMAP *outmap);
Description
Parameters
Return Values
Allowed From
All
Example
GX_IMAGE_READER my_image_reader;
GX_PIXELMAP *src_map;
GX_COLOR *palette;
INT palette_size;
GX_PIXELMAP out_map;
ULONG new_format;
If(new_format == GX_COLOR_FORMAT_8BIT_PALETTE)
{
/* Set palette information */
gx_image_reader_palette_set (&image_reader, palette, palette_size)
}
/* If status is GX_SUCCESS the “out_map” successfully load the resulting pixelmap of colorspace
convert. */
See Also
gx_image_reader_info_set, gx_image_reader_palette_set
Prototype
UINT gx_image_reader_info_set(
GX_IMAGE_READER *image_reader,
GX_PIXELMAP *pixelmap,
GX_UBYTE color_format,
GX_BOOL save_alpha,
GX_BOOL dither,
GX_BOOL compress);
Description
This service assigns the specified informations for the image reader
such as the converted pixelmap and ther target color format.
Parameters
Return Values
Allowed From
All
Example
/* If status is GX_SUCCESS image reader colorspace convert information has been set. */
See Also
gx_image_reader_colorspace_convert, gx_image_reader_palette_set
Prototype
UINT gx_image_reader_palette_set(
GX_IMAGE_READER *image_reader,
GX_COLOR *pal,
UINT palsize);
Description
Parameters
Return Values
Allowed From
All
Example
See Also
gx_image_reader_colorspace_convert, gx_image_reader_info_set
Prototype
Description
This service draws the x,y axis of a line chart. The axis colors and
line width parameters are retrieved from the line chart information
structure.
Parameters
Return Values
Allowed From
Example
/* Write a custom chart drawing function */
See Also
gx_line_chart_create, gx_line_chart_data_draw, gx_line_chart_draw,
gx_line_chart_update, gx_line_chart_y_scale_calculate
Prototype
Description
Parameters
Return Values
Allowed From
Example
chart_size = root_window->gx_widget_size;
See Also
gx_line_chart_create, gx_line_chart_data_draw, gx_line_chart_draw,
gx_line_chart_update, gx_line_chart_y_scale_calculate
Prototype
Description
This service draws the line chart data line. The line colors and line
width parameters are retrieved from the line chart information
structure.
Parameters
Return Values
Allowed From
Example
/* Write a custom chart drawing function */
See Also
gx_line_chart_create, gx_line_chart_draw, gx_line_chart_update,
gx_line_chart_y_scale_calculate
Prototype
Description
This is the default line chart drawing function, which draws the chart
axis and data line. Applications usually provide a custom drawing
function to replace the default drawing to add things such as
tickmarks, scale, or other information to the chart axis and data line
drawn by the base line chart widget.
Parameters
Return Values
Allowed From
Example
/* Write a custom chart drawing function */
See Also
Prototype
Description
This service updates the data array plotted by the line chart window,
and forces the window to redraw.
Parameters
Return Values
Allowed From
Example
INT chart_data[100];
GX_LINE_CHART chart;
See Also
Prototype
Description
This service calculates the fixed-point scaling value used to plot data
values on the chart Y axis. The chart_info parameters and chart
bounding rectangle are used to calculate this scaling value.
Parameters
Return Values
Allowed From
Example
GX_LINE_CHART chart;
INT y_scale;
gx_line_chart_y_scale_calculate(chart, &y_scale);
See Also
gx_line_chart_create, gx_line_chart_data_draw, gx_line_chart_draw,
gx_line_chart_update
Prototype
UINT gx_multi_line_text_button_create(
GX_MULTI_LINE_TEXT_BUTTON *text_button,
GX_CONST GX_CHAR *name,
GX_WIDGET *parent,
GX_RESOURCE_ID text_id,
ULONG style,
USHORT text_button_id,
GX_CONST GX_RECTANGLE *size);
Description
Parameters
Return Values
Allowed From
Example
/* Create multi-line text button “my_text_button”. */
status = gx_text_button_create(&my_text_button, "my text button", &my_parent_window,
MY_TEXT_RESOURCE_ID,
GX_STYLE_BUTTON_TOGGLE, MY_TEXT_BUTTON_ID, &size);
See Also
gx_text_button_create, gx_button_create, gx_multi_line_text_button_draw,
gx_multi_line_text_button_event_process, gx_multi_line_text_button_text_set,
gx_multi_line_text_button_text_id_set
Prototype
UINT gx_multi_line_text_button_draw(GX_MULTI_LINE_TEXT_BUTTON
*button);
Description
Parameters
Return Values
Allowed From
Example
/* Draw the text button “my_text_button”. */
void MyButtonDraw(GX_MULTI_LINE_TEXT_BUTTON *button)
{
/* do the normal drawing first */
status = gx_multi_line_text_button_draw(&my_text_button);
See Also
Prototype
UINT gx_multi_line_text_button_event_process(
GX_MULTI_LINE_TEXT_BUTTON *button,
GX_EVENT *event_ptr);
Description
This service is the default event handling function for the multi line
text button widget. This function is made accessible to applications
that want to provide custom event handling for a text button widget. .
Parameters
Return Values
Allowed From
Example
UINT MyEventHandler(GX_MULTI_LINE_TEXT_BUTTON *button, GX_EVENT *event_ptr)
{
switch(event->gx_event_type)
{
case GX_EVENT_SHOW:
gx_multi_line_text_button_event_proces(button, event_ptr);
/* add custom actions here */
break;
default:
gx_multi_line_text_button_event_proces(button, event_ptr);
break;
}
return GX_SUCCESS;
}
See Also
gx_text_button_create, gx_button_create, gx_multi_line_text_button_draw,
gx_multi_line_text_button_event_process, gx_multi_line_text_button_text_set,
gx_multi_line_text_button_text_id_set
Prototype
VOID gx_multi_line_text_button_text_draw(
GX_MULTI_LINE_TEXT_BUTTON *text_button)
Description
Parameters
Return Values
Allowed From
Example
/* Define a custom drawing function */
VOID my_button_draw(GX_MULTI_LINE_TEXT_BUTTON *button)
{
/* insert code here to draw button background */
See Also
Prototype
UINT gx_multi_line_text_button_text_id_set(
GX_MULTI_LINE_TEXT_BUTTON *text_button,
RESOURCE_ID string_id)
Description
This service sets the specified string resource ID to the text button.
The string may contain newline characters which act to display the
text on multiple lines within the button area.
Parameters
Return Values
Allowed From
Example
/* Set the string ID ”MY_STRING_ID” to the text button “my_text_button”. */
status = gx_multi_line_text_button_text_id_set(&my_text_button, MY_STRING_ID);
See Also
Prototype
UINT gx_mult_line_text_button_text_set(GX_MULTI_LINE_TEXT_BUTTON
*text_button, GX_CHAR *text)
Description
This service assigns the specified string to the text button. The string
must be statically or globally allocated, i.e. it may not be an
automatic or temporary variable.
Parameters
Return Values
Allowed From
Example
/* Set the string “my string” to the text button “my_text_button”. */
status = gx_multi_line_text_button_text_set(&my_text_button, “my\rstring”);
See Also
gx_text_button_create, gx_button_create, gx_multi_line_text_button_draw,
gx_multi_line_text_button_event_process, gx_multi_line_text_button_text_set,
gx_multi_line_text_button_text_id_set
Prototype
UINT gx_multi_line_text_input_buffer_get(
GX_MULTI_LINE_TEXT_INPUT *text_input, GX_CHAR
**buffer_address, UINT *content_size, UINT *buffer_size);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the value of buffer_address, string_size and buffer_size has been
retrieved. */
See Also
gx_single_line_text_input_buffer_clear, gx_multi_line_text_input_style_add,
gx_multi_line_text_input_create, gx_multi_line_text_input_style_remove,
gx_multi_line_text_input_style_set, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_font_set,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_input_buffer_clear(
GX_MULTI_LINE_TEXT_INPUT *text_input);
Description
This service delets all characters from the text input buffer.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text input widget has emptied its input buffer. */
See Also
gx_multi_line_text_input_buffer_get, gx_multi_line_text_input_style_add,
gx_multi_line_text_input_create, gx_multi_line_text_input_style_remove,
gx_multi_line_text_input_style_set, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_font_set,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_input_create(GX_MULTI_LINE_TEXT_INPUT
*text_input,
GX_CONST GX_CHAR *name, GX_WINDOW *parent,
GX_CHAR *input_buffer, UINT buffer_size,
ULONG style, USHORT text_input_id,
GX_CONST GX_RECTANGLE *size);
Description
Parameters
Return Values
Example
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_style_remove,
gx_multi_line_text_input_style_set, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_font_set,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_input_style_add(GX_MULTI_LINE_TEXT_INPUT
*text_input,
ULONG style);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_create, gx_multi_line_text_input_style_remove,
gx_multi_line_text_input_style_set, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_font_set,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_input_remove(GX_MULTI_LINE_TEXT_INPUT
*text_input,
ULONG style);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_set, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_font_set,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_input_style_set(
GX_MULTI_LINE_TEXT_INPUT *text_input,
ULONG style);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_remove, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_font_set,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_view_create(GX_MULTI_LINE_TEXT_VIEW
*text_view,
GX_CONST GX_CHAR *name,
GX_WINDOW *parent,
GX_CHAR *input_buffer,
ULONG style,
USHORT text_view_id,
GX_CONST GX_RECTANGLE *size);
Description
Parameters
Return Values
Allowed From
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_remove, gx_multi_line_text_input_style_set,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_font_set,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_view_event_process(GX_MULTI_LINE_TEXT_VIEW
*text_view,
GX_EVENT *event);
Description
This service processes an event for the multi-line text view widget.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the event “my_event” for text view “my_text_view” has been processed. */
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_remove, gx_multi_line_text_input_style_set,
gx_multi_line_text_view_create, gx_multi_line_text_view_font_set,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_view_text_id_set(GX_MULTI_LINE_TEXT_VIEW
*text_view,
GX_RESOURCE_ID font_id);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text view “my_text_view” will use the specified font to display its text */
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_remove, gx_multi_line_text_input_style_set,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_view_scroll(GX_MULTI_LINE_TEXT_VIEW
*text_view,
GX_VALUE amount_to_scroll);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text view “my_text_view” has been scrolled by 10 rows. */
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_remove, gx_multi_line_text_input_style_set,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_font_set, gx_multi_line_text_view_text_color_set,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_view_text_color_set(
GX_MULTI_LINE_TEXT_VIEW *text_view,
GX_RESOURCE_ID normal_text_color_id,
GX_RESOURCE_ID selected_text_color_id);
Description
This service assigns text color to the multi-line text view widget.
Parameters
Return Values
Allowed From
Example
/* Set normal text color and selected text color to the multi-line text view widget “my_text_view”. */
status = gx_multi_line_text_view_text_color_set(&my_text_view, NORMAL_TEXT_COLOR,
SELECTED_TEXT_COLOR);
/* If status is GX_SUCCESS the text view “my_text_view” will display the text using specified colors. */
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_remove, gx_multi_line_text_input_style_set,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_font_set, gx_multi_line_text_view_scroll,
gx_multi_line_text_view_text_id_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_view_text_id_set(GX_MULTI_LINE_TEXT_VIEW
*text_view,
GX_RESOURCE_ID text_id);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text view “my_text_view” will display the string
resource STRING_ID. */
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_remove, gx_multi_line_text_input_style_set,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_font_set, gx_multi_line_text_view_scroll,
gx_multi_line_text_view_text_color_set, gx_multi_line_text_view_text_set
Prototype
UINT gx_multi_line_text_view_text_set(GX_MULTI_LINE_TEXT_VIEW
*text_view,
GX_CHAR *text);
Description
This service assigns a text string to the multi-line text view widget.
Parameters
Return Values
Allowed From
Example
/* Set string “my string” to the multi-line text view widget “my_text_view”. */
status = gx_multi_line_text_view_text_set(&my_text_view, “my string”);
/* If status is GX_SUCCESS the text view “my_text_view” will display the string “my string”. */
See Also
gx_multi_line_text_input_buffer_get, gx_single_line_text_input_buffer_clear,
gx_multi_line_text_input_style_add, gx_multi_line_text_input_create,
gx_multi_line_text_input_style_remove, gx_multi_line_text_input_style_set,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_font_set, gx_multi_line_text_view_scroll,
gx_multi_line_text_view_text_color_set, gx_multi_line_text_view_text_id_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw “my_pixelmap_button”. */
status = gx_pixelmap_button_draw(&my_pixelmap_button);
See Also
Prototype
Description
This service provides default event handling for the pixelmap button
widget type.
Parameters
Return Values
Allowed From
Example
switch(event_ptr->gx_event_type)
{
case GX_EVENT_SHOW:
/* Do default handling. */
status = gx_pixelmap_button_event_process(icon, event_ptr);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
/* Draw “my_pixelmap_button”. */
status = gx_pixelmap_button_pixelmap_set (&my_pixelmap_button, NORMAL_ID, SELECTED_ID,
DISABLED_ID);
See Also
Prototype
Description
Parameters
Return Values
Example
/* Create “my_pixelmap_prompt”. */
status = gx_pixelmap_prompt_create(&my_pixelmap_prompt, “my_pixelmap_prompt”, &my_parent,
MY_TEXT_RESOURCE_ID, MY_LEFT_RESOURCE_ID,
MY_FILL_RESOURCE_ID, MY_RIGHT_RESOURCE_ID,
GX_STYLE_BORDER_RAISED, MY_PIXELMAP_PROMPT_ID,
&size);
See Also
gx_pixelmap_button_create, gx_pixelmap_button_draw,
gx_pixelmap_button_pixelmap_set, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_pixelmap_slider_create,
gx_pixelmap_slider_draw, gx_pixelmap_slider_event_process, gx_prompt_create,
gx_prompt_draw, gx_prompt_font_set, gx_prompt_text_color_set,
gx_prompt_text_get, gx_prompt_text_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw “my_pixelmap_prompt”. */
status = gx_pixelmap_prompt_draw(&my_pixelmap_prompt);
See Also
gx_pixelmap_button_create, gx_pixelmap_button_draw,
gx_pixelmap_button_pixelmap_set, gx_pixelmap_prompt_create,
gx_pixelmap_prompt_pixelmap_set, gx_pixelmap_slider_create,
gx_pixelmap_slider_draw, gx_pixelmap_slider_event_process, gx_prompt_create,
gx_prompt_draw, gx_prompt_font_set, gx_prompt_text_color_set,
gx_prompt_text_get, gx_prompt_text_set
Prototype
Description
Parameters
Return Values
Allowed From
/* Assign pixelmap IDs to “my_prompt”. Only the normal state pixelmaps are used in this case */
status = gx_pixelmap_prompt_pixelmap_set (&my_prompt, normal_left_id, normal_fill_id,
normal_right_id, 0, 0, 0);
See Also
Prototype
Description
Parameters
gx_slider_info_min_value;
gx_slider_info_max_value;
gx_slider_info_current_value;
gx_slider_info_increment;
gx_slider_info_min_travel;
gx_slider_info_max_travel;
gx_slider_info_needle_pos;
gx_slider_info_needle_width;
gx_slider_info_needle_height;
gx_slider_info_needle_inset;
gx_slider_info_needle_hotspot_offset;
pixelmap_info Pointer to a
GX_PIXELMAP_SLIDER_INFO structure
which defines the pixelmaps used the
draw the slider background and needle.
The slider background can use one or
two pixelmaps. If one, the background
Return Values
Allowed From
Example
/* Create “my_pixelmap_slider”. */
status = gx_pixelmap_slider_create(&my_pixelmap_slider, “my_pixelmap_slider”, &my_parent,
&info, &pixelmap_info,
GX_STYLE_BORDER_RAISED, MY_PIXELMAP_SLIDER_ID, &size);
See Also
gx_pixelmap_button_create, gx_pixelmap_button_draw,
gx_pixelmap_button_pixelmap_set, gx_pixelmap_prompt_create,
gx_pixelmap_prompt_draw, gx_pixelmap_prompt_pixelmap_set,
gx_pixelmap_slider_draw, gx_pixelmap_slider_event_process, gx_slider_create,
gx_slider_draw, gx_slider_event_process, gx_slider_needle_draw,
gx_slider_needle_position_get, gx_slider_needle_position_get,
gx_slider_tickmarks_draw, gx_slider_travel_get, gx_slider_value_calculate,
gx_slider_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw “my_pixelmap_slider”. */
status = gx_pixelmap_slider_draw(&my_pixelmap_slider);
See Also
gx_pixelmap_button_create, gx_pixelmap_button_draw,
gx_pixelmap_button_pixelmap_set, gx_pixelmap_prompt_create,
gx_pixelmap_prompt_draw, gx_pixelmap_prompt_pixelmap_set,
gx_pixelmap_slider_create, gx_pixelmap_slider_event_process,
gx_pixelmap_slider_pixelmap_set, gx_slider_create, gx_slider_draw,
gx_slider_event_process, gx_slider_needle_draw, gx_slider_needle_position_get,
gx_slider_needle_position_get, gx_slider_tickmarks_draw, gx_slider_travel_get,
gx_slider_value_calculate, gx_slider_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the event has been processed for pixelmap slider “my_pixelmap_slider”.
*/
See Also
gx_pixelmap_button_create, gx_pixelmap_button_draw,
gx_pixelmap_button_pixelmap_set, gx_pixelmap_prompt_create,
gx_pixelmap_prompt_draw, gx_pixelmap_prompt_pixelmap_set,
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_pixelmap_set, gx_slider_create, gx_slider_draw,
gx_slider_event_process, gx_slider_needle_draw,
gx_slider_needle_position_get, gx_slider_needle_position_get,
gx_slider_tickmarks_draw, gx_slider_travel_get, gx_slider_value_calculate,
gx_slider_value_set
Prototype
Description
Parameters
Return Values
Allowed From
/* Draw “my_pixelmap_button”. */
status = gx_pixelmap_slider _pixelmap_set (&my_pixelmap_slider, &pixinfo);
See Also
Prototype
Description
Parameters
Return Values
GX_SUCCESS (0x00)
Successful prompt create
GX_CALLER_ERROR (0x11)
Invalid caller of this function
GX_PTR_ERROR (0x07)
Invalid pointer
GX_ALREADY_CREATED (0x13)
Widget already created
GX_INVALID_WIDGET_SIZE (0x14)
Invalid widget control block
size
GX_INVALID_RESOURCE_ID (0x22) Invalid resource ID
GX_INVALID_STYLE (0x18) Invalid style
Allowed From
GX_PROGRESS_BAR_INFO info;
GX_RECTANGLE size;
info.gx_progress_bar_info_min_val = 0;
info.gx_progress_bar_info_max_val = 100;
info.gx_progress_bar_info_current_val = 0;
info.gx_progress_bar_font_id = GX_FONT_ID_SYSTEM_FONT;
info.gx_progress_bar_normal_text_color = GX_COLOR_ID_WHITE;
info.gx_progress_bar_selected_text_color = GX_COLOR_ID_BLUE;
info.gx_progress_bar_fill_pixelmap = 0;
size.gx_rectangle_left = 10;
size.gx_rectangle_top = 10;
size.gx_rectangle_right = 110;
size.gx_rectangle_bottom = 140;
See Also
gx_progress_bar_draw, gx_progress_bar_event_process, gx_progress_bar_font_set,
gx_progress_bar_info_set, gx_progress_bar_pielmap_set, gx_progress_bar_range_set,
gx_progress_bar_text_color_set, gx_progress_bar_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
UINT status = gx_progress_bar_draw(progress_bar);
See Also
gx_progress_bar_create gx_progress_bar_event_process, gx_progress_bar_font_set,
gx_progress_bar_info_set, gx_progress_bar_pielmap_set, gx_progress_bar_range_set,
gx_progress_bar_text_color_set, gx_progress_bar_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
UINT status = gx_progress_bar_event_process(progress_bar, event_ptr);
See Also
gx_progress_bar_create, gx_progress_bar_event_draw, gx_progress_bar_font_set,
gx_progress_bar_info_set, gx_progress_bar_pielmap_set, gx_progress_bar_range_set,
gx_progress_bar_text_color_set, gx_progress_bar_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
UINT status = gx_progress_bar_font_set(progress_bar, GX_FONT_ID_MEDIUM);
See Also
gx_progress_bar_create, gx_progress_bar_draw, gx_progress_bar_event_process,
gx_progress_bar_info_set, gx_progress_bar_pielmap_set, gx_progress_bar_range_set,
gx_progress_bar_text_color_set, gx_progress_bar_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_PROGRESS_BAR_INFO info;
info.gx_progress_bar_info_min_val = 0;
info.gx_progress_bar_info_max_val = 100;
info.gx_progress_bar_info_current_val = 0;
info.gx_progress_bar_font_id = GX_FONT_ID_SYSTEM_FONT;
info.gx_progress_bar_normal_text_color = GX_COLOR_ID_WHITE;
info.gx_progress_bar_selected_text_color = GX_COLOR_ID_BLUE;
info.gx_progress_bar_fill_pixelmap = 0;
See Also
gx_progress_bar_info_create, gx_progress_bar_draw, gx_progress_bar_event_process,
gx_progress_bar_font_set, gx_progress_bar_pielmap_set, gx_progress_bar_range_set,
gx_progress_bar_text_color_set, gx_progress_bar_value_set
Prototype
Description
This service assigns the pixelmap used to fill the progress bar.
Parameters
Return Values
Allowed From
Example
UINT status = gx_progress_bar_pixelmap_set(progress_bar,
GX_PIXELMAP_ID_PROGRESS_FILL);
See Also
gx_progress_bar_pielmap_create, gx_progress_bar_draw,
gx_progress_bar_event_process, gx_progress_bar_font_set, gx_progress_bar_info_set,
gx_progress_bar_range_set, gx_progress_bar_text_color_set,
gx_progress_bar_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
UINT status = gx_progress_bar_range_set(progress_bar, 0, 100);
See Also
gx_progress_bar_range_create, gx_progress_bar_draw,
gx_progress_bar_event_process, gx_progress_bar_font_set, gx_progress_bar_info_set,
gx_progress_bar_pielmap_set, gx_progress_bar_text_color_set,
gx_progress_bar_value_set
Prototype
Description
This service assigns the colors used to draw the progress bar text.
Parameters
Return Values
Allowed From
Example
UINT status = gx_progress_bar_text_color_set(progress_bar, GX_COLOR_ID_WHITE,
GX_COLOR_ID_BLUE);
/* if status == GX_SUCCESS the progress bar text colors were successfully assigned. */
See Also
gx_progress_bar_create, gx_progress_bar_draw, gx_progress_bar_event_process,
gx_progress_bar_font_set, gx_progress_bar_info_set, gx_progress_bar_pielmap_set,
gx_progress_bar_range_set, gx_progress_bar_value_set
Prototype
Description
This service assigns the progress bar current value. The progress
bar widget will automatically invalidate and redraw itself when the
progress bar value is changed.
Parameters
Return Values
Allowed From
Example
UINT status = gx_progress_bar_value_set(progress_bar, 50);
See Also
gx_progress_bar_value_create, gx_progress_bar_draw, gx_progress_bar_event_process,
gx_progress_bar_font_set, gx_progress_bar_info_set, gx_progress_bar_pielmap_set,
gx_progress_bar_range_set, gx_progress_bar_text_color_set,
Prototype
Description
Parameters
Return Values
Allowed From
/* Create “my_prompt”. */
status = gx_prompt_create(&my_prompt, “my_promPt”, &my_parent,
MY_PROMPT_TEXT_RESOURCE_ID,
GX_STYLE_BORDER_RAISED, MY_PROPMT_ID, &size);
See Also
gx_pixelmap_prompt_create, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_prompt_draw, gx_prompt_font_set,
gx_prompt_text_color_set, gx_prompt_text_get, gx_prompt_text_id_set,
gx_prompt_text_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw “my_prompt”. */
status = gx_prompt_draw(&my_prompt);
See Also
gx_pixelmap_prompt_create, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_prompt_create, gx_prompt_font_set,
gx_prompt_text_color_set, gx_prompt_text_get, gx_prompt_text_id_set,
gx_prompt_text_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the font for prompt “my_prompt” has been set. */
See Also
gx_pixelmap_prompt_create, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_prompt_create, gx_prompt_draw,
gx_prompt_text_color_set, gx_prompt_text_get, gx_prompt_text_id_set,
gx_prompt_text_set
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS the text color for prompt “my_prompt” has been set. */
See Also
gx_pixelmap_prompt_create, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_prompt_create, gx_prompt_draw,
gx_prompt_font_set, gx_prompt_text_get, gx_prompt_text_id_set,
gx_prompt_text_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Define a custom drawing function */
VOID my_prompt_draw(GX_PROMPT *prompt)
{
/* insert code here to draw prompt background */
See Also
gx_pixelmap_prompt_create, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_prompt_create, gx_prompt_draw,
gx_prompt_font_set, gx_prompt_text_color_set, gx_prompt_text_id_set,
gx_prompt_text_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_pixelmap_prompt_create, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_prompt_create, gx_prompt_draw,
gx_prompt_font_set, gx_prompt_text_color_set, gx_prompt_text_id_set,
gx_prompt_text_set
Prototype
Description
This service sets the string ID for the text prompt widget.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text ID for prompt “my_prompt” has been set. */
See Also
gx_pixelmap_prompt_create, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_prompt_create, gx_prompt_draw,
gx_prompt_font_set, gx_prompt_text_get, gx_prompt_text_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_pixelmap_prompt_create, gx_pixelmap_prompt_draw,
gx_pixelmap_prompt_pixelmap_set, gx_prompt_create, gx_prompt_draw,
gx_prompt_font_set, gx_prompt_text_color_set, gx_prompt_text_id_set,
gx_prompt_text_get
Prototype
UINT gx_radial_progress_bar_anchor_set(
GX_RADIAL_PROGRESS_BAR *progress_bar,
GX_VALUE angle);
Description
This service sets the starting angle for radial progress bar.
Parameters
Return Values
Allowed From
Example
See Also
gx_radial_progress_bar_background_draw, gx_radial_progress_bar_create,
gx_radial_progress_bar_draw, gx_radial_progress_bar_event_process,
Prototype
UINT gx_radial_progress_bar_background_draw(
GX_RADIAL_PROGRESS_BAR
*progress_bar);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_radial_progress_bar_anchor_set, gx_radial_progress_bar_create,
gx_radial_progress_bar_draw, gx_radial_progress_bar_event_process,
gx_radial_progress_bar_font_set, gx_radial_progress_bar_info_set,
gx_radial_progress_bar_text_color_set, gx_radial_progress_bar_text_draw,
gx_radial_progress_bar_value_set
Prototype
UINT gx_radial_progress_bar_create(
GX_RADIAL_PROGRESS_BAR *progress_bar,
GX_CONST GX_CHAR *name,
GX_WIDGET *parent,
GX_RADIAL_PROGRESS_BAR_INFO *info,
ULONG style
USHORT id);
Description
This service creates a radial progress bar. Many of the progress bar
parameters are defined by the
GX_RADIAL_PROGRESS_BAR_INFO structure. This structure is
defined as:
} GX_RADIAL_PROGRESS_BAR_INFO;
The xcenter and ycenter parameters specify the widget position. The
radius parameter specifies the widget size. The current_val and
anchor_val parameters specify the starting and ending angle for the
upper arc. These values are defined in terms of integer degrees with
0 degrees pointing to the right and 90 degress indicating straight up
positions.
The font_id parameter defines the font used to draw the optional text
value within the progress bar widget. normal_text_color and
selected_text_color are also used to define the optional text
drawing. The normal brush width and selected brush width
parameters define the width of the arc drawn for the lower and upper
arcs. The upper arc may be narrower, the same as, or wider than
the lower arc. Finally, the normal_brush_color and
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the radial progress bar “my_progress_bar” has been created. */
See Also
gx_radial_progress_bar_anchor_set, gx_radial_progress_bar_background_draw,
gx_radial_progress_bar_draw, gx_radial_progress_bar_event_process,
gx_radial_progress_bar_font_set, gx_radial_progress_bar_info_set,
gx_radial_progress_bar_text_color_set, gx_radial_progress_bar_text_draw,
gx_radial_progress_bar_value_set
Prototype
UINT gx_radial_progress_bar_draw(
GX_RADIAL_PROGRESS_BAR
*progress_bar);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the radial progress bar “my_progress_bar” has been drawn. */
See Also
Prototype
UINT gx_radial_progress_bar_event_process(
GX_RADIAL_PROGRESS_BAR *progress_bar,
GX_EVENT *event_ptr);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_radial_progress_bar_anchor_set, gx_radial_progress_bar_background_draw,
gx_radial_progress_bar_create, gx_radial_progress_bar_draw,
gx_radial_progress_bar_font_set, gx_radial_progress_bar_info_set,
Prototype
UINT gx_radial_progress_bar_font_set(
GX_RADIAL_PROGRESS_BAR *progress_bar,
GX_RESOURCE_ID font_id);
Description
This service sets the font of a radial progress bar widget. This
parameter has no effect if the style GX_STYLE_PROGRESS
Parameters
Return Values
Allowed From
Example
See Also
gx_radial_progress_bar_anchor_set, gx_radial_progress_bar_background_draw,
gx_radial_progress_bar_create, gx_radial_progress_bar_draw,
gx_radial_progress_bar_event_process, gx_radial_progress_bar_info_set,
gx_radial_progress_bar_text_color_set, gx_radial_progress_bar_text_draw,
gx_radial_progress_bar_value_set
Prototype
UINT gx_radial_progress_bar_info_set(
GX_RADIAL_PROGRESS_BAR *progress_bar,
GX_RADIAL_PROGRESS_BAR_INFO *info);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_radial_progress_bar_anchor_set, gx_radial_progress_bar_background_draw,
gx_radial_progress_bar_create, gx_radial_progress_bar_draw,
gx_radial_progress_bar_event_process, gx_radial_progress_bar_font_set,
gx_radial_progress_bar_text_color_set, gx_radial_progress_bar_text_draw,
gx_radial_progress_bar_value_set
Prototype
UINT gx_radial_progress_bar_text_color_set(
GX_RADIAL_PROGRESS_BAR *progress_bar,
GX_RESOURCE_ID normal_text_color,
GX_RESOURCE_ID selected_text_color);
Description
This service sets the text color of radial progress bar. This value is
only used if the style GX_STYLE_PROGRESS_TEXT_DRAW is
applied.
Parameters
Return Values
Allowed From
Example
/* Set text color for radial progress bar “my_progress_bar”. */
status = gx_radial_progress_bar_text_color_set(&my_progress_bar, normal_text_color,
selected_text_color);
See Also
gx_radial_progress_bar_anchor_set, gx_radial_progress_bar_background_draw,
gx_radial_progress_bar_create, gx_radial_progress_bar_draw,
gx_radial_progress_bar_event_process, gx_radial_progress_bar_font_set,
Prototype
UINT gx_radial_progress_bar_text_draw(
GX_RADIAL_PROGRESS_BAR *progress_bar)
Description
This service draws the text of specified radial progress bar. This
function is called internally as part of the
gx_radial_progress_bar_draw(), but is exposed to the application to
support those cases where the application defines a custom
progress bar drawing function.
Parameters
Return Values
Allowed From
Example
See Also
gx_radial_progress_bar_anchor_set, gx_radial_progress_bar_background_draw,
gx_radial_progress_bar_create, gx_radial_progress_bar_draw,
gx_radial_progress_bar_event_process, gx_radial_progress_bar_font_set,
gx_radial_progress_bar_info_set, gx_radial_progress_bar_text_color_set,
gx_radial_progress_bar_value_set
Prototype
UINT gx_radial_progress_bar_value_set(
GX_RADIAL_PROGRESS_BAR *progress_bar,
GX_VALUE value);
Description
This service sets radial progress bar value. The assigned value is
limited to the range [-360, 360], defining the possible range of
angular values for the progress bar current location. The application
must scale the real-world value being indicated to assign an angular
value to the progress bar widget.
The progress bar is drawn such that the current value indicates the
angular delta between the anchor position and the end point of the
upper arc. Negative values cause the arc to be drawn in a clockwise
direction starting at the anchor position. Positive current value
causes the arc to be drawn in a counter-clockwise direction starting
at the anchor position.
For example, to draw an arc starting at the top of the arc (12
O’Clock position) and ending at the right (3 O’Clock position), assign
an anchor value of 90 degrees and a current value of -90 degrees.
Parameters
Return Values
Allowed From
Example
See Also
gx_radial_progress_bar_anchor_set, gx_radial_progress_bar_background_draw,
gx_radial_progress_bar_create, gx_radial_progress_bar_draw,
gx_radial_progress_bar_event_process, gx_radial_progress_bar_font_set,
gx_radial_progress_bar_info_set, gx_radial_progress_bar_text_color_set,
gx_radial_progress_bar_text_draw
Prototype
Description
Parameters
Return Values
Allowed From
/* Create “my_radio_button”. */
status = gx_radio_button_create(&my_radio_button, “my_radio_button”, &my_parent,
MY_RADIO_BUTTON_TEXT_RESOURCE_ID,
GX_STYLE_BORDER_RAISED, MY_RADIO_BUTTON_ID, &size);
See Also
gx_button_background_draw, gx_button_create, gx_button_deselect,
gx_button_draw, gx_button_event_process, gx_button_select,
gx_icon_button_create, gx_pixelmap_button_create, gx_pixelmap_button_draw,
gx_text_button_create, gx_text_button_color_set, gx_text_button_draw,
gx_radio_button_draw
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw “my_radio_button”. */
status = gx_radio_button_draw(&my_radio_button);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Initialize “my_stack_control”. */
status = gx_screen_stack_create(&my_stack_control, memory, memory_size);
/* If status is GX_SUCCESS the screen control block “my_stack control” has been initialized, with
screen stack pointed to memory. */
See Also
Prototype
Description
This service detaches screen from its parent, and pushes the screen
pointer and the parent pointer onto the screen stack. The new
screen pointer is then attached to the parent.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the widget “screen” and its parent has been pushed to screen stack,
“screen” has been detached from its parent, “new_screen” has been attached to the parent. */
See Also
Prototype
Description
This service removes the topmost entry from the screen stack, and
attaches the poped screen to its parent.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the topmost entry has been removed from the screen stack,
and the popped screen has been attached to its parent. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS the pixelmaps for radio button “my_radio_button” has been set. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
gx_scroll_thumb_draw, gx_scroll_thumb_event_process
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw scroll thumb “my_scroll_thumb”. */
status = gx_scroll_thumb_draw(&my_scroll_thumb);
See Also
gx_scroll_thumb_create, gx_scroll_thumb_event_process
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the event for scroll thumb “my_scroll_thumb” has been processed. */
See Also
gx_scroll_thumb_create, gx_scroll_thumb_draw
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the event “my_event” for scrollbar “my_scrollbar” has been processed. */
See Also
Prototype
Description
This service checks the limit of the scrollbar and prevents the
scrollbar thumbwheel from traveling beyond the predefined limits.
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
GX_SCROLL_INFO my_info;
my_info.gx_scroll_value = 0;
my_info.gx_scroll_minimum = 0;
my_info.gx_scroll_maximum = 100;
my_info.gx_scroll_visible = 10;
my_info.gx_scroll_increment = 1;
See Also
Prototype
UINT gx_single_line_text_input_backspace(
GX_SINGLE_LINE_TEXT_INPUT *text_input);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text input widget has processed a backspace input character. */
See Also
gx_single_line_text_input_buffer_clear, gx_single_line_text_input_buffer_get,
gx_single_line_text_input_create, gx_single_line_text_input_character_delete,
gx_single_line_text_input_character_insert, gx_single_line_text_input_draw,
gx_single_line_text_input_end, gx_single_line_text_input_event_process,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_position_get, gx_single_line_text_input_right_arrow,
gx_single_line_text_input_style_add, gx_single_line_text_input_style_remove,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_buffer_clear(
GX_SINGLE_LINE_TEXT_INPUT *text_input);
Description
This service delets all characters from the text input buffer.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text input widget has emptied its input buffer. */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer,
gx_single_line_text_input_create, gx_single_line_text_input_character_delete,
gx_single_line_text_input_character_insert, gx_single_line_text_input_draw,
gx_single_line_text_input_end, gx_single_line_text_input_event_process,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_position_get, gx_single_line_text_input_right_arrow,
gx_single_line_text_input_style_add, gx_single_line_text_input_style_remove,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_buffer_get(
GX_SINGLE_LINE_TEXT_INPUT *text_input, GX_CHAR
**buffer_address, UINT *content_size, UINT *buffer_size);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the value of buffer_address, string_size and buffer_size has been
retrieved. */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_create, gx_single_line_text_input_character_delete,
gx_single_line_text_input_character_insert, gx_single_line_text_input_draw,
gx_single_line_text_input_end, gx_single_line_text_input_event_process,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_position_get, gx_single_line_text_input_right_arrow,
Prototype
UINT gx_single_line_text_input_character_delete(
GX_SINGLE_LINE_TEXT_INPUT *text_input);
Description
This service delete the character after the text input cursor position.
This service is called internally when a delete character event is
received, but can also be invoked by the application.
Parameters
Return Values
Allowed From
Example
/* delete character. */
status = gx_single_line_text_input_character_delete(&my_text_input);
/* If status is GX_SUCCESS the text input widget has processed a backspace input character. */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_insert, gx_single_line_text_input_draw,
gx_single_line_text_input_end, gx_single_line_text_input_event_process,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_position_get, gx_single_line_text_input_right_arrow,
gx_single_line_text_input_style_add, gx_single_line_text_input_style_remove,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_character_insert(
GX_SINGLE_LINE_TEXT_INPUT *text_input,
GX_CHAR character);
Description
This service inserts a character into the text input string at the
current cursor position.
Parameters
Return Values
Allowed From
Example
/* Insert character at current cursor position. */
status = gx_single_line_text_input_character_insert(&my_text_input, ‘A’);
/* If status is GX_SUCCESS the text input widget has inserted the characterr. */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_draw,
gx_single_line_text_input_end, gx_single_line_text_input_event_process,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_position_get, gx_single_line_text_input_right_arrow,
gx_single_line_text_input_style_add, gx_single_line_text_input_style_remove,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_create(GX_SINGLE_LINE_TEXT_INPUT
*text_input, GX_CONST GX_CHAR *name, GX_WIDGET *parent, GX_CHAR
*input_buffer, UINT buffer_size, UINT style, USHORT text_input_id,
GX_CONST GX_RECTANGLE *size);
Description
This service creates a text input widget. The caller must provide
storage for the input string and indicate the maximum length of the
string.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text input widget has processed a backspace input character. */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_character_delete,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_event_process, gx_single_line_text_input_home,
gx_single_line_text_input_left_arrow, gx_single_line_text_input_position_get,
gx_single_line_text_input_right_arrow, gx_single_line_text_input_style_add,
gx_single_line_text_input_style_remove, gx_single_line_text_input_style_set,
gx_multi_line_text_input_create, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_draw(
GX_SINGLE_LINE_TEXT_INPUT *text_input);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_end, gx_single_line_text_input_event_process,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_position_get, gx_single_line_text_input_right_arrow,
gx_single_line_text_input_style_add, gx_single_line_text_input_style_remove,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_end(
GX_SINGLE_LINE_TEXT_INPUT *text_input);
Description
This service positions the text input widget cursor at the end of the
input string.
Parameters
Return Values
Allowed From
Example
/* invoke backspace handler */
status = gx_single_line_text_input_end(&my_text_input);
/* If status is GX_SUCCESS the cursor has been moved to the end of the text input string */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_event_process,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_position_get, gx_single_line_text_input_right_arrow,
gx_single_line_text_input_style_add, gx_single_line_text_input_style_remove,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_event_process(
GX_SINGLE_LINE_TEXT_INPUT *text_input,
GX_EVENT *event_ptr);
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the text input widget has processed the event */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_position_get, gx_single_line_text_input_right_arrow,
gx_single_line_text_input_style_add, gx_single_line_text_input_style_remove,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
Prototype
UINT gx_single_line_text_input_home(
GX_SINGLE_LINE_TEXT_INPUT *text_input);
Description
Move the text input cursor position to the start of the input string.
Parameters
Return Values
Allowed From
Example
/* invoke backspace handler */
status = gx_single_line_text_input_home(&my_text_input);
/* If status is GX_SUCCESS the cursor has been moved to the home position */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_left_arrow, gx_single_line_text_input_position_get,
gx_single_line_text_input_right_arrow, gx_single_line_text_input_style_add,
gx_single_line_text_input_style_remove, gx_single_line_text_input_style_set,
gx_multi_line_text_input_create, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_left_arrow(
GX_SINGLE_LINE_TEXT_INPUT *text_input);
Description
This service moves the text input cursor one character position to
the left.
Parameters
Return Values
Allowed From
Example
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_remove, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_home, gx_single_line_text_input_position_get,
gx_single_line_text_input_right_arrow, gx_single_line_text_input_style_add,
gx_single_line_text_input_style_remove, gx_single_line_text_input_style_set,
gx_multi_line_text_input_create, gx_multi_line_text_view_create,
gx_multi_line_text_view_event_process, gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_position_get(
GX_SINGLE_LINE_TEXT_INPUT *text_input,
INT pixel_position);
Description
This service positions the text input cursor based on the requested
pixel position. The text input cursor index will be calculated based on
the x value of the pixel position.
Parameters
Return Values
Allowed From
Example
/* invoke backspace handler */
status = gx_single_line_text_input_position_get(&my_text_input, 100);
/* If status is GX_SUCCESS the text input widget cursor has been positioned */
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_home, gx_single_line_text_input_left_arrow,
gx_single_line_text_input_right_arrow, gx_single_line_text_input_style_add,
gx_single_line_text_input_style_remove, gx_single_line_text_input_style_set,
Prototype
UINT gx_single_line_text_input_right_arrow(
GX_SINGLE_LINE_TEXT_INPUT *text_input);
Description
This service moves the text input cursor one character position to
the right.
Parameters
Return Values
Allowed From
Example
/* move cursor to the right */
status = gx_single_line_text_input_right_arrow(&my_text_input);
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_home, gx_single_line_text_input_position_get,
gx_single_line_text_input_right_arrow, gx_single_line_text_input_cursor_flag_set,
gx_single_line_text_input_cursor_flag_clear
Prototype
UINT gx_single_line_text_input_style_add(
GX_SINGLE_LINE_TEXT_INPUT *text_input, ULONG style);
Description
Parameters
Allowed From
Example
/* invoke backspace handler */
status = gx_single_line_text_input_style_add(&my_text_input, GX_STYLE_CURSOR_SHOW);
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_home, gx_single_line_text_input_position_get,
gx_single_line_text_input_right_arrow, gx_single_line_text_input_style_remove,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_style_remove(
GX_SINGLE_LINE_TEXT_INPUT *text_input, ULONG style);
Description
This service removes styles from single line text input widget.
Parameters
Return Values
Allowed From
Example
/* invoke backspace handler */
status = gx_single_line_text_input_style_remove(&my_text_input, GX_STYLE_CURSOR_BLINK);
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_home, gx_single_line_text_input_position_get,
gx_single_line_text_input_right_arrow, gx_single_line_text_input_style_add,
gx_single_line_text_input_style_set, gx_multi_line_text_input_create,
gx_multi_line_text_view_create, gx_multi_line_text_view_event_process,
gx_multi_line_text_view_scroll
Prototype
UINT gx_single_line_text_input_style_set(
GX_SINGLE_LINE_TEXT_INPUT *text_input, ULONG style);
Description
This service sets styles for single line text input widget.
Parameters
Return Values
Allowed From
Example
/* Set style GX_STYLE_CURSOR_BLINK for single line text input widget “my_text_input” */
status = gx_single_line_text_input_style_set(&my_text_input, GX_STYLE_CURSOR_BLINK);
See Also
gx_single_line_text_input_backspace, gx_single_line_text_input_buffer_clear,
gx_single_line_text_input_buffer_get, gx_single_line_text_input_create,
gx_single_line_text_input_character_delete, gx_single_line_text_input_character_insert,
gx_single_line_text_input_draw, gx_single_line_text_input_end,
gx_single_line_text_input_home, gx_single_line_text_input_position_get,
gx_single_line_text_input_right_arrow, gx_single_line_text_input_style_add,
gx_single_line_text_input_style_remove, gx_multi_line_text_input_create,
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Create slider “my_slider”. */
GX_SLIDER_INFO info;
info.gx_slider_info_min_val = 0;
info.gx_slider_ info_max_val = 100;
info.gx_slider_ info_current_val = 50;
info.gx_slider_ info_increment = 1;
info.gx_slider_ info_min_travel = 20;
info.gx_slider_ info_max_travel = 20;
info.gx_slider_ info_needle_pos = 0;
info.gx_slider_info_needle_width = 10;
info.gx_slider_info_needle_height = 10;
info.gx_slider_info_needle_inset = 5;
info.gx_slider_info_needle_hotspot_offset = 5;
See Also
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_event_process, gx_pixelmap_slider_pixelmap_set,
gx_slider_draw, gx_slider_event_process, gx_slider_needle_draw,
gx_slider_needle_position_get, gx_slider_needle_position_get,
gx_slider_tickmarks_draw, gx_slider_travel_get, gx_slider_value_calculate,
gx_slider_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_event_process, gx_pixelmap_slider_pixelmap_set,
gx_slider_create, gx_slider_event_process, gx_slider_needle_draw,
gx_slider_needle_position_get, gx_slider_needle_position_get,
gx_slider_tickmarks_draw, gx_slider_travel_get, gx_slider_value_calculate,
gx_slider_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the event for slider “my_slider” has been processed. */
See Also
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_event_process, gx_pixelmap_slider_pixelmap_set,
gx_slider_create, gx_slider_draw, gx_slider_needle_draw,
gx_slider_needle_position_get, gx_slider_needle_position_get,
gx_slider_tickmarks_draw, gx_slider_travel_get, gx_slider_value_calculate,
gx_slider_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the needle for slider “my_slider” has been drawn. */
See Also
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_event_process, gx_pixelmap_slider_pixelmap_set,
gx_slider_create, gx_slider_draw, gx_slider_event_process,
gx_slider_needle_position_get, gx_slider_needle_position_get,
gx_slider_tickmarks_draw, gx_slider_travel_get, gx_slider_value_calculate,
gx_slider_value_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the needle position for slider “my_slider” has been retrieved. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the tickmarks for slider “my_slider” have been drawn. */
See Also
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_event_process, gx_pixelmap_slider_pixelmap_set,
gx_slider_create, gx_slider_draw, gx_slider_event_process,
gx_slider_needle_draw, gx_slider_needle_position_get,
gx_slider_needle_position_get, gx_slider_travel_get, gx_slider_value_calculate,
gx_slider_value_set
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS the travel max/min values for slider “my_slider” have been retrieved. */
See Also
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_event_process, gx_pixelmap_slider_pixelmap_set,
gx_slider_create, gx_slider_draw, gx_slider_event_process,
gx_slider_needle_draw, gx_slider_needle_position_get,
gx_slider_needle_position_get, gx_slider_tickmarks_draw,
gx_slider_value_calculate, gx_slider_value_set
Prototype
Description
This service calculates the slider value based on the slider needle
position. This function is called internally by GUIX when the user
moves the slider needle, but can also be invoked by the application
when implementing a custom slider widget.
Parameters
gx_slider_info_min_value;
gx_slider_info_max_value;
gx_slider_info_current_value;
gx_slider_info_increment;
gx_slider_info_min_travel;
gx_slider_info_max_travel;
gx_slider_info_needle_pos;
gx_slider_info_needle_width;
gx_slider_info_needle_height;
gx_slider_info_needle_inset;
gx_slider_info_needle_hotspot_offset;
Return Values
Example
See Also
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_event_process, gx_pixelmap_slider_pixelmap_set,
gx_slider_create, gx_slider_draw, gx_slider_event_process,
gx_slider_needle_draw, gx_slider_needle_position_get,
gx_slider_needle_position_get, gx_slider_tickmarks_draw, gx_slider_travel_get,
gx_slider_value_set
Prototype
Description
This service sets the slider value. This API can be called by the
application to move a slider needle under program control,
bypassing the need for user input to drag the slider needle.
Parameters
Return Values
/* If status is GX_SUCCESS the new value has been set for slider “my_slider”. */
See Also
gx_pixelmap_slider_create, gx_pixelmap_slider_draw,
gx_pixelmap_slider_event_process, gx_pixelmap_slider_pixelmap_set,
gx_slider_create, gx_slider_draw, gx_slider_event_process,
gx_slider_needle_draw, gx_slider_needle_position_get,
gx_slider_needle_position_get, gx_slider_tickmarks_draw, gx_slider_travel_get,
gx_slider_value_calculate
Prototype
Description
The x and y offset fields specify an offset, if desired, from the top-left
corner of the sprite widget to display the pixelmap.
The frame_delay field specifies the delay value, in GUIX timer ticks, after
displaying this frame before advancing to the next sprite frame.
Return Values
Allowed From
Example
/* Create spriter “my_sprite”. */
status = gx_slider_create(&my_sprite, “my_spriter”, &my_parent,
sprite_frame_list, frame_count,
GX_STYLE_SPRITE_AUTO|GX_STYLE_SPRITE_LOOP,
ID_MY_SPRITE, &size);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Assign frame number 3 as the current sprite frame */
status = gx_sprite_current_frame_set(&my_sprite, 3);
/* If status is GX_SUCCESS the sprite “my_sprite” has will display frame index 3. */
See Also
Prototype
Description
This service can be used to assign or re-assign the frame list used
by a sprite widget after the sprite widget has been created. For
information about the contents of a sprite frame list, refer to the
gx_sprite_create API documentation.
Parameters
Return Values
Allowed From
Example
/* Assign framelist_1, which has 10 frames, to my_sprite */
status = gx_sprite_frame_list_set(&my_sprite, framelist_1, 10);
/* If status is GX_SUCCESS the new frame list is now associated with this sprite */
See Also
Prototype
Description
This service starts a sprite auto-run sequence. The sprite widget will
cycle through the sprite frames until the last frame is reached, or will
run continuously if the GX_SPRITE_LOOP style is set.
Parameters
Return Values
Allowed From
Example
/* Start the sprite “my_sprite” */
status = gx_sprite_start(&my_sprite, 0);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Stop the sprite sequence */
status = gx_sprite_stop(&my_sprite);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Create the widget named “child_popup”, which is a child of the top-level screen “main_screen”. */
widget = gx_studio_widget_create(&main_screen_child_popup_define, &main_screen);
See Also
gx_studio_named_widget_create
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Create the widget named “child_popup”, which is a child of the top-level screen “main_screen”. */
GX_WIDGET *menu_screen;
/* If status == GX_SUCCESS the screen was created and linked to the root window. */
See Also
gx_studio_widget_create
Prototype
Description
Parameters
Allowed From
Example
/* Create the widget named “child_popup”, which is a child of the top-level screen “main_screen”. */
GX_WIDGET *menu_screen;
/* If status == GX_SUCCESS the display was initialized, a canvas was created for the display, a root
window was created for the canvas, and the requested language and theme have been installed. */
See Also
Prototype
Description
This service set the current language. The language index must be
less than the number of columns in the application string table.
Parameters
Return Values
Allowed From
Example
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
UINT gx_system_canvas_refresh(VOID);
Description
Parameters
None
Return Values
None
Allowed From
Example
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
This service marks the area of this widget as dirty. This effectively
queues the widget for re-drawing when the system event processing
has been completed.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the area associated with “my_widget” has been marked as dirty. */
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
This service marks the partial area of this widget as dirty. This
queues the widget for re-drawing by the GUIX canvas refresh
operation when the system event processing has been completed.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the partial area “partial_area” associated with “my_widget” has been
marked as dirty. */
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
current_context Pointer to destination for current drawing
context pointer
Return Values
Allowed From
Example
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
This service searches the GUIX event queue for an event of the
same type. If an event of the same type exists, the event payload is
updated to match the new event. If no matching event is found, the
gx_system_event_send function is called to add the new event to
the end of the event queue.
Parameters
Return Values
Allowed From
Example
/* Send “my_event” for processing. */
status = gx_system_event_fold(&my_event);
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
This service sends the specified event into the GUIX system event
queue. The new event is placed at the end of the queue.
Parameters
Return Values
Allowed From
Example
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
This service claims the focus for the specified widget. If the widget
did no previously have focus, it will receive a
GX_EVENT_FOCUS_GAINED event.
Parameters
Return Values
Allowed From
Example
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
UINT gx_system_initialize(VOID);
Description
Parameters
None
Return Values
Allowed From
Example
/* Initialize GUIX. */
status = gx_system_initialize();
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_CHAR ***language_table;
UINT language_count;
UINT string_count;
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_CHAR ***language_table;
UINT language_count;
UINT string_count;
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_SCROLLBAR_APPEARACE my_appearance;
See Also
gx_display_scroll_appearance_set
Prototype
Description
Parameters
Return Values
Allowed From
See Also
gx_display_scroll_appearance_get
Prototype
UINT gx_system_start(VOID);
Description
Parameters
None
Return Values
Allowed From
Example
/* Start GUIX. */
status = gx_system_start();
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
This service gets the string for the specified resource ID.
Parameters
Return Values
Allowed From
Example
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
language Language index
string_table Pointer to storage space of the string
table pointer, or NULL if the caller does
not need to get the pointer to the string
table.
get_size Pointer to the storage for the number of
strings in string table, or NULL if the
caller does not need to get the number of
strings in the string table.
Return Values
Allowed From
Example
/* If status is GX_SUCCESS . the pointer to the string table has been obtained. */
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Start a periodic timer for the widget “my_widget”. */
status = gx_system_timer_start(&my_widget, MY_TIMER_ID, 10, 20);
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Stop the periodic timer for the widget “my_widget”. */
status = gx_system_timer_stop(&my_widget, MY_TIMER_ID);
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_CHAR *version;
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS . the search was successful and “my_widget” contains the pointer to the
widget. */
See Also
gx_system_dirty_partial_add, gx_system_draw_context_get,
gx_system_event_send, gx_system_focus_claim, gx_system_initialize,
gx_system_start, gx_system_string_get, gx_system_string_table_get,
gx_system_string_table_set, gx_system_string_width_get,
gx_system_timer_start, gx_system_timer_stop, gx_system_widget_find
Prototype
Description
Parameters
Return Values
Allowed From
See Also
gx_button_background_draw, gx_button_create, gx_button_deselect,
gx_button_draw, gx_button_event_process, gx_button_select,
gx_icon_button_create, gx_pixelmap_button_create, gx_pixelmap_button_draw,
gx_text_button_color_set, gx_text_button_draw, gx_text_button_font_set,
gx_text_button_text_get, gx_text_button_text_set, gx_text_button_text_id_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw the text button “my_text_button”. */
status = gx_text_button_draw(&my_text_button);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Set the text button with the font ID MY_FONT. */
status = gx_text_button_font_set(&my_text_button, MY_FONT);
/* If status is GX_SUCCESS, the font to the text button “my_text_button” was set to MY_FONT. */
See Also
gx_button_background_draw, gx_button_create, gx_button_deselect,
gx_button_draw, gx_button_event_process, gx_button_select,
gx_icon_button_create, gx_pixelmap_button_create, gx_pixelmap_button_draw,
gx_text_button_create, gx_text_button_draw, gx_text_button_color_set,
gx_text_button_text_get, gx_text_button_text_set, gx_text_button_text_id_set
Prototype
Description
Parameters
Return Values
Allowed From
See Also
gx_button_background_draw, gx_button_create, gx_button_deselect,
gx_button_draw, gx_button_event_process, gx_button_select,
gx_icon_button_create, x_pixelmap_button_create, gx_pixelmap_button_draw,
gx_text_button_create, gx_text_button_draw, gx_text_button_font_set,
gx_text_button_text_get, gx_text_button_text_set, gx_text_button_text_id_set
Prototype
Description
This support function draws the text portion of a text button. This
function is called internally by gx_text_button_draw, and is provided
as a separate API as a convenience for applications that define a
custom button drawing function. Applications that want to customize
the button background drawing can provide their custom drawing
function, and invoke the gx_text_button_text_draw service as part of
their custom drawing to draw the button text over the background.
Parameters
Return Values
Allowed From
Example
/* Define a custom drawing function */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Get the string from the text button “my_text_button”. */
status = gx_text_button_text_color_get(&my_text_button, &string);
/* If status is GX_SUCCESS, the string pointer from “my_text_button” is retrieved and stored in
string. */
See Also
Prototype
Description
This service sets the specified string resource ID to the text button.
Parameters
Return Values
Allowed From
Example
/* Set the string ID ”MY_STRING_ID” to the text button “my_text_button”. */
status = gx_text_button_text_id_set(&my_text_button, MY_STRING_ID);
See Also
gx_button_background_draw, gx_button_create, gx_button_deselect,
gx_button_draw, gx_button_event_process, gx_button_select,
gx_icon_button_create, x_pixelmap_button_create, gx_pixelmap_button_draw,
gx_text_button_create, gx_text_button_draw, gx_text_button_font_set,
gx_text_button_text_color_set, gx_text_button_text_get
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Set the string “my string” to the text button “my_text_button”. */
status = gx_text_button_text_set(&my_text_button, “my string”);
See Also
gx_button_background_draw, gx_button_create, gx_button_deselect,
gx_button_draw, gx_button_event_process, gx_button_select,
gx_icon_button_create, x_pixelmap_button_create, gx_pixelmap_button_draw,
gx_text_button_create, gx_text_button_draw, gx_text_button_font_set,
gx_text_button_text_color_set, gx_text_button_text_get,
gx_text_button_text_id_set
Prototype
Description
Parameters
Return Values
None
Allowed From
All
Example
/* Convert “my_value” into an ASCII string. */
gx_utility_ltoa(my_value, my_value_string, sizeof(my_value_string));
See Also
gx_utility_math_cos, gx_utility_math_sin, gx_utility_math_sqrt,
gx_utility_pixelmap_rotate, gx_utility_pixelmap_simple_rotate,
gx_utility_rectangle_center, gx_utility_rectangle_center_find,
gx_utility_rectangle_combine, gx_utility_rectangle_compare,
gx_utility_rectangle_define, gx_utility_rectangle_grow,
gx_utility_rectangle_overlap_detect, gx_utility_rectangle_point_detect,
gx_utility_rectangle_shift
Prototype
Description
Parameters
Return Values
Allowed From
All
Example
/* Compute the angle value of arc cosine of “x”. */
angle = gx_utility_math_acos(x);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
All
Example
/* Compute the angle value of arc sine of “x”. */
angle = gx_utility_math_asin(x);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
All
Example
/* Compute cosine of “my_angle”. */
my_angle_cosine = gx_utility_math_cos(my_angle);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
All
Example
/* Compute sine of “my_angle”. */
my_angle_sine = gx_utility_math_sin(my_angle);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
All
Example
/* Compute square root of “my_value”. */
my_square_root = gx_utility_math_sqrt(my_value);
See Also
Prototype
Description
Parameters
Return Values
None
Allowed From
All
Example
rot_cx = source_rotate_center_x;
rot_cy = source_rotate_center_y;
See Also
Prototype
Description
Parameters
Return Values
None
Allowed From
All
Example
rot_cx = source_rotate_center_x;
rot_cy = source_rotate_center_y;
See Also
gx_utility_ltoa, gx_utility_math_cos, gx_utility_math_sin, gx_utility_math_sqrt,
gx_utility_pixelmap_rotate, gx_utility_rectangle_center,
gx_utility_rectangle_center_find, gx_utility_rectangle_combine,
gx_utility_rectangle_compare, gx_utility_rectangle_define,
gx_utility_rectangle_grow, gx_utility_rectangle_overlap_detect,
gx_utility_rectangle_point_detect, gx_utility_rectangle_shift
Prototype
Description
Parameters
Return Values
None
Allowed From
All
Example
/* Center “my_inner_rectangle” inside of “my_outer_rectangle”. */
gx_utility_rectangle_center(&my_inner_rectangle, &my_outer_rectangle);
See Also
gx_utility_ltoa, gx_utility_math_cos, gx_utility_math_sin, gx_utility_math_sqrt,
gx_utility_pixelmap_rotate, gx_utility_pixelmap_simple_rotate,
gx_utility_rectangle_center_find, gx_utility_rectangle_combine,
gx_utility_rectangle_compare, gx_utility_rectangle_define,
gx_utility_rectangle_grow, gx_utility_rectangle_overlap_detect,
gx_utility_rectangle_point_detect, gx_utility_rectangle_shift
Prototype
Description
Parameters
rectangle Rectangle
return_center Pointer to destination to store found
center point
Return Values
None
Allowed From
All
Example
/* Find center of “my_rectangle””. */
gx_utility_rectangle_center_find(&my_rectangle, &my_center_point);
See Also
gx_utility_ltoa, gx_utility_math_cos, gx_utility_math_sin, gx_utility_math_sqrt,
gx_utility_pixelmap_rotate, gx_utility_pixelmap_simple_rotate,
gx_utility_rectangle_center, gx_utility_rectangle_combine,
gx_utility_rectangle_compare, gx_utility_rectangle_define,
gx_utility_rectangle_grow, gx_utility_rectangle_overlap_detect,
gx_utility_rectangle_point_detect, gx_utility_rectangle_shift
Prototype
Description
This service combines the first and second rectangle into the first
rectangle. The first rectangle is expanded to include the second.
Parameters
Return Values
None
Allowed From
All
Example
/* Combine “my_rectangle_a” to “my_rectangle_b”. */
gx_utility_rectangle_combine(&my_rectangle_a, &my_rectangle_b);
See Also
gx_utility_ltoa, gx_utility_math_cos, gx_utility_math_sin, gx_utility_math_sqrt,
gx_utility_pixelmap_rotate, gx_utility_pixelmap_simple_rotate,
gx_utility_rectangle_center, gx_utility_rectangle_center_find,
gx_utility_rectangle_compare, gx_utility_rectangle_define,
gx_utility_rectangle_grow, gx_utility_rectangle_overlap_detect,
gx_utility_rectangle_point_detect, gx_utility_rectangle_shift
Prototype
GX_BOOL gx_utility_rectangle_compare(
GX_RECTANGLE *first_rectangle,
GX_RECTANGLE *second_rectangle);
Description
This service compares the first and second rectangle. If they are
equal, a value of GX_TRUE is returned.
Parameters
Return Values
Allowed From
All
Example
/* Compare “my_rectangle_a” to “my_rectangle_b”. */
result = gx_utility_rectangle_compare(&my_rectangle_a, &my_rectangle_b);
See Also
Prototype
Description
Parameters
Return Values
None
Allowed From
All
Example
/* Define “my_rectangle”. */
gx_utility_rectangle_define(&my_rectangle, 10, 5, 200, 100);
/* “my_rectangle” is defined. */
See Also
gx_utility_ltoa, gx_utility_math_cos, gx_utility_math_sin, gx_utility_math_sqrt,
gx_utility_pixelmap_rotate, gx_utility_pixelmap_simple_rotate,
gx_utility_rectangle_center, gx_utility_rectangle_center_find,
gx_utility_rectangle_combine, gx_utility_rectangle_compare,
gx_utility_rectangle_grow, gx_utility_rectangle_overlap_detect,
gx_utility_rectangle_point_detect, gx_utility_rectangle_shift
Prototype
UINT gx_utility_rectangle_overlap_detect
(GX_RECTANGLE *first_rectangle,
GX_RECTANGLE *second_rectangle,
GX_RECTANGLE *return_overlap_area);
Description
Parameters
Return Values
Allowed From
All
Example
/* Detect overlap of “my_rectangle_a” and “my_rectangle_b”. */
result = gx_utility_rectangle_overlap_detect(&my_rectangle_a, &my_rectangle_b,
&my_overlap_area);
See Also
Prototype
Description
Parameters
rectangle Rectangle
point Point
Return Values
Allowed From
All
Example
/* Detect if point “my_point” is within “my_rectangle””. */
result = gx_utility_rectangle_point_detect(&my_rectangle, &my_point);
See Also
gx_utility_ltoa, gx_utility_math_cos, gx_utility_math_sin, gx_utility_math_sqrt,
gx_utility_pixelmap_rotate, gx_utility_pixelmap_simple_rotate,
gx_utility_rectangle_center, gx_utility_rectangle_center_find,
gx_utility_rectangle_combine, gx_utility_rectangle_compare,
gx_utility_rectangle_define, gx_utility_rectangle_grow,
gx_utility_rectangle_overlap_detect, gx_utility_rectangle_shift
Prototype
Description
Parameters
Return Values
None
Allowed From
All
Example
/* Adjust “my_rectangle” by increasing 20 pixels on four sides */
gx_utility_rectangle_adjust(&my_rectangle, 20);
See Also
gx_utility_ltoa, gx_utility_math_cos, gx_utility_math_sin, gx_utility_math_sqrt,
gx_utility_pixelmap_rotate, gx_utility_pixelmap_simple_rotate,
gx_utility_rectangle_center, gx_utility_rectangle_center_find,
gx_utility_rectangle_combine, gx_utility_rectangle_compare,
gx_utility_rectangle_define, gx_utility_rectangle_overlap_detect,
gx_utility_rectangle_point_detect, gx_utility_rectangle_shift
Prototype
Description
Parameters
Return Values
None
Allowed From
All
Example
/* Shift “my_rectangle”. */
gx_utility_rectangle_shift(&my_rectangle, 10, 20);
See Also
Prototype
UINT gx_vertical_list_children_position(GX_VERTICAL_LIST
*vertical_list)
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_vertical_list_create, gx_vertical_list_event_process,
gx_vertical_list_page_index_set, gx_vertical_list_selected_index_get,
gx_vertical_list_selecgted_widget_get, gx_vertical_list_selected_widget_get,
gx_vertical_list_selected_set, gx_vertical_list_total_rows_set
Prototype
UINT gx_vertical_list_create(GX_VERTICAL_LIST *vertical_list,
GX_CONST GX_CHAR *name, GX_WIDGET *parent, INT total_rows,
VOID (*callback)(GX_VERTICAL_LIST *, GX_WIDGET *, INT),
ULONG style, USHORT vertical_list_id,
GX_CONST GX_RECTANGLE *size);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_vertical_list_children_position, gx_vertical_list_event_process,
gx_vertical_list_page_index_set, gx_vertical_list_selected_index_get,
gx_vertical_list_selected_widget_get, gx_vertical_list_selected_set,
gx_vertical_list_total_rows_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the event for vertical list “my_list” has been processed. */
See Also
gx_vertical_list_children_position, gx_vertical_list_create,
gx_vertical_list_page_index_set, gx_vertical_list_selected_index_get,
gx_vertical_list_selected_widget_get, gx_vertical_list_selected_set,
gx_vertical_list_selected_set
Prototype
Description
This service sets the starting index for the vertical list.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the starting page index of “m_list” has been set. */
See Also
gx_vertical_list_children_position, gx_vertical_list_create,
gx_vertical_list_event_process, gx_vertical_list_selected_index_get,
gx_vertical_list_selected_widget_get, gx_vertical_list_selected_set,
gx_vertical_list_total_rows_set
Prototype
UINT gx_vertical_list_selected_index_get(GX_VERTICAL_LIST
*vertical_list,
INT *return_index);
Description
Parameters
Return Values
Allowed From
Example
/* Get the list entry at the current index of vertical list “my_list”. */
status = gx_vertical_list_selected_index_get(&my_list, ¤t_list_index);
/* If status is GX_SUCCESS, “current_list_index” contains the index of the selected list item. */
See Also
gx_vertical_list_children_position, gx_vertical_list_create,
gx_vertical_list_event_process, gx_vertical_list_page_index_set,
gx_vertical_list_selected_widget_get, gx_vertical_list_selected_set,
gx_vertical_list_total_rows_set
Prototype
UINT gx_vertical_list_selected_widget_get(GX_VERTICAL_LIST
*vertical_list,
GX_WIDGET **return_list_entry);
Description
This service returns the selected widget of the vertical list. Note that
if the list contains more rows than child widgets, and the selected
child widget has been scrolled from view, this function will return
GX_NULL as the GX_WIDGET pointer, since the widget has been
re-used to display a new list entry.
Parameters
Return Values
Allowed From
Example
/* Get the list entry at the current index of vertical list “my_list”. */
status = gx_vertical_list_selected_widget_get(&my_list, ¤t_list_entry);
See Also
gx_vertical_list_children_position, gx_vertical_list_create,
gx_vertical_list_event_process, gx_vertical_list_page_index_set,
gx_vertical_list_selected_index_get, gx_vertical_list_selected_set,
gx_vertical_list_total_rows_set
Prototype
UINT gx_vertical_list_selected_set
(GX_VERTICAL_LIST *vertical_list,
GX_WIDGET *list_entry);
Description
This service sets the list entry at the current list index.
Parameters
Return Values
Allowed From
Example
/* Set the list entry at the current index of vertical list “my_list”. */
status = gx_vertical_list_selected_set(&my_list, &my_entry);
See Also
gx_vertical_list_children_position, gx_vertical_list_create,
gx_vertical_list_event_process, gx_vertical_list_page_index_get,
gx_vertical_list_selected_index_get, gx_vertical_list_selected_widget_get,
gx_vertical_list_total_rows_set
Prototype
UINT gx_vertical_list_total_rows_set
(GX_VERTICAL_LIST *vertical_list,
INT count);
Description
Parameters
Return Values
Allowed From
Example
See Also
gx_vertical_list_children_position, gx_vertical_list_create,
gx_vertical_list_event_process, gx_vertical_list_page_index_set,
gx_vertical_list_selected_index_get, gx_vertical_list_selected_widget_get,
gx_vertical_list_selected_set
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_TEXT_BUTTON *button;
See Also
Prototype
Description
This service attaches the widget to the specified parent. If the widget
is already attached to another parent, it is first detached. If the
widget is already attached to the same parent, the function does
nothing.
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw the widget background */
status = gx_widget_background_draw(widget);
See Also
Prototype
Description
This service attaches the widget to the specified parent. If the widget
is already attached to another parent, it is first detached. If the
widget is already attached to the same parent, the function does
nothing.
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
This service moves the widget to the back in the parent's Z-order of
child widgets.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS and “moved_flag” is GX_TRUE, the widget “my_widget” was moved to
the back. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
See Also
Prototype
Description
Parameters
Return Values
Example
/* Draw border of “my_widget”. */
status = gx_widget_border_draw(&my_widget, GX_COLOR_BLACK, GX_COLOR_GREEN,
GX_COLOR_BLUE, GX_TRUE);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS the widget “my_widget” border style has been set. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS, “my_width” contains the border width of the widget “my_widget”. */
See Also
Prototype
Description
This service returns a pointer to the canvas onto which this widget is
rendered.
Parameters
Return Values
Allowed From
Example
/* Get canvas associated with “my_widget”. */
status = gx_widget_canvas_get(&my_widget, &my_canvas);
See Also
Prototype
Description
This service detects if the widget is a child of the parent widget. This
service nests to search children of children, and returns TRUE if the
parent widget is at any level an ancestor of the child widget.
Parameters
Return Values
Allowed From
See Also
Prototype
Description
This service draws all children of the parent widget. This service is
normally invoked by all standard widget drawing functions to draw
any existing child widgets, and should be invoked by any custom
drawing functions to allow child widgets to be attached to your
custom parent widget type.
Parameters
Return Values
Allowed From
Example
/* Draw children of “my_widget”. */
status = gx_widget_children_draw(&my_widget);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
This service gets the color associated with the supplied resource ID.
This service should only be called by visible widgets.
Parameters
widget Pointer to widget control block
resource_id Resource ID of color. Appendix B
contains pre-defined color Resource IDs.
Note that the application may add
custom color Resource IDs as well.
return_color Pointer to destination for color.
Appendix A contains pre-defined colors.
Note that the application may add
custom colors as well.
Return Values
Allowed From
See Also
gx_widget_font_get, gx_widget_pixelmap_get
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Test to see if widget “my_widget” is created. */
status = gx_widget_created_test(&my_widget, &was_created);
/* If status is GX_SUCCESS and “was_created” is GX_TRUE, the widget “my_widget” has been
created. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Delete widget “my_widget”. */
status = gx_widget_delete(&my_widget);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Detach widget “my_widget” from its parent. */
status = gx_widget_detach(&my_widget);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw widget “my_widget”. */
status = gx_widget_draw(&my_widget);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Set the drawing function of widget “my_widget” to “my_drawing_function”. */
status = gx_widget_draw_set(&my_widget, my_drawing_function);
/* If status is GX_SUCCESS the widget “my_widget” has the drawning function “my_drawing_function”.
*/
See Also
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS the redraw event for widget “my_widget” has been generated. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Process event “my_event” for widget “my_widget”. */
status = gx_widget_event_process(&my_widget, &my_event);
/* If status is GX_SUCCESS the event “my_event” for widget “my_widget” has been processed. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Send my_event to the widget’s parent */
status = gx_widget_event_to_parent(&my_widget, my_event);
/* If status is GX_SUCCESS the event has been delivered to the parent of my_widget. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS, the pointer “widget_found” contains the pointer to the widget found. */
See Also
Prototype
Description
This service retrieves the font associated with the specified resource
ID from the font table of the display on which this widget is visible.
This function should only be called by a visible widget.
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the focus has been moved to the next widget in the navigation order */
See Also
gx_widget_focus_previous
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* If status is GX_SUCCESS the input focus has been moved to the previous widget. */
See Also
gx_widget_focus_next
Prototype
Description
This service retrieves the font associated with the specified resource
ID from the font table of the display on which this widget is visible.
This function should only be called by a visible widget.
Parameters
Return Values
Allowed From
Example
See Also
gx_widget_color_get, gx_widget_pixelmap_get
Prototype
Description
This service moves the widget to the front in the parent Z-order list
of child widgets.
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS and “widget_moved” is GX_TRUE, the widget “my_widget” was moved to
the front . */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Get height for widget “my_widget”. */
status = gx_widget_height_get(&my_widget, &widget_height);
See Also
Prototype
Description
This service hides the widget. This widget is still attached to it's
parent, but it is not allowed to draw on the canvas.
Parameters
Return Values
Allowed From
Example
/* Hide widget “my_widget”. */
status = gx_widget_hide(&my_widget);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
GX_PIXELMAP *my_pixelmap;
See Also
gx_widget_color_get, gx_widget_font_get
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Resize widget “my_widget”. */
status = gx_widget_resize(&my_widget, &new_size);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
This service shows the widget. The widget will become visible only if
it is attached to a parent and the parent widget is also visible.
Parameters
Return Values
Allowed From
Example
/* Show widget “my_widget”. */
status = gx_widget_show(&my_widget);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
This service removes the specified status flags from the widgets
internal status variable.
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS the widget “my_widget” status was tested and the result in “test_result”. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
This service blends the specified text over a widget using current
brush and text alignment.
Parameters
Return Values
Allowed From
Example
/* Blend “my_string” over “my_widget” given alpha value 120. */
status = gx_widget_text_blend(&my_widget, my_text_color, my_font_id,
&my_string, xoffset, yoffset, 120);
See Also
gx_widget_text_draw, gx_widget_text_id_draw
Prototype
Description
This service draws the specified text over a widget using current
brush and text alignment.
Parameters
Return Values
Allowed From
Example
/* Draw “my_string” over “my_widget”. */
status = gx_widget_text_draw(&my_widget, my_text_color, my_font_id,
&my_string, xoffset, yoffset);
See Also
gx_widget_text_blend, gx_widget_text_id_draw,
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw text over “my_widget” given text id “my_string_id”. */
status = gx_widget_text_id(&my_widget, my_text_color, my_font_id,
&my_string_id, xoffset, yoffset);
/* If status is GX_SUCCESS the text given by “my_string_id” has been draw over “my_widget”. */
See Also
gx_widget_text_blend, gx_widget_text_draw
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Get width of widget “my_widget”. */
status = gx_widget_width_get(&my_widget, &my_widget_width);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Get client height of “my_window”. */
status = gx_window_client_height_get(&my_window, &my_client_height);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Scroll clients of “my_window”. */
status = gx_window_client_scroll(&my_window, 10, 0);
See Also
gx_window_canvas_set, gx_window_client_height_get,
gx_window_client_width_get, gx_window_create, gx_window_draw,
gx_window_event_process, gx_window_root_create, gx_window_root_delete,
gx_window_root_event_process, gx_window_root_find,
gx_window_scroll_info_get, gx_window_scrollbar_find,
gx_window_wallpaper_get, gx_window_wallpaper_set
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Get client width of “my_window”. */
status = gx_window_client_width_get(&my_window, &my_client_width);
See Also
Prototype
Description
This service forces a modal window to detach from it’s parent and
return from the modal execution loop.
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Draw window “my_window”. */
status = gx_window_draw(&my_window);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Process “my_event” for window “my_window”. */
status = gx_window_event_process(&my_window, &my_event);
/* If status is GX_SUCCESS the event for window “my_window” has been processed. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Process “my_event” for window “my_window”. */
status = gx_window_event_process(&my_window, &my_event);
/* If status is GX_SUCCESS the event for window “my_window” has been processed. */
See Also
Prototype
Parameters
Return Values
Allowed From
/* If status is GX_SUCCESS the window was executed, and return_code holds the execution return
code.. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Delete a root window */
status = gx_window_root_delete(&root_window);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
status = gx_window_root_event_process(&root_window, &my_event);
See Also
Prototype
Description
This service finds the root window for the specified widget.
Parameters
Return Values
Allowed From
Example
/* Find root window associated with window “my_window”. */
status = gx_window_root_find(&my_window, &root_window);
/* If status is GX_SUCCESS the “root_window” contains the root window for window “my_window”. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Get scroll information for window “my_window”. */
status = gx_window_scroll_info_get(&my_window, GX_SCROLLBAR_HORIZONTAL, &scroll_info);
/* If status is GX_SUCCESS the “scroll_info” contains the scroll information for window “my_window”.
*/
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Find horizontal scrollbar for window “my_window”. */
status = gx_window_scrollbar_find(&my_window, GX_SCROLLBAR_HORIZONTAL,
&my_scrollbar);
/* If status is GX_SUCCESS the “my_scrollbar” contains the horizontal scrollbar for window
“my_window”. */
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Get wallpaper for window “my_window”. */
status = gx_window_wallpaper_get(&my_window, &my_window_wallpaper);
See Also
Prototype
Description
Parameters
Return Values
Allowed From
Example
/* Set wallpaper for window “my_window”. */
status = gx_window_wallpaper_set(&my_window, MY_WALLPAPER_RESOURCE_ID, GX_TRUE);
See Also
GUIX provides a default set of drawing functions for each supported color
depth and color format. When implementing a display driver with no
specific hardware acceleration capability or other hardware specific
considerations, these default drawing functions are normally sufficient for
the final driver implementation. For these simplest of drivers, the only
function that normally needs to be implemented in the driver software is a
function to configure the hardware device. This often involves initializing
various hardware registers to define the LCD display clock, display
dimensions etc. For all other functions, the driver implementaton simply
initialize the GX_DISPLAY function pointers to the default function
implementations for the desired color depth and format.
If you are writing a custom display driver, you will need to include the
gx_display.h header file in your custom driver source, which is an internal
use header file not available to application level software.
ULONG gx_display_handle:
VOID (*gx_display_driver_simple_wide_line_draw)(GX_DRAW_CONTECT
*context, INT x1, INTy1, INT x2, INT y2): This is a pointer to a function to
implement generic wide line drawing, no anti-aliasing. Default
implementations of this function are provided for each supported color
depth and color format.
VOID (*gx_display_driver_anti_aliased_line_draw)(GX_DRAW_CONTECT
*context, INT x1, INTy1, INT x2, INT y2): This is a pointer to a function to
implement generic anti-aliased line drawing. Default implementations of
this function are provided for each supported color depth and color format.
VOID
(*gx_display_driver_anti_aliased_wide_line_draw)(GX_DRAW_CONTECT
*context, INT x1, INTy1, INT x2, INT y2): This is a pointer to a function to
implement generic anti-aliased wide line drawing, no anti-aliasing. Default
implementations of this function are provided for each supported color
depth and color format.
VOID (*gx_display_driver_horizonal_line_draw)(GX_DRAW_CONTECT
*context, INT x1, INT x2, INT y): This is a pointer to a function to implement
the special case of horizontal line drawing. Default implementations of this
function are provided for each supported color depth and color format.
VOID (*gx_display_driver_vertical_line_draw)(GX_DRAW_CONTECT
*context, INT y1, INT y2, INT x): This is a pointer to a function to implement
the special case of horizontal line drawing. Default implementations of this
function are provided for each supported color depth and color format.
VOID
(*gx_display_driver_horizonal_pattern_line_draw)(GX_DRAW_CONTECT
*context, INT x1, INT x2, INT y): This is a pointer to a function to implement
horizontal pattern line drawing. Default implementations of this function are
provided for each supported color depth and color format.
VOID
(*gx_display_driver_vertical_pattern_line_draw)(GX_DRAW_CONTECT
*context, INT y1, INT y2, INT x): This is a pointer to a function to implement
vertical pattern line drawing. Default implementations of this function are
provided for each supported color depth and color format.
VOID (*gx_display_driver_pixelmap_blend)(GX_DRAW_CONTEXT
*context, INT xpos, INT ypos, GX_PIXELMAP *pmp, GX_UBYTE alpha):
This is a pointer to a function to blend a pixelmap on the background
canvas defined by the draw context. The supplied alpha value may be in
addition to an alpha channel contained in the pixelmap data.
VOID (*gx_display_driver_pixelmap_draw)(GX_DRAW_CONTEXT
*context, INT xpos, INT ypos, GX_PIXELMAP *pmp): This is a pointer to a
function to draw a pixelmap into the canvas defined by the draw context.
VOID (*gx_display_driver_anti_aliased_circle_draw)
(GX_DRAW_CONTEXT*context, INT xcenter, INT ycenter, UINT r): Pointer
to a function to draw an anti-aliased circle.
VOID (*gx_display_driver_anti_aliased_arc_draw)(GX_DRAW_CONTEXT
*context, INT xcenter, INT ycenter, UINT r, INT start_angle, INTend_angle)
: Pointer to a function to draw an anti-aliased arc.
VOID (*gx_display_driver_8bit_glyph_draw)(GX_DRAW_CONTEXT
*context, GX_RECTANGLE *draw_area, GX_POINT *map_offset, const
GX_GLYPH *glyph): Pointer to function to draw one 8-bit aliased text glyph
to the canvas using the brush of the current drawing context.
VOID (*gx_display_driver_4bit_glyph_draw)(GX_DRAW_CONTEXT
*context, GX_RECTANGLE *draw_area, GX_POINT *map_offset, const
GX_GLYPH *glyph): Pointer to function to draw one 4-bit aliased text glyph
to the canvas using the brush of the current drawing context.
VOID (*gx_display_driver_1bit_glyph_draw)(GX_DRAW_CONTEXT
*context, GX_RECTANGLE *draw_area, GX_POINT *map_offset, const
GX_GLYPH *glyph): Pointer to function to draw one 1-bit monochrome text
glyph to the canvas using the brush of the current drawing context.
#include "tx_api.h"
#include "gx_api.h"
/* User-defined color ID */
#define GX_COLOR_ID_BLACK GX_FIRST_USER_COLOR
#define GX_COLOR_ID_WHITE (GX_FIRST_USER_COLOR + 1)
/* In this demo, two color entries are added to the color table. */
GX_COLOR_BLACK,
GX_COLOR_WHITE
};
int main(void)
{
/* Enter ThreadX. */
tx_kernel_enter();
return (0);
}
GX_RECTANGLE root_window_size;
GX_RECTANGLE prompt_position;
/* Initialize GUIX. */
gx_system_initialize();
/* Create a text prompt on the root window. Set the text color to white,
and the background to black. */
/* Create the prompt on top of the root window using the string defined by
string ID SID_HELLO_WORLD. */
gx_prompt_create(&demo_prompt, NULL, &demo_root_window, SID_HELLO_WORLD,
GX_STYLE_NONE, GX_ID_NONE, &prompt_position);
/* Set the text color to be white, and the background color to be black. */
gx_prompt_text_color_set(&demo_prompt, GX_COLOR_ID_WHITE, GX_COLOR_ID_WHITE);
gx_widget_background_set(&demo_prompt, GX_COLOR_ID_BLACK, GX_COLOR_ID_BLACK);
General Styles:
GX_STYLE_BORDER_NONE 0x00000000
GX_STYLE_BORDER_RAISED 0x00000001
GX_STYLE_BORDER_RECESSED 0x00000002
GX_STYLE_BORDER_THIN 0x00000004
GX_STYLE_BORDER_THICK 0x00000008
GX_STYLE_BORDER_MASK 0x0000000f
GX_STYLE_TRANSPARENT 0x10000000
GX_STYLE_DRAW_SELECTED 0x20000000
GX_STYLE_ENABLED 0x40000000
GX_STYLE_BUTTON_PUSHED 0x00000010
GX_STYLE_BUTTON_TOGGLE 0x00000020
GX_STYLE_BUTTON_RADIO 0x00000040
GX_STYLE_BUTTON_EVENT_ON_PUSH 0x00000080
GX_STYLE_BUTTON_REPEAT 0x00000100
GX_STYLE_CENTER_SELECTED 0x00000010
GX_STYLE_WRAP 0x00000020
GX_STYLE_FLICKABLE 0x00000040
GX_STYLE_HALIGN_CENTER 0x00010000
GX_STYLE_HALIGN_LEFT 0x00020000
GX_STYLE_HALIGN_RIGHT 0x00040000
GX_STYLE_VALIGN_CENTER 0x00080000
GX_STYLE_VALIGN_TOP 0x00100000
GX_STYLE_VALIGN_BOTTOM 0x00200000
GX_PIXELMAP_HALIGN_MASK 0x00070000
GX_PIXELMAP_VALIGN_MASK 0x00380000
GX_STYLE_SHOW_NEEDLE 0x00000200
GX_STYLE_SHOW_TICKMARKS 0x00000400
GX_STYLE_SLIDER_VERTICAL 0x00000800
GX_STYLE_TILE_BACKGROUND 0x00001000
GX_STYLE_SHOW_PERCENT 0x00000010
GX_STYLE_TEXT_LEFT 0x00001000
GX_STYLE_TEXT_RIGHT 0x00002000
GX_STYLE_TEXT_CENTER 0x00004000
GX_STYLE_TEXT_ALIGNMENT_MASK 0x00007000
GX_STYLE_TEXT_COPY 0x00008000
GX_STYLE_TEXT_INPUT_NOTIFY_ALL 0x00000100
GX_STYLE_TILE_WALLPAPER 0x00040000
GX_STYLE_AUTO_HSCROLL 0x00100000
GX_STYLE_AUTO_VSCROLL 0x00200000
GX_SCROLLBAR_BACKGROUND_TILE 0x00010000
GX_SCROLLBAR_RELATIVE_THUMB 0x00020000
GX_SCROLLBAR_END_BUTTONS 0x00040000
GX_SCROLLBAR_VERTICAL 0x01000000
GX_SYSTEM_THREAD_START
This macro is invoked when the GUIX task or thread should start
executing. This macro should be defined to call a function which will start
the GUIX thread running. The entry point to the GUIX thread is passed to
the called function. The signature of the called function must be
GX_EVENT_PUSH
This macro is invoked to push an event into the FIFO event queue used by
GUIX. When porting to a new rtos, it is your responsibility to implement this
event queue in a thread-safe manner. GX_EVENT structures must be
copied into this queue and copied out of this queue, i.e. a queue of
GX_EVENT pointers will not work, since GUIX events can be automatic
variables from the view of the event producer. The signature of the function
called by this macro must be:
This function should return GX_SUCCESS if the event is pushed into the
event queue, otherwise it should return GX_FAILURE.
GX_EVENT_POP
This macro is invoked to remove the head (oldest) event from the GUIX
event queue and copy it into the requested location. This function must be
able to optionally block or wait for an event if no events are currently in the
event queue. The signature of the function invoked by this macro must be
If the wait parameter == GX_TRUE, the function should not return until an
event is provided. If the wait parameter is GX_FALSE, the function should
return immediately with or without an event.
If an event is retrieved from the queue, it should copied into the put_event
location and the return status is GX_SUCCESS. Otherwise the return
status should be GX_FAILURE.
GX_EVENT_FOLD
This macro is invoked by GUIX to fold an event into the FIFO event queue.
Folding an event means that if an event of the same type already exists in
the queue, that entry is update to contain the payload of the new event. If
an existing event of the same type is not found in the queue, a new event is
pushed into the queue.
For bindings that cannot implement the event fold feature, it is acceptable
to simply invoke the GX_EVENT_PUSH.
GX_TIMER_START
This macro is invoked when GUIX needs to receive periodic timer input.
This macro should invoke a service that starts the low-level RTOS periodic
timer service. If the RTOS timer service cannot be easily stopped and
started, it is acceptable but less efficient to leave this service running at all
times.
When the low-level RTOS timer service periodically expires, the binding
must call the GUIX system function _gx_system_timer_expiration(0);
Calling this function periodically is what drives the high-level GUIX timer
widget timer services.
GX_TIMER_STOP
If you never utilize any GUIX API services outside of the GUIX thread, you
can define this macro to do nothing.
GX_SYSTEM_MUTEX_UNLOCK
This macro is invoked at the end of critical code sections, and should
unlock the GUIX resource using the suitable underlying RTOS service. If
you never utilize any GUIX API services outside of the GUIX thread, you
can define this macro to do nothing.
GX_SYSTEM_TIME_GET
This macro should call a function that returns the current system time is
“system ticks”, which is usually the number of low-level timer interrupts that
have occurred since system startup.This service is used to calculate touch
event pen speed for touch input gestures. The signature of the function
invoked by this macro must be:
ULONG function_name(VOID);
GX_CURRENT_THREAD
Each GUIX font starts with a GX_FONT structure. The GX_FONT structure
defines global font parameters, such as the character included within the
font and the line height of the font. The GX_FONT structure points at an
array of GX_GLYPH structures. Each GX_GLYPH structure defines the
width, height, and baseline offset of one specific character glyph. The
GX_GLYPH structure also points to the actual glyph bitmap data (which
may be NULL for whitespace characters).
The gx_font_format field defines the font bits-per-pixel and other flags, as
defined in the gx_api.h header file.
The gx_font_prespace defines the pixel space to skip above each line of
text in a multi-line text display.
The gx_font_postspace field defines the pixel space to skip below each line
of text in a multi-line text display.
The gx_font_line_height field defines the height of the tallest glyph in the
font.
The gx_font_baseline field defines the distance, in pixels, from the top row
of glyph pixels to the font baseline.
The gx_glyph_map pointer points to the glyph bitmap. This pointer may be
GX_NULL for whitespace characters. The bitmap data is encoded as 1
bpp, 2 bpp, 4 bpp, or 8 bpp alpha values. For 1 bit data, a value of 1
indicates that the pixel should be written in the foreground color, and a
value of 0 indicates that the pixel is transparent. For 8 bit data, the values
range from 0 (fully transparent) to 255 (fully opague). All intermediate value
represent a blending value for anti-aliased fonts. The glyph bitmap data is
always padded to full byte alignment for formats using less than 8bpp data
values.