PageTab Class Reference

Allows the user to set any options which are normally associated with the document's page. This includes such things as:- The size of the page as either a predefined page size or A custom page with explicit width/height control. Choice of Portrait or Landscape. Bleed size. Show page shadow switch. More...

#include <optspage.h>

Inheritance diagram for PageTab:

OptionsTabs ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PageTab ()
 PageTab constructor. Creates a non-undoable operation.
 ~PageTab ()
 PageTab destructor.
virtual BOOL Init ()
 PageTab initialisation routine.
virtual BOOL HandleMsg (DialogMsg *Msg)
 Handles all the Page options tabs messages.
virtual BOOL InitSection ()
 Sets initial values for the Page section of the options dialog box. This section includes the:-.
virtual BOOL CommitSection ()
 Takes the values in the Page 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 NewUnitsInSection ()
 Function called when new default units come into operation. We must convert all units fields to display in the newly specified units.
virtual BOOL GreySection ()
 Called when the user has closed all documents.
virtual BOOL UngreySection ()
 Called when the user has selected a new document.
BOOL ChangeControlStatus (const BOOL Status)
 Called to grey/ungrey all controls on this tab.
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. The document name allows the info field on the tab to be filled in correctly.
BOOL UpdatePageSection ()
 Called when we have undone a page resize operation and hence need to update the page's details on the page section of this tab. Should only init the tab if the page is present.
virtual CDlgResID GetPageID ()
 Allows the options dialog code to determine the dialog ID of this section.
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.
BOOL InvokeResize (PageResizeInfo *Param)
 Checks to see what the size of the first page in the first spread in the document is and returns the width and height of it. Assumes at present a fairly simple document structure. This function should not no be used, should be using the undoable operation instead. Assumes the class variables pDocument, pSpread have been set up. Sets the new details of the page size and of the default grid. The default grid should always be resident in the spread. Assumes the class variables pDocument, pSpread have been set up. This function should be used instead of SetNewSizeOfPage as it is undoable and they aren't.
BOOL InvokeResizeAndCentre (PageResizeInfo *Param)
 Sets the new details of the page size and of the default grid. The default grid should always be resident in the spread. Assumes the class variables pDocument, pSpread have been set up. This function should be used instead of SetNewSizeOfPage as it is undoable and they aren't. This does the same as resize but centres the objects on the page. Used by the batching code.

Protected Member Functions

BOOL InitPageSection ()
 Sets initial values for the page details section of the Page tab on the options dialog box.
BOOL SetUpPageSizeList ()
 Sets up the pages sizes list in the Page tab on the options dialog box. Done separately to InitPageSection so that code is modular and should only be used once when the page is set up and not on updates otherwise you get the drop list causing a huge redraw problem.
INT32 GetPageSizeItem (const MILLIPOINT Width, const MILLIPOINT Height)
 Translates a width or height into a number which specifies whether it is A0, A1 ... or custom which corresponds to the list offered to the user.
BOOL HandlePageList (INT32 ItemClicked, BOOL Portrait)
 Sets up the height and width fields according to the item selected in the list.
BOOL HandlePortraitLandscape ()
 Checks to see if Portrait or Landscape has been selected. If a change has been made then swaps the height and width fields over.
BOOL GetSizeOfPage (MILLIPOINT *Width, MILLIPOINT *Height, MILLIPOINT *Margin, MILLIPOINT *Bleed, BOOL *Portrait, BOOL *Dps, BOOL *ShowDropShadow)
 Checks to see what the size of the first page in the first spread in the document is and returns the width and height of it. Assumes at present a fairly simple document structure. Assumes the class variables pDocument, pSpread have been set up.

Protected Attributes

BOOL PortraitSelected

Private Attributes

MILLIPOINT OldPageWidth
MILLIPOINT OldPageHeight
BOOL OldDpsState
BOOL OldPortraitState
MILLIPOINT OldBleedSize
MILLIPOINT OldMarginSize
BOOL OldDropShadowState
BOOL GreyStatus
BOOL InitedPageSizeList

Detailed Description

Allows the user to set any options which are normally associated with the document's page. This includes such things as:- The size of the page as either a predefined page size or A custom page with explicit width/height control. Choice of Portrait or Landscape. Bleed size. Show page shadow switch.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/12/94
See also:
OptionsTabs; AppPrefsDlg; DocPrefsDlg; PageSize; PageSizesList;

Definition at line 151 of file optspage.h.


Constructor & Destructor Documentation

PageTab::PageTab  ) 
 

PageTab constructor. Creates a non-undoable operation.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 158 of file optspage.cpp.

00159 {   
00160     // Do nothing for now
00161     InitedPageSizeList = FALSE;
00162 }        

PageTab::~PageTab  ) 
 

PageTab destructor.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 180 of file optspage.cpp.

00181 {   
00182 }        


Member Function Documentation

BOOL PageTab::ChangeControlStatus const BOOL  Status  ) 
 

Called to grey/ungrey all controls on this tab.

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

Errors: -

See also:
PageTab::GreySection; PageTab::UngreySection;

Definition at line 619 of file optspage.cpp.

00620 {
00621     // Grey/Ungrey the controls
00622     pPrefsDlg->EnableGadget(_R(IDC_OPTS_INFO), Status);
00623 
00624     pPrefsDlg->EnableGadget(_R(IDC_OPTS_PAGEGROUP), Status);
00625     pPrefsDlg->EnableGadget(_R(IDC_OPTS_SIZENAME), Status);
00626     pPrefsDlg->EnableGadget(_R(IDN_PAGESIZE_CUSTOM), Status);
00627 // WEBSTER-ranbirr-13/11/96
00628 #ifndef WEBSTER
00629     pPrefsDlg->EnableGadget(_R(IDC_OPTS_SIZELIST), Status);
00630 #endif //webster
00631     pPrefsDlg->EnableGadget(_R(IDC_OPTS_HEIGHTTXT), Status);
00632     pPrefsDlg->EnableGadget(_R(IDC_OPTS_HEIGHT), Status);
00633     pPrefsDlg->EnableGadget(_R(IDC_OPTS_WIDTHTXT), Status);
00634     pPrefsDlg->EnableGadget(_R(IDC_OPTS_WIDTH), Status);
00635     pPrefsDlg->EnableGadget(_R(IDC_OPTS_ORIENTGROUP), Status);
00636 
00637 // WEBSTER-ranbirr-13/11/96
00638 #ifndef WEBSTER
00639     pPrefsDlg->EnableGadget(_R(IDC_OPTS_PORTRAIT), Status);
00640     pPrefsDlg->EnableGadget(_R(IDC_OPTS_LANDSCAPE), Status);
00641 
00642     pPrefsDlg->EnableGadget(_R(IDC_OPTS_SPREADGROUP), Status);
00643     pPrefsDlg->EnableGadget(_R(IDC_OPTS_MARGINTXT), Status);
00644     pPrefsDlg->EnableGadget(_R(IDC_OPTS_MARGIN), Status);
00645     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEEDSWITCH), Status);
00646     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEED), Status);
00647     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEEDTXT), Status);
00648     pPrefsDlg->EnableGadget(_R(IDC_OPTS_DPS), Status);
00649     pPrefsDlg->EnableGadget(_R(IDC_OPTS_SHADOW), Status);
00650 #endif //webster
00651     return TRUE;
00652 }           

