43#include "wx28compat.h"
44#include "color_handler.h"
49EVT_PAINT(ThumbWin::OnPaint)
55 : wxWindow(parent, wxID_ANY, wxPoint(20, 20), wxSize(5, 5),
58 m_max_size.x = m_max_size.y = 100;
62ThumbWin::~ThumbWin() {}
64void ThumbWin::Resize(
void) {
66 if (pThumbChart->GetThumbData()->pDIBThumb) {
67 int newheight = std::min(
68 m_max_size.y, pThumbChart->GetThumbData()->pDIBThumb->GetHeight());
69 int newwidth = std::min(
70 m_max_size.x, pThumbChart->GetThumbData()->pDIBThumb->GetWidth());
71 SetSize(0, 0, newwidth, newheight);
76void ThumbWin::SetMaxSize(wxSize
const &max_size) { m_max_size = max_size; }
78void ThumbWin::OnPaint(wxPaintEvent &event) {
82 if (pThumbChart->GetThumbData()) {
83 if (pThumbChart->GetThumbData()->pDIBThumb)
84 dc.DrawBitmap(*(pThumbChart->GetThumbData()->pDIBThumb), 0, 0,
false);
86 wxPen ppPen(GetGlobalColor(_T(
"CHBLK")), 1, wxPENSTYLE_SOLID);
88 wxBrush yBrush(GetGlobalColor(_T(
"CHYLW")), wxBRUSHSTYLE_SOLID);
90 dc.DrawCircle(pThumbChart->GetThumbData()->ShipX,
91 pThumbChart->GetThumbData()->ShipY, 6);
96const wxBitmap &ThumbWin::GetBitmap(
void) {
98 if (pThumbChart->GetThumbData()) {
99 if (pThumbChart->GetThumbData()->pDIBThumb)
100 m_bitmap = *(pThumbChart->GetThumbData()->pDIBThumb);