27#include <wx/dataview.h>
31#include <wx/radiobut.h>
67 canvas->ZoomFitScreen();
74 long filterInsertPos =
m_filterCtrl->GetInsertionPoint();
96 if( textCtrlHasFocus )
108 if( aEvent.GetKeyCode() == WXK_DOWN || aEvent.GetKeyCode() == WXK_UP )
145 m_modelZoneOverviewTable(
147 aParent->
GetBoard(), aParent, this ) ),
148 m_zoneViewer( new
PANE_ZONE_VIEWER( this, aParent ) ), m_priorityDragIndex( {} ),
149 m_needZoomGAL(
true ), m_isFillingZones(
false ), m_zoneFillComplete(
false )
152 m_sizerZoneOP->InsertSpacer( m_sizerZoneOP->GetItemCount(), 5 );
157 m_sizerProperties->Add( m_panelZoneProperties, 1, wxALL | wxEXPAND );
158 m_sizerTop->Add( m_zoneViewer, 1, wxBOTTOM | wxTOP | wxRIGHT | wxEXPAND, 5 );
160 m_zoneViewer->SetId( ZONE_VIEWER );
165 m_viewZonesOverview->AppendIconTextColumn( v, k );
167 m_viewZonesOverview->AppendTextColumn( v, k );
170 m_viewZonesOverview->AssociateModel( m_modelZoneOverviewTable.get() );
172#if wxUSE_DRAG_AND_DROP
174 m_viewZonesOverview->EnableDragSource( wxDF_UNICODETEXT );
175 m_viewZonesOverview->EnableDropTarget( wxDF_UNICODETEXT );
177 Bind( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, &DIALOG_ZONE_MANAGER::OnBeginDrag,
this,
179 Bind( wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, &DIALOG_ZONE_MANAGER::OnDropPossible,
this,
181 Bind( wxEVT_DATAVIEW_ITEM_DROP, &DIALOG_ZONE_MANAGER::OnDrop,
this, VIEW_ZONE_TABLE );
193 wxEVT_BOOKCTRL_PAGE_CHANGED,
194 [
this]( wxNotebookEvent& aEvent )
200 bool foundZone = m_modelZoneOverviewTable->GetCount();
203 SelectZoneTableItem( m_modelZoneOverviewTable->GetItem( 0 ) );
206 m_MainBoxSizer->Fit(
this );
234 i->OnZoneSelectionChanged( zone );
269 zone_management->OnUserConfirmChange();
282#if wxUSE_DRAG_AND_DROP
284void DIALOG_ZONE_MANAGER::OnBeginDrag( wxDataViewEvent& aEvent )
286 wxTextDataObject* obj =
new wxTextDataObject;
287 obj->SetText(
"42" );
288 aEvent.SetDataObject( obj );
289 aEvent.SetDragFlags( wxDrag_AllowMove );
290 const wxDataViewItem it = aEvent.GetItem();
297void DIALOG_ZONE_MANAGER::OnDropPossible( wxDataViewEvent& aEvent )
299 aEvent.SetDropEffect( wxDragMove );
309void DIALOG_ZONE_MANAGER::OnDrop( wxDataViewEvent& aEvent )
311 if( aEvent.GetDataFormat() != wxDF_UNICODETEXT )
320 const wxDataViewItem it = aEvent.GetItem();
329 const std::optional<unsigned> rtn =
332 if( rtn.has_value() )
401 auto commit = std::make_unique<BOARD_COMMIT>(
m_pcbFrame );
402 m_filler = std::make_unique<ZONE_FILLER>( board, commit.get() );
403 auto reporter = std::make_unique<WX_PROGRESS_REPORTER>(
this,
_(
"Fill All Zones" ), 5 );
404 m_filler->SetProgressReporter( reporter.get() );
420 gal->RedrawRatsnest();
421 gal->GetView()->UpdateItems();
423 int layer = gal->GetLayer();
424 gal->ActivateSelectedZone(
426 gal->OnLayerSelected( layer );
437 zone->SetZoneName( aEvent.GetString() );
446 unsigned count = aEvent.GetInt();
455 const wxObject* sender = aEvent.GetEventObject();
461 else if( aEvent.GetEventObject() ==
m_checkNet )
481 if( !selectedItem.IsOk() )
485 const std::optional<unsigned> new_index =
488 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 OnMoveDownClick(wxCommandEvent &aEvent)
void OnButtonApplyClick(wxCommandEvent &aEvent) override
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
void OnIDle(wxIdleEvent &aEvent)
PANEL_ZONE_PROPERTIES * m_panelZoneProperties
std::unique_ptr< ZONE_FILLER > m_filler
void OnRepourCheck(wxCommandEvent &aEvent) override
void OnTableChar(wxKeyEvent &event) 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 OnOk(wxCommandEvent &aEvt)
void OnCheckBoxClicked(wxCommandEvent &aEvent)
void OnMoveUpClick(wxCommandEvent &aEvent)
void OnFilterCtrlTextChange(wxCommandEvent &aEvent) override
ZONE_SETTINGS * m_zoneInfo
void SelectZoneTableItem(wxDataViewItem const &aItem)
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()
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 void SetRepourOnClose(bool aRepour)
Should all the zones be re-poured on dialog close.
static bool GetRepourOnClose()
Subscriber who is interested in the zone selection change.
ZONE_SETTINGS handles zones parameters.
Handle a list of polygons defining a copper zone.
This file is part of the common library.
int InvokeZonesManager(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aZoneInfo)
Function InvokeZonesManager invokes up a modal dialog window for zones manager.
Abstract pattern-matching tool and implementations.
std::vector< ZONE * > ZONES
#define ZONE_MANAGER_REPOUR