Import r67258 of the wxWidgets trunk, which I expect will before

long become wxWidgets 2.9.2, which in turn is expected to be the
last 2.9 release before the 3.0 stable release.

Since the full wxWidgets distribution is rather large, I have
imported only the parts that we use, on a subdirectory basis:

art
include/wx/*.*
include/wx/aui
include/wx/cocoa
include/wx/generic
include/wx/gtk
include/wx/meta
include/wx/msw
include/wx/osx
include/wx/persist
include/wx/private
include/wx/protocol
include/wx/unix
src/aui
src/common
src/generic
src/gtk
src/msw
src/osx
src/unix


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7380 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-03-20 18:05:19 +00:00
parent 205637ccc3
commit d14efe561b
1945 changed files with 694474 additions and 0 deletions

View File

@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/accel.h
// Purpose: wxAcceleratorTable class
// Author: Julian Smart
// Modified by:
// Created: 31/7/98
// RCS-ID: $Id: accel.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ACCEL_H_
#define _WX_ACCEL_H_
class WXDLLIMPEXP_FWD_CORE wxWindow;
// ----------------------------------------------------------------------------
// the accel table has all accelerators for a given window or menu
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject
{
public:
// default ctor
wxAcceleratorTable() { }
// load from .rc resource (Windows specific)
wxAcceleratorTable(const wxString& resource);
// initialize from array
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
bool Ok() const { return IsOk(); }
bool IsOk() const;
void SetHACCEL(WXHACCEL hAccel);
WXHACCEL GetHACCEL() const;
// translate the accelerator, return true if done
bool Translate(wxWindow *window, WXMSG *msg) const;
private:
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
};
#endif
// _WX_ACCEL_H_

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="0.64.1.0"
processorArchitecture="amd64"
name="Controls"
type="win32"
/>
<description>wxWindows application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="amd64"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@ -0,0 +1,206 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/app.h
// Purpose: wxApp class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: app.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_APP_H_
#define _WX_APP_H_
#include "wx/event.h"
#include "wx/icon.h"
class WXDLLIMPEXP_FWD_CORE wxFrame;
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_FWD_CORE wxApp;
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
class WXDLLIMPEXP_FWD_BASE wxLog;
// Represents the application. Derive OnInit and declare
// a new App object to start application
class WXDLLIMPEXP_CORE wxApp : public wxAppBase
{
public:
wxApp();
virtual ~wxApp();
// override base class (pure) virtuals
virtual bool Initialize(int& argc, wxChar **argv);
virtual void CleanUp();
virtual void WakeUpIdle();
virtual void SetPrintMode(int mode) { m_printMode = mode; }
virtual int GetPrintMode() const { return m_printMode; }
// implementation only
void OnIdle(wxIdleEvent& event);
void OnEndSession(wxCloseEvent& event);
void OnQueryEndSession(wxCloseEvent& event);
#if wxUSE_EXCEPTIONS
virtual bool OnExceptionInMainLoop();
#endif // wxUSE_EXCEPTIONS
// MSW-specific from now on
// ------------------------
// this suffix should be appended to all our Win32 class names to obtain a
// variant registered without CS_[HV]REDRAW styles
static const wxChar *GetNoRedrawClassSuffix() { return wxT("NR"); }
// get the name of the registered Win32 class with the given (unique) base
// name: this function constructs the unique class name using this name as
// prefix, checks if the class is already registered and registers it if it
// isn't and returns the name it was registered under (or NULL if it failed)
//
// the registered class will always have CS_[HV]REDRAW and CS_DBLCLKS
// styles as well as any additional styles specified as arguments here; and
// there will be also a companion registered class identical to this one
// but without CS_[HV]REDRAW whose name will be the same one but with
// GetNoRedrawClassSuffix()
//
// the background brush argument must be either a COLOR_XXX standard value
// or (default) -1 meaning that the class paints its background itself
static const wxChar *GetRegisteredClassName(const wxChar *name,
int bgBrushCol = -1,
int extraStyles = 0);
// return true if this name corresponds to one of the classes we registered
// in the previous GetRegisteredClassName() calls
static bool IsRegisteredClassName(const wxString& name);
protected:
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
public:
// unregister any window classes registered by GetRegisteredClassName()
static void UnregisterWindowClasses();
#if wxUSE_RICHEDIT
// initialize the richedit DLL of (at least) given version, return true if
// ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3)
static bool InitRichEdit(int version = 2);
#endif // wxUSE_RICHEDIT
// returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
// wasn't found at all
static int GetComCtl32Version();
// the same for shell32.dll: returns 400, 471, 500, 600, ... (4.70 not
// currently detected)
static int GetShell32Version();
// the SW_XXX value to be used for the frames opened by the application
// (currently seems unused which is a bug -- TODO)
static int m_nCmdShow;
protected:
DECLARE_EVENT_TABLE()
wxDECLARE_NO_COPY_CLASS(wxApp);
DECLARE_DYNAMIC_CLASS(wxApp)
};
#ifdef __WXWINCE__
// under CE provide a dummy implementation of GetComCtl32Version() returning
// the value passing all ">= 470" tests (which are the only ones used in our
// code currently) as commctrl.dll under CE 2.0 and later support comctl32.dll
// functionality
inline int wxApp::GetComCtl32Version()
{
return 471;
}
// this is not currently used at all under CE so it's not really clear what do
// we need to return from here
inline int wxApp::GetShell32Version()
{
return 0;
}
#endif // __WXWINCE__
// ----------------------------------------------------------------------------
// MSW-specific wxEntry() overload and wxIMPLEMENT_WXWIN_MAIN definition
// ----------------------------------------------------------------------------
// we need HINSTANCE declaration to define WinMain()
#include "wx/msw/wrapwin.h"
#ifndef SW_SHOWNORMAL
#define SW_SHOWNORMAL 1
#endif
// WinMain() is always ANSI, even in Unicode build, under normal Windows
// but is always Unicode under CE
#ifdef __WXWINCE__
typedef wchar_t *wxCmdLineArgType;
#else
typedef char *wxCmdLineArgType;
#endif
// wxMSW-only overloads of wxEntry() and wxEntryStart() which take the
// parameters passed to WinMain() instead of those passed to main()
extern WXDLLIMPEXP_CORE bool
wxEntryStart(HINSTANCE hInstance,
HINSTANCE hPrevInstance = NULL,
wxCmdLineArgType pCmdLine = NULL,
int nCmdShow = SW_SHOWNORMAL);
extern WXDLLIMPEXP_CORE int
wxEntry(HINSTANCE hInstance,
HINSTANCE hPrevInstance = NULL,
wxCmdLineArgType pCmdLine = NULL,
int nCmdShow = SW_SHOWNORMAL);
#if defined(__BORLANDC__) && wxUSE_UNICODE
// Borland C++ has the following nonstandard behaviour: when the -WU
// command line flag is used, the linker expects to find wWinMain instead
// of WinMain. This flag causes the compiler to define _UNICODE and
// UNICODE symbols and there's no way to detect its use, so we have to
// define both WinMain and wWinMain so that wxIMPLEMENT_WXWIN_MAIN works
// for both code compiled with and without -WU.
// See http://sourceforge.net/tracker/?func=detail&atid=309863&aid=1935997&group_id=9863
// for more details.
#define wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD \
extern "C" int WINAPI wWinMain(HINSTANCE hInstance, \
HINSTANCE hPrevInstance, \
wchar_t * WXUNUSED(lpCmdLine), \
int nCmdShow) \
{ \
wxDISABLE_DEBUG_SUPPORT(); \
\
/* NB: wxEntry expects lpCmdLine argument to be char*, not */ \
/* wchar_t*, but fortunately it's not used anywhere */ \
/* and we can simply pass NULL in: */ \
return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \
}
#else
#define wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD
#endif // defined(__BORLANDC__) && wxUSE_UNICODE
#define wxIMPLEMENT_WXWIN_MAIN \
extern "C" int WINAPI WinMain(HINSTANCE hInstance, \
HINSTANCE hPrevInstance, \
wxCmdLineArgType WXUNUSED(lpCmdLine), \
int nCmdShow) \
{ \
wxDISABLE_DEBUG_SUPPORT(); \
\
/* NB: We pass NULL in place of lpCmdLine to behave the same as */ \
/* Borland-specific wWinMain() above. If it becomes needed */ \
/* to pass lpCmdLine to wxEntry() here, you'll have to fix */ \
/* wWinMain() above too. */ \
return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \
} \
wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD
#endif // _WX_APP_H_

View File

@ -0,0 +1,69 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/apptbase.h
// Purpose: declaration of wxAppTraits for MSW
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.06.2003
// RCS-ID: $Id: apptbase.h 67185 2011-03-14 11:54:32Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_APPTBASE_H_
#define _WX_MSW_APPTBASE_H_
// ----------------------------------------------------------------------------
// wxAppTraits: the MSW version adds extra hooks needed by MSW-only code
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase
{
public:
// wxExecute() support methods
// ---------------------------
// called before starting to wait for the child termination, may return
// some opaque data which will be passed later to AfterChildWaitLoop()
virtual void *BeforeChildWaitLoop() = 0;
// called after starting to wait for the child termination, the parameter
// is the return value of BeforeChildWaitLoop()
virtual void AfterChildWaitLoop(void *data) = 0;
// wxThread helpers
// ----------------
// process a message while waiting for a(nother) thread, should return
// false if and only if we have to exit the application
virtual bool DoMessageFromThreadWait() = 0;
// wait for the handle to be signaled, return WAIT_OBJECT_0 if it is or, in
// the GUI code, WAIT_OBJECT_0 + 1 if a Windows message arrived
virtual WXDWORD WaitForThread(WXHANDLE hThread, int flags) = 0;
#ifndef __WXWINCE__
// console helpers
// ---------------
// this method can be overridden by a derived class to always return true
// or false to force [not] using the console for output to stderr
//
// by default console applications always return true from here while the
// GUI ones only return true if they're being run from console and there is
// no other activity happening in this console
virtual bool CanUseStderr() = 0;
// write text to the console, return true if ok or false on error
virtual bool WriteToStderr(const wxString& text) = 0;
#endif // !__WXWINCE__
protected:
// implementation of WaitForThread() for the console applications which is
// also used by the GUI code if it doesn't [yet|already} dispatch events
WXDWORD DoSimpleWaitForThread(WXHANDLE hThread);
};
#endif // _WX_MSW_APPTBASE_H_

View File

@ -0,0 +1,59 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/apptrait.h
// Purpose: class implementing wxAppTraits for MSW
// Author: Vadim Zeitlin
// Modified by:
// Created: 21.06.2003
// RCS-ID: $Id: apptrait.h 67185 2011-03-14 11:54:32Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_APPTRAIT_H_
#define _WX_MSW_APPTRAIT_H_
// ----------------------------------------------------------------------------
// wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxConsoleAppTraits : public wxConsoleAppTraitsBase
{
public:
virtual wxEventLoopBase *CreateEventLoop();
virtual void *BeforeChildWaitLoop();
virtual void AfterChildWaitLoop(void *data);
#if wxUSE_TIMER
virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer);
#endif
virtual bool DoMessageFromThreadWait();
virtual WXDWORD WaitForThread(WXHANDLE hThread, int flags);
#ifndef __WXWINCE__
virtual bool CanUseStderr() { return true; }
virtual bool WriteToStderr(const wxString& text);
#endif // !__WXWINCE__
};
#if wxUSE_GUI
class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase
{
public:
virtual wxEventLoopBase *CreateEventLoop();
virtual void *BeforeChildWaitLoop();
virtual void AfterChildWaitLoop(void *data);
#if wxUSE_TIMER
virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer);
#endif
virtual bool DoMessageFromThreadWait();
virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const;
virtual WXDWORD WaitForThread(WXHANDLE hThread, int flags);
#ifndef __WXWINCE__
virtual bool CanUseStderr();
virtual bool WriteToStderr(const wxString& text);
#endif // !__WXWINCE__
};
#endif // wxUSE_GUI
#endif // _WX_MSW_APPTRAIT_H_

View File

@ -0,0 +1,299 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/bitmap.h
// Purpose: wxBitmap class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: bitmap.h 66086 2010-11-10 13:51:51Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BITMAP_H_
#define _WX_BITMAP_H_
#include "wx/msw/gdiimage.h"
#include "wx/palette.h"
class WXDLLIMPEXP_FWD_CORE wxBitmap;
class WXDLLIMPEXP_FWD_CORE wxBitmapHandler;
class WXDLLIMPEXP_FWD_CORE wxBitmapRefData;
class WXDLLIMPEXP_FWD_CORE wxControl;
class WXDLLIMPEXP_FWD_CORE wxCursor;
class WXDLLIMPEXP_FWD_CORE wxDC;
#if wxUSE_WXDIB
class WXDLLIMPEXP_FWD_CORE wxDIB;
#endif
class WXDLLIMPEXP_FWD_CORE wxIcon;
class WXDLLIMPEXP_FWD_CORE wxMask;
class WXDLLIMPEXP_FWD_CORE wxPalette;
class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
// What kind of transparency should a bitmap copied from an icon or cursor
// have?
enum wxBitmapTransparency
{
wxBitmapTransparency_Auto, // default: copy alpha if the source has it
wxBitmapTransparency_None, // never create alpha
wxBitmapTransparency_Always // always use alpha
};
// ----------------------------------------------------------------------------
// wxBitmap: a mono or colour bitmap
// NOTE: for wxMSW we don't use the wxBitmapBase base class declared in bitmap.h!
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmap : public wxGDIImage
{
public:
// default ctor creates an invalid bitmap, you must Create() it later
wxBitmap() { }
// Initialize with raw data
wxBitmap(const char bits[], int width, int height, int depth = 1);
// Initialize with XPM data
wxBitmap(const char* const* data);
#ifdef wxNEEDS_CHARPP
wxBitmap(char** data)
{
*this = wxBitmap(const_cast<const char* const*>(data));
}
#endif
// Load a file or resource
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
// New constructor for generalised creation from data
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
// Create a new, uninitialized bitmap of the given size and depth (if it
// is omitted, will create a bitmap compatible with the display)
//
// NB: this ctor will create a DIB for 24 and 32bpp bitmaps, use ctor
// taking a DC argument if you want to force using DDB in this case
wxBitmap(int width, int height, int depth = -1) { (void)Create(width, height, depth); }
wxBitmap(const wxSize& sz, int depth = -1) { (void)Create(sz, depth); }
// Create a bitmap compatible with the given DC
wxBitmap(int width, int height, const wxDC& dc);
#if wxUSE_IMAGE
// Convert from wxImage
wxBitmap(const wxImage& image, int depth = -1)
{ (void)CreateFromImage(image, depth); }
// Create a DDB compatible with the given DC from wxImage
wxBitmap(const wxImage& image, const wxDC& dc)
{ (void)CreateFromImage(image, dc); }
#endif // wxUSE_IMAGE
// we must have this, otherwise icons are silently copied into bitmaps using
// the copy ctor but the resulting bitmap is invalid!
wxBitmap(const wxIcon& icon,
wxBitmapTransparency transp = wxBitmapTransparency_Auto)
{
CopyFromIcon(icon, transp);
}
wxBitmap& operator=(const wxIcon& icon)
{
(void)CopyFromIcon(icon);
return *this;
}
wxBitmap& operator=(const wxCursor& cursor)
{
(void)CopyFromCursor(cursor);
return *this;
}
virtual ~wxBitmap();
#if wxUSE_IMAGE
wxImage ConvertToImage() const;
wxBitmap ConvertToDisabled(unsigned char brightness = 255) const;
#endif // wxUSE_IMAGE
// get the given part of bitmap
wxBitmap GetSubBitmap( const wxRect& rect ) const;
// NB: This should not be called from user code. It is for wx internal
// use only.
wxBitmap GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const;
// copies the contents and mask of the given (colour) icon to the bitmap
bool CopyFromIcon(const wxIcon& icon,
wxBitmapTransparency transp = wxBitmapTransparency_Auto);
// copies the contents and mask of the given cursor to the bitmap
bool CopyFromCursor(const wxCursor& cursor,
wxBitmapTransparency transp = wxBitmapTransparency_Auto);
#if wxUSE_WXDIB
// copies from a device independent bitmap
bool CopyFromDIB(const wxDIB& dib);
#endif
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH)
{ return Create(sz.GetWidth(), sz.GetHeight(), depth); }
virtual bool Create(int width, int height, const wxDC& dc);
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
wxBitmapRefData *GetBitmapData() const
{ return (wxBitmapRefData *)m_refData; }
// raw bitmap access support functions
void *GetRawData(wxPixelDataBase& data, int bpp);
void UngetRawData(wxPixelDataBase& data);
#if wxUSE_PALETTE
wxPalette* GetPalette() const;
void SetPalette(const wxPalette& palette);
#endif // wxUSE_PALETTE
wxMask *GetMask() const;
wxBitmap GetMaskBitmap() const;
void SetMask(wxMask *mask);
// these functions are internal and shouldn't be used, they risk to
// disappear in the future
bool HasAlpha() const;
void UseAlpha();
// implementation only from now on
// -------------------------------
public:
void SetHBITMAP(WXHBITMAP bmp) { SetHandle((WXHANDLE)bmp); }
WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); }
void SetSelectedInto(wxDC *dc);
wxDC *GetSelectedInto() const;
protected:
virtual wxGDIImageRefData *CreateData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
// creates an uninitialized bitmap, called from Create()s above
bool DoCreate(int w, int h, int depth, WXHDC hdc);
#if wxUSE_IMAGE
// creates the bitmap from wxImage, supposed to be called from ctor
bool CreateFromImage(const wxImage& image, int depth);
// creates a DDB from wxImage, supposed to be called from ctor
bool CreateFromImage(const wxImage& image, const wxDC& dc);
// common part of the 2 methods above (hdc may be 0)
bool CreateFromImage(const wxImage& image, int depth, WXHDC hdc);
#endif // wxUSE_IMAGE
private:
// common part of CopyFromIcon/CopyFromCursor for Win32
bool
CopyFromIconOrCursor(const wxGDIImage& icon,
wxBitmapTransparency transp = wxBitmapTransparency_Auto);
DECLARE_DYNAMIC_CLASS(wxBitmap)
};
// ----------------------------------------------------------------------------
// wxMask: a mono bitmap used for drawing bitmaps transparently.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMask : public wxObject
{
public:
wxMask();
// Copy constructor
wxMask(const wxMask &mask);
// Construct a mask from a bitmap and a colour indicating the transparent
// area
wxMask(const wxBitmap& bitmap, const wxColour& colour);
// Construct a mask from a bitmap and a palette index indicating the
// transparent area
wxMask(const wxBitmap& bitmap, int paletteIndex);
// Construct a mask from a mono bitmap (copies the bitmap).
wxMask(const wxBitmap& bitmap);
// construct a mask from the givne bitmap handle
wxMask(WXHBITMAP hbmp) { m_maskBitmap = hbmp; }
virtual ~wxMask();
bool Create(const wxBitmap& bitmap, const wxColour& colour);
bool Create(const wxBitmap& bitmap, int paletteIndex);
bool Create(const wxBitmap& bitmap);
// Implementation
WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; }
void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; }
protected:
WXHBITMAP m_maskBitmap;
DECLARE_DYNAMIC_CLASS(wxMask)
};
// ----------------------------------------------------------------------------
// wxBitmapHandler is a class which knows how to load/save bitmaps to/from file
// NOTE: for wxMSW we don't use the wxBitmapHandler class declared in bitmap.h!
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapHandler : public wxGDIImageHandler
{
public:
wxBitmapHandler() { }
wxBitmapHandler(const wxString& name, const wxString& ext, wxBitmapType type)
: wxGDIImageHandler(name, ext, type) { }
// implement wxGDIImageHandler's pure virtuals:
virtual bool Create(wxGDIImage *image,
const void* data,
wxBitmapType type,
int width, int height, int depth = 1);
virtual bool Load(wxGDIImage *image,
const wxString& name,
wxBitmapType type,
int desiredWidth, int desiredHeight);
virtual bool Save(const wxGDIImage *image,
const wxString& name,
wxBitmapType type) const;
// make wxBitmapHandler compatible with the wxBitmapHandler interface
// declared in bitmap.h, even if it's derived from wxGDIImageHandler:
virtual bool Create(wxBitmap *bitmap,
const void* data,
wxBitmapType type,
int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap,
const wxString& name,
wxBitmapType type,
int desiredWidth, int desiredHeight);
virtual bool SaveFile(const wxBitmap *bitmap,
const wxString& name,
wxBitmapType type,
const wxPalette *palette = NULL) const;
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
};
#endif
// _WX_BITMAP_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

View File

@ -0,0 +1,71 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/bmpbuttn.h
// Purpose: wxBitmapButton class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: bmpbuttn.h 61071 2009-06-15 23:10:16Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BMPBUTTN_H_
#define _WX_BMPBUTTN_H_
#include "wx/button.h"
#include "wx/bitmap.h"
#include "wx/brush.h"
class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
{
public:
wxBitmapButton() { Init(); }
wxBitmapButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxBU_AUTODRAW,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
{
Init();
Create(parent, id, bitmap, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxBU_AUTODRAW,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
protected:
// common part of all ctors
void Init()
{
m_disabledSetByUser =
m_hoverSetByUser = false;
}
// reimplement some base class virtuals
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
// true if disabled bitmap was set by user, false if we created it
// ourselves from the normal one
bool m_disabledSetByUser;
// true if hover bitmap was set by user, false if it was set from focused
// one
bool m_hoverSetByUser;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton)
};
#endif // _WX_BMPBUTTN_H_

View File

@ -0,0 +1,136 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/bmpcbox.h
// Purpose: wxBitmapComboBox
// Author: Jaakko Salli
// Created: 2008-04-06
// RCS-ID: $Id: bmpcbox.h 65091 2010-07-25 07:39:17Z JMS $
// Copyright: (c) 2008 Jaakko Salli
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_BMPCBOX_H_
#define _WX_MSW_BMPCBOX_H_
#include "wx/combobox.h"
// ----------------------------------------------------------------------------
// wxBitmapComboBox: a wxComboBox that allows images to be shown
// in front of string items.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxBitmapComboBox : public wxComboBox,
public wxBitmapComboBoxBase
{
public:
// ctors and such
wxBitmapComboBox() : wxComboBox(), wxBitmapComboBoxBase()
{
Init();
}
wxBitmapComboBox(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0,
const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr)
: wxComboBox(),
wxBitmapComboBoxBase()
{
Init();
(void)Create(parent, id, value, pos, size, n,
choices, style, validator, name);
}
wxBitmapComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
int n,
const wxString choices[],
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapComboBoxNameStr);
virtual ~wxBitmapComboBox();
// Sets the image for the given item.
virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap);
virtual bool SetFont(const wxFont& font);
// Adds item with image to the end of the combo box.
int Append(const wxString& item, const wxBitmap& bitmap = wxNullBitmap);
int Append(const wxString& item, const wxBitmap& bitmap, void *clientData);
int Append(const wxString& item, const wxBitmap& bitmap, wxClientData *clientData);
// Inserts item with image into the list before pos. Not valid for wxCB_SORT
// styles, use Append instead.
int Insert(const wxString& item, const wxBitmap& bitmap, unsigned int pos);
int Insert(const wxString& item, const wxBitmap& bitmap,
unsigned int pos, void *clientData);
int Insert(const wxString& item, const wxBitmap& bitmap,
unsigned int pos, wxClientData *clientData);
protected:
WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
// Event handlers
void OnSize(wxSizeEvent& event);
virtual wxItemContainer* GetItemContainer() { return this; }
virtual wxWindow* GetControl() { return this; }
// wxItemContainer implementation
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData, wxClientDataType type);
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int n);
virtual bool OnAddBitmap(const wxBitmap& bitmap);
virtual wxSize DoGetBestSize() const;
void RecreateControl();
private:
void Init();
bool m_inResize;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxBitmapComboBox)
};
#endif // _WX_MSW_BMPCBOX_H_

View File

@ -0,0 +1,62 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/brush.h
// Purpose: wxBrush class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: brush.h 54273 2008-06-17 17:28:26Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BRUSH_H_
#define _WX_BRUSH_H_
class WXDLLIMPEXP_FWD_CORE wxBrush;
class WXDLLIMPEXP_FWD_CORE wxColour;
class WXDLLIMPEXP_FWD_CORE wxBitmap;
// ----------------------------------------------------------------------------
// wxBrush
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase
{
public:
wxBrush();
wxBrush(const wxColour& col, wxBrushStyle style = wxBRUSHSTYLE_SOLID);
#if FUTURE_WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_FUTURE( wxBrush(const wxColour& col, int style) );
#endif
wxBrush(const wxBitmap& stipple);
virtual ~wxBrush();
virtual void SetColour(const wxColour& col);
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b);
virtual void SetStyle(wxBrushStyle style);
virtual void SetStipple(const wxBitmap& stipple);
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
wxColour GetColour() const;
wxBrushStyle GetStyle() const;
wxBitmap *GetStipple() const;
#if FUTURE_WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_FUTURE( void SetStyle(int style) )
{ SetStyle((wxBrushStyle)style); }
#endif
// return the HBRUSH for this brush
virtual WXHANDLE GetResourceHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
private:
DECLARE_DYNAMIC_CLASS(wxBrush)
};
#endif // _WX_BRUSH_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

View File

@ -0,0 +1,125 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/button.h
// Purpose: wxButton class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: button.h 67065 2011-02-27 12:48:26Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BUTTON_H_
#define _WX_BUTTON_H_
// ----------------------------------------------------------------------------
// Pushbutton
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
{
public:
wxButton() { Init(); }
wxButton(wxWindow *parent,
wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
{
Init();
Create(parent, id, label, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
virtual ~wxButton();
virtual wxWindow *SetDefault();
// overridden base class methods
virtual void SetLabel(const wxString& label);
virtual bool SetBackgroundColour(const wxColour &colour);
virtual bool SetForegroundColour(const wxColour &colour);
// implementation from now on
virtual void Command(wxCommandEvent& event);
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
// send a notification event, return true if processed
bool SendClickEvent();
// default button handling
void SetTmpDefault();
void UnsetTmpDefault();
// set or unset BS_DEFPUSHBUTTON style
static void SetDefaultStyle(wxButton *btn, bool on);
// usually overridden base class virtuals
virtual wxSize DoGetBestSize() const;
virtual bool DoGetAuthNeeded() const;
virtual void DoSetAuthNeeded(bool show);
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual wxSize DoGetBitmapMargins() const;
virtual void DoSetBitmapMargins(wxCoord x, wxCoord y);
virtual void DoSetBitmapPosition(wxDirection dir);
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP
// Increases the passed in size to account for the button image.
//
// Should only be called if we do have a button, i.e. if m_imageData is
// non-NULL.
void AdjustForBitmapSize(wxSize& size) const;
class wxButtonImageData *m_imageData;
#if wxUSE_MARKUP
class wxMarkupText *m_markupText;
#endif // wxUSE_MARKUP
// true if the UAC symbol is shown
bool m_authNeeded;
private:
void Init()
{
m_imageData = NULL;
#if wxUSE_MARKUP
m_markupText = NULL;
#endif // wxUSE_MARKUP
m_authNeeded = false;
}
// Switches button into owner-drawn mode: this is used if we need to draw
// something not supported by the native control, such as using non default
// colours or a bitmap on pre-XP systems.
void MakeOwnerDrawn();
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxButton);
};
#endif // _WX_BUTTON_H_

View File

@ -0,0 +1,99 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/calctrl.h
// Purpose: wxCalendarCtrl control implementation for MSW
// Author: Vadim Zeitlin
// RCS-ID: $Id: calctrl.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (C) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_CALCTRL_H_
#define _WX_MSW_CALCTRL_H_
class WXDLLIMPEXP_ADV wxCalendarCtrl : public wxCalendarCtrlBase
{
public:
wxCalendarCtrl() { Init(); }
wxCalendarCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS,
const wxString& name = wxCalendarNameStr)
{
Init();
Create(parent, id, date, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS,
const wxString& name = wxCalendarNameStr);
virtual bool SetDate(const wxDateTime& date);
virtual wxDateTime GetDate() const;
virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
const wxDateTime& upperdate = wxDefaultDateTime);
virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const;
virtual bool EnableMonthChange(bool enable = true);
virtual void Mark(size_t day, bool mark);
virtual void SetHoliday(size_t day);
virtual wxCalendarHitTestResult HitTest(const wxPoint& pos,
wxDateTime *date = NULL,
wxDateTime::WeekDay *wd = NULL);
virtual void SetWindowStyleFlag(long style);
protected:
virtual wxSize DoGetBestSize() const;
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
void MSWOnClick(wxMouseEvent& event);
void MSWOnDoubleClick(wxMouseEvent& event);
private:
void Init();
// bring the control in sync with m_marks
void UpdateMarks();
// set first day of week in the control to correspond to our
// wxCAL_MONDAY_FIRST flag
void UpdateFirstDayOfWeek();
// reset holiday information
virtual void ResetHolidayAttrs() { m_holidays = 0; }
// redisplay holidays
virtual void RefreshHolidays() { UpdateMarks(); }
// current date, we need to store it instead of simply retrieving it from
// the control as needed in order to be able to generate the correct events
// from MSWOnNotify()
wxDateTime m_date;
// bit field containing the state (marked or not) of all days in the month
wxUint32 m_marks;
// the same but indicating whether a day is a holiday or not
wxUint32 m_holidays;
DECLARE_DYNAMIC_CLASS(wxCalendarCtrl)
wxDECLARE_NO_COPY_CLASS(wxCalendarCtrl);
};
#endif // _WX_MSW_CALCTRL_H_

View File

@ -0,0 +1,64 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/caret.h
// Purpose: wxCaret class - the MSW implementation of wxCaret
// Author: Vadim Zeitlin
// Modified by:
// Created: 23.05.99
// RCS-ID: $Id: caret.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CARET_H_
#define _WX_CARET_H_
class WXDLLIMPEXP_CORE wxCaret : public wxCaretBase
{
public:
wxCaret() { Init(); }
// create the caret of given (in pixels) width and height and associate
// with the given window
wxCaret(wxWindow *window, int width, int height)
{
Init();
(void)Create(window, width, height);
}
// same as above
wxCaret(wxWindowBase *window, const wxSize& size)
{
Init();
(void)Create(window, size);
}
// process wxWindow notifications
virtual void OnSetFocus();
virtual void OnKillFocus();
protected:
void Init()
{
wxCaretBase::Init();
m_hasCaret = false;
}
// override base class virtuals
virtual void DoMove();
virtual void DoShow();
virtual void DoHide();
virtual void DoSize();
// helper function which creates the system caret
bool MSWCreateCaret();
private:
bool m_hasCaret;
wxDECLARE_NO_COPY_CLASS(wxCaret);
};
#endif // _WX_CARET_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,91 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/checkbox.h
// Purpose: wxCheckBox class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: checkbox.h 54008 2008-06-07 01:54:44Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHECKBOX_H_
#define _WX_CHECKBOX_H_
// Checkbox item (single checkbox)
class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
{
public:
wxCheckBox() { }
wxCheckBox(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool value);
virtual bool GetValue() const;
// override some base class virtuals
virtual void SetLabel(const wxString& label);
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual void Command(wxCommandEvent& event);
virtual bool SetForegroundColour(const wxColour& colour);
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;
virtual void DoSet3StateValue(wxCheckBoxState value);
virtual wxCheckBoxState DoGet3StateValue() const;
// make the checkbox owner drawn or reset it to normal style
void MakeOwnerDrawn(bool ownerDrawn);
// return true if this checkbox is owner drawn
bool IsOwnerDrawn() const;
private:
// common part of all ctors
void Init();
// event handlers used by owner-drawn checkbox
void OnMouseEnterOrLeave(wxMouseEvent& event);
void OnMouseLeft(wxMouseEvent& event);
void OnFocus(wxFocusEvent& event);
// current state of the checkbox
wxCheckBoxState m_state;
// true if the checkbox is currently pressed
bool m_isPressed;
// true if mouse is currently over the control
bool m_isHot;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckBox)
};
#endif
// _WX_CHECKBOX_H_

View File

@ -0,0 +1,89 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/checklst.h
// Purpose: wxCheckListBox class - a listbox with checkable items
// Author: Vadim Zeitlin
// Modified by:
// Created: 16.11.97
// RCS-ID: $Id: checklst.h 63226 2010-01-23 13:22:00Z VZ $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef __CHECKLST__H_
#define __CHECKLST__H_
#if !wxUSE_OWNER_DRAWN
#error "wxCheckListBox class requires owner-drawn functionality."
#endif
class WXDLLIMPEXP_FWD_CORE wxOwnerDrawn;
class WXDLLIMPEXP_FWD_CORE wxCheckListBoxItem; // fwd decl, defined in checklst.cpp
class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
{
public:
// ctors
wxCheckListBox();
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int nStrings = 0,
const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
// items may be checked
virtual bool IsChecked(unsigned int uiIndex) const;
virtual void Check(unsigned int uiIndex, bool bCheck = true);
virtual void Toggle(unsigned int uiIndex);
// we create our items ourselves and they have non-standard size,
// so we need to override these functions
virtual wxOwnerDrawn *CreateLboxItem(size_t n);
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
protected:
// pressing space or clicking the check box toggles the item
void OnKeyDown(wxKeyEvent& event);
void OnLeftClick(wxMouseEvent& event);
// send an "item checked" event
void SendEvent(unsigned int uiIndex)
{
wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId());
event.SetInt(uiIndex);
event.SetEventObject(this);
event.SetString(GetString(uiIndex));
ProcessCommand(event);
}
wxSize DoGetBestClientSize() const;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckListBox)
};
#endif //_CHECKLST_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,421 @@
/*
* Name: wx/msw/chkconf.h
* Purpose: Compiler-specific configuration checking
* Author: Julian Smart
* Modified by:
* Created: 01/02/97
* RCS-ID: $Id: chkconf.h 63832 2010-04-02 19:30:41Z VZ $
* Copyright: (c) Julian Smart
* Licence: wxWindows licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#ifndef _WX_MSW_CHKCONF_H_
#define _WX_MSW_CHKCONF_H_
/* ensure that MSW-specific settings are defined */
#ifndef wxUSE_ACTIVEX
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_ACTIVEX must be defined."
# else
# define wxUSE_ACTIVEX 0
# endif
#endif /* !defined(wxUSE_ACTIVEX) */
#ifndef wxUSE_CRASHREPORT
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_CRASHREPORT must be defined."
# else
# define wxUSE_CRASHREPORT 0
# endif
#endif /* !defined(wxUSE_CRASHREPORT) */
#ifndef wxUSE_DC_CACHEING
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_DC_CACHEING must be defined"
# else
# define wxUSE_DC_CACHEING 1
# endif
#endif /* wxUSE_DC_CACHEING */
#ifndef wxUSE_DIALUP_MANAGER
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_DIALUP_MANAGER must be defined."
# else
# define wxUSE_DIALUP_MANAGER 0
# endif
#endif /* !defined(wxUSE_DIALUP_MANAGER) */
#ifndef wxUSE_MS_HTML_HELP
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_MS_HTML_HELP must be defined."
# else
# define wxUSE_MS_HTML_HELP 0
# endif
#endif /* !defined(wxUSE_MS_HTML_HELP) */
#ifndef wxUSE_INICONF
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_INICONF must be defined."
# else
# define wxUSE_INICONF 0
# endif
#endif /* !defined(wxUSE_INICONF) */
#ifndef wxUSE_OLE
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_OLE must be defined."
# else
# define wxUSE_OLE 0
# endif
#endif /* !defined(wxUSE_OLE) */
#ifndef wxUSE_OLE_AUTOMATION
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_OLE_AUTOMATION must be defined."
# else
# define wxUSE_OLE_AUTOMATION 0
# endif
#endif /* !defined(wxUSE_OLE_AUTOMATION) */
#ifndef wxUSE_TASKBARICON_BALLOONS
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_TASKBARICON_BALLOONS must be defined."
# else
# define wxUSE_TASKBARICON_BALLOONS 0
# endif
#endif /* wxUSE_TASKBARICON_BALLOONS */
#ifndef wxUSE_UNICODE_MSLU
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_UNICODE_MSLU must be defined."
# else
# define wxUSE_UNICODE_MSLU 0
# endif
#endif /* wxUSE_UNICODE_MSLU */
#ifndef wxUSE_UXTHEME
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_UXTHEME must be defined."
# else
# define wxUSE_UXTHEME 0
# endif
#endif /* wxUSE_UXTHEME */
/*
* We don't want to give an error if wxUSE_UNICODE_MSLU is enabled but
* wxUSE_UNICODE is not as this would make it impossible to simply set the
* former in wx/setup.h as then the library wouldn't compile in non-Unicode
* configurations, so instead simply unset it silently when it doesn't make
* sense.
*/
#if wxUSE_UNICODE_MSLU && !wxUSE_UNICODE
# undef wxUSE_UNICODE_MSLU
# define wxUSE_UNICODE_MSLU 0
#endif
/*
* disable the settings which don't work for some compilers
*/
#ifndef wxUSE_NORLANDER_HEADERS
# if ( wxCHECK_WATCOM_VERSION(1,0) || defined(__WINE__) ) || \
((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))))
# define wxUSE_NORLANDER_HEADERS 1
# else
# define wxUSE_NORLANDER_HEADERS 0
# endif
#endif
/*
* See WINVER definition in wx/msw/wrapwin.h for the explanation of this test
* logic.
*/
#if (defined(__VISUALC__) && (__VISUALC__ < 1300)) && \
(!defined(WINVER) || WINVER < 0x0500)
# undef wxUSE_TASKBARICON_BALLOONS
# define wxUSE_TASKBARICON_BALLOONS 0
#endif
/*
* All of the settings below require SEH support (__try/__catch) and can't work
* without it.
*/
#if !defined(_MSC_VER) && \
(!defined(__BORLANDC__) || __BORLANDC__ < 0x0550)
# undef wxUSE_ON_FATAL_EXCEPTION
# define wxUSE_ON_FATAL_EXCEPTION 0
# undef wxUSE_CRASHREPORT
# define wxUSE_CRASHREPORT 0
# undef wxUSE_STACKWALKER
# define wxUSE_STACKWALKER 0
#endif /* compiler doesn't support SEH */
/* wxUSE_DEBUG_NEW_ALWAYS doesn't work with CodeWarrior */
#if defined(__MWERKS__)
# undef wxUSE_DEBUG_NEW_ALWAYS
# define wxUSE_DEBUG_NEW_ALWAYS 0
#endif
#if defined(__GNUWIN32__)
/* These don't work as expected for mingw32 and cygwin32 */
# undef wxUSE_MEMORY_TRACING
# define wxUSE_MEMORY_TRACING 0
# undef wxUSE_GLOBAL_MEMORY_OPERATORS
# define wxUSE_GLOBAL_MEMORY_OPERATORS 0
# undef wxUSE_DEBUG_NEW_ALWAYS
# define wxUSE_DEBUG_NEW_ALWAYS 0
/* some Cygwin versions don't have wcslen */
# if defined(__CYGWIN__) || defined(__CYGWIN32__)
# if ! ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95)))
# undef wxUSE_WCHAR_T
# define wxUSE_WCHAR_T 0
# endif
#endif
#endif /* __GNUWIN32__ */
/* wxUSE_MFC is not defined when using configure as it doesn't make sense for
gcc or mingw32 anyhow */
#ifndef wxUSE_MFC
#define wxUSE_MFC 0
#endif /* !defined(wxUSE_MFC) */
/* MFC duplicates these operators */
#if wxUSE_MFC
# undef wxUSE_GLOBAL_MEMORY_OPERATORS
# define wxUSE_GLOBAL_MEMORY_OPERATORS 0
# undef wxUSE_DEBUG_NEW_ALWAYS
# define wxUSE_DEBUG_NEW_ALWAYS 0
#endif /* wxUSE_MFC */
#if (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS)
/* GnuWin32 doesn't have appropriate headers for e.g. IUnknown. */
# undef wxUSE_DRAG_AND_DROP
# define wxUSE_DRAG_AND_DROP 0
#endif
#if !wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
# undef wxUSE_CHECKLISTBOX
# define wxUSE_CHECKLISTBOX 0
#endif
#if wxUSE_SPINCTRL
# if !wxUSE_SPINBTN
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxSpinCtrl requires wxSpinButton on MSW"
# else
# undef wxUSE_SPINBTN
# define wxUSE_SPINBTN 1
# endif
# endif
#endif
/*
Win64-specific checks.
*/
#ifdef __WIN64__
# if wxUSE_STACKWALKER
/* this is not currently supported under Win64, volunteers needed to
make it work */
# undef wxUSE_STACKWALKER
# define wxUSE_STACKWALKER 0
# undef wxUSE_CRASHREPORT
# define wxUSE_CRASHREPORT 0
# endif
#endif /* __WIN64__ */
/*
Compiler-specific checks.
*/
// Borland
#ifdef __BORLANDC__
#if __BORLANDC__ < 0x500
/* BC++ 4.0 can't compile JPEG library */
# undef wxUSE_LIBJPEG
# define wxUSE_LIBJPEG 0
#endif
/* wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode */
#if defined(WXMAKINGDLL) || defined(WXUSINGDLL)
# undef wxUSE_DEBUG_NEW_ALWAYS
# define wxUSE_DEBUG_NEW_ALWAYS 0
#endif
#endif /* __BORLANDC__ */
/* DMC++ doesn't have definitions for date picker control, so use generic control
*/
#ifdef __DMC__
# if wxUSE_DATEPICKCTRL
# undef wxUSE_DATEPICKCTRL_GENERIC
# undef wxUSE_DATEPICKCTRL
# endif
# define wxUSE_DATEPICKCTRL 0
# define wxUSE_DATEPICKCTRL_GENERIC 1
#endif
/*
un/redefine the options which we can't compile (after checking that they're
defined
*/
#ifdef __WINE__
# if wxUSE_ACTIVEX
# undef wxUSE_ACTIVEX
# define wxUSE_ACTIVEX 0
# endif /* wxUSE_ACTIVEX */
# if wxUSE_UNICODE_MSLU
# undef wxUSE_UNICODE_MSLU
# define wxUSE_UNICODE_MSLU 0
# endif /* wxUSE_UNICODE_MSLU */
#endif /* __WINE__ */
/* check settings consistency for MSW-specific ones */
#if wxUSE_CRASHREPORT && !wxUSE_ON_FATAL_EXCEPTION
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_CRASHREPORT requires wxUSE_ON_FATAL_EXCEPTION"
# else
# undef wxUSE_CRASHREPORT
# define wxUSE_CRASHREPORT 0
# endif
#endif /* wxUSE_CRASHREPORT */
#if !wxUSE_VARIANT
# if wxUSE_ACTIVEX
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxActiveXContainer requires wxVariant"
# else
# undef wxUSE_ACTIVEX
# define wxUSE_ACTIVEX 0
# endif
# endif
# if wxUSE_OLE_AUTOMATION
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxAutomationObject requires wxVariant"
# else
# undef wxUSE_OLE_AUTOMATION
# define wxUSE_OLE_AUTOMATION 0
# endif
# endif
#endif /* !wxUSE_VARIANT */
#if !wxUSE_DYNAMIC_LOADER
# if wxUSE_MS_HTML_HELP
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_MS_HTML_HELP requires wxUSE_DYNAMIC_LOADER."
# else
# undef wxUSE_MS_HTML_HELP
# define wxUSE_MS_HTML_HELP 0
# endif
# endif
# if wxUSE_DIALUP_MANAGER
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_DIALUP_MANAGER requires wxUSE_DYNAMIC_LOADER."
# else
# undef wxUSE_DIALUP_MANAGER
# define wxUSE_DIALUP_MANAGER 0
# endif
# endif
#endif /* !wxUSE_DYNAMIC_LOADER */
#if !wxUSE_DYNLIB_CLASS
# if wxUSE_UXTHEME
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_UXTHEME requires wxUSE_DYNLIB_CLASS"
# else
# undef wxUSE_UXTHEME
# define wxUSE_UXTHEME 0
# endif
# endif
# if wxUSE_MEDIACTRL
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_MEDIACTRL requires wxUSE_DYNLIB_CLASS"
# else
# undef wxUSE_MEDIACTRL
# define wxUSE_MEDIACTRL 0
# endif
# endif
# if wxUSE_INKEDIT
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_INKEDIT requires wxUSE_DYNLIB_CLASS"
# else
# undef wxUSE_INKEDIT
# define wxUSE_INKEDIT 0
# endif
# endif
#endif /* !wxUSE_DYNLIB_CLASS */
#if !wxUSE_OLE
# if wxUSE_ACTIVEX
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxActiveXContainer requires wxUSE_OLE"
# else
# undef wxUSE_ACTIVEX
# define wxUSE_ACTIVEX 0
# endif
# endif
# if wxUSE_DATAOBJ
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_DATAOBJ requires wxUSE_OLE"
# else
# undef wxUSE_DATAOBJ
# define wxUSE_DATAOBJ 0
# endif
# endif
# if wxUSE_OLE_AUTOMATION
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxAutomationObject requires wxUSE_OLE"
# else
# undef wxUSE_OLE_AUTOMATION
# define wxUSE_OLE_AUTOMATION 0
# endif
# endif
#endif /* !wxUSE_OLE */
#if !wxUSE_ACTIVEX
# if wxUSE_MEDIACTRL
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxMediaCtl requires wxActiveXContainer"
# else
# undef wxUSE_MEDIACTRL
# define wxUSE_MEDIACTRL 0
# endif
# endif
#endif /* !wxUSE_ACTIVEX */
#if !wxUSE_THREADS
# if wxUSE_FSWATCHER
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxFileSystemWatcher requires wxThread under MSW"
# else
# undef wxUSE_FSWATCHER
# define wxUSE_FSWATCHER 0
# endif
# endif
#endif /* !wxUSE_THREADS */
#if defined(__WXUNIVERSAL__) && wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW && !wxUSE_POSTSCRIPT
# undef wxUSE_POSTSCRIPT
# define wxUSE_POSTSCRIPT 1
#endif
#endif /* _WX_MSW_CHKCONF_H_ */

View File

@ -0,0 +1,165 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/choice.h
// Purpose: wxChoice class
// Author: Julian Smart
// Modified by: Vadim Zeitlin to derive from wxChoiceBase
// Created: 01/02/97
// RCS-ID: $Id: choice.h 62960 2009-12-21 15:20:37Z JMS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICE_H_
#define _WX_CHOICE_H_
// ----------------------------------------------------------------------------
// Choice item
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase
{
public:
// ctors
wxChoice() { Init(); }
virtual ~wxChoice();
wxChoice(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
{
Init();
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxChoice(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
virtual void SetLabel(const wxString& label);
virtual unsigned int GetCount() const;
virtual int GetSelection() const;
virtual int GetCurrentSelection() const;
virtual void SetSelection(int n);
virtual int FindString(const wxString& s, bool bCase = false) const;
virtual wxString GetString(unsigned int n) const;
virtual void SetString(unsigned int n, const wxString& s);
virtual wxVisualAttributes GetDefaultAttributes() const
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// MSW only
virtual bool MSWCommand(WXUINT param, WXWORD id);
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXHBRUSH MSWControlColor(WXHDC hDC, WXHWND hWnd);
virtual bool MSWShouldPreProcessMessage(WXMSG *pMsg);
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
// common part of all ctors
void Init()
{
m_lastAcceptedSelection = wxID_NONE;
m_heightOwn = wxDefaultCoord;
}
virtual void DoDeleteOneItem(unsigned int n);
virtual void DoClear();
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData, wxClientDataType type);
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoSetItemClientData(unsigned int n, void* clientData);
virtual void* DoGetItemClientData(unsigned int n) const;
// MSW implementation
virtual wxSize DoGetBestSize() const;
virtual void DoGetSize(int *w, int *h) const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
// update the height of the drop down list to fit the number of items we
// have (without changing the visible height)
void MSWUpdateDropDownHeight();
// set the height of the visible part of the control to m_heightOwn
void MSWUpdateVisibleHeight();
// create and initialize the control
bool CreateAndInit(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
int n, const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name);
// free all memory we have (used by Clear() and dtor)
void Free();
// set the height for simple combo box
int SetHeightSimpleComboBox(int nItems) const;
#if wxUSE_DEFERRED_SIZING
virtual void MSWEndDeferWindowPos();
#endif // wxUSE_DEFERRED_SIZING
// last "completed" selection, i.e. not the transient one while the user is
// browsing the popup list: this is only used when != wxID_NONE which is
// the case while the drop down is opened
int m_lastAcceptedSelection;
// the height of the control itself if it was set explicitly or
// wxDefaultCoord if it hadn't
int m_heightOwn;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice)
};
#endif // _WX_CHOICE_H_

View File

@ -0,0 +1,90 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/clipbrd.h
// Purpose: wxClipboad class and clipboard functions for MSW
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: clipbrd.h 61485 2009-07-20 23:54:08Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CLIPBRD_H_
#define _WX_CLIPBRD_H_
#if wxUSE_CLIPBOARD
// These functions superceded by wxClipboard, but retained in order to
// implement wxClipboard, and for compatibility.
// open/close the clipboard
WXDLLIMPEXP_CORE bool wxOpenClipboard();
WXDLLIMPEXP_CORE bool wxIsClipboardOpened();
#define wxClipboardOpen wxIsClipboardOpened
WXDLLIMPEXP_CORE bool wxCloseClipboard();
// get/set data
WXDLLIMPEXP_CORE bool wxEmptyClipboard();
WXDLLIMPEXP_CORE bool wxSetClipboardData(wxDataFormat dataFormat,
const void *data,
int width = 0, int height = 0);
WXDLLIMPEXP_CORE void* wxGetClipboardData(wxDataFormat dataFormat,
long *len = NULL);
// clipboard formats
WXDLLIMPEXP_CORE bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
WXDLLIMPEXP_CORE wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
WXDLLIMPEXP_CORE int wxRegisterClipboardFormat(wxChar *formatName);
WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat,
wxChar *formatName,
int maxCount);
//-----------------------------------------------------------------------------
// wxClipboard
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
{
public:
wxClipboard();
virtual ~wxClipboard();
// open the clipboard before SetData() and GetData()
virtual bool Open();
// close the clipboard after SetData() and GetData()
virtual void Close();
// query whether the clipboard is opened
virtual bool IsOpened() const;
// set the clipboard data. all other formats will be deleted.
virtual bool SetData( wxDataObject *data );
// add to the clipboard data.
virtual bool AddData( wxDataObject *data );
// ask if data in correct format is available
virtual bool IsSupported( const wxDataFormat& format );
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data );
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear();
// flushes the clipboard: this means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// eating memory), otherwise the clipboard will be emptied on exit
virtual bool Flush();
private:
IDataObject *m_lastDataObject;
bool m_isOpened;
DECLARE_DYNAMIC_CLASS(wxClipboard)
};
#endif // wxUSE_CLIPBOARD
#endif // _WX_CLIPBRD_H_

View File

@ -0,0 +1,74 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/colordlg.h
// Purpose: wxColourDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: colordlg.h 66615 2011-01-07 05:26:57Z PC $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLORDLG_H_
#define _WX_COLORDLG_H_
#include "wx/dialog.h"
// ----------------------------------------------------------------------------
// wxColourDialog: dialog for choosing a colours
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
{
public:
wxColourDialog() { Init(); }
wxColourDialog(wxWindow *parent, wxColourData *data = NULL)
{
Init();
Create(parent, data);
}
bool Create(wxWindow *parent, wxColourData *data = NULL);
wxColourData& GetColourData() { return m_colourData; }
// override some base class virtuals
virtual void SetTitle(const wxString& title);
virtual wxString GetTitle() const;
virtual int ShowModal();
// wxMSW-specific implementation from now on
// -----------------------------------------
// called from the hook procedure on WM_INITDIALOG reception
virtual void MSWOnInitDone(WXHWND hDlg);
protected:
// common part of all ctors
void Init();
#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
virtual void DoGetPosition( int *x, int *y ) const;
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCentre(int dir);
#endif // !(__SMARTPHONE__ && __WXWINCE__)
wxColourData m_colourData;
wxString m_title;
// indicates that the dialog should be centered in this direction if non 0
// (set by DoCentre(), used by MSWOnInitDone())
int m_centreDir;
// true if DoMoveWindow() had been called
bool m_movedWindow;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxColourDialog)
};
#endif // _WX_COLORDLG_H_

View File

@ -0,0 +1,73 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/colour.h
// Purpose: wxColour class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: colour.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOUR_H_
#define _WX_COLOUR_H_
#include "wx/object.h"
// ----------------------------------------------------------------------------
// Colour
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
{
public:
// constructors
// ------------
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
// accessors
// ---------
virtual bool IsOk() const { return m_isInit; }
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
unsigned char Alpha() const { return m_alpha ; }
// comparison
bool operator==(const wxColour& colour) const
{
return m_isInit == colour.m_isInit
&& m_red == colour.m_red
&& m_green == colour.m_green
&& m_blue == colour.m_blue
&& m_alpha == colour.m_alpha;
}
bool operator!=(const wxColour& colour) const { return !(*this == colour); }
WXCOLORREF GetPixel() const { return m_pixel; }
public:
WXCOLORREF m_pixel;
protected:
// Helper function
void Init();
virtual void
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
private:
bool m_isInit;
unsigned char m_red;
unsigned char m_blue;
unsigned char m_green;
unsigned char m_alpha;
private:
DECLARE_DYNAMIC_CLASS(wxColour)
};
#endif // _WX_COLOUR_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

View File

@ -0,0 +1,116 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/combo.h
// Purpose: wxComboCtrl class
// Author: Jaakko Salli
// Modified by:
// Created: Apr-30-2006
// RCS-ID: $Id: combo.h 66385 2010-12-16 17:21:49Z JMS $
// Copyright: (c) Jaakko Salli
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COMBOCONTROL_H_
#define _WX_COMBOCONTROL_H_
// NB: Definition of _WX_COMBOCONTROL_H_ is used in wx/generic/combo.h to
// determine whether there is native wxComboCtrl, so make sure you
// use it in all native wxComboCtrls.
#if wxUSE_COMBOCTRL
#if !defined(__WXWINCE__) && wxUSE_TIMER
#include "wx/timer.h"
#define wxUSE_COMBOCTRL_POPUP_ANIMATION 1
#else
#define wxUSE_COMBOCTRL_POPUP_ANIMATION 0
#endif
// ----------------------------------------------------------------------------
// Native wxComboCtrl
// ----------------------------------------------------------------------------
// Define this only if native implementation includes all features
#define wxCOMBOCONTROL_FULLY_FEATURED
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
class WXDLLIMPEXP_CORE wxComboCtrl : public wxComboCtrlBase
{
public:
// ctors and such
wxComboCtrl() : wxComboCtrlBase() { Init(); }
wxComboCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
: wxComboCtrlBase()
{
Init();
(void)Create(parent, id, value, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
virtual ~wxComboCtrl();
virtual void PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const;
virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const;
static int GetFeatures() { return wxComboCtrlFeatures::All; }
#if wxUSE_COMBOCTRL_POPUP_ANIMATION
void OnTimerEvent(wxTimerEvent& WXUNUSED(event)) { DoTimerEvent(); }
protected:
void DoTimerEvent();
virtual bool AnimateShow( const wxRect& rect, int flags );
#endif // wxUSE_COMBOCTRL_POPUP_ANIMATION
protected:
// Dummy method - we override all functions that call this
virtual WXHWND GetEditHWND() const { return NULL; }
// customization
virtual void OnResize();
virtual wxCoord GetNativeTextIndent() const;
// event handlers
void OnPaintEvent( wxPaintEvent& event );
void OnMouseEvent( wxMouseEvent& event );
private:
void Init();
#if wxUSE_COMBOCTRL_POPUP_ANIMATION
// Popup animation related
wxLongLong m_animStart;
wxTimer m_animTimer;
wxRect m_animRect;
int m_animFlags;
#endif
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxComboCtrl)
};
#endif // wxUSE_COMBOCTRL
#endif
// _WX_COMBOCONTROL_H_

View File

@ -0,0 +1,166 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/combobox.h
// Purpose: wxComboBox class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: combobox.h 63242 2010-01-24 01:00:45Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COMBOBOX_H_
#define _WX_COMBOBOX_H_
#include "wx/choice.h"
#include "wx/textentry.h"
#if wxUSE_COMBOBOX
// ----------------------------------------------------------------------------
// Combobox control
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxComboBox : public wxChoice,
public wxTextEntry
{
public:
wxComboBox() { Init(); }
wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Init();
Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Init();
Create(parent, id, value, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0,
const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
// resolve ambiguities among virtual functions inherited from both base
// classes
virtual void Clear();
virtual wxString GetValue() const;
virtual void SetValue(const wxString& value);
virtual wxString GetStringSelection() const
{ return wxChoice::GetStringSelection(); }
virtual void Popup() { MSWDoPopupOrDismiss(true); }
virtual void Dismiss() { MSWDoPopupOrDismiss(false); }
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
virtual void SetSelection(long from, long to)
{ wxTextEntry::SetSelection(from, to); }
virtual int GetSelection() const { return wxChoice::GetSelection(); }
virtual void GetSelection(long *from, long *to) const;
virtual bool IsEditable() const;
// implementation only from now on
virtual bool MSWCommand(WXUINT param, WXWORD id);
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
bool MSWShouldPreProcessMessage(WXMSG *pMsg);
// Standard event handling
void OnCut(wxCommandEvent& event);
void OnCopy(wxCommandEvent& event);
void OnPaste(wxCommandEvent& event);
void OnUndo(wxCommandEvent& event);
void OnRedo(wxCommandEvent& event);
void OnDelete(wxCommandEvent& event);
void OnSelectAll(wxCommandEvent& event);
void OnUpdateCut(wxUpdateUIEvent& event);
void OnUpdateCopy(wxUpdateUIEvent& event);
void OnUpdatePaste(wxUpdateUIEvent& event);
void OnUpdateUndo(wxUpdateUIEvent& event);
void OnUpdateRedo(wxUpdateUIEvent& event);
void OnUpdateDelete(wxUpdateUIEvent& event);
void OnUpdateSelectAll(wxUpdateUIEvent& event);
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
#if wxUSE_UXTHEME
// override wxTextEntry method to work around Windows bug
virtual bool SetHint(const wxString& hint);
#endif // wxUSE_UXTHEME
protected:
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip(wxToolTip *tip);
#endif
void MSWDoPopupOrDismiss(bool show);
// this is the implementation of GetEditHWND() which can also be used when
// we don't have the edit control, it simply returns NULL then
//
// try not to use this function unless absolutely necessary (as in the
// message handling code where the edit control might not be created yet
// for the messages we receive during the control creation) as normally
// just testing for IsEditable() and using GetEditHWND() should be enough
WXHWND GetEditHWNDIfAvailable() const;
virtual void EnableTextChangedEvents(bool enable)
{
m_allowTextEvents = enable;
}
private:
// there are the overridden wxTextEntry methods which should only be called
// when we do have an edit control so they assert if this is not the case
virtual wxWindow *GetEditableWindow();
virtual WXHWND GetEditHWND() const;
// common part of all ctors
void Init()
{
m_allowTextEvents = true;
}
// normally true, false if text events are currently disabled
bool m_allowTextEvents;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox)
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_COMBOBOX
#endif // _WX_COMBOBOX_H_

View File

@ -0,0 +1,74 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/commandlinkbutton.h
// Purpose: wxCommandLinkButton class
// Author: Rickard Westerlund
// Created: 2010-06-11
// RCS-ID: $Id: commandlinkbutton.h 65327 2010-08-17 14:48:50Z VZ $
// Copyright: (c) 2010 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_COMMANDLINKBUTTON_H_
#define _WX_MSW_COMMANDLINKBUTTON_H_
// ----------------------------------------------------------------------------
// Command link button for wxMSW
// ----------------------------------------------------------------------------
// Derive from the generic version to be able to fall back to it during
// run-time if the command link buttons are not supported by the system we're
// running under.
class WXDLLIMPEXP_ADV wxCommandLinkButton : public wxGenericCommandLinkButton
{
public:
wxCommandLinkButton () : wxGenericCommandLinkButton() { }
wxCommandLinkButton(wxWindow *parent,
wxWindowID id,
const wxString& mainLabel = wxEmptyString,
const wxString& note = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
: wxGenericCommandLinkButton()
{
Create(parent, id, mainLabel, note, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& mainLabel = wxEmptyString,
const wxString& note = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
// overridden base class methods
// -----------------------------
// do the same thing as in the generic case here
virtual void SetLabel(const wxString& label)
{
SetMainLabelAndNote(label.BeforeFirst('\n'), label.AfterFirst('\n'));
}
virtual void SetMainLabelAndNote(const wxString& mainLabel,
const wxString& note);
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
protected:
virtual wxSize DoGetBestSize() const;
virtual bool HasNativeBitmap() const;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxCommandLinkButton);
};
#endif // _WX_MSW_COMMANDLINKBUTTON_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,133 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/control.h
// Purpose: wxControl class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: control.h 62151 2009-09-26 16:43:06Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CONTROL_H_
#define _WX_CONTROL_H_
#include "wx/dynarray.h"
// General item class
class WXDLLIMPEXP_CORE wxControl : public wxControlBase
{
public:
wxControl() { }
wxControl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr)
{
Create(parent, id, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
// Simulates an event
virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
// implementation from now on
// --------------------------
virtual wxVisualAttributes GetDefaultAttributes() const
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// Calls the callback and appropriate event handlers
bool ProcessCommand(wxCommandEvent& event);
// MSW-specific
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
// For ownerdraw items
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *WXUNUSED(item)) { return false; }
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *WXUNUSED(item)) { return false; }
const wxArrayLong& GetSubcontrols() const { return m_subControls; }
// default handling of WM_CTLCOLORxxx: this is public so that wxWindow
// could call it
virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd);
// default style for the control include WS_TABSTOP if it AcceptsFocus()
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const;
// return default best size (doesn't really make any sense, override this)
virtual wxSize DoGetBestSize() const;
// This is a helper for all wxControls made with UPDOWN native control.
// In wxMSW it was only wxSpinCtrl derived from wxSpinButton but in
// WinCE of Smartphones this happens also for native wxTextCtrl,
// wxChoice and others.
virtual wxSize GetBestSpinnerSize(const bool is_vertical) const;
// create the control of the given Windows class: this is typically called
// from Create() method of the derived class passing its label, pos and
// size parameter (style parameter is not needed because m_windowStyle is
// supposed to had been already set and so is used instead when this
// function is called)
bool MSWCreateControl(const wxChar *classname,
const wxString& label,
const wxPoint& pos,
const wxSize& size);
// NB: the method below is deprecated now, with MSWGetStyle() the method
// above should be used instead! Once all the controls are updated to
// implement MSWGetStyle() this version will disappear.
//
// create the control of the given class with the given style (combination
// of WS_XXX flags, i.e. Windows style, not wxWidgets one), returns
// false if creation failed
//
// All parameters except classname and style are optional, if the
// size/position are not given, they should be set later with SetSize()
// and, label (the title of the window), of course, is left empty. The
// extended style is determined from the style and the app 3D settings
// automatically if it's not specified explicitly.
bool MSWCreateControl(const wxChar *classname,
WXDWORD style,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& label = wxEmptyString,
WXDWORD exstyle = (WXDWORD)-1);
// call this from the derived class MSWControlColor() if you want to show
// the control greyed out (and opaque)
WXHBRUSH MSWControlColorDisabled(WXHDC pDC);
// common part of the 3 functions above: pass wxNullColour to use the
// appropriate background colour (meaning ours or our parents) or a fixed
// one
virtual WXHBRUSH DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd);
// for controls like radiobuttons which are really composite this array
// holds the ids (not HWNDs!) of the sub controls
wxArrayLong m_subControls;
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxControl)
};
#endif // _WX_CONTROL_H_

View File

@ -0,0 +1,120 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/crashrpt.h
// Purpose: helpers for the structured exception handling (SEH) under Win32
// Author: Vadim Zeitlin
// Modified by:
// Created: 13.07.2003
// RCS-ID: $Id: crashrpt.h 53816 2008-05-29 13:28:05Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_CRASHRPT_H_
#define _WX_MSW_CRASHRPT_H_
#include "wx/defs.h"
#if wxUSE_CRASHREPORT
struct _EXCEPTION_POINTERS;
// ----------------------------------------------------------------------------
// crash report generation flags
// ----------------------------------------------------------------------------
enum
{
// we always report where the crash occurred
wxCRASH_REPORT_LOCATION = 0,
// if this flag is given, the call stack is dumped
//
// this results in dump/crash report as small as possible, this is the
// default flag
wxCRASH_REPORT_STACK = 1,
// if this flag is given, the values of the local variables are dumped
//
// note that with the current implementation it requires dumping the full
// process address space and so this will result in huge dump file and will
// take some time to generate
//
// it's probably not a good idea to use this by default, start with default
// mini dump and ask your users to set WX_CRASH_FLAGS environment variable
// to 2 or 4 if you need more information in the dump
wxCRASH_REPORT_LOCALS = 2,
// if this flag is given, the values of all global variables are dumped
//
// this creates a much larger mini dump than just wxCRASH_REPORT_STACK but
// still much smaller than wxCRASH_REPORT_LOCALS one
wxCRASH_REPORT_GLOBALS = 4,
// default is to create the smallest possible crash report
wxCRASH_REPORT_DEFAULT = wxCRASH_REPORT_LOCATION | wxCRASH_REPORT_STACK
};
// ----------------------------------------------------------------------------
// wxCrashContext: information about the crash context
// ----------------------------------------------------------------------------
struct WXDLLIMPEXP_BASE wxCrashContext
{
// initialize this object with the given information or from the current
// global exception info which is only valid inside wxApp::OnFatalException
wxCrashContext(_EXCEPTION_POINTERS *ep = NULL);
// get the name for this exception code
wxString GetExceptionString() const;
// exception code
size_t code;
// exception address
void *addr;
// machine-specific registers vaues
struct
{
#ifdef __INTEL__
wxInt32 eax, ebx, ecx, edx, esi, edi,
ebp, esp, eip,
cs, ds, es, fs, gs, ss,
flags;
#endif // __INTEL__
} regs;
};
// ----------------------------------------------------------------------------
// wxCrashReport: this class is used to create crash reports
// ----------------------------------------------------------------------------
struct WXDLLIMPEXP_BASE wxCrashReport
{
// set the name of the file to which the report is written, it is
// constructed from the .exe name by default
static void SetFileName(const wxString& filename);
// return the current file name
static wxString GetFileName();
// write the exception report to the file, return true if it could be done
// or false otherwise
//
// if ep pointer is NULL, the global exception info which is valid only
// inside wxApp::OnFatalException() is used
static bool Generate(int flags = wxCRASH_REPORT_DEFAULT,
_EXCEPTION_POINTERS *ep = NULL);
// generate a crash report from outside of wxApp::OnFatalException(), this
// can be used to take "snapshots" of the program in wxApp::OnAssert() for
// example
static bool GenerateNow(int flags = wxCRASH_REPORT_DEFAULT);
};
#endif // wxUSE_CRASHREPORT
#endif // _WX_MSW_CRASHRPT_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

View File

@ -0,0 +1,43 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/ctrlsub.h
// Purpose: common functionality of wxItemContainer-derived controls
// Author: Vadim Zeitlin
// Created: 2007-07-25
// RCS-ID: $Id: ctrlsub.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_CTRLSUB_H_
#define _WX_MSW_CTRLSUB_H_
// ----------------------------------------------------------------------------
// wxControlWithItems
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxControlWithItems : public wxControlWithItemsBase
{
public:
wxControlWithItems() { }
protected:
// preallocate memory for inserting the given new items into the control
// using the wm message (normally either LB_INITSTORAGE or CB_INITSTORAGE)
void MSWAllocStorage(const wxArrayStringsAdapter& items, unsigned wm);
// insert or append a string to the controls using the given message
// (one of {CB,LB}_{ADD,INSERT}STRING, pos must be 0 when appending)
int MSWInsertOrAppendItem(unsigned pos, const wxString& item, unsigned wm);
// normally the control containing the items is this window itself but if
// the derived control is composed of several windows, this method can be
// overridden to return the real list/combobox control
virtual WXHWND MSWGetItemsHWND() const { return GetHWND(); }
private:
DECLARE_ABSTRACT_CLASS(wxControlWithItems)
wxDECLARE_NO_COPY_CLASS(wxControlWithItems);
};
#endif // _WX_MSW_CTRLSUB_H_

View File

@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/cursor.h
// Purpose: wxCursor class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: cursor.h 55884 2008-09-25 17:56:07Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CURSOR_H_
#define _WX_CURSOR_H_
#include "wx/msw/gdiimage.h"
class WXDLLIMPEXP_FWD_CORE wxImage;
// Cursor
class WXDLLIMPEXP_CORE wxCursor : public wxGDIImage
{
public:
// constructors
wxCursor();
wxCursor(const wxImage& image);
wxCursor(const wxString& name,
wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
wxCursor(wxStockCursor id) { InitFromStock(id); }
#if WXWIN_COMPATIBILITY_2_8
wxCursor(int id) { InitFromStock((wxStockCursor)id); }
#endif
virtual ~wxCursor();
// implementation only
void SetHCURSOR(WXHCURSOR cursor) { SetHandle((WXHANDLE)cursor); }
WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); }
protected:
void InitFromStock(wxStockCursor);
virtual wxGDIImageRefData *CreateData() const;
private:
DECLARE_DYNAMIC_CLASS(wxCursor)
};
#endif
// _WX_CURSOR_H_

View File

@ -0,0 +1,74 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/datectrl.h
// Purpose: wxDatePickerCtrl for Windows
// Author: Vadim Zeitlin
// Modified by:
// Created: 2005-01-09
// RCS-ID: $Id: datectrl.h 49893 2007-11-13 12:10:34Z JS $
// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_DATECTRL_H_
#define _WX_MSW_DATECTRL_H_
// ----------------------------------------------------------------------------
// wxDatePickerCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlBase
{
public:
// ctors
wxDatePickerCtrl() { }
wxDatePickerCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDatePickerCtrlNameStr)
{
Create(parent, id, dt, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDatePickerCtrlNameStr);
// set/get the date
virtual void SetValue(const wxDateTime& dt);
virtual wxDateTime GetValue() const;
// set/get the allowed valid range for the dates, if either/both of them
// are invalid, there is no corresponding limit and if neither is set
// GetRange() returns false
virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2);
virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxSize DoGetBestSize() const;
// the date currently shown by the control, may be invalid
wxDateTime m_date;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl)
};
#endif // _WX_MSW_DATECTRL_H_

373
Externals/wxWidgets3/include/wx/msw/dc.h vendored Normal file
View File

@ -0,0 +1,373 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dc.h
// Purpose: wxDC class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dc.h 67063 2011-02-27 12:48:13Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_DC_H_
#define _WX_MSW_DC_H_
#include "wx/defs.h"
#include "wx/dc.h"
// ---------------------------------------------------------------------------
// macros
// ---------------------------------------------------------------------------
#if wxUSE_DC_CACHEING
/*
* Cached blitting, maintaining a cache
* of bitmaps required for transparent blitting
* instead of constant creation/deletion
*/
class wxDCCacheEntry: public wxObject
{
public:
wxDCCacheEntry(WXHBITMAP hBitmap, int w, int h, int depth);
wxDCCacheEntry(WXHDC hDC, int depth);
virtual ~wxDCCacheEntry();
WXHBITMAP m_bitmap;
WXHDC m_dc;
int m_width;
int m_height;
int m_depth;
};
#endif
// this is an ABC: use one of the derived classes to create a DC associated
// with a window, screen, printer and so on
class WXDLLIMPEXP_CORE wxMSWDCImpl: public wxDCImpl
{
public:
wxMSWDCImpl(wxDC *owner, WXHDC hDC);
virtual ~wxMSWDCImpl();
// implement base class pure virtuals
// ----------------------------------
virtual void Clear();
virtual bool StartDoc(const wxString& message);
virtual void EndDoc();
virtual void StartPage();
virtual void EndPage();
virtual void SetFont(const wxFont& font);
virtual void SetPen(const wxPen& pen);
virtual void SetBrush(const wxBrush& brush);
virtual void SetBackground(const wxBrush& brush);
virtual void SetBackgroundMode(int mode);
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette);
#endif // wxUSE_PALETTE
virtual void DestroyClippingRegion();
virtual wxCoord GetCharHeight() const;
virtual wxCoord GetCharWidth() const;
virtual bool CanDrawBitmap() const;
virtual bool CanGetTextExtent() const;
virtual int GetDepth() const;
virtual wxSize GetPPI() const;
virtual void SetMapMode(wxMappingMode mode);
virtual void SetUserScale(double x, double y);
virtual void SetLogicalScale(double x, double y);
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
virtual void SetLogicalFunction(wxRasterOperationMode function);
// implementation from now on
// --------------------------
virtual void SetRop(WXHDC cdc);
virtual void SelectOldObjects(WXHDC dc);
void SetWindow(wxWindow *win)
{
m_window = win;
#if wxUSE_PALETTE
// if we have palettes use the correct one for this window
InitializePalette();
#endif // wxUSE_PALETTE
}
WXHDC GetHDC() const { return m_hDC; }
void SetHDC(WXHDC dc, bool bOwnsDC = false)
{
m_hDC = dc;
m_bOwnsDC = bOwnsDC;
// we might have a pre existing clipping region, make sure that we
// return it if asked -- but avoid calling ::GetClipBox() right now as
// it could be unnecessary wasteful
m_clipping = true;
m_clipX1 =
m_clipX2 = 0;
}
const wxBitmap& GetSelectedBitmap() const { return m_selectedBitmap; }
wxBitmap& GetSelectedBitmap() { return m_selectedBitmap; }
// update the internal clip box variables
void UpdateClipBox();
#if wxUSE_DC_CACHEING
static wxDCCacheEntry* FindBitmapInCache(WXHDC hDC, int w, int h);
static wxDCCacheEntry* FindDCInCache(wxDCCacheEntry* notThis, WXHDC hDC);
static void AddToBitmapCache(wxDCCacheEntry* entry);
static void AddToDCCache(wxDCCacheEntry* entry);
static void ClearCache();
#endif
// RTL related functions
// ---------------------
// get or change the layout direction (LTR or RTL) for this dc,
// wxLayout_Default is returned if layout direction is not supported
virtual wxLayoutDirection GetLayoutDirection() const;
virtual void SetLayoutDirection(wxLayoutDirection dir);
protected:
void Init()
{
m_bOwnsDC = false;
m_hDC = NULL;
m_oldBitmap = NULL;
m_oldPen = NULL;
m_oldBrush = NULL;
m_oldFont = NULL;
#if wxUSE_PALETTE
m_oldPalette = NULL;
#endif // wxUSE_PALETTE
}
// create an uninitialized DC: this should be only used by the derived
// classes
wxMSWDCImpl( wxDC *owner ) : wxDCImpl( owner ) { Init(); }
void RealizeScaleAndOrigin();
public:
virtual void DoGetFontMetrics(int *height,
int *ascent,
int *descent,
int *internalLeading,
int *externalLeading,
int *averageWidth) const;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const;
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const;
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE);
virtual void DoGradientFillLinear(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
wxDirection nDirection = wxEAST);
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
virtual void DoDrawPoint(wxCoord x, wxCoord y);
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc);
virtual void DoDrawCheckMark(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea);
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius);
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
#if wxUSE_SPLINES && !defined(__WXWINCE__)
virtual void DoDrawSpline(const wxPointList *points);
#endif
virtual void DoCrossHair(wxCoord x, wxCoord y);
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false);
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
double angle);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest,
wxCoord dstWidth, wxCoord dstHeight,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
wxCoord srcWidth, wxCoord srcHeight,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
wxCoord *w, wxCoord *h) const;
virtual void DoGetSizeMM(int* width, int* height) const;
virtual void DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset);
virtual void DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
{
return subrect == NULL ? GetSelectedBitmap()
: GetSelectedBitmap().GetSubBitmap(*subrect);
}
#if wxUSE_PALETTE
// MSW specific, select a logical palette into the HDC
// (tell windows to translate pixel from other palettes to our custom one
// and vice versa)
// Realize tells it to also reset the system palette to this one.
void DoSelectPalette(bool realize = false);
// Find out what palette our parent window has, then select it into the dc
void InitializePalette();
#endif // wxUSE_PALETTE
protected:
// common part of DoDrawText() and DoDrawRotatedText()
void DrawAnyText(const wxString& text, wxCoord x, wxCoord y);
// common part of DoSetClippingRegion() and DoSetDeviceClippingRegion()
void SetClippingHrgn(WXHRGN hrgn);
// implementation of DoGetSize() for wxScreen/PrinterDC: this simply
// returns the size of the entire device this DC is associated with
//
// notice that we intentionally put it in a separate function instead of
// DoGetSize() itself because we want it to remain pure virtual both
// because each derived class should take care to define it as needed (this
// implementation is not at all always appropriate) and because we want
// wxDC to be an ABC to prevent it from being created directly
void GetDeviceSize(int *width, int *height) const;
// MSW-specific member variables
// -----------------------------
// the window associated with this DC (may be NULL)
wxWindow *m_canvas;
wxBitmap m_selectedBitmap;
// TRUE => DeleteDC() in dtor, FALSE => only ReleaseDC() it
bool m_bOwnsDC:1;
// our HDC
WXHDC m_hDC;
// Store all old GDI objects when do a SelectObject, so we can select them
// back in (this unselecting user's objects) so we can safely delete the
// DC.
WXHBITMAP m_oldBitmap;
WXHPEN m_oldPen;
WXHBRUSH m_oldBrush;
WXHFONT m_oldFont;
#if wxUSE_PALETTE
WXHPALETTE m_oldPalette;
#endif // wxUSE_PALETTE
#if wxUSE_DC_CACHEING
static wxObjectList sm_bitmapCache;
static wxObjectList sm_dcCache;
#endif
DECLARE_CLASS(wxMSWDCImpl)
wxDECLARE_NO_COPY_CLASS(wxMSWDCImpl);
};
// ----------------------------------------------------------------------------
// wxDCTemp: a wxDC which doesn't free the given HDC (used by wxWidgets
// only/mainly)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDCTempImpl : public wxMSWDCImpl
{
public:
// construct a temporary DC with the specified HDC and size (it should be
// specified whenever we know it for this HDC)
wxDCTempImpl(wxDC *owner, WXHDC hdc, const wxSize& size )
: wxMSWDCImpl( owner, hdc ),
m_size(size)
{
}
virtual ~wxDCTempImpl()
{
// prevent base class dtor from freeing it
SetHDC((WXHDC)NULL);
}
virtual void DoGetSize(int *w, int *h) const
{
wxASSERT_MSG( m_size.IsFullySpecified(),
wxT("size of this DC hadn't been set and is unknown") );
if ( w )
*w = m_size.x;
if ( h )
*h = m_size.y;
}
private:
// size of this DC must be explicitly set by SetSize() as we have no way to
// find it ourselves
const wxSize m_size;
wxDECLARE_NO_COPY_CLASS(wxDCTempImpl);
};
class WXDLLIMPEXP_CORE wxDCTemp : public wxDC
{
public:
wxDCTemp(WXHDC hdc, const wxSize& size = wxDefaultSize)
: wxDC(new wxDCTempImpl(this, hdc, size))
{
}
};
#endif // _WX_MSW_DC_H_

View File

@ -0,0 +1,115 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dcclient.h
// Purpose: wxClientDC class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dcclient.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCCLIENT_H_
#define _WX_DCCLIENT_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/dc.h"
#include "wx/msw/dc.h"
#include "wx/dcclient.h"
#include "wx/dynarray.h"
// ----------------------------------------------------------------------------
// array types
// ----------------------------------------------------------------------------
// this one if used by wxPaintDC only
struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo;
WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
// ----------------------------------------------------------------------------
// DC classes
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxMSWDCImpl
{
public:
// default ctor
wxWindowDCImpl( wxDC *owner );
// Create a DC corresponding to the whole window
wxWindowDCImpl( wxDC *owner, wxWindow *win );
virtual void DoGetSize(int *width, int *height) const;
protected:
// initialize the newly created DC
void InitDC();
DECLARE_CLASS(wxWindowDCImpl)
wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
};
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
{
public:
// default ctor
wxClientDCImpl( wxDC *owner );
// Create a DC corresponding to the client area of the window
wxClientDCImpl( wxDC *owner, wxWindow *win );
virtual ~wxClientDCImpl();
virtual void DoGetSize(int *width, int *height) const;
protected:
void InitDC();
DECLARE_CLASS(wxClientDCImpl)
wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
};
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
{
public:
wxPaintDCImpl( wxDC *owner );
// Create a DC corresponding for painting the window in OnPaint()
wxPaintDCImpl( wxDC *owner, wxWindow *win );
virtual ~wxPaintDCImpl();
// find the entry for this DC in the cache (keyed by the window)
static WXHDC FindDCInCache(wxWindow* win);
protected:
static wxArrayDCInfo ms_cache;
// find the entry for this DC in the cache (keyed by the window)
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
DECLARE_CLASS(wxPaintDCImpl)
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
};
/*
* wxPaintDCEx
* This class is used when an application sends an HDC with the WM_PAINT
* message. It is used in HandlePaint and need not be used by an application.
*/
class WXDLLIMPEXP_CORE wxPaintDCEx : public wxPaintDC
{
public:
wxPaintDCEx(wxWindow *canvas, WXHDC dc);
DECLARE_CLASS(wxPaintDCEx)
wxDECLARE_NO_COPY_CLASS(wxPaintDCEx);
};
#endif
// _WX_DCCLIENT_H_

View File

@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dcmemory.h
// Purpose: wxMemoryDC class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dcmemory.h 61724 2009-08-21 10:41:26Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCMEMORY_H_
#define _WX_DCMEMORY_H_
#include "wx/dcmemory.h"
#include "wx/msw/dc.h"
class WXDLLIMPEXP_CORE wxMemoryDCImpl: public wxMSWDCImpl
{
public:
wxMemoryDCImpl( wxMemoryDC *owner );
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc ); // Create compatible DC
// override some base class virtuals
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoGetSize(int* width, int* height) const;
virtual void DoSelect(const wxBitmap& bitmap);
virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmapOfHDC(*subrect, GetHDC() );}
protected:
// create DC compatible with the given one or screen if dc == NULL
bool CreateCompatible(wxDC *dc);
// initialize the newly created DC
void Init();
DECLARE_CLASS(wxMemoryDCImpl)
wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl);
};
#endif
// _WX_DCMEMORY_H_

View File

@ -0,0 +1,83 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dcprint.h
// Purpose: wxPrinterDC class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dcprint.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_DCPRINT_H_
#define _WX_MSW_DCPRINT_H_
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/dcprint.h"
#include "wx/cmndata.h"
#include "wx/msw/dc.h"
// ------------------------------------------------------------------------
// wxPrinterDCImpl
//
class WXDLLIMPEXP_CORE wxPrinterDCImpl : public wxMSWDCImpl
{
public:
// Create from print data
wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
wxPrinterDCImpl( wxPrinterDC *owner, WXHDC theDC );
// override some base class virtuals
virtual bool StartDoc(const wxString& message);
virtual void EndDoc();
virtual void StartPage();
virtual void EndPage();
virtual wxRect GetPaperRect() const;
protected:
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
virtual void DoGetSize(int *w, int *h) const
{
GetDeviceSize(w, h);
}
// init the dc
void Init();
wxPrintData m_printData;
private:
DECLARE_CLASS(wxPrinterDCImpl)
wxDECLARE_NO_COPY_CLASS(wxPrinterDCImpl);
};
// Gets an HDC for the specified printer configuration
WXHDC WXDLLIMPEXP_CORE wxGetPrinterDC(const wxPrintData& data);
// ------------------------------------------------------------------------
// wxPrinterDCromHDC
//
class WXDLLIMPEXP_CORE wxPrinterDCFromHDC: public wxPrinterDC
{
public:
wxPrinterDCFromHDC( WXHDC theDC )
: wxPrinterDC(new wxPrinterDCImpl(this, theDC))
{
}
};
#endif // wxUSE_PRINTING_ARCHITECTURE
#endif // _WX_MSW_DCPRINT_H_

View File

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dcscreen.h
// Purpose: wxScreenDC class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dcscreen.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_DCSCREEN_H_
#define _WX_MSW_DCSCREEN_H_
#include "wx/dcscreen.h"
#include "wx/msw/dc.h"
class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxMSWDCImpl
{
public:
// Create a DC representing the whole screen
wxScreenDCImpl( wxScreenDC *owner );
virtual void DoGetSize(int *w, int *h) const
{
GetDeviceSize(w, h);
}
DECLARE_CLASS(wxScreenDCImpl)
wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl);
};
#endif // _WX_MSW_DCSCREEN_H_

View File

@ -0,0 +1,138 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dde.h
// Purpose: DDE class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dde.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DDE_H_
#define _WX_DDE_H_
#include "wx/ipcbase.h"
/*
* Mini-DDE implementation
Most transactions involve a topic name and an item name (choose these
as befits your application).
A client can:
- ask the server to execute commands (data) associated with a topic
- request data from server by topic and item
- poke data into the server
- ask the server to start an advice loop on topic/item
- ask the server to stop an advice loop
A server can:
- respond to execute, request, poke and advice start/stop
- send advise data to client
Note that this limits the server in the ways it can send data to the
client, i.e. it can't send unsolicited information.
*
*/
class WXDLLIMPEXP_FWD_BASE wxDDEServer;
class WXDLLIMPEXP_FWD_BASE wxDDEClient;
class WXDLLIMPEXP_BASE wxDDEConnection : public wxConnectionBase
{
public:
wxDDEConnection(void *buffer, size_t size); // use external buffer
wxDDEConnection(); // use internal buffer
virtual ~wxDDEConnection();
// implement base class pure virtual methods
virtual const void *Request(const wxString& item,
size_t *size = NULL,
wxIPCFormat format = wxIPC_TEXT);
virtual bool StartAdvise(const wxString& item);
virtual bool StopAdvise(const wxString& item);
virtual bool Disconnect();
protected:
virtual bool DoExecute(const void *data, size_t size, wxIPCFormat format);
virtual bool DoPoke(const wxString& item, const void *data, size_t size,
wxIPCFormat format);
virtual bool DoAdvise(const wxString& item, const void *data, size_t size,
wxIPCFormat format);
public:
wxString m_topicName;
wxDDEServer* m_server;
wxDDEClient* m_client;
WXHCONV m_hConv;
const void* m_sendingData;
int m_dataSize;
wxIPCFormat m_dataType;
wxDECLARE_NO_COPY_CLASS(wxDDEConnection);
DECLARE_DYNAMIC_CLASS(wxDDEConnection)
};
class WXDLLIMPEXP_BASE wxDDEServer : public wxServerBase
{
public:
wxDDEServer();
bool Create(const wxString& server_name);
virtual ~wxDDEServer();
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic);
// Find/delete wxDDEConnection corresponding to the HCONV
wxDDEConnection *FindConnection(WXHCONV conv);
bool DeleteConnection(WXHCONV conv);
wxString& GetServiceName() const { return (wxString&) m_serviceName; }
wxDDEConnectionList& GetConnections() const
{ return (wxDDEConnectionList&) m_connections; }
protected:
int m_lastError;
wxString m_serviceName;
wxDDEConnectionList m_connections;
DECLARE_DYNAMIC_CLASS(wxDDEServer)
};
class WXDLLIMPEXP_BASE wxDDEClient: public wxClientBase
{
public:
wxDDEClient();
virtual ~wxDDEClient();
bool ValidHost(const wxString& host);
// Call this to make a connection. Returns NULL if cannot.
virtual wxConnectionBase *MakeConnection(const wxString& host,
const wxString& server,
const wxString& topic);
// Tailor this to return own connection.
virtual wxConnectionBase *OnMakeConnection();
// Find/delete wxDDEConnection corresponding to the HCONV
wxDDEConnection *FindConnection(WXHCONV conv);
bool DeleteConnection(WXHCONV conv);
wxDDEConnectionList& GetConnections() const
{ return (wxDDEConnectionList&) m_connections; }
protected:
int m_lastError;
wxDDEConnectionList m_connections;
DECLARE_DYNAMIC_CLASS(wxDDEClient)
};
void WXDLLIMPEXP_BASE wxDDEInitialize();
void WXDLLIMPEXP_BASE wxDDECleanUp();
#endif // _WX_DDE_H_

View File

@ -0,0 +1,228 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/debughlp.h
// Purpose: wraps dbghelp.h standard file
// Author: Vadim Zeitlin
// Modified by:
// Created: 2005-01-08 (extracted from msw/crashrpt.cpp)
// RCS-ID: $Id: debughlp.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 2003-2005 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_DEBUGHLPH_H_
#define _WX_MSW_DEBUGHLPH_H_
#include "wx/dynlib.h"
#include "wx/msw/wrapwin.h"
#ifndef __WXWINCE__
#include <imagehlp.h>
#endif // __WXWINCE__
#include "wx/msw/private.h"
// we need to determine whether we have the declarations for the function in
// debughlp.dll version 5.81 (at least) and we check for DBHLPAPI to test this
//
// reasons:
// - VC6 version of imagehlp.h doesn't define it
// - VC7 one does
// - testing for compiler version doesn't work as you can install and use
// the new SDK headers with VC6
//
// in any case, the user may override by defining wxUSE_DBGHELP himself
#ifndef wxUSE_DBGHELP
#ifdef DBHLPAPI
#define wxUSE_DBGHELP 1
#else
#define wxUSE_DBGHELP 0
#endif
#endif
#if wxUSE_DBGHELP
// ----------------------------------------------------------------------------
// wxDbgHelpDLL: dynamically load dbghelp.dll functions
// ----------------------------------------------------------------------------
// wrapper for some functions from dbghelp.dll
//
// MT note: this class is not MT safe and should be only used from a single
// thread at a time (this is so because dbghelp.dll is not MT-safe
// itself anyhow)
class wxDbgHelpDLL
{
public:
// some useful constants not present in debughlp.h (stolen from DIA SDK)
enum BasicType
{
BASICTYPE_NOTYPE = 0,
BASICTYPE_VOID = 1,
BASICTYPE_CHAR = 2,
BASICTYPE_WCHAR = 3,
BASICTYPE_INT = 6,
BASICTYPE_UINT = 7,
BASICTYPE_FLOAT = 8,
BASICTYPE_BCD = 9,
BASICTYPE_BOOL = 10,
BASICTYPE_LONG = 13,
BASICTYPE_ULONG = 14,
BASICTYPE_CURRENCY = 25,
BASICTYPE_DATE = 26,
BASICTYPE_VARIANT = 27,
BASICTYPE_COMPLEX = 28,
BASICTYPE_BIT = 29,
BASICTYPE_BSTR = 30,
BASICTYPE_HRESULT = 31,
BASICTYPE_MAX
};
enum SymbolTag
{
SYMBOL_TAG_NULL,
SYMBOL_TAG_EXE,
SYMBOL_TAG_COMPILAND,
SYMBOL_TAG_COMPILAND_DETAILS,
SYMBOL_TAG_COMPILAND_ENV,
SYMBOL_TAG_FUNCTION,
SYMBOL_TAG_BLOCK,
SYMBOL_TAG_DATA,
SYMBOL_TAG_ANNOTATION,
SYMBOL_TAG_LABEL,
SYMBOL_TAG_PUBLIC_SYMBOL,
SYMBOL_TAG_UDT,
SYMBOL_TAG_ENUM,
SYMBOL_TAG_FUNCTION_TYPE,
SYMBOL_TAG_POINTER_TYPE,
SYMBOL_TAG_ARRAY_TYPE,
SYMBOL_TAG_BASE_TYPE,
SYMBOL_TAG_TYPEDEF,
SYMBOL_TAG_BASE_CLASS,
SYMBOL_TAG_FRIEND,
SYMBOL_TAG_FUNCTION_ARG_TYPE,
SYMBOL_TAG_FUNC_DEBUG_START,
SYMBOL_TAG_FUNC_DEBUG_END,
SYMBOL_TAG_USING_NAMESPACE,
SYMBOL_TAG_VTABLE_SHAPE,
SYMBOL_TAG_VTABLE,
SYMBOL_TAG_CUSTOM,
SYMBOL_TAG_THUNK,
SYMBOL_TAG_CUSTOM_TYPE,
SYMBOL_TAG_MANAGED_TYPE,
SYMBOL_TAG_DIMENSION,
SYMBOL_TAG_MAX
};
enum DataKind
{
DATA_UNKNOWN,
DATA_LOCAL,
DATA_STATIC_LOCAL,
DATA_PARAM,
DATA_OBJECT_PTR, // "this" pointer
DATA_FILE_STATIC,
DATA_GLOBAL,
DATA_MEMBER,
DATA_STATIC_MEMBER,
DATA_CONSTANT,
DATA_MAX
};
enum UdtKind
{
UDT_STRUCT,
UDT_CLASS,
UDT_UNION,
UDT_MAX
};
// function types
typedef DWORD (WINAPI *SymGetOptions_t)();
typedef DWORD (WINAPI *SymSetOptions_t)(DWORD);
typedef BOOL (WINAPI *SymInitialize_t)(HANDLE, LPSTR, BOOL);
typedef BOOL (WINAPI *StackWalk_t)(DWORD, HANDLE, HANDLE, LPSTACKFRAME,
LPVOID, PREAD_PROCESS_MEMORY_ROUTINE,
PFUNCTION_TABLE_ACCESS_ROUTINE,
PGET_MODULE_BASE_ROUTINE,
PTRANSLATE_ADDRESS_ROUTINE);
typedef BOOL (WINAPI *SymFromAddr_t)(HANDLE, DWORD64, PDWORD64, PSYMBOL_INFO);
typedef LPVOID (WINAPI *SymFunctionTableAccess_t)(HANDLE, DWORD);
typedef DWORD (WINAPI *SymGetModuleBase_t)(HANDLE, DWORD);
typedef BOOL (WINAPI *SymGetLineFromAddr_t)(HANDLE, DWORD,
PDWORD, PIMAGEHLP_LINE);
typedef BOOL (WINAPI *SymSetContext_t)(HANDLE, PIMAGEHLP_STACK_FRAME,
PIMAGEHLP_CONTEXT);
typedef BOOL (WINAPI *SymEnumSymbols_t)(HANDLE, ULONG64, PCSTR,
PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
typedef BOOL (WINAPI *SymGetTypeInfo_t)(HANDLE, DWORD64, ULONG,
IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
typedef BOOL (WINAPI *SymCleanup_t)(HANDLE);
typedef BOOL (WINAPI *EnumerateLoadedModules_t)(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
typedef BOOL (WINAPI *MiniDumpWriteDump_t)(HANDLE, DWORD, HANDLE,
MINIDUMP_TYPE,
CONST PMINIDUMP_EXCEPTION_INFORMATION,
CONST PMINIDUMP_USER_STREAM_INFORMATION,
CONST PMINIDUMP_CALLBACK_INFORMATION);
#define wxDO_FOR_ALL_SYM_FUNCS(what) \
what(SymGetOptions); \
what(SymSetOptions); \
what(SymInitialize); \
what(StackWalk); \
what(SymFromAddr); \
what(SymFunctionTableAccess); \
what(SymGetModuleBase); \
what(SymGetLineFromAddr); \
what(SymSetContext); \
what(SymEnumSymbols); \
what(SymGetTypeInfo); \
what(SymCleanup); \
what(EnumerateLoadedModules); \
what(MiniDumpWriteDump)
#define wxDECLARE_SYM_FUNCTION(func) static func ## _t func
wxDO_FOR_ALL_SYM_FUNCS(wxDECLARE_SYM_FUNCTION);
#undef wxDECLARE_SYM_FUNCTION
// load all functions from DLL, return true if ok
static bool Init();
// return the string with the error message explaining why Init() failed
static const wxString& GetErrorMessage();
// log error returned by the given function to debug output
static void LogError(const wxChar *func);
// return textual representation of the value of given symbol
static wxString DumpSymbol(PSYMBOL_INFO pSymInfo, void *pVariable);
// return the name of the symbol with given type index
static wxString GetSymbolName(PSYMBOL_INFO pSymInfo);
private:
// dereference the given symbol, i.e. return symbol which is not a
// pointer/reference any more
//
// if ppData != NULL, dereference the pointer as many times as we
// dereferenced the symbol
//
// return the tag of the dereferenced symbol
static SymbolTag DereferenceSymbol(PSYMBOL_INFO pSymInfo, void **ppData);
static wxString DumpField(PSYMBOL_INFO pSymInfo,
void *pVariable,
unsigned level);
static wxString DumpBaseType(BasicType bt, DWORD64 length, void *pVariable);
static wxString DumpUDT(PSYMBOL_INFO pSymInfo,
void *pVariable,
unsigned level = 0);
};
#endif // wxUSE_DBGHELP
#endif // _WX_MSW_DEBUGHLPH_H_

View File

@ -0,0 +1,143 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dialog.h
// Purpose: wxDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dialog.h 60559 2009-05-09 12:26:15Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIALOG_H_
#define _WX_DIALOG_H_
#include "wx/panel.h"
// this option is always enabled (there doesn't seem to be any good reason to
// disable it) for desktop Windows versions but Windows CE dialogs are usually
// not resizeable and never show resize gripper anyhow so don't use it there
#ifdef __WXWINCE__
#define wxUSE_DIALOG_SIZEGRIP 0
#else
#define wxUSE_DIALOG_SIZEGRIP 1
#endif
extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr[];
class WXDLLIMPEXP_FWD_CORE wxDialogModalData;
#if wxUSE_TOOLBAR && (defined(__SMARTPHONE__) || defined(__POCKETPC__))
class WXDLLIMPEXP_FWD_CORE wxToolBar;
extern WXDLLIMPEXP_DATA_CORE(const char) wxToolBarNameStr[];
#endif
// Dialog boxes
class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
{
public:
wxDialog() { Init(); }
// full ctor
wxDialog(wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
{
Init();
(void)Create(parent, id, title, pos, size, style, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr);
virtual ~wxDialog();
// return true if we're showing the dialog modally
virtual bool IsModal() const { return m_modalData != NULL; }
// show the dialog modally and return the value passed to EndModal()
virtual int ShowModal();
// may be called to terminate the dialog with the given return code
virtual void EndModal(int retCode);
// we treat dialog toolbars specially under Windows CE
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
// create main toolbar by calling OnCreateToolBar()
virtual wxToolBar* CreateToolBar(long style = -1,
wxWindowID winid = wxID_ANY,
const wxString& name = wxToolBarNameStr);
// return a new toolbar
virtual wxToolBar *OnCreateToolBar(long style,
wxWindowID winid,
const wxString& name );
// get the main toolbar
wxToolBar *GetToolBar() const { return m_dialogToolBar; }
#endif // wxUSE_TOOLBAR && __POCKETPC__
// implementation only from now on
// -------------------------------
// override some base class virtuals
virtual bool Show(bool show = true);
virtual void Raise();
virtual void SetWindowStyleFlag(long style);
#ifdef __POCKETPC__
// Responds to the OK button in a PocketPC titlebar. This
// can be overridden, or you can change the id used for
// sending the event with SetAffirmativeId. Returns false
// if the event was not processed.
virtual bool DoOK();
#endif
// Windows callbacks
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
protected:
// common part of all ctors
void Init();
private:
#if wxUSE_DIALOG_SIZEGRIP
// these functions deal with the gripper window shown in the corner of
// resizeable dialogs
void CreateGripper();
void DestroyGripper();
void ShowGripper(bool show);
void ResizeGripper();
// this function is used to adjust Z-order of new children relative to the
// gripper if we have one
void OnWindowCreate(wxWindowCreateEvent& event);
// gripper window for a resizable dialog, NULL if we're not resizable
WXHWND m_hGripper;
#endif // wxUSE_DIALOG_SIZEGRIP
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
wxToolBar* m_dialogToolBar;
#endif
// this pointer is non-NULL only while the modal event loop is running
wxDialogModalData *m_modalData;
DECLARE_DYNAMIC_CLASS(wxDialog)
wxDECLARE_NO_COPY_CLASS(wxDialog);
};
#endif
// _WX_DIALOG_H_

View File

@ -0,0 +1,265 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dib.h
// Purpose: wxDIB class representing Win32 device independent bitmaps
// Author: Vadim Zeitlin
// Modified by:
// Created: 03.03.03 (replaces the old file with the same name)
// RCS-ID: $Id: dib.h 65959 2010-10-30 23:50:50Z VZ $
// Copyright: (c) 1997-2003 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_DIB_H_
#define _WX_MSW_DIB_H_
class WXDLLIMPEXP_FWD_CORE wxBitmap;
class WXDLLIMPEXP_FWD_CORE wxPalette;
#include "wx/msw/private.h"
#if wxUSE_WXDIB
// ----------------------------------------------------------------------------
// wxDIB: represents a DIB section
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDIB
{
public:
// ctors and such
// --------------
// create an uninitialized DIB with the given width, height and depth (only
// 24 and 32 bpp DIBs are currently supported)
//
// after using this ctor, GetData() and GetHandle() may be used if IsOk()
// returns true
wxDIB(int width, int height, int depth)
{ Init(); (void)Create(width, height, depth); }
// create a DIB from the DDB
wxDIB(const wxBitmap& bmp)
{ Init(); (void)Create(bmp); }
// create a DIB from the Windows DDB
wxDIB(HBITMAP hbmp)
{ Init(); (void)Create(hbmp); }
// load a DIB from file (any depth is supoprted here unlike above)
//
// as above, use IsOk() to see if the bitmap was loaded successfully
wxDIB(const wxString& filename)
{ Init(); (void)Load(filename); }
// same as the corresponding ctors but with return value
bool Create(int width, int height, int depth);
bool Create(const wxBitmap& bmp) { return Create(GetHbitmapOf(bmp)); }
bool Create(HBITMAP hbmp);
bool Load(const wxString& filename);
// dtor is not virtual, this class is not meant to be used polymorphically
~wxDIB();
// operations
// ----------
#ifndef __WXWINCE__
// create a bitmap compatible with the given HDC (or screen by default) and
// return its handle, the caller is responsible for freeing it (using
// DeleteObject())
HBITMAP CreateDDB(HDC hdc = 0) const;
#endif // !__WXWINCE__
// get the handle from the DIB and reset it, i.e. this object won't destroy
// the DIB after this (but the caller should do it)
HBITMAP Detach() { HBITMAP hbmp = m_handle; m_handle = 0; return hbmp; }
#if wxUSE_PALETTE
// create a palette for this DIB (always a trivial/default one for 24bpp)
wxPalette *CreatePalette() const;
#endif // wxUSE_PALETTE
// save the DIB as a .BMP file to the file with the given name
bool Save(const wxString& filename);
// accessors
// ---------
// return true if DIB was successfully created, false otherwise
bool IsOk() const { return m_handle != 0; }
// get the bitmap size
wxSize GetSize() const { DoGetObject(); return wxSize(m_width, m_height); }
int GetWidth() const { DoGetObject(); return m_width; }
int GetHeight() const { DoGetObject(); return m_height; }
// get the number of bits per pixel, or depth
int GetDepth() const { DoGetObject(); return m_depth; }
// get the DIB handle
HBITMAP GetHandle() const { return m_handle; }
// get raw pointer to bitmap bits, you should know what you do if you
// decide to use it
unsigned char *GetData() const
{ DoGetObject(); return (unsigned char *)m_data; }
// HBITMAP conversion
// ------------------
// these functions are only used by wxWidgets internally right now, please
// don't use them directly if possible as they're subject to change
#ifndef __WXWINCE__
// creates a DDB compatible with the given (or screen) DC from either
// a plain DIB or a DIB section (in which case the last parameter must be
// non NULL)
static HBITMAP ConvertToBitmap(const BITMAPINFO *pbi,
HDC hdc = 0,
void *bits = NULL);
// create a plain DIB (not a DIB section) from a DDB, the caller is
// responsable for freeing it using ::GlobalFree()
static HGLOBAL ConvertFromBitmap(HBITMAP hbmp);
// creates a DIB from the given DDB or calculates the space needed by it:
// if pbi is NULL, only the space is calculated, otherwise pbi is supposed
// to point at BITMAPINFO of the correct size which is filled by this
// function (this overload is needed for wxBitmapDataObject code in
// src/msw/ole/dataobj.cpp)
static size_t ConvertFromBitmap(BITMAPINFO *pbi, HBITMAP hbmp);
#endif // __WXWINCE__
// wxImage conversion
// ------------------
#if wxUSE_IMAGE
// Possible formats for DIBs created by the functions below.
enum PixelFormat
{
PixelFormat_PreMultiplied = 0,
PixelFormat_NotPreMultiplied = 1
};
// Create a DIB from the given image, the DIB will be either 24 or 32 (if
// the image has alpha channel) bpp.
//
// By default the DIB stores pixel data in pre-multiplied format so that it
// can be used with ::AlphaBlend() but it is also possible to disable
// pre-multiplication for the DIB to be usable with ImageList_Draw() which
// does pre-multiplication internally.
wxDIB(const wxImage& image, PixelFormat pf = PixelFormat_PreMultiplied)
{
Init();
(void)Create(image, pf);
}
// same as the above ctor but with the return code
bool Create(const wxImage& image, PixelFormat pf = PixelFormat_PreMultiplied);
// create wxImage having the same data as this DIB
wxImage ConvertToImage() const;
#endif // wxUSE_IMAGE
// helper functions
// ----------------
// return the size of one line in a DIB with given width and depth: the
// point here is that as the scan lines need to be DWORD aligned so we may
// need to add some padding
static unsigned long GetLineSize(int width, int depth)
{
return ((width*depth + 31) & ~31) >> 3;
}
private:
// common part of all ctors
void Init();
// free resources
void Free();
// initialize the contents from the provided DDB (Create() must have been
// already called)
bool CopyFromDDB(HBITMAP hbmp);
// the DIB section handle, 0 if invalid
HBITMAP m_handle;
// NB: we could store only m_handle and not any of the other fields as
// we may always retrieve them from it using ::GetObject(), but we
// decide to still store them for efficiency concerns -- however if we
// don't have them from the very beginning (e.g. DIB constructed from a
// bitmap), we only retrieve them when necessary and so these fields
// should *never* be accessed directly, even from inside wxDIB code
// function which must be called before accessing any members and which
// gets their values from m_handle, if not done yet
void DoGetObject() const;
// pointer to DIB bits, may be NULL
void *m_data;
// size and depth of the image
int m_width,
m_height,
m_depth;
// in some cases we could be using a handle which we didn't create and in
// this case we shouldn't free it neither -- this flag tell us if this is
// the case
bool m_ownsHandle;
// DIBs can't be copied
wxDIB(const wxDIB&);
wxDIB& operator=(const wxDIB&);
};
// ----------------------------------------------------------------------------
// inline functions implementation
// ----------------------------------------------------------------------------
inline
void wxDIB::Init()
{
m_handle = 0;
m_ownsHandle = true;
m_data = NULL;
m_width =
m_height =
m_depth = 0;
}
inline
void wxDIB::Free()
{
if ( m_handle && m_ownsHandle )
{
if ( !::DeleteObject(m_handle) )
{
wxLogLastError(wxT("DeleteObject(hDIB)"));
}
Init();
}
}
inline wxDIB::~wxDIB()
{
Free();
}
#endif
// wxUSE_WXDIB
#endif // _WX_MSW_DIB_H_

View File

@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dirdlg.h
// Purpose: wxDirDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dirdlg.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIRDLG_H_
#define _WX_DIRDLG_H_
class WXDLLIMPEXP_CORE wxDirDialog : public wxDirDialogBase
{
public:
wxDirDialog(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr);
void SetPath(const wxString& path);
virtual int ShowModal();
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDirDialog)
};
#endif
// _WX_DIRDLG_H_

View File

@ -0,0 +1,274 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/dragimag.h
// Purpose: wxDragImage class: a kind of a cursor, that can cope
// with more sophisticated images
// Author: Julian Smart
// Modified by:
// Created: 08/04/99
// RCS-ID: $Id: dragimag.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DRAGIMAG_H_
#define _WX_DRAGIMAG_H_
#if wxUSE_DRAGIMAGE
#include "wx/bitmap.h"
#include "wx/icon.h"
#include "wx/cursor.h"
#include "wx/treectrl.h"
#include "wx/listctrl.h"
// If 1, use a simple wxCursor instead of ImageList_SetDragCursorImage
#define wxUSE_SIMPLER_DRAGIMAGE 0
/*
To use this class, create a wxDragImage when you start dragging, for example:
void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event)
{
#ifdef __WXMSW__
::UpdateWindow((HWND) GetHWND()); // We need to implement this in wxWidgets
#endif
CaptureMouse();
m_dragImage = new wxDragImage(* this, itemId);
m_dragImage->BeginDrag(wxPoint(0, 0), this);
m_dragImage->Move(pt, this);
m_dragImage->Show(this);
...
}
In your OnMouseMove function, hide the image, do any display updating required,
then move and show the image again:
void MyTreeCtrl::OnMouseMove(wxMouseEvent& event)
{
if (m_dragMode == MY_TREE_DRAG_NONE)
{
event.Skip();
return;
}
// Prevent screen corruption by hiding the image
if (m_dragImage)
m_dragImage->Hide(this);
// Do some updating of the window, such as highlighting the drop target
...
#ifdef __WXMSW__
if (updateWindow)
::UpdateWindow((HWND) GetHWND());
#endif
// Move and show the image again
m_dragImage->Move(event.GetPosition(), this);
m_dragImage->Show(this);
}
Eventually we end the drag and delete the drag image.
void MyTreeCtrl::OnLeftUp(wxMouseEvent& event)
{
...
// End the drag and delete the drag image
if (m_dragImage)
{
m_dragImage->EndDrag(this);
delete m_dragImage;
m_dragImage = NULL;
}
ReleaseMouse();
}
*/
/*
Notes for Unix version:
Can we simply use cursors instead, creating a cursor dynamically, setting it into the window
in BeginDrag, and restoring the old cursor in EndDrag?
For a really bog-standard implementation, we could simply use a normal dragging cursor
and ignore the image.
*/
/*
* wxDragImage
*/
class WXDLLIMPEXP_CORE wxDragImage: public wxObject
{
public:
// Ctors & dtor
////////////////////////////////////////////////////////////////////////////
wxDragImage();
wxDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor)
{
Init();
Create(image, cursor);
}
// Deprecated form of the above
wxDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot)
{
Init();
Create(image, cursor, cursorHotspot);
}
wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor)
{
Init();
Create(image, cursor);
}
// Deprecated form of the above
wxDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot)
{
Init();
Create(image, cursor, cursorHotspot);
}
wxDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor)
{
Init();
Create(str, cursor);
}
// Deprecated form of the above
wxDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot)
{
Init();
Create(str, cursor, cursorHotspot);
}
#if wxUSE_TREECTRL
wxDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
{
Init();
Create(treeCtrl, id);
}
#endif
#if wxUSE_LISTCTRL
wxDragImage(const wxListCtrl& listCtrl, long id)
{
Init();
Create(listCtrl, id);
}
#endif
virtual ~wxDragImage();
// Attributes
////////////////////////////////////////////////////////////////////////////
// Operations
////////////////////////////////////////////////////////////////////////////
// Create a drag image from a bitmap and optional cursor
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor);
bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(image, cursor);
}
// Create a drag image from an icon and optional cursor
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor);
bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(image, cursor);
}
// Create a drag image from a string and optional cursor
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor);
bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(str, cursor);
}
#if wxUSE_TREECTRL
// Create a drag image for the given tree control item
bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id);
#endif
#if wxUSE_LISTCTRL
// Create a drag image for the given list control item
bool Create(const wxListCtrl& listCtrl, long id);
#endif
// 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.
bool BeginDrag(const wxPoint& hotspot, wxWindow* window, wxWindow* fullScreenRect);
// 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();
// Implementation
////////////////////////////////////////////////////////////////////////////
// Initialize variables
void Init();
// Returns the native image list handle
WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
#if !wxUSE_SIMPLER_DRAGIMAGE
// Returns the native image list handle for the cursor
WXHIMAGELIST GetCursorHIMAGELIST() const { return m_hCursorImageList; }
#endif
protected:
WXHIMAGELIST m_hImageList;
#if wxUSE_SIMPLER_DRAGIMAGE
wxCursor m_oldCursor;
#else
WXHIMAGELIST m_hCursorImageList;
#endif
wxCursor m_cursor;
// wxPoint m_cursorHotspot; // Obsolete
wxPoint m_position;
wxWindow* m_window;
wxRect m_boundingRect;
bool m_fullScreen;
private:
DECLARE_DYNAMIC_CLASS(wxDragImage)
wxDECLARE_NO_COPY_CLASS(wxDragImage);
};
#endif // wxUSE_DRAGIMAGE
#endif
// _WX_DRAGIMAG_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,187 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/enhmeta.h
// Purpose: wxEnhMetaFile class for Win32
// Author: Vadim Zeitlin
// Modified by:
// Created: 13.01.00
// RCS-ID: $Id: enhmeta.h 60843 2009-05-31 19:11:15Z VS $
// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_ENHMETA_H_
#define _WX_MSW_ENHMETA_H_
#include "wx/dc.h"
#include "wx/gdiobj.h"
#if wxUSE_DRAG_AND_DROP
#include "wx/dataobj.h"
#endif
// ----------------------------------------------------------------------------
// wxEnhMetaFile: encapsulation of Win32 HENHMETAFILE
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxEnhMetaFile : public wxGDIObject
{
public:
wxEnhMetaFile(const wxString& file = wxEmptyString) : m_filename(file)
{ Init(); }
wxEnhMetaFile(const wxEnhMetaFile& metafile) : wxGDIObject()
{ Init(); Assign(metafile); }
wxEnhMetaFile& operator=(const wxEnhMetaFile& metafile)
{ Free(); Assign(metafile); return *this; }
virtual ~wxEnhMetaFile()
{ Free(); }
// display the picture stored in the metafile on the given DC
bool Play(wxDC *dc, wxRect *rectBound = NULL);
// accessors
virtual bool IsOk() const { return m_hMF != 0; }
wxSize GetSize() const;
int GetWidth() const { return GetSize().x; }
int GetHeight() const { return GetSize().y; }
const wxString& GetFileName() const { return m_filename; }
// copy the metafile to the clipboard: the width and height parameters are
// for backwards compatibility (with wxMetaFile) only, they are ignored by
// this method
bool SetClipboard(int width = 0, int height = 0);
// implementation
WXHANDLE GetHENHMETAFILE() const { return m_hMF; }
void SetHENHMETAFILE(WXHANDLE hMF) { Free(); m_hMF = hMF; }
protected:
void Init();
void Free();
void Assign(const wxEnhMetaFile& mf);
// we don't use these functions (but probably should) but have to implement
// them as they're pure virtual in the base class
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
private:
wxString m_filename;
WXHANDLE m_hMF;
DECLARE_DYNAMIC_CLASS(wxEnhMetaFile)
};
// ----------------------------------------------------------------------------
// wxEnhMetaFileDC: allows to create a wxEnhMetaFile
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxEnhMetaFileDC : public wxDC
{
public:
// the ctor parameters specify the filename (empty for memory metafiles),
// the metafile picture size and the optional description/comment
wxEnhMetaFileDC(const wxString& filename = wxEmptyString,
int width = 0, int height = 0,
const wxString& description = wxEmptyString);
// as above, but takes reference DC as first argument to take resolution,
// size, font metrics etc. from
wxEnhMetaFileDC(const wxDC& referenceDC,
const wxString& filename = wxEmptyString,
int width = 0, int height = 0,
const wxString& description = wxEmptyString);
// obtain a pointer to the new metafile (caller should delete it)
wxEnhMetaFile *Close();
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxEnhMetaFileDC)
};
#if wxUSE_DRAG_AND_DROP
// ----------------------------------------------------------------------------
// wxEnhMetaFileDataObject is a specialization of wxDataObject for enh metafile
// ----------------------------------------------------------------------------
// notice that we want to support both CF_METAFILEPICT and CF_ENHMETAFILE and
// so we derive from wxDataObject and not from wxDataObjectSimple
class WXDLLIMPEXP_CORE wxEnhMetaFileDataObject : public wxDataObject
{
public:
// ctors
wxEnhMetaFileDataObject() { }
wxEnhMetaFileDataObject(const wxEnhMetaFile& metafile)
: m_metafile(metafile) { }
// virtual functions which you may override if you want to provide data on
// demand only - otherwise, the trivial default versions will be used
virtual void SetMetafile(const wxEnhMetaFile& metafile)
{ m_metafile = metafile; }
virtual wxEnhMetaFile GetMetafile() const
{ return m_metafile; }
// implement base class pure virtuals
virtual wxDataFormat GetPreferredFormat(Direction dir) const;
virtual size_t GetFormatCount(Direction dir) const;
virtual void GetAllFormats(wxDataFormat *formats, Direction dir) const;
virtual size_t GetDataSize(const wxDataFormat& format) const;
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
virtual bool SetData(const wxDataFormat& format, size_t len,
const void *buf);
protected:
wxEnhMetaFile m_metafile;
wxDECLARE_NO_COPY_CLASS(wxEnhMetaFileDataObject);
};
// ----------------------------------------------------------------------------
// wxEnhMetaFileSimpleDataObject does derive from wxDataObjectSimple which
// makes it more convenient to use (it can be used with wxDataObjectComposite)
// at the price of not supoprting any more CF_METAFILEPICT but only
// CF_ENHMETAFILE
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxEnhMetaFileSimpleDataObject : public wxDataObjectSimple
{
public:
// ctors
wxEnhMetaFileSimpleDataObject() : wxDataObjectSimple(wxDF_ENHMETAFILE) { }
wxEnhMetaFileSimpleDataObject(const wxEnhMetaFile& metafile)
: wxDataObjectSimple(wxDF_ENHMETAFILE), m_metafile(metafile) { }
// virtual functions which you may override if you want to provide data on
// demand only - otherwise, the trivial default versions will be used
virtual void SetEnhMetafile(const wxEnhMetaFile& metafile)
{ m_metafile = metafile; }
virtual wxEnhMetaFile GetEnhMetafile() const
{ return m_metafile; }
// implement base class pure virtuals
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
{ return GetDataSize(); }
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
void *buf) const
{ return GetDataHere(buf); }
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
size_t len, const void *buf)
{ return SetData(len, buf); }
protected:
wxEnhMetaFile m_metafile;
wxDECLARE_NO_COPY_CLASS(wxEnhMetaFileSimpleDataObject);
};
#endif // wxUSE_DRAG_AND_DROP
#endif // _WX_MSW_ENHMETA_H_

