ViewTab Class Reference

Allows the user to set any options which are normally associated with the applications View. This includes such things as:- Colour bar display mode Showing percentage hourglasses and/or progress bars. More...

#include <optsview.h>

Inheritance diagram for ViewTab:

OptionsTabs ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ViewTab ()
 ViewTab constructor. Creates a non-undoable operation.
 ~ViewTab ()
 ViewTab destructor.
virtual BOOL Init ()
 ViewTab initialisation routine.
virtual BOOL HandleMsg (DialogMsg *Msg)
 Called when the transparency state has changed and so we must update the switch state. Handles all the View options tabs messages.
virtual BOOL InitSection ()
 Sets initial values for the View section of the options dialog box. This section includes the:- Window
  • background redraw option
  • proportional scroll bars options Display
  • Colour bar mode selector
  • show system hourglass
  • show progress bar.

virtual BOOL CommitSection ()
 Takes the values in the View section tab of the options dialog box and sets the associated preference values accordingly Called when ok is pressed on the dialog box.
BOOL CommitBitmapSmoothingFlag (BOOL bNewSetting)
 Commits the 'allow bitmap smoothing when scaled up' setting. All bitmaps which are affected by the setting will be redrawn.
virtual BOOL GreySection ()
 Called when the user has closed all documents.
virtual BOOL UngreySection ()
 Called when the user has selected a new document or the title has been changed.
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.
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.

Protected Member Functions

BOOL GetDisplayStyleForView ()
 Reads the attributes associated with the current view. These include:-
  • background redraw state
  • proportional scroll bars state
  • transparency state.

BOOL DecodeModelListItem (BOOL *AutoColourModel, ColourModel *DisplayModel)
 Takes the selected item in the automatic colour model sleection list and translates it into the two items required:-
  • Automatic colour model selection flag
  • colour model selected.

BOOL InitAutoColourModelList (ColourModel DisplayModel, INT32 *SelectedIndex)
 Sets initial list for the automatic colour model selection but also returns the colour model passed in as an index into the list available.
INT32 GetSelectedDither (void)
 Converts the state of the radio button controls to a dither style.
BOOL SetSelectedDither (INT32 DitherStyle)
 Sets the radio buttons to the correct state for the supplied dither style.

Private Attributes

BOOL GreyStatus
BOOL OldShowTransparency
BOOL OldBackgroundRedraw
BOOL OldPropScroll
BOOL OldViewDither

Detailed Description

Allows the user to set any options which are normally associated with the applications View. This includes such things as:- Colour bar display mode Showing percentage hourglasses and/or progress bars.

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

Definition at line 126 of file optsview.h.


Constructor & Destructor Documentation

ViewTab::ViewTab  ) 
 

ViewTab 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 146 of file optsview.cpp.

00147 {   
00148     // Set up our private variables to known states
00149     GreyStatus = TRUE;
00150 
00151     // Variables to store the old control states.
00152     OldShowTransparency = TRUE; 
00153     OldBackgroundRedraw = TRUE; 
00154     OldPropScroll = TRUE;
00155 }        

ViewTab::~ViewTab  ) 
 

ViewTab destructor.

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

Errors: -

See also:
-

Definition at line 173 of file optsview.cpp.

00174 {   
00175 }        


Member Function Documentation

BOOL ViewTab::ChangeControlStatus const BOOL  Status  ) 
 

Called to grey/ungrey all controls on this tab.

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

Errors: -

See also:
ViewTab::GreySection; ViewTab::UngreySection;

Definition at line 712 of file optsview.cpp.

00713 {
00714     // Grey/ungrey the controls
00715 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_VIEWINFO), Status);
00716 
00717 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_DISPLAYGROUP), Status);
00719 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_PROGRESS), Status);
00720 
00721 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_COLOURLINEGROUP), Status);
00722 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_COLOURBAR), Status);
00723 
00724 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_COLOUREDITOR), Status);
00725 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_AUTOCOLOUR), Status);
00726 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_AUTOCOLOURTXT), Status);
00727 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_AUTOSCROLL), Status);
00728 
00729 //  pPrefsDlg->EnableGadget(_OPTS_INTERACTIVEFILL, Status);
00730 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_AUTOTRANS), Status);
00731 
00732 //  removed transparency control 27/8/96 
00733 //  pPrefsDlg->EnableGadget(_R(IDC_OPTS_SHOWTRANS), Status);
00734     pPrefsDlg->EnableGadget(_R(IDC_OPTS_SCROLLBARS), Status);
00735 
00736     pPrefsDlg->EnableGadget(_R(IDC_OPTS_SMOOTH_BITMAPS), Status);
00737 
00738     return TRUE;
00739 }           

BOOL ViewTab::CommitBitmapSmoothingFlag BOOL  bNewSetting  ) 
 

Commits the 'allow bitmap smoothing when scaled up' setting. All bitmaps which are affected by the setting will be redrawn.

