; -------------------------------------------------------------------------------- ; @Title: Example for dialog with a combo box ; @Description: ; Shows a dialog with a combobox ; For more information please refer to training_practice.pdf and ide_user.pdf ; @Keywords: combobox, dialog, practice ; @Author: REI ; @Copyright: (C) 1989-2021 Lauterbach GmbH, licensed for use with TRACE32(R) only ; -------------------------------------------------------------------------------- ; $Id: dialog_combobox.cmm 18691 2021-12-15 18:51:36Z rweiss $ DIALOG ( HEADER "COMBOBOX Demo" ; define dialog width by printing empty text: POS 0. 0. 1. POS 0. 0. 29. 1. TEXT "" POS 1. 0. 27. 1. TEXT "Select OptionA:" OptionA.SEL: DEFCOMBOBOX "Option1,Option2,Option3,Option4,Option5" "" TEXT "Select OptionB:" OptionB.SEL: COMBOBOX "Option1,Option2,Option3,Option4,Option5" "" ;buttons OK (Default) and Cancel POS 1. 5. 12. 1. DEFBUTTON "OK" "GOSUB OnOK" POS 16. 5. 12. 1. BUTTON "Cancel" "GOSUB OnCancel" ;dialog open event INIT ( ;set default selections DIALOG.SET OptionA.SEL "Option2" DIALOG.SET OptionB.SEL "Option5" ) ;dialog close event CLOSE "GOSUB OnCancel" ;subroutines SUBROUTINE OnOK ( ;get selection &SelectionA=DIALOG.STRING(OptionA.SEL); &SelectionB=DIALOG.STRING(OptionB.SEL); ;close dialog window DIALOG.END ;print result DIALOG.OK "SelectionA: &SelectionA" "SelectionB: &SelectionB" ) SUBROUTINE OnCancel ( DIALOG.END DIALOG.OK "Cancelled" ) ) ENDDO