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
Diff: Application/ImageButton.h
- Revision:
- 2:efae611de184
- Child:
- 3:3fabfe3339b8
diff -r 46c8df4608c8 -r efae611de184 Application/ImageButton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Application/ImageButton.h Fri Dec 19 07:37:24 2014 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright 2014 Embedded Artists AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BUTTON_H +#define BUTTON_H + +#include "Clickable.h" +#include "Image.h" + +/** + * The ImageButton is used in the same way as the Button so see it for an example + */ +class ImageButton : public Clickable { +public: + + /** Creates a new button + * + * This button will use a SWIM window to draw on. That window will use + * part of the full size frame buffer to draw on. + * + * @param fb the frame buffer + * @param x the upper left corner of the button + * @param y the upper left corner of the button + * @param width the width of the button + * @param height the height of the button + * @param imgUp the image for the normal state + * @param imgDown the image for the pressed state (or NULL to use the same) + */ + ImageButton(COLOR_T* fb, uint16_t x, uint16_t y, uint16_t width, uint16_t height, const char* imgUp, const char* imgDown = 0); + ~ImageButton(); + + /** Draws the button + */ + virtual void draw(); + +private: + Image::ImageData_t _imgUp; + Image::ImageData_t _imgDown; +}; + +#endif /* BUTTON_H */