cEdit Struct Reference

Inheritance diagram for cEdit

Inheritance graph

Collaboration diagram for cEdit:

Collaboration graph


Public Methods

struct cEdit* cEdit_ctor (struct cEdit *ptr_cedit, struct Font *ptr_cfont, int buffer_size, int style, color_t color, int width)
void cEdit_dtor (struct cEdit *ptr_cedit, int memory_flag)
void cEdit_HighliteText (struct cEdit *, bool flag)
bool cEdit_SetReadOnly (struct cEdit *ptr_cedit, bool state)
int cEdit_SetPageLineCount (struct cEdit *ptr_cedit, int lines)
bool cEdit_IsHighlited (struct cEdit *ptr_cedit)
int cEdit_SetCursorPos (struct cEdit *ptr_cedit, int position)
int cEdit_MoveCursor (struct cEdit *ptr_cedit, int reg)
int cEdit_GetCursorPos (struct cEdit *ptr_cedit)
int cEdit_SetText (struct cEdit *ptr_cedit, char *text)
int cEdit_AppendText (struct cEdit *ptr_cedit, char *text)
int cEdit_SetText_Ex (struct cEdit *ptr_cedit, struct Input *ptr_input)
int cEdit_GetText_Ex (struct cEdit *ptr_cedit, struct Output *ptr_output)
bool cEdit_IsModified (struct cEdit *ptr_cedit)
int cEdit_GetTextLength (struct cEdit *ptr_cedit)
char* cEdit_GetBufferPtr (struct cEdit *)
int cEdit_GetText (struct cEdit *, char *)
bool cEdit_proc (struct cEdit *ptr_cedit, struct Message *ptr_message)
void cEdit_Disconnect (struct cEdit *ptr_cedit)
bool cEdit_Select (struct cEdit *ptr_cedit)
void cEdit_update (struct cEdit *ptr_cedit)
struct cClipcEdit_GetParent (struct cEdit *ptr_cedit)
void cEdit_Hide (struct cEdit *ptr_cedit)
void cEdit_Show (struct cEdit *ptr_cedit)
void cEdit_Disable (struct cEdit *ptr_cedit)
void cEdit_Enable (struct cEdit *ptr_cedit)


Detailed Description

Use a cEdit object to put a standard edit control on the Cybiko screen. cEdit controls are used to retrieve the text that users type. cEdit controls can also display text to the user.

When only displaying text to the user, choose an edit control to allow users to select text and copy it to the buffer.

See also:
Controls


Member Function Documentation

int cEdit_AppendText ( struct cEdit * ptr_cedit,
char * text )
 

Appends text from external buffer.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
text   The text to append
Returns:
Number of characters in the text string
       #include <cywin.h>
       ...
       struct cEdit cedit;
       char   buffer[100];
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_normal,
                   CLR_LTGRAY,
                   100 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       cEdit_GetText( &cedit, buffer );
       cEdit_AppendText( &cedit, ";" );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );

void cEdit_Disable ( struct cEdit * ptr_cedit )
 

Disables the cEdit object so that it cannot be selected.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
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:
cEdit_Enable.

void cEdit_Disconnect ( struct cEdit * ptr_cedit )
 

Disconnects a cEdit from its parent object.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
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 cEdit_Enable ( struct cEdit * ptr_cedit )
 

Enables a cEdit object so that it may be selected.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
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:
cEdit_Disable.

char * cEdit_GetBufferPtr ( struct cEdit * ptr_cedit )
 

Returns a pointer to the internal buffer.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object.
Returns:
A pointer to a cEdit text string.
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_normal,
                   CLR_LTGRAY,
                   100 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       TRACE( "%s", cEdit_GetBufferPtr( &cedit ) );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );

int cEdit_GetCursorPos ( struct cEdit * ptr_cedit )
 

Returns the current cursor position relative to the beginning of a piece of text.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
Returns:
Resulting cursor position
       #include <cywin.h>
       ...
       struct cEdit cedit;
       int    curPos;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );            
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       // Sets the password's character limit. A password can't be longer than 8 characters.
       if ( cEdit_GetCursorPos( &cedit ) >= 8 )
       {
         cEdit_SetReadOnly( &cedit, TRUE );
         cEdit_SetCursorPos( &cedit, 0 );
       }
       ...
       curPos = cEdit_GetCursorPos( &cedit );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
See also:
cEdit_SetCursorPos.

struct cClip * cEdit_GetParent ( struct cEdit * ptr_cedit )
 

Returns a pointer to the cClip of the parent object.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
Returns:
A pointer to the cClip of 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 ); 

int cEdit_GetText ( struct cEdit * ptr_cedit,
char * buffer )
 

