wxWidgets3: update to svn r70933

This commit is contained in:
Shawn Hoffman
2012-03-17 18:12:27 -07:00
parent 0ed8af2287
commit a648aca65c
906 changed files with 39468 additions and 17244 deletions

View File

@ -3,7 +3,7 @@
// Purpose: generic wxAboutBox() implementation
// Author: Vadim Zeitlin
// Created: 2006-10-07
// RCS-ID: $Id: aboutdlgg.h 60389 2009-04-26 13:41:21Z VZ $
// RCS-ID: $Id: aboutdlgg.h 70413 2012-01-20 22:11:32Z VZ $
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -21,6 +21,16 @@ class WXDLLIMPEXP_FWD_ADV wxAboutDialogInfo;
class WXDLLIMPEXP_FWD_CORE wxSizer;
class WXDLLIMPEXP_FWD_CORE wxSizerFlags;
// Under GTK and OS X "About" dialogs are not supposed to be modal, unlike MSW
// and, presumably, all the other platforms.
#ifndef wxUSE_MODAL_ABOUT_DIALOG
#if defined(__WXGTK__) || defined(__WXMAC__)
#define wxUSE_MODAL_ABOUT_DIALOG 0
#else
#define wxUSE_MODAL_ABOUT_DIALOG 1
#endif
#endif // wxUSE_MODAL_ABOUT_DIALOG not defined
// ----------------------------------------------------------------------------
// wxGenericAboutDialog: generic "About" dialog implementation
// ----------------------------------------------------------------------------
@ -73,6 +83,12 @@ private:
// common part of all ctors
void Init() { m_sizerText = NULL; }
#if !wxUSE_MODAL_ABOUT_DIALOG
// An explicit handler for deleting the dialog when it's closed is needed
// when we show it non-modally.
void OnCloseWindow(wxCloseEvent& event);
void OnOK(wxCommandEvent& event);
#endif // !wxUSE_MODAL_ABOUT_DIALOG
wxSizer *m_sizerText;
};

View File

@ -4,7 +4,7 @@
// Author: Julian Smart
// Modified by: 03.11.00: VZ to add wxArrayString and multiple sel functions
// Created: 01/02/97
// RCS-ID: $Id: choicdgg.h 63731 2010-03-21 11:06:31Z VZ $
// RCS-ID: $Id: choicdgg.h 70642 2012-02-20 21:56:18Z VZ $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -106,39 +106,112 @@ public:
const wxString& caption,
int n,
const wxString *choices,
char **clientData = (char **)NULL,
void **clientData = NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
const wxPoint& pos = wxDefaultPosition)
{
Create(parent, message, caption, n, choices, clientData, style, pos);
}
wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData = (char **)NULL,
void **clientData = NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
const wxPoint& pos = wxDefaultPosition)
{
Create(parent, message, caption, choices, clientData, style, pos);
}
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
char **clientData = (char **)NULL,
void **clientData = NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData = (char **)NULL,
void **clientData = NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
void SetSelection(int sel);
int GetSelection() const { return m_selection; }
wxString GetStringSelection() const { return m_stringSelection; }
void* GetSelectionData() const { return m_clientData; }
// obsolete function (NB: no need to make it return wxChar, it's untyped)
char *GetSelectionClientData() const { return (char *)m_clientData; }
#if WXWIN_COMPATIBILITY_2_8
// Deprecated overloads taking "char**" client data.
wxDEPRECATED_CONSTRUCTOR
(
wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
char **clientData,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
)
{
Create(parent, message, caption, n, choices,
(void**)clientData, style, pos);
}
wxDEPRECATED_CONSTRUCTOR
(
wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
)
{
Create(parent, message, caption, choices,
(void**)clientData, style, pos);
}
wxDEPRECATED_INLINE
(
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
char **clientData,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition),
return Create(parent, message, caption, n, choices,
(void**)clientData, style, pos);
)
wxDEPRECATED_INLINE
(
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition),
return Create(parent, message, caption, choices,
(void**)clientData, style, pos);
)
// NB: no need to make it return wxChar, it's untyped
wxDEPRECATED_ACCESSOR
(
char* GetSelectionClientData() const,
(char*)GetSelectionData()
)
#endif // WXWIN_COMPATIBILITY_2_8
// implementation from now on
void OnOK(wxCommandEvent& event);

View File

@ -4,7 +4,7 @@
// Author: Francesco Montorsi
// Modified by:
// Created: 8/10/2006
// RCS-ID: $Id: collpaneg.h 58606 2009-02-01 20:59:03Z FM $
// RCS-ID: $Id: collpaneg.h 68366 2011-07-24 22:19:33Z VZ $
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
@ -25,7 +25,8 @@ class WXDLLIMPEXP_FWD_CORE wxDisclosureTriangle;
// wxGenericCollapsiblePane
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericCollapsiblePane : public wxCollapsiblePaneBase
class WXDLLIMPEXP_CORE wxGenericCollapsiblePane :
public wxNavigationEnabled<wxCollapsiblePaneBase>
{
public:
wxGenericCollapsiblePane() { Init(); }
@ -103,7 +104,6 @@ private:
void OnButton(wxCommandEvent &ev);
void OnSize(wxSizeEvent &ev);
WX_DECLARE_CONTROL_CONTAINER();
DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane)
DECLARE_EVENT_TABLE()
};

View File

@ -0,0 +1,96 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/custombgwin.h
// Purpose: Generic implementation of wxCustomBackgroundWindow.
// Author: Vadim Zeitlin
// Created: 2011-10-10
// RCS-ID: $Id: custombgwin.h 69378 2011-10-11 17:07:43Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_CUSTOMBGWIN_H_
#define _WX_GENERIC_CUSTOMBGWIN_H_
#include "wx/bitmap.h"
// A helper to avoid template bloat: this class contains all type-independent
// code of wxCustomBackgroundWindow<> below.
class wxCustomBackgroundWindowGenericBase : public wxCustomBackgroundWindowBase
{
public:
wxCustomBackgroundWindowGenericBase() { }
protected:
void DoEraseBackground(wxEraseEvent& event, wxWindow* win)
{
wxDC& dc = *event.GetDC();
const wxSize clientSize = win->GetClientSize();
const wxSize bitmapSize = m_bitmapBg.GetSize();
for ( int x = 0; x < clientSize.x; x += bitmapSize.x )
{
for ( int y = 0; y < clientSize.y; y += bitmapSize.y )
{
dc.DrawBitmap(m_bitmapBg, x, y);
}
}
}
// The bitmap used for painting the background if valid.
wxBitmap m_bitmapBg;
wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowGenericBase);
};
// ----------------------------------------------------------------------------
// wxCustomBackgroundWindow
// ----------------------------------------------------------------------------
template <class W>
class wxCustomBackgroundWindow : public W,
public wxCustomBackgroundWindowGenericBase
{
public:
typedef W BaseWindowClass;
wxCustomBackgroundWindow() { }
protected:
virtual void DoSetBackgroundBitmap(const wxBitmap& bmp)
{
m_bitmapBg = bmp;
if ( m_bitmapBg.IsOk() )
{
BaseWindowClass::Connect
(
wxEVT_ERASE_BACKGROUND,
wxEraseEventHandler(wxCustomBackgroundWindow::OnEraseBackground)
);
}
else
{
BaseWindowClass::Disconnect
(
wxEVT_ERASE_BACKGROUND,
wxEraseEventHandler(wxCustomBackgroundWindow::OnEraseBackground)
);
}
}
private:
// Event handler for erasing the background which is only used when we have
// a valid background bitmap.
void OnEraseBackground(wxEraseEvent& event)
{
DoEraseBackground(event, this);
}
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxCustomBackgroundWindow, W);
};
#endif // _WX_GENERIC_CUSTOMBGWIN_H_

