#include <prpslyrs.h>
Inheritance diagram for LayerPropertiesTab:
Public Member Functions | |
LayerPropertiesTab () | |
LayerPropertiesTab constructor. Creates a non-undoable operation. | |
~LayerPropertiesTab () | |
LayerPropertiesTab destructor. | |
virtual BOOL | Init () |
LayerPropertiesTab initialisation routine. | |
virtual BOOL | HandleMsg (DialogMsg *Msg) |
Handles all the messages for this layer property tab. | |
virtual BOOL | InitSection () |
Sets initial values for this tab on the layer properties dialog box. | |
virtual BOOL | CommitSection () |
Takes the values in this tab of the layer properties dialog box. Called when ok or apply now is pressed on the main dialog box. | |
virtual BOOL | UpdateLayerSection () |
Called when the layer-related section of the tab should be updated. | |
virtual BOOL | GreySection () |
Called when the user has closed all documents. | |
virtual BOOL | UngreySection () |
Called when the user has selected a new document. | |
BOOL | ChangeControlStatus (const BOOL Status) |
Called to grey/ungrey all controls on this tab. | |
virtual BOOL | UpdateSection () |
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 | IsPropertyRequired () |
Allows the layer propertiesto determine if this tab is required. | |
Private Member Functions | |
BOOL | ShowDetails () |
Shows the details of the associated layer in this tab. | |
BOOL | UpdateApplyState () |
This changes the 'Apply now' state based on the settings of the active layer and the settings in this tab. If the settings are the same, the 'Apply state' is FALSE, else it are TRUE. | |
BOOL | HavePropertiesChanged (Layer *pLayer) |
Central place for comparing settings in the dlg against the settings of a layer. | |
Private Attributes | |
BOOL | GreyStatus |
Definition at line 125 of file prpslyrs.h.
|
LayerPropertiesTab constructor. Creates a non-undoable operation.
Definition at line 144 of file prpslyrs.cpp.
|
|
LayerPropertiesTab destructor.
Definition at line 165 of file prpslyrs.cpp.
|
|
Called to grey/ungrey all controls on this tab.
Definition at line 365 of file prpslyrs.cpp. 00366 { 00367 BOOL Enable; 00368 00369 Layer* pLayer = GetActiveLayer(); 00370 Enable = (pLayer != NULL) && Status; 00371 00372 BOOL EnableNonFrameItem = Enable; 00373 //It shouldn't be in Webster builds anyway but we will take it out jus tin case 00374 #ifndef WEBSTER 00375 // Check if we are on a frame layer or not 00376 // If we are then we must disable some items 00377 // At present, these are the visible and editable flags as these are not user controlled. 00378 // BOOL FrameLayer = FALSE; 00379 if (pLayer != NULL && pLayer->IsFrame()) 00380 EnableNonFrameItem = FALSE; 00381 #endif 00382 00383 pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_GUIDELINELIST),Enable); 00384 pPropertiesDlg->EnableGadget(_R(IDC_LAYERTAB_NAME), Enable); 00385 pPropertiesDlg->EnableGadget(_R(IDC_LAYERTAB_VISIBLE), EnableNonFrameItem); 00386 pPropertiesDlg->EnableGadget(_R(IDC_LAYERTAB_EDITABLE), EnableNonFrameItem); 00387 00388 return TRUE; 00389 }
|
|
Takes the values in this tab of the layer properties dialog box. Called when ok or apply now is pressed on the main dialog box.
Reimplemented from LayerPropertyTabs. Definition at line 243 of file prpslyrs.cpp. 00244 { 00245 TRACEUSER( "Neville", _T("LayerPropertiesTab::CommitSection\n")); 00246 ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::CommitSection called with no dialog pointer"); 00247 00248 BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); 00249 if (!ok) 00250 return TRUE; // Talk to page failed to return now 00251 00252 Layer* pLayer = GetActiveLayer(); 00253 00254 // Only do the op if we have a layer with a different set of properties 00255 if (pLayer != NULL && HavePropertiesChanged(pLayer)) 00256 { 00257 // Initialise the param structure 00258 OpLayerGalParam Param(LAYER_CHANGE, pSpread); 00259 Param.pLayer = pLayer; 00260 00261 Param.VisibleState = pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_LAYERTAB_VISIBLE)); 00262 Param.LockedState = !pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_LAYERTAB_EDITABLE)); 00263 Param.NewName = pPropertiesDlg->GetStringGadgetValue(_R(IDC_LAYERTAB_NAME),NULL); 00264 00265 // Invoke the operation 00266 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_LAYERGALCHANGE); 00267 if (pOpDesc != NULL) 00268 pOpDesc->Invoke((OpParam*)&Param); 00269 else 00270 { 00271 ERROR3("Couldn't find OPTOKEN_LAYERGALCHANGE op descriptor"); 00272 } 00273 } 00274 00275 return TRUE; 00276 }
|
|
Allows the options dialog code to determine the dialog ID of this section.
Reimplemented from LayerPropertyTabs. Definition at line 205 of file prpslyrs.cpp. 00206 { 00207 return _R(IDD_TAB_LAYER_PROPERTIES); 00208 }
|
|
Called when the user has closed all documents.
Reimplemented from PropertyTabs. Definition at line 293 of file prpslyrs.cpp. 00294 { 00295 TRACEUSER( "Neville", _T("GreySection in LayerPropertiesTab section\n")); 00296 ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::GreySection called with no dialog pointer"); 00297 00298 BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); 00299 if (!ok) 00300 return TRUE; // Talk to page failed to return now 00301 00302 // Only update if we are not already grey 00303 if (GreyStatus == TRUE) 00304 return TRUE; 00305 00306 // Call our central greying/ungreying function 00307 ok = ChangeControlStatus(FALSE); 00308 00309 GreyStatus = TRUE; 00310 00311 return ok; 00312 }
|
|
Handles all the messages for this layer property tab.
Reimplemented from LayerPropertyTabs. Definition at line 494 of file prpslyrs.cpp. 00495 { 00496 TRACEUSER( "Neville", _T("LayerPropertiesTab::HandleMsg\n")); 00497 ERROR2IF(Msg == NULL,FALSE,"LayerPropertiesTab::Message null message received"); 00498 ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::HandleMsg called with no dialog pointer"); 00499 00500 BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); 00501 if (!ok) 00502 return TRUE; // no page present = handled message 00503 00504 switch(Msg->DlgMsg) 00505 { 00506 case DIM_CREATE: // Initialise controls 00507 GreyStatus = FALSE; // we are ungreyed by default 00508 ok = InitSection(); 00509 if (!ok) 00510 InformError(); 00511 break; 00512 case DIM_LFT_BN_CLICKED: 00513 { 00514 UpdateApplyState(); 00515 //switch (Msg->GadgetID) 00516 //{ 00517 //} 00518 } 00519 break; 00520 00521 case DIM_SELECTION_CHANGED: 00522 case DIM_TEXT_CHANGED: 00523 UpdateApplyState(); 00524 break; 00525 00526 default: 00527 break; 00528 } 00529 return TRUE; 00530 }
|
|
Central place for comparing settings in the dlg against the settings of a layer.
Definition at line 586 of file prpslyrs.cpp. 00587 { 00588 BOOL VisibleState= pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_LAYERTAB_VISIBLE)); 00589 BOOL LockedState = !pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_LAYERTAB_EDITABLE)); 00590 String_256 Name = pPropertiesDlg->GetStringGadgetValue(_R(IDC_LAYERTAB_NAME),NULL); 00591 00592 // BOOL CurVisible = pLayer->IsVisible(); 00593 // BOOL CurLocked = pLayer->IsLocked(); 00594 BOOL CurVisible = pLayer->GetVisibleFlagState(); 00595 BOOL CurLocked = pLayer->GetLockedFlagState(); 00596 String_256 CurName = pLayer->GetLayerID(); 00597 00598 return ((VisibleState != CurVisible) || 00599 (LockedState != CurLocked) || 00600 (Name != CurName)); 00601 }
|
|
LayerPropertiesTab initialisation routine.
Reimplemented from LayerPropertyTabs. Definition at line 185 of file prpslyrs.cpp. 00186 { 00187 return TRUE; 00188 }
|
|
Sets initial values for this tab on the layer properties dialog box.
Reimplemented from LayerPropertyTabs. Definition at line 618 of file prpslyrs.cpp. 00619 { 00620 TRACEUSER( "Neville", _T("LayerPropertiesTab::InitSection\n")); 00621 ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::InitSection called with no dialog pointer"); 00622 00623 ShowDetails(); 00624 00625 return TRUE; 00626 }
|
|
Allows the layer propertiesto determine if this tab is required.
Reimplemented from PropertyTabs. Definition at line 221 of file prpslyrs.cpp. 00222 { 00223 return TRUE; // This tab is required 00224 }
|
|
Shows the details of the associated layer in this tab.
Definition at line 436 of file prpslyrs.cpp. 00437 { 00438 String_256 LayerID; 00439 00440 Layer* pLayer = GetActiveLayer(); 00441 if (pLayer != NULL) 00442 { 00443 LayerID = pLayer->GetLayerID(); 00444 00445 // pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_LAYERTAB_VISIBLE),pLayer->IsVisible()); 00446 // pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_LAYERTAB_EDITABLE),!pLayer->IsLocked()); 00447 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_LAYERTAB_VISIBLE),pLayer->GetVisibleFlagState()); 00448 pPropertiesDlg->SetBoolGadgetSelected(_R(IDC_LAYERTAB_EDITABLE),!pLayer->GetLockedFlagState()); 00449 } 00450 00451 pPropertiesDlg->SetStringGadgetValue(_R(IDC_LAYERTAB_NAME), LayerID); 00452 00453 ChangeControlStatus(!GreyStatus); 00454 00455 return TRUE; 00456 }
|
|
Called when the user has selected a new document.
Reimplemented from PropertyTabs. Definition at line 329 of file prpslyrs.cpp. 00330 { 00331 TRACEUSER( "Neville", _T("UngreySection in LayerPropertiesTab section\n")); 00332 ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::UngreySection called with no dialog pointer"); 00333 00334 BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); // The LayerPropertiesTab identifier 00335 if (!ok) 00336 return TRUE; // Talk to page failed to return now 00337 00338 // Only update if we are not already ungrey 00339 if (GreyStatus == FALSE) 00340 return TRUE; 00341 00342 // Call our central greying/ungreying function 00343 ok = ChangeControlStatus(TRUE); 00344 00345 GreyStatus = FALSE; 00346 00347 return ok; 00348 }
|
|
This changes the 'Apply now' state based on the settings of the active layer and the settings in this tab. If the settings are the same, the 'Apply state' is FALSE, else it are TRUE.
Definition at line 549 of file prpslyrs.cpp. 00550 { 00551 BOOL OldApplyNowState = LayerPropertiesTab::GetApplyNowState(); 00552 00553 Layer* pLayer = GetActiveLayer(); 00554 00555 if (pLayer != NULL) 00556 LayerPropertiesTab::SetApplyNowState(HavePropertiesChanged(pLayer)); 00557 00558 BOOL NewApplyNowState = LayerPropertiesTab::GetApplyNowState(); 00559 00560 if (OldApplyNowState != NewApplyNowState) 00561 { 00562 if (NewApplyNowState) 00563 LayerPropertiesTab::UngreyApplyNow(); 00564 else 00565 LayerPropertiesTab::GreyApplyNow(); 00566 } 00567 00568 return TRUE; 00569 }
|
|
Called when the layer-related section of the tab should be updated.
Reimplemented from PropertyTabs. Definition at line 473 of file prpslyrs.cpp. 00474 { 00475 ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::UpdateLayerSection() called with no dialog pointer"); 00476 return (pPropertiesDlg->TalkToPage(GetPageID()) && ShowDetails()); 00477 }
|
|
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.
Reimplemented from PropertyTabs. Definition at line 406 of file prpslyrs.cpp. 00407 { 00408 TRACEUSER( "Neville", _T("LayerPropertiesTab::UpdateSection\n")); 00409 ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::UpdateSection called with no dialog pointer"); 00410 00411 BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); 00412 if (!ok) 00413 return TRUE; // page not present 00414 00415 ShowDetails(); 00416 00417 // We are happy with what happened 00418 return TRUE; 00419 }
|
|
Definition at line 165 of file prpslyrs.h. |