MYTUI

Rapid TUI Application Development

CURSES-BASED • EASY TO USE WIDGETS• WYSIWYG WORKSHOP • FREE SDK
MYTUI Logo

APIs for Combobox Widget

CONTENT

 

1.1. Introduction 2

1.1.1. Look & Feel 3

1.1.2. Key Bindings 3

1.1.3. Callbacks 4

1.2. Attributes 4

1.2.1. ComboBox Name 4

1.2.2. Position 4

1.2.3. Box Mode (Line Editor) 5

1.2.4. Box Attribute (Line Editor) 5

1.2.5. Text (Line Editor) 5

1.2.6. Maximum Text Length (Line Editor) 5

1.2.7. Display Length (Line Editor) 6

1.2.8. Text Attribute (Normal) (Line Editor) 6

1.2.9. Text Attribute (Focus) (Line Editor) 6

1.2.10. Echo Mode (Line Editor) 6

1.2.11. Hide Flag 6

1.2.12. Edit Flag 7

1.2.13. Edit Flag (Line Editor) 7

1.2.14. Drawdown Key Binding 7

1.2.15. Callback Functions 7

1.2.16. Shared Object Name 7

1.2.17. Hint Information 7

1.2.18. Height (Drawdown List Box ) 7

1.2.19. Box Mode (Drawdown List Box ) 8

1.2.20. Box Attrib (Drawdown List Box ) 8

1.2.21. Title Mode (Drawdown List Box ) 8

1.2.22. Title Attrib (Drawdown List Box ) 9

1.2.23. Title Align (Drawdown List Box ) 9

1.2.24. Title (Drawdown List Box ) 9

1.2.25. Item-Value pairs (Drawdown List Box ) 9

1.3. Methods (in alphabetic order) 10

1.3.1. MYCOMBOXaddItem: Append a item to the list 10

1.3.2. MYCOMBOXaddItemValue: Append a item to the list 10

1.3.3. MYCOMBOXgetCurItem: get index of the current item 10

1.3.4. MYCOMBOXgetCurItemValue: get current Item-Value pair 11

1.3.5. MYCOMBOXgetDispLength: get the display length 11

1.3.6. MYCOMBOXgetDrawDownKey: get the drawdown key 11

1.3.7. MYCOMBOXgetItem: get the specified item by index 11

1.3.8. MYCOMBOXgetItemValue: get the Item-Value pair by index 12

1.3.9. MYCOMBOXgetMaxLength: get the maximum text length 12

1.3.10. MYCOMBOXgetPos: get position of the combobox 12

1.3.11. MYCOMBOXgetText: get text of the line editor widget 12

1.3.12. MYCOMBOXitemNumber: return the number of items 13

1.3.13. MYCOMBOXprintf: set the text with the formatted string 13

1.3.14. MYCOMBOXregPostProcess: register the postprocess function 13

1.3.15. MYCOMBOXregPreProcess: register the preprocess function 14

1.3.16. MYCOMBOXremoveAll: delete all items 14

1.3.17. MYCOMBOXremoveItem: delete the specified item by index 14

1.3.18. MYCOMBOXsetCurItem: set the current item 14

1.3.19. MYCOMBOXsetDisplayOnly: set the combobox read only 15

1.3.20. MYCOMBOXsetDispLength: set display length for the combobox 15

1.3.21. MYCOMBOXsetDrawDownKey: set the key binding for popping out the drawdown list box 15

1.3.22. MYCOMBOXsetEchoMode: set echo mode for the combobox 16

1.3.23. MYCOMBOXsetEditable: set thecombobox editable 16

1.3.24. MYCOMBOXsetHint: set the hint information 16

1.3.25. MYCOMBOXsetInvisible: hide the combobox from the form 17

1.3.26. MYCOMBOXsetLineEditAttrib: set display attribute for the text of the line editor 17

1.3.27. MYCOMBOXsetLineEditBoxAttrib: set display attribute for the box of the line editor 17

1.3.28. MYCOMBOXsetLineEditBoxMode: set the line editor¡¯s box mode 18

1.3.29. MYCOMBOXsetLineEditDisplayOnly: set the line editor part read only 18

1.3.30. MYCOMBOXsetLineEditEditable: set the line editor part editable 18

1.3.31. MYCOMBOXsetListBoxAttrib: set display attribute for the drawdown list box 19

1.3.32. MYCOMBOXsetListBoxMode: set box mode for the drawdown list box 19

1.3.33. MYCOMBOXsetListHeight: set height for the drawdown list box 19

1.3.34. MYCOMBOXsetListTitle: set title for the drawdown list box 20

1.3.35. MYCOMBOXsetListTitleAlign: set text alignment for the title bar of the drawdown list box 20

1.3.36. MYCOMBOXsetListTitleAttrib: set display attribute for the title bar of the drawdown list box 20

1.3.37. MYCOMBOXsetListTitleMode: set the title bar¡¯s mode for the drawdown list box 21

1.3.38. MYCOMBOXsetMaxLength: set maximum length for the line editor¡¯s text 21

1.3.39. MYCOMBOXsetPos: set combobox¡¯s position within the form 21

1.3.40. MYCOMBOXsetText: set line editor¡¯s text for the combobox 22

1.3.41. MYCOMBOXsetVisible: make the combobox visible 22

 

1.1. Introduction

The ComboBox widget is a combined line editor and drawdown list box (drawdown list box is the base widget for combobox and popup/pulldown menu, it cannot be referred alone). It provides a means of presenting a list of options to the user in a way that takes up the minimum amount of screen space.

A combobox is a line editor widget that displays the current item, and can pop up a list of selectable items (drawdown list box). By default the line editor is read-only, but can be set editable to let the user change the content selected from the list items.

Each item in the draw down list box is an Item/Value pair, just likes the Option/Value pair definition for the SELECT element of a FORM in a HTML document. The item is displayed on the list box and the respective value is what you really want to get when the item is selected. For example, you can define a item as ¡°First/0¡± pair, which you can get ¡®0¡¯ by method MYCOMBOXgetCurItemValue() when ¡°First¡± is selected.

As it is a combination of two widgets, most of the attributes and methods are inherited from the line editor and drawdown list box. So here we don¡¯t want to introduce the line editor again (you can refer to line editor¡¯s manual for details).

You can change the edit flag with MYCOMBOXsetDisplayOnly() to turn the combobox into a read-only object, or activate again with MYCOMBOXsetEditable().

By changing the hide flag with MYCOMBOXsetInvisible() or MYCOMBOXsetVisible(), it can be hidden from or redisplayed on the form window.

The drawdown list box¡¯s height can be set with method MYCOMBOXsetListHeight(), however, it must be limited within the height of the form window¡¯s workarea.