PrintLayoutTab Class Reference

Allows the user to set any options which are associated with general document printing. More...

#include <optsprin.h>

Inheritance diagram for PrintLayoutTab:

PrintBaseTab OptionsTabs ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PrintLayoutTab ()
 PrintLayoutTab constructor.
 ~PrintLayoutTab ()
 PrintLayoutTab destructor.
virtual BOOL HandleMsg (DialogMsg *Msg)
 Handles all the print layout options tabs messages.
virtual BOOL CommitSection ()
 Takes the values in the Print Layout section tab of the options dialog box and sets the associated preference values accordingly Called when ok is pressed on the dialog box.
virtual BOOL InitSection ()
 Sets initial values for the print layout section of the options dialog box. This section includes the:-.
virtual CDlgResID GetPageID ()

Private Member Functions

BOOL EnableControls ()
 The enables and disables the various controls depending on the values held in the given print control object.
virtual BOOL ShowDetails ()
 Sets values for the print layout section of the options dialog box.
BOOL ShowDetails (CGadgetID *pGadgetIDList, CGadgetID Exclude)
 Sets values for the print layout section of the options dialog box.

Detailed Description

Allows the user to set any options which are associated with general document printing.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/3/95
See also:
OptionsTabs; AppPrefsDlg; DocPrefsDlg;

Definition at line 237 of file optsprin.h.


Constructor & Destructor Documentation

PrintLayoutTab::PrintLayoutTab  ) 
 

PrintLayoutTab constructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1263 of file optsprin.cpp.

01264 {   
01265 }        

PrintLayoutTab::~PrintLayoutTab  ) 
 

PrintLayoutTab destructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1283 of file optsprin.cpp.

01284 {   
01285 }        


Member Function Documentation

BOOL PrintLayoutTab::CommitSection  )  [virtual]
 

Takes the values in the Print Layout section tab of the options dialog box and sets the associated preference values accordingly Called when ok is pressed on the dialog box.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if values in dialog box ok, False otherwise.

Errors: -

See also:
-

Reimplemented from PrintBaseTab.

Definition at line 1484 of file optsprin.cpp.

