wxArt2D
strucdlgdoc.h
Go to the documentation of this file.
1 /*! \file wx/editor/strucdlgdoc.h
2  \brief for choosing a a2dCanvasObject from a list.
3  \author Klaas Holwerda
4 
5  Copyright: 2000-2004 (c) Klaas Holwerda
6 
7  Licence: wxWidgets Licence
8 
9  RCS-ID: $Id: strucdlg.h,v 1.8 2009/10/05 20:03:11 titato Exp $
10 */
11 
12 
13 #ifndef __STRUCDLGDOC_H__
14 #define __STRUCDLGDOC_H__
15 
16 #ifndef WX_PRECOMP
17 #include "wx/wx.h"
18 #endif
19 
20 #include "wx/canvas/canmod.h"
21 #include "wx/docview/doccom.h"
22 #include "wx/canvas/sttool.h"
23 #include "wx/editor/candoc.h"
24 
25 #define ID_DIALOG 10000
26 #define SYMBOL_A2DCANVASOBJECTSDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
27 #define SYMBOL_A2DCANVASOBJECTSDIALOG_TITLE _("Choose Canvas Object")
28 #define SYMBOL_A2DCANVASOBJECTSDIALOG_IDNAME ID_DIALOG
29 #define SYMBOL_A2DCANVASOBJECTSDIALOG_SIZE wxSize(400, 300)
30 #define SYMBOL_A2DCANVASOBJECTSDIALOG_POSITION wxDefaultPosition
31 #define STRUCT_ID_STATIC 10001
32 #define STRUCT_ID_LISTBOX 10002
33 #define STRUCT_ID_HIDE 10003
34 #define STRUCT_ID_APPLY 10004
35 
36 
37 //!Class a2dCanvasObjectsDocDialog.
38 //!This class is used to show a dialog containing objects.
39 class A2DEDITORDLLEXP a2dCanvasObjectsDocDialog: public wxDialog
40 {
41  DECLARE_EVENT_TABLE()
42 
43 public:
44 
45  a2dCanvasObjectsDocDialog( wxWindow* parent,
46  a2dCanvasDocument* document, bool structOnly = true, bool modal = false, long style = SYMBOL_A2DCANVASOBJECTSDIALOG_STYLE,
47  wxWindowID id = SYMBOL_A2DCANVASOBJECTSDIALOG_IDNAME, const wxString& caption = SYMBOL_A2DCANVASOBJECTSDIALOG_TITLE, const wxPoint& pos = SYMBOL_A2DCANVASOBJECTSDIALOG_POSITION, const wxSize& size = SYMBOL_A2DCANVASOBJECTSDIALOG_SIZE );
48 
49  //! constructor with a specific list of objects
50  a2dCanvasObjectsDocDialog( wxWindow* parent, a2dCanvasObjectList* total, bool modal = false, long style = SYMBOL_A2DCANVASOBJECTSDIALOG_STYLE,
51  wxWindowID id = SYMBOL_A2DCANVASOBJECTSDIALOG_IDNAME, const wxString& caption = SYMBOL_A2DCANVASOBJECTSDIALOG_TITLE, const wxPoint& pos = SYMBOL_A2DCANVASOBJECTSDIALOG_POSITION, const wxSize& size = SYMBOL_A2DCANVASOBJECTSDIALOG_SIZE );
52 
54 
55  /// Creation
56  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_A2DCANVASOBJECTSDIALOG_IDNAME, const wxString& caption = SYMBOL_A2DCANVASOBJECTSDIALOG_TITLE, const wxPoint& pos = SYMBOL_A2DCANVASOBJECTSDIALOG_POSITION, const wxSize& size = SYMBOL_A2DCANVASOBJECTSDIALOG_SIZE, long style = SYMBOL_A2DCANVASOBJECTSDIALOG_STYLE );
57 
58  //! Pointer to object selected.
59  a2dCanvasObject* GetCanvasObject();
60 
61  //! take over object to show from objects
62  void Init( a2dCanvasObjectList* objects );
63 
64  void Init( a2dCanvasDocument* document );
65 
66 protected:
67 
68  /// Creates the controls and sizers
69  void CreateControls();
70 
71  /// wxEVT_CLOSE_WINDOW event handler for ID_DIALOG
72  void OnCloseWindow( wxCloseEvent& event );
73 
74  /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for STRUCT_ID_LISTBOX
75  void OnStructIdListboxSelected( wxCommandEvent& event );
76 
77  /// wxEVT_COMMAND_LISTBOX_DOUBLECLICKED event handler for STRUCT_ID_LISTBOX
78  void OnStructIdListboxDoubleClicked( wxCommandEvent& event );
79 
80  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for STRUCT_ID_HIDE
81  void OnStructIdHideClick( wxCommandEvent& event );
82 
83  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for STRUCT_ID_APPLY
84  void OnStructIdApplyClick( wxCommandEvent& event );
85 
86  /// Should we show tooltips?
87  static bool ShowToolTips() { return true; }
88 
89  //! document changed
90  void OnChangedDocument( a2dCommandEvent& event );
91 
92  void OnComEvent( a2dComEvent& event );
93 
94  void OnDoEvent( a2dCommandProcessorEvent& event );
95 
96  void CmApply();
97 
98  bool m_modal;
99 
100  wxListBox* m_listbox;
101  wxButton* m_hide;
102  wxButton* m_Apply;
103 
104  wxStaticText* m_numberObjects;
105 
106  //! Pointer to object list
107  a2dCanvasObjectsSet m_structureSet;
108 
109  //! Pointer to the choosen object.
111 
112  a2dCanvasDocument* m_document;
113 
114 };
115 
116 
117 
118 #endif
119 
a2dCanvasObjectsSet m_structureSet
Pointer to object list.
Definition: strucdlgdoc.h:107
see a2dCommandEvent
Definition: doccom.h:79
a2dCanvasObject is the base class for Canvas Objects.
Definition: canobj.h:371
Docview framework its controlling class.
a2dCanvasObject * m_object
Pointer to the choosen object.
Definition: strucdlgdoc.h:110
Each a2dCanvasView needs to have a a2dCanvasDocument set in order to render data. ...
Definition: candoc.h:374
Event sent to a2dCommandProcessor.
Definition: comevt.h:701
see a2dComEvent
Definition: gen.h:371
all headers of the canvas module
stack based tools controller and tools for drawing and editing.
static bool ShowToolTips()
Should we show tooltips?
Definition: strucdlgdoc.h:87
strucdlgdoc.h Source File -- Sun Oct 12 2014 17:04:24 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation