From 5360828db9ece34c6c7dc81ec7b4a294e6cd5cd5 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 31 Aug 1999 12:03:05 +0000 Subject: [PATCH] Added Set/GetSelection to wxPrintDialogData (the value of the Selection radio button); corrected bug in cursor.cpp (used wxIconRefData). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/print.tex | 14 ++++++++++++++ include/wx/cmndata.h | 3 +++ src/common/cmndata.cpp | 7 ++++++- src/msw/cursor.cpp | 4 ++-- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/latex/wx/print.tex b/docs/latex/wx/print.tex index 96af356c34..c8510ba8d0 100644 --- a/docs/latex/wx/print.tex +++ b/docs/latex/wx/print.tex @@ -457,6 +457,13 @@ Returns a reference to the internal wxPrintData object. Returns TRUE if the user has selected printing to a file. +\membersection{wxPrintDialogData::GetSelection}\label{wxprintdialogdatagetselection} + +\constfunc{bool}{GetSelection}{\void} + +Returns TRUE if the user requested that the selection be printed (where 'selection' is +a concept specific to the application). + \membersection{wxPrintDialogData::GetToPage}\label{wxprintdialogdatagettopage} \constfunc{int}{GetToPage}{\void} @@ -505,6 +512,13 @@ Sets the internal wxPrintData. Sets the 'Print to file' checkbox to TRUE or FALSE. +\membersection{wxPrintDialogData::SetSelection}\label{wxprintdialogdatasetselection} + +\func{void}{SetSelection}{\param{bool}{ flag}} + +Selects the 'Selection' radio button. The effect of printing the selection depends on how the application +implements this command, if at all. + \membersection{wxPrintDialogData::SetSetupDialog}\label{wxprintdialogdatasetsetupdialog} \func{void}{SetSetupDialog}{\param{bool }{flag}} diff --git a/include/wx/cmndata.h b/include/wx/cmndata.h index 178e58668c..82768cc4e3 100644 --- a/include/wx/cmndata.h +++ b/include/wx/cmndata.h @@ -222,6 +222,7 @@ class WXDLLEXPORT wxPrintDialogData: public wxObject int GetMaxPage() const { return m_printMaxPage; }; int GetNoCopies() const { return m_printNoCopies; }; bool GetAllPages() const { return m_printAllPages; }; + bool GetSelection() const { return m_printSelection; }; bool GetCollate() const { return m_printCollate; }; bool GetPrintToFile() const { return m_printToFile; }; bool GetSetupDialog() const { return m_printSetupDialog; }; @@ -232,6 +233,7 @@ class WXDLLEXPORT wxPrintDialogData: public wxObject void SetMaxPage(int v) { m_printMaxPage = v; }; void SetNoCopies(int v) { m_printNoCopies = v; }; void SetAllPages(bool flag) { m_printAllPages = flag; }; + void SetSelection(bool flag) { m_printSelection = flag; }; void SetCollate(bool flag) { m_printCollate = flag; }; void SetPrintToFile(bool flag) { m_printToFile = flag; }; void SetSetupDialog(bool flag) { m_printSetupDialog = flag; }; @@ -274,6 +276,7 @@ private: bool m_printAllPages; bool m_printCollate; bool m_printToFile; + bool m_printSelection; bool m_printEnableSelection; bool m_printEnablePageNumbers; bool m_printEnableHelp; diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 018cd49bb3..0b621274e9 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -677,6 +677,7 @@ wxPrintDialogData::wxPrintDialogData() m_printAllPages = FALSE; m_printCollate = FALSE; m_printToFile = FALSE; + m_printSelection = FALSE; m_printEnableSelection = FALSE; m_printEnablePageNumbers = TRUE; m_printEnablePrintToFile = TRUE; @@ -702,6 +703,7 @@ wxPrintDialogData::wxPrintDialogData(const wxPrintData& printData) m_printAllPages = FALSE; m_printCollate = FALSE; m_printToFile = FALSE; + m_printSelection = FALSE; m_printEnableSelection = FALSE; m_printEnablePageNumbers = TRUE; m_printEnablePrintToFile = TRUE; @@ -789,6 +791,8 @@ void wxPrintDialogData::ConvertToNative() if ( m_printAllPages ) pd->Flags |= PD_ALLPAGES; + if ( m_printAllPages ) + pd->Flags |= PD_SELECTION; if ( m_printCollate ) pd->Flags |= PD_COLLATE; if ( m_printToFile ) @@ -834,6 +838,7 @@ void wxPrintDialogData::ConvertFromNative() m_printNoCopies = pd->nCopies ; m_printAllPages = ((pd->Flags & PD_ALLPAGES) == PD_ALLPAGES); + m_printSelection = ((pd->Flags & PD_SELECTION) == PD_SELECTION); m_printCollate = ((pd->Flags & PD_COLLATE) == PD_COLLATE); m_printToFile = ((pd->Flags & PD_PRINTTOFILE) == PD_PRINTTOFILE); m_printEnablePrintToFile = ((pd->Flags & PD_DISABLEPRINTTOFILE) != PD_DISABLEPRINTTOFILE); @@ -881,6 +886,7 @@ void wxPrintDialogData::operator=(const wxPrintDialogData& data) m_printAllPages = data.m_printAllPages; m_printCollate = data.m_printCollate; m_printToFile = data.m_printToFile; + m_printSelection = data.m_printSelection; m_printEnableSelection = data.m_printEnableSelection; m_printEnablePageNumbers = data.m_printEnablePageNumbers; m_printEnableHelp = data.m_printEnableHelp; @@ -1013,7 +1019,6 @@ void wxPageSetupDialogData::ConvertToNative() pd->hDevMode = NULL; } - pd->hDevMode = (HGLOBAL) m_printData.GetNativeData(); m_printData.SetNativeData((void*) NULL); diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 3ad8200c69..3ae986e719 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -73,7 +73,7 @@ wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSE wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY) { - m_refData = new wxIconRefData; + m_refData = new wxCursorRefData; M_CURSORDATA->m_destroyCursor = FALSE; M_CURSORDATA->m_hCursor = 0; @@ -125,7 +125,7 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho // Cursors by stock number wxCursor::wxCursor(int cursor_type) { - m_refData = new wxIconRefData; + m_refData = new wxCursorRefData; switch (cursor_type) { -- 2.45.2