View File

@ -0,0 +1,119 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/evtloop.h
// Purpose: wxEventLoop class for MSW
// Author: Vadim Zeitlin
// Modified by:
// Created: 2004-07-31
// RCS-ID: $Id: evtloop.h 59161 2009-02-26 14:15:20Z VZ $
// Copyright: (c) 2003-2004 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_EVTLOOP_H_
#define _WX_MSW_EVTLOOP_H_
#if wxUSE_GUI
#include "wx/dynarray.h"
#include "wx/msw/wrapwin.h"
#include "wx/window.h"
#endif
// ----------------------------------------------------------------------------
// wxEventLoop
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMSWEventLoopBase : public wxEventLoopManual
{
public:
wxMSWEventLoopBase();
// implement base class pure virtuals
virtual bool Pending() const;
protected:
// get the next message from queue and return true or return false if we
// got WM_QUIT or an error occurred
bool GetNextMessage(WXMSG *msg);
// same as above but with a timeout and return value can be -1 meaning that
// time out expired in addition to
int GetNextMessageTimeout(WXMSG *msg, unsigned long timeout);
};
#if wxUSE_GUI
WX_DECLARE_EXPORTED_OBJARRAY(MSG, wxMSGArray);
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxMSWEventLoopBase
{
public:
wxGUIEventLoop() { }
// process a single message: calls PreProcessMessage() before dispatching
// it
virtual void ProcessMessage(WXMSG *msg);
// preprocess a message, return true if processed (i.e. no further
// dispatching required)
virtual bool PreProcessMessage(WXMSG *msg);
// set the critical window: this is the window such that all the events
// except those to this window (and its children) stop to be processed
// (typical examples: assert or crash report dialog)
//
// calling this function with NULL argument restores the normal event
// handling
static void SetCriticalWindow(wxWindowMSW *win) { ms_winCritical = win; }
// return true if there is no critical window or if this window is [a child
// of] the critical one
static bool AllowProcessing(wxWindowMSW *win)
{
return !ms_winCritical || IsChildOfCriticalWindow(win);
}
// override/implement base class virtuals
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout);
virtual void WakeUp();
virtual bool YieldFor(long eventsToProcess);
protected:
virtual void OnNextIteration();
private:
// check if the given window is a child of ms_winCritical (which must be
// non NULL)
static bool IsChildOfCriticalWindow(wxWindowMSW *win);
// array of messages used for temporary storage by YieldFor()
wxMSGArray m_arrMSG;
// critical window or NULL
static wxWindowMSW *ms_winCritical;
};
#else // !wxUSE_GUI
#if wxUSE_CONSOLE_EVENTLOOP
class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxMSWEventLoopBase
{
public:
wxConsoleEventLoop() { }
// override/implement base class virtuals
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout);
virtual void WakeUp();
virtual bool YieldFor(long WXUNUSED(eventsToProcess)) { return true; }
// MSW-specific function to process a single message
virtual void ProcessMessage(WXMSG *msg);
};
#endif // wxUSE_CONSOLE_EVENTLOOP
#endif // wxUSE_GUI/!wxUSE_GUI
#endif // _WX_MSW_EVTLOOP_H_

View File

@ -0,0 +1,62 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/fdrepdlg.h
// Purpose: wxFindReplaceDialog class
// Author: Markus Greither
// Modified by: 31.07.01: VZ: integrated into wxWidgets
// Created: 23/03/2001
// RCS-ID: $Id: fdrepdlg.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Markus Greither
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_FDREPDLG_H_
#define _WX_MSW_FDREPDLG_H_
// ----------------------------------------------------------------------------
// wxFindReplaceDialog: dialog for searching / replacing text
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFindReplaceDialog : public wxFindReplaceDialogBase
{
public:
// ctors and such
wxFindReplaceDialog() { Init(); }
wxFindReplaceDialog(wxWindow *parent,
wxFindReplaceData *data,
const wxString &title,
int style = 0);
bool Create(wxWindow *parent,
wxFindReplaceData *data,
const wxString &title,
int style = 0);
virtual ~wxFindReplaceDialog();
// implementation only from now on
wxFindReplaceDialogImpl *GetImpl() const { return m_impl; }
// override some base class virtuals
virtual bool Show(bool show = true);
virtual void SetTitle( const wxString& title);
virtual wxString GetTitle() const;
protected:
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
void Init();
wxString m_title;
wxFindReplaceDialogImpl *m_impl;
DECLARE_DYNAMIC_CLASS(wxFindReplaceDialog)
wxDECLARE_NO_COPY_CLASS(wxFindReplaceDialog);
};
#endif // _WX_MSW_FDREPDLG_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,69 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/filedlg.h
// Purpose: wxFileDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: filedlg.h 62722 2009-11-26 16:17:00Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEDLG_H_
#define _WX_FILEDLG_H_
//-------------------------------------------------------------------------
// wxFileDialog
//-------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDialog: public wxFileDialogBase
{
public:
wxFileDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
virtual void GetPaths(wxArrayString& paths) const;
virtual void GetFilenames(wxArrayString& files) const;
#ifndef __WXWINCE__
virtual bool SupportsExtraControl() const { return true; }
void MSWOnInitDialogHook(WXHWND hwnd);
#endif // __WXWINCE__
virtual int ShowModal();
// wxMSW-specific implementation from now on
// -----------------------------------------
// called from the hook procedure on CDN_INITDONE reception
virtual void MSWOnInitDone(WXHWND hDlg);
protected:
#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCentre(int dir);
virtual void DoGetSize( int *width, int *height ) const;
virtual void DoGetPosition( int *x, int *y ) const;
#endif // !(__SMARTPHONE__ && __WXWINCE__)
private:
wxArrayString m_fileNames;
// remember if our SetPosition() or Centre() (which requires special
// treatment) was called
bool m_bMovedWindow;
int m_centreDir; // nothing to do if 0
DECLARE_DYNAMIC_CLASS(wxFileDialog)
wxDECLARE_NO_COPY_CLASS(wxFileDialog);
};
#endif // _WX_FILEDLG_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,171 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/font.h
// Purpose: wxFont class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: font.h 65670 2010-09-29 13:46:09Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FONT_H_
#define _WX_FONT_H_
#include "wx/gdicmn.h"
// ----------------------------------------------------------------------------
// wxFont
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { }
#if FUTURE_WXWIN_COMPATIBILITY_3_0
wxFont(int size,
int family,
int style,
int weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
(void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
}
#endif
wxFont(int size,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Create(size, family, style, weight, underlined, face, encoding);
}
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
return DoCreate(size, wxDefaultSize, false, family, style,
weight, underlined, face, encoding);
}
#if FUTURE_WXWIN_COMPATIBILITY_3_0
wxFont(const wxSize& pixelSize,
int family,
int style,
int weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
(void)Create(pixelSize, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight,
underlined, face, encoding);
}
#endif
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
(void)Create(pixelSize, family, style, weight,
underlined, face, encoding);
}
wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{
Create(info, hFont);
}
wxFont(const wxString& fontDesc);
bool Create(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
return DoCreate(-1, pixelSize, true, family, style,
weight, underlined, face, encoding);
}
bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0);
virtual ~wxFont();
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual wxSize GetPixelSize() const;
virtual bool IsUsingSizeInPixels() const;
virtual wxFontStyle GetStyle() const;
virtual wxFontWeight GetWeight() const;
virtual bool GetUnderlined() const;
virtual wxString GetFaceName() const;
virtual wxFontEncoding GetEncoding() const;
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
virtual void SetPointSize(int pointSize);
virtual void SetPixelSize(const wxSize& pixelSize);
virtual void SetFamily(wxFontFamily family);
virtual void SetStyle(wxFontStyle style);
virtual void SetWeight(wxFontWeight weight);
virtual bool SetFaceName(const wxString& faceName);
virtual void SetUnderlined(bool underlined);
virtual void SetEncoding(wxFontEncoding encoding);
wxDECLARE_COMMON_FONT_METHODS();
virtual bool IsFixedWidth() const;
// implementation only from now on
// -------------------------------
virtual bool IsFree() const;
virtual bool RealizeResource();
virtual WXHANDLE GetResourceHandle() const;
virtual bool FreeResource(bool force = false);
// for consistency with other wxMSW classes
WXHFONT GetHFONT() const;
protected:
// real font creation function, used in all cases
bool DoCreate(int size,
const wxSize& pixelSize,
bool sizeUsingPixels,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
virtual wxFontFamily DoGetFamily() const;
// implement wxObject virtuals which are used by AllocExclusive()
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
private:
DECLARE_DYNAMIC_CLASS(wxFont)
};
#endif // _WX_FONT_H_

View File

@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/fontdlg.h
// Purpose: wxFontDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: fontdlg.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_FONTDLG_H_
#define _WX_MSW_FONTDLG_H_
// ----------------------------------------------------------------------------
// wxFontDialog
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFontDialog : public wxFontDialogBase
{
public:
wxFontDialog() : wxFontDialogBase() { /* must be Create()d later */ }
wxFontDialog(wxWindow *parent)
: wxFontDialogBase(parent) { Create(parent); }
wxFontDialog(wxWindow *parent, const wxFontData& data)
: wxFontDialogBase(parent, data) { Create(parent, data); }
virtual int ShowModal();
#if WXWIN_COMPATIBILITY_2_6
// deprecated interface, don't use
wxDEPRECATED( wxFontDialog(wxWindow *parent, const wxFontData *data) );
#endif // WXWIN_COMPATIBILITY_2_6
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontDialog)
};
#if WXWIN_COMPATIBILITY_2_6
// deprecated interface, don't use
inline wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData *data)
: wxFontDialogBase(parent) { InitFontData(data); Create(parent); }
#endif // WXWIN_COMPATIBILITY_2_6
#endif
// _WX_MSW_FONTDLG_H_

View File

@ -0,0 +1,172 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/frame.h
// Purpose: wxFrame class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: frame.h 60337 2009-04-25 12:59:09Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FRAME_H_
#define _WX_FRAME_H_
class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
{
public:
// construction
wxFrame() { Init(); }
wxFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
{
Init();
Create(parent, id, title, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual ~wxFrame();
// implement base class pure virtuals
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
virtual void Raise();
// implementation only from now on
// -------------------------------
// event handlers
void OnSysColourChanged(wxSysColourChangedEvent& event);
// Toolbar
#if wxUSE_TOOLBAR
virtual wxToolBar* CreateToolBar(long style = -1,
wxWindowID id = wxID_ANY,
const wxString& name = wxToolBarNameStr);
#endif // wxUSE_TOOLBAR
// Status bar
#if wxUSE_STATUSBAR
virtual wxStatusBar* OnCreateStatusBar(int number = 1,
long style = wxSTB_DEFAULT_STYLE,
wxWindowID id = 0,
const wxString& name = wxStatusLineNameStr);
// Hint to tell framework which status bar to use: the default is to use
// native one for the platforms which support it (Win32), the generic one
// otherwise
// TODO: should this go into a wxFrameworkSettings class perhaps?
static void UseNativeStatusBar(bool useNative)
{ m_useNativeStatusBar = useNative; }
static bool UsesNativeStatusBar()
{ return m_useNativeStatusBar; }
#endif // wxUSE_STATUSBAR
// event handlers
bool HandleSize(int x, int y, WXUINT flag);
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup);
// tooltip management
#if wxUSE_TOOLTIPS
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
#endif // tooltips
// override the base class function to handle iconized/maximized frames
virtual void SendSizeEvent(int flags = 0);
virtual wxPoint GetClientAreaOrigin() const;
// override base class version to add menu bar accel processing
virtual bool MSWTranslateMessage(WXMSG *msg)
{
return MSWDoTranslateMessage(this, msg);
}
// window proc for the frames
virtual WXLRESULT MSWWindowProc(WXUINT message,
WXWPARAM wParam,
WXLPARAM lParam);
#if wxUSE_MENUS
// get the currently active menu: this is the same as the frame menu for
// normal frames but is overridden by wxMDIParentFrame
virtual WXHMENU MSWGetActiveMenu() const { return m_hMenu; }
#endif // wxUSE_MENUS
protected:
// common part of all ctors
void Init();
// override base class virtuals
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoSetClientSize(int width, int height);
#if wxUSE_MENUS_NATIVE
// perform MSW-specific action when menubar is changed
virtual void AttachMenuBar(wxMenuBar *menubar);
// a plug in for MDI frame classes which need to do something special when
// the menubar is set
virtual void InternalSetMenuBar();
#endif // wxUSE_MENUS_NATIVE
// propagate our state change to all child frames
void IconizeChildFrames(bool bIconize);
// the real implementation of MSWTranslateMessage(), also used by
// wxMDIChildFrame
bool MSWDoTranslateMessage(wxFrame *frame, WXMSG *msg);
// handle WM_INITMENUPOPUP message to generate wxEVT_MENU_OPEN
bool HandleInitMenuPopup(WXHMENU hMenu);
virtual bool IsMDIChild() const { return false; }
// get default (wxWidgets) icon for the frame
virtual WXHICON GetDefaultIcon() const;
#if wxUSE_TOOLBAR
virtual void PositionToolBar();
#endif // wxUSE_TOOLBAR
#if wxUSE_STATUSBAR
virtual void PositionStatusBar();
static bool m_useNativeStatusBar;
#endif // wxUSE_STATUSBAR
#if wxUSE_MENUS
// frame menu, NULL if none
WXHMENU m_hMenu;
#endif // wxUSE_MENUS
private:
#if wxUSE_TOOLTIPS
WXHWND m_hwndToolTip;
#endif // tooltips
// used by IconizeChildFrames(), see comments there
bool m_wasMinimized;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame)
};
#endif
// _WX_FRAME_H_

View File

@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/fswatcher.h
// Purpose: wxMSWFileSystemWatcher
// Author: Bartosz Bekier
// Created: 2009-05-26
// RCS-ID: $Id: fswatcher.h 62474 2009-10-22 11:35:43Z VZ $
// Copyright: (c) 2009 Bartosz Bekier <bartosz.bekier@gmail.com>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FSWATCHER_MSW_H_
#define _WX_FSWATCHER_MSW_H_
#include "wx/defs.h"
#if wxUSE_FSWATCHER
class WXDLLIMPEXP_BASE wxMSWFileSystemWatcher : public wxFileSystemWatcherBase
{
public:
wxMSWFileSystemWatcher();
wxMSWFileSystemWatcher(const wxFileName& path,
int events = wxFSW_EVENT_ALL);
protected:
bool Init();
};
#endif // wxUSE_FSWATCHER
#endif /* _WX_FSWATCHER_MSW_H_ */

View File

@ -0,0 +1,78 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/gauge.h
// Purpose: wxGauge implementation for MSW
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: gauge.h 64648 2010-06-20 17:43:02Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_GAUGE_H_
#define _WX_MSW_GAUGE_H_
#if wxUSE_GAUGE
extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr[];
// Group box
class WXDLLIMPEXP_CORE wxGauge : public wxGaugeBase
{
public:
wxGauge() { }
wxGauge(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr)
{
(void)Create(parent, id, range, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr);
// set gauge range/value
virtual void SetRange(int range);
virtual void SetValue(int pos);
// overriden base class virtuals
virtual bool SetForegroundColour(const wxColour& col);
virtual bool SetBackgroundColour(const wxColour& col);
virtual void Pulse();
WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;
private:
// returns true if the control is currently in indeterminate (a.k.a.
// "marquee") mode
bool IsInIndeterminateMode() const;
// switch to/from indeterminate mode
void SetIndeterminateMode();
void SetDeterminateMode();
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGauge)
};
#endif // wxUSE_GAUGE
#endif // _WX_MSW_GAUGE_H_

View File

@ -0,0 +1,127 @@
/*
Name: wx/msw/gccpriv.h
Purpose: MinGW/Cygwin definitions
Author: Vadim Zeitlin
Modified by:
Created:
RCS-ID: $Id: gccpriv.h 36155 2005-11-10 16:16:05Z ABX $
Copyright: (c) Vadim Zeitlin
Licence: wxWindows Licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#ifndef _WX_MSW_GCCPRIV_H_
#define _WX_MSW_GCCPRIV_H_
#if defined(__MINGW32__) && !defined(__GNUWIN32__)
#define __GNUWIN32__
#endif
#if defined(__MINGW32__) && ( ( __GNUC__ > 2 ) || ( ( __GNUC__ == 2 ) && ( __GNUC_MINOR__ >= 95 ) ) )
#include <_mingw.h>
#endif
#if defined( __MINGW32__ ) && !defined(__WINE__) && !defined( HAVE_W32API_H )
#if __MINGW32_MAJOR_VERSION >= 1
#define HAVE_W32API_H
#endif
#elif defined( __CYGWIN__ ) && !defined( HAVE_W32API_H )
#if ( __GNUC__ > 2 )
#define HAVE_W32API_H
#endif
#endif
#if wxCHECK_WATCOM_VERSION(1,0)
#define HAVE_W32API_H
#endif
/* check for MinGW/Cygwin w32api version ( releases >= 0.5, only ) */
#if defined( HAVE_W32API_H )
#include <w32api.h>
#endif
/* Watcom can't handle defined(xxx) here: */
#if defined(__W32API_MAJOR_VERSION) && defined(__W32API_MINOR_VERSION)
#define wxCHECK_W32API_VERSION( major, minor ) \
( ( ( __W32API_MAJOR_VERSION > (major) ) \
|| ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor) ) ) )
#else
#define wxCHECK_W32API_VERSION( major, minor ) (0)
#endif
/* Cygwin / Mingw32 with gcc >= 2.95 use new windows headers which
are more ms-like (header author is Anders Norlander, hence the name) */
#if (defined(__MINGW32__) || defined(__CYGWIN__) || defined(__WINE__)) && ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>=95)))
#ifndef wxUSE_NORLANDER_HEADERS
#define wxUSE_NORLANDER_HEADERS 1
#endif
#else
#ifndef wxUSE_NORLANDER_HEADERS
#define wxUSE_NORLANDER_HEADERS 0
#endif
#endif
/* "old" GNUWIN32 is the one without Norlander's headers: it lacks the
standard Win32 headers and we define the used stuff ourselves for it
in wx/msw/gnuwin32/extra.h */
#if defined(__GNUC__) && !wxUSE_NORLANDER_HEADERS
#define __GNUWIN32_OLD__
#endif
/* Cygwin 1.0 */
#if defined(__CYGWIN__) && ((__GNUC__==2) && (__GNUC_MINOR__==9))
#define __CYGWIN10__
#endif
/* Check for Mingw runtime version: */
#if defined(__MINGW32_MAJOR_VERSION) && defined(__MINGW32_MINOR_VERSION)
#define wxCHECK_MINGW32_VERSION( major, minor ) \
( ( ( __MINGW32_MAJOR_VERSION > (major) ) \
|| ( __MINGW32_MAJOR_VERSION == (major) && __MINGW32_MINOR_VERSION >= (minor) ) ) )
#else
#define wxCHECK_MINGW32_VERSION( major, minor ) (0)
#endif
/* Mingw runtime 1.0-20010604 has some missing _tXXXX functions,
so let's define them ourselves: */
#if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \
&& !wxCHECK_W32API_VERSION( 1, 1 )
#ifndef _tsetlocale
#if wxUSE_UNICODE
#define _tsetlocale _wsetlocale
#else
#define _tsetlocale setlocale
#endif
#endif
#ifndef _tgetenv
#if wxUSE_UNICODE
#define _tgetenv _wgetenv
#else
#define _tgetenv getenv
#endif
#endif
#ifndef _tfopen
#if wxUSE_UNICODE
#define _tfopen _wfopen
#else
#define _tfopen fopen
#endif
#endif
#endif
/* current (= before mingw-runtime 3.3) mingw32 headers forget to
define _puttchar, this will probably be fixed in the next versions but
for now do it ourselves
*/
#if defined( __MINGW32__ ) && \
!wxCHECK_MINGW32_VERSION(3,3) && !defined( _puttchar )
#ifdef wxUSE_UNICODE
#define _puttchar putwchar
#else
#define _puttchar puttchar
#endif
#endif
#endif
/* _WX_MSW_GCCPRIV_H_ */

View File

@ -0,0 +1,198 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/gdiimage.h
// Purpose: wxGDIImage class: base class for wxBitmap, wxIcon, wxCursor
// under MSW
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.11.99
// RCS-ID: $Id: gdiimage.h 66374 2010-12-14 18:43:49Z VZ $
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// NB: this is a private header, it is not intended to be directly included by
// user code (but may be included from other, public, wxWin headers
#ifndef _WX_MSW_GDIIMAGE_H_
#define _WX_MSW_GDIIMAGE_H_
#include "wx/gdiobj.h" // base class
#include "wx/gdicmn.h" // wxBITMAP_TYPE_INVALID
#include "wx/list.h"
class WXDLLIMPEXP_FWD_CORE wxGDIImageRefData;
class WXDLLIMPEXP_FWD_CORE wxGDIImageHandler;
class WXDLLIMPEXP_FWD_CORE wxGDIImage;
WX_DECLARE_EXPORTED_LIST(wxGDIImageHandler, wxGDIImageHandlerList);
// ----------------------------------------------------------------------------
// wxGDIImageRefData: common data fields for all derived classes
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGDIImageRefData : public wxGDIRefData
{
public:
wxGDIImageRefData()
{
m_width = m_height = m_depth = 0;
m_handle = 0;
}
wxGDIImageRefData(const wxGDIImageRefData& data) : wxGDIRefData()
{
m_width = data.m_width;
m_height = data.m_height;
m_depth = data.m_depth;
// can't copy handles like this, derived class copy ctor must do it!
m_handle = NULL;
}
// accessors
virtual bool IsOk() const { return m_handle != 0; }
void SetSize(int w, int h) { m_width = w; m_height = h; }
// free the ressources we allocated
virtual void Free() = 0;
// for compatibility, the member fields are public
// the size of the image
int m_width, m_height;
// the depth of the image
int m_depth;
// the handle to it
union
{
WXHANDLE m_handle; // for untyped access
WXHBITMAP m_hBitmap;
WXHICON m_hIcon;
WXHCURSOR m_hCursor;
};
};
// ----------------------------------------------------------------------------
// wxGDIImage: this class supports GDI image handlers which may be registered
// dynamically and will be used for loading/saving the images in the specified
// format. It also falls back to wxImage if no appropriate image is found.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGDIImage : public wxGDIObject
{
public:
// handlers list interface
static wxGDIImageHandlerList& GetHandlers() { return ms_handlers; }
static void AddHandler(wxGDIImageHandler *handler);
static void InsertHandler(wxGDIImageHandler *handler);
static bool RemoveHandler(const wxString& name);
static wxGDIImageHandler *FindHandler(const wxString& name);
static wxGDIImageHandler *FindHandler(const wxString& extension, long type);
static wxGDIImageHandler *FindHandler(long type);
static void InitStandardHandlers();
static void CleanUpHandlers();
// access to the ref data casted to the right type
wxGDIImageRefData *GetGDIImageData() const
{ return (wxGDIImageRefData *)m_refData; }
// accessors
WXHANDLE GetHandle() const
{ return IsNull() ? 0 : GetGDIImageData()->m_handle; }
void SetHandle(WXHANDLE handle)
{ AllocExclusive(); GetGDIImageData()->m_handle = handle; }
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_width; }
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_height; }
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_depth; }
wxSize GetSize() const
{
return IsNull() ? wxSize(0,0) :
wxSize(GetGDIImageData()->m_width, GetGDIImageData()->m_height);
}
void SetWidth(int w) { AllocExclusive(); GetGDIImageData()->m_width = w; }
void SetHeight(int h) { AllocExclusive(); GetGDIImageData()->m_height = h; }
void SetDepth(int d) { AllocExclusive(); GetGDIImageData()->m_depth = d; }
void SetSize(int w, int h)
{
AllocExclusive();
GetGDIImageData()->SetSize(w, h);
}
void SetSize(const wxSize& size) { SetSize(size.x, size.y); }
// forward some of base class virtuals to wxGDIImageRefData
bool FreeResource(bool force = false);
virtual WXHANDLE GetResourceHandle() const;
protected:
// create the data for the derived class here
virtual wxGDIImageRefData *CreateData() const = 0;
// implement the wxGDIObject method in terms of our, more specific, one
virtual wxGDIRefData *CreateGDIRefData() const { return CreateData(); }
// we can't [efficiently] clone objects of this class
virtual wxGDIRefData *
CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
{
wxFAIL_MSG( wxT("must be implemented if used") );
return NULL;
}
static wxGDIImageHandlerList ms_handlers;
};
// ----------------------------------------------------------------------------
// wxGDIImageHandler: a class which knows how to load/save wxGDIImages.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGDIImageHandler : public wxObject
{
public:
// ctor
wxGDIImageHandler() { m_type = wxBITMAP_TYPE_INVALID; }
wxGDIImageHandler(const wxString& name,
const wxString& ext,
wxBitmapType type)
: m_name(name), m_extension(ext), m_type(type) { }
// accessors
void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; }
void SetType(wxBitmapType type) { m_type = type; }
const wxString& GetName() const { return m_name; }
const wxString& GetExtension() const { return m_extension; }
wxBitmapType GetType() const { return m_type; }
// real handler operations: to implement in derived classes
virtual bool Create(wxGDIImage *image,
const void* data,
wxBitmapType flags,
int width, int height, int depth = 1) = 0;
virtual bool Load(wxGDIImage *image,
const wxString& name,
wxBitmapType flags,
int desiredWidth, int desiredHeight) = 0;
virtual bool Save(const wxGDIImage *image,
const wxString& name,
wxBitmapType type) const = 0;
protected:
wxString m_name;
wxString m_extension;
wxBitmapType m_type;
};
#endif // _WX_MSW_GDIIMAGE_H_

View File

