now MSW stuff is complete
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
61
include/wx/msw/ctl3d/ctl3d.h
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*-----------------------------------------------------------------------
|
||||||
|
| CTL3D.DLL
|
||||||
|
|
|
||||||
|
| Adds 3d effects to Windows controls
|
||||||
|
|
|
||||||
|
| See ctl3d.doc for info
|
||||||
|
|
|
||||||
|
-----------------------------------------------------------------------*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dSubclassDlg(HWND, WORD);
|
||||||
|
BOOL WINAPI Ctl3dSubclassDlgEx(HWND, DWORD);
|
||||||
|
WORD WINAPI Ctl3dGetVer(void);
|
||||||
|
BOOL WINAPI Ctl3dEnabled(void);
|
||||||
|
HBRUSH WINAPI Ctl3dCtlColor(HDC, LONG); // ARCHAIC, use Ctl3dCtlColorEx
|
||||||
|
HBRUSH WINAPI Ctl3dCtlColorEx(UINT wm, WPARAM wParam, LPARAM lParam);
|
||||||
|
BOOL WINAPI Ctl3dColorChange(void);
|
||||||
|
BOOL WINAPI Ctl3dSubclassCtl(HWND);
|
||||||
|
LONG WINAPI Ctl3dDlgFramePaint(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dAutoSubclass(HANDLE);
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dRegister(HANDLE);
|
||||||
|
BOOL WINAPI Ctl3dUnregister(HANDLE);
|
||||||
|
|
||||||
|
//begin DBCS: far east short cut key support
|
||||||
|
VOID WINAPI Ctl3dWinIniChange(void);
|
||||||
|
//end DBCS
|
||||||
|
|
||||||
|
|
||||||
|
/* Ctl3dSubclassDlg3d flags */
|
||||||
|
#define CTL3D_BUTTONS 0x0001
|
||||||
|
#define CTL3D_LISTBOXES 0x0002
|
||||||
|
#define CTL3D_EDITS 0x0004
|
||||||
|
#define CTL3D_COMBOS 0x0008
|
||||||
|
#define CTL3D_STATICTEXTS 0x0010
|
||||||
|
#define CTL3D_STATICFRAMES 0x0020
|
||||||
|
|
||||||
|
#define CTL3D_NODLGWINDOW 0x00010000
|
||||||
|
#define CTL3D_ALL 0xffff
|
||||||
|
|
||||||
|
#define WM_DLGBORDER (WM_USER+3567)
|
||||||
|
/* WM_DLGBORDER *(int FAR *)lParam return codes */
|
||||||
|
#define CTL3D_NOBORDER 0
|
||||||
|
#define CTL3D_BORDER 1
|
||||||
|
|
||||||
|
#define WM_DLGSUBCLASS (WM_USER+3568)
|
||||||
|
/* WM_DLGSUBCLASS *(int FAR *)lParam return codes */
|
||||||
|
#define CTL3D_NOSUBCLASS 0
|
||||||
|
#define CTL3D_SUBCLASS 1
|
||||||
|
|
||||||
|
/* Resource ID for 3dcheck.bmp (for .lib version of ctl3d) */
|
||||||
|
#define CTL3D_3DCHECK 26567
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
113
include/wx/msw/ole/droptgt.h
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: ole/droptgt.h
|
||||||
|
// Purpose: declaration of the wxDropTarget class
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 06.03.98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// prolog
|
||||||
|
// ============================================================================
|
||||||
|
#ifndef _OLEDROPTGT_H
|
||||||
|
#define _OLEDROPTGT_H
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "droptgt.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !USE_DRAG_AND_DROP
|
||||||
|
#error "You should #define USE_DRAG_AND_DROP to 1 to compile this file!"
|
||||||
|
#endif //WX_DRAG_DROP
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// forward declarations
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class wxIDropTarget;
|
||||||
|
struct IDataObject;
|
||||||
|
|
||||||
|
typedef unsigned short wxDataFormat;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// An instance of the class wxDropTarget may be associated with any wxWindow
|
||||||
|
// derived object via SetDropTarget() function. If this is done, the virtual
|
||||||
|
// methods of wxDropTarget are called when something is dropped on the window.
|
||||||
|
//
|
||||||
|
// Note that wxDropTarget is an abstract base class (ABC) and you should derive
|
||||||
|
// your own class from it implementing pure virtual function in order to use it
|
||||||
|
// (all of them, including protected ones which are called by the class itself)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class WXDLLEXPORT wxDropTarget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctor & dtor
|
||||||
|
wxDropTarget();
|
||||||
|
virtual ~wxDropTarget();
|
||||||
|
|
||||||
|
// normally called by wxWindow on window creation/destruction, but might be
|
||||||
|
// called `manually' as well. Register() returns true on success.
|
||||||
|
bool Register(WXHWND hwnd);
|
||||||
|
void Revoke(WXHWND hwnd);
|
||||||
|
|
||||||
|
// do we accept this kind of data?
|
||||||
|
virtual bool IsAcceptedData(IDataObject *pIDataSource) const;
|
||||||
|
|
||||||
|
// called when mouse enters/leaves the window: might be used to give
|
||||||
|
// some visual feedback to the user
|
||||||
|
virtual void OnEnter() { }
|
||||||
|
virtual void OnLeave() { }
|
||||||
|
|
||||||
|
// this function is called when data is dropped.
|
||||||
|
// (x, y) are the coordinates of the drop
|
||||||
|
virtual bool OnDrop(long x, long y, const void *pData) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Override these to indicate what kind of data you support: the first
|
||||||
|
// format to which data can be converted is used. The classes below show
|
||||||
|
// how it can be done in the simplest cases.
|
||||||
|
// how many different (clipboard) formats do you support?
|
||||||
|
virtual size_t GetFormatCount() const = 0;
|
||||||
|
// return the n-th supported format
|
||||||
|
virtual wxDataFormat GetFormat(size_t n) const = 0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxIDropTarget *m_pIDropTarget; // the pointer to COM interface
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// A simple wxDropTarget derived class for text data: you only need to
|
||||||
|
// override OnDropText() to get something working
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class WXDLLEXPORT wxTextDropTarget : public wxDropTarget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual bool OnDrop(long x, long y, const void *pData);
|
||||||
|
virtual bool OnDropText(long x, long y, const char *psz) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual size_t GetFormatCount() const;
|
||||||
|
virtual wxDataFormat GetFormat(size_t n) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// A drop target which accepts files (dragged from File Manager or Explorer)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class WXDLLEXPORT wxFileDropTarget : public wxDropTarget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual bool OnDrop(long x, long y, const void *pData);
|
||||||
|
|
||||||
|
// params: the number of files and the array of file names
|
||||||
|
virtual bool OnDropFiles(long x, long y,
|
||||||
|
size_t nFiles, const char * const aszFiles[]) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual size_t GetFormatCount() const;
|
||||||
|
virtual wxDataFormat GetFormat(size_t n) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
#endif //_OLEDROPTGT_H
|
145
include/wx/msw/ole/oleutils.h
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: oleutils.h
|
||||||
|
// Purpose: OLE helper routines, OLE debugging support &c
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 19.02.1998
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _OLEUTILS_H
|
||||||
|
#define _OLEUTILS_H
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "oleutils.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// General purpose functions and macros
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// misc helper functions/macros
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// release the interface pointer (if !NULL)
|
||||||
|
inline void ReleaseInterface(IUnknown *pIUnk)
|
||||||
|
{
|
||||||
|
if ( pIUnk != NULL )
|
||||||
|
pIUnk->Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
// release the interface pointer (if !NULL) and make it NULL
|
||||||
|
#define RELEASE_AND_NULL(p) if ( (p) != NULL ) { p->Release(); p = NULL; };
|
||||||
|
|
||||||
|
// return TRUE if the iid is in the array
|
||||||
|
bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount);
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// IUnknown implementation helpers
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
/*
|
||||||
|
The most dumb implementation of IUnknown methods. We don't support
|
||||||
|
aggregation nor containment, but for 99% of cases this simple
|
||||||
|
implementation is quite enough.
|
||||||
|
|
||||||
|
Usage is trivial: here is all you should have
|
||||||
|
1) DECLARE_IUNKNOWN_METHOS in your (IUnknown derived!) class declaration
|
||||||
|
2) BEGIN/END_IID_TABLE with ADD_IID in between for all interfaces you
|
||||||
|
support (at least all for which you intent to return 'this' from QI,
|
||||||
|
i.e. you should derive from IFoo if you have ADD_IID(Foo)) somewhere else
|
||||||
|
3) IMPLEMENT_IUNKNOWN_METHOS somewhere also
|
||||||
|
|
||||||
|
These macros are quite simple: AddRef and Release are trivial and QI does
|
||||||
|
lookup in a static member array of IIDs and returns 'this' if it founds
|
||||||
|
the requested interface in it or E_NOINTERFACE if not.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// declare the methods and the member variable containing reference count
|
||||||
|
// you must also define the ms_aIids array somewhere with BEGIN_IID_TABLE
|
||||||
|
// and friends (see below)
|
||||||
|
#define DECLARE_IUNKNOWN_METHODS \
|
||||||
|
public: \
|
||||||
|
STDMETHODIMP QueryInterface(REFIID, void **); \
|
||||||
|
STDMETHODIMP_(ULONG) AddRef(); \
|
||||||
|
STDMETHODIMP_(ULONG) Release(); \
|
||||||
|
private: \
|
||||||
|
static const IID *ms_aIids[]; \
|
||||||
|
ULONG m_cRef
|
||||||
|
|
||||||
|
// macros for declaring supported interfaces
|
||||||
|
// NB: you should write ADD_INTERFACE(Foo) and not ADD_INTERFACE(IID_IFoo)!
|
||||||
|
#define BEGIN_IID_TABLE(cname) const IID *cname::ms_aIids[] = {
|
||||||
|
#define ADD_IID(iid) &IID_I##iid,
|
||||||
|
#define END_IID_TABLE }
|
||||||
|
|
||||||
|
// implementation is as straightforward as possible
|
||||||
|
// Parameter: classname - the name of the class
|
||||||
|
#define IMPLEMENT_IUNKNOWN_METHODS(classname) \
|
||||||
|
STDMETHODIMP classname::QueryInterface(REFIID riid, void **ppv) \
|
||||||
|
{ \
|
||||||
|
wxLogQueryInterface(#classname, riid); \
|
||||||
|
\
|
||||||
|
if ( IsIidFromList(riid, ms_aIids, WXSIZEOF(ms_aIids)) ) { \
|
||||||
|
*ppv = this; \
|
||||||
|
AddRef(); \
|
||||||
|
\
|
||||||
|
return S_OK; \
|
||||||
|
} \
|
||||||
|
else { \
|
||||||
|
*ppv = NULL; \
|
||||||
|
\
|
||||||
|
return (HRESULT) E_NOINTERFACE; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
STDMETHODIMP_(ULONG) classname::AddRef() \
|
||||||
|
{ \
|
||||||
|
wxLogAddRef(#classname, m_cRef); \
|
||||||
|
\
|
||||||
|
return ++m_cRef; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
STDMETHODIMP_(ULONG) classname::Release() \
|
||||||
|
{ \
|
||||||
|
wxLogRelease(#classname, m_cRef); \
|
||||||
|
\
|
||||||
|
if ( --m_cRef == 0 ) { \
|
||||||
|
delete this; \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
return m_cRef; \
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Debugging support
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
#ifdef __DEBUG__
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// All OLE specific log functions have DebugTrace level (as LogTrace)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// tries to translate riid into a symbolic name, if possible
|
||||||
|
void wxLogQueryInterface(const char *szInterface, REFIID riid);
|
||||||
|
|
||||||
|
// these functions print out the new value of reference counter
|
||||||
|
void wxLogAddRef (const char *szInterface, ULONG cRef);
|
||||||
|
void wxLogRelease(const char *szInterface, ULONG cRef);
|
||||||
|
|
||||||
|
#else //!DEBUG
|
||||||
|
#define wxLogQueryInterface(szInterface, riid)
|
||||||
|
#define wxLogAddRef(szInterface, cRef)
|
||||||
|
#define wxLogRelease(szInterface, cRef)
|
||||||
|
#endif //DEBUG
|
||||||
|
|
||||||
|
#endif //_OLEUTILS_H
|
91
include/wx/msw/ole/uuid.h
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: ole/uuid.h
|
||||||
|
// Purpose: encapsulates an UUID with some added helper functions
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 11.07.97
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
//
|
||||||
|
// Notes: you should link your project with RPCRT4.LIB!
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _OLEUUID_H
|
||||||
|
#define _OLEUUID_H
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "uuid.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// UUID (Universally Unique IDentifier) definition
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
// ----- taken from RPC.H
|
||||||
|
#ifndef UUID_DEFINED // in some cases RPC.H will be already
|
||||||
|
#ifdef __WIN32__ // included, so avoid redefinition
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned long Data1;
|
||||||
|
unsigned short Data2;
|
||||||
|
unsigned short Data3;
|
||||||
|
unsigned char Data4[8];
|
||||||
|
} UUID; // UUID = GUID = CLSID = LIBID = IID
|
||||||
|
#else // WIN16
|
||||||
|
#error "Don't know about UUIDs on this platform"
|
||||||
|
#endif // WIN32
|
||||||
|
#endif // UUID_DEFINED
|
||||||
|
|
||||||
|
#ifndef GUID_DEFINED
|
||||||
|
typedef UUID GUID;
|
||||||
|
#define UUID_DEFINED // prevent redefinition
|
||||||
|
#endif // GUID_DEFINED
|
||||||
|
|
||||||
|
typedef unsigned char uchar;
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// a class to store UUID and it's string representation
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
// uses RPC functions to create/convert Universally Unique Identifiers
|
||||||
|
class Uuid
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
UUID m_uuid;
|
||||||
|
uchar *m_pszUuid; // this string is alloc'd and freed by RPC
|
||||||
|
char *m_pszCForm; // this string is allocated in Set/Create
|
||||||
|
|
||||||
|
void UuidToCForm();
|
||||||
|
|
||||||
|
// function used to set initial state by all ctors
|
||||||
|
void Init() { m_pszUuid = NULL; m_pszCForm = NULL; }
|
||||||
|
|
||||||
|
public:
|
||||||
|
// ctors & dtor
|
||||||
|
Uuid() { Init(); }
|
||||||
|
Uuid(const char *pc) { Init(); Set(pc); }
|
||||||
|
Uuid(const UUID &uuid) { Init(); Set(uuid); }
|
||||||
|
~Uuid();
|
||||||
|
|
||||||
|
// copy ctor and assignment operator needed for this class
|
||||||
|
Uuid(const Uuid& uuid);
|
||||||
|
Uuid& operator=(const Uuid& uuid);
|
||||||
|
|
||||||
|
// create a brand new UUID
|
||||||
|
void Create();
|
||||||
|
|
||||||
|
// set value of UUID
|
||||||
|
bool Set(const char *pc); // from a string, returns true if ok
|
||||||
|
void Set(const UUID& uuid); // from another UUID (never fails)
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
operator const UUID*() const { return &m_uuid; }
|
||||||
|
operator const char*() const { return (char *)(m_pszUuid); }
|
||||||
|
|
||||||
|
// return string representation of the UUID in the C form
|
||||||
|
// (as in DEFINE_GUID macro)
|
||||||
|
const char *CForm() const { return m_pszCForm; }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _OLEUUID_H
|
BIN
samples/joytest/chart.ico
Normal file
After Width: | Height: | Size: 766 B |
BIN
samples/joytest/gun.wav
Normal file
171
samples/joytest/joytest.cpp
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: joytest.cpp
|
||||||
|
// Purpose: Joystick sample
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 04/01/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart and Markus Holzem
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/wx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <wx/msw/wave.h>
|
||||||
|
#include <wx/msw/joystick.h>
|
||||||
|
|
||||||
|
#include "joytest.h"
|
||||||
|
|
||||||
|
MyFrame *frame = NULL;
|
||||||
|
|
||||||
|
IMPLEMENT_APP(MyApp)
|
||||||
|
|
||||||
|
// For drawing lines in a canvas
|
||||||
|
long xpos = -1;
|
||||||
|
long ypos = -1;
|
||||||
|
|
||||||
|
int winNumber = 1;
|
||||||
|
|
||||||
|
// Initialise this in OnInit, not statically
|
||||||
|
bool MyApp::OnInit(void)
|
||||||
|
{
|
||||||
|
wxJoystick stick(wxJOYSTICK1);
|
||||||
|
if (!stick.IsOk())
|
||||||
|
{
|
||||||
|
wxMessageBox("No joystick detected!");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
m_fire.Create("gun.wav");
|
||||||
|
|
||||||
|
m_maxX = stick.GetXMax();
|
||||||
|
m_maxY = stick.GetYMax();
|
||||||
|
|
||||||
|
// Create the main frame window
|
||||||
|
|
||||||
|
frame = new MyFrame(NULL, "Joystick Demo", wxPoint(0, 0), wxSize(500, 400),
|
||||||
|
wxDEFAULT_FRAME | wxHSCROLL | wxVSCROLL);
|
||||||
|
|
||||||
|
// Give it an icon (this is ignored in MDI mode: uses resources)
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
frame->SetIcon(wxIcon("joyicon"));
|
||||||
|
#endif
|
||||||
|
#ifdef __X__
|
||||||
|
frame->SetIcon(wxIcon("joyicon.xbm"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Make a menubar
|
||||||
|
wxMenu *file_menu = new wxMenu;
|
||||||
|
|
||||||
|
file_menu->Append(JOYTEST_QUIT, "&Exit");
|
||||||
|
|
||||||
|
wxMenu *help_menu = new wxMenu;
|
||||||
|
help_menu->Append(JOYTEST_ABOUT, "&About");
|
||||||
|
|
||||||
|
wxMenuBar *menu_bar = new wxMenuBar;
|
||||||
|
|
||||||
|
menu_bar->Append(file_menu, "&File");
|
||||||
|
menu_bar->Append(help_menu, "&Help");
|
||||||
|
|
||||||
|
// Associate the menu bar with the frame
|
||||||
|
frame->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
|
frame->CreateStatusBar();
|
||||||
|
|
||||||
|
frame->Show(TRUE);
|
||||||
|
|
||||||
|
SetTopWindow(frame);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
|
||||||
|
EVT_JOYSTICK_EVENTS(MyCanvas::OnJoystickEvent)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
// Define a constructor for my canvas
|
||||||
|
MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size):
|
||||||
|
wxScrolledWindow(parent, -1, pos, size, wxSUNKEN_BORDER)
|
||||||
|
{
|
||||||
|
wxJoystick joystick(wxJOYSTICK1);
|
||||||
|
joystick.SetCapture(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
MyCanvas::~MyCanvas(void)
|
||||||
|
{
|
||||||
|
wxJoystick joystick(wxJOYSTICK1);
|
||||||
|
joystick.ReleaseCapture();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCanvas::OnJoystickEvent(wxJoystickEvent& event)
|
||||||
|
{
|
||||||
|
wxClientDC dc(this);
|
||||||
|
|
||||||
|
wxPoint pt(event.GetPosition());
|
||||||
|
|
||||||
|
// Scale to canvas size
|
||||||
|
int cw, ch;
|
||||||
|
GetSize(&cw, &ch);
|
||||||
|
|
||||||
|
pt.x = (long) (((double)pt.x/(double)wxGetApp().m_maxX) * cw);
|
||||||
|
pt.y = (long) (((double)pt.y/(double)wxGetApp().m_maxY) * ch);
|
||||||
|
|
||||||
|
if (xpos > -1 && ypos > -1 && event.IsMove() && event.ButtonIsDown())
|
||||||
|
{
|
||||||
|
dc.SetPen(*wxBLACK_PEN);
|
||||||
|
dc.DrawLine(xpos, ypos, pt.x, pt.y);
|
||||||
|
}
|
||||||
|
xpos = pt.x;
|
||||||
|
ypos = pt.y;
|
||||||
|
|
||||||
|
char buf[100];
|
||||||
|
if (event.ButtonDown())
|
||||||
|
sprintf(buf, "Joystick (%ld, %ld) Fire!", pt.x, pt.y);
|
||||||
|
else
|
||||||
|
sprintf(buf, "Joystick (%ld, %ld)", pt.x, pt.y);
|
||||||
|
frame->SetStatusText(buf);
|
||||||
|
|
||||||
|
if (event.ButtonDown() && wxGetApp().m_fire.IsOk())
|
||||||
|
{
|
||||||
|
wxGetApp().m_fire.Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||||
|
EVT_MENU(JOYTEST_QUIT, MyFrame::OnQuit)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
MyFrame::MyFrame(wxFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||||
|
const long style):
|
||||||
|
wxFrame(parent, -1, title, pos, size, style)
|
||||||
|
{
|
||||||
|
canvas = new MyCanvas(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
MyFrame::~MyFrame(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyFrame::OnQuit(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
Close(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyFrame::OnActivate(wxActivateEvent& event)
|
||||||
|
{
|
||||||
|
if (event.GetActive() && canvas)
|
||||||
|
canvas->SetFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MyFrame::OnClose(void)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
8
samples/joytest/joytest.def
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
NAME Joytest
|
||||||
|
DESCRIPTION 'Joystick Test Program'
|
||||||
|
EXETYPE WINDOWS
|
||||||
|
STUB 'WINSTUB.EXE'
|
||||||
|
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||||
|
DATA PRELOAD MOVEABLE MULTIPLE
|
||||||
|
HEAPSIZE 6000
|
||||||
|
STACKSIZE 48000
|
51
samples/joytest/joytest.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: joytest.cpp
|
||||||
|
// Purpose: Joystick sample
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 04/01/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart and Markus Holzem
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Define a new application
|
||||||
|
class MyApp: public wxApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool OnInit(void);
|
||||||
|
|
||||||
|
// Joystick max values
|
||||||
|
int m_maxX;
|
||||||
|
int m_maxY;
|
||||||
|
|
||||||
|
wxWave m_fire;
|
||||||
|
};
|
||||||
|
|
||||||
|
DECLARE_APP(MyApp)
|
||||||
|
|
||||||
|
class MyCanvas: public wxScrolledWindow
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyCanvas(wxWindow *parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
|
||||||
|
~MyCanvas(void);
|
||||||
|
void OnJoystickEvent(wxJoystickEvent& event);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
class MyFrame: public wxFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyCanvas *canvas;
|
||||||
|
MyFrame(wxFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
|
||||||
|
~MyFrame(void);
|
||||||
|
bool OnClose(void);
|
||||||
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
void OnQuit(wxCommandEvent& event);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#define JOYTEST_QUIT 1
|
||||||
|
#define JOYTEST_ABOUT 2
|
BIN
samples/joytest/joytest.ico
Normal file
After Width: | Height: | Size: 766 B |
5
samples/joytest/joytest.rc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
aaaa ICON "mondrian.ico"
|
||||||
|
joyicon ICON "mondrian.ico"
|
||||||
|
|
||||||
|
#include "wx/msw/wx.rc"
|
||||||
|
|
64
samples/joytest/makefile.b32
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.b32
|
||||||
|
# Author: Patrick Halke
|
||||||
|
# Created: 1995
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds 32bit MDI example.
|
||||||
|
|
||||||
|
# WXWIN and BCCDIR are set by parent make
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makeb32.env
|
||||||
|
|
||||||
|
WXLIBDIR = $(WXDIR)\lib
|
||||||
|
WXLIB = $(WXLIBDIR)\wx32.lib
|
||||||
|
LIBS=$(WXLIB) cw32 import32
|
||||||
|
|
||||||
|
TARGET=joytest
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS =
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
OBJECTS = joytest.obj
|
||||||
|
|
||||||
|
$(TARGET).exe: $(OBJECTS) $(TARGET).def $(TARGET).res
|
||||||
|
tlink32 $(LINKFLAGS) @&&!
|
||||||
|
c0w32.obj $(OBJECTS)
|
||||||
|
$(TARGET)
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
$(TARGET).def
|
||||||
|
!
|
||||||
|
brc32 -K $(TARGET).res
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
bcc32 $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
.c.obj:
|
||||||
|
bcc32 $(CPPFLAGS) -P- -c {$< }
|
||||||
|
|
||||||
|
joytest.obj: joytest.$(SRCSUFF) joytest.h
|
||||||
|
|
||||||
|
$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.rws
|
||||||
|
|
||||||
|
|
75
samples/joytest/makefile.bcc
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.bcc
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds joytest example (DOS).
|
||||||
|
|
||||||
|
!if "$(BCCDIR)" == ""
|
||||||
|
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if "$(WXWIN)" == ""
|
||||||
|
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!ifndef FINAL
|
||||||
|
FINAL=0
|
||||||
|
!endif
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makebcc.env
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\joytest
|
||||||
|
WXLIB = $(WXDIR)\lib\wx.lib
|
||||||
|
LIBS=$(WXLIB) mathwl cwl import
|
||||||
|
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
|
||||||
|
CFG=$(WXDIR)\src\wxwin.cfg
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||||
|
OPT = -O2
|
||||||
|
DEBUG_FLAGS =
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
HEADERS = joytest.h
|
||||||
|
SOURCES = joytest.$(SRCSUFF)
|
||||||
|
OBJECTS = joytest.obj
|
||||||
|
|
||||||
|
joytest: joytest.exe
|
||||||
|
|
||||||
|
all: joytest.exe
|
||||||
|
|
||||||
|
joytest.exe: $(WXLIB) joytest.obj joytest.def joytest.res
|
||||||
|
tlink $(LINKFLAGS) @&&!
|
||||||
|
c0wl.obj joytest.obj
|
||||||
|
joytest
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
joytest.def
|
||||||
|
!
|
||||||
|
rc -30 -K joytest.res
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
bcc $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
joytest.obj: joytest.$(SRCSUFF)
|
||||||
|
|
||||||
|
joytest.res : joytest.rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
rc -r /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa joytest
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.rws
|
63
samples/joytest/makefile.dos
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.dos
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds joytest example (DOS).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\makemsc.env
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\joytest
|
||||||
|
INC=/I$(WXDIR)\include
|
||||||
|
|
||||||
|
HEADERS = joytest.h
|
||||||
|
SOURCES = joytest.$(SRCSUFF)
|
||||||
|
OBJECTS = joytest.obj
|
||||||
|
|
||||||
|
all: joytest.exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
|
||||||
|
joytest.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) joytest.obj joytest.def joytest.res
|
||||||
|
link $(LINKFLAGS) @<<
|
||||||
|
$(WXDIR)\src\msw\dummy.obj joytest.obj,
|
||||||
|
joytest,
|
||||||
|
NUL,
|
||||||
|
$(LIBS),
|
||||||
|
joytest.def
|
||||||
|
;
|
||||||
|
<<
|
||||||
|
rc -K joytest.res
|
||||||
|
|
||||||
|
joytest.obj: joytest.h joytest.$(SRCSUFF)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
joytest.res : joytest.rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
rc -r /i$(WXDIR)\include joytest
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.pdb
|
35
samples/joytest/makefile.g95
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.unx
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile for joytest example (UNIX).
|
||||||
|
|
||||||
|
WXDIR = ../..
|
||||||
|
|
||||||
|
# All common UNIX compiler flags and options are now in
|
||||||
|
# this central makefile.
|
||||||
|
include $(WXDIR)/src/makeg95.env
|
||||||
|
|
||||||
|
OBJECTS = $(OBJDIR)/joytest.$(OBJSUFF) $(OBJDIR)/joytest_resources.$(OBJSUFF)
|
||||||
|
|
||||||
|
all: $(OBJDIR) joytest$(GUISUFFIX)
|
||||||
|
|
||||||
|
$(OBJDIR):
|
||||||
|
mkdir $(OBJDIR)
|
||||||
|
|
||||||
|
joytest$(GUISUFFIX): $(OBJECTS) $(WXLIB)
|
||||||
|
$(CC) $(LDFLAGS) -o joytest$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
|
||||||
|
|
||||||
|
$(OBJDIR)/joytest.$(OBJSUFF): joytest.$(SRCSUFF) joytest.h
|
||||||
|
$(CC) -c $(CPPFLAGS) -o $@ joytest.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(OBJDIR)/joytest_resources.o: joytest.rc
|
||||||
|
$(RESCOMP) -i joytest.rc -o $(OBJDIR)/joytest_resources.o $(RESFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJECTS) joytest$(GUISUFFIX).exe core *.res *.rsc
|
63
samples/joytest/makefile.nt
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.nt
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds joytest example (MS VC++).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
# Set WXDIR for your system
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
WXUSINGDLL=0
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\ntwxwin.mak
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\joytest
|
||||||
|
PROGRAM=joytest
|
||||||
|
|
||||||
|
OBJECTS = $(PROGRAM).obj
|
||||||
|
|
||||||
|
$(PROGRAM): $(PROGRAM).exe
|
||||||
|
|
||||||
|
all: wx $(PROGRAM).exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(link) @<<
|
||||||
|
-out:$(PROGRAM).exe
|
||||||
|
$(LINKFLAGS)
|
||||||
|
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(LIBS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
|
||||||
|
$(PROGRAM).obj: $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ)
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
|
||||||
|
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.pdb
|
37
samples/joytest/makefile.sc
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
; Last change: JS 12 Apr 98 10:45 am
|
||||||
|
# Symantec C++ makefile for joytest example
|
||||||
|
# NOTE that peripheral libraries are now dealt in main wxWindows makefile.
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makesc.env
|
||||||
|
|
||||||
|
WXLIB = $(WXDIR)\lib\wx.lib
|
||||||
|
INCDIR = $(WXDIR)\include
|
||||||
|
MSWINC = $(INCDIR)\msw
|
||||||
|
BASEINC = $(INCDIR)\base
|
||||||
|
|
||||||
|
CC=sc
|
||||||
|
RC=rc
|
||||||
|
CFLAGS = -o -ml -W -Dwx_msw
|
||||||
|
LDFLAGS = -ml -W
|
||||||
|
|
||||||
|
INCLUDE=$(BASEINC);$(MSWINC)
|
||||||
|
|
||||||
|
LIBS=$(WXLIB) libw.lib commdlg.lib shell.lib
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
*$(CC) -c $(CFLAGS) -I$(INCLUDE) $<
|
||||||
|
|
||||||
|
.rc.res:
|
||||||
|
*$(RC) -r -I$(INCLUDE) $<
|
||||||
|
|
||||||
|
joytest.exe: joytest.obj joytest.def joytest.res
|
||||||
|
*$(CC) $(LDFLAGS) -o$@ joytest.obj joytest.def $(LIBS)
|
||||||
|
*$(RC) -k joytest.res
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-del *.obj
|
||||||
|
-del *.exe
|
||||||
|
-del *.res
|
||||||
|
-del *.map
|
||||||
|
-del *.rws
|
55
samples/joytest/makefile.unx
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.unx
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile for joytest example (UNIX).
|
||||||
|
|
||||||
|
WXDIR = ../..
|
||||||
|
|
||||||
|
# All common UNIX compiler flags and options are now in
|
||||||
|
# this central makefile.
|
||||||
|
include $(WXDIR)/src/make.env
|
||||||
|
|
||||||
|
OBJECTS = $(OBJDIR)/joytest.$(OBJSUFF)
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
|
all: $(OBJDIR) joytest$(GUISUFFIX)
|
||||||
|
|
||||||
|
wx:
|
||||||
|
# cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx
|
||||||
|
motif:
|
||||||
|
$(MAKE) -f makefile.unx GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK=
|
||||||
|
|
||||||
|
xview:
|
||||||
|
$(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)'
|
||||||
|
|
||||||
|
hp:
|
||||||
|
$(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='$(DEBUG)' WARN='-w' \
|
||||||
|
XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' LDLIBS='$(HPLDLIBS)'
|
||||||
|
|
||||||
|
$(OBJDIR):
|
||||||
|
mkdir $(OBJDIR)
|
||||||
|
|
||||||
|
joytest$(GUISUFFIX): $(OBJDIR)/joytest.$(OBJSUFF) $(WXLIB)
|
||||||
|
$(CC) $(LDFLAGS) -o joytest$(GUISUFFIX) $(OBJDIR)/joytest.$(OBJSUFF) $(XVIEW_LINK) $(LDLIBS)
|
||||||
|
|
||||||
|
$(OBJDIR)/joytest.$(OBJSUFF): joytest.$(SRCSUFF) joytest.h
|
||||||
|
$(CC) -c $(CPPFLAGS) -o $@ joytest.$(SRCSUFF)
|
||||||
|
|
||||||
|
clean_motif:
|
||||||
|
$(MAKE) -f makefile.unx GUISUFFIX=_motif cleanany
|
||||||
|
|
||||||
|
clean_ol:
|
||||||
|
$(MAKE) -f makefile.unx GUISUFFIX=_ol cleanany
|
||||||
|
|
||||||
|
clean_hp:
|
||||||
|
$(MAKE) -f makefile.unx GUISUFFIX=_hp cleanany
|
||||||
|
|
||||||
|
cleanany:
|
||||||
|
rm -f $(OBJECTS) joytest$(GUISUFFIX) core
|
43
samples/joytest/makefile.wat
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#
|
||||||
|
# Makefile for WATCOM
|
||||||
|
#
|
||||||
|
# Created by D.Chubraev, chubraev@iem.ee.ethz.ch
|
||||||
|
# 8 Nov 1994
|
||||||
|
#
|
||||||
|
|
||||||
|
WXDIR = ..\..
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\makewat.env
|
||||||
|
|
||||||
|
WXLIB = $(WXDIR)\lib
|
||||||
|
NAME = joytest
|
||||||
|
LNK = $(name).lnk
|
||||||
|
OBJS = $(name).obj
|
||||||
|
|
||||||
|
all: $(name).exe
|
||||||
|
|
||||||
|
$(name).exe : $(OBJS) $(name).res $(LNK) $(WXLIB)\wx$(LEVEL).lib
|
||||||
|
wlink @$(LNK)
|
||||||
|
$(BINDCOMMAND) $(name).res
|
||||||
|
|
||||||
|
$(name).res : $(name).rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
$(RC) $(RESFLAGS1) $(name).rc
|
||||||
|
|
||||||
|
$(LNK) : makefile.wat
|
||||||
|
%create $(LNK)
|
||||||
|
@%append $(LNK) debug all
|
||||||
|
@%append $(LNK) system $(LINKOPTION)
|
||||||
|
@%append $(LNK) $(MINDATA)
|
||||||
|
@%append $(LNK) $(MAXDATA)
|
||||||
|
@%append $(LNK) $(STACK)
|
||||||
|
@%append $(LNK) name $(name)
|
||||||
|
@%append $(LNK) file $(WXLIB)\wx$(LEVEL).lib
|
||||||
|
@for %i in ($(EXTRALIBS)) do @%append $(LNK) file %i
|
||||||
|
@for %i in ($(OBJS)) do @%append $(LNK) file %i
|
||||||
|
|
||||||
|
thing: .SYMBOLIC
|
||||||
|
echo $(WATLIBDIR)
|
||||||
|
|
||||||
|
clean: .SYMBOLIC
|
||||||
|
-erase *.obj *.bak *.err *.pch *.lib *.lnk *.res *.exe *.rex
|
||||||
|
|
BIN
samples/joytest/mondrian.ico
Normal file
After Width: | Height: | Size: 766 B |
71
samples/mfc/makefile.b32
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.bcc
|
||||||
|
# Author: Andre Beltman
|
||||||
|
# Created: 1995
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1995, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds mfc example (DOS).
|
||||||
|
|
||||||
|
# WXWIN and BCCDIR are set by parent make
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makeb32.env
|
||||||
|
|
||||||
|
WXLIBDIR = $(WXDIR)\lib
|
||||||
|
WXINC = $(WXDIR)\include\msw
|
||||||
|
WXBASESRC = $(WXDIR)\src\base
|
||||||
|
WXBASEINC = $(WXDIR)\include\base
|
||||||
|
WXLIB = $(WXLIBDIR)\wx32.lib
|
||||||
|
FAFALIB = $(WXLIBDIR)\fafa.lib
|
||||||
|
ITSYLIB = $(WXLIBDIR)\itsy.lib
|
||||||
|
XPMLIB = $(WXLIBDIR)\xpm.lib
|
||||||
|
DIBLIB = $(WXLIBDIR)\dib.lib
|
||||||
|
GAUGELIB = $(WXLIBDIR)\gauge.lib
|
||||||
|
WXTREELIB = $(WXLIBDIR)\wxtree.lib
|
||||||
|
RCPARSERLIB = $(WXLIBDIR)\rcparser.lib
|
||||||
|
PROLOGLIB = $(WXLIBDIR)\prologio.lib
|
||||||
|
LIBS=$(WXLIB) cw32 import32 ctl3d32 $(FAFALIB) $(ITSYLIB) $(DIBLIB)\
|
||||||
|
$(XPMLIB) $(PROLOGLIB) $(RCPARSERLIB) $(GAUGELIB) $(WXTREELIB)
|
||||||
|
|
||||||
|
TARGET=hello
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS =
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
OBJECTS = hello.obj
|
||||||
|
|
||||||
|
$(TARGET).exe: $(OBJECTS) $(TARGET).def $(TARGET).res
|
||||||
|
tlink32 $(LINKFLAGS) @&&!
|
||||||
|
c0w32.obj $(OBJECTS)
|
||||||
|
$(TARGET)
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
$(TARGET).def
|
||||||
|
!
|
||||||
|
brc32 -K $(TARGET).res
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
bcc32 $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
.c.obj:
|
||||||
|
bcc32 $(CPPFLAGS) -P- -c {$< }
|
||||||
|
|
||||||
|
hello.obj: hello.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(TARGET).res : $(TARGET).rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa $(TARGET)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj *.exe *.res *.map *.rws
|
||||||
|
|
76
samples/mfc/makefile.bcc
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.bcc
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds mfc example (DOS).
|
||||||
|
|
||||||
|
!if "$(BCCDIR)" == ""
|
||||||
|
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if "$(WXWIN)" == ""
|
||||||
|
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||||
|
!endif
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makebcc.env
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\mfc
|
||||||
|
WXLIB = $(WXDIR)\lib\wx.lib
|
||||||
|
|
||||||
|
LIBS=$(WXLIB) mathwl cwl import
|
||||||
|
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
|
||||||
|
CFG=$(WXDIR)\src\wxwin.cfg
|
||||||
|
|
||||||
|
!ifndef FINAL
|
||||||
|
FINAL=0
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||||
|
OPT = -O2
|
||||||
|
DEBUG_FLAGS =
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
HEADERS = hello.h
|
||||||
|
SOURCES = hello.$(SRCSUFF)
|
||||||
|
OBJECTS = hello.obj
|
||||||
|
|
||||||
|
hello: hello.exe
|
||||||
|
|
||||||
|
all: hello.exe
|
||||||
|
|
||||||
|
hello.exe: $(WXLIB) hello.obj hello.def hello.res
|
||||||
|
tlink $(LINKFLAGS) @&&!
|
||||||
|
c0wl.obj hello.obj
|
||||||
|
hello
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
hello.def
|
||||||
|
!
|
||||||
|
rc -30 -K hello.res
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
bcc $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
hello.obj: hello.$(SRCSUFF)
|
||||||
|
|
||||||
|
hello.res : hello.rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
rc -r /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa hello
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.rws
|
89
samples/mfc/makefile.dos
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.dos
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds MFC compatibility example (DOS).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info.
|
||||||
|
|
||||||
|
# Set WXDIR for your system
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\makemsc.env
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\mfc
|
||||||
|
WXLIB = $(WXDIR)\lib\wx.lib
|
||||||
|
MFCINC = c:\msvc\mfc\include
|
||||||
|
LIBS=lafxcwD $(WXLIB) oldnames libw llibcew commdlg ddeml shell mmsystem # mfcoleui compobj storage ole2 ole2disp
|
||||||
|
#LIBS=lafxcwD llibcew libw commdlg shell
|
||||||
|
INC=-I$(MFCINC) -I$(WXDIR)\include\base -I$(WXDIR)\include\msw
|
||||||
|
DUMMY=$(WXDIR)\src\msw\dummy.obj
|
||||||
|
|
||||||
|
# Set this to nothing if using MS C++ 7
|
||||||
|
ZOPTION=/Z7
|
||||||
|
|
||||||
|
!ifndef FINAL
|
||||||
|
FINAL=0
|
||||||
|
!endif
|
||||||
|
|
||||||
|
PRECOMP = # /YuWX_PREC.H /Fp$(WXDIR)\src\msw\wx.pch
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
CPPFLAGS=/D_DEBUG /AL /W3 /Zi $(ZOPTION) /G2sw /Od $(INC) $(PRECOMP) /Dwx_msw
|
||||||
|
#CPPFLAGS=/AL /Zp /GA /G2 /Gyf /Od /W3 $(INC) /D_DEBUG
|
||||||
|
LINKFLAGS=/NOD /CO /NOE /ONERROR:NOEXE /SEG:256 /STACK:12000
|
||||||
|
!else
|
||||||
|
CPPFLAGS=/AL /W3 /G2sw $(INC) /Ox $(PRECOMP) /Dwx_msw
|
||||||
|
LINKFLAGS=/NOD /NOE /ONERROR:NOEXE /SEG:256
|
||||||
|
!endif
|
||||||
|
|
||||||
|
HEADERS = hello.h
|
||||||
|
SOURCES = hello.$(SRCSUFF)
|
||||||
|
OBJECTS = hello.obj
|
||||||
|
|
||||||
|
hello: hello.exe
|
||||||
|
|
||||||
|
all: wx hello.exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
|
||||||
|
hello.exe: $(DUMMY) $(WXLIB) hello.obj hello.def hello.res
|
||||||
|
link $(LINKFLAGS) @<<
|
||||||
|
$(DUMMY) hello.obj,
|
||||||
|
hello,
|
||||||
|
NUL,
|
||||||
|
$(LIBS),
|
||||||
|
hello.def
|
||||||
|
;
|
||||||
|
<<
|
||||||
|
rc -31 -K hello.res
|
||||||
|
|
||||||
|
hello.obj: hello.h hello.$(SRCSUFF) $(DUMMY)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
hello.res : hello.rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
rc -r /i$(MFCINC) /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa hello
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.pdb
|
66
samples/mfc/makefile.nt
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.nt
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds MFC/wxWin example (MS VC++).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
# Set WXDIR for your system
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
EXTRALIBS=# mfc42.lib
|
||||||
|
EXTRAINC=-Ig:\DevStudio\mfc\include
|
||||||
|
EXTRAFLAGS=/D_AFXDLL
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\ntwxwin.mak
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\mfc
|
||||||
|
PROGRAM=mfctest
|
||||||
|
|
||||||
|
OBJECTS = $(PROGRAM).obj
|
||||||
|
|
||||||
|
$(PROGRAM): $(PROGRAM).exe
|
||||||
|
|
||||||
|
all: wx $(PROGRAM).exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(link) @<<
|
||||||
|
-out:$(PROGRAM).exe
|
||||||
|
$(LINKFLAGS)
|
||||||
|
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(LIBS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
|
||||||
|
$(PROGRAM).obj: $(PROGRAM).h $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ)
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.pdb
|
||||||
|
|
47
samples/mfc/makefile.wat
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
#
|
||||||
|
# Makefile for WATCOM
|
||||||
|
#
|
||||||
|
# Created by D.Chubraev, chubraev@iem.ee.ethz.ch
|
||||||
|
# 8 Nov 1994
|
||||||
|
#
|
||||||
|
|
||||||
|
WXDIR = ..\..
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\makewat.env
|
||||||
|
|
||||||
|
WXLIB = $(WXDIR)\lib
|
||||||
|
NAME = hello
|
||||||
|
LNK = $(name).lnk
|
||||||
|
OBJS = $(name).obj
|
||||||
|
|
||||||
|
# Required for multi-threaded MFC apps
|
||||||
|
EXTRACPPFLAGS = -bm -oaxt-zp4-ei-xs-zo-w3-bm-bt=nt -d_WINDOWS -d_MBCS
|
||||||
|
refmain = _wstart2_
|
||||||
|
|
||||||
|
|
||||||
|
PRECOMP=
|
||||||
|
|
||||||
|
all: $(name).exe
|
||||||
|
|
||||||
|
$(name).exe : $(OBJS) $(name).res $(LNK) $(WXLIB)\wx$(LEVEL).lib
|
||||||
|
wlink @$(LNK)
|
||||||
|
$(BINDCOMMAND) -d_MBCS $(name).res
|
||||||
|
|
||||||
|
$(name).res : $(name).rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
$(RC) $(RESFLAGS1) $(name).rc
|
||||||
|
|
||||||
|
$(LNK) : makefile.wat
|
||||||
|
%create $(LNK)
|
||||||
|
@%append $(LNK) debug all
|
||||||
|
@%append $(LNK) system $(LINKOPTION)
|
||||||
|
@%append $(LNK) $(MINDATA)
|
||||||
|
@%append $(LNK) $(MAXDATA)
|
||||||
|
@%append $(LNK) $(STACK)
|
||||||
|
@%append $(LNK) name $(name)
|
||||||
|
@%append $(LNK) file $(WXLIB)\wx$(LEVEL).lib
|
||||||
|
@for %i in ($(EXTRALIBS)) do @%append $(LNK) file %i
|
||||||
|
@for %i in ($(OBJS)) do @%append $(LNK) file %i
|
||||||
|
|
||||||
|
clean: .SYMBOLIC
|
||||||
|
-erase *.obj *.bak *.err *.pch *.lib *.lnk *.res *.exe *.rex
|
||||||
|
|
408
samples/mfc/mfctest.cpp
Normal file
@@ -0,0 +1,408 @@
|
|||||||
|
// hello.cpp : Defines the class behaviors for the application.
|
||||||
|
// Hello is a simple program which consists of a main window
|
||||||
|
// and an "About" dialog which can be invoked by a menu choice.
|
||||||
|
// It is intended to serve as a starting-point for new
|
||||||
|
// applications.
|
||||||
|
//
|
||||||
|
// This is a part of the Microsoft Foundation Classes C++ library.
|
||||||
|
// Copyright (C) 1992 Microsoft Corporation
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// This source code is only intended as a supplement to the
|
||||||
|
// Microsoft Foundation Classes Reference and Microsoft
|
||||||
|
// WinHelp documentation provided with the library.
|
||||||
|
// See these sources for detailed information regarding the
|
||||||
|
// Microsoft Foundation Classes product.
|
||||||
|
|
||||||
|
// *** MODIFIED BY JULIAN SMART TO DEMONSTRATE CO-EXISTANCE WITH wxWINDOWS ***
|
||||||
|
//
|
||||||
|
// This sample pops up an initial wxWindows frame, with a menu item
|
||||||
|
// that allows a new MFC window to be created. Note that CDummyWindow
|
||||||
|
// is a class that allows a wxWindows window to be seen as a CWnd
|
||||||
|
// for the purposes of specifying a valid main window to the
|
||||||
|
// MFC initialisation.
|
||||||
|
//
|
||||||
|
// You can easily modify this code so that an MFC window pops up
|
||||||
|
// initially as the main frame, and allows wxWindows frames to be
|
||||||
|
// created subsequently:
|
||||||
|
//
|
||||||
|
// (1) Make MyApp::OnInit return NULL, not create a window.
|
||||||
|
// (2) Restore the MFC code to create a window in InitInstance, and remove
|
||||||
|
// creation of CDummyWindow.
|
||||||
|
//
|
||||||
|
// IMPORTANT NOTE: to compile this sample, you must first edit
|
||||||
|
// wx/src/msw/wx_main.cc, set NOWINMAIN to 1, and remake wxWindows
|
||||||
|
// (it only needs to recompile wx_main.cc).
|
||||||
|
// This eliminates the duplicate WinMain function which MFC implements.
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/wx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef new
|
||||||
|
#undef new
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#ifdef DrawText
|
||||||
|
#undef DrawText
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#include "mfctest.h"
|
||||||
|
|
||||||
|
#include "wx/wx.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// theApp:
|
||||||
|
// Just creating this application object runs the whole application.
|
||||||
|
//
|
||||||
|
CTheApp theApp;
|
||||||
|
|
||||||
|
// wxWindows elements
|
||||||
|
|
||||||
|
// Define a new application type
|
||||||
|
class MyApp: public wxApp
|
||||||
|
{ public:
|
||||||
|
bool OnInit(void);
|
||||||
|
wxFrame *CreateFrame(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
DECLARE_APP(MyApp)
|
||||||
|
|
||||||
|
class MyCanvas: public wxScrolledWindow
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
|
||||||
|
void OnPaint(wxPaintEvent& event);
|
||||||
|
void OnMouseEvent(wxMouseEvent& event);
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
class MyChild: public wxFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyCanvas *canvas;
|
||||||
|
MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
|
||||||
|
~MyChild(void);
|
||||||
|
Bool OnClose(void);
|
||||||
|
|
||||||
|
void OnQuit(wxCommandEvent& event);
|
||||||
|
void OnNew(wxCommandEvent& event);
|
||||||
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
// For drawing lines in a canvas
|
||||||
|
long xpos = -1;
|
||||||
|
long ypos = -1;
|
||||||
|
|
||||||
|
// Initialise this in OnInit, not statically
|
||||||
|
wxPen *red_pen;
|
||||||
|
wxFont *small_font;
|
||||||
|
|
||||||
|
// ID for the menu quit command
|
||||||
|
#define HELLO_QUIT 1
|
||||||
|
#define HELLO_NEW 2
|
||||||
|
|
||||||
|
DECLARE_APP(MyApp)
|
||||||
|
IMPLEMENT_APP(MyApp)
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// CMainWindow constructor:
|
||||||
|
// Create the window with the appropriate style, size, menu, etc.
|
||||||
|
//
|
||||||
|
CMainWindow::CMainWindow()
|
||||||
|
{
|
||||||
|
LoadAccelTable( "MainAccelTable" );
|
||||||
|
Create( NULL, "Hello Foundation Application",
|
||||||
|
WS_OVERLAPPEDWINDOW, rectDefault, NULL, "MainMenu" );
|
||||||
|
}
|
||||||
|
|
||||||
|
// OnPaint:
|
||||||
|
// This routine draws the string "Hello, Windows!" in the center of the
|
||||||
|
// client area. It is called whenever Windows sends a WM_PAINT message.
|
||||||
|
// Note that creating a CPaintDC automatically does a BeginPaint and
|
||||||
|
// an EndPaint call is done when it is destroyed at the end of this
|
||||||
|
// function. CPaintDC's constructor needs the window (this).
|
||||||
|
//
|
||||||
|
void CMainWindow::OnPaint()
|
||||||
|
{
|
||||||
|
CString s = "Hello, Windows!";
|
||||||
|
CPaintDC dc( this );
|
||||||
|
CRect rect;
|
||||||
|
|
||||||
|
GetClientRect( rect );
|
||||||
|
dc.SetTextAlign( TA_BASELINE | TA_CENTER );
|
||||||
|
dc.SetTextColor( ::GetSysColor( COLOR_WINDOWTEXT ) );
|
||||||
|
dc.SetBkMode(TRANSPARENT);
|
||||||
|
dc.TextOut( ( rect.right / 2 ), ( rect.bottom / 2 ),
|
||||||
|
s, s.GetLength() );
|
||||||
|
}
|
||||||
|
|
||||||
|
// OnAbout:
|
||||||
|
// This member function is called when a WM_COMMAND message with an
|
||||||
|
// IDM_ABOUT code is received by the CMainWindow class object. The
|
||||||
|
// message map below is responsible for this routing.
|
||||||
|
//
|
||||||
|
// We create a ClDialog object using the "AboutBox" resource (see
|
||||||
|
// hello.rc), and invoke it.
|
||||||
|
//
|
||||||
|
void CMainWindow::OnAbout()
|
||||||
|
{
|
||||||
|
CDialog about( "AboutBox", this );
|
||||||
|
about.DoModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMainWindow::OnTest()
|
||||||
|
{
|
||||||
|
wxMessageBox("This is a wxWindows message box.\nWe're about to create a new wxWindows frame.", "wxWindows", wxOK);
|
||||||
|
wxGetApp().CreateFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
// CMainWindow message map:
|
||||||
|
// Associate messages with member functions.
|
||||||
|
//
|
||||||
|
// It is implied that the ON_WM_PAINT macro expects a member function
|
||||||
|
// "void OnPaint()".
|
||||||
|
//
|
||||||
|
// It is implied that members connected with the ON_COMMAND macro
|
||||||
|
// receive no arguments and are void of return type, e.g., "void OnAbout()".
|
||||||
|
//
|
||||||
|
BEGIN_MESSAGE_MAP( CMainWindow, CFrameWnd )
|
||||||
|
//{{AFX_MSG_MAP( CMainWindow )
|
||||||
|
ON_WM_PAINT()
|
||||||
|
ON_COMMAND( IDM_ABOUT, OnAbout )
|
||||||
|
ON_COMMAND( IDM_TEST, OnTest )
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CTheApp
|
||||||
|
|
||||||
|
// InitInstance:
|
||||||
|
// When any CTheApp object is created, this member function is automatically
|
||||||
|
// called. Any data may be set up at this point.
|
||||||
|
//
|
||||||
|
// Also, the main window of the application should be created and shown here.
|
||||||
|
// Return TRUE if the initialization is successful.
|
||||||
|
//
|
||||||
|
BOOL CTheApp::InitInstance()
|
||||||
|
{
|
||||||
|
TRACE( "HELLO WORLD\n" );
|
||||||
|
|
||||||
|
SetDialogBkColor(); // hook gray dialogs (was default in MFC V1)
|
||||||
|
|
||||||
|
wxEntry((WXHINSTANCE) m_hInstance, (WXHINSTANCE) m_hPrevInstance, m_lpCmdLine, m_nCmdShow, FALSE);
|
||||||
|
|
||||||
|
/*
|
||||||
|
m_pMainWnd = new CMainWindow();
|
||||||
|
m_pMainWnd->ShowWindow( m_nCmdShow );
|
||||||
|
m_pMainWnd->UpdateWindow();
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (wxTheApp && wxTheApp->GetTopWindow())
|
||||||
|
{
|
||||||
|
m_pMainWnd = new CDummyWindow((HWND) wxTheApp->GetTopWindow()->GetHWND());
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CTheApp::ExitInstance()
|
||||||
|
{
|
||||||
|
wxApp::CleanUp();
|
||||||
|
|
||||||
|
return CWinApp::ExitInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Override this to provide wxWindows message loop
|
||||||
|
// compatibility
|
||||||
|
|
||||||
|
BOOL CTheApp::PreTranslateMessage(MSG *msg)
|
||||||
|
{
|
||||||
|
if (wxTheApp && wxTheApp->ProcessMessage((WXMSG*) msg))
|
||||||
|
return TRUE;
|
||||||
|
else
|
||||||
|
return CWinApp::PreTranslateMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL CTheApp::OnIdle(LONG lCount)
|
||||||
|
{
|
||||||
|
if (wxTheApp)
|
||||||
|
return wxTheApp->ProcessIdle();
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* wxWindows elements
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
bool MyApp::OnInit(void)
|
||||||
|
{
|
||||||
|
// Don't exit app when the top level frame is deleted
|
||||||
|
// SetExitOnFrameDelete(FALSE);
|
||||||
|
|
||||||
|
// Create a red pen
|
||||||
|
red_pen = new wxPen("RED", 3, wxSOLID);
|
||||||
|
|
||||||
|
// Create a small font
|
||||||
|
small_font = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL);
|
||||||
|
|
||||||
|
wxFrame* frame = CreateFrame();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxFrame *MyApp::CreateFrame(void)
|
||||||
|
{
|
||||||
|
MyChild *subframe = new MyChild(NULL, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300),
|
||||||
|
wxDEFAULT_FRAME);
|
||||||
|
|
||||||
|
subframe->SetTitle("wxWindows canvas frame");
|
||||||
|
|
||||||
|
// Give it a status line
|
||||||
|
subframe->CreateStatusBar();
|
||||||
|
|
||||||
|
// Make a menubar
|
||||||
|
wxMenu *file_menu = new wxMenu;
|
||||||
|
|
||||||
|
file_menu->Append(HELLO_NEW, "&New MFC Window");
|
||||||
|
file_menu->Append(HELLO_QUIT, "&Close");
|
||||||
|
|
||||||
|
wxMenuBar *menu_bar = new wxMenuBar;
|
||||||
|
|
||||||
|
menu_bar->Append(file_menu, "&File");
|
||||||
|
|
||||||
|
// Associate the menu bar with the frame
|
||||||
|
subframe->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
|
int width, height;
|
||||||
|
subframe->GetClientSize(&width, &height);
|
||||||
|
|
||||||
|
MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height));
|
||||||
|
wxCursor *cursor = new wxCursor(wxCURSOR_PENCIL);
|
||||||
|
canvas->SetCursor(cursor);
|
||||||
|
subframe->canvas = canvas;
|
||||||
|
|
||||||
|
// Give it scrollbars
|
||||||
|
// canvas->SetScrollbars(20, 20, 50, 50, 4, 4);
|
||||||
|
|
||||||
|
subframe->Show(TRUE);
|
||||||
|
// Return the main frame window
|
||||||
|
return subframe;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
|
||||||
|
EVT_PAINT(MyCanvas::OnPaint)
|
||||||
|
EVT_MOUSE_EVENTS(MyCanvas::OnMouseEvent)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
// Define a constructor for my canvas
|
||||||
|
MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size):
|
||||||
|
wxScrolledWindow(parent, -1, pos, size)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define the repainting behaviour
|
||||||
|
void MyCanvas::OnPaint(wxPaintEvent& event)
|
||||||
|
{
|
||||||
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
|
dc.SetFont(small_font);
|
||||||
|
dc.SetPen(wxGREEN_PEN);
|
||||||
|
dc.DrawLine(0, 0, 200, 200);
|
||||||
|
dc.DrawLine(200, 0, 0, 200);
|
||||||
|
|
||||||
|
dc.SetBrush(wxCYAN_BRUSH);
|
||||||
|
dc.SetPen(wxRED_PEN);
|
||||||
|
dc.DrawRectangle(100, 100, 100, 50);
|
||||||
|
dc.DrawRoundedRectangle(150, 150, 100, 50, 20);
|
||||||
|
|
||||||
|
dc.DrawEllipse(250, 250, 100, 50);
|
||||||
|
dc.DrawSpline(50, 200, 50, 100, 200, 10);
|
||||||
|
dc.DrawLine(50, 230, 200, 230);
|
||||||
|
dc.DrawText("This is a test string", 50, 230);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This implements a tiny doodling program! Drag the mouse using
|
||||||
|
// the left button.
|
||||||
|
void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||||
|
{
|
||||||
|
wxClientDC dc(this);
|
||||||
|
dc.SetPen(wxBLACK_PEN);
|
||||||
|
long x, y;
|
||||||
|
event.Position(&x, &y);
|
||||||
|
if (xpos > -1 && ypos > -1 && event.Dragging())
|
||||||
|
{
|
||||||
|
dc.DrawLine(xpos, ypos, x, y);
|
||||||
|
}
|
||||||
|
xpos = x;
|
||||||
|
ypos = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MyChild, wxFrame)
|
||||||
|
EVT_MENU(HELLO_QUIT, MyChild::OnQuit)
|
||||||
|
EVT_MENU(HELLO_NEW, MyChild::OnNew)
|
||||||
|
EVT_ACTIVATE(MyChild::OnActivate)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
MyChild::MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, const long style):
|
||||||
|
wxFrame(frame, -1, title, pos, size, style)
|
||||||
|
{
|
||||||
|
canvas = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
MyChild::~MyChild(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyChild::OnQuit(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
Close(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyChild::OnNew(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
CMainWindow *mainWin = new CMainWindow();
|
||||||
|
mainWin->ShowWindow( TRUE );
|
||||||
|
mainWin->UpdateWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyChild::OnActivate(wxActivateEvent& event)
|
||||||
|
{
|
||||||
|
if (event.GetActive() && canvas)
|
||||||
|
canvas->SetFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool MyChild::OnClose(void)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Dummy MFC window for specifying a valid main window to MFC, using
|
||||||
|
// a wxWindows HWND.
|
||||||
|
CDummyWindow::CDummyWindow(HWND hWnd):CWnd()
|
||||||
|
{
|
||||||
|
Attach(hWnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't let the CWnd destructor delete the HWND
|
||||||
|
CDummyWindow::~CDummyWindow(void)
|
||||||
|
{
|
||||||
|
Detach();
|
||||||
|
}
|
||||||
|
|
21
samples/mfc/mfctest.def
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
; hello.def : Declares the module parameters for the application.
|
||||||
|
;
|
||||||
|
; This is a part of the Microsoft Foundation Classes C++ library.
|
||||||
|
; Copyright (C) 1992 Microsoft Corporation
|
||||||
|
; All rights reserved.
|
||||||
|
;
|
||||||
|
; This source code is only intended as a supplement to the
|
||||||
|
; Microsoft Foundation Classes Reference and Microsoft
|
||||||
|
; WinHelp documentation provided with the library.
|
||||||
|
; See these sources for detailed information regarding the
|
||||||
|
; Microsoft Foundation Classes product.
|
||||||
|
|
||||||
|
NAME Hello
|
||||||
|
DESCRIPTION 'Hello Microsoft Foundation Classes Windows Application'
|
||||||
|
|
||||||
|
EXETYPE WINDOWS
|
||||||
|
|
||||||
|
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||||
|
DATA PRELOAD MOVEABLE MULTIPLE
|
||||||
|
|
||||||
|
HEAPSIZE 1024
|
66
samples/mfc/mfctest.h
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// hello.h : Declares the class interfaces for the application.
|
||||||
|
// Hello is a simple program which consists of a main window
|
||||||
|
// and an "About" dialog which can be invoked by a menu choice.
|
||||||
|
// It is intended to serve as a starting-point for new
|
||||||
|
// applications.
|
||||||
|
//
|
||||||
|
// This is a part of the Microsoft Foundation Classes C++ library.
|
||||||
|
// Copyright (C) 1992 Microsoft Corporation
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// This source code is only intended as a supplement to the
|
||||||
|
// Microsoft Foundation Classes Reference and Microsoft
|
||||||
|
// WinHelp documentation provided with the library.
|
||||||
|
// See these sources for detailed information regarding the
|
||||||
|
// Microsoft Foundation Classes product.
|
||||||
|
|
||||||
|
#ifndef __MFCTEST_H__
|
||||||
|
#define __MFCTEST_H__
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// CMainWindow:
|
||||||
|
// See hello.cpp for the code to the member functions and the message map.
|
||||||
|
//
|
||||||
|
class CMainWindow : public CFrameWnd
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CMainWindow();
|
||||||
|
|
||||||
|
//{{AFX_MSG( CMainWindow )
|
||||||
|
afx_msg void OnPaint();
|
||||||
|
afx_msg void OnAbout();
|
||||||
|
afx_msg void OnTest();
|
||||||
|
//}}AFX_MSG
|
||||||
|
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
// A dummy CWnd pointing to a wxWindow's HWND
|
||||||
|
class CDummyWindow: public CWnd
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CDummyWindow(HWND hWnd);
|
||||||
|
~CDummyWindow(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// CTheApp:
|
||||||
|
// See hello.cpp for the code to the InitInstance member function.
|
||||||
|
//
|
||||||
|
class CTheApp : public CWinApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BOOL InitInstance();
|
||||||
|
int ExitInstance();
|
||||||
|
|
||||||
|
// Override this to provide wxWindows message loop
|
||||||
|
// compatibility
|
||||||
|
BOOL PreTranslateMessage(MSG *msg);
|
||||||
|
BOOL OnIdle(LONG lCount);
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#endif // __MFCTEST_H__
|
BIN
samples/mfc/mfctest.ico
Normal file
After Width: | Height: | Size: 766 B |
108
samples/mfc/mfctest.rc
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
//Microsoft App Studio generated resource script.
|
||||||
|
//
|
||||||
|
#include "wx/msw/wx.rc"
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
|
#include "afxres.h"
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Icon
|
||||||
|
//
|
||||||
|
|
||||||
|
AFX_IDI_STD_FRAME ICON DISCARDABLE "MFCTEST.ICO"
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Menu
|
||||||
|
//
|
||||||
|
|
||||||
|
MAINMENU MENU DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
POPUP "&File"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "&Test wxWindows", IDM_TEST
|
||||||
|
END
|
||||||
|
POPUP "&Help"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "&About Hello...\tF1", IDM_ABOUT
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Accelerator
|
||||||
|
//
|
||||||
|
|
||||||
|
MAINACCELTABLE ACCELERATORS MOVEABLE PURE
|
||||||
|
BEGIN
|
||||||
|
VK_F1, IDM_ABOUT, VIRTKEY
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Dialog
|
||||||
|
//
|
||||||
|
|
||||||
|
ABOUTBOX DIALOG DISCARDABLE 34, 22, 144, 75
|
||||||
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
|
CAPTION "About Hello"
|
||||||
|
FONT 8, "Helv"
|
||||||
|
BEGIN
|
||||||
|
CTEXT "Microsoft Windows",IDC_STATIC,0,5,144,8
|
||||||
|
CTEXT "Microsoft Foundation Classes",IDC_STATIC,0,14,144,8
|
||||||
|
CTEXT "Hello, Windows!",IDC_STATIC,0,23,144,8
|
||||||
|
CTEXT "Version 2.0",IDC_STATIC,0,36,144,8
|
||||||
|
DEFPUSHBUTTON "OK",IDOK,56,53,32,14,WS_GROUP
|
||||||
|
END
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"#include ""afxres.h""\r\n"
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
18
samples/mfc/resource.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// App Studio generated include file.
|
||||||
|
// Used by HELLO.RC
|
||||||
|
//
|
||||||
|
#define IDM_ABOUT 100
|
||||||
|
#define IDM_TEST 101
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 110
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 112
|
||||||
|
#endif
|
||||||
|
#endif
|
12
samples/mfc/stdafx.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// This is a part of the Microsoft Foundation Classes C++ library.
|
||||||
|
// Copyright (C) 1992 Microsoft Corporation
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// This source code is only intended as a supplement to the
|
||||||
|
// Microsoft Foundation Classes Reference and Microsoft
|
||||||
|
// WinHelp documentation provided with the library.
|
||||||
|
// See these sources for detailed information regarding the
|
||||||
|
// Microsoft Foundation Classes product.
|
||||||
|
|
||||||
|
|
||||||
|
#include <afxwin.h>
|
BIN
samples/nativdlg/aiai.ico
Normal file
After Width: | Height: | Size: 766 B |
142
samples/nativdlg/dialog1.rc
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
//Microsoft Developer Studio generated resource script.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef __WINDOWS__
|
||||||
|
#define __WINDOWS__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __WIN32__
|
||||||
|
#define __WIN32__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __WIN95__
|
||||||
|
#define __WIN95__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#define wxID_OK 5100
|
||||||
|
#define wxID_CANCEL 5101
|
||||||
|
#define wxID_APPLY 5102
|
||||||
|
#define wxID_YES 5103
|
||||||
|
#define wxID_NO 5104
|
||||||
|
/* #include <wx/msw/gnuwin32/winresrc.h> */
|
||||||
|
#else
|
||||||
|
#include <wx/defs.h>
|
||||||
|
/* #include <windows.h> */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#ifndef __MINGW32__
|
||||||
|
#include <commctrl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
|
// #include "afxres.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// English (U.K.) resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif //_WIN32
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Dialog
|
||||||
|
//
|
||||||
|
|
||||||
|
dialog1 DIALOG DISCARDABLE 0, 0, 271, 172
|
||||||
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
|
CAPTION "Test Dialog"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
DEFPUSHBUTTON "OK",wxID_OK,214,7,50,14
|
||||||
|
PUSHBUTTON "Cancel",wxID_CANCEL,214,24,50,14
|
||||||
|
GROUPBOX "wxStaticBox",IDC_STATIC,7,7,198,158
|
||||||
|
EDITTEXT IDC_EDIT1,64,23,125,14,ES_AUTOHSCROLL
|
||||||
|
LTEXT "wxStaticText",IDC_STATIC,13,25,42,8
|
||||||
|
CONTROL "wxCheckBox",IDC_CHECK1,"Button",BS_AUTOCHECKBOX |
|
||||||
|
WS_TABSTOP,14,47,57,10
|
||||||
|
COMBOBOX IDC_COMBO1,83,46,48,30,CBS_DROPDOWN | CBS_SORT |
|
||||||
|
WS_VSCROLL | WS_TABSTOP
|
||||||
|
CONTROL "wxRadioButton",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,
|
||||||
|
141,47,64,10
|
||||||
|
LISTBOX IDC_LIST1,14,69,86,40,LBS_SORT | LBS_NOINTEGRALHEIGHT |
|
||||||
|
WS_VSCROLL | WS_TABSTOP
|
||||||
|
SCROLLBAR IDC_SCROLLBAR1,111,71,76,11
|
||||||
|
CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH |
|
||||||
|
TBS_NOTICKS | WS_TABSTOP,10,116,100,15
|
||||||
|
CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_ARROWKEYS,111,90,
|
||||||
|
10,14
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DESIGNINFO
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
GUIDELINES DESIGNINFO DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
dialog1, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 264
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 165
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"#include ""afxres.h""\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
#endif // English (U.K.) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
64
samples/nativdlg/makefile.b32
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.b32
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds 32bit nativdlg example.
|
||||||
|
|
||||||
|
# WXWIN and BCCDIR are set by parent make
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makeb32.env
|
||||||
|
|
||||||
|
WXLIBDIR = $(WXDIR)\lib
|
||||||
|
WXLIB = $(WXLIBDIR)\wx32.lib
|
||||||
|
LIBS=$(WXLIB) cw32 import32
|
||||||
|
|
||||||
|
TARGET=nativdlg
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS =
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
OBJECTS = nativdlg.obj
|
||||||
|
|
||||||
|
$(TARGET).exe: $(OBJECTS) $(TARGET).def $(TARGET).res
|
||||||
|
tlink32 $(LINKFLAGS) @&&!
|
||||||
|
c0w32.obj $(OBJECTS)
|
||||||
|
$(TARGET)
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
$(TARGET).def
|
||||||
|
!
|
||||||
|
brc32 -K $(TARGET).res
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
bcc32 $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
.c.obj:
|
||||||
|
bcc32 $(CPPFLAGS) -P- -c {$< }
|
||||||
|
|
||||||
|
nativdlg.obj: nativdlg.$(SRCSUFF) nativdlg.h # dialog1.wxr
|
||||||
|
|
||||||
|
$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
brc32 -r /D__WINDOWS__ /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.rws
|
||||||
|
|
||||||
|
|
74
samples/nativdlg/makefile.bcc
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.bcc
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds resource example (DOS).
|
||||||
|
|
||||||
|
!if "$(BCCDIR)" == ""
|
||||||
|
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if "$(WXWIN)" == ""
|
||||||
|
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||||
|
!endif
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
THISDIR = $(WXDIR)\samples\resource
|
||||||
|
WXLIB = $(WXDIR)\lib\wx.lib
|
||||||
|
|
||||||
|
LIBS=$(WXLIB) mathwl cwl import
|
||||||
|
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
|
||||||
|
CFG=$(WXDIR)\src\wxwin.cfg
|
||||||
|
|
||||||
|
!ifndef FINAL
|
||||||
|
FINAL=0
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||||
|
OPT = -O2
|
||||||
|
DEBUG_FLAGS =
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
HEADERS = resource.h
|
||||||
|
SOURCES = resource.cc
|
||||||
|
OBJECTS = resource.obj
|
||||||
|
|
||||||
|
resource: resource.exe
|
||||||
|
|
||||||
|
all: resource.exe
|
||||||
|
|
||||||
|
resource.exe: $(WXLIB) resource.obj resource.def resource.res
|
||||||
|
tlink $(LINKFLAGS) @&&!
|
||||||
|
c0wl.obj resource.obj
|
||||||
|
resource
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
resource.def
|
||||||
|
!
|
||||||
|
rc -30 -K resource.res
|
||||||
|
|
||||||
|
.cc.obj:
|
||||||
|
bcc $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
resource.obj: resource.cc
|
||||||
|
|
||||||
|
resource.res : resource.rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
rc -r /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa resource
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.rws
|
86
samples/nativdlg/makefile.dos
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.dos
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds resource example (DOS).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info.
|
||||||
|
|
||||||
|
# Set WXDIR for your system
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\makemsc.env
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\resource
|
||||||
|
WXLIB = $(WXDIR)\lib\wx.lib
|
||||||
|
LIBS=$(WXLIB) oldnames libw llibcew commdlg ddeml shell mmsystem
|
||||||
|
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
|
||||||
|
DUMMY=$(WXDIR)\src\msw\dummy.obj
|
||||||
|
|
||||||
|
# Set this to nothing if using MS C++ 7
|
||||||
|
ZOPTION=/Z7
|
||||||
|
|
||||||
|
!ifndef FINAL
|
||||||
|
FINAL=0
|
||||||
|
!endif
|
||||||
|
|
||||||
|
PRECOMP = /YuWX_PREC.H /Fp$(WXDIR)\src\msw\wx.pch
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
CPPFLAGS=/AL /W3 /Zi $(ZOPTION) /G2sw /Od $(INC) $(PRECOMP) /Dwx_msw
|
||||||
|
LINKFLAGS=/NOD /CO /ONERROR:NOEXE /SEG:256
|
||||||
|
!else
|
||||||
|
CPPFLAGS=/AL /W3 /G2sw $(INC) /Ox $(PRECOMP) /Dwx_msw
|
||||||
|
LINKFLAGS=/NOD /ONERROR:NOEXE /SEG:256
|
||||||
|
!endif
|
||||||
|
|
||||||
|
HEADERS = resource.h
|
||||||
|
SOURCES = resource.$(SRCSUFF)
|
||||||
|
OBJECTS = resource.obj
|
||||||
|
|
||||||
|
resource: resource.exe
|
||||||
|
|
||||||
|
all: wx resource.exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
|
||||||
|
resource.exe: $(DUMMY) $(WXLIB) resource.obj resource.def resource.res
|
||||||
|
link $(LINKFLAGS) @<<
|
||||||
|
$(DUMMY) resource.obj,
|
||||||
|
resource,
|
||||||
|
NUL,
|
||||||
|
$(LIBS),
|
||||||
|
resource.def
|
||||||
|
;
|
||||||
|
<<
|
||||||
|
rc -31 -K resource.res
|
||||||
|
|
||||||
|
resource.obj: resource.h resource.$(SRCSUFF) dialog1.wxr $(DUMMY)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
resource.res : resource.rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
rc -r /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa resource
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.pdb
|
36
samples/nativdlg/makefile.g95
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.g95
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile for nativdlg example (UNIX).
|
||||||
|
|
||||||
|
WXDIR = ../..
|
||||||
|
|
||||||
|
# All common UNIX compiler flags and options are now in
|
||||||
|
# this central makefile.
|
||||||
|
include $(WXDIR)/src/makeg95.env
|
||||||
|
|
||||||
|
OBJECTS=$(OBJDIR)/nativdlg.$(OBJSUFF) $(OBJDIR)/nativdlg_resources.$(OBJSUFF)
|
||||||
|
|
||||||
|
all: $(OBJDIR) nativdlg$(GUISUFFIX)
|
||||||
|
|
||||||
|
$(OBJDIR):
|
||||||
|
mkdir $(OBJDIR)
|
||||||
|
|
||||||
|
$(OBJDIR)/nativdlg.$(OBJSUFF): nativdlg.$(SRCSUFF) nativdlg.h
|
||||||
|
$(CC) -c $(CPPFLAGS) -o $@ nativdlg.$(SRCSUFF)
|
||||||
|
|
||||||
|
nativdlg$(GUISUFFIX): $(OBJECTS) $(WXLIB)
|
||||||
|
$(CC) $(LDFLAGS) -o nativdlg$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
|
||||||
|
|
||||||
|
$(OBJDIR)/nativdlg_resources.o: nativdlg.rc
|
||||||
|
$(RESCOMP) -i nativdlg.rc -o $(OBJDIR)/nativdlg_resources.o $(RESFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJECTS) nativdlg$(GUISUFFIX).exe core *.rsc *.res
|
||||||
|
|
63
samples/nativdlg/makefile.nt
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.nt
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds nativdlg example (MS VC++).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
# Set WXDIR for your system
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\ntwxwin.mak
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\nativdlg
|
||||||
|
PROGRAM=nativdlg
|
||||||
|
|
||||||
|
OBJECTS = $(PROGRAM).obj
|
||||||
|
|
||||||
|
$(PROGRAM): $(PROGRAM).exe
|
||||||
|
|
||||||
|
all: wx $(PROGRAM).exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(link) @<<
|
||||||
|
-out:$(PROGRAM).exe
|
||||||
|
$(LINKFLAGS)
|
||||||
|
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(LIBS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
|
||||||
|
$(PROGRAM).obj: $(PROGRAM).h $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ)
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc dialog1.rc
|
||||||
|
$(rc) -r /i$(WXDIR)\include /D__WINDOWS__ -fo$@ $(PROGRAM).rc
|
||||||
|
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.pdb
|
||||||
|
|
35
samples/nativdlg/makefile.sc
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Symantec C++ makefile for hello example
|
||||||
|
# NOTE that peripheral libraries are now dealt in main wxWindows makefile.
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
WXLIB = $(WXDIR)\lib\wx.lib
|
||||||
|
INCDIR = $(WXDIR)\include
|
||||||
|
MSWINC = $(INCDIR)\msw
|
||||||
|
BASEINC = $(INCDIR)\base
|
||||||
|
|
||||||
|
CC=sc
|
||||||
|
RC=rc
|
||||||
|
CFLAGS = -o -ml -W -Dwx_msw
|
||||||
|
LDFLAGS = -ml -W
|
||||||
|
|
||||||
|
INCLUDE=$(BASEINC);$(MSWINC)
|
||||||
|
|
||||||
|
LIBS=$(WXLIB) libw.lib commdlg.lib shell.lib
|
||||||
|
|
||||||
|
.cc.obj:
|
||||||
|
*$(CC) -c $(CFLAGS) -I$(INCLUDE) $<
|
||||||
|
|
||||||
|
.rc.res:
|
||||||
|
*$(RC) -r -I$(INCLUDE) $<
|
||||||
|
|
||||||
|
hello.exe: hello.obj hello.def hello.res
|
||||||
|
*$(CC) $(LDFLAGS) -o$@ hello.obj hello.def $(LIBS)
|
||||||
|
*$(RC) -k hello.res
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-del *.obj
|
||||||
|
-del *.exe
|
||||||
|
-del *.res
|
||||||
|
-del *.map
|
||||||
|
-del *.rws
|
||||||
|
|
76
samples/nativdlg/makefile.unx
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.unx
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile for resource example (UNIX).
|
||||||
|
|
||||||
|
WXDIR = ../..
|
||||||
|
|
||||||
|
# All common UNIX compiler flags and options are now in
|
||||||
|
# this central makefile.
|
||||||
|
include $(WXDIR)/src/make.env
|
||||||
|
|
||||||
|
OBJECTS=$(OBJDIR)/resource.$(OBJSUFF)
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
|
all: $(OBJDIR) resource$(GUISUFFIX)
|
||||||
|
|
||||||
|
wxmotif:
|
||||||
|
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif
|
||||||
|
|
||||||
|
wxxview:
|
||||||
|
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview
|
||||||
|
|
||||||
|
wxhp:
|
||||||
|
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx hp
|
||||||
|
|
||||||
|
# For SGI, include -lPW on your LDLIBS
|
||||||
|
motif: wxmotif
|
||||||
|
$(MAKE) -f makefile.unx all GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' WXLIB=$(WXDIR)/lib/libwx_motif.a OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK=
|
||||||
|
|
||||||
|
xview: wxxview
|
||||||
|
$(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' LDLIBS='$(XVIEWLDLIBS)'
|
||||||
|
|
||||||
|
hp: wxhp
|
||||||
|
$(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC OPT='' DEBUG='$(DEBUG)' WARN='-w' \
|
||||||
|
XINCLUDE='$(HPXINCLUDE)' \
|
||||||
|
XLIB='$(HPXLIB)' \
|
||||||
|
XVIEW_LINK='' \
|
||||||
|
LDLIBS='$(HPLDLIBS)'
|
||||||
|
|
||||||
|
$(OBJDIR):
|
||||||
|
mkdir $(OBJDIR)
|
||||||
|
|
||||||
|
resource$(GUISUFFIX): $(OBJDIR)/resource.$(OBJSUFF) $(WXLIB)
|
||||||
|
$(CC) $(LDFLAGS) -o resource$(GUISUFFIX) $(OBJDIR)/resource.$(OBJSUFF) $(XVIEW_LINK) $(LDLIBS)
|
||||||
|
|
||||||
|
$(OBJDIR)/resource.$(OBJSUFF): resource.$(SRCSUFF) resource.h
|
||||||
|
$(CC) -c $(CPPFLAGS) -o $@ resource.$(SRCSUFF)
|
||||||
|
|
||||||
|
clean_motif:
|
||||||
|
$(MAKE) -f makefile.unx GUISUFFIX=_motif cleanany
|
||||||
|
|
||||||
|
clean_ol:
|
||||||
|
$(MAKE) -f makefile.unx GUISUFFIX=_ol cleanany
|
||||||
|
|
||||||
|
clean_hp:
|
||||||
|
$(MAKE) -f makefile.unx GUISUFFIX=_hp cleanany
|
||||||
|
|
||||||
|
cleanany:
|
||||||
|
rm -f $(OBJECTS) resource$(GUISUFFIX) core
|
||||||
|
|
||||||
|
wxclean_ol:
|
||||||
|
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_ol
|
||||||
|
|
||||||
|
wxclean_motif:
|
||||||
|
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_motif
|
||||||
|
|
||||||
|
wxclean_hp:
|
||||||
|
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_hp
|
||||||
|
|
38
samples/nativdlg/makefile.vms
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#************************************************************************
|
||||||
|
# Makefile for HELLO under VMS
|
||||||
|
# by Stefan Hammes
|
||||||
|
# (incomplete) update history:
|
||||||
|
# 11.04.95
|
||||||
|
#************************************************************************
|
||||||
|
|
||||||
|
#************************************************************************
|
||||||
|
# Definition section
|
||||||
|
# (cave: definitions and includes must begin with ',')
|
||||||
|
#************************************************************************
|
||||||
|
|
||||||
|
APPOPTS =
|
||||||
|
APPDEFS =
|
||||||
|
APPINCS =
|
||||||
|
|
||||||
|
#************************************************************************
|
||||||
|
# Module section
|
||||||
|
#************************************************************************
|
||||||
|
|
||||||
|
# Name of main module
|
||||||
|
MAIN = hello
|
||||||
|
|
||||||
|
# Object modules of the application.
|
||||||
|
OBJS = hello.obj
|
||||||
|
|
||||||
|
.include [--.src]makevms.env
|
||||||
|
|
||||||
|
# main dependency
|
||||||
|
$(MAIN).exe : $(MAIN).$(OBJ)
|
||||||
|
$(LINK) $(LINKFLAGS) /exec=$(MAIN).exe $(MAIN).$(OBJ),$(WXLIB)/lib,$(OPTSFILE)/option
|
||||||
|
- purge *.exe
|
||||||
|
|
||||||
|
#************************************************************************
|
||||||
|
# Header file depedencies following
|
||||||
|
#************************************************************************
|
||||||
|
hello.obj : hello.cc hello.h
|
||||||
|
|
42
samples/nativdlg/makefile.wat
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#
|
||||||
|
# Makefile for WATCOM
|
||||||
|
#
|
||||||
|
# Created by D.Chubraev, chubraev@iem.ee.ethz.ch
|
||||||
|
# 8 Nov 1994
|
||||||
|
#
|
||||||
|
|
||||||
|
WXDIR = ..\..
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\makewat.env
|
||||||
|
|
||||||
|
WXLIB = $(WXDIR)\lib
|
||||||
|
NAME = hello
|
||||||
|
LNK = $(name).lnk
|
||||||
|
OBJS = $(name).obj
|
||||||
|
|
||||||
|
PRECOMP=
|
||||||
|
|
||||||
|
all: $(name).exe
|
||||||
|
|
||||||
|
$(name).exe : $(OBJS) $(name).res $(LNK) $(WXLIB)\wx$(LEVEL).lib
|
||||||
|
wlink @$(LNK)
|
||||||
|
$(BINDCOMMAND) $(name).res
|
||||||
|
|
||||||
|
$(name).res : $(name).rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
$(RC) $(RESFLAGS1) $(name).rc
|
||||||
|
|
||||||
|
$(LNK) : makefile.wat
|
||||||
|
%create $(LNK)
|
||||||
|
@%append $(LNK) debug all
|
||||||
|
@%append $(LNK) system $(LINKOPTION)
|
||||||
|
@%append $(LNK) $(MINDATA)
|
||||||
|
@%append $(LNK) $(MAXDATA)
|
||||||
|
@%append $(LNK) $(STACK)
|
||||||
|
@%append $(LNK) name $(name)
|
||||||
|
@%append $(LNK) file $(WXLIB)\wx$(LEVEL).lib
|
||||||
|
@for %i in ($(EXTRALIBS)) do @%append $(LNK) file %i
|
||||||
|
@for %i in ($(OBJS)) do @%append $(LNK) file %i
|
||||||
|
|
||||||
|
clean: .SYMBOLIC
|
||||||
|
-erase *.obj *.bak *.err *.pch *.lib *.lnk *.res *.exe *.rex
|
||||||
|
|
130
samples/nativdlg/nativdlg.cpp
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: nativdlg.cpp
|
||||||
|
// Purpose: Native Windows dialog sample
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 04/01/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart and Markus Holzem
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/wx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/resource.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include "nativdlg.h"
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
// Declare two frames
|
||||||
|
MyFrame *frame = NULL;
|
||||||
|
|
||||||
|
IMPLEMENT_APP(MyApp)
|
||||||
|
|
||||||
|
// Testing of ressources
|
||||||
|
MyApp::MyApp()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MyApp::OnInit(void)
|
||||||
|
{
|
||||||
|
// Create the main frame window
|
||||||
|
frame = new MyFrame(NULL, -1, "wxWindows Native Dialog Sample", wxPoint(0, 0), wxSize(300, 250));
|
||||||
|
|
||||||
|
// Give it a status line
|
||||||
|
frame->CreateStatusBar(2);
|
||||||
|
|
||||||
|
// Make a menubar
|
||||||
|
wxMenu *file_menu = new wxMenu;
|
||||||
|
|
||||||
|
file_menu->Append(RESOURCE_TEST1, "&Dialog box test", "Test dialog box resource");
|
||||||
|
file_menu->Append(RESOURCE_QUIT, "E&xit", "Quit program");
|
||||||
|
|
||||||
|
wxMenuBar *menu_bar = new wxMenuBar;
|
||||||
|
|
||||||
|
menu_bar->Append(file_menu, "&File");
|
||||||
|
|
||||||
|
// Associate the menu bar with the frame
|
||||||
|
frame->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
|
// Make a panel
|
||||||
|
frame->panel = new wxWindow(frame, -1, wxPoint(0, 0), wxSize(400, 400), 0, "MyMainFrame");
|
||||||
|
frame->Show(TRUE);
|
||||||
|
|
||||||
|
// Return the main frame window
|
||||||
|
SetTopWindow(frame);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||||
|
EVT_MENU(RESOURCE_QUIT, MyFrame::OnQuit)
|
||||||
|
EVT_MENU(RESOURCE_TEST1, MyFrame::OnTest1)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
// Define my frame constructor
|
||||||
|
MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size):
|
||||||
|
wxFrame(parent, id, title, pos, size)
|
||||||
|
{
|
||||||
|
panel = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyFrame::OnQuit(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
Close(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyFrame::OnTest1(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
MyDialog *dialog = new MyDialog;
|
||||||
|
if (dialog->LoadNativeDialog(this, dialog1))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
wxTextCtrl *text = (wxTextCtrl *)wxFindWindowByName("multitext3", dialog);
|
||||||
|
if (text)
|
||||||
|
text->SetValue("wxWindows resource demo");
|
||||||
|
*/
|
||||||
|
dialog->SetModal(TRUE);
|
||||||
|
dialog->ShowModal();
|
||||||
|
}
|
||||||
|
dialog->Close(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MyFrame::OnClose(void)
|
||||||
|
{
|
||||||
|
Show(FALSE);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
|
||||||
|
EVT_BUTTON(wxID_OK, MyDialog::OnOk)
|
||||||
|
EVT_BUTTON(wxID_CANCEL, MyDialog::OnCancel)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
|
void MyDialog::OnOk(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
EndModal(wxID_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyDialog::OnCancel(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
EndModal(wxID_CANCEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
9
samples/nativdlg/nativdlg.def
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
NAME Resource
|
||||||
|
DESCRIPTION 'Resource'
|
||||||
|
EXETYPE WINDOWS
|
||||||
|
STUB 'WINSTUB.EXE'
|
||||||
|
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||||
|
DATA PRELOAD MOVEABLE MULTIPLE
|
||||||
|
HEAPSIZE 1024
|
||||||
|
STACKSIZE 16192
|
||||||
|
|
47
samples/nativdlg/nativdlg.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: nativdlg.h
|
||||||
|
// Purpose: Native Windows dialog sample
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 04/01/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart and Markus Holzem
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Define a new application
|
||||||
|
class MyApp: public wxApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyApp(void) ;
|
||||||
|
bool OnInit(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
class MyFrame: public wxFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxWindow *panel;
|
||||||
|
MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size);
|
||||||
|
bool OnClose(void);
|
||||||
|
void OnQuit(wxCommandEvent& event);
|
||||||
|
void OnTest1(wxCommandEvent& event);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
class MyDialog : public wxDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void OnOk(wxCommandEvent& event);
|
||||||
|
void OnCancel(wxCommandEvent& event);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
#define RESOURCE_QUIT 4
|
||||||
|
#define RESOURCE_TEST1 2
|
||||||
|
|
4
samples/nativdlg/nativdlg.rc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#include "wx/msw/wx.rc"
|
||||||
|
|
||||||
|
#include "dialog1.rc"
|
||||||
|
|
25
samples/nativdlg/resource.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Developer Studio generated include file.
|
||||||
|
// Used by dialog1.rc
|
||||||
|
//
|
||||||
|
#define dialog1 101
|
||||||
|
#define IDC_EDIT1 1000
|
||||||
|
#define IDC_CHECK1 1001
|
||||||
|
#define IDC_COMBO1 1003
|
||||||
|
#define IDC_RADIO1 1005
|
||||||
|
#define IDC_LIST1 1006
|
||||||
|
#define IDC_SCROLLBAR1 1007
|
||||||
|
#define IDC_SLIDER1 1008
|
||||||
|
#define IDC_SPIN1 1009
|
||||||
|
#define IDC_STATIC -1
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1010
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
BIN
samples/ownerdrw/bell.bmp
Normal file
After Width: | Height: | Size: 370 B |
64
samples/ownerdrw/makefile.b32
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.bcc
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds ownerdrw example (DOS).
|
||||||
|
|
||||||
|
# WXWIN and BCCDIR are set by parent make
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makeb32.env
|
||||||
|
|
||||||
|
WXLIBDIR = $(WXDIR)\lib
|
||||||
|
WXINC = $(WXDIR)\include\msw
|
||||||
|
WXLIB = $(WXLIBDIR)\wx32.lib
|
||||||
|
LIBS=$(WXLIB) cw32 import32
|
||||||
|
|
||||||
|
TARGET=ownerdrw
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS =
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
OBJECTS = ownerdrw.obj
|
||||||
|
|
||||||
|
$(TARGET).exe: $(OBJECTS) $(TARGET).def $(TARGET).res
|
||||||
|
tlink32 $(LINKFLAGS) @&&!
|
||||||
|
c0w32.obj $(OBJECTS)
|
||||||
|
$(TARGET)
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
$(TARGET).def
|
||||||
|
!
|
||||||
|
brc32 -K $(TARGET).res
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
bcc32 $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
.c.obj:
|
||||||
|
bcc32 $(CPPFLAGS) -P- -c {$< }
|
||||||
|
|
||||||
|
ownerdrw.obj: ownerdrw.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.rws
|
||||||
|
|
65
samples/ownerdrw/makefile.dos
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.dos
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds ownerdrw example (DOS).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\makemsc.env
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\ownerdrw
|
||||||
|
|
||||||
|
!ifndef FINAL
|
||||||
|
FINAL=0
|
||||||
|
!endif
|
||||||
|
|
||||||
|
HEADERS =
|
||||||
|
SOURCES = ownerdrw.$(SRCSUFF)
|
||||||
|
OBJECTS = ownerdrw.obj
|
||||||
|
|
||||||
|
all: ownerdrw.exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
ownerdrw.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) ownerdrw.obj ownerdrw.def ownerdrw.res
|
||||||
|
link $(LINKFLAGS) @<<
|
||||||
|
ownerdrw.obj $(WXDIR)\src\msw\dummy.obj,
|
||||||
|
ownerdrw,
|
||||||
|
NUL,
|
||||||
|
$(LIBS),
|
||||||
|
ownerdrw.def
|
||||||
|
;
|
||||||
|
<<
|
||||||
|
rc -K ownerdrw.res
|
||||||
|
|
||||||
|
ownerdrw.obj: ownerdrw.$(SRCSUFF)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
ownerdrw.res : ownerdrw.rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
rc -r /i$(WXDIR)\include ownerdrw
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.pdb
|
37
samples/ownerdrw/makefile.g95
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.unx
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile for ownerdrw example (UNIX).
|
||||||
|
|
||||||
|
WXDIR = ../..
|
||||||
|
|
||||||
|
# All common UNIX compiler flags and options are now in
|
||||||
|
# this central makefile.
|
||||||
|
include $(WXDIR)/src/makeg95.env
|
||||||
|
|
||||||
|
OBJECTS = $(OBJDIR)/ownerdrw.$(OBJSUFF) $(OBJDIR)/ownerdrw_resources.$(OBJSUFF)
|
||||||
|
|
||||||
|
all: $(OBJDIR) ownerdrw$(GUISUFFIX)$(EXESUFF)
|
||||||
|
|
||||||
|
wx:
|
||||||
|
|
||||||
|
$(OBJDIR):
|
||||||
|
mkdir $(OBJDIR)
|
||||||
|
|
||||||
|
ownerdrw$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB)
|
||||||
|
$(CC) $(LDFLAGS) -o ownerdrw$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
|
||||||
|
|
||||||
|
$(OBJDIR)/ownerdrw.$(OBJSUFF): ownerdrw.$(SRCSUFF)
|
||||||
|
$(CC) -c $(CPPFLAGS) -o $@ ownerdrw.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(OBJDIR)/ownerdrw_resources.o: ownerdrw.rc
|
||||||
|
$(RESCOMP) -i ownerdrw.rc -o $(OBJDIR)/ownerdrw_resources.o $(RESFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJECTS) ownerdrw$(GUISUFFIX).exe core *.rsc *.res
|
64
samples/ownerdrw/makefile.nt
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.nt
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds ownerdrw example (MS VC++).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
# Set WXDIR for your system
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
WXUSINGDLL=0
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\ntwxwin.mak
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\ownerdrw
|
||||||
|
PROGRAM=ownerdrw
|
||||||
|
|
||||||
|
OBJECTS = $(PROGRAM).obj
|
||||||
|
|
||||||
|
$(PROGRAM): $(PROGRAM).exe
|
||||||
|
|
||||||
|
all: wx $(PROGRAM).exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(link) @<<
|
||||||
|
-out:$(PROGRAM).exe
|
||||||
|
$(LINKFLAGS)
|
||||||
|
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(LIBS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
|
||||||
|
$(PROGRAM).obj: $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ)
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
|
||||||
|
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.pdb
|
BIN
samples/ownerdrw/mondrian.ico
Normal file
After Width: | Height: | Size: 766 B |
BIN
samples/ownerdrw/nosound.bmp
Normal file
After Width: | Height: | Size: 370 B |
293
samples/ownerdrw/ownerdrw.cpp
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: ownerdrw.cpp
|
||||||
|
// Purpose: Owner-draw sample, for Windows
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 13.11.97
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// headers & declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/wx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/ownerdrw.h"
|
||||||
|
#include "wx/menuitem.h"
|
||||||
|
#include "wx/msw/checklst.h"
|
||||||
|
|
||||||
|
// Define a new application type
|
||||||
|
class OwnerDrawnApp: public wxApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool OnInit();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Define a new frame type
|
||||||
|
class OwnerDrawnFrame : public wxFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctor & dtor
|
||||||
|
OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int w, int h);
|
||||||
|
~OwnerDrawnFrame();
|
||||||
|
|
||||||
|
// notifications
|
||||||
|
void OnQuit (wxCommandEvent& event);
|
||||||
|
void OnAbout (wxCommandEvent& event);
|
||||||
|
void OnListboxSelect (wxCommandEvent& event);
|
||||||
|
void OnCheckboxToggle (wxCommandEvent& event);
|
||||||
|
void OnListboxDblClick (wxCommandEvent& event);
|
||||||
|
bool OnClose () { return TRUE; }
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
||||||
|
private:
|
||||||
|
void InitMenu();
|
||||||
|
|
||||||
|
wxCheckListBox *m_pListBox;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
Menu_Quit = 1,
|
||||||
|
Menu_First = 100,
|
||||||
|
Menu_Test1, Menu_Test2, Menu_Test3,
|
||||||
|
Menu_Bitmap, Menu_Bitmap2,
|
||||||
|
Menu_Submenu, Menu_Sub1, Menu_Sub2, Menu_Sub3,
|
||||||
|
Control_First = 1000,
|
||||||
|
Control_Listbox, Control_Listbox2,
|
||||||
|
};
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(OwnerDrawnFrame, wxFrame)
|
||||||
|
EVT_MENU(Menu_Quit, OwnerDrawnFrame::OnQuit)
|
||||||
|
EVT_LISTBOX(Control_Listbox, OwnerDrawnFrame::OnListboxSelect)
|
||||||
|
EVT_CHECKLISTBOX(Control_Listbox, OwnerDrawnFrame::OnCheckboxToggle)
|
||||||
|
EVT_COMMAND(Control_Listbox, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED,
|
||||||
|
OwnerDrawnFrame::OnListboxDblClick)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
IMPLEMENT_APP(OwnerDrawnApp);
|
||||||
|
|
||||||
|
// init our app: create windows
|
||||||
|
bool OwnerDrawnApp::OnInit(void)
|
||||||
|
{
|
||||||
|
OwnerDrawnFrame *pFrame = new OwnerDrawnFrame(NULL, "wxWindows Ownerdraw Sample",
|
||||||
|
50, 50, 450, 340);
|
||||||
|
SetTopWindow(pFrame);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// create the menu bar for the main frame
|
||||||
|
void OwnerDrawnFrame::InitMenu()
|
||||||
|
{
|
||||||
|
// Make a menubar
|
||||||
|
wxMenu *file_menu = new wxMenu,
|
||||||
|
*sub_menu = new wxMenu;
|
||||||
|
|
||||||
|
// vars used for menu construction
|
||||||
|
wxMenuItem *pItem;
|
||||||
|
wxFont fontLarge(18, wxROMAN, wxNORMAL, wxBOLD, FALSE),
|
||||||
|
fontUlined(12, wxDEFAULT, wxNORMAL, wxNORMAL, TRUE),
|
||||||
|
fontItalic(12, wxMODERN, wxITALIC, wxBOLD, FALSE),
|
||||||
|
// should be at least of the size of bitmaps
|
||||||
|
fontBmp(14, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE);
|
||||||
|
|
||||||
|
// sorry for my artistic skills...
|
||||||
|
wxBitmap bmpBell("bell"), bmpSound("sound"), bmpNoSound("nosound");
|
||||||
|
|
||||||
|
// construct submenu
|
||||||
|
pItem = new wxMenuItem(sub_menu, Menu_Sub1, "Submenu &first", "large", TRUE);
|
||||||
|
pItem->SetFont(fontLarge);
|
||||||
|
sub_menu->Append(pItem);
|
||||||
|
|
||||||
|
pItem = new wxMenuItem(sub_menu, Menu_Sub2, "Submenu &second", "italic", TRUE);
|
||||||
|
pItem->SetFont(fontItalic);
|
||||||
|
sub_menu->Append(pItem);
|
||||||
|
|
||||||
|
pItem = new wxMenuItem(sub_menu, Menu_Sub3, "Submenu &third", "underlined", TRUE);
|
||||||
|
pItem->SetFont(fontUlined);
|
||||||
|
sub_menu->Append(pItem);
|
||||||
|
|
||||||
|
// construct menu
|
||||||
|
pItem = new wxMenuItem(file_menu, Menu_Test1, "&Uncheckable", "red item");
|
||||||
|
pItem->SetFont(*wxITALIC_FONT);
|
||||||
|
pItem->SetTextColour(wxColor(255, 0, 0));
|
||||||
|
pItem->SetMarginWidth(23);
|
||||||
|
file_menu->Append(pItem);
|
||||||
|
|
||||||
|
pItem = new wxMenuItem(file_menu, Menu_Test2, "&Checkable", "checkable item", TRUE);
|
||||||
|
pItem->SetFont(*wxSMALL_FONT);
|
||||||
|
file_menu->Append(pItem);
|
||||||
|
file_menu->Check(Menu_Test2, TRUE);
|
||||||
|
|
||||||
|
pItem = new wxMenuItem(file_menu, Menu_Test3, "&Disabled", "disabled item");
|
||||||
|
pItem->SetFont(*wxNORMAL_FONT);
|
||||||
|
file_menu->Append(pItem);
|
||||||
|
file_menu->Enable(Menu_Test3, FALSE);
|
||||||
|
|
||||||
|
file_menu->AppendSeparator();
|
||||||
|
|
||||||
|
pItem = new wxMenuItem(file_menu, Menu_Bitmap, "&Bell", "check/uncheck me!", TRUE);
|
||||||
|
pItem->SetFont(fontBmp);
|
||||||
|
pItem->SetBitmaps(bmpBell);
|
||||||
|
file_menu->Append(pItem);
|
||||||
|
|
||||||
|
pItem = new wxMenuItem(file_menu, Menu_Bitmap2, "So&und", "icon changes!", TRUE);
|
||||||
|
pItem->SetFont(fontBmp);
|
||||||
|
pItem->SetBitmaps(bmpSound, bmpNoSound);
|
||||||
|
file_menu->Append(pItem);
|
||||||
|
|
||||||
|
file_menu->AppendSeparator();
|
||||||
|
|
||||||
|
pItem = new wxMenuItem(file_menu, Menu_Submenu, "&Sub menu", "", TRUE, sub_menu);
|
||||||
|
pItem->SetFont(*wxSWISS_FONT);
|
||||||
|
file_menu->Append(pItem);
|
||||||
|
|
||||||
|
file_menu->AppendSeparator();
|
||||||
|
file_menu->Append(Menu_Quit, "&Quit", "Normal item");
|
||||||
|
|
||||||
|
wxMenuBar *menu_bar = new wxMenuBar;
|
||||||
|
|
||||||
|
menu_bar->Append(file_menu, "&File");
|
||||||
|
SetMenuBar(menu_bar);
|
||||||
|
}
|
||||||
|
|
||||||
|
// main frame constructor
|
||||||
|
OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int w, int h)
|
||||||
|
: wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
|
||||||
|
{
|
||||||
|
// set the icon
|
||||||
|
SetIcon(wxIcon("mondrian"));
|
||||||
|
|
||||||
|
// create the menu
|
||||||
|
InitMenu();
|
||||||
|
|
||||||
|
// make a panel with some controls
|
||||||
|
wxPanel *pPanel = new wxPanel(this, -1, wxPoint(0, 0),
|
||||||
|
wxSize(400, 200), wxTAB_TRAVERSAL);
|
||||||
|
|
||||||
|
// check list box
|
||||||
|
static const char* aszChoices[] = { "Hello", "world", "and",
|
||||||
|
"goodbye", "cruel", "world",
|
||||||
|
"-------", "owner-drawn", "listbox" };
|
||||||
|
|
||||||
|
wxString *astrChoices = new wxString[WXSIZEOF(aszChoices)];
|
||||||
|
uint ui;
|
||||||
|
for ( ui = 0; ui < WXSIZEOF(aszChoices); ui++ )
|
||||||
|
astrChoices[ui] = aszChoices[ui];
|
||||||
|
|
||||||
|
m_pListBox = new wxCheckListBox
|
||||||
|
(
|
||||||
|
pPanel, // parent
|
||||||
|
Control_Listbox, // control id
|
||||||
|
wxPoint(10, 10), // listbox poistion
|
||||||
|
wxSize(200, 200), // listbox size
|
||||||
|
WXSIZEOF(aszChoices), // number of strings
|
||||||
|
astrChoices // array of strings
|
||||||
|
);
|
||||||
|
|
||||||
|
delete [] astrChoices;
|
||||||
|
|
||||||
|
for ( ui = 0; ui < WXSIZEOF(aszChoices); ui += 2 ) {
|
||||||
|
m_pListBox->GetItem(ui)->SetBackgroundColour(wxColor(200, 200, 200));
|
||||||
|
}
|
||||||
|
|
||||||
|
m_pListBox->Check(2);
|
||||||
|
|
||||||
|
// normal (but owner-drawn) listbox
|
||||||
|
static const char* aszColors[] = { "Red", "Blue", "Pink",
|
||||||
|
"Green", "Yellow",
|
||||||
|
"Black", "Violet" };
|
||||||
|
struct { uint r, g, b; } aColors[] = { {255,0,0}, {0,0,255}, {255,128,192},
|
||||||
|
{0,255,0}, {255,255,128},
|
||||||
|
{0,0,0}, {128,0,255} };
|
||||||
|
astrChoices = new wxString[WXSIZEOF(aszColors)];
|
||||||
|
for ( ui = 0; ui < WXSIZEOF(aszColors); ui++ )
|
||||||
|
astrChoices[ui] = aszColors[ui];
|
||||||
|
|
||||||
|
wxListBox *pListBox = new wxListBox
|
||||||
|
(
|
||||||
|
pPanel, // parent
|
||||||
|
Control_Listbox2, // control id
|
||||||
|
wxPoint(220, 10), // listbox poistion
|
||||||
|
wxDefaultSize, // listbox size
|
||||||
|
WXSIZEOF(aszColors), // number of strings
|
||||||
|
astrChoices, // array of strings
|
||||||
|
wxLB_OWNERDRAW, // owner-drawn
|
||||||
|
wxDefaultValidator, //
|
||||||
|
wxListBoxNameStr
|
||||||
|
);
|
||||||
|
|
||||||
|
for ( ui = 0; ui < WXSIZEOF(aszColors); ui++ ) {
|
||||||
|
pListBox->GetItem(ui)->SetTextColour(wxColor(aColors[ui].r,
|
||||||
|
aColors[ui].g,
|
||||||
|
aColors[ui].b));
|
||||||
|
// yellow on white is horrible...
|
||||||
|
if ( ui == 4 )
|
||||||
|
pListBox->GetItem(ui)->SetBackgroundColour(wxColor(0, 0, 0));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// create the status line
|
||||||
|
const int widths[] = { -1, 60 };
|
||||||
|
CreateStatusBar(2);
|
||||||
|
SetStatusWidths(2, widths);
|
||||||
|
SetStatusText("no selection", 0);
|
||||||
|
|
||||||
|
Show(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
OwnerDrawnFrame::~OwnerDrawnFrame()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void OwnerDrawnFrame::OnQuit(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
Close(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OwnerDrawnFrame::OnAbout(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
wxMessageDialog dialog(this, "Demo of owner-drawn controls\n"
|
||||||
|
"About wxOwnerDrawn", wxYES_NO | wxCANCEL);
|
||||||
|
dialog.ShowModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OwnerDrawnFrame::OnListboxSelect(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
wxString strSelection;
|
||||||
|
uint nSel = event.GetSelection();
|
||||||
|
strSelection.sprintf("item %d selected (%schecked)", nSel,
|
||||||
|
m_pListBox->IsChecked(nSel) ? "" : "not ");
|
||||||
|
SetStatusText(strSelection);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OwnerDrawnFrame::OnListboxDblClick(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
wxString strSelection;
|
||||||
|
strSelection.sprintf("item %d double clicked", m_pListBox->GetSelection());
|
||||||
|
wxMessageDialog dialog(this, strSelection);
|
||||||
|
dialog.ShowModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OwnerDrawnFrame::OnCheckboxToggle(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
wxString strSelection;
|
||||||
|
uint nItem = event.GetInt();
|
||||||
|
strSelection.sprintf("item %d was %schecked", nItem,
|
||||||
|
m_pListBox->IsChecked(nItem) ? "" : "un");
|
||||||
|
SetStatusText(strSelection);
|
||||||
|
}
|
8
samples/ownerdrw/ownerdrw.def
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
NAME OWNERDRW
|
||||||
|
DESCRIPTION 'Owner-draw sample'
|
||||||
|
EXETYPE WINDOWS
|
||||||
|
STUB 'WINSTUB.EXE'
|
||||||
|
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||||
|
DATA PRELOAD MOVEABLE MULTIPLE
|
||||||
|
HEAPSIZE 4048
|
||||||
|
STACKSIZE 16000
|
6
samples/ownerdrw/ownerdrw.rc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
mondrian ICON "mondrian.ico"
|
||||||
|
bell BITMAP "bell.bmp"
|
||||||
|
sound BITMAP "sound.bmp"
|
||||||
|
nosound BITMAP "nosound.bmp"
|
||||||
|
#include "wx/msw/wx.rc"
|
||||||
|
|
BIN
samples/ownerdrw/sound.bmp
Normal file
After Width: | Height: | Size: 370 B |
BIN
samples/regtest/key1.ico
Normal file
After Width: | Height: | Size: 318 B |
BIN
samples/regtest/key2.ico
Normal file
After Width: | Height: | Size: 318 B |
BIN
samples/regtest/key3.ico
Normal file
After Width: | Height: | Size: 318 B |
37
samples/regtest/makefile.g95
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.unx
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile for regtest example (UNIX).
|
||||||
|
|
||||||
|
WXDIR = ../..
|
||||||
|
|
||||||
|
# All common UNIX compiler flags and options are now in
|
||||||
|
# this central makefile.
|
||||||
|
include $(WXDIR)/src/makeg95.env
|
||||||
|
|
||||||
|
OBJECTS = $(OBJDIR)/regtest.$(OBJSUFF) $(OBJDIR)/regtest_resources.$(OBJSUFF)
|
||||||
|
|
||||||
|
all: $(OBJDIR) regtest$(GUISUFFIX)$(EXESUFF)
|
||||||
|
|
||||||
|
wx:
|
||||||
|
|
||||||
|
$(OBJDIR):
|
||||||
|
mkdir $(OBJDIR)
|
||||||
|
|
||||||
|
regtest$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB)
|
||||||
|
$(CC) $(LDFLAGS) -o regtest$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
|
||||||
|
|
||||||
|
$(OBJDIR)/regtest.$(OBJSUFF): regtest.$(SRCSUFF)
|
||||||
|
$(CC) -c $(CPPFLAGS) -o $@ regtest.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(OBJDIR)/regtest_resources.o: regtest.rc
|
||||||
|
$(RESCOMP) -i regtest.rc -o $(OBJDIR)/regtest_resources.o $(RESFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJECTS) regtest$(GUISUFFIX).exe core *.rsc *.res
|
64
samples/regtest/makefile.nt
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.nt
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds regtest example (MS VC++).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
# Set WXDIR for your system
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
WXUSINGDLL=0
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\ntwxwin.mak
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\regtest
|
||||||
|
PROGRAM=regtest
|
||||||
|
|
||||||
|
OBJECTS = $(PROGRAM).obj
|
||||||
|
|
||||||
|
$(PROGRAM): $(PROGRAM).exe
|
||||||
|
|
||||||
|
all: wx $(PROGRAM).exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(link) @<<
|
||||||
|
-out:$(PROGRAM).exe
|
||||||
|
$(LINKFLAGS)
|
||||||
|
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(LIBS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
|
||||||
|
$(PROGRAM).obj: $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ)
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
|
||||||
|
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.pdb
|
BIN
samples/regtest/registry.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
834
samples/regtest/regtest.cpp
Normal file
@@ -0,0 +1,834 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: registry.cpp
|
||||||
|
// Purpose: wxRegKey class demo
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 03.04.98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/wx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/log.h"
|
||||||
|
#include "wx/treectrl.h"
|
||||||
|
#include "wx/msw/registry.h"
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// application type
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class RegApp : public wxApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool OnInit(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// image list with registry icons
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class RegImageList : public wxImageList
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum Icon
|
||||||
|
{
|
||||||
|
Root,
|
||||||
|
ClosedKey,
|
||||||
|
OpenedKey,
|
||||||
|
TextValue,
|
||||||
|
BinaryValue,
|
||||||
|
};
|
||||||
|
|
||||||
|
RegImageList();
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// our control
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class RegTreeCtrl : public wxTreeCtrl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctor & dtor
|
||||||
|
RegTreeCtrl(wxWindow *parent, wxWindowID id);
|
||||||
|
virtual ~RegTreeCtrl();
|
||||||
|
|
||||||
|
// notifications
|
||||||
|
void OnDeleteItem (wxTreeEvent& event);
|
||||||
|
void OnItemExpanding(wxTreeEvent& event);
|
||||||
|
void OnSelChanged (wxTreeEvent& event);
|
||||||
|
|
||||||
|
void OnRightClick (wxMouseEvent& event);
|
||||||
|
void OnChar (wxKeyEvent& event);
|
||||||
|
|
||||||
|
// forwarded notifications (by the frame)
|
||||||
|
void OnMenuTest();
|
||||||
|
|
||||||
|
// operations
|
||||||
|
void DeleteSelected();
|
||||||
|
void CreateNewKey(const wxString& strName);
|
||||||
|
void CreateNewTextValue(const wxString& strName);
|
||||||
|
void CreateNewBinaryValue(const wxString& strName);
|
||||||
|
|
||||||
|
// information
|
||||||
|
bool IsKeySelected() const;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// array of children of the node
|
||||||
|
struct TreeNode;
|
||||||
|
WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
|
||||||
|
|
||||||
|
// structure describing a registry key/value
|
||||||
|
struct TreeNode
|
||||||
|
{
|
||||||
|
RegTreeCtrl *m_pTree; // must be !NULL
|
||||||
|
TreeNode *m_pParent; // NULL only for the root node
|
||||||
|
long m_id; // the id of the tree control item
|
||||||
|
wxString m_strName; // name of the key/value
|
||||||
|
TreeChildren m_aChildren; // array of subkeys/values
|
||||||
|
bool m_bKey; // key or value?
|
||||||
|
wxRegKey *m_pKey; // only may be !NULL if m_bKey == true
|
||||||
|
long m_lDummy; // dummy subkey (to make expansion possible)
|
||||||
|
|
||||||
|
// ctor
|
||||||
|
TreeNode() { m_lDummy = 0; }
|
||||||
|
|
||||||
|
// trivial accessors
|
||||||
|
long Id() const { return m_id; }
|
||||||
|
bool IsRoot() const { return m_pParent == NULL; }
|
||||||
|
bool IsKey() const { return m_bKey; }
|
||||||
|
TreeNode *Parent() const { return m_pParent; }
|
||||||
|
|
||||||
|
// notifications
|
||||||
|
bool OnExpand();
|
||||||
|
void OnCollapse();
|
||||||
|
|
||||||
|
// operations
|
||||||
|
void Refresh() { OnCollapse(); OnExpand(); }
|
||||||
|
void AddDummy();
|
||||||
|
void DestroyChildren();
|
||||||
|
const char *FullName() const;
|
||||||
|
|
||||||
|
// get the associated key: make sure the pointer is !NULL
|
||||||
|
wxRegKey& Key() { if ( !m_pKey ) OnExpand(); return *m_pKey; }
|
||||||
|
|
||||||
|
// dtor deletes all children
|
||||||
|
~TreeNode();
|
||||||
|
};
|
||||||
|
|
||||||
|
wxMenu *m_pMenuPopup;
|
||||||
|
TreeNode *m_pRoot;
|
||||||
|
wxImageList *m_imageList;
|
||||||
|
|
||||||
|
TreeNode *GetNode(const wxTreeEvent& event)
|
||||||
|
{ return (TreeNode *)GetItemData(event.m_item.m_itemId); }
|
||||||
|
|
||||||
|
public:
|
||||||
|
// create a new node and insert it to the tree
|
||||||
|
TreeNode *InsertNewTreeNode(TreeNode *pParent,
|
||||||
|
const wxString& strName,
|
||||||
|
int idImage = RegImageList::ClosedKey,
|
||||||
|
const wxString *pstrValue = NULL);
|
||||||
|
// add standard registry keys
|
||||||
|
void AddStdKeys();
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// the main window of our application
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class RegFrame : public wxFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctor & dtor
|
||||||
|
RegFrame(wxFrame *parent, char *title, int x, int y, int w, int h);
|
||||||
|
virtual ~RegFrame(void);
|
||||||
|
|
||||||
|
// callbacks
|
||||||
|
void OnQuit (wxCommandEvent& event);
|
||||||
|
void OnAbout(wxCommandEvent& event);
|
||||||
|
void OnTest (wxCommandEvent& event);
|
||||||
|
|
||||||
|
void OnExpand (wxCommandEvent& event);
|
||||||
|
void OnCollapse(wxCommandEvent& event);
|
||||||
|
void OnToggle (wxCommandEvent& event);
|
||||||
|
|
||||||
|
void OnDelete (wxCommandEvent& event);
|
||||||
|
void OnNewKey (wxCommandEvent& event);
|
||||||
|
void OnNewText (wxCommandEvent& event);
|
||||||
|
void OnNewBinary(wxCommandEvent& event);
|
||||||
|
|
||||||
|
bool OnClose () { return TRUE; }
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
|
private:
|
||||||
|
RegTreeCtrl *m_treeCtrl;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// various ids
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
Menu_Quit = 100,
|
||||||
|
Menu_About,
|
||||||
|
Menu_Test,
|
||||||
|
Menu_Expand,
|
||||||
|
Menu_Collapse,
|
||||||
|
Menu_Toggle,
|
||||||
|
Menu_New,
|
||||||
|
Menu_NewKey,
|
||||||
|
Menu_NewText,
|
||||||
|
Menu_NewBinary,
|
||||||
|
Menu_Delete,
|
||||||
|
|
||||||
|
Ctrl_RegTree = 200,
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// event tables
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(RegFrame, wxFrame)
|
||||||
|
EVT_MENU(Menu_Test, RegFrame::OnTest)
|
||||||
|
EVT_MENU(Menu_About, RegFrame::OnAbout)
|
||||||
|
EVT_MENU(Menu_Quit, RegFrame::OnQuit)
|
||||||
|
EVT_MENU(Menu_Expand, RegFrame::OnExpand)
|
||||||
|
EVT_MENU(Menu_Collapse, RegFrame::OnCollapse)
|
||||||
|
EVT_MENU(Menu_Toggle, RegFrame::OnToggle)
|
||||||
|
EVT_MENU(Menu_Delete, RegFrame::OnDelete)
|
||||||
|
EVT_MENU(Menu_NewKey, RegFrame::OnNewKey)
|
||||||
|
EVT_MENU(Menu_NewText, RegFrame::OnNewText)
|
||||||
|
EVT_MENU(Menu_NewBinary,RegFrame::OnNewBinary)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(RegTreeCtrl, wxTreeCtrl)
|
||||||
|
EVT_TREE_DELETE_ITEM (Ctrl_RegTree, RegTreeCtrl::OnDeleteItem)
|
||||||
|
EVT_TREE_ITEM_EXPANDING(Ctrl_RegTree, RegTreeCtrl::OnItemExpanding)
|
||||||
|
EVT_TREE_SEL_CHANGED (Ctrl_RegTree, RegTreeCtrl::OnSelChanged)
|
||||||
|
|
||||||
|
EVT_CHAR (RegTreeCtrl::OnChar)
|
||||||
|
EVT_RIGHT_DOWN(RegTreeCtrl::OnRightClick)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// global functions
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// create the "registry operations" menu
|
||||||
|
wxMenu *CreateRegistryMenu()
|
||||||
|
{
|
||||||
|
wxMenu *pMenuNew = new wxMenu;
|
||||||
|
pMenuNew->Append(Menu_NewKey, "&Key", "Create a new key");
|
||||||
|
pMenuNew->AppendSeparator();
|
||||||
|
pMenuNew->Append(Menu_NewText, "&Text value", "Create a new text value");
|
||||||
|
pMenuNew->Append(Menu_NewBinary, "&Binary value", "Create a new binary value");
|
||||||
|
|
||||||
|
wxMenu *pMenuReg = new wxMenu;
|
||||||
|
pMenuReg->Append(Menu_New, "&New", pMenuNew);
|
||||||
|
pMenuReg->Append(Menu_Delete, "&Delete...", "Delete selected key/value");
|
||||||
|
pMenuReg->AppendSeparator();
|
||||||
|
pMenuReg->Append(Menu_Expand, "&Expand", "Expand current key");
|
||||||
|
pMenuReg->Append(Menu_Collapse, "&Collapse", "Collapse current key");
|
||||||
|
pMenuReg->Append(Menu_Toggle, "&Toggle", "Toggle current key");
|
||||||
|
|
||||||
|
return pMenuReg;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// application class
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
IMPLEMENT_APP(RegApp)
|
||||||
|
|
||||||
|
// `Main program' equivalent, creating windows and returning main app frame
|
||||||
|
bool RegApp::OnInit()
|
||||||
|
{
|
||||||
|
// create the main frame window and show it
|
||||||
|
RegFrame *frame = new RegFrame(NULL, "wxRegKey Test", 50, 50, 600, 350);
|
||||||
|
frame->Show(true);
|
||||||
|
|
||||||
|
SetTopWindow(frame);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// RegFrame
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
RegFrame::RegFrame(wxFrame *parent, char *title, int x, int y, int w, int h)
|
||||||
|
: wxFrame(parent, -1, title, wxPoint(x, y), wxSize(w, h))
|
||||||
|
{
|
||||||
|
// this reduces flicker effects
|
||||||
|
SetBackgroundColour(wxColour(255, 255, 255));
|
||||||
|
|
||||||
|
// set the icon
|
||||||
|
// ------------
|
||||||
|
SetIcon(wxIcon("app_icon"));
|
||||||
|
|
||||||
|
// create menu
|
||||||
|
// -----------
|
||||||
|
wxMenu *pMenuFile = new wxMenu;
|
||||||
|
pMenuFile->Append(Menu_Test, "Te&st", "Test key creation");
|
||||||
|
pMenuFile->AppendSeparator();
|
||||||
|
pMenuFile->Append(Menu_About, "&About...", "Show an extraordinarly beautiful dialog");
|
||||||
|
pMenuFile->AppendSeparator();
|
||||||
|
pMenuFile->Append(Menu_Quit, "E&xit", "Quit this program");
|
||||||
|
|
||||||
|
wxMenuBar *pMenu = new wxMenuBar;
|
||||||
|
pMenu->Append(pMenuFile, "&File");
|
||||||
|
pMenu->Append(CreateRegistryMenu(), "&Registry");
|
||||||
|
SetMenuBar(pMenu);
|
||||||
|
|
||||||
|
// create child controls
|
||||||
|
// ---------------------
|
||||||
|
m_treeCtrl = new RegTreeCtrl(this, Ctrl_RegTree);
|
||||||
|
|
||||||
|
// create the status line
|
||||||
|
// ----------------------
|
||||||
|
int aWidths[2];
|
||||||
|
aWidths[0] = 200;
|
||||||
|
aWidths[1] = -1;
|
||||||
|
CreateStatusBar(2);
|
||||||
|
SetStatusWidths(2, aWidths);
|
||||||
|
}
|
||||||
|
|
||||||
|
RegFrame::~RegFrame(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnQuit(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
Close(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnAbout(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
wxMessageDialog dialog(this, "wxRegistry sample\n(c) 1998 Vadim Zeitlin",
|
||||||
|
"About wxRegistry", wxOK);
|
||||||
|
|
||||||
|
dialog.ShowModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnTest(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
m_treeCtrl->OnMenuTest();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnExpand(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
m_treeCtrl->ExpandItem(m_treeCtrl->GetSelection(), wxTREE_EXPAND_EXPAND);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnCollapse(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
m_treeCtrl->ExpandItem(m_treeCtrl->GetSelection(), wxTREE_EXPAND_COLLAPSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnToggle(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
m_treeCtrl->ExpandItem(m_treeCtrl->GetSelection(), wxTREE_EXPAND_TOGGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnDelete(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
m_treeCtrl->DeleteSelected();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnNewKey(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
if ( m_treeCtrl->IsKeySelected() ) {
|
||||||
|
m_treeCtrl->CreateNewKey(
|
||||||
|
wxGetTextFromUser("Enter the name of the new key"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnNewText(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
if ( m_treeCtrl->IsKeySelected() ) {
|
||||||
|
m_treeCtrl->CreateNewTextValue(
|
||||||
|
wxGetTextFromUser("Enter the name for the new text value"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnNewBinary(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
if ( m_treeCtrl->IsKeySelected() ) {
|
||||||
|
m_treeCtrl->CreateNewBinaryValue(
|
||||||
|
wxGetTextFromUser("Enter the name for the new binary value"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// RegImageList
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
RegImageList::RegImageList() : wxImageList(16, 16, TRUE)
|
||||||
|
{
|
||||||
|
// should be in sync with enum RegImageList::RegIcon
|
||||||
|
static const char *aszIcons[] = { "key1","key2","key3","value1","value2" };
|
||||||
|
wxString str = "icon_";
|
||||||
|
for ( uint n = 0; n < WXSIZEOF(aszIcons); n++ ) {
|
||||||
|
Add(wxIcon(str + aszIcons[n], wxBITMAP_TYPE_ICO_RESOURCE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// RegTreeCtrl
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// create a new tree item and insert it into the tree
|
||||||
|
RegTreeCtrl::TreeNode *RegTreeCtrl::InsertNewTreeNode(TreeNode *pParent,
|
||||||
|
const wxString& strName,
|
||||||
|
int idImage,
|
||||||
|
const wxString *pstrValue)
|
||||||
|
{
|
||||||
|
// create new item & insert it
|
||||||
|
TreeNode *pNewNode = new TreeNode;
|
||||||
|
pNewNode->m_pTree = this;
|
||||||
|
pNewNode->m_pParent = pParent;
|
||||||
|
pNewNode->m_strName = strName;
|
||||||
|
pNewNode->m_bKey = pstrValue == NULL;
|
||||||
|
pNewNode->m_pKey = NULL;
|
||||||
|
pNewNode->m_id = InsertItem(pParent ? pParent->m_id : 0,
|
||||||
|
pNewNode->IsKey() ? strName : *pstrValue,
|
||||||
|
idImage);
|
||||||
|
|
||||||
|
wxASSERT_MSG( pNewNode->m_id, "can't create tree control item!");
|
||||||
|
|
||||||
|
// save the pointer in the item
|
||||||
|
if ( !SetItemData(pNewNode->m_id, (long)pNewNode) ) {
|
||||||
|
wxFAIL_MSG("can't store item's data in tree control!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// add it to the list of parent's children
|
||||||
|
if ( pParent != NULL ) {
|
||||||
|
pParent->m_aChildren.Add(pNewNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
// force the [+] button (@@@ not very elegant...)
|
||||||
|
if ( pNewNode->IsKey() )
|
||||||
|
pNewNode->AddDummy();
|
||||||
|
|
||||||
|
return pNewNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegTreeCtrl::RegTreeCtrl(wxWindow *parent, wxWindowID id)
|
||||||
|
: wxTreeCtrl(parent, id, wxDefaultPosition, wxDefaultSize,
|
||||||
|
wxTR_HAS_BUTTONS | wxSUNKEN_BORDER)
|
||||||
|
{
|
||||||
|
// create the image list
|
||||||
|
// ---------------------
|
||||||
|
m_imageList = new RegImageList;
|
||||||
|
SetImageList(m_imageList, wxIMAGE_LIST_NORMAL);
|
||||||
|
|
||||||
|
// create root keys
|
||||||
|
// ----------------
|
||||||
|
m_pRoot = InsertNewTreeNode(NULL, "Registry Root", RegImageList::Root);
|
||||||
|
|
||||||
|
// create popup menu
|
||||||
|
// -----------------
|
||||||
|
m_pMenuPopup = CreateRegistryMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
RegTreeCtrl::~RegTreeCtrl()
|
||||||
|
{
|
||||||
|
delete m_pMenuPopup;
|
||||||
|
delete m_pRoot;
|
||||||
|
delete m_imageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::AddStdKeys()
|
||||||
|
{
|
||||||
|
for ( uint ui = 0; ui < wxRegKey::nStdKeys; ui++ ) {
|
||||||
|
InsertNewTreeNode(m_pRoot, wxRegKey::GetStdKeyName(ui));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// notifications
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void RegTreeCtrl::OnRightClick(wxMouseEvent& event)
|
||||||
|
{
|
||||||
|
int iFlags;
|
||||||
|
long lId = HitTest(wxPoint(event.GetX(), event.GetY()), iFlags);
|
||||||
|
if ( iFlags & wxTREE_HITTEST_ONITEMLABEL ) {
|
||||||
|
// popup menu only if an item was clicked
|
||||||
|
wxASSERT( lId != 0 );
|
||||||
|
SelectItem(lId);
|
||||||
|
PopupMenu(m_pMenuPopup, event.GetX(), event.GetY());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RegTreeCtrl::OnDeleteItem(wxTreeEvent& event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// test the key creation functions
|
||||||
|
void RegTreeCtrl::OnMenuTest()
|
||||||
|
{
|
||||||
|
long lId = GetSelection();
|
||||||
|
TreeNode *pNode = (TreeNode *)GetItemData(lId);
|
||||||
|
|
||||||
|
wxCHECK( pNode != NULL );
|
||||||
|
|
||||||
|
if ( pNode->IsRoot() ) {
|
||||||
|
wxLogError("Can't create a subkey under the root key.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !pNode->IsKey() ) {
|
||||||
|
wxLogError("Can't create a subkey under a value!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRegKey key1(pNode->Key(), "key1");
|
||||||
|
if ( key1.Create() ) {
|
||||||
|
wxRegKey key2a(key1, "key2a"), key2b(key1, "key2b");
|
||||||
|
if ( key2a.Create() && key2b.Create() ) {
|
||||||
|
// put some values under the newly created keys
|
||||||
|
key1.SetValue("first_term", "10");
|
||||||
|
key1.SetValue("second_term", "7");
|
||||||
|
key2a = "this is the unnamed value";
|
||||||
|
key2b.SetValue("sum", 17);
|
||||||
|
|
||||||
|
// refresh tree
|
||||||
|
pNode->Refresh();
|
||||||
|
wxLogStatus("Test keys successfully added.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wxLogError("Creation of test keys failed.");
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::OnChar(wxKeyEvent& event)
|
||||||
|
{
|
||||||
|
if ( event.KeyCode() == WXK_DELETE )
|
||||||
|
DeleteSelected();
|
||||||
|
else
|
||||||
|
wxTreeCtrl::OnChar(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::OnSelChanged(wxTreeEvent& event)
|
||||||
|
{
|
||||||
|
wxFrame *pFrame = (wxFrame *)(wxWindow::GetParent());
|
||||||
|
pFrame->SetStatusText(GetNode(event)->FullName(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event)
|
||||||
|
{
|
||||||
|
TreeNode *pNode = GetNode(event);
|
||||||
|
bool bExpanding = event.m_code == wxTREE_EXPAND_EXPAND;
|
||||||
|
|
||||||
|
// expansion might take some time
|
||||||
|
wxSetCursor(*wxHOURGLASS_CURSOR);
|
||||||
|
wxLogStatus("Working...");
|
||||||
|
wxYield(); // to give the status line a chance to refresh itself
|
||||||
|
|
||||||
|
if ( pNode->IsKey() ) {
|
||||||
|
if ( bExpanding ) {
|
||||||
|
// expanding: add subkeys/values
|
||||||
|
if ( !pNode->OnExpand() )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// collapsing: clean up
|
||||||
|
pNode->OnCollapse();
|
||||||
|
}
|
||||||
|
|
||||||
|
// change icon for non root key
|
||||||
|
if ( !pNode->IsRoot() ) {
|
||||||
|
int idIcon = bExpanding ? RegImageList::OpenedKey
|
||||||
|
: RegImageList::ClosedKey;
|
||||||
|
SetItemImage(pNode->Id(), idIcon, idIcon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wxLogStatus("Ok");
|
||||||
|
wxSetCursor(*wxSTANDARD_CURSOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// TreeNode implementation
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
bool RegTreeCtrl::TreeNode::OnExpand()
|
||||||
|
{
|
||||||
|
// remove dummy item
|
||||||
|
if ( m_lDummy != 0 )
|
||||||
|
m_pTree->DeleteItem(m_lDummy);
|
||||||
|
|
||||||
|
if ( IsRoot() ) {
|
||||||
|
// we're the root key
|
||||||
|
m_pTree->AddStdKeys();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Parent()->IsRoot() ) {
|
||||||
|
// we're a standard key
|
||||||
|
m_pKey = new wxRegKey(m_strName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// we're a normal key
|
||||||
|
m_pKey = new wxRegKey(*(Parent()->m_pKey), m_strName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !m_pKey->Open() ) {
|
||||||
|
m_lDummy = 0;
|
||||||
|
wxLogError("The key '%s' can't be opened.", FullName());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// enumeration variables
|
||||||
|
long l;
|
||||||
|
wxString str;
|
||||||
|
bool bCont;
|
||||||
|
|
||||||
|
// enumerate all subkeys
|
||||||
|
bCont = m_pKey->GetFirstKey(str, l);
|
||||||
|
while ( bCont ) {
|
||||||
|
m_pTree->InsertNewTreeNode(this, str, RegImageList::ClosedKey);
|
||||||
|
bCont = m_pKey->GetNextKey(str, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// enumerate all values
|
||||||
|
bCont = m_pKey->GetFirstValue(str, l);
|
||||||
|
while ( bCont ) {
|
||||||
|
wxString strItem;
|
||||||
|
if (str.IsEmpty())
|
||||||
|
strItem = "<default>";
|
||||||
|
else
|
||||||
|
strItem = str;
|
||||||
|
strItem += " = ";
|
||||||
|
|
||||||
|
// determine the appropriate icon
|
||||||
|
RegImageList::Icon icon;
|
||||||
|
switch ( m_pKey->GetValueType(str) ) {
|
||||||
|
case wxRegKey::Type_String:
|
||||||
|
case wxRegKey::Type_Expand_String:
|
||||||
|
case wxRegKey::Type_Multi_String:
|
||||||
|
{
|
||||||
|
wxString strValue;
|
||||||
|
icon = RegImageList::TextValue;
|
||||||
|
m_pKey->QueryValue(str, strValue);
|
||||||
|
strItem += strValue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case wxRegKey::Type_None:
|
||||||
|
// @@ handle the error...
|
||||||
|
icon = RegImageList::BinaryValue;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case wxRegKey::Type_Dword:
|
||||||
|
{
|
||||||
|
char szBuf[128];
|
||||||
|
long l;
|
||||||
|
m_pKey->QueryValue(str, &l);
|
||||||
|
sprintf(szBuf, "%lx", l);
|
||||||
|
strItem += szBuf;
|
||||||
|
}
|
||||||
|
|
||||||
|
// fall through
|
||||||
|
|
||||||
|
default:
|
||||||
|
icon = RegImageList::BinaryValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_pTree->InsertNewTreeNode(this, str, icon, &strItem);
|
||||||
|
bCont = m_pKey->GetNextValue(str, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::TreeNode::OnCollapse()
|
||||||
|
{
|
||||||
|
bool bHasChildren = !m_aChildren.IsEmpty();
|
||||||
|
DestroyChildren();
|
||||||
|
if ( bHasChildren )
|
||||||
|
AddDummy();
|
||||||
|
else
|
||||||
|
m_lDummy = 0;
|
||||||
|
|
||||||
|
delete m_pKey;
|
||||||
|
m_pKey = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::TreeNode::AddDummy()
|
||||||
|
{
|
||||||
|
// insert dummy item forcing appearance of [+] button
|
||||||
|
m_lDummy = m_pTree->InsertItem(Id(), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::TreeNode::DestroyChildren()
|
||||||
|
{
|
||||||
|
// destroy all children
|
||||||
|
uint nCount = m_aChildren.Count();
|
||||||
|
for ( uint n = 0; n < nCount; n++ ) {
|
||||||
|
long lId = m_aChildren[n]->Id();
|
||||||
|
delete m_aChildren[n];
|
||||||
|
m_pTree->DeleteItem(lId);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_aChildren.Empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
RegTreeCtrl::TreeNode::~TreeNode()
|
||||||
|
{
|
||||||
|
DestroyChildren();
|
||||||
|
|
||||||
|
delete m_pKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *RegTreeCtrl::TreeNode::FullName() const
|
||||||
|
{
|
||||||
|
static wxString s_strName;
|
||||||
|
|
||||||
|
if ( IsRoot() ) {
|
||||||
|
return "Registry Root";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// our own registry key might not (yet) exist or we might be a value,
|
||||||
|
// so just use the parent's and concatenate
|
||||||
|
s_strName = Parent()->FullName();
|
||||||
|
s_strName << '\\' << m_strName;
|
||||||
|
|
||||||
|
return s_strName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// operations on RegTreeCtrl
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void RegTreeCtrl::DeleteSelected()
|
||||||
|
{
|
||||||
|
long lCurrent = GetSelection(),
|
||||||
|
lParent = GetParent(lCurrent);
|
||||||
|
|
||||||
|
if ( lParent == 0 ) {
|
||||||
|
wxLogError("Can't delete root key.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent),
|
||||||
|
*pParent = (TreeNode *)GetItemData(lParent);
|
||||||
|
|
||||||
|
wxCHECK ( pCurrent && pParent );
|
||||||
|
|
||||||
|
if ( pParent->IsRoot() ) {
|
||||||
|
wxLogError("Can't delete standard key.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pCurrent->IsKey() ) {
|
||||||
|
if ( wxMessageBox("Do you really want to delete this key?",
|
||||||
|
"Confirmation",
|
||||||
|
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// must close key before deleting it
|
||||||
|
pCurrent->OnCollapse();
|
||||||
|
|
||||||
|
if ( pParent->Key().DeleteKey(pCurrent->m_strName) )
|
||||||
|
pParent->Refresh();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ( wxMessageBox("Do you really want to delete this value?",
|
||||||
|
"Confirmation",
|
||||||
|
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pParent->Key().DeleteValue(pCurrent->m_strName) )
|
||||||
|
pParent->Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::CreateNewKey(const wxString& strName)
|
||||||
|
{
|
||||||
|
long lCurrent = GetSelection();
|
||||||
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
||||||
|
|
||||||
|
wxCHECK( pCurrent != NULL );
|
||||||
|
|
||||||
|
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
||||||
|
|
||||||
|
if ( pCurrent->IsRoot() ) {
|
||||||
|
wxLogError("Can't create a new key under the root key.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRegKey key(pCurrent->Key(), strName);
|
||||||
|
if ( key.Create() )
|
||||||
|
pCurrent->Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::CreateNewTextValue(const wxString& strName)
|
||||||
|
{
|
||||||
|
long lCurrent = GetSelection();
|
||||||
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
||||||
|
|
||||||
|
wxCHECK( pCurrent != NULL );
|
||||||
|
|
||||||
|
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
||||||
|
|
||||||
|
if ( pCurrent->IsRoot() ) {
|
||||||
|
wxLogError("Can't create a new value under the root key.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pCurrent->Key().SetValue(strName, "") )
|
||||||
|
pCurrent->Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::CreateNewBinaryValue(const wxString& strName)
|
||||||
|
{
|
||||||
|
long lCurrent = GetSelection();
|
||||||
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
||||||
|
|
||||||
|
wxCHECK( pCurrent != NULL );
|
||||||
|
|
||||||
|
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
||||||
|
|
||||||
|
if ( pCurrent->IsRoot() ) {
|
||||||
|
wxLogError("Can't create a new value under the root key.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pCurrent->Key().SetValue(strName, 0) )
|
||||||
|
pCurrent->Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegTreeCtrl::IsKeySelected() const
|
||||||
|
{
|
||||||
|
long lCurrent = GetSelection();
|
||||||
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
||||||
|
|
||||||
|
wxCHECK_RET( pCurrent != NULL, false );
|
||||||
|
|
||||||
|
return pCurrent->IsKey();
|
||||||
|
}
|
9
samples/regtest/regtest.rc
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "wx/msw/wx.rc"
|
||||||
|
|
||||||
|
app_icon ICON "registry.ico"
|
||||||
|
icon_key1 ICON "key1.ico"
|
||||||
|
icon_key2 ICON "key2.ico"
|
||||||
|
icon_key3 ICON "key3.ico"
|
||||||
|
icon_value1 ICON "value1.ico"
|
||||||
|
icon_value2 ICON "value2.ico"
|
||||||
|
|
BIN
samples/regtest/value1.ico
Normal file
After Width: | Height: | Size: 318 B |
BIN
samples/regtest/value2.ico
Normal file
After Width: | Height: | Size: 318 B |
64
samples/taskbar/makefile.b32
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.bcc
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds tab example
|
||||||
|
|
||||||
|
# WXWIN and BCCDIR are set by parent make
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makeb32.env
|
||||||
|
|
||||||
|
WXLIBDIR = $(WXDIR)\lib
|
||||||
|
WXINC = $(WXDIR)\include\msw
|
||||||
|
WXLIB = $(WXLIBDIR)\wx32.lib
|
||||||
|
LIBS=$(WXLIB) cw32 import32 ole2w32
|
||||||
|
|
||||||
|
TARGET=tbtest
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS =
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
OBJECTS = tbtest.obj
|
||||||
|
|
||||||
|
$(TARGET).exe: $(OBJECTS) $(TARGET).def $(TARGET).res
|
||||||
|
tlink32 $(LINKFLAGS) @&&!
|
||||||
|
c0w32.obj $(OBJECTS)
|
||||||
|
$(TARGET)
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
$(TARGET).def
|
||||||
|
!
|
||||||
|
brc32 -K $(TARGET).res
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
bcc32 $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
.c.obj:
|
||||||
|
bcc32 $(CPPFLAGS) -P- -c {$< }
|
||||||
|
|
||||||
|
tbtest.obj: tbtest.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.rws
|
||||||
|
|
73
samples/taskbar/makefile.bcc
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.bcc
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds tbtest example (DOS).
|
||||||
|
|
||||||
|
!if "$(BCCDIR)" == ""
|
||||||
|
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if "$(WXWIN)" == ""
|
||||||
|
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||||
|
!endif
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
!include $(WXDIR)\src\makebcc.env
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\taskbar
|
||||||
|
WXLIB = $(WXDIR)\lib\wx.lib
|
||||||
|
LIBS=$(WXLIB) mathwl cwl import
|
||||||
|
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
|
||||||
|
CFG=$(WXDIR)\src\wxwin.cfg
|
||||||
|
|
||||||
|
!ifndef FINAL
|
||||||
|
FINAL=0
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if "$(FINAL)" == "0"
|
||||||
|
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||||
|
OPT = -Od
|
||||||
|
DEBUG_FLAGS= -v
|
||||||
|
!else
|
||||||
|
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||||
|
OPT = -O2
|
||||||
|
DEBUG_FLAGS=
|
||||||
|
!endif
|
||||||
|
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||||
|
|
||||||
|
OBJECTS = tbtest.obj
|
||||||
|
|
||||||
|
tbtest: tbtest.exe
|
||||||
|
|
||||||
|
all: tbtest.exe
|
||||||
|
|
||||||
|
tbtest.exe: $(WXLIB) tbtest.obj tbtest.def tbtest.res
|
||||||
|
tlink $(LINKFLAGS) @&&!
|
||||||
|
c0wl.obj tbtest.obj
|
||||||
|
tbtest
|
||||||
|
nul
|
||||||
|
$(LIBS)
|
||||||
|
tbtest.def
|
||||||
|
!
|
||||||
|
rc -31 -K tbtest.res
|
||||||
|
|
||||||
|
.$(SRCSUFF).obj:
|
||||||
|
bcc $(CPPFLAGS) -c {$< }
|
||||||
|
|
||||||
|
tbtest.obj: tbtest.$(SRCSUFF)
|
||||||
|
|
||||||
|
tbtest.res : tbtest.rc $(WXDIR)\include\msw\wx.rc
|
||||||
|
rc -r /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa tbtest
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.rws
|
65
samples/taskbar/makefile.dos
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.dos
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds taskbar example (DOS).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\makemsc.env
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\taskbar
|
||||||
|
|
||||||
|
!ifndef FINAL
|
||||||
|
FINAL=0
|
||||||
|
!endif
|
||||||
|
|
||||||
|
HEADERS =
|
||||||
|
SOURCES = tbtest.$(SRCSUFF)
|
||||||
|
OBJECTS = tbtest.obj
|
||||||
|
|
||||||
|
all: tbtest.exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.dos clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
tbtest.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) tbtest.obj tbtest.def tbtest.res
|
||||||
|
link $(LINKFLAGS) @<<
|
||||||
|
tbtest.obj $(WXDIR)\src\msw\dummy.obj,
|
||||||
|
tbtest,
|
||||||
|
NUL,
|
||||||
|
$(LIBS),
|
||||||
|
tbtest.def
|
||||||
|
;
|
||||||
|
<<
|
||||||
|
rc -K tbtest.res
|
||||||
|
|
||||||
|
tbtest.obj: tbtest.$(SRCSUFF)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
tbtest.res : tbtest.rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
rc -r /i$(WXDIR)\include tbtest
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.pdb
|
37
samples/taskbar/makefile.g95
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.unx
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile for taskbar example
|
||||||
|
|
||||||
|
WXDIR = ../..
|
||||||
|
|
||||||
|
# All common UNIX compiler flags and options are now in
|
||||||
|
# this central makefile.
|
||||||
|
include $(WXDIR)/src/makeg95.env
|
||||||
|
|
||||||
|
OBJECTS = $(OBJDIR)/tbtest.$(OBJSUFF) $(OBJDIR)/tbtest_resources.$(OBJSUFF)
|
||||||
|
|
||||||
|
all: $(OBJDIR) tbtest$(GUISUFFIX)$(EXESUFF)
|
||||||
|
|
||||||
|
wx:
|
||||||
|
|
||||||
|
$(OBJDIR):
|
||||||
|
mkdir $(OBJDIR)
|
||||||
|
|
||||||
|
tbtest$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB)
|
||||||
|
$(CC) $(LDFLAGS) -o tbtest$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
|
||||||
|
|
||||||
|
$(OBJDIR)/tbtest.$(OBJSUFF): tbtest.$(SRCSUFF)
|
||||||
|
$(CC) -c $(CPPFLAGS) -o $@ tbtest.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(OBJDIR)/tbtest_resources.o: tbtest.rc
|
||||||
|
$(RESCOMP) -i tbtest.rc -o $(OBJDIR)/tbtest_resources.o $(RESFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJECTS) tbtest$(GUISUFFIX).exe core *.rsc *.res
|
64
samples/taskbar/makefile.nt
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.nt
|
||||||
|
# Author: Julian Smart
|
||||||
|
# Created: 1993
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Builds tab example (MS VC++).
|
||||||
|
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||||
|
# info
|
||||||
|
|
||||||
|
# Set WXDIR for your system
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
|
WXUSINGDLL=0
|
||||||
|
|
||||||
|
!include $(WXDIR)\src\ntwxwin.mak
|
||||||
|
|
||||||
|
THISDIR = $(WXDIR)\samples\taskbar
|
||||||
|
PROGRAM=tbtest
|
||||||
|
|
||||||
|
OBJECTS = $(PROGRAM).obj
|
||||||
|
|
||||||
|
$(PROGRAM): $(PROGRAM).exe
|
||||||
|
|
||||||
|
all: wx $(PROGRAM).exe
|
||||||
|
|
||||||
|
wx:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt FINAL=$(FINAL)
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
wxclean:
|
||||||
|
cd $(WXDIR)\src\msw
|
||||||
|
nmake -f makefile.nt clean
|
||||||
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(link) @<<
|
||||||
|
-out:$(PROGRAM).exe
|
||||||
|
$(LINKFLAGS)
|
||||||
|
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res
|
||||||
|
$(LIBS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
|
||||||
|
$(PROGRAM).obj: $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ)
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
|
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||||
|
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
|
||||||
|
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase *.obj
|
||||||
|
-erase *.exe
|
||||||
|
-erase *.res
|
||||||
|
-erase *.map
|
||||||
|
-erase *.sbr
|
||||||
|
-erase *.pdb
|
BIN
samples/taskbar/mondrian.ico
Normal file
After Width: | Height: | Size: 766 B |
120
samples/taskbar/tbtest.cpp
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: tbtest.cpp
|
||||||
|
// Purpose: wxTaskBarIcon demo
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 01/02/97
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c)
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/msw/taskbar.h"
|
||||||
|
#include "tbtest.h"
|
||||||
|
|
||||||
|
// Declare two frames
|
||||||
|
MyDialog *dialog = NULL;
|
||||||
|
|
||||||
|
IMPLEMENT_APP(MyApp)
|
||||||
|
|
||||||
|
bool MyApp::OnInit(void)
|
||||||
|
{
|
||||||
|
wxIcon icon("mondrian_icon");
|
||||||
|
|
||||||
|
if (!m_taskBarIcon.SetIcon(icon, "wxTaskBarIcon Sample"))
|
||||||
|
wxMessageBox("Could not set icon.");
|
||||||
|
|
||||||
|
// Create the main frame window
|
||||||
|
dialog = new MyDialog(NULL, -1, "wxTaskBarIcon Test Dialog", wxPoint(-1, -1), wxSize(365, 290), wxDIALOG_MODELESS|wxDEFAULT_DIALOG_STYLE);
|
||||||
|
|
||||||
|
dialog->Show(TRUE);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
|
||||||
|
EVT_BUTTON(wxID_OK, MyDialog::OnOK)
|
||||||
|
EVT_BUTTON(wxID_EXIT, MyDialog::OnExit)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
MyDialog::MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
|
||||||
|
const wxPoint& pos, const wxSize& size, const long windowStyle):
|
||||||
|
wxDialog(parent, id, title, pos, size, windowStyle)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyDialog::OnOK(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
Show(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyDialog::OnExit(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
Close(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyDialog::OnCloseWindow(wxCloseEvent& event)
|
||||||
|
{
|
||||||
|
Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyDialog::Init(void)
|
||||||
|
{
|
||||||
|
int dialogWidth = 365;
|
||||||
|
int dialogHeight = 290;
|
||||||
|
|
||||||
|
wxStaticText* stat = new wxStaticText(this, -1, "Press OK to hide me, Exit to quit.",
|
||||||
|
wxPoint(10, 20));
|
||||||
|
|
||||||
|
wxStaticText* stat2 = new wxStaticText(this, -1, "Double-click on the taskbar icon to show me again.",
|
||||||
|
wxPoint(10, 40));
|
||||||
|
|
||||||
|
wxButton *okButton = new wxButton(this, wxID_OK, "OK", wxPoint(100, 230), wxSize(80, 25));
|
||||||
|
wxButton *exitButton = new wxButton(this, wxID_EXIT, "Exit", wxPoint(185, 230), wxSize(80, 25));
|
||||||
|
okButton->SetDefault();
|
||||||
|
this->Centre(wxBOTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Overridables
|
||||||
|
void MyTaskBarIcon::OnMouseMove(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyTaskBarIcon::OnLButtonDown(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyTaskBarIcon::OnLButtonUp(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyTaskBarIcon::OnRButtonDown(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyTaskBarIcon::OnRButtonUp(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyTaskBarIcon::OnLButtonDClick(void)
|
||||||
|
{
|
||||||
|
dialog->Show(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyTaskBarIcon::OnRButtonDClick(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
8
samples/taskbar/tbtest.def
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
NAME TBTest
|
||||||
|
DESCRIPTION 'wxTaskBarIcon test'
|
||||||
|
EXETYPE WINDOWS
|
||||||
|
STUB 'WINSTUB.EXE'
|
||||||
|
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||||
|
DATA PRELOAD MOVEABLE MULTIPLE
|
||||||
|
HEAPSIZE 1024
|
||||||
|
STACKSIZE 16192
|
50
samples/taskbar/tbtest.h
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: tbtest.h
|
||||||
|
// Purpose: wxTaskBarIcon sample
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 01/02/97
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c)
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class MyTaskBarIcon: public wxTaskBarIcon
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyTaskBarIcon() {};
|
||||||
|
|
||||||
|
virtual void OnMouseMove(void);
|
||||||
|
virtual void OnLButtonDown(void);
|
||||||
|
virtual void OnLButtonUp(void);
|
||||||
|
virtual void OnRButtonDown(void);
|
||||||
|
virtual void OnRButtonUp(void);
|
||||||
|
virtual void OnLButtonDClick(void);
|
||||||
|
virtual void OnRButtonDClick(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Define a new application
|
||||||
|
class MyApp: public wxApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool OnInit(void);
|
||||||
|
protected:
|
||||||
|
MyTaskBarIcon m_taskBarIcon;
|
||||||
|
};
|
||||||
|
|
||||||
|
class MyDialog: public wxDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
|
||||||
|
const wxPoint& pos, const wxSize& size, const long windowStyle = wxDEFAULT_DIALOG_STYLE);
|
||||||
|
|
||||||
|
void OnOK(wxCommandEvent& event);
|
||||||
|
void OnExit(wxCommandEvent& event);
|
||||||
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
|
void Init(void);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
3
samples/taskbar/tbtest.rc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
mondrian_icon ICON "mondrian.ico"
|
||||||
|
#include "wx/msw/wx.rc"
|
||||||
|
|
25
src/msw/ctl3d/borland/makefile.b32
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.b32
|
||||||
|
# Author: Andre Beltman
|
||||||
|
# Created: 1995
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1995, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Imports 32bit ctl3d library for Windows 95
|
||||||
|
# and Borland C++ 4.x
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
WXLIB = $(WXDIR)\lib
|
||||||
|
|
||||||
|
LIBTARGET= $(WXLIB)\ctl3d32.lib
|
||||||
|
|
||||||
|
all: $(LIBTARGET)
|
||||||
|
|
||||||
|
$(LIBTARGET):
|
||||||
|
erase $(LIBTARGET)
|
||||||
|
implib $(LIBTARGET) ..\ctl3d32.dll
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase $(LIBTARGET)
|
25
src/msw/ctl3d/borland/makefile.bcc
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#
|
||||||
|
# File: makefile.b32
|
||||||
|
# Author: Andre Beltman
|
||||||
|
# Created: 1995
|
||||||
|
# Updated:
|
||||||
|
# Copyright: (c) 1995, AIAI, University of Edinburgh
|
||||||
|
#
|
||||||
|
# "%W% %G%"
|
||||||
|
#
|
||||||
|
# Makefile : Imports ctl3d library
|
||||||
|
# and Borland C++ 4.x
|
||||||
|
|
||||||
|
WXDIR = $(WXWIN)
|
||||||
|
WXLIB = $(WXDIR)\lib
|
||||||
|
|
||||||
|
LIBTARGET= $(WXLIB)\ctl3dv2.lib
|
||||||
|
|
||||||
|
all: $(LIBTARGET)
|
||||||
|
|
||||||
|
$(LIBTARGET):
|
||||||
|
erase $(LIBTARGET)
|
||||||
|
implib $(LIBTARGET) ..\ctl3dv2.dll
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-erase $(LIBTARGET)
|
BIN
src/msw/ctl3d/ctl3d.dll
Normal file
BIN
src/msw/ctl3d/ctl3d32.dll
Normal file
BIN
src/msw/ctl3d/ctl3dv2.dll
Normal file
61
src/msw/ctl3d/msvc/ctl3d.h
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*-----------------------------------------------------------------------
|
||||||
|
| CTL3D.DLL
|
||||||
|
|
|
||||||
|
| Adds 3d effects to Windows controls
|
||||||
|
|
|
||||||
|
| See ctl3d.doc for info
|
||||||
|
|
|
||||||
|
-----------------------------------------------------------------------*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dSubclassDlg(HWND, WORD);
|
||||||
|
BOOL WINAPI Ctl3dSubclassDlgEx(HWND, DWORD);
|
||||||
|
WORD WINAPI Ctl3dGetVer(void);
|
||||||
|
BOOL WINAPI Ctl3dEnabled(void);
|
||||||
|
HBRUSH WINAPI Ctl3dCtlColor(HDC, LONG); // ARCHAIC, use Ctl3dCtlColorEx
|
||||||
|
HBRUSH WINAPI Ctl3dCtlColorEx(UINT wm, WPARAM wParam, LPARAM lParam);
|
||||||
|
BOOL WINAPI Ctl3dColorChange(void);
|
||||||
|
BOOL WINAPI Ctl3dSubclassCtl(HWND);
|
||||||
|
LONG WINAPI Ctl3dDlgFramePaint(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dAutoSubclass(HANDLE);
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dRegister(HANDLE);
|
||||||
|
BOOL WINAPI Ctl3dUnregister(HANDLE);
|
||||||
|
|
||||||
|
//begin DBCS: far east short cut key support
|
||||||
|
VOID WINAPI Ctl3dWinIniChange(void);
|
||||||
|
//end DBCS
|
||||||
|
|
||||||
|
|
||||||
|
/* Ctl3dSubclassDlg3d flags */
|
||||||
|
#define CTL3D_BUTTONS 0x0001
|
||||||
|
#define CTL3D_LISTBOXES 0x0002
|
||||||
|
#define CTL3D_EDITS 0x0004
|
||||||
|
#define CTL3D_COMBOS 0x0008
|
||||||
|
#define CTL3D_STATICTEXTS 0x0010
|
||||||
|
#define CTL3D_STATICFRAMES 0x0020
|
||||||
|
|
||||||
|
#define CTL3D_NODLGWINDOW 0x00010000
|
||||||
|
#define CTL3D_ALL 0xffff
|
||||||
|
|
||||||
|
#define WM_DLGBORDER (WM_USER+3567)
|
||||||
|
/* WM_DLGBORDER *(int FAR *)lParam return codes */
|
||||||
|
#define CTL3D_NOBORDER 0
|
||||||
|
#define CTL3D_BORDER 1
|
||||||
|
|
||||||
|
#define WM_DLGSUBCLASS (WM_USER+3568)
|
||||||
|
/* WM_DLGSUBCLASS *(int FAR *)lParam return codes */
|
||||||
|
#define CTL3D_NOSUBCLASS 0
|
||||||
|
#define CTL3D_SUBCLASS 1
|
||||||
|
|
||||||
|
/* Resource ID for 3dcheck.bmp (for .lib version of ctl3d) */
|
||||||
|
#define CTL3D_3DCHECK 26567
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
BIN
src/msw/ctl3d/msvc/ctl3d.lib
Normal file
BIN
src/msw/ctl3d/msvc/ctl3dv2.lib
Normal file
31
src/msw/ctl3d/readme.txt
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
CTL3D
|
||||||
|
-----
|
||||||
|
|
||||||
|
CTL3D gives 3D controls to 16-bit Windows 3.1 applications.
|
||||||
|
Its use in wxWindows is controlled by the CTL3D symbol
|
||||||
|
in include/base/wx_setup.h.
|
||||||
|
|
||||||
|
If using a 16-bit compiler, copy ctl3dv2.lib to your compiler
|
||||||
|
library directory, and remember to distribute ctl3dv2.dll
|
||||||
|
with your applications. The DLL should be copied to
|
||||||
|
windows/system and DELETED from the application installation
|
||||||
|
directory.
|
||||||
|
|
||||||
|
If using Watcom C++ in 386 mode, things are slightly more complex: you need
|
||||||
|
to link with Patrick Halke's ctl3d32.obj which provides an interface
|
||||||
|
from 32-bits to the 16-bit CTL3DV2 library. Link your application
|
||||||
|
with ctl3d32.obj file instead of ctl3dv2.lib, distributing
|
||||||
|
ctl3dv2.dll as above.
|
||||||
|
|
||||||
|
ctl3d.dll ; Version 1 of the CTL3D library DLL: obsolete
|
||||||
|
ctl3dv2.dll ; Version 2 of the CTL3D library DLL
|
||||||
|
readme.txt ; This file
|
||||||
|
|
||||||
|
msvc/ctl3d.h ; Header file for either version of CTL3D
|
||||||
|
msvc/ctl3d.lib ; Import library for 16-bit compilers
|
||||||
|
watcom/import32.zip ; Import libraries for Watcom WIN32 compilation
|
||||||
|
wat386/ ; Source & objects for Watcom 386 object file to
|
||||||
|
; interface 16<->32 bit modes
|
||||||
|
borland/ ; Makefiles for making import libraries for Borland
|
||||||
|
|
BIN
src/msw/ctl3d/wat32/import32.zip
Normal file
61
src/msw/ctl3d/wat386/ctl3d.h
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*-----------------------------------------------------------------------
|
||||||
|
| CTL3D.DLL
|
||||||
|
|
|
||||||
|
| Adds 3d effects to Windows controls
|
||||||
|
|
|
||||||
|
| See ctl3d.doc for info
|
||||||
|
|
|
||||||
|
-----------------------------------------------------------------------*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dSubclassDlg(HWND, WORD);
|
||||||
|
BOOL WINAPI Ctl3dSubclassDlgEx(HWND, DWORD);
|
||||||
|
WORD WINAPI Ctl3dGetVer(void);
|
||||||
|
BOOL WINAPI Ctl3dEnabled(void);
|
||||||
|
HBRUSH WINAPI Ctl3dCtlColor(HDC, LONG); // ARCHAIC, use Ctl3dCtlColorEx
|
||||||
|
HBRUSH WINAPI Ctl3dCtlColorEx(UINT wm, WPARAM wParam, LPARAM lParam);
|
||||||
|
BOOL WINAPI Ctl3dColorChange(void);
|
||||||
|
BOOL WINAPI Ctl3dSubclassCtl(HWND);
|
||||||
|
LONG WINAPI Ctl3dDlgFramePaint(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dAutoSubclass(HANDLE);
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dRegister(HANDLE);
|
||||||
|
BOOL WINAPI Ctl3dUnregister(HANDLE);
|
||||||
|
|
||||||
|
//begin DBCS: far east short cut key support
|
||||||
|
VOID WINAPI Ctl3dWinIniChange(void);
|
||||||
|
//end DBCS
|
||||||
|
|
||||||
|
|
||||||
|
/* Ctl3dSubclassDlg3d flags */
|
||||||
|
#define CTL3D_BUTTONS 0x0001
|
||||||
|
#define CTL3D_LISTBOXES 0x0002
|
||||||
|
#define CTL3D_EDITS 0x0004
|
||||||
|
#define CTL3D_COMBOS 0x0008
|
||||||
|
#define CTL3D_STATICTEXTS 0x0010
|
||||||
|
#define CTL3D_STATICFRAMES 0x0020
|
||||||
|
|
||||||
|
#define CTL3D_NODLGWINDOW 0x00010000
|
||||||
|
#define CTL3D_ALL 0xffff
|
||||||
|
|
||||||
|
#define WM_DLGBORDER (WM_USER+3567)
|
||||||
|
/* WM_DLGBORDER *(int FAR *)lParam return codes */
|
||||||
|
#define CTL3D_NOBORDER 0
|
||||||
|
#define CTL3D_BORDER 1
|
||||||
|
|
||||||
|
#define WM_DLGSUBCLASS (WM_USER+3568)
|
||||||
|
/* WM_DLGSUBCLASS *(int FAR *)lParam return codes */
|
||||||
|
#define CTL3D_NOSUBCLASS 0
|
||||||
|
#define CTL3D_SUBCLASS 1
|
||||||
|
|
||||||
|
/* Resource ID for 3dcheck.bmp (for .lib version of ctl3d) */
|
||||||
|
#define CTL3D_3DCHECK 26567
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
285
src/msw/ctl3d/wat386/ctl3d32.c
Normal file
@@ -0,0 +1,285 @@
|
|||||||
|
/*
|
||||||
|
* File: ctl3d32.c
|
||||||
|
* Purpose: 32bit interface to CTL3D functions for Watcom C/C++
|
||||||
|
* Author: Patrick Halke
|
||||||
|
* Created: 1995
|
||||||
|
* Updated:
|
||||||
|
* Copyright: (c) 1995
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include "ctl3d.h"
|
||||||
|
|
||||||
|
#if defined(__WINDOWS_386__)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef FAR
|
||||||
|
#define FAR
|
||||||
|
|
||||||
|
#define INDIR_INT INDIR_WORD
|
||||||
|
#define INDIR_UINT INDIR_WORD
|
||||||
|
#define INDIR_WPARAM INDIR_UINT
|
||||||
|
#define INDIR_LPARAM INDIR_DWORD
|
||||||
|
#define INDIR_LONG INDIR_DWORD
|
||||||
|
#define INDIR_ULONG INDIR_DWORD
|
||||||
|
|
||||||
|
#ifdef STRICT
|
||||||
|
#define INDIR_HANDLE INDIR_PTR
|
||||||
|
#define INDIR_HWND INDIR_PTR
|
||||||
|
#define INDIR_HDC INDIR_PTR
|
||||||
|
#else
|
||||||
|
#define INDIR_HANDLE INDIR_UINT
|
||||||
|
#define INDIR_HWND INDIR_UINT
|
||||||
|
#define INDIR_HDC INDIR_UINT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct tagCTL3DFUNCTIONS {
|
||||||
|
HINSTANCE dll;
|
||||||
|
/* Function Handles */
|
||||||
|
HINDIR _Ctl3dSubclassDlg;
|
||||||
|
HINDIR _Ctl3dSubclassDlgEx;
|
||||||
|
HINDIR _Ctl3dGetVer;
|
||||||
|
HINDIR _Ctl3dEnabled;
|
||||||
|
HINDIR _Ctl3dCtlColor;
|
||||||
|
HINDIR _Ctl3dCtlColorEx;
|
||||||
|
HINDIR _Ctl3dColorChange;
|
||||||
|
HINDIR _Ctl3dSubclassCtl;
|
||||||
|
HINDIR _Ctl3dDlgFramePaint;
|
||||||
|
HINDIR _Ctl3dAutoSubclass;
|
||||||
|
HINDIR _Ctl3dRegister;
|
||||||
|
HINDIR _Ctl3dUnregister;
|
||||||
|
HINDIR _Ctl3dWinIniChange;
|
||||||
|
} CTL3DFUNCTIONS;
|
||||||
|
|
||||||
|
static CTL3DFUNCTIONS Ctl3dFunc = { 0 };
|
||||||
|
|
||||||
|
static BOOL load_functions( CTL3DFUNCTIONS* functions )
|
||||||
|
{
|
||||||
|
FARPROC proc;
|
||||||
|
HINSTANCE dll;
|
||||||
|
|
||||||
|
dll = LoadLibrary( "CTL3D.DLL" );
|
||||||
|
if( dll < HINSTANCE_ERROR ) {
|
||||||
|
return( FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function thunks */
|
||||||
|
|
||||||
|
proc = GetProcAddress(dll, "Ctl3dSubclassDlg");
|
||||||
|
functions->_Ctl3dSubclassDlg = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_HWND,
|
||||||
|
INDIR_WORD,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dSubclassDlgEx" );
|
||||||
|
functions->_Ctl3dSubclassDlgEx = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_HWND,
|
||||||
|
INDIR_DWORD,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dGetVer" );
|
||||||
|
functions->_Ctl3dGetVer = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dEnabled" );
|
||||||
|
functions->_Ctl3dEnabled = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dCtlColor" );
|
||||||
|
functions->_Ctl3dCtlColor = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_HDC,
|
||||||
|
INDIR_LONG,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dCtlColorEx" );
|
||||||
|
functions->_Ctl3dCtlColorEx = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_UINT,
|
||||||
|
INDIR_WPARAM,
|
||||||
|
INDIR_LPARAM,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dColorChange" );
|
||||||
|
functions->_Ctl3dColorChange = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dSubclassCtl" );
|
||||||
|
functions->_Ctl3dSubclassCtl = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_HWND,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dDlgFramePaint" );
|
||||||
|
functions->_Ctl3dDlgFramePaint = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_HWND,
|
||||||
|
INDIR_UINT,
|
||||||
|
INDIR_WPARAM,
|
||||||
|
INDIR_LPARAM,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dAutoSubclass" );
|
||||||
|
functions->_Ctl3dAutoSubclass = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_HANDLE,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dRegister" );
|
||||||
|
functions->_Ctl3dRegister = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_HANDLE,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dUnregister" );
|
||||||
|
functions->_Ctl3dUnregister = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_HANDLE,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
proc = GetProcAddress( dll, "Ctl3dWinIniChange" );
|
||||||
|
functions->_Ctl3dWinIniChange = GetIndirectFunctionHandle( proc,
|
||||||
|
INDIR_ENDLIST );
|
||||||
|
|
||||||
|
functions->dll = dll;
|
||||||
|
return( TRUE );
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unload_functions( CTL3DFUNCTIONS * functions )
|
||||||
|
{
|
||||||
|
FreeLibrary( functions->dll );
|
||||||
|
functions->dll = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function Definitions */
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dSubclassDlg(HWND hwnd, WORD w)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (BOOL)InvokeIndirectFunction(Ctl3dFunc._Ctl3dSubclassDlg,
|
||||||
|
hwnd, w);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dSubclassDlgEx(HWND hwnd, DWORD dw)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (BOOL)InvokeIndirectFunction(Ctl3dFunc._Ctl3dSubclassDlgEx,
|
||||||
|
hwnd, dw);
|
||||||
|
}
|
||||||
|
|
||||||
|
WORD WINAPI Ctl3dGetVer(void)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (WORD)InvokeIndirectFunction(Ctl3dFunc._Ctl3dGetVer);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dEnabled(void)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (BOOL)InvokeIndirectFunction(Ctl3dFunc._Ctl3dEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
HBRUSH WINAPI Ctl3dCtlColor(HDC hdc, LONG l)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (HBRUSH)InvokeIndirectFunction(Ctl3dFunc._Ctl3dCtlColor,
|
||||||
|
hdc, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
HBRUSH WINAPI Ctl3dCtlColorEx(UINT ui, WPARAM wp, LPARAM lp)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (HBRUSH)InvokeIndirectFunction(Ctl3dFunc._Ctl3dCtlColorEx,
|
||||||
|
ui, wp, lp);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dColorChange(void)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (BOOL)InvokeIndirectFunction(Ctl3dFunc._Ctl3dColorChange);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dSubclassCtl(HWND hwnd)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (BOOL)InvokeIndirectFunction(Ctl3dFunc._Ctl3dSubclassCtl,
|
||||||
|
hwnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
LONG WINAPI Ctl3dDlgFramePaint(HWND hwnd, UINT ui, WPARAM wp, LPARAM lp)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (LONG)InvokeIndirectFunction(Ctl3dFunc._Ctl3dDlgFramePaint,
|
||||||
|
hwnd, ui, wp, lp);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dAutoSubclass(HANDLE hnd)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (BOOL)InvokeIndirectFunction(Ctl3dFunc._Ctl3dAutoSubclass,
|
||||||
|
hnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dRegister(HANDLE hnd)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (BOOL)InvokeIndirectFunction(Ctl3dFunc._Ctl3dRegister,
|
||||||
|
hnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI Ctl3dUnregister(HANDLE hnd)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return (BOOL)InvokeIndirectFunction(Ctl3dFunc._Ctl3dUnregister,
|
||||||
|
hnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID WINAPI Ctl3dWinIniChange(void)
|
||||||
|
{
|
||||||
|
if (!Ctl3dFunc.dll)
|
||||||
|
if (!load_functions(&Ctl3dFunc))
|
||||||
|
return;
|
||||||
|
|
||||||
|
InvokeIndirectFunction(Ctl3dFunc._Ctl3dWinIniChange);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // __WINDOWS_386__
|
1
src/msw/ctl3d/wat386/ctl3d32.lnk
Normal file
@@ -0,0 +1 @@
|
|||||||
|
+-ctl3d32.obj
|
BIN
src/msw/ctl3d/wat386/ctl3d32.obj
Normal file
11
src/msw/ctl3d/wat386/ctl3d32.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Using this package should be no big problem. You only need to change your
|
||||||
|
wx_setup.h for including the CTL3D stuff, compile ctl3d32.c and add
|
||||||
|
ctl3d32.obj to wx.lib (or just link it with your application).
|
||||||
|
|
||||||
|
Please send bug reports to 'patrick@zaphod.ruhr.de'.
|
||||||
|
|
||||||
|
|
||||||
|
Good luck
|
||||||
|
|
||||||
|
- patrick
|
||||||
|
|
23
src/msw/ctl3d/wat386/makefile.wat
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
CC = wcc386
|
||||||
|
CXX = wpp386
|
||||||
|
LIB = wlib
|
||||||
|
IFLAGS = -i=..\\..\\include\\base;..\\..\\include\\msw
|
||||||
|
CFLAGS = $(IFLAGS) -zq -zW -w1 -d2 -ot -3 -dwx_msw
|
||||||
|
|
||||||
|
WXDIR = ..\\..
|
||||||
|
LIBTARGET = $(WXDIR)\\lib\\wx.lib
|
||||||
|
|
||||||
|
C_SRCS = ctl3d32.c
|
||||||
|
|
||||||
|
OBJECTS = $(C_SRCS:.c=.obj) $(CC_SRCS:.cc=.obj)
|
||||||
|
|
||||||
|
.c.obj:
|
||||||
|
$(CC) $(CFLAGS) $<
|
||||||
|
|
||||||
|
.cc.obj:
|
||||||
|
$(CXX) $(CFLAGS) $<
|
||||||
|
|
||||||
|
all: $(OBJECTS) $(LIBTARGET)
|
||||||
|
|
||||||
|
$(LIBTARGET): $(OBJECTS)
|
||||||
|
$(LIB) /P=256 $(LIBTARGET) @ctl3d32.lnk
|
459
src/msw/ole/droptgt.cpp
Normal file
@@ -0,0 +1,459 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: ole/droptgt.cpp
|
||||||
|
// Purpose: wxDropTarget implementation
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created:
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "droptgt.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#define IN_WX_MAIN_CPP
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#if defined(__BORLANDC__)
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <wx/setup.h>
|
||||||
|
|
||||||
|
#if USE_DRAG_AND_DROP
|
||||||
|
|
||||||
|
#include <wx/log.h>
|
||||||
|
|
||||||
|
#ifdef __WIN32__
|
||||||
|
#ifndef __GNUWIN32__
|
||||||
|
#include <shlobj.h> // for DROPFILES structure
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#include <shellapi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <wx/msw/ole/droptgt.h>
|
||||||
|
|
||||||
|
#ifndef __WIN32__
|
||||||
|
#include <ole2.h>
|
||||||
|
#include <olestd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <wx/msw/ole/oleutils.h>
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// IDropTarget interface: forward all interesting things to wxDropTarget
|
||||||
|
// (the name is unfortunate, but wx_I_DropTarget is not at all the same thing
|
||||||
|
// as wxDropTarget which is 'public' class, while this one is private)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxIDropTarget : public IDropTarget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxIDropTarget(wxDropTarget *p);
|
||||||
|
~wxIDropTarget();
|
||||||
|
|
||||||
|
// IDropTarget methods
|
||||||
|
STDMETHODIMP DragEnter(LPDATAOBJECT, DWORD, POINTL, LPDWORD);
|
||||||
|
STDMETHODIMP DragOver(DWORD, POINTL, LPDWORD);
|
||||||
|
STDMETHODIMP DragLeave(void);
|
||||||
|
STDMETHODIMP Drop(LPDATAOBJECT, DWORD, POINTL, LPDWORD);
|
||||||
|
|
||||||
|
// @@ we assume that if QueryGetData() returns S_OK, than we can really
|
||||||
|
// get data in this format, so we remember here the format for which
|
||||||
|
// QueryGetData() succeeded
|
||||||
|
void SetSupportedFormat(wxDataFormat cfFormat) { m_cfFormat = cfFormat; }
|
||||||
|
|
||||||
|
DECLARE_IUNKNOWN_METHODS;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
IDataObject *m_pIDataObject; // !NULL between DragEnter and DragLeave/Drop
|
||||||
|
wxDropTarget *m_pTarget; // the real target (we're just a proxy)
|
||||||
|
|
||||||
|
wxDataFormat m_cfFormat; // the format in which to ask for data
|
||||||
|
|
||||||
|
private:
|
||||||
|
static inline DWORD GetDropEffect(DWORD flags);
|
||||||
|
};
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// wxIDropTarget implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// Name : static wxDropTarget::GetDropEffect
|
||||||
|
// Purpose : determine the drop operation from keyboard/mouse state.
|
||||||
|
// Returns : DWORD combined from DROPEFFECT_xxx constants
|
||||||
|
// Params : [in] DWORD flags kbd & mouse flags as passed to
|
||||||
|
// IDropTarget methods
|
||||||
|
// Notes : We do "move" normally and "copy" if <Ctrl> is pressed,
|
||||||
|
// which is the standard behaviour (currently there is no
|
||||||
|
// way to redefine it)
|
||||||
|
DWORD wxIDropTarget::GetDropEffect(DWORD flags)
|
||||||
|
{
|
||||||
|
return flags & MK_CONTROL ? DROPEFFECT_COPY : DROPEFFECT_MOVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxIDropTarget::wxIDropTarget(wxDropTarget *pTarget)
|
||||||
|
{
|
||||||
|
m_cRef = 0;
|
||||||
|
m_pTarget = pTarget;
|
||||||
|
m_cfFormat = 0;
|
||||||
|
m_pIDataObject = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxIDropTarget::~wxIDropTarget()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_IID_TABLE(wxIDropTarget)
|
||||||
|
ADD_IID(Unknown)
|
||||||
|
ADD_IID(DropTarget)
|
||||||
|
END_IID_TABLE;
|
||||||
|
|
||||||
|
IMPLEMENT_IUNKNOWN_METHODS(wxIDropTarget)
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
STDMETHODIMP wxIDropTarget::QueryInterface(REFIID riid, void **ppv)
|
||||||
|
{
|
||||||
|
// wxLogQueryInterface(wxIDropTarget, riid);
|
||||||
|
|
||||||
|
if ( IsIidFromList(riid, ms_aIids, WXSIZEOF(ms_aIids)) ) {
|
||||||
|
*ppv = this;
|
||||||
|
AddRef();
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*ppv = NULL;
|
||||||
|
|
||||||
|
return (HRESULT) E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP_(ULONG) wxIDropTarget::AddRef()
|
||||||
|
{
|
||||||
|
wxLogAddRef(wxIDropTarget, m_cRef);
|
||||||
|
|
||||||
|
return ++m_cRef;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP_(ULONG) wxIDropTarget::Release()
|
||||||
|
{
|
||||||
|
wxLogRelease(wxIDropTarget, m_cRef);
|
||||||
|
|
||||||
|
if ( --m_cRef == 0 ) {
|
||||||
|
delete this;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return m_cRef;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Name : wxIDropTarget::DragEnter
|
||||||
|
// Purpose : Called when the mouse enters the window (dragging something)
|
||||||
|
// Returns : S_OK
|
||||||
|
// Params : [in] IDataObject *pIDataSource : source data
|
||||||
|
// [in] DWORD grfKeyState : kbd & mouse state
|
||||||
|
// [in] POINTL pt : mouse coordinates
|
||||||
|
// [out]DWORD *pdwEffect : effect flag
|
||||||
|
// Notes :
|
||||||
|
STDMETHODIMP wxIDropTarget::DragEnter(IDataObject *pIDataSource,
|
||||||
|
DWORD grfKeyState,
|
||||||
|
POINTL pt,
|
||||||
|
DWORD *pdwEffect)
|
||||||
|
{
|
||||||
|
wxLogDebug("IDropTarget::DragEnter");
|
||||||
|
|
||||||
|
wxASSERT( m_pIDataObject == NULL );
|
||||||
|
|
||||||
|
if ( !m_pTarget->IsAcceptedData(pIDataSource) ) {
|
||||||
|
// we don't accept this kind of data
|
||||||
|
*pdwEffect = DROPEFFECT_NONE;
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@ should check the point also?
|
||||||
|
|
||||||
|
*pdwEffect = GetDropEffect(grfKeyState);
|
||||||
|
|
||||||
|
// get hold of the data object
|
||||||
|
m_pIDataObject = pIDataSource;
|
||||||
|
m_pIDataObject->AddRef();
|
||||||
|
|
||||||
|
// give some visual feedback
|
||||||
|
m_pTarget->OnEnter();
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name : wxIDropTarget::DragOver
|
||||||
|
// Purpose : Indicates that the mouse was moved inside the window represented
|
||||||
|
// by this drop target.
|
||||||
|
// Returns : S_OK
|
||||||
|
// Params : [in] DWORD grfKeyState kbd & mouse state
|
||||||
|
// [in] POINTL pt mouse coordinates
|
||||||
|
// [out]LPDWORD pdwEffect effect flag
|
||||||
|
// Notes : We're called on every WM_MOUSEMOVE, so this function should be
|
||||||
|
// very efficient.
|
||||||
|
STDMETHODIMP wxIDropTarget::DragOver(DWORD grfKeyState,
|
||||||
|
POINTL pt,
|
||||||
|
LPDWORD pdwEffect)
|
||||||
|
{
|
||||||
|
// there are too many of them... wxLogDebug("IDropTarget::DragOver");
|
||||||
|
|
||||||
|
*pdwEffect = m_pIDataObject == NULL ? DROPEFFECT_NONE
|
||||||
|
: GetDropEffect(grfKeyState);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name : wxIDropTarget::DragLeave
|
||||||
|
// Purpose : Informs the drop target that the operation has left its window.
|
||||||
|
// Returns : S_OK
|
||||||
|
// Notes : good place to do any clean-up
|
||||||
|
STDMETHODIMP wxIDropTarget::DragLeave()
|
||||||
|
{
|
||||||
|
wxLogDebug("IDropTarget::DragLeave");
|
||||||
|
|
||||||
|
// remove the UI feedback
|
||||||
|
m_pTarget->OnLeave();
|
||||||
|
|
||||||
|
// release the held object
|
||||||
|
RELEASE_AND_NULL(m_pIDataObject);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name : wxIDropTarget::Drop
|
||||||
|
// Purpose : Instructs the drop target to paste data that was just now
|
||||||
|
// dropped on it.
|
||||||
|
// Returns : S_OK
|
||||||
|
// Params : [in] IDataObject *pIDataSource the data to paste
|
||||||
|
// [in] DWORD grfKeyState kbd & mouse state
|
||||||
|
// [in] POINTL pt where the drop occured?
|
||||||
|
// [ouy]DWORD *pdwEffect operation effect
|
||||||
|
// Notes :
|
||||||
|
STDMETHODIMP wxIDropTarget::Drop(IDataObject *pIDataSource,
|
||||||
|
DWORD grfKeyState,
|
||||||
|
POINTL pt,
|
||||||
|
DWORD *pdwEffect)
|
||||||
|
{
|
||||||
|
wxLogDebug("IDropTarget::Drop");
|
||||||
|
|
||||||
|
// @@ I don't know why there is this parameter, but so far I assume
|
||||||
|
// that it's the same we've already got in DragEnter
|
||||||
|
wxASSERT( m_pIDataObject == pIDataSource );
|
||||||
|
|
||||||
|
STGMEDIUM stm;
|
||||||
|
*pdwEffect = DROPEFFECT_NONE;
|
||||||
|
|
||||||
|
// should be set by SetSupportedFormat() call
|
||||||
|
wxASSERT( m_cfFormat != 0 );
|
||||||
|
|
||||||
|
FORMATETC fmtMemory;
|
||||||
|
fmtMemory.cfFormat = m_cfFormat;
|
||||||
|
fmtMemory.ptd = NULL;
|
||||||
|
fmtMemory.dwAspect = DVASPECT_CONTENT;
|
||||||
|
fmtMemory.lindex = -1;
|
||||||
|
fmtMemory.tymed = TYMED_HGLOBAL; // @@@@ to add other media
|
||||||
|
|
||||||
|
HRESULT hr = pIDataSource->GetData(&fmtMemory, &stm);
|
||||||
|
if ( SUCCEEDED(hr) ) {
|
||||||
|
if ( stm.hGlobal != NULL ) {
|
||||||
|
if ( m_pTarget->OnDrop(pt.x, pt.y, GlobalLock(stm.hGlobal)) )
|
||||||
|
*pdwEffect = GetDropEffect(grfKeyState);
|
||||||
|
//else: DROPEFFECT_NONE
|
||||||
|
|
||||||
|
GlobalUnlock(stm.hGlobal);
|
||||||
|
ReleaseStgMedium(&stm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// wxLogApiError("GetData", hr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// release the held object
|
||||||
|
RELEASE_AND_NULL(m_pIDataObject);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// wxDropTarget implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// ctor/dtor
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxDropTarget::wxDropTarget()
|
||||||
|
{
|
||||||
|
// create an IDropTarget implementation which will notify us about
|
||||||
|
// d&d operations.
|
||||||
|
m_pIDropTarget = new wxIDropTarget(this);
|
||||||
|
m_pIDropTarget->AddRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxDropTarget::~wxDropTarget()
|
||||||
|
{
|
||||||
|
ReleaseInterface(m_pIDropTarget);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// [un]register drop handler
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
bool wxDropTarget::Register(WXHWND hwnd)
|
||||||
|
{
|
||||||
|
HRESULT hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);
|
||||||
|
if ( FAILED(hr) ) {
|
||||||
|
// wxLogApiError("CoLockObjectExternal", hr);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr = ::RegisterDragDrop((HWND) hwnd, m_pIDropTarget);
|
||||||
|
if ( FAILED(hr) ) {
|
||||||
|
::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE);
|
||||||
|
|
||||||
|
// wxLogApiError("RegisterDragDrop", hr);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDropTarget::Revoke(WXHWND hwnd)
|
||||||
|
{
|
||||||
|
HRESULT hr = ::RevokeDragDrop((HWND) hwnd);
|
||||||
|
|
||||||
|
if ( FAILED(hr) )
|
||||||
|
{
|
||||||
|
// wxLogApiError("RevokeDragDrop", hr);
|
||||||
|
}
|
||||||
|
|
||||||
|
::CoLockObjectExternal(m_pIDropTarget, FALSE, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// determine if we accept data of this type
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
bool wxDropTarget::IsAcceptedData(IDataObject *pIDataSource) const
|
||||||
|
{
|
||||||
|
// this strucutre describes a data of any type (first field will be
|
||||||
|
// changing) being passed through global memory block.
|
||||||
|
static FORMATETC s_fmtMemory = {
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
DVASPECT_CONTENT,
|
||||||
|
-1,
|
||||||
|
TYMED_HGLOBAL
|
||||||
|
};
|
||||||
|
|
||||||
|
// cycle thorugh all supported formats
|
||||||
|
for ( size_t n = 0; n < GetFormatCount(); n++ ) {
|
||||||
|
s_fmtMemory.cfFormat = GetFormat(n);
|
||||||
|
// @ don't use SUCCEEDED macro here: QueryGetData returns 1 (whatever it
|
||||||
|
// means) for file drag and drop
|
||||||
|
if ( pIDataSource->QueryGetData(&s_fmtMemory) == S_OK ) {
|
||||||
|
// remember this format: we'll later ask for data in it
|
||||||
|
m_pIDropTarget->SetSupportedFormat(s_fmtMemory.cfFormat);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// wxTextDropTarget
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
bool wxTextDropTarget::OnDrop(long x, long y, const void *pData)
|
||||||
|
{
|
||||||
|
return OnDropText(x, y, (const char *)pData);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t wxTextDropTarget::GetFormatCount() const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
||||||
|
{
|
||||||
|
return CF_TEXT;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// wxFileDropTarget
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
bool wxFileDropTarget::OnDrop(long x, long y, const void *pData)
|
||||||
|
{
|
||||||
|
// the documentation states that the first member of DROPFILES structure
|
||||||
|
// is a "DWORD offset of double NUL terminated file list". What they mean by
|
||||||
|
// this (I wonder if you see it immediately) is that the list starts at
|
||||||
|
// ((char *)&(pDropFiles.pFiles)) + pDropFiles.pFiles. We're also advised to
|
||||||
|
// use DragQueryFile to work with this structure, but not told where and how
|
||||||
|
// to get HDROP.
|
||||||
|
HDROP hdrop = (HDROP)pData; // @@ it works, but I'm not sure about it
|
||||||
|
|
||||||
|
// get number of files (magic value -1)
|
||||||
|
UINT nFiles = ::DragQueryFile(hdrop, -1, NULL, 0);
|
||||||
|
|
||||||
|
// for each file get the length, allocate memory and then get the name
|
||||||
|
char **aszFiles = new char *[nFiles];
|
||||||
|
UINT len, n;
|
||||||
|
for ( n = 0; n < nFiles; n++ ) {
|
||||||
|
// +1 for terminating NUL
|
||||||
|
len = ::DragQueryFile(hdrop, n, NULL, 0) + 1;
|
||||||
|
|
||||||
|
aszFiles[n] = new char[len];
|
||||||
|
|
||||||
|
UINT len2 = ::DragQueryFile(hdrop, n, aszFiles[n], len);
|
||||||
|
if ( len2 != len - 1 ) {
|
||||||
|
wxLogDebug("In wxFileDropTarget::OnDrop DragQueryFile returned %d "
|
||||||
|
"characters, %d expected.", len2, len - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool bResult = OnDropFiles(x, y, nFiles, (const char**) aszFiles);
|
||||||
|
|
||||||
|
// free memory
|
||||||
|
for ( n = 0; n < nFiles; n++ ) {
|
||||||
|
delete [] aszFiles[n];
|
||||||
|
}
|
||||||
|
delete [] aszFiles;
|
||||||
|
|
||||||
|
return bResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t wxFileDropTarget::GetFormatCount() const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
||||||
|
{
|
||||||
|
#ifdef __WIN32__
|
||||||
|
return CF_HDROP;
|
||||||
|
#else
|
||||||
|
// TODO: how to implement this in WIN16?
|
||||||
|
return CF_TEXT;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// USE_DRAG_AND_DROP
|
193
src/msw/ole/oleutils.cpp
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: ole/oleutils.cpp
|
||||||
|
// Purpose: implementation of OLE helper functions
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 19.02.98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "oleutils.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#define IN_WX_MAIN_CPP
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#if defined(__BORLANDC__)
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <wx/setup.h>
|
||||||
|
|
||||||
|
#if USE_DRAG_AND_DROP
|
||||||
|
|
||||||
|
#include <wx/log.h>
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
// OLE
|
||||||
|
#include <wx/msw/ole/uuid.h>
|
||||||
|
#include <wx/msw/ole/oleutils.h>
|
||||||
|
|
||||||
|
#ifndef __BORLANDC__
|
||||||
|
#include <docobj.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// return TRUE if the iid is in the array
|
||||||
|
bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount)
|
||||||
|
{
|
||||||
|
for ( size_t i = 0; i < nCount; i++ ) {
|
||||||
|
if ( riid == *aIids[i] )
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Debug support
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __DEBUG__
|
||||||
|
|
||||||
|
const char *GetIidName(REFIID riid)
|
||||||
|
{
|
||||||
|
// an association between symbolic name and numeric value of an IID
|
||||||
|
struct KNOWN_IID {
|
||||||
|
const IID *pIid;
|
||||||
|
const char *szName;
|
||||||
|
};
|
||||||
|
|
||||||
|
// construct the table containing all known interfaces
|
||||||
|
#define ADD_KNOWN_IID(name) { &IID_I##name, #name }
|
||||||
|
|
||||||
|
static const KNOWN_IID aKnownIids[] = {
|
||||||
|
ADD_KNOWN_IID(AdviseSink),
|
||||||
|
ADD_KNOWN_IID(AdviseSink2),
|
||||||
|
ADD_KNOWN_IID(BindCtx),
|
||||||
|
ADD_KNOWN_IID(ClassFactory),
|
||||||
|
ADD_KNOWN_IID(ContinueCallback),
|
||||||
|
ADD_KNOWN_IID(EnumOleDocumentViews),
|
||||||
|
ADD_KNOWN_IID(OleCommandTarget),
|
||||||
|
ADD_KNOWN_IID(OleDocument),
|
||||||
|
ADD_KNOWN_IID(OleDocumentSite),
|
||||||
|
ADD_KNOWN_IID(OleDocumentView),
|
||||||
|
ADD_KNOWN_IID(Print),
|
||||||
|
ADD_KNOWN_IID(DataAdviseHolder),
|
||||||
|
ADD_KNOWN_IID(DataObject),
|
||||||
|
ADD_KNOWN_IID(Debug),
|
||||||
|
ADD_KNOWN_IID(DebugStream),
|
||||||
|
ADD_KNOWN_IID(DfReserved1),
|
||||||
|
ADD_KNOWN_IID(DfReserved2),
|
||||||
|
ADD_KNOWN_IID(DfReserved3),
|
||||||
|
ADD_KNOWN_IID(Dispatch),
|
||||||
|
ADD_KNOWN_IID(DropSource),
|
||||||
|
ADD_KNOWN_IID(DropTarget),
|
||||||
|
ADD_KNOWN_IID(EnumCallback),
|
||||||
|
ADD_KNOWN_IID(EnumFORMATETC),
|
||||||
|
ADD_KNOWN_IID(EnumGeneric),
|
||||||
|
ADD_KNOWN_IID(EnumHolder),
|
||||||
|
ADD_KNOWN_IID(EnumMoniker),
|
||||||
|
ADD_KNOWN_IID(EnumOLEVERB),
|
||||||
|
ADD_KNOWN_IID(EnumSTATDATA),
|
||||||
|
ADD_KNOWN_IID(EnumSTATSTG),
|
||||||
|
ADD_KNOWN_IID(EnumString),
|
||||||
|
ADD_KNOWN_IID(EnumUnknown),
|
||||||
|
ADD_KNOWN_IID(EnumVARIANT),
|
||||||
|
ADD_KNOWN_IID(ExternalConnection),
|
||||||
|
ADD_KNOWN_IID(InternalMoniker),
|
||||||
|
ADD_KNOWN_IID(LockBytes),
|
||||||
|
ADD_KNOWN_IID(Malloc),
|
||||||
|
ADD_KNOWN_IID(Marshal),
|
||||||
|
ADD_KNOWN_IID(MessageFilter),
|
||||||
|
ADD_KNOWN_IID(Moniker),
|
||||||
|
ADD_KNOWN_IID(OleAdviseHolder),
|
||||||
|
ADD_KNOWN_IID(OleCache),
|
||||||
|
ADD_KNOWN_IID(OleCache2),
|
||||||
|
ADD_KNOWN_IID(OleCacheControl),
|
||||||
|
ADD_KNOWN_IID(OleClientSite),
|
||||||
|
ADD_KNOWN_IID(OleContainer),
|
||||||
|
ADD_KNOWN_IID(OleInPlaceActiveObject),
|
||||||
|
ADD_KNOWN_IID(OleInPlaceFrame),
|
||||||
|
ADD_KNOWN_IID(OleInPlaceObject),
|
||||||
|
ADD_KNOWN_IID(OleInPlaceSite),
|
||||||
|
ADD_KNOWN_IID(OleInPlaceUIWindow),
|
||||||
|
ADD_KNOWN_IID(OleItemContainer),
|
||||||
|
ADD_KNOWN_IID(OleLink),
|
||||||
|
ADD_KNOWN_IID(OleManager),
|
||||||
|
ADD_KNOWN_IID(OleObject),
|
||||||
|
ADD_KNOWN_IID(OlePresObj),
|
||||||
|
ADD_KNOWN_IID(OleWindow),
|
||||||
|
ADD_KNOWN_IID(PSFactory),
|
||||||
|
ADD_KNOWN_IID(ParseDisplayName),
|
||||||
|
ADD_KNOWN_IID(Persist),
|
||||||
|
ADD_KNOWN_IID(PersistFile),
|
||||||
|
ADD_KNOWN_IID(PersistStorage),
|
||||||
|
ADD_KNOWN_IID(PersistStream),
|
||||||
|
ADD_KNOWN_IID(ProxyManager),
|
||||||
|
ADD_KNOWN_IID(RootStorage),
|
||||||
|
ADD_KNOWN_IID(RpcChannel),
|
||||||
|
ADD_KNOWN_IID(RpcProxy),
|
||||||
|
ADD_KNOWN_IID(RpcStub),
|
||||||
|
ADD_KNOWN_IID(RunnableObject),
|
||||||
|
ADD_KNOWN_IID(RunningObjectTable),
|
||||||
|
ADD_KNOWN_IID(StdMarshalInfo),
|
||||||
|
ADD_KNOWN_IID(Storage),
|
||||||
|
ADD_KNOWN_IID(Stream),
|
||||||
|
ADD_KNOWN_IID(StubManager),
|
||||||
|
ADD_KNOWN_IID(Unknown),
|
||||||
|
ADD_KNOWN_IID(ViewObject),
|
||||||
|
ADD_KNOWN_IID(ViewObject2),
|
||||||
|
};
|
||||||
|
|
||||||
|
// don't clobber preprocessor name space
|
||||||
|
#undef ADD_KNOWN_IID
|
||||||
|
|
||||||
|
// try to find the interface in the table
|
||||||
|
for ( uint ui = 0; ui < WXSIZEOF(aKnownIids); ui++ ) {
|
||||||
|
if ( riid == *aKnownIids[ui].pIid ) {
|
||||||
|
return aKnownIids[ui].szName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// unknown IID, just transform to string
|
||||||
|
static Uuid s_uuid;
|
||||||
|
s_uuid.Set(riid);
|
||||||
|
return s_uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxLogQueryInterface(const char *szInterface, REFIID riid)
|
||||||
|
{
|
||||||
|
wxLogTrace("%s::QueryInterface (iid = %s)", szInterface, GetIidName(riid));
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxLogAddRef(const char *szInterface, ULONG cRef)
|
||||||
|
{
|
||||||
|
wxLogTrace("After %s::AddRef: m_cRef = %d", szInterface, cRef + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxLogRelease(const char *szInterface, ULONG cRef)
|
||||||
|
{
|
||||||
|
wxLogTrace("After %s::Release: m_cRef = %d", szInterface, cRef - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //DEBUG
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// USE_DRAG_AND_DROP
|
153
src/msw/ole/uuid.cpp
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: ole/uuid.cpp
|
||||||
|
// Purpose: implements Uuid class, see uuid.h for details
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 12.09.96
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "uuid.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#define IN_WX_MAIN_CPP
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#if defined(__BORLANDC__)
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <wx/setup.h>
|
||||||
|
|
||||||
|
#if USE_DRAG_AND_DROP
|
||||||
|
|
||||||
|
// standard headers
|
||||||
|
#include <rpc.h> // UUID related functions
|
||||||
|
|
||||||
|
#include <wx/msw/ole/uuid.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// length of UUID in C format
|
||||||
|
#define UUID_CSTRLEN 100 // real length is 66
|
||||||
|
|
||||||
|
// copy ctor
|
||||||
|
Uuid::Uuid(const Uuid& uuid)
|
||||||
|
{
|
||||||
|
// bitwise copy Ok for UUIDs
|
||||||
|
m_uuid = uuid.m_uuid;
|
||||||
|
|
||||||
|
// force the string to be allocated by RPC
|
||||||
|
// (we free it later with RpcStringFree)
|
||||||
|
UuidToString(&m_uuid, &m_pszUuid);
|
||||||
|
|
||||||
|
// allocate new buffer
|
||||||
|
m_pszCForm = new char[UUID_CSTRLEN];
|
||||||
|
// and fill it
|
||||||
|
memcpy(m_pszCForm, uuid.m_pszCForm, UUID_CSTRLEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// assignment operator
|
||||||
|
Uuid& Uuid::operator=(const Uuid& uuid)
|
||||||
|
{
|
||||||
|
m_uuid = uuid.m_uuid;
|
||||||
|
|
||||||
|
// force the string to be allocated by RPC
|
||||||
|
// (we free it later with RpcStringFree)
|
||||||
|
UuidToString(&m_uuid, &m_pszUuid);
|
||||||
|
|
||||||
|
// allocate new buffer if not done yet
|
||||||
|
if ( !m_pszCForm )
|
||||||
|
m_pszCForm = new char[UUID_CSTRLEN];
|
||||||
|
|
||||||
|
// and fill it
|
||||||
|
memcpy(m_pszCForm, uuid.m_pszCForm, UUID_CSTRLEN);
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// dtor
|
||||||
|
Uuid::~Uuid()
|
||||||
|
{
|
||||||
|
// this string must be allocated by RPC!
|
||||||
|
// (otherwise you get a debug breakpoint deep inside RPC DLL)
|
||||||
|
if ( m_pszUuid )
|
||||||
|
RpcStringFree(&m_pszUuid);
|
||||||
|
|
||||||
|
// perhaps we should just use a static buffer and not bother
|
||||||
|
// with new and delete?
|
||||||
|
if ( m_pszCForm )
|
||||||
|
delete [] m_pszCForm;
|
||||||
|
}
|
||||||
|
|
||||||
|
// update string representation of new UUID
|
||||||
|
void Uuid::Set(const UUID &uuid)
|
||||||
|
{
|
||||||
|
m_uuid = uuid;
|
||||||
|
|
||||||
|
// get string representation
|
||||||
|
UuidToString(&m_uuid, &m_pszUuid);
|
||||||
|
|
||||||
|
// cache UUID in C format
|
||||||
|
UuidToCForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
// create a new UUID
|
||||||
|
void Uuid::Create()
|
||||||
|
{
|
||||||
|
UUID uuid;
|
||||||
|
|
||||||
|
// can't fail
|
||||||
|
UuidCreate(&uuid);
|
||||||
|
|
||||||
|
Set(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the value
|
||||||
|
bool Uuid::Set(const char *pc)
|
||||||
|
{
|
||||||
|
// get UUID from string
|
||||||
|
if ( UuidFromString((uchar *)pc, &m_uuid) != RPC_S_OK)
|
||||||
|
// failed: probably invalid string
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// transform it back to string to normalize it
|
||||||
|
UuidToString(&m_uuid, &m_pszUuid);
|
||||||
|
|
||||||
|
// update m_pszCForm
|
||||||
|
UuidToCForm();
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// stores m_uuid in m_pszCForm in a format required by
|
||||||
|
// DEFINE_GUID macro: i.e. something like
|
||||||
|
// 0x7D8A2281L,0x4C61,0x11D0,0xBA,0xBD,0x00,0x00,0xC0,0x18,0xBA,0x27
|
||||||
|
// m_pszUuid is of the form (no, it's not quite the same UUID :-)
|
||||||
|
// 6aadc650-67b0-11d0-bac8-0000c018ba27
|
||||||
|
void Uuid::UuidToCForm()
|
||||||
|
{
|
||||||
|
if ( m_pszCForm == NULL )
|
||||||
|
m_pszCForm = new char[UUID_CSTRLEN];
|
||||||
|
|
||||||
|
wsprintf(m_pszCForm, "0x%8.8X,0x%4.4X,0x%4.4X,0x%2.2X,0x2.2%X,"
|
||||||
|
"0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X",
|
||||||
|
m_uuid.Data1, m_uuid.Data2, m_uuid.Data3,
|
||||||
|
m_uuid.Data4[1], m_uuid.Data4[2], m_uuid.Data4[3], m_uuid.Data4[4],
|
||||||
|
m_uuid.Data4[5], m_uuid.Data4[6], m_uuid.Data4[7], m_uuid.Data4[8]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// USE_DRAG_AND_DROP
|
32
utils/nplugin/docs/notes.txt
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
Notes about plugins
|
||||||
|
|
||||||
|
|
||||||
|
I have users that want to visit my pages with tclets, but they do not
|
||||||
|
have the plugin. What can I do?
|
||||||
|
|
||||||
|
Add a pluginspage=http://www.sunlabs.com/tcl/plugin/ name=value
|
||||||
|
pair to the embed statement. This will cause Navigator to find
|
||||||
|
the plugin for your user and suggest they install it. The user
|
||||||
|
is then prompted to download and install the plugin, and then she
|
||||||
|
has to restart the browser and revisit your page. Very inconvenient
|
||||||
|
and only slightly better than giving your users the broken image
|
||||||
|
icon. Netscape says they are working on a more automatic solution.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
14. Your demos work just fine, but when I visit my own pages with tclets in
|
||||||
|
them, at http://www.myserver.com/~mypages/mypage.html, I still get the
|
||||||
|
broken image icon. Why doesn't it work for me?
|
||||||
|
|
||||||
|
This is likely because your web server -- the program that sends
|
||||||
|
the pages to your browser when you click on a URL -- is not
|
||||||
|
sending the right mime-type when it sends the '.tcl' file. You
|
||||||
|
can work around this by adding a type=application/x-tcl name=value
|
||||||
|
pair to the embed statement, which will cause Navigator to infer
|
||||||
|
that it should use the Tcl plugin anyways. A better solution is
|
||||||
|
to ask your system administrator to configure the web server to
|
||||||
|
send the mime type application/x-tcl when it sends files with a
|
||||||
|
'.tcl' extension. Nearly all web servers in the world nowadays
|
||||||
|
are already configured to do this, the only ones we are aware of
|
||||||
|
that do not are some older versions of Apache.
|
1
utils/nplugin/lib/dummy
Normal file
@@ -0,0 +1 @@
|
|||||||
|
I'm just here to force the creation of a LIB directory.
|