Public Methods |
bool | cWinApp_defproc (struct cWinApp *ptr_win_app, struct Message *ptr_message) |
bool | cWinApp_pause (struct cWinApp *ptr_win_app, clock_t timeout) |
struct DisplayGraphics* | cWinApp_init_display (void) |
void | cWinApp_clear_screen (void) |
void | cWinApp_cancel_shutup (struct cWinApp *ptr_win_app) |
void | cWinApp_ext_cancel_shutup (void) |
struct Process* | cWinApp_request_focus (struct cWinApp *ptr_win_app) |
bool | cWinApp_has_focus (struct cWinApp *ptr_win_app) |
struct DisplayGraphics* | cWinApp_get_display (void) |
struct Message* | cWinApp_peek_message (struct cWinApp *ptr_win_app, bool remove, int min, int max) |
struct Message* | cWinApp_get_message (struct cWinApp *ptr_win_app, long timeout, int min, int max) |
void | cWinApp_put_message (struct cWinApp *ptr_win_app, struct Message *ptr_message) |
char* | cWinApp_get_name (struct cWinApp *ptr_win_app) |
void | cWinApp_Disconnect (struct cWinApp *ptr_win_app) |
bool | cWinApp_Select (struct cWinApp *ptr_win_app) |
void | cWinApp_update (struct cWinApp *ptr_win_app) |
struct cClip* | cWinApp_GetParent (struct cWinApp *ptr_win_app) |
void | cWinApp_Hide (struct cWinApp *ptr_win_app) |
void | cWinApp_Show (struct cWinApp *ptr_win_app) |
void | cWinApp_Disable (struct cWinApp *ptr_win_app) |
void | cWinApp_Enable (struct cWinApp *ptr_win_app) |
void | cWinApp_AddObj (struct cWinApp *ptr_win_app, struct cObject *ptr_object, int x, int y) |
void | cWinApp_InsObj (struct cWinApp *ptr_win_app, struct cObject *ptr_object, int x, int y, int index) |
void | cWinApp_RemObj (struct cClip *ptr_win_app, struct cObject *ptr_object) |
bool | cWinApp_SelectFirst (struct cWinApp *ptr_win_app) |
bool | cWinApp_SelectPrev (struct cWinApp *ptr_win_app, bool round) |
bool | cWinApp_SelectNext (struct cWinApp *ptr_win_app, bool round) |
void | cWinApp_Scroll (struct cWinApp *ptr_win_app, struct rect_t *rectangle) |
void | cWinApp_Scroll_Ex (struct cWinApp *ptr_win_app, int x, int y) |
void | cWinApp_SendScroll (struct cWinApp *ptr_win_app) |
int | cWinApp_GetShifty (struct cWinApp *ptr_win_app) |
int | cWinApp_GetShiftx (struct cWinApp *ptr_win_app) |
int | cWinApp_GetCount (struct cWinApp *ptr_win_app) |
struct cObject* | cWinApp_get_by_index (struct cWinApp *ptr_win_app, int index) |
int | cWinApp_FindObj (struct cWinApp *ptr_win_app, struct cObject *ptr_object) |
struct cObject* | cWinApp_GetSelectedObject (struct cWinApp *ptr_win_app) |
The cWinApp structure is your application object. It implements cywin's functions, to work with user's objects such as: cBitmap, cEdit, cList, cItem, etc.
You must make a pointer to it using the init_module function.
|
Returns a child object's index in cWinApp (or -1).
-
Parameters:
-
ptr_win_app
|
A pointer to the initialized cClip structure |
ptr_object
|
A pointer to the needed cObject |
-
Returns:
-
The child object's index in cWinApp (or -1).
#include <cywin.h>
...
struct cButton button1;
struct cButton button2;
struct cButton button3;
struct module_t main_module;
struct cObject * currentObj;
int nButtonNumber;
int i;
...
init_module( &main_module );
...
cButton_ctor( &button1, "Button text 1", mrOk );
cWinApp_AddObj( main_module.m_process, &button1, 20, 50 );
...
cButton_ctor( &button2, "Button text 2", mrOk );
cWinApp_InsObj( main_module.m_process, &button2, 20, 50, 1 );
...
cButton_ctor( &button3, "Button text 3", mrOk );
cWinApp_InsObj( main_module.m_process, &button3, 20, 50, 2 );
...
if ( cWinApp_FindObj( main_module.m_process, &button2 ) != -1 )
...
cButton_dtor( &button, LEAVE_MEMORY ); |
|
Adds an object to the cWinApp in position (x, y) with a z-position index (maximal index is on the top).
-
Parameters:
-
ptr_win_app
|
A pointer to the initialized cWinApp structure |
ptr_object
|
A pointer to the initialized cObject structure |
x
|
x-coordinate of the new object |
y
|
y-coordinate of the new object |
index
|
The index of the new object's z-position |
-
Returns:
-
None
#include <cywin.h>
...
struct cButton button1;
struct cButton button2;
struct cButton button3;
struct module_t main_module;
...
init_module( &main_module );
...
cButton_ctor( &button1, "Button text 1", mrOk );
cWinApp_AddObj( main_module.m_process, &button1, 20, 50 );
...
cButton_ctor( &button2, "Button text 2", mrOk );
cWinApp_InsObj( main_module.m_process, &button2, 20, 50, 1 );
...
cButton_ctor( &button3, "Button text 3", mrOk );
cWinApp_InsObj( main_module.m_process, &button3, 20, 50, 2 );
...
cButton_dtor( &button, LEAVE_MEMORY ); |
|
Selects the next object in the cWinApp.
-
Parameters:
-
ptr_win_app
|
A pointer to the initialized cClip structure |
round
|
TRUE if you need to select the last object after selecting the first |
-
Returns:
-
FALSE if the function failed
#include <cywin.h>
...
struct cButton button1;
struct cButton button2;
struct cButton button3;
struct module_t main_module;
...
init_module( &main_module );
...
cButton_ctor( &button1, "Button text 1", mrOk );
cWinApp_AddObj( main_module.m_process, &button1, 20, 50 );
...
cButton_ctor( &button2, "Button text 2", mrOk );
cWinApp_InsObj( main_module.m_process, &button2, 20, 50, 1 );
...
cButton_ctor( &button3, "Button text 3", mrOk );
cWinApp_InsObj( main_module.m_process, &button3, 20, 50, 2 );
...
cWinApp_SelectFirst( main_module.m_process );
...
cWinApp_SelectNext( main_module.m_process , TRUE);
cButton_dtor( &button, LEAVE_MEMORY );
-
See also:
-
cWinApp_SelectFirst, cWinApp_SelectPrev.
|
|
Selects the previous object in cWinApp.
-
Parameters:
-
ptr_win_app
|
A pointer to the initialized cClip structure |
round
|
TRUE if you need to select the last object after selecting the first |
-
Returns:
-
FALSE if the function failed
#include <cywin.h>
...
struct cButton button1;
struct cButton button2;
struct cButton button3;
struct module_t main_module;
...
init_module( &main_module );
...
cButton_ctor( &button1, "Button text 1", mrOk );
cWinApp_AddObj( main_module.m_process, &button1, 20, 50 );
...
cButton_ctor( &button2, "Button text 2", mrOk );
cWinApp_InsObj( main_module.m_process, &button2, 20, 50, 1 );
...
cButton_ctor( &button3, "Button text 3", mrOk );
cWinApp_InsObj( main_module.m_process, &button3, 20, 50, 2 );
...
cWinApp_SelectFirst( main_module.m_process );
...
cWinApp_SelectPrev( main_module.m_process , TRUE);
cButton_dtor( &button, LEAVE_MEMORY );
-
See also:
-
cWinApp_SelectFirst, cWinApp_SelectNext.
|
|
Returns an object with its index.
-
Parameters:
-
ptr_win_app
|
A pointer to the initialized cClip structure |
index
|
Index of the object in cWinApp |
-
Returns:
-
The object with its index
#include <cywin.h>
...
struct cButton button1;
struct cButton button2;
struct cButton button3;
struct module_t main_module;
struct cObject * currentObj;
int nButtonNumber;
int i;
...
init_module( &main_module );
...
cButton_ctor( &button1, "Button text 1", mrOk );
cWinApp_AddObj( main_module.m_process, &button1, 20, 50 );
...
cButton_ctor( &button2, "Button text 2", mrOk );
cWinApp_InsObj( main_module.m_process, &button2, 20, 50, 1 );
...
cButton_ctor( &button3, "Button text 3", mrOk );
cWinApp_InsObj( main_module.m_process, &button3, 20, 50, 2 );
...
for ( i=0; i<cWinApp_GetCount( main_module.m_process ); i++)
{
cButton_update( cWinApp_get_by_index( main_module.m_process, i) );
}
...
cButton_dtor( &button, LEAVE_MEMORY ); |