]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/cmndata.cpp
added wxLocale::GetLanguageInfo()
[wxWidgets.git] / src / common / cmndata.cpp
index e09196f2fec9347e2525ae1caed4138b8f64209f..3eabda7f5099ffbf3ca65d27071a964644109bcf 100644 (file)
 #include "wx/cmndata.h"
 #include "wx/log.h"
 
-// For compatibility
-#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXX11__)|| defined(__WXPM__) || defined(__WXMAC__)) && wxUSE_POSTSCRIPT
-    #define wxCOMPATIBILITY_WITH_PRINTSETUPDATA 1
-#endif
+#if wxUSE_FONTDLG
+    #include "wx/fontdlg.h"
+#endif // wxUSE_FONTDLG
 
 #if wxUSE_PRINTING_ARCHITECTURE
     #include "wx/paper.h"
-
-    #if wxCOMPATIBILITY_WITH_PRINTSETUPDATA
-        #include "wx/generic/dcpsg.h"
-    #endif
 #endif // wxUSE_PRINTING_ARCHITECTURE
 
 #ifdef __WXMSW__
@@ -163,7 +158,7 @@ void wxColourData::operator=(const wxColourData& data)
 wxFontData::wxFontData()
 {
     // Intialize colour to black.
-    fontColour.Set(0, 0, 0);
+    fontColour = wxNullColour;
 
     showHelp = FALSE;
     allowSymbols = TRUE;
@@ -178,6 +173,14 @@ wxFontData::~wxFontData()
 {
 }
 
+#if wxUSE_FONTDLG
+
+wxFontDialogBase::~wxFontDialogBase()
+{
+}
+
+#endif // wxUSE_FONTDLG
+
 #if wxUSE_PRINTING_ARCHITECTURE
 // ----------------------------------------------------------------------------
 // Print data
@@ -192,16 +195,16 @@ wxPrintData::wxPrintData()
 #if TARGET_CARBON
     m_macPageFormat = kPMNoPageFormat;
     m_macPrintSettings = kPMNoPrintSettings;
-    
+
   #if PM_USE_SESSION_APIS
     PMPrintSession macPrintSession = kPMNoReference;
     OSStatus       err;
-    
+
     err = ::UMAPrOpen(&macPrintSession) ;
     if ( err == noErr )
-    {  
+    {
         err = PMCreatePageFormat((PMPageFormat *)&m_macPageFormat);
-        
+
         //  Note that PMPageFormat is not session-specific, but calling
         //  PMSessionDefaultPageFormat assigns values specific to the printer
         //  associated with the current printing session.
@@ -210,9 +213,9 @@ wxPrintData::wxPrintData()
             err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
                                              (PMPageFormat)m_macPageFormat);
         }
-        
+
         err = PMCreatePrintSettings((PMPrintSettings *)&m_macPrintSettings);
-        
+
         //  Note that PMPrintSettings is not session-specific, but calling
         //  PMSessionDefaultPrintSettings assigns values specific to the printer
         //  associated with the current printing session.
@@ -252,11 +255,26 @@ wxPrintData::wxPrintData()
     m_paperSize = wxSize(210, 297);
 
     // PostScript-specific data
-    m_printerCommand = "";
-    m_previewCommand = "";
-    m_printerOptions = "";
-    m_filename = "";
-    m_afmPath = "";
+    m_previewCommand = wxT("");
+    m_filename = wxT("");
+#ifdef __VMS__
+    m_printerCommand = wxT("print");
+    m_printerOptions = wxT("/nonotify/queue=psqueue");
+    m_afmPath = wxT("sys$ps_font_metrics:");
+#endif
+
+#ifdef __WXMSW__
+    m_printerCommand = wxT("print");
+    m_printerOptions = wxT("");
+    m_afmPath = wxT("c:\\windows\\system\\");
+#endif
+
+#if !defined(__VMS__) && !defined(__WXMSW__)
+    m_printerCommand = wxT("lpr");
+    m_printerOptions = wxT("");
+    m_afmPath = wxT("");
+#endif
+
     m_printerScaleX = 1.0;
     m_printerScaleY = 1.0;
     m_printerTranslateX = 0;
@@ -311,7 +329,7 @@ wxPrintData::~wxPrintData()
   #endif
         m_macPrintSettings = kPMNoPrintSettings;
     }
-    
+
 #else
     wxASSERT( m_macPrintSettings );
     // we should perhaps delete
@@ -827,32 +845,6 @@ void wxPrintData::operator=(const wxPrintData& data)
     m_printMode = data.m_printMode;
 }
 
-// For compatibility
-#if wxCOMPATIBILITY_WITH_PRINTSETUPDATA
-void wxPrintData::operator=(const wxPrintSetupData& setupData)
-{
-    SetPrinterCommand(setupData.GetPrinterCommand());
-    SetPreviewCommand(setupData.GetPrintPreviewCommand());
-    SetPrinterOptions(setupData.GetPrinterOptions());
-
-    long xt, yt;
-    setupData.GetPrinterTranslation(& xt, & yt);
-    SetPrinterTranslation(xt, yt);
-
-    double xs, ys;
-    setupData.GetPrinterScaling(& xs, & ys);
-    SetPrinterScaling(xs, ys);
-
-    SetOrientation(setupData.GetPrinterOrientation());
-    SetPrintMode((wxPrintMode) setupData.GetPrinterMode());
-    SetFontMetricPath(setupData.GetAFMPath());
-    if (setupData.GetPaperName() != "")
-        SetPaperId(wxThePrintPaperDatabase->ConvertNameToId(setupData.GetPaperName()));
-    SetColour(setupData.GetColour());
-    SetFilename(setupData.GetPrinterFile());
-}
-#endif // wxCOMPATIBILITY_WITH_PRINTSETUPDATA
-
 // Is this data OK for showing the print dialog?
 bool wxPrintData::Ok() const
 {
@@ -861,7 +853,7 @@ bool wxPrintData::Ok() const
     return (m_devMode != NULL) ;
 #else
     return TRUE;
-#endif    
+#endif
 }
 
 // ----------------------------------------------------------------------------