@ -0,0 +1,43 @@
/*
* Name: wx/msw/genrcdefs.h
* Purpose: Emit preprocessor symbols into rcdefs.h for resource compiler
* Author: Mike Wetherell
* RCS-ID: $Id: genrcdefs.h 46936 2007-06-25 14:04:34Z VS $
* Copyright: (c) 2005 Mike Wetherell
* Licence: wxWindows licence
*/
#define EMIT(line) line
EMIT(#ifndef _WX_RCDEFS_H)
EMIT(#define _WX_RCDEFS_H)
#ifdef _MSC_FULL_VER
EMIT(#define WX_MSC_FULL_VER _MSC_FULL_VER)
#endif
#ifdef _M_AMD64
EMIT(#define WX_CPU_AMD64)
#endif
#ifdef _M_ARM
EMIT(#define WX_CPU_ARM)
#endif
#ifdef _M_IA64
EMIT(#define WX_CPU_IA64)
#endif
#if defined _M_IX86 || defined _X86_
EMIT(#define WX_CPU_X86)
#endif
#ifdef _M_PPC
EMIT(#define WX_CPU_PPC)
#endif
#ifdef _M_SH
EMIT(#define WX_CPU_SH)
#endif
EMIT(#endif)

View File

@ -0,0 +1,159 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/glcanvas.h
// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Windows
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id: glcanvas.h 54202 2008-06-14 01:44:13Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include "wx/palette.h"
#include "wx/msw/wrapwin.h"
#include <GL/gl.h>
// ----------------------------------------------------------------------------
// wxGLContext: OpenGL rendering context
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
{
public:
wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL);
virtual ~wxGLContext();
virtual bool SetCurrent(const wxGLCanvas& win) const;
HGLRC GetGLRC() const { return m_glContext; }
protected:
HGLRC m_glContext;
private:
DECLARE_CLASS(wxGLContext)
};
// ----------------------------------------------------------------------------
// wxGLCanvas: OpenGL output window
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
{
public:
wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const int *attribList = NULL,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette);
virtual ~wxGLCanvas();
// implement wxGLCanvasBase methods
virtual bool SwapBuffers();
// MSW-specific helpers
// --------------------
// get the HDC used for OpenGL rendering
HDC GetHDC() const { return m_hDC; }
// try to find pixel format matching the given attributes list for the
// specified HDC, return 0 on error, otherwise pfd is filled in with the
// information from attribList if non-NULL
static int ChooseMatchingPixelFormat(HDC hdc, const int *attribList,
PIXELFORMATDESCRIPTOR *pfd = NULL);
#if wxUSE_PALETTE
// palette stuff
bool SetupPalette(const wxPalette& palette);
virtual wxPalette CreateDefaultPalette();
void OnQueryNewPalette(wxQueryNewPaletteEvent& event);
void OnPaletteChanged(wxPaletteChangedEvent& event);
#endif // wxUSE_PALETTE
// deprecated methods using the implicit wxGLContext, associate the context
// explicitly with the window instead
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED(
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette)
);
wxDEPRECATED(
wxGLCanvas(wxWindow *parent,
const wxGLContext *shared,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette)
);
wxDEPRECATED(
wxGLCanvas(wxWindow *parent,
const wxGLCanvas *shared,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette)
);
#endif // WXWIN_COMPATIBILITY_2_8
protected:
// common part of all ctors
void Init();
// the real window creation function, Create() may reuse it twice as we may
// need to create an OpenGL window to query the available extensions and
// then potentially delete and recreate it with another pixel format
bool CreateWindow(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName);
// set up the pixel format using the given attributes and palette
int DoSetup(PIXELFORMATDESCRIPTOR &pfd, const int *attribList);
// HDC for this window, we keep it all the time
HDC m_hDC;
private:
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxGLCanvas)
};
#endif // _WX_GLCANVAS_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

View File

@ -0,0 +1,133 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/headerctrl.h
// Purpose: wxMSW native wxHeaderCtrl
// Author: Vadim Zeitlin
// Created: 2008-12-01
// RCS-ID: $Id: headerctrl.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_HEADERCTRL_H_
#define _WX_MSW_HEADERCTRL_H_
class WXDLLIMPEXP_FWD_CORE wxImageList;
// ----------------------------------------------------------------------------
// wxHeaderCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxHeaderCtrl : public wxHeaderCtrlBase
{
public:
wxHeaderCtrl()
{
Init();
}
wxHeaderCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr)
{
Init();
Create(parent, id, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr);
virtual ~wxHeaderCtrl();
private:
// implement base class pure virtuals
virtual void DoSetCount(unsigned int count);
virtual unsigned int DoGetCount() const;
virtual void DoUpdate(unsigned int idx);
virtual void DoScrollHorz(int dx);
virtual void DoSetColumnsOrder(const wxArrayInt& order);
virtual wxArrayInt DoGetColumnsOrder() const;
// override wxWindow methods which must be implemented by a new control
virtual wxSize DoGetBestSize() const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
// override MSW-specific methods needed for new control
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
// common part of all ctors
void Init();
// wrapper around Header_InsertItem(): insert the item using information
// from the given column at the given index
void DoInsertItem(const wxHeaderColumn& col, unsigned int idx);
// get the number of currently visible items: this is also the total number
// of items contained in the native control
int GetShownColumnsCount() const;
// due to the discrepancy for the hidden columns which we know about but
// the native control does not, there can be a difference between the
// column indices we use and the ones used by the native control; these
// functions translate between them
//
// notice that MSWToNativeIdx() shouldn't be called for hidden columns and
// MSWFromNativeIdx() always returns an index of a visible column
int MSWToNativeIdx(int idx);
int MSWFromNativeIdx(int item);
// this is the same as above but for order, not index
int MSWToNativeOrder(int order);
int MSWFromNativeOrder(int order);
// get the event type corresponding to a click or double click event
// (depending on dblclk value) with the specified (using MSW convention)
// mouse button
wxEventType GetClickEventType(bool dblclk, int button);
// the number of columns in the control, including the hidden ones (not
// taken into account by the native control, see comment in DoGetCount())
unsigned int m_numColumns;
// this is a lookup table allowing us to check whether the column with the
// given index is currently shown in the native control, in which case the
// value of this array element with this index is 0, or hidden
//
// notice that this may be different from GetColumn(idx).IsHidden() and in
// fact we need this array precisely because it will be different from it
// in DoUpdate() when the column hidden flag gets toggled and we need it to
// handle this transition correctly
wxArrayInt m_isHidden;
// the order of our columns: this array contains the index of the column
// shown at the position n as the n-th element
//
// this is necessary only to handle the hidden columns: the native control
// doesn't know about them and so we can't use Header_GetOrderArray()
wxArrayInt m_colIndices;
// the image list: initially NULL, created on demand
wxImageList *m_imageList;
// the offset of the window used to emulate scrolling it
int m_scrollOffset;
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrl);
};
#endif // _WX_MSW_HEADERCTRL_H_

View File

@ -0,0 +1,129 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/helpbest.h
// Purpose: Tries to load MS HTML Help, falls back to wxHTML upon failure
// Author: Mattia Barbon
// Modified by:
// Created: 02/04/2001
// RCS-ID: $Id: helpbest.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Mattia Barbon
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HELPBEST_H_
#define _WX_HELPBEST_H_
#if wxUSE_HELP && wxUSE_MS_HTML_HELP \
&& wxUSE_WXHTML_HELP && !defined(__WXUNIVERSAL__)
#include "wx/helpbase.h"
#include "wx/html/helpfrm.h" // for wxHF_DEFAULT_STYLE
class WXDLLIMPEXP_HTML wxBestHelpController: public wxHelpControllerBase
{
public:
wxBestHelpController(wxWindow* parentWindow = NULL,
int style = wxHF_DEFAULT_STYLE)
: wxHelpControllerBase(parentWindow),
m_helpControllerType(wxUseNone),
m_helpController(NULL),
m_style(style)
{
}
virtual ~wxBestHelpController() { delete m_helpController; }
// Must call this to set the filename
virtual bool Initialize(const wxString& file);
virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize( file ); }
// If file is "", reloads file given in Initialize
virtual bool LoadFile(const wxString& file = wxEmptyString)
{
return m_helpController->LoadFile( GetValidFilename( file ) );
}
virtual bool DisplayContents()
{
return m_helpController->DisplayContents();
}
virtual bool DisplaySection(int sectionNo)
{
return m_helpController->DisplaySection( sectionNo );
}
virtual bool DisplaySection(const wxString& section)
{
return m_helpController->DisplaySection( section );
}
virtual bool DisplayBlock(long blockNo)
{
return m_helpController->DisplayBlock( blockNo );
}
virtual bool DisplayContextPopup(int contextId)
{
return m_helpController->DisplayContextPopup( contextId );
}
virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos)
{
return m_helpController->DisplayTextPopup( text, pos );
}
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL)
{
return m_helpController->KeywordSearch( k, mode );
}
virtual bool Quit()
{
return m_helpController->Quit();
}
// Allows one to override the default settings for the help frame.
virtual void SetFrameParameters(const wxString& title,
const wxSize& size,
const wxPoint& pos = wxDefaultPosition,
bool newFrameEachTime = false)
{
m_helpController->SetFrameParameters( title, size, pos,
newFrameEachTime );
}
// Obtains the latest settings used by the help frame and the help frame.
virtual wxFrame *GetFrameParameters(wxSize *size = NULL,
wxPoint *pos = NULL,
bool *newFrameEachTime = NULL)
{
return m_helpController->GetFrameParameters( size, pos,
newFrameEachTime );
}
/// Set the window that can optionally be used for the help window's parent.
virtual void SetParentWindow(wxWindow* win) { m_helpController->SetParentWindow(win); }
/// Get the window that can optionally be used for the help window's parent.
virtual wxWindow* GetParentWindow() const { return m_helpController->GetParentWindow(); }
protected:
// Append/change extension if necessary.
wxString GetValidFilename(const wxString& file) const;
protected:
enum HelpControllerType { wxUseNone, wxUseHtmlHelp, wxUseChmHelp };
HelpControllerType m_helpControllerType;
wxHelpControllerBase* m_helpController;
int m_style;
DECLARE_DYNAMIC_CLASS(wxBestHelpController)
wxDECLARE_NO_COPY_CLASS(wxBestHelpController);
};
#endif // wxUSE_HELP && wxUSE_MS_HTML_HELP && wxUSE_WXHTML_HELP
#endif
// _WX_HELPBEST_H_

View File

@ -0,0 +1,90 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/helpchm.h
// Purpose: Help system: MS HTML Help implementation
// Author: Julian Smart
// Modified by:
// Created: 16/04/2000
// RCS-ID: $Id: helpchm.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_HELPCHM_H_
#define _WX_MSW_HELPCHM_H_
#if wxUSE_MS_HTML_HELP
#include "wx/helpbase.h"
class WXDLLIMPEXP_CORE wxCHMHelpController : public wxHelpControllerBase
{
public:
wxCHMHelpController(wxWindow* parentWindow = NULL): wxHelpControllerBase(parentWindow) { }
// Must call this to set the filename
virtual bool Initialize(const wxString& file);
virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize( file ); }
// If file is "", reloads file given in Initialize
virtual bool LoadFile(const wxString& file = wxEmptyString);
virtual bool DisplayContents();
virtual bool DisplaySection(int sectionNo);
virtual bool DisplaySection(const wxString& section);
virtual bool DisplayBlock(long blockNo);
virtual bool DisplayContextPopup(int contextId);
virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos);
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
virtual bool Quit();
wxString GetHelpFile() const { return m_helpFile; }
// helper of DisplayTextPopup(), also used in wxSimpleHelpProvider::ShowHelp
static bool ShowContextHelpPopup(const wxString& text,
const wxPoint& pos,
wxWindow *window);
protected:
// get the name of the CHM file we use from our m_helpFile
wxString GetValidFilename() const;
// Call HtmlHelp() with the provided parameters (both overloads do the same
// thing but allow to avoid casts in the calling code) and return false
// (but don't crash) if HTML help is unavailable
static bool CallHtmlHelp(wxWindow *win, const wxChar *str,
unsigned cmd, WXWPARAM param);
static bool CallHtmlHelp(wxWindow *win, const wxChar *str,
unsigned cmd, const void *param = NULL)
{
return CallHtmlHelp(win, str, cmd, reinterpret_cast<WXWPARAM>(param));
}
// even simpler wrappers using GetParentWindow() and GetValidFilename() as
// the first 2 HtmlHelp() parameters
bool CallHtmlHelp(unsigned cmd, WXWPARAM param)
{
return CallHtmlHelp(GetParentWindow(), GetValidFilename().wx_str(),
cmd, param);
}
bool CallHtmlHelp(unsigned cmd, const void *param = NULL)
{
return CallHtmlHelp(cmd, reinterpret_cast<WXWPARAM>(param));
}
// wrapper around CallHtmlHelp(HH_DISPLAY_TEXT_POPUP): only one of text and
// contextId parameters can be non-NULL/non-zero
static bool DoDisplayTextPopup(const wxChar *text,
const wxPoint& pos,
int contextId,
wxWindow *window);
wxString m_helpFile;
DECLARE_CLASS(wxCHMHelpController)
};
#endif // wxUSE_MS_HTML_HELP
#endif // _WX_MSW_HELPCHM_H_

View File

@ -0,0 +1,56 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/helpwin.h
// Purpose: Help system: WinHelp implementation
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id: helpwin.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HELPWIN_H_
#define _WX_HELPWIN_H_
#include "wx/wx.h"
#if wxUSE_HELP
#include "wx/helpbase.h"
class WXDLLIMPEXP_CORE wxWinHelpController: public wxHelpControllerBase
{
DECLARE_CLASS(wxWinHelpController)
public:
wxWinHelpController(wxWindow* parentWindow = NULL): wxHelpControllerBase(parentWindow) {}
virtual ~wxWinHelpController() {}
// Must call this to set the filename
virtual bool Initialize(const wxString& file);
virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize( file ); }
// If file is "", reloads file given in Initialize
virtual bool LoadFile(const wxString& file = wxEmptyString);
virtual bool DisplayContents();
virtual bool DisplaySection(int sectionNo);
virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); }
virtual bool DisplayBlock(long blockNo);
virtual bool DisplayContextPopup(int contextId);
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
virtual bool Quit();
inline wxString GetHelpFile() const { return m_helpFile; }
protected:
// Append extension if necessary.
wxString GetValidFilename(const wxString& file) const;
private:
wxString m_helpFile;
};
#endif // wxUSE_HELP
#endif
// _WX_HELPWIN_H_

View File

@ -0,0 +1,465 @@
/*
* wx/msw/htmlhelp.h
* Copyright 2004 Jacek Caban
*
* Originally written for the Wine project, and issued under
* the wxWindows licence by kind permission of the author.
*
* Licence: wxWindows licence
*/
#ifndef __HTMLHELP_H__
#define __HTMLHELP_H__
#define HH_DISPLAY_TOPIC 0x00
#define HH_HELP_FINDER 0x00
#define HH_DISPLAY_TOC 0x01
#define HH_DISPLAY_INDEX 0x02
#define HH_DISPLAY_SEARCH 0x03
#define HH_SET_WIN_TYPE 0x04
#define HH_GET_WIN_TYPE 0x05
#define HH_GET_WIN_HANDLE 0x06
#define HH_ENUM_INFO_TYPE 0x07
#define HH_SET_INFO_TYPE 0x08
#define HH_SYNC 0x09
#define HH_RESERVED1 0x0A
#define HH_RESERVED2 0x0B
#define HH_RESERVED3 0x0C
#define HH_KEYWORD_LOOKUP 0x0D
#define HH_DISPLAY_TEXT_POPUP 0x0E
#define HH_HELP_CONTEXT 0x0F
#define HH_TP_HELP_CONTEXTMENU 0x10
#define HH_TP_HELP_WM_HELP 0x11
#define HH_CLOSE_ALL 0x12
#define HH_ALINK_LOOKUP 0x13
#define HH_GET_LAST_ERROR 0x14
#define HH_ENUM_CATEGORY 0x15
#define HH_ENUM_CATEGORY_IT 0x16
#define HH_RESET_IT_FILTER 0x17
#define HH_SET_INCLUSIVE_FILTER 0x18
#define HH_SET_EXCLUSIVE_FILTER 0x19
#define HH_INITIALIZE 0x1C
#define HH_UNINITIALIZE 0x1D
#define HH_PRETRANSLATEMESSAGE 0xFD
#define HH_SET_GLOBAL_PROPERTY 0xFC
#define HHWIN_PROP_TAB_AUTOHIDESHOW 0x00000001
#define HHWIN_PROP_ONTOP 0x00000002
#define HHWIN_PROP_NOTITLEBAR 0x00000004
#define HHWIN_PROP_NODEF_STYLES 0x00000008
#define HHWIN_PROP_NODEF_EXSTYLES 0x00000010
#define HHWIN_PROP_TRI_PANE 0x00000020
#define HHWIN_PROP_NOTB_TEXT 0x00000040
#define HHWIN_PROP_POST_QUIT 0x00000080
#define HHWIN_PROP_AUTO_SYNC 0x00000100
#define HHWIN_PROP_TRACKING 0x00000200
#define HHWIN_PROP_TAB_SEARCH 0x00000400
#define HHWIN_PROP_TAB_HISTORY 0x00000800
#define HHWIN_PROP_TAB_FAVORITES 0x00001000
#define HHWIN_PROP_CHANGE_TITLE 0x00002000
#define HHWIN_PROP_NAV_ONLY_WIN 0x00004000
#define HHWIN_PROP_NO_TOOLBAR 0x00008000
#define HHWIN_PROP_MENU 0x00010000
#define HHWIN_PROP_TAB_ADVSEARCH 0x00020000
#define HHWIN_PROP_USER_POS 0x00040000
#define HHWIN_PROP_TAB_CUSTOM1 0x00080000
#define HHWIN_PROP_TAB_CUSTOM2 0x00100000
#define HHWIN_PROP_TAB_CUSTOM3 0x00200000
#define HHWIN_PROP_TAB_CUSTOM4 0x00400000
#define HHWIN_PROP_TAB_CUSTOM5 0x00800000
#define HHWIN_PROP_TAB_CUSTOM6 0x01000000
#define HHWIN_PROP_TAB_CUSTOM7 0x02000000
#define HHWIN_PROP_TAB_CUSTOM8 0x04000000
#define HHWIN_PROP_TAB_CUSTOM9 0x08000000
#define HHWIN_TB_MARGIN 0x10000000
#define HHWIN_PARAM_PROPERTIES 0x00000002
#define HHWIN_PARAM_STYLES 0x00000004
#define HHWIN_PARAM_EXSTYLES 0x00000008
#define HHWIN_PARAM_RECT 0x00000010
#define HHWIN_PARAM_NAV_WIDTH 0x00000020
#define HHWIN_PARAM_SHOWSTATE 0x00000040
#define HHWIN_PARAM_INFOTYPES 0x00000080
#define HHWIN_PARAM_TB_FLAGS 0x00000100
#define HHWIN_PARAM_EXPANSION 0x00000200
#define HHWIN_PARAM_TABPOS 0x00000400
#define HHWIN_PARAM_TABORDER 0x00000800
#define HHWIN_PARAM_HISTORY_COUNT 0x00001000
#define HHWIN_PARAM_CUR_TAB 0x00002000
#define HHWIN_BUTTON_EXPAND 0x00000002
#define HHWIN_BUTTON_BACK 0x00000004
#define HHWIN_BUTTON_FORWARD 0x00000008
#define HHWIN_BUTTON_STOP 0x00000010
#define HHWIN_BUTTON_REFRESH 0x00000020
#define HHWIN_BUTTON_HOME 0x00000040
#define HHWIN_BUTTON_BROWSE_FWD 0x00000080
#define HHWIN_BUTTON_BROWSE_BCK 0x00000100
#define HHWIN_BUTTON_NOTES 0x00000200
#define HHWIN_BUTTON_CONTENTS 0x00000400
#define HHWIN_BUTTON_SYNC 0x00000800
#define HHWIN_BUTTON_OPTIONS 0x00001000
#define HHWIN_BUTTON_PRINT 0x00002000
#define HHWIN_BUTTON_INDEX 0x00004000
#define HHWIN_BUTTON_SEARCH 0x00008000
#define HHWIN_BUTTON_HISTORY 0x00010000
#define HHWIN_BUTTON_FAVORITES 0x00020000
#define HHWIN_BUTTON_JUMP1 0x00040000
#define HHWIN_BUTTON_JUMP2 0x00080000
#define HHWIN_BUTTON_ZOOM 0x00100000
#define HHWIN_BUTTON_TOC_NEXT 0x00200000
#define HHWIN_BUTTON_TOC_PREV 0x00400000
#define HHWIN_DEF_BUTTONS \
(HHWIN_BUTTON_EXPAND | HHWIN_BUTTON_BACK | HHWIN_BUTTON_OPTIONS | HHWIN_BUTTON_PRINT)
#define IDTB_EXPAND 200
#define IDTB_CONTRACT 201
#define IDTB_STOP 202
#define IDTB_REFRESH 203
#define IDTB_BACK 204
#define IDTB_HOME 205
#define IDTB_SYNC 206
#define IDTB_PRINT 207
#define IDTB_OPTIONS 208
#define IDTB_FORWARD 209
#define IDTB_NOTES 210
#define IDTB_BROWSE_FWD 211
#define IDTB_BROWSE_BACK 212
#define IDTB_CONTENTS 213
#define IDTB_INDEX 214
#define IDTB_SEARCH 215
#define IDTB_HISTORY 216
#define IDTB_FAVORITES 217
#define IDTB_JUMP1 218
#define IDTB_JUMP2 219
#define IDTB_CUSTOMIZE 221
#define IDTB_ZOOM 222
#define IDTB_TOC_NEXT 223
#define IDTB_TOC_PREV 224
#define HHN_FIRST (0U-860U)
#define HHN_LAST (0U-879U)
#define HHN_NAVCOMPLETE HHN_FIRST
#define HHN_TRACK (HHN_FIRST-1)
#define HHN_WINDOW_CREATE (HHN_FIRST-2)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct tagHH_NOTIFY {
NMHDR hdr;
PCSTR pszurl;
} HH_NOTIFY;
typedef struct tagHH_POPUPA {
int cbStruct;
HINSTANCE hinst;
UINT idString;
LPCSTR pszText;
POINT pt;
COLORREF clrForeground;
COLORREF clrBackground;
RECT rcMargins;
LPCSTR pszFont;
} HH_POPUPA;
typedef struct tagHH_POPUPW {
int cbStruct;
HINSTANCE hinst;
UINT idString;
LPCWSTR pszText;
POINT pt;
COLORREF clrForeground;
COLORREF clrBackground;
RECT rcMargins;
LPCWSTR pszFont;
} HH_POPUPW;
#ifdef _UNICODE
typedef HH_POPUPW HH_POPUP;
#else
typedef HH_POPUPA HH_POPUP;
#endif
typedef struct tagHH_ALINKA {
int cbStruct;
BOOL fReserved;
LPCSTR pszKeywords;
LPCSTR pszUrl;
LPCSTR pszMsgText;
LPCSTR pszMsgTitle;
LPCSTR pszWindow;
BOOL fIndexOnFail;
} HH_ALINKA;
typedef struct tagHH_ALINKW {
int cbStruct;
BOOL fReserved;
LPCWSTR pszKeywords;
LPCWSTR pszUrl;
LPCWSTR pszMsgText;
LPCWSTR pszMsgTitle;
LPCWSTR pszWindow;
BOOL fIndexOnFail;
} HH_ALINKW;
#ifdef _UNICODE
typedef HH_ALINKW HH_ALINK;
typedef HH_ALINKW HH_AKLINK;
#else
typedef HH_ALINKA HH_ALINK;
typedef HH_ALINKA HH_AKLINK;
#endif
enum {
HHWIN_NAVTYPE_TOC,
HHWIN_NAVTYPE_INDEX,
HHWIN_NAVTYPE_SEARCH,
HHWIN_NAVTYPE_FAVORITES,
HHWIN_NAVTYPE_HISTORY,
HHWIN_NAVTYPE_AUTHOR,
HHWIN_NAVTYPE_CUSTOM_FIRST = 11
};
enum {
IT_INCLUSIVE,
IT_EXCLUSIVE,
IT_HIDDEN
};
typedef struct tagHH_ENUM_IT {
int cbStruct;
int iType;
LPCSTR pszCatName;
LPCSTR pszITName;
LPCSTR pszITDescription;
} HH_ENUM_IT, *PHH_ENUM_IT;
typedef struct tagHH_ENUM_CAT {
int cbStruct;
LPCSTR pszCatName;
LPCSTR pszCatDescription;
} HH_ENUM_CAT, *PHH_ENUM_CAT;
typedef struct tagHH_SET_INFOTYPE {
int cbStruct;
LPCSTR pszCatName;
LPCSTR pszInfoTypeName;
} HH_SET_INFOTYPE;
typedef DWORD HH_INFOTYPE, *PHH_INFOTYPE;
enum {
HHWIN_NAVTAB_TOP,
HHWIN_NAVTAB_LEFT,
HHWIN_NAVTAB_BOTTOM
};
#define HH_MAX_TABS 19
enum {
HH_TAB_CONTENTS,
HH_TAB_INDEX,
HH_TAB_SEARCH,
HH_TAB_FAVORITES,
HH_TAB_HISTORY,
HH_TAB_AUTHOR,
HH_TAB_CUSTOM_FIRST = 11,
HH_TAB_CUSTOM_LAST = HH_MAX_TABS
};
#define HH_MAX_TABS_CUSTOM (HH_TAB_CUSTOM_LAST-HH_TAB_CUSTOM_FIRST+1)
#define HH_FTS_DEFAULT_PROXIMITY -1
typedef struct tagHH_FTS_QUERYA {
int cbStruct;
BOOL fUniCodeStrings;
LPCSTR pszSearchQuery;
LONG iProximity;
BOOL fStemmedSearch;
BOOL fTitleOnly;
BOOL fExecute;
LPCSTR pszWindow;
} HH_FTS_QUERYA;
typedef struct tagHH_FTS_QUERYW {
int cbStruct;
BOOL fUniCodeStrings;
LPCWSTR pszSearchQuery;
LONG iProximity;
BOOL fStemmedSearch;
BOOL fTitleOnly;
BOOL fExecute;
LPCWSTR pszWindow;
} HH_FTS_QUERYW;
#ifdef _UNICODE
typedef HH_FTS_QUERYW HH_FTS_QUERY;
#else
typedef HH_FTS_QUERYA HH_FTS_QUERY;
#endif
typedef struct tagHH_WINTYPEA {
int cbStruct;
BOOL fUniCodeStrings;
LPCSTR pszType;
DWORD fsValidMembers;
DWORD fsWinProperties;
LPCSTR pszCaption;
DWORD dwStyles;
DWORD dwExStyles;
RECT rcWindowPos;
int nShowState;
HWND hwndHelp;
HWND hwndCaller;
PHH_INFOTYPE paInfoTypes;
HWND hwndToolBar;
HWND hwndNavigation;
HWND hwndHTML;
int iNavWidth;
RECT rcHTML;
LPCSTR pszToc;
LPCSTR pszIndex;
LPCSTR pszFile;
LPCSTR pszHome;
DWORD fsToolBarFlags;
BOOL fNotExpanded;
int curNavType;
int tabpos;
int idNotify;
BYTE tabOrder[HH_MAX_TABS+1];
int cHistory;
LPCSTR pszJump1;
LPCSTR pszJump2;
LPCSTR pszUrlJump1;
LPCSTR pszUrlJump2;
RECT rcMinSize;
int cbInfoTypes;
LPCSTR pszCustomTabs;
} HH_WINTYPEA, *PHH_WINTYPEA;
typedef struct tagHH_WINTYPEW {
int cbStruct;
BOOL fUniCodeStrings;
LPCWSTR pszType;
DWORD fsValidMembers;
DWORD fsWinProperties;
LPCWSTR pszCaption;
DWORD dwStyles;
DWORD dwExStyles;
RECT rcWindowPos;
int nShowState;
HWND hwndHelp;
HWND hwndCaller;
PHH_INFOTYPE paInfoTypes;
HWND hwndToolBar;
HWND hwndNavigation;
HWND hwndHTML;
int iNavWidth;
RECT rcHTML;
LPCWSTR pszToc;
LPCWSTR pszIndex;
LPCWSTR pszFile;
LPCWSTR pszHome;
DWORD fsToolBarFlags;
BOOL fNotExpanded;
int curNavType;
int tabpos;
int idNotify;
BYTE tabOrder[HH_MAX_TABS+1];
int cHistory;
LPCWSTR pszJump1;
LPCWSTR pszJump2;
LPCWSTR pszUrlJump1;
LPCWSTR pszUrlJump2;
RECT rcMinSize;
int cbInfoTypes;
LPCWSTR pszCustomTabs;
} HH_WINTYPEW, *PHH_WINTYPEW;
#ifdef _UNICODE
typedef HH_WINTYPEW HH_WINTYPE;
#else
typedef HH_WINTYPEA HH_WINTYPE;
#endif
enum {
HHACT_TAB_CONTENTS,
HHACT_TAB_INDEX,
HHACT_TAB_SEARCH,
HHACT_TAB_HISTORY,
HHACT_TAB_FAVORITES,
HHACT_EXPAND,
HHACT_CONTRACT,
HHACT_BACK,
HHACT_FORWARD,
HHACT_STOP,
HHACT_REFRESH,
HHACT_HOME,
HHACT_SYNC,
HHACT_OPTIONS,
HHACT_PRINT,
HHACT_HIGHLIGHT,
HHACT_CUSTOMIZE,
HHACT_JUMP1,
HHACT_JUMP2,
HHACT_ZOOM,
HHACT_TOC_NEXT,
HHACT_TOC_PREV,
HHACT_NOTES,
HHACT_LAST_ENUM
};
typedef struct tagHH_NTRACKA {
NMHDR hdr;
PCSTR pszCurUrl;
int idAction;
PHH_WINTYPEA phhWinType;
} HH_NTRACKA;
typedef struct tagHH_NTRACKW {
NMHDR hdr;
PCSTR pszCurUrl;
int idAction;
PHH_WINTYPEW phhWinType;
} HH_NTRACKW;
#ifdef _UNICODE
typedef HH_NTRACKW HH_NTRACK;
#else
typedef HH_NTRACKA HH_NTRACK;
#endif
HWND WINAPI HtmlHelpA(HWND,LPCSTR,UINT,DWORD);
HWND WINAPI HtmlHelpA(HWND,LPCSTR,UINT,DWORD);
#define HtmlHelp WINELIB_NAME_AW(HtmlHelp)
#define ATOM_HTMLHELP_API_ANSI (LPTSTR)14
#define ATOM_HTMLHELP_API_UNICODE (LPTSTR)15
typedef enum tagHH_GPROPID {
HH_GPROPID_SINGLETHREAD = 1,
HH_GPROPID_TOOLBAR_MARGIN = 2,
HH_GPROPID_UI_LANGUAGE = 3,
HH_GPROPID_CURRENT_SUBSET = 4,
HH_GPROPID_CONTENT_LANGUAGE = 5
} HH_GPROPID;
#ifdef __WIDL_OAIDL_H
typedef struct tagHH_GLOBAL_PROPERTY
{
HH_GPROPID id;
VARIANT var;
} HH_GLOBAL_PROPERTY ;
#endif /* __WIDL_OAIDL_H */
#ifdef __cplusplus
}
#endif
#endif /* __HTMLHELP_H__ */

View File

@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/hyperlink.h
// Purpose: Hyperlink control
// Author: Rickard Westerlund
// Created: 2010-08-04
// RCS-ID: $Id: hyperlink.h 65334 2010-08-17 16:55:32Z VZ $
// Copyright: (c) 2010 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_HYPERLINK_H_
#define _WX_MSW_HYPERLINK_H_
#include "wx/generic/hyperlink.h"
// ----------------------------------------------------------------------------
// wxHyperlinkCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxHyperlinkCtrl : public wxGenericHyperlinkCtrl
{
public:
// Default constructor (for two-step construction).
wxHyperlinkCtrl() { }
// Constructor.
wxHyperlinkCtrl(wxWindow *parent,
wxWindowID id,
const wxString& label, const wxString& url,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHL_DEFAULT_STYLE,
const wxString& name = wxHyperlinkCtrlNameStr)
{
(void)Create(parent, id, label, url, pos, size, style, name);
}
// Creation function (for two-step construction).
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label, const wxString& url,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHL_DEFAULT_STYLE,
const wxString& name = wxHyperlinkCtrlNameStr);
// overridden base class methods
// -----------------------------
virtual void SetURL(const wxString &url);
virtual void SetLabel(const wxString &label);
protected:
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
virtual wxSize DoGetBestClientSize() const;
private:
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
wxDECLARE_DYNAMIC_CLASS( wxHyperlinkCtrl );
};
#endif // _WX_MSW_HYPERLINK_H_

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="0.64.1.0"
processorArchitecture="IA64"
name="Controls"
type="win32"
/>
<description>wxWindows application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="IA64"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@ -0,0 +1,95 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/icon.h
// Purpose: wxIcon class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: icon.h 56644 2008-11-02 02:39:52Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ICON_H_
#define _WX_ICON_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/msw/gdiimage.h"
// ---------------------------------------------------------------------------
// icon data
// ---------------------------------------------------------------------------
// notice that although wxIconRefData inherits from wxBitmapRefData, it is not
// a valid wxBitmapRefData
class WXDLLIMPEXP_CORE wxIconRefData : public wxGDIImageRefData
{
public:
wxIconRefData() { }
virtual ~wxIconRefData() { Free(); }
virtual void Free();
};
// ---------------------------------------------------------------------------
// Icon
// ---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIcon : public wxGDIImage
{
public:
// ctors
// default
wxIcon() { }
// from raw data
wxIcon(const char bits[], int width, int height);
// from XPM data
wxIcon(const char* const* data) { CreateIconFromXpm(data); }
#ifdef wxNEEDS_CHARPP
wxIcon(char **data) { CreateIconFromXpm(const_cast<const char* const*>(data)); }
#endif
// from resource/file
wxIcon(const wxString& name,
wxBitmapType type = wxICON_DEFAULT_TYPE,
int desiredWidth = -1, int desiredHeight = -1);
wxIcon(const wxIconLocation& loc);
virtual ~wxIcon();
virtual bool LoadFile(const wxString& name,
wxBitmapType type = wxICON_DEFAULT_TYPE,
int desiredWidth = -1, int desiredHeight = -1);
// implementation only from now on
wxIconRefData *GetIconData() const { return (wxIconRefData *)m_refData; }
void SetHICON(WXHICON icon) { SetHandle((WXHANDLE)icon); }
WXHICON GetHICON() const { return (WXHICON)GetHandle(); }
// create from bitmap (which should have a mask unless it's monochrome):
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
// ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp);
protected:
virtual wxGDIImageRefData *CreateData() const
{
return new wxIconRefData;
}
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
// create from XPM data
void CreateIconFromXpm(const char* const* data);
private:
DECLARE_DYNAMIC_CLASS(wxIcon)
};
#endif
// _WX_ICON_H_

View File

@ -0,0 +1,206 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/imaglist.h
// Purpose: wxImageList class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: imaglist.h 59036 2009-02-19 20:26:00Z RR $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGLIST_H_
#define _WX_IMAGLIST_H_
#include "wx/bitmap.h"
// Eventually we'll make this a reference-counted wxGDIObject. For
// now, the app must take care of ownership issues. That is, the
// image lists must be explicitly deleted after the control(s) that uses them
// is (are) deleted, or when the app exits.
class WXDLLIMPEXP_CORE wxImageList : public wxObject
{
public:
/*
* Public interface
*/
wxImageList();
// Creates an image list.
// Specify the width and height of the images in the list,
// whether there are masks associated with them (e.g. if creating images
// from icons), and the initial size of the list.
wxImageList(int width, int height, bool mask = true, int initialCount = 1)
{
Create(width, height, mask, initialCount);
}
virtual ~wxImageList();
// Attributes
////////////////////////////////////////////////////////////////////////////
// Returns the number of images in the image list.
int GetImageCount() const;
// Returns the size (same for all images) of the images in the list
bool GetSize(int index, int &width, int &height) const;
// Operations
////////////////////////////////////////////////////////////////////////////
// Creates an image list
// width, height specify the size of the images in the list (all the same).
// mask specifies whether the images have masks or not.
// initialNumber is the initial number of images to reserve.
bool Create(int width, int height, bool mask = true, int initialNumber = 1);
// Adds a bitmap, and optionally a mask bitmap.
// Note that wxImageList creates *new* bitmaps, so you may delete
// 'bitmap' and 'mask' after calling Add.
int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
// Adds a bitmap, using the specified colour to create the mask bitmap
// Note that wxImageList creates *new* bitmaps, so you may delete
// 'bitmap' after calling Add.
int Add(const wxBitmap& bitmap, const wxColour& maskColour);
// Adds a bitmap and mask from an icon.
int Add(const wxIcon& icon);
// Replaces a bitmap, optionally passing a mask bitmap.
// Note that wxImageList creates new bitmaps, so you may delete
// 'bitmap' and 'mask' after calling Replace.
bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
/* Not supported by Win95
// Replacing a bitmap, using the specified colour to create the mask bitmap
// Note that wxImageList creates new bitmaps, so you may delete
// 'bitmap'.
bool Replace(int index, const wxBitmap& bitmap, const wxColour& maskColour);
*/
// Replaces a bitmap and mask from an icon.
// You can delete 'icon' after calling Replace.
bool Replace(int index, const wxIcon& icon);
// Removes the image at the given index.
bool Remove(int index);
// Remove all images
bool RemoveAll();
// Draws the given image on a dc at the specified position.
// If 'solidBackground' is true, Draw sets the image list background
// colour to the background colour of the wxDC, to speed up
// drawing by eliminating masked drawing where possible.
bool Draw(int index, wxDC& dc, int x, int y,
int flags = wxIMAGELIST_DRAW_NORMAL,
bool solidBackground = false);
// Get a bitmap
wxBitmap GetBitmap(int index) const;
// Get an icon
wxIcon GetIcon(int index) const;
// TODO: miscellaneous functionality
/*
wxIcon *MakeIcon(int index);
bool SetOverlayImage(int index, int overlayMask);
*/
// TODO: Drag-and-drop related functionality.
#if 0
// Creates a new drag image by combining the given image (typically a mouse cursor image)
// with the current drag image.
bool SetDragCursorImage(int index, const wxPoint& hotSpot);
// If successful, returns a pointer to the temporary image list that is used for dragging;
// otherwise, NULL.
// dragPos: receives the current drag position.
// hotSpot: receives the offset of the drag image relative to the drag position.
static wxImageList *GetDragImageList(wxPoint& dragPos, wxPoint& hotSpot);
// Call this function to begin dragging an image. This function creates a temporary image list
// that is used for dragging. The image combines the specified image and its mask with the
// current cursor. In response to subsequent mouse move messages, you can move the drag image
// by using the DragMove member function. To end the drag operation, you can use the EndDrag
// member function.
bool BeginDrag(int index, const wxPoint& hotSpot);
// Ends a drag operation.
bool EndDrag();
// Call this function to move the image that is being dragged during a drag-and-drop operation.
// This function is typically called in response to a mouse move message. To begin a drag
// operation, use the BeginDrag member function.
static bool DragMove(const wxPoint& point);
// During a drag operation, locks updates to the window specified by lockWindow and displays
// the drag image at the position specified by point.
// The coordinates are relative to the window's upper left corner, so you must compensate
// for the widths of window elements, such as the border, title bar, and menu bar, when
// specifying the coordinates.
// If lockWindow is NULL, this function draws the image in the display context associated
// with the desktop window, and coordinates are relative to the upper left corner of the screen.
// This function locks all other updates to the given window during the drag operation.
// If you need to do any drawing during a drag operation, such as highlighting the target
// of a drag-and-drop operation, you can temporarily hide the dragged image by using the
// wxImageList::DragLeave function.
// lockWindow: pointer to the window that owns the drag image.
// point: position at which to display the drag image. Coordinates are relative to the
// upper left corner of the window (not the client area).
static bool DragEnter( wxWindow *lockWindow, const wxPoint& point );
// Unlocks the window specified by pWndLock and hides the drag image, allowing the
// window to be updated.
static bool DragLeave( wxWindow *lockWindow );
/* Here's roughly how you'd use these functions if implemented in this Win95-like way:
1) Starting to drag:
wxImageList *dragImageList = new wxImageList(16, 16, true);
dragImageList->Add(myDragImage); // Provide an image to combine with the current cursor
dragImageList->BeginDrag(0, wxPoint(0, 0));
wxShowCursor(false); // wxShowCursor not yet implemented in wxWin
myWindow->CaptureMouse();
2) Dragging:
// Called within mouse move event. Could also use dragImageList instead of assuming
// these are static functions.
// These two functions could possibly be combined into one, since DragEnter is
// a bit obscure.
wxImageList::DragMove(wxPoint(x, y)); // x, y are current cursor position
wxImageList::DragEnter(NULL, wxPoint(x, y)); // NULL assumes dragging across whole screen
3) Finishing dragging:
dragImageList->EndDrag();
myWindow->ReleaseMouse();
wxShowCursor(true);
*/
#endif
// Implementation
////////////////////////////////////////////////////////////////////////////
// Returns the native image list handle
WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
protected:
WXHIMAGELIST m_hImageList;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxImageList)
};
#endif
// _WX_IMAGLIST_H_

View File

@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/iniconf.h
// Purpose: INI-file based wxConfigBase implementation
// Author: Vadim Zeitlin
// Modified by:
// Created: 27.07.98
// RCS-ID: $Id: iniconf.h 64943 2010-07-13 13:29:58Z VZ $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_INICONF_H_
#define _WX_MSW_INICONF_H_
#include "wx/defs.h"
#if wxUSE_CONFIG && wxUSE_INICONF
// ----------------------------------------------------------------------------
// wxIniConfig is a wxConfig implementation which uses MS Windows INI files to
// store the data. Because INI files don't really support arbitrary nesting of
// groups, we do the following:
// (1) in win.ini file we store all entries in the [vendor] section and
// the value group1/group2/key is mapped to the value group1_group2_key
// in this section, i.e. all path separators are replaced with underscore
// (2) in appname.ini file we map group1/group2/group3/key to the entry
// group2_group3_key in [group1]
//
// Of course, it might lead to indesirable results if '_' is also used in key
// names (i.e. group/key is the same as group_key) and also GetPath() result
// may be not what you would expect it to be.
//
// Another limitation: the keys and section names are never case-sensitive
// which might differ from wxFileConfig it it was compiled with
// wxCONFIG_CASE_SENSITIVE option.
// ----------------------------------------------------------------------------
// for this class, "local" file is the file appname.ini and the global file
// is the [vendor] subsection of win.ini (default for "vendor" is to be the
// same as appname). The file name (strAppName parameter) may, in fact,
// contain the full path to the file. If it doesn't, the file is searched for
// in the Windows directory.
class WXDLLIMPEXP_CORE wxIniConfig : public wxConfigBase
{
public:
// ctor & dtor
// if strAppName doesn't contain the extension and is not an absolute path,
// ".ini" is appended to it. if strVendor is empty, it's taken to be the
// same as strAppName.
wxIniConfig(const wxString& strAppName = wxEmptyString, const wxString& strVendor = wxEmptyString,
const wxString& localFilename = wxEmptyString, const wxString& globalFilename = wxEmptyString, long style = wxCONFIG_USE_LOCAL_FILE);
virtual ~wxIniConfig();
// implement inherited pure virtual functions
virtual void SetPath(const wxString& strPath);
virtual const wxString& GetPath() const;
virtual bool GetFirstGroup(wxString& str, long& lIndex) const;
virtual bool GetNextGroup (wxString& str, long& lIndex) const;
virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
virtual bool GetNextEntry (wxString& str, long& lIndex) const;
virtual size_t GetNumberOfEntries(bool bRecursive = false) const;
virtual size_t GetNumberOfGroups(bool bRecursive = false) const;
virtual bool HasGroup(const wxString& strName) const;
virtual bool HasEntry(const wxString& strName) const;
// return true if the current group is empty
bool IsEmpty() const;
virtual bool Flush(bool bCurrentOnly = false);
virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
virtual bool RenameGroup(const wxString& oldName, const wxString& newName);
virtual bool DeleteEntry(const wxString& Key, bool bGroupIfEmptyAlso = true);
virtual bool DeleteGroup(const wxString& szKey);
virtual bool DeleteAll();
protected:
// read/write
bool DoReadString(const wxString& key, wxString *pStr) const;
bool DoReadLong(const wxString& key, long *plResult) const;
bool DoReadBinary(const wxString& key, wxMemoryBuffer *buf) const;
bool DoWriteString(const wxString& key, const wxString& szValue);
bool DoWriteLong(const wxString& key, long lValue);
bool DoWriteBinary(const wxString& key, const wxMemoryBuffer& buf);
private:
// helpers
wxString GetPrivateKeyName(const wxString& szKey) const;
wxString GetKeyName(const wxString& szKey) const;
wxString m_strLocalFilename; // name of the private INI file
wxString m_strGroup, // current group in appname.ini file
m_strPath; // the rest of the path (no trailing '_'!)
wxDECLARE_NO_COPY_CLASS(wxIniConfig);
DECLARE_ABSTRACT_CLASS(wxIniConfig)
};
#endif // wxUSE_CONFIG && wxUSE_INICONF
#endif // _WX_MSW_INICONF_H_

View File

@ -0,0 +1,92 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/joystick.h
// Purpose: wxJoystick class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: joystick.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_JOYSTICK_H_
#define _WX_JOYSTICK_H_
#include "wx/event.h"
class WXDLLIMPEXP_ADV wxJoystick: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxJoystick)
public:
/*
* Public interface
*/
wxJoystick(int joystick = wxJOYSTICK1);
// Attributes
////////////////////////////////////////////////////////////////////////////
wxPoint GetPosition(void) const;
int GetPosition(unsigned axis) const;
bool GetButtonState(unsigned button) const;
int GetZPosition(void) const;
int GetButtonState(void) const;
int GetPOVPosition(void) const;
int GetPOVCTSPosition(void) const;
int GetRudderPosition(void) const;
int GetUPosition(void) const;
int GetVPosition(void) const;
int GetMovementThreshold(void) const;
void SetMovementThreshold(int threshold) ;
// Capabilities
////////////////////////////////////////////////////////////////////////////
static int GetNumberJoysticks(void);
bool IsOk(void) const; // Checks that the joystick is functioning
int GetManufacturerId(void) const ;
int GetProductId(void) const ;
wxString GetProductName(void) const ;
int GetXMin(void) const;
int GetYMin(void) const;
int GetZMin(void) const;
int GetXMax(void) const;
int GetYMax(void) const;
int GetZMax(void) const;
int GetNumberButtons(void) const;
int GetNumberAxes(void) const;
int GetMaxButtons(void) const;
int GetMaxAxes(void) const;
int GetPollingMin(void) const;
int GetPollingMax(void) const;
int GetRudderMin(void) const;
int GetRudderMax(void) const;
int GetUMin(void) const;
int GetUMax(void) const;
int GetVMin(void) const;
int GetVMax(void) const;
bool HasRudder(void) const;
bool HasZ(void) const;
bool HasU(void) const;
bool HasV(void) const;
bool HasPOV(void) const;
bool HasPOV4Dir(void) const;
bool HasPOVCTS(void) const;
// Operations
////////////////////////////////////////////////////////////////////////////
// pollingFreq = 0 means that movement events are sent when above the threshold.
// If pollingFreq > 0, events are received every this many milliseconds.
bool SetCapture(wxWindow* win, int pollingFreq = 0);
bool ReleaseCapture(void);
protected:
int m_joystick;
};
#endif
// _WX_JOYSTICK_H_

View File

@ -0,0 +1,27 @@
/*
* Name: wx/msw/libraries.h
* Purpose: Pragmas for linking libs conditionally
* Author: Michael Wetherell
* Modified by:
* RCS-ID: $Id: libraries.h 37045 2006-01-21 22:50:46Z MW $
* Copyright: (c) 2005 Michael Wetherell
* Licence: wxWindows licence
*/
#ifndef _WX_MSW_LIBRARIES_H_
#define _WX_MSW_LIBRARIES_H_
/*
* Notes:
*
* In general the preferred place to add libs is in the bakefiles. This file
* can be used where libs must be added conditionally, for those compilers that
* support a way to do that.
*/
/* VC++ 5 didn't include oleacc.lib, though it came with the PSDK */
#if defined __VISUALC__ && (wxUSE_ACCESSIBILITY || __VISUALC__ >= 1200)
#pragma comment(lib, "oleacc")
#endif
#endif /* _WX_MSW_LIBRARIES_H_ */

View File

@ -0,0 +1,208 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/listbox.h
// Purpose: wxListBox class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: listbox.h 64548 2010-06-10 10:40:21Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LISTBOX_H_
#define _WX_LISTBOX_H_
#if wxUSE_LISTBOX
// ----------------------------------------------------------------------------
// simple types
// ----------------------------------------------------------------------------
#if wxUSE_OWNER_DRAWN
class WXDLLIMPEXP_FWD_CORE wxOwnerDrawn;
// define the array of list box items
#include "wx/dynarray.h"
WX_DEFINE_EXPORTED_ARRAY_PTR(wxOwnerDrawn *, wxListBoxItemsArray);
#endif // wxUSE_OWNER_DRAWN
// forward decl for GetSelections()
class WXDLLIMPEXP_FWD_BASE wxArrayInt;
// ----------------------------------------------------------------------------
// List box control
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
{
public:
// ctors and such
wxListBox() { Init(); }
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Init();
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxListBox();
virtual unsigned int GetCount() const;
virtual wxString GetString(unsigned int n) const;
virtual void SetString(unsigned int n, const wxString& s);
virtual int FindString(const wxString& s, bool bCase = false) const;
virtual bool IsSelected(int n) const;
virtual int GetSelection() const;
virtual int GetSelections(wxArrayInt& aSelections) const;
// return the index of the item at this position or wxNOT_FOUND
int HitTest(const wxPoint& pt) const { return DoHitTestList(pt); }
int HitTest(wxCoord x, wxCoord y) const { return DoHitTestList(wxPoint(x, y)); }
// ownerdrawn wxListBox and wxCheckListBox support
#if wxUSE_OWNER_DRAWN
// override base class virtuals
virtual bool SetFont(const wxFont &font);
bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
// plug-in for derived classes
virtual wxOwnerDrawn *CreateLboxItem(size_t n);
// allows to get the item and use SetXXX functions to set it's appearance
wxOwnerDrawn *GetItem(size_t n) const { return m_aItems[n]; }
// get the index of the given item
int GetItemIndex(wxOwnerDrawn *item) const { return m_aItems.Index(item); }
// get rect of the given item index
bool GetItemRect(size_t n, wxRect& rect) const;
// redraw the given item
bool RefreshItem(size_t n);
#endif // wxUSE_OWNER_DRAWN
// Windows-specific code to update the horizontal extent of the listbox, if
// necessary. If s is non-empty, the horizontal extent is increased to the
// length of this string if it's currently too short, otherwise the maximum
// extent of all strings is used. In any case calls InvalidateBestSize()
virtual void SetHorizontalExtent(const wxString& s = wxEmptyString);
// Windows callbacks
bool MSWCommand(WXUINT param, WXWORD id);
WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// under XP when using "transition effect for menus and tooltips" if we
// return true for WM_PRINTCLIENT here then it causes noticable slowdown
virtual bool MSWShouldPropagatePrintChild()
{
return false;
}
virtual wxVisualAttributes GetDefaultAttributes() const
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL)
{
return GetCompositeControlsDefaultAttributes(variant);
}
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
virtual void OnInternalIdle();
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
protected:
virtual wxSize DoGetBestClientSize() const;
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int n);
virtual void DoSetSelection(int n, bool select);
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData, wxClientDataType type);
virtual void DoSetFirstItem(int n);
virtual void DoSetItemClientData(unsigned int n, void* clientData);
virtual void* DoGetItemClientData(unsigned int n) const;
// this can't be called DoHitTest() because wxWindow already has this method
virtual int DoHitTestList(const wxPoint& point) const;
// free memory (common part of Clear() and dtor)
void Free();
unsigned int m_noItems;
#if wxUSE_OWNER_DRAWN
// control items
wxListBoxItemsArray m_aItems;
#endif
private:
// common part of all ctors
void Init();
// call this when items are added to or deleted from the listbox or an
// items text changes
void MSWOnItemsChanged();
// flag indicating whether the max horizontal extent should be updated,
// i.e. if we need to call SetHorizontalExtent() from OnInternalIdle()
bool m_updateHorizontalExtent;
// flag set to true when we get a keyboard event and reset to false when we
// get a mouse one: this is used to find the correct item for the selection
// event
bool m_selectedByKeyboard;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxListBox)
};
#endif // wxUSE_LISTBOX
#endif
// _WX_LISTBOX_H_

View File

@ -0,0 +1,475 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/listctrl.h
// Purpose: wxListCtrl class
// Author: Julian Smart
// Modified by: Agron Selimaj
// Created: 01/02/97
// RCS-ID: $Id: listctrl.h 64532 2010-06-09 13:55:48Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LISTCTRL_H_
#define _WX_LISTCTRL_H_
#include "wx/textctrl.h"
#include "wx/dynarray.h"
#include "wx/vector.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
class wxMSWListItemData;
// define this symbol to indicate the availability of SetColumnsOrder() and
// related functions
#define wxHAS_LISTCTRL_COLUMN_ORDER
/*
The wxListCtrl can show lists of items in four different modes:
wxLC_LIST: multicolumn list view, with optional small icons (icons could be
optional for some platforms). Columns are computed automatically,
i.e. you don't set columns as in wxLC_REPORT. In other words,
the list wraps, unlike a wxListBox.
wxLC_REPORT: single or multicolumn report view (with optional header)
wxLC_ICON: large icon view, with optional labels
wxLC_SMALL_ICON: small icon view, with optional labels
You can change the style dynamically, either with SetSingleStyle or
SetWindowStyleFlag.
Further window styles:
wxLC_ALIGN_TOP icons align to the top (default)
wxLC_ALIGN_LEFT icons align to the left
wxLC_AUTOARRANGE icons arrange themselves
wxLC_USER_TEXT the app provides label text on demand, except for column headers
wxLC_EDIT_LABELS labels are editable: app will be notified.
wxLC_NO_HEADER no header in report mode
wxLC_NO_SORT_HEADER can't click on header
wxLC_SINGLE_SEL single selection
wxLC_SORT_ASCENDING sort ascending (must still supply a comparison callback in SortItems)
wxLC_SORT_DESCENDING sort descending (ditto)
Items are referred to by their index (position in the list starting from zero).
Label text is supplied via insertion/setting functions and is stored by the
control, unless the wxLC_USER_TEXT style has been specified, in which case
the app will be notified when text is required (see sample).
Images are dealt with by (optionally) associating 3 image lists with the control.
Zero-based indexes into these image lists indicate which image is to be used for
which item. Each image in an image list can contain a mask, and can be made out
of either a bitmap, two bitmaps or an icon. See ImagList.h for more details.
Notifications are passed via the wxWidgets 2.0 event system, or using virtual
functions in wxWidgets 1.66.
See the sample wxListCtrl app for API usage.
TODO:
- addition of further convenience functions
to avoid use of wxListItem in some functions
- state/overlay images: probably not needed.
- in Win95, you can be called back to supply other information
besides text, such as state information. This saves no memory
and is probably superfluous to requirements.
- testing of whole API, extending current sample.
*/
class WXDLLIMPEXP_CORE wxListCtrl: public wxControl
{
public:
/*
* Public interface
*/
wxListCtrl() { Init(); }
wxListCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListCtrlNameStr)
{
Init();
Create(parent, id, pos, size, style, validator, name);
}
virtual ~wxListCtrl();
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListCtrlNameStr);
// Attributes
////////////////////////////////////////////////////////////////////////////
// Set the control colours
bool SetForegroundColour(const wxColour& col);
bool SetBackgroundColour(const wxColour& col);
// Gets information about this column
bool GetColumn(int col, wxListItem& item) const;
// Sets information about this column
bool SetColumn(int col, const wxListItem& item);
// Gets the column width
int GetColumnWidth(int col) const;
// Sets the column width
bool SetColumnWidth(int col, int width);
// Gets the column order from its index or index from its order
int GetColumnOrder(int col) const;
int GetColumnIndexFromOrder(int order) const;
// Gets the column order for all columns
wxArrayInt GetColumnsOrder() const;
// Sets the column order for all columns
bool SetColumnsOrder(const wxArrayInt& orders);
// Gets the number of items that can fit vertically in the
// visible area of the list control (list or report view)
// or the total number of items in the list control (icon
// or small icon view)
int GetCountPerPage() const;
// return the total area occupied by all the items (icon/small icon only)
wxRect GetViewRect() const;
// Gets the edit control for editing labels.
wxTextCtrl* GetEditControl() const;
// Gets information about the item
bool GetItem(wxListItem& info) const;
// Sets information about the item
bool SetItem(wxListItem& info);
// Sets a string field at a particular column
long SetItem(long index, int col, const wxString& label, int imageId = -1);
// Gets the item state
int GetItemState(long item, long stateMask) const;
// Sets the item state
bool SetItemState(long item, long state, long stateMask);
// Sets the item image
bool SetItemImage(long item, int image, int selImage = -1);
bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
wxString GetItemText(long item, int col = 0) const;
// Sets the item text
void SetItemText(long item, const wxString& str);
// Gets the item data
wxUIntPtr GetItemData(long item) const;
// Sets the item data
bool SetItemPtrData(long item, wxUIntPtr data);
bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
// Gets the item rectangle
bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const;
// Gets the subitem rectangle in report mode
bool GetSubItemRect(long item, long subItem, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const;
// Gets the item position
bool GetItemPosition(long item, wxPoint& pos) const;
// Sets the item position
bool SetItemPosition(long item, const wxPoint& pos);
// Gets the number of items in the list control
int GetItemCount() const;
// Gets the number of columns in the list control
int GetColumnCount() const { return m_colCount; }
// get the horizontal and vertical components of the item spacing
wxSize GetItemSpacing() const;
// Foreground colour of an item.
void SetItemTextColour( long item, const wxColour& col);
wxColour GetItemTextColour( long item ) const;
// Background colour of an item.
void SetItemBackgroundColour( long item, const wxColour &col);
wxColour GetItemBackgroundColour( long item ) const;
// Font of an item.
void SetItemFont( long item, const wxFont &f);
wxFont GetItemFont( long item ) const;
// Gets the number of selected items in the list control
int GetSelectedItemCount() const;
// Gets the text colour of the listview
wxColour GetTextColour() const;
// Sets the text colour of the listview
void SetTextColour(const wxColour& col);
// Gets the index of the topmost visible item when in
// list or report view
long GetTopItem() const;
// Add or remove a single window style
void SetSingleStyle(long style, bool add = true);
// Set the whole window style
void SetWindowStyleFlag(long style);
// Searches for an item, starting from 'item'.
// item can be -1 to find the first item that matches the
// specified flags.
// Returns the item or -1 if unsuccessful.
long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const;
// Gets one of the three image lists
wxImageList *GetImageList(int which) const;
// Sets the image list
// N.B. There's a quirk in the Win95 list view implementation.
// If in wxLC_LIST mode, it'll *still* display images by the labels if
// there's a small-icon image list set for the control - even though you
// haven't specified wxLIST_MASK_IMAGE when inserting.
// So you have to set a NULL small-icon image list to be sure that
// the wxLC_LIST mode works without icons. Of course, you may want icons...
void SetImageList(wxImageList *imageList, int which);
void AssignImageList(wxImageList *imageList, int which);
// are we in report mode?
bool InReportView() const { return HasFlag(wxLC_REPORT); }
// are we in virtual report mode?
bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); }
// refresh items selectively (only useful for virtual list controls)
void RefreshItem(long item);
void RefreshItems(long itemFrom, long itemTo);
// Operations
////////////////////////////////////////////////////////////////////////////
// Arranges the items
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
// Deletes an item
bool DeleteItem(long item);
// Deletes all items
bool DeleteAllItems();
// Deletes a column
bool DeleteColumn(int col);
// Deletes all columns
bool DeleteAllColumns();
// Clears items, and columns if there are any.
void ClearAll();
// Edit the label
wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl));
// End label editing, optionally cancelling the edit
bool EndEditLabel(bool cancel);
// Ensures this item is visible
bool EnsureVisible(long item);
// Find an item whose label matches this string, starting from the item after 'start'
// or the beginning if 'start' is -1.
long FindItem(long start, const wxString& str, bool partial = false);
// Find an item whose data matches this data, starting from the item after 'start'
// or the beginning if 'start' is -1.
long FindItem(long start, wxUIntPtr data);
// Find an item nearest this position in the specified direction, starting from
// the item after 'start' or the beginning if 'start' is -1.
long FindItem(long start, const wxPoint& pt, int direction);
// Determines which item (if any) is at the specified point,
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
// Request the subitem number as well at the given coordinate.
long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const;
// Inserts an item, returning the index of the new item if successful,
// -1 otherwise.
long InsertItem(const wxListItem& info);
// Insert a string item
long InsertItem(long index, const wxString& label);
// Insert an image item
long InsertItem(long index, int imageIndex);
// Insert an image/string item
long InsertItem(long index, const wxString& label, int imageIndex);
// For list view mode (only), inserts a column.
long InsertColumn(long col, const wxListItem& info);
long InsertColumn(long col,
const wxString& heading,
int format = wxLIST_FORMAT_LEFT,
int width = -1);
// set the number of items in a virtual list control
void SetItemCount(long count);
// Scrolls the list control. If in icon, small icon or report view mode,
// x specifies the number of pixels to scroll. If in list view mode, x
// specifies the number of columns to scroll.
// If in icon, small icon or list view mode, y specifies the number of pixels
// to scroll. If in report view mode, y specifies the number of lines to scroll.
bool ScrollList(int dx, int dy);
// Sort items.
// fn is a function which takes 3 long arguments: item1, item2, data.
// item1 is the long data associated with a first item (NOT the index).
// item2 is the long data associated with a second item (NOT the index).
// data is the same value as passed to SortItems.
// The return value is a negative number if the first item should precede the second
// item, a positive number of the second item should precede the first,
// or zero if the two items are equivalent.
// data is arbitrary data to be passed to the sort function.
bool SortItems(wxListCtrlCompare fn, wxIntPtr data);
// IMPLEMENTATION
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
virtual bool MSWShouldPreProcessMessage(WXMSG* msg);
// bring the control in sync with current m_windowStyle value
void UpdateStyle();
// Event handlers
////////////////////////////////////////////////////////////////////////////
// Necessary for drawing hrules and vrules, if specified
void OnPaint(wxPaintEvent& event);
virtual bool ShouldInheritColours() const { return false; }
virtual wxVisualAttributes GetDefaultAttributes() const
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
#if WXWIN_COMPATIBILITY_2_6
// obsolete stuff, for compatibility only -- don't use
wxDEPRECATED( int GetItemSpacing(bool isSmall) const);
#endif // WXWIN_COMPATIBILITY_2_6
// convert our styles to Windows
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// special Windows message handling
virtual WXLRESULT MSWWindowProc(WXUINT nMsg,
WXWPARAM wParam,
WXLPARAM lParam);
protected:
// common part of all ctors
void Init();
// free memory taken by all internal data
void FreeAllInternalData();
// get the internal data object for this item (may return NULL)
wxMSWListItemData *MSWGetItemData(long item) const;
// get the item attribute, either by quering it for virtual control, or by
// returning the one previously set using setter methods for a normal one
wxListItemAttr *DoGetItemColumnAttr(long item, long column) const;
wxTextCtrl* m_textCtrl; // The control used for editing a label
wxImageList * m_imageListNormal; // The image list for normal icons
wxImageList * m_imageListSmall; // The image list for small icons
wxImageList * m_imageListState; // The image list state icons (not implemented yet)
bool m_ownsImageListNormal,
m_ownsImageListSmall,
m_ownsImageListState;
int m_colCount; // Windows doesn't have GetColumnCount so must
// keep track of inserted/deleted columns
long m_count; // Keep track of item count to save calls to
// ListView_GetItemCount
// all wxMSWListItemData objects we use
wxVector<wxMSWListItemData *> m_internalData;
// true if we have any items with custom attributes
bool m_hasAnyAttr;
// these functions are only used for virtual list view controls, i.e. the
// ones with wxLC_VIRTUAL style
// return the text for the given column of the given item
virtual wxString OnGetItemText(long item, long column) const;
// return the icon for the given item. In report view, OnGetItemImage will
// only be called for the first column. See OnGetItemColumnImage for
// details.
virtual int OnGetItemImage(long item) const;
// return the icon for the given item and column.
virtual int OnGetItemColumnImage(long item, long column) const;
// return the attribute for the item (may return NULL if none)
virtual wxListItemAttr *OnGetItemAttr(long item) const;
// return the attribute for the given item and column (may return NULL if none)
virtual wxListItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const
{
return OnGetItemAttr(item);
}
private:
// process NM_CUSTOMDRAW notification message
WXLPARAM OnCustomDraw(WXLPARAM lParam);
// set the extended styles for the control (used by Create() and
// UpdateStyle()), only should be called if InReportView()
void MSWSetExListStyles();
// initialize the (already created) m_textCtrl with the associated HWND
void InitEditControl(WXHWND hWnd);
// destroy m_textCtrl if it's currently valid and reset it to NULL
void DeleteEditControl();
DECLARE_DYNAMIC_CLASS(wxListCtrl)
DECLARE_EVENT_TABLE()
wxDECLARE_NO_COPY_CLASS(wxListCtrl);
};
#endif // _WX_LISTCTRL_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

View File

@ -0,0 +1,269 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/mdi.h
// Purpose: MDI (Multiple Document Interface) classes
// Author: Julian Smart
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
// Created: 01/02/97
// RCS-ID: $Id: mdi.h 61986 2009-09-21 08:44:42Z VZ $
// Copyright: (c) 1997 Julian Smart
// (c) 2008 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_MDI_H_
#define _WX_MSW_MDI_H_
#include "wx/frame.h"
class WXDLLIMPEXP_FWD_CORE wxAcceleratorTable;
// ---------------------------------------------------------------------------
// wxMDIParentFrame
// ---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
{
public:
wxMDIParentFrame() { Init(); }
wxMDIParentFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr)
{
Init();
Create(parent, id, title, pos, size, style, name);
}
virtual ~wxMDIParentFrame();
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
// override/implement base class [pure] virtual methods
// ----------------------------------------------------
static bool IsTDI() { return false; }
// we don't store the active child in m_currentChild so override this
// function to find it dynamically
virtual wxMDIChildFrame *GetActiveChild() const;
virtual void Cascade();
virtual void Tile(wxOrientation orient = wxHORIZONTAL);
virtual void ArrangeIcons();
virtual void ActivateNext();
virtual void ActivatePrevious();
#if wxUSE_MENUS
virtual void SetWindowMenu(wxMenu* menu);
virtual void DoMenuUpdates(wxMenu* menu = NULL);
// return the active child menu, if any
virtual WXHMENU MSWGetActiveMenu() const;
#endif // wxUSE_MENUS
// implementation only from now on
// MDI helpers
// -----------
#if wxUSE_MENUS
// called by wxMDIChildFrame after it was successfully created
virtual void AddMDIChild(wxMDIChildFrame *child);
// called by wxMDIChildFrame just before it is destroyed
virtual void RemoveMDIChild(wxMDIChildFrame *child);
#endif // wxUSE_MENUS
// handlers
// --------
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
void OnSize(wxSizeEvent& event);
void OnIconized(wxIconizeEvent& event);
bool HandleActivate(int state, bool minimized, WXHWND activate);
// override window proc for MDI-specific message processing
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXLRESULT MSWDefWindowProc(WXUINT, WXWPARAM, WXLPARAM);
virtual bool MSWTranslateMessage(WXMSG* msg);
#if wxUSE_MENUS
// override wxFrameBase function to also look in the active child menu bar
// and the "Window" menu
virtual wxMenuItem *FindItemInMenuBar(int menuId) const;
#endif // wxUSE_MENUS
protected:
// override to pass menu/toolbar events to the active child first
virtual bool TryBefore(wxEvent& event);
#if wxUSE_MENUS_NATIVE
virtual void InternalSetMenuBar();
#endif // wxUSE_MENUS_NATIVE
virtual WXHICON GetDefaultIcon() const;
// set the size of the MDI client window to match the frame size
void UpdateClientSize();
private:
// common part of all ctors
void Init();
#if wxUSE_MENUS
// "Window" menu commands event handlers
void OnMDICommand(wxCommandEvent& event);
void OnMDIChild(wxCommandEvent& event);
// add/remove window menu if we have it (i.e. m_windowMenu != NULL)
void AddWindowMenu();
void RemoveWindowMenu();
// update the window menu (if we have it) to enable or disable the commands
// which only make sense when we have more than one child
void UpdateWindowMenu(bool enable);
#if wxUSE_ACCEL
wxAcceleratorTable *m_accelWindowMenu;
#endif // wxUSE_ACCEL
#endif // wxUSE_MENUS
// return the number of child frames we currently have (maybe 0)
int GetChildFramesCount() const;
friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
wxDECLARE_NO_COPY_CLASS(wxMDIParentFrame);
};
// ---------------------------------------------------------------------------
// wxMDIChildFrame
// ---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxMDIChildFrameBase
{
public:
wxMDIChildFrame() { Init(); }
wxMDIChildFrame(wxMDIParentFrame *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
{
Init();
Create(parent, id, title, pos, size, style, name);
}
bool Create(wxMDIParentFrame *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual ~wxMDIChildFrame();
// implement MDI operations
virtual void Activate();
// Override some frame operations too
virtual void Maximize(bool maximize = true);
virtual void Restore();
virtual bool Show(bool show = true);
// Implementation only from now on
// -------------------------------
// Handlers
bool HandleMDIActivate(long bActivate, WXHWND, WXHWND);
bool HandleWindowPosChanging(void *lpPos);
bool HandleGetMinMaxInfo(void *mmInfo);
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual WXLRESULT MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWTranslateMessage(WXMSG *msg);
virtual void MSWDestroyWindow();
bool ResetWindowStyle(void *vrect);
void OnIdle(wxIdleEvent& event);
protected:
virtual void DoGetScreenPosition(int *x, int *y) const;
virtual void DoGetPosition(int *x, int *y) const;
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
virtual void DoSetClientSize(int width, int height);
virtual void InternalSetMenuBar();
virtual bool IsMDIChild() const { return true; }
virtual void DetachMenuBar();
virtual WXHICON GetDefaultIcon() const;
// common part of all ctors
void Init();
private:
bool m_needsInitialShow; // Show must be called in idle time after Creation
bool m_needsResize; // flag which tells us to artificially resize the frame
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIChildFrame)
};
// ---------------------------------------------------------------------------
// wxMDIClientWindow
// ---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
{
public:
wxMDIClientWindow() { Init(); }
// Note: this is virtual, to allow overridden behaviour.
virtual bool CreateClient(wxMDIParentFrame *parent,
long style = wxVSCROLL | wxHSCROLL);
// Explicitly call default scroll behaviour
void OnScroll(wxScrollEvent& event);
protected:
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
void Init() { m_scrollX = m_scrollY = 0; }
int m_scrollX, m_scrollY;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIClientWindow)
};
#endif // _WX_MSW_MDI_H_

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,234 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/menu.h
// Purpose: wxMenu, wxMenuBar classes
// Author: Julian Smart
// Modified by: Vadim Zeitlin (wxMenuItem is now in separate file)
// Created: 01/02/97
// RCS-ID: $Id: menu.h 66178 2010-11-17 01:20:50Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MENU_H_
#define _WX_MENU_H_
#if wxUSE_ACCEL
#include "wx/accel.h"
#include "wx/dynarray.h"
WX_DEFINE_EXPORTED_ARRAY_PTR(wxAcceleratorEntry *, wxAcceleratorArray);
#endif // wxUSE_ACCEL
class WXDLLIMPEXP_FWD_CORE wxFrame;
#if defined(__WXWINCE__) && wxUSE_TOOLBAR
class WXDLLIMPEXP_FWD_CORE wxToolBar;
#endif
// Not using a combined wxToolBar/wxMenuBar? then use
// a commandbar in WinCE .NET to implement the
// menubar, since there is no ::SetMenu function.
#if defined(__WXWINCE__)
# if ((_WIN32_WCE >= 400) && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) || \
defined(__HANDHELDPC__)
# define WINCE_WITH_COMMANDBAR
# else
# define WINCE_WITHOUT_COMMANDBAR
# endif
#endif
#include "wx/arrstr.h"
// ----------------------------------------------------------------------------
// Menu
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase
{
public:
// ctors & dtor
wxMenu(const wxString& title, long style = 0)
: wxMenuBase(title, style) { Init(); }
wxMenu(long style = 0) : wxMenuBase(style) { Init(); }
virtual ~wxMenu();
virtual void Break();
virtual void SetTitle(const wxString& title);
// implementation only from now on
// -------------------------------
virtual void Attach(wxMenuBarBase *menubar);
bool MSWCommand(WXUINT param, WXWORD id);
// get the native menu handle
WXHMENU GetHMenu() const { return m_hMenu; }
#if wxUSE_ACCEL
// called by wxMenuBar to build its accel table from the accels of all menus
bool HasAccels() const { return !m_accels.empty(); }
size_t GetAccelCount() const { return m_accels.size(); }
size_t CopyAccels(wxAcceleratorEntry *accels) const;
// called by wxMenuItem when its accels changes
void UpdateAccel(wxMenuItem *item);
// helper used by wxMenu itself (returns the index in m_accels)
int FindAccel(int id) const;
// used only by wxMDIParentFrame currently but could be useful elsewhere:
// returns a new accelerator table with accelerators for just this menu
// (shouldn't be called if we don't have any accelerators)
wxAcceleratorTable *CreateAccelTable() const;
#endif // wxUSE_ACCEL
#if wxUSE_OWNER_DRAWN
int GetMaxAccelWidth()
{
if (m_maxAccelWidth == -1)
CalculateMaxAccelWidth();
return m_maxAccelWidth;
}
void ResetMaxAccelWidth()
{
m_maxAccelWidth = -1;
}
private:
void CalculateMaxAccelWidth();
#endif // wxUSE_OWNER_DRAWN
protected:
virtual wxMenuItem* DoAppend(wxMenuItem *item);
virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item);
virtual wxMenuItem* DoRemove(wxMenuItem *item);
private:
// common part of all ctors
void Init();
// common part of Append/Insert (behaves as Append is pos == (size_t)-1)
bool DoInsertOrAppend(wxMenuItem *item, size_t pos = (size_t)-1);
// terminate the current radio group, if any
void EndRadioGroup();
// if true, insert a breal before appending the next item
bool m_doBreak;
// the position of the first item in the current radio group or -1
int m_startRadioGroup;
// the menu handle of this menu
WXHMENU m_hMenu;
#if wxUSE_ACCEL
// the accelerators for our menu items
wxAcceleratorArray m_accels;
#endif // wxUSE_ACCEL
#if wxUSE_OWNER_DRAWN
// true if the menu has any ownerdrawn items
bool m_ownerDrawn;
// the max width of menu items bitmaps
int m_maxBitmapWidth;
// the max width of menu items accels
int m_maxAccelWidth;
#endif // wxUSE_OWNER_DRAWN
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenu)
};
// ----------------------------------------------------------------------------
// Menu Bar (a la Windows)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase
{
public:
// ctors & dtor
// default constructor
wxMenuBar();
// unused under MSW
wxMenuBar(long style);
// menubar takes ownership of the menus arrays but copies the titles
wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0);
virtual ~wxMenuBar();
// menubar construction
virtual bool Append( wxMenu *menu, const wxString &title );
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Remove(size_t pos);
virtual void EnableTop( size_t pos, bool flag );
virtual void SetMenuLabel( size_t pos, const wxString& label );
virtual wxString GetMenuLabel( size_t pos ) const;
// implementation from now on
WXHMENU Create();
virtual void Detach();
virtual void Attach(wxFrame *frame);
#if defined(__WXWINCE__) && wxUSE_TOOLBAR
// Under WinCE, a menubar is owned by the frame's toolbar
void SetToolBar(wxToolBar* toolBar) { m_toolBar = toolBar; }
wxToolBar* GetToolBar() const { return m_toolBar; }
#endif
#ifdef WINCE_WITH_COMMANDBAR
WXHWND GetCommandBar() const { return m_commandBar; }
bool AddAdornments(long style);
#endif
#if wxUSE_ACCEL
// update the accel table (must be called after adding/deleting a menu)
void RebuildAccelTable();
#endif // wxUSE_ACCEL
// get the menu handle
WXHMENU GetHMenu() const { return m_hMenu; }
// if the menubar is modified, the display is not updated automatically,
// call this function to update it (m_menuBarFrame should be !NULL)
void Refresh();
// To avoid compile warning
void Refresh( bool eraseBackground,
const wxRect *rect = (const wxRect *) NULL ) { wxWindow::Refresh(eraseBackground, rect); }
protected:
// common part of all ctors
void Init();
WXHMENU m_hMenu;
// Return the MSW position for a wxMenu which is sometimes different from
// the wxWidgets position.
int MSWPositionForWxMenu(wxMenu *menu, int wxpos);
#if defined(__WXWINCE__) && wxUSE_TOOLBAR
wxToolBar* m_toolBar;
#endif
#ifdef WINCE_WITH_COMMANDBAR
WXHWND m_commandBar;
bool m_adornmentsAdded;
#endif
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenuBar)
};
#endif // _WX_MENU_H_

