33 #include <wx/hyperlink.h> 58 if( !getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty )
61 std::vector<ZONE*> toFill;
64 toFill.push_back(zone);
75 if( filler.
Fill( toFill,
true, aCaller ) )
77 commit.
Push(
_(
"Fill Zone(s)" ),
false );
78 getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty =
false;
98 std::vector<ZONE*> toFill;
103 toFill.push_back( zone );
107 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
110 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules"),
113 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
114 [&]( wxHyperlinkEvent& aEvent )
116 getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog(
_(
"Rules" ) );
122 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ),
123 10000, wxICON_WARNING );
131 std::lock_guard<KISPINLOCK> lock(
board()->GetConnectivity()->GetLock() );
133 if( filler.
Fill( toFill ) )
135 commit.
Push(
_(
"Fill Zone(s)" ),
false );
136 getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty =
false;
144 getEditFrame<PCB_EDIT_FRAME>()->UpdateUserInterface();
156 std::vector<ZONE*> toFill;
162 toFill.push_back( passedZone );
168 if(
ZONE* zone = dynamic_cast<ZONE*>( item ) )
169 toFill.push_back( zone );
176 std::lock_guard<KISPINLOCK> lock(
board()->GetConnectivity()->GetLock() );
178 if( filler.
Fill( toFill ) )
179 commit.
Push(
_(
"Fill Zone(s)" ),
false );
203 ZONE* zone = static_cast<ZONE*>( item );
207 zone->SetIsFilled(
false );
208 zone->ClearFilledPolysList();
211 commit.
Push(
_(
"Unfill Zone" ) );
226 zone->SetIsFilled(
false );
227 zone->ClearFilledPolysList();
230 commit.
Push(
_(
"Unfill All Zones" ) );
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION)
Show the infobar with the provided message and icon for a specific period of time.
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
void AddButton(wxButton *aButton)
Add an already created button to the infobar.
static TOOL_ACTION zoneFillAll
A progress reporter for use in multi-threaded environments.
virtual void Revert() override
static TOOL_ACTION zoneFill
void InstallNewProgressReporter(wxWindow *aParent, const wxString &aTitle, int aNumPhases)
bool Fill(std::vector< ZONE * > &aZones, bool aCheck=false, wxWindow *aParent=nullptr)
Fills the given list of zones.
void SetProgressReporter(PROGRESS_REPORTER *aReporter)
virtual void SetFocus() override
ZONE handles a list of polygons defining a copper zone.
class ZONE, a copper pour area
static TOOL_ACTION zoneUnfillAll
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
static TOOL_ACTION zoneUnfill
A modified version of the wxInfoBar class that allows us to:
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
WX_INFOBAR * GetInfoBar()