A basic graphics package for the LPC4088 Display Module.
Dependents: lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI lpc4088_displaymodule_fs_aid ... more
Fork of DMBasicGUI by
Application/ImageButton.h@2:efae611de184, 2014-12-19 (annotated)
- Committer:
- embeddedartists
- Date:
- Fri Dec 19 07:37:24 2014 +0000
- Revision:
- 2:efae611de184
- Child:
- 3:3fabfe3339b8
Added ImageButton and Clickable
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 2:efae611de184 | 1 | /* |
embeddedartists | 2:efae611de184 | 2 | * Copyright 2014 Embedded Artists AB |
embeddedartists | 2:efae611de184 | 3 | * |
embeddedartists | 2:efae611de184 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
embeddedartists | 2:efae611de184 | 5 | * you may not use this file except in compliance with the License. |
embeddedartists | 2:efae611de184 | 6 | * You may obtain a copy of the License at |
embeddedartists | 2:efae611de184 | 7 | * |
embeddedartists | 2:efae611de184 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
embeddedartists | 2:efae611de184 | 9 | * |
embeddedartists | 2:efae611de184 | 10 | * Unless required by applicable law or agreed to in writing, software |
embeddedartists | 2:efae611de184 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
embeddedartists | 2:efae611de184 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
embeddedartists | 2:efae611de184 | 13 | * See the License for the specific language governing permissions and |
embeddedartists | 2:efae611de184 | 14 | * limitations under the License. |
embeddedartists | 2:efae611de184 | 15 | */ |
embeddedartists | 2:efae611de184 | 16 | |
embeddedartists | 2:efae611de184 | 17 | #ifndef BUTTON_H |
embeddedartists | 2:efae611de184 | 18 | #define BUTTON_H |
embeddedartists | 2:efae611de184 | 19 | |
embeddedartists | 2:efae611de184 | 20 | #include "Clickable.h" |
embeddedartists | 2:efae611de184 | 21 | #include "Image.h" |
embeddedartists | 2:efae611de184 | 22 | |
embeddedartists | 2:efae611de184 | 23 | /** |
embeddedartists | 2:efae611de184 | 24 | * The ImageButton is used in the same way as the Button so see it for an example |
embeddedartists | 2:efae611de184 | 25 | */ |
embeddedartists | 2:efae611de184 | 26 | class ImageButton : public Clickable { |
embeddedartists | 2:efae611de184 | 27 | public: |
embeddedartists | 2:efae611de184 | 28 | |
embeddedartists | 2:efae611de184 | 29 | /** Creates a new button |
embeddedartists | 2:efae611de184 | 30 | * |
embeddedartists | 2:efae611de184 | 31 | * This button will use a SWIM window to draw on. That window will use |
embeddedartists | 2:efae611de184 | 32 | * part of the full size frame buffer to draw on. |
embeddedartists | 2:efae611de184 | 33 | * |
embeddedartists | 2:efae611de184 | 34 | * @param fb the frame buffer |
embeddedartists | 2:efae611de184 | 35 | * @param x the upper left corner of the button |
embeddedartists | 2:efae611de184 | 36 | * @param y the upper left corner of the button |
embeddedartists | 2:efae611de184 | 37 | * @param width the width of the button |
embeddedartists | 2:efae611de184 | 38 | * @param height the height of the button |
embeddedartists | 2:efae611de184 | 39 | * @param imgUp the image for the normal state |
embeddedartists | 2:efae611de184 | 40 | * @param imgDown the image for the pressed state (or NULL to use the same) |
embeddedartists | 2:efae611de184 | 41 | */ |
embeddedartists | 2:efae611de184 | 42 | ImageButton(COLOR_T* fb, uint16_t x, uint16_t y, uint16_t width, uint16_t height, const char* imgUp, const char* imgDown = 0); |
embeddedartists | 2:efae611de184 | 43 | ~ImageButton(); |
embeddedartists | 2:efae611de184 | 44 | |
embeddedartists | 2:efae611de184 | 45 | /** Draws the button |
embeddedartists | 2:efae611de184 | 46 | */ |
embeddedartists | 2:efae611de184 | 47 | virtual void draw(); |
embeddedartists | 2:efae611de184 | 48 | |
embeddedartists | 2:efae611de184 | 49 | private: |
embeddedartists | 2:efae611de184 | 50 | Image::ImageData_t _imgUp; |
embeddedartists | 2:efae611de184 | 51 | Image::ImageData_t _imgDown; |
embeddedartists | 2:efae611de184 | 52 | }; |
embeddedartists | 2:efae611de184 | 53 | |
embeddedartists | 2:efae611de184 | 54 | #endif /* BUTTON_H */ |