OptionsTabs Class Reference

These encompass all the tabs available for the options dialog box to use. More...

#include <appprefs.h>

Inheritance diagram for OptionsTabs:

ListItem CCObject SimpleCCObject EditTab GridTab InternetTab MiscTab PageTab PlugInsTab PointersTab PrintBaseTab ScaleTab TuneTab UndoTab UnitsTab ViewTab List of all members.

Public Member Functions

 OptionsTabs ()
 Constructor.
virtual BOOL Init ()
 Initialiser.
BOOL DeclareOptionsTab (OptionsTabs *pOptionsTab)
 A function to declare a new tab to the system.
virtual CDlgResID GetPageID ()=0
virtual BOOL InitSection ()=0
virtual BOOL CommitSection ()=0
virtual BOOL HandleMsg (DialogMsg *Msg)=0
virtual MsgResult Message (Msg *pMessage)
 A traditional message handler.
virtual BOOL NewUnitsInSection ()
 Called when new default units chosen. Gives any tabbed dialog a chance to update any fields with new units in. This is the base class version and so will be used for any tabs which have no specified handling code.
virtual BOOL GreySection ()
 Called when the user has closed all documents. Gives any tabbed dialog a chance to grey any fields which are document specific. This is the base class version and so will be used for any tabs which have no specified handling code.
virtual BOOL UngreySection ()
 Called when the user has opened a document. Gives any tabbed dialog a chance to update any fields which may have been greyed when the last document was closed. This is the base class version and so will be used for any tabs which have no specified handling code.
virtual BOOL UpdateSection (String_256 *DocumentName)
 Called when the user has clicked on a new document or opened a new document. Gives any tabbed dialog a chance to update any fields which are used to reflect the current document's status. The document name allows the info field on the tab to be filled in correctly. This is the base class version and so will be used for any tabs which have no specified handling code.
virtual BOOL IsDocumentOption ()=0
virtual BOOL IsProgramOption ()=0
virtual BOOL IsPrintingOption ()
 Allows the printing options dialog code to determine if this tab belongs to the group of printing options. This base class version allow the majority of tabs to answer no to this question and hence only needs overiding if the tab is a printing one.
virtual BOOL PageSizeHasChanged ()
 Allows a tab to update any page size items being displayed. This is the base class version which is just here to be overidden.

Static Public Member Functions

static BOOL InitOptionsTabs ()
 Scans all OptionsTabs to find out which OptionsTabs are available for use, and instantiates one of each, and holds them in a list.
static BOOL DeinitOptionsTabs ()
 Destroy all the OptionsTab objects.
static OptionsTabsGetFirst ()
 Iterating through the list of OptionsTabs known to Camelot. This function returns the first OptionsTabs.
static OptionsTabsGetNext (OptionsTabs *)
 Iterating through the list of OptionsTabs known to Camelot. This function returns the next OptionsTabs.
static BOOL SetUpDocUnits ()
 Sets up the units variable to the currently set document units.
static BOOL GetApplyNowState ()
 Finds out the current state of the apply now button.
static BOOL SetApplyNowState (BOOL NewState)
 Allows the setting of a new ApplyNow state.
static BOOL GreyApplyNow ()
 Makes the Apply Now button on the main page of the tabbed dialog grey.
static BOOL UngreyApplyNow ()
 Makes the Apply Now button on the main page of the tabbed dialog ungrey.
static BOOL SetInitMessageState (BOOL NewState)
 Allows the setting of a new InitMessage state.
static BOOL GetInitMessageState ()
 Finds out whether we are sending/handling an init message or not.
static String_256GetDocumentName ()
 Allows the name of the selected document to be found and displayed on the tab.
static void SetDocumentName (Document *pDoc)
 Allows the name of the selected document to be set and remembered for when the tabs ask what the name is so that they can display it correctly. Reads the title from the currently selected document and stores this in the class variable for later use. If the document pointer is null then it just sets the document name to a nice default.
static void SetDocumentName (String_256 *DocumentName)
 Allows the name of the selected document to be set and remembered for when the tabs ask what the name is so that they can display it correctly. Uses the name supplied to set the new stored document name.