Author:
Andy_Hills (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/11/00
Parameters:
bNewSetting new bitmap smoothing setting [INPUTS]
- [OUTPUTS]
Returns:
TRUE on success

Errors: -

See also:
-

Definition at line 357 of file optsview.cpp.

00358 {
00359     if (!pDocument)
00360         return(TRUE);
00361     
00362     // Invalidate any affected bitmaps.
00363     /* BOOL bOldSetting =*/ pDocument->GetBitmapSmoothing();
00364 
00365     // Enable the new setting
00366     pDocument->SetBitmapSmoothing(bNewSetting);
00367 
00368 
00369     // get the document's list of bitmaps
00370     BitmapList *pBitmapList = pDocument->GetBitmapList();
00371     ERROR3IF( (!pBitmapList), "ViewTab::CommitBitmapSmoothingFlag - couldn't get bitmap list" );
00372     DWORD ListSize = pBitmapList->GetCount();
00373 
00374     // get the first bitmap in the list
00375     KernelBitmap *pBitmap = (KernelBitmap*) (pBitmapList->GetHead());
00376 
00377     // for every KernelBitmap in the current document 
00378     while(ListSize>0)
00379     {
00380         // validate the bitmap ptr
00381         ERROR3IF( (!(pBitmap->IsKindOf(CC_RUNTIME_CLASS(KernelBitmap)))), "ViewTab::CommitBitmapSmoothingFlag - pBitmap is not a KernelBitmap" );
00382         
00383         // This is now redundant.
00384         // Since the document bitmap smoothing flag now affects all bitmaps,
00385         // but the individual bitmap smoothing flags only affect bitmaps which
00386         // are scaled up, the rule for whether or not we invalidate a bitmap
00387         // is much more complicated (we can't just invalidate all references to
00388         // one bitmap, since some of them may be scaled up, others scaled down,
00389         // etc.)
00390         // So we will invalidate ALL bitmaps instead!
00391         
00392         /*
00393         // work out whether the bitmap was being smoothed before the change
00394         BOOL bWasSmoothed    = (pBitmap->GetInterpolation() && bOldSetting);
00395         BOOL bWillBeSmoothed = (pBitmap->GetInterpolation() && bNewSetting);
00396 
00397         // if the bitmap was smoothed but isn't now (or vice versa) then invalidate it
00398         if( bWasSmoothed != bWillBeSmoothed )
00399         {
00400             // all nodes which use the bitmap will be redrawn
00401             pBitmap->GetActualBitmap()->InvalidateAllReferences(pDocument);
00402         }
00403         */
00404 
00405         pBitmap->GetActualBitmap()->InvalidateAllReferences(pDocument);
00406 
00407         // get the next bitmap in the list
00408         pBitmap = (KernelBitmap*) (pBitmapList->GetNext(pBitmap));
00409         ListSize--;
00410     }
00411 
00412     return TRUE;
00413 }

BOOL ViewTab::CommitSection  )  [virtual]
 

Takes the values in the View 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 433 of file optsview.cpp.

