We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

access to lexems in a collapsed region

Thread ID:

Created:

Updated:

Platform:

Replies:

54968 Jan 20,2007 01:55 PM Mar 7,2007 11:15 AM Windows Forms 4
loading
Tags: EditControl
Administrator [Syncfusion]
Asked On January 20, 2007 01:55 PM

When a certain key is pressed in the editor, I use the EditControl's GetLine method to scan all lines above the current line picking out particular lexems of interest for a context choice prompt.

This technique works well except when there is a collapsed region somewhere above the current line. The line with the collapsed region has a special lexem that appears to represent the collapsed region. The lexem's Collapser property is non-null but doesn't appear to have any way to get to the lexems inside of the region.

Is there a way to gain access to the lexems inside of a collapsed region without first expanding it?

thanks,
Travis

Administrator [Syncfusion]
Replied On January 22, 2007 07:19 PM

Hi Travis,

It is possible to access the lexems inside a collapsed region.I have attached a sample that illustrates this. Let me know if this meets your requirements.

Thanks for your patience.

Regards,
Ebenezer.P

sample

Administrator [Syncfusion]
Replied On January 28, 2007 10:33 AM

Thanks Ebenezer. To sum up your sample, the way to get access to lexems in collapsed regions is to create a secondary EditControl set with the .Text of the original control. This secondary control has all regions expanded by default and therefore has access to all lexems. The downside is the potential performance hit in parsing the complete text a second time just to get access to a few collapsed regions. Kind of a hack but works for me for now.

-travis

Administrator [Syncfusion]
Replied On March 6, 2007 07:30 PM

Hi Ebenezer,

I'm using the hidden edit control technique you described previously. It has largely worked for me but now I notice that with a certain data file it crashes on the second use of the technique for some reason. The crash is on this line:

expandedEditor.Text = editor.Text;

Attached is the stack trace.

Any ideas?



stack-trace.zip

Administrator [Syncfusion]
Replied On March 7, 2007 11:15 AM

Hi Travis,

I have tested for this issue using version 4.4.0.51 and was not able to see the problem. This is how I went about testing this issue :

1.Run the attached sample.

2.Click Lexems several times.

3.Exception is not thrown.

Please let me know if I am missing something. Also, Could you please let me know the version of Essential Studio being used by you.

Thanks for your patience.

Regards,
Ebenezer.P

sample

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;