fix compilation errors for wxFileDialog when wxUSE_RADIOBTN is off

fix compilation errors when wxUSE_RADIOBTN, wxUSE_RADIOBOX,
wxUSE_RICHTEXT, and wxUSE_PRINTING_ARCHITECTURE are off.
This commit is contained in:
matyalatte 2023-06-23 02:50:37 +09:00
parent e1e2e982e3
commit 4d8e3399cf
4 changed files with 22 additions and 0 deletions

View file

@ -15,7 +15,9 @@
class wxFileDialogCustomControlImpl;
class wxFileDialogButtonImpl;
class wxFileDialogCheckBoxImpl;
#if wxUSE_RADIOBTN
class wxFileDialogRadioButtonImpl;
#endif
class wxFileDialogChoiceImpl;
class wxFileDialogTextCtrlImpl;
class wxFileDialogStaticTextImpl;
@ -92,6 +94,7 @@ private:
wxDECLARE_NO_COPY_CLASS(wxFileDialogCheckBox);
};
#if wxUSE_RADIOBTN
// A class representing a custom radio button.
class WXDLLIMPEXP_CORE wxFileDialogRadioButton : public wxFileDialogCustomControl
{
@ -110,6 +113,7 @@ private:
wxDECLARE_NO_COPY_CLASS(wxFileDialogRadioButton);
};
#endif // wxUSE_RADIOBTN
// A class representing a custom combobox button.
class WXDLLIMPEXP_CORE wxFileDialogChoice : public wxFileDialogCustomControl
@ -170,7 +174,9 @@ class WXDLLIMPEXP_CORE wxFileDialogCustomize
public:
wxFileDialogButton* AddButton(const wxString& label);
wxFileDialogCheckBox* AddCheckBox(const wxString& label);
#if wxUSE_RADIOBTN
wxFileDialogRadioButton* AddRadioButton(const wxString& label);
#endif
wxFileDialogChoice* AddChoice(size_t n, const wxString* strings);
wxFileDialogTextCtrl* AddTextCtrl(const wxString& label = wxString());
wxFileDialogStaticText* AddStaticText(const wxString& label);

View file

@ -38,12 +38,14 @@ public:
virtual void SetValue(bool value) = 0;
};
#if wxUSE_RADIOBTN
class wxFileDialogRadioButtonImpl : public wxFileDialogCustomControlImpl
{
public:
virtual bool GetValue() = 0;
virtual void SetValue(bool value) = 0;
};
#endif // wxUSE_RADIOBTN
class wxFileDialogChoiceImpl : public wxFileDialogCustomControlImpl
{
@ -74,7 +76,9 @@ class wxFileDialogCustomizeImpl
public:
virtual wxFileDialogButtonImpl* AddButton(const wxString& label) = 0;
virtual wxFileDialogCheckBoxImpl* AddCheckBox(const wxString& label) = 0;
#if wxUSE_RADIOBTN
virtual wxFileDialogRadioButtonImpl* AddRadioButton(const wxString& label) = 0;
#endif
virtual wxFileDialogChoiceImpl* AddChoice(size_t n, const wxString* strings) = 0;
virtual wxFileDialogTextCtrlImpl* AddTextCtrl(const wxString& label) = 0;
virtual wxFileDialogStaticTextImpl* AddStaticText(const wxString& label) = 0;

View file

@ -145,6 +145,7 @@ void wxFileDialogCheckBox::SetValue(bool value)
GetImpl()->SetValue(value);
}
#if wxUSE_RADIOBTN
wxFileDialogRadioButton::wxFileDialogRadioButton(wxFileDialogRadioButtonImpl* impl)
: wxFileDialogCustomControl(impl)
{
@ -172,6 +173,7 @@ void wxFileDialogRadioButton::SetValue(bool value)
{
GetImpl()->SetValue(value);
}
#endif // wxUSE_RADIOBTN
wxFileDialogChoice::wxFileDialogChoice(wxFileDialogChoiceImpl* impl)
: wxFileDialogCustomControl(impl)
@ -280,11 +282,13 @@ wxFileDialogCustomize::AddCheckBox(const wxString& label)
return StoreAndReturn(new wxFileDialogCheckBox(m_impl->AddCheckBox(label)));
}
#if wxUSE_RADIOBTN
wxFileDialogRadioButton*
wxFileDialogCustomize::AddRadioButton(const wxString& label)
{
return StoreAndReturn(new wxFileDialogRadioButton(m_impl->AddRadioButton(label)));
}
#endif // wxUSE_RADIOBTN
wxFileDialogChoice*
wxFileDialogCustomize::AddChoice(size_t n, const wxString* strings)
@ -444,6 +448,7 @@ private:
wxEvtHandler* m_handler;
};
#if wxUSE_RADIOBTN
class RadioButtonImpl : public ControlImplBase<wxFileDialogRadioButtonImpl>
{
public:
@ -495,6 +500,7 @@ private:
wxEvtHandler* m_handler;
};
#endif // wxUSE_RADIOBTN
class ChoiceImpl : public ControlImplBase<wxFileDialogChoiceImpl>
{
@ -648,6 +654,7 @@ public:
return AddToLayoutAndReturn<CheckBoxImpl>(label);
}
#if wxUSE_RADIOBTN
wxFileDialogRadioButtonImpl* AddRadioButton(const wxString& label) override
{
RadioButtonImpl* const impl = AddToLayoutAndReturn<RadioButtonImpl>(label);
@ -661,6 +668,7 @@ public:
return impl;
}
#endif // wxUSE_RADIOBTN
wxFileDialogChoiceImpl* AddChoice(size_t n, const wxString* strings) override
{

View file

@ -326,6 +326,7 @@ public:
}
};
#if wxUSE_RADIOBTN
class wxFileDialogRadioButtonImplFDC
: public wxFileDialogImplFDC<wxFileDialogRadioButtonImpl>
{
@ -366,6 +367,7 @@ public:
private:
const DWORD m_item;
};
#endif // wxUSE_RADIOBTN
class wxFileDialogChoiceImplFDC
: public wxFileDialogImplFDC<wxFileDialogChoiceImpl>
@ -534,6 +536,7 @@ public:
return new wxFileDialogCheckBoxImplFDC(m_fdc, m_lastId);
}
#if wxUSE_RADIOBTN
wxFileDialogRadioButtonImpl* AddRadioButton(const wxString& label) override
{
HRESULT hr;
@ -568,6 +571,7 @@ public:
return impl;
}
#endif // wxUSE_RADIOBTN
wxFileDialogChoiceImpl* AddChoice(size_t n, const wxString* strings) override
{