BOOL PageTab::CommitSection  )  [virtual]
 

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

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

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 290 of file optspage.cpp.

00291 {
00292 TRACEUSER( "Neville", _T("commit page section\n"));
00293     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::CommitSection called with no dialog pointer");
00294 
00295     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PAGE));  // The Page page identifier
00296     if (!ok)
00297         return TRUE;    // Talk to page failed to return now
00298 
00299     // All units work off the selected document and so we must do nothing if there is no
00300     // selected document. Check our clas variable to see if this is true or not.
00301     // Units should have been set up by the caller.
00302     if (pDocument == NULL)
00303         return (TRUE);
00304 
00305     // Ok has been pressed so take the values from this section of the dialog box
00306     BOOL Valid=0;       // Flag for validity of value
00307 //  BOOL State=0;       // Flag for state of button/switch
00308 //  BOOL SetOk=0;       // Preference value set ok
00309 
00310 
00311 
00312     // Section = Page
00313 
00314 // WEBSTER Neville 13/8/97
00315 #ifdef WEBSTER
00316     // Webster has a limited set of controls. So use the present settings on the page and just
00317     // allow the user to alter the few parameters that they can.
00318 
00319     // Find out the details on the presently selected page/spread
00320     MILLIPOINT  Width       = 0;
00321     MILLIPOINT  Height      = 0;
00322     MILLIPOINT  Margin      = 0;
00323     MILLIPOINT  Bleed       = 0;
00324     BOOL        Portrait    = TRUE;
00325     BOOL        Dps         = FALSE;
00326     BOOL        DropShadow  = FALSE;
00327 
00328     INT32 PageSizeId =0; 
00329     
00330     ok = GetSizeOfPage(&Width, &Height, &Margin, &Bleed, &Portrait, &Dps, &DropShadow);
00331     if (!ok)
00332         return FALSE;
00333 TRACEUSER( "Neville", _T("Currently Width =%d Height =%d Margin=%d Bleed=%d\n"), Width, Height, Margin, Bleed);
00334 
00335 #else
00336     // In Camelot mode, the user can change everything
00337 
00338     // First, get the current state of Portrait button
00339     BOOL Portrait = FALSE;
00340     Portrait = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_PORTRAIT), 0, 1, 0, &Valid);
00341 
00342     // Next, get the current values for the page width and height.
00343     // If custom use the editable fields otherwise use the actual page size from
00344     // the definition otherwise may encounter conversion errors.
00345     MILLIPOINT Width = 0;
00346     MILLIPOINT Height = 0;
00347 
00348     INT32 PageSizeSelected = CUSTOM;
00349     PageSizeSelected = pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_SIZELIST));
00350 
00351     if (PageSizeSelected == CUSTOM)
00352 #endif //webster
00353     {
00354         // Portrait and landscape radio buttons should have been taken care of by the switch
00355         // changing the editable fields which we are just about to read. 
00356         Height = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_HEIGHT), CurrentPageUnits,
00357                                                   MinPageDimension, MaxPageDimension,
00358                                                   _R(IDE_OPTS_INVALIDHEIGHT), &Valid);
00359         if (!Valid)
00360             return FALSE;           // height incorrect, user has been warned already
00361 
00362         Width  = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_WIDTH), CurrentPageUnits,
00363                                                   MinPageDimension, MaxPageDimension,
00364                                                   _R(IDE_OPTS_INVALIDWIDTH), &Valid);
00365         if (!Valid)
00366             return FALSE;           // width incorrect, user has been warned already
00367     }
00368 // WEBSTER-ranbirr-13/11/96
00369 #ifndef WEBSTER
00370     else
00371     {
00372         if (AppPrefsDlg::pPageSizesList != NULL && InitedPageSizeList)
00373         {
00374             // We will need to take account of the Portrait and landscape radio buttons and
00375             // hence swapping of the width and height fields as we are reading the values
00376             // directly from the sizes list.
00377             PageId PageChosen = (PageId)PageSizeSelected;
00378             AppPrefsDlg::pPageSizesList->GetSizeFromPageId(PageChosen, &Width, &Height);
00379 TRACEUSER( "Neville", _T("PageTab::CommitSection width %d height %d in MP\n"),Width,Height);
00380             
00381             // Now we have the width/height, check if landscape is selected and if so
00382             // swap the height and width over.
00383             if (!Portrait)
00384             {
00385                 // Swap the height and width fields over.
00386                 MILLIPOINT Temp = Width;
00387                 Width = Height;
00388                 Height = Temp;
00389             }
00390         }
00391         else
00392         {
00393             ERROR2IF(TRUE,FALSE,"Bad page sizes list in PageTab::CommitSection"); 
00394         }
00395     }
00396 
00397     // Now the page margin size
00398     // Limit the page margin to much less than the page size as things like zoom to 
00399     // spread/drawing assume that part of the spread is visible in the view so that
00400     // this can then be used to pick up the desired spread. 
00401     MILLIPOINT Margin = 0; // MinPageDimension;
00402     MILLIPOINT MaxPageMargin = MaxPageDimension;
00403     Margin = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_MARGIN), CurrentPageUnits,
00404                                              MinPageDimension, MaxPageMargin,
00405                                              0, &Valid);
00406     if (Margin < 0 || Margin >= MaxPageDimension) // ignore valid as it will be false
00407     {
00408         InformError(_R(IDE_OPTS_INVALIDMARGIN));
00409         return FALSE;           // margin incorrect, user has been warned already
00410     }
00411 
00412     // Now the page bleed size
00413     MILLIPOINT Bleed = 0;
00414     BOOL BleedEnabled;
00415     BleedEnabled = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_BLEEDSWITCH), 0, 1, 0, &Valid);
00416     if (BleedEnabled)
00417     {
00418         const MILLIPOINT MaxBleed = (MILLIPOINT)(3 * 72000);    // maximum in inches
00419         Bleed = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_BLEED), CurrentPageUnits,
00420                                                  0, MaxBleed, _R(IDE_OPTS_INVALIDBLEED), &Valid);
00421         if (!Valid)
00422             return FALSE;           // bleed incorrect, user has been warned already
00423     }
00424     else
00425         Bleed = 0;
00426 
00427     // Get current state of the double page spread button
00428     BOOL Dps = FALSE;
00429     Dps = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_DPS), 0, 1, 0, &Valid);
00430 
00431     // Get the current state of the drop shadow switch
00432     BOOL DropShadow = FALSE;
00433     DropShadow = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_SHADOW), 0, 1, 0, &Valid);
00434 #endif //webster
00435 
00436     // Check pasteboard dimensions
00437 
00438     // Possibly should get the resize operation to check this and pass back a result, as
00439     // loading dodgy documents might be possibly another way to create completely large pages.
00440 
00441     // Check if the overall size of the pasteboard will break our maximum dimensions
00442     MILLIPOINT PagesWidth = Width;
00443     if (Dps)
00444         PagesWidth += Width;    // If double page spread then make two page wide
00445     MILLIPOINT PasteBoardWidth = Margin + PagesWidth + Margin;
00446     MILLIPOINT PasteBoardHeight = Margin + Height + Margin;
00447     if (PasteBoardWidth > MaxPageDimension || PasteBoardHeight > MaxPageDimension)
00448     {
00449         // There is a problem so warn the user that the value is incorrect
00450         InformWarning(_R(IDE_OPTS_OVERALLSPREADSIZE));
00451         return FALSE;
00452     }
00453 
00454 
00455 
00456     // Go and make those requested changes
00457 
00458     // Now that we have the required information, now go and do it
00459     // Set up the parameters which we require to do the page resizing operation 
00460     // This is undoable and redoable
00461     PageResizeInfo Param;
00462 
00463     // Set up the new page parameters that we want
00464     Param.Height         = Height;
00465     Param.Width          = Width;
00466     Param.Margin         = Margin;
00467     Param.Bleed          = Bleed;
00468     Param.Portrait       = Portrait;
00469     Param.Dps            = Dps;
00470     Param.ShowDropShadow = DropShadow;
00471 
00472     InvokeResize(&Param);
00473 
00474     return ok;
00475 }

