Foundation classes for a basic GUI implementing simple widgets and events

Dependents:   TouchScreenGUIDemo

Widgets/BitmapWidget.h

Committer:
duncanFrance
Date:
2016-05-28
Revision:
18:d849f3ada858
Parent:
16:e9a771ecfdbe

File content as of revision 18:d849f3ada858:

#ifndef SIMPLEGUI_BITMAP_WIDGET_H
#define SIMPLEGUI_BITMAP_WIDGET_H

#include "Widget.h"

class BitmapWidget : public Widget {
    
    public:
    
        BitmapWidget(GraphicsContext *context);
        BitmapWidget(GraphicsContext *context, bool monochrome);
                
        // Ccncrete methods for this class
        void setBitmap(unsigned char const * bitmap, int width, int height);
        
        // Set to draw the bitmap in monochrome
        void setMonochrome(bool enabled);
        bool isMonochrome();
        
        // Override to accommodate auto-resizing (yes, yes. sorry)
        virtual void setBorder(int width, uint16_t color);
    
    protected:

        virtual void _draw();      
            
        unsigned char* _bitmap;
        bool _monochrome;
        int _bitmapWidth, _bitmapHeight;
};

#endif