00434 {
00435 TRACEUSER( "Neville", _T("commit view section\n"));
00436     ERROR3IF(pPrefsDlg == NULL, "ViewTab::CommitSection called with no dialog pointer");
00437 
00438     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_VIEW));  // The View View identifier
00439     if (!ok)
00440         return TRUE;    // Talk to View failed to return now
00441 
00442     // Section = View
00443 
00444     // Ok has been pressed so take the values from this section of the dialog box
00445     BOOL Valid=TRUE;        // Flag for validity of value
00446     BOOL State=FALSE;       // Flag for state of button/switch
00447     BOOL SetOk=TRUE;        // Preference value set ok
00448 
00449     // Section = Display
00450 
00451     // Now the colour bar mode combo box
00452     INT32 ColourBarMode = 0;
00453     ColourBarMode = pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_COLOURBAR));
00454 TRACEUSER( "Neville", _T("commit colour bar mode='%d' \n"),ColourBarMode);
00455     SetOk = Camelot.SetPrefValue(TEXT("Displays"), TEXT("ColourBarMode"), &ColourBarMode);
00456     ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_VIEW));
00457 
00458 #ifndef STANDALONE
00459     CColourBar::SetDisplayMode();       // Try and get the colour bar to update itself
00460 #endif
00461 
00462     // Now tell other users that there is a possibly new colour bar display mode
00463     // in operation and so update any necessary items. 
00464     BROADCAST_TO_ALL(OptionsChangingMsg(pDocument, OptionsChangingMsg::NEWCOLOURBARMODE));
00465 
00466     // Now set up the other preference values according to the switches
00467 
00468     // Automatic colour model selection in colour editor
00469     BOOL AutoColourModel;
00470     ColourModel DisplayModel;
00471     DecodeModelListItem(&AutoColourModel, &DisplayModel);
00472 
00473     // added by CGS ....
00474     // since the default colour model can now be set from within the colour editor (coldlog.cpp)
00475     // we now need to force it from in here as well (otherwise the colour editor will save the one
00476     // that it is currently using - and NOT the one that we have just applied here!
00477 
00478     OpDescriptor* pOpDescriptor = (OpDescriptor*) OpDescriptor::FindOpDescriptor( OPTOKEN_COLOUREDITDLG );
00479 
00480     String_256 Dummy;
00481     OpState ColourEditDlgState = pOpDescriptor->GetOpsState(&Dummy);
00482 
00483     if (ColourEditDlgState.Ticked)
00484     {
00485         ColourEditDlg* pColourEditDlg = ColourEditDlg::GetColourEditDlg ();
00486         ASSERT (pColourEditDlg);
00487 
00488         pColourEditDlg->SetDefaultDisplayModel (DisplayModel);
00489     }
00490 
00491     SetOk = Camelot.SetPrefValue(TEXT("Displays"), TEXT("ColourEditorAutoModel"), &AutoColourModel);
00492     INT32 DisplayModelPref = (INT32)DisplayModel;   
00493     SetOk = SetOk && Camelot.SetPrefValue(TEXT("Displays"), TEXT("ColourEditorDisplayModel"), &DisplayModelPref);
00494     ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_VIEW));
00495 
00496     // Error diffused view option
00497     BOOL ViewDither = 2;
00498     ViewDither = GetSelectedDither();
00499     SetOk = Camelot.SetPrefValue(_T("Screen"), _T("ViewDither"), &ViewDither);
00500     ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_VIEW));
00501 
00502     PaletteManager::RedrawAllPalettedWindows(NULL);
00503 
00504     // Section = Bitmaps
00505 
00506     // The 'allow bitmap smoothing when scaled up' setting has changed.
00507     BOOL bSmoothing = ! pPrefsDlg->GetBoolGadgetSelected(_R(IDC_OPTS_SMOOTH_BITMAPS), 0, NULL, -1 );
00508     ok = CommitBitmapSmoothingFlag(bSmoothing);
00509     if (!ok) return FALSE;
00510 
00511     INT32 m_compoundConvertToEditableShapesDPI = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_COMPOUNDDPI), 10, 1000, _R(IDE_OPTS_INVALIDCOMPOUNDDPISIZE), &Valid);
00512     if (Valid)
00513     {
00514         BOOL SetOk = Camelot.SetPrefValue(TEXT("Displays"), TEXT("CompCToEDPI"), &m_compoundConvertToEditableShapesDPI);
00515         ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_TUNE));
00516     }
00517 
00518     BOOL fScaleJpg96dpi = FALSE; // Whether all JPEGs should be imported at 96DPI
00519     fScaleJpg96dpi = pPrefsDlg->GetLongGadgetValue( _R(IDC_JPEG_96DPI_CHECK), 0, 1, 0, &Valid );
00520     JPEGImportFilter::SetImportAt96dpi( fScaleJpg96dpi );
00521 
00522     // Automatic colour line, gallery scroll to colour selected
00523     State = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_AUTOSCROLL), 0, 1, 0, &Valid);
00524     SetOk = Camelot.SetPrefValue(TEXT("Displays"), TEXT("AutoScrollColours"), &State);
00525     ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_VIEW));
00526 
00527 // Removed 18/12/95 as non longer required
00528 //  // Show progress hourglass
00529 //  State = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_HOURGLASS), 0, 1, 0, &Valid);
00531 //      // We need a special access routine for this pref, as we want to create & destroy as
00532 //  // it changes value.
00533 //  extern BOOL ProgressCursorSetPref(BOOL fNewState);
00534 //  SetOk = ProgressCursorSetPref(State);
00535 //  ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_VIEW));
00536 
00537     // Show progress bar.
00538     State = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_PROGRESS), 0, 1, 0, &Valid);
00539     SetOk = Camelot.SetPrefValue(TEXT("Displays"), TEXT("ProgressBar"), &State);
00540     ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_VIEW));
00541 
00542     // Section = Window
00543 
00544     // Now try and set the current view's state, if there is one.   
00545     DocView *pView = DocView::GetSelected();
00546     BOOL BackgroundRedraw = TRUE;
00547 
00548     // Proportional scrollbar state option (for main view) removed 10/10/05 by Marc.
00549     // The current scrollbars are always proportional so it didn't make sense
00550 
00551     // Read the state of the interactive fill editing switch and set the new value in the preferences
00552     BOOL InteractiveFill = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_INTERACTIVEFILL), 0, 1, 0, &Valid);
00553     SetOk = Camelot.SetPrefValue(TEXT("Dragging"), TEXT("InteractiveFillEditing"), &InteractiveFill);
00554     ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_VIEW));
00555 
00556 // Removed 29/8/95 as transparency prompt dead
00557     // Read the state of the auto transparancy switch and set the new value in the preferences
00558 //  BOOL AutoTransparency = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_AUTOTRANS), 0, 1, 0, &Valid);
00559 //  SetOk = Camelot.SetPrefValue(TEXT("Rendering"), TEXT("AutoTransparency"), &AutoTransparency);
00560 //  ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_VIEW));
00561 
00562     // Read the state of the show transparancy switch and set the new value in the
00563     // selected document. Read vack value afterwards as the user will have been asked to 
00564     // confirm the operation 
00565 // Removed 27/8/96; Transparency Control is DEAD 
00566 /*
00567     BOOL ShowTransparency = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_SHOWTRANS), 0, 1, 0, &Valid);
00568     if (pDocument != NULL)
00569     {
00570         // According to the state of the switch, try to enable or disable transparency
00571         BOOL NewState;
00572         if (ShowTransparency)
00573             NewState = pDocument->TransparencyState(Enable);
00574         else
00575             NewState = pDocument->TransparencyState(Disable);
00576 */
00577         // If transparancy is present and the user has tried to turn it off then they will
00578         // have been prompted as to whether they want to or not. Therefore, we must reset
00579         // the switch state according to thevalue returned to us.
00580 
00581 // removed 27/8/96 Transparency Control is DEAD 
00582 //      pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_SHOWTRANS), NewState);
00583 
00584 // Removed 29/8/95 as transparency prompt dead
00585         // Just in case, we will check the state of the automatic transparency switch
00586 //      BOOL NewAutoTransparency = FALSE;
00587 //      BOOL ReadOk = Camelot.GetPrefValue(TEXT("Rendering"), TEXT("AutoTransparency"),
00588 //                                         &NewAutoTransparency);
00589 //      if (NewAutoTransparency != 0)
00590 //          pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_AUTOTRANS), TRUE);
00591 //      else
00592 //          pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_AUTOTRANS), FALSE);
00593 //  } 
00594 // Removed this rampant ERROR2 when no documents are present
00595 //  else
00596 //      ERROR2(FALSE,_R(IDE_OPTS_READPREF_VIEW));
00597 
00598 
00599     // Set the document altered state true if any of the document/view based items have been
00600     // changed but only if we have a valid document and view.
00601     if (pView != NULL && pDocument != NULL)
00602     {
00603         //removed 27/8/96 Transparency Control DEAD 
00604         if (
00605     //      OldShowTransparency != ShowTransparency || 
00606             OldBackgroundRedraw != BackgroundRedraw
00607            )
00608         {
00609             pDocument->SetModified(TRUE);       
00610         }
00611            
00612         // Now remember the new states
00613     //  OldShowTransparency = ShowTransparency; removed 27/8/96 transparency control DEAD
00614         OldBackgroundRedraw = BackgroundRedraw;
00615     }
00616 
00617     return TRUE;
00618 }

