33 #include <wx/statline.h>
34 #include <wx/listctrl.h>
55 wxDialog(parent, -1, _T("Transport Bus Order"), wxDefaultPosition),
58 createContents(
this,
true,
true);
60 list_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_LIST));
61 list_->InsertColumn(0, _T(
"index"), wxLIST_FORMAT_LEFT, 50);
62 list_->InsertColumn(1, _T(
"bus"), wxLIST_FORMAT_LEFT, 180);
84 list_->DeleteAllItems();
88 for (
int i = 0; i < navigator.
count(); i++) {
89 std::string busName = navigator.
item(i)->name();
114 position - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
116 list_->EnsureVisible(position - 1);
130 if (position >= (navigator.
count() - 1)) {
140 position + 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
142 list_->EnsureVisible(position + 1);
168 if (selection < (navigator.
count() - 1)) {
183 item =
list_->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
193 wxWindow* parent,
bool call_fit,
bool set_sizer) {
195 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
197 wxBoxSizer *item1 =
new wxBoxSizer( wxHORIZONTAL );
199 wxListCtrl *item2 =
new wxListCtrl( parent,
ID_LIST, wxDefaultPosition, wxSize(250,300), wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER );
200 item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
202 wxBoxSizer *item3 =
new wxBoxSizer( wxVERTICAL );
204 wxButton *item4 =
new wxButton( parent,
ID_UP, wxT(
"&Up"), wxDefaultPosition, wxDefaultSize, 0 );
205 item3->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
207 wxButton *item5 =
new wxButton( parent,
ID_DOWN, wxT(
"&Down"), wxDefaultPosition, wxDefaultSize, 0 );
208 item3->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
210 item1->Add( item3, 0, wxALL, 5 );
212 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
214 wxStaticLine *item6 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
215 item0->Add( item6, 0, wxGROW|wxALL, 5 );
217 wxBoxSizer *item7 =
new wxBoxSizer( wxHORIZONTAL );
219 wxButton *item8 =
new wxButton( parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
220 item7->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
222 wxButton *item9 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
223 item7->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 );
225 item0->Add( item7, 0, wxALL, 5 );
229 parent->SetSizer( item0 );
231 item0->SetSizeHints( parent );