Differential D3787 Diff 16957 source/tools/atlas/AtlasUI/CustomControls/EditableListCtrl/FieldEditCtrl.cpp
Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/AtlasUI/CustomControls/EditableListCtrl/FieldEditCtrl.cpp
/* Copyright (C) 2009 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if (newColor.IsOk()) // test whether the user cancelled the selection | ||||
AtlasWindowCommandProc::GetFromParentFrame(editCtrl)->Submit( | AtlasWindowCommandProc::GetFromParentFrame(editCtrl)->Submit( | ||||
new EditCommand_Text(editCtrl, row, col, newColorStr) | new EditCommand_Text(editCtrl, row, col, newColorStr) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// | ||||
void FieldEditCtrl_Boolean::StartEdit(wxWindow* parent, wxRect rect, long row, int col) | |||||
{ | |||||
wxArrayString choices; | |||||
// The famous three-valued boolean. | |||||
choices.Add("true"); | |||||
choices.Add("false"); | |||||
choices.Add(""); | |||||
ListCtrlValidator validator((EditableListCtrl*)parent, row, col); | |||||
new QuickComboBox(parent, rect, choices, validator); | |||||
} | |||||
////////////////////////////////////////////////////////////////////////// | |||||
FieldEditCtrl_List::FieldEditCtrl_List(const char* listType) | FieldEditCtrl_List::FieldEditCtrl_List(const char* listType) | ||||
: m_ListType(listType) | : m_ListType(listType) | ||||
{ | { | ||||
} | } | ||||
void FieldEditCtrl_List::StartEdit(wxWindow* parent, wxRect rect, long row, int col) | void FieldEditCtrl_List::StartEdit(wxWindow* parent, wxRect rect, long row, int col) | ||||
{ | { | ||||
wxArrayString choices; | wxArrayString choices; | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator