mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
fixed rotation bug
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@143 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -82,12 +82,14 @@ void PackageList::clear() {
|
||||
update();
|
||||
}
|
||||
|
||||
void PackageList::select(const String& name) {
|
||||
void PackageList::select(const String& name, bool send_event) {
|
||||
for (vector<PackageData>::const_iterator it = packages.begin() ; it != packages.end() ; ++it) {
|
||||
if (it->package->name() == name) {
|
||||
selection = it - packages.begin();
|
||||
update();
|
||||
sendEvent(EVENT_GALLERY_SELECT);
|
||||
if (send_event) {
|
||||
sendEvent(EVENT_GALLERY_SELECT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class PackageList : public GalleryList {
|
||||
}
|
||||
|
||||
/// Select the package with the given name, if it is not found, selects nothing
|
||||
void select(const String& name);
|
||||
void select(const String& name, bool send_event = true);
|
||||
|
||||
protected:
|
||||
/// Return how many items there are in the list
|
||||
|
||||
@@ -402,8 +402,8 @@ void TextValueEditor::showCaret() {
|
||||
cursor = rot.tr(cursor);
|
||||
// set size
|
||||
wxSize size = cursor.size();
|
||||
size.SetWidth (max(1, size.GetWidth()));
|
||||
size.SetHeight(max(1, size.GetHeight()));
|
||||
if (size.GetWidth() == 0) size.SetWidth (1);
|
||||
if (size.GetHeight() == 0) size.SetHeight(1);
|
||||
// resize, move, show
|
||||
if (size != caret->GetSize()) {
|
||||
caret->SetSize(size);
|
||||
|
||||
Reference in New Issue
Block a user