A cXStr object might have an icon on the left and/or additional text on the right. It is possible to input text into the right field. You must call the cXStr_ctor function before use and the cXStr_dtor function after use.
Disables a cXStr object so that it cannot be selected.
Disconnects a cXStr from its parent object.
Enables a cXStr object so that it may be selected.
Clears an edited string and deselects the section on the item's right side(if it was selected).
Behavior for the left side is not changed.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char icon_index = 2; struct cItem* ptr_menu_item; char buffer[100]; init_module(&main_module); // Bitmap sequence contains three icons: digit '1', digit '2', digit '3'. BitmapSequence_ctor_Ex(&sq, "digits.pic"); bmps[0] = BitmapSequence_get_bitmap(&sq, 0); bmps[1] = BitmapSequence_get_bitmap(&sq, 1); bmps[2] = BitmapSequence_get_bitmap(&sq, 2); bmps[3] = NULL; cWinApp_clear_screen(); ptr_menu_item = (struct cItem* )malloc ( sizeof ( struct cItem ) ); strcpy( buffer, "Initial value" ); ... // Item will be shown as follows: '3' | "Any item" | "Initial value" cXStr_ctor( ptr_menu_item, 160, "Any item", buffer, 30, 80, bmps, &icon_index, FALSE ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... // We have made changes then restore the previous state. cXStr_Esc( ptr_menu_item ); ... cXStr_dtor( ptr_menu_item, FREE_MEMORY ); }
Returns a pointer to the cClip of the parent object.
Returns the item's title.
Hides a cXStr object.
Saves an edited string and deselects the section on the item's right side (if it was selected).
Behavior for the left side is not changed.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char icon_index = 2; struct cItem* ptr_menu_item; char buffer[100]; init_module(&main_module); // Bitmap sequence contains three icons: digit '1', digit '2', digit '3'. BitmapSequence_ctor_Ex(&sq, "digits.pic"); bmps[0] = BitmapSequence_get_bitmap(&sq, 0); bmps[1] = BitmapSequence_get_bitmap(&sq, 1); bmps[2] = BitmapSequence_get_bitmap(&sq, 2); bmps[3] = NULL; cWinApp_clear_screen(); ptr_menu_item = (struct cItem* )malloc ( sizeof ( struct cItem ) ); strcpy( buffer, "Initial value" ); // Item will be shown as follows: '3' | "Any item" | "Initial value" cXStr_ctor( ptr_menu_item, 160, "Any item", buffer, 30, 80, bmps, &icon_index, FALSE ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... // Saves the current state cXStr_OK( ptr_menu_item ); ... cXStr_dtor( ptr_menu_item, FREE_MEMORY ); }
Saves a Str to an external string.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char icon_index = 2; struct cItem* ptr_menu_item; char buffer[100]; init_module(&main_module); // Bitmap sequence contains three icons: digit '1', digit '2', digit '3'. BitmapSequence_ctor_Ex(&sq, "digits.pic"); bmps[0] = BitmapSequence_get_bitmap(&sq, 0); bmps[1] = BitmapSequence_get_bitmap(&sq, 1); bmps[2] = BitmapSequence_get_bitmap(&sq, 2); bmps[3] = NULL; cWinApp_clear_screen(); ptr_menu_item = (struct cItem* )malloc ( sizeof ( struct cItem ) ); strcpy( buffer, "Initial value" ); ... // Item will be shown as follows: '3' | "Any item" | "Initial value" cXStr_ctor( ptr_menu_item, 160, "Any item", buffer, 30, 80, bmps, &icon_index, FALSE ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... // If we made a change in the right section of the item, this function saves it in the 'buffer'. cXStr_SaveStr( ptr_menu_item ); ... cXStr_dtor( ptr_menu_item, FREE_MEMORY ); }
Selects the section on the item's left side (only if the item has the focus).
Selects the section on the item's right side (only if the item has the focus).
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char icon_index = 2; struct cItem* ptr_menu_item; char buffer[100]; ... init_module(&main_module); // Bitmap sequence contains three icons: digit '1', digit '2', digit '3'. BitmapSequence_ctor_Ex(&sq, "digits.pic"); bmps[0] = BitmapSequence_get_bitmap(&sq, 0); bmps[1] = BitmapSequence_get_bitmap(&sq, 1); bmps[2] = BitmapSequence_get_bitmap(&sq, 2); bmps[3] = NULL; cWinApp_clear_screen(); ptr_menu_item = (struct cItem* )malloc ( sizeof ( struct cItem ) ); strcpy( buffer, "Initial value" ); // Item will be shown as follows: '3' | "Any item" | "Initial value" cXStr_ctor( ptr_menu_item, 160, "Any item", buffer, 30, 80, bmps, &icon_index, FALSE ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... // Selects the right part. cXStr_SelRight( ptr_menu_item ); ... cXStr_dtor( ptr_menu_item, FREE_MEMORY ); }
Selects a cXStr object.
Changes the left section's value by 'index'.
Changes right section's value by 'index'.
Highlights the entire whole right-side string, and positions the cursor at its end (only when the section on the item's right side is selected).
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char icon_index = 2; struct cItem* ptr_menu_item; char buffer[100]; ... init_module(&main_module); // Bitmap sequence contains three icons: digit '1', digit '2', digit '3'. BitmapSequence_ctor_Ex(&sq, "digits.pic"); bmps[0] = BitmapSequence_get_bitmap(&sq, 0); bmps[1] = BitmapSequence_get_bitmap(&sq, 1); bmps[2] = BitmapSequence_get_bitmap(&sq, 2); bmps[3] = NULL; cWinApp_clear_screen(); ptr_menu_item = (struct cItem* )malloc ( sizeof ( struct cItem ) ); strcpy( buffer, "Initial value" ); ... // Item will be shown as follows: '3' | "Any item" | "Initial value" cXStr_ctor( ptr_menu_item, 160, "Any item", buffer, 30, 80, bmps, &icon_index, FALSE ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... // Highlights the right part. cXStr_SetStart( ptr_menu_item ); ... cXStr_dtor( ptr_menu_item, FREE_MEMORY ); }
Shows a cXStr object.
Constructor.
Creates a cXStr object.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char icon_index = 2; struct cItem* ptr_menu_item; char buffer[100]; init_module(&main_module); // Bitmap sequence contains three icons: digit '1', digit '2', digit '3'. BitmapSequence_ctor_Ex(&sq, "digits.pic"); bmps[0] = BitmapSequence_get_bitmap(&sq, 0); bmps[1] = BitmapSequence_get_bitmap(&sq, 1); bmps[2] = BitmapSequence_get_bitmap(&sq, 2); bmps[3] = NULL; cWinApp_clear_screen(); ptr_menu_item = (struct cItem* )malloc ( sizeof ( struct cItem ) ); strcpy( buffer, "Initial value" ); // Item will be shown as follows: '3' | "Any item" | "Initial value" cXStr_ctor( ptr_menu_item, 160, "Any item", buffer, 30, 80, bmps, &icon_index, FALSE ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... cXStr_dtor( ptr_menu_item, FREE_MEMORY ); }
Destructor.
Deletes the cXStr object.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char icon_index = 2; struct cItem* ptr_menu_item; char buffer[100]; init_module(&main_module); // Bitmap sequence contains three icons: digit '1', digit '2', digit '3'. BitmapSequence_ctor_Ex(&sq, "digits.pic"); bmps[0] = BitmapSequence_get_bitmap(&sq, 0); bmps[1] = BitmapSequence_get_bitmap(&sq, 1); bmps[2] = BitmapSequence_get_bitmap(&sq, 2); bmps[3] = NULL; cWinApp_clear_screen(); ptr_menu_item = (struct cItem* )malloc ( sizeof ( struct cItem ) ); strcpy( buffer, "Initial value" ); ... // Item will be shown as follows: '3' | "Any item" | "Initial value" cXStr_ctor( ptr_menu_item, 160, "Any item", buffer, 30, 80, bmps, &icon_index, FALSE ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... cXStr_dtor( ptr_menu_item, FREE_MEMORY ); }
The Message-processing function.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char icon_index = 2; struct cItem* ptr_menu_item; char buffer[100]; struct Message* ptr_message; ... init_module(&main_module); // Bitmap sequence contains three icons: digit '1', digit '2', digit '3'. BitmapSequence_ctor_Ex(&sq, "digits.pic"); bmps[0] = BitmapSequence_get_bitmap(&sq, 0); bmps[1] = BitmapSequence_get_bitmap(&sq, 1); bmps[2] = BitmapSequence_get_bitmap(&sq, 2); bmps[3] = NULL; cWinApp_clear_screen(); ptr_menu_item = (struct cItem* )malloc ( sizeof ( struct cItem ) ); strcpy( buffer, "Initial value" ); ... // Item will be shown as follows: '3' | "Any item" | "Initial value" cXStr_ctor( ptr_menu_item, 160, "Any item", buffer, 30, 80, bmps, &icon_index, FALSE ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... ptr_message = cWinApp_get_message( main_module.m_process, 0, 1, MSG_USER ); // Processes the messages that the cXStr control manages. cXStr_proc( ptr_menu_item, ptr_message ); ... // If we made change in the right item part this function saves it in the 'buffer'. cXStr_SaveStr( ptr_menu_item ); ... cXStr_dtor( ptr_menu_item, FREE_MEMORY ); }
Updates a cXStr object.