static void SetCurrentDocAndSpread (Document *pDoc)
 Sets up the document and spread that we are currently supposed to be working on. This can then be used by the tabs instead of each one using their own method to work it out.
static void SetDefaultUnits ()
 Sets up the units class variables to the default values.

Static Public Attributes

static DialogTabOppPrefsDlg = NULL
static UINT32 UnitsAppTabNumber = 0
static UINT32 ScaleAppTabNumber = 0
static UINT32 PageAppTabNumber = 0
static UINT32 GridAppTabNumber = 0
static UINT32 PlugsAppTabNumber = 0
static UINT32 PrintTabNumber = 0
static DocumentpScopeDocument = NULL

Static Protected Attributes

static DocumentpDocument = NULL
static SpreadpSpread = NULL
static UnitType CurrentPageUnits = NOTYPE
static UnitType CurrentScaledUnits = NOTYPE
static UnitType CurrentFontUnits = NOTYPE

Private Member Functions

 CC_DECLARE_DYNAMIC (OptionsTabs)

Static Private Attributes

static BOOL InitMessage = FALSE
static BOOL ApplyNow = FALSE
static List OptionsTabsList
static String_256 DocName = "-"

Detailed Description

These encompass all the tabs available for the options dialog box to use.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/12/94

Definition at line 327 of file appprefs.h.


Constructor & Destructor Documentation

OptionsTabs::OptionsTabs  ) 
 

Constructor.

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

Definition at line 1569 of file appprefs.cpp.

01570 {
01571     // Ensure our link to the application options dialog box is set to a good default.
01572     pPrefsDlg = NULL;
01573     pScopeDocument = NULL;
01574 }


Member Function Documentation

OptionsTabs::CC_DECLARE_DYNAMIC OptionsTabs   )  [private]
 

virtual BOOL OptionsTabs::CommitSection  )  [pure virtual]
 

Implemented in EditTab, GridTab, InternetTab, MiscTab, PageTab, PlugInsTab, PointersTab, PrintBaseTab, PrintGeneralTab, PrintLayoutTab, PrintSepsTab, PrintImagesetterTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

BOOL OptionsTabs::DeclareOptionsTab OptionsTabs pOptionsTab  ) 
 

A function to declare a new tab to the system.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/12/94
Parameters:
A pointer to a new OptionsTabs class already declared into the system [INPUTS]
Returns:
True if tab declared, False if something went wrong.
See also:
OptionsTab

Definition at line 1777 of file appprefs.cpp.

01778 {
01779     // First check to see if somebody has actually declared the pointer to be non null.
01780     if (pOptionsTab == NULL) return FALSE;
01781 
01782     if (!pOptionsTab->Init())
01783     {
01784         /* Error occured - report it and stop trying to initialise the options tab. */
01785         InformError();
01786         return TRUE;
01787     }
01788     OptionsTabsList.AddTail(pOptionsTab);
01789     
01790     // All ok
01791     return TRUE;
01792 }

BOOL OptionsTabs::DeinitOptionsTabs  )  [static]
 

Destroy all the OptionsTab objects.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/12/94
See also:
OptionsTab

Definition at line 1755 of file appprefs.cpp.

01756 {
01757     // Get rid of our OptionsTabs
01758     OptionsTabsList.DeleteAll();
01759 
01760     // All ok
01761     return TRUE;
01762 }

BOOL OptionsTabs::GetApplyNowState  )  [static]
 

Finds out the current state of the apply now button.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The current ApplyNow state as either True or False.

Errors: -

See also:
SetApplyNowState();

Definition at line 2142 of file appprefs.cpp.

02143 {
02144     return ApplyNow;
02145 } 

String_256 * OptionsTabs::GetDocumentName  )  [static]
 

Allows the name of the selected document to be found and displayed on the tab.

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

Errors: -

See also:
SetDocumentName();

Definition at line 2235 of file appprefs.cpp.

02236 {
02237     return &DocName;
02238 }

OptionsTabs * OptionsTabs::GetFirst  )  [static]
 

Iterating through the list of OptionsTabs known to Camelot. This function returns the first OptionsTabs.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/12/94
Returns:
Pointer to the first OptionsTab, or NULL if none.
See also:
OptionsTabs::GetNext() Scope: Static

