#include <wx/wxprec.h>
#include <wx/wx.h>
#include "../include/wxdragon.h"
#include <wx/slider.h>
inline wxPoint
wxdPointToWxPoint(wxd_Point p)
{
return wxPoint(p.x, p.y);
}
inline wxSize
wxdSizeToWxSize(wxd_Size s)
{
return wxSize(s.width, s.height);
}
WXD_EXPORTED wxd_Slider_t*
wxd_Slider_Create(wxd_Window_t* parent, wxd_Id id, int value, int minValue, int maxValue,
wxd_Point pos, wxd_Size size, wxd_Style_t style)
{
wxWindow* parentWin = reinterpret_cast<wxWindow*>(parent);
wxSlider* slider = new wxSlider(parentWin, id, value, minValue, maxValue,
wxdPointToWxPoint(pos), wxdSizeToWxSize(size), style);
return reinterpret_cast<wxd_Slider_t*>(slider);
}
WXD_EXPORTED int
wxd_Slider_GetValue(wxd_Slider_t* self)
{
wxSlider* slider = reinterpret_cast<wxSlider*>(self);
if (!slider)
return 0; return slider->GetValue();
}
WXD_EXPORTED void
wxd_Slider_SetValue(wxd_Slider_t* self, int value)
{
wxSlider* slider = reinterpret_cast<wxSlider*>(self);
if (slider) {
slider->SetValue(value);
}
}
WXD_EXPORTED void
wxd_Slider_SetRange(wxd_Slider_t* self, int minValue, int maxValue)
{
wxSlider* slider = reinterpret_cast<wxSlider*>(self);
if (slider) {
slider->SetRange(minValue, maxValue);
}
}
WXD_EXPORTED int
wxd_Slider_GetMin(wxd_Slider_t* self)
{
wxSlider* slider = reinterpret_cast<wxSlider*>(self);
if (!slider)
return 0; return slider->GetMin();
}
WXD_EXPORTED int
wxd_Slider_GetMax(wxd_Slider_t* self)
{
wxSlider* slider = reinterpret_cast<wxSlider*>(self);
if (!slider)
return 0; return slider->GetMax();
}