first pass of wxUniv merge - nothing works, most parts don't even compile

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-06-26 20:59:19 +00:00
parent aeb313f31c
commit 1e6feb95a7
409 changed files with 42065 additions and 6675 deletions

View File

@@ -9,7 +9,7 @@
// Created: 21/3/2000
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIRCTRL_H_
@@ -19,6 +19,8 @@
#pragma interface "dirctrlg.h"
#endif
#if wxUSE_DIRDLG
#include "wx/treectrl.h"
#include "wx/dirdlg.h"
#include "wx/choice.h"
@@ -247,5 +249,7 @@ protected:
};
#endif // wxUSE_DIRDLG
#endif
// _WX_DIRCTRLG_H_

View File

@@ -19,6 +19,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_GRID
#include "wx/panel.h"
#include "wx/string.h"
#include "wx/scrolbar.h"
@@ -420,5 +423,7 @@ typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&);
#define EVT_GRID_LABEL_LCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_LABEL_LCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL),
#define EVT_GRID_LABEL_RCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_GRID_LABEL_RCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL),
#endif // wxUSE_GRID
#endif // __GRIDH_G__

View File

@@ -198,8 +198,10 @@ class WXDLLEXPORT wxLayoutAlgorithm: public wxObject
public:
wxLayoutAlgorithm() {}
#if wxUSE_MDI_ARCHITECTURE
// The MDI client window is sized to whatever's left over.
bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = (wxRect*) NULL);
#endif // wxUSE_MDI_ARCHITECTURE
// mainWindow is sized to whatever's left over. This function for backward
// compatibility; use LayoutWindow.

View File

@@ -71,9 +71,11 @@ public:
// to the dialog via validators.
virtual void InitDialog();
#if wxUSE_BUTTON
// a default button is activated when Enter is pressed
wxButton *GetDefaultItem() const { return m_btnDefault; }
void SetDefaultItem(wxButton *btn) { m_btnDefault = btn; }
#endif // wxUSE_BUTTON
// implementation from now on
// --------------------------
@@ -109,8 +111,10 @@ protected:
// the child which had the focus last time this panel was activated
wxWindow *m_winLastFocused;
#if wxUSE_BUTTON
// a default button or NULL
wxButton *m_btnDefault;
#endif // wxUSE_BUTTON
private:
DECLARE_DYNAMIC_CLASS(wxPanel)

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/scrolwin.h
// Purpose: wxScrolledWindow class
// Purpose: wxGenericScrolledWindow class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
@@ -30,25 +30,32 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
#endif
// avoid triggering this stupid VC++ warning
#ifdef __VISUALC__
#pragma warning(disable:4355) // 'this' used in base member initializer list
#endif
// ----------------------------------------------------------------------------
// wxGenericScrolledWindow
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
public wxScrollHelper
{
public:
wxGenericScrolledWindow();
wxGenericScrolledWindow() : wxScrollHelper(this) { }
wxGenericScrolledWindow(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxScrollHelper(this)
{
Create(parent, id, pos, size, style, name);
}
~wxGenericScrolledWindow();
virtual ~wxGenericScrolledWindow();
bool Create(wxWindow *parent,
wxWindowID id,
@@ -57,100 +64,15 @@ public:
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr);
// Normally the wxGenericScrolledWindow will scroll itself, but in
// some rare occasions you might want it to scroll another
// window (e.g. a child of it in order to scroll only a portion
// the area between the scrollbars (spreadsheet: only cell area
// will move).
virtual void SetTargetWindow( wxWindow *target );
virtual wxWindow *GetTargetWindow();
// Number of pixels per user unit (0 or -1 for no scrollbar)
// Length of virtual canvas in user units
// Length of page in user units
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = FALSE );
// Physically scroll the window
virtual void Scroll(int x_pos, int y_pos);
#if WXWIN_COMPATIBILITY
virtual void GetScrollUnitsPerPage(int *x_page, int *y_page) const;
virtual void CalcUnscrolledPosition(int x, int y, float *xx, float *yy) const;
#endif
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
// Enable/disable Windows scrolling in either direction.
// If TRUE, wxWindows scrolls the canvas and only a bit of
// the canvas is invalidated; no Clear() is necessary.
// If FALSE, the whole canvas is invalidated and a Clear() is
// necessary. Disable for when the scroll increment is used
// to actually scroll a non-constant distance
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
virtual void GetViewStart(int *x, int *y) const;
// Compatibility
void ViewStart(int *x, int *y) const
{ GetViewStart( x, y ); }
// Actual size in pixels when scrolling is taken into account
virtual void GetVirtualSize(int *x, int *y) const;
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const;
virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Adjust the scrollbars
virtual void AdjustScrollbars(void);
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) {};
// Override this function if you don't want to have wxGenericScrolledWindow
// automatically change the origin according to the scroll position.
virtual void PrepareDC(wxDC& dc);
// implementation from now on
void OnScroll(wxScrollWinEvent& event);
void OnSize(wxSizeEvent& event);
void OnPaint(wxPaintEvent& event);
void OnChar(wxKeyEvent& event);
void OnMouseWheel(wxMouseEvent& event);
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollWinEvent& event);
protected:
wxWindow *m_targetWindow;
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLines;
int m_yScrollLines;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
double m_scaleX;
double m_scaleY;
int m_wheelRotation;
virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
private:
DECLARE_EVENT_TABLE()
DECLARE_ABSTRACT_CLASS(wxGenericScrolledWindow)
};
#ifdef __VISUALC__
#pragma warning(default:4355)
#endif
#endif
// _WX_GENERIC_SCROLLWIN_H_

