mac adaptions

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
1999-11-09 15:24:52 +00:00
parent eff869aad2
commit e75491071d
66 changed files with 4803 additions and 5220 deletions

View File

@@ -43,8 +43,12 @@ class WXDLLEXPORT wxButton: public wxControl
const wxString& name = wxButtonNameStr);
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
static wxSize GetDefaultSize();
virtual void SetDefault();
virtual void Command(wxCommandEvent& event);
protected:
virtual wxSize DoGetBestSize();
};
#endif

View File

@@ -19,75 +19,87 @@
#pragma interface "clipbrd.h"
#endif
#include "wx/defs.h"
#include "wx/setup.h"
#if wxUSE_CLIPBOARD
#include "wx/list.h"
#include "wx/module.h"
#include "wx/dataobj.h" // for wxDataFormat
/* A clipboard client holds data belonging to the clipboard.
For plain text, a client is not necessary. */
class WXDLLEXPORT wxClipboardClient : public wxObject
{
DECLARE_ABSTRACT_CLASS(wxClipboardClient)
// These functions superceded by wxClipboard, but retained in order to
// implement wxClipboard, and for compatibility.
public:
/* This list should be filled in with strings indicating the formats
this client can provide. Almost all clients will provide "TEXT".
Format names should be 4 characters long, so things will work
out on the Macintosh */
wxStringList formats;
// open/close the clipboard
WXDLLEXPORT bool wxOpenClipboard();
WXDLLEXPORT bool wxIsClipboardOpened();
#define wxClipboardOpen wxIsClipboardOpened
WXDLLEXPORT bool wxCloseClipboard();
/* This method is called when the client is losing the selection. */
virtual void BeingReplaced() = 0;
// get/set data
WXDLLEXPORT bool wxEmptyClipboard();
WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat,
const void *data,
int width = 0, int height = 0);
WXDLLEXPORT void* wxGetClipboardData(wxDataFormat dataFormat,
long *len = NULL);
/* This method is called when someone wants the data this client is
supplying to the clipboard. "format" is a string indicating the
format of the data - one of the strings from the "formats"
list. "*size" should be filled with the size of the resulting
data. In the case of text, "*size" does not count the
NULL terminator. */
virtual char *GetData(char *format, long *size) = 0;
};
// clipboard formats
WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
WXDLLEXPORT int wxRegisterClipboardFormat(wxChar *formatName);
WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat,
wxChar *formatName,
int maxCount);
/* ONE instance of this class: */
//-----------------------------------------------------------------------------
// wxClipboard
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxDataObject;
class WXDLLEXPORT wxClipboard : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxClipboard)
DECLARE_DYNAMIC_CLASS(wxClipboard)
public:
wxClipboardClient *clipOwner;
char *cbString, *sentString, *receivedString;
void *receivedTargets;
long receivedLength;
public:
wxClipboard();
~wxClipboard();
wxClipboard();
~wxClipboard();
// open the clipboard before SetData() and GetData()
virtual bool Open();
/* Set the clipboard data owner. "time" comes from the event record. */
void SetClipboardClient(wxClipboardClient *, long time);
// close the clipboard after SetData() and GetData()
virtual void Close();
/* Set the clipboard string; does not require a client. */
void SetClipboardString(char *, long time);
// query whether the clipboard is opened
virtual bool IsOpened() const;
/* Get data from the clipboard in the format "TEXT". */
char *GetClipboardString(long time);
// set the clipboard data. all other formats will be deleted.
virtual bool SetData( wxDataObject *data );
/* Get data from the clipboard */
char *GetClipboardData(char *format, long *length, long time);
// add to the clipboard data.
virtual bool AddData( wxDataObject *data );
/* Get the clipboard client directly. Will be NULL if clipboard data
is a string, or if some other application owns the clipboard.
This can be useful for shortcutting data translation, if the
clipboard user can check for a specific client. (This is used
by the wxMediaEdit class.) */
wxClipboardClient *GetClipboardClient();
// ask if data in correct format is available
virtual bool IsSupported( wxDataFormat format );
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data );
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear();
// flushes the clipboard: this means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// eating memory), otherwise the clipboard will be emptied on exit
virtual bool Flush();
// X11 has two clipboards which get selected by this call. Empty on MSW.
void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
private:
bool m_clearOnExit;
};
/* Initialize wxTheClipboard. Can be called repeatedly */
void WXDLLEXPORT wxInitClipboard();
/* The clipboard */
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
#endif // wxUSE_CLIPBOARD
#endif
// _WX_CLIPBRD_H_

View File

@@ -64,7 +64,7 @@ public:
unsigned char Blue() const { return m_blue; }
// comparison
bool operator == (const wxColour& colour)
bool operator == (const wxColour& colour) const
{
return (m_red == colour.m_red &&
m_green == colour.m_green &&

View File

@@ -33,12 +33,36 @@ public:
// Calls the callback and appropriate event handlers
bool ProcessCommand(wxCommandEvent& event);
virtual void SetLabel(const wxString& title) ;
wxList& GetSubcontrols() { return m_subControls; }
void OnEraseBackground(wxEraseEvent& event);
virtual bool Enable(bool enabled) ;
virtual bool Show(bool show) ;
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label ,
const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator,
const wxString& name , Rect *outBounds , StringPtr maclabel ) ;
virtual void MacPostControlCreate() ;
virtual void MacAdjustControlRect() ;
virtual ControlHandle MacGetContainerForEmbedding() ;
virtual void MacSuperChangedPosition() ;
virtual void MacSuperEnabled( bool enabled ) ;
virtual void MacSuperShown( bool show ) ;
virtual bool MacCanFocus() const ;
void DoSetSize(int x, int y,int width, int height,int sizeFlags ) ;
virtual void OnKeyDown( wxKeyEvent &event ) ;
virtual void OnMouseEvent( wxMouseEvent &event ) ;
virtual void OnPaint(wxPaintEvent& event) ;
virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ;
ControlHandle GetMacControl() { return m_macControl ;}
#if WXWIN_COMPATIBILITY
virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
wxColour* GetButtonColour() const { return NULL; }
@@ -59,18 +83,13 @@ protected:
protected:
// For controls like radiobuttons which are really composite
ControlHandle m_macControl ;
int m_macHorizontalBorder ;
int m_macVerticalBorder ;
wxList m_subControls;
virtual wxSize DoGetBestSize();
// create the control of the given class with the given style, returns FALSE
// if creation failed
bool MSWCreateControl(const wxChar *classname, WXDWORD style);
// determine the extended styles combination for this window (may slightly
// modify styl parameter)
WXDWORD GetExStyle(WXDWORD& style) const;
private:
DECLARE_EVENT_TABLE()
};

View File

@@ -20,79 +20,111 @@
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
class WXDLLEXPORT wxMacToolTip ;
// Dialog boxes
class WXDLLEXPORT wxDialog: public wxPanel
class WXDLLEXPORT wxDialog : public wxDialogBase
{
DECLARE_DYNAMIC_CLASS(wxDialog)
DECLARE_DYNAMIC_CLASS(wxDialog)
public:
wxDialog();
wxDialog();
// Constructor with a modal flag, but no window id - the old convention
wxDialog(wxWindow *parent,
const wxString& title, bool modal,
int x = -1, int y= -1, int width = 500, int height = 500,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
{
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height),
style | modalStyle, name);
}
// Constructor with a modal flag, but no window id - the old convention
inline wxDialog(wxWindow *parent,
const wxString& title, bool modal,
int x = -1, int y= -1, int width = 500, int height = 500,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
{
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
}
// Constructor with no modal flag - the new convention.
wxDialog(wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
{
Create(parent, id, title, pos, size, style, name);
}
// Constructor with no modal flag - the new convention.
inline wxDialog(wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
{
Create(parent, id, title, pos, size, style, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& title, // bool modal = FALSE, // TODO make this a window style?
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr);
~wxDialog();
~wxDialog();
virtual bool Destroy();
virtual bool Destroy();
bool Show(bool show);
void Fit();
virtual void DoSetClientSize(int width, int height);
void Iconize(bool iconize);
virtual void GetPosition(int *x, int *y) const;
virtual bool IsIconized() const;
void OnCharHook(wxKeyEvent& event);
void OnCloseWindow(wxCloseEvent& event);
bool Show(bool show);
bool IsShown() const;
void Iconize(bool iconize);
void SetModal(bool flag);
#if WXWIN_COMPATIBILITY
bool Iconized() const { return IsIconized(); };
#endif
virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
virtual bool IsIconized() const;
void Fit();
virtual int ShowModal();
virtual void EndModal(int retCode);
void SetTitle(const wxString& title);
wxString GetTitle() const ;
// Standard buttons
void OnOK(wxCommandEvent& event);
void OnApply(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
void OnSize(wxSizeEvent& event);
bool OnClose();
void OnCharHook(wxKeyEvent& event);
void OnPaint(wxPaintEvent& event);
void OnCloseWindow(wxCloseEvent& event);
void OnSize(wxSizeEvent& event) ;
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
void SetModal(bool flag);
// splits text up at newlines and places the
// lines into a vertical wxBoxSizer
wxSizer *CreateTextSizer( const wxString &message );
// places buttons into a horizontal wxBoxSizer
wxSizer *CreateButtonSizer( long flags );
virtual void Centre(int direction = wxBOTH);
virtual bool IsModal() const;
DECLARE_EVENT_TABLE()
// For now, same as Show(TRUE) but returns return code
virtual int ShowModal();
virtual void EndModal(int retCode);
// Standard buttons
void OnOK(wxCommandEvent& event);
void OnApply(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
// implementation
// --------------
bool IsModalShowing() const { return m_modalShowing; }
// tooltip management
#if wxUSE_TOOLTIPS
wxMacToolTip* GetToolTipCtrl() const { return m_hwndToolTip; }
void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = tt; }
wxMacToolTip* m_hwndToolTip ;
#endif // tooltips
protected:
bool m_modalShowing;
WXHWND m_hwndOldFocus; // the window which had focus before we were shown
private:
DECLARE_EVENT_TABLE()
};
#endif

View File

@@ -16,15 +16,66 @@
#pragma interface "font.h"
#endif
// ----------------------------------------------------------------------------
// public functions
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFontRefData: public wxGDIRefData
{
friend class WXDLLEXPORT wxFont;
public:
wxFontRefData()
{
Init(12, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE,
"", wxFONTENCODING_DEFAULT);
}
// convert wxFontEncoding into one of Windows XXX_CHARSET constants (fill exact
// parameter if it's not NULL with TRUE if encoding is realyl supported under
// Windows and FALSE if not and we just chose something close to it)
extern int wxCharsetFromEncoding(wxFontEncoding encoding, bool *exact = NULL);
wxFontRefData(const wxFontRefData& data)
{
Init(data.m_pointSize, data.m_family, data.m_style, data.m_weight,
data.m_underlined, data.m_faceName, data.m_encoding);
m_macFontNum = data.m_macFontNum ;
m_macFontSize = data.m_macFontSize;
m_macFontStyle = data.m_macFontStyle;
m_fontId = data.m_fontId;
}
wxFontRefData(int size,
int family,
int style,
int weight,
bool underlined,
const wxString& faceName,
wxFontEncoding encoding)
{
Init(size, family, style, weight, underlined, faceName, encoding);
}
virtual ~wxFontRefData();
protected:
// common part of all ctors
void Init(int size,
int family,
int style,
int weight,
bool underlined,
const wxString& faceName,
wxFontEncoding encoding);
// font characterstics
int m_fontId;
int m_pointSize;
int m_family;
int m_style;
int m_weight;
bool m_underlined;
wxString m_faceName;
wxFontEncoding m_encoding;
public :
short m_macFontNum ;
short m_macFontSize ;
Style m_macFontStyle ;
public :
void MacFindFont() ;
};
// ----------------------------------------------------------------------------
// wxFont
// ----------------------------------------------------------------------------
@@ -87,6 +138,7 @@ public:
virtual bool RealizeResource();
virtual WXHANDLE GetResourceHandle();
virtual bool FreeResource(bool force = FALSE);
void MacInstall() const ;
/*
virtual bool UseResource();
virtual bool ReleaseResource();

View File

@@ -125,8 +125,9 @@ public:
void OnSysColourChanged(wxSysColourChangedEvent& event);
// Query app for menu item updates (called from OnIdle)
void DoMenuUpdates();
void DoMenuUpdates(wxMenu* menu);
// Query app for menu item updates (called from OnIdle)
void DoMenuUpdates();
void DoMenuUpdates(wxMenu* menu, wxWindow* focusWin);
// Checks if there is a toolbar, and returns the first free client position
virtual wxPoint GetClientAreaOrigin() const;
@@ -136,7 +137,8 @@ public:
// tooltip management
#if wxUSE_TOOLTIPS
wxMacToolTip* GetToolTipCtrl() const { return m_hwndToolTip; }
void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = wxMacToolTip; }
void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = tt; }
wxMacToolTip* m_hwndToolTip ;
#endif // tooltips
protected:

View File

@@ -44,6 +44,8 @@ public:
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
wxIcon( const char **bits, int width=-1, int height=-1 );
wxIcon( char **bits, int width=-1, int height=-1 );
wxIcon(const char bits[], int width, int height);
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICON_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1);

View File

@@ -9,93 +9,116 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LISTBOX_H_
#define _WX_LISTBOX_H_
#ifdef __GNUG__
#pragma interface "listbox.h"
#pragma interface "listbox.h"
#endif
#include "wx/control.h"
#include "wx/dynarray.h"
// ----------------------------------------------------------------------------
// simple types
// ----------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
#if wxUSE_OWNER_DRAWN
class WXDLLEXPORT wxOwnerDrawn;
// define the array of list box items
#include <wx/dynarray.h>
WX_DEFINE_EXPORTED_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
#endif // wxUSE_OWNER_DRAWN
// forward decl for GetSelections()
class WXDLLEXPORT wxArrayInt;
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
class wxArrayInt;
// List box item
WX_DEFINE_ARRAY( char * , wxListDataArray ) ;
class WXDLLEXPORT wxListBox: public wxControl
// ----------------------------------------------------------------------------
// List box control
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxListBox : public wxListBoxBase
{
DECLARE_DYNAMIC_CLASS(wxListBox)
public:
public:
// ctors and such
wxListBox();
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox();
inline wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxListBox();
~wxListBox();
// implement base class pure virtuals
virtual void Clear();
virtual void Delete(int n);
virtual void Append(const wxString& item);
virtual void Append(const wxString& item, char *clientData);
virtual void Set(int n, const wxString* choices, char **clientData = NULL);
virtual int FindString(const wxString& s) const ;
virtual void Clear();
virtual void SetSelection(int n, bool select = TRUE);
virtual int GetCount() const;
virtual wxString GetString(int n) const;
virtual void SetString(int n, const wxString& s);
virtual int FindString(const wxString& s) const;
virtual void Deselect(int n);
virtual bool IsSelected(int n) const;
virtual void SetSelection(int n, bool select = TRUE);
virtual int GetSelection() const;
virtual int GetSelections(wxArrayInt& aSelections) const;
// For single choice list item only
virtual int GetSelection() const ;
virtual void Delete(int n);
virtual char *GetClientData(int n) const ;
virtual void SetClientData(int n, char *clientData);
virtual void SetString(int n, const wxString& s);
virtual int DoAppend(const wxString& item);
virtual void DoInsertItems(const wxArrayString& items, int pos);
virtual void DoSetItems(const wxArrayString& items, void **clientData);
// For single or multiple choice list item
virtual int GetSelections(wxArrayInt& aSelections) const;
virtual bool Selected(int n) const ;
virtual wxString GetString(int n) const ;
virtual void DoSetFirstItem(int n);
// Set the specified item at the first visible item
// or scroll to max range.
virtual void SetFirstItem(int n) ;
virtual void SetFirstItem(const wxString& s) ;
virtual void DoSetItemClientData(int n, void* clientData);
virtual void* DoGetItemClientData(int n) const;
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
virtual wxClientData* DoGetItemClientObject(int n) const;
virtual void InsertItems(int nItems, const wxString items[], int pos);
// wxCheckListBox support
#if wxUSE_OWNER_DRAWN
// plug-in for derived classes
virtual wxOwnerDrawn *CreateItem(size_t n);
virtual wxString GetStringSelection() const ;
virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
virtual int Number() const ;
// allows to get the item and use SetXXX functions to set it's appearance
wxOwnerDrawn *GetItem(size_t n) const { return m_aItems[n]; }
void Command(wxCommandEvent& event);
// get the index of the given item
int GetItemIndex(wxOwnerDrawn *item) const { return m_aItems.Index(item); }
#endif // wxUSE_OWNER_DRAWN
void MacSetRedraw( bool doDraw ) ;
protected:
int m_noItems;
int m_selected;
// Windows-specific code to set the horizontal extent of the listbox, if
// necessary. If s is non-NULL, it's used to calculate the horizontal
// extent. Otherwise, all strings are used.
virtual void SetHorizontalExtent(const wxString& s = wxEmptyString);
// Windows callbacks
virtual void SetupColours();
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
ListHandle m_macList ;
wxArrayString m_stringArray ;
wxListDataArray m_dataArray ;
void MacSetRedraw( bool doDraw ) ;
protected:
void MacDestroy() ;
void MacDelete( int n ) ;
void MacInsert( int n , const char * text) ;
@@ -111,13 +134,25 @@ class WXDLLEXPORT wxListBox: public wxControl
void MacDoClick() ;
void MacDoDoubleClick() ;
public :
ListHandle m_macList ;
wxArrayString m_stringArray ;
wxListDataArray m_dataArray ;
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
DECLARE_EVENT_TABLE()
// do we have multiple selections?
bool HasMultipleSelection() const;
// free memory (common part of Clear() and dtor)
void Free();
int m_noItems;
int m_selected;
virtual wxSize DoGetBestSize();
#if wxUSE_OWNER_DRAWN
// control items
wxListBoxItemsArray m_aItems;
#endif
private:
DECLARE_DYNAMIC_CLASS(wxListBox)
DECLARE_EVENT_TABLE()
};
#endif

View File

@@ -16,168 +16,193 @@
#pragma interface "menu.h"
#endif
#include "wx/defs.h"
#include "wx/event.h"
#if wxUSE_ACCEL
#include "wx/accel.h"
#include "wx/dynarray.h"
class WXDLLEXPORT wxMenuItem;
class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxMenu;
WX_DEFINE_EXPORTED_ARRAY(wxAcceleratorEntry *, wxAcceleratorArray);
#endif // wxUSE_ACCEL
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
class WXDLLEXPORT wxFrame;
// ----------------------------------------------------------------------------
// Menu
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenu: public wxEvtHandler
class WXDLLEXPORT wxMenu : public wxMenuBase
{
DECLARE_DYNAMIC_CLASS(wxMenu)
public:
// ctor & dtor
wxMenu(const wxString& title = wxEmptyString, const wxFunction func = NULL);
~wxMenu();
// ctors & dtor
wxMenu(const wxString& title, long style = 0)
: wxMenuBase(title, style) { Init(); }
// construct menu
// append items to the menu
// separator line
void AppendSeparator();
// normal item
void Append(int id, const wxString& Label, const wxString& helpString = wxEmptyString,
bool checkable = FALSE);
// a submenu
void Append(int id, const wxString& Label, wxMenu *SubMenu,
const wxString& helpString = wxEmptyString);
// the most generic form (create wxMenuItem first and use it's functions)
void Append(wxMenuItem *pItem);
// insert a break in the menu
void Break();
// delete an item
void Delete(int id);
wxMenu(long style = 0) : wxMenuBase(style) { Init(); }
// menu item control
void Enable(int id, bool Flag);
bool Enabled(int id) const;
inline bool IsEnabled(int id) const { return Enabled(id); };
void Check(int id, bool Flag);
bool Checked(int id) const;
inline bool IsChecked(int id) const { return IsChecked(id); };
virtual ~wxMenu();
// Client data
inline void SetClientData(void* clientData) { m_clientData = clientData; }
inline void* GetClientData() const { return m_clientData; }
// implement base class virtuals
virtual bool DoAppend(wxMenuItem *item);
virtual bool DoInsert(size_t pos, wxMenuItem *item);
virtual wxMenuItem *DoRemove(wxMenuItem *item);
// item properties
// title
void SetTitle(const wxString& label);
const wxString GetTitle() const;
// label
void SetLabel(int id, const wxString& label);
wxString GetLabel(int id) const;
// help string
virtual void SetHelpString(int id, const wxString& helpString);
virtual wxString GetHelpString(int id) const ;
virtual void Break();
// find item
// Finds the item id matching the given string, -1 if not found.
virtual int FindItem(const wxString& itemString) const ;
// Find wxMenuItem by ID, and item's menu too if itemMenu is !NULL.
wxMenuItem *FindItemForId(int itemId, wxMenu **itemMenu = NULL) const;
virtual void SetTitle(const wxString& title);
void ProcessCommand(wxCommandEvent& event);
inline void Callback(const wxFunction func) { m_callback = func; }
// MSW-specific
bool ProcessCommand(wxCommandEvent& event);
virtual void SetParent(wxEvtHandler *parent) { m_parent = parent; }
inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
#if WXWIN_COMPATIBILITY
wxMenu(const wxString& title, const wxFunction func)
: wxMenuBase(title)
{
Callback(func);
}
#endif // WXWIN_COMPATIBILITY
inline wxList& GetItems() const { return (wxList&) m_menuItems; }
// implementation only from now on
// -------------------------------
void SetInvokingWindow(wxWindow *pWin) { m_pInvokingWindow = pWin; }
wxWindow * GetInvokingWindow() const { return m_pInvokingWindow; }
bool MacMenuSelect(wxEvtHandler* handler, long when , int macMenuId, int macMenuItemNum) ;
int MacGetIndexFromId( int id ) ;
int MacGetIndexFromItem( wxMenuItem *pItem ) ;
void MacEnableMenu( bool bDoEnable ) ;
bool MacMenuSelect(wxEvtHandler* handler, long when , int macMenuId, int macMenuItemNum) ;
public:
wxFunction m_callback;
// semi-private accessors
// get the window which contains this menu
wxWindow *GetWindow() const;
// get the menu handle
WXHMENU GetHMenu() const { return m_hMenu; }
int m_noItems;
wxString m_title;
wxMenuBar * m_menuBar;
wxList m_menuItems;
wxEvtHandler * m_parent;
wxEvtHandler * m_eventHandler;
wxWindow* m_pInvokingWindow;
void* m_clientData;
MenuHandle m_macMenuHandle;
short m_macMenuId;
bool m_macMenuEnabled ;
// attach/detach menu to/from wxMenuBar
void Attach(wxMenuBar *menubar);
void Detach();
short MacGetMenuId() { return m_macMenuId ; }
#if wxUSE_ACCEL
// called by wxMenuBar to build its accel table from the accels of all menus
bool HasAccels() const { return !m_accels.IsEmpty(); }
size_t GetAccelCount() const { return m_accels.GetCount(); }
size_t CopyAccels(wxAcceleratorEntry *accels) const;
// void MacSetTitle(const wxString& title);
int MacGetIndexFromId( int id ) ;
int MacGetIndexFromItem( wxMenuItem *pItem ) ;
void MacEnableMenu( bool bDoEnable ) ;
// called by wxMenuItem when its accels changes
void UpdateAccel(wxMenuItem *item);
static short s_macNextMenuId ;
// helper used by wxMenu itself (returns the index in m_accels)
int FindAccel(int id) const;
#endif // wxUSE_ACCEL
protected:
private:
// common part of all ctors
void Init();
// common part of Append/Insert (behaves as Append is pos == (size_t)-1)
bool DoInsertOrAppend(wxMenuItem *item, size_t pos = (size_t)-1);
// if TRUE, insert a breal before appending the next item
bool m_doBreak;
// the menu handle of this menu
WXHMENU m_hMenu;
short m_macMenuId;
static short s_macNextMenuId ;
#if wxUSE_ACCEL
// the accelerators for our menu items
wxAcceleratorArray m_accels;
#endif // wxUSE_ACCEL
DECLARE_DYNAMIC_CLASS(wxMenu)
};
// ----------------------------------------------------------------------------
// Menu Bar (a la Windows)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFrame;
class WXDLLEXPORT wxMenuBar: public wxEvtHandler
class WXDLLEXPORT wxMenuBar : public wxMenuBarBase
{
DECLARE_DYNAMIC_CLASS(wxMenuBar)
public:
// ctors & dtor
// default constructor
wxMenuBar();
// unused under MSW
wxMenuBar(long style);
// menubar takes ownership of the menus arrays but copies the titles
wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
virtual ~wxMenuBar();
wxMenuBar();
wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
~wxMenuBar();
// menubar construction
virtual bool Append( wxMenu *menu, const wxString &title );
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Remove(size_t pos);
void Append(wxMenu *menu, const wxString& title);
// Must only be used AFTER menu has been attached to frame,
// otherwise use individual menus to enable/disable items
void Enable(int Id, bool Flag);
bool Enabled(int Id) const ;
inline bool IsEnabled(int Id) const { return Enabled(Id); };
void EnableTop(int pos, bool Flag);
void Check(int id, bool Flag);
bool Checked(int id) const ;
inline bool IsChecked(int Id) const { return Checked(Id); };
void SetLabel(int id, const wxString& label) ;
wxString GetLabel(int id) const ;
void SetLabelTop(int pos, const wxString& label) ;
wxString GetLabelTop(int pos) const ;
virtual void Delete(wxMenu *menu, int index = 0); /* Menu not destroyed */
virtual bool OnAppend(wxMenu *menu, const char *title);
virtual bool OnDelete(wxMenu *menu, int index);
virtual int FindMenuItem(const wxString& menuString,
const wxString& itemString) const;
virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const;
virtual void SetHelpString(int Id, const wxString& helpString);
virtual wxString GetHelpString(int Id) const ;
virtual void EnableTop( size_t pos, bool flag );
virtual void SetLabelTop( size_t pos, const wxString& label );
virtual wxString GetLabelTop( size_t pos ) const;
virtual int FindMenuItem(const wxString& menuString, const wxString& itemString) const ;
// compatibility: these functions are deprecated
#if WXWIN_COMPATIBILITY
void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
wxEvtHandler *GetEventHandler() { return m_eventHandler; }
// Find wxMenuItem for item ID, and return item's
// menu too if itemMenu is non-NULL.
wxMenuItem *FindItemForId(int itemId, wxMenu **menuForItem = NULL) const ;
bool Enabled(int id) const { return IsEnabled(id); }
bool Checked(int id) const { return IsChecked(id); }
#endif // WXWIN_COMPATIBILITY
inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
// implementation from now on
WXHMENU Create();
int FindMenu(const wxString& title);
void Detach();
inline int GetMenuCount() const { return m_menuCount; }
inline wxMenu* GetMenu(int i) const { return m_menus[i]; }
// returns TRUE if we're attached to a frame
bool IsAttached() const { return m_menuBarFrame != NULL; }
// get the frame we live in
wxFrame *GetFrame() const { return m_menuBarFrame; }
// attach to a frame
void Attach(wxFrame *frame);
#if wxUSE_ACCEL
// get the accel table for all the menus
const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; }
// update the accel table (must be called after adding/deletign a menu)
void RebuildAccelTable();
#endif // wxUSE_ACCEL
// if the menubar is modified, the display is not updated automatically,
// call this function to update it (m_menuBarFrame should be !NULL)
void Refresh();
void MacInstallMenuBar() ;
void MacMenuSelect(wxEvtHandler* handler, long when , int macMenuId, int macMenuItemNum) ;
static wxMenuBar* MacGetInstalledMenuBar() { return s_macInstalledMenuBar ; }
public:
wxEvtHandler * m_eventHandler;
int m_menuCount;
wxMenu ** m_menus;
wxString * m_titles;
wxFrame * m_menuBarFrame;
protected:
// common part of all ctors
void Init();
#if WXWIN_COMPATIBILITY
wxEvtHandler *m_eventHandler;
#endif // WXWIN_COMPATIBILITY
wxArrayString m_titles;
wxFrame *m_menuBarFrame;
#if wxUSE_ACCEL
// the accelerator table for all accelerators in all our menus
wxAcceleratorTable m_accelTable;
#endif // wxUSE_ACCEL
private:
static wxMenuBar* s_macInstalledMenuBar ;
DECLARE_DYNAMIC_CLASS(wxMenuBar)
};
#endif // _WX_MENU_H_

View File

@@ -11,46 +11,4 @@
#ifndef _WX_PRINT_H_
#define _WX_PRINT_H_
#ifdef __GNUG__
#pragma interface "print.h"
#endif
#include "wx/prntbase.h"
/*
* Represents the printer: manages printing a wxPrintout object
*/
class WXDLLEXPORT wxPrinter: public wxPrinterBase
{
DECLARE_DYNAMIC_CLASS(wxPrinter)
public:
wxPrinter(wxPrintData *data = NULL);
~wxPrinter();
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
virtual bool PrintDialog(wxWindow *parent);
virtual bool Setup(wxWindow *parent);
};
/*
* wxPrintPreview
* Programmer creates an object of this class to preview a wxPrintout.
*/
class WXDLLEXPORT wxPrintPreview: public wxPrintPreviewBase
{
DECLARE_CLASS(wxPrintPreview)
public:
wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL);
~wxPrintPreview();
virtual bool Print(bool interactive);
virtual void DetermineScaling();
};
#endif
// _WX_PRINT_H_
#endif

View File

@@ -33,18 +33,21 @@ class WXDLLEXPORT wxPrintDialog: public wxDialog
public:
wxPrintDialog();
wxPrintDialog(wxWindow *parent, wxPrintData* data = NULL);
wxPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL);
wxPrintDialog(wxWindow *parent, wxPrintData* data );
~wxPrintDialog();
bool Create(wxWindow *parent, wxPrintData* data = NULL);
bool Create(wxWindow *parent, wxPrintDialogData* data = NULL);
virtual int ShowModal();
inline wxPrintData& GetPrintData() { return m_printData; }
wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
wxPrintData& GetPrintData() { return m_printDialogData.GetPrintData(); }
virtual wxDC *GetPrintDC();
private:
wxPrintData m_printData;
wxPrintDialogData m_printDialogData;
wxDC* m_printerDC;
bool m_destroyDC;
wxWindow* m_dialogParent;
};
@@ -52,9 +55,6 @@ class WXDLLEXPORT wxPageSetupDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
private:
wxPageSetupData m_pageSetupData;
wxWindow* m_dialogParent;
public:
wxPageSetupDialog();
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
@@ -64,6 +64,9 @@ class WXDLLEXPORT wxPageSetupDialog: public wxDialog
virtual int ShowModal();
inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
private:
wxPageSetupData m_pageSetupData;
wxWindow* m_dialogParent;
};
#endif