View File

@ -3,7 +3,7 @@
// Purpose: wxDataViewCtrl generic implementation header
// Author: Robert Roebling
// Modified By: Bo Yang
// Id: $Id: dataview.h 65948 2010-10-30 15:57:41Z VS $
// Id: $Id: dataview.h 70717 2012-02-27 18:54:02Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -68,10 +68,12 @@ public:
virtual void SetFlags(int flags) { m_flags = flags; UpdateDisplay(); }
virtual int GetFlags() const { return m_flags; }
virtual void SetAsSortKey(bool sort = true) { m_sort = sort; UpdateDisplay(); }
virtual bool IsSortKey() const { return m_sort; }
virtual void SetSortOrder(bool ascending) { m_sortAscending = ascending; UpdateDisplay(); }
virtual void UnsetAsSortKey() { m_sort = false; UpdateDisplay(); }
virtual void SetSortOrder(bool ascending);
virtual bool IsSortOrderAscending() const { return m_sortAscending; }
virtual void SetBitmap( const wxBitmap& bitmap ) { wxDataViewColumnBase::SetBitmap(bitmap); UpdateDisplay(); }
@ -155,7 +157,7 @@ public:
virtual wxDataViewColumn *GetSortingColumn() const;
virtual wxDataViewItem GetSelection() const;
virtual int GetSelectedItemsCount() const;
virtual int GetSelections( wxDataViewItemArray & sel ) const;
virtual void SetSelections( const wxDataViewItemArray & sel );
virtual void Select( const wxDataViewItem & item );
@ -172,6 +174,8 @@ public:
virtual wxRect GetItemRect( const wxDataViewItem & item,
const wxDataViewColumn *column = NULL ) const;
virtual bool SetRowHeight( int rowHeight );
virtual void Expand( const wxDataViewItem & item );
virtual void Collapse( const wxDataViewItem & item );
virtual bool IsExpanded( const wxDataViewItem & item ) const;
@ -185,19 +189,18 @@ public:
virtual wxBorder GetDefaultBorder() const;
void StartEditor( const wxDataViewItem & item, unsigned int column );
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column);
// These methods are specific to generic wxDataViewCtrl implementation and
// should not be used in portable code.
wxColour GetAlternateRowColour() const { return m_alternateRowColour; }
void SetAlternateRowColour(const wxColour& colour);
protected:
virtual int GetSelections( wxArrayInt & sel ) const;
virtual void SetSelections( const wxArrayInt & sel );
virtual void Select( int row );
virtual void Unselect( int row );
virtual bool IsSelected( int row ) const;
virtual void SelectRange( int from, int to );
virtual void UnselectRange( int from, int to );
virtual void EnsureVisible( int row, int column );
// Notice that row here may be invalid (i.e. >= GetRowCount()), this is not
// an error and this function simply returns an invalid item in this case.
virtual wxDataViewItem GetItemByRow( unsigned int row ) const;
virtual int GetRowByItem( const wxDataViewItem & item ) const;
@ -226,21 +229,32 @@ public: // utility functions not part of the API
// return the column displayed at the given position in the control
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
virtual wxDataViewColumn *GetCurrentColumn() const;
virtual void OnInternalIdle();
private:
virtual wxDataViewItem DoGetCurrentItem() const;
virtual void DoSetCurrentItem(const wxDataViewItem& item);
void InvalidateColBestWidths();
void InvalidateColBestWidth(int idx);
void UpdateColWidths();
wxDataViewColumnList m_cols;
// cached column best widths or 0 if not computed, values are for
// respective columns from m_cols and the arrays have same size
wxVector<int> m_colsBestWidths;
// m_colsBestWidths partially invalid, needs recomputing
bool m_colsDirty;
wxDataViewModelNotifier *m_notifier;
wxDataViewMainWindow *m_clientArea;
wxDataViewHeaderWindow *m_headerArea;
// user defined color to draw row lines, may be invalid
wxColour m_alternateRowColour;
// the index of the column currently used for sorting or -1
int m_sortingColumnIdx;

View File

@ -4,7 +4,7 @@
// Author: Andreas Pflug
// Modified by:
// Created: 2005-01-19
// RCS-ID: $Id: datectrl.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: datectrl.h 70736 2012-02-28 14:41:30Z VZ $
// Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -82,6 +82,10 @@ private:
void OnSize(wxSizeEvent& event);
void OnFocus(wxFocusEvent& event);
#ifdef __WXOSX_COCOA__
virtual void OSXGenerateEvent(const wxDateTime& WXUNUSED(dt)) { }
#endif
wxComboCtrl* m_combo;
wxCalendarComboPopup* m_popup;

View File

