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 "edlist.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(wxResourceEditorControlList
, wxListCtrl
)
43 wxResourceEditorControlList::wxResourceEditorControlList(wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
,
45 wxListCtrl(parent
, id
, pos
, size
, style
), m_imageList(16, 16, TRUE
)
50 wxResourceEditorControlList::~wxResourceEditorControlList()
52 SetImageList(NULL
, wxIMAGE_LIST_SMALL
);
55 // Load icons and add to the list
56 void wxResourceEditorControlList::Initialize()
58 wxIcon
icon1("ARROW_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
59 m_imageList
.Add(icon1
);
61 wxIcon
icon2("BUTTON_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
62 m_imageList
.Add(icon2
);
64 wxIcon
icon3("BMPBUTTON_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
65 m_imageList
.Add(icon3
);
67 wxIcon
icon4("STATICTEXT_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
68 m_imageList
.Add(icon4
);
70 wxIcon
icon5("STATICBMP_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
71 m_imageList
.Add(icon5
);
73 wxIcon
icon6("STATICBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
74 m_imageList
.Add(icon6
);
76 wxIcon
icon7("TEXTSING_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
77 m_imageList
.Add(icon7
);
79 wxIcon
icon8("TEXTMULT_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
80 m_imageList
.Add(icon8
);
82 wxIcon
icon9("LISTBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
83 m_imageList
.Add(icon9
);
85 wxIcon
icon10("CHOICE_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
86 m_imageList
.Add(icon10
);
88 wxIcon
icon11("COMBOBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
89 m_imageList
.Add(icon11
);
91 wxIcon
icon12("CHECKBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
92 m_imageList
.Add(icon12
);
94 wxIcon
icon13("SLIDER_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
95 m_imageList
.Add(icon13
);
97 wxIcon
icon14("GAUGE_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
98 m_imageList
.Add(icon14
);
100 wxIcon
icon15("RADIOBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
101 m_imageList
.Add(icon15
);
103 wxIcon
icon16("RADIOBTN_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
104 m_imageList
.Add(icon16
);
106 wxIcon
icon17("SCROLBAR_ICON", wxBITMAP_TYPE_ICO_RESOURCE
, 16, 16);
107 m_imageList
.Add(icon17
);
109 SetImageList(& m_imageList
, wxIMAGE_LIST_SMALL
);
111 long id
= InsertItem(0, "Pointer", 0);
112 id
= InsertItem(1, "wxButton", 1);
113 id
= InsertItem(2, "wxBitmapButton", 2);
114 id
= InsertItem(3, "wxStaticText", 3);
115 id
= InsertItem(4, "wxStaticBitmap", 4);
116 id
= InsertItem(5, "wxStaticBox", 5);
117 id
= InsertItem(6, "wxTextCtrl", 6);
118 id
= InsertItem(7, "wxTextCtrl", 7);
119 id
= InsertItem(8, "wxListBox", 8);
120 id
= InsertItem(9, "wxChoice", 9);
121 id
= InsertItem(10, "wxComboBox", 10);
122 id
= InsertItem(11, "wxCheckBox", 11);
123 id
= InsertItem(12, "wxSlider", 12);
124 id
= InsertItem(13, "wxGauge", 13);
125 id
= InsertItem(14, "wxRadioBox", 14);
126 id
= InsertItem(15, "wxRadioButton", 15);
127 id
= InsertItem(16, "wxScrollBar", 16);
130 InsertItem(RESED_TREECTRL, "wxTreeCtrl", 16);
131 InsertItem(RESED_LISTCTRL, "wxListCtrl", 17);
132 InsertItem(RESED_SPINBUTTON, "wxSpinButton", 18);
135 // SetColumnWidth(-1, 80);
138 // Get selection, or -1
139 long wxResourceEditorControlList::GetSelection() const
141 return GetNextItem(-1, wxLIST_NEXT_ALL
, wxLIST_STATE_SELECTED
);