20#include "../globals.hpp"
21#include "../compositions/grouppanel.hpp"
22#include "../../kernel/core/ui/language.hpp"
23#include "../../kernel/core/utils/stringtools.hpp"
28RenameSymbolsDialog::RenameSymbolsDialog(wxWindow* parent,
const std::vector<wxString>& vChangeLog, wxWindowID
id,
const wxString& title,
const wxString& defaultval) : wxDialog(parent, id, title, wxDefaultPosition, wxDefaultSize, wxCAPTION | wxRESIZE_BORDER | wxSTAY_ON_TOP)
37 wxBoxSizer* vSizer =
new wxBoxSizer(wxVERTICAL);
38 this->SetSizer(vSizer);
43 vSizer->Add(panel, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
70 wxListView* listview = panel->
CreateListView(group->GetStaticBox(), group, wxLC_REPORT | wxLC_VRULES);
71 listview->AppendColumn(
"ID");
72 listview->AppendColumn(
_guilang.
get(
"GUI_DLG_RENAMESYMBOLS_CHANGELOG_OLDNAME"));
73 listview->AppendColumn(
_guilang.
get(
"GUI_DLG_RENAMESYMBOLS_CHANGELOG_NEWNAME"));
80 vSizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
82 GetSizer()->SetSizeHints(
this);
97 wxString sCurrentItem;
100 for (
int i = vChangeLog.size()-1; i >= 0 ; i--)
102 sCurrentItem = vChangeLog[i];
104 listView->InsertItem((vChangeLog.size()-1) - i,
toString(i+1));
105 listView->SetItem((vChangeLog.size()-1) - i, 1, sCurrentItem.substr(0, sCurrentItem.find(
'\t')));
106 listView->SetItem((vChangeLog.size()-1) - i, 2, sCurrentItem.substr(sCurrentItem.find(
'\t')+1));
111 if (!vChangeLog.size())
113 listView->InsertItem(0,
"---");
114 listView->SetItem(0, 1,
"---");
115 listView->SetItem(0, 2,
"---");
116 listView->SetItemTextColour(0, wxColour(128, 128, 128));
117 listView->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
118 listView->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
119 listView->SetColumnWidth(2, wxLIST_AUTOSIZE_USEHEADER);
124 listView->SetColumnWidth(0, wxLIST_AUTOSIZE);
125 listView->SetColumnWidth(1, wxLIST_AUTOSIZE);
126 listView->SetColumnWidth(2, wxLIST_AUTOSIZE);
This class simplifies the creation of simple windows and creates a common layout among all windows.
wxListView * CreateListView(wxWindow *parent, wxSizer *sizer, int nStyle=wxLC_REPORT, wxSize size=wxDefaultSize, int id=wxID_ANY)
This member function creates the layout for a listview control.
void AddSpacer(int nSize=10, wxSizer *sizer=nullptr)
Add extra space between the last added (main) element and the next element to be added.
wxCheckBox * CreateCheckBox(wxWindow *parent, wxSizer *sizer, const wxString &description, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a usual checkbox.
wxStaticBoxSizer * createGroup(const wxString &sGroupName, int orient=wxVERTICAL, wxWindow *parent=nullptr, wxSizer *sizer=nullptr, int expand=0)
Member function to create a group (a static box with a label) in the panel.
wxBoxSizer * getVerticalSizer()
Return the pointer to the vertical sizer.
TextField * CreateTextInput(wxWindow *parent, wxSizer *sizer, const wxString &description, const wxString &sDefault=wxEmptyString, int nStyle=0, int id=wxID_ANY, const wxSize &size=wxSize(310,-1), int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a text input.
This class handles the internal language system and returns the language strings of the selected lang...
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
wxCheckBox * m_replaceInWholeFile
void fillChangesLog(wxListView *listView, const std::vector< wxString > &vChangeLog)
wxCheckBox * m_replaceBeforeCursor
wxTextCtrl * m_replaceName
RenameSymbolsDialog(wxWindow *parent, const std::vector< wxString > &vChangeLog, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxString &defaultval=wxEmptyString)
wxCheckBox * m_replaceAfterCursor
wxCheckBox * m_replaceInComments
std::string toString(int)
Converts an integer to a string without the Settings bloat.