Definition at line 1843 of file appprefs.cpp.

01844 {
01845     return (OptionsTabs *) OptionsTabsList.GetHead();
01846 }

BOOL OptionsTabs::GetInitMessageState  )  [static]
 

Finds out whether we are sending/handling an init message or not.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The current ApplInitMessageyNow state as either True or False.

Errors: -

See also:
SetApplyNowState();

Definition at line 2190 of file appprefs.cpp.

02191 {
02192     return InitMessage;
02193 } 

OptionsTabs * OptionsTabs::GetNext OptionsTabs pOptionsTabs  )  [static]
 

Iterating through the list of OptionsTabs known to Camelot. This function returns the next OptionsTabs.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/12/94
Parameters:
pOptionsTabs - pointer to the OptionsTabs to be used to get the following [INPUTS] OptionsTabs.
Returns:
Pointer to the next OptionsTabs, or NULL if none.
See also:
OptionsTabs::GetFirst

Definition at line 1863 of file appprefs.cpp.

01864 {
01865     return (OptionsTabs *) OptionsTabsList.GetNext(pOptionsTabs);
01866 }

virtual CDlgResID OptionsTabs::GetPageID  )  [pure virtual]
 

Implemented in EditTab, GridTab, InternetTab, MiscTab, PageTab, PlugInsTab, PointersTab, PrintGeneralTab, PrintLayoutTab, PrintSepsTab, PrintImagesetterTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

BOOL OptionsTabs::GreyApplyNow  )  [static]
 

Makes the Apply Now button on the main page of the tabbed dialog grey.

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

Errors: -

See also:
-

Definition at line 2075 of file appprefs.cpp.

02076 {
02077     ERROR2IF(pPrefsDlg == NULL,FALSE,"OptionsTabs::GreyApplyNow called with no dialog pointer");
02078 
02079     // Grey out the apply now button on the main page
02080     // Must restore the state of the currently selected tab as otherwise you might start
02081     // switching to talking to the main page when we are in the middle of talking to controls
02082     // on one of the pages and hence give rise to unknown controls messages when we try to
02083     // talk to the pages controls again.
02084     CDlgResID PageID = pPrefsDlg->GetCurrentPageID();   // Get currently selected Tab id
02085     pPrefsDlg->TalkToPage(0);
02086     pPrefsDlg->EnableGadget(_R(ID_APPLY_NOW), FALSE);
02087     pPrefsDlg->TalkToPage(PageID);                      // Select the originally selected tab
02088 
02089     return TRUE;
02090 }

BOOL OptionsTabs::GreySection  )  [virtual]
 

Called when the user has closed all documents. Gives any tabbed dialog a chance to grey any fields which are document specific. This is the base class version and so will be used for any tabs which have no specified handling code.

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

Errors: -

See also:
OptionsTabs::UngreySection(); OptionsTabs::UpdateSection();

Reimplemented in EditTab, GridTab, MiscTab, PageTab, PointersTab, PrintBaseTab, PrintSepsTab, PrintImagesetterTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

Definition at line 1999 of file appprefs.cpp.

02000 {
02001     // Called when the user has closed all documents
02002     // Would normally be overriden by a a particular tab
02003     return TRUE;
02004 }

virtual BOOL OptionsTabs::HandleMsg DialogMsg Msg  )  [pure virtual]
 

Implemented in EditTab, GridTab, InternetTab, MiscTab, PageTab, PlugInsTab, PointersTab, PrintBaseTab, PrintGeneralTab, PrintLayoutTab, PrintSepsTab, PrintImagesetterTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

BOOL OptionsTabs::Init void   )  [virtual]
 

Initialiser.

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

Reimplemented from SimpleCCObject.

Reimplemented in EditTab, GridTab, MiscTab, PageTab, PlugInsTab, PointersTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

Definition at line 1589 of file appprefs.cpp.

01590 {
01591     // Do nothing for now.
01592     return TRUE;
01593 }

BOOL OptionsTabs::InitOptionsTabs  )  [static]
 

Scans all OptionsTabs to find out which OptionsTabs are available for use, and instantiates one of each, and holds them in a list.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/12/94
Returns:
TRUE if initialised ok, FALSE if not.

