The same type of string as in the cItem structure. However, it is possible to insert text on the right or an icon on the left, and to select one of the values assigned previously.
You must call the cXItem_ctor function before use and the cXItem_dtor function after use.
Disables a cXItem object so that it cannot be selected.
Disconnects a cXItem from its parent object.
Enables a cXItem object so that it may be selected.
Deselects the left or right section of the item (if either was selected), and restores L/Rsel from L/Rprev.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... // For example, icon "1" is selected now, you can bypass the icon "2" value and set the icon "3" value. cXItem_SetLeft( ptr_menu_item, 2 ); ... // Restores the previous state. cXItem_Esc( ptr_menu_item, FREE_MEMORY ); cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
Returns a pointer to the cClip of the parent object.
Returns the item's title.
Hides a cXItem object.
Deselects the left or right section of the item (if either was selected), and saves L/Rsel to L/Rprev.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... // For example, icon "1" is selected now, you can bypass the icon "2" value and set the icon "3" value. cXItem_SetLeft( ptr_menu_item, 2 ); ... // Save the current state. cXItem_OK( ptr_menu_item, FREE_MEMORY ); cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
Selects the left-side section of the item (only if the item has focus).
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... // If you on the right item part now you can select the left item part. Note, the focus would be on the left part. cXItem_SelLeft( ptr_menu_item ); ... cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
Selects the right-side section of the item (only if the item has focus).
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... // If you on the left item part now you can select the right item part. Note, the focus would be on the right part. cXItem_SelRight( ptr_menu_item ); ... cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
Selects cXItem object.
Changes the left section's value by 'index'.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... // For example, "Digit 1" value is selected now, you can bypass "Digit 2" value and set the "Digit 3" value. cXItem_SetRight( ptr_menu_item, 2 ); ... cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
Changes the right section's value by 'index'.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... // For example, icon "1" is selected now, you can bypass the icon "2" value and set the icon "3" value. cXItem_SetLeft( ptr_menu_item, 2 ); ... cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
Shows a cXItem object.
Constructor.
Creates a cXItem object.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
Destructor.
It deletes the cXItem object.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
The Message-processing function.
#include <cywin.h> ... { struct BitmapSequence sq; struct Bitmap* bmps[4]; char right_index = 1; char left_index = 1; struct cItem* ptr_menu_item; static const char* sz_menu_text[4] = { "Digit 1", "Digit 2", "Digit 3", '0円' }; 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 ) ); // Item will be shown as follows: '2' | "Now digit is" | "Digit 2" cXItem_ctor( ptr_menu_item, 160, "Now digit is", sz_menu_text, &right_index, FALSE, FALSE, bmps, &left_index ); cWinApp_AddObj( main_module.m_process, ptr_menu_item, 0, 40 ); ... ptr_message = cWinApp_get_message( main_module.m_process, 0, 1, MSG_USER ); // cXItem will be redraw automatically now. cXItem_proc( ptr_menu_item, ptr_message ); ... // Now you can use the <Select> button to change values on the left part of the item: "Digit 1"->"Digit 2"-> etc. // To move to the right part use the arrows buttons. // Now you can use the <Select> button to change values on the right part of the item: icon '1'->icon '2'-> etc. ... // For example, icon "1" is selected now, you can bypass the icon "2" value and set the icon "3" value. cXItem_SetLeft( ptr_menu_item, 2 ); ... // Restore the previous state. cXItem_Esc( ptr_menu_item, FREE_MEMORY ); cXItem_dtor( ptr_menu_item, FREE_MEMORY ); }
Updates a cXItem object.