cBox Struct Reference

Inheritance diagram for cBox

Inheritance graph

Collaboration diagram for cBox:

Collaboration graph


Public Methods

struct cBox* cBox_ctor (struct cBox *ptr_cbox, int w, int h, color_t color, bool transparent)
void cBox_dtor (struct cBox *ptr_cbox, int memory_flag)
bool cBox_proc (struct cBox *ptr_cbox, struct Message *ptr_message)
void cBox_Disconnect (struct cBox *ptr_cbox)
bool cBox_Select (struct cBox *ptr_cbox)
void cBox_update (struct cBox *ptr_cbox)
struct cClipcBox_GetParent (struct cBox *ptr_cbox)
void cBox_Hide (struct cBox *ptr_cbox)
void cBox_Show (struct cBox *ptr_cbox)
void cBox_Disable (struct cBox *ptr_cbox)
void cBox_Enable (struct cBox *ptr_cbox)


Detailed Description

A filled rectangle. To put a cBox on the Cybiko screen, use the cWinApp_AddObj() function.

See also:
Controls, cWinApp_AddObj


Member Function Documentation

void cBox_Disable ( struct cBox * ptr_cbox )
 

Disables a cBox object so that it cannot be selected.

Parameters:
ptr_cbox   A pointer to the initialized cBox structure
Returns:
None
    #include <cywin.h>
    ...
    struct cButton button;
    struct module_t main_module;
    struct cClip* parent;
    ...
    init_module( &main_module );
    ...
    cButton_ctor( &button, "Button text", mrOk );
    // Puts the 'button' object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &button, 20, 50 );
    ...
    // It's the same as using the cButton_Disable( &button ) function.
    // Now the user can't use this object.
    cObject_Disable( &button )
    ...
    // It's the same as using the cButton_Enable( &button ) function.
    // Now the user can use this object again.
    cObject_Enable( &button )
    ...
    cButton_dtor( &button, LEAVE_MEMORY ); 
See also:
cBox_Enable.

void cBox_Disconnect ( struct cBox * ptr_cbox )
 

Disconnects a cBox object from its parent object.

Parameters:
ptr_cbox   A pointer to the initialized cBox object
Returns:
None
      #include <cywin.h>
      ...
      struct cBox cbox;
      struct module_t main_module;
      ...
      init_module( &main_module );
      ...
      cBox_ctor( &cbox, 100, 100, CLR_LTGRAY, TRUE );
      // Puts the cBox object on the Cybiko screen.
      cWinApp_AddObj( main_module.m_process, &cbox, 10, 40 );
      ...
      // Removes the cBox object from the Cybiko screen.
      cBox_Disconnect( &cbmp );
      ...
      // Puts the cBox object on the Cybiko screen again.
      cWinApp_AddObj( main_module.m_process, &cbmp, 10, 40 );
      ...
      cBox_dtor( &cbox, LEAVE_MEMORY );
      ...

void cBox_Enable ( struct cBox * ptr_cbox )
 

Enables a cBox object - so that it may be selected.

Parameters:
ptr_cbox   A pointer to the initialized cBox structure
Returns:
None
    #include <cywin.h>
    ...
    struct cButton button;
    struct module_t main_module;
    struct cClip* parent;
    ...
    init_module( &main_module );
    ...
    cButton_ctor( &button, "Button text", mrOk );
    // Puts the 'button' object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &button, 20, 50 );
    ...
    // It's the same as using the cButton_Disable( &button ) function.
    // Now the user can't use this object.
    cObject_Disable( &button )
    ...
    // It's the same as using the cButton_Enable( &button ) function.
    // Now the user can use this object again.
    cObject_Enable( &button )
    ...
    cButton_dtor( &button, LEAVE_MEMORY ); 
See also:
cBox_Disable.

struct cClip * cBox_GetParent ( struct cBox * ptr_cbox )
 

Returns a pointer to the parent object's cClip.

Parameters:
ptr_cbox   A pointer to the initialized cBox structure
Returns:
A pointer to the parent object
    #include <cywin.h>
    ...
    struct cButton button;
    struct module_t main_module;
    struct cClip* parent;
    ...
    init_module( &main_module );
    ...
    cButton_ctor( &button, "Button text", mrOk );
    // Puts the 'button' object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &button, 20, 50 );
    ...
    // It's the same as using the cButton_GetParent( &button ) function.
    // Checks for the right parent relation.
    parent = cObject_GetParent( &button );
    if ( parent == main_module.m_process )
    {
      ...
    }
    ...
    cButton_dtor( &button, LEAVE_MEMORY ); 

void cBox_Hide ( struct cBox * ptr_cbox )
 

Hides a cBox object.

