PlugInsTab Class Reference

Allows the user to define options assocaited with plug-ins. At present this covers:- More...

#include <optsplug.h>

Inheritance diagram for PlugInsTab:

OptionsTabs ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PlugInsTab ()
 PlugInsTab constructor. Creates a non-undoable operation.
 ~PlugInsTab ()
 PlugInsTab destructor.
virtual BOOL Init ()
 PlugInsTab initialisation routine.
virtual BOOL HandleMsg (DialogMsg *Msg)
 Handles all the Plug-ins options tabs messages.
virtual BOOL InitSection ()
 Shows the list of pathnames in the list control. Sets initial values for the Plug-ins section of the options dialog box. This section includes the:-.
virtual BOOL CommitSection ()
 Takes the values in the Units section tab of the options dialog box and sets the associated preference values accordingly Called when ok is pressed on the dialog box.
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 CommitDialogValues ()
 Takes the values in the dialog. Called when the OK button is selected.
BOOL InitControls ()
 Creates a new path that the user has just requested. Deletes the currently selected path. Provides access from the 'Buy Plugins' button to Xara's plugin pages. Errors If the browser could not be opened, an Error message box is diplayed. See Also ~ adapted from Ranbir's HelpXaraNewsAction() ~Inits all the controls in the dialog Called immediately after the bar is created to init drop lists, grey out gadgets, etc.
BOOL EnableControls ()
 Enables or disables the controls depending on the current context, i.e. the controls are disabled if there is no selection, etc.

Private Attributes

BOOL m_ChangedList

Detailed Description

Allows the user to define options assocaited with plug-ins. At present this covers:-

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

Definition at line 122 of file optsplug.h.


Constructor & Destructor Documentation

PlugInsTab::PlugInsTab  ) 
 

PlugInsTab constructor. Creates a non-undoable operation.

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

Errors: -

See also:
-

Definition at line 139 of file optsplug.cpp.

00140 {   
00141     // Set up our default states
00142     m_ChangedList = FALSE;
00143 }        

PlugInsTab::~PlugInsTab  ) 
 

PlugInsTab destructor.

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

Errors: -

See also:
-

Definition at line 160 of file optsplug.cpp.

00161 {   
00162 }        


Member Function Documentation

BOOL PlugInsTab::CommitDialogValues  )  [protected]
 

Takes the values in the dialog. Called when the OK button is selected.

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

Errors: -

See also:
-

Definition at line 394 of file optsplug.cpp.

00395 {
00396     ERROR2IF(pPrefsDlg == NULL,FALSE,"PlugInsTab::CommitDialogValues called with no dialog pointer");
00397 //  ERROR2IF(m_pManager == NULL,FALSE,"PlugInsTab::CommitDialogValues called with no plug-ins manager pointer");
00398 
00399     // All our settings should be up todate on the dialog box itself
00400     // All we need to do is rescan all of the plug-in paths available.
00401 
00402     // If we have changed our list changed flag then we should reparse the list of plug-ins for
00403     // these paths.
00404     BOOL ok = TRUE;
00405 //  if (m_ChangedList)
00406 //  {   
00407 //      ok = ok && m_pManager->DestroyPlugInsList();
00408 //      ok = ok && m_pManager->ParseAllPaths();
00409 //
00410 //      if (ok)
00411 //          m_ChangedList = FALSE;
00412 //  }
00413 
00414     BOOL SetOk = FALSE;
00415     INT32 State = 0;
00416     BOOL Valid = FALSE;
00417 
00418 /*  // Cacheing preferences
00419     State = pPrefsDlg->GetLongGadgetValue(_R(IDC_CHECK_CACHE_ENABLED), 0, 1, 0, &Valid);
00420     if (Valid)
00421         SetOk = Camelot.SetPrefValue(TEXT("Rendering"), TEXT("Cacheing"), &State);
00422 
00423 //  State = pPrefsDlg->GetLongGadgetValue(_R(IDC_EDIT_CACHE_SIZE), 1, 100, 0, &Valid);
00424     String_256 strCachePercent = pPrefsDlg->GetStringGadgetValue(_R(IDC_EDIT_CACHE_SIZE), &Valid);
00425     double dValue = 0;
00426     INT32 Pos = 0;
00427     INT32 iValue = 0;
00428     Convert::ReadNumber(&strCachePercent, &Pos, &dValue);   // Allow trailing chars
00429     if (Valid && dValue>=1 && dValue<=100)
00430         iValue = (INT32)dValue;
00431         SetOk = Camelot.SetPrefValue(TEXT("Cache"), TEXT("CacheRAMPercent"), &iValue);
00432 
00433     // Reset the cache size...
00434     CBitmapCache* pCache = Camelot.GetBitmapCache();
00435     if (pCache)
00436     {
00437         pCache->SetMaximumDataSize(pCache->CalcRecommendedMaximumDataSize());
00438         // If the new size if smaller than the old size, things will get
00439         // thrown out of the cache the next time any attempt is made to
00440         // store anything...
00441     }
00442 */
00443     // Effect resolution preferences
00444     INT32 dLiveResolution = pPrefsDlg->GetResDropListValue(_R(IDC_COMBO_LIVEEFFECT_RES), TRUE, &Valid);
00445     if (Valid)
00446         Camelot.SetPrefValue(TEXT("Effects"), TEXT("DefaultLivePixelsPerInch"), &dLiveResolution);
00447 
00448     INT32 dLockedResolution = pPrefsDlg->GetResDropListValue(_R(IDC_COMBO_LOCKEDEFFECT_RES), FALSE, &Valid);
00449     if (Valid)
00450         Camelot.SetPrefValue(TEXT("Effects"), TEXT("DefaultLockedPixelsPerInch"), &dLockedResolution);
00451 
00452     State = pPrefsDlg->GetLongGadgetValue(_R(IDC_CHECK_NEW_EFFECTS_LOCKED), 0, 1, 0, &Valid);
00453     SetOk = Camelot.SetPrefValue(TEXT("Effects"), TEXT("DefaultLocked"), &State);
00454 
00455     return ok;
00456 }

BOOL PlugInsTab::CommitSection  )  [virtual]
 

Takes the values in the Units 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:
12/12/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if values in dialog box ok, False otherwise.

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 267 of file optsplug.cpp.

00268 {
00269     ERROR2IF(pPrefsDlg == NULL,FALSE,"PlugInsTab::CommitSection called with no dialog pointer");
00270 
00271     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PLUGINS));   // The units page identifier
00272     if (!ok)
00273         return TRUE;    // Talk to page failed to return now
00274 
00275     ok = CommitDialogValues();
00276 
00277     return ok;
00278 }

BOOL PlugInsTab::EnableControls  )  [protected]
 

Enables or disables the controls depending on the current context, i.e. the controls are disabled if there is no selection, etc.

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

Definition at line 621 of file optsplug.cpp.

00622 {
00623     ERROR2IF(pPrefsDlg == NULL,FALSE,"PlugInsTab::EnableControls called with no dialog pointer");
00624 //  ERROR2IF(m_pManager == NULL,FALSE,"PlugInsTab::EnableControls called with no plug-ins manager pointer");
00625 
00626     BOOL enable = FALSE; //(pDocUnitList->FindFirstUserUnit() != NULL);
00627 
00628     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BUTTON_PLUGINS_SETUP),  enable);
00629 /*  pPrefsDlg->EnableGadget(_R(IDC_OPTS_DELETEPATH),    enable);
00630     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BUYPLUGS),      enable);
00631     pPrefsDlg->EnableGadget(_R(IDC_OPTS_NEWPATH),       enable);
00632 */
00633     return TRUE;
00634 }           

CDlgResID PlugInsTab::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:
12/12/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The dialog ID of this tab section.

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 202 of file optsplug.cpp.

00203 {
00204     return _R(IDD_OPTSTAB_PLUGINS);
00205 }

BOOL PlugInsTab::HandleMsg DialogMsg Msg  )  [virtual]
 

Handles all the Plug-ins options tabs messages.

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

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 295 of file optsplug.cpp.