Saves "text" to the external buffer.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
buffer   A string buffer
Returns:
Number of characters in the "text"
       #include <cywin.h>
       ...
       struct cEdit cedit;
       char   buffer[8];
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY, CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   oool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       // Sets the password's character limit. A password can't be longer than 8 characters.
       if ( cEdit_GetTextLength( &cedit ) >= 8 )
       {
         cEdit_SetReadOnly( &cedit, TRUE );
         cEdit_SetCursorPos( &cedit, 0 );
         cEdit_GetText( &cedit, buffer );
       }
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
See also:
cEdit_GetText_Ex, cEdit_SetText.

int cEdit_GetTextLength ( struct cEdit * ptr_cedit )
 

Returns the current text length (not including finishing '\0').

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
Returns:
Current text length
       #include <cywin.h>
       ...
       struct cEdit cedit;
       char   buffer[8];
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       // Sets the limit on password. Password can't be larger than 8 symbols.
       if ( cEdit_GetTextLength( &cedit ) >= 8 )
       {
         cEdit_SetReadOnly( &cedit, TRUE );
         cEdit_SetCursorPos( &cedit, 0 );
         cEdit_GetText( &cedit, buffer );
       }
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
See also:
cEdit_GetText.

int cEdit_GetText_Ex ( struct cEdit * ptr_cedit,
struct Output * ptr_output )
 

Saves "text" to the external output stream.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
ptr_output   A pointer to the initialized Output object
Returns:
Number of characters in the text string
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       struct FileOutput file_doc;
       ...
       init_module( &main_module );
       ...
       FileOutput_ctor_Ex( &file_doc, "doc.txt", TRUE );
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
         cEdit_GetText_Ex( &cedit, &file_doc );
       cEdit_dtor( &cedit, LEAVE_MEMORY );
       FileOutput_dtor( &file_doc, LEAVE_MEMORY );
See also:
cEdit_GetText.

void cEdit_Hide ( struct cEdit * ptr_cedit )
 

Hides a cEdit object.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
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:
cEdit_Show.

void cEdit_HighliteText ( struct cEdit * ptr_cedit,
bool flag )
 

Sets a highlighted state.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
flag   Sets the highlighted state
Returns:
None
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
        if( cEdit_IsHighlited( &cedit ) )
            cEdit_HighliteText( &cedit, FALSE );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );

bool cEdit_IsHighlited ( struct cEdit * ptr_cedit )
 

Highlighted state.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
Returns:
TRUE if the text is highlighted
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
        if( cEdit_IsHighlited( &cedit ) )
            cEdit_HighliteText( &cedit, FALSE );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );

bool cEdit_IsModified ( struct cEdit * ptr_cedit )
 

Checks whether the text has been modified.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
Returns:
TRUE if the text was modified
       #include <cywin.h>
       ...
       struct cEdit cedit;
       char   buffer[8];
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       // Sets the password's character limit. A password can't be longer than 8 characters.
       if ( cEdit_IsModified( &cedit ) && if ( cEdit_GetTextLength( &cedit ) >= 8 )
       {
         cEdit_SetReadOnly( &cedit, TRUE );
         cEdit_SetCursorPos( &cedit, 0 );
         cEdit_GetText( &cedit, buffer );
       }
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );

int cEdit_MoveCursor ( struct cEdit * ptr_cedit,
int reg )
 

Uses one of these defined methods for moving the cursor: one line up = mc_lineup; one line down = mc_linedown; one page up = mc_pageup; one page down = mc_pagedown (the number of lines per page is defined in page_line_count).
Move to the beginning of the current line = mc_home; move to the end of the current line = mc_end.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
reg   The method of moving. See "Remarks"
Returns:
The resulting cursor position
       #include <cywin.h>
       ...
       struct cEdit cedit;
       sruct Message* ptr_message;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_normal,
                   CLR_LTGRAY,
                   100 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       ptr_message = cWinApp_get_message( main_module.m_process, 0, 1, MSG_USER );
       if( ( ptr_message->msgid == MSG_KEYDOWN ) &&
           ( Message_get_key_param(ptr_message)->scancode == KEY_U ))
            cEdit_MoveCursor( &cedit, mc_pageup );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
See also:
mc_lineup , mc_linedown , mc_pageup , mc_pagedown , mc_home , mc_end.

bool cEdit_Select ( struct cEdit * ptr_cedit )
 

Selects a cEdit object.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
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 ); 

int cEdit_SetCursorPos ( struct cEdit * ptr_cedit,
int position )
 

Moves the cursor to a given position relative to the beginning of a string or block of text.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
position   The new cursor position
Returns:
The resulting cursor position
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       // Sets the password's character limit. A password can't be longer than 8 characters.
       if ( cEdit_GetCursorPos( &cedit ) >= 8 )
       {
         cEdit_SetReadOnly( &cedit, TRUE );
         cEdit_SetCursorPos( &cedit, 0 );
       }
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
See also:
cEdit_GetCursorPos.