CDlgResID PageTab::GetPageID  )  [virtual]
 

Allows the options dialog code to determine the dialog ID of this section.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The dialog ID of this tab section.

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 225 of file optspage.cpp.

00226 {
00227     return _R(IDD_OPTSTAB_PAGE);
00228 }

INT32 PageTab::GetPageSizeItem const MILLIPOINT  Width,
const MILLIPOINT  Height
[protected]
 

Translates a width or height into a number which specifies whether it is A0, A1 ... or custom which corresponds to the list offered to the user.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/94
Parameters:
Width width of current page in millipoints [INPUTS] Height height of current page in millipoints
Type of page found according to position on list [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1123 of file optspage.cpp.

01124 {    
01125     PageId ItemInList = CUSTOM;     // set useful default of CUSTOM
01126 
01127     if (AppPrefsDlg::pPageSizesList != NULL)
01128     {
01129         // Use the PageSize and PageSizesList classes to work out if this is a known page
01130         // size or if it is regarded as a custom one.
01131         ItemInList = AppPrefsDlg::pPageSizesList->GetPageIdFromSize(Width, Height);
01132 TRACEUSER( "Neville", _T("PageTab::GetPageSizeItem width %d height %d give item = %d\n"),Width,Height,ItemInList);
01133     }
01134 
01135     return (INT32) ItemInList;  
01136 }

BOOL PageTab::GetSizeOfPage MILLIPOINT Width,
MILLIPOINT Height,
MILLIPOINT Margin,
MILLIPOINT Bleed,
BOOL *  Portrait,
BOOL *  Dps,
BOOL *  ShowDropShadow
[protected]
 

Checks to see what the size of the first page in the first spread in the document is and returns the width and height of it. Assumes at present a fairly simple document structure. Assumes the class variables pDocument, pSpread have been set up.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/94
Parameters:
Width found page width in millipoints [OUTPUTS] Height found page height in millipoints Margin found page margin in millipoints Bleed found page bleed in millipoints Portrait set TRUE if found Width smaller than height Dps set TRUE if double page spread present ShowDropShadow set TRUE if currently displaying a drop shadow
Returns:
True if found the details ok.

Errors: -

See also:
AppPrefsDlg::SetCurrentSpread;

Definition at line 1293 of file optspage.cpp.

01295 {
01296     // Set up defaults in case of dodgy exit
01297     *Width  = 0;
01298     *Height = 0;
01299     *Margin  = 0;
01300     *Bleed  = 0;
01301     *Portrait = TRUE;
01302     *Dps = FALSE;
01303     //   WEBSTER-ranbirr-13/11/96
01304 #ifndef WEBSTER
01305     *ShowDropShadow = TRUE;
01306 #else   //webster has no page shadow.       
01307     *ShowDropShadow = FALSE;
01308 #endif  //webster
01309 
01310     // The dialog handler should have already set up the class variables pDocument and pSpread.
01311     // We will check that they are not null.
01312     // For now, get details on 1st page of spread 1
01313     ERROR2IF(pDocument == NULL,FALSE,"PageTab::GetSizeOfPage no selected document");
01314     ERROR2IF(pSpread == NULL,FALSE,"PageTab::GetSizeOfPage no spread to work on");
01315 
01316     // Set up some interim variables
01317     MILLIPOINT PageWidth = *Width;
01318     MILLIPOINT PageHeight = *Height;
01319     MILLIPOINT PageMargin = *Margin;
01320     MILLIPOINT PageBleed = *Bleed;
01321     BOOL Pages = *Dps;
01322     BOOL DropShadow = *ShowDropShadow;
01323         
01324     if (pSpread != NULL)
01325     {
01326         BOOL ok = pSpread->GetPageSize(&PageWidth, &PageHeight, &PageMargin, &PageBleed,
01327                                        &Pages, &DropShadow);
01328         if (ok)
01329         {
01330             // page values read ok so set return parameters
01331             *Width  = PageWidth;
01332             *Height = PageHeight;
01333             *Margin  = PageMargin;
01334             *Bleed  = PageBleed;
01335             *Dps = Pages;
01336             *ShowDropShadow = DropShadow;
01337         }
01338         else
01339             return FALSE;
01340     }
01341 
01342 
01343     // Now check if landscape or portrait
01344     if (PageWidth < PageHeight)
01345     {
01346         *Portrait = TRUE;
01347         *Width = PageWidth;
01348         *Height = PageHeight;
01349     }
01350     else
01351     {
01352         *Portrait = FALSE;
01353         *Width = PageHeight;
01354         *Height = PageWidth;
01355     }
01356     
01357     // Remember the states found
01358     OldPageWidth = PageWidth;           // entry page width
01359     OldPageHeight = PageHeight;         // entry page height
01360     OldDpsState = Pages;                // entry state of dps
01361     OldDropShadowState = DropShadow;    // entry drop shadow state 
01362     OldMarginSize  = PageMargin;        // entry page margin size
01363     OldBleedSize  = PageBleed;          // entry page bleed size
01364     OldPortraitState = *Portrait;       // entry portrait/landscape state
01365 
01366     return TRUE;
01367 }

BOOL PageTab::GreySection  )  [virtual]
 

