removed wxUniversalWindow class and merged its methods into wxWindow itself,

wxGTK builds with the generic wxStaticText enabled (but doesn't work...)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-08-14 19:08:04 +00:00
parent 04e2f7e395
commit c9278366ee
24 changed files with 807 additions and 604 deletions

View File

@@ -32,6 +32,7 @@ include ./src/make.env
srcdir = @srcdir@
VP1 = @top_srcdir@/src/common
VP1_5 = @top_srcdir@/src/univ
VP2 = @top_srcdir@/src/@TOOLKIT_DIR@
VP3 = @top_srcdir@/src/motif/xmcombo
VP4 = @top_srcdir@/src/generic
@@ -46,7 +47,7 @@ VP11 = @top_srcdir@/src/iodbc
# the comment at the end of the next line is needed because otherwise autoconf
# would remove this line completely - it contains a built-in hack to remove
# any VPATH assignment not containing ':'
VPATH = $(VP1)@PATH_IFS@$(VP2)@PATH_IFS@$(VP3)@PATH_IFS@$(VP4)@PATH_IFS@$(VP5)@PATH_IFS@$(VP6)@PATH_IFS@$(VP7)@PATH_IFS@$(VP8)@PATH_IFS@$(VP9)@PATH_IFS@$(VP10)@PATH_IFS@$(VP11) # ':' for autoconf
VPATH = $(VP1)@PATH_IFS@$(VP1_5)@PATH_IFS@$(VP2)@PATH_IFS@$(VP3)@PATH_IFS@$(VP4)@PATH_IFS@$(VP5)@PATH_IFS@$(VP6)@PATH_IFS@$(VP7)@PATH_IFS@$(VP8)@PATH_IFS@$(VP9)@PATH_IFS@$(VP10)@PATH_IFS@$(VP11) # ':' for autoconf
top_srcdir = @top_srcdir@
prefix = @prefix@
@@ -561,7 +562,7 @@ ALL_GUI_DIST: ALL_DIST
mkdir $(DISTDIR)/src/tiff
mkdir $(DISTDIR)/src/iodbc
mkdir $(DISTDIR)/src/unix
cp $(WXDIR)/@PORT_FILES@ $(DISTDIR)/@PORT_FILES@
cp $(WXDIR)/@PORT_FILES@ $(DISTDIR)
cp $(SRCDIR)/*.in $(DISTDIR)/src
cp $(COMMDIR)/*.cpp $(DISTDIR)/src/common
cp $(COMMDIR)/*.c $(DISTDIR)/src/common
@@ -601,7 +602,7 @@ BASE_DIST: ALL_DIST
mkdir $(DISTDIR)/include/wx/unix
mkdir $(DISTDIR)/src/common
mkdir $(DISTDIR)/src/unix
cp $(WXDIR)/@PORT_FILES@ $(DISTDIR)/@PORT_FILES@
cp $(WXDIR)/@PORT_FILES@ $(DISTDIR)
cp $(WXDIR)/@RPM_FILES@ $(DISTDIR)/@RPM_FILES@
cp $(WXDIR)/@RPM_SPEC@ $(DISTDIR)/@RPM_SPEC@
cp $(WXDIR)/wxBase.dsp $(DISTDIR)

1141
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -804,6 +804,7 @@ if test $DEBUG_CONFIGURE = 1; then
DEFAULT_wxUSE_STATBMP=no
DEFAULT_wxUSE_STATBOX=no
DEFAULT_wxUSE_STATLINE=no
DEFAULT_wxUSE_STATTEXT=no
DEFAULT_wxUSE_STATUSBAR=no
DEFAULT_wxUSE_TABDIALOG=no
DEFAULT_wxUSE_TEXTCTRL=no
@@ -941,6 +942,7 @@ else
DEFAULT_wxUSE_STATBMP=yes
DEFAULT_wxUSE_STATBOX=yes
DEFAULT_wxUSE_STATLINE=yes
DEFAULT_wxUSE_STATTEXT=yes
DEFAULT_wxUSE_STATUSBAR=yes
DEFAULT_wxUSE_TABDIALOG=no
DEFAULT_wxUSE_TEXTCTRL=yes
@@ -1235,6 +1237,7 @@ WX_ARG_ENABLE(splitter, [ --enable-splitter use wxSplitterWindow class
WX_ARG_ENABLE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP)
WX_ARG_ENABLE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX)
WX_ARG_ENABLE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE)
WX_ARG_ENABLE(stattext, [ --enable-stattext use wxStaticText class], wxUSE_STATTEXT)
WX_ARG_ENABLE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR)
WX_ARG_ENABLE(tabdialog, [ --enable-tabdialog use wxTabControl class], wxUSE_TABDIALOG)
WX_ARG_ENABLE(textctrl, [ --enable-textctrl use wxTextCtrl class], wxUSE_TEXTCTRL)
@@ -1962,6 +1965,9 @@ if test "$wxUSE_GUI" = "yes"; then
dnl are we using the generic version with this low level toolkit?
if test "$wxUSE_UNIVERSAL" = "yes"; then
TOOLKIT_NAME="${TOOLKIT_NAME}univ"
SETUPH_DIR="univ"
else
SETUPH_DIR="${TOOLKIT_DIR}"
fi
dnl append 'd' to the debug library name
@@ -1980,7 +1986,7 @@ if test "$wxUSE_GUI" = "yes"; then
dnl the sources, their dependenices and the headers
if test "$wxUSE_UNIVERSAL" = "yes"; then
ALL_OBJECTS="\$(GUI_LOWLEVEL_OBJS)"
ALL_OBJECTS="\$(GUI_LOWLEVEL_OBJS) \${UNIVOBJS}"
else
ALL_OBJECTS="\$(GUIOBJS)"
fi
@@ -2018,6 +2024,9 @@ if test "$wxUSE_GUI" = "yes"; then
ALL_DEPFILES="${ALL_DEPFILES} \$(COMMONDEPS) \$(GENERICDEPS) \$(UNIXDEPS) \$(HTMLDEPS) \$(OGLDEPS)"
PORT_FILES="src/\$(TOOLKITDIR)/files.lst"
if test "$wxUSE_UNIVERSAL" = "yes"; then
PORT_FILES="${PORT_FILES} \${top_srcdir}/src/univ/files.lst"
fi
RPM_FILES="src/\$(TOOLKITDIR)/rpmfiles.lst"
RPM_SPEC="wx\$(TOOLKIT).spec"
@@ -3668,6 +3677,10 @@ if test "$wxUSE_STATBOX" = "yes"; then
AC_DEFINE(wxUSE_STATBOX)
fi
if test "$wxUSE_STATTEXT" = "yes"; then
AC_DEFINE(wxUSE_STATTEXT)
fi
if test "$wxUSE_STATLINE" = "yes"; then
if test "$wxUSE_WINE" = 1 ; then
AC_MSG_WARN([wxStaticLine is not supported under WINE])
@@ -3968,6 +3981,7 @@ AC_SUBST(AFMINSTALL)
AC_SUBST(TOOLKIT)
AC_SUBST(TOOLKIT_DEF)
AC_SUBST(TOOLKIT_DIR)
AC_SUBST(SETUPH_DIR)
AC_SUBST(TOOLKIT_NAME)
AC_SUBST(TOOLKIT_INCLUDE)
AC_SUBST(WXCONFIG_INCLUDE)
@@ -4032,9 +4046,9 @@ AC_PROG_MAKE_SET
dnl move setup.h back if available
if test -d include; then
if test -d include/wx; then
if test -d include/wx/${TOOLKIT_DIR}; then
if test -f include/wx/${TOOLKIT_DIR}/setup.h; then
mv -f include/wx/${TOOLKIT_DIR}/setup.h setup.h
if test -d include/wx/${SETUPH_DIR}; then
if test -f include/wx/${SETUPH_DIR}/setup.h; then
mv -f include/wx/${SETUPH_DIR}/setup.h setup.h
fi
fi
fi
@@ -4085,11 +4099,11 @@ AC_OUTPUT([
if test ! -d lib/wx/include/wx; then
mkdir lib/wx/include/wx
fi
if test ! -d lib/wx/include/wx/${TOOLKIT_NAME}; then
mkdir lib/wx/include/wx/${TOOLKIT_NAME}
if test ! -d lib/wx/include/wx/${SETUPH_DIR}; then
mkdir lib/wx/include/wx/${SETUPH_DIR}
fi
if test -f setup.h; then
cp -f setup.h lib/wx/include/wx/${TOOLKIT_NAME}/setup.h
cp -f setup.h lib/wx/include/wx/${SETUPH_DIR}/setup.h
fi
dnl *move* setup.h to its final place
@@ -4100,16 +4114,16 @@ AC_OUTPUT([
if test ! -d include/wx; then
mkdir include/wx
fi
if test ! -d include/wx/${TOOLKIT_DIR}; then
mkdir include/wx/${TOOLKIT_DIR}
if test ! -d include/wx/${SETUPH_DIR}; then
mkdir include/wx/${SETUPH_DIR}
fi
if test -f setup.h; then
mv -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
mv -f setup.h include/wx/${SETUPH_DIR}/setup.h
fi
],
[
TOOLKIT_DIR="${TOOLKIT_DIR}"
SETUPH_DIR="${SETUPH_DIR}"
TOOLKIT_NAME="${TOOLKIT_NAME}"
LN_S="${LN_S}"
]

View File

@@ -78,7 +78,7 @@ public:
// depend on the toolkit. default version does nothing.
//
// Override: rarely.
virtual bool OnInitGui() { return TRUE; }
virtual bool OnInitGui();
#endif // wxUSE_GUI
// called to start program execution - the default version just enters

View File

@@ -24,6 +24,8 @@
#include "wx/window.h" // base class
extern const wxChar* wxControlNameStr; // the default name
// ----------------------------------------------------------------------------
// wxControl is the base class for all controls
// ----------------------------------------------------------------------------
@@ -31,6 +33,14 @@
class WXDLLEXPORT wxControlBase : public wxWindow
{
public:
// Create() function adds the validator parameter
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 the event of given type (i.e. wxButton::Command() is just as
// if the button was clicked)
virtual void Command(wxCommandEvent &event);
@@ -57,7 +67,9 @@ protected:
// include platform-dependent wxControl declarations
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#if defined(__WXUNIVERSAL__)
#include "wx/univ/control.h"
#elif defined(__WXMSW__)
#include "wx/msw/control.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/control.h"

View File

@@ -29,8 +29,6 @@ class wxControl;
// wxControl
//-----------------------------------------------------------------------------
extern const wxChar* wxControlNameStr;
class wxControl : public wxControlBase
{
public:

View File

@@ -30,8 +30,6 @@ class wxStaticText;
// global data
//-----------------------------------------------------------------------------
extern const wxChar *wxStaticTextNameStr;
//-----------------------------------------------------------------------------
// wxStaticText
//-----------------------------------------------------------------------------

View File

@@ -29,8 +29,6 @@ class wxControl;
// wxControl
//-----------------------------------------------------------------------------
extern const wxChar* wxControlNameStr;
class wxControl : public wxControlBase
{
public:

View File

@@ -30,8 +30,6 @@ class wxStaticText;
// global data
//-----------------------------------------------------------------------------
extern const wxChar *wxStaticTextNameStr;
//-----------------------------------------------------------------------------
// wxStaticText
//-----------------------------------------------------------------------------

View File

@@ -36,6 +36,7 @@ public:
virtual ~wxApp();
// override base class (pure) virtuals
virtual bool OnInitGui() { return TRUE; }
virtual int MainLoop();
virtual void ExitMainLoop();
virtual bool Initialized();

View File

@@ -3,20 +3,33 @@
#if wxUSE_STATTEXT
#if defined(__WXMSW__)
#include "wx/msw/stattext.h"
#include "wx/control.h"
extern const wxChar *wxStaticTextNameStr;
class WXDLLEXPORT wxStaticTextBase : public wxControl
{
public:
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/stattext.h"
#elif defined(__WXMSW__)
#include "wx/msw/stattext.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/stattext.h"
#include "wx/motif/stattext.h"
#elif defined(__WXGTK__)
#include "wx/gtk/stattext.h"
#include "wx/gtk/stattext.h"
#elif defined(__WXQT__)
#include "wx/qt/stattext.h"
#include "wx/qt/stattext.h"
#elif defined(__WXMAC__)
#include "wx/mac/stattext.h"
#include "wx/mac/stattext.h"
#elif defined(__WXPM__)
#include "wx/os2/stattext.h"
#include "wx/os2/stattext.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/stattext.h"
#include "wx/stubs/stattext.h"
#endif
#endif // wxUSE_STATTEXT

View File

@@ -19,6 +19,9 @@
#ifndef _WX_UNIX_RENDERER_H_
#define _WX_UNIX_RENDERER_H_
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxRenderer
{
public:

View File

@@ -14,6 +14,10 @@
#ifndef _WX_UNIX_THEME_H_
#define _WX_UNIX_THEME_H_
#ifdef __GNUG__
#pragma interface "theme.h"
#endif
// ----------------------------------------------------------------------------
// wxTheme
// ----------------------------------------------------------------------------
@@ -25,16 +29,25 @@ class WXDLLEXPORT wxColourScheme;
class WXDLLEXPORT wxTheme
{
public:
// create the default theme
static bool CreateDefault();
// change the current scheme
static wxTheme *Set(wxTheme *theme);
// get the current theme (never NULL)
static wxTheme *Get() { return ms_theme; }
virtual wxRenderer *GetRenderer() = 0;
virtual wxInputHandler *GetInputHandler() = 0;
virtual wxColourScheme *GetColourScheme() = 0;
virtual ~wxTheme();
private:
// the current theme
static wxTheme *ms_theme;
};
// ----------------------------------------------------------------------------
// global variables
// ----------------------------------------------------------------------------
extern WXDLLEXPORT_DATA(wxTheme *) wxTheTheme;
#endif // _WX_UNIX_THEME_H_

View File

@@ -48,6 +48,9 @@ class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxDropTarget;
class WXDLLEXPORT wxItemResource;
class WXDLLEXPORT wxLayoutConstraints;
#ifdef __WXUNIVERSAL__
class WXDLLEXPORT wxRenderer;
#endif // __WXUNIVERSAL__
class WXDLLEXPORT wxResourceTable;
class WXDLLEXPORT wxSizer;
class WXDLLEXPORT wxToolTip;
@@ -852,6 +855,20 @@ protected:
ClientData_Void // client data is untyped and we don't own it
} m_clientDataType;
#ifdef __WXUNIVERSAL__
// draw the controls contents: the base class version draws the border as
// required (depending on the window style flags and enabled state) and
// adjusts the DC so that subsequent drawing is clipped to the area inside
// the border
virtual void DoDraw(wxDC& dc, wxRenderer *renderer);
// draw the border corresponding to the window style
virtual void DoDrawBorder(wxDC& dc, wxRenderer *renderer);
// event handlers
void OnPaint(wxPaintEvent& event);
#endif // __WXUNIVERSAL__
private:
// contains the last id generated by NewControlId
static int ms_lastControlId;

View File

@@ -33,6 +33,8 @@
#include "wx/app.h"
#include "wx/frame.h"
#include "wx/dcclient.h"
#include "wx/stattext.h"
#endif
// Define a new application type, each program should derive a class from wxApp
@@ -57,7 +59,6 @@ public:
protected:
// event handlers
void OnPaint(wxPaintEvent& event);
void OnLeftUp(wxMouseEvent& event);
private:
@@ -72,8 +73,6 @@ private:
IMPLEMENT_APP(MyUnivApp)
BEGIN_EVENT_TABLE(MyUnivFrame, wxFrame)
EVT_PAINT(MyUnivFrame::OnPaint)
EVT_LEFT_UP(MyUnivFrame::OnLeftUp)
END_EVENT_TABLE()
@@ -100,12 +99,8 @@ bool MyUnivApp::OnInit()
MyUnivFrame::MyUnivFrame(const wxString& title)
: wxFrame(NULL, -1, title, wxDefaultPosition, wxSize(300, 150))
{
}
void MyUnivFrame::OnPaint(wxPaintEvent& event)
{
wxPaintDC dc(this);
dc.DrawText(_T("Ctrl-click to exit."), 10, 10);
new wxStaticText(this, _T("Test static text"), wxPoint(10, 10));
new wxStaticText(this, _T("Ctrl-click to exit."), wxPoint(40, 10));
}
void MyUnivFrame::OnLeftUp(wxMouseEvent& event)

View File

@@ -374,6 +374,10 @@
* Use this control
*/
#define wxUSE_STATLINE 0
/*
* Use this control
*/
#define wxUSE_STATTEXT 0
/*
* Use this control
*/

View File

@@ -36,10 +36,43 @@
#include "wx/thread.h"
#include "wx/confbase.h"
#ifdef __WXUNIVERSAL__
#include "wx/univ/theme.h"
#endif // __WXUNIVERSAL__
// ===========================================================================
// implementation
// ===========================================================================
// ----------------------------------------------------------------------------
// initialization and termination
// ----------------------------------------------------------------------------
bool wxAppBase::OnInitGui()
{
#ifdef __WXUNIVERSAL__
if ( !wxTheme::CreateDefault() )
return FALSE;
#endif // __WXUNIVERSAL__
return TRUE;
}
int wxAppBase::OnExit()
{
#if wxUSE_CONFIG
// delete the config object if any (don't use Get() here, but Set()
// because Get() could create a new config object)
delete wxConfigBase::Set((wxConfigBase *) NULL);
#endif // wxUSE_CONFIG
#ifdef __WXUNIVERSAL__
delete wxTheme::Set(NULL);
#endif // __WXUNIVERSAL__
return 0;
}
// ---------------------------------------------------------------------------
// wxAppBase
// ----------------------------------------------------------------------------
@@ -74,13 +107,3 @@ void wxAppBase::ProcessPendingEvents()
wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
}
int wxAppBase::OnExit()
{
#if wxUSE_CONFIG
// delete the config object if any (don't use Get() here, but Set()
// because Get() could create a new config object)
delete wxConfigBase::Set((wxConfigBase *) NULL);
#endif // wxUSE_CONFIG
return 0;
}