BOOL ViewTab::DecodeModelListItem BOOL *  AutoColourModel,
ColourModel DisplayModel
[protected]
 

Takes the selected item in the automatic colour model sleection list and translates it into the two items required:-

  • Automatic colour model selection flag
  • colour model selected.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/4/95
Parameters:
- [INPUTS]
AutoColourModel Is the automatic selection state [OUTPUTS] DisplayModel Is the colour model chosen
Returns:
True if taken from list ok, False otherwise.

Errors: -

See also:
CommitSection;

Definition at line 281 of file optsview.cpp.

00282 {
00283 TRACEUSER( "Neville", _T("ViewTab::DecodeModelListItem\n"));
00284     ERROR3IF(pPrefsDlg == NULL, "ViewTab::DecodeModelListItem called with no dialog pointer");
00285 
00286     // Decode the selected item in the automatic colour model list into the two preference
00287     // values we require
00288     
00289     // Set up default values in case of early exit
00290     *AutoColourModel = FALSE;
00291     *DisplayModel = COLOURMODEL_HSVT;
00292 
00293     // Get the number of the selected item in the list
00294     WORD Index;
00295     pPrefsDlg->GetValueIndex(_R(IDC_OPTS_AUTOCOLOUR), &Index);
00296 
00297     // If the selected item is zero then Automatic has been chosen
00298     if (Index == 0)
00299     {
00300         // Set up the return variables
00301         *AutoColourModel = TRUE;
00302         *DisplayModel = COLOURMODEL_HSVT;
00303     }
00304     else if ((Index > 0) && (Index < (MAX_COLOURMODELS + 1)))
00305     {
00306         // Remove the automatic from the list
00307         Index--;
00308         
00309         // Work out the colour model required
00310         ColourContextArray ColContexts;
00311         ColourContext::GetGlobalDefaults(&ColContexts);
00312 
00313         // Variable for holding the selected model number
00314         INT32 NewModelNum;
00315 
00316         // Work through the colour model list an index number of times
00317         for (NewModelNum = 0; NewModelNum < MAX_COLOURMODELS; NewModelNum++)
00318         {
00319             if (ColContexts.Context[NewModelNum] != NULL)
00320             {
00321                 if ((Index--) <= 0)
00322                     break;
00323             }
00324         }
00325 
00326         // Set up the return variables
00327         *AutoColourModel = FALSE;
00328         *DisplayModel = (ColourModel) NewModelNum;
00329     }
00330     else
00331     {
00332         // something nasty has happened 
00333         return FALSE;
00334     }
00335 
00336     return TRUE;
00337     
00338 }   

