Difference between revisions of "Windows"

From uGFX Wiki
Jump to: navigation, search
(Window creation)
(API reference)
 
(8 intermediate revisions by the same user not shown)
Line 8: Line 8:
  
 
Therefore, a window is a completely passive element. It does not accept any kind of input.
 
Therefore, a window is a completely passive element. It does not accept any kind of input.
A list with description of the common window API can be found [http://ugfx.org/images/resources/doxygen/master/group___window.html here].
+
 
 +
== API reference ==
 +
The generic window API reference can be found [http://api.ugfx.io/group___window.html here].
  
 
== Window creation ==
 
== Window creation ==
Each window provides a creation call with is named <code>gwinCreateXxx()</code> where Xxx is the name of the window. The first parameter is either a pointer to a static window object or ''NULL''. If ''NULL'', the object will be allocated dynamically from the heap.
+
Each window provides a creation call with is named <code>gwinXxxCreate()</code> where Xxx is the name of the window. The first parameter is either a pointer to a static window object or ''NULL''. If ''NULL'', the object will be allocated dynamically from the heap.
 
The second parameter is a pointer to a <code>GWindowInit</code> struct. This struct contains all the attributes which are needed to create the window (position, size, ...):
 
The second parameter is a pointer to a <code>GWindowInit</code> struct. This struct contains all the attributes which are needed to create the window (position, size, ...):
 
<syntaxhighlight lang=c>
 
<syntaxhighlight lang=c>
Line 25: Line 27:
 
Examples on how to use this struct correctly can be found on each window documentation page.
 
Examples on how to use this struct correctly can be found on each window documentation page.
  
 +
<code>gwinDestroy()</code> can be used to destroy a window that is no longer needed.
 
== Implemented Windows ==
 
== Implemented Windows ==
 
These are the currently implemented windows:
 
These are the currently implemented windows:
* [[Window]]
 
 
* [[Console]]
 
* [[Console]]
 
* [[Graph]]
 
* [[Graph]]
  
 
[[Category:GWIN]]
 
[[Category:GWIN]]

Latest revision as of 10:07, 9 October 2016

A window is the most basic GWIN element. All the other elements (widget, container) are based on this one. A window consists the following attributes:

  • Position
  • Size
  • Foreground color
  • Background color
  • Font

Therefore, a window is a completely passive element. It does not accept any kind of input.

API reference

The generic window API reference can be found here.

Window creation

Each window provides a creation call with is named gwinXxxCreate() where Xxx is the name of the window. The first parameter is either a pointer to a static window object or NULL. If NULL, the object will be allocated dynamically from the heap. The second parameter is a pointer to a GWindowInit struct. This struct contains all the attributes which are needed to create the window (position, size, ...):

typedef struct GWindowInit {
   coord_t			x, y;				// The initial position relative to its parent
   coord_t			width, height;			// The initial dimension
   bool_t			show;				// Should the window be visible initially
   #if GWIN_NEED_CONTAINERS
      GHandle		        parent;				// The parent - must be a container or NULL
   #endif
} GWindowInit;

Examples on how to use this struct correctly can be found on each window documentation page.

gwinDestroy() can be used to destroy a window that is no longer needed.

Implemented Windows

These are the currently implemented windows: