25#include <wx/checkbox.h>
40 std::vector<DRC_RE_FIELD_POSITION> positions =
m_data->GetFieldPositions();
45 field =
AddCheckbox( wxS(
"ninety_degrees" ), positions[1] );
48 field =
AddCheckbox( wxS(
"one_eighty_degrees" ), positions[2] );
51 field =
AddCheckbox( wxS(
"two_seventy_degrees" ), positions[3] );
54 field =
AddCheckbox( wxS(
"all_degrees" ), positions[4] );
57 auto notifyModified = [
this]( wxCommandEvent& )
64 auto onIndividualCheckbox = [
this, notifyModified]( wxCommandEvent& evt )
70 notifyModified( evt );
73 auto onAllDegreesCheckbox = [
this, notifyModified]( wxCommandEvent& evt )
81 notifyModified( evt );
134 wxString* aValidationMessage )
142 *aErrorCount =
result.errors.size();
144 for(
size_t i = 0; i <
result.errors.size(); i++ )
157 return wxEmptyString;
159 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.