Files
oboe/osx/dialogxml/dialog.keys.h
Celtic Minstrel 56f73cb156 Lots of little tweaks and fixes to various things, mostly dialog stuff.
- LED groups now trigger their own click handler in addition to the clicked LED's click handler (provided the latter returns true). If the handler returns false, the click has no effect.
- LED groups now cancel the selection change if their focus handler returns false; this mimics the behaviour when an individual LED's focus handler returns false.
- Move the dialog getResult() definitions inline - since there's only two of them now that I'm using boost::any, having them in a separate file is pointless.
- Changed how the pict choice dialog returns its result - now it returns only whether the user clicked cancel and provides getters to obtain the number and type.
- Pict and string choice dialogs now hide the arrow buttons when there is only one page of options.
- Fix pict choice dialog always returning the initially selected value (similar to how the string choice dialog did before I fixed it)
- When passed an invalid starting selection, the pict choice dialog now always starts with the first icon selected
- Fix wrong bounds for several typs of custom graphics in dialogs
- Fix wrong /source/ bounds for custom 28x36 graphics /everywhere in the game/.
- Fix select PC graphic dialog having a second page with an invalid graphic that can be selected.
2014-12-05 23:48:07 -05:00

49 lines
1.3 KiB
C

//
// dialog.keys.h
// BoE
//
// Created by Celtic Minstrel on 14-03-31.
//
//
#ifndef BoE_dialog_keys_h
#define BoE_dialog_keys_h
enum eKeyMod {
mod_none = 0,
mod_alt = 1, mod_shift = 2, mod_ctrl = 4,
mod_altshift = mod_alt + mod_shift,
mod_altctrl = mod_alt + mod_ctrl,
mod_shiftctrl = mod_shift + mod_ctrl,
mod_all = mod_alt + mod_shift + mod_ctrl,
};
enum eSpecKey {
key_left, key_right, key_up, key_down,
key_esc, key_enter, key_tab, key_help, // key_help should bind to the help key on Mac and the F1 key on Windows
key_bsp, key_del, key_home, key_end, key_pgup, key_pgdn, // TODO: Implement these
key_copy, key_cut, key_paste, key_selectall
// TODO: On Mac, command-left should trigger key_home; command-right should trigger key_end;
// command-up should trigger key_pgup; and command-down should trigger key_pgdn.
// This is in addition to the home, end, pgup, pgdn keys triggering these.
};
struct cKey {
bool spec;
union {
unsigned char c;
eSpecKey k;
};
eKeyMod mod;
};
eKeyMod operator + (eKeyMod lhs, eKeyMod rhs);
eKeyMod operator - (eKeyMod lhs, eKeyMod rhs);
eKeyMod&operator += (eKeyMod&lhs, eKeyMod rhs);
eKeyMod&operator -= (eKeyMod&lhs, eKeyMod rhs);
bool operator== (cKey a, cKey b);
bool mod_contains(eKeyMod haystack, eKeyMod needle);
#endif