35 #include <wx/hyperlink.h> 44 m_fillInProgress( false )
66 std::vector<ZONE*> toFill;
69 toFill.push_back(zone);
72 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
81 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Checking Zones" ), 4 );
85 if( filler.
Fill( toFill,
true, aCaller ) )
88 commit.
Push(
_(
"Fill Zone(s)" ) );
89 getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty =
false;
111 std::vector<ZONE*> toFill;
119 toFill.push_back( zone );
124 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
127 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
130 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules"),
133 button->Bind( wxEVT_COMMAND_HYPERLINK,
134 std::function<
void( wxHyperlinkEvent& aEvent )>(
135 [
frame]( wxHyperlinkEvent& aEvent )
137 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
143 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ),
144 10000, wxICON_WARNING );
153 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Fill All Zones" ), 3 );
158 if( filler.
Fill( toFill ) )
161 commit.
Push(
_(
"Fill Zone(s)" ),
true );
162 frame->m_ZoneFillsDirty =
false;
170 frame->UpdateUserInterface();
192 std::vector<ZONE*> toFill;
196 toFill.push_back( passedZone );
202 if(
ZONE* zone = dynamic_cast<ZONE*>( item ) )
203 toFill.push_back( zone );
208 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
211 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame(),
_(
"Fill Zone" ), 4 );
214 if( filler.
Fill( toFill ) )
217 commit.
Push(
_(
"Fill Zone(s)" ),
true );
243 ZONE* zone = static_cast<ZONE*>( item );
250 commit.
Push(
_(
"Unfill Zone" ) );
268 commit.
Push(
_(
"Unfill All Zones" ) );
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 interface for use in multi-threaded environments.
virtual void Revert() override
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
static TOOL_ACTION zoneFill
bool Fill(std::vector< ZONE * > &aZones, bool aCheck=false, wxWindow *aParent=nullptr)
Fills the given list of zones.
void SetProgressReporter(PROGRESS_REPORTER *aReporter)
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
virtual void SetFocus() override
Handle a list of polygons defining a copper zone.
class ZONE, a copper pour area
void IncrementTimeStamp()
static TOOL_ACTION zoneUnfillAll
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
static TOOL_ACTION zoneUnfill
A modified version of the wxInfoBar class that allows us to:
class ZONE, managed by a footprint
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
The main frame for Pcbnew.
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()