; --------------------------------------------------------------------------------
; @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-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: dialog_pulldown.cmm 11037 2017-06-30 11:36:05Z 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" "CONTinue"
  POS 16. 5. 12. 1.
  BUTTON    "Cancel" "GOTO cancel"
;define action when window is closed
  CLOSE "GOTO cancel"
)
  
;set default selections
  DIALOG.SET OptionA.SEL "Option2"
  DIALOG.SET OptionB.SEL "Option5"
;STOP command halts script execution 
  STOP

;script will continue here when "OK" button is clicked

;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"
ENDDO

;script continues here when Cancel is clicked"
cancel:
  DIALOG.END
  DIALOG.OK "Cancelled"
ENDDO
