58 lines
1.5 KiB
Plaintext
58 lines
1.5 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: Example for dialog with a pulldown menu
|
|
; @Description:
|
|
; Shows a dialog with a pulldown menu
|
|
; For more information please refer to training_practice.pdf and ide_user.pdf
|
|
; @Keywords: dialog, practice, pulldown
|
|
; @Author: REI
|
|
; @Copyright: (C) 1989-2021 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; --------------------------------------------------------------------------------
|
|
; $Id: dialog_pulldown.cmm 18691 2021-12-15 18:51:36Z rweiss $
|
|
|
|
|
|
DIALOG
|
|
(
|
|
HEADER "PULLDOWN demo"
|
|
; define dialog width by inserting empty text: POS 0. 0. <width> 1.
|
|
POS 0. 0. 29. 1.
|
|
TEXT ""
|
|
|
|
POS 1. 0. 27. 1.
|
|
TEXT "Select OptionA:"
|
|
OptionA.SEL: PULLDOWN "Option1,Option2,Option3,Option4,Option5" ""
|
|
TEXT "Select OptionB:"
|
|
OptionB.SEL: PULLDOWN "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
|
|
(
|
|
&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
|