Errors: Out of memory (if a OptionsTab fails to initialise for other reasons then an error is reported, but Camelot will still start up ok, i.e. TRUE is returned).

See also:
OptionsTab

Definition at line 1635 of file appprefs.cpp.

01636 {
01637     // Find the OptionsTabs - the kernel ones are hard-wired.
01638     OptionsTabs *pOptionsTab = NULL;
01639 
01640 #ifndef STANDALONE
01641 
01642     // Create, initialise and install the built in OptionsTabs list
01643     //
01644     // NOTE: These should be defined in alphabetical ordering unless there is a very good
01645     // reason otherwise.
01646     //
01647     //ADD_OPTIONSTAB(EditTab)
01648     ADD_OPTIONSTAB(MiscTab)         // General
01649     ADD_OPTIONSTAB(GridTab)         // Grid and Rulers
01650 //  WEBSTER-ranbirr-13/11/96
01651 #ifndef WEBSTER
01652 #ifdef BUILD_SEPARATIONS
01653     ADD_OPTIONSTAB(PrintImagesetterTab) // Imagesetting
01654 #endif
01655 #endif //webster
01656 PORTNOTE("other", "Disabled internet tab")
01657 #ifndef EXCLUDE_FROM_XARALX
01658     ADD_OPTIONSTAB(InternetTab)     // Internet options
01659 #endif
01660 //  WEBSTER-ranbirr-13/11/96
01661 #ifndef WEBSTER
01662     ADD_OPTIONSTAB(PointersTab)     // Mouse
01663     ADD_OPTIONSTAB(PrintGeneralTab) // Output
01664 #endif //webster
01665     ADD_OPTIONSTAB(PageTab)         // Page
01666 #ifdef PHOTOSHOPPLUGINS
01667     // Only add in if required - general plug-in removal at present
01668     ADD_OPTIONSTAB(PlugInsTab)      // Plug-ins
01669 #endif
01670 //  WEBSTER-ranbirr-13/11/96
01671 #ifndef WEBSTER
01672     ADD_OPTIONSTAB(PrintLayoutTab)  // Print layout
01673     ADD_OPTIONSTAB(ScaleTab)        // Scaling
01674 #ifdef BUILD_SEPARATIONS
01675     ADD_OPTIONSTAB(PrintSepsTab)    // Separation (Colour) 
01676 #endif
01677     ADD_OPTIONSTAB(TuneTab)         // Tune ups
01678 //  ADD_OPTIONSTAB(UndoTab)
01679     ADD_OPTIONSTAB(UnitsTab)        // Units
01680     ADD_OPTIONSTAB(ViewTab)         // View
01681 #endif //webster
01682 
01683     // We must work out what the units tab number is when used in document mode so
01684     // that we can skip to it directly when using the units button on the tool bar.
01685     INT32 i = 0;
01686     INT32 print_i = 0;
01687 
01688     // Now go through all the tabs declared to the system
01689     pOptionsTab = OptionsTabs::GetFirst();
01690 
01691     while (pOptionsTab != NULL)
01692     {
01693         // Only include the tab if it is a document based option
01694         if ( pOptionsTab->IsProgramOption() )
01695         {
01696             //  WEBSTER-ranbirr-13/11/96
01697             #ifndef WEBSTER
01698             if( _R(IDD_OPTSTAB_UNITS) == pOptionsTab->GetPageID() )
01699                     UnitsAppTabNumber = i;      // note that tab number
01700             else
01701             if( _R(IDD_OPTSTAB_SCALE) == pOptionsTab->GetPageID() )
01702                     ScaleAppTabNumber = i;      // note that tab number
01703             else
01704             #endif //websdter
01705             if( _R(IDD_OPTSTAB_PAGE) == pOptionsTab->GetPageID() )
01706                     PageAppTabNumber = i;       // note that tab number
01707             else
01708             if( _R(IDD_OPTSTAB_GRID) == pOptionsTab->GetPageID() )
01709                     GridAppTabNumber = i;       // note that tab number
01710             else
01711             if( _R(IDD_OPTSTAB_PLUGINS) == pOptionsTab->GetPageID() )
01712                     PlugsAppTabNumber = i;      // note that tab number
01713             
01714             i += 1;     // increment the counter 
01715         }
01716     //  WEBSTER-ranbirr-13/11/96
01717     #ifndef WEBSTER
01718         // In this section, only include the tab if it is a printing based option
01719         if ( pOptionsTab->IsPrintingOption() )
01720         {
01721             if( _R(IDD_OPTSTAB_PRINTLAYOUT) == pOptionsTab->GetPageID() )
01722             {
01723                     PrintTabNumber = print_i;   // note that tab number
01724             }
01725             
01726             print_i += 1;       // increment the counter 
01727         }
01728     #endif //webster
01729         // Get the next option's tab.
01730         pOptionsTab = OptionsTabs::GetNext(pOptionsTab);
01731     }
01732 TRACEUSER( "Neville", _T("OptionsTabs::UnitsAppTabNumber = %d\n"),OptionsTabs::UnitsAppTabNumber);
01733 TRACEUSER( "Neville", _T("OptionsTabs::ScaleAppTabNumber = %d\n"),OptionsTabs::ScaleAppTabNumber);
01734 TRACEUSER( "Neville", _T("OptionsTabs::PageAppTabNumber = %d\n"),OptionsTabs::PageAppTabNumber);
01735 TRACEUSER( "Neville", _T("OptionsTabs::GridAppTabNumber = %d\n"),OptionsTabs::GridAppTabNumber);
01736 
01737 TRACEUSER( "Neville", _T("OptionsTabs::PrintTabNumber = %d\n"),OptionsTabs::PrintTabNumber);
01738 #endif
01739 
01740     // All ok
01741     return TRUE;
01742 }