View File

@@ -39,6 +39,24 @@
// implementation
// ============================================================================
bool wxControlBase::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
long style,
const wxValidator& validator,
const wxString &name)
{
bool ret = wxWindow::Create(parent, id, pos, size, style, name);
#if wxUSE_VALIDATORS
if ( ret )
SetValidator(validator);
#endif // wxUSE_VALIDATORS
return ret;
}
bool wxControlBase::CreateControl(wxWindowBase *parent,
wxWindowID id,
const wxPoint& pos,

View File

@@ -35,6 +35,7 @@
#include "wx/frame.h"
#include "wx/defs.h"
#include "wx/window.h"
#include "wx/control.h"
#include "wx/checkbox.h"
#include "wx/radiobut.h"
#include "wx/textctrl.h"
@@ -77,6 +78,11 @@ BEGIN_EVENT_TABLE(wxWindowBase, wxEvtHandler)
EVT_SYS_COLOUR_CHANGED(wxWindowBase::OnSysColourChanged)
EVT_INIT_DIALOG(wxWindowBase::OnInitDialog)
EVT_MIDDLE_DOWN(wxWindowBase::OnMiddleClick)
#ifdef __WXUNIVERSAL__
EVT_PAINT(wxWindowBase::OnPaint)
#endif // __WXUNIVERSAL__
END_EVENT_TABLE()
// ============================================================================

View File

@@ -275,6 +275,9 @@ wxApp::~wxApp()
bool wxApp::OnInitGui()
{
if ( !wxAppBase::OnInitGui() )
return FALSE;
GdkVisual *visual = gdk_visual_get_system();
/* on some machines, the default visual is just 256 colours, so

View File

@@ -14,7 +14,7 @@
#define gtk_marshal_NONE__POINTER_POINTER gtk_marshal_NONE__POINTER_POINT
#endif
#include "wx/gtk/setup.h"
#include "wx/setup.h"
#include "wx/gtk/win_gtk.h"
#include "gtk/gtksignal.h"
#include "gtk/gtkprivate.h"

View File

@@ -275,6 +275,9 @@ wxApp::~wxApp()
bool wxApp::OnInitGui()
{
if ( !wxAppBase::OnInitGui() )
return FALSE;
GdkVisual *visual = gdk_visual_get_system();
/* on some machines, the default visual is just 256 colours, so

View File

@@ -14,7 +14,7 @@
#define gtk_marshal_NONE__POINTER_POINTER gtk_marshal_NONE__POINTER_POINT
#endif
#include "wx/gtk/setup.h"
#include "wx/setup.h"
#include "wx/gtk/win_gtk.h"
#include "gtk/gtksignal.h"
#include "gtk/gtkprivate.h"

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
// Name: univ/window.cpp
// Purpose: wxUniversalWindow implementation
// Purpose: implementation of extra wxWindow methods for wxUniv port
// Author: Vadim Zeitlin
// Modified by:
// Created: 06.08.00
@@ -29,8 +29,22 @@
#endif
#ifndef WX_PRECOMP
#include "wx/window.h"
#include "wx/dc.h"
#include "wx/dcclient.h"
#include "wx/event.h"
#include "wx/univ/renderer.h"
#include "wx/univ/theme.h"
#endif // WX_PRECOMP
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// we don't have any objects of type wxWindowBase so this cast is always safe
#define self ((wxWindow *)this)
// ============================================================================
// implementation
// ============================================================================
@@ -40,22 +54,28 @@
// ----------------------------------------------------------------------------
// the event handler executed when the window must be repainted
void wxUniversalWindow::OnPaint(wxPaintEvent& event)
void wxWindowBase::OnPaint(wxPaintEvent& event)
{
// get the renderer to use
wxRenderer *renderer = wxTheTheme->GetRenderer();
// get the renderer and the DC to use
wxRenderer *renderer = wxTheme::Get()->GetRenderer();
wxPaintDC dc(self);
// draw the border
DoDrawBorder(dc, renderer);
// draw the control
wxPaintDC dc(this);
DoDraw(dc, renderer);
}
// draw the border
void DoDrawBorder(wxRenderer *renderer, wxDC& dc, const wxRect& rect)
void wxWindowBase::DoDrawBorder(wxDC& dc, wxRenderer *renderer)
{
if ( !(m_windowStyle & wxNO_BORDER) )
{
renderer->DrawBorder(dc, this);
renderer->DrawBorder(dc, self);
}
}
void wxWindowBase::DoDraw(wxDC& dc, wxRenderer *renderer)
{
}