View File

@@ -12,16 +12,105 @@
#ifndef _WX_GENERIC_SPINCTRL_H_
#define _WX_GENERIC_SPINCTRL_H_
// ----------------------------------------------------------------------------
// wxSpinCtrl is a combination of wxSpinButton and wxTextCtrl, so if
// wxSpinButton is available, this is what we do - but if it isn't, we still
// define wxSpinCtrl class which then has the same appearance as wxTextCtrl but
// the different interface. This allows to write programs using wxSpinCtrl
// without tons of #ifdefs.
// ----------------------------------------------------------------------------
#if wxUSE_SPINBTN
#ifdef __GNUG__
#pragma interface "spinctlg.h"
#endif
#include "wx/textctrl.h"
class WXDLLEXPORT wxSpinButton;
class WXDLLEXPORT wxTextCtrl;
// ----------------------------------------------------------------------------
// generic wxSpinCtrl is just a text control
// wxSpinCtrl is a combination of wxTextCtrl and wxSpinButton
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxSpinCtrl : public wxControl
{
public:
wxSpinCtrl() { Init(); }
wxSpinCtrl(wxWindow *parent,
wxWindowID id = -1,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"))
{
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
bool Create(wxWindow *parent,
wxWindowID id = -1,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"));
virtual ~wxSpinCtrl();
// operations
void SetValue(int val);
void SetValue(const wxString& text);
void SetRange(int min, int max);
// accessors
int GetValue() const;
int GetMin() const;
int GetMax() const;
// implementation from now on
// forward these functions to all subcontrols
virtual bool Enable(bool enable = TRUE);
virtual bool Show(bool show = TRUE);
// get the subcontrols
wxTextCtrl *GetText() const { return m_text; }
wxSpinButton *GetSpinButton() const { return m_btn; }
// set the value of the text (only)
void SetTextValue(int val);
// put the numeric value of the string in the text ctrl into val and return
// TRUE or return FALSE if the text ctrl doesn't contain a number or if the
// number is out of range
bool GetTextValue(int *val) const;
protected:
// override the base class virtuals involved into geometry calculations
virtual wxSize DoGetBestClientSize() const;
virtual void DoMoveWindow(int x, int y, int width, int height);
// common part of all ctors
void Init();
private:
// the subcontrols
wxTextCtrl *m_text;
wxSpinButton *m_btn;
};
#else // !wxUSE_SPINBTN
// ----------------------------------------------------------------------------
// wxSpinCtrl is just a text control
// ----------------------------------------------------------------------------
#include "wx/textctrl.h"
class WXDLLEXPORT wxSpinCtrl : public wxTextCtrl
{
public:
@@ -86,5 +175,7 @@ private:
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
};
#endif // wxUSE_SPINBTN/!wxUSE_SPINBTN
#endif // _WX_GENERIC_SPINCTRL_H_

View File

@@ -16,6 +16,8 @@
#pragma interface "treectlg.h"
#endif
#if wxUSE_TREECTRL
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/object.h"
@@ -450,5 +452,7 @@ public:
#endif
#endif // wxUSE_TREECTRL
#endif // _GENERIC_TREECTRL_H_