Small annoyance in wx.FileDialog

I'm having trouble understanding your description of the problem and
the circumstances. Please create a *small* runnable sample that
demonstrates the problem and post it to the list.

···

On 9/6/07, Stef Mientki <s.mientki@ru.nl> wrote:

Robin Dunn wrote:
> Stef Mientki wrote:
>> hello,
>>
>> I've a small annoyance in wx.FileDialog, (used as opendialog in winXP)
>> in the box where I've to edit the filename,
>> the cursor (I-type) continuously jumps back to 8 position.
>
> There is no wx code involved at that point, it's all Microsoft.
>
Interesting, ...
... I've never seen this behavior before,
and I expect it's a caret problem in STC.

I investigated somewhat further.
I've an application, with about 4 panes
- 1 PythonSTC editor
- 2 TextCtrl editors
Now when I start the program, I see the following weird things:

- if I start the wx.FileDialog, I get the cursor continuously jumping to
the 8 position (about every second)

- if I put my cursor with the mouse in one of the TextCtrl,
the cursor jumps always to the first line, 7-position in the active TextCtrl
(not the 8-position as in the file dialog).

- If I put my cursor in a TextCtrl, put another program on top,
now focus back to the Python program,
I see for a moment that the cursor is ok,
but within a second jumps back to line1, pos7

- As soon as I've placed my cursor once in the PythonSTC,
all above effects are gone.

So I decided to take a look at what commands I sent to the PythonSTC,
and here is the line that causes all problems:
    self.Code_Editor.SetSTCFocus ( True )

Is there another way or better moment (I now do it in form init) to give
the PythonSTC focus ?

The current line indicator in STC is only shown when it has focus.

If you want to show it when the control doesn't have focus, you'll
need to set some sort of styling or a marker or something. I'd have to
dig around in the API to see if it's possible and I don't have time
right now. I belive that SciTe does something like this so theres
probably a mechanism for it.
  

ok I just tried to look at some discussion-lists about Scintilla,
but I can't connect to most of them.
Found something in ASPN archives about SC_MARK_BACKGROUND,
so I'll study that in the near future
(for now I just keep the illegal use of SetSTCFocus, and accept the weird caret in other edit fields ;-).

Indeed tha SC_MARK_BACKGROUND is thé tool to use
   # define the marker
   Code_Editor.MarkerDefine ( 31, stc.STC_MARK_BACKGROUND, "#00FF00", "#00FF00")

   # use the marker to follow the actual code line
   Code_Editor.MarkerDeleteAll ( 31 )
   Code_Editor.MarkerAdd ( line_nr-1, 31 )
   Code_Editor.GotoLine ( line_nr - 1 )

thanks,
Stef Mientki

Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629.
The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.

The current line indicator in STC is only shown when it has focus.

If you want to show it when the control doesn't have focus, you'll
need to set some sort of styling or a marker or something. I'd have to
dig around in the API to see if it's possible and I don't have time
right now. I belive that SciTe does something like this so theres
probably a mechanism for it.

Indeed the SC_MARK_BACKGROUND is thé tool to use
  # define the marker
  Code_Editor.MarkerDefine ( 31, stc.STC_MARK_BACKGROUND, "#00FF00", "#00FF00")

  # use the marker to follow the actual code line
  Code_Editor.MarkerDeleteAll ( 31 )
  Code_Editor.MarkerAdd ( line_nr-1, 31 )
  Code_Editor.GotoLine ( line_nr - 1 )

cheers,
Stef Mientki

Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629.
The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.

The current line indicator in STC is only shown when it has focus.

If you want to show it when the control doesn't have focus, you'll
need to set some sort of styling or a marker or something. I'd have to
dig around in the API to see if it's possible and I don't have time
right now. I belive that SciTe does something like this so theres
probably a mechanism for it.
  

ok I just tried to look at some discussion-lists about Scintilla,
but I can't connect to most of them.
Found something in ASPN archives about SC_MARK_BACKGROUND,
so I'll study that in the near future
(for now I just keep the illegal use of SetSTCFocus, and accept the weird caret in other edit fields ;-).

Indeed tha SC_MARK_BACKGROUND is thé tool to use
  # define the marker
  Code_Editor.MarkerDefine ( 31, stc.STC_MARK_BACKGROUND, "#00FF00", "#00FF00")

  # use the marker to follow the actual code line
  Code_Editor.MarkerDeleteAll ( 31 )
  Code_Editor.MarkerAdd ( line_nr-1, 31 )
  Code_Editor.GotoLine ( line_nr - 1 )

works perfect, nor more caret problems.

thanks,
Stef Mientki

Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629.
The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.