wxpython wx.stc.StyledTextCtrl set readonly for some words in line

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

wxpython wx.stc.StyledTextCtrl set readonly for some words in line

Nagarajan Babu
Hi,

iam using wx.stc.StyledTextCtrl to show xml. user can edit xml content but not tags.

like this:

<tagname>edit here</tagname>

I want to restrict user not to edit the start and end tag(<tagname></tagname>). They are only allowed to edit inside  the tag contents.

Is there anyway, can we make tag ready only using marker or any other methods. It includes keyboard selection(arrows), mouse selection, backspace key and delete key.

thank you.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wxpython wx.stc.StyledTextCtrl set readonly for some words in line

Nathan McCorkle
It will probably involve parsing the file everytime a change is made, find the tags... then use HitTest with mouse/key events and watch the direction (currentposition - lastposition) and not Skip the event if the direction is in the direction toward the tag.

On Wednesday, December 3, 2014 4:08:50 AM UTC-8, Nagarajan Babu wrote:
Hi,

iam using wx.stc.StyledTextCtrl to show xml. user can edit xml content but not tags.

like this:

<tagname>edit here</tagname>

I want to restrict user not to edit the start and end tag(<tagname></tagname>). They are only allowed to edit inside  the tag contents.

Is there anyway, can we make tag ready only using marker or any other methods. It includes keyboard selection(arrows), mouse selection, backspace key and delete key.

thank you.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wxpython wx.stc.StyledTextCtrl set readonly for some words in line

Nagarajan Babu
can we set read only for tags in begining (after load file)

On Wednesday, December 3, 2014 10:44:04 PM UTC+5:30, Nathan McCorkle wrote:
It will probably involve parsing the file everytime a change is made, find the tags... then use HitTest with mouse/key events and watch the direction (currentposition - lastposition) and not Skip the event if the direction is in the direction toward the tag.

On Wednesday, December 3, 2014 4:08:50 AM UTC-8, Nagarajan Babu wrote:
Hi,

iam using wx.stc.StyledTextCtrl to show xml. user can edit xml content but not tags.

like this:

<tagname>edit here</tagname>

I want to restrict user not to edit the start and end tag(<tagname></tagname>). They are only allowed to edit inside  the tag contents.

Is there anyway, can we make tag ready only using marker or any other methods. It includes keyboard selection(arrows), mouse selection, backspace key and delete key.

thank you.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wxpython wx.stc.StyledTextCtrl set readonly for some words in line

nepix32

On Friday, December 5, 2014 7:24:27 AM UTC+1, Nagarajan Babu wrote:
can we set read only for tags in begining (after load file)

I want to restrict user not to edit the start and end tag(<tagname></tagname>). They are only allowed to edit inside  the tag contents.
According to the Scintilla documentation (section "Style"), there is an experimental feature to set the text style of a section of text to non-changeable (see the caveats of its limitations). If this is robust enough for your you would save yourself a lot of interface-twisting work.

I have not tested if this Scintilla feature is old enough to be contained in wxPython.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wxpython wx.stc.StyledTextCtrl set readonly for some words in line

Nagarajan Babu
thank you.

On Friday, December 5, 2014 4:07:16 PM UTC+5:30, nepix32 wrote:

On Friday, December 5, 2014 7:24:27 AM UTC+1, Nagarajan Babu wrote:
can we set read only for tags in begining (after load file)

I want to restrict user not to edit the start and end tag(<tagname></tagname>). They are only allowed to edit inside  the tag contents.
According to the Scintilla documentation (<a href="http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETCHANGEABLE" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.scintilla.org%2FScintillaDoc.html%23SCI_STYLESETCHANGEABLE\46sa\75D\46sntz\0751\46usg\75AFQjCNEWTuk4RYJn0PPIhG4_HNxuQSycXw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.scintilla.org%2FScintillaDoc.html%23SCI_STYLESETCHANGEABLE\46sa\75D\46sntz\0751\46usg\75AFQjCNEWTuk4RYJn0PPIhG4_HNxuQSycXw';return true;">section "Style"), there is an experimental feature to set the text style of a section of text to non-changeable (see the caveats of its limitations). If this is robust enough for your you would save yourself a lot of interface-twisting work.

I have not tested if this Scintilla feature is old enough to be contained in wxPython.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.