-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from mcorino/develop
major validator improvements and extensions
- Loading branch information
Showing
25 changed files
with
2,737 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) 2023 M.J.N. Corino, The Netherlands | ||
// | ||
// This software is released under the MIT license. | ||
|
||
/* | ||
* WxRuby3 wxRubyValidator class | ||
*/ | ||
|
||
#ifndef _WXRUBY_VALIDATOR_H | ||
#define _WXRUBY_VALIDATOR_H | ||
|
||
#include "wxruby-ValidatorBinding.h" | ||
|
||
class WXRUBY_EXPORT wxRubyValidator : public wxValidator, public wxRubyValidatorBinding | ||
{ | ||
public: | ||
wxRubyValidator (); | ||
wxRubyValidator (const wxRubyValidator&); | ||
virtual ~wxRubyValidator (); | ||
|
||
virtual wxObject* Clone() const override; | ||
|
||
virtual void SetWindow(wxWindow *win) override; | ||
|
||
virtual bool TransferFromWindow () override; | ||
virtual bool TransferToWindow () override; | ||
|
||
protected: | ||
static WxRuby_ID do_transfer_from_window_id; | ||
static WxRuby_ID do_transfer_to_window_id; | ||
static WxRuby_ID clone_id; | ||
|
||
virtual VALUE DoTransferFromWindow(); | ||
virtual bool DoTransferToWindow(VALUE data); | ||
|
||
virtual VALUE get_self() override; | ||
}; | ||
|
||
#endif /* _WXRUBY_VALIDATOR_HASH_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) 2023 M.J.N. Corino, The Netherlands | ||
// | ||
// This software is released under the MIT license. | ||
|
||
/* | ||
* WxRuby3 wxRubyValidatorBinding class | ||
*/ | ||
|
||
#ifndef _WXRUBY_VALIDATOR_BINDING_H | ||
#define _WXRUBY_VALIDATOR_BINDING_H | ||
|
||
class WXRUBY_EXPORT wxRubyValidatorBinding | ||
{ | ||
public: | ||
wxRubyValidatorBinding () | ||
: self_(Qnil) | ||
, on_transfer_from_win_proc_(Qnil) | ||
, on_transfer_to_win_proc_(Qnil) | ||
{} | ||
|
||
void SetOnTransferFromWindow(VALUE proc) | ||
{ | ||
this->on_transfer_from_win_proc_ = proc; | ||
} | ||
void SetOnTransferToWindow(VALUE proc) | ||
{ | ||
this->on_transfer_to_win_proc_ = proc; | ||
} | ||
|
||
VALUE DoOnTransferToWindow(); | ||
bool DoOnTransferFromWindow(VALUE data); | ||
|
||
bool OnTransferFromWindow(VALUE data); | ||
VALUE OnTransferToWindow(); | ||
|
||
void GC_Mark() | ||
{ | ||
rb_gc_mark(this->on_transfer_from_win_proc_); | ||
rb_gc_mark(this->on_transfer_to_win_proc_); | ||
} | ||
|
||
protected: | ||
static WxRuby_ID do_on_transfer_from_window_id; | ||
static WxRuby_ID do_on_transfer_to_window_id; | ||
static WxRuby_ID call_id; | ||
|
||
wxRubyValidatorBinding (const wxRubyValidatorBinding& vb) | ||
: self_(Qnil) | ||
, on_transfer_from_win_proc_(vb.on_transfer_from_win_proc_) | ||
, on_transfer_to_win_proc_(vb.on_transfer_to_win_proc_) | ||
{} | ||
|
||
void CopyBindings(const wxRubyValidatorBinding* val_bind); | ||
|
||
virtual VALUE get_self() = 0; | ||
|
||
VALUE self_; | ||
|
||
private: | ||
VALUE on_transfer_from_win_proc_; | ||
VALUE on_transfer_to_win_proc_; | ||
}; | ||
|
||
#endif /* #define _WXRUBY_VALIDATOR_BINDING_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.