wxWidgets/samples/render/renddll.cpp
Vadim Zeitlin 3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00

68 lines
2.0 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: renddll.cpp
// Purpose: Example of a renderer implemented in a DLL
// Author: Vadim Zeitlin
// Modified by:
// Created: 04.08.03
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "wx/renderer.h"
#ifndef WX_PRECOMP
#include "wx/dc.h"
#endif
// 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
{
public:
// draw the header control button (used by wxListCtrl)
virtual int DrawHeaderButton(wxWindow * WXUNUSED(win),
wxDC& dc,
const wxRect& rect,
int WXUNUSED(flags) = 0,
wxHeaderSortIconType WXUNUSED(sortArrow) = wxHDR_SORT_ICON_NONE,
wxHeaderButtonParams* WXUNUSED(params) = NULL)
{
dc.SetBrush(*wxCYAN_BRUSH);
dc.SetTextForeground(*wxRED);
dc.DrawRoundedRectangle(rect, 10);
dc.DrawLabel("MyDllRenderer", wxNullBitmap, rect, wxALIGN_CENTER);
return dc.GetTextExtent("MyDllRenderer").x;
}
virtual wxRendererVersion GetVersion() const
{
return wxRendererVersion(wxRendererVersion::Current_Version,
wxRendererVersion::Current_Age);
}
#if 0 // just for debugging
MyDllRenderer()
{
wxMessageBox(wxT("Creating MyDllRenderer"), wxT("Renderer Sample"));
}
virtual ~MyDllRenderer()
{
wxMessageBox(wxT("Deleting MyDllRenderer"), wxT("Renderer Sample"));
}
#endif // 0
};
extern "C"
WXEXPORT wxRendererNative *wxCreateRenderer()
{
return new MyDllRenderer;
}