cSItem Struct Reference

Inheritance diagram for cSItem

Inheritance graph

Collaboration diagram for cSItem:

Collaboration graph


Public Methods

struct cSItem* cSItem_ctor (struct cSItem *ptr_csitem, int w, char *title, struct Bitmap *ptr_bitmap)
void cSItem_dtor (struct cSItem *ptr_csitem, int memory_flag)
void cSItem_Disconnect (struct cSItem *ptr_csitem)
bool cSItem_Select (struct cSItem *ptr_csitem)
void cSItem_update (struct cSItem *ptr_csitem)
struct cClipcSItem_GetParent (struct cSItem *ptr_csitem)
void cSItem_Hide (struct cSItem *ptr_csitem)
void cSItem_Show (struct cSItem *ptr_csitem)
void cSItem_Disable (struct cSItem *ptr_csitem)
void cSItem_Enable (struct cSItem *ptr_csitem)
char* cSItem_GetTitle (struct cSItem *ptr_csitem)
bool cSItem_proc (struct cSItem *ptr_csitem, struct Message *ptr_message)


Detailed Description

A cSItem object might have an icon on the left and/or additional text on the right It is possible to input text into the field on the right, but only numerical data. For more information see the cItem structure definition.

You must call the cSItem_ctor function before use and the cSItem_dtor function after use.

See also:
Controls


Member Function Documentation

void cSItem_Disable ( struct cSItem * ptr_csitem )
 

Disables a cSItem object so that it cannot be selected.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
None
See also:
cSItem_Enable.

void cSItem_Disconnect ( struct cSItem * ptr_csitem )
 

Disconnects a cSItem from its parent object.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
None

void cSItem_Enable ( struct cSItem * ptr_csitem )
 

Enables a cSItem object so that it may be selected.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
None
See also:
cSItem_Disable.

struct cClip * cSItem_GetParent ( struct cSItem * ptr_csitem )
 

Returns a pointer to the parent object.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
A pointer to the parent object

char * cSItem_GetTitle ( struct cSItem * ptr_csitem )
 

Returns the item's title.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
The item's title

void cSItem_Hide ( struct cSItem * ptr_csitem )
 

Hides a cSItem object.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
None
See also:
cSItem_Show.

bool cSItem_Select ( struct cSItem * ptr_csitem )
 

Selects a cSItem object.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
TRUE if the object was selected

void cSItem_Show ( struct cSItem * ptr_csitem )
 

Shows a cSItem object.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
None
See also:
cSItem_Hide.

struct cSItem * cSItem_ctor ( struct cSItem * ptr_csitem,
int w,
char * title,
struct Bitmap * ptr_bitmap )
 

Constructor.
Creates an empty cSItem object.

Parameters:
ptr_csitem   A pointer to a cSItem structure
w   Item's width in pixels
title   Title string
ptr_bitmap   Creates a pointer to the icon bitmap
Returns:
A pointer to the initialized cSItem object
   #include <cywin.h>
     ...
   {
     char   buf[15];
     struct BitmapSequence * ptr_bmps = (BitmapSequence* ) malloc( sizeof( struct BitmapSequence ) );
     struct cList * ptr_clist = (cList* )malloc( sizeof( cList ) );
     struct cSItem * ptr_csitem = (cSItem* )malloc( sizeof( cSItem ) );
     ...
     BitmapSequence_ctor_Ex( ptr_bmps,"gfx.pic" );
     cList_ctor( ptr_clist, 80 );
     ...
     for ( int i=1; i<=5; i++ )
     {
       sprintf( buf, "menu item %d", i );
       cSItem_ctor( ptr_csitem, LCD_WIDTH, buf, BitmapSequence_get_bitmap( ptr_bmps, i-1 ) );
       cList_AddItem( ptr_clist, ptr_csitem );
     }
     ...
     cSItem_dtor( ptr_csitem, FREE_MEMORY );
     cList_dtor( ptr_clist, FREE_MEMORY );
     BitmapSequence_dtor( ptr_bmps, FREE_MEMORY );
   }

void cSItem_dtor ( struct cSItem * ptr_csitem,
int memory_flag )
 

Destructor.
Deletes a cSItem object.

Parameters:
ptr_csitem   A pointer to the initialized cSItem 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 a stack
Returns:
None
   #include <cywin.h>
     ...
   {
     char   buf[15];
     struct BitmapSequence * ptr_bmps = (BitmapSequence* ) malloc( sizeof( struct BitmapSequence ) );
     struct cList * ptr_clist = (cList* )malloc( sizeof( cList ) );
     struct cSItem * ptr_csitem = (cSItem* )malloc( sizeof( cSItem ) );
     ...
     BitmapSequence_ctor_Ex( ptr_bmps,"gfx.pic" );
     cList_ctor( ptr_clist, 80 );
     ...
     for ( int i=1; i<=5; i++ )
     {
       sprintf( buf, "menu item %d", i );
       cSItem_ctor( ptr_csitem, LCD_WIDTH, buf, BitmapSequence_get_bitmap( ptr_bmps, i-1 ) );
       cList_AddItem( ptr_clist, ptr_csitem );
     }
     ...
     cSItem_dtor( ptr_csitem, FREE_MEMORY );
     cList_dtor( ptr_clist, FREE_MEMORY );
     BitmapSequence_dtor( ptr_bmps, FREE_MEMORY );
   }
See also:
FREE_MEMORY, LEAVE_MEMORY.

bool cSItem_proc ( struct cSItem * ptr_csitem,
struct Message * ptr_message )
 

The Message-processing function.

Parameters:
ptr_csitem   A pointer to a cSItem object
ptr_message   A pointer to a Message
Returns:
TRUE if the message was processed

void cSItem_update ( struct cSItem * ptr_csitem )
 

Updates a cSItem object.

Parameters:
ptr_csitem   A pointer to a cSItem object
Returns:
None