virtual BOOL OptionsTabs::InitSection  )  [pure virtual]
 

Implemented in EditTab, GridTab, InternetTab, MiscTab, PageTab, PlugInsTab, PointersTab, PrintBaseTab, PrintLayoutTab, PrintSepsTab, PrintImagesetterTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

virtual BOOL OptionsTabs::IsDocumentOption  )  [pure virtual]
 

Implemented in EditTab, GridTab, InternetTab, MiscTab, PageTab, PlugInsTab, PointersTab, PrintBaseTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

BOOL OptionsTabs::IsPrintingOption  )  [virtual]
 

Allows the printing options dialog code to determine if this tab belongs to the group of printing options. This base class version allow the majority of tabs to answer no to this question and hence only needs overiding if the tab is a printing one.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Returns True if this tab is a printing option.

Errors: -

See also:
IsProgramOption(); IsDocumentOption();

Reimplemented in PrintBaseTab.

Definition at line 2327 of file appprefs.cpp.

02328 {
02329     return FALSE;
02330 }

virtual BOOL OptionsTabs::IsProgramOption  )  [pure virtual]
 

Implemented in EditTab, GridTab, InternetTab, MiscTab, PageTab, PlugInsTab, PointersTab, PrintBaseTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

MsgResult OptionsTabs::Message Msg pMessage  )  [virtual]
 

A traditional message handler.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/8/96
Parameters:
pMessage - the message [INPUTS]
Returns:
OK Message handled ok (return this even if you don't need to respond to the message).
FAIL Something terrible happened whilst processing the message eg. we ran out of memory. You must set ERROR if you are returning this value.

NOTE that many generally useful messages like DocChangingMsgs are handled by the caller, and are converted into upcalls to functions like UpdateSection() so will NOT be passed on to this function. However, less-used messages like ColourChangingMsgs will be passed on to this generic handler.

The base class simply returns OK. Derived classes which want to override this behaviour should return OK, unless something particuilarly unpleasant happened.

Reimplemented in PrintSepsTab, and PrintImagesetterTab.

Definition at line 1823 of file appprefs.cpp.

01824 {
01825     return(OK);
01826 }

BOOL OptionsTabs::NewUnitsInSection  )  [virtual]
 

Called when new default units chosen. Gives any tabbed dialog a chance to update any fields with new units in. This is the base class version and so will be used for any tabs which have no specified handling code.

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

Errors: -

See also:
-

