i’m searching for a additional window beside the editorwindow which gives me an overview of the Subroutines and variable Definitions from the actual subprogram or program. If someone knows like the “Outline” window at Eclipse. It would be Great to get to the Line of Code by Clicking to needed Statemend within the Window.
This is an interesting feature with Eclipse. There are many other very good features in Eclipse as well. We are looking at Eclipse and will decide on possible features in Natural Studio when the upcoming release Natural 6.2 is out of the door.
Regards,
Michael
Noone uses such provocative variable names at our department. Anyway I thought that Software AG had put stoppers against reserved words in variable names into the compilers.
@Allan:
Do you pass a refresh object with the Refresh method? Anyway, you should watch for the GetChildren method being called for each node concerned by the refresh, which gives you the opportunity to pass a new child list and let Natural Studio update the tree. The fact that you receive the NOTIFY-REFRESH notificiation at all indicates at least that you have already taken the first hurdle: ‘Automatic refresh’ is turned on in Tools/Options/Workspace’.
Regards, +o:-]
I don’t understand. I don’t call the Refresh method. The notify method gets call by Natural Studio, when window focus is changed and source i the program editor gets saved. The object in OBJECTPARAM is my ThreeView.
Do I have do call the Refresh method of the Natural Studio, in my notify method?
I got it to work :D. The following code works. If I don’t use the #REFRESH-ACTIVE variabel SPoD loops
IF NOTIFICATION = NOTIFY-REFRESH
IF NOT #REFRESH-ACTIVE
#REFRESH-ACTIVE := TRUE
SEND 'Refresh' TO #STUDIO
#REFRESH-ACTIVE := FALSE
RESULT := 1
END-IF
END-IF
I tried to use the following to avoid looping, but it didn’t make a deference.
COMPRESS '<ritem>'
'<rguid>0025E718-EB5A-4DCC-B691-5603FB123456</rguid>'
'<rtype>30000</rtype>'
'<rkey>ONNFY-N PLUG-IN</rkey>'
'<rinfo></rinfo>'
'</ritem>'
INTO #TEKST-DYN LEAVING NO
SEND 'Refresh' TO #STUDIO
WITH #TEKST-DYN
How I am only missing to get follow code work
#ACTION := 'GOTOLINE'
#START-LINE := VAL(#LINE-NUMBER)
#WITHLINENO := TRUE
RESET #RESPONSE2 #ERR-TXT2
*
CALLNAT 'USR6004N' PARM-AREA
*
IF #RESPONSE2 <> 0
COMPRESS '#RESPONSE:' #RESPONSE ' #ERR-TXT:'
#ERR-TXT INTO #TEKST
SEND 'Messagebox' TO #STUDIO
WITH #TEKST 'Natural studio plug-in'
END-IF
I get “#RESPONSE: 9 #ERR-TXT: Program editor not active and/or no active window”, then the code is run.
No, you should definitely not do this. The notification is just sent in order to inform you that a Refresh is currently taking place and to let you decide if you want to let your views take part in this, not to make you trigger a new (then recursive) Refresh. My question raised from my wrong understanding that “I don’t get the Refresh to work” meant that you are triggering the Refresh yourself by calling the Refresh method.
In this case I presume that by comparing the object currently being refreshed Natural Studio assumes that your tree nodes are not concerned by the ongoing Refresh. It is hard to decide if this is right or wrong without having more detail about the plug-in. If you like, upload it and let me have a short look.
[/quote]
Better don’t do this. The notification indicates that there is a Refresh going on. It should be sufficient to respond with 1. I could possibly tell what’s wrong if you could upload the code.
Regards, +o:-]
@Allan: Thanks for the fine example. Well, I had to add a few things to make the refresh work, but it’s not too hard.
First of all, you should let Natural Studio know that the root node of your tree actually represents a built-in object (say a Program or what else). Otherwise the Refresh mechanics does not know that your tree node has something to do with the object currently being saved. I achieved this by changing the call to the Open method in ONCMD-N to
SEND ‘Open’ TO #MNATAUTOOBJECTTREES
WITH 30000 #TEKST-DYN#TEKST
6X 1009 ‘TESTCLS A1 101 99’
Obviously this works only if you incidentally have a Program TESTCLS in Library A1 on DBnr 99 and Fnr 101 open in the editor, but it should be sufficient to indicate the general approach. This has the nice side effect that Natural Studio treats this node as a Program in any respect, means it shows the right icon and context menu.
Second, I respond to the REFRESH notification in ONNFY-N simply with 1 and do nothing else.
IF NOTIFICATION = NOTIFY-REFRESH
RESULT := 1
END-IF
Third, it is safer to use the original method PDAs from SYSEXPLG (having SYSEXPLG as a steplib) rather that having private copies of the PDAs in the plug-in library. Something seemed to be wrong with the copies (I did not pursue this further), in any case it worked only correctly after I used the original one at least for the OnNotify method.
Having done all this, I nicely received the GetChildren call whenever I saved the source in the editor.