Parameters:
ptr_cbox   A pointer to the initialized cBox structure
Returns:
None
    #include <cywin.h>
    ...
    struct cButton button;
    struct module_t main_module;
    struct cClip* parent;
    ...
    init_module( &main_module );
    ...
    cButton_ctor( &button, "Button text", mrOk );
    // Puts the 'button' object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &button, 20, 50 );
    ...
    // It's the same as using the cButton_Hide( &button ) function.
    cObject_Hide( &button );
    ...
    // It's the same as using the cButton_Show( &button ) function.
    cObject_Show( &button );
    ...
    cButton_dtor( &button, LEAVE_MEMORY ); 
See also:
cBox_Show.

bool cBox_Select ( struct cBox * ptr_cbox )
 

Selects a cBox object.

Parameters:
ptr_cbox   A pointer to the initialized cBox object
Returns:
TRUE if object was selected, otherwise FALSE.
       #include <cywin.h>
       ...
       struct cBox cbox;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // It's the same as using the cButton_Select( &button ) function.
       // Selects the button.
       cObject_Select( &button );
       ...
       cButton_dtor( &button, LEAVE_MEMORY ); 

void cBox_Show ( struct cBox * ptr_cbox )
 

Shows a cBox object.

Parameters:
ptr_cbox   A pointer to the initialized cBox structure
Returns:
None
    #include <cywin.h>
    ...
    struct cButton button;
    struct module_t main_module;
    struct cClip* parent;
    ...
    init_module( &main_module );
    ...
    cButton_ctor( &button, "Button text", mrOk );
    // Puts the 'button' object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &button, 20, 50 );
    ...
    // It's the same as using the cButton_Hide( &button ) function.
    cObject_Hide( &button );
    ...
    // It's the same as using the cButton_Show( &button ) function.
    cObject_Show( &button );
    ...
    cButton_dtor( &button, LEAVE_MEMORY ); 
See also:
cBox_Hide.

struct cBox * cBox_ctor ( struct cBox * ptr_cbox,
int w,
int h,
color_t color,
bool transparent )
 

Constructor.
Creates an empty cBox object.

Parameters:
ptr_cbox   A pointer to the initialized cBox object
w   The box width
h   The box height
color   The box color
transparent   Transparent mode. If TRUE, the cBox is transparent
Returns:
A pointer to the initialized cBox object
       #include <cywin.h>
       ...
       struct cBox cbox;
       struct module_t main_module;
       ...
       init_module( &main_module );
       cBox_ctor( &cbox, 100, 100, CLR_LTGRAY, TRUE );
       // Puts the cBox object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cbox, 10, 40 );
       ...
       cBox_dtor( &cbox, LEAVE_MEMORY );
See also:
cBox_dtor.

void cBox_dtor ( struct cBox * ptr_cbox,
int memory_flag )
 

Destructor.
Deletes the cBox.

Parameters:
ptr_cbox   A pointer the initialized cBox object
memory_flag   Can be FREE_MEMORY or LEAVE_MEMORY. If the memory was allocated for the object by malloc(), use FREE_MEMORY to free it. Use LEAVE_MEMORY if object was static or allocated in stack.
Returns:
None.
       #include <cywin.h>
       ...
       struct cBox cbox;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       cBox_ctor( &cbox, 100, 100, CLR_LTGRAY, TRUE );
       // Puts the cBox object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cbox, 10, 40 );
       ...
       cBox_dtor( &cbox, LEAVE_MEMORY );
See also:
cBox_ctor, FREE_MEMORY, LEAVE_MEMORY.

bool cBox_proc ( struct cBox * ptr_cbox,
struct Message * ptr_message )
 

The Message-processing function.

Parameters:
ptr_cbox   A pointer to the initialized cBox object
ptr_message   A pointer to the processed message
Returns:
TRUE if the message was processed, otherwise FALSE
       #include <cywin.h>
       ...
       struct cBox cbox;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       cBox_ctor( &cbox, 100, 100, CLR_LTGRAY, TRUE );
       // Puts the cBox object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cbox, 10, 40 );
       ...
       ptr_message = cWinApp_get_message( main_module.m_process, 
                                          0,
                                          1, 
                                          MSG_USER );
       //  Processes messages using the cBox message handler.
       cBox_proc( &cbox, ptr_message );
       ...
       cBox_dtor( &cbox, LEAVE_MEMORY );
       ...

void cBox_update ( struct cBox * ptr_cbox )
 

Updates a cBox object.

Parameters:
ptr_cbox   A pointer to the initialized cBox structure
Returns:
None
    #include <cywin.h>
    ...
    struct cButton button;
    struct module_t main_module;
    ...
    init_module( &main_module );
    ...
    cButton_ctor( &button, "Button text", mrOk );
    // Puts the 'button' object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &button, 20, 50 );
    ...
    cWinApp_clear_screen();
    // It's the same as using the cButton_update( &button ) function.
    // Redraws the button.
    cObject_update( &button )
    ...
    cButton_dtor( &button, LEAVE_MEMORY );