01485 {
01486     if (IsAllGreyed() || pDocument == NULL)
01487         return(PrintBaseTab::CommitSection());
01488 
01489     ERROR3IF(pPrefsDlg == NULL, "PrintLayoutTab::CommitSection called with no dialog pointer");
01490 
01491     if (!TalkToPage())
01492         return TRUE;    // Just return if TalkToPage() fails
01493 
01494 /*
01495 
01496     //---
01497     // RANGE CHECK ALL VALUES TO MAKE SURE THEY ARE SENSIBLE
01498     //---
01499     
01500     PrintControl* pPrCtrl = GetPrintControl();
01501     ERROR2IF(pPrCtrl == NULL,TRUE,"The doc's print component gave me a NULL print control object");
01502 
01503     // We only want to change the values of the doc print control as if we are importing the values
01504     // from a file, i.e. we don't want other values changing as a result of these calls
01505     pPrCtrl->StartImport();
01506 |*
01507     // Only set the members this tab has changed.
01508     pPrCtrl->SetPrintOrient(LocalPrintControl.GetPrintOrient());
01509     pPrCtrl->SetWholeSpread(LocalPrintControl.IsWholeSpread());
01510     pPrCtrl->SetFitType(    LocalPrintControl.GetFitType());
01511     pPrCtrl->SetScale(      LocalPrintControl.GetScale());
01512     pPrCtrl->SetTopMargin(  LocalPrintControl.GetTopMargin());
01513     pPrCtrl->SetLeftMargin( LocalPrintControl.GetLeftMargin());
01514     pPrCtrl->SetWidth(      LocalPrintControl.GetWidth());
01515     pPrCtrl->SetHeight(     LocalPrintControl.GetHeight());
01516     pPrCtrl->SetRows(       LocalPrintControl.GetRows());
01517     pPrCtrl->SetColumns(    LocalPrintControl.GetColumns());
01518     pPrCtrl->SetGutter(     LocalPrintControl.GetGutter());
01519 *|
01520 
01521     // Read the docuemnt vaules directly out of the dialogue
01522     CGadgetID OrientGadgets[] = { _R(IDC_BTN_UPRIGHT), _R(IDC_BTN_SIDEWAYS), NULL };
01523     BOOL Result = (pPrefsDlg->GetRadioGroupSelected(OrientGadgets) == _R(IDC_BTN_UPRIGHT));
01524     pPrCtrl->SetPrintOrient((Result) ? PRINTORIENTATION_UPRIGHT : PRINTORIENTATION_SIDEWAYS);
01525 
01526     CGadgetID DPSGadgets[] = { _R(IDC_DPS_INDIVIDUALPAGES), _R(IDC_DPS_WHOLESPREAD), NULL };
01527     Result = (pPrefsDlg->GetRadioGroupSelected(DPSGadgets) == _R(IDC_DPS_WHOLESPREAD));
01528     pPrCtrl->SetWholeSpread(Result);
01529 
01530     CGadgetID FitGadgets[] = { _R(IDC_BESTFIT), _R(IDC_CUSTOMFIT), _R(IDC_MULTIPLEFIT), NULL };
01531     ResourceID FitRadio = GetRadioGroupSelected(FitGadgets))
01532     if (FitRadio == _R(IDC_BESTFIT))
01533         pPrCtrl->SetFitType(PRINTFIT_BEST);
01534     else if (FitRadio == _R(IDC_CUSTOMFIT))
01535         pPrCtrl->SetFitType(PRINTFIT_CUSTOM);
01536     else if (FitRadio == _R(IDC_MULTIPLEFIT))
01537         pPrCtrl->SetFitType(PRINTFIT_MULTIPLE);
01538     
01539     double Scale = pPrefsDlg->GetDoubleGadgetValue(_R(IDC_SCALEEDIT),0,0);
01540     // We need to range check the value before converting it to a Fixed 16
01541     if (Scale > 32000.0) Scale = 32000.0;
01542     if (Scale < 0)       Scale = 0.0;
01543     pPrCtrl->SetScale(FIXED16(Scale));
01544 
01545     pPrCtrl->SetTopMargin(pPrefsDlg->GetUnitGadgetValue(_R(IDC_TOPEDIT),CurrentPageUnits,0,0));
01546     pPrCtrl->SetLeftMargin(pPrefsDlg->GetUnitGadgetValue(_R(IDC_LEFTEDIT),CurrentPageUnits,0,0));
01547     pPrCtrl->SetWidth(pPrefsDlg->GetUnitGadgetValue(_R(IDC_WIDTHEDIT),CurrentPageUnits,0,0));
01548     pPrCtrl->SetHeight(pPrefsDlg->GetUnitGadgetValue(_R(IDC_HEIGHTEDIT),CurrentPageUnits,0,0));
01549     pPrCtrl->SetRows(pPrefsDlg->GetLongGadgetValue(_R(IDC_ROWSEDIT),0,0));
01550     pPrCtrl->SetColumns(pPrefsDlg->GetLongGadgetValue(_R(IDC_COLUMNSEDIT),0,0));
01551     pPrCtrl->SetGutter(pPrefsDlg->GetUnitGadgetValue(_R(IDC_GUTTEREDIT),CurrentPageUnits,0,0));
01552 
01553     // Finished making the changes.
01554     pPrCtrl->EndImport();
01555 
01556     // Set up the print again so that it takes the new settings on board
01557     pPrCtrl->SetUp(pDocument->GetSelectedSpread());
01558 */
01559 
01560     // Redraw all views that are showing their print borders
01561     FRDocViewFunc pFunc = PrintControl::RedrawPrintableArea;
01562     pDocument->ForceRedraw(pFunc);
01563 
01564     return(PrintBaseTab::CommitSection());
01565 }

