1. some more of "#if wxUSE_XXX" here and there

2. Makefile fixes for Cygwin compilation


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-06-13 22:54:04 +00:00
parent a9b5e89f5f
commit d427503c36
19 changed files with 306 additions and 231 deletions

View File

@@ -60,22 +60,6 @@ enum
wxCONFIG_USE_RELATIVE_PATH = 4
};
// ----------------------------------------------------------------------------
// various helper global functions
// ----------------------------------------------------------------------------
/*
Replace environment variables ($SOMETHING) with their values. The format is
$VARNAME or ${VARNAME} where VARNAME contains alphanumeric characters and
'_' only. '$' must be escaped ('\$') in order to be taken literally.
*/
extern wxString wxExpandEnvVars(const wxString &sz);
/*
Split path into parts removing '..' in progress
*/
extern void wxSplitPath(wxArrayString& aParts, const wxChar *sz);
// ----------------------------------------------------------------------------
// abstract base class wxConfigBase which defines the interface for derived
// classes
@@ -311,9 +295,23 @@ private:
#define sm_classwxConfig sm_classwxFileConfig
#endif
#endif
#endif // wxUSE_CONFIG
// wxUSE_CONFIG
// ----------------------------------------------------------------------------
// various helper global functions (defined even if !wxUSE_CONFIG)
// ----------------------------------------------------------------------------
/*
Replace environment variables ($SOMETHING) with their values. The format is
$VARNAME or ${VARNAME} where VARNAME contains alphanumeric characters and
'_' only. '$' must be escaped ('\$') in order to be taken literally.
*/
extern wxString wxExpandEnvVars(const wxString &sz);
/*
Split path into parts removing '..' in progress
*/
extern void wxSplitPath(wxArrayString& aParts, const wxChar *sz);
#endif
// _WX_CONFIG_H_

View File

@@ -16,6 +16,8 @@
#pragma interface "dcprint.h"
#endif
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/dc.h"
#include "wx/cmndata.h"
@@ -49,6 +51,8 @@ protected:
// Gets an HDC for the specified printer configuration
WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& data);
#endif // wxUSE_PRINTING_ARCHITECTURE
#endif
// _WX_DCPRINT_H_

View File

@@ -85,6 +85,7 @@ public:
virtual void SetIcon(const wxIcon& icon);
// Toolbar
#if wxUSE_TOOLBAR
virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT,
wxWindowID id = -1,
const wxString& name = wxToolBarNameStr);
@@ -95,7 +96,9 @@ public:
virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
virtual void PositionToolBar();
#endif // wxUSE_TOOLBAR
#if wxUSE_STATUSBAR
// Status bar
virtual wxStatusBar* CreateStatusBar(int number = 1,
long style = wxST_SIZEGRIP,
@@ -121,6 +124,7 @@ public:
// TODO: should this go into a wxFrameworkSettings class perhaps?
static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
static bool UsesNativeStatusBar() { return m_useNativeStatusBar; };
#endif // wxUSE_STATUSBAR
// Iconize
virtual void Iconize(bool iconize);
@@ -191,13 +195,19 @@ protected:
long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
wxMenuBar * m_frameMenuBar;
wxStatusBar * m_frameStatusBar;
wxIcon m_icon;
bool m_iconized;
WXHICON m_defaultIcon;
wxToolBar * m_frameToolBar;
#if wxUSE_STATUSBAR
wxStatusBar * m_frameStatusBar;
static bool m_useNativeStatusBar;
#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
wxToolBar * m_frameToolBar;
#endif // wxUSE_TOOLBAR
private:
#if wxUSE_TOOLTIPS

View File

@@ -126,8 +126,10 @@ public:
void Attach(wxMenuBar *menubar);
void Detach();
#if wxUSE_ACCEL
size_t GetAccelCount() const { return m_accelKeyCodes.GetCount(); }
size_t CopyAccels(wxAcceleratorEntry *accels) const;
#endif // wxUSE_ACCEL
#ifdef WXWIN_COMPATIBILITY
void Callback(const wxFunction func) { m_callback = func; }
@@ -160,8 +162,10 @@ private:
wxWindow *m_pInvokingWindow;
void* m_clientData;
#if wxUSE_ACCEL
// the accelerators data
wxArrayInt m_accelKeyCodes, m_accelFlags, m_accelIds;
#endif // wxUSE_ACCEL
};
// ----------------------------------------------------------------------------
@@ -246,8 +250,11 @@ public:
// attach to a frame
void Attach(wxFrame *frame);
#if wxUSE_ACCEL
// get the accel table for the menus
const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; }
#endif // wxUSE_ACCEL
// get the menu handle
WXHMENU GetHMenu() const { return m_hMenu; }
@@ -266,8 +273,10 @@ protected:
wxFrame *m_menuBarFrame;
WXHMENU m_hMenu;
#if wxUSE_ACCEL
// the accelerator table for all accelerators in all our menus
wxAcceleratorTable m_accelTable;
#endif // wxUSE_ACCEL
};
#endif // _WX_MENU_H_

View File

@@ -16,6 +16,8 @@
#pragma interface "printdlg.h"
#endif
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/dialog.h"
#include "wx/cmndata.h"
@@ -68,5 +70,7 @@ private:
wxWindow* m_dialogParent;
};
#endif // wxUSE_PRINTING_ARCHITECTURE
#endif
// _WX_PRINTDLG_H_

View File

@@ -20,6 +20,7 @@
#include "wx/msw/winundef.h"
class WXDLLEXPORT wxFont;
class WXDLLEXPORT wxWindow;
// ---------------------------------------------------------------------------
// private constants

View File

@@ -179,6 +179,8 @@
#define wxUSE_ACCEL 1
#define wxUSE_SASH 1
#define wxUSE_TEXTDLG 1
#define wxUSE_TOOLBAR 1
#define wxUSE_STATUSBAR 1
/*
* Finer detail

View File

@@ -16,7 +16,7 @@
#pragma interface "tbar95.h"
#endif
#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
#if wxUSE_TOOLBAR
#include "wx/tbarbase.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr;
@@ -89,6 +89,7 @@ protected:
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_TOOL/BUTTONBAR
#endif // wxUSE_TOOLBAR
#endif
// _WX_TBAR95_H_

View File

@@ -15,6 +15,7 @@
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma interface "treectrl.h"
#endif
@@ -23,6 +24,12 @@
#include "wx/event.h"
#include "wx/textctrl.h"
#ifdef __GNUWIN32__
// Cygwin windows.h defines these identifiers
#undef GetFirstChild
#undef GetNextSibling
#endif // Cygwin
// the type for "untyped" data
typedef long wxDataType;

View File

@@ -17,6 +17,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/event.h"
#include "wx/cmndata.h"
#include "wx/panel.h"
@@ -367,5 +370,7 @@ private:
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_PRINTING_ARCHITECTURE
#endif
// _WX_PRNTBASEH__

View File

@@ -21,12 +21,15 @@
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#if wxUSE_CONFIG
#ifndef WX_PRECOMP
#include "wx/string.h"
#include "wx/intl.h"
@@ -1483,3 +1486,6 @@ static wxString GetAppName(const wxString& appName)
else
return appName;
}
#endif // wxUSE_CONFIG

View File

@@ -28,6 +28,8 @@
#pragma hdrstop
#endif
#if wxUSE_INTL
// standard headers
#include <locale.h>
#include <ctype.h>
@@ -646,3 +648,6 @@ wxLocale *wxSetLocale(wxLocale *pLocale)
g_pLocale = pLocale;
return pOld;
}
#endif // wxUSE_INTL

View File

@@ -16,6 +16,7 @@
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma implementation "layout.h"
#endif
@@ -29,6 +30,8 @@
#include "wx/defs.h"
#if wxUSE_CONSTRAINTS
#ifndef WX_PRECOMP
#include "wx/window.h"
#include "wx/utils.h"
@@ -1762,3 +1765,4 @@ wxSpacingSizer::~wxSpacingSizer()
{
}
#endif // wxUSE_CONSTRAINTS

View File

@@ -1,4 +1,5 @@
%{
#include "wx/setup.h"
#include <string.h>
#ifdef _MSC_VER
#include <io.h>
@@ -156,7 +157,7 @@ void yyerror(char *s)
* to test
*/
#ifndef __SC__
#if !defined(__SC__) && !defined(__GNUWIN32__)
#ifdef USE_DEFINE
#ifndef yywrap
#define yywrap() 1

View File

@@ -22,6 +22,8 @@
#include "wx/defs.h"
#if wxUSE_PRINTING_ARCHITECTURE
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/dc.h"
@@ -45,20 +47,13 @@
#include <string.h>
#ifdef __WXMSW__
#include <windows.h>
#include "wx/msw/private.h"
#include <commdlg.h>
// Clash with Windows header files
#ifdef StartDoc
#undef StartDoc
#endif
#ifndef __WIN32__
#include <print.h>
#endif
#endif
// End __WXMSW__
#endif // __WXMSW__
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxPrinterBase, wxObject)
@@ -763,3 +758,4 @@ void wxPrintPreviewBase::SetZoom(int percent)
}
}
#endif // wxUSE_PRINTING_ARCHITECTURE

View File

@@ -20,6 +20,8 @@
#pragma hdrstop
#endif
#if wxUSE_CONSTRAINTS
#ifndef WX_PRECOMP
#include <stdio.h>
#include "wx/utils.h"
@@ -358,4 +360,5 @@ void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
EndModal(wxID_OK);
}
#endif // wxUSE_CONSTRAINTS

View File

