ComboBox and CheckBox have no IsModified()

Werner,

I had to "write my own" IsModified() routine for wxMaskedTextCtrl,
(actually in response to your feedback!) because .SetValue()
is used internally to set the value on each keystroke, and that
function doesn't affect the "IsModified"-ness of the control.

I thought about implementing the same thing for wxMaskedComboBox, but
didn't because it wasn't a function that base control supported.
However, in principle, you could derive your own combobox control
subclass that just intercepts each EVT_CHAR and EVT_COMBOBOX prior to
calling event.Skip(), and keep track internally in a similar fashion.

As for wxCheckbox, I would think that if you use a derived
class and an internal state variable initialized on construction,
you could easily tell if the value had changed; the semantic
issue is: if it changes, and changes back, has it been "modified?"
(I believe this *is* true of wxTextCtrl, ie. any keystroke
causes IsModified to be set, even if you restore the original
value.)

I think it couldn't hurt to file a feature request for these, though,
as they seem like obvious oversights.

Regards,
/Will Sadkin
Parlance Corporation
www.nameconnector.com

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Wednesday, May 21, 2003 1:02 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] ComboBox and CheckBox have no
IsModified()

Werner F. Bruhin wrote:
> Just realized that both of these controls do not have IsModified(),
> which is available for TextCtrl.
>
> Are there any plans of having this in the near future?
>

Not that I know of.

> If not, how does one go about to code this myself. Any
hints would be
> much appreciated.
>

It would have to be added to the C++ class for the various
platforms and
then a patch submitted to the patch manager at SF.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

Will,

Thanks for the hints, and just ignore my last message.

I assume this should be a feature request for wxWindows.

See you
Werner

Will Sadkin wrote:

···

Werner,

I had to "write my own" IsModified() routine for wxMaskedTextCtrl,
(actually in response to your feedback!) because .SetValue() is used internally to set the value on each keystroke, and that
function doesn't affect the "IsModified"-ness of the control.

I thought about implementing the same thing for wxMaskedComboBox, but
didn't because it wasn't a function that base control supported.
However, in principle, you could derive your own combobox control
subclass that just intercepts each EVT_CHAR and EVT_COMBOBOX prior to
calling event.Skip(), and keep track internally in a similar fashion.

As for wxCheckbox, I would think that if you use a derived
class and an internal state variable initialized on construction,
you could easily tell if the value had changed; the semantic
issue is: if it changes, and changes back, has it been "modified?"
(I believe this *is* true of wxTextCtrl, ie. any keystroke causes IsModified to be set, even if you restore the original value.)

I think it couldn't hurt to file a feature request for these, though,
as they seem like obvious oversights.

Regards,
/Will Sadkin
Parlance Corporation
www.nameconnector.com

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Wednesday, May 21, 2003 1:02 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] ComboBox and CheckBox have no IsModified()

Werner F. Bruhin wrote:
   

Just realized that both of these controls do not have IsModified(), which is available for TextCtrl.

Are there any plans of having this in the near future?

Not that I know of.

If not, how does one go about to code this myself. Any
     

hints would be
   

much appreciated.

It would have to be added to the C++ class for the various platforms and then a patch submitted to the patch manager at SF.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org