BOOL ViewTab::GetDisplayStyleForView  )  [protected]
 

Reads the attributes associated with the current view. These include:-

  • background redraw state
  • proportional scroll bars state
  • transparency state.

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

Errors: -

See also:
AppPrefsDlg; OptionsTabs;

Definition at line 908 of file optsview.cpp.

00909 {
00910     // Now the document's transparency state
00911     if (pDocument != NULL)
00912     {
00913 //removed 27/8/96; Transparency Control DEAD  
00914 //      BOOL ShowTransparency = pDocument->TransparencyState(NoChange);
00915 //      if (ShowTransparency != 0)
00916 //          pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_SHOWTRANS), TRUE);
00917 //      else
00918 //          pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_SHOWTRANS), FALSE);
00919 
00920         // We must have a selected document to have a selected view
00921         DocView *pView = DocView::GetSelected();
00922         if (pView != NULL)
00923         {
00924         }
00925 
00926         // Remember this value for later use
00927 //      OldShowTransparency = ShowTransparency; removed 27/8/96 transparency control DEAD
00928     }
00929     else
00930     {
00931         // Ensure that the dodgy options are greyed and unuseable 
00932         GreySection();  
00933         return FALSE;
00934     }
00935         
00936     // Everything went well.
00937     return TRUE;
00938 }   

CDlgResID ViewTab::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 214 of file optsview.cpp.

00215 {
00216     return _R(IDD_OPTSTAB_VIEW);
00217 }

INT32 ViewTab::GetSelectedDither void   )  [protected]
 

Converts the state of the radio button controls to a dither style.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The GDraw dither style specified by the controls

Errors: -

See also:
-

Definition at line 1181 of file optsview.cpp.

01182 {
01183     INT32 DitherStyle = 2;  // Default to ordered dither
01184 
01185     CGadgetID Gadget = pPrefsDlg->GetRadioGroupSelected(DitherGadgets);
01186 
01187     if (Gadget ==  _R(IDC_OPTS_DITHER_NONE))
01188         DitherStyle = 4;
01189     else if (Gadget == _R(IDC_OPTS_DITHER_ORDERED))
01190         DitherStyle = 2;
01191     else if (Gadget == _R(IDC_OPTS_DITHER_DIFFUSED))
01192         DitherStyle = 3;
01193 
01194     return(DitherStyle);
01195 }

BOOL ViewTab::GreySection  )  [virtual]
 

Called when the user has closed all documents.

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

Errors: -

See also:
ViewTab::UngreySection;

Reimplemented from OptionsTabs.

Definition at line 635 of file optsview.cpp.

00636 {
00637 TRACEUSER( "Neville", _T("GreySection in ViewTab section\n"));
00638     ERROR2IF(pPrefsDlg == NULL,FALSE,"ViewTab::GreySection called with no dialog pointer");
00639 
00640     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_VIEW));  // The ViewTab identifier
00641     if (!ok)
00642         return TRUE;    // Talk to page failed to return now
00643 
00644     // Only update if we are not already grey 
00645     if (GreyStatus == TRUE)
00646         return TRUE;
00647 
00648     // Call our central greying/ungreying function
00649     ok = ChangeControlStatus(FALSE);
00650     
00651     GreyStatus = TRUE;
00652 
00653     return ok;
00654 } 

BOOL ViewTab::HandleMsg DialogMsg Msg  )  [virtual]
 

Called when the transparency state has changed and so we must update the switch state. Handles all the View 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 844 of file optsview.cpp.

00845 {
00846 TRACEUSER( "Neville", _T("HandleViewMsg\n"));
00847     ERROR2IF(Msg == NULL,FALSE,"ViewTab::Message null message received");
00848     ERROR2IF(pPrefsDlg == NULL,FALSE,"ViewTab::HandleMsg called with no dialog pointer");
00849 
00850     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_VIEW));  // The View View identifier
00851     if (!ok)
00852         return TRUE;        // page not present
00853 
00854     switch(Msg->DlgMsg)
00855     {
00856         case DIM_CREATE:    // Initialise controls
00857             GreyStatus = FALSE; // we are ungreyed by default
00858             ok = InitSection();
00859             if (!ok)
00860                 InformError();
00861             break;
00862         case DIM_LFT_BN_CLICKED:
00863             OptionsTabs::SetApplyNowState(TRUE);
00864 //          switch (Msg->GadgetID)
00865 //          {
00866 //              case _R(IDC_OPTS_SHOWTRANS):
00867 //                  // If the show transparency button is turned off and the automatic
00868 //                  // transparency is on then force it off.
00869 //                  BOOL Valid;
00870 //                  BOOL ShowTrans = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_SHOWTRANS), 0, 1, 0, &Valid);
00871 //                  BOOL AutoTrans = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_AUTOTRANS), 0, 1, 0, &Valid);
00872 //                  if (!ShowTrans && AutoTrans)
00873 //                  {
00874 //                      pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_AUTOTRANS), FALSE);
00875 //                  }
00876 //                  break;
00877 //          }
00878             break;
00879         case DIM_SELECTION_CHANGED:
00880         case DIM_TEXT_CHANGED:
00881             OptionsTabs::SetApplyNowState(TRUE);
00882             break;
00883         default:
00884             break;
00885     }
00886 
00887     return TRUE;
00888 }  