View File

@ -0,0 +1,156 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/menuitem.h
// Purpose: wxMenuItem class
// Author: Vadim Zeitlin
// Modified by:
// Created: 11.11.97
// RCS-ID: $Id: menuitem.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _MENUITEM_H
#define _MENUITEM_H
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#include "wx/bitmap.h"
struct tagRECT;
#endif
// ----------------------------------------------------------------------------
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
#if wxUSE_OWNER_DRAWN
, public wxOwnerDrawn
#endif
{
public:
// ctor & dtor
wxMenuItem(wxMenu *parentMenu = NULL,
int id = wxID_SEPARATOR,
const wxString& name = wxEmptyString,
const wxString& help = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL,
wxMenu *subMenu = NULL);
virtual ~wxMenuItem();
// override base class virtuals
virtual void SetItemLabel(const wxString& strName);
virtual void Enable(bool bDoEnable = true);
virtual void Check(bool bDoCheck = true);
virtual bool IsChecked() const;
// unfortunately needed to resolve ambiguity between
// wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
bool IsCheckable() const { return wxMenuItemBase::IsCheckable(); }
// the id for a popup menu is really its menu handle (as required by
// ::AppendMenu() API), so this function will return either the id or the
// menu handle depending on what we are
//
// notice that it also returns the id as an unsigned int, as required by
// Win32 API
WXWPARAM GetMSWId() const;
// mark item as belonging to the given radio group
void SetAsRadioGroupStart();
void SetRadioGroupStart(int start);
void SetRadioGroupEnd(int end);
#if WXWIN_COMPATIBILITY_2_8
// compatibility only, don't use in new code
wxDEPRECATED(
wxMenuItem(wxMenu *parentMenu,
int id,
const wxString& text,
const wxString& help,
bool isCheckable,
wxMenu *subMenu = NULL)
);
#endif
#if wxUSE_OWNER_DRAWN
void SetBitmaps(const wxBitmap& bmpChecked,
const wxBitmap& bmpUnchecked = wxNullBitmap)
{
m_bmpChecked = bmpChecked;
m_bmpUnchecked = bmpUnchecked;
SetOwnerDrawn(true);
}
void SetBitmap(const wxBitmap& bmp, bool bChecked = true)
{
if ( bChecked )
m_bmpChecked = bmp;
else
m_bmpUnchecked = bmp;
SetOwnerDrawn(true);
}
void SetDisabledBitmap(const wxBitmap& bmpDisabled)
{
m_bmpDisabled = bmpDisabled;
SetOwnerDrawn(true);
}
const wxBitmap& GetBitmap(bool bChecked = true) const
{ return (bChecked ? m_bmpChecked : m_bmpUnchecked); }
const wxBitmap& GetDisabledBitmap() const
{ return m_bmpDisabled; }
int MeasureAccelWidth() const;
// override wxOwnerDrawn base class virtuals
virtual wxString GetName() const;
virtual bool OnMeasureItem(size_t *pwidth, size_t *pheight);
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
protected:
virtual void GetFontToUse(wxFont& font) const;
virtual void GetColourToUse(wxODStatus stat, wxColour& colText, wxColour& colBack) const;
private:
// helper function for draw std menu check mark
void DrawStdCheckMark(WXHDC hdc, const tagRECT* rc, wxODStatus stat);
#endif // wxUSE_OWNER_DRAWN
private:
// common part of all ctors
void Init();
// the positions of the first and last items of the radio group this item
// belongs to or -1: start is the radio group start and is valid for all
// but first radio group items (m_isRadioGroupStart == false), end is valid
// only for the first one
union
{
int start;
int end;
} m_radioGroup;
// does this item start a radio group?
bool m_isRadioGroupStart;
#if wxUSE_OWNER_DRAWN
// item bitmaps
wxBitmap m_bmpChecked, // bitmap to put near the item
m_bmpUnchecked, // (checked is used also for 'uncheckable' items)
m_bmpDisabled;
#endif // wxUSE_OWNER_DRAWN
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenuItem)
};
#endif //_MENUITEM_H

View File

@ -0,0 +1,190 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/metafile.h
// Purpose: wxMetaFile, wxMetaFileDC and wxMetaFileDataObject classes
// Author: Julian Smart
// Modified by: VZ 07.01.00: implemented wxMetaFileDataObject
// Created: 01/02/97
// RCS-ID: $Id: metafile.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_METAFIILE_H_
#define _WX_METAFIILE_H_
#include "wx/dc.h"
#include "wx/gdiobj.h"
#if wxUSE_DRAG_AND_DROP
#include "wx/dataobj.h"
#endif
// ----------------------------------------------------------------------------
// Metafile and metafile device context classes
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxMetafile;
class WXDLLIMPEXP_CORE wxMetafileRefData: public wxGDIRefData
{
public:
wxMetafileRefData();
virtual ~wxMetafileRefData();
virtual bool IsOk() const { return m_metafile != 0; }
public:
WXHANDLE m_metafile;
int m_windowsMappingMode;
int m_width, m_height;
friend class WXDLLIMPEXP_FWD_CORE wxMetafile;
};
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
class WXDLLIMPEXP_CORE wxMetafile: public wxGDIObject
{
public:
wxMetafile(const wxString& file = wxEmptyString);
virtual ~wxMetafile();
// After this is called, the metafile cannot be used for anything
// since it is now owned by the clipboard.
virtual bool SetClipboard(int width = 0, int height = 0);
virtual bool Play(wxDC *dc);
// set/get the size of metafile for clipboard operations
wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); }
int GetWidth() const { return M_METAFILEDATA->m_width; }
int GetHeight() const { return M_METAFILEDATA->m_height; }
void SetWidth(int width) { M_METAFILEDATA->m_width = width; }
void SetHeight(int height) { M_METAFILEDATA->m_height = height; }
// Implementation
WXHANDLE GetHMETAFILE() const { return M_METAFILEDATA->m_metafile; }
void SetHMETAFILE(WXHANDLE mf) ;
int GetWindowsMappingMode() const { return M_METAFILEDATA->m_windowsMappingMode; }
void SetWindowsMappingMode(int mm);
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
private:
DECLARE_DYNAMIC_CLASS(wxMetafile)
};
class WXDLLIMPEXP_CORE wxMetafileDCImpl: public wxMSWDCImpl
{
public:
wxMetafileDCImpl(wxDC *owner, const wxString& file = wxEmptyString);
wxMetafileDCImpl(wxDC *owner, const wxString& file,
int xext, int yext, int xorg, int yorg);
virtual ~wxMetafileDCImpl();
virtual wxMetafile *Close();
virtual void SetMapMode(wxMappingMode mode);
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const;
// Implementation
wxMetafile *GetMetaFile() const { return m_metaFile; }
void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; }
int GetWindowsMappingMode() const { return m_windowsMappingMode; }
void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; }
protected:
virtual void DoGetSize(int *width, int *height) const;
int m_windowsMappingMode;
wxMetafile* m_metaFile;
private:
DECLARE_CLASS(wxMetafileDCImpl)
wxDECLARE_NO_COPY_CLASS(wxMetafileDCImpl);
};
class WXDLLIMPEXP_CORE wxMetafileDC: public wxDC
{
public:
// Don't supply origin and extent
// Supply them to wxMakeMetaFilePlaceable instead.
wxMetafileDC(const wxString& file)
: wxDC(new wxMetafileDCImpl( this, file ))
{ }
// Supply origin and extent (recommended).
// Then don't need to supply them to wxMakeMetaFilePlaceable.
wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg)
: wxDC(new wxMetafileDCImpl( this, file, xext, yext, xorg, yorg ))
{ }
wxMetafile *GetMetafile() const
{ return ((wxMetafileDCImpl*)m_pimpl)->GetMetaFile(); }
wxMetafile *Close()
{ return ((wxMetafileDCImpl*)m_pimpl)->Close(); }
private:
DECLARE_CLASS(wxMetafileDC)
wxDECLARE_NO_COPY_CLASS(wxMetafileDC);
};
/*
* Pass filename of existing non-placeable metafile, and bounding box.
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
* and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
*
*/
// No origin or extent
bool WXDLLIMPEXP_CORE wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0);
// Optional origin and extent
bool WXDLLIMPEXP_CORE wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = true);
// ----------------------------------------------------------------------------
// wxMetafileDataObject is a specialization of wxDataObject for metafile data
// ----------------------------------------------------------------------------
#if wxUSE_DRAG_AND_DROP
class WXDLLIMPEXP_CORE wxMetafileDataObject : public wxDataObjectSimple
{
public:
// ctors
wxMetafileDataObject() : wxDataObjectSimple(wxDF_METAFILE)
{ }
wxMetafileDataObject(const wxMetafile& metafile)
: wxDataObjectSimple(wxDF_METAFILE), m_metafile(metafile) { }
// virtual functions which you may override if you want to provide data on
// demand only - otherwise, the trivial default versions will be used
virtual void SetMetafile(const wxMetafile& metafile)
{ m_metafile = metafile; }
virtual wxMetafile GetMetafile() const
{ return m_metafile; }
// implement base class pure virtuals
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
protected:
wxMetafile m_metafile;
};
#endif // wxUSE_DRAG_AND_DROP
#endif
// _WX_METAFIILE_H_

View File

@ -0,0 +1,235 @@
/*
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/microwin.h
// Purpose: Extra implementation for MicroWindows
// Author: Julian Smart
// Created: 2001-05-31
// RCS-ID: $Id: microwin.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
*/
#ifndef _WX_MICROWIN_H_
#define _WX_MICROWIN_H_
/* Implemented by microwin.cpp */
#ifdef __cplusplus
extern "C" {
#endif
BOOL SetCursorPos(int x, int y);
HCURSOR SetCursor(HCURSOR hCursor);
/* Implemented with wrong number of args by MicroWindows */
/* so we need to use a different name */
int GetScrollPosWX (HWND hWnd, int iSBar);
BOOL ScrollWindow(HWND, int xAmount, int yAmount,
CONST RECT* lpRect, CONST RECT* lpClipRect);
HWND WindowFromPoint(POINT pt);
SHORT GetKeyState(int nVirtKey);
HWND SetParent(HWND hWndChild, HWND hWndNewParent);
VOID DragAcceptFiles(HWND, BOOL);
BOOL IsDialogMessage(HWND hWnd, MSG* msg);
DWORD GetMessagePos(VOID);
BOOL IsIconic(HWND hWnd);
int SetMapMode(HDC hDC, int mode);
int GetMapMode(HDC hDC);
HCURSOR LoadCursor(HINSTANCE hInst, int cursor);
DWORD GetModuleFileName(HINSTANCE hInst, LPSTR name, DWORD sz);
VOID DestroyIcon(HICON hIcon);
COLORREF GetTextColor(HDC hdc);
COLORREF GetBkColor(HDC hdc);
HPALETTE SelectPalette(HDC hdc, HPALETTE hPalette, BOOL b);
BOOL IntersectClipRect(HDC hdc, int x, int y,
int w, int h);
BOOL GetClipBox(HDC hdc, RECT* rect);
BOOL DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int w, int h, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
BOOL SetViewportExtEx(HDC hdc, int x, int y, LPSIZE lpSize);
BOOL SetViewportOrgEx(HDC hdc, int x, int y, LPPOINT lpPoint);
BOOL SetWindowExtEx(HDC hdc, int x, int y, LPSIZE lpSize);
BOOL SetWindowOrgEx(HDC hdc, int x, int y, LPPOINT lpSize);
BOOL ExtFloodFill(HDC hdc, int x, int y, COLORREF col, UINT flags);
int SetPolyFillMode(HDC hdc, int mode);
BOOL RoundRect(HDC hdc, int left, int top, int right, int bottom, int r1, int r2);
BOOL MaskBlt(HDC hdc, int x, int y, int w, int h,
HDC hDCSource, int xSrc, int ySrc, HBITMAP hBitmapMask, int xMask, int yMask, DWORD rop);
UINT RealizePalette(HDC hDC);
BOOL SetBrushOrgEx(HDC hdc, int xOrigin, int yOrigin, LPPOINT lpPoint);
int GetObject(HGDIOBJ hObj, int sz, LPVOID logObj);
/* For some reason these aren't defined in the headers */
BOOL EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable) ;
BOOL GetScrollPos (HWND hWnd, int iSBar, int* pPos);
BOOL GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos);
BOOL SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
BOOL SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos);
BOOL SetScrollInfo (HWND hWnd, int iSBar,
LPCSCROLLINFO lpsi, BOOL fRedraw);
BOOL GetScrollInfo(HWND hWnd, int iSBar, LPSCROLLINFO lpsi);
BOOL ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
HBITMAP WINAPI
CreateBitmap( int width, int height, int nPlanes, int bPP, LPCVOID lpData);
#ifdef __cplusplus
}
#endif
/*
* Key State Masks for Mouse Messages
*/
#ifndef MK_LBUTTON
#define MK_LBUTTON 0x0001
#define MK_RBUTTON 0x0002
#define MK_SHIFT 0x0004
#define MK_CONTROL 0x0008
#define MK_MBUTTON 0x0010
#endif
/*
* DrawIcon flags
*/
#ifndef DI_MASK
#define DI_MASK 0x0001
#define DI_IMAGE 0x0002
#define DI_NORMAL 0x0003
#define DI_COMPAT 0x0004
#define DI_DEFAULTSIZE 0x0008
#endif
/* TODO: May have to fake these message */
#ifndef WM_INITDIALOG
#define WM_INITDIALOG 0x0110
#endif
#ifndef WM_QUERYENDSESSION
#define WM_QUERYENDSESSION 0x0011
#endif
#ifndef WM_ENDSESSION
#define WM_ENDSESSION 0x0016
#endif
#ifndef WM_SETCURSOR
#define WM_SETCURSOR 0x0020
#endif
#ifndef WM_GETMINMAXINFO
#define WM_GETMINMAXINFO 0x0024
typedef struct tagMINMAXINFO {
POINT ptReserved;
POINT ptMaxSize;
POINT ptMaxPosition;
POINT ptMinTrackSize;
POINT ptMaxTrackSize;
} MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;
#endif
#ifndef WM_SYSCOMMAND
#define WM_SYSCOMMAND 0x0112
#endif
#ifndef WM_SYSCOLORCHANGE
#define WM_SYSCOLORCHANGE 0x0015
#endif
#ifndef WM_QUERYNEWPALETTE
#define WM_QUERYNEWPALETTE 0x030F
#endif
#ifndef WM_PALETTEISCHANGING
#define WM_PALETTEISCHANGING 0x0310
#endif
#ifndef WM_PALETTECHANGED
#define WM_PALETTECHANGED 0x0311
#endif
#ifndef WM_NOTIFY
#define WM_NOTIFY 0x004E
#endif
#ifndef WM_DROPFILES
#define WM_DROPFILES 0x0233
#endif
#ifndef PALETTERGB
#define PALETTERGB RGB
#endif
#ifndef MM_TEXT
#define MM_TEXT 1
#define MM_LOMETRIC 2
#define MM_HIMETRIC 3
#define MM_LOENGLISH 4
#define MM_HIENGLISH 5
#define MM_TWIPS 6
#define MM_ISOTROPIC 7
#define MM_ANISOTROPIC 8
#endif
#ifndef SC_MAXIMIZE
#define SC_MINIMIZE 0xF020
#define SC_MAXIMIZE 0xF030
#endif
// TODO: all of them
#ifndef IDC_ARROW
#define IDC_ARROW 1
#endif
/*
* Standard Cursor IDs
*/
#ifndef MAKEINTRESOURCE
#define MAKEINTRESOURCE(r) r
#endif
#ifndef IDC_ARROW
#define IDC_ARROW MAKEINTRESOURCE(32512)
#define IDC_IBEAM MAKEINTRESOURCE(32513)
#define IDC_WAIT MAKEINTRESOURCE(32514)
#define IDC_CROSS MAKEINTRESOURCE(32515)
#define IDC_UPARROW MAKEINTRESOURCE(32516)
#define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
#define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
#define IDC_SIZENWSE MAKEINTRESOURCE(32642)
#define IDC_SIZENESW MAKEINTRESOURCE(32643)
#define IDC_SIZEWE MAKEINTRESOURCE(32644)
#define IDC_SIZENS MAKEINTRESOURCE(32645)
#define IDC_SIZEALL MAKEINTRESOURCE(32646)
#define IDC_NO MAKEINTRESOURCE(32648) /* not in win3.1 */
#if(WINVER >= 0x0500)
#define IDC_HAND MAKEINTRESOURCE(32649)
#endif /* WINVER >= 0x0500 */
#define IDC_APPSTARTING MAKEINTRESOURCE(32650) /* not in win3.1 */
#if(WINVER >= 0x0400)
#define IDC_HELP MAKEINTRESOURCE(32651)
#endif /* WINVER >= 0x0400 */
#endif
/* ExtFloodFill style flags */
#define FLOODFILLBORDER 0
#define FLOODFILLSURFACE 1
/* PolyFill() Modes */
#define ALTERNATE 1
#define WINDING 2
#define POLYFILL_LAST 2
/* Quaternary raster codes */
#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
/* Device Parameters for GetDeviceCaps() */
#define DRIVERVERSION 0 /* Device driver version */
#define TECHNOLOGY 2 /* Device classification */
#define HORZSIZE 4 /* Horizontal size in millimeters */
#define VERTSIZE 6 /* Vertical size in millimeters */
/* Ternary raster operations */
/* Now defined by MicroWindows */
#if 0
#define DSTINVERT (DWORD)0x00550009 /* dest = (NOT dest) */
#define WHITENESS (DWORD)0x00FF0062 /* dest = WHITE */
#define SRCERASE (DWORD)0x00440328 /* dest = source AND (NOT dest ) */
#define MERGEPAINT (DWORD)0x00BB0226 /* dest = (NOT source) OR dest */
#define SRCPAINT (DWORD)0x00EE0086 /* dest = source OR dest */
#define NOTSRCCOPY (DWORD)0x00330008 /* dest = (NOT source) */
#endif
#endif /* _WX_MICROWIN_H_ */

View File

@ -0,0 +1,116 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/mimetype.h
// Purpose: classes and functions to manage MIME types
// Author: Vadim Zeitlin
// Modified by:
// Created: 23.09.98
// RCS-ID: $Id: mimetype.h 54434 2008-06-30 11:58:41Z RR $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence (part of wxExtra library)
/////////////////////////////////////////////////////////////////////////////
#ifndef _MIMETYPE_IMPL_H
#define _MIMETYPE_IMPL_H
#include "wx/defs.h"
#if wxUSE_MIMETYPE
#include "wx/mimetype.h"
// ----------------------------------------------------------------------------
// wxFileTypeImpl is the MSW version of wxFileType, this is a private class
// and is never used directly by the application
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxFileTypeImpl
{
public:
// ctor
wxFileTypeImpl() { }
// one of these Init() function must be called (ctor can't take any
// arguments because it's common)
// initialize us with our file type name and extension - in this case
// we will read all other data from the registry
void Init(const wxString& strFileType, const wxString& ext);
// implement accessor functions
bool GetExtensions(wxArrayString& extensions);
bool GetMimeType(wxString *mimeType) const;
bool GetMimeTypes(wxArrayString& mimeTypes) const;
bool GetIcon(wxIconLocation *iconLoc) const;
bool GetDescription(wxString *desc) const;
bool GetOpenCommand(wxString *openCmd,
const wxFileType::MessageParameters& params) const;
bool GetPrintCommand(wxString *printCmd,
const wxFileType::MessageParameters& params) const;
size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands,
const wxFileType::MessageParameters& params) const;
bool Unassociate();
// set an arbitrary command, ask confirmation if it already exists and
// overwriteprompt is true
bool SetCommand(const wxString& cmd,
const wxString& verb,
bool overwriteprompt = true);
bool SetDefaultIcon(const wxString& cmd = wxEmptyString, int index = 0);
// this is called by Associate
bool SetDescription (const wxString& desc);
private:
// helper function: reads the command corresponding to the specified verb
// from the registry (returns an empty string if not found)
wxString GetCommand(const wxString& verb) const;
// get the registry path for the given verb
wxString GetVerbPath(const wxString& verb) const;
// check that the registry key for our extension exists, create it if it
// doesn't, return false if this failed
bool EnsureExtKeyExists();
wxString m_strFileType, // may be empty
m_ext;
// these methods are not publicly accessible (as wxMimeTypesManager
// doesn't know about them), and should only be called by Unassociate
bool RemoveOpenCommand();
bool RemoveCommand(const wxString& verb);
bool RemoveMimeType();
bool RemoveDefaultIcon();
bool RemoveDescription();
};
class WXDLLIMPEXP_BASE wxMimeTypesManagerImpl
{
public:
// nothing to do here, we don't load any data but just go and fetch it from
// the registry when asked for
wxMimeTypesManagerImpl() { }
// implement containing class functions
wxFileType *GetFileTypeFromExtension(const wxString& ext);
wxFileType *GetOrAllocateFileTypeFromExtension(const wxString& ext);
wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
size_t EnumAllFileTypes(wxArrayString& mimetypes);
// create a new filetype association
wxFileType *Associate(const wxFileTypeInfo& ftInfo);
// create a new filetype with the given name and extension
wxFileType *CreateFileType(const wxString& filetype, const wxString& ext);
};
#endif // wxUSE_MIMETYPE
#endif
//_MIMETYPE_IMPL_H

View File

@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/minifram.h
// Purpose: wxMiniFrame class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: minifram.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MINIFRAM_H_
#define _WX_MINIFRAM_H_
#include "wx/frame.h"
class WXDLLIMPEXP_CORE wxMiniFrame : public wxFrame
{
public:
wxMiniFrame() { }
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER,
const wxString& name = wxFrameNameStr)
{
return wxFrame::Create(parent, id, title, pos, size,
style |
wxFRAME_TOOL_WINDOW |
(parent ? wxFRAME_FLOAT_ON_PARENT : 0), name);
}
wxMiniFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER,
const wxString& name = wxFrameNameStr)
{
Create(parent, id, title, pos, size, style, name);
}
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMiniFrame)
};
#endif
// _WX_MINIFRAM_H_

View File

@ -0,0 +1,545 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/missing.h
// Purpose: Declarations for parts of the Win32 SDK that are missing in
// the versions that come with some compilers
// Created: 2002/04/23
// RCS-ID: $Id: missing.h 66996 2011-02-22 13:26:06Z VZ $
// Copyright: (c) 2002 Mattia Barbon
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MISSING_H_
#define _WX_MISSING_H_
/*
* The following are required for VC++ 6.
*/
// Needed by cursor.cpp
#ifndef IDC_HAND
#define IDC_HAND MAKEINTRESOURCE(32649)
#endif
// Needed by strconv.cpp
#ifndef WC_NO_BEST_FIT_CHARS
#define WC_NO_BEST_FIT_CHARS 0x400
#endif
#ifndef WM_CONTEXTMENU
#define WM_CONTEXTMENU 0x007B
#endif
#ifndef WM_CHANGEUISTATE
#define WM_CHANGEUISTATE 0x0127
#endif
#ifndef WM_UPDATEUISTATE
#define WM_UPDATEUISTATE 0x0128
#endif
#ifndef WM_QUERYUISTATE
#define WM_QUERYUISTATE 0x0129
#endif
#ifndef WM_PRINTCLIENT
#define WM_PRINTCLIENT 0x318
#endif
#ifndef DT_HIDEPREFIX
#define DT_HIDEPREFIX 0x00100000
#endif
// Needed by toplevel.cpp
#ifndef UIS_SET
#define UIS_SET 1
#define UIS_CLEAR 2
#define UIS_INITIALIZE 3
#endif
#ifndef UISF_HIDEFOCUS
#define UISF_HIDEFOCUS 1
#endif
#ifndef UISF_HIDEACCEL
#define UISF_HIDEACCEL 2
#endif
#ifndef OFN_EXPLORER
#define OFN_EXPLORER 0x00080000
#endif
#ifndef OFN_ENABLESIZING
#define OFN_ENABLESIZING 0x00800000
#endif
// Needed by window.cpp
#if wxUSE_MOUSEWHEEL
#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL 0x020A
#endif
#ifndef WHEEL_DELTA
#define WHEEL_DELTA 120
#endif
#ifndef SPI_GETWHEELSCROLLLINES
#define SPI_GETWHEELSCROLLLINES 104
#endif
#endif // wxUSE_MOUSEWHEEL
// Needed by window.cpp
#ifndef VK_OEM_1
#define VK_OEM_1 0xBA
#define VK_OEM_2 0xBF
#define VK_OEM_3 0xC0
#define VK_OEM_4 0xDB
#define VK_OEM_5 0xDC
#define VK_OEM_6 0xDD
#define VK_OEM_7 0xDE
#endif
#ifndef VK_OEM_COMMA
#define VK_OEM_PLUS 0xBB
#define VK_OEM_COMMA 0xBC
#define VK_OEM_MINUS 0xBD
#define VK_OEM_PERIOD 0xBE
#endif
#ifndef SM_TABLETPC
#define SM_TABLETPC 86
#endif
#ifndef INKEDIT_CLASS
# define INKEDIT_CLASSW L"INKEDIT"
# ifdef UNICODE
# define INKEDIT_CLASS INKEDIT_CLASSW
# else
# define INKEDIT_CLASS "INKEDIT"
# endif
#endif
#ifndef EM_SETINKINSERTMODE
# define EM_SETINKINSERTMODE (WM_USER + 0x0204)
#endif
#ifndef EM_SETUSEMOUSEFORINPUT
#define EM_SETUSEMOUSEFORINPUT (WM_USER + 0x224)
#endif
#ifndef TPM_RECURSE
#define TPM_RECURSE 1
#endif
#ifndef WS_EX_LAYOUTRTL
#define WS_EX_LAYOUTRTL 0x00400000
#endif
#ifndef WS_EX_COMPOSITED
#define WS_EX_COMPOSITED 0x02000000L
#endif
#ifndef WS_EX_LAYERED
#define WS_EX_LAYERED 0x00080000
#endif
#ifndef LWA_ALPHA
#define LWA_ALPHA 2
#endif
#ifndef QS_ALLPOSTMESSAGE
#define QS_ALLPOSTMESSAGE 0
#endif
/*
* The following are required for VC++ 5 when the PSDK is not available.
*/
#if defined __VISUALC__ && __VISUALC__ <= 1100
#ifndef VER_NT_WORKSTATION
typedef struct _OSVERSIONINFOEXA {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
typedef struct _OSVERSIONINFOEXW {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW;
#ifdef UNICODE
typedef OSVERSIONINFOW OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO;
typedef OSVERSIONINFOEXW OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX;
#else
typedef OSVERSIONINFOA OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO;
typedef OSVERSIONINFOEXA OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX;
#endif
#endif // defined VER_NT_WORKSTATION
#ifndef CP_SYMBOL
#define CP_SYMBOL 42
#endif
// NMLVCUSTOMDRAW originally didn't have the iSubItem member. It was added
// with IE4, as was IPN_FIRST which is used as a test :-(.
//
#ifndef IPN_FIRST
typedef struct wxtagNMLVCUSTOMDRAW_ {
NMCUSTOMDRAW nmcd;
COLORREF clrText;
COLORREF clrTextBk;
int iSubItem;
} wxNMLVCUSTOMDRAW_, *wxLPNMLVCUSTOMDRAW_;
#define NMLVCUSTOMDRAW wxNMLVCUSTOMDRAW_
#define LPNMLVCUSTOMDRAW wxLPNMLVCUSTOMDRAW_
#endif // defined IPN_FIRST
#endif // defined __VISUALC__ && __VISUALC__ <= 1100
// ----------------------------------------------------------------------------
// menu stuff
// ----------------------------------------------------------------------------
#ifndef MIIM_BITMAP
#define MIIM_STRING 0x00000040
#define MIIM_BITMAP 0x00000080
#define MIIM_FTYPE 0x00000100
#define HBMMENU_CALLBACK ((HBITMAP) -1)
typedef struct tagMENUINFO
{
DWORD cbSize;
DWORD fMask;
DWORD dwStyle;
UINT cyMax;
HBRUSH hbrBack;
DWORD dwContextHelpID;
DWORD dwMenuData;
} MENUINFO, FAR *LPMENUINFO;
#endif // MIIM_BITMAP &c
// ----------------------------------------------------------------------------
// definitions related to ListView and Header common controls, needed by
// msw/listctrl.cpp and msw/headerctrl.cpp
// ----------------------------------------------------------------------------
#ifndef I_IMAGENONE
#define I_IMAGENONE (-2)
#endif
#ifndef LVS_EX_FULLROWSELECT
#define LVS_EX_FULLROWSELECT 0x00000020
#endif
// LVS_EX_LABELTIP is not supported by Windows CE, don't define it there
#if !defined(LVS_EX_LABELTIP) && !defined(__WXWINCE__)
#define LVS_EX_LABELTIP 0x00004000
#endif
#ifndef LVS_EX_SUBITEMIMAGES
#define LVS_EX_SUBITEMIMAGES 0x00000002
#endif
#ifndef HDN_GETDISPINFOW
#define HDN_GETDISPINFOW (HDN_FIRST-29)
#endif
#ifndef HDS_HOTTRACK
#define HDS_HOTTRACK 4
#endif
#ifndef HDS_FLAT
#define HDS_FLAT 0x0200
#endif
#ifndef HDF_SORTUP
#define HDF_SORTUP 0x0400
#define HDF_SORTDOWN 0x0200
#endif
/*
* In addition to the above, the following are required for several compilers.
*/
#if !defined(CCS_VERT)
#define CCS_VERT 0x00000080L
#endif
#if !defined(CCS_RIGHT)
#define CCS_RIGHT (CCS_VERT|CCS_BOTTOM)
#endif
#if !defined(TB_SETDISABLEDIMAGELIST)
#define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
#endif // !defined(TB_SETDISABLEDIMAGELIST)
#ifndef CFM_BACKCOLOR
#define CFM_BACKCOLOR 0x04000000
#endif
#ifndef HANGUL_CHARSET
#define HANGUL_CHARSET 129
#endif
#ifndef CCM_SETUNICODEFORMAT
#define CCM_SETUNICODEFORMAT 8197
#endif
// ----------------------------------------------------------------------------
// Tree control
// ----------------------------------------------------------------------------
#ifndef TV_FIRST
#define TV_FIRST 0x1100
#endif
#ifndef TVS_FULLROWSELECT
#define TVS_FULLROWSELECT 0x1000
#endif
#ifndef TVM_SETBKCOLOR
#define TVM_SETBKCOLOR (TV_FIRST + 29)
#define TVM_SETTEXTCOLOR (TV_FIRST + 30)
#endif
/*
* The following are required for BC++ 5.5 (none at present.)
*/
/*
* The following are specifically required for Digital Mars C++
*/
#ifdef __DMC__
#ifndef VER_NT_WORKSTATION
typedef struct _OSVERSIONINFOEX {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
TCHAR szCSDVersion[ 128 ];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEX;
#endif // !defined(VER_NT_WORKSTATION)
#ifndef _TrackMouseEvent
#define _TrackMouseEvent TrackMouseEvent
#endif
#ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
#define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
#endif
#ifndef LVM_GETSUBITEMRECT
#define LVM_GETSUBITEMRECT (0x1000 + 56)
#endif
#ifndef LVCF_IMAGE
#define LVCF_IMAGE 0x0010
#endif
#ifndef Header_GetItemRect
#define Header_GetItemRect(w,i,r) \
(BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r))
#endif
#ifndef HDM_GETITEMRECT
#define HDM_GETITEMRECT (HDM_FIRST+7)
#endif
#ifndef ListView_GetHeader
#define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0)
#endif
#ifndef ListView_GetSubItemRect
#define ListView_GetSubItemRect(w, i, s, c, p) (HWND)SendMessage(w,LVM_GETSUBITEMRECT,i, ((p) ? ((((LPRECT)(p))->top = s), (((LPRECT)(p))->left = c), (LPARAM)(p)) : (LPARAM)(LPRECT)NULL))
#endif
#ifndef LVM_GETHEADER
#define LVM_GETHEADER (LVM_FIRST+31)
#endif
#ifndef HDLAYOUT
#define HDLAYOUT HD_LAYOUT
#endif
#ifndef HDITEM
#define HDITEM HD_ITEM
#endif
#ifndef NMHEADER
#define NMHEADER HD_NOTIFY
#endif
#ifndef HDS_DRAGDROP
#define HDS_DRAGDROP 0x0040
#endif
#ifndef HDS_FULLDRAG
#define HDS_FULLDRAG 0x0080
#endif
#ifndef HDN_BEGINDRAG
#define HDN_BEGINDRAG (HDN_FIRST - 11)
#endif
#ifndef HDN_ENDDRAG
#define HDN_ENDDRAG (HDN_FIRST - 10)
#endif
#ifndef LVSICF_NOSCROLL
#define LVSICF_NOINVALIDATEALL 0x0001
#define LVSICF_NOSCROLL 0x0002
#endif
#ifndef CP_SYMBOL
#define CP_SYMBOL 42
#endif
// ----------------------------------------------------------------------------
// wxDisplay
// ----------------------------------------------------------------------------
// The windows headers with Digital Mars lack some typedefs.
// typedef them as my_XXX and then #define to rename to XXX in case
// a newer version of Digital Mars fixes the headers
// (or up to date PSDK is in use with older version)
// also we use any required definition (MONITOR_DEFAULTTONULL) to recognize
// whether whole missing block needs to be included
#ifndef MONITOR_DEFAULTTONULL
#define HMONITOR_DECLARED
DECLARE_HANDLE(HMONITOR);
typedef BOOL(CALLBACK* my_MONITORENUMPROC)(HMONITOR,HDC,LPRECT,LPARAM);
#define MONITORENUMPROC my_MONITORENUMPROC
typedef struct my_tagMONITORINFO {
DWORD cbSize;
RECT rcMonitor;
RECT rcWork;
DWORD dwFlags;
} my_MONITORINFO,*my_LPMONITORINFO;
#define MONITORINFO my_MONITORINFO
#define LPMONITORINFO my_LPMONITORINFO
typedef struct my_MONITORINFOEX : public my_tagMONITORINFO
{
TCHAR szDevice[CCHDEVICENAME];
} my_MONITORINFOEX, *my_LPMONITORINFOEX;
#define MONITORINFOEX my_MONITORINFOEX
#define LPMONITORINFOEX my_LPMONITORINFOEX
#ifndef MONITOR_DEFAULTTONULL
#define MONITOR_DEFAULTTONULL 0
#endif // MONITOR_DEFAULTTONULL
#ifndef MONITORINFOF_PRIMARY
#define MONITORINFOF_PRIMARY 1
#endif // MONITORINFOF_PRIMARY
#ifndef DDENUM_ATTACHEDSECONDARYDEVICES
#define DDENUM_ATTACHEDSECONDARYDEVICES 1
#endif
#endif // MONITOR_DEFAULTTONULL
// ----------------------------------------------------------------------------
// Tree control
// ----------------------------------------------------------------------------
#ifndef TVIS_FOCUSED
#define TVIS_FOCUSED 0x0001
#endif
#ifndef TVS_CHECKBOXES
#define TVS_CHECKBOXES 0x0100
#endif
#ifndef TVITEM
#define TVITEM TV_ITEM
#endif
#endif
// DMC++
/*
* The following are specifically required for OpenWatcom C++ (none at present)
*/
#if defined(__WATCOMC__)
#endif
/*
* The following are specifically required for MinGW (none at present)
*/
#if defined (__MINGW32__)
#if !wxCHECK_W32API_VERSION(3,1)
#include <windows.h>
#include "wx/msw/winundef.h"
typedef struct
{
RECT rgrc[3];
WINDOWPOS *lppos;
} NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS;
#endif
#endif
/*
* In addition to the declarations for VC++, the following are required for WinCE
*/
#ifdef __WXWINCE__
#include "wx/msw/wince/missing.h"
#endif
/*
* The following are specifically required for Wine
*/
#ifdef __WINE__
#ifndef ENUM_CURRENT_SETTINGS
#define ENUM_CURRENT_SETTINGS ((DWORD)-1)
#endif
#ifndef BROADCAST_QUERY_DENY
#define BROADCAST_QUERY_DENY 1112363332
#endif
#endif // defined __WINE__
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif
#endif
// _WX_MISSING_H_

View File

@ -0,0 +1,73 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/msgdlg.h
// Purpose: wxMessageDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: msgdlg.h 66237 2010-11-22 12:49:07Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSGBOXDLG_H_
#define _WX_MSGBOXDLG_H_
class WXDLLIMPEXP_CORE wxMessageDialog : public wxMessageDialogBase
{
public:
wxMessageDialog(wxWindow *parent,
const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK|wxCENTRE,
const wxPoint& WXUNUSED(pos) = wxDefaultPosition)
: wxMessageDialogBase(parent, message, caption, style)
{
m_hook = NULL;
}
virtual int ShowModal();
// implementation-specific
// return the font used for the text in the message box
static wxFont GetMessageFont();
protected:
// Override this as task dialogs are always centered on parent.
virtual void DoCentre(int dir);
private:
// hook procedure used to adjust the message box beyond what the standard
// MessageBox() function can do for us
static WXLRESULT wxCALLBACK HookFunction(int code, WXWPARAM, WXLPARAM);
static const struct ButtonAccessors
{
int id;
wxString (wxMessageDialog::*getter)() const;
} ms_buttons[];
// replace the static text control with a text control in order to show
// scrollbar (and also, incidentally, allow text selection)
void ReplaceStaticWithEdit();
// adjust the button labels
//
// this is called from HookFunction() and our HWND is valid at this moment
void AdjustButtonLabels();
// offset all buttons starting from the first one given by dx to the right
void OffsetButtonsStartingFrom(int first, int dx);
// used by ShowModal() to display a message box when task dialogs
// aren't available.
int ShowMessageBox();
WXHANDLE m_hook; // HHOOK used to position the message box
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMessageDialog);
};
#endif // _WX_MSGBOXDLG_H_

View File

@ -0,0 +1,23 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/mslu.h
// Purpose: MSLU-related declarations
// Author: Vaclav Slavik
// Modified by: Vadim Zeitlin to move out various functions to other files
// to fix header inter-dependencies
// Created: 2002/02/17
// RCS-ID: $Id: mslu.h 42462 2006-10-26 19:06:51Z VZ $
// Copyright: (c) 2002 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSLU_H_
#define _WX_MSLU_H_
#include "wx/defs.h"
// Returns true if we are running under Unicode emulation in Win9x environment.
// Workaround hacks take effect only if this condition is met
// (NB: this function is needed even if !wxUSE_UNICODE_MSLU)
WXDLLIMPEXP_BASE bool wxUsingUnicowsDll();
#endif // _WX_MSLU_H_

View File

@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/msvcrt.h
// Purpose: macros to use some non-standard features of MS Visual C++
// C run-time library
// Author: Vadim Zeitlin
// Modified by:
// Created: 31.01.1999
// RCS-ID: $Id: msvcrt.h 59725 2009-03-22 12:53:48Z VZ $
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// the goal of this file is to define wxCrtSetDbgFlag() macro which may be
// used like this:
// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
// to turn on memory leak checks for programs compiled with Microsoft Visual
// C++ (5.0+). The macro will not be defined under other compilers or if it
// can't be used with MSVC for whatever reason.
#ifndef _MSW_MSVCRT_H_
#define _MSW_MSVCRT_H_
// use debug CRT functions for memory leak detections in VC++ 5.0+ in debug
// builds
#undef wxUSE_VC_CRTDBG
#if defined(_DEBUG) && defined(__VISUALC__) && (__VISUALC__ >= 1000) \
&& !defined(UNDER_CE)
// it doesn't combine well with wxWin own memory debugging methods
#if !wxUSE_GLOBAL_MEMORY_OPERATORS && !wxUSE_MEMORY_TRACING && !defined(__NO_VC_CRTDBG__)
#define wxUSE_VC_CRTDBG
#endif
#endif
#ifdef wxUSE_VC_CRTDBG
// Need to undef new if including crtdbg.h which may redefine new itself
#ifdef new
#undef new
#endif
#include <stdlib.h>
#ifndef _CRTBLD
// Needed when building with pure MS SDK
#define _CRTBLD
#endif
#include <crtdbg.h>
#undef WXDEBUG_NEW
#define WXDEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
// this define works around a bug with inline declarations of new, see
//
// http://support.microsoft.com/kb/q140858/
//
// for the details
#define new WXDEBUG_NEW
#define wxCrtSetDbgFlag(flag) \
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | (flag))
#else // !using VC CRT
#define wxCrtSetDbgFlag(flag)
#endif // wxUSE_VC_CRTDBG
#endif // _MSW_MSVCRT_H_