Reimplemented in EditTab, GridTab, MiscTab, PageTab, and PointersTab.

Definition at line 1974 of file appprefs.cpp.

01975 {
01976     // Called when new default units chosen
01977     // Would normally be overriden by a a particular tab
01978     return TRUE;
01979 }

BOOL OptionsTabs::PageSizeHasChanged  )  [virtual]
 

Allows a tab to update any page size items being displayed. This is the base class version which is just here to be overidden.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if handled ok, False if not.

Errors: -

See also:
-

Reimplemented in PrintBaseTab.

Definition at line 2378 of file appprefs.cpp.

02379 {
02380     // Sent when the page size has been changed
02381     // This base class version does nothing
02382     return TRUE;        
02383 }

BOOL OptionsTabs::SetApplyNowState BOOL  NewState  )  [static]
 

Allows the setting of a new ApplyNow state.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/12/94
Parameters:
New ApplyNow flag state. [INPUTS]
- [OUTPUTS]
Returns:
The old ApplyNow state as either True or False.

Errors: -

See also:
GetApplyNowState();

Definition at line 2162 of file appprefs.cpp.

02163 {
02164     BOOL OldState = ApplyNow;       // note current old state
02165     // Only make the change if we are not in an init message state. As otherwise, when we
02166     // do an init, we will be sent a message to say a control has been changed and then
02167     // try to set the ApplyNow TRUE and hence then try to ungrey the ApplyNow button when
02168     // we shouldn't. 
02169     if (!InitMessage)
02170         ApplyNow = NewState;        // Set up the required new state    
02171 
02172     return OldState;                // return old state to the caller
02173 }

void OptionsTabs::SetCurrentDocAndSpread Document pDoc  )  [static]
 

Sets up the document and spread that we are currently supposed to be working on. This can then be used by the tabs instead of each one using their own method to work it out.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/3/95
Parameters:
Pointer to the document to use, can be NULL of course. [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2349 of file appprefs.cpp.

02350 {
02351     // Note this new document in our class variable.
02352     pDocument = pDoc;
02353 
02354     // Set up what we consider to be the current spread using the current document
02355     // class variable. 
02356     if (pDocument)
02357         pSpread = pDocument->FindFirstSpread();
02358     else
02359         pSpread = NULL; 
02360 }   

void OptionsTabs::SetDefaultUnits  )  [static]
 

Sets up the units class variables to the default values.

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

Errors: -

See also:
SetUpDocUnits;

Definition at line 1883 of file appprefs.cpp.

01884 {
01885     // Just to be on the safe side set up some default values 
01886     CurrentPageUnits = MILLIMETRES;         // Set up random default units.
01887     CurrentScaledUnits = MILLIMETRES;       // Set up random default units.
01888     CurrentFontUnits = COMP_POINTS;         // Set up random default units.
01889 
01890 }

void OptionsTabs::SetDocumentName String_256 DocumentName  )  [static]
 

Allows the name of the selected document to be set and remembered for when the tabs ask what the name is so that they can display it correctly. Uses the name supplied to set the new stored document name.

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

Errors: -

See also:
GetDocumentName();

Definition at line 2303 of file appprefs.cpp.

02304 {
02305     DocName = *DocumentName;
02306 }

void OptionsTabs::SetDocumentName Document pDoc  )  [static]
 

Allows the name of the selected document to be set and remembered for when the tabs ask what the name is so that they can display it correctly. Reads the title from the currently selected document and stores this in the class variable for later use. If the document pointer is null then it just sets the document name to a nice default.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/95
Parameters:
pDoc a pointer to the name to get the document from, NULL means set default [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
GetDocumentName();

Definition at line 2260 of file appprefs.cpp.

02261 {
02262     // Blank the present document name
02263     DocName.Empty();
02264     String_256 DocumentName;
02265 
02266     if (pDoc)
02267     {
02268         DocumentName = pDoc->GetDocName();
02269         //DocumentName = pDoc->GetTitle();
02270     }
02271     
02272     if (DocumentName.IsEmpty())
02273     {
02274         // No document name found so show a nice default blank type thing
02275         DocName = String(_R(IDS_K_APPPREF_NODOCNAME));
02276     }
02277     else
02278     {
02279         // Put the name into quotes
02280         DocName = String(_R(IDS_K_APPPREF_DOCNAMEQUOTES));
02281         DocName += DocumentName;
02282         DocName += String(_R(IDS_K_APPPREF_DOCNAMEQUOTES));
02283     }
02284 }

BOOL OptionsTabs::SetInitMessageState BOOL  NewState  )  [static]
 