int cEdit_SetPageLineCount ( struct cEdit * ptr_cedit,
int lines )
 

Sets the page length (number of lines to move text when using cursor pageup/down commands).

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
lines   The number of lines
Returns:
The previous page line count
       #include <cywin.h>
       ...
       struct cEdit cedit;
       sruct Message* ptr_message;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_normal,
                   CLR_LTGRAY,
                   100 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       ptr_message = cWinApp_get_message( main_module.m_process, 0, 1, MSG_USER );
       if( ( ptr_message->msgid == MSG_KEYDOWN ) &&
           ( Message_get_key_param(ptr_message)->scancode == KEY_U ))
       {
            // Page will contain 20 lines.
            cEdit_SetPageLineCount( &cedit, 20 );
            cEdit_MoveCursor( &cedit, mc_pageup );
       }
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );

bool cEdit_SetReadOnly ( struct cEdit * ptr_cedit,
bool state )
 

Sets a read-only state.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
state   TRUE if the read-only state needs to be set
Returns:
The previous read-only state
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       // Sets the password's character limit. A password can't be longer than 8 symbols.
       if ( cEdit_GetCursorPos( &cedit ) >= 8 )
            cEdit_SetReadOnly( &cedit, TRUE );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );

int cEdit_SetText ( struct cEdit * ptr_cedit,
char * text )
 

Loads text from an external buffer.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
text   The text to set
Returns:
The number of characters in the text string
       #include <cywin.h>
       ...
       struct cEdit cedit;
       int    numSimb;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_normal,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       numSimb = cEdit_SetText( &cedit, "This text will be loaded" );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
See also:
cEdit_SetText_Ex, cEdit_GetText.

int cEdit_SetText_Ex ( struct cEdit * ptr_cedit,
struct Input * ptr_input )
 

Loads text from an external input stream.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
ptr_input   A pointer to the initialized Input object
Returns:
The number of characters in the text string
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       struct FileInput file_doc;
       ...
       init_module( &main_module );
       ...
       FileInput_ctor_Ex( &file_doc, "doc.txt" );
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       cEdit_SetText_Ex( &cedit, &file_doc );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
       FileInput_dtor( &file_doc, LEAVE_MEMORY );
See also:
cEdit_SetText.

void cEdit_Show ( struct cEdit * ptr_cedit )
 

Shows a cEdit object.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
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:
cEdit_Hide.

struct cEdit * cEdit_ctor ( struct cEdit * ptr_cedit,
struct Font * ptr_cfont,
int buffer_size,
int style,
color_t color,
int width )
 

Constructor.

Parameters:
ptr_cedit   A pointer to the cEdit struct
ptr_cfont   The font for drawing text
buffer_size   Maximum text length (not including finishing '\0')
style   Style state bits
color   Text color.
width   Width of the edit window (-1 means single-line style with unlimited width and horizontal scrolling)
Returns:
A pointer to the initialized cEdit object.
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
See also:
cEdit_dtor.

void cEdit_dtor ( struct cEdit * ptr_cedit,
int memory_flag )
 

Destructor.
Deletes an object.

Parameters:
ptr_cedit   A pointer to the initialized cEdit 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>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );
See also:
cEdit_ctor, FREE_MEMORY, LEAVE_MEMORY.

bool cEdit_proc ( struct cEdit * ptr_cedit,
struct Message * ptr_message )
 

Message-processing function.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
ptr_message   A pointer to the Message struct
Returns:
TRUE if the message was processed
       #include <cywin.h>
       ...
       struct cEdit cedit;
       struct module_t main_module;
       struct Message* ptr_message;
       ...
       init_module( &main_module );
       ...
       // The color value may be: CLR_LTGRAY, CLR_BKGRAY,
       //                         CLR_WHITE, CLR_BLACK.
       cEdit_ctor( &cedit,
                   cool_normal_font,
                   100,
                   es_password,
                   CLR_LTGRAY,
                   -1 );
       // Puts the cBitmap object on the Cybiko screen.
       cWinApp_AddObj( main_module.m_process, &cedit, 10, 40 );
       ...
       ptr_message = cWinApp_get_message( main_module.m_process, 0, 1, MSG_USER );
       // Processes the messages that the cEdit control manages.
       cEdit_proc( &cedit, ptr_message );
       ...
       cEdit_dtor( &cedit, LEAVE_MEMORY );

void cEdit_update ( struct cEdit * ptr_cedit )
 

Updates a cEdit object.

Parameters:
ptr_cedit   A pointer to the initialized cEdit object
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 );