BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Refresh Files already opened in the IDE

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OpenToolsAPI
View previous topic :: View next topic  
Author Message
Manfra
Guest





PostPosted: Mon Dec 04, 2006 9:08 pm    Post subject: Refresh Files already opened in the IDE Reply with 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
Christian Wilkerson
Guest





PostPosted: Tue Dec 05, 2006 1:05 am    Post subject: Re: Refresh Files already opened in the IDE Reply with 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...
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





PostPosted: Tue Dec 05, 2006 11:33 pm    Post subject: Re: Refresh Files already opened in the IDE Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OpenToolsAPI All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.