20#include "../../kernel/core/ui/language.hpp"
23#define ELEMENT_BORDER 5
35GroupPanel::GroupPanel(wxWindow* parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
long style,
bool useVerticalSizer) : wxScrolledWindow(parent, id, pos, size, style | wxVSCROLL)
125 sizer->AddSpacer(nSize);
142 wxStaticText* staticText =
new wxStaticText(parent,
id, text, wxDefaultPosition, wxDefaultSize, 0);
143 sizer->Add(staticText, 0, alignment | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
ELEMENT_BORDER);
161wxStaticBoxSizer*
GroupPanel::createGroup(
const wxString& sGroupName,
int orient, wxWindow* parent, wxSizer* sizer,
int expand)
170 wxStaticBoxSizer* groupSizer =
new wxStaticBoxSizer(orient, parent, sGroupName);
195 wxBoxSizer* groupSizer =
new wxBoxSizer(orient);
198 sizer->Add(groupSizer, expand, wxEXPAND | wxALL, 0);
223 wxCollapsiblePane* collpane =
new wxCollapsiblePane(parent, wxID_ANY, label, wxDefaultPosition, wxDefaultSize, wxCP_NO_TLW_RESIZE | wxCP_DEFAULT_STYLE);
226 sizer->Add(collpane, 1, wxEXPAND | wxALL | wxRESERVE_SPACE_EVEN_IF_HIDDEN, 1);
248 wxStaticText* inputStaticText =
new wxStaticText(parent, wxID_STATIC, description, wxDefaultPosition, wxDefaultSize, 0);
249 sizer->Add(inputStaticText, 0, wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
ELEMENT_BORDER);
253 wxBoxSizer* hSizer =
new wxBoxSizer(wxHORIZONTAL);
254 sizer->Add(hSizer, wxALIGN_LEFT);
257 wxTextCtrl* textCtrl =
new wxTextCtrl(parent,
id, wxEmptyString, wxDefaultPosition, wxSize(310, -1), wxTE_PROCESS_ENTER);
260 wxButton* button =
new wxButton(parent, buttonID,
_guilang.
get(
"GUI_OPTIONS_CHOOSE"));
263 hSizer->Add(textCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM,
ELEMENT_BORDER);
264 hSizer->Add(button, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM,
ELEMENT_BORDER);
287 wxStaticText* inputStaticText =
nullptr;
289 if (description.length())
291 inputStaticText =
new wxStaticText(parent, wxID_STATIC, description, wxDefaultPosition, wxDefaultSize, 0);
292 sizer->Add(inputStaticText, 0, alignment | wxLEFT | wxTOP | wxRIGHT | wxADJUST_MINSIZE | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
297 textCtrl->
m_label = inputStaticText;
298 sizer->Add(textCtrl, 0, alignment | wxALL | wxEXPAND | wxFIXED_MINSIZE | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
319 wxCheckBox* checkBox =
new wxCheckBox(parent,
id, description, wxDefaultPosition, wxDefaultSize, 0);
320 sizer->Add(checkBox, 0, alignment | wxALL | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
346 wxBoxSizer* spinCtrlSizer =
new wxBoxSizer(wxHORIZONTAL);
350 SpinBut* spinCtrl =
new SpinBut(parent,
id, wxSize(60, -1), nMin, nMax, nInitial);
353 wxStaticText* spinCtrlStaticText =
new wxStaticText(parent, wxID_STATIC, description, wxDefaultPosition, wxDefaultSize, 0);
354 spinCtrl->
m_label = spinCtrlStaticText;
357 spinCtrlSizer->Add(spinCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL | wxRESERVE_SPACE_EVEN_IF_HIDDEN, 0);
358 spinCtrlSizer->Add(spinCtrlStaticText, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxADJUST_MINSIZE | wxRESERVE_SPACE_EVEN_IF_HIDDEN, 3);
379 wxListView* listView =
new wxListView(parent,
id, wxDefaultPosition, size, nStyle);
380 sizer->Add(listView, 1, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND | wxFIXED_MINSIZE,
ELEMENT_BORDER);
403 listCtrl->SetMinClientSize(wxSize(100,200));
404 sizer->Add(listCtrl, 1, alignment | wxALL | wxEXPAND | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
427 wxcode::wxTreeListCtrl* listCtrl =
new wxcode::wxTreeListCtrl(parent,
id, wxDefaultPosition, size, nStyle);
428 listCtrl->SetMinClientSize(wxSize(100,200));
429 sizer->Add(listCtrl, 1, alignment | wxALL | wxEXPAND | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
449 wxButton* button =
new wxButton(parent,
id, description);
452 sizer->Add(button, 0, alignment | wxALL | wxFIXED_MINSIZE | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
454 sizer->Add(button, 1, alignment | wxALL | wxFIXED_MINSIZE | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
474wxRadioBox*
GroupPanel::CreateRadioBox(wxWindow* parent, wxSizer* sizer,
const wxString& description,
const wxArrayString& choices,
int style,
int id,
int alignment)
476 wxRadioBox* box =
new wxRadioBox(parent,
id, description, wxDefaultPosition, wxDefaultSize, choices, 0, style);
477 sizer->Add(box, 0, alignment | wxALL | wxEXPAND | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
497 wxChoice* box =
new wxChoice(parent,
id, wxDefaultPosition, wxDefaultSize, choices);
499 if (
dynamic_cast<wxBoxSizer*
>(sizer) &&
dynamic_cast<wxBoxSizer*
>(sizer)->GetOrientation() == wxHORIZONTAL)
500 sizer->Add(box, 1, alignment | wxALL | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
502 sizer->Add(box, 0, alignment | wxALL | wxEXPAND | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
522 wxComboBox* box =
new wxComboBox(parent,
id, wxEmptyString, wxDefaultPosition, wxDefaultSize, choices);
524 if (
dynamic_cast<wxBoxSizer*
>(sizer) &&
dynamic_cast<wxBoxSizer*
>(sizer)->GetOrientation() == wxHORIZONTAL)
525 sizer->Add(box, 1, alignment | wxALL | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
527 sizer->Add(box, 0, alignment | wxALL | wxEXPAND | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
547 wxGauge* gauge =
new wxGauge(parent,
id, 100, wxDefaultPosition, wxDefaultSize, style);
548 sizer->Add(gauge, 0, alignment | wxALL | wxEXPAND | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
568 wxStaticBitmap* bitmap =
new wxStaticBitmap(parent,
id, wxBitmap(filename, wxBITMAP_TYPE_ANY));
569 sizer->Add(bitmap, 0, alignment | wxALL | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
590wxSlider*
GroupPanel::CreateSlider(wxWindow* parent, wxSizer* sizer,
int nMin,
int nMax,
int nInitial,
int style,
int id,
int alignment)
592 wxSlider* slider =
new wxSlider(parent,
id, nInitial, nMin, nMax, wxDefaultPosition, wxDefaultSize, style);
593 sizer->Add(slider, 0, alignment | wxALL | wxEXPAND | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
ELEMENT_BORDER);
wxStaticText * AddStaticText(wxWindow *parent, wxSizer *sizer, const wxString &text, int id=wxID_STATIC, int alignment=wxALIGN_CENTER_VERTICAL)
Add some static test to the current sizer and window.
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.
wxGauge * CreateGauge(wxWindow *parent, wxSizer *sizer, int style, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a progress bar.
wxStaticBitmap * CreateBitmap(wxWindow *parent, wxSizer *sizer, const wxString &filename, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a static bitmap.
SpinBut * CreateSpinControl(wxWindow *parent, wxSizer *sizer, const wxString &description, int nMin, int nMax, int nInitial, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a spin control including the assigned text.
wxTreeListCtrl * CreateTreeListCtrl(wxWindow *parent, wxSizer *sizer, int nStyle=wxTL_SINGLE, wxSize size=wxDefaultSize, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a treelist control.
wxTextCtrl * CreatePathInput(wxWindow *parent, wxSizer *sizer, const wxString &description, int buttonID, int id=wxID_ANY)
This member function creates the layout for a path input dialog including the "choose" button.
void AddSpacer(int nSize=10, wxSizer *sizer=nullptr)
Add extra space between the last added (main) element and the next element to be added.
wxChoice * CreateChoices(wxWindow *parent, wxSizer *sizer, const wxArrayString &choices, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a dropdown list.
wxRadioBox * CreateRadioBox(wxWindow *parent, wxSizer *sizer, const wxString &description, const wxArrayString &choices, int style=wxHORIZONTAL, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a radio box.
wxBoxSizer * horizontalSizer
wxcode::wxTreeListCtrl * CreateWxcTreeListCtrl(wxWindow *parent, wxSizer *sizer, int nStyle=wxTR_TWIST_BUTTONS|wxTR_FULL_ROW_HIGHLIGHT|wxTR_EXTENDED, wxSize size=wxDefaultSize, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a treelist control in the wxCode variant.
wxSlider * CreateSlider(wxWindow *parent, wxSizer *sizer, int nMin, int nMax, int nInitial, int style, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a slider.
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.
wxBoxSizer * getMainSizer()
Return the pointer to the current main layout sizer.
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.
wxComboBox * CreateComboBox(wxWindow *parent, wxSizer *sizer, const wxArrayString &choices, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a combobox.
wxBoxSizer * getVerticalSizer()
Return the pointer to the vertical sizer.
wxBoxSizer * getHorizontalSizer()
Return the pointer to the horizontal sizer.
wxCollapsiblePane * createCollapsibleGroup(const wxString &label, wxWindow *parent=nullptr, wxSizer *sizer=nullptr)
Member function to create a collapsible group.
wxButton * CreateButton(wxWindow *parent, wxSizer *sizer, const wxString &description, int id=wxID_ANY, int alignment=wxALIGN_CENTER_VERTICAL)
This member function creates the layout for a button.
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.
GroupPanel(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, bool useVerticalSizer=true)
Constructor.
wxBoxSizer * verticalSizer
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 ...
This class is a extension to the standard wxSpinCtrl to combine it with a read- and changeable label.
This class is a extension to the standard wxTextCtrl to combine it with a read- and changeable label.