BOOL ViewTab::Init void   )  [virtual]
 

ViewTab 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 193 of file optsview.cpp.

00194 {   
00195     return TRUE;
00196 }        

BOOL ViewTab::InitAutoColourModelList ColourModel  DisplayModel,
INT32 *  SelectedIndex
[protected]
 

Sets initial list for the automatic colour model selection but also returns the colour model passed in as an index into the list available.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/4/95
Parameters:
DisplayModel preference for the colour model to be used [INPUTS]
SelectedIndex returned index into the list [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
InitSection;

Definition at line 958 of file optsview.cpp.

00959 {
00960 TRACEUSER( "Neville", _T("ViewTab::InitAutoColourModelList\n"));
00961     ERROR2IF(pPrefsDlg == NULL,FALSE,"ViewTab::InitAutoColourModelList called with no dialog pointer");
00962 
00963     // Wipe the list back to nothing, just in case
00964     pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_AUTOCOLOUR));
00965     
00966     ColourContextArray ColContexts;
00967     ColourContext::GetGlobalDefaults(&ColContexts);
00968 
00969     // General variables
00970     String_64 NameString;
00971     INT32 Index = 0;
00972     String_32 ModelName;
00973     // Set up decent return value in case of early exit
00974     *SelectedIndex = 0;
00975 
00976     // First item in the list is an automatic.
00977     ModelName = String(_R(IDT_OPTS_AUTOMATIC));     // automatic colour model   
00978     NameString.MakeMsg(_R(IDS_COLCONTEXTNAME), (TCHAR *) ModelName);
00979     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_AUTOCOLOUR), NameString, FALSE, Index);
00980 
00981     for (INT32 i = 0; i < MAX_COLOURMODELS; i++)
00982     {
00983         if (ColContexts.Context[i] != NULL)
00984         {
00985             ColContexts.Context[i]->GetModelName(&ModelName);
00986 
00987             NameString.MakeMsg(_R(IDS_COLCONTEXTNAME), (TCHAR *) ModelName);
00988             pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_AUTOCOLOUR), NameString, FALSE, Index + 1);
00989 
00990             // If the colour model is equal to the entry model then note the index for this item. 
00991             if (i == (INT32)DisplayModel)
00992                 *SelectedIndex = Index;
00993     
00994             Index++;
00995         }
00996     }       
00997 
00998     // Set the length of the list
00999     pPrefsDlg->SetComboListLength(_R(IDC_OPTS_AUTOCOLOUR));
01000 
01001     return TRUE;
01002 }

BOOL ViewTab::InitSection  )  [virtual]
 

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

  • background redraw option
  • proportional scroll bars options Display
  • Colour bar mode selector
  • show system hourglass
  • show progress bar.

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;

Implements OptionsTabs.

Definition at line 1027 of file optsview.cpp.