@ -3,7 +3,7 @@
// Purpose: wxDataViewRenderer for generic wxDataViewCtrl implementation
// Author: Robert Roebling, Vadim Zeitlin
// Created: 2009-11-07 (extracted from wx/generic/dataview.h)
// RCS-ID: $Id: dvrenderer.h 67099 2011-03-01 12:16:49Z VS $
// RCS-ID: $Id: dvrenderer.h 69473 2011-10-19 16:20:17Z VS $
// Copyright: (c) 2006 Robert Roebling
// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
@ -41,23 +41,16 @@ public:
// implementation
// These callbacks are used by generic implementation of wxDVC itself.
// They're different from the corresponding Activate/LeftClick() methods
// which should only be overridable for the custom renderers while the
// generic implementation uses these ones for all of them, including the
// standard ones.
// This callback is used by generic implementation of wxDVC itself. It's
// different from the corresponding ActivateCell() method which should only
// be overridable for the custom renderers while the generic implementation
// uses this one for all of them, including the standard ones.
virtual bool WXOnActivate(const wxRect& WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model),
const wxDataViewItem & WXUNUSED(item),
unsigned int WXUNUSED(col))
{ return false; }
virtual bool WXOnLeftClick(const wxPoint& WXUNUSED(cursor),
const wxRect& WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model),
const wxDataViewItem & WXUNUSED(item),
unsigned int WXUNUSED(col) )
virtual bool WXActivateCell(const wxRect& WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model),
const wxDataViewItem & WXUNUSED(item),
unsigned int WXUNUSED(col),
const wxMouseEvent* WXUNUSED(mouseEvent))
{ return false; }
private:

View File

@ -3,7 +3,7 @@
// Purpose: All generic wxDataViewCtrl renderer classes
// Author: Robert Roebling, Vadim Zeitlin
// Created: 2009-11-07 (extracted from wx/generic/dataview.h)
// RCS-ID: $Id: dvrenderers.h 67099 2011-03-01 12:16:49Z VS $
// RCS-ID: $Id: dvrenderers.h 69473 2011-10-19 16:20:17Z VS $
// Copyright: (c) 2006 Robert Roebling
// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
@ -26,21 +26,13 @@ public:
// see the explanation of the following WXOnXXX() methods in wx/generic/dvrenderer.h
virtual bool WXOnActivate(const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem& item,
unsigned int col)
virtual bool WXActivateCell(const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem& item,
unsigned int col,
const wxMouseEvent *mouseEvent)
{
return Activate(cell, model, item, col);
}
virtual bool WXOnLeftClick(const wxPoint& cursor,
const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem &item,
unsigned int col)
{
return LeftClick(cursor, cell, model, item, col);
return ActivateCell(cell, model, item, col, mouseEvent);
}
private:
@ -67,9 +59,9 @@ public:
// in-place editing
virtual bool HasEditorCtrl() const;
virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value );
protected:
wxString m_text;
@ -121,11 +113,11 @@ public:
wxSize GetSize() const;
// Implementation only, don't use nor override
virtual bool WXOnLeftClick(const wxPoint& cursor,
const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem& item,
unsigned int col);
virtual bool WXActivateCell(const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem& item,
unsigned int col,
const wxMouseEvent *mouseEvent);
private:
bool m_toggle;
@ -177,9 +169,9 @@ public:
virtual wxSize GetSize() const;
virtual bool HasEditorCtrl() const { return true; }
virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value );
private:
wxDataViewIconText m_value;
@ -188,36 +180,5 @@ protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
};
// ---------------------------------------------------------
// wxDataViewDateRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewRenderer
{
public:
wxDataViewDateRenderer( const wxString &varianttype = wxT("datetime"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant& value ) const;
virtual bool Render( wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const;
// Implementation only, don't use nor override
virtual bool WXOnActivate(const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem& item,
unsigned int col);
private:
wxDateTime m_date;
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
};
#endif // _WX_GENERIC_DVRENDERERS_H_

View File

@ -5,7 +5,7 @@
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Francesco Montorsi
// RCS-ID: $Id: filepickerg.h 63690 2010-03-16 00:23:57Z VZ $
// RCS-ID: $Id: filepickerg.h 70043 2011-12-18 12:34:47Z VZ $
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
@ -49,7 +49,7 @@ public:
virtual wxControl *AsControl() { return this; }
public: // overrideable
public: // overridable
virtual wxDialog *CreateDialog() = 0;
@ -58,6 +58,8 @@ public: // overrideable
virtual wxEventType GetEventType() const = 0;
virtual void SetInitialDirectory(const wxString& dir);
public:
bool Create(wxWindow *parent, wxWindowID id,
@ -82,6 +84,9 @@ protected:
// just doesn't make sense to use picker styles for wxButton anyhow
long m_pickerStyle;
// Initial directory set by SetInitialDirectory() call or empty.
wxString m_initialDir;
private:
// common part of all ctors
void Init() { m_pickerStyle = -1; }
@ -114,7 +119,7 @@ public:
pos, size, style, validator, name);
}
public: // overrideable
public: // overridable
virtual long GetDialogStyle() const
{
@ -140,16 +145,7 @@ public: // overrideable
return filedlgstyle;
}
virtual wxDialog *CreateDialog()
{
wxFileDialog *p = new wxFileDialog(GetDialogParent(), m_message,
wxEmptyString, wxEmptyString,
m_wildcard, GetDialogStyle());
// this sets both the default folder and the default file of the dialog
p->SetPath(m_path);
return p;
}
virtual wxDialog *CreateDialog();
wxEventType GetEventType() const
{ return wxEVT_COMMAND_FILEPICKER_CHANGED; }
@ -160,6 +156,10 @@ protected:
void UpdatePathFromDialog(wxDialog *p)
{ m_path = wxStaticCast(p, wxFileDialog)->GetPath(); }
// Set the initial directory for the dialog but without overriding the
// directory of the currently selected file, if any.
void DoSetInitialDirectory(wxFileDialog* dialog, const wxString& dir);
private:
DECLARE_DYNAMIC_CLASS(wxGenericFileButton)
};
@ -190,7 +190,7 @@ public:
pos, size, style, validator, name);
}
public: // overrideable
public: // overridable
virtual long GetDialogStyle() const
{
@ -204,11 +204,7 @@ public: // overrideable
return dirdlgstyle;
}
virtual wxDialog *CreateDialog()
{
return new wxDirDialog(GetDialogParent(), m_message, m_path,
GetDialogStyle());
}
virtual wxDialog *CreateDialog();
wxEventType GetEventType() const
{ return wxEVT_COMMAND_DIRPICKER_CHANGED; }

View File