BOOL PrintLayoutTab::EnableControls  )  [private, virtual]
 

The enables and disables the various controls depending on the values held in the given print control object.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if all went well

Errors: -

See also:
-

Implements PrintBaseTab.

Definition at line 1791 of file optsprin.cpp.

01792 {
01793     if (pPrefsDlg == NULL) return TRUE;
01794 
01795     if (!TalkToPage())
01796         return(TRUE);
01797 
01798 //  BOOL BestFit     = (LocalPrintControl.GetFitType() == PRINTFIT_BEST);
01799     BOOL CustomFit   = (LocalPrintControl.GetFitType() == PRINTFIT_CUSTOM);
01800     BOOL MultipleFit = (LocalPrintControl.GetFitType() == PRINTFIT_MULTIPLE);
01801 //  BOOL BestFitPaper= (LocalPrintControl.GetFitType() == PRINTFIT_BESTPAPER);
01802 
01803     // Controls available all the time
01804     EnableControl(_R(IDC_BESTFIT),          TRUE);
01805     EnableControl(_R(IDC_CUSTOMFIT),        TRUE);
01806     EnableControl(_R(IDC_MULTIPLEFIT),      TRUE);
01807     EnableControl(_R(IDC_BESTFITPAPER),     TRUE);
01808     EnableControl(_R(IDC_PRINT_DOCNAME),    TRUE);
01809     EnableControl(_R(IDC_PRINT_DOCNAMETEXT),TRUE);
01810     EnableControl(_R(IDC_LAYOUTINFO),       TRUE);
01811     EnableControl(_R(IDC_PAPERSIZETEXT),    TRUE);
01812     EnableControl(_R(IDC_PAPERSIZEINFO),    TRUE);
01813 
01814     // Controls available when in custom fit mode
01815     EnableControl(_R(IDC_TOPEDIT),      CustomFit);
01816     EnableControl(_R(IDC_LEFTEDIT),     CustomFit);
01817     EnableControl(_R(IDC_WIDTHEDIT),    CustomFit);
01818     EnableControl(_R(IDC_HEIGHTEDIT),   CustomFit);
01819     EnableControl(_R(IDC_TOPTEXT),      CustomFit);
01820     EnableControl(_R(IDC_LEFTTEXT),     CustomFit);
01821     EnableControl(_R(IDC_WIDTHTEXT),    CustomFit);
01822     EnableControl(_R(IDC_HEIGHTTEXT),   CustomFit);
01823     EnableControl(_R(IDC_SCALEEDIT),    CustomFit);
01824     EnableControl(_R(IDC_SCALETEXT),    CustomFit);
01825     EnableControl(_R(IDC_SCALEPERCENT), CustomFit);
01826 
01827     // Controls available when in multiple fit mode
01828     EnableControl(_R(IDC_ROWSEDIT),     MultipleFit);
01829     EnableControl(_R(IDC_COLUMNSEDIT),  MultipleFit);
01830     EnableControl(_R(IDC_GUTTEREDIT),   MultipleFit);
01831     EnableControl(_R(IDC_ROWSTEXT),     MultipleFit);
01832     EnableControl(_R(IDC_COLUMNSTEXT),  MultipleFit);
01833     EnableControl(_R(IDC_GUTTERTEXT),   MultipleFit);
01834 
01835     // Controls available when in multiple or custom fit mode
01836     EnableControl(_R(IDC_BTN_UPRIGHT),          CustomFit || MultipleFit);
01837     EnableControl(_R(IDC_BTN_SIDEWAYS),         CustomFit || MultipleFit);
01838     EnableControl(_R(IDC_PRINTORIENTATIONTEXT), CustomFit || MultipleFit);
01839 
01840     // Controls available when the page is a double page spread
01841     EnableControl(_R(IDC_DPS_WHOLESPREAD),      LocalPrintControl.IsDoublePageSpread());
01842     EnableControl(_R(IDC_DPS_INDIVIDUALPAGES),  LocalPrintControl.IsDoublePageSpread());
01843 
01844     // If in windows 95, hide the picture boxes as they don't slab in, and go against Win95 look & feel
01845 PORTNOTE("other", "Assume new windows UI")
01846 #ifndef EXCLUDE_FROM_XARALX
01847     if (CCamApp::IsNewWindowsUI()) //IsWindows95())
01848 #endif
01849     {
01850         if (pPrefsDlg != NULL)
01851         {
01852             pPrefsDlg->HideGadget(_R(IDC_LAYOUTINFO_BOX),TRUE);
01853             pPrefsDlg->HideGadget(_R(IDC_PAPERSIZEINFO_BOX),TRUE);
01854         }
01855     }
01856 
01857     return TRUE;
01858 }

