Public Types |
enum | tScrolls {
sNone = 0,
sUp = 1,
sDown = 2,
sUpDown = 3
} |
Public Methods |
void | cClip_AddObj (struct cClip *, struct cObject *, int, int) |
void | cClip_InsObj (struct cClip *, struct cObject *, int, int, int) |
void | cClip_RemObj (struct cClip *, struct cObject *) |
bool | cClip_SelectFirst (struct cClip *) |
bool | cClip_SelectPrev (struct cClip *, bool) |
bool | cClip_SelectNext (struct cClip *, bool) |
void | cClip_Scroll (struct cClip *ptr_clip, struct rect_t *rectangle) |
void | cClip_Scroll_Ex (struct cClip *ptr_clip, int x, int y) |
void | cClip_SendScroll (struct cClip *ptr_clip) |
int | cClip_GetShifty (struct cClip *ptr_clip) |
int | cClip_GetShiftx (struct cClip *ptr_clip) |
int | cClip_GetCount (struct cClip *ptr_clip) |
struct cObject* | cClip_get_by_index (struct cClip *, int) |
int | cClip_FindObj (struct cClip *, struct cObject *) |
struct cObject* | cClip_GetSelectedObject (struct cClip *ptr_clip) |
bool | cClip_proc (struct cClip *ptr_clip, struct Message *ptr_message) |
void | cClip_Disconnect (struct cClip *ptr_clip) |
bool | cClip_Select (struct cClip *ptr_clip) |
void | cClip_update (struct cClip *ptr_clip) |
struct cClip* | cClip_GetParent (struct cClip *ptr_clip) |
void | cClip_Hide (struct cClip *ptr_clip) |
void | cClip_Show (struct cObject *ptr_clip) |
void | cClip_Disable (struct Clip *ptr_clip) |
void | cClip_Enable (struct cObject *ptr_clip) |
This is a base window structure - a clipped box, which may contain other objects. cClip implements base message-delivery and command-processing functions. It supports scrolling, painting child objects, and so on. You must the initialize structure before use and release object resources after use.
|
Returns the child object's index in the cClip.
-
Parameters:
-
ptr_clip
|
A pointer to the initialized cClip structure |
ptr_object
|
A pointer to the needed cObject |
-
Returns:
-
Object index; -1 if the index cannot be found
#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 ( cClip_FindObj( main_module.m_process, &button2 ) != -1 )
...
cButton_dtor( &button, LEAVE_MEMORY ); |
|
Returns the count of child objects.
-
Parameters:
-
ptr_clip
|
A pointer to the initialized cClip structure |
-
Returns:
-
Child objects count
#include <cywin.h>
...
struct cButton button1;
struct cButton button2;
struct cButton button3;
struct module_t main_module;
int nButtonNumber;
...
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 );
...
nButtonNumber = cClip_GetCount( main_module.m_process );
...
cButton_dtor( &button, LEAVE_MEMORY ); |
|
Returns the currently selected object in the cClip.
-
Parameters:
-
ptr_clip
|
A pointer to the initialized cClip structure |
-
Returns:
-
The currently selected object in the cClip
#include <cywin.h>
...
struct cButton button1;
struct cButton button2;
struct cButton button3;
struct module_t main_module;
struct cObject * selectedObj;
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 );
...
cObject_Select( &button2 );
...
cButton_update( cClip_GetSelectedObject( main_module.m_process );
...
cButton_dtor( &button, LEAVE_MEMORY ); |
|
Adds the object 'obj' to the cClip in position (x,y), with a z-position index (maximal index is on the top).
-
Parameters:
-
ptr_clip
|
A pointer to the initialized cClip structure |
ptr_object
|
A pointer to initialized cObject structure |
x
|
The x-coordinate of the new object |
y
|
The y-coordinate of the new object |
index
|
The z-position of the new object |
-
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 first object in the cClip.
-
Parameters:
-
ptr_clip
|
A pointer to the initialized cClip structure |
-
Returns:
-
FALSE if the operation 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 );
...
cClip_SelectFirst( main_module.m_process );
...
cButton_dtor( &button, LEAVE_MEMORY ); |
|
Selects the next object in the cClip.
-
Parameters:
-
ptr_clip
|
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 operation 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 );
...
cClip_SelectFirst( main_module.m_process );
...
cClip_SelectNext( main_module.m_process, TRUE );
...
cButton_dtor( &button, LEAVE_MEMORY ); |
|
Selects the previous object in the cClip.
-
Parameters:
-
ptr_clip
|
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 operation 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 );
...
cClip_SelectFirst( main_module.m_process );
...
cClip_SelectPrev( main_module.m_process, TRUE );
...
cButton_dtor( &button, LEAVE_MEMORY ); |
|
Returns an object with its index.
-
Parameters:
-
ptr_clip
|
A pointer to the initialized cClip structure |
index
|
The index of the object in cClip |
-
Returns:
-
If the index is valid, a pointer to the cObject under the specified index; else NULL.
#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<cClip_GetCount( main_module.m_process ); i++)
{
cButton_update( cClip_get_by_index( main_module.m_process, i) );
}
...
cButton_dtor( &button, LEAVE_MEMORY ); |