@ -4,7 +4,7 @@
// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn)
// Modified by: Santiago Palacios
// Created: 1/08/1999
// RCS-ID: $Id: grid.h 65451 2010-08-30 22:18:52Z VZ $
// RCS-ID: $Id: grid.h 70825 2012-03-06 10:23:44Z SC $
// Copyright: (c) Michael Bedward
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -432,9 +432,9 @@ public:
void SetKind(wxAttrKind kind) { m_attrkind = kind; }
// accessors
bool HasTextColour() const { return m_colText.Ok(); }
bool HasBackgroundColour() const { return m_colBack.Ok(); }
bool HasFont() const { return m_font.Ok(); }
bool HasTextColour() const { return m_colText.IsOk(); }
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
bool HasFont() const { return m_font.IsOk(); }
bool HasAlignment() const
{
return m_hAlign != wxALIGN_INVALID || m_vAlign != wxALIGN_INVALID;
@ -1637,7 +1637,7 @@ public:
// unset any existing sorting column
void UnsetSortingColumn() { SetSortingColumn(wxNOT_FOUND); }
#ifdef WXWIN_COMPATIBILITY_2_8
#if WXWIN_COMPATIBILITY_2_8
// ------ For compatibility with previous wxGrid only...
//
// ************************************************
@ -2160,7 +2160,7 @@ private:
// --------------------------------
// process mouse drag event in WXGRID_CURSOR_SELECT_CELL mode
void DoGridCellDrag(wxMouseEvent& event,
bool DoGridCellDrag(wxMouseEvent& event,
const wxGridCellCoords& coords,
bool isFirstDrag);

View File

@ -4,7 +4,7 @@
// Author: Paul Gammans, Roger Gammans
// Modified by:
// Created: 11/04/2001
// RCS-ID: $Id: gridctrl.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: gridctrl.h 69856 2011-11-28 13:23:33Z VZ $
// Copyright: (c) The Computer Surgery (paul@compsurg.co.uk)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -81,13 +81,17 @@ protected:
class WXDLLIMPEXP_ADV wxGridCellFloatRenderer : public wxGridCellStringRenderer
{
public:
wxGridCellFloatRenderer(int width = -1, int precision = -1);
wxGridCellFloatRenderer(int width = -1,
int precision = -1,
int format = wxGRID_FLOAT_FORMAT_DEFAULT);
// get/change formatting parameters
int GetWidth() const { return m_width; }
void SetWidth(int width) { m_width = width; m_format.clear(); }
int GetPrecision() const { return m_precision; }
void SetPrecision(int precision) { m_precision = precision; m_format.clear(); }
int GetFormat() const { return m_style; }
void SetFormat(int format) { m_style = format; m_format.clear(); }
// draw the string right aligned with given width/precision
virtual void Draw(wxGrid& grid,
@ -102,7 +106,8 @@ public:
wxDC& dc,
int row, int col);
// parameters string format is "width[,precision]"
// parameters string format is "width[,precision[,format]]"
// with format being one of f|e|g|E|F|G
virtual void SetParameters(const wxString& params);
virtual wxGridCellRenderer *Clone() const;
@ -115,6 +120,7 @@ private:
int m_width,
m_precision;
int m_style;
wxString m_format;
};

View File

@ -4,7 +4,7 @@
// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn)
// Modified by: Santiago Palacios
// Created: 1/08/1999
// RCS-ID: $Id: grideditors.h 61508 2009-07-23 20:30:22Z VZ $
// RCS-ID: $Id: grideditors.h 70693 2012-02-25 23:49:55Z VZ $
// Copyright: (c) Michael Bedward
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -154,11 +154,38 @@ private:
wxDECLARE_NO_COPY_CLASS(wxGridCellNumberEditor);
};
enum wxGridCellFloatFormat
{
// Decimal floating point (%f)
wxGRID_FLOAT_FORMAT_FIXED = 0x0010,
// Scientific notation (mantise/exponent) using e character (%e)
wxGRID_FLOAT_FORMAT_SCIENTIFIC = 0x0020,
// Use the shorter of %e or %f (%g)
wxGRID_FLOAT_FORMAT_COMPACT = 0x0040,
// To use in combination with one of the above formats (%F/%E/%G)
wxGRID_FLOAT_FORMAT_UPPER = 0x0080,
// Format used by default.
wxGRID_FLOAT_FORMAT_DEFAULT = wxGRID_FLOAT_FORMAT_FIXED,
// A mask to extract format from the combination of flags.
wxGRID_FLOAT_FORMAT_MASK = wxGRID_FLOAT_FORMAT_FIXED |
wxGRID_FLOAT_FORMAT_SCIENTIFIC |
wxGRID_FLOAT_FORMAT_COMPACT |
wxGRID_FLOAT_FORMAT_UPPER
};
// the editor for floating point numbers (double) data
class WXDLLIMPEXP_ADV wxGridCellFloatEditor : public wxGridCellTextEditor
{
public:
wxGridCellFloatEditor(int width = -1, int precision = -1);
wxGridCellFloatEditor(int width = -1,
int precision = -1,
int format = wxGRID_FLOAT_FORMAT_DEFAULT);
virtual void Create(wxWindow* parent,
wxWindowID id,
@ -176,18 +203,22 @@ public:
virtual wxGridCellEditor *Clone() const
{ return new wxGridCellFloatEditor(m_width, m_precision); }
// parameters string format is "width,precision"
// parameters string format is "width[,precision[,format]]"
// format to choose beween f|e|g|E|G (f is used by default)
virtual void SetParameters(const wxString& params);
protected:
// string representation of our value
wxString GetString() const;
wxString GetString();
private:
int m_width,
m_precision;
double m_value;
int m_style;
wxString m_format;
wxDECLARE_NO_COPY_CLASS(wxGridCellFloatEditor);
};
@ -264,6 +295,8 @@ public:
wxWindowID id,
wxEvtHandler* evtHandler);
virtual void SetSize(const wxRect& rect);
virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
virtual void BeginEdit(int row, int col, wxGrid* grid);

View File

@ -4,7 +4,7 @@
// Author: David Norris <danorris@gmail.com>, Otto Wyss
// Modified by: Ryan Norton, Francesco Montorsi
// Created: 04/02/2005
// RCS-ID: $Id: hyperlink.h 65334 2010-08-17 16:55:32Z VZ $
// RCS-ID: $Id: hyperlink.h 67948 2011-06-15 21:56:23Z VZ $
// Copyright: (c) 2005 David Norris
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -75,6 +75,12 @@ protected:
// Renders the hyperlink.
void OnPaint(wxPaintEvent& event);
// Handle set/kill focus events (invalidate for painting focus rect)
void OnFocus(wxFocusEvent& event);
// Fire a HyperlinkEvent on space
void OnChar(wxKeyEvent& event);
// Returns the wxRect of the label of this hyperlink.
// This is different from the clientsize's rectangle when
// clientsize != bestsize and this rectangle is influenced

View File

@ -3,7 +3,7 @@
// Purpose: Generic list control
// Author: Robert Roebling
// Created: 01/02/97
// RCS-ID: $Id: listctrl.h 64884 2010-07-11 10:44:08Z VZ $
// RCS-ID: $Id: listctrl.h 70282 2012-01-07 15:09:43Z VZ $
// Copyright: (c) 1998 Robert Roebling and Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -14,8 +14,6 @@
#include "wx/scrolwin.h"
#include "wx/textctrl.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
#if wxUSE_DRAG_AND_DROP
class WXDLLIMPEXP_FWD_CORE wxDropTarget;
#endif
@ -31,7 +29,7 @@ class WXDLLIMPEXP_FWD_CORE wxListMainWindow;
// wxListCtrl
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericListCtrl: public wxControl,
class WXDLLIMPEXP_CORE wxGenericListCtrl: public wxListCtrlBase,
public wxScrollHelper
{
public:
@ -66,7 +64,7 @@ public:
const wxString &name = wxListCtrlNameStr);
bool GetColumn( int col, wxListItem& item ) const;
bool SetColumn( int col, wxListItem& item );
bool SetColumn( int col, const wxListItem& item );
int GetColumnWidth( int col ) const;
bool SetColumnWidth( int col, int width);
int GetCountPerPage() const; // not the same in wxGLC as in Windows, I think
@ -134,18 +132,9 @@ public:
long InsertItem( long index, const wxString& label );
long InsertItem( long index, int imageIndex );
long InsertItem( long index, const wxString& label, int imageIndex );
long InsertColumn( long col, wxListItem& info );
long InsertColumn( long col, const wxString& heading,
int format = wxLIST_FORMAT_LEFT, int width = -1 );
bool ScrollList( int dx, int dy );
bool SortItems( wxListCtrlCompare fn, wxIntPtr data );
// are we in report mode?
bool InReportView() const { return HasFlag(wxLC_REPORT); }
// are we in virtual report mode?
bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); }
// do we have a header window?
bool HasHeader() const
{ return InReportView() && !HasFlag(wxLC_NO_HEADER); }
@ -214,6 +203,10 @@ public:
wxListMainWindow *m_mainWin;
protected:
// Implement base class pure virtual methods.
long DoInsertColumn(long col, const wxListItem& info);
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
// take into account the coordinates difference between the container

