mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fancy theming of ListCtrls: explorer style (windows vista+)
This requires that we ev.Skip() EVT_MOTION, otherwise the list becomes very sluggish to update. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1611 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include <gui/control/card_list.hpp>
|
||||
#include <gui/control/card_list_column_select.hpp>
|
||||
#include <gui/icon_menu.hpp>
|
||||
#include <gui/util.hpp>
|
||||
#include <data/game.hpp>
|
||||
#include <data/field.hpp>
|
||||
#include <data/field/choice.hpp>
|
||||
@@ -57,7 +56,6 @@ CardListBase::CardListBase(Window* parent, int id, long additional_style)
|
||||
{
|
||||
// add to the list of card lists
|
||||
card_lists.push_back(this);
|
||||
//enable_themed_selection_rectangle(this); // while this looks fancy, it is buggy
|
||||
}
|
||||
|
||||
CardListBase::~CardListBase() {
|
||||
@@ -368,6 +366,7 @@ void CardListBase::onChar(wxKeyEvent& ev) {
|
||||
}
|
||||
|
||||
void CardListBase::onDrag(wxMouseEvent& ev) {
|
||||
ev.Skip();
|
||||
if (!allowModify()) return;
|
||||
if (ev.Dragging() && selected_item && sort_by_column < 0) {
|
||||
// reorder card list
|
||||
@@ -381,6 +380,7 @@ void CardListBase::onDrag(wxMouseEvent& ev) {
|
||||
// move card in the set
|
||||
set->actions.addAction(new ReorderCardsAction(*set, item, selected_item_pos));
|
||||
}
|
||||
ev.Skip(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,13 @@ ItemList::ItemList(Window* parent, int id, long additional_style, bool multi_sel
|
||||
il->Add(load_resource_image(_("sort_asc")), Color(255,0,255));
|
||||
il->Add(load_resource_image(_("sort_desc")), Color(255,0,255));
|
||||
AssignImageList(il, wxIMAGE_LIST_SMALL);
|
||||
// Theming things wx fails to do for us
|
||||
#if defined(__WXMSW__) && defined(LVS_EX_DOUBLEBUFFER)
|
||||
// Fancy theming (on windows)
|
||||
enable_themed_selection_rectangle(this);
|
||||
// Use double buffering
|
||||
ListView_SetExtendedListViewStyle(GetHwnd(), ListView_GetExtendedListViewStyle(GetHwnd()) | LVS_EX_DOUBLEBUFFER);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : ItemList : Selection
|
||||
|
||||
Reference in New Issue
Block a user