mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Eliminated most build errors (gcc,linux,wxGTK).
What is left is mostly:
- warning: converting double to int
-> add a cast/to_int or ignore
- wrong initialization order in ctor
-> just swap the order to match the class
- errors about wxCursors
-> add a function loadResourceCursor
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@183 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -22,13 +22,13 @@ const int BORDER = 1; // margin between items
|
||||
|
||||
GalleryList::GalleryList(Window* parent, int id, int direction)
|
||||
: wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | (direction == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL) )
|
||||
, direction(direction)
|
||||
, selection(NO_SELECTION)
|
||||
, direction(direction)
|
||||
{}
|
||||
|
||||
void GalleryList::update() {
|
||||
const int w = item_size.width + MARGIN + 2*BORDER;
|
||||
const int h = item_size.height + MARGIN + 2*BORDER;
|
||||
const int w = (int)item_size.width + MARGIN + 2*BORDER;
|
||||
const int h = (int)item_size.height + MARGIN + 2*BORDER;
|
||||
// resize and scroll
|
||||
if (direction == wxHORIZONTAL) {
|
||||
SetVirtualSize(w * (int)itemCount() + MARGIN, h + MARGIN);
|
||||
@@ -56,11 +56,11 @@ void GalleryList::update() {
|
||||
|
||||
size_t GalleryList::findItem(const wxMouseEvent& ev) const {
|
||||
if (direction == wxHORIZONTAL) {
|
||||
int x, w = item_size.width + MARGIN + 2*BORDER;
|
||||
int x, w = (int)item_size.width + MARGIN + 2*BORDER;
|
||||
GetViewStart (&x, 0);
|
||||
return static_cast<size_t>( x + ev.GetX() / w );
|
||||
} else { // wxVERTICAL
|
||||
int y, h = item_size.height + MARGIN + 2*BORDER;
|
||||
int y, h = (int)item_size.height + MARGIN + 2*BORDER;
|
||||
GetViewStart (0, &y);
|
||||
return static_cast<size_t>( y + ev.GetY() / h );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user