wxDialogValidateEvent as an alternative to Validate() (PR #26026)

7 views
Skip to first unread message

RobertRoeb

unread,
Dec 10, 2025, 4:41:30 PM (2 days ago) Dec 10
to wx-...@googlegroups.com, Subscribed
  • Replaces identical PR that got mixed with other commits
  • adds documentation
  • This adds the above mentioend event that is sent after pressing OK or APPLY to validate the dialog data and or transfer its data
  • Derived from wxNotifyEvent to allow veto
  • It is the sister event of wxInitDialog that can be used to transfer data to the dialog
  • This event is helpful if deriving from wxDialog and overriding wxWindow::Validate() is not (easily) possible and it happens to be useful for language bindings

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26026

Commit Summary

  • e550721 wxDialogValidateEvent as an alternative to Validate()

File Changes

(5 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26026@github.com>

RobertRoeb

unread,
Dec 10, 2025, 4:42:23 PM (2 days ago) Dec 10
to wx-...@googlegroups.com, Subscribed
RobertRoeb left a comment (wxWidgets/wxWidgets#26026)

Discussion from the other PR was:

Either way, as I wrote, we have the validators and I would really like to know if they actually are used.

Yes, extensively.

There is also wxInitDialogEvent - not sure when you would need that instead of just adding data during dialog creation,

I don't know about this one either.

I propose an event that would get sent across native and generic dialogs when pressing OK and or some other affirmative > button. And events are easier for language bindings than overriding virtual functions across languages. wxWidgets does
almost everything by events. It should do this as well, I think.

Language bindings are a good argument, but in C++ overriding virtual functions is much more convenient. E.g. it allows to call the base class member first, which may be important, while with the events you can only process the event in the derived class and skip it to let the base class have it later.

Anyhow, my fear is that by adding events to the existing mix of virtual functions and validators we risk making things even more confusing as there will be I don't know how many different ways of handling this in a derived class (e.g. "process the event, then skip it to let the base class function use validators for the inherited controls"). Other than language bindings I really don't see a good reason to complicate things further here. I wonder how does wxPython and co handle this now, i.e. do they provide some way of overriding TransferData{To,From}Window() or a replacement mechanism?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26026/c3639080312@github.com>

Reply all
Reply to author
Forward
0 new messages