29#include <wx/checkbox.h>
44 std::vector<DRC_RE_FIELD_POSITION> positions =
m_data->GetFieldPositions();
49 field =
AddCheckbox( wxS(
"ninety_degrees" ), positions[1] );
52 field =
AddCheckbox( wxS(
"one_eighty_degrees" ), positions[2] );
55 field =
AddCheckbox( wxS(
"two_seventy_degrees" ), positions[3] );
58 field =
AddCheckbox( wxS(
"all_degrees" ), positions[4] );
61 auto notifyModified = [
this]( wxCommandEvent& )
68 auto onIndividualCheckbox = [
this, notifyModified]( wxCommandEvent& evt )
74 notifyModified( evt );
77 auto onAllDegreesCheckbox = [
this, notifyModified]( wxCommandEvent& evt )
85 notifyModified( evt );
138 wxString* aValidationMessage )
146 *aErrorCount =
result.errors.size();
148 for(
size_t i = 0; i <
result.errors.size(); i++ )
161 return wxEmptyString;
163 return m_data->GenerateRule( aContext );
wxCheckBox * m_zeroDegreesCheckbox
wxCheckBox * m_twoSeventyDegreesCheckbox
wxCheckBox * m_oneEightyDegreesCheckbox
bool TransferDataFromWindow() override
DRC_RE_ALLOWED_ORIENTATION_OVERLAY_PANEL(wxWindow *aParent, DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA *aData)
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
bool ValidateInputs(int *aErrorCount, wxString *aValidationMessage) override
bool TransferDataToWindow() override
wxCheckBox * m_ninetyDegreesCheckbox
DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA * m_data
wxCheckBox * m_allDegreesCheckbox
DRC_RE_OVERLAY_FIELD * AddCheckbox(const wxString &aId, const DRC_RE_FIELD_POSITION &aPosition)
Create and position a checkbox control on the bitmap overlay.
void SetBackgroundBitmap(BITMAPS aBitmap)
Set the background bitmap for this panel.
DRC_RE_BITMAP_OVERLAY_PANEL(wxWindow *aParent, wxWindowID aId=wxID_ANY)
void PositionFields()
Position all fields based on the current scale factor.
Wraps a wxControl positioned over a bitmap overlay panel.
wxControl * GetControl() const
static wxString FormatErrorMessage(int aErrorCount, const wxString &aErrorMessage)
void SetModified()
Marks the dialog as modified, indicating unsaved changes.
static RULE_EDITOR_DIALOG_BASE * GetDialog(wxWindow *aWindow)
Static method to retrieve the rule editor dialog instance associated with a given window.
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.