CDlgResID PrintLayoutTab::GetPageID  )  [virtual]
 

Implements OptionsTabs.

Definition at line 1287 of file optsprin.cpp.

01287 { return _R(IDD_OPTSTAB_PRINTLAYOUT); }

BOOL PrintLayoutTab::HandleMsg DialogMsg Msg  )  [virtual]
 

Handles all the print layout options tabs messages.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from PrintBaseTab.

Definition at line 1304 of file optsprin.cpp.

01305 {
01306     ERROR2IF(Msg == NULL,FALSE,"PrintLayoutTab::Message null message received");
01307     ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintLayoutTab::HandleMsg called with no dialog pointer");
01308 
01309     BOOL ok = TalkToPage(); // The print layout tab identifier
01310     if (!ok)
01311         return TRUE;        // page not present
01312 
01313     switch(Msg->DlgMsg)
01314     {
01315         case DIM_CREATE:    // Initialise controls
01316             ok = InitSection();
01317             if (!ok)
01318                 InformError();
01319             break;
01320 
01321         case DIM_LFT_BN_CLICKED:
01322             OptionsTabs::SetApplyNowState(TRUE);
01323 
01324             if (FALSE) {}
01325             // Orientation
01326             else if (Msg->GadgetID == _R(IDC_BTN_UPRIGHT))
01327             {
01328                 LocalPrintControl.SetPrintOrient(PRINTORIENTATION_UPRIGHT);
01329                 ShowDetails();
01330             }
01331             else if (Msg->GadgetID == _R(IDC_BTN_SIDEWAYS))
01332             {
01333                 LocalPrintControl.SetPrintOrient(PRINTORIENTATION_SIDEWAYS);
01334                 ShowDetails();
01335             }
01336             // DPS buttons
01337             else if (Msg->GadgetID == _R(IDC_DPS_INDIVIDUALPAGES))
01338             {
01339                 LocalPrintControl.SetWholeSpread(FALSE);
01340                 ShowDetails();
01341             }
01342             else if (Msg->GadgetID == _R(IDC_DPS_WHOLESPREAD))
01343             {
01344                 LocalPrintControl.SetWholeSpread(TRUE);
01345                 ShowDetails();
01346             }
01347             // Fit type
01348             else if (Msg->GadgetID == _R(IDC_BESTFIT))
01349             {
01350                 LocalPrintControl.SetFitType(PRINTFIT_BEST);
01351                 ShowDetails();
01352             }
01353             else if (Msg->GadgetID == _R(IDC_CUSTOMFIT))
01354             {
01355                 LocalPrintControl.SetFitType(PRINTFIT_CUSTOM);
01356                 ShowDetails();
01357             }
01358             else if (Msg->GadgetID == _R(IDC_MULTIPLEFIT))
01359             {
01360                 LocalPrintControl.SetFitType(PRINTFIT_MULTIPLE);
01361                 ShowDetails();
01362             }
01363             else if (Msg->GadgetID == _R(IDC_BESTFITPAPER))
01364             {
01365                 LocalPrintControl.SetFitType(PRINTFIT_BESTPAPER);
01366                 ShowDetails();
01367             }
01368             break;
01369 
01370         case DIM_SELECTION_CHANGED:
01371             OptionsTabs::SetApplyNowState(TRUE);
01372             break;
01373 
01374         case DIM_TEXT_CHANGED:
01375             OptionsTabs::SetApplyNowState(TRUE);
01376 
01377             if (!IgnoreTextChangedMsgs)
01378             {
01379                 if (FALSE) {}
01380                 // Scale ed field
01381                 else if (Msg->GadgetID == _R(IDC_SCALEEDIT))
01382                 {
01383                     double Scale = pPrefsDlg->GetDoubleGadgetValue(_R(IDC_SCALEEDIT),0,0);
01384                     // We need to range check the value before converting it to a Fixed 16
01385                     if (Scale > 32000.0) Scale = 32000.0;
01386                     if (Scale < 0)       Scale = 0.0;
01387                     LocalPrintControl.SetScale(FIXED16(Scale));
01388                     ShowDetails(NULL,_R(IDC_SCALEEDIT));
01389                 }
01390                 // Custom fit ed fields
01391                 else if (Msg->GadgetID == _R(IDC_TOPEDIT))
01392                 {
01393                     LocalPrintControl.SetTopMargin(pPrefsDlg->GetUnitGadgetValue(_R(IDC_TOPEDIT),CurrentPageUnits,0,0));
01394                     ShowDetails(NULL,_R(IDC_TOPEDIT));
01395                 }
01396                 else if (Msg->GadgetID == _R(IDC_LEFTEDIT))
01397                 {
01398                     LocalPrintControl.SetLeftMargin(pPrefsDlg->GetUnitGadgetValue(_R(IDC_LEFTEDIT),CurrentPageUnits,0,0));
01399                     ShowDetails(NULL,_R(IDC_LEFTEDIT));
01400                 }
01401                 else if (Msg->GadgetID == _R(IDC_WIDTHEDIT))
01402                 {
01403                     LocalPrintControl.SetWidth(pPrefsDlg->GetUnitGadgetValue(_R(IDC_WIDTHEDIT),CurrentPageUnits,0,0));
01404                     ShowDetails(NULL,_R(IDC_WIDTHEDIT));
01405                 }
01406                 else if (Msg->GadgetID == _R(IDC_HEIGHTEDIT))
01407                 {
01408                     LocalPrintControl.SetHeight(pPrefsDlg->GetUnitGadgetValue(_R(IDC_HEIGHTEDIT),CurrentPageUnits,0,0));
01409                     ShowDetails(NULL,_R(IDC_HEIGHTEDIT));
01410                 }
01411                 // Multiple fit ed fields
01412                 else if (Msg->GadgetID == _R(IDC_ROWSEDIT))
01413                 {
01414                     LocalPrintControl.SetRows(pPrefsDlg->GetLongGadgetValue(_R(IDC_ROWSEDIT),0,0));
01415                     ShowDetails(NULL,_R(IDC_ROWSEDIT));
01416                 }
01417                 else if (Msg->GadgetID == _R(IDC_COLUMNSEDIT))
01418                 {
01419                     LocalPrintControl.SetColumns(pPrefsDlg->GetLongGadgetValue(_R(IDC_COLUMNSEDIT),0,0));
01420                     ShowDetails(NULL,_R(IDC_COLUMNSEDIT));
01421                 }
01422                 else if (Msg->GadgetID == _R(IDC_GUTTEREDIT))
01423                 {
01424                     LocalPrintControl.SetGutter(pPrefsDlg->GetUnitGadgetValue(_R(IDC_GUTTEREDIT),CurrentPageUnits,0,0));
01425                     ShowDetails(NULL,_R(IDC_GUTTEREDIT));
01426                 }
01427             }
01428             break;
01429 
01430         case DIM_KILL_FOCUS:
01431             {
01432                 CGadgetID List[] = { 0, 0 };
01433                 // Edit fields
01434                 if ((Msg->GadgetID == _R(IDC_SCALEEDIT)) ||
01435                     (Msg->GadgetID == _R(IDC_ROWSEDIT)) ||
01436                     (Msg->GadgetID == _R(IDC_COLUMNSEDIT)) ||
01437                     (Msg->GadgetID == _R(IDC_GUTTEREDIT)) ||
01438                     (Msg->GadgetID == _R(IDC_TOPEDIT)) ||
01439                     (Msg->GadgetID == _R(IDC_LEFTEDIT)) ||
01440                     (Msg->GadgetID == _R(IDC_WIDTHEDIT)) ||
01441                     (Msg->GadgetID == _R(IDC_HEIGHTEDIT)) )
01442                 {
01443                     List[0] = Msg->GadgetID;
01444                     ShowDetails(List, 0);
01445                 }
01446             }
01447             break;
01448 
01449         default:
01450             return(PrintBaseTab::HandleMsg(Msg));
01451     }       
01452 
01453 #ifdef _DEBUG
01454     if (Msg->DlgMsg == DIM_LFT_BN_CLICKED &&
01455         ((Msg->GadgetID == _R(IDC_BESTFIT)) || (Msg->GadgetID == _R(IDC_CUSTOMFIT)) || (Msg->GadgetID == _R(IDC_MULTIPLEFIT))) &&
01456         KeyPress::IsConstrainPressed())
01457     {
01458         PrintLayoutTab::TestPrinting(&LocalPrintControl);
01459     }
01460 #endif
01461 
01462     return TRUE;
01463 }