Allows the setting of a new InitMessage state.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/12/94
Parameters:
New InitMessage state. [INPUTS]
- [OUTPUTS]
Returns:
The old InitMessage state as either True or False.

Errors: -

See also:
GetInitMessageState();

Definition at line 2210 of file appprefs.cpp.

02211 {
02212     BOOL OldState = InitMessage;    // note current old state
02213     InitMessage = NewState;         // Set up the required new state    
02214     
02215     return OldState;                // return old state to the caller
02216 }

BOOL OptionsTabs::SetUpDocUnits  )  [static]
 

Sets up the units variable to the currently set document units.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if set up ok, FALSE otherwise.

Errors: -

See also:
SetDefaultUnits;

Definition at line 1907 of file appprefs.cpp.

01908 {
01909     BOOL SetUpOk = FALSE; 
01910 
01911     // Set up the default document measurement units that are used
01912     // Get the page units from the doc unit list of the current document unless there
01913     // is no document present.
01914     // Otherwise just pick a random default.
01915     pDocument = Document::GetSelected();
01916     if (pDocument == NULL)
01917     {
01918         // Just to be on the safe side set up some default values 
01919         CurrentPageUnits = MILLIMETRES;                     
01920         CurrentScaledUnits = CurrentPageUnits;
01921         CurrentFontUnits = COMP_POINTS;
01922     }
01923     else
01924     {
01925         // Get the unit list attached to the current document
01926         //DocUnitList* pDocUnitList = DocUnitList::GetCurrentDocUnitList();
01927         DocUnitList* pDocUnitList = pDocument->GetDocUnitList();
01928         ERROR3IF(pDocUnitList == NULL,"OptionsTabs::SetUpDocUnits No doc unit list attached to this doc yet");
01929     
01930         if (pDocUnitList != NULL)
01931         {
01932             CurrentPageUnits = pDocUnitList->GetPageUnits();    // Set to the page units.
01933         
01934             CurrentScaledUnits = pDocUnitList->GetScaleUnits(); // Set to the scale units.
01935             // If set to automatic then use the current page units
01936             if (CurrentScaledUnits == AUTOMATIC)
01937                 CurrentScaledUnits = CurrentPageUnits; 
01938     
01939             CurrentFontUnits = pDocUnitList->GetFontUnits();    // Set to the font units.
01940 
01941             // Flag that everything went ok
01942             SetUpOk = TRUE; 
01943         }
01944         else
01945         {
01946             // Just to be on the safe side set up some default values 
01947             CurrentPageUnits = MILLIMETRES;                     // Set up random default units.
01948             CurrentScaledUnits = MILLIMETRES;                   // Set up random default units.
01949             CurrentFontUnits = COMP_POINTS;                     // Set up random default units.
01950         }
01951     }
01952 
01953     return (SetUpOk);
01954 }

BOOL OptionsTabs::UngreyApplyNow  )  [static]
 

Makes the Apply Now button on the main page of the tabbed dialog ungrey.

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

Errors: -

See also:
-

Definition at line 2107 of file appprefs.cpp.

02108 {
02109     ERROR2IF(pPrefsDlg == NULL,FALSE,"OptionsTabs::UngreyApplyNow called with no dialog pointer");
02110     
02111     // Ungrey the apply now button on the main page
02112     // Must restore the state of the currently selected tab as otherwise you might start
02113     // switching to talking to the main page when we are in the middle of talking to controls
02114     // on one of the pages and hence give rise to unknown controls messages when we try to
02115     // talk to the pages controls again.
02116     CDlgResID PageID = pPrefsDlg->GetCurrentPageID();   // Get currently selected Tab id
02117     pPrefsDlg->TalkToPage(0);                       // Select the main tab
02118     pPrefsDlg->EnableGadget(_R(ID_APPLY_NOW), TRUE);        // ungrey button on main tab
02120 //pPrefsDlg->EnableGadget(IDOK, TRUE);              // ungrey button on main tab
02121 //pPrefsDlg->EnableGadget(IDCANCEL, TRUE);          // ungrey button on main tab
02122     pPrefsDlg->TalkToPage(PageID);                      // Select the originally selected tab
02123 
02124     return TRUE;
02125 }

