Using StyledTextCtrl and IEHtmlWindow

I have some questions relating to the wx.stc.StyledTextCtrl control and
the wx.lib.iewin.IEHtmlWindow control.

In the StyledTextCtrl I'm having problems in getting the left margin
wide enough to be able to show 5 digit numbers (line number). On the
left hand side of the control I've configured two margins, one for the
line number and one for the marker. I've looked in the wx-python demo
(copied code), however I have not succeeded so far in increasing the
width of the part presenting the line number. Any hints on what is
wrong?

In the application the user my select a node in a tree control and the
node will have a corresponding line in the StyledTextCtrl. I make the
StyledTextCtrl go to the correct line and ensure that the caret is
visible as shown below:

Ctrl.GotoLine(lineNumber)
Ctrl.EnsureCaretVisible()

Whenever the caret is 'above' the current view of the content, the
content is scrolled so that the line (with the caret) is the first line
above the current view - I would expect it to be visible (inside the
view). Anyone knows if there is a trick with this?

Whenever I use the IEHtmlWindow to present a page having buttons (to
submit content of a form) and edit fields (of a form), there is probably
a need to hook up some event on the control to handle the keyboard
events (ENTER, TAB) and mouse (BUTTON PUSHED). Does anyone have
examples of how this is done?

Thanks for any help.
Nikolai

Nikolai Kirsebom wrote:

I have some questions relating to the wx.stc.StyledTextCtrl control and
the wx.lib.iewin.IEHtmlWindow control.

In the StyledTextCtrl I'm having problems in getting the left margin
wide enough to be able to show 5 digit numbers (line number). On the
left hand side of the control I've configured two margins, one for the
line number and one for the marker. I've looked in the wx-python demo
(copied code), however I have not succeeded so far in increasing the
width of the part presenting the line number. Any hints on what is
wrong?

It should just need to have SetMarginWidth called with a pixel size that is large enough.

In the application the user my select a node in a tree control and the
node will have a corresponding line in the StyledTextCtrl. I make the
StyledTextCtrl go to the correct line and ensure that the caret is
visible as shown below:

Ctrl.GotoLine(lineNumber)
Ctrl.EnsureCaretVisible()

Whenever the caret is 'above' the current view of the content, the
content is scrolled so that the line (with the caret) is the first line
above the current view - I would expect it to be visible (inside the
view). Anyone knows if there is a trick with this?

Are you accounting for the fact that the first line is line zero?

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

In the application the user my select a node in a tree control and

the

node will have a corresponding line in the StyledTextCtrl. I make

the

StyledTextCtrl go to the correct line and ensure that the caret is
visible as shown below:

Ctrl.GotoLine(lineNumber)
Ctrl.EnsureCaretVisible()

Whenever the caret is 'above' the current view of the content, the
content is scrolled so that the line (with the caret) is the first

line

above the current view - I would expect it to be visible (inside the
view). Anyone knows if there is a trick with this?

Are you accounting for the fact that the first line is line zero?

The solution (work around) to the GotoLine/EnsureCaretVisible was;

Ctrl.GotoLine(lineNumber-1)
Ctrl.EnsureCaretVisible()
Ctrl.GotoLine(lineNumber)

So I think there might be a problem with the EnsureCaretVisible when the
effect is to scroll up.

Nikolai