Called when the user has closed all documents.

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

Errors: -

See also:
PageTab::UngreySection;

Reimplemented from OptionsTabs.

Definition at line 535 of file optspage.cpp.

00536 {
00537 TRACEUSER( "Neville", _T("GreySection in page section\n"));
00538     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::GreySection called with no dialog pointer");
00539 
00540     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PAGE));  // The page tab identifier
00541     if (!ok)
00542         return TRUE;    // Talk to page failed to return now
00543 
00544     // Make sure the information field displaying the name of the current document
00545     // is correct.
00546     String_256  DocumentName(_R(IDT_OPTS_PAGE_INFO)); 
00547     DocumentName += *GetDocumentName();
00548     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocumentName);
00549 
00550     // Only update if we are not already grey 
00551     if (GreyStatus == TRUE)
00552         return TRUE;
00553 
00554     // Call our central greying/ungreying function
00555     ok = ChangeControlStatus(FALSE);
00556     
00557     GreyStatus = TRUE;
00558 
00559     return ok;
00560 } 

BOOL PageTab::HandleMsg DialogMsg Msg  )  [virtual]
 

Handles all the Page options tabs messages.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 787 of file optspage.cpp.

00788 {
00789 TRACEUSER( "Neville", _T("HandlePageMsg\n"));
00790     ERROR2IF(Msg == NULL,FALSE,"PageTab::Message null message received");
00791     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::HandleMsg called with no dialog pointer");
00792 
00793     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PAGE));  // The Page page identifier
00794     if (!ok)
00795         return TRUE;        // page not present
00796 
00797     switch(Msg->DlgMsg)
00798     {
00799         case DIM_CREATE:    // Initialise controls
00800             GreyStatus = FALSE; // we are ungreyed by default
00801             ok = InitSection();
00802             if (!ok)
00803                 InformError();
00804             break;
00805         case DIM_SELECTION_CHANGED:
00806             OptionsTabs::SetApplyNowState(TRUE);
00807     // WEBSTER-ranbirr-13/11/96
00808     #ifndef WEBSTER
00809             if (Msg->GadgetID == _R(IDC_OPTS_SIZELIST))
00810             {
00811                 // Get the currently selected item and set up the other fields accordingly 
00812                 INT32 PageSizeSelected;
00813                 PageSizeSelected = pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_SIZELIST));
00814                 // Get whether we are in Portrait or Landscape mode
00815                 BOOL Portrait;
00816                 BOOL Valid;
00817                 Portrait = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_PORTRAIT), 0, 1, 0, &Valid);
00818                 HandlePageList(PageSizeSelected, Portrait);
00819                 break;
00820             }
00821         case DIM_LFT_BN_CLICKED:
00822             OptionsTabs::SetApplyNowState(TRUE);
00823             if (FALSE) {}
00824             // WEBSTER-ranbirr-13/11/96
00825             #ifndef WEBSTER
00826             else if ((Msg->GadgetID == _R(IDC_OPTS_PORTRAIT)) || (Msg->GadgetID == _R(IDC_OPTS_LANDSCAPE)))
00827                 // Portrait landscape buttons toggle the width/height fields
00828                 HandlePortraitLandscape();
00829             #endif // Webster
00830             else if (Msg->GadgetID == _R(IDC_OPTS_BLEEDSWITCH))
00831             {
00832                 // Bleed switch enables or disables the bleed size field 
00833                 BOOL BleedEnabled;
00834                 BOOL Valid;
00835                 BleedEnabled = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_BLEEDSWITCH), 0, 1, 0, &Valid);
00836                 if (BleedEnabled)
00837                 {
00838                     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEED), TRUE);
00839                     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEEDTXT), TRUE);
00840                 }
00841                 else
00842                 {
00843                     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEED), FALSE);
00844                     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEEDTXT), FALSE);
00845                 }                                                   
00846             }
00847     #endif //webster    
00848         case DIM_TEXT_CHANGED:
00849             OptionsTabs::SetApplyNowState(TRUE);
00850             break;
00851         default:
00852             break;
00853     }
00854     
00855     return TRUE;
00856 }  

BOOL PageTab::HandlePageList INT32  ItemClicked,
BOOL  Portrait
[protected]
 

Sets up the height and width fields according to the item selected in the list.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/94
Parameters:
ItemClicked number of item clicked in list [INPUTS] Portrait True if Portrait, False if Landscape.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1155 of file optspage.cpp.

01156 {    
01157     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::HandlePageList called with no dialog pointer");
01158 
01159     // Now enable or disable and fill in the height and width fields dependent
01160     // on what size has been selected in the list of available pages. 
01161     BOOL Enable;
01162     BOOL ok;
01163     MILLIPOINT Width = 0;
01164     MILLIPOINT Height = 0;
01165 
01166     if ( ItemClicked == CUSTOM)
01167     {
01168         // If custom then just ungrey the present width/height editable fields
01169         Enable = TRUE;
01170     }
01171     else
01172     {
01173         Enable = FALSE;
01174         PageId PageChosen = (PageId)ItemClicked;
01175         if (AppPrefsDlg::pPageSizesList != NULL)
01176         {
01177             AppPrefsDlg::pPageSizesList->GetSizeFromPageId(PageChosen, &Width, &Height);
01178 TRACEUSER( "Neville", _T("PageTab::HandlePageList width %d height %d in MP\n"),Width,Height);
01179         }
01180 
01181         // If not Portrait i.e. Landscape then swap the width and the height fields over 
01182         if (Portrait == FALSE)
01183         {
01184             // Swap width for height
01185             MILLIPOINT Temp = Width;
01186             Width = Height;
01187             Height = Temp;
01188         }   
01189         // Now set up the height and width fields accordingly
01190         ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_HEIGHT), CurrentPageUnits,
01191                                              Height, FALSE, -1);
01192         ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_WIDTH), CurrentPageUnits,
01193                                              Width, FALSE, -1);
01194     }   
01195     
01196     // Enable should be True if the custom page size has been selected.
01197     pPrefsDlg->EnableGadget(_R(IDC_OPTS_HEIGHT), Enable);
01198     pPrefsDlg->EnableGadget(_R(IDC_OPTS_WIDTH), Enable);
01199 
01200     return TRUE;
01201 }

BOOL PageTab::HandlePortraitLandscape  )  [protected]
 

Checks to see if Portrait or Landscape has been selected. If a change has been made then swaps the height and width fields over.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/94
Returns:
Errors: -
See also:
-

Definition at line 1218 of file optspage.cpp.

01219 {
01220     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::HandlePortraitLandscape called with no dialog pointer");
01221 
01222     // Get current state of Portrait button
01223     BOOL Portrait;
01224     BOOL Valid;
01225     Portrait = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_PORTRAIT), 0, 1, 0, &Valid);
01226 
01227     // Check for change of state, if none then exit now
01228     if (Portrait == PortraitSelected)
01229         return TRUE;
01230 
01231 TRACEUSER( "Neville", _T("PageTab::HandlePortraitLandscape() change state\n"));
01232     // We have changed so swap the height and the width fields over
01233     // First, get the current values from the editable fields
01234     MILLIPOINT Width = 0;
01235     MILLIPOINT Height = 0;
01236     BOOL ok;
01237     Height = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_HEIGHT), CurrentPageUnits,
01238                                               0, INT_MAX, _R(IDE_OPTS_INVALIDHEIGHT), &Valid);
01239     if (!Valid)
01240     {
01241         // failed to read correct value so return switch to known position and exit
01242         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_PORTRAIT), PortraitSelected);
01243         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_LANDSCAPE), !PortraitSelected);
01244         return FALSE;           
01245     }
01246     Width  = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_WIDTH), CurrentPageUnits,
01247                                               0, INT_MAX, _R(IDE_OPTS_INVALIDWIDTH), &Valid);
01248     if (!Valid)
01249     {
01250         // failed to read correct value so return switch to known position and exit
01251         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_PORTRAIT), PortraitSelected);
01252         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_LANDSCAPE), !PortraitSelected);
01253         return FALSE;           
01254     }
01255 
01256     // Now set up the height and width fields reversly
01257     ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_HEIGHT), CurrentPageUnits,
01258                                           Width, FALSE, -1);
01259     ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_WIDTH), CurrentPageUnits,
01260                                           Height, FALSE, -1);
01261     
01262     // Now update the stored present state to the new state 
01263     PortraitSelected = Portrait;
01264 
01265     return TRUE;
01266 }    

BOOL PageTab::Init void   )  [virtual]
 

PageTab initialisation routine.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if initialised ok, False if failed.

Errors: -

See also:
-

Reimplemented from OptionsTabs.

Definition at line 200 of file optspage.cpp.

00201 {   
00202     // Init (register) all our undoable operations
00203     if (!OpPageResize::Init())
00204         return(FALSE);
00205 
00206     return TRUE;
00207 }        

BOOL PageTab::InitPageSection  )  [protected]
 

Sets initial values for the page details section of the Page tab on the options dialog box.

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

Errors: -

See also:
InitSection; AppPrefsDlg; OptionsTabs;

Definition at line 986 of file optspage.cpp.

00987 {
00988     BOOL ok = TRUE;
00989 
00990     // Section = Page
00991 
00992     // List size done elsewhere so that only ever done once and not on updates as well.
00993 
00994     // Find out the details on the presently selected page/spread
00995     MILLIPOINT Width = 0;
00996     MILLIPOINT Height = 0;
00997     MILLIPOINT Margin = 0;
00998     MILLIPOINT Bleed = 0;
00999     PortraitSelected = TRUE;
01000     BOOL Dps = FALSE;
01001 // WEBSTER-ranbirr-13/11/96
01002 #ifndef WEBSTER
01003     BOOL PageShadow = TRUE;
01004 #else
01005     BOOL PageShadow = FALSE;
01006 #endif //webster
01007 
01008     INT32 PageSizeId =0; 
01009     
01010     ok = GetSizeOfPage(&Width, &Height, &Margin, &Bleed, &PortraitSelected, &Dps, &PageShadow);
01011     if (!ok)
01012         return FALSE;
01013 TRACEUSER( "Neville", _T("Width =%d Height =%d Margin=%d Bleed=%d\n"), Width, Height, Margin, Bleed);
01014 
01015     PageSizeId = GetPageSizeItem(Width, Height);
01016 TRACEUSER( "Neville", _T("PageSize =%d \n"), PageSizeId);
01017     // Set up the default option displayed
01018 // WEBSTER-ranbirr-13/11/96
01019 #ifndef WEBSTER
01020     ok = pPrefsDlg->SetSelectedValueIndex(_R(IDC_OPTS_SIZELIST),PageSizeId);
01021 
01022     // Get the current portrait/landscape state orientation
01023     if ( PortraitSelected != FALSE )
01024     {
01025         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_PORTRAIT), TRUE);
01026         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_LANDSCAPE), FALSE);
01027     }
01028     else
01029     {
01030         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_PORTRAIT), FALSE);
01031         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_LANDSCAPE), TRUE);
01032     }
01033 #endif //webster
01034     // Now set up and enable/disable the height and width fields accordingly
01035     // If not Portrait i.e. Landscape then swap the width and the height fields over 
01036     if (PortraitSelected == FALSE)
01037     {
01038         // Swap width for height
01039         MILLIPOINT Temp = Width;
01040         Width = Height;
01041         Height = Temp;
01042     }   
01043     // Now set up the height and width fields accordingly
01044     ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_HEIGHT), CurrentPageUnits, Height, FALSE, -1);
01045     ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_WIDTH), CurrentPageUnits, Width, FALSE, -1);
01046     BOOL Enable;
01047 // WEBSTER-ranbirr-13/11/96
01048 #ifndef WEBSTER
01049     if (PageSizeId == CUSTOM)
01050         Enable = TRUE;
01051     else
01052         Enable = FALSE; 
01053 #endif //webster
01054     // Enable should be True if the custom page size has been selected.
01055     pPrefsDlg->EnableGadget(_R(IDC_OPTS_HEIGHT), Enable);
01056     pPrefsDlg->EnableGadget(_R(IDC_OPTS_WIDTH), Enable);
01057 // WEBSTER-ranbirr-13/11/96
01058 #ifndef WEBSTER
01059     // Now show the current page Margin
01060     ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_MARGIN), CurrentPageUnits, Margin, FALSE, -1);
01061 #endif //webster
01062     // Now show the current page bleed, setting or unsetting the switch accordingly
01063     // and greying/ungreying the size field accordingly.
01064     BOOL BleedEnabled;
01065     if (Bleed == 0)
01066     {
01067         // No bleed
01068         BleedEnabled = FALSE;
01069     }
01070     else
01071     {
01072         // Bleed present
01073         BleedEnabled = TRUE;
01074     }
01075 // WEBSTER-ranbirr-13/11/96
01076 #ifndef WEBSTER
01077     pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_BLEEDSWITCH), BleedEnabled);
01078     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEED), BleedEnabled);
01079     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BLEEDTXT), BleedEnabled);
01080 #endif //webster
01081     // If the bleed is zero and disabled then fill in a default value of 3mm
01082     if ((Bleed == 0) && (!BleedEnabled))
01083     {
01084 // WEBSTER-ranbirr-13/11/96
01085 #ifndef WEBSTER
01086         Bleed = (MILLIPOINT)(3 * MM_MP_VAL);    // 3mm in millipoints
01087 #else
01088         Bleed = 0;
01089 #endif //webster
01090     }
01091 
01092     // Now show the current value
01093     // WEBSTER-ranbirr-13/11/96
01094 #ifndef WEBSTER
01095     ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_BLEED), CurrentPageUnits, Bleed, FALSE, -1);
01096     // Now for the double page spread button
01097     pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_DPS), Dps);
01098     // Now for the show page shadow
01099     pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_SHADOW), PageShadow);
01100 #endif //webster
01101 
01102     return TRUE;
01103 }

