27#include <wx/dataview.h>
60 m_pcbFrame( aParent ),
61 m_zoneInfo( aZoneInfo ),
63 m_priorityDragIndex( {} ),
64 m_needZoomGAL(
true ),
65 m_isFillingZones(
false ),
66 m_zoneFillComplete(
false )
69 m_sizerZoneOP->InsertSpacer( m_sizerZoneOP->GetItemCount(), 5 );
76 m_sizerProperties->Add( m_panelZoneProperties, 1, wxTOP | wxEXPAND, 5 );
79 m_sizerTop->Add( m_zoneViewer, 1, wxBOTTOM | wxLEFT | wxEXPAND, 10 );
87 m_viewZonesOverview->AppendIconTextColumn( v, k );
89 m_viewZonesOverview->AppendTextColumn( v, k );
93 aParent->GetBoard(), aParent,
this );
94 m_viewZonesOverview->AssociateModel( m_modelZoneOverviewTable.get() );
96#if wxUSE_DRAG_AND_DROP
97 m_viewZonesOverview->EnableDragSource( wxDF_UNICODETEXT );
98 m_viewZonesOverview->EnableDropTarget( wxDF_UNICODETEXT );
100 int id = m_viewZonesOverview->GetId();
101 Bind( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, &DIALOG_ZONE_MANAGER::OnBeginDrag,
this,
id );
102 Bind( wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, &DIALOG_ZONE_MANAGER::OnDropPossible,
this,
id );
103 Bind( wxEVT_DATAVIEW_ITEM_DROP, &DIALOG_ZONE_MANAGER::OnDrop,
this,
id );
110 Bind( wxEVT_BOOKCTRL_PAGE_CHANGED,
111 [
this]( wxNotebookEvent& aEvent )
115 m_zoneViewer->GetId() );
117 if( m_modelZoneOverviewTable->GetCount() )
118 SelectZoneTableItem( m_modelZoneOverviewTable->GetItem( 0 ) );
121 m_MainBoxSizer->Fit(
this );
122 finishDialogSettings();
135 canvas->ZoomFitScreen();
142 long filterInsertPos =
m_filterCtrl->GetInsertionPoint();
164 if( textCtrlHasFocus )
176 if( aEvent.GetKeyCode() == WXK_DOWN || aEvent.GetKeyCode() == WXK_UP )
219 i->OnZoneSelectionChanged( zone );
254 zone_management->OnUserConfirmChange();
273#if wxUSE_DRAG_AND_DROP
275void DIALOG_ZONE_MANAGER::OnBeginDrag( wxDataViewEvent& aEvent )
277 wxTextDataObject* obj =
new wxTextDataObject;
278 obj->SetText(
"42" );
279 aEvent.SetDataObject( obj );
280 aEvent.SetDragFlags( wxDrag_AllowMove );
281 const wxDataViewItem it = aEvent.GetItem();
288void DIALOG_ZONE_MANAGER::OnDropPossible( wxDataViewEvent& aEvent )
290 aEvent.SetDropEffect( wxDragMove );
294void DIALOG_ZONE_MANAGER::OnDrop( wxDataViewEvent& aEvent )
296 if( aEvent.GetDataFormat() != wxDF_UNICODETEXT )
305 const wxDataViewItem it = aEvent.GetItem();
314 const std::optional<unsigned> rtn =
317 if( rtn.has_value() )
385 auto commit = std::make_unique<BOARD_COMMIT>(
m_pcbFrame );
386 m_filler = std::make_unique<ZONE_FILLER>( board, commit.get() );
387 auto reporter = std::make_unique<WX_PROGRESS_REPORTER>(
this,
_(
"Fill All Zones" ), 5 );
388 m_filler->SetProgressReporter( reporter.get() );
403 gal->RedrawRatsnest();
404 gal->GetView()->UpdateItems();
406 int layer = gal->GetLayer();
407 gal->ActivateSelectedZone(
409 gal->OnLayerSelected( layer );
425 zone->SetZoneName( aEvent.GetString() );
434 unsigned count = aEvent.GetInt();
443 const wxObject* sender = aEvent.GetEventObject();
449 else if( aEvent.GetEventObject() ==
m_checkNet )
469 if( !selectedItem.IsOk() )
473 const std::optional<unsigned> new_index =
476 if( new_index.has_value() )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Information pertinent to a Pcbnew printed circuit board.
const ZONES & Zones() const
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
void IncrementTimeStamp()
Class DIALOG_ZONE_MANAGER_BASE.
wxCheckBox * m_checkRepour
STD_BITMAP_BUTTON * m_btnMoveUp
wxSearchCtrl * m_filterCtrl
wxDataViewCtrl * m_viewZonesOverview
STD_BITMAP_BUTTON * m_btnMoveDown
void OnZoneNameUpdate(wxCommandEvent &aEvent)
PANE_ZONE_VIEWER * m_zoneViewer
void OnViewZonesOverviewOnLeftUp(wxMouseEvent &aEvent) override
~DIALOG_ZONE_MANAGER() override
void PostProcessZoneViewSelectionChange(wxDataViewItem const &item)
void GenericProcessChar(wxKeyEvent &event)
PCB_BASE_FRAME * m_pcbFrame
PANEL_ZONE_PROPERTIES * m_panelZoneProperties
void OnMoveDownClick(wxCommandEvent &aEvent) override
std::unique_ptr< ZONE_FILLER > m_filler
void OnRepourCheck(wxCommandEvent &aEvent) override
void OnTableChar(wxKeyEvent &event) override
void onDialogResize(wxSizeEvent &event) override
void OnMoveUpClick(wxCommandEvent &aEvent) override
void OnUpdateDisplayedZonesClick(wxCommandEvent &aEvent) override
void MoveSelectedZonePriority(ZONE_INDEX_MOVEMENT aMove)
void OnDataViewCtrlSelectionChanged(wxDataViewEvent &event) override
std::optional< unsigned > m_priorityDragIndex
DIALOG_ZONE_MANAGER(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aZoneInfo)
void OnTableCharHook(wxKeyEvent &event) override
void OnIdle(wxIdleEvent &aEvent)
void OnCheckBoxClicked(wxCommandEvent &aEvent)
void OnFilterCtrlTextChange(wxCommandEvent &aEvent) override
ZONE_SETTINGS * m_zoneInfo
void SelectZoneTableItem(wxDataViewItem const &aItem)
void OnOk(wxCommandEvent &aEvt) override
void OnFilterCtrlCancel(wxCommandEvent &aEvent) override
wxObjectDataPtr< MODEL_ZONES_OVERVIEW_TABLE > m_modelZoneOverviewTable
void OnFilterCtrlEnter(wxCommandEvent &aEvent) override
void OnZoneSelectionChanged(ZONE *aZone)
void OnZonesTableRowCountChange(wxCommandEvent &aEvent)
std::unique_ptr< ZONES_CONTAINER > m_zonesContainer
void OnFilterCtrlSearch(wxCommandEvent &aEvent) override
static std::map< int, wxString > GetColumnNames()
bool TransferZoneSettingsFromWindow()
std::shared_ptr< ZONE_SETTINGS > GetZoneSettings() const
void ActivateSelectedZone(ZONE *new_zone) override
PANEL_ZONE_GAL * GetZoneGAL() const
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
Classes need post progress after user click OK.
static bool GetRepourOnClose()
static void SetRefillOnClose(bool aRepour)
Should all the zones be re-poured on dialog close.
Subscriber who is interested in the zone selection change.
ZONE_SETTINGS handles zones parameters.
Handle a list of polygons defining a copper zone.
std::vector< ZONE * > ZONES