View File

@ -4,7 +4,7 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id: logg.h 61346 2009-07-08 13:47:33Z VZ $
// RCS-ID: $Id: logg.h 67656 2011-04-30 10:57:04Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -104,7 +104,7 @@ private:
// ----------------------------------------------------------------------------
// (background) log window: this class forwards all log messages to the log
// target which was active when it was instantiated, but also collects them
// to the log window. This window has it's own menu which allows the user to
// to the log window. This window has its own menu which allows the user to
// close it, clear the log contents or save it to the file.
// ----------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: msgdlgg.h 65449 2010-08-30 21:48:21Z VZ $
// RCS-ID: $Id: msgdlgg.h 68537 2011-08-04 22:53:42Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -32,6 +32,7 @@ protected:
void OnYes(wxCommandEvent& event);
void OnNo(wxCommandEvent& event);
void OnHelp(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
// can be overridden to provide more contents to the dialog

View File

@ -3,7 +3,7 @@
// Purpose: wxNotebook class (a.k.a. property sheet, tabbed dialog)
// Author: Julian Smart
// Modified by:
// RCS-ID: $Id: notebook.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: notebook.h 68810 2011-08-21 14:08:49Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -107,7 +107,7 @@ public:
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = false,
int imageId = -1);
int imageId = NO_IMAGE);
// callbacks
// ---------

View File

@ -4,7 +4,7 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: panelg.h 67253 2011-03-20 00:00:49Z VZ $
// RCS-ID: $Id: panelg.h 70098 2011-12-23 05:59:59Z PC $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -30,7 +30,7 @@ public:
Create(parent, winid, pos, size, style, name);
}
#ifdef WXWIN_COMPATIBILITY_2_8
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_CONSTRUCTOR(
wxPanel(wxWindow *parent,
int x, int y, int width, int height,
@ -42,18 +42,7 @@ public:
)
#endif // WXWIN_COMPATIBILITY_2_8
protected:
virtual void DoSetBackgroundBitmap(const wxBitmap& bmp);
private:
// Event handler for erasing the background which is only used when we have
// a valid background bitmap.
void OnEraseBackground(wxEraseEvent& event);
// The bitmap used for painting the background if valid.
wxBitmap m_bitmapBg;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel);
};

View File

