26 EVT_BUTTON ( ID_IDENT_HIDE, IdentifyDialog::hide )
27 EVT_BUTTON ( ID_IDENT_UPDATE, IdentifyDialog::Update )
28 EVT_ACTIVATE ( IdentifyDialog::OnActivate )
30 EVT_CLOSE ( IdentifyDialog::OnCloseWindow )
31 EVT_SIZE ( IdentifyDialog::OnSize )
32 EVT_DO ( IdentifyDialog::OnDoEvent )
40 IdentifyDialog::IdentifyDialog( )
58 Create( parent,
id, caption, pos, size, style );
69 IdentifyDialog::~IdentifyDialog( )
87 bool IdentifyDialog::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
93 SetExtraStyle( GetExtraStyle() | wxWS_EX_BLOCK_EVENTS );
94 wxDialog::Create( parent,
id, caption, pos, size, style );
110 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer( wxVERTICAL );
111 itemDialog1->SetSizer( itemBoxSizer2 );
113 wxString* m_objectsListStrings = NULL;
114 m_objectsList =
new wxListBox( itemDialog1, ID_IDENT_LISTBOX, wxDefaultPosition, wxDefaultSize, 0, m_objectsListStrings, wxLB_SINGLE | wxLB_NEEDED_SB | wxLB_SORT );
115 m_objectsList->SetHelpText( _(
"Object selected for identify" ) );
117 m_objectsList->SetToolTip( _(
"Object selected for identify" ) );
118 itemBoxSizer2->Add( m_objectsList, 1, wxGROW | wxALL, 0 );
120 wxBoxSizer* itemBoxSizer4 =
new wxBoxSizer( wxHORIZONTAL );
121 itemBoxSizer2->Add( itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
123 wxButton* itemButton5 =
new wxButton( itemDialog1, ID_IDENT_HIDE, _(
"Hide" ), wxDefaultPosition, wxDefaultSize, 0 );
124 itemButton5->SetHelpText( _(
"Hide dialog" ) );
126 itemButton5->SetToolTip( _(
"Hide dialog" ) );
127 itemBoxSizer4->Add( itemButton5, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0 );
129 m_update =
new wxButton( itemDialog1, ID_IDENT_UPDATE, _(
"Update" ), wxDefaultPosition, wxDefaultSize, 0 );
130 m_update->SetHelpText( _(
"Update dialog for selected objects in view" ) );
132 m_update->SetToolTip( _(
"Update dialog for selected objects in view" ) );
133 itemBoxSizer4->Add( m_update, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0 );
144 void IdentifyDialog::hide( wxCommandEvent& )
146 m_objectsList->Clear();
150 void IdentifyDialog::OnCloseWindow( wxCloseEvent& event )
152 m_objectsList->Clear();
156 void IdentifyDialog::Update( wxCommandEvent& )
163 if ( !m_objectsList )
165 m_objectsList->Clear();
172 for( a2dCanvasObjectList::iterator iter = childList->begin(); iter != childList->end(); ++iter )
182 if ( layerobj != wxNullLayerInfo )
183 layerName = layerobj->
GetName();
186 listline = wxString::Format( wxT(
"layerId=%d layer=%s " ), obj->
GetLayer(), layerName.c_str() );
187 listline += wxString::Format( wxT(
"x=%lg, y=%lg " ), obj->
GetPosX(), obj->
GetPosY() );
188 listline << wxT(
"name=" ) << obj->
GetName() << wxT(
" class=" ) << obj->GetClassInfo()->GetClassName();
189 m_objectsList->Append( listline );
194 void IdentifyDialog::OnActivate( wxActivateEvent& windowevent )
221 void IdentifyDialog::OnSize( wxSizeEvent& WXUNUSED( event ) )
228 wxString cmdName =
event.GetCommand()->GetName();
241 void IdentifyDialog::OnComEvent(
a2dComEvent& event )
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
virtual wxString GetName() const
Returns the name of this object, if no name is given the internal id will be returned.
IdentifyDialog()
Constructors.
a2dCommand * GetCommand()
the command ( if there was one ) that did it.
bool Create(wxWindow *parent, wxWindowID id=SYMBOL_IDENTIFYDIALOG_IDNAME, const wxString &caption=SYMBOL_IDENTIFYDIALOG_TITLE, const wxPoint &pos=SYMBOL_IDENTIFYDIALOG_POSITION, const wxSize &size=SYMBOL_IDENTIFYDIALOG_SIZE, long style=SYMBOL_IDENTIFYDIALOG_STYLE)
Creation.
void Init(a2dCanvasObject *showObject)
selected child objects with this as parent will be shown
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
#define EVT_DO(func)
event sent from a2DocumentCommandProcessor when a command is initially done
static bool ShowToolTips()
Should we show tooltips?
void ConnectEvent(wxEventType type, wxEvtHandler *eventSink)
a2dCanvasObject is the base class for Canvas Objects.
std::vector< a2dLayerInfoPtr > & GetLayerIndex()
return array index on Layer
virtual a2dObject * GetRefObject() const
when a2dProperty, return its value else assert
a2dLayers * GetLayerSetup()
Get the layersettings for the canvas.
a2dCanvasObjectList * GetChildObjectList()
get the list where the child objects are stored in.
bool GetSelected() const
is the object selected flag set
a2dDrawingPart * GetActiveDrawingPart()
return the currently/last active drawing part.
virtual wxString GetName() const
Get name for layer.
static const a2dSignal sig_changedShowObject
static const a2dSignal sig_changedActiveDrawing
when active drawing is set, this signal is send to the drawing.
double GetPosX() const
get x position from affine matrix
#define EVT_COM_EVENT(func)
static wxEvtHandler for communication event
layer settings for a a2dCanvasDocument Holds layers settings classes
const a2dCommandId * GetCommandId()
a specific id for this command.
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
void CreateControls()
Creates the controls and sizers.
a2dCanvasObject * GetShowObject() const
return pointer of then currently shown object on the drawer.
wxUint16 GetLayer() const
Returns the layer index where this object is drawn upon.
contains the layer properties for one layer,
a2dCanvasObject * m_showObject
selected child objects with this as parent will be shown
double GetPosY() const
get y position from affine matrix
Event sent to a2dCommandProcessor.
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
all headers of the canvas module
bool DisconnectEvent(wxEventType type, wxEvtHandler *eventSink)
Contain one drawing as hierarchical tree of a2dCanvasObject's.