typedef wxMenu* MenuID;
#endif
-#if PLAT_GTK || PLAT_WX
-#define SHIFT_PRESSED 1
-#define LEFT_CTRL_PRESSED 2
-#define LEFT_ALT_PRESSED 4
-#endif
-
// Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably
class Point {
};
class Font {
+protected:
FontID id;
#if PLAT_WX
int ascent;
Font &operator=(const Font &) { id=0; return *this; }
public:
Font();
- ~Font();
+ virtual ~Font();
- void Create(const char *faceName, int characterSet, int size, bool bold, bool italic);
- void Release();
+ virtual void Create(const char *faceName, int characterSet, int size, bool bold, bool italic);
+ virtual void Release();
FontID GetID() { return id; }
// Alias another font - caller guarantees not to Release
void Show(bool show=true);
void InvalidateAll();
void InvalidateRectangle(PRectangle rc);
- void SetFont(Font &font);
+ virtual void SetFont(Font &font);
enum Cursor { cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow };
void SetCursor(Cursor curs);
void SetTitle(const char *s);
WindowID scroller;
int current;
#endif
+ int desiredVisibleRows;
+ unsigned int maxItemCharacters;
+ unsigned int aveCharWidth;
public:
ListBox();
virtual ~ListBox();
- ListBox &operator=(WindowID id_) {
- id = id_;
- return *this;
- }
void Create(Window &parent, int ctrlID);
+ virtual void SetFont(Font &font);
+ void SetAverageCharWidth(int width);
+ void SetVisibleRows(int rows);
+ PRectangle GetDesiredRect();
void Clear();
void Append(char *s);
int Length();
// These are utility functions not really tied to a platform
static int Minimum(int a, int b);
static int Maximum(int a, int b);
+ // Next three assume 16 bit shorts and 32 bit longs
+ static long LongFromTwoShorts(short a,short b) {
+ return (a) | ((b) << 16);
+ }
+ static short HighShortFromLong(long x) {
+ return static_cast<short>(x >> 16);
+ }
+ static short LowShortFromLong(long x) {
+ return static_cast<short>(x & 0xffff);
+ }
static void DebugPrintf(const char *format, ...);
static int Clamp(int val, int minVal, int maxVal);
};