01028 {
01029 TRACEUSER( "Neville", _T("ViewTab::InitSection\n"));
01030     ERROR2IF(pPrefsDlg == NULL,FALSE,"ViewTab::InitSection called with no dialog pointer");
01031 
01032     BOOL ReadOk = FALSE;    // Flag to say whether the preference value was read ok 
01033 
01034     // Section = Display
01035 
01036     // Now the colour bar mode combo box
01037     INT32 ColourBarMode = 0; 
01038     ReadOk = Camelot.GetPrefValue(TEXT("Displays"), TEXT("ColourBarMode"), &ColourBarMode);
01039 TRACEUSER( "Neville", _T("set colour bar mode '%d'\n"),ColourBarMode);
01040     // Set up the list of available options
01041     pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_COLOURBAR));
01042     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_COLOURBAR), String_32(_R(IDN_COLBAR_SMALL)));
01043     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_COLOURBAR), String_32(_R(IDN_COLBAR_MEDIUM)));
01044     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_COLOURBAR), String_32(_R(IDN_COLBAR_MEDSCROLL)));
01045     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_COLOURBAR), String_32(_R(IDN_COLBAR_LARGE)));
01046     pPrefsDlg->SetComboListLength(_R(IDC_OPTS_COLOURBAR));
01047     // Set up the default option displayed
01048     BOOL ok = pPrefsDlg->SetSelectedValueIndex(_R(IDC_OPTS_COLOURBAR),ColourBarMode);
01049     ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01050 
01051     
01052     // Now the colour editor model selection
01053     BOOL ColourEditorAutoModel = FALSE; 
01054     ColourModel DisplayModel = COLOURMODEL_HSVT;
01055     INT32 DisplayModelPref = (INT32)DisplayModel;
01056     INT32 SelectedIndex = 0;
01057 
01058     // First check if automatic is set.
01059     ReadOk = Camelot.GetPrefValue(TEXT("Displays"), TEXT("ColourEditorAutoModel"), &ColourEditorAutoModel);
01060 TRACEUSER( "Neville", _T("set colour editor auto model mode '%d'\n"),ColourEditorAutoModel);
01061     // Now get the display model preference 
01062     ReadOk = ReadOk && Camelot.GetPrefValue(TEXT("Displays"), TEXT("ColourEditorDisplayModel"), &DisplayModelPref);
01063 TRACEUSER( "Neville", _T("set colour editor model '%d'\n"),DisplayModelPref);
01064 
01065     DisplayModel = (ColourModel)DisplayModelPref;
01066     // Set up the list, passing in the default colour model, returning an index into the list
01067     // of available colour models
01068     InitAutoColourModelList(DisplayModel, &SelectedIndex);  
01069 TRACEUSER( "Neville", _T("set colour editor list item '%d'\n"),SelectedIndex);
01070     if (ColourEditorAutoModel != 0)
01071     {
01072         // Automatic colour model selection so select the first in the list
01073         pPrefsDlg->SetSelectedValueIndex(_R(IDC_OPTS_AUTOCOLOUR), 0);
01074     }
01075     else
01076     {
01077         // Not automatic so select item in list taking into account extra automatic option
01078         // which is the first in the list.
01079         pPrefsDlg->SetSelectedValueIndex(_R(IDC_OPTS_AUTOCOLOUR), SelectedIndex + 1);
01080     }
01081     ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01082     
01083     // Automatic colour line, gallery scroll to colour selected
01084     BOOL ColourAutoScroll = FALSE;
01085     ReadOk = Camelot.GetPrefValue(TEXT("Displays"), TEXT("AutoScrollColours"), &ColourAutoScroll);
01086     if (ColourAutoScroll != 0)
01087         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_AUTOSCROLL), TRUE);
01088     else
01089         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_AUTOSCROLL), FALSE);
01090     ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01091 
01092 
01093     // Now set up the other buttons according to the values set in the variables
01094 // Removed 18/12/95 as non longer required
01095 //  BOOL HourGlass = FALSE;
01096 //  ReadOk = Camelot.GetPrefValue(TEXT("Displays"), TEXT("Hourglass"), &HourGlass);
01097 //  if (HourGlass != 0)
01098 //      pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_HOURGLASS), TRUE);
01099 //  else
01100 //      pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_HOURGLASS), FALSE);
01101 //  ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01102 
01103     BOOL ProgressBar = FALSE;
01104     ReadOk = Camelot.GetPrefValue(TEXT("Displays"), TEXT("ProgressBar"), &ProgressBar);
01105     if (ProgressBar != 0)
01106         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_PROGRESS), TRUE);
01107     else
01108         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_PROGRESS), FALSE);
01109     ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01110 
01111     // Section = Bitmaps
01112     BOOL bSmoothing = TRUE;
01113     if (pDocument)
01114         bSmoothing = pDocument->GetBitmapSmoothing();
01115     pPrefsDlg->SetBoolGadgetSelected(_R(IDC_OPTS_SMOOTH_BITMAPS), !bSmoothing, 0 );
01116 
01117     INT32 m_compoundConvertToEditableShapesDPI;
01118     ReadOk = Camelot.GetPrefValue(TEXT("Displays"), TEXT("CompCToEDPI"), &m_compoundConvertToEditableShapesDPI);
01119     pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_COMPOUNDDPI), m_compoundConvertToEditableShapesDPI);
01120     ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01121 
01122     // Set the force JPEG DPI flag
01123     pPrefsDlg->SetLongGadgetValue( _R(IDC_JPEG_96DPI_CHECK), INT32(JPEGImportFilter::GetImportAt96dpi()) );
01124 
01125     // Section = Window
01126 
01127 // Removed 29/8/95 as transparency prompt dead
01128 //  BOOL AutoTransparency = FALSE;
01129 //  ReadOk = Camelot.GetPrefValue(TEXT("Rendering"), TEXT("AutoTransparency"), &AutoTransparency);
01130 //  if (AutoTransparency != 0)
01131 //      pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_AUTOTRANS), TRUE);
01132 //  else
01133 //      pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_AUTOTRANS), FALSE);
01134 //  ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01135 
01136     BOOL InteractiveFill = FALSE;
01137     ReadOk = Camelot.GetPrefValue(TEXT("Dragging"), TEXT("InteractiveFillEditing"), &InteractiveFill);
01138     if (InteractiveFill != 0)
01139         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_INTERACTIVEFILL), TRUE);
01140     else
01141         pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_INTERACTIVEFILL), FALSE);
01142     ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01143     
01144     INT32 ViewDither = 2;
01145     ReadOk = Camelot.GetPrefValue(_T("Screen"), _T("ViewDither"), &ViewDither);
01146     SetSelectedDither(ViewDither);
01147     ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_VIEW));
01148 
01149     // Set up the attributes which are document/view specific
01150     ok = GetDisplayStyleForView();
01151 
01152     return TRUE;
01153 }

