]>
Commit | Line | Data |
---|---|---|
ae8351fc JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: edlist.cpp | |
3 | // Purpose: Resource editor project management tree | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 04/01/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifdef __GNUG__ | |
13 | #pragma implementation "edlist.h" | |
14 | #endif | |
15 | ||
16 | // For compilers that support precompilation, includes "wx/wx.h". | |
17 | #include "wx/wxprec.h" | |
18 | ||
19 | #ifdef __BORLANDC__ | |
20 | #pragma hdrstop | |
21 | #endif | |
22 | ||
23 | #ifndef WX_PRECOMP | |
24 | #include "wx/wx.h" | |
25 | ||
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" | |
32 | #include "wx/gauge.h" | |
33 | #include "wx/slider.h" | |
34 | #include "wx/textctrl.h" | |
35 | #endif | |
36 | ||
37 | #include "edlist.h" | |
38 | #include "reseditr.h" | |
39 | ||
40 | BEGIN_EVENT_TABLE(wxResourceEditorControlList, wxListCtrl) | |
41 | END_EVENT_TABLE() | |
42 | ||
43 | wxResourceEditorControlList::wxResourceEditorControlList(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, | |
44 | long style): | |
45 | wxListCtrl(parent, id, pos, size, style), m_imageList(16, 16, TRUE) | |
46 | { | |
47 | Initialize(); | |
48 | } | |
49 | ||
50 | wxResourceEditorControlList::~wxResourceEditorControlList() | |
51 | { | |
52 | SetImageList(NULL, wxIMAGE_LIST_SMALL); | |
53 | } | |
54 | ||
55 | // Load icons and add to the list | |
56 | void wxResourceEditorControlList::Initialize() | |
57 | { | |
58 | wxIcon icon1("ARROW_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
59 | m_imageList.Add(icon1); | |
60 | ||
61 | wxIcon icon2("BUTTON_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
62 | m_imageList.Add(icon2); | |
63 | ||
64 | wxIcon icon3("BMPBUTTON_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
65 | m_imageList.Add(icon3); | |
66 | ||
67 | wxIcon icon4("STATICTEXT_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
68 | m_imageList.Add(icon4); | |
69 | ||
70 | wxIcon icon5("STATICBMP_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
71 | m_imageList.Add(icon5); | |
72 | ||
73 | wxIcon icon6("STATICBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
74 | m_imageList.Add(icon6); | |
75 | ||
76 | wxIcon icon7("TEXTSING_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
77 | m_imageList.Add(icon7); | |
78 | ||
79 | wxIcon icon8("TEXTMULT_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
80 | m_imageList.Add(icon8); | |
81 | ||
82 | wxIcon icon9("LISTBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
83 | m_imageList.Add(icon9); | |
84 | ||
85 | wxIcon icon10("CHOICE_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
86 | m_imageList.Add(icon10); | |
87 | ||
88 | wxIcon icon11("COMBOBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
89 | m_imageList.Add(icon11); | |
90 | ||
91 | wxIcon icon12("CHECKBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
92 | m_imageList.Add(icon12); | |
93 | ||
94 | wxIcon icon13("SLIDER_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
95 | m_imageList.Add(icon13); | |
96 | ||
97 | wxIcon icon14("GAUGE_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
98 | m_imageList.Add(icon14); | |
99 | ||
100 | wxIcon icon15("RADIOBOX_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
101 | m_imageList.Add(icon15); | |
102 | ||
103 | wxIcon icon16("RADIOBTN_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
104 | m_imageList.Add(icon16); | |
105 | ||
106 | wxIcon icon17("SCROLBAR_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); | |
107 | m_imageList.Add(icon17); | |
108 | ||
109 | SetImageList(& m_imageList, wxIMAGE_LIST_SMALL); | |
110 | ||
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); | |
128 | ||
129 | /* | |
130 | InsertItem(RESED_TREECTRL, "wxTreeCtrl", 16); | |
131 | InsertItem(RESED_LISTCTRL, "wxListCtrl", 17); | |
132 | InsertItem(RESED_SPINBUTTON, "wxSpinButton", 18); | |
133 | */ | |
134 | ||
135 | // SetColumnWidth(-1, 80); | |
136 | } | |
137 | ||
138 | // Get selection, or -1 | |
139 | long wxResourceEditorControlList::GetSelection() const | |
140 | { | |
141 | return GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); | |
142 | } | |
143 | ||
144 |