KiCad PCB EDA Suite
dialog_copper_zones.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include <fctsys.h>
27 #include <kiface_i.h>
28 #include <confirm.h>
29 #include <pcb_edit_frame.h>
30 #include <zones.h>
31 #include <bitmaps.h>
32 #include <widgets/unit_binder.h>
33 #include <class_zone.h>
34 #include <class_board.h>
35 
37 
38 
40 {
41 public:
42  DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings );
43 
44 private:
46  wxConfigBase* m_Config; // Current config
47 
48  bool m_settingsExported; // settings will be written to all other zones
49 
52 
55  static wxString m_netNameShowFilter; // the filter to show nets (default * "*"). Static
56  // to keep this pattern for an entire Pcbnew session
58 
64 
68 
69  bool TransferDataToWindow() override;
70  bool TransferDataFromWindow() override;
71 
77  bool AcceptOptions( bool aUseExportableSetupOnly = false );
78 
79  void OnStyleSelection( wxCommandEvent& event ) override;
80  void OnLayerSelection( wxDataViewEvent& event ) override;
81  void OnNetSortingOptionSelected( wxCommandEvent& event ) override;
82  void ExportSetupToOtherCopperZones( wxCommandEvent& event ) override;
83  void OnRunFiltersButtonClick( wxCommandEvent& event ) override;
84  void OnUpdateUI( wxUpdateUIEvent& ) override;
85  void OnButtonCancelClick( wxCommandEvent& event ) override;
86  void OnClose( wxCloseEvent& event ) override;
87 
89 };
90 
91 
92 // Initialize static member variables
93 wxString DIALOG_COPPER_ZONE::m_netNameShowFilter( wxT( "*" ) );
94 
95 
97 {
98  DIALOG_COPPER_ZONE dlg( aCaller, aSettings );
99 
100  return dlg.ShowModal();
101 }
102 
103 #define MIN_THICKNESS ZONE_THICKNESS_MIN_VALUE_MIL*IU_PER_MILS
104 
106  DIALOG_COPPER_ZONE_BASE( aParent ),
107  m_cornerSmoothingType( ZONE_SETTINGS::SMOOTHING_UNDEFINED ),
108  m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits, true ),
109  m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits, true ),
110  m_minWidth( aParent, m_minWidthLabel, m_minWidthCtrl, m_minWidthUnits, true ),
111  m_antipadClearance( aParent, m_antipadLabel, m_antipadCtrl, m_antipadUnits, true ),
112  m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits, true ),
113  m_gridStyleRotation( aParent, m_staticTextGrindOrient, m_tcGridStyleOrientation, m_staticTextRotUnits,
114  false ),
115  m_gridStyleThickness( aParent, m_staticTextStyleThickness,
116  m_tcGridStyleThickness, m_GridStyleThicknessUnits, false ),
117  m_gridStyleGap( aParent, m_staticTextGridGap, m_tcGridStyleGap, m_GridStyleGapUnits, false )
118 {
119  m_Parent = aParent;
121  m_bitmapNoNetWarning->SetBitmap( KiBitmap( dialog_warning_xpm ) );
122 
123  m_ptr = aSettings;
124  m_settings = *aSettings;
126 
127  m_settingsExported = false;
128 
129  m_NetFiltering = false;
130  m_NetSortingByPadCount = true; // false = alphabetic sort, true = pad count sort
131 
132  m_sdbSizerOK->SetDefault();
133 
135 }
136 
137 
139 {
144 
146  {
147  case ZONE_CONTAINER::NO_HATCH: m_OutlineAppearanceCtrl->SetSelection( 0 ); break;
148  case ZONE_CONTAINER::DIAGONAL_EDGE: m_OutlineAppearanceCtrl->SetSelection( 1 ); break;
149  case ZONE_CONTAINER::DIAGONAL_FULL: m_OutlineAppearanceCtrl->SetSelection( 2 ); break;
150  }
151 
154 
155  switch( m_settings.GetPadConnection() )
156  {
157  default:
158  case PAD_ZONE_CONN_THERMAL: m_PadInZoneOpt->SetSelection( 1 ); break;
159  case PAD_ZONE_CONN_THT_THERMAL: m_PadInZoneOpt->SetSelection( 2 ); break;
160  case PAD_ZONE_CONN_NONE: m_PadInZoneOpt->SetSelection( 3 ); break;
161  case PAD_ZONE_CONN_FULL: m_PadInZoneOpt->SetSelection( 0 ); break;
162  }
163 
164  // Do not enable/disable antipad clearance and spoke width. They might be needed if
165  // a module or pad overrides the zone to specify a thermal connection.
168 
169  wxString netNameDoNotShowFilter = wxT( "Net-*" );
170  m_NetFiltering = false;
171  m_NetSortingByPadCount = true;
172 
173  if( m_Config )
174  {
175  int opt = m_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
176  m_NetFiltering = opt >= 2;
177  m_NetSortingByPadCount = opt % 2;
178  m_Config->Read( ZONE_NET_FILTER_STRING_KEY, netNameDoNotShowFilter );
179  }
180 
182  m_DoNotShowNetNameFilter->SetValue( netNameDoNotShowFilter );
183  m_showAllNetsOpt->SetValue( !m_NetFiltering );
185 
186  // Build list of nets:
188 
190 
191  switch( m_settings.m_FillMode )
192  {
193  case ZFM_HATCH_PATTERN:
194  m_GridStyleCtrl->SetSelection( 1 ); break;
195  default:
196  m_GridStyleCtrl->SetSelection( 0 ); break;
197  }
198 
201 
202  // Gives a reasonable value to grid style parameters, if currently there are no defined
203  // parameters for grid pattern thickness and gap (if the value is 0)
204  // the grid pattern thickness default value is (arbitrary) m_ZoneMinThickness * 4
205  // or 1mm
206  // the grid pattern gap default value is (arbitrary) m_ZoneMinThickness * 6
207  // or 1.5 mm
208  int bestvalue = m_settings.m_HatchFillTypeThickness;
209 
210  if( bestvalue <= 0 ) // No defined value for m_HatchFillTypeThickness
211  bestvalue = std::max( m_settings.m_ZoneMinThickness * 4, Millimeter2iu( 1.0 ) );
212 
214 
215  bestvalue = m_settings.m_HatchFillTypeGap;
216 
217  if( bestvalue <= 0 ) // No defined value for m_HatchFillTypeGap
218  bestvalue = std::max( m_settings.m_ZoneMinThickness * 6, Millimeter2iu( 1.5 ) );
219 
221 
224 
225  // Enable/Disable some widgets
226  wxCommandEvent event;
227  OnStyleSelection( event );
228 
229  return true;
230 }
231 
232 
233 void DIALOG_COPPER_ZONE::OnUpdateUI( wxUpdateUIEvent& )
234 {
235  if( m_ListNetNameSelection->GetSelection() < 0 )
236  m_ListNetNameSelection->SetSelection( 0 );
237 
238  m_bNoNetWarning->Show( m_ListNetNameSelection->GetSelection() == 0 );
239 
240  if( m_cornerSmoothingType != m_cornerSmoothingChoice->GetSelection() )
241  {
243 
245  m_cornerRadiusLabel->SetLabel( _( "Chamfer distance:" ) );
246  else
247  m_cornerRadiusLabel->SetLabel( _( "Fillet radius:" ) );
248  }
249 
251 }
252 
253 
254 void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event )
255 {
256  // After an "Export Settings to Other Zones" cancel and close must return
257  // ZONE_EXPORT_VALUES instead of wxID_CANCEL.
258  Close( true );
259 }
260 
261 
263 {
265 
266  if( m_GridStyleCtrl->GetSelection() > 0 )
268  else
270 
271  if( !AcceptOptions() )
272  return false;
273 
274  m_settings.m_HatchFillTypeOrientation = m_gridStyleRotation.GetValue()/10.0; // value is returned in deci-degree
279 
280  *m_ptr = m_settings;
281  return true;
282 }
283 
284 
285 void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event )
286 {
287  EndModal( m_settingsExported ? ZONE_EXPORT_VALUES : wxID_CANCEL );
288 }
289 
290 
291 bool DIALOG_COPPER_ZONE::AcceptOptions( bool aUseExportableSetupOnly )
292 {
293  if( !m_clearance.Validate( 0, Mils2iu( ZONE_CLEARANCE_MAX_VALUE_MIL ) ) )
294  return false;
295 
296  if( !m_minWidth.Validate( Mils2iu( ZONE_THICKNESS_MIN_VALUE_MIL ), INT_MAX ) )
297  return false;
298 
299  if( !m_cornerRadius.Validate( 0, INT_MAX ) )
300  return false;
301 
302  if( !m_spokeWidth.Validate( 0, INT_MAX ) )
303  return false;
304 
306 
308  {
309  int minThickness = m_minWidth.GetValue();
310 
311  if( !m_gridStyleThickness.Validate( minThickness, INT_MAX ) )
312  return false;
313 
314  if( !m_gridStyleGap.Validate( minThickness, INT_MAX ) )
315  return false;
316  }
317 
318  switch( m_PadInZoneOpt->GetSelection() )
319  {
324  }
325 
326  switch( m_OutlineAppearanceCtrl->GetSelection() )
327  {
331  }
332 
333  if( m_Config )
334  {
336  wxString filter = m_DoNotShowNetNameFilter->GetValue();
337  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, filter );
338  }
339 
341 
344 
346 
348  ? 0 : m_cornerRadius.GetValue() );
349 
351 
353 
356 
358  {
359  DisplayError( this, _( "Thermal spoke width cannot be smaller than the minimum width." ) );
360  return false;
361  }
362 
363  if( m_Config )
364  {
373  }
374 
375  // If we use only exportable to others zones parameters, exit here:
376  if( aUseExportableSetupOnly )
377  return true;
378 
379  // Get the layer selection for this zone
380  int layer = -1;
381  for( int ii = 0; ii < m_layers->GetItemCount(); ++ii )
382  {
383  if( m_layers->GetToggleValue( (unsigned) ii, 0 ) )
384  {
385  layer = ii;
386  break;
387  }
388  }
389 
390  if( layer < 0 )
391  {
392  DisplayError( this, _( "No layer selected." ) );
393  return false;
394  }
395 
396  NETINFO_ITEM* net = nullptr;
397 
398  // Search net_code for this net, if a net was selected
399  if( m_ListNetNameSelection->GetSelection() > 0 )
400  {
401  wxString netname = m_ListNetNameSelection->GetStringSelection();
402  net = m_Parent->GetBoard()->FindNet( netname );
403  }
404 
405  m_settings.m_NetcodeSelection = net ? net->GetNet() : 0;
406 
407  return true;
408 }
409 
410 
411 void DIALOG_COPPER_ZONE::OnStyleSelection( wxCommandEvent& event )
412 {
413  bool enable = m_GridStyleCtrl->GetSelection() >= 1;
414  m_tcGridStyleThickness->Enable( enable );
415  m_tcGridStyleGap->Enable( enable );
416  m_tcGridStyleOrientation->Enable( enable );
417  m_spinCtrlSmoothLevel->Enable( enable );
418  m_spinCtrlSmoothValue->Enable( enable );
419 }
420 
421 
422 void DIALOG_COPPER_ZONE::OnLayerSelection( wxDataViewEvent& event )
423 {
424  if( event.GetColumn() != 0 )
425  return;
426 
427  int row = m_layers->ItemToRow( event.GetItem() );
428 
429  if( m_layers->GetToggleValue( row, 0 ) )
430  {
431  wxVariant layerID;
432  m_layers->GetValue( layerID, row, 2 );
433  m_settings.m_CurrentZone_Layer = ToLAYER_ID( layerID.GetInteger() );
434 
435  // Turn all other checkboxes off.
436  for( int ii = 0; ii < m_layers->GetItemCount(); ++ii )
437  {
438  if( ii != row )
439  m_layers->SetToggleValue( false, ii, 0 );
440  }
441  }
442 }
443 
444 
446 {
447  m_NetFiltering = !m_showAllNetsOpt->GetValue();
450 
452 
453  if( m_Config )
454  {
455  long configValue = m_NetFiltering ? 2 : 0;
456 
458  configValue += 1;
459 
460  m_Config->Write( ZONE_NET_SORT_OPTION_KEY, configValue );
461  wxString Filter = m_DoNotShowNetNameFilter->GetValue();
462  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, Filter );
463  }
464 }
465 
466 
468 {
469  if( !AcceptOptions( true ) )
470  return;
471 
472  // Export settings ( but layer and netcode ) to others copper zones
473  BOARD* pcb = m_Parent->GetBoard();
474 
475  for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
476  {
477  ZONE_CONTAINER* zone = pcb->GetArea( ii );
478 
479  // Cannot export settings from a copper zone
480  // to a zone keepout:
481  if( zone->GetIsKeepout() )
482  continue;
483 
484  m_settings.ExportSetting( *zone, false ); // false = partial export
485  m_settingsExported = true;
486  m_Parent->OnModify();
487  }
488 }
489 
490 
491 void DIALOG_COPPER_ZONE::OnRunFiltersButtonClick( wxCommandEvent& event )
492 {
493  m_NetFiltering = true;
494  m_showAllNetsOpt->SetValue( false );
495 
497 }
498 
499 
501 {
502  wxArrayString listNetName;
503 
505 
506  if( m_NetFiltering )
507  {
508  wxString doNotShowFilter = m_DoNotShowNetNameFilter->GetValue();
509  wxString ShowFilter = m_ShowNetNameFilter->GetValue();
510 
511  for( unsigned ii = 0; ii < listNetName.GetCount(); ii++ )
512  {
513  if( listNetName[ii].Matches( doNotShowFilter ) )
514  {
515  listNetName.RemoveAt( ii );
516  ii--;
517  }
518  else if( !listNetName[ii].Matches( ShowFilter ) )
519  {
520  listNetName.RemoveAt( ii );
521  ii--;
522  }
523  }
524  }
525 
526  listNetName.Insert( wxT( "<no net>" ), 0 );
527 
528  // Ensure currently selected net for the zone is visible, regardless of filters
529  int selectedNetListNdx = 0;
530  int net_select = m_settings.m_NetcodeSelection;
531 
532  if( net_select > 0 )
533  {
534  NETINFO_ITEM* selectedNet = m_Parent->GetBoard()->FindNet( net_select );
535  if( selectedNet )
536  {
537  selectedNetListNdx = listNetName.Index( selectedNet->GetNetname() );
538 
539  if( wxNOT_FOUND == selectedNetListNdx )
540  {
541  // the currently selected net must *always* be visible.
542  // <no net> is the zero'th index, so pick next lowest
543  listNetName.Insert( selectedNet->GetNetname(), 1 );
544  selectedNetListNdx = 1;
545  }
546  }
547  }
548 
549  m_ListNetNameSelection->Clear();
550  m_ListNetNameSelection->InsertItems( listNetName, 0 );
551  m_ListNetNameSelection->SetSelection( selectedNetListNdx );
552  m_ListNetNameSelection->EnsureVisible( selectedNetListNdx );
553 }
554 
void OnRunFiltersButtonClick(wxCommandEvent &event) override
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
Definition: zone_settings.h:81
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
void OnButtonCancelClick(wxCommandEvent &event) override
static wxString m_netNameShowFilter
This file is part of the common library.
void SetCornerSmoothingType(int aType)
void OnLayerSelection(wxDataViewEvent &event) override
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
Definition: zone_settings.h:84
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type.
Definition: zone_settings.h:69
double m_HatchFillTypeOrientation
Grid style shape: orientation of grid lines in degrees.
Definition: zone_settings.h:68
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int GetCornerSmoothingType() const
int m_HatchFillTypeGap
Grid style shape: clearance between lines (0 -> solid shape)
Definition: zone_settings.h:67
#define ZONE_CLEARANCE_MAX_VALUE_MIL
Definition: zones.h:43
virtual void SetUnits(EDA_UNITS_T aUnits, bool aUseMils=false)
Function SetUnits Normally not needed (as the UNIT_BINDER inherits from the parent frame),...
Definition: unit_binder.cpp:68
#define ZONE_EXPORT_VALUES
Definition: zones.h:46
Class DIALOG_COPPER_ZONE_BASE.
void OnStyleSelection(wxCommandEvent &event) override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:115
unsigned int GetCornerRadius() const
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
bool AcceptOptions(bool aUseExportableSetupOnly=false)
Pads are not covered.
Definition: zones.h:52
T NormalizeAngle180(T Angle)
Normalize angle to be in the -180.0 .. 180.0 range.
Definition: trigo.h:338
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:74
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:949
#define ZONE_NET_SORT_OPTION_KEY
Definition: zones.h:30
PCB_BASE_FRAME * m_Parent
wxSpinCtrlDouble * m_spinCtrlSmoothValue
bool TransferDataFromWindow() override
int m_ZonePriority
Priority (0 ... N) of the zone.
Definition: zone_settings.h:62
int SortedNetnamesList(wxArrayString &aNames, bool aSortbyPadsCount)
Function SortedNetnamesList.
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:233
int m_ZoneClearance
Clearance value.
Definition: zone_settings.h:64
#define ZONE_THERMAL_RELIEF_GAP_STRING_KEY
Definition: zones.h:32
#define ZONE_NET_FILTER_STRING_KEY
Definition: zones.h:31
void ExportSetupToOtherCopperZones(wxCommandEvent &event) override
ZoneConnection GetPadConnection() const
void ExportSetting(ZONE_CONTAINER &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
virtual bool Validate(long long int aMin, long long int aMax, bool setFocusOnError=true)
Function Validate Validates the control against the given range, informing the user of any errors fou...
#define _(s)
Thermal relief only for THT pads.
Definition: zones.h:55
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:630
Class ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:49
void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
Function ConfigBaseWriteDouble This is a helper function to write doubles in config We cannot use wxC...
#define ZONE_MIN_THICKNESS_WIDTH_STRING_KEY
Definition: zones.h:35
ZONE_FILL_MODE m_FillMode
Definition: zone_settings.h:60
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
Class NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
#define ZONE_THICKNESS_MIN_VALUE_MIL
Definition: zones.h:41
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
Definition: zones.h:33
int GetNet() const
Function GetNet.
Definition: netinfo.h:225
#define max(a, b)
Definition: auxiliary.h:86
UNIT_BINDER m_gridStyleThickness
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
void SetCornerRadius(int aRadius)
double m_HatchFillTypeSmoothingValue
Grid pattern chamfer distance/fillet value.
Definition: zone_settings.h:71
DIALOG_COPPER_ZONE(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings)
#define IU_PER_MILS
Definition: plotter.cpp:136
#define ZONE_CLEARANCE_WIDTH_STRING_KEY
Definition: zones.h:34
void OnNetSortingOptionSelected(wxCommandEvent &event) override
void SetPadConnection(ZoneConnection aPadConnection)
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
int InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing.
#define ZONE_NET_OUTLINES_STYLE_KEY
Definition: zones.h:29
void SetupLayersList(wxDataViewListCtrl *aList, PCB_BASE_FRAME *aFrame, bool aShowCopper, bool aFpEditorMode=false)
A helper routine for the various zone dialogs (copper, non-copper, keepout).
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:914
BOARD * GetBoard() const
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: zone_settings.h:66
bool TransferDataToWindow() override
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:813
Use thermal relief for pads.
Definition: zones.h:53
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
Definition: zone_settings.h:78
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
Definition: zone_settings.h:83
void OnClose(wxCloseEvent &event) override
int m_ZoneMinThickness
Min thickness value in filled areas.
Definition: zone_settings.h:65
pads are covered by copper
Definition: zones.h:54
void OnUpdateUI(wxUpdateUIEvent &) override