#include <optsplug.h>
Inheritance diagram for PlugInsTab:
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 |
Definition at line 122 of file optsplug.h.
|
PlugInsTab constructor. Creates a non-undoable operation.
Definition at line 139 of file optsplug.cpp. 00140 { 00141 // Set up our default states 00142 m_ChangedList = FALSE; 00143 }
|
|
PlugInsTab destructor.
Definition at line 160 of file optsplug.cpp.
|
|
Takes the values in the dialog. Called when the OK button is selected.
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 }
|
|
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.
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 }
|
|
Enables or disables the controls depending on the current context, i.e. the controls are disabled if there is no selection, etc.
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 }
|
|
Allows the options dialog code to determine the dialog ID of this section.
Implements OptionsTabs. Definition at line 202 of file optsplug.cpp. 00203 { 00204 return _R(IDD_OPTSTAB_PLUGINS); 00205 }
|
|
Handles all the Plug-ins options tabs messages.
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 }
|
|
PlugInsTab initialisation routine.
Reimplemented from OptionsTabs. Definition at line 179 of file optsplug.cpp. 00180 { 00181 // m_pManager = NULL; 00182 00183 return TRUE; 00184 }
|
|
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.
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 }
|
|
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:-.
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 }
|
|
Allows the document options dialog code to determine if this tab belongs to the group of document options.
Implements OptionsTabs. Definition at line 223 of file optsplug.cpp. 00224 { 00225 return FALSE; // This tab is not a document option 00226 }
|
|
Allows the program options dialog code to determine if this tab belongs to the group of program options.
Implements OptionsTabs. Definition at line 244 of file optsplug.cpp. 00245 { 00246 return TRUE; // This tab is a program option 00247 }
|
|
Definition at line 163 of file optsplug.h. |