Removed DrawOpenSpline since it doesn't seem to be needed, with required changes

in all ports. Added Motif wxFileDialog. Added wxPostScriptModule and removed
PostScript init in app.cpp. Also removed wxMessageBox function from
generic implementation. Windows release .exes are now smaller (< 300K for minimal.exe).
Some OGL updates. __try -> try in MSW main.cpp. BC++ 5 fixes.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-10-02 12:50:01 +00:00
parent 9c039d08bf
commit dfad059924
56 changed files with 825 additions and 368 deletions

View File

@@ -179,6 +179,24 @@ bool wxConfigBase::Read(const wxString& key, bool* val, bool defVal) const
}
// Convenience functions
bool wxConfigBase::Read(const wxString& key, int *pi) const
{
long l;
bool ret = Read(key, &l);
if (ret)
*pi = (int) l;
return ret;
}
bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const
{
long l;
bool ret = Read(key, &l, (long) defVal);
*pi = (int) l;
return ret;
}
bool wxConfigBase::Write(const wxString& key, double val)
{
wxString str;

View File

@@ -859,7 +859,7 @@ wxFileConfig::LineList *wxFileConfig::ConfigGroup::GetGroupLine()
// this group wasn't present in local config file, add it now
if ( pParent != NULL ) {
wxString strFullName;
strFullName << "[" << GetFullName().c_str() + 1 << "]"; // +1: no '/'
strFullName << "[" << (GetFullName().c_str() + 1) << "]"; // +1: no '/'
m_pLine = m_pConfig->LineListInsert(strFullName,
pParent->GetLastGroupLine());
pParent->SetLastGroup(this); // we're surely after all the others

View File

@@ -294,7 +294,7 @@ void wxPostScriptDC::SetClippingRegion (long cx, long cy, long cw, long ch)
*m_pstream << "gsave\n";
*m_pstream << "newpath\n";
*m_pstream << cx << " " << YSCALE (cy) << " moveto\n";
*m_pstream << cx + cw << " " << YSCALE (cy) << " lineto\n";
*m_pstream << (cx + cw) << " " << YSCALE (cy) << " lineto\n";
*m_pstream << cx + cw << " " << YSCALE (cy + ch) << " lineto\n";
*m_pstream << cx << " " << YSCALE (cy + ch) << " lineto\n";
*m_pstream << "closepath clip newpath\n";
@@ -415,8 +415,8 @@ void wxPostScriptDC::DrawEllipticArc(long x,long y,long w,long h,double sa,doubl
*m_pstream <<
"newpath\n" <<
x+w/2 << " " << YSCALE (y+h/2) << " " <<
w/2 << " " << h/2 << " " <<
(x+w/2) << " " << YSCALE (y+h/2) << " " <<
w/2 << " " << (h/2) << " " <<
int(sa) <<" "<< int(ea)<<" true ellipticarc\n";
CalcBoundingBox (x , (long)YSCALE (y ));
@@ -428,8 +428,8 @@ void wxPostScriptDC::DrawEllipticArc(long x,long y,long w,long h,double sa,doubl
*m_pstream <<
"newpath\n" <<
x+w/2 << " " << YSCALE (y+h/2) << " " <<
w/2 << " " << h/2 << " " <<
(x+w/2) << " " << YSCALE (y+h/2) << " " <<
(w/2) << " " << (h/2) << " " <<
int(sa) <<" "<< int(ea)<<" false ellipticarc\n";
CalcBoundingBox (x , (long)YSCALE (y ));
@@ -545,8 +545,8 @@ void wxPostScriptDC::DrawRectangle (long x, long y, long width, long height)
*m_pstream << "newpath\n";
*m_pstream << x << " " << YSCALE (y) << " moveto\n";
*m_pstream << x + width << " " << YSCALE (y) << " lineto\n";
*m_pstream << x + width << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << (x + width) << " " << YSCALE (y) << " lineto\n";
*m_pstream << (x + width) << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << x << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << "closepath\n";
*m_pstream << "fill\n";
@@ -560,8 +560,8 @@ void wxPostScriptDC::DrawRectangle (long x, long y, long width, long height)
*m_pstream << "newpath\n";
*m_pstream << x << " " << YSCALE (y) << " moveto\n";
*m_pstream << x + width << " " << YSCALE (y) << " lineto\n";
*m_pstream << x + width << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << (x + width) << " " << YSCALE (y) << " lineto\n";
*m_pstream << (x + width) << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << x << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << "closepath\n";
*m_pstream << "stroke\n";
@@ -593,19 +593,19 @@ void wxPostScriptDC::DrawRoundedRectangle (long x, long y, long width, long heig
SetBrush (m_brush);
// Draw rectangle anticlockwise
*m_pstream << "newpath\n";
*m_pstream << x + radius << " " << YSCALE (y + radius) << " " << radius << " 90 180 arc\n";
*m_pstream << (x + radius) << " " << YSCALE (y + radius) << " " << radius << " 90 180 arc\n";
*m_pstream << x << " " << YSCALE (y + radius) << " moveto\n";
*m_pstream << x + radius << " " << YSCALE (y + height - radius) << " " << radius << " 180 270 arc\n";
*m_pstream << x + width - radius << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << (x + radius) << " " << YSCALE (y + height - radius) << " " << radius << " 180 270 arc\n";
*m_pstream << (x + width - radius) << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << x + width - radius << " " << YSCALE (y + height - radius) << " " << radius << " 270 0 arc\n";
*m_pstream << x + width << " " << YSCALE (y + radius) << " lineto\n";
*m_pstream << (x + width - radius) << " " << YSCALE (y + height - radius) << " " << radius << " 270 0 arc\n";
*m_pstream << (x + width) << " " << YSCALE (y + radius) << " lineto\n";
*m_pstream << x + width - radius << " " << YSCALE (y + radius) << " " << radius << " 0 90 arc\n";
*m_pstream << (x + width - radius) << " " << YSCALE (y + radius) << " " << radius << " 0 90 arc\n";
*m_pstream << x + radius << " " << YSCALE (y) << " lineto\n";
*m_pstream << (x + radius) << " " << YSCALE (y) << " lineto\n";
*m_pstream << "closepath\n";
@@ -619,19 +619,19 @@ void wxPostScriptDC::DrawRoundedRectangle (long x, long y, long width, long heig
SetPen (m_pen);
// Draw rectangle anticlockwise
*m_pstream << "newpath\n";
*m_pstream << x + radius << " " << YSCALE (y + radius) << " " << radius << " 90 180 arc\n";
*m_pstream << (x + radius) << " " << YSCALE (y + radius) << " " << radius << " 90 180 arc\n";
*m_pstream << x << " " << YSCALE (y + height - radius) << " lineto\n";
*m_pstream << x + radius << " " << YSCALE (y + height - radius) << " " << radius << " 180 270 arc\n";
*m_pstream << x + width - radius << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << (x + radius) << " " << YSCALE (y + height - radius) << " " << radius << " 180 270 arc\n";
*m_pstream << (x + width - radius) << " " << YSCALE (y + height) << " lineto\n";
*m_pstream << x + width - radius << " " << YSCALE (y + height - radius) << " " << radius << " 270 0 arc\n";
*m_pstream << x + width << " " << YSCALE (y + radius) << " lineto\n";
*m_pstream << (x + width - radius) << " " << YSCALE (y + height - radius) << " " << radius << " 270 0 arc\n";
*m_pstream << (x + width) << " " << YSCALE (y + radius) << " lineto\n";
*m_pstream << x + width - radius << " " << YSCALE (y + radius) << " " << radius << " 0 90 arc\n";
*m_pstream << (x + width - radius) << " " << YSCALE (y + radius) << " " << radius << " 0 90 arc\n";
*m_pstream << x + radius << " " << YSCALE (y) << " lineto\n";
*m_pstream << (x + radius) << " " << YSCALE (y) << " lineto\n";
*m_pstream << "closepath\n";
@@ -651,8 +651,8 @@ void wxPostScriptDC::DrawEllipse (long x, long y, long width, long height)
SetBrush (m_brush);
*m_pstream << "newpath\n";
*m_pstream << x + width / 2 << " " << YSCALE (y + height / 2) << " ";
*m_pstream << width / 2 << " " << height / 2 << " 0 360 ellipse\n";
*m_pstream << (x + width / 2) << " " << YSCALE (y + height / 2) << " ";
*m_pstream << (width / 2) << " " << (height / 2) << " 0 360 ellipse\n";
*m_pstream << "fill\n";
CalcBoundingBox (x - width, (long)YSCALE (y - height));
@@ -663,8 +663,8 @@ void wxPostScriptDC::DrawEllipse (long x, long y, long width, long height)
SetPen (m_pen);
*m_pstream << "newpath\n";
*m_pstream << x + width / 2 << " " << YSCALE (y + height / 2) << " ";
*m_pstream << width / 2 << " " << height / 2 << " 0 360 ellipse\n";
*m_pstream << (x + width / 2) << " " << YSCALE (y + height / 2) << " ";
*m_pstream << (width / 2) << " " << (height / 2) << " 0 360 ellipse\n";
*m_pstream << "stroke\n";
CalcBoundingBox (x - width, (long)YSCALE (y - height));
@@ -767,7 +767,7 @@ void wxPostScriptDC::SetFont (const wxFont& the_font)
strcpy (buf, name);
strcat (buf, style);
*m_pstream << buf << " findfont\n";
*m_pstream << m_font.GetPointSize() * m_scaleFactor << " scalefont setfont\n";
*m_pstream << (m_font.GetPointSize() * m_scaleFactor) << " scalefont setfont\n";
}
void wxPostScriptDC::SetPen (const wxPen& pen)
@@ -976,7 +976,7 @@ void wxPostScriptDC::DrawText (const wxString& text, long x, long y, bool WXUNUS
*m_pstream << "gsave " << x << " " << YSCALE (y + size - UnderlinePosition)
<< " moveto\n"
<< UnderlineThickness << " setlinewidth "
<< x + w << " " << YSCALE (y + size - UnderlinePosition)
<< (x + w) << " " << YSCALE (y + size - UnderlinePosition)
<< " lineto stroke grestore\n";
}
@@ -1216,7 +1216,7 @@ void wxPostScriptDC::EndDoc (void)
*m_pstream << "%%BoundingBox: "
<< floor((double)llx) << " " << floor((double)lly) << " "
<< ceil((double)urx) << " " << ceil((double)ury) << "\n";
*m_pstream << "%%Pages: " << wxPageNumber - 1 << "\n";
*m_pstream << "%%Pages: " << (wxPageNumber - 1) << "\n";
*m_pstream << "%%EndComments\n\n";
// To check the correctness of the bounding box, postscript commands
@@ -1322,7 +1322,7 @@ void wxPostScriptDC::StartPage (void)
{
if (!m_pstream)
return;
*m_pstream << "%%Page: " << wxPageNumber++ << "\n";
*m_pstream << "%%Page: " << (wxPageNumber++) << "\n";
// *m_pstream << "matrix currentmatrix\n";
// Added by Chris Breeze
@@ -1403,8 +1403,6 @@ void wxPostScriptDC::EndPage (void)
#endif
}
/* MATTHEW: Implement Blit: */
/* MATTHEW: [4] Re-wrote to use colormap */
bool wxPostScriptDC::
Blit (long xdest, long ydest, long fwidth, long fheight,
wxDC *source, long xsrc, long ysrc, int WXUNUSED(rop), bool WXUNUSED(useMask))
@@ -1820,7 +1818,7 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
#endif
}
void wxPostScriptDC::DrawOpenSpline( wxList *points )
void wxPostScriptDC::DrawSpline( wxList *points )
{
double a, b, c, d, x1, y1, x2, y2, x3, y3;
wxPoint *p, *q;
@@ -1836,7 +1834,7 @@ void wxPostScriptDC::DrawOpenSpline( wxList *points )
x3 = a = (double)(x1 + c) / 2;
y3 = b = (double)(y1 + d) / 2;
*(GetStream()) << "newpath " << x1 << " " << GetYOrigin() - y1 << " moveto " << x3 << " " << GetYOrigin() - y3;
*(GetStream()) << "newpath " << x1 << " " << (GetYOrigin() - y1) << " moveto " << x3 << " " << (GetYOrigin() - y3);
*(GetStream()) << " lineto\n";
CalcBoundingBox( (long)x1, (long)(GetYOrigin() - y1));
CalcBoundingBox( (long)x3, (long)(GetYOrigin() - y3));
@@ -1850,8 +1848,8 @@ void wxPostScriptDC::DrawOpenSpline( wxList *points )
c = q->x; d = q->y;
x3 = (double)(x2 + c) / 2;
y3 = (double)(y2 + d) / 2;
*(GetStream()) << x1 << " " << GetYOrigin() - y1 << " " << x2 << " " << GetYOrigin() - y2 << " ";
*(GetStream()) << x3 << " " << GetYOrigin() - y3 << " DrawSplineSection\n";
*(GetStream()) << x1 << " " << (GetYOrigin() - y1) << " " << x2 << " " << (GetYOrigin() - y2) << " ";
*(GetStream()) << x3 << " " << (GetYOrigin() - y3) << " DrawSplineSection\n";
CalcBoundingBox( (long)x1, (long)(GetYOrigin() - y1));
CalcBoundingBox( (long)x3, (long)(GetYOrigin() - y3));
@@ -1860,7 +1858,7 @@ void wxPostScriptDC::DrawOpenSpline( wxList *points )
* At this point, (x2,y2) and (c,d) are the position of the
* next-to-last and last point respectively, in the point list
*/
*(GetStream()) << c << " " << GetYOrigin() - d << " lineto stroke\n";
*(GetStream()) << c << " " << (GetYOrigin() - d) << " lineto stroke\n";
}
long wxPostScriptDC::GetCharWidth (void)
@@ -2586,4 +2584,25 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name)
return (wxPrintPaperType *) NULL;
}
/*
* Initialization/cleanup module
*/
bool wxPostScriptModule::OnInit()
{
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
return TRUE;
}
void wxPostScriptModule::OnExit()
{
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
}
#endif

View File

@@ -26,6 +26,8 @@
#include "wx/window.h"
#include "wx/menu.h"
#include "wx/frame.h"
#include "wx/msgdlg.h"
#include "wx/textdlg.h"
#endif
#if wxUSE_IOSTREAMH
@@ -740,3 +742,44 @@ whereami(name)
#endif
/*
* N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp
* since otherwise the generic code may be pulled in unnecessarily.
*/
int wxMessageBox(const wxString& message, const wxString& caption, long style,
wxWindow *parent, int WXUNUSED(x), int WXUNUSED(y) )
{
wxMessageDialog dialog(parent, message, caption, style);
int ans = dialog.ShowModal();
switch ( ans )
{
case wxID_OK:
return wxOK;
break;
case wxID_YES:
return wxYES;
break;
case wxID_NO:
return wxNO;
break;
default:
case wxID_CANCEL:
return wxCANCEL;
break;
}
return ans;
}
wxString wxGetTextFromUser(const wxString& message, const wxString& caption,
const wxString& defaultValue, wxWindow *parent,
int x, int y, bool WXUNUSED(centre) )
{
wxTextEntryDialog dialog(parent, message, caption, defaultValue, wxOK|wxCANCEL, wxPoint(x, y));
if (dialog.ShowModal() == wxID_OK)
return dialog.GetValue();
else
return wxString("");
}

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: choicesg.cpp
// Name: choicdgg.cpp
// Purpose: Choice dialogs
// Author: Julian Smart
// Modified by:
@@ -33,7 +33,38 @@
#include "wx/generic/choicdgg.h"
extern void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer);
// Split message, using constraints to position controls
static void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer)
{
char *copyMessage = copystring(message);
size_t i = 0;
size_t len = strlen(copyMessage);
char *currentMessage = copyMessage;
// wxWindow *lastWindow = parent;
while (i < len) {
while ((i < len) && (copyMessage[i] != '\n')) i++;
if (i < len) copyMessage[i] = 0;
wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
/*
wxLayoutConstraints *c = new wxLayoutConstraints;
c->left.SameAs (parent, wxLeft, 10);
c->top.SameAs (lastWindow, wxBottom, 5);
c->right.AsIs ();
c->height.AsIs ();
mess->SetConstraints(c);
*/
sizer->AddSizerChild(mess);
messageList->Append(mess);
currentMessage = copyMessage + i + 1;
}
delete[] copyMessage;
}
wxString wxGetSingleChoice( const wxString& message, const wxString& caption, int n,
const wxString *choices, wxWindow *parent,

View File

@@ -179,28 +179,3 @@ void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
}
int wxMessageBox(const wxString& message, const wxString& caption, long style,
wxWindow *parent, int WXUNUSED(x), int WXUNUSED(y) )
{
wxMessageDialog dialog(parent, message, caption, style);
int ans = dialog.ShowModal();
switch ( ans )
{
case wxID_OK:
return wxOK;
break;
case wxID_YES:
return wxYES;
break;
case wxID_NO:
return wxNO;
break;
default:
case wxID_CANCEL:
return wxCANCEL;
break;
}
return ans;
}

