Improvements to keyboard handling (TAB)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@660 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-09-02 01:03:37 +00:00
parent 4840ba824c
commit 100d48b5a7
19 changed files with 105 additions and 54 deletions
+7 -5
View File
@@ -29,17 +29,18 @@ DECLARE_EVENT_TYPE(EVENT_GALLERY_ACTIVATE, <not used>)
*/
class GalleryList : public wxScrolledWindow {
public:
GalleryList(Window* parent, int id, int direction = wxHORIZONTAL);
GalleryList(Window* parent, int id, int direction = wxHORIZONTAL, bool always_focused = true);
/// Is there an item selected?
inline bool hasSelection() const { return selection < itemCount(); }
protected:
static const size_t NO_SELECTION = (size_t)-1;
size_t selection; ///< The selected item, or NO_SELECTION if there is no selection
wxSize item_size; ///< The size of a single item
int direction; ///< Direction of the list, can be wxHORIZONTAL or wxVERTICAL
int scroll_increment; ///< How large are the scroll steps?
size_t selection; ///< The selected item, or NO_SELECTION if there is no selection
wxSize item_size; ///< The size of a single item
int direction; ///< Direction of the list, can be wxHORIZONTAL or wxVERTICAL
int scroll_increment; ///< How large are the scroll steps?
bool always_focused; ///< Always draw as if focused
/// Redraw the list after changing the selection or the number of items
void update();
@@ -58,6 +59,7 @@ class GalleryList : public wxScrolledWindow {
void onLeftDown (wxMouseEvent& ev);
void onLeftDClick(wxMouseEvent& ev);
void onChar(wxKeyEvent& ev);
void onFocus(wxFocusEvent&);
void onPaint(wxPaintEvent&);
void onSize(wxSizeEvent&);
void OnDraw(DC& dc);