1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Resource editor project management tree
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "edtree.h"
16 // For compilers that support precompilation, includes "wx/wx.h".
17 #include "wx/wxprec.h"
26 #include "wx/checkbox.h"
27 #include "wx/button.h"
28 #include "wx/choice.h"
29 #include "wx/listbox.h"
30 #include "wx/radiobox.h"
31 #include "wx/statbox.h"
33 #include "wx/slider.h"
34 #include "wx/textctrl.h"
40 BEGIN_EVENT_TABLE(wxResourceEditorProjectTree
, wxTreeCtrl
)
41 EVT_LEFT_DCLICK(wxResourceEditorProjectTree::LeftDClick
)
42 EVT_TREE_SEL_CHANGED(IDC_TREECTRL
, wxResourceEditorProjectTree::OnSelChanged
)
45 wxResourceEditorProjectTree::wxResourceEditorProjectTree(wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
,
47 wxTreeCtrl(parent
, id
, pos
, size
, style
)
51 void wxResourceEditorProjectTree::LeftDClick(wxMouseEvent
& event
)
54 long sel
= GetSelection();
58 if (GetItemData(sel
) == 0)
61 wxItemResource
* res
= (wxItemResource
*) GetItemData(sel
);
62 wxString
resType(res
->GetType());
63 if (resType
!= "wxDialog" && resType
!= "wxDialogBox" && resType
!= "wxPanel")
66 wxResourceEditorFrame
*frame
= (wxResourceEditorFrame
*)wxWindow::GetParent();
67 wxResourceManager
*manager
= frame
->manager
;
69 manager
->EditSelectedResource();
73 void wxResourceEditorProjectTree::OnSelChanged(wxTreeEvent
& event
)
75 long sel
= GetSelection();
79 if (GetItemData(sel
) == 0)
85 wxItemResource
* res
= (wxItemResource
*) GetItemData(sel
);
86 wxString
resType(res
->GetType());
87 if (resType
!= "wxDialog" && resType
!= "wxDialogBox" && resType
!= "wxPanel")
90 wxResourceManager::GetCurrentResourceManager()->Edit(res
);