2003-08-06 08:32:14 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: renddll.cpp
|
|
|
|
// Purpose: Example of a renderer implemented in a DLL
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 04.08.03
|
|
|
|
// RCS-ID: $Id$
|
2004-05-25 07:20:37 -04:00
|
|
|
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
|
2003-08-06 08:32:14 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "wx/wxprec.h"
|
|
|
|
|
2003-08-06 11:37:32 -04:00
|
|
|
#ifdef __BORLANDC__
|
|
|
|
#pragma hdrstop
|
|
|
|
#endif
|
|
|
|
|
2003-08-06 08:32:14 -04:00
|
|
|
#include "wx/renderer.h"
|
|
|
|
|
2003-08-07 04:34:28 -04:00
|
|
|
#ifndef WX_PRECOMP
|
|
|
|
#include "wx/dc.h"
|
|
|
|
#endif
|
|
|
|
|
2003-08-06 08:32:14 -04:00
|
|
|
class MyDllRenderer : public wxRendererNative
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// draw the header control button (used by wxListCtrl)
|
|
|
|
virtual void DrawHeaderButton(wxWindow *win,
|
|
|
|
wxDC& dc,
|
|
|
|
const wxRect& rect,
|
|
|
|
int flags = 0)
|
|
|
|
{
|
|
|
|
dc.SetBrush(*wxCYAN_BRUSH);
|
|
|
|
dc.SetTextForeground(*wxRED);
|
|
|
|
dc.DrawRoundedRectangle(rect, 10);
|
|
|
|
dc.DrawLabel(_T("MyDllRenderer"), wxNullBitmap, rect, wxALIGN_CENTER);
|
|
|
|
}
|
|
|
|
|
|
|
|
// draw the expanded/collapsed icon for a tree control item
|
|
|
|
virtual void DrawTreeItemButton(wxWindow *win,
|
|
|
|
wxDC& dc,
|
|
|
|
const wxRect& rect,
|
|
|
|
int flags = 0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// draw the border for sash window: this border must be such that the sash
|
|
|
|
// drawn by DrawSash() blends into it well
|
|
|
|
virtual void DrawSplitterBorder(wxWindow *win,
|
|
|
|
wxDC& dc,
|
|
|
|
const wxRect& rect,
|
|
|
|
int flags = 0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// draw a (vertical) sash
|
|
|
|
virtual void DrawSplitterSash(wxWindow *win,
|
|
|
|
wxDC& dc,
|
|
|
|
const wxSize& size,
|
|
|
|
wxCoord position,
|
|
|
|
wxOrientation orient,
|
|
|
|
int flags = 0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-02-06 05:41:35 -05:00
|
|
|
// draw a combobox dropdown button
|
|
|
|
//
|
|
|
|
// flags may only use wxCONTROL_PRESSED
|
|
|
|
virtual void DrawComboBoxDropButton(wxWindow *win,
|
|
|
|
wxDC& dc,
|
|
|
|
const wxRect& rect,
|
|
|
|
int flags = 0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-04-06 21:02:29 -04:00
|
|
|
// draw a dropdown arrow
|
|
|
|
//
|
|
|
|
// flags may use wxCONTROL_PRESSED and wxCONTROL_CURRENT
|
|
|
|
virtual void DrawDropArrow(wxWindow *win,
|
|
|
|
wxDC& dc,
|
|
|
|
const wxRect& rect,
|
|
|
|
int flags = 0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2003-08-06 08:32:14 -04:00
|
|
|
// get the splitter parameters: the x field of the returned point is the
|
|
|
|
// sash width and the y field is the border width
|
|
|
|
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win)
|
|
|
|
{
|
|
|
|
return wxSplitterRenderParams(0, 0, 0);
|
|
|
|
}
|
|
|
|
|
2003-08-10 11:51:30 -04:00
|
|
|
virtual wxRendererVersion GetVersion() const
|
|
|
|
{
|
|
|
|
return wxRendererVersion(wxRendererVersion::Current_Version,
|
|
|
|
wxRendererVersion::Current_Age);
|
|
|
|
}
|
|
|
|
|
2003-08-06 08:32:14 -04:00
|
|
|
#if 0 // just for debugging
|
|
|
|
MyDllRenderer()
|
|
|
|
{
|
|
|
|
wxMessageBox(_T("Creating MyDllRenderer"), _T("Renderer Sample"));
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~MyDllRenderer()
|
|
|
|
{
|
|
|
|
wxMessageBox(_T("Deleting MyDllRenderer"), _T("Renderer Sample"));
|
|
|
|
}
|
|
|
|
#endif // 0
|
|
|
|
};
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
WXEXPORT wxRendererNative *wxCreateRenderer()
|
|
|
|
{
|
|
|
|
return new MyDllRenderer;
|
|
|
|
}
|
|
|
|
|