View File

@ -0,0 +1,211 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/notebook.h
// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
// Author: Robert Roebling
// Modified by: Vadim Zeitlin for Windows version
// RCS-ID: $Id: notebook.h 67250 2011-03-20 00:00:29Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _NOTEBOOK_H
#define _NOTEBOOK_H
#if wxUSE_NOTEBOOK
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/control.h"
// ----------------------------------------------------------------------------
// wxNotebook
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase
{
public:
// ctors
// -----
// default for dynamic class
wxNotebook();
// the same arguments as for wxControl (@@@ any special styles?)
wxNotebook(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
// Create() function
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNotebookNameStr);
virtual ~wxNotebook();
// accessors
// ---------
// get number of pages in the dialog
virtual size_t GetPageCount() const;
// set the currently selected page, return the index of the previously
// selected one (or wxNOT_FOUND on error)
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
int SetSelection(size_t nPage);
// changes selected page without sending events
int ChangeSelection(size_t nPage);
// set/get the title of a page
bool SetPageText(size_t nPage, const wxString& strText);
wxString GetPageText(size_t nPage) const;
// image list stuff: each page may have an image associated with it. All
// the images belong to an image list, so you have to
// 1) create an image list
// 2) associate it with the notebook
// 3) set for each page it's image
// associate image list with a control
void SetImageList(wxImageList* imageList);
// sets/returns item's image index in the current image list
int GetPageImage(size_t nPage) const;
bool SetPageImage(size_t nPage, int nImage);
// currently it's always 1 because wxGTK doesn't support multi-row
// tab controls
int GetRowCount() const;
// control the appearance of the notebook pages
// set the size (the same for all pages)
void SetPageSize(const wxSize& size);
// set the padding between tabs (in pixels)
void SetPadding(const wxSize& padding);
// operations
// ----------
// remove all pages
bool DeleteAllPages();
// inserts a new page to the notebook (it will be deleted ny the notebook,
// don't delete it yourself). If bSelect, this page becomes active.
bool InsertPage(size_t nPage,
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = false,
int imageId = -1);
// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
// style.
void SetTabSize(const wxSize& sz);
// hit test
virtual int HitTest(const wxPoint& pt, long *flags = NULL) const;
// calculate the size of the notebook from the size of its page
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
// callbacks
// ---------
void OnSize(wxSizeEvent& event);
void OnNavigationKey(wxNavigationKeyEvent& event);
// base class virtuals
// -------------------
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
virtual bool MSWOnScroll(int orientation, WXWORD nSBCode,
WXWORD pos, WXHWND control);
#if wxUSE_CONSTRAINTS
virtual void SetConstraintSizes(bool recurse = true);
virtual bool DoPhase(int nPhase);
#endif // wxUSE_CONSTRAINTS
// Attempts to get colour for UX theme page background
wxColour GetThemeBackgroundColour() const;
// implementation only
// -------------------
#if wxUSE_UXTHEME
virtual bool SetBackgroundColour(const wxColour& colour)
{
if ( !wxNotebookBase::SetBackgroundColour(colour) )
return false;
UpdateBgBrush();
return true;
}
// draw child background
virtual bool MSWPrintChild(WXHDC hDC, wxWindow *win);
virtual bool MSWHasInheritableBackground() const { return true; }
#endif // wxUSE_UXTHEME
// translate wxWin styles to the Windows ones
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
protected:
// common part of all ctors
void Init();
// hides the currently shown page and shows the given one (if not -1) and
// updates m_selection accordingly
void UpdateSelection(int selNew);
// remove one page from the notebook, without deleting
virtual wxNotebookPage *DoRemovePage(size_t nPage);
// get the page rectangle for the current notebook size
//
// returns empty rectangle if an error occurs, do test for it
wxRect GetPageSize() const;
// set the size of the given page to fit in the notebook
void AdjustPageSize(wxNotebookPage *page);
#if wxUSE_UXTHEME
// return the themed brush for painting our children
virtual WXHBRUSH MSWGetCustomBgBrush() { return m_hbrBackground; }
// gets the bitmap of notebook background and returns a brush from it
WXHBRUSH QueryBgBitmap();
// creates the brush to be used for drawing the tab control background
void UpdateBgBrush();
// common part of QueryBgBitmap() and MSWPrintChild()
//
// if child == NULL, draw background for the entire notebook itself
bool DoDrawBackground(WXHDC hDC, wxWindow *child = NULL);
#endif // wxUSE_UXTHEME
// these function are only used for reducing flicker on notebook resize and
// we don't need to do this for WinCE
#ifndef __WXWINCE__
void OnEraseBackground(wxEraseEvent& event);
void OnPaint(wxPaintEvent& event);
// true if we have already subclassed our updown control
bool m_hasSubclassedUpdown;
#endif // __WXWINCE__
#if wxUSE_UXTHEME
// background brush used to paint the tab control
WXHBRUSH m_hbrBackground;
#endif // wxUSE_UXTHEME
DECLARE_DYNAMIC_CLASS_NO_COPY(wxNotebook)
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_NOTEBOOK
#endif // _NOTEBOOK_H

View File

@ -0,0 +1,74 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/notifmsg.h
// Purpose: implementation of wxNotificationMessage for Windows
// Author: Vadim Zeitlin
// Created: 2007-12-01
// RCS-ID: $Id: notifmsg.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_NOTIFMSG_H_
#define _WX_MSW_NOTIFMSG_H_
class WXDLLIMPEXP_FWD_ADV wxTaskBarIcon;
// ----------------------------------------------------------------------------
// wxNotificationMessage
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxNotificationMessage : public wxNotificationMessageBase
{
public:
wxNotificationMessage() { Init(); }
wxNotificationMessage(const wxString& title,
const wxString& message = wxString(),
wxWindow *parent = NULL)
: wxNotificationMessageBase(title, message, parent)
{
Init();
}
virtual ~wxNotificationMessage();
virtual bool Show(int timeout = Timeout_Auto);
virtual bool Close();
// MSW implementation-specific methods
// by default, wxNotificationMessage under MSW creates a temporary taskbar
// icon to which it attaches the notification, if there is an existing
// taskbar icon object in the application you may want to call this method
// to attach the notification to it instead (we won't take ownership of it
// and you can also pass NULL to not use the icon for notifications any
// more)
//
// returns the task bar icon which was used previously (may be NULL)
static wxTaskBarIcon *UseTaskBarIcon(wxTaskBarIcon *icon);
// call this to always use the generic implementation, even if the system
// supports the balloon tooltips used by the native one
static void AlwaysUseGeneric(bool alwaysUseGeneric)
{
ms_alwaysUseGeneric = alwaysUseGeneric;
}
private:
// common part of all ctors
void Init() { m_impl = NULL; }
// flag indicating whether we should always use generic implementation
static bool ms_alwaysUseGeneric;
// the real implementation of this class (selected during run-time because
// the balloon task bar icons are not available in all Windows versions)
class wxNotifMsgImpl *m_impl;
wxDECLARE_NO_COPY_CLASS(wxNotificationMessage);
};
#endif // _WX_MSW_NOTIFMSG_H_

View File

@ -0,0 +1,68 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/ole/access.h
// Purpose: declaration of the wxAccessible class
// Author: Julian Smart
// Modified by:
// Created: 2003-02-12
// RCS-ID: $Id: access.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 2003 Julian Smart
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ACCESS_H_
#define _WX_ACCESS_H_
#if wxUSE_ACCESSIBILITY
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class wxIAccessible;
class WXDLLIMPEXP_FWD_CORE wxWindow;
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxAccessible implements accessibility behaviour.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAccessible : public wxAccessibleBase
{
public:
wxAccessible(wxWindow *win = NULL);
virtual ~wxAccessible();
// Overridables
// Accessors
// Returns the wxIAccessible pointer
wxIAccessible* GetIAccessible() { return m_pIAccessible; }
// Returns the IAccessible standard interface pointer
void* GetIAccessibleStd() ;
// Operations
// Sends an event when something changes in an accessible object.
static void NotifyEvent(int eventType, wxWindow* window, wxAccObject objectType,
int objectId);
protected:
void Init();
private:
wxIAccessible * m_pIAccessible; // the pointer to COM interface
void* m_pIAccessibleStd; // the pointer to the standard COM interface,
// for default processing
wxDECLARE_NO_COPY_CLASS(wxAccessible);
};
#endif //wxUSE_ACCESSIBILITY
#endif //_WX_ACCESS_H_

View File

@ -0,0 +1,262 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/ole/activex.h
// Purpose: wxActiveXContainer class
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
// Created: 8/18/05
// RCS-ID: $Id: activex.h 64533 2010-06-09 14:28:08Z FM $
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// Definitions
// ============================================================================
#ifndef _WX_MSW_OLE_ACTIVEXCONTAINER_H_
#define _WX_MSW_OLE_ACTIVEXCONTAINER_H_
#if wxUSE_ACTIVEX
//---------------------------------------------------------------------------
// wx includes
//---------------------------------------------------------------------------
#include "wx/msw/ole/oleutils.h" // wxBasicString &c
#include "wx/msw/ole/uuid.h"
#include "wx/window.h"
#include "wx/variant.h"
class FrameSite;
//---------------------------------------------------------------------------
// MSW COM includes
//---------------------------------------------------------------------------
#include <oleidl.h>
#include <olectl.h>
#if !defined(__WXWINCE__) || defined(__WINCE_STANDARDSDK__)
#include <exdisp.h>
#endif
#include <docobj.h>
#ifndef STDMETHOD
#define STDMETHOD(funcname) virtual HRESULT wxSTDCALL funcname
#endif
//
// These defines are from another ole header - but its not in the
// latest sdk. Also the ifndef DISPID_READYSTATE is here because at
// least on my machine with the latest sdk olectl.h defines these 3
//
#ifndef DISPID_READYSTATE
#define DISPID_READYSTATE (-525)
#define DISPID_READYSTATECHANGE (-609)
#define DISPID_AMBIENT_TRANSFERPRIORITY (-728)
#endif
#define DISPID_AMBIENT_OFFLINEIFNOTCONNECTED (-5501)
#define DISPID_AMBIENT_SILENT (-5502)
#ifndef DISPID_AMBIENT_CODEPAGE
#define DISPID_AMBIENT_CODEPAGE (-725)
#define DISPID_AMBIENT_CHARSET (-727)
#endif
//---------------------------------------------------------------------------
//
// wxActiveXContainer
//
//---------------------------------------------------------------------------
template<typename I>
class wxAutoOleInterface
{
public:
typedef I Interface;
explicit wxAutoOleInterface(I *pInterface = NULL) : m_interface(pInterface)
{}
wxAutoOleInterface(REFIID riid, IUnknown *pUnk) : m_interface(NULL)
{ QueryInterface(riid, pUnk); }
wxAutoOleInterface(REFIID riid, IDispatch *pDispatch) : m_interface(NULL)
{ QueryInterface(riid, pDispatch); }
wxAutoOleInterface(REFCLSID clsid, REFIID riid) : m_interface(NULL)
{ CreateInstance(clsid, riid); }
wxAutoOleInterface(const wxAutoOleInterface& ti) : m_interface(NULL)
{ operator=(ti); }
wxAutoOleInterface& operator=(const wxAutoOleInterface& ti)
{
if ( ti.m_interface )
ti.m_interface->AddRef();
Free();
m_interface = ti.m_interface;
return *this;
}
wxAutoOleInterface& operator=(I*& ti)
{
Free();
m_interface = ti;
return *this;
}
~wxAutoOleInterface() { Free(); }
void Free()
{
if ( m_interface )
m_interface->Release();
m_interface = NULL;
}
HRESULT QueryInterface(REFIID riid, IUnknown *pUnk)
{
Free();
wxASSERT(pUnk != NULL);
return pUnk->QueryInterface(riid, (void **)&m_interface);
}
HRESULT CreateInstance(REFCLSID clsid, REFIID riid)
{
Free();
return CoCreateInstance
(
clsid,
NULL,
CLSCTX_ALL,
riid,
(void **)&m_interface
);
}
operator I*() const {return m_interface; }
I* operator->() {return m_interface; }
I** GetRef() {return &m_interface; }
bool Ok() const { return IsOk(); }
bool IsOk() const { return m_interface != NULL; }
protected:
I *m_interface;
};
#if WXWIN_COMPATIBILITY_2_8
// this macro is kept for compatibility with older wx versions
#define WX_DECLARE_AUTOOLE(wxAutoOleInterfaceType, I) \
typedef wxAutoOleInterface<I> wxAutoOleInterfaceType;
#endif // WXWIN_COMPATIBILITY_2_8
typedef wxAutoOleInterface<IDispatch> wxAutoIDispatch;
typedef wxAutoOleInterface<IOleClientSite> wxAutoIOleClientSite;
typedef wxAutoOleInterface<IUnknown> wxAutoIUnknown;
typedef wxAutoOleInterface<IOleObject> wxAutoIOleObject;
typedef wxAutoOleInterface<IOleInPlaceObject> wxAutoIOleInPlaceObject;
typedef wxAutoOleInterface<IOleInPlaceActiveObject> wxAutoIOleInPlaceActiveObject;
typedef wxAutoOleInterface<IOleDocumentView> wxAutoIOleDocumentView;
typedef wxAutoOleInterface<IViewObject> wxAutoIViewObject;
class WXDLLIMPEXP_CORE wxActiveXContainer : public wxWindow
{
public:
wxActiveXContainer(wxWindow * parent, REFIID iid, IUnknown* pUnk);
virtual ~wxActiveXContainer();
void OnSize(wxSizeEvent&);
void OnPaint(wxPaintEvent&);
void OnSetFocus(wxFocusEvent&);
void OnKillFocus(wxFocusEvent&);
protected:
friend class FrameSite;
friend class wxActiveXEvents;
FrameSite *m_frameSite;
wxAutoIDispatch m_Dispatch;
wxAutoIOleClientSite m_clientSite;
wxAutoIUnknown m_ActiveX;
wxAutoIOleObject m_oleObject;
wxAutoIOleInPlaceObject m_oleInPlaceObject;
wxAutoIOleInPlaceActiveObject m_oleInPlaceActiveObject;
wxAutoIOleDocumentView m_docView;
wxAutoIViewObject m_viewObject;
HWND m_oleObjectHWND;
bool m_bAmbientUserMode;
DWORD m_docAdviseCookie;
wxWindow* m_realparent;
void CreateActiveX(REFIID, IUnknown*);
};
///\brief Store native event parameters.
///\detail Store OLE 'Invoke' parameters for event handlers that need to access them.
/// These are the exact values for the event as they are passed to the wxActiveXContainer.
struct wxActiveXEventNativeMSW
{
DISPID dispIdMember;
REFIID riid;
LCID lcid;
WORD wFlags;
DISPPARAMS *pDispParams;
VARIANT *pVarResult;
EXCEPINFO *pExcepInfo;
unsigned int *puArgErr;
wxActiveXEventNativeMSW
(DISPID a_dispIdMember, REFIID a_riid, LCID a_lcid, WORD a_wFlags, DISPPARAMS *a_pDispParams,
VARIANT *a_pVarResult, EXCEPINFO *a_pExcepInfo, unsigned int *a_puArgErr)
:dispIdMember(a_dispIdMember), riid(a_riid), lcid(a_lcid), wFlags(a_wFlags), pDispParams(a_pDispParams),
pVarResult(a_pVarResult), pExcepInfo(a_pExcepInfo), puArgErr(a_puArgErr)
{ }
};
// Events
class WXDLLIMPEXP_CORE wxActiveXEvent : public wxCommandEvent
{
private:
friend class wxActiveXEvents;
wxVariant m_params;
DISPID m_dispid;
public:
virtual wxEvent *Clone() const
{ return new wxActiveXEvent(*this); }
size_t ParamCount() const;
wxString ParamType(size_t idx) const
{
wxASSERT(idx < ParamCount());
return m_params[idx].GetType();
}
wxString ParamName(size_t idx) const
{
wxASSERT(idx < ParamCount());
return m_params[idx].GetName();
}
wxVariant& operator[] (size_t idx);
DISPID GetDispatchId() const
{ return m_dispid; }
wxActiveXEventNativeMSW *GetNativeParameters() const
{ return (wxActiveXEventNativeMSW*)GetClientData(); }
};
// #define wxACTIVEX_ID 14001
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_ACTIVEX, wxActiveXEvent );
typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
#define wxActiveXEventHandler(func) \
wxEVENT_HANDLER_CAST( wxActiveXEventFunction, func )
#define EVT_ACTIVEX(id, fn) wxDECLARE_EVENT_TABLE_ENTRY(wxEVT_ACTIVEX, id, -1, wxActiveXEventHandler( fn ), NULL ),
#endif // wxUSE_ACTIVEX
#endif // _WX_MSW_OLE_ACTIVEXCONTAINER_H_

View File

@ -0,0 +1,117 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/ole/automtn.h
// Purpose: OLE automation utilities
// Author: Julian Smart
// Modified by:
// Created: 11/6/98
// RCS-ID: $Id: automtn.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_AUTOMTN_H_
#define _WX_AUTOMTN_H_
#include "wx/defs.h"
#if wxUSE_OLE_AUTOMATION
#include "wx/object.h"
#include "wx/variant.h"
typedef void WXIDISPATCH;
typedef unsigned short* WXBSTR;
#ifdef GetObject
#undef GetObject
#endif
// Flags used with wxAutomationObject::GetInstance()
enum wxAutomationInstanceFlags
{
// Only use the existing instance, never create a new one.
wxAutomationInstance_UseExistingOnly = 0,
// Create a new instance if there are no existing ones.
wxAutomationInstance_CreateIfNeeded = 1,
// Do not log errors if we failed to get the existing instance because none
// is available.
wxAutomationInstance_SilentIfNone = 2
};
/*
* wxAutomationObject
* Wraps up an IDispatch pointer and invocation; does variant conversion.
*/
class WXDLLIMPEXP_CORE wxAutomationObject: public wxObject
{
public:
wxAutomationObject(WXIDISPATCH* dispatchPtr = NULL);
virtual ~wxAutomationObject();
// Set/get dispatch pointer
void SetDispatchPtr(WXIDISPATCH* dispatchPtr) { m_dispatchPtr = dispatchPtr; }
WXIDISPATCH* GetDispatchPtr() const { return m_dispatchPtr; }
bool IsOk() const { return m_dispatchPtr != NULL; }
// Get a dispatch pointer from the current object associated
// with a ProgID, such as "Excel.Application"
bool GetInstance(const wxString& progId,
int flags = wxAutomationInstance_CreateIfNeeded) const;
// Get a dispatch pointer from a new instance of the class
bool CreateInstance(const wxString& progId) const;
// Low-level invocation function. Pass either an array of variants,
// or an array of pointers to variants.
bool Invoke(const wxString& member, int action,
wxVariant& retValue, int noArgs, wxVariant args[], const wxVariant* ptrArgs[] = 0) const;
// Invoke a member function
wxVariant CallMethod(const wxString& method, int noArgs, wxVariant args[]);
wxVariant CallMethodArray(const wxString& method, int noArgs, const wxVariant **args);
// Convenience function
wxVariant CallMethod(const wxString& method,
const wxVariant& arg1 = wxNullVariant, const wxVariant& arg2 = wxNullVariant,
const wxVariant& arg3 = wxNullVariant, const wxVariant& arg4 = wxNullVariant,
const wxVariant& arg5 = wxNullVariant, const wxVariant& arg6 = wxNullVariant);
// Get/Put property
wxVariant GetProperty(const wxString& property, int noArgs = 0, wxVariant args[] = NULL) const;
wxVariant GetPropertyArray(const wxString& property, int noArgs, const wxVariant **args) const;
wxVariant GetProperty(const wxString& property,
const wxVariant& arg1, const wxVariant& arg2 = wxNullVariant,
const wxVariant& arg3 = wxNullVariant, const wxVariant& arg4 = wxNullVariant,
const wxVariant& arg5 = wxNullVariant, const wxVariant& arg6 = wxNullVariant);
bool PutPropertyArray(const wxString& property, int noArgs, const wxVariant **args);
bool PutProperty(const wxString& property, int noArgs, wxVariant args[]) ;
bool PutProperty(const wxString& property,
const wxVariant& arg1, const wxVariant& arg2 = wxNullVariant,
const wxVariant& arg3 = wxNullVariant, const wxVariant& arg4 = wxNullVariant,
const wxVariant& arg5 = wxNullVariant, const wxVariant& arg6 = wxNullVariant);
// Uses DISPATCH_PROPERTYGET
// and returns a dispatch pointer. The calling code should call Release
// on the pointer, though this could be implicit by constructing an wxAutomationObject
// with it and letting the destructor call Release.
WXIDISPATCH* GetDispatchProperty(const wxString& property, int noArgs, wxVariant args[]) const;
WXIDISPATCH* GetDispatchProperty(const wxString& property, int noArgs, const wxVariant **args) const;
// A way of initialising another wxAutomationObject with a dispatch object,
// without having to deal with nasty IDispatch pointers.
bool GetObject(wxAutomationObject& obj, const wxString& property, int noArgs = 0, wxVariant args[] = NULL) const;
bool GetObject(wxAutomationObject& obj, const wxString& property, int noArgs, const wxVariant **args) const;
public:
WXIDISPATCH* m_dispatchPtr;
wxDECLARE_NO_COPY_CLASS(wxAutomationObject);
};
#endif // wxUSE_OLE_AUTOMATION
#endif // _WX_AUTOMTN_H_

View File

@ -0,0 +1,75 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/ole/dataform.h
// Purpose: declaration of the wxDataFormat class
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.10.99 (extracted from msw/ole/dataobj.h)
// RCS-ID: $Id: dataform.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_OLE_DATAFORM_H
#define _WX_MSW_OLE_DATAFORM_H
// ----------------------------------------------------------------------------
// wxDataFormat identifies the single format of data
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataFormat
{
public:
// the clipboard formats under Win32 are WORD's
typedef unsigned short NativeFormat;
wxDataFormat(NativeFormat format = wxDF_INVALID) { m_format = format; }
// we need constructors from all string types as implicit conversions to
// wxString don't apply when we already rely on implicit conversion of a,
// for example, "char *" string to wxDataFormat, and existing code does it
wxDataFormat(const wxString& format) { SetId(format); }
wxDataFormat(const char *format) { SetId(format); }
wxDataFormat(const wchar_t *format) { SetId(format); }
wxDataFormat(const wxCStrData& format) { SetId(format); }
wxDataFormat& operator=(NativeFormat format)
{ m_format = format; return *this; }
wxDataFormat& operator=(const wxDataFormat& format)
{ m_format = format.m_format; return *this; }
// default copy ctor/assignment operators ok
// comparison (must have both versions)
bool operator==(wxDataFormatId format) const
{ return m_format == (NativeFormat)format; }
bool operator!=(wxDataFormatId format) const
{ return m_format != (NativeFormat)format; }
bool operator==(const wxDataFormat& format) const
{ return m_format == format.m_format; }
bool operator!=(const wxDataFormat& format) const
{ return m_format != format.m_format; }
// explicit and implicit conversions to NativeFormat which is one of
// standard data types (implicit conversion is useful for preserving the
// compatibility with old code)
NativeFormat GetFormatId() const { return m_format; }
operator NativeFormat() const { return m_format; }
// this works with standard as well as custom ids
void SetType(NativeFormat format) { m_format = format; }
NativeFormat GetType() const { return m_format; }
// string ids are used for custom types - this SetId() must be used for
// application-specific formats
wxString GetId() const;
void SetId(const wxString& format);
// returns true if the format is one of those defined in wxDataFormatId
bool IsStandard() const { return m_format > 0 && m_format < wxDF_PRIVATE; }
private:
NativeFormat m_format;
};
#endif // _WX_MSW_OLE_DATAFORM_H

View File

@ -0,0 +1,79 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/ole/dataobj.h
// Purpose: declaration of the wxDataObject class
// Author: Vadim Zeitlin
// Modified by:
// Created: 10.05.98
// RCS-ID: $Id: dataobj.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_OLE_DATAOBJ_H
#define _WX_MSW_OLE_DATAOBJ_H
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
struct IDataObject;
// ----------------------------------------------------------------------------
// wxDataObject is a "smart" and polymorphic piece of data.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase
{
public:
// ctor & dtor
wxDataObject();
virtual ~wxDataObject();
// retrieve IDataObject interface (for other OLE related classes)
IDataObject *GetInterface() const { return m_pIDataObject; }
// tell the object that it should be now owned by IDataObject - i.e. when
// it is deleted, it should delete us as well
void SetAutoDelete();
// return true if we support this format in "Get" direction
bool IsSupportedFormat(const wxDataFormat& format) const
{ return wxDataObjectBase::IsSupported(format, Get); }
// if this method returns false, this wxDataObject will be copied to
// the clipboard with its size prepended to it, which is compatible with
// older wx versions
//
// if returns true, then this wxDataObject will be copied to the clipboard
// without any additional information and ::HeapSize() function will be used
// to get the size of that data
virtual bool NeedsVerbatimData(const wxDataFormat& WXUNUSED(format)) const
{
// return false from here only for compatibility with earlier wx versions
return true;
}
// function to return symbolic name of clipboard format (for debug messages)
#ifdef __WXDEBUG__
static const wxChar *GetFormatName(wxDataFormat format);
#define wxGetFormatName(format) wxDataObject::GetFormatName(format)
#else // !Debug
#define wxGetFormatName(format) wxT("")
#endif // Debug/!Debug
// they need to be accessed from wxIDataObject, so made them public,
// or wxIDataObject friend
public:
virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size,
const wxDataFormat& format );
virtual void* SetSizeInBuffer( void* buffer, size_t size,
const wxDataFormat& format );
virtual size_t GetBufferOffset( const wxDataFormat& format );
private:
IDataObject *m_pIDataObject; // pointer to the COM interface
wxDECLARE_NO_COPY_CLASS(wxDataObject);
};
#endif //_WX_MSW_OLE_DATAOBJ_H

View File

@ -0,0 +1,146 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/ole/dataobj2.h
// Purpose: second part of platform specific wxDataObject header -
// declarations of predefined wxDataObjectSimple-derived classes
// Author: Vadim Zeitlin
// Modified by:
// Created: 21.10.99
// RCS-ID: $Id: dataobj2.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_OLE_DATAOBJ2_H
#define _WX_MSW_OLE_DATAOBJ2_H
// ----------------------------------------------------------------------------
// wxBitmapDataObject is a specialization of wxDataObject for bitmap data
//
// NB: in fact, under MSW we support CF_DIB (and not CF_BITMAP) clipboard
// format and we also provide wxBitmapDataObject2 for CF_BITMAP (which is
// rarely used). This is ugly, but I haven't found a solution for it yet.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
{
public:
// ctors
wxBitmapDataObject(const wxBitmap& bitmap = wxNullBitmap)
: wxBitmapDataObjectBase(bitmap)
{
SetFormat(wxDF_DIB);
m_data = NULL;
}
// implement base class pure virtuals
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
{ return GetDataSize(); }
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
void *buf) const
{ return GetDataHere(buf); }
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
size_t len, const void *buf)
{ return SetData(len, buf); }
private:
// the DIB data
void /* BITMAPINFO */ *m_data;
wxDECLARE_NO_COPY_CLASS(wxBitmapDataObject);
};
// ----------------------------------------------------------------------------
// wxBitmapDataObject2 - a data object for CF_BITMAP
//
// FIXME did I already mention it was ugly?
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapDataObject2 : public wxBitmapDataObjectBase
{
public:
// ctors
wxBitmapDataObject2(const wxBitmap& bitmap = wxNullBitmap)
: wxBitmapDataObjectBase(bitmap)
{
}
// implement base class pure virtuals
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
{ return GetDataSize(); }
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
void *buf) const
{ return GetDataHere(buf); }
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
size_t len, const void *buf)
{ return SetData(len, buf); }
private:
wxDECLARE_NO_COPY_CLASS(wxBitmapDataObject2);
};
// ----------------------------------------------------------------------------
// wxFileDataObject - data object for CF_HDROP
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
{
public:
wxFileDataObject() { }
// implement base class pure virtuals
virtual bool SetData(size_t len, const void *buf);
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *pData) const;
virtual void AddFile(const wxString& file);
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
{ return GetDataSize(); }
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
void *buf) const
{ return GetDataHere(buf); }
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
size_t len, const void *buf)
{ return SetData(len, buf); }
private:
wxDECLARE_NO_COPY_CLASS(wxFileDataObject);
};
// ----------------------------------------------------------------------------
// wxURLDataObject: data object for URLs
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxURLDataObject : public wxDataObjectComposite
{
public:
// initialize with URL in ctor or use SetURL later
wxURLDataObject(const wxString& url = wxEmptyString);
// return the URL as string
wxString GetURL() const;
// Set a string as the URL in the data object
void SetURL(const wxString& url);
// override to set m_textFormat
virtual bool SetData(const wxDataFormat& format,
size_t len,
const void *buf);
private:
// last data object we got data in
wxDataObjectSimple *m_dataObjectLast;
wxDECLARE_NO_COPY_CLASS(wxURLDataObject);
};
#endif // _WX_MSW_OLE_DATAOBJ2_H

Some files were not shown because too many files have changed in this diff Show More