cBevel Struct Reference

Inheritance diagram for cBevel

Inheritance graph

Collaboration diagram for cBevel:

Collaboration graph


Public Methods

struct cBevel* cBevel_ctor (struct cBevel *, int, int, color_t, char)
void cBevel_dtor (struct cBevel *, int)
bool cBevel_proc (struct cBevel *ptr_cbevel, struct Message *ptr_message)
void cBevel_Disconnect (struct cBevel *ptr_cbevel)
bool cBevel_Select (struct cBevel *ptr_cbevel)
void cBevel_update (struct cBevel *ptr_cbevel)
struct cClipcBevel_GetParent (struct cBevel *ptr_cbevel)
void cBevel_Hide (struct cBevel *ptr_cbevel)
void cBevel_Show (struct cBevel *ptr_cbevel)
void cBevel_Disable (struct cBevel *ptr_cbevel)
void cBevel_Enable (struct cBevel *ptr_cbevel)


Detailed Description

The cBevel object is an outlined empty rectangle. The cBevel structure lets you put beveled lines, boxes, or frames on the Cybiko screen. Any side of the rectangle can be visible or invisible.

The default is for all sides to be visible. The visibility values for all sides are defined in the tBevelSidesTypes enumeration and described in the 'Enums' section.

See also:
Controls


Member Function Documentation

void cBevel_Disable ( struct cBevel * ptr_cbevel )
 

Disables the cBevel object so that it cannot be selected.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel 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:
cBevel_Enable.

void cBevel_Disconnect ( struct cBevel * ptr_cbevel )
 

Disconnects cBevel from its parent object.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel structure
Returns:
None
    #include <cywin.h>
    ...
    struct cBitmap cbmp;
    struct Bitmap bmp;
    struct module_t main_module;
    ...
    init_module( &main_module );
    ...
    // Creates a bitmap from the file "root.ico".
    Bitmap_ctor_Ex1( &bmp, "root.ico" );
    cBitmap_ctor( &cbmp, &bmp );
    // Puts the cBitmap object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &cbmp, 10, 40 );
    ...
    // Removes the object from the Cybiko screen.
    // It's the same as using the cObject_Disconnect( &cbmp ) function.
    cBitmap_Disconnect( &cbmp );
    ...
    // Puts the cBitmap object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &cbmp, 10, 40 );
    ...
    // Afterwards this function disconnects the cBitmap object automatically.
    cBitmap_dtor( &cbmp, LEAVE_MEMORY );
    Bitmap_dtor( &bmp, LEAVE_MEMORY ); 

void cBevel_Enable ( struct cBevel * ptr_cbevel )
 

Enables the cBevel object so that it may be selected.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel 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:
cBevel_Disable.

struct cClip * cBevel_GetParent ( struct cBevel * ptr_cbevel )
 

Returns a pointer to the parent object's cClip.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel structure
Returns:
A pointer to the parent object's cClip
    #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 cBevel_Hide ( struct cBevel * ptr_cbevel )
 

Hides the cBevel object.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel 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:
cBevel_Show.

bool cBevel_Select ( struct cBevel * ptr_cbevel )
 

Selects cBevel object.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel structure
Returns:
TRUE if the object was selected
    #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 );
    ...
    // It's the same as using the cButton_Select( &button ) function.
    // Selects the button.
    cObject_Select( &button );
    ...
    cButton_dtor( &button, LEAVE_MEMORY ); 

void cBevel_Show ( struct cBevel * ptr_cbevel )
 

Shows the cBevel object.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel 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:
cBevel_Hide.

struct cBevel * cBevel_ctor ( struct cBevel * ptr_cbevel,
int w,
int h,
color_t color,
char sides )
 

Constructor.
Creates an empty cBevel object.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel object
w   The box width
h   The box height
color   The object's color
sides   The visibility state of the box sides. See 'tBevelSidesTypes' enumeration in the 'Enums' section
Returns:
A pointer to the initialized cBevel object
       #include <cywin.h>
       ...
       struct cBevel cbevel;
       struct module_t main_module;
       ...
       init_module( &main_module );
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY, CLR_WHITE, CLR_BLACK.
       cBevel_ctor( &cbox, 100, 100, CLR_LTGRAY, Left | Right );
       // Puts the cBevel object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cbevel, 10, 40 );
       ...
       cBox_dtor( &cbevel, LEAVE_MEMORY );
See also:
cBevel_dtor.

void cBevel_dtor ( struct cBevel * ptr_cbevel,
int memory_flag )
 

Destructor.
Deletes an object.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel 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 the object was static or allocated in stack
Returns:
None
       #include <cywin.h>
       ...
       struct cBevel cbevel;
       struct module_t main_module;
       ...
       init_module( &main_module );
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY, CLR_WHITE, CLR_BLACK.
       cBevel_ctor( &cbox, 100, 100, CLR_LTGRAY, Left | Right );
       // Puts the cBevel object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cbevel, 10, 40 );
       ...
       cBox_dtor( &cbevel, LEAVE_MEMORY );
See also:
cBevel_ctor, FREE_MEMORY, LEAVE_MEMORY.

bool cBevel_proc ( struct cBevel * ptr_cbevel,
struct Message * ptr_message )
 

The Message-processing function.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel structure
ptr_message   A pointer to the processed message
Returns:
TRUE if the message was processed
    #include <cywin.h>
    ...
    struct cBitmap cbmp;
    struct Bitmap bmp;
    struct module_t main_module;
    struct Message* ptr_message;
    ...
    init_module( &main_module );
    ...
    // Creates a bitmap from the file "root.ico".
    Bitmap_ctor_Ex1( &bmp, "root.ico" );
    cBitmap_ctor( &cbmp, &bmp );
    // Puts the cBitmap object on the Cybiko screen.
    cWinApp_AddObj( main_module.m_process, &cbmp, 10, 40 );
    ...
    ptr_message = cWinApp_get_message( main_module.m_process, 0, 1, MSG_USER );
    // It's the same as using the cObject_proc( &cbmp, ptr_message ) function.
    // Processes messages that manage the cBitmap control.
    cBitmap_proc( &cbmp, ptr_message );
    ...
    // Afterwards this function disconnects the cBitmap object automatically.
    cBitmap_dtor( &cbmp, LEAVE_MEMORY );
    Bitmap_dtor( &bmp, LEAVE_MEMORY ); 

void cBevel_update ( struct cBevel * ptr_cbevel )
 

Updates a cBevel object.

Parameters:
ptr_cbevel   A pointer to the initialized cBevel 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 );