View File

@@ -44,7 +44,38 @@ END_EVENT_TABLE()
IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
#endif
extern void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer);
// Split message, using constraints to position controls
static void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer)
{
char *copyMessage = copystring(message);
size_t i = 0;
size_t len = strlen(copyMessage);
char *currentMessage = copyMessage;
// wxWindow *lastWindow = parent;
while (i < len) {
while ((i < len) && (copyMessage[i] != '\n')) i++;
if (i < len) copyMessage[i] = 0;
wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
/*
wxLayoutConstraints *c = new wxLayoutConstraints;
c->left.SameAs (parent, wxLeft, 10);
c->top.SameAs (lastWindow, wxBottom, 5);
c->right.AsIs ();
c->height.AsIs ();
mess->SetConstraints(c);
*/
sizer->AddSizerChild(mess);
messageList->Append(mess);
currentMessage = copyMessage + i + 1;
}
delete[] copyMessage;
}
wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption,
const wxString& value, long style, const wxPoint& pos):
@@ -128,13 +159,3 @@ void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) )
EndModal(wxID_OK);
}
wxString wxGetTextFromUser(const wxString& message, const wxString& caption,
const wxString& defaultValue, wxWindow *parent,
int x, int y, bool WXUNUSED(centre) )
{
wxTextEntryDialog dialog(parent, message, caption, defaultValue, wxOK|wxCANCEL, wxPoint(x, y));
if (dialog.ShowModal() == wxID_OK)
return dialog.GetValue();
else
return wxString("");
}

