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 

syntax highlighting...not again!

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Rory Walsh
Guest





PostPosted: Thu Jun 23, 2005 1:05 pm    Post subject: syntax highlighting...not again! Reply with quote



Hi everyone, I am sure I have your hearts broken with all my questions
about syntax highlighting on this list, but once again I have a
question. A while back someone pointed me towards
http://home.att.net/~robertdunn/Yacs.html which answer a lot of my
questions. So much so that I know have a nice little code editor,
however there is one more thing I would like to add, I can't seem to get
comments to work. In the routines I use for the syntax highlighting I
compare the current word with an array of keywords, once it matches I
perform the syntax highlighting. The problem is that I can't do a
comparison for comments like I do with the keywords. Another thing is
that with the keyword highlighting the keyword is highlighted once the
word has been entered in full, with comments though the highlighting
must continue all the way until the end of the line. Here is the routine
that I am working on, as some of you will see straight away it does not
work as I want. But I believe that bones of it are there, I'm just not
using them right?
Cheers,
Rory

void __fastcall TForm1::RichEdit1Change(TObject *Sender)
{
CHARRANGE text;
RichEdit1->Perform(EM_EXGETSEL, 0, (LPARAM)&text);
//get currentline
int currentline = RichEdit1->Perform(EM_LINEFROMCHAR,
Original.cpMin, 0);

//Get the position of the '//' for comments?
text.cpMin = RichEdit1->Lines->Strings[currentline].AnsiPos("//");
RichEdit1->SelStart =
RichEdit1->Lines->Strings[currentline].AnsiPos("//");

//Get the lenght of the line for the comment?
text.cpMax = RichEdit1->Lines->Strings[currentline].Length();
RichEdit1->SelLength = RichEdit1->Lines->Strings[currentline].Length();

RichEdit1->Perform(EM_EXSETSEL, 0, (LPARAM)&LineSelection);
CHARFORMAT FormatKey;
memset(&FormatKey, 0, sizeof(FormatKey));
FormatKey.cbSize = sizeof(FormatKey);
FormatKey.crTextColor = clBlue;
RichEdit1->Perform(EM_SETCHARFORMAT, SCF_SELECTION,
(LPARAM)&FormatKey);
}
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Jun 23, 2005 5:13 pm    Post subject: Re: syntax highlighting...not again! Reply with quote




"Rory Walsh" <rorywalsh (AT) ear (DOT) ie> wrote


Quote:
A while back someone pointed me towards
http://home.att.net/~robertdunn/Yacs.html

That article is for doing syntax highlighting inside a RichEdit - a control
that was not really designed for syntx highlighting in the first place. For
maximum performance and highlighting flexibility, you really should use a
real syntax highlighting control instead, such as SynEdit
([url]http://synedit.sourceforge.net)[/url], or any number of other available controls.


Gambit



Back to top
Rory Walsh
Guest





PostPosted: Thu Jun 23, 2005 9:32 pm    Post subject: Re: syntax highlighting...not again! Reply with quote



Cheers for the tips, I tried this before but it seems that this, as with
a lot of the other packages around will not build with a 'personal'
edition of BC++ Builder. I'm afraid that purchasing the Professional
version is not an option. It would be great, seen as it's free that I
could build it with a less expensive IDE. Perhaps I'm wrong but each
time I try this it looks for files I don't have? Has anyone out there
had luck building this with the personal edition of BC++? The file it's
looking for is 'sqltimest.dcu'. I tried downloaded the demo of the
professional version and use the library files from there but this
wasn't a great solution. Any help is much appreciated. Thanks again,
Rory.

Remy Lebeau (TeamB) wrote:
Quote:
"Rory Walsh" <rorywalsh (AT) ear (DOT) ie> wrote in message
news:42bab3c4 (AT) newsgroups (DOT) borland.com...


A while back someone pointed me towards
http://home.att.net/~robertdunn/Yacs.html


That article is for doing syntax highlighting inside a RichEdit - a control
that was not really designed for syntx highlighting in the first place. For
maximum performance and highlighting flexibility, you really should use a
real syntax highlighting control instead, such as SynEdit
([url]http://synedit.sourceforge.net)[/url], or any number of other available controls.


Gambit



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Jun 23, 2005 11:06 pm    Post subject: Re: syntax highlighting...not again! Reply with quote


"Rory Walsh" <rorywalsh (AT) ear (DOT) ie> wrote


Quote:
The file it's looking for is 'sqltimest.dcu'.

I highly doubt that. There is no reference to that unit anywhere in
SynEdit, and I use SynEdit in my Pro and Enterprise editions of BCB just
fine. Neither of them has files for that unit.


Gambit



Back to top
Rory Walsh
Guest





PostPosted: Fri Jun 24, 2005 9:36 am    Post subject: Re: syntax highlighting...not again! Reply with quote

I just downloaded it again and attempted a clean build. It immediately
asks for these units which are not distributed with the personal
edition:(correct me if I'm wrong...)

dbrtl.bpi
vcldb.bpi

If I try to build without these files I get the error about the
sqltimest.dcu file not being found. If anyone has any ideas please let
me know.

regards,
Rory.

Remy Lebeau (TeamB) wrote:
Quote:
I highly doubt that. There is no reference to that unit anywhere in
SynEdit, and I use SynEdit in my Pro and Enterprise editions of BCB just
fine. Neither of them has files for that unit.


Gambit



Back to top
Jonathan Benedicto
Guest





PostPosted: Fri Jun 24, 2005 3:01 pm    Post subject: Re: syntax highlighting...not again! Reply with quote

"Rory Walsh" <rorywalsh (AT) ear (DOT) ie> wrote

Quote:
I just downloaded it again and attempted a clean build. It
immediately asks for these units which are not distributed with the
personal edition:(correct me if I'm wrong...)

dbrtl.bpi
vcldb.bpi

If I try to build without these files I get the error about the
sqltimest.dcu file not being found. If anyone has any ideas please
let me know.

SynEdit has a DbSynEdit, and it seems that the Personal edition of BCB
does not include database support. So, I would suggest that you remove
the reference to vcldb.bpi from the package. Then, open the
SynEdit.inc file, and put this just below the {$DEFINE
SYNEDIT_INCLUDE} :

{$SYN_DELPHI_PE}

Now save the file, and compile the package.

HTH

Jonathan



Back to top
Jonathan Benedicto
Guest





PostPosted: Fri Jun 24, 2005 4:15 pm    Post subject: Re: syntax highlighting...not again! Reply with quote

"Jonathan Benedicto" <incorrect (AT) no (DOT) server> wrote

Quote:
{$SYN_DELPHI_PE}

Sorry, that is an error. Rather:

{$DEFINE SYN_DELPHI_PE}

Jonathan



Back to top
Michel Leunen
Guest





PostPosted: Fri Jun 24, 2005 6:32 pm    Post subject: Re: syntax highlighting...not again! Reply with quote

Rory Walsh wrote:
Quote:
Cheers for the tips, I tried this before but it seems that this, as with
a lot of the other packages around will not build with a 'personal'
edition of BC++ Builder.

I don't know for synedit but personnally I use Scintilla
([url]www.scintilla.org)[/url]. It's not a VCL component but it works without any
problem with BCB.

Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------

Back to top
Rory Walsh
Guest





PostPosted: Sat Jun 25, 2005 9:41 am    Post subject: Re: syntax highlighting...not again! Reply with quote

Cheers I took your advice. I had to remove a lot of references to a lot
of libraries and now it compiles and seems to run fine. Fingers crossed,
thanks again,
Rory.

Jonathan Benedicto wrote:
Quote:
"Jonathan Benedicto" <incorrect (AT) no (DOT) server> wrote in message
news:42bc2036 (AT) newsgroups (DOT) borland.com...

{$SYN_DELPHI_PE}


Sorry, that is an error. Rather:

{$DEFINE SYN_DELPHI_PE}

Jonathan



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) 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.