header changes for the fixes commited previously
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -31,10 +31,10 @@ public:
|
|||||||
wxColourData(const wxColourData& data);
|
wxColourData(const wxColourData& data);
|
||||||
~wxColourData();
|
~wxColourData();
|
||||||
|
|
||||||
inline void SetChooseFull(bool flag) { chooseFull = flag; }
|
void SetChooseFull(bool flag) { chooseFull = flag; }
|
||||||
inline bool GetChooseFull() const { return chooseFull; }
|
bool GetChooseFull() const { return chooseFull; }
|
||||||
inline void SetColour(wxColour& colour) { dataColour = colour; }
|
void SetColour(wxColour& colour) { dataColour = colour; }
|
||||||
inline wxColour &GetColour() { return dataColour; }
|
wxColour &GetColour() { return dataColour; }
|
||||||
|
|
||||||
// Array of 16 custom colours
|
// Array of 16 custom colours
|
||||||
void SetCustomColour(int i, wxColour& colour);
|
void SetCustomColour(int i, wxColour& colour);
|
||||||
@@ -56,25 +56,25 @@ public:
|
|||||||
wxFontData(const wxFontData& fontData);
|
wxFontData(const wxFontData& fontData);
|
||||||
~wxFontData();
|
~wxFontData();
|
||||||
|
|
||||||
inline void SetAllowSymbols(bool flag) { allowSymbols = flag; }
|
void SetAllowSymbols(bool flag) { allowSymbols = flag; }
|
||||||
inline bool GetAllowSymbols() const { return allowSymbols; }
|
bool GetAllowSymbols() const { return allowSymbols; }
|
||||||
|
|
||||||
inline void SetColour(const wxColour& colour) { fontColour = colour; }
|
void SetColour(const wxColour& colour) { fontColour = colour; }
|
||||||
inline wxColour &GetColour() { return fontColour; }
|
wxColour &GetColour() { return fontColour; }
|
||||||
|
|
||||||
inline void SetShowHelp(bool flag) { showHelp = flag; }
|
void SetShowHelp(bool flag) { showHelp = flag; }
|
||||||
inline bool GetShowHelp() const { return showHelp; }
|
bool GetShowHelp() const { return showHelp; }
|
||||||
|
|
||||||
inline void EnableEffects(bool flag) { enableEffects = flag; }
|
void EnableEffects(bool flag) { enableEffects = flag; }
|
||||||
inline bool GetEnableEffects() const { return enableEffects; }
|
bool GetEnableEffects() const { return enableEffects; }
|
||||||
|
|
||||||
inline void SetInitialFont(const wxFont& font) { initialFont = font; }
|
void SetInitialFont(const wxFont& font) { initialFont = font; }
|
||||||
inline wxFont GetInitialFont() const { return initialFont; }
|
wxFont GetInitialFont() const { return initialFont; }
|
||||||
|
|
||||||
inline void SetChosenFont(const wxFont& font) { chosenFont = font; }
|
void SetChosenFont(const wxFont& font) { chosenFont = font; }
|
||||||
inline wxFont GetChosenFont() const { return chosenFont; }
|
wxFont GetChosenFont() const { return chosenFont; }
|
||||||
|
|
||||||
inline void SetRange(int minRange, int maxRange) { minSize = minRange; maxSize = maxRange; }
|
void SetRange(int minRange, int maxRange) { minSize = minRange; maxSize = maxRange; }
|
||||||
|
|
||||||
void operator=(const wxFontData& data);
|
void operator=(const wxFontData& data);
|
||||||
|
|
||||||
@@ -102,53 +102,53 @@ class WXDLLEXPORT wxPrintData: public wxObject
|
|||||||
wxPrintData(const wxPrintData& printData);
|
wxPrintData(const wxPrintData& printData);
|
||||||
~wxPrintData();
|
~wxPrintData();
|
||||||
|
|
||||||
inline int GetNoCopies() const { return m_printNoCopies; };
|
int GetNoCopies() const { return m_printNoCopies; };
|
||||||
inline bool GetCollate() const { return m_printCollate; };
|
bool GetCollate() const { return m_printCollate; };
|
||||||
inline int GetOrientation() const { return m_printOrientation; };
|
int GetOrientation() const { return m_printOrientation; };
|
||||||
|
|
||||||
inline const wxString& GetPrinterName() const { return m_printerName; }
|
const wxString& GetPrinterName() const { return m_printerName; }
|
||||||
inline bool GetColour() const { return m_colour; }
|
bool GetColour() const { return m_colour; }
|
||||||
inline wxDuplexMode GetDuplex() const { return m_duplexMode; }
|
wxDuplexMode GetDuplex() const { return m_duplexMode; }
|
||||||
inline wxPaperSize GetPaperId() const { return m_paperId; }
|
wxPaperSize GetPaperId() const { return m_paperId; }
|
||||||
inline const wxSize& GetPaperSize() const { return m_paperSize; } // Not used yet: confusable with paper size
|
const wxSize& GetPaperSize() const { return m_paperSize; } // Not used yet: confusable with paper size
|
||||||
// in wxPageSetupDialogData
|
// in wxPageSetupDialogData
|
||||||
inline wxPrintQuality GetQuality() const { return m_printQuality; }
|
wxPrintQuality GetQuality() const { return m_printQuality; }
|
||||||
|
|
||||||
inline void SetNoCopies(int v) { m_printNoCopies = v; };
|
void SetNoCopies(int v) { m_printNoCopies = v; };
|
||||||
inline void SetCollate(bool flag) { m_printCollate = flag; };
|
void SetCollate(bool flag) { m_printCollate = flag; };
|
||||||
inline void SetOrientation(int orient) { m_printOrientation = orient; };
|
void SetOrientation(int orient) { m_printOrientation = orient; };
|
||||||
|
|
||||||
inline void SetPrinterName(const wxString& name) { m_printerName = name; }
|
void SetPrinterName(const wxString& name) { m_printerName = name; }
|
||||||
inline void SetColour(bool colour) { m_colour = colour; }
|
void SetColour(bool colour) { m_colour = colour; }
|
||||||
inline void SetDuplex(wxDuplexMode duplex) { m_duplexMode = duplex; }
|
void SetDuplex(wxDuplexMode duplex) { m_duplexMode = duplex; }
|
||||||
inline void SetPaperId(wxPaperSize sizeId) { m_paperId = sizeId; }
|
void SetPaperId(wxPaperSize sizeId) { m_paperId = sizeId; }
|
||||||
inline void SetPaperSize(const wxSize& sz) { m_paperSize = sz; }
|
void SetPaperSize(const wxSize& sz) { m_paperSize = sz; }
|
||||||
inline void SetQuality(wxPrintQuality quality) { m_printQuality = quality; }
|
void SetQuality(wxPrintQuality quality) { m_printQuality = quality; }
|
||||||
|
|
||||||
// PostScript-specific data
|
// PostScript-specific data
|
||||||
inline const wxString& GetPrinterCommand() const { return m_printerCommand; }
|
const wxString& GetPrinterCommand() const { return m_printerCommand; }
|
||||||
inline const wxString& GetPrinterOptions() const { return m_printerOptions; }
|
const wxString& GetPrinterOptions() const { return m_printerOptions; }
|
||||||
inline const wxString& GetPreviewCommand() const { return m_previewCommand; }
|
const wxString& GetPreviewCommand() const { return m_previewCommand; }
|
||||||
inline const wxString& GetFilename() const { return m_filename; }
|
const wxString& GetFilename() const { return m_filename; }
|
||||||
inline const wxString& GetFontMetricPath() const { return m_afmPath; }
|
const wxString& GetFontMetricPath() const { return m_afmPath; }
|
||||||
inline double GetPrinterScaleX() const { return m_printerScaleX; }
|
double GetPrinterScaleX() const { return m_printerScaleX; }
|
||||||
inline double GetPrinterScaleY() const { return m_printerScaleY; }
|
double GetPrinterScaleY() const { return m_printerScaleY; }
|
||||||
inline long GetPrinterTranslateX() const { return m_printerTranslateX; }
|
long GetPrinterTranslateX() const { return m_printerTranslateX; }
|
||||||
inline long GetPrinterTranslateY() const { return m_printerTranslateY; }
|
long GetPrinterTranslateY() const { return m_printerTranslateY; }
|
||||||
inline wxPrintMode GetPrintMode() const { return m_printMode; }
|
wxPrintMode GetPrintMode() const { return m_printMode; }
|
||||||
|
|
||||||
inline void SetPrinterCommand(const wxString& command) { m_printerCommand = command; }
|
void SetPrinterCommand(const wxString& command) { m_printerCommand = command; }
|
||||||
inline void SetPrinterOptions(const wxString& options) { m_printerOptions = options; }
|
void SetPrinterOptions(const wxString& options) { m_printerOptions = options; }
|
||||||
inline void SetPreviewCommand(const wxString& command) { m_previewCommand = command; }
|
void SetPreviewCommand(const wxString& command) { m_previewCommand = command; }
|
||||||
inline void SetFilename(const wxString& filename) { m_filename = filename; }
|
void SetFilename(const wxString& filename) { m_filename = filename; }
|
||||||
inline void SetFontMetricPath(const wxString& path) { m_afmPath = path; }
|
void SetFontMetricPath(const wxString& path) { m_afmPath = path; }
|
||||||
inline void SetPrinterScaleX(double x) { m_printerScaleX = x; }
|
void SetPrinterScaleX(double x) { m_printerScaleX = x; }
|
||||||
inline void SetPrinterScaleY(double y) { m_printerScaleY = y; }
|
void SetPrinterScaleY(double y) { m_printerScaleY = y; }
|
||||||
inline void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; }
|
void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; }
|
||||||
inline void SetPrinterTranslateX(long x) { m_printerTranslateX = x; }
|
void SetPrinterTranslateX(long x) { m_printerTranslateX = x; }
|
||||||
inline void SetPrinterTranslateY(long y) { m_printerTranslateY = y; }
|
void SetPrinterTranslateY(long y) { m_printerTranslateY = y; }
|
||||||
inline void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
|
void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
|
||||||
inline void SetPrintMode(wxPrintMode printMode) { m_printMode = printMode; }
|
void SetPrintMode(wxPrintMode printMode) { m_printMode = printMode; }
|
||||||
|
|
||||||
void operator=(const wxPrintData& data);
|
void operator=(const wxPrintData& data);
|
||||||
|
|
||||||
@@ -161,8 +161,8 @@ class WXDLLEXPORT wxPrintData: public wxObject
|
|||||||
// Convert to/from the DEVMODE structure
|
// Convert to/from the DEVMODE structure
|
||||||
void ConvertToNative();
|
void ConvertToNative();
|
||||||
void ConvertFromNative();
|
void ConvertFromNative();
|
||||||
inline void* GetNativeData() const { return m_devMode; }
|
void* GetNativeData() const { return m_devMode; }
|
||||||
inline void SetNativeData(void* data) { m_devMode = data; }
|
void SetNativeData(void* data) { m_devMode = data; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -213,38 +213,38 @@ class WXDLLEXPORT wxPrintDialogData: public wxObject
|
|||||||
wxPrintDialogData(const wxPrintData& printData);
|
wxPrintDialogData(const wxPrintData& printData);
|
||||||
~wxPrintDialogData();
|
~wxPrintDialogData();
|
||||||
|
|
||||||
inline int GetFromPage() const { return m_printFromPage; };
|
int GetFromPage() const { return m_printFromPage; };
|
||||||
inline int GetToPage() const { return m_printToPage; };
|
int GetToPage() const { return m_printToPage; };
|
||||||
inline int GetMinPage() const { return m_printMinPage; };
|
int GetMinPage() const { return m_printMinPage; };
|
||||||
inline int GetMaxPage() const { return m_printMaxPage; };
|
int GetMaxPage() const { return m_printMaxPage; };
|
||||||
inline int GetNoCopies() const { return m_printNoCopies; };
|
int GetNoCopies() const { return m_printNoCopies; };
|
||||||
inline bool GetAllPages() const { return m_printAllPages; };
|
bool GetAllPages() const { return m_printAllPages; };
|
||||||
inline bool GetCollate() const { return m_printCollate; };
|
bool GetCollate() const { return m_printCollate; };
|
||||||
inline bool GetPrintToFile() const { return m_printToFile; };
|
bool GetPrintToFile() const { return m_printToFile; };
|
||||||
inline bool GetSetupDialog() const { return m_printSetupDialog; };
|
bool GetSetupDialog() const { return m_printSetupDialog; };
|
||||||
|
|
||||||
inline void SetFromPage(int v) { m_printFromPage = v; };
|
void SetFromPage(int v) { m_printFromPage = v; };
|
||||||
inline void SetToPage(int v) { m_printToPage = v; };
|
void SetToPage(int v) { m_printToPage = v; };
|
||||||
inline void SetMinPage(int v) { m_printMinPage = v; };
|
void SetMinPage(int v) { m_printMinPage = v; };
|
||||||
inline void SetMaxPage(int v) { m_printMaxPage = v; };
|
void SetMaxPage(int v) { m_printMaxPage = v; };
|
||||||
inline void SetNoCopies(int v) { m_printNoCopies = v; };
|
void SetNoCopies(int v) { m_printNoCopies = v; };
|
||||||
inline void SetAllPages(bool flag) { m_printAllPages = flag; };
|
void SetAllPages(bool flag) { m_printAllPages = flag; };
|
||||||
inline void SetCollate(bool flag) { m_printCollate = flag; };
|
void SetCollate(bool flag) { m_printCollate = flag; };
|
||||||
inline void SetPrintToFile(bool flag) { m_printToFile = flag; };
|
void SetPrintToFile(bool flag) { m_printToFile = flag; };
|
||||||
inline void SetSetupDialog(bool flag) { m_printSetupDialog = flag; };
|
void SetSetupDialog(bool flag) { m_printSetupDialog = flag; };
|
||||||
|
|
||||||
inline void EnablePrintToFile(bool flag) { m_printEnablePrintToFile = flag; };
|
void EnablePrintToFile(bool flag) { m_printEnablePrintToFile = flag; };
|
||||||
inline void EnableSelection(bool flag) { m_printEnableSelection = flag; };
|
void EnableSelection(bool flag) { m_printEnableSelection = flag; };
|
||||||
inline void EnablePageNumbers(bool flag) { m_printEnablePageNumbers = flag; };
|
void EnablePageNumbers(bool flag) { m_printEnablePageNumbers = flag; };
|
||||||
inline void EnableHelp(bool flag) { m_printEnableHelp = flag; };
|
void EnableHelp(bool flag) { m_printEnableHelp = flag; };
|
||||||
|
|
||||||
inline bool GetEnablePrintToFile() const { return m_printEnablePrintToFile; };
|
bool GetEnablePrintToFile() const { return m_printEnablePrintToFile; };
|
||||||
inline bool GetEnableSelection() const { return m_printEnableSelection; };
|
bool GetEnableSelection() const { return m_printEnableSelection; };
|
||||||
inline bool GetEnablePageNumbers() const { return m_printEnablePageNumbers; };
|
bool GetEnablePageNumbers() const { return m_printEnablePageNumbers; };
|
||||||
inline bool GetEnableHelp() const { return m_printEnableHelp; };
|
bool GetEnableHelp() const { return m_printEnableHelp; };
|
||||||
|
|
||||||
inline wxPrintData& GetPrintData() { return m_printData; }
|
wxPrintData& GetPrintData() { return m_printData; }
|
||||||
inline void SetPrintData(const wxPrintData& printData) { m_printData = printData; }
|
void SetPrintData(const wxPrintData& printData) { m_printData = printData; }
|
||||||
|
|
||||||
void operator=(const wxPrintDialogData& data);
|
void operator=(const wxPrintDialogData& data);
|
||||||
void operator=(const wxPrintData& data); // Sets internal m_printData member
|
void operator=(const wxPrintData& data); // Sets internal m_printData member
|
||||||
@@ -254,7 +254,7 @@ class WXDLLEXPORT wxPrintDialogData: public wxObject
|
|||||||
void ConvertToNative();
|
void ConvertToNative();
|
||||||
void ConvertFromNative();
|
void ConvertFromNative();
|
||||||
void SetOwnerWindow(wxWindow* win);
|
void SetOwnerWindow(wxWindow* win);
|
||||||
inline void* GetNativeData() const { return m_printDlgData; }
|
void* GetNativeData() const { return m_printDlgData; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@@ -297,20 +297,20 @@ public:
|
|||||||
wxPageSetupDialogData(const wxPrintData& printData);
|
wxPageSetupDialogData(const wxPrintData& printData);
|
||||||
~wxPageSetupDialogData();
|
~wxPageSetupDialogData();
|
||||||
|
|
||||||
inline wxSize GetPaperSize() const { return m_paperSize; };
|
wxSize GetPaperSize() const { return m_paperSize; };
|
||||||
inline wxPaperSize GetPaperId() const { return m_printData.GetPaperId(); };
|
wxPaperSize GetPaperId() const { return m_printData.GetPaperId(); };
|
||||||
inline wxPoint GetMinMarginTopLeft() const { return m_minMarginTopLeft; };
|
wxPoint GetMinMarginTopLeft() const { return m_minMarginTopLeft; };
|
||||||
inline wxPoint GetMinMarginBottomRight() const { return m_minMarginBottomRight; };
|
wxPoint GetMinMarginBottomRight() const { return m_minMarginBottomRight; };
|
||||||
inline wxPoint GetMarginTopLeft() const { return m_marginTopLeft; };
|
wxPoint GetMarginTopLeft() const { return m_marginTopLeft; };
|
||||||
inline wxPoint GetMarginBottomRight() const { return m_marginBottomRight; };
|
wxPoint GetMarginBottomRight() const { return m_marginBottomRight; };
|
||||||
|
|
||||||
inline bool GetDefaultMinMargins() const { return m_defaultMinMargins; };
|
bool GetDefaultMinMargins() const { return m_defaultMinMargins; };
|
||||||
inline bool GetEnableMargins() const { return m_enableMargins; };
|
bool GetEnableMargins() const { return m_enableMargins; };
|
||||||
inline bool GetEnableOrientation() const { return m_enableOrientation; };
|
bool GetEnableOrientation() const { return m_enableOrientation; };
|
||||||
inline bool GetEnablePaper() const { return m_enablePaper; };
|
bool GetEnablePaper() const { return m_enablePaper; };
|
||||||
inline bool GetEnablePrinter() const { return m_enablePrinter; };
|
bool GetEnablePrinter() const { return m_enablePrinter; };
|
||||||
inline bool GetDefaultInfo() const { return m_getDefaultInfo; };
|
bool GetDefaultInfo() const { return m_getDefaultInfo; };
|
||||||
inline bool GetEnableHelp() const { return m_enableHelp; };
|
bool GetEnableHelp() const { return m_enableHelp; };
|
||||||
|
|
||||||
// If a corresponding paper type is found in the paper database, will set the m_printData
|
// If a corresponding paper type is found in the paper database, will set the m_printData
|
||||||
// paper size id member as well.
|
// paper size id member as well.
|
||||||
@@ -319,25 +319,25 @@ public:
|
|||||||
// Sets the wxPrintData id, plus the paper width/height if found in the paper database.
|
// Sets the wxPrintData id, plus the paper width/height if found in the paper database.
|
||||||
void SetPaperSize(wxPaperSize id);
|
void SetPaperSize(wxPaperSize id);
|
||||||
|
|
||||||
inline void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; };
|
void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; };
|
||||||
inline void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; };
|
void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; };
|
||||||
inline void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; };
|
void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; };
|
||||||
inline void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; };
|
void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; };
|
||||||
inline void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; };
|
void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; };
|
||||||
inline void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; };
|
void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; };
|
||||||
|
|
||||||
inline void EnableMargins(bool flag) { m_enableMargins = flag; };
|
void EnableMargins(bool flag) { m_enableMargins = flag; };
|
||||||
inline void EnableOrientation(bool flag) { m_enableOrientation = flag; };
|
void EnableOrientation(bool flag) { m_enableOrientation = flag; };
|
||||||
inline void EnablePaper(bool flag) { m_enablePaper = flag; };
|
void EnablePaper(bool flag) { m_enablePaper = flag; };
|
||||||
inline void EnablePrinter(bool flag) { m_enablePrinter = flag; };
|
void EnablePrinter(bool flag) { m_enablePrinter = flag; };
|
||||||
inline void EnableHelp(bool flag) { m_enableHelp = flag; };
|
void EnableHelp(bool flag) { m_enableHelp = flag; };
|
||||||
|
|
||||||
#if defined(__WIN95__)
|
#if defined(__WIN95__)
|
||||||
// Convert to/from the PAGESETUPDLG structure
|
// Convert to/from the PAGESETUPDLG structure
|
||||||
void ConvertToNative();
|
void ConvertToNative();
|
||||||
void ConvertFromNative();
|
void ConvertFromNative();
|
||||||
void SetOwnerWindow(wxWindow* win);
|
void SetOwnerWindow(wxWindow* win);
|
||||||
inline void* GetNativeData() const { return m_pageSetupData; }
|
void* GetNativeData() const { return m_pageSetupData; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Use paper size defined in this object to set the wxPrintData
|
// Use paper size defined in this object to set the wxPrintData
|
||||||
@@ -350,8 +350,8 @@ public:
|
|||||||
void operator=(const wxPageSetupData& data);
|
void operator=(const wxPageSetupData& data);
|
||||||
void operator=(const wxPrintData& data);
|
void operator=(const wxPrintData& data);
|
||||||
|
|
||||||
inline wxPrintData& GetPrintData() { return m_printData; }
|
wxPrintData& GetPrintData() { return m_printData; }
|
||||||
inline void SetPrintData(const wxPrintData& printData) { m_printData = printData; }
|
void SetPrintData(const wxPrintData& printData) { m_printData = printData; }
|
||||||
|
|
||||||
#if defined(__WIN95__)
|
#if defined(__WIN95__)
|
||||||
void* m_pageSetupData;
|
void* m_pageSetupData;
|
||||||
|
@@ -14,43 +14,52 @@
|
|||||||
#define __PRINTPSH__
|
#define __PRINTPSH__
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "printps.h"
|
#pragma interface "printps.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/prntbase.h"
|
#include "wx/prntbase.h"
|
||||||
|
|
||||||
/*
|
// ----------------------------------------------------------------------------
|
||||||
* Represents the printer: manages printing a wxPrintout object
|
// Represents the printer: manages printing a wxPrintout object
|
||||||
*/
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxPostScriptPrinter: public wxPrinterBase
|
class WXDLLEXPORT wxPostScriptPrinter : public wxPrinterBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPostScriptPrinter)
|
DECLARE_DYNAMIC_CLASS(wxPostScriptPrinter)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPostScriptPrinter(wxPrintDialogData *data = (wxPrintDialogData *) NULL);
|
wxPostScriptPrinter(wxPrintDialogData *data = (wxPrintDialogData *) NULL);
|
||||||
~wxPostScriptPrinter(void);
|
virtual ~wxPostScriptPrinter();
|
||||||
|
|
||||||
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
|
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
|
||||||
virtual wxDC* PrintDialog(wxWindow *parent);
|
virtual wxDC* PrintDialog(wxWindow *parent);
|
||||||
virtual bool Setup(wxWindow *parent);
|
virtual bool Setup(wxWindow *parent);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
// ----------------------------------------------------------------------------
|
||||||
* wxPrintPreview
|
// wxPrintPreview: programmer creates an object of this class to preview a
|
||||||
* Programmer creates an object of this class to preview a wxPrintout.
|
// wxPrintout.
|
||||||
*/
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxPostScriptPrintPreview: public wxPrintPreviewBase
|
class WXDLLEXPORT wxPostScriptPrintPreview : public wxPrintPreviewBase
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(wxPostScriptPrintPreview)
|
DECLARE_CLASS(wxPostScriptPrintPreview)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPostScriptPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = (wxPrintout *) NULL, wxPrintDialogData *data = (wxPrintDialogData *) NULL);
|
wxPostScriptPrintPreview(wxPrintout *printout,
|
||||||
~wxPostScriptPrintPreview(void);
|
wxPrintout *printoutForPrinting = (wxPrintout *) NULL,
|
||||||
|
wxPrintDialogData *data = (wxPrintDialogData *) NULL);
|
||||||
|
wxPostScriptPrintPreview(wxPrintout *printout,
|
||||||
|
wxPrintout *printoutForPrinting,
|
||||||
|
wxPrintData *data);
|
||||||
|
|
||||||
|
virtual ~wxPostScriptPrintPreview();
|
||||||
|
|
||||||
virtual bool Print(bool interactive);
|
virtual bool Print(bool interactive);
|
||||||
virtual void DetermineScaling(void);
|
virtual void DetermineScaling();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init(wxPrintout *printout, wxPrintout *printoutForPrinting);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -14,17 +14,15 @@
|
|||||||
#define __PRINTDLGH_G_
|
#define __PRINTDLGH_G_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "prntdlgg.h"
|
#pragma interface "prntdlgg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/dialog.h"
|
#include "wx/dialog.h"
|
||||||
#include "wx/dc.h"
|
|
||||||
#include "wx/cmndata.h"
|
|
||||||
#include "wx/dialog.h"
|
#include "wx/dialog.h"
|
||||||
|
|
||||||
#if wxUSE_POSTSCRIPT
|
#if wxUSE_POSTSCRIPT
|
||||||
#include "wx/dcps.h"
|
#include "wx/dcps.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class WXDLLEXPORT wxTextCtrl;
|
class WXDLLEXPORT wxTextCtrl;
|
||||||
@@ -35,26 +33,55 @@ class WXDLLEXPORT wxStaticText;
|
|||||||
class WXDLLEXPORT wxRadioBox;
|
class WXDLLEXPORT wxRadioBox;
|
||||||
class WXDLLEXPORT wxPrintSetupData;
|
class WXDLLEXPORT wxPrintSetupData;
|
||||||
|
|
||||||
/*
|
// ----------------------------------------------------------------------------
|
||||||
* Simulated Print and Print Setup dialogs
|
// constants
|
||||||
* for non-Windows platforms (and Windows using PostScript print/preview)
|
// ----------------------------------------------------------------------------
|
||||||
*/
|
|
||||||
|
|
||||||
#define wxPRINTID_STATIC 10
|
// FIXME why all these enums start with 10 or 30?
|
||||||
#define wxPRINTID_RANGE 11
|
|
||||||
#define wxPRINTID_FROM 12
|
|
||||||
#define wxPRINTID_TO 13
|
|
||||||
#define wxPRINTID_COPIES 14
|
|
||||||
#define wxPRINTID_PRINTTOFILE 15
|
|
||||||
#define wxPRINTID_SETUP 16
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxGenericPrintDialog: public wxDialog
|
enum
|
||||||
|
{
|
||||||
|
wxPRINTID_STATIC = 10,
|
||||||
|
wxPRINTID_RANGE,
|
||||||
|
wxPRINTID_FROM,
|
||||||
|
wxPRINTID_TO,
|
||||||
|
wxPRINTID_COPIES,
|
||||||
|
wxPRINTID_PRINTTOFILE,
|
||||||
|
wxPRINTID_SETUP
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
wxPRINTID_LEFTMARGIN = 30,
|
||||||
|
wxPRINTID_RIGHTMARGIN,
|
||||||
|
wxPRINTID_TOPMARGIN,
|
||||||
|
wxPRINTID_BOTTOMMARGIN
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
wxPRINTID_PRINTCOLOUR = 10,
|
||||||
|
wxPRINTID_ORIENTATION,
|
||||||
|
wxPRINTID_COMMAND,
|
||||||
|
wxPRINTID_OPTIONS,
|
||||||
|
wxPRINTID_PAPERSIZE
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Simulated Print and Print Setup dialogs for non-Windows platforms (and
|
||||||
|
// Windows using PostScript print/preview)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxGenericPrintDialog : public wxDialog
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
|
DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxGenericPrintDialog(wxWindow *parent, wxPrintDialogData* data = (wxPrintDialogData*) NULL);
|
wxGenericPrintDialog(wxWindow *parent,
|
||||||
~wxGenericPrintDialog();
|
wxPrintDialogData* data = (wxPrintDialogData*)NULL);
|
||||||
|
wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
|
||||||
|
|
||||||
|
virtual ~wxGenericPrintDialog();
|
||||||
|
|
||||||
void OnSetup(wxCommandEvent& event);
|
void OnSetup(wxCommandEvent& event);
|
||||||
void OnRange(wxCommandEvent& event);
|
void OnRange(wxCommandEvent& event);
|
||||||
@@ -65,7 +92,12 @@ public:
|
|||||||
|
|
||||||
virtual int ShowModal();
|
virtual int ShowModal();
|
||||||
|
|
||||||
inline wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
#if wxUSE_POSTSCRIPT
|
||||||
|
wxPrintData& GetPrintData()
|
||||||
|
{ return m_printDialogData.GetPrintData(); }
|
||||||
|
#endif // wxUSE_POSTSCRIPT
|
||||||
|
|
||||||
|
wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
||||||
wxDC *GetPrintDC();
|
wxDC *GetPrintDC();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -81,17 +113,14 @@ public:
|
|||||||
|
|
||||||
wxPrintDialogData m_printDialogData;
|
wxPrintDialogData m_printDialogData;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void Init(wxWindow *parent);
|
||||||
|
|
||||||
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#define wxPRINTID_PRINTCOLOUR 10
|
class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
|
||||||
#define wxPRINTID_ORIENTATION 11
|
|
||||||
#define wxPRINTID_COMMAND 12
|
|
||||||
#define wxPRINTID_OPTIONS 13
|
|
||||||
#define wxPRINTID_PAPERSIZE 14
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxGenericPrintSetupDialog: public wxDialog
|
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(wxGenericPrintSetupDialog)
|
DECLARE_CLASS(wxGenericPrintSetupDialog)
|
||||||
|
|
||||||
@@ -100,7 +129,7 @@ public:
|
|||||||
// just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
|
// just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
|
||||||
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
|
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
|
||||||
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
|
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
|
||||||
~wxGenericPrintSetupDialog();
|
virtual ~wxGenericPrintSetupDialog();
|
||||||
|
|
||||||
void Init(wxPrintData* data);
|
void Init(wxPrintData* data);
|
||||||
|
|
||||||
@@ -118,23 +147,17 @@ public:
|
|||||||
|
|
||||||
#if wxUSE_POSTSCRIPT
|
#if wxUSE_POSTSCRIPT
|
||||||
wxPrintData m_printData;
|
wxPrintData m_printData;
|
||||||
inline wxPrintData& GetPrintData() { return m_printData; }
|
wxPrintData& GetPrintData() { return m_printData; }
|
||||||
#endif
|
#endif // wxUSE_POSTSCRIPT
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define wxPRINTID_LEFTMARGIN 30
|
class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
|
||||||
#define wxPRINTID_RIGHTMARGIN 31
|
|
||||||
#define wxPRINTID_TOPMARGIN 32
|
|
||||||
#define wxPRINTID_BOTTOMMARGIN 33
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxGenericPageSetupDialog: public wxDialog
|
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(wxGenericPageSetupDialog)
|
DECLARE_CLASS(wxGenericPageSetupDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL);
|
wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = (wxPageSetupData*) NULL);
|
||||||
~wxGenericPageSetupDialog();
|
virtual ~wxGenericPageSetupDialog();
|
||||||
|
|
||||||
virtual bool TransferDataFromWindow();
|
virtual bool TransferDataFromWindow();
|
||||||
virtual bool TransferDataToWindow();
|
virtual bool TransferDataToWindow();
|
||||||
@@ -142,7 +165,7 @@ public:
|
|||||||
void OnPrinter(wxCommandEvent& event);
|
void OnPrinter(wxCommandEvent& event);
|
||||||
|
|
||||||
wxChoice *CreatePaperTypeChoice(int* x, int* y);
|
wxChoice *CreatePaperTypeChoice(int* x, int* y);
|
||||||
inline wxPageSetupData& GetPageSetupData() { return m_pageData; }
|
wxPageSetupData& GetPageSetupData() { return m_pageData; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxButton* m_printerButton;
|
wxButton* m_printerButton;
|
||||||
@@ -157,6 +180,7 @@ public:
|
|||||||
|
|
||||||
wxPageSetupData m_pageData;
|
wxPageSetupData m_pageData;
|
||||||
|
|
||||||
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
214
include/wx/log.h
214
include/wx/log.h
@@ -13,9 +13,11 @@
|
|||||||
#define _WX_LOG_H_
|
#define _WX_LOG_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "log.h"
|
#pragma interface "log.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <wx/dynarray.h>
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// constants
|
// constants
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -35,6 +37,22 @@ enum
|
|||||||
wxLOG_User = 100 // user defined levels start here
|
wxLOG_User = 100 // user defined levels start here
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// symbolic trace masks - wxLogTrace("foo", "some trace message...") will be
|
||||||
|
// discarded unless the string "foo" has been added to the list of allowed
|
||||||
|
// ones with AddTraceMask()
|
||||||
|
|
||||||
|
#define wxTRACE_MemAlloc "memalloc" // trace memory allocation (new/delete)
|
||||||
|
#define wxTRACE_Messages "messages" // trace window messages/X callbacks
|
||||||
|
#define wxTRACE_ResAlloc "resalloc" // trace GDI resource allocation
|
||||||
|
#define wxTRACE_RefCount "refcount" // trace various ref counting operations
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
#define wxTRACE_OleCalls "ole" // OLE interface calls
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// the trace masks have been superceded by symbolic trace constants, they're
|
||||||
|
// for compatibility only andwill be removed soon - do NOT use them
|
||||||
|
|
||||||
// meaning of different bits of the trace mask (which allows selectively
|
// meaning of different bits of the trace mask (which allows selectively
|
||||||
// enable/disable some trace messages)
|
// enable/disable some trace messages)
|
||||||
#define wxTraceMemAlloc 0x0001 // trace memory allocation (new/delete)
|
#define wxTraceMemAlloc 0x0001 // trace memory allocation (new/delete)
|
||||||
@@ -52,12 +70,13 @@ typedef unsigned long wxLogLevel;
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// forward declarations
|
// forward declarations
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxTextCtrl;
|
class WXDLLEXPORT wxTextCtrl;
|
||||||
class WXDLLEXPORT wxLogFrame;
|
class WXDLLEXPORT wxLogFrame;
|
||||||
class WXDLLEXPORT wxFrame;
|
class WXDLLEXPORT wxFrame;
|
||||||
|
|
||||||
#if wxUSE_IOSTREAMH
|
#if wxUSE_IOSTREAMH
|
||||||
// N.B. BC++ doesn't have istream.h, ostream.h
|
// N.B. BC++ doesn't have istream.h, ostream.h
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
#else
|
#else
|
||||||
# include <ostream>
|
# include <ostream>
|
||||||
@@ -70,6 +89,7 @@ class WXDLLEXPORT wxFrame;
|
|||||||
// derive from this class to redirect (or suppress, or ...) log messages
|
// derive from this class to redirect (or suppress, or ...) log messages
|
||||||
// normally, only a single instance of this class exists but it's not enforced
|
// normally, only a single instance of this class exists but it's not enforced
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxLog
|
class WXDLLEXPORT wxLog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -83,83 +103,83 @@ public:
|
|||||||
static bool EnableLogging(bool doIt = TRUE)
|
static bool EnableLogging(bool doIt = TRUE)
|
||||||
{ bool doLogOld = ms_doLog; ms_doLog = doIt; return doLogOld; }
|
{ bool doLogOld = ms_doLog; ms_doLog = doIt; return doLogOld; }
|
||||||
|
|
||||||
// sink function
|
// static sink function - see DoLog() for function to overload in the
|
||||||
static void OnLog(wxLogLevel level, const char *szString)
|
// derived classes
|
||||||
|
static void OnLog(wxLogLevel level, const char *szString, time_t t)
|
||||||
{
|
{
|
||||||
if ( IsEnabled() ) {
|
if ( IsEnabled() ) {
|
||||||
wxLog *pLogger = GetActiveTarget();
|
wxLog *pLogger = GetActiveTarget();
|
||||||
if ( pLogger )
|
if ( pLogger )
|
||||||
pLogger->DoLog(level, szString);
|
pLogger->DoLog(level, szString, t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// message buffering
|
// message buffering
|
||||||
// flush shows all messages if they're not logged immediately
|
// flush shows all messages if they're not logged immediately (FILE
|
||||||
// (FILE and iostream logs don't need it, but wxGuiLog does to avoid
|
// and iostream logs don't need it, but wxGuiLog does to avoid showing
|
||||||
// showing 17 modal dialogs one after another)
|
// 17 modal dialogs one after another)
|
||||||
virtual void Flush();
|
virtual void Flush();
|
||||||
// call to Flush() may be optimized: call it only if this function
|
// call to Flush() may be optimized: call it only if this function
|
||||||
// returns true (although Flush() also returns immediately if there
|
// returns true (although Flush() also returns immediately if there is
|
||||||
// is no messages, this functions is more efficient because inline)
|
// no messages, this functions is more efficient because inline)
|
||||||
bool HasPendingMessages() const { return m_bHasMessages; }
|
bool HasPendingMessages() const { return m_bHasMessages; }
|
||||||
|
|
||||||
// only one sink is active at each moment
|
// only one sink is active at each moment
|
||||||
// get current log target, will call wxApp::CreateLogTarget() to create one
|
// get current log target, will call wxApp::CreateLogTarget() to
|
||||||
// if none exists
|
// create one if none exists
|
||||||
static wxLog *GetActiveTarget();
|
static wxLog *GetActiveTarget();
|
||||||
// change log target, pLogger may be NULL
|
// change log target, pLogger may be NULL
|
||||||
static wxLog *SetActiveTarget(wxLog *pLogger);
|
static wxLog *SetActiveTarget(wxLog *pLogger);
|
||||||
|
|
||||||
// functions controlling the default wxLog behaviour
|
// functions controlling the default wxLog behaviour
|
||||||
// verbose mode is activated by standard command-line '-verbose' option
|
// verbose mode is activated by standard command-line '-verbose'
|
||||||
|
// option
|
||||||
void SetVerbose(bool bVerbose = TRUE) { m_bVerbose = bVerbose; }
|
void SetVerbose(bool bVerbose = TRUE) { m_bVerbose = bVerbose; }
|
||||||
// sets the format for timestamp prepended by wxLog::DoLog(): it's
|
// should GetActiveTarget() try to create a new log object if the
|
||||||
// passed to strftime() function, see it's documentation for details.
|
// current is NULL?
|
||||||
// no time stamp at all if szTF is NULL or empty
|
static void DontCreateOnDemand() { ms_bAutoCreate = FALSE; }
|
||||||
// NB: the string is not copied, so it's lifetime must be long enough!
|
|
||||||
void SetTimeStampFormat(const char *szTF) { m_szTimeFormat = szTF; }
|
|
||||||
// trace mask (see wxTraceXXX constants for details)
|
// trace mask (see wxTraceXXX constants for details)
|
||||||
static void SetTraceMask(wxTraceMask ulMask) { ms_ulTraceMask = ulMask; }
|
static void SetTraceMask(wxTraceMask ulMask) { ms_ulTraceMask = ulMask; }
|
||||||
// should GetActiveTarget() try to create a new log object if the current
|
// add string trace mask
|
||||||
// is NULL?
|
static void AddTraceMask(const wxString& str) { ms_aTraceMasks.Add(str); }
|
||||||
static void DontCreateOnDemand() { ms_bAutoCreate = FALSE; }
|
// add string trace mask
|
||||||
|
static void RemoveTraceMask(const wxString& str);
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
// gets the verbose status
|
// gets the verbose status
|
||||||
bool GetVerbose() const { return m_bVerbose; }
|
bool GetVerbose() const { return m_bVerbose; }
|
||||||
// get current time format
|
|
||||||
const char *GetTimeStampFormat() const { return m_szTimeFormat; }
|
|
||||||
// get trace mask
|
// get trace mask
|
||||||
static wxTraceMask GetTraceMask() { return ms_ulTraceMask; }
|
static wxTraceMask GetTraceMask() { return ms_ulTraceMask; }
|
||||||
|
// is this trace mask in the list?
|
||||||
|
static bool IsAllowedTraceMask(const char *mask)
|
||||||
|
{ return ms_aTraceMasks.Index(mask) != wxNOT_FOUND; }
|
||||||
|
|
||||||
// make dtor virtual for all derived classes
|
// make dtor virtual for all derived classes
|
||||||
virtual ~wxLog() { }
|
virtual ~wxLog() { }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_bHasMessages;
|
bool m_bHasMessages; // any messages in the queue?
|
||||||
|
|
||||||
bool m_bVerbose; // FALSE => ignore LogInfo messages
|
bool m_bVerbose; // FALSE => ignore LogInfo messages
|
||||||
const char *m_szTimeFormat; // format for strftime()
|
|
||||||
|
|
||||||
// the logging functions that can be overriden
|
// the logging functions that can be overriden
|
||||||
// default DoLog() prepends the time stamp and a prefix corresponding
|
// default DoLog() prepends the time stamp and a prefix corresponding
|
||||||
// to the message to szString and then passes it to DoLogString()
|
// to the message to szString and then passes it to DoLogString()
|
||||||
virtual void DoLog(wxLogLevel level, const char *szString);
|
virtual void DoLog(wxLogLevel level, const char *szString, time_t t);
|
||||||
// default DoLogString does nothing but is not pure virtual because if
|
// default DoLogString does nothing but is not pure virtual because if
|
||||||
// you override DoLog() you might not need it at all
|
// you override DoLog() you might not need it at all
|
||||||
virtual void DoLogString(const char *szString);
|
virtual void DoLogString(const char *szString, time_t t);
|
||||||
|
|
||||||
// helpers
|
|
||||||
// put the time stamp in the current format into the string
|
|
||||||
wxString TimeStamp() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// static variables
|
// static variables
|
||||||
// ----------------
|
// ----------------
|
||||||
|
|
||||||
static wxLog *ms_pLogger; // currently active log sink
|
static wxLog *ms_pLogger; // currently active log sink
|
||||||
static bool ms_doLog; // FALSE => all logging disabled
|
static bool ms_doLog; // FALSE => all logging disabled
|
||||||
static bool ms_bAutoCreate; // automatically create new log targets?
|
static bool ms_bAutoCreate; // create new log targets on demand?
|
||||||
|
|
||||||
static wxTraceMask ms_ulTraceMask; // controls wxLogTrace behaviour
|
static wxTraceMask ms_ulTraceMask; // controls wxLogTrace behaviour
|
||||||
|
static wxArrayString ms_aTraceMasks; // more powerful filter for wxLogTrace
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -175,7 +195,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// implement sink function
|
// implement sink function
|
||||||
virtual void DoLogString(const char *szString);
|
virtual void DoLogString(const char *szString, time_t t);
|
||||||
|
|
||||||
FILE *m_fp;
|
FILE *m_fp;
|
||||||
};
|
};
|
||||||
@@ -190,9 +210,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// implement sink function
|
// implement sink function
|
||||||
virtual void DoLogString(const char *szString);
|
virtual void DoLogString(const char *szString, time_t t);
|
||||||
|
|
||||||
// @@ using ptr here to avoid including <iostream.h> from this file
|
// using ptr here to avoid including <iostream.h> from this file
|
||||||
ostream *m_ostr;
|
ostream *m_ostr;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@@ -223,10 +243,15 @@ public:
|
|||||||
virtual void Flush();
|
virtual void Flush();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoLog(wxLogLevel level, const char *szString);
|
virtual void DoLog(wxLogLevel level, const char *szString, time_t t);
|
||||||
|
|
||||||
|
// empty everything
|
||||||
|
void Clear();
|
||||||
|
|
||||||
wxArrayString m_aMessages;
|
wxArrayString m_aMessages;
|
||||||
bool m_bErrors;
|
wxArrayLong m_aTimes;
|
||||||
|
bool m_bErrors, // do we have any errors?
|
||||||
|
m_bWarnings; // any warnings?
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -273,8 +298,8 @@ public:
|
|||||||
virtual void OnFrameDelete(wxFrame *frame);
|
virtual void OnFrameDelete(wxFrame *frame);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoLog(wxLogLevel level, const char *szString);
|
virtual void DoLog(wxLogLevel level, const char *szString, time_t t);
|
||||||
virtual void DoLogString(const char *szString);
|
virtual void DoLogString(const char *szString, time_t t);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_bPassMessages; // pass messages to m_pOldLog?
|
bool m_bPassMessages; // pass messages to m_pOldLog?
|
||||||
@@ -290,17 +315,17 @@ private:
|
|||||||
|
|
||||||
// example of usage:
|
// example of usage:
|
||||||
/*
|
/*
|
||||||
void Foo() {
|
void Foo() {
|
||||||
wxFile file;
|
wxFile file;
|
||||||
|
|
||||||
// wxFile.Open() normally complains if file can't be opened, we don't want it
|
// wxFile.Open() normally complains if file can't be opened, we don't want it
|
||||||
wxLogNull logNo;
|
wxLogNull logNo;
|
||||||
if ( !file.Open("bar") )
|
if ( !file.Open("bar") )
|
||||||
... process error ourselves ...
|
... process error ourselves ...
|
||||||
|
|
||||||
// ~wxLogNull called, old log sink restored
|
// ~wxLogNull called, old log sink restored
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
class WXDLLEXPORT wxLogNull
|
class WXDLLEXPORT wxLogNull
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -324,79 +349,86 @@ private:
|
|||||||
// -------------------
|
// -------------------
|
||||||
|
|
||||||
#define DECLARE_LOG_FUNCTION(level) \
|
#define DECLARE_LOG_FUNCTION(level) \
|
||||||
extern void WXDLLEXPORT wxLog##level(const char *szFormat, ...)
|
extern void WXDLLEXPORT wxLog##level(const char *szFormat, ...)
|
||||||
#define DECLARE_LOG_FUNCTION2(level, arg1) \
|
#define DECLARE_LOG_FUNCTION2(level, arg1) \
|
||||||
extern void WXDLLEXPORT wxLog##level(arg1, const char *szFormat, ...)
|
extern void WXDLLEXPORT wxLog##level(arg1, const char *szFormat, ...)
|
||||||
|
|
||||||
// a generic function for all levels (level is passes as parameter)
|
// a generic function for all levels (level is passes as parameter)
|
||||||
DECLARE_LOG_FUNCTION2(Generic, wxLogLevel level);
|
DECLARE_LOG_FUNCTION2(Generic, wxLogLevel level);
|
||||||
|
|
||||||
// one function per each level
|
// one function per each level
|
||||||
DECLARE_LOG_FUNCTION(FatalError);
|
DECLARE_LOG_FUNCTION(FatalError);
|
||||||
DECLARE_LOG_FUNCTION(Error);
|
DECLARE_LOG_FUNCTION(Error);
|
||||||
DECLARE_LOG_FUNCTION(Warning);
|
DECLARE_LOG_FUNCTION(Warning);
|
||||||
DECLARE_LOG_FUNCTION(Message);
|
DECLARE_LOG_FUNCTION(Message);
|
||||||
DECLARE_LOG_FUNCTION(Info);
|
DECLARE_LOG_FUNCTION(Info);
|
||||||
DECLARE_LOG_FUNCTION(Verbose);
|
DECLARE_LOG_FUNCTION(Verbose);
|
||||||
|
|
||||||
// this function sends the log message to the status line of the top level
|
// this function sends the log message to the status line of the top level
|
||||||
// application frame, if any
|
// application frame, if any
|
||||||
DECLARE_LOG_FUNCTION(Status);
|
DECLARE_LOG_FUNCTION(Status);
|
||||||
|
|
||||||
// this one is the same as previous except that it allows to explicitly
|
// this one is the same as previous except that it allows to explicitly
|
||||||
// specify the frame to which the output should go
|
// specify the frame to which the output should go
|
||||||
DECLARE_LOG_FUNCTION2(Status, wxFrame *pFrame);
|
DECLARE_LOG_FUNCTION2(Status, wxFrame *pFrame);
|
||||||
|
|
||||||
// additional one: as wxLogError, but also logs last system call error code
|
// additional one: as wxLogError, but also logs last system call error code
|
||||||
// and the corresponding error message if available
|
// and the corresponding error message if available
|
||||||
DECLARE_LOG_FUNCTION(SysError);
|
DECLARE_LOG_FUNCTION(SysError);
|
||||||
|
|
||||||
// and another one which also takes the error code (for those broken APIs
|
// and another one which also takes the error code (for those broken APIs
|
||||||
// that don't set the errno (like registry APIs in Win32))
|
// that don't set the errno (like registry APIs in Win32))
|
||||||
DECLARE_LOG_FUNCTION2(SysError, long lErrCode);
|
DECLARE_LOG_FUNCTION2(SysError, long lErrCode);
|
||||||
|
|
||||||
// debug functions do nothing in release mode
|
// debug functions do nothing in release mode
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
DECLARE_LOG_FUNCTION(Debug);
|
DECLARE_LOG_FUNCTION(Debug);
|
||||||
|
|
||||||
// first king of LogTrace is uncoditional: it doesn't check the level,
|
// first king of LogTrace is uncoditional: it doesn't check the level,
|
||||||
// while the second one does nothing if all of level bits are not set
|
|
||||||
// in wxLog::GetActive()->GetTraceMask().
|
|
||||||
DECLARE_LOG_FUNCTION(Trace);
|
DECLARE_LOG_FUNCTION(Trace);
|
||||||
|
|
||||||
|
// this second version will only log the message if the mask had been
|
||||||
|
// added to the list of masks with AddTraceMask()
|
||||||
|
DECLARE_LOG_FUNCTION2(Trace, const char *mask);
|
||||||
|
|
||||||
|
// the last one does nothing if all of level bits are not set
|
||||||
|
// in wxLog::GetActive()->GetTraceMask() - it's deprecated in favour of
|
||||||
|
// string identifiers
|
||||||
DECLARE_LOG_FUNCTION2(Trace, wxTraceMask mask);
|
DECLARE_LOG_FUNCTION2(Trace, wxTraceMask mask);
|
||||||
#else //!debug
|
#else //!debug
|
||||||
// these functions do nothing
|
// these functions do nothing in release builds
|
||||||
inline void wxLogDebug(const char *, ...) { }
|
inline void wxLogDebug(const char *, ...) { }
|
||||||
inline void wxLogTrace(const char *, ...) { }
|
inline void wxLogTrace(const char *, ...) { }
|
||||||
inline void wxLogTrace(wxTraceMask, const char *, ...) { }
|
inline void wxLogTrace(wxTraceMask, const char *, ...) { }
|
||||||
|
inline void wxLogTrace(const char *, const char *, ...) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// are we in 'verbose' mode?
|
// are we in 'verbose' mode?
|
||||||
// (note that it's often handy to change this var manually from the
|
// (note that it's often handy to change this var manually from the
|
||||||
// debugger, thus enabling/disabling verbose reporting for some
|
// debugger, thus enabling/disabling verbose reporting for some
|
||||||
// parts of the program only)
|
// parts of the program only)
|
||||||
WXDLLEXPORT_DATA(extern bool) g_bVerbose;
|
WXDLLEXPORT_DATA(extern bool) g_bVerbose;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// get error code/error message from system in a portable way
|
// get error code/error message from system in a portable way
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// return the last system error code
|
// return the last system error code
|
||||||
WXDLLEXPORT unsigned long wxSysErrorCode();
|
WXDLLEXPORT unsigned long wxSysErrorCode();
|
||||||
// return the error message for given (or last if 0) error code
|
// return the error message for given (or last if 0) error code
|
||||||
WXDLLEXPORT const char* wxSysErrorMsg(unsigned long nErrCode = 0);
|
WXDLLEXPORT const char* wxSysErrorMsg(unsigned long nErrCode = 0);
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// debug only logging functions: use them with API name and error code
|
// debug only logging functions: use them with API name and error code
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
#define wxLogApiError(api, rc) \
|
#define wxLogApiError(api, rc) \
|
||||||
wxLogDebug("At %s(%d) '%s' failed with error %lx (%s).", \
|
wxLogDebug("At %s(%d) '%s' failed with error %lx (%s).", \
|
||||||
__FILE__, __LINE__, api, \
|
__FILE__, __LINE__, api, \
|
||||||
rc, wxSysErrorMsg(rc))
|
rc, wxSysErrorMsg(rc))
|
||||||
#define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode())
|
#define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode())
|
||||||
#else //!debug
|
#else //!debug
|
||||||
inline void wxLogApiError(const char *, long) { }
|
inline void wxLogApiError(const char *, long) { }
|
||||||
inline void wxLogLastError(const char *) { }
|
inline void wxLogLastError(const char *) { }
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
#define _WX_PRNTBASEH__
|
#define _WX_PRNTBASEH__
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "prntbase.h"
|
#pragma interface "prntbase.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
@@ -45,12 +45,14 @@ class WXDLLEXPORT wxPrinterBase: public wxObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
wxPrinterBase(wxPrintDialogData *data = (wxPrintDialogData *) NULL);
|
wxPrinterBase(wxPrintDialogData *data = (wxPrintDialogData *) NULL);
|
||||||
~wxPrinterBase();
|
virtual ~wxPrinterBase();
|
||||||
|
|
||||||
virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout);
|
virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout);
|
||||||
virtual void ReportError(wxWindow *parent, wxPrintout *printout, char *message);
|
virtual void ReportError(wxWindow *parent, wxPrintout *printout, char *message);
|
||||||
inline wxPrintDialogData& GetPrintDialogData() const { return (wxPrintDialogData&) m_printDialogData; };
|
|
||||||
inline bool GetAbort() const { return sm_abortIt; }
|
wxPrintDialogData& GetPrintDialogData() const
|
||||||
|
{ return (wxPrintDialogData&) m_printDialogData; }
|
||||||
|
bool GetAbort() const { return sm_abortIt; }
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// OVERRIDES
|
// OVERRIDES
|
||||||
@@ -62,6 +64,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
wxPrintDialogData m_printDialogData;
|
wxPrintDialogData m_printDialogData;
|
||||||
wxPrintout* m_currentPrintout;
|
wxPrintout* m_currentPrintout;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static wxWindow* sm_abortWindow;
|
static wxWindow* sm_abortWindow;
|
||||||
static bool sm_abortIt;
|
static bool sm_abortIt;
|
||||||
@@ -78,11 +81,11 @@ public:
|
|||||||
|
|
||||||
class WXDLLEXPORT wxPrintout: public wxObject
|
class WXDLLEXPORT wxPrintout: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_ABSTRACT_CLASS(wxPrintout)
|
DECLARE_ABSTRACT_CLASS(wxPrintout)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPrintout(const wxString& title = "Printout");
|
wxPrintout(const wxString& title = "Printout");
|
||||||
~wxPrintout();
|
virtual ~wxPrintout();
|
||||||
|
|
||||||
virtual bool OnBeginDocument(int startPage, int endPage);
|
virtual bool OnBeginDocument(int startPage, int endPage);
|
||||||
virtual void OnEndDocument();
|
virtual void OnEndDocument();
|
||||||
@@ -90,29 +93,29 @@ public:
|
|||||||
virtual void OnEndPrinting();
|
virtual void OnEndPrinting();
|
||||||
|
|
||||||
// Guaranteed to be before any other functions are called
|
// Guaranteed to be before any other functions are called
|
||||||
inline virtual void OnPreparePrinting() { }
|
virtual void OnPreparePrinting() { }
|
||||||
|
|
||||||
virtual bool HasPage(int page);
|
virtual bool HasPage(int page);
|
||||||
virtual bool OnPrintPage(int page) = 0;
|
virtual bool OnPrintPage(int page) = 0;
|
||||||
virtual void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo);
|
virtual void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo);
|
||||||
|
|
||||||
inline virtual wxString GetTitle() const { return m_printoutTitle; }
|
virtual wxString GetTitle() const { return m_printoutTitle; }
|
||||||
|
|
||||||
inline wxDC *GetDC() const { return m_printoutDC; }
|
wxDC *GetDC() const { return m_printoutDC; }
|
||||||
inline void SetDC(wxDC *dc) { m_printoutDC = dc; }
|
void SetDC(wxDC *dc) { m_printoutDC = dc; }
|
||||||
inline void SetPageSizePixels(int w, int h) { m_pageWidthPixels = w; m_pageHeightPixels = h; }
|
void SetPageSizePixels(int w, int h) { m_pageWidthPixels = w; m_pageHeightPixels = h; }
|
||||||
inline void GetPageSizePixels(int *w, int *h) const { *w = m_pageWidthPixels; *h = m_pageHeightPixels; }
|
void GetPageSizePixels(int *w, int *h) const { *w = m_pageWidthPixels; *h = m_pageHeightPixels; }
|
||||||
inline void SetPageSizeMM(int w, int h) { m_pageWidthMM = w; m_pageHeightMM = h; }
|
void SetPageSizeMM(int w, int h) { m_pageWidthMM = w; m_pageHeightMM = h; }
|
||||||
inline void GetPageSizeMM(int *w, int *h) const { *w = m_pageWidthMM; *h = m_pageHeightMM; }
|
void GetPageSizeMM(int *w, int *h) const { *w = m_pageWidthMM; *h = m_pageHeightMM; }
|
||||||
|
|
||||||
inline void SetPPIScreen(int x, int y) { m_PPIScreenX = x; m_PPIScreenY = y; }
|
void SetPPIScreen(int x, int y) { m_PPIScreenX = x; m_PPIScreenY = y; }
|
||||||
inline void GetPPIScreen(int *x, int *y) const { *x = m_PPIScreenX; *y = m_PPIScreenY; }
|
void GetPPIScreen(int *x, int *y) const { *x = m_PPIScreenX; *y = m_PPIScreenY; }
|
||||||
inline void SetPPIPrinter(int x, int y) { m_PPIPrinterX = x; m_PPIPrinterY = y; }
|
void SetPPIPrinter(int x, int y) { m_PPIPrinterX = x; m_PPIPrinterY = y; }
|
||||||
inline void GetPPIPrinter(int *x, int *y) const { *x = m_PPIPrinterX; *y = m_PPIPrinterY; }
|
void GetPPIPrinter(int *x, int *y) const { *x = m_PPIPrinterX; *y = m_PPIPrinterY; }
|
||||||
|
|
||||||
inline virtual bool IsPreview() const { return m_isPreview; }
|
virtual bool IsPreview() const { return m_isPreview; }
|
||||||
|
|
||||||
inline virtual void SetIsPreview(bool p) { m_isPreview = p; }
|
virtual void SetIsPreview(bool p) { m_isPreview = p; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString m_printoutTitle;
|
wxString m_printoutTitle;
|
||||||
@@ -142,9 +145,12 @@ class WXDLLEXPORT wxPreviewCanvas: public wxScrolledWindow
|
|||||||
DECLARE_CLASS(wxPreviewCanvas)
|
DECLARE_CLASS(wxPreviewCanvas)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPreviewCanvas(wxPrintPreviewBase *preview, wxWindow *parent,
|
wxPreviewCanvas(wxPrintPreviewBase *preview,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
wxWindow *parent,
|
||||||
long style = 0, const wxString& name = "canvas");
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = "canvas");
|
||||||
~wxPreviewCanvas();
|
~wxPreviewCanvas();
|
||||||
|
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
@@ -155,7 +161,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
wxPrintPreviewBase* m_printPreview;
|
wxPrintPreviewBase* m_printPreview;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -168,9 +174,13 @@ class WXDLLEXPORT wxPreviewFrame: public wxFrame
|
|||||||
DECLARE_CLASS(wxPreviewFrame)
|
DECLARE_CLASS(wxPreviewFrame)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPreviewFrame(wxPrintPreviewBase *preview, wxFrame *parent, const wxString& title = "Print Preview",
|
wxPreviewFrame(wxPrintPreviewBase *preview,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
wxFrame *parent,
|
||||||
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
|
const wxString& title = "Print Preview",
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = "frame");
|
||||||
~wxPreviewFrame();
|
~wxPreviewFrame();
|
||||||
|
|
||||||
void OnCloseWindow(wxCloseEvent& event);
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
@@ -183,7 +193,8 @@ protected:
|
|||||||
wxPreviewControlBar* m_controlBar;
|
wxPreviewControlBar* m_controlBar;
|
||||||
wxPrintPreviewBase* m_printPreview;
|
wxPrintPreviewBase* m_printPreview;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
private:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -212,15 +223,20 @@ class WXDLLEXPORT wxPreviewControlBar: public wxPanel
|
|||||||
DECLARE_CLASS(wxPreviewControlBar)
|
DECLARE_CLASS(wxPreviewControlBar)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPreviewControlBar(wxPrintPreviewBase *preview, long buttons,
|
wxPreviewControlBar(wxPrintPreviewBase *preview,
|
||||||
wxWindow *parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
long buttons,
|
||||||
long style = 0, const wxString& name = "panel");
|
wxWindow *parent,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = "panel");
|
||||||
~wxPreviewControlBar();
|
~wxPreviewControlBar();
|
||||||
|
|
||||||
virtual void CreateButtons();
|
virtual void CreateButtons();
|
||||||
virtual void SetZoomControl(int zoom);
|
virtual void SetZoomControl(int zoom);
|
||||||
virtual int GetZoomControl();
|
virtual int GetZoomControl();
|
||||||
inline virtual wxPrintPreviewBase *GetPrintPreview() const { return m_printPreview; }
|
virtual wxPrintPreviewBase *GetPrintPreview() const
|
||||||
|
{ return m_printPreview; }
|
||||||
|
|
||||||
void OnPrint(wxCommandEvent& event);
|
void OnPrint(wxCommandEvent& event);
|
||||||
void OnWindowClose(wxCommandEvent& event);
|
void OnWindowClose(wxCommandEvent& event);
|
||||||
@@ -238,7 +254,8 @@ protected:
|
|||||||
wxChoice* m_zoomControl;
|
wxChoice* m_zoomControl;
|
||||||
long m_buttonFlags;
|
long m_buttonFlags;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
private:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -251,21 +268,26 @@ class WXDLLEXPORT wxPrintPreviewBase: public wxObject
|
|||||||
DECLARE_CLASS(wxPrintPreviewBase)
|
DECLARE_CLASS(wxPrintPreviewBase)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPrintPreviewBase(wxPrintout *printout, wxPrintout *printoutForPrinting = (wxPrintout *) NULL, wxPrintDialogData *data = (wxPrintDialogData *) NULL);
|
wxPrintPreviewBase(wxPrintout *printout,
|
||||||
~wxPrintPreviewBase();
|
wxPrintout *printoutForPrinting = (wxPrintout *) NULL,
|
||||||
|
wxPrintDialogData *data = (wxPrintDialogData *) NULL);
|
||||||
|
wxPrintPreviewBase(wxPrintout *printout,
|
||||||
|
wxPrintout *printoutForPrinting,
|
||||||
|
wxPrintData *data);
|
||||||
|
virtual ~wxPrintPreviewBase();
|
||||||
|
|
||||||
virtual bool SetCurrentPage(int pageNum);
|
virtual bool SetCurrentPage(int pageNum);
|
||||||
inline int GetCurrentPage() const { return m_currentPage; };
|
int GetCurrentPage() const { return m_currentPage; };
|
||||||
|
|
||||||
inline void SetPrintout(wxPrintout *printout) { m_previewPrintout = printout; };
|
void SetPrintout(wxPrintout *printout) { m_previewPrintout = printout; };
|
||||||
inline wxPrintout *GetPrintout() const { return m_previewPrintout; };
|
wxPrintout *GetPrintout() const { return m_previewPrintout; };
|
||||||
inline wxPrintout *GetPrintoutForPrinting() const { return m_printPrintout; };
|
wxPrintout *GetPrintoutForPrinting() const { return m_printPrintout; };
|
||||||
|
|
||||||
inline void SetFrame(wxFrame *frame) { m_previewFrame = frame; };
|
void SetFrame(wxFrame *frame) { m_previewFrame = frame; };
|
||||||
inline void SetCanvas(wxWindow *canvas) { m_previewCanvas = canvas; };
|
void SetCanvas(wxWindow *canvas) { m_previewCanvas = canvas; };
|
||||||
|
|
||||||
inline virtual wxFrame *GetFrame() const { return m_previewFrame; }
|
virtual wxFrame *GetFrame() const { return m_previewFrame; }
|
||||||
inline virtual wxWindow *GetCanvas() const { return m_previewCanvas; }
|
virtual wxWindow *GetCanvas() const { return m_previewCanvas; }
|
||||||
|
|
||||||
// The preview canvas should call this from OnPaint
|
// The preview canvas should call this from OnPaint
|
||||||
virtual bool PaintPage(wxWindow *canvas, wxDC& dc);
|
virtual bool PaintPage(wxWindow *canvas, wxDC& dc);
|
||||||
@@ -273,20 +295,19 @@ public:
|
|||||||
// This draws a blank page onto the preview canvas
|
// This draws a blank page onto the preview canvas
|
||||||
virtual bool DrawBlankPage(wxWindow *canvas, wxDC& dc);
|
virtual bool DrawBlankPage(wxWindow *canvas, wxDC& dc);
|
||||||
|
|
||||||
// This is called by wxPrintPreview to render a page into
|
// This is called by wxPrintPreview to render a page into a wxMemoryDC.
|
||||||
// a wxMemoryDC.
|
|
||||||
virtual bool RenderPage(int pageNum);
|
virtual bool RenderPage(int pageNum);
|
||||||
|
|
||||||
inline wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
||||||
|
|
||||||
virtual void SetZoom(int percent);
|
virtual void SetZoom(int percent);
|
||||||
inline int GetZoom() const { return m_currentZoom; };
|
int GetZoom() const { return m_currentZoom; };
|
||||||
|
|
||||||
inline int GetMaxPage() const { return m_maxPage; }
|
int GetMaxPage() const { return m_maxPage; }
|
||||||
inline int GetMinPage() const { return m_minPage; }
|
int GetMinPage() const { return m_minPage; }
|
||||||
|
|
||||||
inline bool Ok() const { return m_isOk; }
|
bool Ok() const { return m_isOk; }
|
||||||
inline void SetOk(bool ok) { m_isOk = ok; }
|
void SetOk(bool ok) { m_isOk = ok; }
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// OVERRIDES
|
// OVERRIDES
|
||||||
@@ -317,8 +338,11 @@ protected:
|
|||||||
int m_pageHeight;
|
int m_pageHeight;
|
||||||
int m_minPage;
|
int m_minPage;
|
||||||
int m_maxPage;
|
int m_maxPage;
|
||||||
protected:
|
|
||||||
bool m_isOk;
|
bool m_isOk;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init(wxPrintout *printout, wxPrintout *printoutForPrinting);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -329,14 +353,18 @@ class WXDLLEXPORT wxPrintAbortDialog: public wxDialog
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPrintAbortDialog(wxWindow *parent,
|
wxPrintAbortDialog(wxWindow *parent,
|
||||||
const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxString& title,
|
||||||
long style = 0, const wxString& name = "dialog"):
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
wxDialog(parent, -1, title, pos, size, style, name)
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = "dialog")
|
||||||
|
: wxDialog(parent, -1, title, pos, size, style, name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnCancel(wxCommandEvent& event);
|
void OnCancel(wxCommandEvent& event);
|
||||||
|
|
||||||
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -12,8 +12,12 @@
|
|||||||
#ifndef _WX_UTILSH__
|
#ifndef _WX_UTILSH__
|
||||||
#define _WX_UTILSH__
|
#define _WX_UTILSH__
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "utils.h"
|
#pragma interface "utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/setup.h"
|
#include "wx/setup.h"
|
||||||
@@ -24,54 +28,88 @@
|
|||||||
|
|
||||||
#include "wx/ioswrap.h"
|
#include "wx/ioswrap.h"
|
||||||
|
|
||||||
class WXDLLEXPORT wxProcess;
|
|
||||||
|
|
||||||
#ifdef __X__
|
#ifdef __X__
|
||||||
#ifndef __VMS__
|
#include <dirent.h>
|
||||||
/*steve: these two are not known under VMS */
|
#include <unistd.h>
|
||||||
#include <dirent.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef __GNUWIN32__
|
// ----------------------------------------------------------------------------
|
||||||
#define stricmp strcasecmp
|
|
||||||
#define strnicmp strncasecmp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Forward declaration
|
// Forward declaration
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxProcess;
|
||||||
class WXDLLEXPORT wxFrame;
|
class WXDLLEXPORT wxFrame;
|
||||||
|
|
||||||
// Stupid ASCII macros
|
// FIXME should use wxStricmp() instead
|
||||||
#define wxToUpper(C) (((C) >= 'a' && (C) <= 'z')? (C) - 'a' + 'A': (C))
|
#ifdef __GNUWIN32__
|
||||||
#define wxToLower(C) (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C))
|
#define stricmp strcasecmp
|
||||||
|
#define strnicmp strncasecmp
|
||||||
|
#endif
|
||||||
|
|
||||||
// Return a string with the current date/time
|
// ----------------------------------------------------------------------------
|
||||||
WXDLLEXPORT wxString wxNow();
|
// Macros
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#define wxMax(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
|
#define wxMin(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// String functions (deprecated, use wxString)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Useful buffer (FIXME VZ: yeah, that is. To be removed!)
|
||||||
|
WXDLLEXPORT_DATA(extern char*) wxBuffer;
|
||||||
|
|
||||||
// Make a copy of this string using 'new'
|
// Make a copy of this string using 'new'
|
||||||
WXDLLEXPORT char* copystring(const char *s);
|
WXDLLEXPORT char* copystring(const char *s);
|
||||||
|
|
||||||
|
// Matches string one within string two regardless of case
|
||||||
|
WXDLLEXPORT bool StringMatch(char *one, char *two, bool subString = TRUE, bool exact = FALSE);
|
||||||
|
|
||||||
|
// A shorter way of using strcmp
|
||||||
|
#define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Miscellaneous functions
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Sound the bell
|
||||||
|
WXDLLEXPORT void wxBell(void) ;
|
||||||
|
|
||||||
|
// Get OS version
|
||||||
|
WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ;
|
||||||
|
|
||||||
|
// Return a string with the current date/time
|
||||||
|
WXDLLEXPORT wxString wxNow();
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Window ID management
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Generate a unique ID
|
// Generate a unique ID
|
||||||
WXDLLEXPORT long wxNewId();
|
WXDLLEXPORT long wxNewId();
|
||||||
#define NewId wxNewId
|
#if !defined(NewId) && defined(WXWIN_COMPATIBILITY)
|
||||||
|
#define NewId wxNewId
|
||||||
|
#endif
|
||||||
|
|
||||||
// Ensure subsequent IDs don't clash with this one
|
// Ensure subsequent IDs don't clash with this one
|
||||||
WXDLLEXPORT void wxRegisterId(long id);
|
WXDLLEXPORT void wxRegisterId(long id);
|
||||||
#define RegisterId wxRegisterId
|
#if !defined(RegisterId) && defined(WXWIN_COMPATIBILITY)
|
||||||
|
#define RegisterId wxRegisterId
|
||||||
|
#endif
|
||||||
|
|
||||||
// Return the current ID
|
// Return the current ID
|
||||||
WXDLLEXPORT long wxGetCurrentId();
|
WXDLLEXPORT long wxGetCurrentId();
|
||||||
|
|
||||||
// Useful buffer
|
// ----------------------------------------------------------------------------
|
||||||
WXDLLEXPORT_DATA(extern char*) wxBuffer;
|
// Various conversions
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WXDLLEXPORT_DATA(extern const char*) wxFloatToStringStr;
|
WXDLLEXPORT_DATA(extern const char*) wxFloatToStringStr;
|
||||||
WXDLLEXPORT_DATA(extern const char*) wxDoubleToStringStr;
|
WXDLLEXPORT_DATA(extern const char*) wxDoubleToStringStr;
|
||||||
|
|
||||||
// Various conversions
|
|
||||||
WXDLLEXPORT void StringToFloat(char *s, float *number);
|
WXDLLEXPORT void StringToFloat(char *s, float *number);
|
||||||
WXDLLEXPORT char* FloatToString(float number, const char *fmt = wxFloatToStringStr);
|
WXDLLEXPORT char* FloatToString(float number, const char *fmt = wxFloatToStringStr);
|
||||||
WXDLLEXPORT void StringToDouble(char *s, double *number);
|
WXDLLEXPORT void StringToDouble(char *s, double *number);
|
||||||
@@ -81,12 +119,6 @@ WXDLLEXPORT void StringToLong(char *s, long *number);
|
|||||||
WXDLLEXPORT char* IntToString(int number);
|
WXDLLEXPORT char* IntToString(int number);
|
||||||
WXDLLEXPORT char* LongToString(long number);
|
WXDLLEXPORT char* LongToString(long number);
|
||||||
|
|
||||||
// Matches string one within string two regardless of case
|
|
||||||
WXDLLEXPORT bool StringMatch(char *one, char *two, bool subString = TRUE, bool exact = FALSE);
|
|
||||||
|
|
||||||
// A shorter way of using strcmp
|
|
||||||
#define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
|
|
||||||
|
|
||||||
// Convert 2-digit hex number to decimal
|
// Convert 2-digit hex number to decimal
|
||||||
WXDLLEXPORT int wxHexToDec(const wxString& buf);
|
WXDLLEXPORT int wxHexToDec(const wxString& buf);
|
||||||
|
|
||||||
@@ -94,15 +126,41 @@ WXDLLEXPORT int wxHexToDec(const wxString& buf);
|
|||||||
WXDLLEXPORT void wxDecToHex(int dec, char *buf);
|
WXDLLEXPORT void wxDecToHex(int dec, char *buf);
|
||||||
WXDLLEXPORT wxString wxDecToHex(int dec);
|
WXDLLEXPORT wxString wxDecToHex(int dec);
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Process management
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Execute another program. Returns 0 if there was an error, a PID otherwise.
|
// Execute another program. Returns 0 if there was an error, a PID otherwise.
|
||||||
WXDLLEXPORT long wxExecute(char **argv, bool sync = FALSE,
|
WXDLLEXPORT long wxExecute(char **argv, bool sync = FALSE,
|
||||||
wxProcess *process = (wxProcess *) NULL);
|
wxProcess *process = (wxProcess *) NULL);
|
||||||
WXDLLEXPORT long wxExecute(const wxString& command, bool sync = FALSE,
|
WXDLLEXPORT long wxExecute(const wxString& command, bool sync = FALSE,
|
||||||
wxProcess *process = (wxProcess *) NULL);
|
wxProcess *process = (wxProcess *) NULL);
|
||||||
|
|
||||||
#define wxSIGTERM 1
|
enum wxSignal
|
||||||
|
{
|
||||||
|
wxSIGNONE = 0, // verify if the process exists under Unix
|
||||||
|
wxSIGHUP,
|
||||||
|
wxSIGINT,
|
||||||
|
wxSIGQUIT,
|
||||||
|
wxSIGILL,
|
||||||
|
wxSIGTRAP,
|
||||||
|
wxSIGABRT,
|
||||||
|
wxSIGIOT = wxSIGABRT, // another name
|
||||||
|
wxSIGEMT,
|
||||||
|
wxSIGFPE,
|
||||||
|
wxSIGKILL,
|
||||||
|
wxSIGBUS,
|
||||||
|
wxSIGSEGV,
|
||||||
|
wxSIGSYS,
|
||||||
|
wxSIGPIPE,
|
||||||
|
wxSIGALRM,
|
||||||
|
wxSIGTERM
|
||||||
|
|
||||||
WXDLLEXPORT int wxKill(long pid, int sig=wxSIGTERM);
|
// further signals are different in meaning between different Unix systems
|
||||||
|
};
|
||||||
|
|
||||||
|
// the argument is ignored under Windows - the process is always killed
|
||||||
|
WXDLLEXPORT int wxKill(long pid, wxSignal sig = wxSIGTERM);
|
||||||
|
|
||||||
// Execute a command in an interactive shell window
|
// Execute a command in an interactive shell window
|
||||||
// If no command then just the shell
|
// If no command then just the shell
|
||||||
@@ -117,35 +175,49 @@ WXDLLEXPORT void wxUsleep(unsigned long milliseconds);
|
|||||||
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
|
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
|
||||||
WXDLLEXPORT long wxGetFreeMemory();
|
WXDLLEXPORT long wxGetFreeMemory();
|
||||||
|
|
||||||
// Consume all events until no more left
|
// ----------------------------------------------------------------------------
|
||||||
WXDLLEXPORT void wxFlushEvents();
|
// Network and username functions.
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
/*
|
// NB: "char *" functions are deprecated, use wxString ones!
|
||||||
* Network and username functions.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Get eMail address
|
// Get eMail address
|
||||||
WXDLLEXPORT bool wxGetEmailAddress(char *buf, int maxSize);
|
WXDLLEXPORT bool wxGetEmailAddress(char *buf, int maxSize);
|
||||||
|
WXDLLEXPORT wxString wxGetEmailAddress();
|
||||||
|
|
||||||
// Get hostname.
|
// Get hostname.
|
||||||
WXDLLEXPORT bool wxGetHostName(char *buf, int maxSize);
|
WXDLLEXPORT bool wxGetHostName(char *buf, int maxSize);
|
||||||
WXDLLEXPORT bool wxGetHostName(wxString& buf);
|
WXDLLEXPORT wxString wxGetHostName();
|
||||||
|
|
||||||
// Get user ID e.g. jacs
|
// Get FQDN
|
||||||
|
WXDLLEXPORT wxString wxGetFullHostName();
|
||||||
|
|
||||||
|
// Get user ID e.g. jacs (this is known as login name under Unix)
|
||||||
WXDLLEXPORT bool wxGetUserId(char *buf, int maxSize);
|
WXDLLEXPORT bool wxGetUserId(char *buf, int maxSize);
|
||||||
WXDLLEXPORT bool wxGetUserId(wxString& buf);
|
WXDLLEXPORT wxString wxGetUserId();
|
||||||
|
|
||||||
// Get user name e.g. Julian Smart
|
// Get user name e.g. Julian Smart
|
||||||
WXDLLEXPORT bool wxGetUserName(char *buf, int maxSize);
|
WXDLLEXPORT bool wxGetUserName(char *buf, int maxSize);
|
||||||
WXDLLEXPORT bool wxGetUserName(wxString& buf);
|
WXDLLEXPORT wxString wxGetUserName();
|
||||||
|
|
||||||
|
// Get current Home dir and copy to dest (returns pstr->c_str())
|
||||||
|
WXDLLEXPORT const char* wxGetHomeDir(wxString *pstr);
|
||||||
|
|
||||||
|
// Get the user's home dir (caller must copy --- volatile)
|
||||||
|
// returns NULL is no HOME dir is known
|
||||||
|
WXDLLEXPORT char* wxGetUserHome(const wxString& user = wxEmptyString);
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Strip out any menu codes
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
/*
|
|
||||||
* Strip out any menu codes
|
|
||||||
*/
|
|
||||||
WXDLLEXPORT char* wxStripMenuCodes(char *in, char *out = (char *) NULL);
|
WXDLLEXPORT char* wxStripMenuCodes(char *in, char *out = (char *) NULL);
|
||||||
WXDLLEXPORT wxString wxStripMenuCodes(const wxString& str);
|
WXDLLEXPORT wxString wxStripMenuCodes(const wxString& str);
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Window search
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Find the window/widget with the given title or label.
|
// Find the window/widget with the given title or label.
|
||||||
// Pass a parent to begin the search from, or NULL to look through
|
// Pass a parent to begin the search from, or NULL to look through
|
||||||
// all windows.
|
// all windows.
|
||||||
@@ -157,16 +229,9 @@ WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent
|
|||||||
// Returns menu item id or -1 if none.
|
// Returns menu item id or -1 if none.
|
||||||
WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
|
WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
|
||||||
|
|
||||||
/*
|
// ----------------------------------------------------------------------------
|
||||||
#if (!defined(__MINMAX_DEFINED) && !defined(max))
|
// Message/event queue helpers
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
// ----------------------------------------------------------------------------
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
#define __MINMAX_DEFINED 1
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define wxMax(a,b) (((a) > (b)) ? (a) : (b))
|
|
||||||
#define wxMin(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
|
|
||||||
// Yield to other apps/messages
|
// Yield to other apps/messages
|
||||||
WXDLLEXPORT bool wxYield();
|
WXDLLEXPORT bool wxYield();
|
||||||
@@ -174,15 +239,16 @@ WXDLLEXPORT bool wxYield();
|
|||||||
// Yield to other apps/messages and disable user input
|
// Yield to other apps/messages and disable user input
|
||||||
WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL);
|
WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL);
|
||||||
|
|
||||||
// Format a message on the standard error (UNIX) or the debugging
|
// Check whether this window wants to process messages, e.g. Stop button
|
||||||
// stream (Windows)
|
// in long calculations.
|
||||||
WXDLLEXPORT void wxDebugMsg(const char *fmt ...) ;
|
WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd);
|
||||||
|
|
||||||
// Sound the bell
|
// Consume all events until no more left
|
||||||
WXDLLEXPORT void wxBell(void) ;
|
WXDLLEXPORT void wxFlushEvents();
|
||||||
|
|
||||||
// Get OS version
|
// ----------------------------------------------------------------------------
|
||||||
WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ;
|
// Cursors
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Set the cursor to the busy cursor for all windows
|
// Set the cursor to the busy cursor for all windows
|
||||||
class WXDLLEXPORT wxCursor;
|
class WXDLLEXPORT wxCursor;
|
||||||
@@ -205,7 +271,13 @@ public:
|
|||||||
{ wxEndBusyCursor(); }
|
{ wxEndBusyCursor(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Error message functions used by wxWindows
|
// ----------------------------------------------------------------------------
|
||||||
|
// Error message functions used by wxWindows (deprecated, use wxLog)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Format a message on the standard error (UNIX) or the debugging
|
||||||
|
// stream (Windows)
|
||||||
|
WXDLLEXPORT void wxDebugMsg(const char *fmt ...) ;
|
||||||
|
|
||||||
// Non-fatal error (continues)
|
// Non-fatal error (continues)
|
||||||
WXDLLEXPORT_DATA(extern const char*) wxInternalErrorStr;
|
WXDLLEXPORT_DATA(extern const char*) wxInternalErrorStr;
|
||||||
@@ -215,7 +287,10 @@ WXDLLEXPORT void wxError(const wxString& msg, const wxString& title = wxInternal
|
|||||||
WXDLLEXPORT_DATA(extern const char*) wxFatalErrorStr;
|
WXDLLEXPORT_DATA(extern const char*) wxFatalErrorStr;
|
||||||
WXDLLEXPORT void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
|
WXDLLEXPORT void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
// Reading and writing resources (eg WIN.INI, .Xdefaults)
|
// Reading and writing resources (eg WIN.INI, .Xdefaults)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_RESOURCES
|
#if wxUSE_RESOURCES
|
||||||
WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = wxEmptyString);
|
WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = wxEmptyString);
|
||||||
WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = wxEmptyString);
|
WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = wxEmptyString);
|
||||||
@@ -228,17 +303,6 @@ WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, l
|
|||||||
WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = wxEmptyString);
|
WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = wxEmptyString);
|
||||||
#endif // wxUSE_RESOURCES
|
#endif // wxUSE_RESOURCES
|
||||||
|
|
||||||
// Get current Home dir and copy to dest (returns pstr->c_str())
|
|
||||||
WXDLLEXPORT const char* wxGetHomeDir(wxString *pstr);
|
|
||||||
|
|
||||||
// Get the user's home dir (caller must copy--- volatile)
|
|
||||||
// returns NULL is no HOME dir is known
|
|
||||||
WXDLLEXPORT char* wxGetUserHome(const wxString& user = wxEmptyString);
|
|
||||||
|
|
||||||
// Check whether this window wants to process messages, e.g. Stop button
|
|
||||||
// in long calculations.
|
|
||||||
WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd);
|
|
||||||
|
|
||||||
void WXDLLEXPORT wxGetMousePosition( int* x, int* y );
|
void WXDLLEXPORT wxGetMousePosition( int* x, int* y );
|
||||||
|
|
||||||
// MSW only: get user-defined resource from the .res file.
|
// MSW only: get user-defined resource from the .res file.
|
||||||
@@ -251,13 +315,16 @@ WXDLLEXPORT char* wxLoadUserResource(const wxString& resourceName, const wxStrin
|
|||||||
// input/output
|
// input/output
|
||||||
WXDLLEXPORT void wxRedirectIOToConsole();
|
WXDLLEXPORT void wxRedirectIOToConsole();
|
||||||
|
|
||||||
#endif
|
#endif // MSW
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Display and colorss (X only)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// X only
|
|
||||||
#ifdef __X__
|
#ifdef __X__
|
||||||
WXDisplay *wxGetDisplay();
|
WXDisplay *wxGetDisplay();
|
||||||
bool wxSetDisplay(const wxString& display_name);
|
bool wxSetDisplay(const wxString& display_name);
|
||||||
wxString wxGetDisplayName();
|
wxString wxGetDisplayName();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __X__
|
#ifdef __X__
|
||||||
@@ -278,9 +345,6 @@ typedef struct wx_hsv {
|
|||||||
#define wxMax3(x,y,z) ((x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z))
|
#define wxMax3(x,y,z) ((x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z))
|
||||||
#define wxMin3(x,y,z) ((x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z))
|
#define wxMin3(x,y,z) ((x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z))
|
||||||
|
|
||||||
#define wxMax2(x,y) ((x > y) ? x : y)
|
|
||||||
#define wxMin2(x,y) ((x < y) ? x : y)
|
|
||||||
|
|
||||||
void wxHSVToXColor(wxHSV *hsv,XColor *xcolor);
|
void wxHSVToXColor(wxHSV *hsv,XColor *xcolor);
|
||||||
void wxXColorToHSV(wxHSV *hsv,XColor *xcolor);
|
void wxXColorToHSV(wxHSV *hsv,XColor *xcolor);
|
||||||
void wxAllocNearestColor(Display *display,Colormap colormap,XColor *xcolor);
|
void wxAllocNearestColor(Display *display,Colormap colormap,XColor *xcolor);
|
||||||
|
Reference in New Issue
Block a user