Wrapper classes for the emwin library
Dependents: app_emwin1 app_emwin2_pos lpc4088_ebb_gui_emwin
EwWindow.h@1:0b16165ada7c, 2014-04-14 (annotated)
- Committer:
- embeddedartists
- Date:
- Mon Apr 14 08:38:33 2014 +0000
- Revision:
- 1:0b16165ada7c
- Parent:
- 0:316c181e9b65
Initialize uninitialized touchState in EwGui
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 0:316c181e9b65 | 1 | |
embeddedartists | 0:316c181e9b65 | 2 | #ifndef EWWINDOW_H |
embeddedartists | 0:316c181e9b65 | 3 | #define EWWINDOW_H |
embeddedartists | 0:316c181e9b65 | 4 | |
embeddedartists | 0:316c181e9b65 | 5 | #include "EwPainter.h" |
embeddedartists | 0:316c181e9b65 | 6 | |
embeddedartists | 0:316c181e9b65 | 7 | #include "GUI.h" |
embeddedartists | 0:316c181e9b65 | 8 | #include "WM.h" |
embeddedartists | 0:316c181e9b65 | 9 | #include "FRAMEWIN.h" |
embeddedartists | 0:316c181e9b65 | 10 | |
embeddedartists | 0:316c181e9b65 | 11 | enum EwTouchState_t { |
embeddedartists | 0:316c181e9b65 | 12 | TouchStatePressed = 0, |
embeddedartists | 0:316c181e9b65 | 13 | TouchStateReleased, |
embeddedartists | 0:316c181e9b65 | 14 | TouchStateReleasedOutside |
embeddedartists | 0:316c181e9b65 | 15 | }; |
embeddedartists | 0:316c181e9b65 | 16 | |
embeddedartists | 0:316c181e9b65 | 17 | /** |
embeddedartists | 0:316c181e9b65 | 18 | * This is base class for all EwGui wrapper classes. It is related to |
embeddedartists | 0:316c181e9b65 | 19 | * the emwin WM interface. |
embeddedartists | 0:316c181e9b65 | 20 | */ |
embeddedartists | 0:316c181e9b65 | 21 | class EwWindow { |
embeddedartists | 0:316c181e9b65 | 22 | public: |
embeddedartists | 0:316c181e9b65 | 23 | |
embeddedartists | 0:316c181e9b65 | 24 | EwWindow(EwWindow* parent = 0); |
embeddedartists | 0:316c181e9b65 | 25 | EwWindow(int x, int y, int width, int height, EwWindow* parent = 0); |
embeddedartists | 0:316c181e9b65 | 26 | ~EwWindow(); |
embeddedartists | 0:316c181e9b65 | 27 | |
embeddedartists | 0:316c181e9b65 | 28 | void setParent(EwWindow* parent); |
embeddedartists | 0:316c181e9b65 | 29 | void bringToBottom(); |
embeddedartists | 0:316c181e9b65 | 30 | void bringToTop(); |
embeddedartists | 0:316c181e9b65 | 31 | void disable(); |
embeddedartists | 0:316c181e9b65 | 32 | void enable(); |
embeddedartists | 0:316c181e9b65 | 33 | bool hasTransparency(); |
embeddedartists | 0:316c181e9b65 | 34 | int getX(); |
embeddedartists | 0:316c181e9b65 | 35 | int getY(); |
embeddedartists | 0:316c181e9b65 | 36 | int getWidth(); |
embeddedartists | 0:316c181e9b65 | 37 | int getHeight(); |
embeddedartists | 0:316c181e9b65 | 38 | bool hasInput(); |
embeddedartists | 0:316c181e9b65 | 39 | bool hasFocus(); |
embeddedartists | 0:316c181e9b65 | 40 | bool getStayOnTop(); |
embeddedartists | 0:316c181e9b65 | 41 | |
embeddedartists | 0:316c181e9b65 | 42 | void hide(); |
embeddedartists | 0:316c181e9b65 | 43 | void invalidate(); |
embeddedartists | 0:316c181e9b65 | 44 | |
embeddedartists | 0:316c181e9b65 | 45 | bool isCompletelyCovered(); |
embeddedartists | 0:316c181e9b65 | 46 | bool isCompletelyVisible(); |
embeddedartists | 0:316c181e9b65 | 47 | bool isEnabled(); |
embeddedartists | 0:316c181e9b65 | 48 | bool isVisible(); |
embeddedartists | 0:316c181e9b65 | 49 | |
embeddedartists | 0:316c181e9b65 | 50 | void makeModal(); |
embeddedartists | 0:316c181e9b65 | 51 | void moveTo(int x, int y); |
embeddedartists | 0:316c181e9b65 | 52 | void moveToAbs(int x, int y); |
embeddedartists | 0:316c181e9b65 | 53 | void move(int dx, int dy); |
embeddedartists | 0:316c181e9b65 | 54 | |
embeddedartists | 0:316c181e9b65 | 55 | void repaint(); |
embeddedartists | 0:316c181e9b65 | 56 | void repaintAll(); |
embeddedartists | 0:316c181e9b65 | 57 | |
embeddedartists | 0:316c181e9b65 | 58 | void resize(int dx, int dy); |
embeddedartists | 0:316c181e9b65 | 59 | void resizeTo(int width, int height); |
embeddedartists | 0:316c181e9b65 | 60 | void setFocus(); |
embeddedartists | 0:316c181e9b65 | 61 | void setHasTransparency(bool hasTrans); |
embeddedartists | 0:316c181e9b65 | 62 | void setStayOnTop(bool onTop); |
embeddedartists | 0:316c181e9b65 | 63 | |
embeddedartists | 0:316c181e9b65 | 64 | void show(); |
embeddedartists | 0:316c181e9b65 | 65 | void update(); |
embeddedartists | 0:316c181e9b65 | 66 | void updateAll(); |
embeddedartists | 0:316c181e9b65 | 67 | |
embeddedartists | 0:316c181e9b65 | 68 | static ewColor_t setDesktopColor(ewColor_t c); |
embeddedartists | 0:316c181e9b65 | 69 | |
embeddedartists | 0:316c181e9b65 | 70 | virtual bool paintEvent(); |
embeddedartists | 0:316c181e9b65 | 71 | virtual bool touchEvent(int x, int y, EwTouchState_t state); |
embeddedartists | 0:316c181e9b65 | 72 | virtual bool focusEvent(bool gotFocus); |
embeddedartists | 0:316c181e9b65 | 73 | virtual bool resizedEvent(); |
embeddedartists | 0:316c181e9b65 | 74 | |
embeddedartists | 0:316c181e9b65 | 75 | protected: |
embeddedartists | 0:316c181e9b65 | 76 | GUI_HWIN _hWnd; |
embeddedartists | 0:316c181e9b65 | 77 | static int _guiWidgetId; |
embeddedartists | 0:316c181e9b65 | 78 | |
embeddedartists | 0:316c181e9b65 | 79 | |
embeddedartists | 0:316c181e9b65 | 80 | void _setNewHandle(GUI_HWIN hWnd, void (*callbackFunc)(WM_MESSAGE* pMsg, EwWindow* w)); |
embeddedartists | 0:316c181e9b65 | 81 | GUI_HWIN _getHandle(EwWindow* w); |
embeddedartists | 0:316c181e9b65 | 82 | |
embeddedartists | 0:316c181e9b65 | 83 | private: |
embeddedartists | 0:316c181e9b65 | 84 | |
embeddedartists | 0:316c181e9b65 | 85 | |
embeddedartists | 0:316c181e9b65 | 86 | void init(int x, int y, int width, int height, EwWindow* parent); |
embeddedartists | 0:316c181e9b65 | 87 | |
embeddedartists | 0:316c181e9b65 | 88 | }; |
embeddedartists | 0:316c181e9b65 | 89 | |
embeddedartists | 0:316c181e9b65 | 90 | #endif |