A simple yet powerful library for controlling graphical displays. Multiple display controllers are supported using inheritance.
Dependents: mbed_rifletool Hexi_Bubble_Game Hexi_Catch-the-dot_Game Hexi_Acceleromagnetic_Synth
NOTE: This library is in beta right now. As far as I know, everything here works, but there are many features that are lacking so far. Most notably containers, button handling, and display drivers other than the SSD1306.
Controls/TextBox.h@0:b876cf091464, 2013-08-30 (annotated)
- Committer:
- neilt6
- Date:
- Fri Aug 30 17:09:18 2013 +0000
- Revision:
- 0:b876cf091464
- Child:
- 1:f7003ec66a51
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
neilt6 | 0:b876cf091464 | 1 | /* NeatGUI Library |
neilt6 | 0:b876cf091464 | 2 | * Copyright (c) 2013 Neil Thiessen |
neilt6 | 0:b876cf091464 | 3 | * |
neilt6 | 0:b876cf091464 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
neilt6 | 0:b876cf091464 | 5 | * you may not use this file except in compliance with the License. |
neilt6 | 0:b876cf091464 | 6 | * You may obtain a copy of the License at |
neilt6 | 0:b876cf091464 | 7 | * |
neilt6 | 0:b876cf091464 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
neilt6 | 0:b876cf091464 | 9 | * |
neilt6 | 0:b876cf091464 | 10 | * Unless required by applicable law or agreed to in writing, software |
neilt6 | 0:b876cf091464 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
neilt6 | 0:b876cf091464 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
neilt6 | 0:b876cf091464 | 13 | * See the License for the specific language governing permissions and |
neilt6 | 0:b876cf091464 | 14 | * limitations under the License. |
neilt6 | 0:b876cf091464 | 15 | */ |
neilt6 | 0:b876cf091464 | 16 | |
neilt6 | 0:b876cf091464 | 17 | #ifndef TEXT_BOX_H |
neilt6 | 0:b876cf091464 | 18 | #define TEXT_BOX_H |
neilt6 | 0:b876cf091464 | 19 | |
neilt6 | 0:b876cf091464 | 20 | #include "mbed.h" |
neilt6 | 0:b876cf091464 | 21 | #include "Control.h" |
neilt6 | 0:b876cf091464 | 22 | #include "Font.h" |
neilt6 | 0:b876cf091464 | 23 | |
neilt6 | 0:b876cf091464 | 24 | /** TextBox class. |
neilt6 | 0:b876cf091464 | 25 | * Used to display strings in a box. |
neilt6 | 0:b876cf091464 | 26 | */ |
neilt6 | 0:b876cf091464 | 27 | class TextBox : public Control |
neilt6 | 0:b876cf091464 | 28 | { |
neilt6 | 0:b876cf091464 | 29 | public: |
neilt6 | 0:b876cf091464 | 30 | /** Create a TextBox object with the specified size, position, and font |
neilt6 | 0:b876cf091464 | 31 | * |
neilt6 | 0:b876cf091464 | 32 | * @param x The X coordinate of the TextBox. |
neilt6 | 0:b876cf091464 | 33 | * @param y The Y coordinate of the TextBox. |
neilt6 | 0:b876cf091464 | 34 | * @param w The width of the TextBox. |
neilt6 | 0:b876cf091464 | 35 | * @param h The height of the TextBox. |
neilt6 | 0:b876cf091464 | 36 | * @param fnt The font to draw text with. |
neilt6 | 0:b876cf091464 | 37 | */ |
neilt6 | 0:b876cf091464 | 38 | TextBox(int x, int y, int w, int h, Font *fnt); |
neilt6 | 0:b876cf091464 | 39 | |
neilt6 | 0:b876cf091464 | 40 | /** Paint the TextBox on the specified canvas |
neilt6 | 0:b876cf091464 | 41 | * |
neilt6 | 0:b876cf091464 | 42 | * @param canvas Pointer to the canvas to paint on. |
neilt6 | 0:b876cf091464 | 43 | */ |
neilt6 | 0:b876cf091464 | 44 | virtual void paint(Canvas *canvas); |
neilt6 | 0:b876cf091464 | 45 | }; |
neilt6 | 0:b876cf091464 | 46 | |
neilt6 | 0:b876cf091464 | 47 | #endif |