#include <optsprin.h>
Inheritance diagram for PrintBaseTab:
Public Member Functions | |
PrintBaseTab () | |
PrintBaseTab constructor. | |
~PrintBaseTab () | |
PrintBaseTab destructor. | |
virtual BOOL | InitSection () |
Sets initial values for the print general section of the options dialog box. | |
virtual BOOL | HandleMsg (DialogMsg *Msg) |
Handles any print options tabs messages that the derived class is not interested in handlign themselves. Should be called by the derived class for any events they don't handle. | |
virtual BOOL | GreySection () |
Called when the user has closed all documents. | |
virtual BOOL | UngreySection () |
Called when the user has selected a new document. | |
virtual BOOL | UpdateSection (String_256 *DocumentName) |
Called when we have switched to a new document and need to update all the controls on this tab. Should only init the tab if the page is present. | |
virtual BOOL | PageSizeHasChanged () |
Allows a tab to update any page size items being displayed. | |
virtual BOOL | IsDocumentOption () |
Allows the document options dialog code to determine if this tab belongs to the group of document options. | |
virtual BOOL | IsProgramOption () |
Allows the program options dialog code to determine if this tab belongs to the group of program options. | |
virtual BOOL | IsPrintingOption () |
Allows the printing options dialog code to determine if this tab belongs to the group of printing options. | |
BOOL | IsAllGreyed () |
void | PrintSettingsChanged () |
Called by AppPrefsDlg::Message() when it received a PrintMsg::SETTINGSCHANGED message. | |
Static Public Member Functions | |
static void | DocumentSettingsUpdated (void) |
Copies the current document print control into our locl print control copy Called by the AppPrefs base dialogue when we soft-commit with the Apply button. | |
Protected Member Functions | |
void | CopyLocalPrintControlFromDoc (void) |
Copies the current document print control into our locl print control copy (i.e. copies the current document configuration into our local copy, either initialising the values that the dialogue should be using, or effectively "cancelling" any user changes made in the dialogue. Note that you'll have to call updatesection to update the dialogue to use the new settings. | |
void | CopyLocalPrintControlToDoc (void) |
Copies our local print control copy into the current document (i.e. commits the local dialogue values into the document). | |
virtual BOOL | CommitSection () |
Commits values from the print dialogue tabs to the document. Should be called by all derived classes. | |
PrintControl * | GetPrintControl () |
Access function to the doc's print control object. | |
void | EnableControl (CGadgetID Gadget, BOOL Enabled) |
This will enable the gadget given if Enabled is TRUE AND AllGreyed is FALSE, i.e. it is a central control-greying func that takes the AllGreyed state of the tab into account. | |
BOOL | TalkToPage () |
This calls pPrefsDlg->TalkToPage() with the ID returned from GetPageID(). | |
virtual BOOL | EnableControls ()=0 |
virtual BOOL | ShowDetails ()=0 |
Static Protected Attributes | |
static PrintControl | LocalPrintControl |
static Document * | pLastPrintControlDocument = NULL |
Private Member Functions | |
void | UpdateDocName () |
This displays the doc name returned from GetDocumentName() in the tab If it can't do it for some reason (i.e. NULL dlg ptr) it just returns. | |
Private Attributes | |
BOOL | AllGreyed |
Friends | |
class | SepsDlg |
Definition at line 126 of file optsprin.h.
|
PrintBaseTab constructor.
Definition at line 203 of file optsprin.cpp.
|
|
PrintBaseTab destructor.
Definition at line 225 of file optsprin.cpp. 00226 { 00227 // Vape the cached print control info 00228 pLastPrintControlDocument = NULL; 00229 00230 // Clear out the entire print control to sensible defaults. This includes wiping the 00231 // plate list, which ensures there are no IndexedColours left "in use" when we exit 00232 PrintControl BlankPC; 00233 LocalPrintControl = BlankPC; 00234 }
|
|
Commits values from the print dialogue tabs to the document. Should be called by all derived classes.
Implements OptionsTabs. Reimplemented in PrintGeneralTab, PrintLayoutTab, PrintSepsTab, and PrintImagesetterTab. Definition at line 830 of file optsprin.cpp. 00831 { 00832 if (!IsAllGreyed() && pDocument != NULL) 00833 CopyLocalPrintControlToDoc(); 00834 00835 pLastPrintControlDocument = NULL; 00836 00837 return(TRUE); 00838 }
|
|
Copies the current document print control into our locl print control copy (i.e. copies the current document configuration into our local copy, either initialising the values that the dialogue should be using, or effectively "cancelling" any user changes made in the dialogue. Note that you'll have to call updatesection to update the dialogue to use the new settings.
Notes: This caches the print control information for the options dialogue document. Subsequent calls don't bother doing anything, on the grounds that due to the random times at which our tabs are initialised, they can try to copy the doc information into the local control when doing so will overwrite changed but non-committed values for this document. (e.g. without this caching lock on it, clicking the "do separations" button doesn't auto-update the "output printers marks" option in the other tab until you've "seen" that tab! Definition at line 536 of file optsprin.cpp. 00537 { 00538 // If cached for this document, don't copy it again, because this could lose settings 00539 // which have been changed in the dialogue but not yet committed. 00540 if (pLastPrintControlDocument == pDocument) 00541 return; 00542 00543 PrintControl *PrintCtrl = GetPrintControl(); 00544 if (PrintCtrl != NULL) 00545 { 00546 LocalPrintControl = *PrintCtrl; 00547 LocalPrintControl.SetUp(pDocument->GetSelectedSpread()); 00548 00549 pLastPrintControlDocument = pDocument; 00550 } 00551 }
|
|
Copies our local print control copy into the current document (i.e. commits the local dialogue values into the document).
Definition at line 604 of file optsprin.cpp. 00605 { 00606 PrintControl *PrintCtrl = GetPrintControl(); 00607 if (PrintCtrl != NULL) 00608 { 00609 *PrintCtrl = LocalPrintControl; 00610 if (pDocument) // If we have just changed document settings 00611 pDocument->SetModified(TRUE); // Then mark the document modified!!! 00612 } 00613 }
|
|
Copies the current document print control into our locl print control copy Called by the AppPrefs base dialogue when we soft-commit with the Apply button.
Definition at line 566 of file optsprin.cpp. 00567 { 00568 Document *pDoc = Document::GetSelected(); 00569 if (pDoc != NULL) 00570 { 00571 PrintComponent* pPrComp = (PrintComponent*)pDoc->GetDocComponent(CC_RUNTIME_CLASS(PrintComponent)); 00572 if (pPrComp != NULL) 00573 { 00574 PrintControl* pPrCtrl = pPrComp->GetPrintControl(); 00575 if (pPrCtrl != NULL) 00576 { 00577 LocalPrintControl = *pPrCtrl; 00578 LocalPrintControl.SetUp(pDoc->GetSelectedSpread()); 00579 00580 pLastPrintControlDocument = pDoc; 00581 } 00582 } 00583 } 00584 }
|
|
This will enable the gadget given if Enabled is TRUE AND AllGreyed is FALSE, i.e. it is a central control-greying func that takes the AllGreyed state of the tab into account.
Definition at line 701 of file optsprin.cpp. 00702 { 00703 00704 // Code to comment out non-functional aspects of the print dlg (18/4/95) 00705 /* 00706 if (Gadget != _R(IDC_GROUP_PRINTMETHOD) && 00707 Gadget != _R(IDC_PRINTMETHOD_NORMAL) && 00708 Gadget != _R(IDC_PRINTMETHOD_BITMAP) && 00709 Gadget != _R(IDC_PRINTMETHOD_AABITMAP) && 00710 00711 Gadget != _R(IDC_GROUP_DPI) && 00712 Gadget != _R(IDC_DPIAUTO) && 00713 Gadget != _R(IDC_DPIMANUAL) && 00714 Gadget != _R(IDC_DPIEDIT) && 00715 Gadget != _R(IDC_DPIEDITTEXT)) 00716 { 00717 Enabled = FALSE; 00718 } 00719 */ 00720 if (pPrefsDlg != NULL) 00721 pPrefsDlg->EnableGadget(Gadget,Enabled && !AllGreyed); 00722 }
|
|
Implemented in PrintGeneralTab, PrintLayoutTab, PrintSepsTab, and PrintImagesetterTab. |
|
Access function to the doc's print control object.
Definition at line 489 of file optsprin.cpp. 00490 { 00491 // Return NULL if we don't have a document ptr 00492 if (pDocument == NULL) 00493 return NULL; 00494 00495 // Find the doc's print component 00496 PrintComponent* pPrComp = (PrintComponent*)pDocument->GetDocComponent(CC_RUNTIME_CLASS(PrintComponent)); 00497 ERROR2IF(pPrComp == NULL,NULL,"Can't find the associated doc's print component"); 00498 00499 // Find a ptr to the print component's print control object 00500 PrintControl* pPrCtrl = pPrComp->GetPrintControl(); 00501 ERROR2IF(pPrCtrl == NULL,NULL,"The doc's print component gave me a NULL print control object"); 00502 00503 return pPrCtrl; 00504 }
|
|
Called when the user has closed all documents.
Reimplemented from OptionsTabs. Reimplemented in PrintSepsTab, and PrintImagesetterTab. Definition at line 371 of file optsprin.cpp. 00372 { 00373 ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintBaseTab::GreySection called with no dialog pointer"); 00374 00375 // Vape the cached print control info 00376 pLastPrintControlDocument = NULL; 00377 00378 // Clear out the entire print control to sensible defaults. This includes wiping the 00379 // plate list, which ensures there are no IndexedColours left "in use" when we exit 00380 PrintControl BlankPC; 00381 LocalPrintControl = BlankPC; 00382 00383 if (TalkToPage()) 00384 { 00385 // Make sure the information field displaying the name of the current document 00386 // is correct. 00387 UpdateDocName(); 00388 00389 AllGreyed = TRUE; 00390 EnableControls(); // Call our central greying/ungreying function 00391 } 00392 00393 return TRUE; 00394 }
|
|
Handles any print options tabs messages that the derived class is not interested in handlign themselves. Should be called by the derived class for any events they don't handle.
DIM_CANCEL - vapes the cached PrintControl info, so that cancel really does cancel! Implements OptionsTabs. Reimplemented in PrintGeneralTab, PrintLayoutTab, PrintSepsTab, and PrintImagesetterTab. Definition at line 773 of file optsprin.cpp. 00774 { 00775 ERROR2IF(Msg == NULL,FALSE,"PrintGeneralTab::Message null message received"); 00776 ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintGeneralTab::HandleMsg called with no dialog pointer"); 00777 00778 BOOL ok = TalkToPage(); // The print general tab identifier 00779 if (!ok) 00780 return TRUE; // page not present 00781 00782 switch(Msg->DlgMsg) 00783 { 00784 case DIM_CREATE: // Initialise controls 00785 ok = InitSection(); 00786 if (!ok) 00787 InformError(); 00788 else 00789 ShowDetails(); // The base class InitSection() no longer does this by default 00790 break; 00791 00792 00793 case DIM_CANCEL: 00794 { 00795 // Vape the cached print control info 00796 pLastPrintControlDocument = NULL; 00797 00798 // Clear out the entire print control to sensible defaults. This includes wiping the 00799 // plate list, which ensures there are no IndexedColours left "in use" when we exit 00800 PrintControl BlankPC; 00801 LocalPrintControl = BlankPC; 00802 break; 00803 } 00804 00805 default: 00806 break; 00807 } 00808 00809 return TRUE; 00810 }
|
|
Sets initial values for the print general section of the options dialog box.
Implements OptionsTabs. Reimplemented in PrintLayoutTab, PrintSepsTab, and PrintImagesetterTab. Definition at line 631 of file optsprin.cpp. 00632 { 00633 ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintBaseTab::InitSection called with no dialog pointer"); 00634 00635 if (pDocument == NULL) 00636 return GreySection(); 00637 00638 AllGreyed = FALSE; // we are ungreyed by default 00639 00640 // Make sure the information field displaying the name of the current document 00641 // is correct. 00642 UpdateDocName(); 00643 00644 // Copy the doc's print control data into our local copy 00645 CopyLocalPrintControlFromDoc(); 00646 00647 if (!TalkToPage()) 00648 return TRUE; // Just return if TalkToPage() fails 00649 00650 // Display the print data in our tab 00651 //return ShowDetails(); // I've commented this out as it should be done in the actual tab's init function - Adrian 00652 return TRUE; 00653 }
|
|
Definition at line 150 of file optsprin.h. 00150 { return AllGreyed; }
|
|
Allows the document options dialog code to determine if this tab belongs to the group of document options.
Implements OptionsTabs. Definition at line 254 of file optsprin.cpp. 00255 { 00256 return FALSE; // This tab is not a document option. Changed from True 3/3/97. 00257 }
|
|
Allows the printing options dialog code to determine if this tab belongs to the group of printing options.
Reimplemented from OptionsTabs. Definition at line 300 of file optsprin.cpp. 00301 { 00302 return TRUE; // This tab is a printing option 00303 }
|
|
Allows the program options dialog code to determine if this tab belongs to the group of program options.
Implements OptionsTabs. Definition at line 277 of file optsprin.cpp. 00278 { 00279 return FALSE; // This tab is not a program option. Changed from True 3/3/97. 00280 }
|
|
Allows a tab to update any page size items being displayed.
Reimplemented from OptionsTabs. Definition at line 672 of file optsprin.cpp. 00673 { 00674 // Sent when the page size has been changed 00675 LocalPrintControl.SetUp(pDocument->GetSelectedSpread()); 00676 00677 if (!TalkToPage()) 00678 return TRUE; // Just return if TalkToPage() fails 00679 00680 return ShowDetails(); 00681 }
|
|
Called by AppPrefsDlg::Message() when it received a PrintMsg::SETTINGSCHANGED message.
Definition at line 739 of file optsprin.cpp. 00740 { 00741 if (IsAllGreyed()) 00742 return; 00743 00744 // Set up the print again so that it takes the new settings on board 00745 LocalPrintControl.SetUp(pDocument->GetSelectedSpread()); 00746 00747 if (TalkToPage()) 00748 ShowDetails(); 00749 }
|
|
Implemented in PrintGeneralTab, PrintLayoutTab, PrintSepsTab, and PrintImagesetterTab. |
|
This calls pPrefsDlg->TalkToPage() with the ID returned from GetPageID().
Definition at line 322 of file optsprin.cpp. 00323 { 00324 if (pPrefsDlg != NULL) 00325 return (pPrefsDlg->TalkToPage(GetPageID())); 00326 00327 return FALSE; 00328 }
|
|
Called when the user has selected a new document.
Reimplemented from OptionsTabs. Reimplemented in PrintSepsTab, and PrintImagesetterTab. Definition at line 413 of file optsprin.cpp. 00414 { 00415 ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintBaseTab::UngreySection called with no dialog pointer"); 00416 00417 // Vape the cached print control info 00418 pLastPrintControlDocument = NULL; 00419 00420 // Clear out the entire print control to sensible defaults. This includes wiping the 00421 // plate list, which ensures there are no IndexedColours left "in use" when we exit 00422 PrintControl BlankPC; 00423 LocalPrintControl = BlankPC; 00424 00425 if (TalkToPage()) 00426 { 00427 // Make sure the information field displaying the name of the current document 00428 // is correct. 00429 UpdateDocName(); 00430 00431 AllGreyed = FALSE; 00432 00433 ShowDetails(); // Make sure all details have been updated to show the new document 00434 EnableControls(); // Call our central greying/ungreying function 00435 } 00436 00437 return TRUE; 00438 }
|
|
This displays the doc name returned from GetDocumentName() in the tab If it can't do it for some reason (i.e. NULL dlg ptr) it just returns.
Definition at line 348 of file optsprin.cpp. 00349 { 00350 if (pPrefsDlg != NULL && TalkToPage()) 00351 pPrefsDlg->SetStringGadgetValue(_R(IDC_PRINT_DOCNAME),*GetDocumentName()); 00352 }
|
|
Called when we have switched to a new document and need to update all the controls on this tab. Should only init the tab if the page is present.
Reimplemented from OptionsTabs. Reimplemented in PrintSepsTab, and PrintImagesetterTab. Definition at line 458 of file optsprin.cpp. 00459 { 00460 ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintBaseTab::UpdateSection called with no dialog pointer"); 00461 00462 if (!TalkToPage()) 00463 return TRUE; // Just return if TalkToPage() fails 00464 00465 // Call the normal init section code 00466 return InitSection(); 00467 }
|
|
Definition at line 185 of file optsprin.h. |
|
Definition at line 183 of file optsprin.h. |
|
Definition at line 178 of file optsprin.h. |
|
Definition at line 179 of file optsprin.h. |