mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
- Added SetWindow::setControlStatusText function for setting the status text of child controls, since wx lacks a feature for doing it automatically.
- RandomPackPanel's spin controls are cleaned up when the set is reloaded
- to_int script function now converts empty string: to_int("") == 0
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1042 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -245,6 +245,32 @@ void SetWindow::selectPanel(int id) {
|
||||
current_panel->SetFocus();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Status text for controls
|
||||
|
||||
void SetWindow::setControlStatusText(wxWindow* control, const String& text) {
|
||||
for (size_t i = 0 ; i < control_status_texts.size() ; ++i) {
|
||||
if (control_status_texts[i].first == control) {
|
||||
control_status_texts[i].second = text;
|
||||
return;
|
||||
}
|
||||
}
|
||||
control_status_texts.push_back(make_pair(control,text));
|
||||
control->Connect(wxEVT_ENTER_WINDOW,(wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)onControlEnter,nullptr,this);
|
||||
control->Connect(wxEVT_LEAVE_WINDOW,(wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)onControlLeave,nullptr,this);
|
||||
}
|
||||
void SetWindow::onControlEnter(wxMouseEvent& ev) {
|
||||
for (size_t i = 0 ; i < control_status_texts.size() ; ++i) {
|
||||
if (control_status_texts[i].first == ev.GetEventObject()) {
|
||||
SetStatusText(control_status_texts[i].second);
|
||||
}
|
||||
}
|
||||
ev.Skip();
|
||||
}
|
||||
void SetWindow::onControlLeave(wxMouseEvent& ev) {
|
||||
SetStatusText(wxEmptyString);
|
||||
ev.Skip();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Window managment
|
||||
|
||||
vector<SetWindow*> SetWindow::set_windows;
|
||||
|
||||
Reference in New Issue
Block a user