BOOL PageTab::InitSection  )  [virtual]
 

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

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
AppPrefsDlg; OptionsTabs; UpdateSection;

Implements OptionsTabs.

Definition at line 875 of file optspage.cpp.

00876 {
00877 TRACEUSER( "Neville", _T("InitPageSection\n"));
00878     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::InitSection called with no dialog pointer");
00879     ERROR2IF(AppPrefsDlg::pPageSizesList == NULL,FALSE,"PageTab::InitSection called with list of page sizes");
00880 
00881 //  BOOL ok = TRUE;         // Flag for whether value set up ok 
00882 
00883     // We have an uninitialised page sizes list, so flag that before we have a chance to exit
00884     pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_SIZELIST));
00885     InitedPageSizeList = FALSE;
00886 
00887     // Do everything the same as the UpdateSection but init the page size list for this
00888     // once and only time to stop redraws.
00889 
00890     // Make sure the information field displaying the name of the current document
00891     // is correct.
00892     String_256  DocumentName(_R(IDT_OPTS_PAGE_INFO)); 
00893     DocumentName += *GetDocumentName();
00894     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocumentName);
00895 
00896 
00897     // All units work off the selected document and so we must do nothing if there is no
00898     // selected document. Check our clas variable to see if this is true or not.
00899     // Units should have been set up by the caller.
00900     if (pDocument == NULL)
00901     {
00902         // If returns False then we are in an invalid situation and so should make sure that
00903         // the dialog box is greyed.
00904         GreySection();
00905         return (TRUE);
00906     }
00907 
00908     // Set up the list of available page size options, starting with the default.
00909     // Handle everything that we do not know as a CUSTOM setting.
00910     SetUpPageSizeList();
00911 
00912     InitPageSection();
00913 
00914     return TRUE;
00915 }

BOOL PageTab::InvokeResize PageResizeInfo pParam  ) 
 

Checks to see what the size of the first page in the first spread in the document is and returns the width and height of it. Assumes at present a fairly simple document structure. This function should not no be used, should be using the undoable operation instead. Assumes the class variables pDocument, pSpread have been set up. Sets the new details of the page size and of the default grid. The default grid should always be resident in the spread. Assumes the class variables pDocument, pSpread have been set up. This function should be used instead of SetNewSizeOfPage as it is undoable and they aren't.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/2/95
Parameters:
[INPUTS] 
Returns:
True if managed to change the page/spread details ok.

Errors: -

See also:
AppPrefsDlg::SetCurrentSpread; SetNewSizeOfPage;

Definition at line 1454 of file optspage.cpp.

01455 {
01456     ERROR2IF(pParam==NULL,FALSE,"PageTab::InvokeResize() no pParam supplied");
01457     // For now, get details on 1st page of spread 1
01458 
01459     // The dialog handler should have already set up the class variables pDocument and pSpread.
01460     // We will check that they are not null.
01461     ERROR2IF(pDocument==NULL,FALSE,"PageTab::InvokeResize() no selected document");
01462     ERROR2IF(  pSpread==NULL,FALSE,"PageTab::InvokeResize() no spread to work on");
01463 
01464     // Only change the page size/layout if something has changed 
01465     // If the user has changed anything then warn them that nothing will happen
01466     MILLIPOINT bodge = 5;       // extra leeway on comparison required
01467 
01468     BOOL ChangeRequired = FALSE;
01469     if ( (OldPageWidth >= (pParam->Width - bodge)) && (OldPageWidth <= (pParam->Width + bodge)) &&
01470          (OldPageHeight  >= (pParam->Height - bodge)) && (OldPageHeight  <= (pParam->Height + bodge)) && 
01471         OldDpsState == pParam->Dps &&
01472         OldDropShadowState == pParam->ShowDropShadow &&
01473         (OldMarginSize >= (pParam->Margin - bodge)) && (OldMarginSize <= (pParam->Margin + bodge)) &&
01474         (OldBleedSize >= (pParam->Bleed - bodge)) && (OldBleedSize <= (pParam->Bleed + bodge)))
01475     {
01476             // Set the page parameters so that we do not resize
01477             pParam->Height = 0;
01478             pParam->Width = 0;
01479             pParam->Margin = 0;
01480             pParam->Bleed = 0;
01481             pParam->Dps = FALSE;
01482     }
01483     else
01484     {
01485         // Flag we need to make a change
01486         ChangeRequired = TRUE;
01487 
01488         // Make these the new defaults
01489         OldPageWidth = pParam->Width;
01490         OldPageHeight = pParam->Height;
01491         OldDpsState = pParam->Dps;
01492         OldPortraitState = pParam->Portrait;
01493         OldDropShadowState = pParam->ShowDropShadow;
01494         OldMarginSize = pParam->Margin;
01495         OldBleedSize = pParam->Bleed;       
01496     }
01497 
01498     if (ChangeRequired)
01499     {
01500         // Set the flag to say that we are doing a move and resize operation
01501         // rather than a centre and resize used by batching
01502         pParam->ResizeAndCentre = FALSE;
01503 
01504         // Invoke the Page resizing operation so that we get Undo.
01505         OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpPageResize));
01506 
01507         if (pOpDesc != NULL)
01508         {
01509             // Set up the parameters which we require to do the page resizing operation 
01510             pParam->pSpread = pSpread;
01511 
01512             // Go for it!
01513             pOpDesc->Invoke((OpParam *) pParam);
01514         }
01515     }
01516 
01517     return TRUE;
01518 }   

