; --------------------------------------------------------------------------------
; @Title: Example for dialog with a edit field
; @Description:
;   Shows a dialog with a single and multi line edit fields
;   For more information please refer to training_practice.pdf and ide_user.pdf
; @Keywords: dialog, edit, editfield, multiline, practice
; @Author: REI
; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: dialog_edit.cmm 11037 2017-06-30 11:36:05Z rweiss $


DIALOG
(
  HEADER "EDIT demo"
; define dialog width by inserting empty text: POS 0. 0. <width> 1.
  POS 0. 0. 25. 1.
  TEXT ""

  POS 1. 0. 23. 1.
  TEXT "Single Line Text:"
  TextA:    EDIT "type here" ""
  TEXT "Multi Line Text:"
  POS 1. 3. 23. 3.
  TextB:    MEDIT "type"+conv.char(0xa)+"here" ""

;buttons OK (Default) and Cancel
  POS 1. 6. 10. 1.
  DEFBUTTON "OK" "CONTinue"
  POS 14. 6. 10. 1.
  BUTTON    "Cancel" "GOTO cancel"
;define action when window is closed
  CLOSE "GOTO cancel"
)

;STOP command halts script execution 
  STOP

;script will continue here when "OK" button is clicked

;get selection
  &TextA=DIALOG.STRING(TextA);
  &TextB=DIALOG.STRING(TextB);

;print result
  DIALOG.OK "Single Line Text: ""&TextA"""  "Multi Line Text:" "--------------------" "&TextB" "--------------------"
;close dialog window  
  DIALOG.END
ENDDO

;script continues here when Cancel is clicked"
cancel:
  DIALOG.END
  DIALOG.OK "Cancelled"
ENDDO
