No, you have to handle this by yourself by Bind()ing wxEVT_TEXT from the Y control and copying the value from the Y to X control in the handler.
For example, something like this
Code: Select all
#include <wx/wx.h>
class MyDialog : public wxDialog
{
public:
MyDialog(wxWindow* parent = nullptr) : wxDialog(parent, wxID_ANY, "Test")
{
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
m_input = new wxTextCtrl(this, wxID_ANY, "Test");
mainSizer->Add(m_input, wxSizerFlags().Border());
m_mirror = new wxTextCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
mainSizer->Add(m_mirror, wxSizerFlags().Border());
m_mirror->ChangeValue(m_input->GetValue());
m_input->Bind(wxEVT_TEXT, [this](wxCommandEvent&)
{
m_mirror->ChangeValue(m_input->GetValue());
});
mainSizer->Add(CreateStdDialogButtonSizer(wxOK | wxCANCEL), wxSizerFlags().Border());
SetSizerAndFit(mainSizer);
}
private:
wxTextCtrl* m_input;
wxTextCtrl* m_mirror;
};
class MyApp : public wxApp
{
public:
bool OnInit() override
{
MyDialog().ShowModal();
return false;
}
}; wxIMPLEMENT_APP(MyApp);