🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.opentoolsapi
6 messages
6 total messages Started by Atmapuri Fri, 06 Jun 2008 14:03
Finding the closest word!
#58
Author: Atmapuri
Date: Fri, 06 Jun 2008 14:03
13 lines
1223 bytes
Hi!

In which way could I obtain the word closest to the
cursor in the currently open file in the editor?

I guess I would at least need cursor position
and access to the text buffer of the currently edited
file. 

I can see in Castalia that this is possible. 

Thanks!
Atmapuri
Re: Finding the closest word!
#59
Author: Gerrit Beuze
Date: Fri, 06 Jun 2008 14:39
13 lines
1319 bytes
> In which way could I obtain the word closest to the
> cursor in the currently open file in the editor?

There's nothing build in the ToolsAPI that does this.

Use IOTAEditView to get the cursor position,
and the corresponding charpos
Use TEditorReader to read the code at that position
(probably the entire line)
Write a procedure that does what you need.

Gerrit Beuze
ModelMaker Tools 
Re: Finding the closest word!
#60
Author: Lex Y. Li
Date: Sat, 07 Jun 2008 03:28
7 lines
1261 bytes
Atmapuri wrote:
> I can see in Castalia that this is possible.

According to CodeRush's author Mark and Castalia's author Jacob, you 
cannot do many fancy things with OTA in fact. Both CodeRush and Castalia 
use a lot of low level hacking tricks to inject into Delphi IDE to 
realize so many wonderful features.
Re: Finding the closest word!
#61
Author: Gerrit Beuze
Date: Sat, 07 Jun 2008 11:01
12 lines
1515 bytes
> According to CodeRush's author Mark and Castalia's author Jacob, you cannot do many fancy things with OTA in fact. Both CodeRush 
> and Castalia use a lot of low level hacking tricks to inject into Delphi IDE to realize so many wonderful features.

You can do a lot without none or very little hacking...
ModelMaker Code Explorer adds a lot of features without any low level
hacks.

Gerrit Beuze
ModelMaker Tools

Boost your productivity in the Delphi IDE with ModelMaker Code Explorer:
http://www.modelmakertools.com/code-explorer/index.html
Re: Finding the closest word!
#63
Author: Erik Berry
Date: Mon, 09 Jun 2008 00:04
10 lines
1305 bytes
Atmapuri wrote:
> In which way could I obtain the word closest to the
> cursor in the currently open file in the editor?

You could try IOTAEditPosition.RipText with the flags like 
rfIncludeAlphaChars.  There is also a search interface to find whole words 
(see IOTASearchOptions.WordBoundary).  You may need to do some caret 
positioning before using either method.

Erik
Re: Finding the closest word!
#65
Author: Atmapuri
Date: Mon, 09 Jun 2008 10:00
13 lines
1483 bytes
Hi!

> You could try IOTAEditPosition.RipText with the flags like 
> rfIncludeAlphaChars.  There is also a search interface to find whole words 
> (see IOTASearchOptions.WordBoundary).  You may need to do some caret 
> positioning before using either method.

I also posted a QC in your corner :)

http://qc.codegear.com/wc/qcmain.aspx?d=63061

Thanks!
Atmapuri
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads