Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Help trying to style string internally.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
RaptorX  
View profile  
 More options Oct 30 2012, 7:28 pm
From: RaptorX <grapt...@gmail.com>
Date: Tue, 30 Oct 2012 16:28:58 -0700 (PDT)
Local: Tues, Oct 30 2012 7:28 pm
Subject: [Lexer] Help trying to style string internally.

Hi.

I have been advancing with my lexer and it is going real well. Now there is
something I would like to do but I am not sure how to approach it.
I want my Lexer to style any string contained in two asterisks characters
and:

1) remove the asterisks
2) convert string to bold

I would like to be able to do that internally, that means not setting up a
Style state where the user would do that manually.

Can you point me in to the functions I would be using for this?
Up to now I have been using a lot of sc.Match, sc.SetState, sc.ChangeState
and others but I am sure this is not the correct approach for this problem.

Thanks in advance for your help!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philippe Lhoste  
View profile  
 More options Nov 1 2012, 7:25 am
From: Philippe Lhoste <Phi...@GMX.net>
Date: Thu, 01 Nov 2012 12:25:27 +0100
Local: Thurs, Nov 1 2012 7:25 am
Subject: Re: [Lexer] Help trying to style string internally.
On 31/10/2012 00:28, RaptorX wrote:

> I have been advancing with my lexer and it is going real well. Now there
> is something I would like to do but I am not sure how to approach it.
> I want my Lexer to style any string contained in
> two asterisks characters and:

> 1) remove the asterisks
> 2) convert string to bold

> I would like to be able to do that internally, that means not setting up
> a Style state where the user would do that manually.

> Can you point me in to the functions I would be using for this?
> Up to now I have been using a lot of sc.Match, sc.SetState,
> sc.ChangeState and others but I am sure this is not the correct approach
> for this problem.

I answered this yesterday, but I don't see my answer here...

Anyway, my answer was: no, a lexer cannot change the text in the buffer,
or at least it should not do it.
And it sets style ids, but it doesn't choose how a style is rendered.
That's the task of Scintilla, following the settings set by its client.

It is about a source code editor, not a rich text editor: if, for
example, you do a markup lexer, you can be tempted to hide the
characters of the markup and show the appropriate rendering, but then it
would be hard to manually remove or change the markup. It would be the
task of the client to offer commands to do so... But, again, that's the
wrong component to use for this task.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  http://PhiLho.deviantART.com
--  --  --  --  --  --  --  --  --  --  --  --  --  --


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philippe Lhoste  
View profile  
 More options Oct 31 2012, 4:38 am
From: Philippe Lhoste <Phi...@GMX.net>
Date: Wed, 31 Oct 2012 09:38:30 +0100
Local: Wed, Oct 31 2012 4:38 am
Subject: Re: [Lexer] Help trying to style string internally.
On 31/10/2012 00:28, RaptorX wrote:

> I have been advancing with my lexer and it is going real well. Now there is something I
> would like to do but I am not sure how to approach it.
> I want my Lexer to style any string contained in two asterisks characters and:

> 1) remove the asterisks
> 2) convert string to bold

> I would like to be able to do that internally, that means not setting up a Style state
> where the user would do that manually.

> Can you point me in to the functions I would be using for this?
> Up to now I have been using a lot of sc.Match, sc.SetState, sc.ChangeState and others but
> I am sure this is not the correct approach for this problem.

1) A lexer cannot (or should not) change the content of the display nor hide or add
characters. Beside, it isn't convenient: if it is, for example, a markup lexer, I can
understand you want to show the effect and not the markup, but then the user depends on
the client around Scintilla to add or remove these marks.
In this case, you are not looking for Scintilla, but for some rich text edit component...

2) A lexer doesn't change the attributes (bold, italic, font choice, size...) of the text,
it only marks part of the text with a number (the lexer style id) and another part maps
this number to a concrete style. It is the responsibility of the client to ensure a given
id is always displayed as bold.

I am not trying to be dogmatic, just pointing out the way all the lexers (that I have
looked at) work... If you need to change the way Scintilla works, well, you have to patch
it. :-) (But it won't work if you aim to ship a lexer working with vanilla Scintilla.)

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[Lexer] Help trying to style string internally." by KHMan
KHMan  
View profile  
 More options Nov 1 2012, 9:47 pm
From: KHMan <keinh...@gmail.com>
Date: Fri, 02 Nov 2012 09:46:49 +0800
Local: Thurs, Nov 1 2012 9:46 pm
Subject: Re: [scintilla] Re: [Lexer] Help trying to style string internally.
On 11/1/2012 7:25 PM, Philippe Lhoste wrote:

> On 31/10/2012 00:28, RaptorX wrote:
>>[snip snip snip]
>> Can you point me in to the functions I would be using for this?
>> Up to now I have been using a lot of sc.Match, sc.SetState,
>> sc.ChangeState and others but I am sure this is not the correct
>> approach
>> for this problem.

> I answered this yesterday, but I don't see my answer here...

A slight delay with moderation, but really IMHO it was Google
messing with Google Groups.

Your membership entry is (and was) of course fully enabled for
posting, but somehow GGroups flagged that message for moderation
yesterday.

I hope this does not become a trend with GGroups, I have little
enough faith in User Interface 'innovations' these days... :-)

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil Hodgson  
View profile  
 More options Nov 6 2012, 2:49 pm
From: Neil Hodgson <nyamaton...@me.com>
Date: Tue, 06 Nov 2012 20:49:54 +0100
Local: Tues, Nov 6 2012 2:49 pm
Subject: Re: [scintilla] Re: [Lexer] Help trying to style string internally.
KHMan:

> A slight delay with moderation, but really IMHO it was Google messing with Google Groups.

   The new groups interface has just worsened an already poor job. I tried to moderate the "spam report" using an iPad from a hotel with poor Internet. Groups defaults to a dumbed down interface when iOS is detected then loses the context when you say "pretend this is a real computer".

    Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Brush  
View profile  
 More options Nov 6 2012, 8:37 pm
From: Matthew Brush <matthewbr...@gmail.com>
Date: Tue, 06 Nov 2012 17:38:12 -0800
Local: Tues, Nov 6 2012 8:38 pm
Subject: Re: [scintilla] Re: [Lexer] Help trying to style string internally.
On 12-11-06 11:49 AM, Neil Hodgson wrote:

> KHMan:

>> A slight delay with moderation, but really IMHO it was Google messing with Google Groups.
>     The new groups interface has just worsened an already poor job. I tried to moderate the "spam report" using an iPad from a hotel with poor Internet. Groups defaults to a dumbed down interface when iOS is detected then loses the context when you say "pretend this is a real computer".

Grrrr. I stopped using my tablet pretty much all together for the web
because of websites dumbing down their content, layouts and usability as
if it's a 2" phone device. This is the modern day equivalent of Animated
GIFs or <blink> HTML tags :)

P.S. Sorry veering off of the group's topic, this just drives me
absolutely bonkers :)

Cheers,
Matthew Brush


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »