wx.ComboBox and some other things

Hello Mailing-list members,

I have uploaded the test file on:
http://berg.heim.at/anden/421194/dialog_stuff.py

my questions (wxPython 2.5, windows Xp):

my questions (wxPython 2.5, windows Xp):

1) is there a workaround for the problem, that all three comboboxes are
      selected at the beginning?
   (I think, it is caused by the "Append" Command)
      
2) if the listbox has not the focus, should'nt the selection be grayed out?
   (as in Listctrl?) (Select an Item from the search for; the press tab key until
    the listbox is reached => select one entry => press tab key again => the
    selected item isn't grayed out).
  
3) I have problems with the comobox "search for".
    If some of the "history" is selected, then OnFillListBox2 is called with
    the wx.EVT_COMBOBOX event.
   If I type some text, and then change the focus, it should also trigger
     the same action (only for test purpose, i choosed another method).
    wx.EVT_COMBOBOX doesn't work here, so I tried
     EVT_KILL_FOCUS. But if i leave the combobox with the tab key,
     the behavior is different, as if i change the focus with the mouse
     (by clicking on another control).
   One see it, if you press shift-tab or tab, and "Search for" is reached, then "Set", "Kill" and "Set"
    appears. if you go out of search for, only "Kill" appears.

4) How can I accomplish to achieve following with the return/enter key:
   If the focus is in the listbox, it should call OnSelect;
   in all other instances, it should perform OnSearch, when the Return key is hitted

many thanks in advance for your answers!

···

--
Franz Steinhäusler

Franz Steinhäusler wrote:

Hello Mailing-list members,

I have uploaded the test file on:
http://berg.heim.at/anden/421194/dialog_stuff.py

my questions (wxPython 2.5, windows Xp):

my questions (wxPython 2.5, windows Xp):

1) is there a workaround for the problem, that all three comboboxes are selected at the beginning?
   (I think, it is caused by the "Append" Command)

         wx.CallAfter(self.txtPattern.SetMark, 0, 0)
         wx.CallAfter(self.txtDirectory.SetMark, 0, 0)

      2) if the listbox has not the focus, should'nt the selection be grayed out?
   (as in Listctrl?)

That's up to the platform and the native widget.

    If some of the "history" is selected, then OnFillListBox2 is called with
    the wx.EVT_COMBOBOX event.
   If I type some text, and then change the focus, it should also trigger
     the same action (only for test purpose, i choosed another method). wx.EVT_COMBOBOX doesn't work here, so I tried EVT_KILL_FOCUS. But if i leave the combobox with the tab key,
     the behavior is different, as if i change the focus with the mouse
     (by clicking on another control).
   One see it, if you press shift-tab or tab, and "Search for" is reached, then "Set", "Kill" and "Set"
    appears. if you go out of search for, only "Kill" appears.

Please enter a bug report about this with a category of "wxMSW specific". In the meantime a common work around for bugs like this is to simply set a flag in the event handler. Then add a handler for EVT_IDLE that checks the flag and does the desired action.

    4) How can I accomplish to achieve following with the return/enter key:
   If the focus is in the listbox, it should call OnSelect;
   in all other instances, it should perform OnSearch, when the Return key is hitted

Normally pressing Enter will cause the default button to be activated, so one way to do this would be to change which button is the default when the listbox has the focus.

···

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

Franz Steinhäusler wrote:

Hello Mailing-list members,

Hello Robin,

many thanks for your reply.

I tried to fixed the things and have uploaded the newer test file on:
http://berg.heim.at/anden/421194/dialog_stuff2.py

1) is there a workaround for the problem, that all three comboboxes are
      selected at the beginning?
   (I think, it is caused by the "Append" Command)

        wx.CallAfter(self.txtPattern.SetMark, 0, 0)
        wx.CallAfter(self.txtDirectory.SetMark, 0, 0)

That works for the initially state now.
BUT: if you resize or maximize the window, again, all three comboboxes are selected :frowning:
Should I put in the onsize event handler about: look which has the focus, and all other shold be marked with 0,0
and again "call after" that?
or is there an easier solution?

2) if the listbox has not the focus, should'nt the selection be grayed out?
   (as in Listctrl?)

That's up to the platform and the native widget.

(Probably no workaround ?)

3) I have problems with the comobox "search for".
    If some of the "history" is selected, then OnFillListBox2 is called with
    the wx.EVT_COMBOBOX event.
   If I type some text, and then change the focus, it should also trigger
     the same action (only for test purpose, i choosed another method).
    wx.EVT_COMBOBOX doesn't work here, so I tried
     EVT_KILL_FOCUS. But if i leave the combobox with the tab key,
     the behavior is different, as if i change the focus with the mouse
     (by clicking on another control).
   One see it, if you press shift-tab or tab, and "Search for" is reached, then "Set", "Kill" and "Set"
    appears. if you go out of search for, only "Kill" appears.

Please enter a bug report about this with a category of "wxMSW
specific". In the meantime a common work around for bugs like this is
to simply set a flag in the event handler. Then add a handler for
EVT_IDLE that checks the flag and does the desired action.

Yes, I will do.
I put this directly in the MyComobox; is that right?

4) How can I accomplish to achieve following with the return/enter key:
   If the focus is in the listbox, it should call OnSelect;
   in all other instances, it should perform OnSearch, when the Return key is hitted

Normally pressing Enter will cause the default button to be activated,
so one way to do this would be to change which button is the default
when the listbox has the focus.

Also ok now :slight_smile:

best regards,

···

On Fri, 03 Sep 2004 10:23:47 -0700, Robin Dunn <robin@alldunn.com> wrote:
--
Franz Steinhäusler

Franz Steinhäusler wrote:

1) is there a workaround for the problem, that all three comboboxes are selected at the beginning?
  (I think, it is caused by the "Append" Command)

       wx.CallAfter(self.txtPattern.SetMark, 0, 0)
       wx.CallAfter(self.txtDirectory.SetMark, 0, 0)

That works for the initially state now.
BUT: if you resize or maximize the window, again, all three comboboxes are selected :frowning:
Should I put in the onsize event handler about: look which has the focus, and all other shold be marked with 0,0
and again "call after" that?
or is there an easier solution?

This is sounding more like a bug now. Please enter a bug report about it.

     2) if the listbox has not the focus, should'nt the selection be grayed out?
  (as in Listctrl?)

That's up to the platform and the native widget.

(Probably no workaround ?)

Not that I know of.

   If some of the "history" is selected, then OnFillListBox2 is called with
   the wx.EVT_COMBOBOX event.
  If I type some text, and then change the focus, it should also trigger
    the same action (only for test purpose, i choosed another method). wx.EVT_COMBOBOX doesn't work here, so I tried EVT_KILL_FOCUS. But if i leave the combobox with the tab key,
    the behavior is different, as if i change the focus with the mouse
    (by clicking on another control).
  One see it, if you press shift-tab or tab, and "Search for" is reached, then "Set", "Kill" and "Set"
   appears. if you go out of search for, only "Kill" appears.

Please enter a bug report about this with a category of "wxMSW specific". In the meantime a common work around for bugs like this is to simply set a flag in the event handler. Then add a handler for EVT_IDLE that checks the flag and does the desired action.

Yes, I will do.
I put this directly in the MyComobox; is that right?

Yes

···

On Fri, 03 Sep 2004 10:23:47 -0700, Robin Dunn <robin@alldunn.com> wrote:

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