View File

@@ -15,7 +15,6 @@
#include "wx/app.h"
#include "wx/gdicmn.h"
#include "wx/utils.h"
#include "wx/postscrp.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/memory.h"
@@ -263,9 +262,11 @@ void wxApp::CommonInit(void)
// For PostScript printing
#if wxUSE_POSTSCRIPT
/* Now done in wxPostScriptModule
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
*/
#endif
@@ -279,8 +280,10 @@ void wxApp::CommonInit(void)
void wxApp::CommonCleanUp(void)
{
wxDELETE(wxTheColourDatabase);
/* Now done in wxPostScriptModule
wxDELETE(wxThePrintPaperDatabase);
wxDELETE(wxThePrintSetupData);
*/
wxDELETE(wxTheFontNameDirectory);
wxDeleteStockObjects();

View File

@@ -151,11 +151,6 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
}
}
void wxDC::DrawSpline( wxList *points )
{
DrawOpenSpline( points );
}
void wxDC::DrawSpline( int n, wxPoint points[] )
{
wxList list;

View File

@@ -1013,7 +1013,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
}
}
void wxPaintDC::DrawOpenSpline( wxList *points )
void wxPaintDC::DrawSpline( wxList *points )
{
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;

View File

@@ -15,7 +15,6 @@
#include "wx/app.h"
#include "wx/gdicmn.h"
#include "wx/utils.h"
#include "wx/postscrp.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/memory.h"
@@ -263,9 +262,11 @@ void wxApp::CommonInit(void)
// For PostScript printing
#if wxUSE_POSTSCRIPT
/* Now done in wxPostScriptModule
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
*/
#endif
@@ -279,8 +280,10 @@ void wxApp::CommonInit(void)
void wxApp::CommonCleanUp(void)
{
wxDELETE(wxTheColourDatabase);
/* Now done in wxPostScriptModule
wxDELETE(wxThePrintPaperDatabase);
wxDELETE(wxThePrintSetupData);
*/
wxDELETE(wxTheFontNameDirectory);
wxDeleteStockObjects();

View File

@@ -151,11 +151,6 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
}
}
void wxDC::DrawSpline( wxList *points )
{
DrawOpenSpline( points );
}
void wxDC::DrawSpline( int n, wxPoint points[] )
{
wxList list;

View File

@@ -1013,7 +1013,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
}
}
void wxPaintDC::DrawOpenSpline( wxList *points )
void wxPaintDC::DrawSpline( wxList *points )
{
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;

View File

@@ -33,10 +33,6 @@
#include "wx/resource.h"
#endif
#if wxUSE_POSTSCRIPT
#include "wx/postscrp.h"
#endif
#include <Xm/Xm.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -91,9 +87,11 @@ bool wxApp::Initialize()
// For PostScript printing
#if wxUSE_POSTSCRIPT
/* Done using wxModule now
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
*/
#endif
wxBitmap::InitStandardHandlers();
@@ -137,9 +135,11 @@ void wxApp::CleanUp()
wxTheColourDatabase = NULL;
#if wxUSE_POSTSCRIPT
/* Done using wxModule now
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
*/
#endif
wxBitmap::CleanUpHandlers();

View File

@@ -147,11 +147,6 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
};
};
void wxDC::DrawSpline( wxList *points )
{
DrawOpenSpline( points );
};
void wxDC::DrawSpline( int n, wxPoint points[] )
{
wxList list;

View File

@@ -2174,7 +2174,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
}
}
void wxWindowDC::DrawOpenSpline( wxList *points )
void wxWindowDC::DrawSpline( wxList *points )
{
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;

View File

@@ -164,7 +164,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
// Can't remember what this was about... but I think it's necessary.
if (USE_INVISIBLE_RESIZE)
if (wxUSE_INVISIBLE_RESIZE)
{
if (pos.x > -1)
XtVaSetValues(dialogShell, XmNx, pos.x,
@@ -216,10 +216,10 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
// Positioning of the dialog doesn't work properly unless the dialog
// is managed, so we manage without mapping to the screen.
// To show, we map the shell (actually it's parent).
if (!USE_INVISIBLE_RESIZE)
if (!wxUSE_INVISIBLE_RESIZE)
XtVaSetValues(shell, XmNmappedWhenManaged, FALSE, NULL);
if (!USE_INVISIBLE_RESIZE)
if (!wxUSE_INVISIBLE_RESIZE)
{
XtManageChild(dialogShell);
SetSize(pos.x, pos.y, size.x, size.y);
@@ -252,7 +252,7 @@ void wxDialog::SetModal(bool flag)
wxDialog::~wxDialog()
{
m_modalShowing = FALSE;
if (!USE_INVISIBLE_RESIZE && m_mainWidget)
if (!wxUSE_INVISIBLE_RESIZE && m_mainWidget)
{
XtUnmapWidget((Widget) m_mainWidget);
}
@@ -426,7 +426,7 @@ bool wxDialog::Show(bool show)
if (show)
{
if (!USE_INVISIBLE_RESIZE)
if (!wxUSE_INVISIBLE_RESIZE)
XtMapWidget(XtParent((Widget) m_mainWidget));
else
XtManageChild((Widget) m_mainWidget) ;
@@ -436,7 +436,7 @@ bool wxDialog::Show(bool show)
}
else
{
if (!USE_INVISIBLE_RESIZE)
if (!wxUSE_INVISIBLE_RESIZE)
XtUnmapWidget(XtParent((Widget) m_mainWidget));
else
XtUnmanageChild((Widget) m_mainWidget) ;

View File

@@ -18,13 +18,31 @@
#include "wx/dialog.h"
#include "wx/filedlg.h"
#include "wx/intl.h"
#include "wx/app.h"
#include <Xm/Xm.h>
#include <Xm/MwmUtil.h>
#include <Xm/Label.h>
#include <Xm/BulletinB.h>
#include <Xm/Frame.h>
#include <Xm/Text.h>
#include <Xm/DialogS.h>
#include <Xm/FileSB.h>
#include <Xm/RowColumn.h>
#include <Xm/LabelG.h>
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
#endif
#define DEFAULT_FILE_SELECTOR_SIZE 0
// Let Motif defines the size of File
// Selector Box (if 1), or fix it to
// wxFSB_WIDTH x wxFSB_HEIGHT (if 0)
#define wxFSB_WIDTH 600
#define wxFSB_HEIGHT 500
char *wxFileSelector(const char *title,
const char *defaultDir, const char *defaultFileName,
const char *defaultExtension, const char *filter, int flags,
@@ -86,104 +104,105 @@ char *wxFileSelectorEx(const char *title,
return NULL;
}
// TODO: Motif file selector code
#if 0
char *wxFileSelectorAnswer = NULL;
Bool wxFileSelectorReturned = FALSE;
wxString wxFileDialog::m_fileSelectorAnswer = "";
bool wxFileDialog::m_fileSelectorReturned = FALSE;
void wxFileSelCancel(Widget fs, XtPointer client_data, XmFileSelectionBoxCallbackStruct *cbs)
{
wxFileSelectorAnswer = NULL;
wxFileSelectorReturned = TRUE;
wxFileDialog::m_fileSelectorAnswer = "";
wxFileDialog::m_fileSelectorReturned = TRUE;
}
void wxFileSelOk(Widget fs, XtPointer client_data, XmFileSelectionBoxCallbackStruct *cbs)
{
char *filename = NULL;
if (!XmStringGetLtoR(cbs->value, XmSTRING_DEFAULT_CHARSET, &filename)) {
wxFileSelectorAnswer = NULL;
wxFileSelectorReturned = TRUE;
wxFileDialog::m_fileSelectorAnswer = "";
wxFileDialog::m_fileSelectorReturned = TRUE;
} else {
if (filename) {
if (wxFileSelectorAnswer) delete[] wxFileSelectorAnswer;
wxFileSelectorAnswer = copystring(filename);
wxFileDialog::m_fileSelectorAnswer = filename;
XtFree(filename);
}
wxFileSelectorReturned = TRUE;
wxFileDialog::m_fileSelectorReturned = TRUE;
}
}
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
long style, const wxPoint& pos)
{
m_message = message;
m_dialogStyle = style;
m_parent = parent;
m_path = "";
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
m_filterIndex = 1;
m_pos = pos;
}
char *wxMotifFileSelector(char *message,
char *default_path, char *default_filename,
char *default_extension, char *wildcard, int flags,
wxWindow *parent, int x, int y)
int wxFileDialog::ShowModal()
{
wxBeginBusyCursor();
static char fileBuf[512];
Widget parentWidget = 0;
if (parent)
Widget parentWidget = (Widget) 0;
if (m_parent)
{
if (parent->IsKindOf(CLASSINFO(wxFrame)))
parentWidget = ((wxFrame *)parent)->frameShell;
else if (parent->IsKindOf(CLASSINFO(wxDialogBox)))
parentWidget = ((wxDialogBox *)parent)->dialogShell;
else
parentWidget = (Widget)parent->handle;
parentWidget = (Widget) m_parent->GetTopWidget();
}
else if (wxTheApp->wx_frame)
parentWidget = wxTheApp->wx_frame->frameShell;
else
parentWidget = (Widget) wxTheApp->GetTopLevelWidget();
Widget fileSel = XmCreateFileSelectionDialog(parentWidget, "file_selector", NULL, 0);
XtUnmanageChild(XmFileSelectionBoxGetChild(fileSel, XmDIALOG_HELP_BUTTON));
Widget shell = XtParent(fileSel);
if (message)
XtVaSetValues(shell, XmNtitle, message, NULL);
if (!m_message.IsNull())
XtVaSetValues(shell, XmNtitle, (char*) (const char*) m_message, NULL);
char *entirePath = NULL;
wxString entirePath("");
if (default_path && default_filename)
if ((m_dir != "") && (m_fileName != ""))
{
sprintf(wxBuffer, "%s/%s", default_path, default_filename);
entirePath = copystring(wxBuffer);
entirePath = m_dir + wxString("/") + m_fileName;
}
else if (default_path && !default_filename)
else if ((m_dir != "") && (m_fileName == ""))
{
sprintf(wxBuffer, "%s/", default_path);
entirePath = copystring(wxBuffer);
entirePath = m_dir + wxString("/");
}
else if ((!default_path) && default_filename)
else if ((m_dir == "") && (m_fileName != ""))
{
sprintf(wxBuffer, "%s", default_filename);
entirePath = copystring(wxBuffer);
entirePath = m_fileName;
}
if (entirePath)
if (entirePath != "")
{
Widget selectionWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_TEXT);
XmTextSetString(selectionWidget, entirePath);
delete[] entirePath;
XmTextSetString(selectionWidget, (char*) (const char*) entirePath);
}
if (wildcard)
if (m_wildCard != "")
{
if (default_path)
sprintf(wxBuffer, "%s/%s", default_path, wildcard);
wxString filter("");
if (m_dir != "")
filter = m_dir + wxString("/") + m_wildCard;
else
sprintf(wxBuffer, "%s", wildcard);
filter = m_wildCard;
Widget filterWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_FILTER_TEXT);
XmTextSetString(filterWidget, wxBuffer);
XmTextSetString(filterWidget, (char*) (const char*) filter);
XmFileSelectionDoSearch(fileSel, NULL);
}
// Suggested by Terry Gitnick, 16/9/97, because of change in Motif
// file selector on Solaris 1.5.1.
if ( default_path )
if ( m_dir != "" )
{
XmString thePath = XmStringCreateLtoR (default_path,
XmString thePath = XmStringCreateLtoR ((char*) (const char*) m_dir,
XmSTRING_DEFAULT_CHARSET);
XtVaSetValues (fileSel,
@@ -214,24 +233,20 @@ char *wxMotifFileSelector(char *message,
XtManageChild(fileSel);
if (wxFileSelectorAnswer)
delete[] wxFileSelectorAnswer;
wxFileSelectorAnswer = NULL;
wxFileSelectorReturned = FALSE;
m_fileSelectorAnswer = "";
m_fileSelectorReturned = FALSE;
wxEndBusyCursor();
XtAddGrab(XtParent(fileSel), TRUE, FALSE);
XEvent event;
while (!wxFileSelectorReturned)
while (!m_fileSelectorReturned)
{
XtAppNextEvent(wxTheApp->appContext, &event);
XtDispatchEvent(&event);
XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
}
XtRemoveGrab(XtParent(fileSel));
XmUpdateDisplay(wxTheApp->topLevel); // Experimental
XmUpdateDisplay((Widget) wxTheApp->GetTopLevelWidget()); // Experimental
// XtDestroyWidget(fileSel);
XtUnmapWidget(XtParent(fileSel));
@@ -239,41 +254,22 @@ char *wxMotifFileSelector(char *message,
// Now process all events, because otherwise
// this might remain on the screen
XSync(XtDisplay(wxTheApp->topLevel), FALSE);
while (XtAppPending(wxTheApp->appContext))
XSync(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()), FALSE);
while (XtAppPending((XtAppContext) wxTheApp->GetAppContext()))
{
XFlush(XtDisplay(wxTheApp->topLevel));
XtAppNextEvent(wxTheApp->appContext, &event);
XFlush(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()));
XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
XtDispatchEvent(&event);
}
if (wxFileSelectorAnswer)
{
strcpy(fileBuf, wxFileSelectorAnswer);
return fileBuf;
}
else return NULL;
}
#endif
m_path = m_fileSelectorAnswer;
m_fileName = wxFileNameFromPath(m_fileSelectorAnswer);
m_dir = wxPathOnly(m_path);
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
long style, const wxPoint& pos)
{
m_message = message;
m_dialogStyle = style;
m_parent = parent;
m_path = "";
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
m_filterIndex = 1;
}
int wxFileDialog::ShowModal()
{
// TODO
if (m_fileName == "")
return wxID_CANCEL;
else
return wxID_OK;
}
// Generic file load/save dialog

View File

@@ -36,7 +36,6 @@
#endif
#include "wx/msw/private.h"
#include "wx/postscrp.h"
#include "wx/log.h"
#include "wx/module.h"
@@ -149,13 +148,6 @@ bool wxApp::Initialize()
wxInitializeResourceSystem();
#endif
// For PostScript printing
#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
#endif
wxBitmap::InitStandardHandlers();
#if defined(__WIN95__)
@@ -387,12 +379,13 @@ void wxApp::ConvertToStandardCommandArgs(char* lpCmdLine)
char* str = buf;
while (*str)
{
if ( count == WXSIZEOF(command) )
/*
if ( count == WXSIZEOF(command) )
{
wxFAIL_MSG("too many command line args.");
break;
}
*/
while ( *str && isspace(*str) ) // skip whitespace
str++;
@@ -456,12 +449,6 @@ void wxApp::CleanUp()
delete wxTheColourDatabase;
wxTheColourDatabase = NULL;
#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
#endif
wxBitmap::CleanUpHandlers();
delete[] wxBuffer;
@@ -525,7 +512,7 @@ int wxEntry(WXHINSTANCE hInstance,
bool enterLoop)
{
#ifndef __WXDEBUG__ // take everything into a try-except block in release build
__try {
try {
#endif
wxhInstance = (HINSTANCE) hInstance;
@@ -606,7 +593,7 @@ int wxEntry(WXHINSTANCE hInstance,
return retValue;
#ifndef __WXDEBUG__ // catch exceptions only in release build
}
__except ( EXCEPTION_EXECUTE_HANDLER ) {
except ( EXCEPTION_EXECUTE_HANDLER ) {
/*
if ( wxTheApp )
wxTheApp->OnFatalException();

View File

@@ -1326,10 +1326,6 @@ void wxDC::GetSizeMM(long *width, long *height) const
*height = h;
}
#if wxUSE_SPLINES
#include "xfspline.inc"
#endif // wxUSE_SPLINES
void wxDC::DrawPolygon(wxList *list, long xoffset, long yoffset,int fillStyle)
{
int n = list->Number();
@@ -1370,34 +1366,6 @@ void wxDC::SetTextBackground(const wxColour& colour)
m_textBackgroundColour = colour;
}
#if wxUSE_SPLINES
// Make a 3-point spline
void wxDC::DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3)
{
wxList *point_list = new wxList;
wxPoint *point1 = new wxPoint;
point1->x = x1; point1->y = y1;
point_list->Append((wxObject*)point1);
wxPoint *point2 = new wxPoint;
point2->x = x2; point2->y = y2;
point_list->Append((wxObject*)point2);
wxPoint *point3 = new wxPoint;
point3->x = x3; point3->y = y3;
point_list->Append((wxObject*)point3);
DrawSpline(point_list);
for(wxNode *node = point_list->First(); node; node = node->Next()) {
wxPoint *p = (wxPoint *)node->Data();
delete p;
}
delete point_list;
}
#endif
// For use by wxWindows only, unless custom units are required.
void wxDC::SetLogicalScale(double x, double y)
{
@@ -1446,4 +1414,274 @@ int wxDC::GetDepth(void) const
return (int) ::GetDeviceCaps((HDC) m_hDC,BITSPIXEL);
}
#if wxUSE_SPLINES
// Make a 3-point spline
void wxDC::DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3)
{
wxList *point_list = new wxList;
wxPoint *point1 = new wxPoint;
point1->x = x1; point1->y = y1;
point_list->Append((wxObject*)point1);
wxPoint *point2 = new wxPoint;
point2->x = x2; point2->y = y2;
point_list->Append((wxObject*)point2);
wxPoint *point3 = new wxPoint;
point3->x = x3; point3->y = y3;
point_list->Append((wxObject*)point3);
DrawSpline(point_list);
for(wxNode *node = point_list->First(); node; node = node->Next()) {
wxPoint *p = (wxPoint *)node->Data();
delete p;
}
delete point_list;
}
////#define wx_round(a) (int)((a)+.5)
//#define wx_round(a) (a)
class wxSpline: public wxObject
{
public:
int type;
wxList *points;
wxSpline(wxList *list);
void DeletePoints(void);
// Doesn't delete points
~wxSpline(void);
};
void wxDC::DrawSpline(int n, wxPoint points[])
{
wxList list;
int i;
for (i =0; i < n; i++)
list.Append((wxObject*)&points[i]);
DrawSpline((wxList *)&list);
}
void wx_draw_open_spline(wxDC *dc, wxSpline *spline);
void wx_quadratic_spline(double a1, double b1, double a2, double b2,
double a3, double b3, double a4, double b4);
void wx_clear_stack(void);
int wx_spline_pop(double *x1, double *y1, double *x2, double *y2, double *x3,
double *y3, double *x4, double *y4);
void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3,
double x4, double y4);
static bool wx_spline_add_point(double x, double y);
static void wx_spline_draw_point_array(wxDC *dc);
wxSpline *wx_make_spline(int x1, int y1, int x2, int y2, int x3, int y3);
void wxDC::DrawSpline(wxList *list)
{
wxSpline spline(list);
wx_draw_open_spline(this, &spline);
}
wxList wx_spline_point_list;
void wx_draw_open_spline(wxDC *dc, wxSpline *spline)
{
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
double x1, y1, x2, y2;
wxNode *node = spline->points->First();
p = (wxPoint *)node->Data();
x1 = p->x;
y1 = p->y;
node = node->Next();
p = (wxPoint *)node->Data();
x2 = p->x;
y2 = p->y;
cx1 = (double)((x1 + x2) / 2);
cy1 = (double)((y1 + y2) / 2);
cx2 = (double)((cx1 + x2) / 2);
cy2 = (double)((cy1 + y2) / 2);
wx_spline_add_point(x1, y1);
while ((node = node->Next()) != NULL)
{
p = (wxPoint *)node->Data();
x1 = x2;
y1 = y2;
x2 = p->x;
y2 = p->y;
cx4 = (double)(x1 + x2) / 2;
cy4 = (double)(y1 + y2) / 2;
cx3 = (double)(x1 + cx4) / 2;
cy3 = (double)(y1 + cy4) / 2;
wx_quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
cx1 = cx4;
cy1 = cy4;
cx2 = (double)(cx1 + x2) / 2;
cy2 = (double)(cy1 + y2) / 2;
}
wx_spline_add_point((double)wx_round(cx1), (double)wx_round(cy1));
wx_spline_add_point(x2, y2);
wx_spline_draw_point_array(dc);
}
/********************* CURVES FOR SPLINES *****************************
The following spline drawing routine is from
"An Algorithm for High-Speed Curve Generation"
by George Merrill Chaikin,
Computer Graphics and Image Processing, 3, Academic Press,
1974, 346-349.
and
"On Chaikin's Algorithm" by R. F. Riesenfeld,
Computer Graphics and Image Processing, 4, Academic Press,
1975, 304-310.
***********************************************************************/
#define half(z1, z2) ((z1+z2)/2.0)
#define THRESHOLD 5
/* iterative version */
void wx_quadratic_spline(double a1, double b1, double a2, double b2, double a3, double b3, double a4,
double b4)
{
register double xmid, ymid;
double x1, y1, x2, y2, x3, y3, x4, y4;
wx_clear_stack();
wx_spline_push(a1, b1, a2, b2, a3, b3, a4, b4);
while (wx_spline_pop(&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)) {
xmid = (double)half(x2, x3);
ymid = (double)half(y2, y3);
if (fabs(x1 - xmid) < THRESHOLD && fabs(y1 - ymid) < THRESHOLD &&
fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD) {
wx_spline_add_point((double)wx_round(x1), (double)wx_round(y1));
wx_spline_add_point((double)wx_round(xmid), (double)wx_round(ymid));
} else {
wx_spline_push(xmid, ymid, (double)half(xmid, x3), (double)half(ymid, y3),
(double)half(x3, x4), (double)half(y3, y4), x4, y4);
wx_spline_push(x1, y1, (double)half(x1, x2), (double)half(y1, y2),
(double)half(x2, xmid), (double)half(y2, ymid), xmid, ymid);
}
}
}
/* utilities used by spline drawing routines */
typedef struct wx_spline_stack_struct {
double x1, y1, x2, y2, x3, y3, x4, y4;
}
Stack;
#define SPLINE_STACK_DEPTH 20
static Stack wx_spline_stack[SPLINE_STACK_DEPTH];
static Stack *wx_stack_top;
static int wx_stack_count;
void wx_clear_stack(void)
{
wx_stack_top = wx_spline_stack;
wx_stack_count = 0;
}
void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
{
wx_stack_top->x1 = x1;
wx_stack_top->y1 = y1;
wx_stack_top->x2 = x2;
wx_stack_top->y2 = y2;
wx_stack_top->x3 = x3;
wx_stack_top->y3 = y3;
wx_stack_top->x4 = x4;
wx_stack_top->y4 = y4;
wx_stack_top++;
wx_stack_count++;
}
int wx_spline_pop(double *x1, double *y1, double *x2, double *y2,
double *x3, double *y3, double *x4, double *y4)
{
if (wx_stack_count == 0)
return (0);
wx_stack_top--;
wx_stack_count--;
*x1 = wx_stack_top->x1;
*y1 = wx_stack_top->y1;
*x2 = wx_stack_top->x2;
*y2 = wx_stack_top->y2;
*x3 = wx_stack_top->x3;
*y3 = wx_stack_top->y3;
*x4 = wx_stack_top->x4;
*y4 = wx_stack_top->y4;
return (1);
}
static bool wx_spline_add_point(double x, double y)
{
wxPoint *point = new wxPoint ;
point->x = (int) x;
point->y = (int) y;
wx_spline_point_list.Append((wxObject*)point);
return TRUE;
}
static void wx_spline_draw_point_array(wxDC *dc)
{
dc->DrawLines(&wx_spline_point_list, (double)0.0, (double)0.0);
wxNode *node = wx_spline_point_list.First();
while (node)
{
wxPoint *point = (wxPoint *)node->Data();
delete point;
delete node;
node = wx_spline_point_list.First();
}
}
wxSpline::wxSpline(wxList *list)
{
points = list;
}
wxSpline::~wxSpline(void)
{
}
void wxSpline::DeletePoints(void)
{
for(wxNode *node = points->First(); node; node = points->First())
{
wxPoint *point = (wxPoint *)node->Data();
delete point;
delete node;
}
delete points;
}
#endif // wxUSE_SPLINES

View File

@@ -61,15 +61,9 @@ DOCDIR = $(WXDIR)\docs
GENERICOBJS= \
$(GENDIR)\choicdgg.obj \
$(GENDIR)\colrdlgg.obj \
$(GENDIR)\fontdlgg.obj \
$(GENDIR)\gridg.obj \
$(GENDIR)\helpxlp.obj \
$(GENDIR)\laywin.obj \
$(GENDIR)\msgdlgg.obj \
$(GENDIR)\panelg.obj \
$(GENDIR)\printps.obj \
$(GENDIR)\prntdlgg.obj \
$(GENDIR)\sashwin.obj \
$(GENDIR)\scrolwin.obj \
$(GENDIR)\splitter.obj \
@@ -77,6 +71,17 @@ GENERICOBJS= \
$(GENDIR)\tabg.obj \
$(GENDIR)\textdlgg.obj
# These are generic things that don't need to be compiled on MSW,
# but sometimes it's useful to do so for testing purposes.
NONESSENTIALOBJS= \
$(GENDIR)\printps.obj \
$(GENDIR)\prntdlgg.obj \
$(GENDIR)\msgdlgg.obj \
$(GENDIR)\helpxlp.obj \
$(GENDIR)\colrdlgg.obj \
$(GENDIR)\fontdlgg.obj \
$(COMMDIR)\postscrp.obj
COMMONOBJS = \
$(COMMDIR)\cmndata.obj \
$(COMMDIR)\config.obj \
@@ -101,7 +106,6 @@ COMMONOBJS = \
$(COMMDIR)\module.obj \
$(COMMDIR)\odbc.obj \
$(COMMDIR)\object.obj \
$(COMMDIR)\postscrp.obj \
$(COMMDIR)\prntbase.obj \
$(COMMDIR)\resource.obj \
$(COMMDIR)\tbarbase.obj \
@@ -229,6 +233,7 @@ MSWOBJS = \
$(OLEDIR)\uuid.obj
# Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
# Normal, static library

View File

@@ -383,7 +383,7 @@ void wxToolBar95::SetRows(int nRows)
wxSize wxToolBar95::GetMaxSize(void) const
{
if (m_maxWidth == -1 | m_maxHeight == -1)
if ((m_maxWidth == -1) || (m_maxHeight == -1))
{
RECT rect;
::SendMessage((HWND) GetHWND(), TB_SETROWS, MAKEWPARAM(m_maxRows, TRUE), (LPARAM) & rect);
@@ -451,7 +451,7 @@ void wxToolBar95::ClearTools(void)
wxToolBarTool *wxToolBar95::AddTool(int index, const wxBitmap& bitmap, const wxBitmap& pushedBitmap,
bool toggle, long xPos, long yPos, wxObject *clientData, const wxString& helpString1, const wxString& helpString2)
{
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, (wxBitmap *)NULL, toggle, xPos, yPos, helpString1, helpString2);
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap, toggle, xPos, yPos, helpString1, helpString2);
tool->m_clientData = clientData;
if (xPos > -1)

View File

@@ -2140,7 +2140,7 @@ void wxWindow::MSWOnLButtonDown(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVENT_TYPE_LEFT_DOWN;
@@ -2159,7 +2159,7 @@ void wxWindow::MSWOnLButtonUp(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_LEFT_UP;
@@ -2175,10 +2175,10 @@ void wxWindow::MSWOnLButtonDClick(int x, int y, WXUINT flags)
event.m_x = x; event.m_y = y;
event.m_shiftDown = ((flags & MK_SHIFT) != 0);
event.m_controlDown = ((flags & MK_CONTROL) != 0);
event.m_leftDown = ((flags & MK_LBUTTON != 0));
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_LEFT_DCLICK;
@@ -2197,7 +2197,7 @@ void wxWindow::MSWOnMButtonDown(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_MIDDLE_DOWN;
@@ -2217,7 +2217,7 @@ void wxWindow::MSWOnMButtonUp(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_MIDDLE_UP;
@@ -2236,7 +2236,7 @@ void wxWindow::MSWOnMButtonDClick(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_MIDDLE_DCLICK;
@@ -2255,7 +2255,7 @@ void wxWindow::MSWOnRButtonDown(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_RIGHT_DOWN;
@@ -2275,7 +2275,7 @@ void wxWindow::MSWOnRButtonUp(int x, int y, WXUINT flags)
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.m_eventObject = this;
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_RIGHT_UP;
@@ -2293,7 +2293,7 @@ void wxWindow::MSWOnRButtonDClick(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_RIGHT_DCLICK;
@@ -2326,7 +2326,7 @@ void wxWindow::MSWOnMouseMove(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
// Window gets a click down message followed by a mouse move
@@ -2358,7 +2358,7 @@ void wxWindow::MSWOnMouseEnter(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastEvent = wxEVT_ENTER_WINDOW;
@@ -2378,7 +2378,7 @@ void wxWindow::MSWOnMouseLeave(int x, int y, WXUINT flags)
event.m_leftDown = ((flags & MK_LBUTTON) != 0);
event.m_middleDown = ((flags & MK_MBUTTON) != 0);
event.m_rightDown = ((flags & MK_RBUTTON) != 0);
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
event.m_eventObject = this;
m_lastEvent = wxEVT_LEAVE_WINDOW;
@@ -2439,7 +2439,7 @@ void wxWindow::MSWOnChar(WXWORD wParam, WXLPARAM lParam, bool isASCII)
event.m_eventObject = this;
event.m_keyCode = id;
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
POINT pt ;
GetCursorPos(&pt) ;
@@ -2984,7 +2984,7 @@ int APIENTRY _EXPORT
event.m_shiftDown = (::GetKeyState(VK_SHIFT)&0x100?TRUE:FALSE);
event.m_controlDown = (::GetKeyState(VK_CONTROL)&0x100?TRUE:FALSE);
/* end Albert's fix for control and shift key 26.5 */
event.SetTimestamp(wxApp::sm_lastMessageTime); /* MATTHEW: timeStamp */
event.SetTimestamp(wxApp::sm_lastMessageTime);
wxWindow *win = wxGetActiveWindow();
if (win)

View File

@@ -121,7 +121,7 @@ OPTIONS=
!if "$(FINAL)" == "0"
OPT = /Od /Gy
# ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated
DEBUG_FLAGS= /Zi /D__WXDEBUG__ /DWXDEBUG=1 # /FR
DEBUG_FLAGS= /Zi /D__WXDEBUG__ /DWXDEBUG=1 /DDEBUG=1 # /FR
LINK_DEBUG_FLAGS=-debug:full -debugtype:cv # /PDB:NONE
CRTFLAG=/MD
!else
@@ -145,9 +145,9 @@ PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) /Fd$(WXDIR)\lib\wx.pdb
MAKEPRECOMP=/YcWX/WXPREC.H
!endif
CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX /DSTRICT
CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX /DSTRICT
# If you don't include wxprec.h, use CPPFLAGS2
CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX /DSTRICT
CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX /DSTRICT
LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup
DUMMY=dummy

View File

@@ -33,10 +33,6 @@
#include "wx/resource.h"
#endif
#if wxUSE_POSTSCRIPT
#include "wx/postscrp.h"
#endif
#include <string.h>
extern char *wxBuffer;
@@ -79,13 +75,6 @@ bool wxApp::Initialize()
wxInitializeResourceSystem();
#endif
// For PostScript printing
#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
#endif
wxBitmap::InitStandardHandlers();
wxModule::RegisterModules();
@@ -121,12 +110,6 @@ void wxApp::CleanUp()
delete wxTheColourDatabase;
wxTheColourDatabase = NULL;
#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
#endif
wxBitmap::CleanUpHandlers();
delete[] wxBuffer;

View File

@@ -146,11 +146,6 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
};
};
void wxDC::DrawSpline( wxList *points )
{
DrawOpenSpline( points );
};
void wxDC::DrawSpline( int n, wxPoint points[] )
{
wxList list;

View File

@@ -569,7 +569,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
}
}
void wxPaintDC::DrawOpenSpline( wxList *points )
void wxPaintDC::DrawSpline( wxList *points )
{
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;

View File

@@ -124,7 +124,7 @@ void wxToolBar::ClearTools()
wxToolBarTool *wxToolBar::AddTool(int index, const wxBitmap& bitmap, const wxBitmap& pushedBitmap,
bool toggle, long xPos, long yPos, wxObject *clientData, const wxString& helpString1, const wxString& helpString2)
{
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, (wxBitmap *)NULL, toggle, xPos, yPos, helpString1, helpString2);
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap, toggle, xPos, yPos, helpString1, helpString2);
tool->m_clientData = clientData;
if (xPos > -1)