2003-08-06 12:32:14 +00: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 11:20:37 +00:00
|
|
|
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
|
2003-08-06 12:32:14 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "wx/wxprec.h"
|
|
|
|
|
2003-08-06 15:37:32 +00:00
|
|
|
#ifdef __BORLANDC__
|
|
|
|
#pragma hdrstop
|
|
|
|
#endif
|
|
|
|
|
2003-08-06 12:32:14 +00:00
|
|
|
#include "wx/renderer.h"
|
|
|
|
|
2003-08-07 08:34:28 +00:00
|
|
|
#ifndef WX_PRECOMP
|
|
|
|
#include "wx/dc.h"
|
|
|
|
#endif
|
|
|
|
|
2006-04-27 13:50:20 +00:00
|
|
|
// derive from wxDelegateRendererNative and not wxRendererNative itself to be
|
|
|
|
// able to only reimplement the methods we want to show and not all of them
|
|
|
|
class MyDllRenderer : public wxDelegateRendererNative
|
2003-08-06 12:32:14 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2003-08-10 15:51:30 +00:00
|
|
|
virtual wxRendererVersion GetVersion() const
|
|
|
|
{
|
|
|
|
return wxRendererVersion(wxRendererVersion::Current_Version,
|
|
|
|
wxRendererVersion::Current_Age);
|
|
|
|
}
|
|
|
|
|
2003-08-06 12:32:14 +00: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;
|
|
|
|
}
|