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 EmbeddedArtists AB

Committer:
embeddedartists
Date:
Fri Dec 19 09:12:51 2014 +0100
Revision:
3:3fabfe3339b8
Parent:
1:46c8df4608c8
Child:
5:f4de114c31c3
- Fixed bug in Clickable
- Fixed missing include in Image
- Updated to match the new TouchPanel interface

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 1:46c8df4608c8 1 /*
embeddedartists 1:46c8df4608c8 2 * Copyright 2014 Embedded Artists AB
embeddedartists 1:46c8df4608c8 3 *
embeddedartists 1:46c8df4608c8 4 * Licensed under the Apache License, Version 2.0 (the "License");
embeddedartists 1:46c8df4608c8 5 * you may not use this file except in compliance with the License.
embeddedartists 1:46c8df4608c8 6 * You may obtain a copy of the License at
embeddedartists 1:46c8df4608c8 7 *
embeddedartists 1:46c8df4608c8 8 * http://www.apache.org/licenses/LICENSE-2.0
embeddedartists 1:46c8df4608c8 9 *
embeddedartists 1:46c8df4608c8 10 * Unless required by applicable law or agreed to in writing, software
embeddedartists 1:46c8df4608c8 11 * distributed under the License is distributed on an "AS IS" BASIS,
embeddedartists 1:46c8df4608c8 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
embeddedartists 1:46c8df4608c8 13 * See the License for the specific language governing permissions and
embeddedartists 1:46c8df4608c8 14 * limitations under the License.
embeddedartists 1:46c8df4608c8 15 */
embeddedartists 1:46c8df4608c8 16
embeddedartists 0:4977187e90c7 17 #ifndef APP_LAUNCHER_H
embeddedartists 0:4977187e90c7 18 #define APP_LAUNCHER_H
embeddedartists 0:4977187e90c7 19
embeddedartists 0:4977187e90c7 20 #include "App.h"
embeddedartists 0:4977187e90c7 21 #include "DMBoard.h"
embeddedartists 0:4977187e90c7 22 #include "lpc_swim.h"
embeddedartists 3:3fabfe3339b8 23 #include "Clickable.h"
embeddedartists 0:4977187e90c7 24
embeddedartists 0:4977187e90c7 25 /**
embeddedartists 1:46c8df4608c8 26 * An App example. This uses a number of buttons to launch different Apps.
embeddedartists 0:4977187e90c7 27 *
embeddedartists 1:46c8df4608c8 28 * The purpose of this example is to demonstrate how to manage a set of
embeddedartists 1:46c8df4608c8 29 * Apps and launch them either as a result of clicked buttons or (in the
embeddedartists 1:46c8df4608c8 30 * case of the TouchCalibrationApp) after an extended press of the USER
embeddedartists 1:46c8df4608c8 31 * button on the back of the display module.
embeddedartists 0:4977187e90c7 32 */
embeddedartists 0:4977187e90c7 33 class AppLauncher : public App {
embeddedartists 0:4977187e90c7 34 public:
embeddedartists 0:4977187e90c7 35
embeddedartists 0:4977187e90c7 36 AppLauncher();
embeddedartists 0:4977187e90c7 37 ~AppLauncher();
embeddedartists 0:4977187e90c7 38
embeddedartists 0:4977187e90c7 39 virtual bool setup();
embeddedartists 0:4977187e90c7 40 virtual void runToCompletion();
embeddedartists 0:4977187e90c7 41 virtual bool teardown();
embeddedartists 0:4977187e90c7 42
embeddedartists 0:4977187e90c7 43 private:
embeddedartists 0:4977187e90c7 44 enum Constants {
embeddedartists 0:4977187e90c7 45 TitleHeight = 20,
embeddedartists 0:4977187e90c7 46 ButtonWidth = 75,
embeddedartists 0:4977187e90c7 47 ButtonHeight = 75,
embeddedartists 0:4977187e90c7 48 ButtonRows = 2,
embeddedartists 0:4977187e90c7 49 ButtonColumns = 5,
embeddedartists 0:4977187e90c7 50 NumberOfButtons = ButtonRows*ButtonColumns,
embeddedartists 0:4977187e90c7 51 };
embeddedartists 0:4977187e90c7 52
embeddedartists 0:4977187e90c7 53 Display* _disp;
embeddedartists 0:4977187e90c7 54 SWIM_WINDOW_T* _win;
embeddedartists 0:4977187e90c7 55 void* _fb;
embeddedartists 3:3fabfe3339b8 56 Clickable* _buttons[NumberOfButtons];
embeddedartists 0:4977187e90c7 57 int _usedButtons;
embeddedartists 0:4977187e90c7 58
embeddedartists 0:4977187e90c7 59 void draw();
embeddedartists 0:4977187e90c7 60 void addButton(uint32_t buttonID, const char* caption);
embeddedartists 3:3fabfe3339b8 61 void addImageButton(uint32_t buttonID, const char* imgUp, const char* imgDown = 0);
embeddedartists 0:4977187e90c7 62 };
embeddedartists 0:4977187e90c7 63
embeddedartists 0:4977187e90c7 64 #endif