@ -4,7 +4,7 @@
// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn)
// Modified by: Santiago Palacios
// Created: 1/08/1999
// RCS-ID: $Id: grid.h 66792 2011-01-27 18:35:01Z SC $
// RCS-ID: $Id: grid.h 69861 2011-11-28 19:15:59Z VZ $
// Copyright: (c) Michael Bedward
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -301,6 +301,8 @@ public:
m_owner = owner;
}
virtual wxWindow *GetMainWindowOfCompositeControl() { return m_owner; }
virtual bool AcceptsFocus() const { return false; }
wxGrid *GetOwner() { return m_owner; }
@ -546,6 +548,11 @@ public:
// implemented for the lines
virtual int GetLineAt(const wxGrid *grid, int pos) const = 0;
// Return the display position of the line with the given index.
//
// NB: As GetLineAt(), currently this is always identity for rows.
virtual int GetLinePos(const wxGrid *grid, int line) const = 0;
// Return the index of the line just before the given one.
virtual int GetLineBefore(const wxGrid* grid, int line) const = 0;
@ -613,7 +620,9 @@ public:
virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const
{ grid->SetDefaultRowSize(size, resizeExisting); }
virtual int GetLineAt(const wxGrid * WXUNUSED(grid), int line) const
virtual int GetLineAt(const wxGrid * WXUNUSED(grid), int pos) const
{ return pos; } // TODO: implement row reordering
virtual int GetLinePos(const wxGrid * WXUNUSED(grid), int line) const
{ return line; } // TODO: implement row reordering
virtual int GetLineBefore(const wxGrid* WXUNUSED(grid), int line) const
@ -677,8 +686,10 @@ public:
virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const
{ grid->SetDefaultColSize(size, resizeExisting); }
virtual int GetLineAt(const wxGrid *grid, int line) const
{ return grid->GetColAt(line); }
virtual int GetLineAt(const wxGrid *grid, int pos) const
{ return grid->GetColAt(pos); }
virtual int GetLinePos(const wxGrid *grid, int line) const
{ return grid->GetColPos(line); }
virtual int GetLineBefore(const wxGrid* grid, int line) const
{ return grid->GetColAt(wxMax(0, grid->GetColPos(line) - 1)); }
@ -691,7 +702,10 @@ public:
// This class abstracts the difference between operations going forward
// (down/right) and backward (up/left) and allows to use the same code for
// functions which differ only in the direction of grid traversal
// functions which differ only in the direction of grid traversal.
//
// Notice that all operations in this class work with display positions and not
// internal indices which can be different if the columns were reordered.
//
// Like wxGridOperations it's an ABC with two concrete subclasses below. Unlike
// it, this is a normal object and not just a function dispatch table and has a
@ -720,6 +734,12 @@ public:
// Find the line at the given distance, in pixels, away from this one
// (this uses clipping, i.e. anything after the last line is counted as the
// last one and anything before the first one as 0)
//
// TODO: Implementation of this method currently doesn't support column
// reordering as it mixes up indices and positions. But this doesn't
// really matter as it's only called for rows (Page Up/Down only work
// vertically) and row reordering is not currently supported. We'd
// need to fix it if this ever changes however.
virtual int MoveByPixelDistance(int line, int distance) const = 0;
// This class is never used polymorphically but give it a virtual dtor
@ -727,6 +747,28 @@ public:
virtual ~wxGridDirectionOperations() { }
protected:
// Get the position of the row or column from the given coordinates pair.
//
// This is just a shortcut to avoid repeating m_oper and m_grid multiple
// times in the derived classes code.
int GetLinePos(const wxGridCellCoords& coords) const
{
return m_oper.GetLinePos(m_grid, m_oper.Select(coords));
}
// Get the index of the row or column from the position.
int GetLineAt(int pos) const
{
return m_oper.GetLineAt(m_grid, pos);
}
// Check if the given line is visible, i.e. has non 0 size.
bool IsLineVisible(int line) const
{
return m_oper.GetLineSize(m_grid, line) != 0;
}
wxGrid * const m_grid;
const wxGridOperations& m_oper;
};
@ -743,14 +785,38 @@ public:
{
wxASSERT_MSG( m_oper.Select(coords) >= 0, "invalid row/column" );
return m_oper.Select(coords) == 0;
int pos = GetLinePos(coords);
while ( pos )
{
// Check the previous line.
int line = GetLineAt(--pos);
if ( IsLineVisible(line) )
{
// There is another visible line before this one, hence it's
// not at boundary.
return false;
}
}
// We reached the boundary without finding any visible lines.
return true;
}
virtual void Advance(wxGridCellCoords& coords) const
{
wxASSERT( !IsAtBoundary(coords) );
int pos = GetLinePos(coords);
for ( ;; )
{
// This is not supposed to happen if IsAtBoundary() returned false.
wxCHECK_RET( pos, "can't advance when already at boundary" );
m_oper.Set(coords, m_oper.Select(coords) - 1);
int line = GetLineAt(--pos);
if ( IsLineVisible(line) )
{
m_oper.Set(coords, line);
break;
}
}
}
virtual int MoveByPixelDistance(int line, int distance) const
@ -760,6 +826,8 @@ public:
}
};
// Please refer to the comments above when reading this class code, it's
// absolutely symmetrical to wxGridBackwardOperations.
class wxGridForwardOperations : public wxGridDirectionOperations
{
public:
@ -773,14 +841,32 @@ public:
{
wxASSERT_MSG( m_oper.Select(coords) < m_numLines, "invalid row/column" );
return m_oper.Select(coords) == m_numLines - 1;
int pos = GetLinePos(coords);
while ( pos < m_numLines - 1 )
{
int line = GetLineAt(++pos);
if ( IsLineVisible(line) )
return false;
}
return true;
}
virtual void Advance(wxGridCellCoords& coords) const
{
wxASSERT( !IsAtBoundary(coords) );
int pos = GetLinePos(coords);
for ( ;; )
{
wxCHECK_RET( pos < m_numLines - 1,
"can't advance when already at boundary" );
m_oper.Set(coords, m_oper.Select(coords) + 1);
int line = GetLineAt(++pos);
if ( IsLineVisible(line) )
{
m_oper.Set(coords, line);
break;
}
}
}
virtual int MoveByPixelDistance(int line, int distance) const

View File

@ -3,7 +3,7 @@
// Purpose: private definitions of wxListCtrl helpers
// Author: Robert Roebling
// Vadim Zeitlin (virtual list control support)
// Id: $Id: listctrl.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: listctrl.h 70285 2012-01-07 15:09:54Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -402,6 +402,10 @@ public:
wxTextCtrl *GetText() const { return m_text; }
// Check if the given key event should stop editing and return true if it
// does or false otherwise.
bool CheckForEndEditKey(const wxKeyEvent& event);
// Different reasons for calling EndEdit():
//
// It was called because:
@ -557,6 +561,7 @@ public:
// called to switch the selection from the current item to newCurrent,
void OnArrowChar( size_t newCurrent, const wxKeyEvent& event );
void OnCharHook( wxKeyEvent &event );
void OnChar( wxKeyEvent &event );
void OnKeyDown( wxKeyEvent &event );
void OnKeyUp( wxKeyEvent &event );
@ -570,13 +575,12 @@ public:
void DrawImage( int index, wxDC *dc, int x, int y );
void GetImageSize( int index, int &width, int &height ) const;
int GetTextLength( const wxString &s ) const;
void SetImageList( wxImageList *imageList, int which );
void SetItemSpacing( int spacing, bool isSmall = false );
int GetItemSpacing( bool isSmall = false );
void SetColumn( int col, wxListItem &item );
void SetColumn( int col, const wxListItem &item );
void SetColumnWidth( int col, int width );
void GetColumn( int col, wxListItem &item ) const;
int GetColumnWidth( int col ) const;
@ -640,7 +644,7 @@ public:
long FindItem( const wxPoint& pt );
long HitTest( int x, int y, int &flags ) const;
void InsertItem( wxListItem &item );
void InsertColumn( long col, wxListItem &item );
void InsertColumn( long col, const wxListItem &item );
int GetItemWidthWithImage(wxListItem * item);
void SortItems( wxListCtrlCompare fn, wxIntPtr data );
@ -788,6 +792,10 @@ private:
// delete all items but don't refresh: called from dtor
void DoDeleteAllItems();
// Compute the minimal width needed to fully display the column header.
int ComputeMinHeaderWidth(const wxListHeaderData* header) const;
// the height of one line using the current font
wxCoord m_lineHeight;

View File

@ -0,0 +1,62 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/private/richtooltip.h
// Purpose: wxRichToolTipGenericImpl declaration.
// Author: Vadim Zeitlin
// Created: 2011-10-18
// RCS-ID: $Id: richtooltip.h 69488 2011-10-20 16:20:19Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_PRIVATE_RICHTOOLTIP_H_
#define _GENERIC_PRIVATE_RICHTOOLTIP_H_
#include "wx/icon.h"
#include "wx/colour.h"
// ----------------------------------------------------------------------------
// wxRichToolTipGenericImpl: defines generic wxRichToolTip implementation.
// ----------------------------------------------------------------------------
class wxRichToolTipGenericImpl : public wxRichToolTipImpl
{
public:
wxRichToolTipGenericImpl(const wxString& title, const wxString& message) :
m_title(title),
m_message(message)
{
m_tipKind = wxTipKind_Auto;
// This is pretty arbitrary, we could follow MSW and use some multiple
// of double-click time here.
m_timeout = 5000;
}
virtual void SetBackgroundColour(const wxColour& col,
const wxColour& colEnd);
virtual void SetCustomIcon(const wxIcon& icon);
virtual void SetStandardIcon(int icon);
virtual void SetTimeout(unsigned milliseconds);
virtual void SetTipKind(wxTipKind tipKind);
virtual void SetTitleFont(const wxFont& font);
virtual void ShowFor(wxWindow* win);
protected:
wxString m_title,
m_message;
private:
wxIcon m_icon;
wxColour m_colStart,
m_colEnd;
unsigned m_timeout;
wxTipKind m_tipKind;
wxFont m_titleFont;
};
#endif // _WX_GENERIC_PRIVATE_RICHTOOLTIP_H_

View File

@ -5,7 +5,7 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: prntdlgg.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: prntdlgg.h 70636 2012-02-20 21:55:55Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -34,7 +34,7 @@ class WXDLLIMPEXP_FWD_CORE wxCheckBox;
class WXDLLIMPEXP_FWD_CORE wxComboBox;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
class WXDLLIMPEXP_FWD_CORE wxRadioBox;
class WXDLLIMPEXP_FWD_CORE wxPageSetupData;
class WXDLLIMPEXP_FWD_CORE wxPageSetupDialogData;
// ----------------------------------------------------------------------------
// constants

View File

@ -4,7 +4,7 @@
// Author: Karsten Ballueder
// Modified by: Francesco Montorsi
// Created: 09.05.1999
// RCS-ID: $Id: progdlgg.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: progdlgg.h 70512 2012-02-05 14:18:25Z VZ $
// Copyright: (c) Karsten Ballueder
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -27,6 +27,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
class WXDLLIMPEXP_CORE wxGenericProgressDialog : public wxDialog
{
public:
wxGenericProgressDialog();
wxGenericProgressDialog(const wxString& title, const wxString& message,
int maximum = 100,
wxWindow *parent = NULL,
@ -34,6 +35,12 @@ public:
virtual ~wxGenericProgressDialog();
bool Create(const wxString& title,
const wxString& message,
int maximum = 100,
wxWindow *parent = NULL,
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL);
virtual bool Pulse(const wxString& newmsg = wxEmptyString, bool *skip = NULL);
@ -67,15 +74,6 @@ public:
};
protected:
// This ctor is used by the native MSW implementation only.
wxGenericProgressDialog(wxWindow *parent, int style);
void Create(const wxString& title,
const wxString& message,
int maximum,
wxWindow *parent,
int style);
// Update just the m_maximum field, this is used by public SetRange() but,
// unlike it, doesn't update the controls state. This makes it useful for
// both this class and its derived classes that don't use m_gauge to
@ -95,7 +93,7 @@ protected:
// Return the progress dialog style. Prefer to use HasPDFlag() if possible.
int GetPDStyle() const { return m_pdStyle; }
void SetPDStyle(int pdStyle) { m_pdStyle = pdStyle; }
// Updates estimated times from a given progress bar value and stores the
// results in provided arguments.
@ -123,6 +121,10 @@ protected:
// the dialog was shown
void ReenableOtherWindows();
// Set the top level parent we store from the parent window provided when
// creating the dialog.
void SetTopParent(wxWindow* parent);
// return the top level parent window of this dialog (may be NULL)
wxWindow *GetTopParent() const { return m_parentTop; }
@ -151,7 +153,7 @@ private:
static void SetTimeLabel(unsigned long val, wxStaticText *label);
// common part of all ctors
void Init(wxWindow *parent, int style);
void Init();
// create the label with given text and another one to show the time nearby
// as the next windows in the sizer, returns the created control

View File

@ -4,7 +4,7 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 28.10.99
// RCS-ID: $Id: spinctlg.h 67199 2011-03-15 11:10:38Z VZ $
// RCS-ID: $Id: spinctlg.h 70432 2012-01-21 17:03:52Z VZ $
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -81,7 +81,6 @@ public:
// forward these functions to all subcontrols
virtual bool Enable(bool enable = true);
virtual bool Show(bool show = true);
virtual bool Reparent(wxWindowBase *newParent);
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip(wxToolTip *tip);
#endif // wxUSE_TOOLTIPS
@ -92,7 +91,7 @@ public:
// forwarded events from children windows
void OnSpinButton(wxSpinEvent& event);
void OnTextLostFocus();
void OnTextLostFocus(wxFocusEvent& event);
void OnTextChar(wxKeyEvent& event);
// this window itself is used only as a container for its sub windows so it
@ -108,6 +107,11 @@ protected:
virtual wxSize DoGetBestSize() const;
virtual void DoMoveWindow(int x, int y, int width, int height);
#ifdef __WXMSW__
// and, for MSW, enabling this window itself
virtual void DoEnable(bool enable);
#endif // __WXMSW__
// generic double valued functions
double DoGetValue() const { return m_value; }
bool DoSetValue(double val);
@ -148,6 +152,8 @@ protected:
private:
// common part of all ctors
void Init();
DECLARE_EVENT_TABLE()
};
#else // !wxUSE_SPINBTN

View File

@ -4,7 +4,7 @@
// Author: Julian Smart
// Modified by:
// Created: 28/6/2000
// RCS-ID: $Id: splash.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: splash.h 69796 2011-11-22 13:18:55Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
@ -13,8 +13,9 @@
#define _WX_SPLASH_H_
#include "wx/bitmap.h"
#include "wx/timer.h"
#include "wx/eventfilter.h"
#include "wx/frame.h"
#include "wx/timer.h"
/*
@ -33,11 +34,12 @@ class WXDLLIMPEXP_FWD_ADV wxSplashScreenWindow;
* wxSplashScreen
*/
class WXDLLIMPEXP_ADV wxSplashScreen: public wxFrame
class WXDLLIMPEXP_ADV wxSplashScreen: public wxFrame,
public wxEventFilter
{
public:
// for RTTI macros only
wxSplashScreen() {}
wxSplashScreen() { Init(); }
wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -52,7 +54,13 @@ public:
wxSplashScreenWindow* GetSplashWindow() const { return m_window; }
int GetTimeout() const { return m_milliseconds; }
// Override wxEventFilter method to hide splash screen on any user input.
virtual int FilterEvent(wxEvent& event);
protected:
// Common part of all ctors.
void Init();
wxSplashScreenWindow* m_window;
long m_splashStyle;
int m_milliseconds;
@ -74,8 +82,6 @@ public:
void OnPaint(wxPaintEvent& event);
void OnEraseBackground(wxEraseEvent& event);
void OnMouseEvent(wxMouseEvent& event);
void OnChar(wxKeyEvent& event);
void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
wxBitmap& GetBitmap() { return m_bitmap; }

View File

@ -4,7 +4,7 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: splitter.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: splitter.h 70840 2012-03-08 13:23:39Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -49,7 +49,7 @@ enum
// to prevent flickering. (WS_CLIPCHILDREN doesn't work in all cases so can't be
// standard).
class WXDLLIMPEXP_CORE wxSplitterWindow: public wxWindow
class WXDLLIMPEXP_CORE wxSplitterWindow: public wxNavigationEnabled<wxWindow>
{
public:
@ -136,8 +136,14 @@ public:
// Sets the border size
void SetBorderSize(int WXUNUSED(width)) { }
// Gets the sash size
// Hide or show the sash and test whether it's currently hidden.
void SetSashInvisible(bool invisible = true);
bool IsSashInvisible() const { return HasFlag(wxSP_NOSASH); }
// Gets the current sash size which may be 0 if it's hidden and the default
// sash size.
int GetSashSize() const;
int GetDefaultSashSize() const;
// Gets the border size
int GetBorderSize() const;
@ -211,9 +217,6 @@ public:
// Resizes subwindows
virtual void SizeWindows();
void SetNeedUpdating(bool needUpdating) { m_needUpdating = needUpdating; }
bool GetNeedUpdating() const { return m_needUpdating ; }
#ifdef __WXMAC__
virtual bool MacClipGrandChildren() const { return true ; }
#endif
@ -297,11 +300,8 @@ protected:
bool m_needUpdating:1;
bool m_permitUnsplitAlways:1;
bool m_isHot:1;
bool m_checkRequestedSashPosition:1;
private:
WX_DECLARE_CONTROL_CONTAINER();
DECLARE_DYNAMIC_CLASS(wxSplitterWindow)
DECLARE_EVENT_TABLE()
wxDECLARE_NO_COPY_CLASS(wxSplitterWindow);

View File

@ -3,7 +3,7 @@
// Purpose: generic wxSearchCtrl class
// Author: Vince Harron
// Created: 2006-02-19
// RCS-ID: $Id: srchctlg.h 59269 2009-03-02 14:49:55Z VZ $
// RCS-ID: $Id: srchctlg.h 68911 2011-08-27 12:13:23Z VZ $
// Copyright: Vince Harron
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -191,6 +191,7 @@ public:
// wxWindow overrides
virtual bool SetFont(const wxFont& font);
virtual bool SetBackgroundColour(const wxColour& colour);
// search control generic only
void SetSearchBitmap( const wxBitmap& bitmap );
@ -235,6 +236,9 @@ protected:
private:
friend class wxSearchButton;
// Implement pure virtual function inherited from wxCompositeWindow.
virtual wxWindowList GetCompositeWindowParts() const;
#if wxUSE_MENUS
void PopupSearchMenu();
#endif // wxUSE_MENUS

View File

@ -3,7 +3,7 @@
// Purpose: wxGenericStaticBitmap header
// Author: Marcin Wojdyr, Stefan Csomor
// Created: 2008-06-16
// RCS-ID: $Id: statbmpg.h 61724 2009-08-21 10:41:26Z VZ $
// RCS-ID: $Id: statbmpg.h 67681 2011-05-03 16:29:04Z DS $
// Copyright: wxWidgets developers
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -61,7 +61,7 @@ public:
private:
wxSize GetBitmapSize()
{
return m_bitmap.Ok() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight())
return m_bitmap.IsOk() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight())
: wxSize(16, 16); // this is completely arbitrary
}

View File

@ -4,7 +4,7 @@
// Author: Julian Smart
// Modified by: VZ at 05.02.00 to derive from wxStatusBarBase
// Created: 01/02/97
// RCS-ID: $Id: statusbr.h 61624 2009-08-06 00:01:43Z VZ $
// RCS-ID: $Id: statusbr.h 67384 2011-04-03 20:31:32Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -81,7 +81,7 @@ protected:
virtual void InitColours();
// true if the status bar shows the size grip: for this it must have
// wxSTB_SIZEGRIP style and the window it is attached to must be resizeable
// wxSTB_SIZEGRIP style and the window it is attached to must be resizable
// and not maximized
bool ShowsSizeGrip() const;

View File

@ -4,7 +4,7 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: tabg.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: tabg.h 70165 2011-12-29 14:42:13Z SN $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -130,7 +130,7 @@ public:
// Called when a tab is activated
virtual void OnTabActivate(int activateId, int deactivateId);
// Allows vetoing
virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return true; };
virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return true; }
// Allows use of application-supplied wxTabControl classes.
virtual wxTabControl *OnCreateTabControl(void) { return new wxTabControl(this); }

View File

@ -0,0 +1,70 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/timectrl.h
// Purpose: Generic implementation of wxTimePickerCtrl.
// Author: Paul Breen, Vadim Zeitlin
// Created: 2011-09-22
// RCS-ID: $Id: timectrl.h 69489 2011-10-20 16:45:48Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_TIMECTRL_H_
#define _WX_GENERIC_TIMECTRL_H_
#include "wx/containr.h"
#include "wx/compositewin.h"
class WXDLLIMPEXP_ADV wxTimePickerCtrlGeneric
: public wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> >
{
public:
typedef wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> > Base;
// Creating the control.
wxTimePickerCtrlGeneric() { Init(); }
virtual ~wxTimePickerCtrlGeneric();
wxTimePickerCtrlGeneric(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr)
{
Init();
(void)Create(parent, id, date, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr);
// Implement pure virtual wxTimePickerCtrlBase methods.
virtual void SetValue(const wxDateTime& date);
virtual wxDateTime GetValue() const;
protected:
virtual wxSize DoGetBestSize() const;
virtual void DoMoveWindow(int x, int y, int width, int height);
private:
void Init();
// Return the list of the windows composing this one.
virtual wxWindowList GetCompositeWindowParts() const;
// Implementation data.
class wxTimePickerGenericImpl* m_impl;
wxDECLARE_NO_COPY_CLASS(wxTimePickerCtrlGeneric);
};
#endif // _WX_GENERIC_TIMECTRL_H_