00296 {
00297     ERROR2IF(Msg == NULL,FALSE,"PlugInsTab::Message null message received");
00298     ERROR2IF(pPrefsDlg == NULL,FALSE,"PlugInsTab::HandleMsg called with no dialog pointer");
00299 
00300     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PLUGINS));   // The edit page identifier
00301     if (!ok)
00302         return TRUE;        // page not present
00303     
00304     switch(Msg->DlgMsg)
00305     {
00306         case DIM_CREATE:    // Initialise controls
00307 //          GreyStatus = FALSE; // we are ungreyed by default
00308             ok = InitSection();
00309             if (!ok)
00310                 InformError();
00311             break;
00312 
00313         case DIM_LFT_BN_CLICKED:
00314             OptionsTabs::SetApplyNowState(TRUE);
00315 //          ERROR2IF(m_pManager == NULL,FALSE,"PlugInsTab::HandleMsg called with no plug-ins manager pointer");
00316             switch (Msg->GadgetID)
00317             {
00318             case _R(IDC_OPTS_BUTTON_PLUGINS_SETUP):
00319                 BOOL bOK = XPEEditOp::EditPluginSettings();
00320                 break;
00321 /*              case _R(IDC_OPTS_NEWPATH):
00322                     // Create the user a new path
00323                     CreateNewPath();
00324                     break;
00325 
00326                 case _R(IDC_OPTS_BUYPLUGS):
00327                     // The user wishes to be relieved of money by buying plug-ins
00328                     BuyPluginsAction();
00329                     break;
00330 
00331                 case _R(IDC_OPTS_DELETEPATH):
00332                     // Delete the currently selected path
00333                     DeletePath();
00334                     break;
00335                 case _R(IDC_OPTS_PARSEATSTART):
00336                 {
00337                     BOOL Valid = FALSE;
00338                     BOOL ParseAtStartUp = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_PARSEATSTART), 0, 1, 0, &Valid);
00339                     if (Valid)
00340                         m_pManager->SetParseAtStartUp(ParseAtStartUp);
00341                     break;
00342                 }
00343 */
00344             }
00345             break; // DIM_LFT_BN_CLICKED
00346 
00347         case DIM_SELECTION_CHANGED:
00348         {
00349             OptionsTabs::SetApplyNowState(TRUE);
00350     
00351 /*          switch (Msg->GadgetID)
00352             {
00353                 case _R(IDC_OPTS_PLUGINSLIST):
00354                 {
00355                     // Clicked on the list of plug-in paths
00356                     // If its valid then ungrey the delete button
00357                     WORD Index = 0;
00358                     pPrefsDlg->GetValueIndex(_R(IDC_OPTS_PLUGINSLIST), &Index); 
00359                     BOOL Valid = FALSE;
00360                     BOOL ok = FALSE;
00361                     String_256 Path = pPrefsDlg->GetStringGadgetValue(_R(IDC_OPTS_PLUGINSLIST), &Valid, Index);
00362                     if (Valid && !Path.IsEmpty())
00363                     {
00364                         pPrefsDlg->EnableGadget(_R(IDC_OPTS_DELETEPATH), TRUE);
00365                     }
00366                     break;
00367                 }
00368             }
00369 */
00370             break; // DIM_SELECTION_CHANGED
00371         }
00372     }
00373 
00374     return TRUE;
00375 }  

BOOL PlugInsTab::Init void   )  [virtual]
 

PlugInsTab initialisation routine.

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

Errors: -

See also:
-

Reimplemented from OptionsTabs.

Definition at line 179 of file optsplug.cpp.

00180 {   
00181 //  m_pManager = NULL;
00182 
00183     return TRUE;
00184 }        

BOOL PlugInsTab::InitControls  )  [protected]
 

Creates a new path that the user has just requested. Deletes the currently selected path. Provides access from the 'Buy Plugins' button to Xara's plugin pages. Errors If the browser could not be opened, an Error message box is diplayed. See Also ~ adapted from Ranbir's HelpXaraNewsAction() ~Inits all the controls in the dialog Called immediately after the bar is created to init drop lists, grey out gadgets, etc.

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

Definition at line 598 of file optsplug.cpp.

00599 {
00600 //  ERROR2IF(m_pManager == NULL,FALSE,"PlugInsTab::InitControls called with no plug-ins manager pointer");
00601 
00602     EnableControls();
00603 
00604     return TRUE;
00605 }

BOOL PlugInsTab::InitSection  )  [virtual]
 

Shows the list of pathnames in the list control. Sets initial values for the Plug-ins section of the options dialog box. This section includes the:-.

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

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 688 of file optsplug.cpp.

