Doc mods; fixed return non-processing problem; fixed toolbar sizing problems
(incl. MDI area clipping); put wxPrintPaperDatabase, wxPrintPaperType into prntbase.cpp since it's needed in non-PostScript WIN16 for the generic page setup dialog; corrected some 16-bit makefiles git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -429,7 +429,6 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxEvtHandler::Connect( int id, int lastId,
|
||||
wxEventType eventType,
|
||||
wxObjectEventFunction func,
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "wx/prntbase.h"
|
||||
#include "wx/dcprint.h"
|
||||
#include "wx/printdlg.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -66,6 +67,7 @@ IMPLEMENT_CLASS(wxPreviewCanvas, wxWindow)
|
||||
IMPLEMENT_CLASS(wxPreviewControlBar, wxWindow)
|
||||
IMPLEMENT_CLASS(wxPreviewFrame, wxFrame)
|
||||
IMPLEMENT_CLASS(wxPrintPreviewBase, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxPrintAbortDialog, wxDialog)
|
||||
EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel)
|
||||
@@ -758,3 +760,121 @@ void wxPrintPreviewBase::SetZoom(int percent)
|
||||
m_previewCanvas->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Paper size database for PostScript or where the generic page setup dialog is
|
||||
* needed
|
||||
*/
|
||||
|
||||
wxPrintPaperType::wxPrintPaperType(const char *name, int wmm, int hmm, int wp, int hp)
|
||||
{
|
||||
widthMM = wmm;
|
||||
heightMM = hmm;
|
||||
widthPixels = wp;
|
||||
heightPixels = hp;
|
||||
pageName = copystring(name);
|
||||
}
|
||||
|
||||
wxPrintPaperType::~wxPrintPaperType()
|
||||
{
|
||||
delete[] pageName;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print paper database for PostScript
|
||||
*/
|
||||
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase*) NULL;
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
|
||||
#endif
|
||||
|
||||
wxPrintPaperDatabase::wxPrintPaperDatabase():wxList(wxKEY_STRING)
|
||||
{
|
||||
DeleteContents(TRUE);
|
||||
}
|
||||
|
||||
wxPrintPaperDatabase::~wxPrintPaperDatabase()
|
||||
{
|
||||
}
|
||||
|
||||
void wxPrintPaperDatabase::CreateDatabase()
|
||||
{
|
||||
// Need correct values for page size in pixels.
|
||||
// Each unit is one 'point' = 1/72 of an inch.
|
||||
// NOTE: WE NEED ALSO TO MAKE ADJUSTMENTS WHEN TRANSLATING
|
||||
// in wxPostScriptDC code, so we can start from top left.
|
||||
// So access this database and translate by appropriate number
|
||||
// of points for this paper size. OR IS IT OK ALREADY?
|
||||
// Can't remember where the PostScript origin is by default.
|
||||
// Heck, someone will know how to make it hunky-dory...
|
||||
// JACS 25/5/95
|
||||
|
||||
AddPaperType(_("A4 210 x 297 mm"), 210, 297, 595, 842);
|
||||
AddPaperType(_("A3 297 x 420 mm"), 297, 420, 842, 1191);
|
||||
AddPaperType(_("Letter 8 1/2 x 11 in"), 216, 279, 612, 791);
|
||||
AddPaperType(_("Legal 8 1/2 x 14 in"), 216, 356, 612, 1009);
|
||||
|
||||
/*
|
||||
This is for 100 ppi
|
||||
|
||||
AddPaperType(_("A4 210 x 297 mm"), 210, 297, 210*4, 297*4 );
|
||||
AddPaperType(_("A3 297 x 420 mm"), 297, 420, 297*4, 420*4 );
|
||||
AddPaperType(_("Letter 8 1/2 x 11 in"), 216, 279, 216*4, 279*4 );
|
||||
AddPaperType(_("Legal 8 1/2 x 14 in"), 216, 356, 216*4, 356*4 );
|
||||
*/
|
||||
}
|
||||
|
||||
void wxPrintPaperDatabase::ClearDatabase()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
void wxPrintPaperDatabase::AddPaperType(const char *name, int wmm, int hmm, int wp, int hp)
|
||||
{
|
||||
Append(name, new wxPrintPaperType(name, wmm, hmm, wp, hp));
|
||||
}
|
||||
|
||||
wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name)
|
||||
{
|
||||
wxNode *node = Find(name);
|
||||
if (node)
|
||||
return (wxPrintPaperType *)node->Data();
|
||||
else
|
||||
return (wxPrintPaperType *) NULL;
|
||||
}
|
||||
|
||||
// A module to allow initialization/cleanup of print paper
|
||||
// things without calling these functions from app.cpp.
|
||||
|
||||
class WXDLLEXPORT wxPrintBaseModule: public wxModule
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPrintBaseModule)
|
||||
public:
|
||||
wxPrintBaseModule() {}
|
||||
bool OnInit();
|
||||
void OnExit();
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintBaseModule, wxModule)
|
||||
|
||||
/*
|
||||
* Initialization/cleanup module
|
||||
*/
|
||||
|
||||
bool wxPrintBaseModule::OnInit()
|
||||
{
|
||||
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
|
||||
wxThePrintPaperDatabase->CreateDatabase();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxPrintBaseModule::OnExit()
|
||||
{
|
||||
delete wxThePrintPaperDatabase;
|
||||
wxThePrintPaperDatabase = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -66,6 +66,7 @@ bool wxToolBarSimple::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos
|
||||
m_yMargin = 0;
|
||||
m_toolPacking = 1;
|
||||
m_toolSeparation = 5;
|
||||
SetCursor(*wxSTANDARD_CURSOR);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -134,7 +134,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
|
||||
|
||||
wxString val(control->GetValue());
|
||||
|
||||
bool ok = true;
|
||||
bool ok = TRUE;
|
||||
|
||||
// this format string should contian exactly one '%s'
|
||||
const char *errormsg = _("'%s' is invalid");
|
||||
@@ -143,37 +143,37 @@ bool wxTextValidator::Validate(wxWindow *parent)
|
||||
{
|
||||
if ( !m_includeList.Member(val) )
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
}
|
||||
}
|
||||
else if ( m_validatorStyle & wxFILTER_EXCLUDE_LIST )
|
||||
{
|
||||
if ( m_excludeList.Member(val) )
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
}
|
||||
}
|
||||
else if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() )
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
|
||||
errormsg = _("'%s' should only contain ASCII characters.");
|
||||
}
|
||||
else if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) )
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
|
||||
errormsg = _("'%s' should only contain alphabetic characters.");
|
||||
}
|
||||
else if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val))
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
|
||||
errormsg = _("'%s' should only contain alphabetic or numeric characters.");
|
||||
}
|
||||
else if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val))
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
|
||||
errormsg = _("'%s' should be numeric.");
|
||||
}
|
||||
|
@@ -203,7 +203,7 @@ IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
|
||||
|
||||
wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
|
||||
int n, const wxString *choices, char **clientData, long style, const wxPoint& pos):
|
||||
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
|
||||
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
|
||||
{
|
||||
Create(parent, message, caption, n, choices, clientData, style);
|
||||
}
|
||||
|
@@ -1837,10 +1837,8 @@ void wxPostScriptDC::GetSizeMM(long *width, long *height) const
|
||||
wxPrintSetupData *wxThePrintSetupData = (wxPrintSetupData *) NULL;
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptModule, wxModule)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
|
||||
#endif
|
||||
|
||||
// Redundant now I think
|
||||
@@ -2338,86 +2336,19 @@ void wxInitializePrintSetupData(bool init)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Paper size database for PostScript
|
||||
*/
|
||||
// A module to allow initialization/cleanup of PostScript-related
|
||||
// things without calling these functions from app.cpp.
|
||||
|
||||
wxPrintPaperType::wxPrintPaperType(const char *name, int wmm, int hmm, int wp, int hp)
|
||||
class WXDLLEXPORT wxPostScriptModule: public wxModule
|
||||
{
|
||||
widthMM = wmm;
|
||||
heightMM = hmm;
|
||||
widthPixels = wp;
|
||||
heightPixels = hp;
|
||||
pageName = copystring(name);
|
||||
}
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptModule)
|
||||
public:
|
||||
wxPostScriptModule() {}
|
||||
bool OnInit();
|
||||
void OnExit();
|
||||
};
|
||||
|
||||
wxPrintPaperType::~wxPrintPaperType()
|
||||
{
|
||||
delete[] pageName;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print paper database for PostScript
|
||||
*/
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
|
||||
#endif
|
||||
|
||||
wxPrintPaperDatabase::wxPrintPaperDatabase():wxList(wxKEY_STRING)
|
||||
{
|
||||
DeleteContents(TRUE);
|
||||
}
|
||||
|
||||
wxPrintPaperDatabase::~wxPrintPaperDatabase()
|
||||
{
|
||||
}
|
||||
|
||||
void wxPrintPaperDatabase::CreateDatabase()
|
||||
{
|
||||
// Need correct values for page size in pixels.
|
||||
// Each unit is one 'point' = 1/72 of an inch.
|
||||
// NOTE: WE NEED ALSO TO MAKE ADJUSTMENTS WHEN TRANSLATING
|
||||
// in wxPostScriptDC code, so we can start from top left.
|
||||
// So access this database and translate by appropriate number
|
||||
// of points for this paper size. OR IS IT OK ALREADY?
|
||||
// Can't remember where the PostScript origin is by default.
|
||||
// Heck, someone will know how to make it hunky-dory...
|
||||
// JACS 25/5/95
|
||||
|
||||
AddPaperType(_("A4 210 x 297 mm"), 210, 297, 595, 842);
|
||||
AddPaperType(_("A3 297 x 420 mm"), 297, 420, 842, 1191);
|
||||
AddPaperType(_("Letter 8 1/2 x 11 in"), 216, 279, 612, 791);
|
||||
AddPaperType(_("Legal 8 1/2 x 14 in"), 216, 356, 612, 1009);
|
||||
|
||||
/*
|
||||
This is for 100 ppi
|
||||
|
||||
AddPaperType(_("A4 210 x 297 mm"), 210, 297, 210*4, 297*4 );
|
||||
AddPaperType(_("A3 297 x 420 mm"), 297, 420, 297*4, 420*4 );
|
||||
AddPaperType(_("Letter 8 1/2 x 11 in"), 216, 279, 216*4, 279*4 );
|
||||
AddPaperType(_("Legal 8 1/2 x 14 in"), 216, 356, 216*4, 356*4 );
|
||||
*/
|
||||
}
|
||||
|
||||
void wxPrintPaperDatabase::ClearDatabase()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
void wxPrintPaperDatabase::AddPaperType(const char *name, int wmm, int hmm, int wp, int hp)
|
||||
{
|
||||
Append(name, new wxPrintPaperType(name, wmm, hmm, wp, hp));
|
||||
}
|
||||
|
||||
wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name)
|
||||
{
|
||||
wxNode *node = Find(name);
|
||||
if (node)
|
||||
return (wxPrintPaperType *)node->Data();
|
||||
else
|
||||
return (wxPrintPaperType *) NULL;
|
||||
}
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptModule, wxModule)
|
||||
|
||||
/*
|
||||
* Initialization/cleanup module
|
||||
@@ -2426,8 +2357,6 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name)
|
||||
bool wxPostScriptModule::OnInit()
|
||||
{
|
||||
wxInitializePrintSetupData();
|
||||
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
|
||||
wxThePrintPaperDatabase->CreateDatabase();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2435,8 +2364,6 @@ bool wxPostScriptModule::OnInit()
|
||||
void wxPostScriptModule::OnExit()
|
||||
{
|
||||
wxInitializePrintSetupData(FALSE);
|
||||
delete wxThePrintPaperDatabase;
|
||||
wxThePrintPaperDatabase = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -39,12 +39,21 @@
|
||||
#endif
|
||||
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
#include "wx/generic/dcpsg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/printdlg.h"
|
||||
|
||||
// For print paper things
|
||||
#include "wx/prntbase.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
|
||||
IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
|
||||
@@ -69,7 +78,7 @@ extern wxPrintPaperDatabase *wxThePrintPaperDatabase;
|
||||
|
||||
|
||||
wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data):
|
||||
wxDialog(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
|
||||
wxDialog(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
|
||||
{
|
||||
if ( data )
|
||||
printData = *data;
|
||||
@@ -274,7 +283,7 @@ wxDC *wxGenericPrintDialog::GetPrintDC(void)
|
||||
*/
|
||||
|
||||
wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data):
|
||||
wxDialog(parent, -1, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
|
||||
wxDialog(parent, -1, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
|
||||
{
|
||||
if ( data )
|
||||
printData = *data;
|
||||
@@ -408,6 +417,8 @@ wxChoice *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
|
||||
choice->SetSelection(sel);
|
||||
return choice;
|
||||
}
|
||||
#endif
|
||||
// wxUSE_POSTSCRIPT
|
||||
|
||||
/*
|
||||
* Generic page setup dialog
|
||||
@@ -429,33 +440,10 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
|
||||
printDialog->ShowModal();
|
||||
|
||||
printDialog->Destroy();
|
||||
|
||||
#if 0
|
||||
if (wxTheApp->GetPrintMode() == wxPRINT_POSTSCRIPT)
|
||||
{
|
||||
wxGenericPrintSetupDialog *genericPrintSetupDialog =
|
||||
new wxGenericPrintSetupDialog(this, wxThePrintSetupData);
|
||||
int ret = genericPrintSetupDialog->ShowModal();
|
||||
if (ret == wxID_OK)
|
||||
*wxThePrintSetupData = genericPrintSetupDialog->GetPrintData();
|
||||
|
||||
genericPrintSetupDialog->Close(TRUE);
|
||||
}
|
||||
#ifdef __WXMSW__
|
||||
else
|
||||
{
|
||||
wxPrintData data;
|
||||
data.SetSetupDialog(TRUE);
|
||||
wxPrintDialog printDialog(this, & data);
|
||||
printDialog.ShowModal();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
// 0
|
||||
}
|
||||
|
||||
wxGenericPageSetupDialog::wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data):
|
||||
wxDialog(parent, -1, _("Page Setup"), wxPoint(0, 0), wxSize(600, 600), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE)
|
||||
wxDialog(parent, -1, _("Page Setup"), wxPoint(0, 0), wxSize(600, 600), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL)
|
||||
{
|
||||
if ( data )
|
||||
pageData = *data;
|
||||
@@ -583,12 +571,16 @@ bool wxGenericPageSetupDialog::TransferDataFromWindow(void)
|
||||
int sel = orientationRadioBox->GetSelection();
|
||||
if (sel == 0)
|
||||
{
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxThePrintSetupData->SetPrinterOrientation(wxPORTRAIT);
|
||||
#endif
|
||||
pageData.SetOrientation(wxPORTRAIT);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxThePrintSetupData->SetPrinterOrientation(wxLANDSCAPE);
|
||||
#endif
|
||||
pageData.SetOrientation(wxLANDSCAPE);
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ static void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *
|
||||
|
||||
wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption,
|
||||
const wxString& value, long style, const wxPoint& pos):
|
||||
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
|
||||
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
|
||||
{
|
||||
m_dialogStyle = style;
|
||||
m_value = value;
|
||||
|
@@ -59,7 +59,9 @@ char *wxOsVersion = (char *) NULL;
|
||||
|
||||
/* For printing several pages */
|
||||
int wxPageNumber;
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
|
||||
|
||||
// Now in prntbase.cpp
|
||||
// wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
|
||||
|
||||
/* GDI Object Lists */
|
||||
wxBrushList *wxTheBrushList = (wxBrushList *) NULL;
|
||||
|
@@ -59,7 +59,9 @@ char *wxOsVersion = (char *) NULL;
|
||||
|
||||
/* For printing several pages */
|
||||
int wxPageNumber;
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
|
||||
|
||||
// Now in prntbase.cpp
|
||||
// wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
|
||||
|
||||
/* GDI Object Lists */
|
||||
wxBrushList *wxTheBrushList = (wxBrushList *) NULL;
|
||||
|
@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
|
@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
|
@@ -128,10 +128,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
|
@@ -491,6 +491,7 @@ void wxApp::CleanUp()
|
||||
// (double deletion of the cursor).
|
||||
wxSetCursor(wxNullCursor);
|
||||
delete g_globalCursor;
|
||||
g_globalCursor = NULL;
|
||||
|
||||
wxDeleteStockObjects() ;
|
||||
|
||||
@@ -932,6 +933,7 @@ void wxApp::Dispatch()
|
||||
* the message. Some may have accelerator tables, or have
|
||||
* MDI complications.
|
||||
*/
|
||||
|
||||
bool wxApp::ProcessMessage(WXMSG *wxmsg)
|
||||
{
|
||||
MSG *msg = (MSG *)wxmsg;
|
||||
|
@@ -78,11 +78,6 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
|
||||
wxGetInstance(), NULL);
|
||||
|
||||
#if wxUSE_CTL3D
|
||||
// if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS))
|
||||
// Ctl3dSubclassCtl(wx_button);
|
||||
#endif
|
||||
|
||||
m_hWnd = (WXHWND)wx_button;
|
||||
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
|
@@ -53,6 +53,7 @@ wxControl::wxControl(void)
|
||||
m_backgroundColour = *wxWHITE;
|
||||
m_foregroundColour = *wxBLACK;
|
||||
m_callback = 0;
|
||||
// m_windowCursor = wxNullCursor; // To avoid the standard cursor being used
|
||||
}
|
||||
|
||||
wxControl::~wxControl(void)
|
||||
|
@@ -24,6 +24,8 @@
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/prntbase.h"
|
||||
|
||||
#define _MAXPATHLEN 500
|
||||
|
||||
// Useful buffer, initialized in wxCommonInit
|
||||
@@ -154,11 +156,6 @@ const char *wxDoubleToStringStr = "%.2f";
|
||||
const char *wxUserResourceStr = "TEXT";
|
||||
#endif
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
class wxPrintPaperDatabase;
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
/*
|
||||
* For wxWindows to be made into a dynamic library (e.g. Sun),
|
||||
@@ -319,9 +316,10 @@ IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPageSetupData, wxObject)
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
|
||||
#endif
|
||||
|
||||
#if wxUSE_WX_RESOURCES
|
||||
#include "wx/resource.h"
|
||||
|
@@ -208,13 +208,13 @@ void wxDialog::OnCharHook(wxKeyEvent& event)
|
||||
{
|
||||
if (event.m_keyCode == WXK_ESCAPE)
|
||||
{
|
||||
// Behaviour changed in 2.0: we'll send a Cancel message
|
||||
// to the dialog instead of Close.
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
cancelEvent.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(cancelEvent);
|
||||
// Behaviour changed in 2.0: we'll send a Cancel message
|
||||
// to the dialog instead of Close.
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
cancelEvent.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(cancelEvent);
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// We didn't process this event.
|
||||
@@ -557,7 +557,7 @@ void wxDialog::OnCancel(wxCommandEvent& event)
|
||||
else
|
||||
{
|
||||
SetReturnCode(wxID_CANCEL);
|
||||
this->Show(FALSE);
|
||||
this->Show(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -70,6 +70,7 @@ GENERICOBJS= \
|
||||
$(GENDIR)\statusbr.obj \
|
||||
$(GENDIR)\tabg.obj \
|
||||
$(GENDIR)\textdlgg.obj\
|
||||
$(GENDIR)\prntdlgg.obj \
|
||||
$(GENDIR)\treectrl.obj
|
||||
|
||||
# Don't need these generic objects for Windows
|
||||
@@ -77,7 +78,6 @@ GENERICOBJS= \
|
||||
# $(GENDIR)\fontdlgg.obj \
|
||||
# $(GENDIR)\colrdlgg.obj \
|
||||
# $(GENDIR)\printps.obj \
|
||||
# $(GENDIR)\prntdlgg.obj \
|
||||
# $(GENDIR)\helpxlp.obj \
|
||||
|
||||
COMMONOBJS = \
|
||||
|
@@ -289,53 +289,6 @@ void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
/*
|
||||
void wxMDIParentFrame::OldOnSize(int x, int y)
|
||||
{
|
||||
#if WXWIN_COMPATIBILITY == 1
|
||||
wxSizeEvent event(wxSize(x, y), m_windowId);
|
||||
event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
#else
|
||||
|
||||
#if wxUSE_CONSTRAINTS
|
||||
if (GetAutoLayout())
|
||||
Layout();
|
||||
#endif
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int width, height;
|
||||
GetClientSize(&width, &height);
|
||||
if ( GetToolBar() )
|
||||
{
|
||||
int wt, ht;
|
||||
GetToolBar()->GetSize(&wt, &ht);
|
||||
height -= ht;
|
||||
y += ht;
|
||||
}
|
||||
|
||||
if ( GetClientWindow() )
|
||||
GetClientWindow()->SetSize(x, y, width, height);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// Default activation behaviour - nothing.
|
||||
// Default activation behaviour - override dedault wxFrame behaviour
|
||||
void wxMDIParentFrame::OldOnActivate(bool flag)
|
||||
{
|
||||
#if WXWIN_COMPATIBILITY == 1
|
||||
wxActivateEvent event(wxEVT_ACTIVATE, flag, m_windowId);
|
||||
event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
// Returns the active MDI child window
|
||||
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
|
||||
{
|
||||
|
@@ -54,10 +54,12 @@
|
||||
#endif // Win32/16
|
||||
|
||||
// wnd proc for radio buttons
|
||||
#ifdef __WIN32__
|
||||
LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hWnd,
|
||||
UINT message,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam);
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global vars
|
||||
@@ -706,14 +708,19 @@ void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
|
||||
if ( !s_wndprocRadioBtn )
|
||||
s_wndprocRadioBtn = (WNDPROC)::GetWindowLong(hwndBtn, GWL_WNDPROC);
|
||||
|
||||
// No GWL_USERDATA in Win16, so omit this subclassing.
|
||||
#ifdef __WIN32__
|
||||
::SetWindowLong(hwndBtn, GWL_WNDPROC, (long)wxRadioBtnWndProc);
|
||||
::SetWindowLong(hwndBtn, GWL_USERDATA, (long)this);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// window proc for radio buttons
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
||||
UINT msg,
|
||||
WPARAM wParam,
|
||||
@@ -777,4 +784,5 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -151,10 +151,18 @@ bool wxToolBar95::Create(wxWindow *parent,
|
||||
msflags |= TBSTYLE_FLAT;
|
||||
}
|
||||
|
||||
bool want3D;
|
||||
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
|
||||
|
||||
// Even with extended styles, need to combine with WS_BORDER
|
||||
// for them to look right.
|
||||
if ( want3D || wxStyleHasBorder(m_windowStyle) )
|
||||
msflags |= WS_BORDER;
|
||||
|
||||
// Create the toolbar control.
|
||||
HWND hWndToolbar = CreateWindowEx
|
||||
(
|
||||
0L, // No extended styles.
|
||||
exStyle, // Extended styles.
|
||||
TOOLBARCLASSNAME, // Class name for the toolbar.
|
||||
"", // No default text.
|
||||
msflags, // Styles
|
||||
@@ -428,7 +436,8 @@ void wxToolBar95::GetSize(int *w, int *h) const
|
||||
wxWindow::GetSize(w, h);
|
||||
// For some reason, the returned height is several pixels bigger than that
|
||||
// displayed!
|
||||
*h -= 2;
|
||||
// Taking this fudge factor out now, it seems fine without it.
|
||||
// *h -= 2;
|
||||
}
|
||||
|
||||
// The button size is bigger than the bitmap size
|
||||
|
@@ -465,12 +465,20 @@ void wxToolBarMSW::Layout(void)
|
||||
node = node->Next();
|
||||
}
|
||||
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
|
||||
{
|
||||
m_maxWidth += maxToolWidth;
|
||||
else
|
||||
m_maxHeight += maxToolHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_maxWidth += maxToolWidth;
|
||||
m_maxHeight += maxToolHeight;
|
||||
}
|
||||
|
||||
m_maxWidth += m_xMargin;
|
||||
m_maxHeight += m_yMargin;
|
||||
|
||||
SetSize(m_maxWidth, m_maxHeight);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -971,8 +971,11 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
|
||||
case WXK_RETURN:
|
||||
{
|
||||
/* Oh yes it will, because we also specify DLGC_WANTCHARS
|
||||
wxASSERT_MSG( m_windowStyle & wxTE_PROCESS_ENTER,
|
||||
"this text ctrl should never receive return" );
|
||||
*/
|
||||
|
||||
if ( (m_windowStyle & wxTE_MULTILINE) == 0 )
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
|
||||
@@ -1007,8 +1010,8 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
// don't just call event.Skip() because this will cause TABs and ENTERs
|
||||
// be passed upwards and we don't always want this - instead process it
|
||||
// right here
|
||||
//Default();
|
||||
event.Skip();
|
||||
Default();
|
||||
// event.Skip();
|
||||
}
|
||||
|
||||
long wxTextCtrl::MSWGetDlgCode()
|
||||
|
@@ -59,6 +59,8 @@
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifndef __GNUWIN32__
|
||||
@@ -234,6 +236,7 @@ void wxWindow::Init()
|
||||
m_isWindow = TRUE;
|
||||
|
||||
// Generic
|
||||
// m_windowCursor = * wxSTANDARD_CURSOR;
|
||||
m_windowId = 0;
|
||||
m_isShown = TRUE;
|
||||
m_windowStyle = 0;
|
||||
@@ -938,7 +941,7 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
|
||||
#define DIMENSION_TYPE int
|
||||
#endif
|
||||
|
||||
// Main Windows 3 window proc
|
||||
// Main Windows window proc
|
||||
long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
wxASSERT( m_lastMsg == message &&
|
||||
@@ -1176,6 +1179,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return MSWOnSysCommand(wParam, lParam);
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
@@ -1227,7 +1231,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return MSWOnMeasureItem((int)wParam, (WXMEASUREITEMSTRUCT *)lParam);
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_KEYDOWN:
|
||||
// If this has been processed by an event handler,
|
||||
// return 0 now (we've handled it).
|
||||
@@ -1288,7 +1291,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_KEYUP:
|
||||
{
|
||||
if (!MSWOnKeyUp((WORD) wParam, lParam))
|
||||
@@ -1301,7 +1303,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return Default();
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_HSCROLL:
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
@@ -1479,7 +1480,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return 1L;
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_GETMINMAXINFO:
|
||||
{
|
||||
MINMAXINFO *info = (MINMAXINFO *)lParam;
|
||||
@@ -1494,10 +1494,10 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return MSWDefWindowProc(message, wParam, lParam );
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
return MSWGetDlgCode();
|
||||
|
||||
{
|
||||
return MSWGetDlgCode();
|
||||
}
|
||||
case WM_SETCURSOR:
|
||||
{
|
||||
// don't set cursor for other windows, only for this one: this
|
||||
@@ -1551,7 +1551,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return MSWDefWindowProc(message, wParam, lParam );
|
||||
|
||||
default:
|
||||
@@ -2147,6 +2146,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
||||
if ( ::IsDialogMessage((HWND)GetHWND(), msg) )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
if ( m_tooltip )
|
||||
{
|
||||
@@ -2157,6 +2157,15 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
||||
}
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// In case we don't have wxTAB_TRAVERSAL style on.
|
||||
// If we don't call this, we may never process Enter correctly.
|
||||
if ( m_hWnd != 0 && (GetWindowStyleFlag() & wxTAB_TRAVERSAL) == 0 )
|
||||
{
|
||||
MSG *msg = (MSG *)pMsg;
|
||||
if ( ::IsDialogMessage((HWND)GetHWND(), msg) )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
|
Reference in New Issue
Block a user