BOOL PageTab::InvokeResizeAndCentre PageResizeInfo pParam  ) 
 

Sets the new details of the page size and of the default grid. The default grid should always be resident in the spread. Assumes the class variables pDocument, pSpread have been set up. This function should be used instead of SetNewSizeOfPage as it is undoable and they aren't. This does the same as resize but centres the objects on the page. Used by the batching code.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/7/95
Parameters:
[INPUTS] 
Returns:
True if managed to change the page/spread details ok.

Errors: -

See also:
AppPrefsDlg::SetCurrentSpread; SetNewSizeOfPage;

Definition at line 1540 of file optspage.cpp.

01541 {
01542     ERROR2IF(pParam==NULL,FALSE,"PageTab::InvokeResizeAndCentre() no pParam supplied");
01543 
01544     // The dialog handler should have already set up the class variables pDocument and pSpread.
01545     // We will check that they are not null.
01546     ERROR2IF(pDocument==NULL,FALSE,"PageTab::InvokeResizeAndCentre() no selected document");
01547     ERROR2IF(  pSpread==NULL,FALSE,"PageTab::InvokeResizeAndCentre() no spread to work on");
01548 
01549     // Flag we need to make a change
01550 //  BOOL ChangeRequired = TRUE;
01551 
01552     // Make these the new defaults
01553     OldPageWidth = pParam->Width;
01554     OldPageHeight = pParam->Height;
01555     OldDpsState = pParam->Dps;
01556     OldPortraitState = pParam->Portrait;
01557     OldDropShadowState = pParam->ShowDropShadow;
01558     OldMarginSize = pParam->Margin;
01559     OldBleedSize = pParam->Bleed;       
01560 
01561     // Set the flag to say that we are doing a centre and resize operation
01562     pParam->ResizeAndCentre = TRUE;
01563 
01564     // Invoke the Page resizing operation so that we get Undo.
01565     OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpPageResize));
01566 
01567     if (pOpDesc != NULL)
01568     {
01569         // Set up the parameters which we require to do the page resizing operation 
01570         pParam->pSpread = pSpread;
01571 
01572         // Go for it!
01573         pOpDesc->Invoke((OpParam *) pParam);
01574     }
01575 
01576     return TRUE;
01577 }   

BOOL PageTab::IsDocumentOption  )  [virtual]
 

Allows the document options dialog code to determine if this tab belongs to the group of document options.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Returns True if this tab is a document option.

Errors: -

See also:
IsProgramOption();

Implements OptionsTabs.

Definition at line 246 of file optspage.cpp.

00247 {
00248     return TRUE;    // This tab is not a document option 
00249 }

BOOL PageTab::IsProgramOption  )  [virtual]
 

Allows the program options dialog code to determine if this tab belongs to the group of program options.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Returns True if this tab is a program option.

Errors: -

See also:
IsProgramOption();

Implements OptionsTabs.

Definition at line 267 of file optspage.cpp.

00268 {
00269     return TRUE;    // This tab is a program option 
00270 }

BOOL PageTab::NewUnitsInSection  )  [virtual]
 

Function called when new default units come into operation. We must convert all units fields to display in the newly specified units.

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

Errors: -

See also:
-

Reimplemented from OptionsTabs.

Definition at line 493 of file optspage.cpp.

00494 {
00495 TRACEUSER( "Neville", _T("New units in page section\n"));
00496     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::NewUnitsInSection called with no dialog pointer");
00497 
00498     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PAGE));  // The page tab identifier
00499     if (!ok)
00500         return TRUE;    // Talk to page failed to return now
00501 
00502 
00503     // All units work off the selected document and so we must do nothing if there is no
00504     // selected document. Check our clas variable to see if this is true or not.
00505     // Units should have been set up by the caller.
00506     if (pDocument == NULL)
00507     {
00508         // the dialog box is greyed.
00509         GreySection();
00510         return (TRUE);
00511     }
00512 
00513     // Do the same things as the normal init section code
00514     InitPageSection();
00515 
00516     return TRUE;
00517 }

BOOL PageTab::SetUpPageSizeList  )  [protected]
 

Sets up the pages sizes list in the Page tab on the options dialog box. Done separately to InitPageSection so that code is modular and should only be used once when the page is set up and not on updates otherwise you get the drop list causing a huge redraw problem.

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

Errors: -

See also:
InitSection; InitPageSection; AppPrefsDlg; OptionsTabs;

Definition at line 934 of file optspage.cpp.

