currently open file in Procedure editor/AppBuilder

jke

New Member
Hello,

we are currently trying to add some functionality to appbuilder and the procedure editor. We have added buttons to pro*tools. Now we have a problem: We seem unable to determine the file being currently edited.
Is there a way to know the filename (absolute path)?

We already found the open window (active-window) and if a file is opened in the procedure editor, we could parse the filename from the title of the window. If we are editing a .w file, only the filename, without the path is in the title. Any suggestions?

Thanks in advance,

Jan
 

jongpau

Member
Interesting, when I open a .w in the procedure editor I do get the full path in the title bar of the editor. Not sure where that difference comes from. I suppose using "search (filename)" to find the file within the propath is out of the question?
 

jke

New Member
I do not mean when opening the file in de procedure editor. There is does show the full path in the title. The problem is when the file is openend with appbuilder, where you can do the gui design. There you cannot see the full path in the title of the window being designed.
 

jke

New Member
Step 1 is solved. We found the name of the open file in the procedure editor. Step 2: AppBuilder ;-)

hanProEditor:NAME contains the filename at the end of the following procedure.


DEF VARIABLE hanEditWindow AS WIDGET-HANDLE NO-UNDO.
DEF VAR hanProEditor AS WIDGET-HANDLE NO-UNDO.
DEF VAR hanFrame AS WIDGET-HANDLE NO-UNDO.
DEF VAR hanHandle AS HANDLE NO-UNDO.

ASSIGN hanFrame = ACTIVE-WINDOW:FIRST-CHILD .
ASSIGN hanHandle = hanFrame:CURRENT-ITERATION.
ASSIGN hanHandle = hanHandle:FIRST-CHILD.

DO WHILE VALID-HANDLE(hanHandle) :
IF CAN-QUERY(hanHandle, "TYPE":U) THEN
DO:
IF hanHandle:TYPE = "EDITOR":U THEN
DO:
ASSIGN hanProEditor = hanHandle.
END.
END.

ASSIGN hanHandle = hanHandle:NEXT-SIBLING.
END.

MESSAGE hanProEditor:NAME.
 
Top