BOOL ViewTab::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 235 of file optsview.cpp.

00236 {
00237     return FALSE;   // This tab is not a document option 
00238 }

BOOL ViewTab::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 256 of file optsview.cpp.

00257 {
00258     return TRUE;    // This tab is a program option 
00259 }

BOOL ViewTab::SetSelectedDither INT32  DitherStyle  )  [protected]
 

Sets the radio buttons to the correct state for the supplied dither style.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/96
Parameters:
DitherStyle - the GDraw dither style [INPUTS]
- [OUTPUTS]
Returns:
TRUE if it succeeded

Errors: -

See also:
DialogOp::SetRadioGroupSelected()

Definition at line 1215 of file optsview.cpp.

01216 {
01217     CGadgetID Gadget = _R(IDC_OPTS_DITHER_ORDERED);
01218 
01219     switch(DitherStyle)
01220     {
01221         case 4:
01222             Gadget = _R(IDC_OPTS_DITHER_NONE);
01223             break;
01224 
01225         case 1:
01226         case 2:
01227             Gadget = _R(IDC_OPTS_DITHER_ORDERED);
01228             break;
01229 
01230         case 0:
01231         case 3:
01232             Gadget = _R(IDC_OPTS_DITHER_DIFFUSED);
01233             break;
01234 
01235         default:
01236             break;
01237     }
01238 
01239     return(pPrefsDlg->SetRadioGroupSelected(DitherGadgets, Gadget));
01240 }

BOOL ViewTab::UngreySection  )  [virtual]
 

Called when the user has selected a new document or the title has been changed.

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

Errors: -

See also:
ViewTab::UngreySection;

Reimplemented from OptionsTabs.

Definition at line 671 of file optsview.cpp.

00672 {
00673 TRACEUSER( "Neville", _T("UngreySection in ViewTab section\n"));
00674     ERROR2IF(pPrefsDlg == NULL,FALSE,"ViewTab::UngreySection called with no dialog pointer");
00675 
00676     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_VIEW));  // The ViewTab identifier
00677     if (!ok)
00678         return TRUE;    // Talk to page failed to return now
00679 
00680     BOOL bSmoothing = TRUE;
00681     if (pDocument)
00682         bSmoothing = pDocument->GetBitmapSmoothing();
00683     pPrefsDlg->SetBoolGadgetSelected(_R(IDC_OPTS_SMOOTH_BITMAPS), !bSmoothing, 0 );
00684 
00685     // Only update if we are not already ungrey 
00686     if (GreyStatus == FALSE)
00687         return TRUE;
00688 
00689     // Call our central greying/ungreying function
00690     ok = ChangeControlStatus(TRUE);
00691     
00692     GreyStatus = FALSE;
00693 
00694     return ok;
00695 }

BOOL ViewTab::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:
4/2/95
Parameters:
Name of document [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
ViewTab::GreySection; ViewTab::UngreySection; ViewTab::InitSection;

Reimplemented from OptionsTabs.

Definition at line 758 of file optsview.cpp.

00759 {
00760 TRACEUSER( "Neville", _T("ViewTab::UpdateSection\n"));
00761     ERROR2IF(pPrefsDlg == NULL,FALSE,"ViewTab::UpdateSection called with no dialog pointer");
00762 
00763     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_VIEW));  // The ViewTab identifier
00764     if (!ok)
00765         return TRUE;        // page not present
00766 
00767     // Remove any lists that we have created.
00768     //pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_COLOURBAR));
00769 
00770     // Update any document/view specific bits
00771     GetDisplayStyleForView();
00772 
00773     BOOL bSmoothing = TRUE;
00774     if (pDocument)
00775         bSmoothing = pDocument->GetBitmapSmoothing();
00776     pPrefsDlg->SetBoolGadgetSelected(_R(IDC_OPTS_SMOOTH_BITMAPS), !bSmoothing, 0 );
00777 
00778     // Call the normal init section code.
00779     // Not required are only a few items which are document based and there are no fields
00780     // displayed using units.
00781     //return InitSection();
00782     return ok;
00783 }


Member Data Documentation

BOOL ViewTab::GreyStatus [private]
 

Definition at line 180 of file optsview.h.

BOOL ViewTab::OldBackgroundRedraw [private]
 

Definition at line 184 of file optsview.h.

BOOL ViewTab::OldPropScroll [private]
 

Definition at line 185 of file optsview.h.

BOOL ViewTab::OldShowTransparency [private]
 

Definition at line 183 of file optsview.h.

BOOL ViewTab::OldViewDither [private]
 

Definition at line 186 of file optsview.h.


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