/*=========================================================================== * * Class CSrScrlView Method - void UpdateEffectList (ListIndex, Update); * *=========================================================================*/ void CSrScrlView::UpdateEffectList (const int ListIndex, const bool Update) { CSrFormidSubrecord* pEffectID; srrlcustomdata_t* pCustomData; srformid_t FormID; CString Buffer; if (GetInputRecord() == NULL) return; pCustomData = m_EffectList.GetCustomData(ListIndex); if (pCustomData == NULL) return; if (Update) m_EffectList.UpdateRecord(ListIndex); pEffectID = SrCastClassNull(CSrFormidSubrecord, pCustomData->Subrecords[0]); if (pEffectID == NULL) return; FormID = pEffectID->GetValue(); Buffer.Format("0x%08X", FormID); m_EffectList.SetCustomField(ListIndex, SR_FIELD_EFFECTID, Buffer); CSrRecord* pRecord = GetInputRecord()->GetParent()->FindFormID(FormID); CSrIdRecord* pIdRecord = SrCastClassNull(CSrIdRecord, pRecord); if (pIdRecord != NULL) m_EffectList.SetCustomField(ListIndex, SR_FIELD_EFFECTNAME, pIdRecord->GetEditorID()); Buffer.Format("%d", pCustomData->UserCount); m_EffectList.SetCustomField(ListIndex, SR_FIELD_CONDITIONCOUNT, Buffer); }
/*=========================================================================== * * Class CSrSelectRecordDlg Method - int UpdateEditorID (void); * *=========================================================================*/ int CSrSelectRecordDlg::UpdateEditorID (void) { CString Buffer; CSString EditorID; CSrIdRecord* pIdRecord; int ListIndex; m_CurrentText.GetWindowText(Buffer); EditorID = Buffer; SrPrepareEditorID(EditorID); if (EditorID.IsEmpty()) { m_CurrentFormID = 0; } else { pIdRecord = m_pRecordHandler->FindEditorID(EditorID); if (pIdRecord == NULL) return (SR_CHECKRESULT_ERROR); ListIndex = m_RecordList.FindRecord(pIdRecord); if (ListIndex < 0) return (SR_CHECKRESULT_ERROR); m_CurrentEditorID = pIdRecord->GetEditorID(); m_CurrentFormID = pIdRecord->GetFormID(); } if (m_CurrentFormID == m_InitialFormID) return (SR_CHECKRESULT_NOCHANGE); Buffer.Format(_T("0x%08X"), m_CurrentFormID); m_CurrentFormIDText.SetWindowText(Buffer); return (SR_CHECKRESULT_OK); }
/*=========================================================================== * * Class CSrSelectRecordDlg Method - void SetControlData (void); * *=========================================================================*/ void CSrSelectRecordDlg::SetControlData (void) { CString Buffer; CString EditorID; CSrIdRecord* pIdRecord; m_RecordList.SortList(SR_FIELD_EDITORID); if (m_DlgInfo.SortField != SR_FIELD_EDITORID) m_RecordList.SortList(m_DlgInfo.SortField); m_RecordList.SelectRecord(m_pCurrentRecord); if (m_pPrevRecord == NULL) { m_PreviousText.SetWindowText(""); m_PreviousFormIDText.SetWindowText("0x00000000"); } else { pIdRecord = SrCastClass(CSrIdRecord, m_pPrevRecord); if (pIdRecord != NULL) EditorID = pIdRecord->GetEditorID(); Buffer.Format("%s", EditorID); m_PreviousText.SetWindowText(Buffer); Buffer.Format("0x%08X", m_pPrevRecord->GetFormID()); m_PreviousFormIDText.SetWindowText(Buffer); } UpdateCurrentRecord(); }
/*=========================================================================== * * Class CSrSelectRecordDlg Method - void UpdateCurrentRecord (void); * *=========================================================================*/ void CSrSelectRecordDlg::UpdateCurrentRecord (void) { CString Buffer; CSrIdRecord* pIdRecord; //m_pCurrentRecord = m_RecordList.GetSelectedRecord(); m_CurrentEditorID.Empty(); if (m_pCurrentRecord == NULL) { m_CurrentText.SetWindowText(""); m_CurrentFormIDText.SetWindowText("0x00000000"); } else { pIdRecord = SrCastClass(CSrIdRecord, m_pCurrentRecord); if (pIdRecord != NULL) m_CurrentEditorID = pIdRecord->GetEditorID(); Buffer.Format("%s", m_CurrentEditorID); m_CurrentText.SetWindowText(Buffer); Buffer.Format("0x%08X", m_pCurrentRecord->GetFormID()); m_CurrentFormIDText.SetWindowText(Buffer); } }