wxArt2D
canorderdlg.cpp
Go to the documentation of this file.
1 /*! \file canvas/src/canorderdlg.cpp
2  \author Klaas Holwerda
3 
4  Copyright: 2000-2004 (c) Klaas Holwerda
5 
6  Licence: wxWidgets Licence
7 
8  RCS-ID: $Id: canorderdlg.cpp,v 1.8 2009/10/01 19:22:35 titato Exp $
9 */
10 
11 #include "a2dprec.h"
12 
13 #ifdef __BORLANDC__
14 #pragma hdrstop
15 #endif
16 
17 #ifdef __GNUG__
18 #pragma implementation
19 #endif
20 
21 #include "wx/canvas/canmod.h"
22 #include "wx/canvas/layerinf.h"
23 
24 #include "wx/canvas/canorderdlg.h"
25 
26 const int ORDER_LIST_SELECT = wxID_HIGHEST + 5108 ;
27 
28 BEGIN_EVENT_TABLE( a2dDragListBox, wxListBox )
29  EVT_LISTBOX( ORDER_LIST_SELECT, a2dDragListBox::CmListBox )
30  EVT_LEFT_DOWN( a2dDragListBox::OnMouseLeftDown )
31  EVT_LEFT_UP( a2dDragListBox::OnMouseLeftUp )
32 END_EVENT_TABLE()
33 
34 a2dDragListBox::a2dDragListBox( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
35  int n, const wxString choices[], long style )
36  : wxListBox ( parent, id, pos, size, n, choices, style )
37 {
38  m_selection = 0;
39 }
40 
41 void a2dDragListBox::OnMouseLeftDown( class wxMouseEvent& event )
42 {
43  wxPoint point = wxPoint( event.m_x, event.m_y );
44  m_selection = HitTest( point );
45 
46  event.Skip();
47 }
48 
49 void a2dDragListBox::OnMouseLeftUp( class wxMouseEvent& event )
50 {
51  int pasteLoc = GetSelection();
52  if ( m_selection != -1 && m_selection != pasteLoc )
53  {
54  if ( m_selection < pasteLoc )
55  {
56  int row;
57  for ( row = m_selection; row < pasteLoc; row++ )
58  {
59  wxString selectLocStr = GetString( row );
60  wxString copyLocStr = GetString( row + 1 );
61 
62  SetString( row, copyLocStr );
63  SetString( row + 1, selectLocStr );
64  }
65 
66  }
67  else
68  {
69  int row;
70  for ( row = m_selection; row > pasteLoc; row-- )
71  {
72  wxString selectLocStr = GetString( row );
73  wxString copyLocStr = GetString( row - 1 );
74 
75  SetString( row, copyLocStr );
76  SetString( row - 1, selectLocStr );
77  }
78 
79  }
80  }
81  event.Skip();
82 }
83 
84 void a2dDragListBox::CmListBox( wxCommandEvent& selevent )
85 {
86  m_selection = GetSelection();
87  selevent.Skip();
88 }
89 
90 
91 const int ORDER_BUTTON_OK = wxID_HIGHEST + 5101 ;
92 const int ORDER_BUTTON_CANCEL = wxID_HIGHEST + 5102 ;
93 
94 const int ORDER_BUTTON_UP = wxID_HIGHEST + 5103 ;
95 
96 const int ORDER_BUTTON_DOWN = wxID_HIGHEST + 5104 ;
97 
98 const int ORDER_BUTTON_SHOW = wxID_HIGHEST + 5106 ;
99 
100 const int ORDER_UPDATE_DIALOG = wxID_HIGHEST + 5107 ;
101 
102 
103 BEGIN_EVENT_TABLE( a2dLayerOrderDlg, wxDialog )
104 
105  EVT_BUTTON ( ORDER_BUTTON_OK, a2dLayerOrderDlg::CmOk )
106 
107  EVT_BUTTON ( ORDER_BUTTON_CANCEL, a2dLayerOrderDlg::CmCancel )
108 
109  EVT_BUTTON ( ORDER_BUTTON_UP, a2dLayerOrderDlg::CmUp )
110 
111  EVT_BUTTON ( ORDER_BUTTON_DOWN, a2dLayerOrderDlg::CmDown )
112 
113  EVT_BUTTON ( ORDER_BUTTON_SHOW, a2dLayerOrderDlg::CmShow )
114 
115  EVT_LISTBOX ( ORDER_LIST_SELECT, a2dLayerOrderDlg::CmListBox )
116 
117  EVT_CLOSE ( a2dLayerOrderDlg::OnCloseWindow )
118 
119 END_EVENT_TABLE()
120 
121 
122 a2dLayerOrderDlg::a2dLayerOrderDlg( a2dHabitat* habitat, wxWindow* parent, a2dLayers* layersetup, const wxString& title, long style, const wxString& name ):
123  wxDialog( parent, ORDER_UPDATE_DIALOG, title, wxPoint( 0, 0 ), wxSize( 200, 500 ), style, name )
124 {
125  m_habitat = m_habitat;
126  //a2dDocviewGlobals->GetDocviewCommandProcessor()->ConnectEvent( wxEVT_ACTIVATE_VIEW, this );
127  //a2dDocviewGlobals->GetDocviewCommandProcessor()->ConnectEvent( wxEVT_CHANGED_DOCUMENT, this );
128  //a2dDocviewGlobals->GetDocviewCommandProcessor()->ConnectEvent( a2dEVT_COM_EVENT, this );
129 
130  a2dLayerOrderDlg* itemDialog1 = this;
131 
132  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxHORIZONTAL );
133  itemDialog1->SetSizer( itemBoxSizer2 );
134 
135  wxString* m_listboxStrings = NULL;
136  m_listbox = new a2dDragListBox( itemDialog1, ORDER_LIST_SELECT, wxDefaultPosition, wxSize( 100, 500 ), 0, m_listboxStrings, wxLB_SINGLE | wxLB_NEEDED_SB );
137  m_listbox->SetHelpText( _( "Select a layer and press up or down button" ) );
138  m_listbox->SetToolTip( _( "Select a layer and press up or down button" ) );
139  itemBoxSizer2->Add( m_listbox, 1, wxGROW | wxALL, 0 );
140 
141  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL );
142  itemBoxSizer2->Add( itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0 );
143 
144  m_buttonOK = new wxButton( itemDialog1, ORDER_BUTTON_OK, _( "Hide" ), wxDefaultPosition, wxSize( 55, 22 ), 0 );
145  itemBoxSizer4->Add( m_buttonOK, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0 );
146 
147  m_buttonCANCEL = new wxButton( itemDialog1, ORDER_BUTTON_CANCEL, _( "Cancel" ), wxDefaultPosition, wxSize( 55, 22 ), 0 );
148  itemBoxSizer4->Add( m_buttonCANCEL, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0 );
149 
150  itemBoxSizer4->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
151 
152  m_buttonUP = new wxButton( itemDialog1, ORDER_BUTTON_UP, _( "Up" ), wxDefaultPosition, wxSize( 55, 22 ), 0 );
153  itemBoxSizer4->Add( m_buttonUP, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0 );
154 
155  m_buttonDOWN = new wxButton( itemDialog1, ORDER_BUTTON_DOWN, _( "Down" ), wxDefaultPosition, wxSize( 55, 22 ), 0 );
156  itemBoxSizer4->Add( m_buttonDOWN, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0 );
157 
158  m_buttonSHOW = new wxButton( itemDialog1, ORDER_BUTTON_SHOW, _( "Apply" ), wxDefaultPosition, wxSize( 55, 22 ), 0 );
159  itemBoxSizer4->Add( m_buttonSHOW, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0 );
160 
161  GetSizer()->Fit( this );
162  GetSizer()->SetSizeHints( this );
163  Centre();
164 
165  Init( layersetup );
166 }
167 
169 {
170  //a2dDocviewGlobals->GetDocviewCommandProcessor()->DisconnectEvent( wxEVT_ACTIVATE_VIEW, this );
171  //a2dDocviewGlobals->GetDocviewCommandProcessor()->DisconnectEvent( wxEVT_CHANGED_DOCUMENT, this );
172  //a2dDocviewGlobals->GetDocviewCommandProcessor()->DisconnectEvent( a2dEVT_COM_EVENT, this );
173 }
174 
176 {
177  if ( !layersetup )
178  return;
179 
180  m_layersetup = layersetup;
181 
182  m_listbox->Clear();
183 
184  int j;
185  for ( j = 0; j < wxMAXLAYER; j++ )
186  {
187  a2dLayerInfo* layerinfo = m_layersetup->GetOrderIndex()[ j ];
188  if ( layerinfo != wxNullLayerInfo )
189  {
190  wxChar _buf[60];
191  // insert the layer in the listbox
192  wxSnprintf( _buf, sizeof( _buf ), wxT( "%04d %s" ), j, layerinfo->GetName().c_str() );
193  m_listbox->Append( _buf ); //AddString(buf);
194  }
195  else
196  {
197  wxChar _buf[60];
198  // insert the layer in the listbox
199  wxSnprintf( _buf, sizeof( _buf ), wxT( "%04d ND %s" ), j, layerinfo->GetName().c_str() );
200  m_listbox->Append( _buf ); //AddString(buf);
201  }
202 
203  }
204 }
205 
207 {
208  wxString layernr;
209  for ( int i = 0; i < wxMAXLAYER; i++ )
210  {
211  layernr = m_listbox->GetString( i ).Left( 4 );
212  a2dLayerInfo* layerinfo = m_layersetup->GetLayerIndex()[ wxAtoi( layernr ) ];
213  if ( layerinfo != wxNullLayerInfo )
214  {
215  layerinfo->SetOrder( i * 10 );
216  }
217  }
218  m_layersetup->SetPending( true );
219 
220  SetEvtHandlerEnabled( false );
221  a2dComEvent changedlayers( m_layersetup->GetRoot(), m_layersetup, a2dDrawing::sig_layersetupChanged );
222  ProcessEvent( changedlayers );
223  SetEvtHandlerEnabled( true );
224 }
225 
226 void a2dLayerOrderDlg::CmOk( wxCommandEvent& )
227 {
228  int selection = m_listbox->GetSelection();
229  m_listbox->SetSelection( selection, FALSE );
230 
231  StoreOrder();
232  Show( FALSE );
233 }
234 
235 void a2dLayerOrderDlg::CmShow( wxCommandEvent& )
236 {
237  int selection = m_listbox->GetSelection();
238  m_listbox->SetSelection( selection, FALSE );
239 
240  StoreOrder();
241 }
242 
243 void a2dLayerOrderDlg::OnCloseWindow( wxCloseEvent& event )
244 {
245  wxCommandEvent a = wxCommandEvent();
246  CmCancel( a );
247 }
248 
249 void a2dLayerOrderDlg::CmCancel( wxCommandEvent& )
250 {
251  Show( FALSE );
252 
253  m_listbox->Clear();
254 
255  // old values reread
256  //Init();
257 }
258 
259 void a2dLayerOrderDlg::CmUp( wxCommandEvent& )
260 {
261  int selection = m_listbox->GetSelection();
262  if ( selection == -1 )
263  ( void )wxMessageBox( _T( "You must select a layer first" ), _T( "a2dLayerOrderDlg" ), wxICON_INFORMATION | wxOK );
264  else
265  {
266  if ( selection != 0 )
267  {
268  if ( selection == wxMAXLAYER - 1 ) m_buttonDOWN->Enable( TRUE );
269 
270  wxString selected = m_listbox->GetString( m_listbox->GetSelection() - 1 );
271 
272  m_listbox->SetString( selection - 1, m_listbox->GetString( selection ) );
273  m_listbox->SetString( selection, selected );
274  m_listbox->Show( TRUE );
275 
276  // to keep the original selection selected
277  m_listbox->SetSelection( selection, FALSE );
278  m_listbox->SetSelection( selection - 1, TRUE );
279  if ( selection == 1 )
280  m_buttonUP->Enable( FALSE );
281  }
282  else
283  {
284  ( void )wxMessageBox( _T( "layer is allready at the highest possible order" ), _T( "a2dLayerOrderDlg" ), wxICON_INFORMATION | wxOK );
285  }
286  }
287 }
288 
289 void a2dLayerOrderDlg::CmDown( wxCommandEvent& )
290 {
291  int selection = m_listbox->GetSelection();
292 
293  if ( selection == -1 )
294  ( void )wxMessageBox( _T( "You must select a layer first" ), _T( "a2dLayerOrderDlg" ), wxICON_INFORMATION | wxOK );
295  else
296  {
297  if ( selection != wxMAXLAYER - 1 )
298  {
299  if ( selection == 0 ) m_buttonUP->Enable( TRUE );
300 
301  wxString selected = m_listbox->GetString( m_listbox->GetSelection() + 1 );
302 
303  m_listbox->SetString( selection + 1, m_listbox->GetString( selection ) );
304  m_listbox->SetString( selection, selected );
305  m_listbox->Show( TRUE );
306 
307  // to keep the original selection selected
308  m_listbox->SetSelection( selection, FALSE );
309  m_listbox->SetSelection( selection + 1, TRUE );
310 
311  if ( selection == wxMAXLAYER - 2 ) m_buttonDOWN->Enable( FALSE );
312  }
313  else
314  {
315  ( void )wxMessageBox( _T( "layer is allready at the lowest possible order" ), _T( "a2dLayerOrderDlg" ), wxICON_INFORMATION | wxOK );
316  }
317  }
318 }
319 
320 void a2dLayerOrderDlg::CmListBox( wxCommandEvent& )
321 {
322  int selection = m_listbox->GetSelection();
323  m_buttonUP->Enable( selection != 0 );
324  m_buttonDOWN->Enable( selection != wxMAXLAYER - 1 );
325 
326  m_habitat->SetLayer( selection, true );
327 }
328 
329 void a2dLayerOrderDlg::OnComEvent( a2dComEvent& event )
330 {
331  if ( GetEvtHandlerEnabled() )
332  {
333  if ( event.GetId() == a2dDrawingPart::sig_changedLayers )
334  {
335  a2dDrawing* doc = wxDynamicCast( event.GetEventObject(), a2dDrawing );
336  if ( doc && doc == m_layersetup->GetRoot() )
337  Init( doc->GetLayerSetup() );
338  }
339  else if ( event.GetId() == a2dDrawing::sig_layersetupChanged )
340  {
341  a2dDrawing* doc = wxDynamicCast( event.GetEventObject(), a2dDrawing );
342  if ( doc && doc == m_layersetup->GetRoot() )
343  Init( doc->GetLayerSetup() );
344  }
345  else if ( event.GetId() == a2dLayerInfo::sig_changedLayerInfo )
346  {
347  a2dDrawing* obj = wxDynamicCast( event.GetEventObject(), a2dDrawing );
348  if ( m_layersetup->GetRoot() == obj->GetRootObject()->GetRoot() )
349  Init( m_layersetup );
350  }
351 
352  }
353 }
354 
355 
356 
357 
358 
359 BEGIN_EVENT_TABLE( a2dLayerDlg, wxDialog )
360  EVT_BUTTON ( ORDER_BUTTON_OK, a2dLayerDlg::CmOk )
361  EVT_BUTTON ( ORDER_BUTTON_CANCEL, a2dLayerDlg::CmCancel )
362  EVT_LISTBOX ( ORDER_LIST_SELECT, a2dLayerDlg::CmListBox )
363  EVT_CLOSE ( a2dLayerDlg::OnCloseWindow )
364 END_EVENT_TABLE()
365 
366 
367 a2dLayerDlg::a2dLayerDlg( a2dHabitat* habitat, wxWindow* parent, a2dLayers* layersetup, bool onOrder, bool modal, const wxString& title, const wxString& name ):
368  wxDialog( parent, ORDER_UPDATE_DIALOG, title, wxPoint( 0, 0 ), wxSize( 200, 500 ), wxDEFAULT_DIALOG_STYLE, name )
369 {
370  m_habitat = m_habitat;
371  a2dLayerDlg* itemDialog1 = this;
372 
373  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxHORIZONTAL );
374  itemDialog1->SetSizer( itemBoxSizer2 );
375 
376  wxString* m_listboxStrings = NULL;
377  m_listbox = new wxListBox( itemDialog1, ORDER_LIST_SELECT, wxDefaultPosition, wxSize( 100, 500 ), 0, m_listboxStrings, wxLB_SINGLE | wxLB_NEEDED_SB );
378  m_listbox->SetHelpText( _( "Select a layer and press up or down button" ) );
379  m_listbox->SetToolTip( _( "Select a layer and press up or down button" ) );
380  itemBoxSizer2->Add( m_listbox, 1, wxGROW | wxALL, 0 );
381 
382  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL );
383  itemBoxSizer2->Add( itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0 );
384 
385  m_modal = modal;
386  if ( m_modal )
387  m_buttonOK = new wxButton( itemDialog1, ORDER_BUTTON_OK, _( "Oke" ), wxDefaultPosition, wxSize( 55, 22 ), 0 );
388  else
389  m_buttonOK = new wxButton( itemDialog1, ORDER_BUTTON_OK, _( "Hide" ), wxDefaultPosition, wxSize( 55, 22 ), 0 );
390  itemBoxSizer4->Add( m_buttonOK, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0 );
391 
392  m_buttonCANCEL = new wxButton( itemDialog1, ORDER_BUTTON_CANCEL, _( "Cancel" ), wxDefaultPosition, wxSize( 55, 22 ), 0 );
393  itemBoxSizer4->Add( m_buttonCANCEL, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0 );
394 
395  itemBoxSizer4->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
396 
397  GetSizer()->Fit( this );
398  GetSizer()->SetSizeHints( this );
399  Centre();
400 
401  m_layerselected = 0;
402  m_onOrder = onOrder;
403  Init( layersetup );
404 }
405 
407 {
408 }
409 
410 void a2dLayerDlg::Init( a2dLayers* layersetup )
411 {
412  if ( !layersetup )
413  return;
414 
415  m_layersetup = layersetup;
416 
417  m_listbox->Clear();
418 
419  int j;
420  for ( j = 0; j < wxMAXLAYER; j++ )
421  {
422  a2dLayerInfo* layerinfo;
423  if ( m_onOrder )
424  layerinfo = m_layersetup->GetOrderIndex()[ j ];
425  else
426  layerinfo = m_layersetup->GetLayerIndex()[ j ];
427 
428  if ( layerinfo != wxNullLayerInfo )
429  {
430  wxChar _buf[60];
431  // insert the layer in the listbox
432  wxSnprintf( _buf, sizeof( _buf ), wxT( "%04d %s" ), j, layerinfo->GetName().c_str() );
433  m_listbox->Append( _buf ); //AddString(buf);
434  }
435  }
436 }
437 
438 void a2dLayerDlg::CmOk( wxCommandEvent& )
439 {
440  if ( IsModal() )
441  EndModal( wxID_OK );
442  else
443  {
444  SetReturnCode( wxID_OK );
445  Show( false );
446  }
447 }
448 
449 void a2dLayerDlg::OnCloseWindow( wxCloseEvent& event )
450 {
451  if ( IsModal() )
452  EndModal( wxID_CANCEL );
453  else
454  {
455  SetReturnCode( wxID_CANCEL );
456  Show( false );
457  }
458 }
459 
460 void a2dLayerDlg::CmCancel( wxCommandEvent& )
461 {
462  if ( IsModal() )
463  EndModal( wxID_CANCEL );
464  else
465  {
466  SetReturnCode( wxID_CANCEL );
467  Show( false );
468  }
469 }
470 
471 void a2dLayerDlg::CmListBox( wxCommandEvent& )
472 {
473  m_layerselected = m_listbox->GetSelection();
474  if ( !IsModal() )
475  {
476  m_habitat->SetLayer( m_layerselected, false );
477  }
478 }
479 
480 void a2dLayerDlg::OnComEvent( a2dComEvent& event )
481 {
482  if ( GetEvtHandlerEnabled() )
483  {
485 
486  if ( !part || !part->GetDrawing() )
487  return;
488 
489  if ( event.GetId() == a2dDrawingPart::sig_changedLayers )
490  {
491  a2dDrawing* doc = wxDynamicCast( event.GetEventObject(), a2dDrawing );
492  if ( doc && doc == m_layersetup->GetRoot() )
493  Init( doc->GetLayerSetup() );
494  }
495  else if ( event.GetId() == a2dDrawing::sig_layersetupChanged )
496  {
497  a2dDrawing* doc = wxDynamicCast( event.GetEventObject(), a2dDrawing );
498  if ( doc && doc == m_layersetup->GetRoot() )
499  Init( doc->GetLayerSetup() );
500  }
501  else if ( event.GetId() == a2dLayerInfo::sig_changedLayerInfo )
502  {
503  a2dCanvasObject* obj = wxDynamicCast( event.GetEventObject(), a2dCanvasObject );
504  if ( m_layersetup->GetRoot() == obj->GetRoot() )
505  Init( m_layersetup );
506  }
507  else if ( event.GetId() == a2dCanvasGlobal::sig_changedActiveDrawing )
508  {
510  if ( part && part->GetShowObject() && part->GetShowObject()->GetRoot() )
511  {
512  if ( m_layersetup != part->GetShowObject()->GetRoot()->GetLayerSetup() )
513  {
514  part->GetShowObject()->GetRoot()->SetAvailable();
515  part->GetDrawing()->DisconnectEvent( a2dEVT_COM_EVENT, this );
516  Init( part->GetShowObject()->GetRoot()->GetLayerSetup() );
517  part->GetDrawing()->ConnectEvent( a2dEVT_COM_EVENT, this );
518 
519  }
520  }
521  }
522  }
523 }
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
Definition: drawer.h:470
void CmShow(wxCommandEvent &)
Show new layerorder if the SHOW-button is pressed.
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
Definition: gen.h:75
void SetLayer(wxUint16 layer, bool setStyleOfLayer=false)
Definition: canglob.cpp:1076
void CmCancel(wxCommandEvent &)
Close window if CANCEL-button is pressed.
a2dCanvasObject * GetRootObject() const
get the root object, which holds the objects in the document
Definition: drawing.h:521
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
Definition: canobj.h:952
void ConnectEvent(wxEventType type, wxEvtHandler *eventSink)
Definition: gen.cpp:876
bool m_onOrder
drawing order in listbox instead of layer id
Definition: canorderdlg.h:98
void OnCloseWindow(wxCloseEvent &event)
Close window if EXIT-button is pressed.
a2dCanvasObject is the base class for Canvas Objects.
Definition: canobj.h:371
std::vector< a2dLayerInfoPtr > & GetLayerIndex()
return array index on Layer
Definition: layerinf.cpp:555
void CmListBox(wxCommandEvent &)
a2dLayers * GetLayerSetup()
Get the layersettings for the canvas.
Definition: drawing.h:506
void CmCancel(wxCommandEvent &)
Close window if CANCEL-button is pressed.
static const a2dSignal sig_layersetupChanged
layer info changed id sent around when m_layersetup is changed.
Definition: drawing.h:771
~a2dLayerOrderDlg()
destructor.
a2dDrawingPart * GetActiveDrawingPart()
return the currently/last active drawing part.
Definition: canglob.h:1262
void CmListBox(wxCommandEvent &)
void CmOk(wxCommandEvent &)
Close window if OK-button is pressed.
virtual wxString GetName() const
Get name for layer.
Definition: layerinf.cpp:248
static const a2dSignal sig_changedActiveDrawing
when active drawing is set, this signal is send to the drawing.
Definition: canglob.h:1292
void CmDown(wxCommandEvent &)
Move selected layer to a lower layersetting if the DOWN-button is pressed.
layer settings for a a2dCanvasDocument Holds layers settings classes
GUI listbox with copy feature.
Definition: canorderdlg.h:29
void SetPending(bool pending)
next to base sets m_indexed false
Definition: layerinf.cpp:545
a2dCanvasObject * GetShowObject() const
return pointer of then currently shown object on the drawer.
Definition: drawer.h:680
static const a2dSignal sig_changedLayerInfo
when one layer its a2dLayerInfo has changed ( e.g. visible or order of rendering ) ...
Definition: layerinf.h:322
contains the layer properties for one layer,
Definition: layerinf.h:41
void OnCloseWindow(wxCloseEvent &event)
Close window if EXIT-button is pressed.
void Init(a2dLayers *layersetup)
initialize with this layer setup
defines common settinsg for a habitat for a set of a2dCameleons.
Definition: canglob.h:439
~a2dLayerDlg()
destructor.
static const a2dSignal sig_changedLayers
when more layers changed ( rerendering view is needed).
Definition: drawer.h:1505
void CmOk(wxCommandEvent &)
Close window if OK-button is pressed.
void SetOrder(wxUint16 order)
set drawing order for layer
Definition: layerinf.cpp:371
wxUint16 m_layerselected
set or end selected layer
Definition: canorderdlg.h:95
see a2dComEvent
Definition: gen.h:371
std::vector< a2dLayerInfoPtr > & GetOrderIndex()
return array index on Order
Definition: layerinf.cpp:562
void CmUp(wxCommandEvent &)
Move selected layer to a heigher layersetting if UP-button is pressed.
a2dDrawing * GetDrawing() const
get drawing via top object
Definition: drawer.cpp:726
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
Definition: canglob.cpp:1234
all headers of the canvas module
void StoreOrder()
store current order to layer setup
bool DisconnectEvent(wxEventType type, wxEvtHandler *eventSink)
Definition: gen.cpp:902
void Init(a2dLayers *layersetup)
initialize with this layer setup
Contain one drawing as hierarchical tree of a2dCanvasObject&#39;s.
Definition: drawing.h:434
canorderdlg.cpp Source File -- Sun Oct 12 2014 17:04:14 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation