wxArt2D
snap.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: snap.cpp
3 // Purpose:
4 // Author:
5 // Modified by:
6 // Created: 11/24/06 11:51:50
7 // RCS-ID:
8 // Copyright:
9 // Licence:
10 /////////////////////////////////////////////////////////////////////////////
11 
12 #include "a2dprec.h"
13 
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17 
18 #ifndef WX_PRECOMP
19 #include "wx/wx.h"
20 #endif
21 
22 ////@begin includes
23 ////@end includes
24 
25 #include "wx/canvas/snap.h"
26 #include "wx/canvas/canglob.h"
27 
28 ////@begin control identifiers
29 #define ID_SNAPALL 10000
30 #define ID_VisibleOnly 10014
31 #define ID_POS_X 10001
32 #define ID_POS_Y 10003
33 #define ID_POS_PIN 10004
34 #define ID_POS_PIN_UNCONN 10013
35 #define ID_BBOXVERTEXES 10021
36 #define ID_VERTEXES 10005
37 #define ID_POS_X_OBJ 10006
38 #define ID_POS_Y_OBJ 10007
39 #define ID_POS_POINT_X 10008
40 #define ID_POS_POINT_Y 10010
41 #define ID_POS_POINT_XY 10009
42 #define ID_SnapGrid_X 10002
43 #define ID_SnapGrid_Y 10012
44 #define ID_SnapOrigin_X 10015
45 #define ID_SnapOrigin_Y 10017
46 #define ID_RotSnapAngle 10018
47 #define ID_SnapThreshold 10019
48 #define ID_snapPointX 10022
49 #define ID_snapPointY 10023
50 ////@end control identifiers
51 
52 ////@begin XPM images
53 ////@end XPM images
54 
55 /*!
56  * a2dSnapSettings type definition
57  */
58 
59 IMPLEMENT_DYNAMIC_CLASS( a2dSnapSettings, wxDialog )
60 
61 /*!
62  * a2dSnapSettings event table definition
63  */
64 
65 BEGIN_EVENT_TABLE( a2dSnapSettings, wxDialog )
66 
67  EVT_CLOSE( a2dSnapSettings::OnCloseWindow )
68  EVT_IDLE( a2dSnapSettings::OnIdle )
69 
70  EVT_CHECKBOX( ID_SNAPALL, a2dSnapSettings::OnSnapallClick )
71  EVT_UPDATE_UI( ID_SNAPALL, a2dSnapSettings::OnSnapallUpdate )
72 
73  EVT_CHECKBOX( ID_VisibleOnly, a2dSnapSettings::OnVisibleonlyClick )
74  EVT_UPDATE_UI( ID_VisibleOnly, a2dSnapSettings::OnVisibleonlyUpdate )
75 
76  EVT_CHECKBOX( ID_POS_X, a2dSnapSettings::OnPosXClick )
77  EVT_UPDATE_UI( ID_POS_X, a2dSnapSettings::OnPosXUpdate )
78 
79  EVT_CHECKBOX( ID_POS_Y, a2dSnapSettings::OnPosYClick )
80  EVT_UPDATE_UI( ID_POS_Y, a2dSnapSettings::OnPosYUpdate )
81 
82  EVT_CHECKBOX( ID_POS_PIN, a2dSnapSettings::OnPosPinClick )
83  EVT_UPDATE_UI( ID_POS_PIN, a2dSnapSettings::OnPosPinUpdate )
84 
85  EVT_CHECKBOX( ID_POS_PIN_UNCONN, a2dSnapSettings::OnPosPinUnconnClick )
86  EVT_UPDATE_UI( ID_POS_PIN_UNCONN, a2dSnapSettings::OnPosPinUnconnUpdate )
87 
88  EVT_CHECKBOX( ID_BBOXVERTEXES, a2dSnapSettings::OnBboxvertexesClick )
89  EVT_UPDATE_UI( ID_BBOXVERTEXES, a2dSnapSettings::OnBboxvertexesUpdate )
90 
91  EVT_CHECKBOX( ID_VERTEXES, a2dSnapSettings::OnVertexesClick )
92  EVT_UPDATE_UI( ID_VERTEXES, a2dSnapSettings::OnVertexesUpdate )
93 
94  EVT_CHECKBOX( ID_POS_X_OBJ, a2dSnapSettings::OnPosXObjClick )
95  EVT_UPDATE_UI( ID_POS_X_OBJ, a2dSnapSettings::OnPosXObjUpdate )
96 
97  EVT_CHECKBOX( ID_POS_Y_OBJ, a2dSnapSettings::OnPosYObjClick )
98  EVT_UPDATE_UI( ID_POS_Y_OBJ, a2dSnapSettings::OnPosYObjUpdate )
99 
100  EVT_CHECKBOX( ID_POS_POINT_X, a2dSnapSettings::OnPosPointXClick )
101  EVT_UPDATE_UI( ID_POS_POINT_X, a2dSnapSettings::OnPosPointXUpdate )
102 
103  EVT_CHECKBOX( ID_POS_POINT_Y, a2dSnapSettings::OnPosPointYClick )
104  EVT_UPDATE_UI( ID_POS_POINT_Y, a2dSnapSettings::OnPosPointYUpdate )
105 
106  EVT_CHECKBOX( ID_POS_POINT_XY, a2dSnapSettings::OnPosPointXyClick )
107  EVT_UPDATE_UI( ID_POS_POINT_XY, a2dSnapSettings::OnPosPointXyUpdate )
108 
109  EVT_TEXT_ENTER( ID_SnapGrid_X, a2dSnapSettings::OnSnapgridXEnter )
110  EVT_UPDATE_UI( ID_SnapGrid_X, a2dSnapSettings::OnSnapgridXUpdate )
111 
112  EVT_TEXT_ENTER( ID_SnapGrid_Y, a2dSnapSettings::OnSnapgridYEnter )
113  EVT_UPDATE_UI( ID_SnapGrid_Y, a2dSnapSettings::OnSnapgridYUpdate )
114 
115  EVT_TEXT_ENTER( ID_SnapOrigin_X, a2dSnapSettings::OnSnaporiginXEnter )
116  EVT_UPDATE_UI( ID_SnapOrigin_X, a2dSnapSettings::OnSnaporiginXUpdate )
117 
118  EVT_TEXT_ENTER( ID_SnapOrigin_Y, a2dSnapSettings::OnSnaporiginYEnter )
119  EVT_UPDATE_UI( ID_SnapOrigin_Y, a2dSnapSettings::OnSnaporiginYUpdate )
120 
121  EVT_TEXT_ENTER( ID_RotSnapAngle, a2dSnapSettings::OnRotsnapangleEnter )
122  EVT_UPDATE_UI( ID_RotSnapAngle, a2dSnapSettings::OnRotsnapangleUpdate )
123 
124  EVT_TEXT_ENTER( ID_SnapThreshold, a2dSnapSettings::OnSnapthresholdEnter )
125  EVT_UPDATE_UI( ID_SnapThreshold, a2dSnapSettings::OnSnapthresholdUpdate )
126 
127  EVT_TEXT_ENTER( ID_snapPointX, a2dSnapSettings::OnSnappointxEnter )
128  EVT_UPDATE_UI( ID_snapPointX, a2dSnapSettings::OnSnappointxUpdate )
129 
130  EVT_TEXT_ENTER( ID_snapPointY, a2dSnapSettings::OnSnappointyEnter )
131  EVT_UPDATE_UI( ID_snapPointY, a2dSnapSettings::OnSnappointyUpdate )
132 
133 END_EVENT_TABLE()
134 
135 /*!
136  * a2dSnapSettings constructors
137  */
138 
139 a2dSnapSettings::a2dSnapSettings( )
140 {
141 }
142 
143 a2dSnapSettings::a2dSnapSettings( a2dHabitat* habitat, wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
144 {
145  m_habitat = habitat;
146  m_restrict = m_habitat->GetRestrictionEngine();
147  wxASSERT_MSG( m_restrict, _( "a2dSnapSettings needs a m_habitat->GetRestrictionEngine() set" ) );
148 
149  Create( parent, id, caption, pos, size, style );
150 }
151 
152 /*!
153  * a2dSnapSettings creator
154  */
155 
156 bool a2dSnapSettings::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
157 {
158  m_snapEnabled = NULL;
159  m_visibleOnly = NULL;
160  m_gridX = NULL;
161  m_gridY = NULL;
162  m_pins = NULL;
163  m_pinsConn = NULL;
164  m_vertexes = NULL;
165  m_objPosX = NULL;
166  m_objPosY = NULL;
167  m_pointPosX = NULL;
168  m_pointPosY = NULL;
169  m_pointPosXY = NULL;
170  m_gridDistX = NULL;
171  m_gridDistY = NULL;
172  m_orgX = NULL;
173  m_orgY = NULL;
174  m_rotation = NULL;
175  m_threshold = NULL;
176  m_snapPointX = NULL;
177  m_snapPointY = NULL;
178 
179  SetExtraStyle( GetExtraStyle() | wxWS_EX_BLOCK_EVENTS );
180  wxDialog::Create( parent, id, caption, pos, size, style );
181 
182  CreateControls();
183  GetSizer()->Fit( this );
184  GetSizer()->SetSizeHints( this );
185  Centre();
186 
187  return TRUE;
188 }
189 
191 {
192 ////@begin a2dSnapSettings content construction
193 
194  a2dSnapSettings* itemDialog1 = this;
195 
196  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL );
197  itemDialog1->SetSizer( itemBoxSizer2 );
198 
199  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL );
200  itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 1 );
201 
202  m_snapEnabled = new wxCheckBox( itemDialog1, ID_SNAPALL, _( "Enable snapping" ), wxDefaultPosition, wxDefaultSize, 0 );
203  m_snapEnabled->SetValue( TRUE );
204  m_snapEnabled->SetHelpText( _( "To enable/disable all snapping " ) );
205  if ( ShowToolTips() )
206  m_snapEnabled->SetToolTip( _( "To enable/disable all snapping" ) );
207  itemBoxSizer3->Add( m_snapEnabled, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1 );
208 
209  m_visibleOnly = new wxCheckBox( itemDialog1, ID_VisibleOnly, _( "Vissible Only" ), wxDefaultPosition, wxDefaultSize, 0 );
210  m_visibleOnly->SetValue( FALSE );
211  itemBoxSizer3->Add( m_visibleOnly, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1 );
212 
213  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer( wxHORIZONTAL );
214  itemBoxSizer2->Add( itemBoxSizer6, 1, wxGROW | wxALL/* wxWidgets 2.9 deprecated version |wxADJUST_MINISIZE*/, 1 );
215 
216  wxBoxSizer* itemBoxSizer7 = new wxBoxSizer( wxVERTICAL );
217  itemBoxSizer6->Add( itemBoxSizer7, 0, wxALIGN_TOP | wxALL/* wxWidgets 2.9 deprecated version |wxADJUST_MINISIZE*/, 1 );
218 
219  m_gridX = new wxCheckBox( itemDialog1, ID_POS_X, _( "Snap Grid X" ), wxDefaultPosition, wxDefaultSize, 0 );
220  m_gridX->SetValue( FALSE );
221  m_gridX->SetHelpText( _( "Snap to canvas grid in Y" ) );
222  if ( ShowToolTips() )
223  m_gridX->SetToolTip( _( "Snap to canvas grid in Y" ) );
224  itemBoxSizer7->Add( m_gridX, 0, wxALIGN_LEFT | wxALL, 5 );
225 
226  m_gridY = new wxCheckBox( itemDialog1, ID_POS_Y, _( "Snap Grid Y" ), wxDefaultPosition, wxDefaultSize, 0 );
227  m_gridY->SetValue( FALSE );
228  m_gridY->SetHelpText( _( "Snap to canvas grid in Y" ) );
229  if ( ShowToolTips() )
230  m_gridY->SetToolTip( _( "Snap to canvas grid in Y" ) );
231  itemBoxSizer7->Add( m_gridY, 0, wxALIGN_LEFT | wxALL, 5 );
232 
233  m_pins = new wxCheckBox( itemDialog1, ID_POS_PIN, _( "Position Pin" ), wxDefaultPosition, wxDefaultSize, 0 );
234  m_pins->SetValue( FALSE );
235  m_pins->SetHelpText( _( "Snap to pins in a canvas object" ) );
236  if ( ShowToolTips() )
237  m_pins->SetToolTip( _( "Snap to pins in a canvas object" ) );
238  itemBoxSizer7->Add( m_pins, 0, wxALIGN_LEFT | wxALL, 5 );
239 
240  m_pinsConn = new wxCheckBox( itemDialog1, ID_POS_PIN_UNCONN, _( "Position Pin Uncon." ), wxDefaultPosition, wxDefaultSize, 0 );
241  m_pinsConn->SetValue( FALSE );
242  m_pinsConn->SetHelpText( _( "Snap to unconnected pins in a canvas object" ) );
243  if ( ShowToolTips() )
244  m_pinsConn->SetToolTip( _( "Snap to unconnected pins in a canvas object" ) );
245  itemBoxSizer7->Add( m_pinsConn, 0, wxALIGN_LEFT | wxALL, 5 );
246 
247  m_bboxvertexes = new wxCheckBox( itemDialog1, ID_BBOXVERTEXES, _( "Object Bbox" ), wxDefaultPosition, wxDefaultSize, 0 );
248  m_bboxvertexes->SetValue( FALSE );
249  itemBoxSizer7->Add( m_bboxvertexes, 0, wxALIGN_LEFT | wxALL, 5 );
250 
251  m_vertexes = new wxCheckBox( itemDialog1, ID_VERTEXES, _( "Object Vertexes " ), wxDefaultPosition, wxDefaultSize, 0 );
252  m_vertexes->SetValue( FALSE );
253  m_vertexes->SetHelpText( _( "Snap to the canvas object vector path vertexes" ) );
254  if ( ShowToolTips() )
255  m_vertexes->SetToolTip( _( "Snap to the canvas object vector path vertexes" ) );
256  itemBoxSizer7->Add( m_vertexes, 0, wxALIGN_LEFT | wxALL, 5 );
257 
258  m_objPosX = new wxCheckBox( itemDialog1, ID_POS_X_OBJ, _( "Object Pos X" ), wxDefaultPosition, wxDefaultSize, 0 );
259  m_objPosX->SetValue( FALSE );
260  m_objPosX->SetHelpText( _( "Snap to the canvas object position in X" ) );
261  if ( ShowToolTips() )
262  m_objPosX->SetToolTip( _( "Snap to the canvas object position in X" ) );
263  itemBoxSizer7->Add( m_objPosX, 0, wxALIGN_LEFT | wxALL, 5 );
264 
265  m_objPosY = new wxCheckBox( itemDialog1, ID_POS_Y_OBJ, _( "Object Pos Y" ), wxDefaultPosition, wxDefaultSize, 0 );
266  m_objPosY->SetValue( FALSE );
267  m_objPosY->SetHelpText( _( "Snap to the canvas object position in Y" ) );
268  if ( ShowToolTips() )
269  m_objPosY->SetToolTip( _( "Snap to the canvas object position in Y" ) );
270  itemBoxSizer7->Add( m_objPosY, 0, wxALIGN_LEFT | wxALL, 5 );
271 
272  m_pointPosX = new wxCheckBox( itemDialog1, ID_POS_POINT_X, _( "Snap Point X" ), wxDefaultPosition, wxDefaultSize, 0 );
273  m_pointPosX->SetValue( FALSE );
274  m_pointPosX->SetHelpText( _( "Snap to the snap point in Y" ) );
275  if ( ShowToolTips() )
276  m_pointPosX->SetToolTip( _( "Snap to the snap point in Y" ) );
277  itemBoxSizer7->Add( m_pointPosX, 0, wxALIGN_LEFT | wxALL, 5 );
278 
279  m_pointPosY = new wxCheckBox( itemDialog1, ID_POS_POINT_Y, _( "Snap Point Y" ), wxDefaultPosition, wxDefaultSize, 0 );
280  m_pointPosY->SetValue( FALSE );
281  m_pointPosY->SetHelpText( _( "Snap to the snap point in Y" ) );
282  if ( ShowToolTips() )
283  m_pointPosY->SetToolTip( _( "Snap to the snap point in Y" ) );
284  itemBoxSizer7->Add( m_pointPosY, 0, wxALIGN_LEFT | wxALL, 5 );
285 
286  m_pointPosXY = new wxCheckBox( itemDialog1, ID_POS_POINT_XY, _( "Snap Point X,Y" ), wxDefaultPosition, wxDefaultSize, 0 );
287  m_pointPosXY->SetValue( FALSE );
288  m_pointPosXY->SetHelpText( _( "Snap to the snap point in X and Y" ) );
289  if ( ShowToolTips() )
290  m_pointPosXY->SetToolTip( _( "Snap to the snap point in X and Y" ) );
291  itemBoxSizer7->Add( m_pointPosXY, 0, wxALIGN_LEFT | wxALL, 5 );
292 
293  wxBoxSizer* itemBoxSizer19 = new wxBoxSizer( wxVERTICAL );
294  itemBoxSizer6->Add( itemBoxSizer19, 2, wxALIGN_TOP | wxALL/* wxWidgets 2.9 deprecated version |wxADJUST_MINISIZE*/, 1 );
295 
296  wxBoxSizer* itemBoxSizer20 = new wxBoxSizer( wxHORIZONTAL );
297  itemBoxSizer19->Add( itemBoxSizer20, 0, wxGROW | wxALL, 1 );
298 
299  wxStaticText* itemStaticText21 = new wxStaticText( itemDialog1, wxID_STATIC, _( "Snap Grid" ), wxDefaultPosition, wxDefaultSize, 0 );
300  itemStaticText21->SetHelpText( _( "Canvas grid distance in X and Y" ) );
301  if ( ShowToolTips() )
302  itemStaticText21->SetToolTip( _( "Canvas grid distance in X and Y" ) );
303  itemBoxSizer20->Add( itemStaticText21, 0, wxALIGN_CENTER_VERTICAL | wxALL/* wxWidgets 2.9 deprecated version |wxADJUST_MINISIZE*/, 5 );
304 
305  m_gridDistX = new wxTextCtrl( itemDialog1, ID_SnapGrid_X, _T( "" ), wxDefaultPosition, wxSize( 50, -1 ), wxTE_PROCESS_ENTER );
306  itemBoxSizer20->Add( m_gridDistX, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
307 
308  m_gridDistY = new wxTextCtrl( itemDialog1, ID_SnapGrid_Y, _T( "" ), wxDefaultPosition, wxSize( 50, -1 ), wxTE_PROCESS_ENTER );
309  itemBoxSizer20->Add( m_gridDistY, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
310 
311  wxBoxSizer* itemBoxSizer24 = new wxBoxSizer( wxHORIZONTAL );
312  itemBoxSizer19->Add( itemBoxSizer24, 0, wxGROW | wxALL, 1 );
313 
314  wxStaticText* itemStaticText25 = new wxStaticText( itemDialog1, wxID_STATIC, _( "Snap Origin" ), wxDefaultPosition, wxDefaultSize, 0 );
315  itemStaticText25->SetHelpText( _( "Canvas grid origin in X and Y" ) );
316  if ( ShowToolTips() )
317  itemStaticText25->SetToolTip( _( "Canvas grid origin in X and Y" ) );
318  itemBoxSizer24->Add( itemStaticText25, 0, wxALIGN_CENTER_VERTICAL | wxALL/* wxWidgets 2.9 deprecated version |wxADJUST_MINISIZE*/, 5 );
319 
320  m_orgX = new wxTextCtrl( itemDialog1, ID_SnapOrigin_X, _T( "" ), wxDefaultPosition, wxSize( 50, -1 ), wxTE_PROCESS_ENTER );
321  itemBoxSizer24->Add( m_orgX, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
322 
323  m_orgY = new wxTextCtrl( itemDialog1, ID_SnapOrigin_Y, _T( "" ), wxDefaultPosition, wxSize( 50, -1 ), wxTE_PROCESS_ENTER );
324  itemBoxSizer24->Add( m_orgY, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
325 
326  wxBoxSizer* itemBoxSizer28 = new wxBoxSizer( wxHORIZONTAL );
327  itemBoxSizer19->Add( itemBoxSizer28, 0, wxGROW | wxALL, 1 );
328 
329  wxStaticText* itemStaticText29 = new wxStaticText( itemDialog1, wxID_STATIC, _( "Rotation Angle snap" ), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
330  itemStaticText29->SetHelpText( _( "steps in which rotation can snap" ) );
331  if ( ShowToolTips() )
332  itemStaticText29->SetToolTip( _( "steps in which rotation can snap" ) );
333  itemBoxSizer28->Add( itemStaticText29, 0, wxALIGN_CENTER_VERTICAL | wxALL/* wxWidgets 2.9 deprecated version |wxADJUST_MINISIZE*/, 5 );
334 
335  m_rotation = new wxTextCtrl( itemDialog1, ID_RotSnapAngle, _T( "" ), wxDefaultPosition, wxSize( 50, -1 ), wxTE_PROCESS_ENTER );
336  itemBoxSizer28->Add( m_rotation, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
337 
338  wxBoxSizer* itemBoxSizer31 = new wxBoxSizer( wxHORIZONTAL );
339  itemBoxSizer19->Add( itemBoxSizer31, 0, wxGROW | wxALL, 1 );
340 
341  wxStaticText* itemStaticText32 = new wxStaticText( itemDialog1, wxID_STATIC, _( "Snap Threshold" ), wxDefaultPosition, wxDefaultSize, 0 );
342  itemBoxSizer31->Add( itemStaticText32, 0, wxALIGN_CENTER_VERTICAL | wxALL/* wxWidgets 2.9 deprecated version |wxADJUST_MINISIZE*/, 5 );
343 
344  m_threshold = new wxTextCtrl( itemDialog1, ID_SnapThreshold, _T( "" ), wxDefaultPosition, wxSize( 50, -1 ), wxTE_PROCESS_ENTER );
345  itemBoxSizer31->Add( m_threshold, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
346 
347  wxBoxSizer* itemBoxSizer34 = new wxBoxSizer( wxHORIZONTAL );
348  itemBoxSizer19->Add( itemBoxSizer34, 0, wxGROW | wxALL, 1 );
349 
350  wxStaticText* itemStaticText35 = new wxStaticText( itemDialog1, wxID_STATIC, _( "Snap Point" ), wxDefaultPosition, wxDefaultSize, 0 );
351  itemBoxSizer34->Add( itemStaticText35, 0, wxALL/* wxWidgets 2.9 deprecated version |wxADJUST_MINISIZE*/, 5 );
352 
353  m_snapPointX = new wxTextCtrl( itemDialog1, ID_snapPointX, _T( "" ), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
354  itemBoxSizer34->Add( m_snapPointX, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
355 
356  m_snapPointY = new wxTextCtrl( itemDialog1, ID_snapPointY, _T( "" ), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
357  itemBoxSizer34->Add( m_snapPointY, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
358 
359 ////@end a2dSnapSettings content construction
360 }
361 
362 /*!
363  * wxEVT_CLOSE_WINDOW event handler for ID_DIALOG
364  */
365 
366 void a2dSnapSettings::OnCloseWindow( wxCloseEvent& event )
367 {
368  event.Skip();
369 }
370 
371 /*!
372  * wxEVT_IDLE event handler for ID_DIALOG
373  */
374 
375 void a2dSnapSettings::OnIdle( wxIdleEvent& event )
376 {
377  event.Skip();
378 }
379 
380 /*!
381  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_SNAPALL
382  */
383 
384 void a2dSnapSettings::OnSnapallClick( wxCommandEvent& event )
385 {
386  m_restrict->SetSnap( m_snapEnabled->IsChecked() );
387 }
388 
389 /*!
390  * wxEVT_UPDATE_UI event handler for ID_SNAPALL
391  */
392 
393 void a2dSnapSettings::OnSnapallUpdate( wxUpdateUIEvent& event )
394 {
395  m_snapEnabled->SetValue( m_restrict->GetSnap() );
396 }
397 
398 /*!
399  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_VisibleOnly
400  */
401 
402 void a2dSnapSettings::OnVisibleonlyClick( wxCommandEvent& event )
403 {
404  //a2dCommand_SetProperty* command = new a2dCommand_SetProperty( m_restrict, a2dRestrictionEngine::PROPID_SnapOnlyVisbleObjects, m_visibleOnly->IsChecked() );
405  //a2dGetCmdh()->Submit( command );
406  m_restrict->SetSnapOnlyVisibleObjects( m_visibleOnly->IsChecked() );
407 }
408 
409 /*!
410  * wxEVT_UPDATE_UI event handler for ID_VisibleOnly
411  */
412 
413 void a2dSnapSettings::OnVisibleonlyUpdate( wxUpdateUIEvent& event )
414 {
415  m_visibleOnly->SetValue( m_restrict->GetSnapOnlyVisibleObjects() );
416 }
417 
418 /*!
419  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_X
420  */
421 
422 void a2dSnapSettings::OnPosXClick( wxCommandEvent& event )
423 {
424  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToGridPosX, m_gridX->GetValue() );
425  //m_restrict->SetSnapTargetFeatures( featureOn );
426 }
427 
428 /*!
429  * wxEVT_UPDATE_UI event handler for ID_POS_X
430  */
431 
432 void a2dSnapSettings::OnPosXUpdate( wxUpdateUIEvent& event )
433 {
434  m_gridX->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToGridPosX ) );
435 }
436 
437 /*!
438  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_Y
439  */
440 
441 void a2dSnapSettings::OnPosYClick( wxCommandEvent& event )
442 {
443  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToGridPosY, m_gridY->GetValue() );
444  //m_restrict->SetSnapTargetFeatures( featureOn );
445 }
446 
447 /*!
448  * wxEVT_UPDATE_UI event handler for ID_POS_Y
449  */
450 
451 void a2dSnapSettings::OnPosYUpdate( wxUpdateUIEvent& event )
452 {
453  m_gridY->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToGridPosY ) );
454 }
455 
456 /*!
457  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_PIN
458  */
459 
460 void a2dSnapSettings::OnPosPinClick( wxCommandEvent& event )
461 {
462  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToPins, m_pins->GetValue() );
463  //m_restrict->SetSnapTargetFeatures( featureOn );
464 }
465 
466 /*!
467  * wxEVT_UPDATE_UI event handler for ID_POS_PIN
468  */
469 
470 void a2dSnapSettings::OnPosPinUpdate( wxUpdateUIEvent& event )
471 {
472  m_pins->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToPins ) );
473 }
474 
475 /*!
476  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_PIN_UNCONN
477  */
478 
479 void a2dSnapSettings::OnPosPinUnconnClick( wxCommandEvent& event )
480 {
481  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToPinsUnconnected, m_pinsConn->GetValue() );
482  //m_restrict->SetSnapTargetFeatures( featureOn );
483 }
484 
485 /*!
486  * wxEVT_UPDATE_UI event handler for ID_POS_PIN_UNCONN
487  */
488 
489 void a2dSnapSettings::OnPosPinUnconnUpdate( wxUpdateUIEvent& event )
490 {
491  m_pinsConn->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToPinsUnconnected ) );
492 }
493 
494 /*!
495  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_VERTEXES
496  */
497 
498 void a2dSnapSettings::OnVertexesClick( wxCommandEvent& event )
499 {
500  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToObjectVertexes, m_vertexes->GetValue() );
501  //m_restrict->SetSnapTargetFeatures( featureOn );
502 }
503 
504 /*!
505  * wxEVT_UPDATE_UI event handler for ID_VERTEXES
506  */
507 
508 void a2dSnapSettings::OnVertexesUpdate( wxUpdateUIEvent& event )
509 {
510  m_vertexes->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToObjectVertexes ) );
511 }
512 
513 /*!
514  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_BBOXVERTEXES
515  */
516 
517 void a2dSnapSettings::OnBboxvertexesClick( wxCommandEvent& event )
518 {
519  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToBoundingBox, m_bboxvertexes->GetValue() );
520  //m_restrict->SetSnapTargetFeatures( featureOn );
521 }
522 
523 /*!
524  * wxEVT_UPDATE_UI event handler for ID_BBOXVERTEXES
525  */
526 
527 void a2dSnapSettings::OnBboxvertexesUpdate( wxUpdateUIEvent& event )
528 {
529  m_bboxvertexes->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToBoundingBox ) );
530 }
531 
532 /*!
533  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_X_OBJ
534  */
535 
536 void a2dSnapSettings::OnPosXObjClick( wxCommandEvent& event )
537 {
538  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToObjectPosX, m_objPosX->GetValue() );
539  //m_restrict->SetSnapTargetFeatures( featureOn );
540 }
541 
542 /*!
543  * wxEVT_UPDATE_UI event handler for ID_POS_X_OBJ
544  */
545 
546 void a2dSnapSettings::OnPosXObjUpdate( wxUpdateUIEvent& event )
547 {
548  m_objPosX->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToObjectPosX ) );
549 }
550 
551 /*!
552  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_Y_OBJ
553  */
554 
555 void a2dSnapSettings::OnPosYObjClick( wxCommandEvent& event )
556 {
557  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToObjectPosY, m_objPosY->GetValue() );
558  //m_restrict->SetSnapTargetFeatures( featureOn );
559 }
560 
561 /*!
562  * wxEVT_UPDATE_UI event handler for ID_POS_Y_OBJ
563  */
564 
565 void a2dSnapSettings::OnPosYObjUpdate( wxUpdateUIEvent& event )
566 {
567  m_objPosY->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToObjectPosY ) );
568 }
569 
570 /*!
571  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_POINT_X
572  */
573 
574 void a2dSnapSettings::OnPosPointXClick( wxCommandEvent& event )
575 {
576  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToPointPosX, m_pointPosX->GetValue() );
577  //m_restrict->SetSnapTargetFeatures( featureOn );
578 }
579 
580 /*!
581  * wxEVT_UPDATE_UI event handler for ID_POS_POINT_X
582  */
583 
584 void a2dSnapSettings::OnPosPointXUpdate( wxUpdateUIEvent& event )
585 {
586  m_pointPosX->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToPointPosX ) );
587 }
588 
589 /*!
590  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_POINT_Y
591  */
592 
593 void a2dSnapSettings::OnPosPointYClick( wxCommandEvent& event )
594 {
595  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToPointPosY, m_pointPosY->GetValue() );
596  //m_restrict->SetSnapTargetFeatures( featureOn );
597 }
598 
599 /*!
600  * wxEVT_UPDATE_UI event handler for ID_POS_POINT_Y
601  */
602 
603 void a2dSnapSettings::OnPosPointYUpdate( wxUpdateUIEvent& event )
604 {
605  m_pointPosY->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToPointPosY ) );
606 }
607 
608 /*!
609  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_POINT_XY
610  */
611 
612 void a2dSnapSettings::OnPosPointXyClick( wxCommandEvent& event )
613 {
614  m_restrict->SetSnapTargetFeature( a2dRestrictionEngine::snapToPointPosXorYForce, m_pointPosXY->GetValue() );
615  //m_restrict->SetSnapTargetFeatures( featureOn );
616 }
617 
618 /*!
619  * wxEVT_UPDATE_UI event handler for ID_POS_POINT_XY
620  */
621 
622 void a2dSnapSettings::OnPosPointXyUpdate( wxUpdateUIEvent& event )
623 {
624  m_pointPosXY->SetValue( m_restrict->GetSnapTargetFeature( a2dRestrictionEngine::snapToPointPosXorYForce ) );
625 }
626 
627 /*!
628  * wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapGrid_X
629  */
630 
631 void a2dSnapSettings::OnSnapgridXEnter( wxCommandEvent& event )
632 {
633  a2dDoMu dx;
634  dx.Eval( m_gridDistX->GetValue() );
635  a2dDoMu dy;
636  dy.Eval( m_gridDistY->GetValue() );
637  m_restrict->SetSnapGrid( dx, dy );
638 }
639 
640 /*!
641  * wxEVT_UPDATE_UI event handler for ID_SnapGrid_X
642  */
643 
644 void a2dSnapSettings::OnSnapgridXUpdate( wxUpdateUIEvent& event )
645 {
646  if ( FindFocus() != m_gridDistX )
647  m_gridDistX->SetValue( m_restrict->GetSnapGridX().GetValueString() );
648 }
649 
650 /*!
651  * wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapGrid_Y
652  */
653 
654 void a2dSnapSettings::OnSnapgridYEnter( wxCommandEvent& event )
655 {
656  a2dDoMu dx;
657  dx.Eval( m_gridDistX->GetValue() );
658  a2dDoMu dy;
659  dy.Eval( m_gridDistY->GetValue() );
660  m_restrict->SetSnapGrid( dx, dy );
661 }
662 
663 /*!
664  * wxEVT_UPDATE_UI event handler for ID_SnapGrid_Y
665  */
666 
667 void a2dSnapSettings::OnSnapgridYUpdate( wxUpdateUIEvent& event )
668 {
669  if ( FindFocus() != m_gridDistY )
670  m_gridDistY->SetValue( m_restrict->GetSnapGridY().GetValueString() );
671 }
672 
673 /*!
674  * wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapOrigin_X
675  */
676 
677 void a2dSnapSettings::OnSnaporiginXEnter( wxCommandEvent& event )
678 {
679  double dx, dy;
680  m_orgX->GetValue().ToDouble( &dx );
681  m_orgY->GetValue().ToDouble( &dy );
682  m_restrict->SetSnapOrigin( dx, dy );
683 }
684 
685 /*!
686  * wxEVT_UPDATE_UI event handler for ID_SnapOrigin_X
687  */
688 
689 void a2dSnapSettings::OnSnaporiginXUpdate( wxUpdateUIEvent& event )
690 {
691  if ( FindFocus() != m_orgX )
692  m_orgX->SetValue( m_restrict->GetSnapOriginX().GetValueString() );
693 }
694 
695 /*!
696  * wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapOrigin_Y
697  */
698 
699 void a2dSnapSettings::OnSnaporiginYEnter( wxCommandEvent& event )
700 {
701  double dx, dy;
702  m_orgX->GetValue().ToDouble( &dx );
703  m_orgY->GetValue().ToDouble( &dy );
704  m_restrict->SetSnapOrigin( dx, dy );
705 }
706 
707 /*!
708  * wxEVT_UPDATE_UI event handler for ID_SnapOrigin_Y
709  */
710 
711 void a2dSnapSettings::OnSnaporiginYUpdate( wxUpdateUIEvent& event )
712 {
713  if ( FindFocus() != m_orgY )
714  m_orgY->SetValue( m_restrict->GetSnapOriginY().GetValueString() );
715 }
716 
717 /*!
718  * wxEVT_COMMAND_TEXT_ENTER event handler for ID_RotSnapAngle
719  */
720 
721 void a2dSnapSettings::OnRotsnapangleEnter( wxCommandEvent& event )
722 {
723  double ang;
724  m_orgY->GetValue().ToDouble( &ang );
725  m_restrict->SetRotationAngle( ang );
726 }
727 
728 /*!
729  * wxEVT_UPDATE_UI event handler for ID_RotSnapAngle
730  */
731 
732 void a2dSnapSettings::OnRotsnapangleUpdate( wxUpdateUIEvent& event )
733 {
734  wxString buf;
735  buf.Printf( wxT( "%f" ), m_restrict->GetRotationAngle() );
736  if ( FindFocus() != m_rotation )
737  m_rotation->SetValue( buf );
738 }
739 
740 /*!
741  * wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapThreshold
742  */
743 
744 void a2dSnapSettings::OnSnapthresholdEnter( wxCommandEvent& event )
745 {
746  long ang;
747  m_threshold->GetValue().ToLong( &ang );
748  m_restrict->SetSnapThresHold( ang );
749 }
750 
751 /*!
752  * wxEVT_UPDATE_UI event handler for ID_SnapThreshold
753  */
754 
755 void a2dSnapSettings::OnSnapthresholdUpdate( wxUpdateUIEvent& event )
756 {
757  wxString buf;
758  buf.Printf( wxT( "%d" ), m_restrict->GetSnapThresHold() );
759  if ( FindFocus() != m_threshold )
760  m_threshold->SetValue( buf );
761 }
762 
763 
764 void a2dSnapSettings::OnSnappointyEnter( wxCommandEvent& event )
765 {
766  double dx, dy;
767  m_snapPointX->GetValue().ToDouble( &dx );
768  m_snapPointY->GetValue().ToDouble( &dy );
769  m_restrict->SetRestrictPoint( dx, dy );
770 }
771 
772 /*!
773  * wxEVT_UPDATE_UI event handler for ID_TEXTCTRL1
774  */
775 
776 void a2dSnapSettings::OnSnappointyUpdate( wxUpdateUIEvent& event )
777 {
778  wxString buf;
779  buf.Printf( wxT( "%f" ), m_restrict->GetRestrictPoint().m_y );
780  if ( FindFocus() != m_snapPointY )
781  m_snapPointY->SetValue( buf );
782 }
783 
784 
785 /*!
786  * wxEVT_COMMAND_TEXT_ENTER event handler for ID_snapPointX
787  */
788 
789 void a2dSnapSettings::OnSnappointxEnter( wxCommandEvent& event )
790 {
791  double dx, dy;
792  m_snapPointX->GetValue().ToDouble( &dx );
793  m_snapPointY->GetValue().ToDouble( &dy );
794  m_restrict->SetRestrictPoint( dx, dy );
795 }
796 
797 /*!
798  * wxEVT_UPDATE_UI event handler for ID_snapPointX
799  */
800 
801 void a2dSnapSettings::OnSnappointxUpdate( wxUpdateUIEvent& event )
802 {
803  wxString buf;
804  buf.Printf( wxT( "%f" ), m_restrict->GetRestrictPoint().m_x );
805  if ( FindFocus() != m_snapPointX )
806  m_snapPointX->SetValue( buf );
807 }
808 
809 /*!
810  * Should we show tooltips?
811  */
812 
814 {
815  return TRUE;
816 }
817 
818 /*!
819  * Get bitmap resources
820  */
821 
822 wxBitmap a2dSnapSettings::GetBitmapResource( const wxString& name )
823 {
824  // Bitmap retrieval
825 ////@begin a2dSnapSettings bitmap retrieval
826  return wxNullBitmap;
827 ////@end a2dSnapSettings bitmap retrieval
828 }
829 
830 /*!
831  * Get icon resources
832  */
833 
834 wxIcon a2dSnapSettings::GetIconResource( const wxString& name )
835 {
836  // Icon retrieval
837 ////@begin a2dSnapSettings icon retrieval
838  return wxNullIcon;
839 ////@end a2dSnapSettings icon retrieval
840 }
perform x position snapping to a specific point
Definition: restrict.h:127
perform snapping to boundingbox of objects
Definition: restrict.h:137
perform y position snapping to a specific point
Definition: restrict.h:128
void OnPosPinUnconnClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_PIN_UNCONN
Definition: snap.cpp:479
void OnSnappointyEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_snapPointY
Definition: snap.cpp:764
wxString GetValueString() const
get the number 1.1 um -> "1.1 um"
Definition: artglob.cpp:247
void OnBboxvertexesUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_BBOXVERTEXES
Definition: snap.cpp:527
void OnSnaporiginYUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_SnapOrigin_Y
Definition: snap.cpp:711
const a2dDoMu & GetSnapGridX() const
Get horizontal center snapping distance (zero if disabled)
Definition: restrict.h:153
void OnPosYClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_Y
Definition: snap.cpp:441
void OnPosYObjClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_Y_OBJ
Definition: snap.cpp:555
void OnPosPinUnconnUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_PIN_UNCONN
Definition: snap.cpp:489
void OnIdle(wxIdleEvent &event)
wxEVT_IDLE event handler for ID_SNAP
Definition: snap.cpp:375
void SetSnapGrid(const a2dDoMu &x, const a2dDoMu &y)
Set snapping grid (only position)
Definition: restrict.h:150
void OnSnaporiginYEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapOrigin_Y
Definition: snap.cpp:699
void OnPosPinUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_PIN
Definition: snap.cpp:470
void SetRotationAngle(double a)
Set rotation angle raster.
Definition: restrict.h:171
void OnVertexesClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_VERTEXES
Definition: snap.cpp:498
snap to pins in other objects when not connected
Definition: restrict.h:112
const a2dDoMu & GetSnapOriginX() const
Get snapping origin X (position grid offset/shift)
Definition: restrict.h:165
void OnSnaporiginXEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapOrigin_X
Definition: snap.cpp:677
void OnPosXClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_X
Definition: snap.cpp:422
void OnPosPinClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_PIN
Definition: snap.cpp:460
int GetSnapThresHold() const
used to snap vertexes to a pin or point like snapping features in objects.
Definition: restrict.h:177
void OnSnappointxEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_snapPointX
Definition: snap.cpp:789
void OnPosXObjClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_X_OBJ
Definition: snap.cpp:536
void SetSnapTargetFeature(a2dSnapToWhat snapTargetFeature, bool value=true)
set one of the snapping features for targets to true or false, leaf others as is
Definition: restrict.h:234
void OnBboxvertexesClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_BBOXVERTEXES
Definition: snap.cpp:517
void OnSnapgridXUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_SnapGrid_X
Definition: snap.cpp:644
perform x position snapping
Definition: restrict.h:104
store and convert number to number with unit and visa versa. e.g. 1.23e-6 => 1.23 * 1e-6 ...
Definition: artglob.h:208
void OnCloseWindow(wxCloseEvent &event)
wxEVT_CLOSE_WINDOW event handler for ID_SNAP
Definition: snap.cpp:366
void OnVertexesUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_VERTEXES
Definition: snap.cpp:508
void CreateControls()
Creates the controls and sizers.
Definition: snap.cpp:190
const a2dPoint2D & GetRestrictPoint() const
to ask engine for the restrict point
Definition: restrict.h:343
snap to other objects its vertexes, which are decided in a2dCanvasObject::RestrictToObject() ...
Definition: restrict.h:116
bool Eval(const wxString &param)
compose a unit based a string "1.1um"
Definition: artglob.cpp:408
void OnPosYObjUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_Y_OBJ
Definition: snap.cpp:565
void OnSnapallClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_SNAPALL
Definition: snap.cpp:384
void SetSnapOnlyVisibleObjects(bool snapOnlyVisbleObjects)
enable all snapping features for object only for visible object.
Definition: restrict.h:195
bool GetSnap() const
enable all snapping features or not
Definition: restrict.h:192
void OnPosPointXyUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_POINT_XY
Definition: snap.cpp:622
bool GetSnapTargetFeature(a2dSnapToWhat snapTargetFeature) const
return the setting of a specific snapping feature
Definition: restrict.h:242
void OnPosXObjUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_X_OBJ
Definition: snap.cpp:546
void OnSnapgridXEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapGrid_X
Definition: snap.cpp:631
void OnPosPointXyClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_POINT_XY
Definition: snap.cpp:612
defines common settinsg for a habitat for a set of a2dCameleons.
Definition: canglob.h:439
void OnVisibleonlyUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_VisibleOnly
Definition: snap.cpp:413
void OnSnaporiginXUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_SnapOrigin_X
Definition: snap.cpp:689
void SetSnapOrigin(const a2dDoMu &x, const a2dDoMu &y)
Set snapping origin (position grid offest/shift)
Definition: restrict.h:159
void OnPosPointXUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_POINT_X
Definition: snap.cpp:584
void OnPosPointYUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_POINT_Y
Definition: snap.cpp:603
static bool ShowToolTips()
Should we show tooltips?
Definition: snap.cpp:813
void OnRotsnapangleEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_RotSnapAngle
Definition: snap.cpp:721
bool Create(wxWindow *parent, wxWindowID id=SYMBOL_A2DSNAPSETTINGS_IDNAME, const wxString &caption=SYMBOL_A2DSNAPSETTINGS_TITLE, const wxPoint &pos=SYMBOL_A2DSNAPSETTINGS_POSITION, const wxSize &size=SYMBOL_A2DSNAPSETTINGS_SIZE, long style=SYMBOL_A2DSNAPSETTINGS_STYLE)
Creation.
Definition: snap.cpp:156
a2dRestrictionEngine * GetRestrictionEngine()
Get restriction engine (grid snapping)
Definition: canglob.cpp:934
bool GetSnapOnlyVisibleObjects() const
all snapping features for object only for visible object?
Definition: restrict.h:198
void OnPosXUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_X
Definition: snap.cpp:432
void OnSnappointyUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_snapPointY
Definition: snap.cpp:776
void OnSnappointxUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_snapPointX
Definition: snap.cpp:801
const a2dDoMu & GetSnapOriginY() const
Get snapping origin Y (position grid offset/shift)
Definition: restrict.h:168
void OnSnapgridYUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_SnapGrid_Y
Definition: snap.cpp:667
a2dSnapSettings()
Constructors.
Definition: snap.cpp:139
void OnPosPointXClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_POINT_X
Definition: snap.cpp:574
void OnSnapthresholdEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapThreshold
Definition: snap.cpp:744
perform x grid snapping
Definition: restrict.h:123
void OnSnapallUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_SNAPALL
Definition: snap.cpp:393
void OnVisibleonlyClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_VisibleOnly
Definition: snap.cpp:402
void SetSnapThresHold(int thresHold)
used to snap vertexes to a pin or point like snapping features in objects.
Definition: restrict.h:180
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
Definition: snap.cpp:834
void SetSnap(bool snap)
enable all snapping features or not
Definition: restrict.h:189
void OnSnapgridYEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_SnapGrid_Y
Definition: snap.cpp:654
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
Definition: snap.cpp:822
perform y position snapping
Definition: restrict.h:105
const a2dDoMu & GetSnapGridY() const
Get vertical center snapping distance (zero if disabled)
Definition: restrict.h:156
void OnPosPointYClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_POS_POINT_Y
Definition: snap.cpp:593
void OnPosYUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_POS_Y
Definition: snap.cpp:451
void SetRestrictPoint(double xSnap, double ySnap)
sets the point for snapping to
Definition: restrict.h:337
perform y grid snapping
Definition: restrict.h:124
void OnRotsnapangleUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_RotSnapAngle
Definition: snap.cpp:732
snap to pins in other objects
Definition: restrict.h:111
perform alligning to X or Y of a specific point
Definition: restrict.h:130
general canvas module declarations and classes
double GetRotationAngle() const
Get rotation angle raster.
Definition: restrict.h:174
void OnSnapthresholdUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_SnapThreshold
Definition: snap.cpp:755
snap.cpp Source File -- Sun Oct 12 2014 17:04:24 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation