Kbase 19840: 4GL. How to Use Drop Target Attribute in Version 9.x
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  24/09/2008 |
|
Status: Verified
GOAL:
4GL. How to use the new Drop-Target attribute and it's supporting attributes and methods.
FACT(s) (Environment):
Progress 9.x
FIX:
The following methods and attributes are documented in the Progress Language Reference and Programming Handbook. They are intended for use in Graphical Interfaces only.
Example:
DEFINE VARIABLE cWin AS HANDLE NO-UNDO.
DEFINE VARIABLE EDITOR-1 AS CHARACTER
VIEW-AS EDITOR SIZE 127 BY 20 DROP-TARGET FONT 5 NO-UNDO.
DEFINE VARIABLE vFileName AS CHARACTER NO-UNDO.
DEFINE BUTTON bDone LABEL "&Done" SIZE 16 BY 1.2 AUTO-GO.
CREATE WINDOW cWin.
ASSIGN CURRENT-WINDOW = cWin
cWin:WIDTH-CHARS = 129.1
cWin:MESSAGE-AREA = FALSE
cWin:STATUS-AREA = FALSE
cWin:TITLE = "Drop File Here..."
cWin:THREE-D = TRUE NO-ERROR.
DEFINE FRAME edFrame EDITOR-1 AT 2 SKIP(.3) bDone AT 113.5
WITH THREE-D WIDTH 129.2 NO-LABELS NO-BOX ROW 2.
ASSIGN cWin:HEIGHT-CHARS = FRAME edFrame:HEIGHT-CHARS + 1
NO-ERROR.
ON 'DROP-FILE-NOTIFY':U OF EDITOR-1 DO:
ASSIGN EDITOR-1:SCREEN-VALUE = ""
vFileName = EDITOR-1:GET-DROPPED-FILE(1)
cWin:TITLE = "Drop File Here... " + vFileName
NO-ERROR.
EDITOR-1:INSERT-FILE(vFileName) NO-ERROR.
EDITOR-1:END-FILE-DROP(). /* Realocate memory Progress uses to */
/* store file name retrieved with */
/* GET-DROPPED-FILE() Method */
APPLY "ENTRY":U TO SELF.
END.
ON 'END-ERROR':U ANYWHERE DO:
RETURN NO-APPLY.
END.
ENABLE ALL WITH FRAME edFrame.
WAIT-FOR GO OF FRAME edFrame OR
WINDOW-CLOSE OF CURRENT-WINDOW.
QUIT.
Reference to Written Documentation:
Progress 4GL Language Reference.
Progress Programming Handbook.