Files
wxWidgets/wxPython/src/_dragimg.i
Robin Dunn 1b8c7ba607 Updated to SWIG 1.3.24 (plus a patch that corrects a bug and adds back
some things that were changed/removed from my patch I submitted to
them.)

Since it is now possible easily and simply share the SWIG type tables
across modules I reverted to always using the stock SWIG runtime
instead of my slightly hacked up version of it exported via the
wxPython C API.

The %name directive is now deprecated so replaced most uses of it with
a custom %Rename macro that uses %rename internally.  These will
evetually need to be replaced with a DocDecl macro when docstrings are
added.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-12-23 20:44:09 +00:00

106 lines
3.8 KiB
OpenEdge ABL

/////////////////////////////////////////////////////////////////////////////
// Name: _dragimg.i
// Purpose: SWIG defs for wxDragImage
//
// Author: Robin Dunn
//
// Created: 18-June-1999
// RCS-ID: $Id$
// Copyright: (c) 2003 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%newgroup
%{
#include <wx/generic/dragimgg.h>
%}
//---------------------------------------------------------------------------
MustHaveApp(wxGenericDragImage);
%rename (DragImage) wxGenericDragImage;
class wxGenericDragImage : public wxObject
{
public:
wxGenericDragImage(const wxBitmap& image,
const wxCursor& cursor = wxNullCursor);
%RenameCtor(DragIcon, wxGenericDragImage(const wxIcon& image,
const wxCursor& cursor = wxNullCursor));
%RenameCtor(DragString, wxGenericDragImage(const wxString& str,
const wxCursor& cursor = wxNullCursor));
%RenameCtor(DragTreeItem, wxGenericDragImage(const wxPyTreeCtrl& treeCtrl, wxTreeItemId& id));
%RenameCtor(DragListItem, wxGenericDragImage(const wxPyListCtrl& listCtrl, long id));
~wxGenericDragImage();
// For efficiency, tell wxGenericDragImage to use a bitmap that's already
// created (e.g. from last drag)
void SetBackingBitmap(wxBitmap* bitmap);
// Begin drag. hotspot is the location of the drag position relative to the upper-left
// corner of the image.
bool BeginDrag(const wxPoint& hotspot, wxWindow* window,
bool fullScreen = false, wxRect* rect = NULL);
// Begin drag. hotspot is the location of the drag position relative to the upper-left
// corner of the image. This is full screen only. fullScreenRect gives the
// position of the window on the screen, to restrict the drag to.
%Rename(BeginDragBounded, bool, BeginDrag(const wxPoint& hotspot, wxWindow* window,
wxWindow* boundingWindow));
// End drag
bool EndDrag();
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
// is non-NULL, or in screen coordinates if NULL.
bool Move(const wxPoint& pt);
// Show the image
bool Show();
// Hide the image
bool Hide();
// TODO, make the rest of these overridable
// Override this if you are using a virtual image (drawing your own image)
virtual wxRect GetImageRect(const wxPoint& pos) const;
// Override this if you are using a virtual image (drawing your own image)
virtual bool DoDrawImage(wxDC& dc, const wxPoint& pos) const;
// Override this if you wish to draw the window contents to the backing bitmap
// yourself. This can be desirable if you wish to avoid flicker by not having to
// redraw the window itself before dragging in order to be graphic-minus-dragged-objects.
// Instead, paint the drag image's backing bitmap to be correct, and leave the window
// to be updated only when dragging the objects away (thus giving a smoother appearance).
virtual bool UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC,
const wxRect& sourceRect, const wxRect& destRect) const;
// Erase and redraw simultaneously if possible
virtual bool RedrawImage(const wxPoint& oldPos, const wxPoint& newPos, bool eraseOld, bool drawNew);
};
//---------------------------------------------------------------------------
%init %{
wxPyPtrTypeMap_Add("wxDragImage", "wxGenericDragImage");
%}
//---------------------------------------------------------------------------