#include <wx/wxprec.h>
#include <wx/wx.h>
#include "../include/wxdragon.h"
#include <wx/bmpbuttn.h>
#include <wx/bitmap.h>
extern "C" {
WXD_EXPORTED void
wxd_BitmapButton_SetBitmapLabel(wxd_BitmapButton_t* self, const wxd_Bitmap_t* bitmap)
{
if (!self)
return;
wxBitmapButton* btn = reinterpret_cast<wxBitmapButton*>(self);
const wxBitmap* bmp = reinterpret_cast<const wxBitmap*>(bitmap);
btn->SetBitmapLabel(bmp ? *bmp : wxNullBitmap);
}
WXD_EXPORTED void
wxd_BitmapButton_SetBitmapDisabled(wxd_BitmapButton_t* self, const wxd_Bitmap_t* bitmap)
{
if (!self)
return;
wxBitmapButton* btn = reinterpret_cast<wxBitmapButton*>(self);
const wxBitmap* bmp = reinterpret_cast<const wxBitmap*>(bitmap);
btn->SetBitmapDisabled(bmp ? *bmp : wxNullBitmap);
}
WXD_EXPORTED void
wxd_BitmapButton_SetBitmapFocus(wxd_BitmapButton_t* self, const wxd_Bitmap_t* bitmap)
{
if (!self)
return;
wxBitmapButton* btn = reinterpret_cast<wxBitmapButton*>(self);
const wxBitmap* bmp = reinterpret_cast<const wxBitmap*>(bitmap);
btn->SetBitmapFocus(bmp ? *bmp : wxNullBitmap);
}
WXD_EXPORTED void
wxd_BitmapButton_SetBitmapHover(wxd_BitmapButton_t* self, const wxd_Bitmap_t* bitmap)
{
if (!self)
return;
wxBitmapButton* btn = reinterpret_cast<wxBitmapButton*>(self);
const wxBitmap* bmp = reinterpret_cast<const wxBitmap*>(bitmap);
btn->SetBitmapCurrent(bmp ? *bmp : wxNullBitmap); }
WXD_EXPORTED wxd_Bitmap_t*
wxd_BitmapButton_GetBitmapLabel(wxd_BitmapButton_t* self)
{
if (!self)
return nullptr;
wxBitmapButton* btn = reinterpret_cast<wxBitmapButton*>(self);
const wxBitmap& bmp = btn->GetBitmapLabel();
if (!bmp.IsOk())
return nullptr;
return (wxd_Bitmap_t*)new wxBitmap(bmp); }
WXD_EXPORTED wxd_Bitmap_t*
wxd_BitmapButton_GetBitmapDisabled(wxd_BitmapButton_t* self)
{
if (!self)
return nullptr;
wxBitmapButton* btn = reinterpret_cast<wxBitmapButton*>(self);
const wxBitmap& bmp = btn->GetBitmapDisabled();
if (!bmp.IsOk())
return nullptr;
return (wxd_Bitmap_t*)new wxBitmap(bmp); }
WXD_EXPORTED wxd_Bitmap_t*
wxd_BitmapButton_GetBitmapFocus(wxd_BitmapButton_t* self)
{
if (!self)
return nullptr;
wxBitmapButton* btn = reinterpret_cast<wxBitmapButton*>(self);
const wxBitmap& bmp = btn->GetBitmapFocus();
if (!bmp.IsOk())
return nullptr;
return (wxd_Bitmap_t*)new wxBitmap(bmp); }
WXD_EXPORTED wxd_Bitmap_t*
wxd_BitmapButton_GetBitmapHover(wxd_BitmapButton_t* self)
{
if (!self)
return nullptr;
wxBitmapButton* btn = reinterpret_cast<wxBitmapButton*>(self);
const wxBitmap& bmp = btn->GetBitmapCurrent(); if (!bmp.IsOk())
return nullptr;
return (wxd_Bitmap_t*)new wxBitmap(bmp); }
}