mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
32 lines
608 B
C++
32 lines
608 B
C++
#include "PLImageWidget.h"
|
|
#include "PLQDraw.h"
|
|
#include "ResourceManager.h"
|
|
|
|
namespace PortabilityLayer
|
|
{
|
|
ImageWidget::ImageWidget(const WidgetBasicState &state)
|
|
: WidgetSpec<ImageWidget>(state)
|
|
{
|
|
}
|
|
|
|
ImageWidget::~ImageWidget()
|
|
{
|
|
}
|
|
|
|
bool ImageWidget::Init(const WidgetBasicState &state)
|
|
{
|
|
m_pict = PortabilityLayer::ResourceManager::GetInstance()->GetResource('PICT', state.m_resID).StaticCast<Picture>();
|
|
|
|
if (!m_pict)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
void ImageWidget::DrawControl(DrawSurface *surface)
|
|
{
|
|
if (m_pict && m_rect.IsValid())
|
|
surface->DrawPicture(m_pict, m_rect);
|
|
}
|
|
}
|