BOOL PrintLayoutTab::InitSection  )  [virtual]
 

Sets initial values for the print layout section of the options dialog box. This section includes the:-.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
AppPrefsDlg; OptionsTabs;

Reimplemented from PrintBaseTab.

Definition at line 1584 of file optsprin.cpp.

01585 {
01586     if (PrintBaseTab::InitSection())
01587     {
01588         ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintLayoutTab::InitSection called with no dialog pointer");
01589 
01590         pPrefsDlg->SetGadgetBitmaps(_R(IDC_BTN_SIDEWAYS),0,0);
01591         pPrefsDlg->SetGadgetBitmaps(_R(IDC_BTN_UPRIGHT),0,0);
01592 
01593         // Set up the units that are used in the currently selected document
01594         // All units work off the selected document and so we must do nothing if there is no
01595         // selected document.
01596         if (!SetUpDocUnits())
01597         {
01598             // If returns False then we are in an invalid situation and so should make sure that
01599             // the dialog box is greyed.
01600             GreySection();
01601             return (TRUE);
01602         }
01603 
01604         return ShowDetails();
01605     }
01606     else
01607         return FALSE;
01608 }

BOOL PrintLayoutTab::ShowDetails CGadgetID pGadgetIDList,
CGadgetID  Exclude
[private]
 

