virtual void SetDefault();
virtual void Command(wxCommandEvent& event);
protected:
- virtual wxSize DoGetBestSize();
+ virtual wxSize DoGetBestSize() const ;
};
#endif
#pragma interface "control.h"
#endif
+WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr;
+
// General item class
class WXDLLEXPORT wxControl : public wxControlBase
{
wxControl();
virtual ~wxControl();
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxControlNameStr);
+
// Simulates an event
virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
int m_macVerticalBorder ;
wxList m_subControls;
- virtual wxSize DoGetBestSize();
+ virtual wxSize DoGetBestSize() const ;
private:
DECLARE_EVENT_TABLE()
virtual void GetTextExtent( const wxString &string, long *width, long *height,
long *descent = NULL, long *externalLeading = NULL,
wxFont *theFont = NULL, bool use16 = FALSE ) const ;
+ virtual void GetTextExtent( const wxString &string, int *width, int *height,
+ int *descent = NULL, int *externalLeading = NULL,
+ wxFont *theFont = NULL, bool use16 = FALSE ) const
+ {
+ long lwidth,lheight,ldescent,lexternal ;
+ GetTextExtent( string, &lwidth,&lheight,&ldescent,&lexternal,theFont,use16 ) ;
+ *width = lwidth ;
+ *height = lheight ;
+ if (descent) *descent = ldescent ;
+ if (externalLeading) *externalLeading = lexternal ;
+ }
virtual wxCoord GetCharWidth(void) const;
virtual wxCoord GetCharHeight(void) const;
int m_noItems;
int m_selected;
- virtual wxSize DoGetBestSize();
+ virtual wxSize DoGetBestSize() const ;
#if wxUSE_OWNER_DRAWN
// control items
typedef wxWindow wxNotebookPage; // so far, any window can be a page
WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
-// ----------------------------------------------------------------------------
-// notebook events
-// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxNotebookEvent : public wxCommandEvent
-{
-public:
- wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
- int nSel = -1, int nOldSel = -1)
- : wxCommandEvent(commandType, id) { m_nSel = nSel; m_nOldSel = nOldSel; }
-
- // accessors
- int GetSelection() const { return m_nSel; }
- int GetOldSelection() const { return m_nOldSel; }
-
-private:
- int m_nSel, // currently selected page
- m_nOldSel; // previously selected page
-
- DECLARE_DYNAMIC_CLASS(wxNotebookEvent)
-};
-
// ----------------------------------------------------------------------------
// wxNotebook
// ----------------------------------------------------------------------------
DECLARE_EVENT_TABLE()
};
-// ----------------------------------------------------------------------------
-// event macros
-// ----------------------------------------------------------------------------
-typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
-
-#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
- { \
- wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
- id, \
- -1, \
- (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
- NULL \
- },
-
-#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
- { \
- wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \ \
- id, \
- -1, \
- (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
- NULL \
- },
#endif // _WX_NOTEBOOK_H_
#ifndef _WX_SETUP_H_
#define _WX_SETUP_H_
-/*
- * General features
- *
- */
+// ----------------------------------------------------------------------------
+// global settings
+// ----------------------------------------------------------------------------
+
+// define this to 0 when building wxBase library
+#define wxUSE_GUI 1
+// ----------------------------------------------------------------------------
+// compatibility settings
+// ----------------------------------------------------------------------------
+
+// This setting determines the compatibility with 1.68 API:
+// Level 0: no backward compatibility, all new features
+// Level 1: some extra methods are defined for compatibility.
+//
+// Default is 0.
+//
+// Recommended setting: 0 (in fact the compatibility code is now very minimal
+// so there is little advantage to setting it to 1.
+#define WXWIN_COMPATIBILITY 0
+
#define WORDS_BIGENDIAN 1
+// ----------------------------------------------------------------------------
+// non GUI features selection
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
+// integer which is implemented in terms of native 64 bit integers if any or
+// uses emulation otherwise.
+//
+// This class is required by wxDateTime and so you should enable it if you want
+// to use wxDateTime. For most modern platforms, it will use the native 64 bit
+// integers in which case (almost) all of its functions are inline and it
+// almost does not take any space, so there should be no reason to switch it
+// off.
+//
+// Recommended setting: 1
+#define wxUSE_LONGLONG 1
+
+
+// Set wxUSE_TIMEDATE to 1 to compile the wxDateTime and related classes which
+// allow to manipulate dates, times and time intervals. wxDateTime replaces the
+// old wxTime and wxDate classes which are still provided for backwards
+// compatibility (and implemented in terms of wxDateTime).
+//
+// Note that this class is relatively new and is still officially in alpha
+// stage because some features are not yet (fully) implemented. It is already
+// quite useful though and should only be disabled if you are aiming at
+// absolutely minimal version of the library.
+//
+// Requires: wxUSE_LONGLONG
+//
+// Recommended setting: 1
+#define wxUSE_TIMEDATE 1
+
+// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes
+// which allow the application to store its settings in the persistent
+// storage. Setting this to 1 will also enable on-demand creation of the
+// global config object in wxApp.
+//
+// See also wxUSE_CONFIG_NATIVE below.
+//
+// Recommended setting: 1
#define wxUSE_CONFIG 1
- // Use wxConfig, with CreateConfig in wxApp
-#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
+// ----------------------------------------------------------------------------
+// Optional controls
+// ----------------------------------------------------------------------------
+
+// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar
+// classes at all. Otherwise, use the native toolbar class unless
+// wxUSE_TOOLBAR_NATIVE is 0. Additionally, the generic toolbar class which
+// supports some features which might not be supported by the native wxToolBar
+// class may be compiled in if wxUSE_TOOLBAR_SIMPLE is 1.
+//
+// Default is 1 for all settings.
+//
+// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE and 0 for
+// wxUSE_TOOLBAR_SIMPLE (the default is 1 mainly for backwards compatibility).
+#define wxUSE_TOOLBAR 1
+#define wxUSE_TOOLBAR_NATIVE 1
+#define wxUSE_TOOLBAR_SIMPLE 0
+
+// wxNotebook is a control with several "tabs" located on one of its sides. It
+// may be used ot logically organise the data presented to the user instead of
+// putting everything in one huge dialog. It replaces wxTabControl and related
+// classes of wxWin 1.6x.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_NOTEBOOK 1
+
+
+// The corresponding controls will be compiled in if wxUSE_<CONTROL> is set to
+// 1 and not compiled into the library otherwise.
+//
+// Default is 1 for everything.
+//
+// Recommended setting: 1 (library might fail to compile for some combinations
+// of disabled controls)
+#define wxUSE_COMBOBOX 1
+#define wxUSE_CHOICE 1
+#define wxUSE_RADIOBTN 1
+#define wxUSE_RADIOBOX 1
+#define wxUSE_SCROLLBAR 1
+#define wxUSE_CHECKBOX 1
+#define wxUSE_LISTBOX 1
+#define wxUSE_SPINBTN 1
+#define wxUSE_SPINCTRL 1
+#define wxUSE_STATLINE 1
+#define wxUSE_CHECKLISTBOX 1
+#define wxUSE_CHOICE 1
+#define wxUSE_CARET 1
+#define wxUSE_SLIDER 1
+
+// ----------------------------------------------------------------------------
+// Postscript support settings
+// ----------------------------------------------------------------------------
+
+
#define wxUSE_POSTSCRIPT 0
// 0 for no PostScript device context
#define wxUSE_AFM_FOR_POSTSCRIPT 0
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
protected:
- virtual wxSize DoGetBestSize();
+ virtual wxSize DoGetBestSize() const;
int m_value ;
private:
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
+ wxSize DoGetBestSize() const ;
protected:
wxBitmap m_messageBitmap;
* Public interface
*/
- wxToolBar();
+ wxToolBar() { Init(); }
+
inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER|wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
{
+ Init();
Create(parent, id, pos, size, style, name);
}
~wxToolBar();
long style = wxNO_BORDER|wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr);
- // If pushedBitmap is NULL, a reversed version of bitmap is
- // created and used as the pushed/toggled image.
- // If toggle is TRUE, the button toggles between the two states.
- wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
- bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
- const wxString& helpString1 = "", const wxString& helpString2 = "");
+ // override/implement base class virtuals
+ virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
- // Set default bitmap size
- void SetToolBitmapSize(const wxSize& size);
- void EnableTool(int toolIndex, bool enable); // additional drawing on enabling
- void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
- void ClearTools();
+ virtual bool Realize();
- // The button size is bigger than the bitmap size
- wxSize GetToolSize() const;
+ virtual void SetToolBitmapSize(const wxSize& size);
+ virtual wxSize GetToolSize() const;
- wxSize GetMaxSize() const;
+ virtual void SetRows(int nRows);
// Add all the buttons
- virtual bool CreateTools();
- virtual void LayoutButtons() {}
- // The post-tool-addition call. TODO: do here whatever's
- // necessary for completing the toolbar construction.
- bool Realize() { return CreateTools(); };
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
protected:
+ // common part of all ctors
+ void Init();
+
+ // implement base class pure virtuals
+ virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
+ virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
+
+ virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
+ virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
+ virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
+
+ virtual wxToolBarToolBase *CreateTool(int id,
+ const wxBitmap& bitmap1,
+ const wxBitmap& bitmap2,
+ bool toggle,
+ wxObject *clientData,
+ const wxString& shortHelpString,
+ const wxString& longHelpString);
+ virtual wxToolBarToolBase *CreateTool(wxControl *control);
+
wxArrayPtrVoid m_macToolHandles ;
-DECLARE_EVENT_TABLE()
+ DECLARE_EVENT_TABLE()
};
#endif // wxUSE_TOOLBAR
virtual void SetFocus();
- virtual bool Reparent( wxWindow *newParent );
virtual void WarpPointer(int x, int y);
virtual void CaptureMouse();
void OnEraseBackground(wxEraseEvent& event);
void OnIdle(wxIdleEvent& event);
void MacOnScroll(wxScrollEvent&event ) ;
+
+ bool AcceptsFocus() const ;
public:
// For implementation purposes - sometimes decorations make the client area
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
- // get the size which best suits the window: e.g., for a static text it
- // will be the width and height of the text
- virtual wxSize DoGetBestSize();
-
// move the window to the specified location and resize it: this is called
// from both DoSetSize() and DoSetClientSize() and would usually just call
// ::MoveWindow() except for composite controls which will want to arrange
#elif defined(__WXQT__)
#include "wx/qt/notebook.h"
#elif defined(__WXMAC__)
- #include "wx/generic/notebook.h"
+ #include "wx/mac/notebook.h"
#elif defined(__WXPM__)
#include "wx/os2/notebook.h"
#elif defined(__WXSTUBS__)
virtual bool DeleteResource(const wxString& name);
virtual bool ParseResourceFile(const wxString& filename);
+ virtual bool ParseResourceFile( wxInputStream *is ) ;
virtual bool ParseResourceData(const wxString& data);
virtual bool SaveResource(const wxString& filename);