View File

@@ -16,71 +16,109 @@
* General features
*
*/
#define wxUSE_BUSYINFO 1
#define WORDS_BIGENDIAN 1
#define wxUSE_LIBPNG 1
// Use PNG bitmap code
#define wxUSE_LIBJPEG 1
// Use JPEG bitmap code
#define wxUSE_STREAMS 1
#define wxUSE_ZLIB 1
#define wxUSE_ZIPSTREAM 1
#define wxUSE_SOCKETS 1
#define wxUSE_CONSTRAINTS 1
// Use constraints mechanism
#define wxUSE_CONFIG 1
// Use wxConfig, with CreateConfig in wxApp
#define _WX_GOODCOMPILER__
// gcc can have problems, but Windows compilers
// are generally OK.
#define WXWIN_COMPATIBILITY 0
// Compatibility with 1.66 API.
// Level 0: no backward compatibility, all new features
// Level 1: wxDC, OnSize (etc.) compatibility, but
// some new features such as event tables
#define wxUSE_AUTOTRANS 0
// Define wxTString
#define wxUSE_POSTSCRIPT 0
// 0 for no PostScript device context
#define wxUSE_AFM_FOR_POSTSCRIPT 0
// 1 to use font metric files in GetTextExtent
#define wxUSE_METAFILE 1
// 0 for no Metafile and metafile device context
#define wxUSE_FORM 0
// 0 for no wxForm
#define wxUSE_IPC 0
// 0 for no interprocess comms
#define wxUSE_HELP 0
// 0 for no help facility
#define wxUSE_RESOURCES 1
// 0 for no wxGetResource/wxWriteResource
#define wxUSE_CONSTRAINTS 1
// Use constraints mechanism
#define wxUSE_TIMEDATE 1
// 0 for no wxTime/wxDate classes
#define wxUSE_CLIPBOARD 1
// 0 for no clipboard functions
#define wxUSE_SPLINES 0
// 0 for no splines
#define wxUSE_XFIG_SPLINE_CODE 0
// 1 for XFIG spline code, 0 for AIAI spline code.
// AIAI spline code is slower, but freer of copyright issues.
// 0 for no splines
// 0 for no clipboard functions
#define wxUSE_SPLINES 1
// 0 for no splines
#define wxUSE_TOOLBAR 1
// Use toolbars
#define wxUSE_DRAG_AND_DROP 0
// 0 for no drag and drop
// 0 for no drag and drop
#define wxUSE_TOOLBAR 1
// Define 1 to use toolbar classes
#define wxUSE_BUTTONBAR 1
// Define 1 to use buttonbar classes (enhanced toolbar
// for MS Windows)
#define wxUSE_GAUGE 1
// Define 1 to use Microsoft's gauge (Windows)
// or Bull's gauge (Motif) library (both in contrib).
#define wxUSE_COMBOBOX 1
// Define 1 to use COMBOXBOX control (Windows)
// or FWW's ComboBox widget (Motif).
#define wxUSE_CHOICE 1
// Define 1 to use CHOICE
#define wxUSE_RADIOBUTTON 1
// Define 1 to use radio button control
#define wxUSE_RADIOBTN 1
// Unfortunately someone introduced this one, too
#define wxUSE_SCROLLBAR 1
// Define 1 to compile contributed wxScrollBar class
#define wxUSE_CHECKBOX 1
// Define 1 to compile checkbox
#define wxUSE_LISTBOX 1
// Define 1 to compile listbox
#define wxUSE_SPINBTN 1
// Define 1 to compile spin button
// use wxStaticLine class (separator line in the dialog)?
#define wxUSE_STATLINE 1
#define wxUSE_CHECKLISTBOX 1
// Define 1 to compile check listbox
#define wxUSE_CHOICE 1
// Define 1 to compile choice
#define wxUSE_CARET 1
// Define 1 to use wxCaret class
#define wxUSE_XPM_IN_MSW 1
// Define 1 to support the XPM package in wxBitmap.
#define wxUSE_IMAGE_LOADING_IN_MSW 1
// Use dynamic DIB loading/saving code in utils/dib under MSW.
#define wxUSE_RESOURCE_LOADING_IN_MSW 1
// Use dynamic icon/cursor loading/saving code
// under MSW.
#define wxUSE_WX_RESOURCES 1
// Use .wxr resource mechanism (requires PrologIO library)
// support for startup tips (wxShowTip &c)
#define wxUSE_STARTUP_TIPS 1
// BC++/Win16 can't cope with the amount of data in resource.cpp
#if defined(__WIN16__) && defined(__BORLANDC__)
#undef wxUSE_WX_RESOURCES
#define wxUSE_WX_RESOURCES 0
#endif
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
// Set to 0 to disable document/view architecture
#define wxUSE_MDI_ARCHITECTURE 1
// Set to 0 to disable MDI document/view architecture
#define wxUSE_PRINTING_ARCHITECTURE 1
// Set to 0 to disable print/preview architecture code
#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
// Set to 0 to disable PostScript print/preview architecture code
// under Windows (just use Windows printing).
#define wxUSE_DYNAMIC_CLASSES 1
@@ -88,19 +126,19 @@
// NOW MANDATORY: don't change.
#define wxUSE_MEMORY_TRACING 1
// If 1, enables debugging versions of wxObject::new and
// wxObject::delete *IF* WXDEBUG is also defined.
// wxObject::delete *IF* __WXDEBUG__ is also defined.
// WARNING: this code may not work with all architectures, especially
// if alignment is an issue.
#define wxUSE_DEBUG_CONTEXT 1
// If 1, enables wxDebugContext, for
// writing error messages to file, etc.
// If WXDEBUG is not defined, will still use
// If __WXDEBUG__ is not defined, will still use
// normal memory operators.
// It's recommended to set this to 1,
// since you may well need to output
// an error log in a production
// version (or non-debugging beta)
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
#define wxUSE_GLOBAL_MEMORY_OPERATORS 1
// In debug mode, cause new and delete to be redefined globally.
// If this causes problems (e.g. link errors), set this to 0.
@@ -108,16 +146,16 @@
// In debug mode, causes new to be defined to
// be WXDEBUG_NEW (see object.h).
// If this causes problems (e.g. link errors), set this to 0.
// You may need to set this to 0 if using templates (at least
// for VC++).
#define REMOVE_UNUSED_ARG 1
// Set this to 0 if your compiler can't cope
// with omission of prototype parameters.
#define wxUSE_C_MAIN 0
// Set to 1 to use main.c instead of main.cpp (UNIX only)
#define wxUSE_ODBC 1
// Define 1 to use ODBC classes
#define wxUSE_ODBC 0
// Define 1 to use ODBC classes
#define wxODBC_FWD_ONLY_CURSORS 1
// Some databases/ODBC drivers only allow forward scrolling cursors.
@@ -129,36 +167,67 @@
#ifndef __MWERKS__
#define wxUSE_IOSTREAMH 0
#else
#define wxUSE_IOSTREAMH 1
#endif
// VC++ 4.2 and above allows <iostream> and <iostream.h>
// but you can't mix them. Set to 1 for <iostream.h>,
// 0 for <iostream>
#define wxUSE_ZIPSTREAM 1
#define wxUSE_FS_ZIP 1
#define wxUSE_FS_INET 1
#define wxUSE_STREAMS 1
// If enabled (1), compiles wxWindows streams classes
#define wxUSE_STD_IOSTREAM 1
// Use standard C++ streams if 1. If 0, use wxWin
// streams implementation.
#define wxUSE_WXCONFIG 0
#define wxUSE_WXCONFIG 1
// if enabled, compiles built-in OS independent wxConfig
// class and it's file (any platform) and registry (Win)
// based implementations
#define wxUSE_THREADS 1
// support for multithreaded applications: if
// 1, compile in thread classes (thread.h)
// and make the library thread safe
#define wxUSE_ZLIB 1
// Use zlib for compression in streams and PNG code
#define wxUSE_LIBPNG 1
// Use PNG bitmap code
#define wxUSE_LIBJPEG 0
// Use JPEG bitmap code
#define wxUSE_SERIAL 0
// Use serialization (requires utils/serialize)
#define wxUSE_DYNLIB_CLASS 0
// Compile in wxLibrary class for run-time
// DLL loading and function calling
#define wxUSE_TOOLTIPS 1
// Define to use wxToolTip class and
// wxWindow::SetToolTip() method
#define wxUSE_SOCKETS 1 // 0
// Set to 1 to use socket classes
#define wxUSE_HTML 1 // 0
// Set to 1 to use wxHTML sub-library
#define wxUSE_FS_ZIP 1 // 0
#define wxUSE_FS_INET 1 // 0 // Set to 1 to enable virtual file systems
#define wxUSE_BUSYINFO 1 // 0
// wxBusyInfo displays window with message
// when app is busy. Works in same way as
// wxBusyCursor
#define wxUSE_ZIPSTREAM 1 // 0
// input stream for reading from zip archives
/*
* Finer detail
*
*/
#define wxUSE_APPLE_IEEE 1
// if enabled, the float codec written by Apple
// will be used to write, in a portable way,
// float on the disk
#define wxUSE_APPLE_IEEE 1
// if enabled, the float codec written by Apple
// will be used to write, in a portable way,
// float on the disk
// use wxFile class - required by i18n code, wxConfig and others - recommended
#define wxUSE_FILE 1
@@ -184,8 +253,6 @@
// text entry dialog and wxGetTextFromUser function
#define wxUSE_TEXTDLG 1
#define wxUSE_STATLINE 1
// wxToolBar class
#define wxUSE_TOOLBAR 1
@@ -198,5 +265,68 @@
// wxDirDlg class for getting a directory name from user
#define wxUSE_DIRDLG 1
/*
* MS Windows/Windows NT
*
*/
#define wxUSE_OLE 1
// drag-and-drop, clipboard, OLE Automation
#if defined(__WIN95__)
#define wxUSE_CTL3D 0
#else
#define wxUSE_CTL3D 1
// Define 1 to use Microsoft CTL3D library.
// See note above about using FAFA and CTL3D.
#endif
#define wxUSE_COMMON_DIALOGS 1
// On rare occasions (e.g. using DJGPP) may want
// to omit common dialogs
// (e.g. file selector, printer dialog).
// Switching this off also switches off
// the printing architecture and interactive
// wxPrinterDC.
#define wxUSE_ITSY_BITSY 1
// Define 1 to use Microsoft's ItsyBitsy
// small title bar library, for wxMiniFrame
#define wxUSE_BITMAP_MESSAGE 1
// Define 1 to use bitmap messages.
#define wxUSE_PORTABLE_FONTS_IN_MSW 0
// Define 1 to use new portable font scheme in Windows
// (used by default under X)
#define wxFONT_SIZE_COMPATIBILITY 0
// Define 1 for font size to be backward compatible
// to 1.63 and earlier. 1.64 and later define point
// sizes to be compatible with Windows.
#define wxUSE_GENERIC_DIALOGS_IN_MSW 1
// Define 1 to use generic dialogs in Windows, even though
// they duplicate native common dialog (e.g. wxColourDialog)
#define wxUSE_PENWINDOWS 0
// Set to 1 to use PenWindows
#define wxUSE_OWNER_DRAWN 1
// Owner-drawn menus and listboxes
#define wxUSE_NATIVE_STATUSBAR 1
// Set to 0 to use cross-platform wxStatusBar
#define wxUSE_DBWIN32 1
// Use Andrew Tucker's OutputDebugString implementation
// (required on Win95 only). See utils.cpp.
/*
* Any platform
*
*/
#define wxUSE_TYPEDEFS 1
// Use typedefs not classes for wxPoint
// and others, to reduce overhead and avoid
// MS C7 memory bug. Bounds checker
// complains about deallocating
// arrays of wxPoints if wxPoint is a class.
#endif
// _WX_SETUP_H_