@@ -19,7 +19,6 @@ EXTRA_LTLIBRARIES = libwx_gtk.la libwx_motif.la libwx_msw.la
# these are the common files which always make part of the library
libwx_msw_la_SOURCES = \
\
winestub.c \
extended.c \
parser.c \
\
@@ -178,12 +177,14 @@ libwx_msw_la_SOURCES = \
# don't know where to put lexer.l - if I put it in the sources too,
# automake tries to build lexer.lo... and fails, of course. (VZ)
BUILT_SOURCES = parser.c lexer.c
# VZ: can anyone please explain me why are we doing these substitutions?
parser.c: $(srcdir)/../common/parser.y lexer.c
$(YACC) $(srcdir)/../common/parser.y
@sed -e "s;$(srcdir)/../common/y.tab.c;parser.y;g" < y.tab.c | \
sed -e "s/BUFSIZ/5000/g" | \
sed -e "s/YYLMAX 200/YYLMAX 5000/g" | \
sed -e "s/yy/PROIO_yy/g" | \
sed -e "s/yy\([^.]\)/PROIO_yy\1/g" | \
sed -e "s/input/PROIO_input/g" | \
sed -e "s/unput/PROIO_unput/g" > parser.c
@$(RM) y.tab.c
@@ -191,13 +192,13 @@ parser.c: $(srcdir)/../common/parser.y lexer.c
lexer.c: $(srcdir)/../common/lexer.l
$(LEX) $(srcdir)/../common/lexer.l
@sed -e "s;$(srcdir)/../common/lex.yy.c;lexer.l;g" < lex.yy.c | \
sed -e "s/yy/PROIO_yy/g" | \
sed -e "s/yy\([^.]\)/PROIO_yy\1/g" | \
sed -e "s/input/PROIO_input/g" | \
sed -e "s/unput/PROIO_unput/g" > lexer.c
@$(RM) lex.yy.c
libwx_msw_la_LDFLAGS = -rpath @libdir@ \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE)
-release $(LT_RELEASE) -no-undefined
libwx_msw_la_LIBADD = $(LTLIBOBJS)
libwx_msw_la_DEPENDENCIES = $(libwx_msw_la_LIBADD) lexer.l parser.y

View File

@@ -346,6 +346,7 @@ void wxFrame::SetIcon(const wxIcon& icon)
#endif
}
#if wxUSE_STATUSBAR
wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
const wxString& name)
{
@@ -430,6 +431,7 @@ void wxFrame::PositionStatusBar()
m_frameStatusBar->SetSize(0, h, w, sh);
}
}
#endif // wxUSE_STATUSBAR
void wxFrame::SetMenuBar(wxMenuBar *menu_bar)
{
@@ -571,13 +573,19 @@ void wxFrame::OnSize(wxSizeEvent& event)
// do we have _exactly_ one child?
wxWindow *child = NULL;
for ( wxNode *node = GetChildren().First(); node; node = node->Next() )
for ( wxWindowList::Node *node = GetChildren().GetFirst();
node;
node = node->GetNext() )
{
wxWindow *win = (wxWindow *)node->Data();
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
!win->IsKindOf(CLASSINFO(wxDialog)) &&
(win != GetStatusBar()) &&
(win != GetToolBar()) )
wxWindow *win = node->GetData();
if ( !win->IsTopLevel()
#if wxUSE_STATUSBAR
&& (win != GetStatusBar())
#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
&& (win != GetToolBar())
#endif // wxUSE_TOOLBAR
)
{
if ( child )
return; // it's our second subwindow - nothing to do
@@ -720,6 +728,7 @@ void wxFrame::ClientToScreen(int *x, int *y) const
wxWindow::ClientToScreen(x, y);
}
#if wxUSE_TOOLBAR
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{
wxCHECK_MSG( m_frameToolBar == NULL, FALSE,
@@ -772,6 +781,7 @@ void wxFrame::PositionToolBar()
}
}
}
#endif // wxUSE_TOOLBAR
// propagate our state change to all child frames: this allows us to emulate X
// Windows behaviour where child frames float independently of the parent one

View File

@@ -146,6 +146,7 @@ void wxMenu::Append(wxMenuItem *pItem)
{
wxCHECK_RET( pItem != NULL, "can't append NULL item to the menu" );
#if wxUSE_ACCEL
// check for accelerators: they are given after '\t'
wxString label = pItem->GetName();
int posTab = label.Find('\t');
@@ -206,6 +207,7 @@ void wxMenu::Append(wxMenuItem *pItem)
m_accelIds.Add(pItem->GetId());
}
}
#endif // wxUSE_ACCEL
UINT flags = 0;
@@ -344,6 +346,8 @@ void wxMenu::Delete(int id)
delete item;
}
#if wxUSE_ACCEL
// ---------------------------------------------------------------------------
// accelerator helpers
// ---------------------------------------------------------------------------
@@ -361,6 +365,8 @@ size_t wxMenu::CopyAccels(wxAcceleratorEntry *accels) const
return count;
}
#endif // wxUSE_ACCEL
// ---------------------------------------------------------------------------
// wxMenu functions implemented in wxMenuItem
// ---------------------------------------------------------------------------
@@ -1014,6 +1020,7 @@ void wxMenuBar::Attach(wxFrame *frame)
m_menuBarFrame = frame;
#if wxUSE_ACCEL
// create the accel table - we consider that the menubar construction is
// finished
size_t nAccelCount = 0;
@@ -1037,6 +1044,7 @@ void wxMenuBar::Attach(wxFrame *frame)
delete [] accelEntries;
}
#endif // wxUSE_ACCEL
}
// ---------------------------------------------------------------------------