Cross update of composed and decomposed text controls fixed
This commit is contained in:
parent
21fa70a828
commit
aad2b347a6
@ -24,7 +24,9 @@
|
|||||||
// wxZRColaComposerPanel
|
// wxZRColaComposerPanel
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) : wxZRColaComposerPanelBase(parent)
|
wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
|
||||||
|
m_progress(false),
|
||||||
|
wxZRColaComposerPanelBase(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,17 +38,29 @@ wxZRColaComposerPanel::~wxZRColaComposerPanel()
|
|||||||
|
|
||||||
void wxZRColaComposerPanel::OnDecomposedText(wxCommandEvent& event)
|
void wxZRColaComposerPanel::OnDecomposedText(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
// TODO: Do the real ZRCola composition here.
|
if (m_progress) {
|
||||||
m_composed->SetValue(m_decomposed->GetValue());
|
// We are being updated by wxZRColaComposerPanel::OnComposedText()
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
|
} else {
|
||||||
|
// TODO: Do the real ZRCola composition here.
|
||||||
|
m_progress = true;
|
||||||
|
m_composed->SetValue(m_decomposed->GetValue());
|
||||||
|
event.Skip();
|
||||||
|
m_progress = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxZRColaComposerPanel::OnComposedText(wxCommandEvent& event)
|
void wxZRColaComposerPanel::OnComposedText(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
// TODO: Do the real ZRCola decomposition here.
|
if (m_progress) {
|
||||||
m_decomposed->SetValue(m_composed->GetValue());
|
// We are being updated by wxZRColaComposerPanel::OnDecomposedText()
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
|
} else {
|
||||||
|
// TODO: Do the real ZRCola decomposition here.
|
||||||
|
m_progress = true;
|
||||||
|
m_decomposed->SetValue(m_composed->GetValue());
|
||||||
|
event.Skip();
|
||||||
|
m_progress = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,4 +43,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void OnDecomposedText(wxCommandEvent& event);
|
virtual void OnDecomposedText(wxCommandEvent& event);
|
||||||
virtual void OnComposedText(wxCommandEvent& event);
|
virtual void OnComposedText(wxCommandEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool m_progress; ///< A boolean flag to avoid recursive updates of composed and decomposed text controls
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user