Foundation classes for a basic GUI implementing simple widgets and events

Dependents:   TouchScreenGUIDemo

Widgets/BitmapWidget.h

Committer:
duncanFrance
Date:
2016-04-11
Revision:
9:616a9686d5db
Parent:
8:a460cabc85ac
Child:
12:63db16fea709

File content as of revision 9:616a9686d5db:

#ifndef SIMPLEGUI_BITMAP_WIDGET_H
#define SIMPLEGUI_BITMAP_WIDGET_H

#include "Widget.h"

class BitmapWidget : public Widget {
    
    public:
    
        BitmapWidget(GUI* gui);
        BitmapWidget(GUI* gui, bool monochrome);
                
        // Ccncrete methods for this class
        void setBitmap(unsigned char* bitmap);
        
        // Set to draw the bitmap in monochrome
        void setMonochrome(bool enabled);
        bool isMonochrome();
    
    protected:
        // Implementation to account for whether the event's coordinates intersect this widget
        virtual void _draw();      
        virtual void _clear();      
    
        unsigned char* _bitmap;
        bool _monochrome;
};

#endif