View File

@@ -29,71 +29,48 @@
wxSP_WRAP: value wraps at either end
*/
class WXDLLEXPORT wxSpinButton: public wxControl
class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
{
DECLARE_DYNAMIC_CLASS(wxSpinButton)
public:
/*
* Public interface
*/
public:
// construction
wxSpinButton() { }
wxSpinButton();
wxSpinButton(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
const wxString& name = "wxSpinButton")
{
Create(parent, id, pos, size, style, name);
}
inline wxSpinButton(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton")
{
Create(parent, id, pos, size, style, name);
}
~wxSpinButton();
virtual ~wxSpinButton();
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton");
bool Create(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
const wxString& name = "wxSpinButton");
// Attributes
////////////////////////////////////////////////////////////////////////////
// accessors
virtual int GetValue() const;
virtual void SetValue(int val);
virtual void SetRange(int minVal, int maxVal);
int GetValue() const ;
void SetValue(int val) ;
void SetRange(int minVal, int maxVal) ;
inline int GetMin() const { return m_min; }
inline int GetMax() const { return m_max; }
// Operations
////////////////////////////////////////////////////////////////////////////
void Command(wxCommandEvent& event) { ProcessCommand(event); };
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
// implementation
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
protected:
int m_min;
int m_max;
int m_value ;
virtual wxSize DoGetBestSize();
int m_value ;
private:
DECLARE_DYNAMIC_CLASS(wxSpinButton)
};
class WXDLLEXPORT wxSpinEvent: public wxScrollEvent
{
DECLARE_DYNAMIC_CLASS(wxSpinEvent)
public:
wxSpinEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
};
typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
// Spin events
#define EVT_SPIN_UP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
#define EVT_SPIN_DOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
#define EVT_SPIN(id, func) \
{ wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
{ wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },
#endif
// _WX_SPINBUTT_H_

View File

@@ -21,6 +21,7 @@
// ---------------------------------------------------------------------------
class WXDLLEXPORT wxButton;
class WXDLLEXPORT wxScrollBar;
// ---------------------------------------------------------------------------
// constants
@@ -169,9 +170,9 @@ public:
// simple accessors
// ----------------
WXHWND GetHWND() const { return m_hWnd; }
void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; }
virtual WXWidget GetHandle() const { return (WXWidget) GetHWND(); }
// WXHWND GetHWND() const { return m_hWnd; }
// void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; }
virtual WXWidget GetHandle() const { return (WXWidget) NULL ; }
bool GetUseCtl3D() const { return m_useCtl3D; }
bool GetTransparentBackground() const { return m_backgroundTransparent; }
@@ -226,12 +227,57 @@ public:
// Responds to colour changes: passes event on to children.
void OnSysColourChanged(wxSysColourChangedEvent& event);
protected:
// the window handle
WXHWND m_hWnd;
public :
static bool MacGetWindowFromPoint( const wxPoint &point , wxWindow** outWin ) ;
virtual void MacActivate( EventRecord *ev , bool inIsActivating ) ;
virtual void MacUpdate( EventRecord *ev ) ;
virtual void MacUpdateImmediately() ;
virtual void MacRedraw( RgnHandle updatergn , long time) ;
virtual void MacMouseDown( EventRecord *ev , short windowPart ) ;
virtual void MacMouseUp( EventRecord *ev , short windowPart ) ;
virtual void MacMouseMoved( EventRecord *ev , short windowPart ) ;
virtual void MacKeyDown( EventRecord *ev ) ;
virtual bool MacCanFocus() const { return true ; }
// the old window proc (we subclass all windows)
WXFARPROC m_oldWndProc;
virtual void MacFireMouseEvent( EventRecord *ev ) ;
virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ;
virtual void MacEraseBackground( Rect *rect ) ;
WindowRef GetMacRootWindow() const ;
virtual ControlHandle MacGetContainerForEmbedding() ;
virtual void MacSuperChangedPosition() ;
bool MacSetupFocusPort() ;
bool MacSetupDrawingPort() ;
bool MacSetupFocusClientPort() ;
bool MacSetupDrawingClientPort() ;
virtual bool MacSetPortFocusParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindow* rootwin ) ;
virtual bool MacSetPortDrawingParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindow* rootwin ) ;
virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindow** rootwin ) ;
virtual void MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindow** rootwin) ;
MacWindowData* MacGetWindowData() { return m_macWindowData ; }
static WindowRef MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
static wxWindow* s_lastMouseWindow ;
private:
virtual bool MacGetWindowFromPointSub( const wxPoint &point , wxWindow** outWin ) ;
protected:
MacWindowData* m_macWindowData ;
static WindowRef s_macWindowInUpdate ;
int m_x ;
int m_y ;
int m_width ;
int m_height ;
wxScrollBar* m_hScrollBar ;
wxScrollBar* m_vScrollBar ;
wxString m_label ;
void MacCreateScrollBars( long style ) ;
void MacRepositionScrollBars() ;
// additional (MSW specific) flags
bool m_useCtl3D:1; // Using CTL3D for this control
@@ -244,10 +290,7 @@ protected:
int m_xThumbSize;
int m_yThumbSize;
WXHMENU m_hMenu; // Menu, if any
// the return value of WM_GETDLGCODE handler
long m_lDlgCode;
// WXHMENU m_hMenu; // Menu, if any
// implement the base class pure virtuals
virtual void DoClientToScreen( int *x, int *y ) const;