00935 {
00936     // already set this up so don't do it again
00937     if (InitedPageSizeList)
00938         return TRUE;
00939 
00940     // Set up the list of available page size options, starting with the default.
00941     // Handle everything that we do not know as a CUSTOM setting.
00942 // WEBSTER-ranbirr-13/11/96
00943 #ifndef WEBSTER
00944     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_SIZELIST), String_32(_R(IDN_PAGESIZE_CUSTOM)));
00945 #endif //webster
00946 
00947     // Now go through the defined list
00948     PageSize* pPageSize = (PageSize*) AppPrefsDlg::pPageSizesList->GetFirstPageSize();
00949 
00950     while (pPageSize != NULL)
00951     {
00952         // Get the name of the current page size item
00953         String_32 *pPageName = pPageSize->GetPageName();
00954 // WEBSTER-ranbirr-13/11/96
00955 #ifndef WEBSTER
00956         pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_SIZELIST), *pPageName);
00957 #endif //webster
00958         // skip to the next item, if there is one
00959         pPageSize = (PageSize*) AppPrefsDlg::pPageSizesList->GetNextPageSize(pPageSize);
00960     }
00961 // WEBSTER-ranbirr-13/11/96
00962 #ifndef WEBSTER
00963     pPrefsDlg->SetComboListLength(_R(IDC_OPTS_SIZELIST));
00964 #endif //webster
00965     // It is now set up and correct
00966     InitedPageSizeList = TRUE;
00967 
00968     return TRUE;
00969 }   

BOOL PageTab::UngreySection  )  [virtual]
 

Called when the user has selected a new document.

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

Errors: -

See also:
PageTab::UngreySection;

Reimplemented from OptionsTabs.

Definition at line 577 of file optspage.cpp.

00578 {
00579 TRACEUSER( "Neville", _T("UngreySection in page section\n"));
00580     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::UngreySection called with no dialog pointer");
00581 
00582     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PAGE));  // The page tab identifier
00583     if (!ok)
00584         return TRUE;    // Talk to page failed to return now
00585 
00586     // Make sure the information field displaying the name of the current document
00587     // is correct.
00588     String_256  DocumentName(_R(IDT_OPTS_PAGE_INFO)); 
00589     DocumentName += *GetDocumentName();
00590     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocumentName);
00591 
00592     // Only update if we are not already ungrey 
00593     if (GreyStatus == FALSE)
00594         return TRUE;
00595 
00596     // Call our central greying/ungreying function
00597     ok = ChangeControlStatus(TRUE);
00598     
00599     GreyStatus = FALSE;
00600 
00601     return ok;
00602 }

BOOL PageTab::UpdatePageSection  ) 
 

Called when we have undone a page resize operation and hence need to update the page's details on the page section of this tab. Should only init the tab if the page is present.

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

Errors: -

See also:
PageTab::GreySection; PageTab::UngreySection; PageTab::InitSection;

Definition at line 732 of file optspage.cpp.

00733 {
00734 TRACEUSER( "Neville", _T("PageTab::UpdatePageSection\n"));
00735     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::UpdatePageSection called with no dialog pointer");
00736 
00737     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PAGE));  // The Page page identifier
00738     if (!ok)
00739         return TRUE;        // page not present
00740 
00741     // Do everything the same as the InitSection but do not init the page size list as this
00742     // causes a huge redraw.
00743 
00744     // All units work off the selected document and so we must do nothing if there is no
00745     // selected document. Check our clas variable to see if this is true or not.
00746     // Units should have been set up by the caller.
00747     if (pDocument == NULL)
00748     {
00749         // If returns False then we are in an invalid situation and so should make sure that
00750         // the dialog box is greyed.
00751         GreySection();
00752         return (TRUE);
00753     }
00754     
00755     // Check if we have an uninitialised page sizes list
00756     if (!InitedPageSizeList)
00757     {
00758         // Remove any lists that we have created.
00759         //pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_SIZELIST));
00760         //InitedPageSizeList = FALSE;
00761 
00762         // Set up the list of available page size options, starting with the default.
00763         // Handle everything that we do not know as a CUSTOM setting.
00764         SetUpPageSizeList();
00765     }
00766 
00767     // Call the normal init section code for the page parts
00768     return InitPageSection();
00769 }

BOOL PageTab::UpdateSection String_256 DocumentName  )  [virtual]
 

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. The document name allows the info field on the tab to be filled in correctly.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/2/95
Parameters:
Name of document [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
PageTab::GreySection; PageTab::UngreySection; PageTab::InitSection;

Reimplemented from OptionsTabs.

Definition at line 671 of file optspage.cpp.

00672 {
00673 TRACEUSER( "Neville", _T("PageTab::UpdateSection\n"));
00674     ERROR2IF(pPrefsDlg == NULL,FALSE,"PageTab::UpdateSection called with no dialog pointer");
00675 
00676     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PAGE));  // The Page page identifier
00677     if (!ok)
00678         return TRUE;        // page not present
00679 
00680     // Do everything the same as the InitSection but do not init the page size list as this
00681     // causes a huge redraw.
00682     
00683     // Make sure the information field displaying the name of the current document
00684     // is correct.
00685     String_256  DocName(_R(IDT_OPTS_PAGE_INFO)); 
00686     DocName +=  *DocumentName;
00687     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocName);
00688 
00689 
00690     // All units work off the selected document and so we must do nothing if there is no
00691     // selected document. Check our clas variable to see if this is true or not.
00692     // Units should have been set up by the caller.
00693     if (pDocument == NULL)
00694     {
00695         // If returns False then we are in an invalid situation and so should make sure that
00696         // the dialog box is greyed.
00697         GreySection();
00698         return TRUE;
00699     }
00700 
00701     // Check if we have an uninitialised page sizes list
00702     if (!InitedPageSizeList)
00703     {
00704         // Set up the list of available page size options, starting with the default.
00705         // Handle everything that we do not know as a CUSTOM setting.
00706         SetUpPageSizeList();
00707     }
00708 
00709     // Do the same things as the normal init section code
00710     InitPageSection();
00711 
00712     return TRUE;
00713 }


Member Data Documentation

BOOL PageTab::GreyStatus [private]
 

Definition at line 221 of file optspage.h.

BOOL PageTab::InitedPageSizeList [private]
 

Definition at line 223 of file optspage.h.

MILLIPOINT PageTab::OldBleedSize [private]
 

Definition at line 217 of file optspage.h.

BOOL PageTab::OldDpsState [private]
 

Definition at line 215 of file optspage.h.

BOOL PageTab::OldDropShadowState [private]
 

Definition at line 219 of file optspage.h.

MILLIPOINT PageTab::OldMarginSize [private]
 

Definition at line 218 of file optspage.h.

MILLIPOINT PageTab::OldPageHeight [private]
 

Definition at line 214 of file optspage.h.

MILLIPOINT PageTab::OldPageWidth [private]
 

Definition at line 213 of file optspage.h.

BOOL PageTab::OldPortraitState [private]
 

Definition at line 216 of file optspage.h.

BOOL PageTab::PortraitSelected [protected]
 

Definition at line 195 of file optspage.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:59:24 2007 for Camelot by  doxygen 1.4.4