BOOL OptionsTabs::UngreySection  )  [virtual]
 

Called when the user has opened a document. Gives any tabbed dialog a chance to update any fields which may have been greyed when the last document was closed. This is the base class version and so will be used for any tabs which have no specified handling code.

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

Errors: -

See also:
OptionsTabs::GreySection(); OptionsTabs::UpdateSection();

Reimplemented in EditTab, GridTab, MiscTab, PageTab, PointersTab, PrintBaseTab, PrintSepsTab, PrintImagesetterTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

Definition at line 2025 of file appprefs.cpp.

02026 {
02027     // Called when the user has opened a document
02028     // Would normally be overriden by a a particular tab
02029     return TRUE;
02030 }

BOOL OptionsTabs::UpdateSection String_256 DocumentName  )  [virtual]
 

Called when the user has clicked on a new document or opened a new document. Gives any tabbed dialog a chance to update any fields which are used to reflect the current document's status. The document name allows the info field on the tab to be filled in correctly. This is the base class version and so will be used for any tabs which have no specified handling code.

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

Errors: -

See also:
OptionsTabs::UngreySection(); OptionsTabs::GreySection();

Reimplemented in EditTab, GridTab, MiscTab, PageTab, PointersTab, PrintBaseTab, PrintSepsTab, PrintImagesetterTab, ScaleTab, TuneTab, UndoTab, UnitsTab, and ViewTab.

Definition at line 2052 of file appprefs.cpp.

02053 {
02054     // Called when the user has opened a document
02055     // Would normally be overriden by a a particular tab
02056     return TRUE;
02057 }


Member Data Documentation

BOOL OptionsTabs::ApplyNow = FALSE [static, private]
 

Definition at line 414 of file appprefs.h.

UnitType OptionsTabs::CurrentFontUnits = NOTYPE [static, protected]
 

Definition at line 410 of file appprefs.h.

UnitType OptionsTabs::CurrentPageUnits = NOTYPE [static, protected]
 

Definition at line 408 of file appprefs.h.

UnitType OptionsTabs::CurrentScaledUnits = NOTYPE [static, protected]
 

Definition at line 409 of file appprefs.h.

String_256 OptionsTabs::DocName = "-" [static, private]
 

Definition at line 419 of file appprefs.h.

UINT32 OptionsTabs::GridAppTabNumber = 0 [static]
 

Definition at line 384 of file appprefs.h.

BOOL OptionsTabs::InitMessage = FALSE [static, private]
 

Definition at line 413 of file appprefs.h.

List OptionsTabs::OptionsTabsList [static, private]
 

Definition at line 417 of file appprefs.h.

UINT32 OptionsTabs::PageAppTabNumber = 0 [static]
 

Definition at line 383 of file appprefs.h.

Document * OptionsTabs::pDocument = NULL [static, protected]
 

Definition at line 405 of file appprefs.h.

UINT32 OptionsTabs::PlugsAppTabNumber = 0 [static]
 

Definition at line 386 of file appprefs.h.

DialogTabOp * OptionsTabs::pPrefsDlg = NULL [static]
 

Definition at line 367 of file appprefs.h.

UINT32 OptionsTabs::PrintTabNumber = 0 [static]
 

Definition at line 389 of file appprefs.h.

Document * OptionsTabs::pScopeDocument = NULL [static]
 

Definition at line 391 of file appprefs.h.

Spread * OptionsTabs::pSpread = NULL [static, protected]
 

Definition at line 406 of file appprefs.h.

UINT32 OptionsTabs::ScaleAppTabNumber = 0 [static]
 

Definition at line 382 of file appprefs.h.

UINT32 OptionsTabs::UnitsAppTabNumber = 0 [static]
 

Definition at line 381 of file appprefs.h.


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