
|
- Written and documented by David Deley
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12.1: 12.2: 12.3: 12.4:
Introduction to CMac Chapter 12.1: DIALOG BOXES: The Elements
First you should read chapters 6 & 7 on Dialog Boxes in the CMAC User Guide. Details
mentioned there are not mentioned here.
![]() STATIC BITMAP (dlg_BitmapStatic) All available bitmap images are listed in the CMAC User Guide Chapter 7. This one is bitmap BT_ED_110. BOXES, RECTANGLES, FRAMES ![]() GROUP BOX (dlg_GroupBox) A group box has text such as the word "Options" here. The following two look similar: ![]() GREY FRAME (dlg_GreyFrame) ![]() GREY RECTANGLE (dlg_GreyRect) The following four look similar: ![]() BLACK FRAME (dlg_BlackFrame) ![]() BLACK RECTANGLE (dlg_BlackRect) ![]() WHITE FRAME (dlg_WhiteFrame) ![]() WHITE RECTANGLE (dlg_WhiteRect) EXAMPLE: Put them all together and you can make a dialog box such as this:
MORE DIALOG BOX CONTROLS ListBox The dlg_ListBox control is quite versatile. Use it when you want to display a list of items. Here is a simple example from Introduction to CMAC. 7: Multi-Edit Tags. ![]() More examples of a ListBox: TOOLS -> ASCII TABLE (lists all the ASCII codes) TOOLS -> CALCULATOR (scrolling tape display) "List All Macros". MACRO -> RUN, enter "ListMacs" "List All Globals". MACRO -> RUN, enter "ListGlob" "List Tags". MACRO -> RUN, enter "Tag_List" (two ListBox windows on top and a dlg_ViewTextBox on the bottom.) TOOLS -> CUSTOMIZE -> General (left side) -> COLORS (the list of colors for each kind of line.) TOOLS -> CUSTOMIZE -> Import/Export (left side). A ListBox in the middle and a dlg_TreeList on the right. TreeList The dlg_TreeList control lists folders and files in a hierarchical tree view. For example the "Find 0" tab displays a TreeList when you do a "File Find" (SEARCH -> FILE FIND).
ViewTextBox The dlg_ViewTextBox control allows you to place a text window in a dialog box. This example is from Introduction to CMAC. 7: Multi-Edit Tags Notice it's a dialog box, there's the "Tags" bitmap in the upper left corner (BT_TAGS_100), and pushbuttons "Next", "Load", "Close", and "Help". You can not edit the text in a ViewTextBox.
TabBar and TreeBar dlg_TabBar A more advanced dialog box can use tabs. The tab you select determines what you see. The "Search" dialog has six tabs: (dlg_TabBar)
dlg_TreeBar A similar concept is the tree bar. One example of this is the TOOLS -> CUSTOMIZE dialog. The option you select on the left determines what you see on the right. (dlg_TreeBar)
(dlg_SubDlg is used with TabBars and TreeBars) The following dialog elements are not used by Multi-Edit. I've had no success getting them to work. However there are alternatives for each one. dlg_RealNumber Real number prompt. Dialog works but there's no way to retrieve the number. Instead use dlg_Text to get a string, then use Rval to convert string to a real number. dlg_Hex Hex number prompt. No success getting this one to work. Instead use dlg_Text to get a hex string, then convert hex string to integer using a routine similar to this:
dlg_ListTextBox I think this one is obsolete. Use dlg_ListBox instead for a more versatile control. dlg_MacroBtnInt Use dlg_MacroBtnStr, using a string version of the integer. dlg_HiddenStr Hidden text prompt - for passwords, etc. Instead use dlg_Text with dlgf_es_Password flag. dlg_HiddenInt Hidden integer prompt - for passwords, PINs, etc. Instead use dlg_Text with dlgf_es_Password flag. Then convert string to integer using Val. Will discuss later (maybe): dlg_OwnerButton //Used twice in COLORS.S dlg_BitmapDefine That's all of them. Related Articles: Introduction to CMAC 12.1 DIALOG BOXES: The Elements Introduction to CMAC 12.2 DIALOG BOXES: The Coordinates Introduction to CMAC 12.3 DIALOG BOXES: Sample Code For Each Control Introduction to CMAC 12.4 DIALOG BOXES: DlgExecute {under construction} (Edits to this Introduction to CMAC series are occasionally made as I learn more.) 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12.1: 12.2: 12.3: 12.4: |