BOOL LayerPropertiesTab::CommitSection() { TRACEUSER( "Neville", _T("LayerPropertiesTab::CommitSection\n")); ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::CommitSection called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); if (!ok) return TRUE; // Talk to page failed to return now Layer* pLayer = GetActiveLayer(); // Only do the op if we have a layer with a different set of properties if (pLayer != NULL && HavePropertiesChanged(pLayer)) { // Initialise the param structure OpLayerGalParam Param(LAYER_CHANGE, pSpread); Param.pLayer = pLayer; Param.VisibleState = pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_LAYERTAB_VISIBLE)); Param.LockedState = !pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_LAYERTAB_EDITABLE)); Param.NewName = pPropertiesDlg->GetStringGadgetValue(_R(IDC_LAYERTAB_NAME),NULL); // Invoke the operation OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_LAYERGALCHANGE); if (pOpDesc != NULL) pOpDesc->Invoke((OpParam*)&Param); else { ERROR3("Couldn't find OPTOKEN_LAYERGALCHANGE op descriptor"); } } return TRUE; }
BOOL GuidesPropertiesTab::CommitSection() { TRACEUSER( "Neville", _T("GuidesPropertiesTab::CommitSection\n")); ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::CommitSection called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); if (!ok) return TRUE; // Talk to page failed to return now return TRUE; }
BOOL LayerPropertiesTab::UpdateSection() { TRACEUSER( "Neville", _T("LayerPropertiesTab::UpdateSection\n")); ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::UpdateSection called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); if (!ok) return TRUE; // page not present ShowDetails(); // We are happy with what happened return TRUE; }
BOOL GuidesPropertiesTab::UpdateSection() { TRACEUSER( "Neville", _T("GuidesPropertiesTab::UpdateSection\n")); ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UpdateSection called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); if (!ok) return TRUE; // page not present // Update our controls here // We are happy with what happened return TRUE; }
BOOL GuidesPropertiesTab::ColourListChanged(Document* pDoc) { ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UpdateGuidelineSection() called with no dialog pointer"); ERROR2IF(pColourDropDown == NULL,FALSE,"ptr to 'colour drop down' is NULL"); if (pPropertiesDlg->TalkToPage(GetPageID())) { BOOL Enable = (pDoc != NULL); pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_COLOURLIST),Enable); pPropertiesDlg->EnableGadget(_R(IDC_GUIDETAB_COLOURTEXT),Enable); if (Enable) ShowColours(); else pColourDropDown->ClearList(); } return TRUE; }
BOOL GuidesPropertiesTab::UngreySection() { TRACEUSER( "Neville", _T("UngreySection in GuidesPropertiesTab section\n")); ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UngreySection called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); // The GuidesPropertiesTab identifier if (!ok) return TRUE; // Talk to page failed to return now // Only update if we are not already ungrey if (GreyStatus == FALSE) return TRUE; // Call our central greying/ungreying function ok = ChangeControlStatus(TRUE); GreyStatus = FALSE; return ok; }
BOOL LayerPropertiesTab::HandleMsg(DialogMsg* Msg) { TRACEUSER( "Neville", _T("LayerPropertiesTab::HandleMsg\n")); ERROR2IF(Msg == NULL,FALSE,"LayerPropertiesTab::Message null message received"); ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::HandleMsg called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); if (!ok) return TRUE; // no page present = handled message switch(Msg->DlgMsg) { case DIM_CREATE: // Initialise controls GreyStatus = FALSE; // we are ungreyed by default ok = InitSection(); if (!ok) InformError(); break; case DIM_LFT_BN_CLICKED: { UpdateApplyState(); //switch (Msg->GadgetID) //{ //} } break; case DIM_SELECTION_CHANGED: case DIM_TEXT_CHANGED: UpdateApplyState(); break; default: break; } return TRUE; }
BOOL GuidesPropertiesTab::HandleMsg(DialogMsg* Msg) { TRACEUSER( "Neville", _T("GuidesPropertiesTab::HandleMsg\n")); ERROR2IF(Msg == NULL,FALSE,"GuidesPropertiesTab::Message null message received"); ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::HandleMsg called with no dialog pointer"); BOOL ok = pPropertiesDlg->TalkToPage(GetPageID()); if (!ok) return TRUE; // no page present = handled message switch(Msg->DlgMsg) { case DIM_CREATE: // Initialise controls GreyStatus = FALSE; // we are ungreyed by default ok = InitSection(); if (!ok) InformError(); break; case DIM_LFT_BN_CLICKED: //LayerPropertyTabs::SetApplyNowState(TRUE); if (FALSE) {} else if (Msg->GadgetID == _R(IDC_GUIDETAB_HORZ)) { if (GuideType != GUIDELINE_HORZ) { GuideType = GUIDELINE_HORZ; ShowDetails(); } } else if (Msg->GadgetID == _R(IDC_GUIDETAB_VERT)) { if (GuideType != GUIDELINE_VERT) { GuideType = GUIDELINE_VERT; ShowDetails(); } } else if (Msg->GadgetID == _R(IDC_GUIDETAB_PROPERTIES)) { PropertiesClicked(); ShowDetails(); } else if (Msg->GadgetID == _R(IDC_GUIDETAB_NEW)) { NewClicked(); ShowDetails(); } else if (Msg->GadgetID == _R(IDC_GUIDETAB_DELETE)) { DeleteClicked(); ShowDetails(); } break; case DIM_SELECTION_CHANGED: case DIM_TEXT_CHANGED: //LayerPropertyTabs::SetApplyNowState(TRUE); if (FALSE) {} else if (Msg->GadgetID == _R(IDC_GUIDETAB_GUIDELINELIST)) { ChangeControlStatus(!GreyStatus); } else if (Msg->GadgetID == _R(IDC_GUIDETAB_COLOURLIST)) { ColourChanged(pPropertiesDlg->GetSelectedValueIndex(Msg->GadgetID)); ShowDetails(); } break; default: break; } return TRUE; }
BOOL GuidesPropertiesTab::UpdateGuidelineSection() { ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::UpdateGuidelineSection() called with no dialog pointer"); return (pPropertiesDlg->TalkToPage(GetPageID()) && ShowDetails()); }