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 cClip* | cEdit_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) |
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.
|
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 );
...
cEdit_ctor( &cedit,
cool_normal_font,
100,
es_normal,
CLR_LTGRAY,
100 );
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.
|