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

Hi,
iam using wx.stc.StyledTextCtrl to show xml. user can edit xml content but not tags.
like this:
edit here
I want to restrict user not to edit the start and end tag(). 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.

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:
edit here
I want to restrict user not to edit the start and end tag(). 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.

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:
edit here
I want to restrict user not to edit the start and end tag(). 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.

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.

···

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(). They are only allowed to edit inside the tag contents.

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(). 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.