00689 {
00690     ERROR2IF(pPrefsDlg == NULL,FALSE,"PlugInsTab::InitSection called with no dialog pointer");
00691 
00692 /*  // Search the pathnames list in the plug-in manager
00693     m_pManager = GetApplication()->GetPlugInManager();
00694     ERROR2IF(m_pManager == NULL,FALSE,"PlugInsTab::InitSection no plug-ins manager");
00695 
00696     pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_PLUGINSLIST));
00697     BOOL ok = ShowPathDetails();
00698 
00699     BOOL ParseAtStartUp = m_pManager->GetParseAtStartUp();
00700     pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_PARSEATSTART), ParseAtStartUp);
00701 
00702     pPrefsDlg->EnableGadget(_R(IDC_OPTS_DELETEPATH),    FALSE);
00703     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BUYPLUGS),      TRUE);
00704     pPrefsDlg->EnableGadget(_R(IDC_OPTS_NEWPATH),       TRUE);
00705 */          
00706     BOOL ok = TRUE;
00707     pPrefsDlg->EnableGadget(_R(IDC_OPTS_BUTTON_PLUGINS_SETUP),      TRUE);
00708 
00709     INT32 iLiveRes = 0;
00710     Camelot.GetPrefValue(TEXT("Effects"), TEXT("DefaultLivePixelsPerInch"), &iLiveRes);
00711     pPrefsDlg->BuildResDropList(_R(IDC_COMBO_LIVEEFFECT_RES), TRUE, TRUE, -1);
00712     pPrefsDlg->SetResDropListValue(_R(IDC_COMBO_LIVEEFFECT_RES), TRUE, iLiveRes);
00713 
00714     INT32 iLockedRes = 0;
00715     Camelot.GetPrefValue(TEXT("Effects"), TEXT("DefaultLockedPixelsPerInch"), &iLockedRes);
00716     pPrefsDlg->BuildResDropList(_R(IDC_COMBO_LOCKEDEFFECT_RES), FALSE, TRUE, -1);
00717     pPrefsDlg->SetResDropListValue(_R(IDC_COMBO_LOCKEDEFFECT_RES), FALSE, iLockedRes);
00718 
00719     BOOL bDefaultLocked = FALSE;
00720     Camelot.GetPrefValue(TEXT("Effects"), TEXT("DefaultLocked"), &bDefaultLocked);
00721     pPrefsDlg->SetBoolGadgetSelected(_R(IDC_CHECK_NEW_EFFECTS_LOCKED), bDefaultLocked);
00722 
00723 
00724 /*  BOOL bCacheingEnabled = FALSE;
00725     Camelot.GetPrefValue(TEXT("Rendering"), TEXT("Cacheing"), &bCacheingEnabled);
00726     pPrefsDlg->SetBoolGadgetSelected(_R(IDC_CHECK_CACHE_ENABLED), bCacheingEnabled);
00727 
00728     INT32 iCacheRAMPercent = 0;
00729     Camelot.GetPrefValue(TEXT("Cache"), TEXT("CacheRAMPercent"), &iCacheRAMPercent);
00730 //  pPrefsDlg->SetLongGadgetValue(_R(IDC_EDIT_CACHE_SIZE), iCacheRAMPercent);               // TODO: Should be percentage
00731     TCHAR Str[32];
00732     String_32 temp(_R(IDS_PERCENT_FORMAT));
00733     wsprintf(Str, temp, iCacheRAMPercent);
00734     String_32 PercentStr(Str);
00735     pPrefsDlg->SetStringGadgetValue(_R(IDC_EDIT_CACHE_SIZE), &PercentStr);
00736 
00737     CBitmapCache* pCache = GetApplication()->GetBitmapCache();
00738     if (pCache)
00739     {
00740         INT32 iCacheUsagePercent = ((UINT64)pCache->GetCurrentDataSize()*100)/pCache->GetMaximumDataSize();
00741 //      pPrefsDlg->SetLongGadgetValue(_R(IDC_EDIT_CURRENTCACHE), iCacheUsagePercent);       // TODO: Should be percentage
00742         TCHAR Str[32];
00743         String_32 temp(_R(IDS_PERCENT_FORMAT));
00744         wsprintf(Str, temp, iCacheUsagePercent);
00745         String_32 PercentStr(Str);
00746         pPrefsDlg->SetStringGadgetValue(_R(IDC_EDIT_CURRENTCACHE), &PercentStr);
00747 
00748 //      pPrefsDlg->SetLongGadgetValue(_R(IDC_PROGRESS_CACHEUSAGE), iCacheUsagePercent);     // TODO: Should be percentage
00749     }
00750 */
00751     return ok;
00752 }

BOOL PlugInsTab::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:
12/12/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Returns True if this tab is a document option.

Errors: -

See also:
IsProgramOption();

Implements OptionsTabs.

Definition at line 223 of file optsplug.cpp.

00224 {
00225     return FALSE;   // This tab is not a document option 
00226 }

BOOL PlugInsTab::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:
12/12/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Returns True if this tab is a program option.

Errors: -

See also:
IsProgramOption();

Implements OptionsTabs.

Definition at line 244 of file optsplug.cpp.

00245 {
00246     return TRUE;    // This tab is a program option 
00247 }


Member Data Documentation

BOOL PlugInsTab::m_ChangedList [private]
 

Definition at line 163 of file optsplug.h.


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