 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Manfra Guest
|
Posted: Mon Dec 04, 2006 9:08 pm Post subject: Refresh Files already opened in the IDE |
|
|
Hi, i wrote a code generator (a program that modifies source code) as
an expert for delphi. The problem is that every time i run the code
generator, if some of the files modified by the generator are already
opened in IDE , the delphi doenst refresh the buffer with the
modifications, i need to ALT_TAB to other app and then ALT_TAB back to
delphi to have the files refreshed. so i need to write some code to
automatically refresh the files already opened in the IDE using Open
Tools but i could find a way to do it.... would appreciate any help.
Thank You. |
|
| Back to top |
|
 |
Christian Wilkerson Guest
|
Posted: Tue Dec 05, 2006 1:05 am Post subject: Re: Refresh Files already opened in the IDE |
|
|
In ToolsAPI.pas, IOTAActionServices has a method called ReloadFile that
takes a filename as a parameter. I think that will do it.
Of course you're going to need a way to see if the file is already open,
there you can turn to IOTAModuleServices which has a property called
ModuleCount which returns the number of open modules. IOTAModuleServices
also has a Modules property which allows you to iterate through the open
modules. Each module has a FileName property so you can compare that with
whatever your looking to reload. There is also a FindModule method
IOTAModuleServices70, but I'm not sure if the module needs to be open or
not.
HTH,
-Christian
"Manfra" <fgmanfredini (AT) gmail (DOT) com> wrote in message
news:1165244911.353599.230930 (AT) f1g2000cwa (DOT) googlegroups.com...
| Quote: | Hi, i wrote a code generator (a program that modifies source code) as
an expert for delphi. The problem is that every time i run the code
generator, if some of the files modified by the generator are already
opened in IDE , the delphi doenst refresh the buffer with the
modifications, i need to ALT_TAB to other app and then ALT_TAB back to
delphi to have the files refreshed. so i need to write some code to
automatically refresh the files already opened in the IDE using Open
Tools but i could find a way to do it.... would appreciate any help.
Thank You.
|
|
|
| Back to top |
|
 |
Manfra Guest
|
Posted: Tue Dec 05, 2006 11:33 pm Post subject: Re: Refresh Files already opened in the IDE |
|
|
Thank you Christian, that solved my problem... the ReloadFile was
exactly what i was looking for...
Christian Wilkerson escreveu:
| Quote: | In ToolsAPI.pas, IOTAActionServices has a method called ReloadFile that
takes a filename as a parameter. I think that will do it.
Of course you're going to need a way to see if the file is already open,
there you can turn to IOTAModuleServices which has a property called
ModuleCount which returns the number of open modules. IOTAModuleServices
also has a Modules property which allows you to iterate through the open
modules. Each module has a FileName property so you can compare that with
whatever your looking to reload. There is also a FindModule method
IOTAModuleServices70, but I'm not sure if the module needs to be open or
not.
HTH,
-Christian
"Manfra" <fgmanfredini (AT) gmail (DOT) com> wrote in message
news:1165244911.353599.230930 (AT) f1g2000cwa (DOT) googlegroups.com...
Hi, i wrote a code generator (a program that modifies source code) as
an expert for delphi. The problem is that every time i run the code
generator, if some of the files modified by the generator are already
opened in IDE , the delphi doenst refresh the buffer with the
modifications, i need to ALT_TAB to other app and then ALT_TAB back to
delphi to have the files refreshed. so i need to write some code to
automatically refresh the files already opened in the IDE using Open
Tools but i could find a way to do it.... would appreciate any help.
Thank You.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|