Sets values for the print layout section of the options dialog box.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
pGadgetIDList = ptr to gadgets to show details in (NULL means all gadgets) [INPUTS] Exclude = gadget to exclude in list
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
AppPrefsDlg; OptionsTabs;

Definition at line 1646 of file optsprin.cpp.

01647 {
01648     if (Document::GetSelected() == NULL)    // No document around! Eek!
01649         return(FALSE);
01650 
01651     IgnoreTextChangedMsgs = TRUE;
01652 
01653     ERROR2IF(pPrefsDlg == NULL,FALSE,"PrintLayoutTab::ShowDetailscalled with no dialog pointer");
01654 
01655     // A list of all the gadgets in which we display details in
01656     static CGadgetID pAllGadgets[] ={   _R(IDC_LAYOUTINFO),_R(IDC_PAPERSIZEINFO),_R(IDC_DPS_WHOLESPREAD),
01657                                         _R(IDC_BTN_UPRIGHT),_R(IDC_SCALEEDIT),_R(IDC_BESTFIT),
01658                                         _R(IDC_TOPEDIT),_R(IDC_LEFTEDIT),_R(IDC_WIDTHEDIT),_R(IDC_HEIGHTEDIT),
01659                                         _R(IDC_ROWSEDIT),_R(IDC_COLUMNSEDIT),_R(IDC_GUTTEREDIT),
01660                                         0 };
01661 
01662     // If no gadget list is given, fall back to the list of all gadgets
01663     if (pGadgetIDList == NULL)
01664         pGadgetIDList = pAllGadgets;
01665 
01666     BOOL ShowMargins =  (   (LocalPrintControl.GetFitType() != PRINTFIT_MULTIPLE) || 
01667                             ((LocalPrintControl.GetRows() == 1) && (LocalPrintControl.GetColumns() == 1))
01668                         );
01669 
01670     String_256 Str;
01671     String_256 Dash = "-";
01672     
01673     for (INT32 i=0; pGadgetIDList[i]; i++)
01674     {
01675         // Ignore the the exclude gadget
01676         if (pGadgetIDList[i] == Exclude)
01677             continue;
01678 
01679         if (FALSE) {}
01680         else if (pGadgetIDList[i] == _R(IDC_LAYOUTINFO))
01681         {
01682             // Display that print info
01683             Str = LocalPrintControl.BuildPrintInfoStr();
01684             pPrefsDlg->SetStringGadgetValue(_R(IDC_LAYOUTINFO),Str);
01685         }
01686         else if (pGadgetIDList[i] == _R(IDC_PAPERSIZEINFO))
01687         {
01688             // Display the paper size
01689             Str = LocalPrintControl.BuildPaperSizeStr();
01690             pPrefsDlg->SetStringGadgetValue(_R(IDC_PAPERSIZEINFO),Str);
01691         }
01692         else if (pGadgetIDList[i] == _R(IDC_DPS_WHOLESPREAD))
01693         {
01694             // Reflect the Whole Spread flag
01695             BOOL WholeSpread = LocalPrintControl.IsWholeSpread();
01696             pPrefsDlg->SetBoolGadgetSelected(_R(IDC_DPS_WHOLESPREAD),WholeSpread);
01697             pPrefsDlg->SetBoolGadgetSelected(_R(IDC_DPS_INDIVIDUALPAGES),!WholeSpread);
01698         }
01699         else if (pGadgetIDList[i] == _R(IDC_BTN_UPRIGHT))
01700         {
01701             // Set the orientation bitmap buttons
01702             BOOL Upright = (LocalPrintControl.GetPrintOrient() == PRINTORIENTATION_UPRIGHT);
01703             pPrefsDlg->SetBoolGadgetSelected(_R(IDC_BTN_UPRIGHT),Upright);
01704             pPrefsDlg->SetBoolGadgetSelected(_R(IDC_BTN_SIDEWAYS),!Upright);
01705         }
01706         else if (pGadgetIDList[i] == _R(IDC_SCALEEDIT)) 
01707         {
01708             // Set the scale factor field
01709             FIXED16 Scale = LocalPrintControl.GetScale();
01710             pPrefsDlg->SetDoubleGadgetValue(_R(IDC_SCALEEDIT),Scale.MakeDouble());
01711         }
01712         else if (pGadgetIDList[i] == _R(IDC_BESTFIT))
01713         {
01714             // The fit radio buttons
01715             CGadgetID FitList[] = { _R(IDC_BESTFIT),_R(IDC_CUSTOMFIT),_R(IDC_MULTIPLEFIT),_R(IDC_BESTFITPAPER), 0 };
01716 
01717             switch (LocalPrintControl.GetFitType())
01718             {
01719                 case PRINTFIT_BEST:     pPrefsDlg->SetRadioGroupSelected(FitList,_R(IDC_BESTFIT));      break;
01720                 case PRINTFIT_CUSTOM:   pPrefsDlg->SetRadioGroupSelected(FitList,_R(IDC_CUSTOMFIT));    break;
01721                 case PRINTFIT_MULTIPLE: pPrefsDlg->SetRadioGroupSelected(FitList,_R(IDC_MULTIPLEFIT));  break;
01722                 case PRINTFIT_BESTPAPER:pPrefsDlg->SetRadioGroupSelected(FitList,_R(IDC_BESTFITPAPER)); break;
01723                 default: ERROR2(FALSE,"Unknown print fit type");
01724             }
01725         }
01726         else if (pGadgetIDList[i] == _R(IDC_TOPEDIT))
01727         {
01728             // Custom fit editable values
01729             if (ShowMargins)
01730                 pPrefsDlg->SetUnitGadgetValue(_R(IDC_TOPEDIT),  CurrentPageUnits, LocalPrintControl.GetTopMargin());
01731             else
01732                 pPrefsDlg->SetStringGadgetValue(_R(IDC_TOPEDIT), Dash);
01733         }
01734         else if (pGadgetIDList[i] == _R(IDC_LEFTEDIT))
01735         {   
01736             // Custom fit editable values
01737             if (ShowMargins)
01738                 pPrefsDlg->SetUnitGadgetValue(_R(IDC_LEFTEDIT), CurrentPageUnits, LocalPrintControl.GetLeftMargin());
01739             else
01740                 pPrefsDlg->SetStringGadgetValue(_R(IDC_LEFTEDIT), Dash);
01741         }
01742         else if (pGadgetIDList[i] == _R(IDC_WIDTHEDIT))
01743         {
01744             pPrefsDlg->SetUnitGadgetValue(_R(IDC_WIDTHEDIT),CurrentPageUnits, LocalPrintControl.GetWidth());
01745         }
01746         else if (pGadgetIDList[i] == _R(IDC_HEIGHTEDIT))
01747         {
01748             pPrefsDlg->SetUnitGadgetValue(_R(IDC_HEIGHTEDIT),CurrentPageUnits, LocalPrintControl.GetHeight());
01749         }
01750         else if (pGadgetIDList[i] == _R(IDC_ROWSEDIT))
01751         {
01752             pPrefsDlg->SetLongGadgetValue(_R(IDC_ROWSEDIT), LocalPrintControl.GetRows());
01753         }
01754         else if (pGadgetIDList[i] == _R(IDC_COLUMNSEDIT))
01755         {
01756             pPrefsDlg->SetLongGadgetValue(_R(IDC_COLUMNSEDIT),LocalPrintControl.GetColumns());
01757         }
01758         else if (pGadgetIDList[i] == _R(IDC_GUTTEREDIT))
01759         {
01760             pPrefsDlg->SetUnitGadgetValue(_R(IDC_GUTTEREDIT),CurrentPageUnits, LocalPrintControl.GetGutter());
01761         }
01762         else
01763         {
01764             ERROR3_PF(("Unknown gadget ID (%D)",pGadgetIDList));
01765         }
01766     }
01767 
01768     BOOL ok = EnableControls();
01769 
01770     IgnoreTextChangedMsgs = FALSE;
01771 
01772     return ok;
01773 }

BOOL PrintLayoutTab::ShowDetails  )  [private, virtual]
 

Sets values for the print layout section of the options dialog box.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/3/95
Parameters:
pGadgetIDList = ptr to gadgets to show details in (NULL means all gadgets) [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
AppPrefsDlg; OptionsTabs; ShowDetails(CGadgetID* pGadgetIDList,CGadgetID Exclude)

Implements PrintBaseTab.

Definition at line 1625 of file optsprin.cpp.

01626 {
01627     return ShowDetails(NULL, 0);
01628 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:02 2007 for Camelot by  doxygen 1.4.4