home *** CD-ROM | disk | FTP | other *** search
- // -------------------------------------------------------------------------
- // Copyright @ 1997 TCK Software, Incorporated
- // All Rights Reserved
- // -------------------------------------------------------------------------
-
- #include "stdafx.h"
- #include "person3VF.h"
- #include "resource.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- // Static Data Members
-
- VTIPerson::VTIPerson()
- {
- m_nRecNo = 0;
- m_name[0] = 0;
- m_note[0] = 0;
- m_nPhoneCnt = 0;
- }
-
- VTIPersonPhone::VTIPersonPhone()
- {
- m_nRecNo = 0;
- m_nPhoneIdx = 0;
- m_phoneDesc[0] = 0;
- m_phone[0] = 0;
- }
-
- // -------------------------------------------------------------------------
- // CPerson3Hdr Constructor
- // -------------------------------------------------------------------------
- CPerson3Hdr::CPerson3Hdr()
- {
- Height(40);
-
- m_chkSelectors.Init(this, IDVC_CHK_SELECTORS, _T("Selectors"), 5,5,80,20);
- m_lblBackGround.Init(this, -1, _T("Background:"), 100,7,83,20);
- m_lstBgOption.Init(this, IDVC_BG_OPTION, _T("Bitmap"), 185,5,90,20);
- m_btnSetBmp.Init(this, IDVC_SET_BMP, _T("Set Bmp"), 285,5,70,20);
- m_chkShadow.Init(this, IDVC_CHK_SHADOW, _T("Shadow"), 370,5,80,20);
- m_lstBoxStyle.Init(this, IDVC_BOX_STYLE, _T("Shadow"), 370,5,90,20);
- m_nBackStyle = 0;
- m_chkSelectors.Checked(TRUE);
- m_chkShadow.Checked(TRUE);
-
- m_lstBgOption.AddString(_T("Normal"));
- m_lstBgOption.AddString(_T("Green Bar"));
- m_lstBgOption.AddString(_T("Paper Pad"));
- m_lstBgOption.AddString(_T("Flat Look"));
- m_lstBgOption.AddString(_T("Bitmap"));
-
- m_lstBoxStyle.AddString(_T("Normal"));
- m_lstBoxStyle.AddString(_T("Shadow"));
- m_lstBoxStyle.AddString(_T("Indented"));
- m_lstBoxStyle.AddString(_T("Bumped"));
-
- AddCtl(&m_chkSelectors);
- AddCtl(&m_lblBackGround);
- AddCtl(&m_lstBgOption);
- AddCtl(&m_btnSetBmp);
- AddCtl(&m_lstBoxStyle);
- }
-
- // -------------------------------------------------------------------------
- // CPerson3Ftr Constructor
- // -------------------------------------------------------------------------
- CPerson3Ftr::CPerson3Ftr()
- {
- Height(35);
- m_lblGoodbye.Init(this, -1, _T("Footer:"), 80,5,60,20);
- m_ftrEdit.Init(this, IDVC_FTREDIT, _T("Goodbye"), 150,5,100,20);
-
- m_ftrEdit.LimitText(20); // Set max chars for m_ftrEdit
-
- AddCtl(&m_lblGoodbye);
- AddCtl(&m_ftrEdit);
- }
-
-
- // -------------------------------------------------------------------------
- // CPerson3Row Constructor
- // -------------------------------------------------------------------------
- CPerson3Row::CPerson3Row(CPerson3VF* pVf)
- {
- m_recno.Init(this, IDVCTREE_RECNO, _T(""), 50,5,20,20);
- m_btnPlus.Init(this, IDVCTREE_BTNPLUS, _T("+"), 75,3,18,18);
- m_name.Init(this, IDVCTREE_NAME, _T(""), 100,3,145,20);
- m_note.Init(this, IDVCTREE_NOTE, _T(""), 255,3,250,20);
- m_phoneDesc.Init(this, IDVCTREE_PHONEDESC, _T(""), 255,3,90,20);
- m_phone.Init(this, IDVCTREE_PHONE, _T(""), 355,3,160,20);
-
- /* --- If not for the Icon Pointer and Paper Pad look,
- // --- we would shift all the fields to the left, like so...
- m_recno.Init(this, IDVCTREE_RECNO, _T(""), 0,5,20,20);
- m_btnPlus.Init(this, IDVCTREE_BTNPLUS, _T("+"), 25,3,18,18);
- m_name.Init(this, IDVCTREE_NAME, _T(""), 50,3,145,20);
- m_note.Init(this, IDVCTREE_NOTE, _T(""), 205,3,250,20);
- m_phoneDesc.Init(this, IDVCTREE_PHONEDESC, _T(""), 205,3,90,20);
- m_phone.Init(this, IDVCTREE_PHONE, _T(""), 305,3,160,20);
- */
- m_name.LimitText(PERS2_NAME);
- m_note.LimitText(PERS2_NOTE);
-
- m_phone.LimitText(PERS2_PHONE);
- m_phoneDesc.LimitText(PERS2_PHONEDESC);
-
- SetIconPosition(5, 0);
-
- // --- Add a profile for each type of row to display ---
- NewProfile(P2PROFILE_PERSON);
- NewProfile(P2PROFILE_PHONE);
-
- VMorphProfile *pProfile;
-
- pProfile = GetProfile(P2PROFILE_PERSON);
- // pProfile->AddCtl(&m_recno);
- pProfile->AddCtl(&m_btnPlus);
- pProfile->AddCtl(&m_name);
- pProfile->AddCtl(&m_note);
-
- pProfile = GetProfile(P2PROFILE_PHONE);
- pProfile->AddCtl(&m_phoneDesc);
- pProfile->AddCtl(&m_phone);
-
- SetProfileIdx(P2PROFILE_PERSON); // Default
-
- m_nBackStyle = 0;
- SetForm(pVf); // We need the form set BEFORE calling SetBG
- SetEffect(VEFFECT_SHADOW);
- }
-
- // -------------------------------------------------------------------------
- // CPerson3Row Destructor
- // -------------------------------------------------------------------------
- CPerson3Row::~CPerson3Row()
- {
- }
-
-
- // -------------------------------------------------------------------------
- // GetBackBmp
- // -------------------------------------------------------------------------
- HBITMAP CPerson3Row::GetBackBmp()
- {
- return ((CPerson3VF*)Form())->GetBackBmp();
- }
-
- // -------------------------------------------------------------------------
- // GetBackPalette
- // -------------------------------------------------------------------------
- HPALETTE CPerson3Row::GetBackPaletteHandle()
- {
- return ((CPerson3VF*)Form())->GetBackPalette();
- }
-
- // -------------------------------------------------------------------------
- // CPerson3Row SetEffect
- // -------------------------------------------------------------------------
- void CPerson3Row::SetEffect(int nEffect)
- {
- int nEffectDepth = (nEffect == VEFFECT_SHADOW) ? 1 : 0;
-
- m_name.Effect(nEffect);
- m_note.Effect(nEffect);
- m_phoneDesc.Effect(nEffect);
- m_phone.Effect(nEffect);
-
- m_name.EffectDepth(nEffectDepth);
- m_note.EffectDepth(nEffectDepth);
- m_phoneDesc.EffectDepth(nEffectDepth);
- m_phone.EffectDepth(nEffectDepth);
-
- SetBG(m_nBackStyle); // Switch us BACK from the gray (possibly)
- }
-
- // -------------------------------------------------------------------------
- // CPerson3Row Background Drawing
- // -------------------------------------------------------------------------
- void CPerson3Row::SetBG(int nBackStyle)
- {
- SetStyle(nBackStyle);
-
- CPerson3VF* pForm = (CPerson3VF *)Form();
- COLORREF clr;
- BOOL bTransparent = FALSE;
- BOOL bNoInactBorder = TRUE;
-
- // These just look better in light gray
- if(pForm->GetEffect() == VEFFECT_SUNKEN ||
- pForm->GetEffect() == VEFFECT_RAISED)
- clr = RGB(192,192,192);
- else
- clr = RGB(255,255,255);
-
- ResetCtl(m_name, bTransparent, bNoInactBorder, clr);
- ResetCtl(m_note, bTransparent, bNoInactBorder, clr);
- ResetCtl(m_phoneDesc, bTransparent, bNoInactBorder, clr);
- ResetCtl(m_phone, bTransparent, bNoInactBorder, clr);
-
- /* Not really needed anymore ------
- switch(nBackStyle)
- {
- case VROW_BG_PAPER: // Paper
- case VROW_BG_FLAT: // Flat
- case VROW_BG_GREENBAR: // Greenbar
- case VROW_BG_BMP: // Bitmap
- default: // Normal
- }
- ---------------- */
- }
-
-
- // IMPLEMENT_DYNCREATE(CPerson3VF, VForm)
-
- BEGIN_MESSAGE_MAP(CPerson3VF, VForm)
- //{{AFX_MSG_MAP(CPerson3VF)
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- // -------------------------------------------------------------------------
- // CPerson3VF Constructor
- // -------------------------------------------------------------------------
- CPerson3VF::CPerson3VF()
- {
- m_pFont = 0; // use default font
- m_pPalMH = 0;
- m_nBackIdx = 0;
- m_hIcon = AfxGetApp()->LoadIcon(IDI_POINTHAND);
- m_nRowHeight = 25;
- m_nRowWidth = 510;
- m_nRows = 0; // Start at 400
- m_nEffect = VEFFECT_SHADOW;
-
- // ------------- Header and footer with Something in them --------
- CPerson3Hdr *pHdr = new CPerson3Hdr();
- SetHeader(pHdr, FALSE);
-
- m_pFont = GetFonts()->GetOrAdd(_T("Arial"), 100);
-
- if(!m_imgList.Create(IDB_IMG_TEST, 16, 0, RGB(0,255,255)))
- TRACE(_T("CPerson3VF could not create image list\n"));
- // m_imgList.SetBkColor(GetSysColor(COLOR_WINDOW));
- if(!m_imgCycleList.Create(IDB_IMG_CYCLES, 16, 0, RGB(0,255,255)))
- TRACE(_T("CPerson3VF could not create cycle image list\n"));
- if(!m_imgPrintAnim.Create(IDB_IMG_PRINT_ANIM, 16, 0, RGB(0,255,255)))
- TRACE(_T("CPerson3VF could not create print animation image list\n"));
-
- m_tree.SetSortCallback(SortFunc); // Set the sorting function
-
- m_personDB.FileName(_T("person3.dat"));
- if(!m_personDB.OpenOrCreate())
- {
- MessageBox(_T("Error opening/creating person2.dat"), _T("VForm Demo"),
- MB_OK | MB_ICONEXCLAMATION);
- }
- SetPersonDB(&m_personDB);
- }
-
- // -------------------------------------------------------------------------
- // CPerson3VF Destructor
- // -------------------------------------------------------------------------
- CPerson3VF::~CPerson3VF()
- {
- }
-
- // -------------------------------------------------------------------------
- // CPerson3VF Load the tree structure
- // -------------------------------------------------------------------------
- void CPerson3VF::SetPersonDB(CPerson2DB *pDB)
- {
- int i, j;
- VTIPerson *pTPerson;
- VTIPersonPhone *pTPhone;
- CPerson2 data;
- long nItem;
-
- m_pPersonDB = pDB;
- int nRecords = m_pPersonDB->GetCount();
- // m_tree.MsgCurPosition();
-
- for(i=0; i < nRecords; i++)
- {
- if(!m_pPersonDB->GetRec(i, data))
- {
- AfxMessageBox(_T("Error loading person data"));
- nRecords = i;
- break;
- }
- pTPerson = new VTIPerson;
- pTPerson->m_nRecNo = i;
- _tcscpy(pTPerson->m_name, data.m_name);
- _tcscpy(pTPerson->m_note, data.m_note);
- // if(!m_tree.InsertItem(pTPerson, VTI_ROOT, VTI_LASTCHILD))
- if(!m_tree.InsertItem(pTPerson, VTI_ROOT, VTI_SORTCHILD))
- {
- AfxMessageBox(_T("Error adding Person to VTree"));
- break;
- }
- // m_tree.MsgCurPosition();
- nItem = m_tree.CurItem();
- ASSERT(nItem >= 0);
-
- for(j=0; j < PERS2_MAX_PHONES; j++)
- {
- sPerson2Phone *pPhone = &data.m_phones[j];
- if(pPhone->m_phoneDesc[0] == 0)
- break;
- pTPhone = new VTIPersonPhone;
- pTPhone->m_nRecNo = i;
- pTPhone->m_nPhoneIdx = j;
- _tcscpy(pTPhone->m_phoneDesc, pPhone->m_phoneDesc);
- _tcscpy(pTPhone->m_phone, pPhone->m_phone);
- // if(!m_tree.InsertItem(pTPhone, nItem, VTI_LASTCHILD))
- if(!m_tree.InsertItem(pTPhone, nItem, VTI_SORTCHILD))
- {
- AfxMessageBox(_T("Error adding Phone to VTree"));
- break;
- }
- // m_tree.MsgCurPosition();
- }
- pTPerson->m_nPhoneCnt = j;
- }
-
- long nRowCnt = m_tree.GetVisibleCount();
- long nTotRowCnt = m_tree.GetCount();
-
- ResetNumRows(nRecords, 0);
- }
-
-
- BOOL CPerson3VF::SetBackBmp(LPCTSTR szFile)
- {
- BOOL bRet;
-
- m_bmpBack.DeleteObject(); // remove old
- bRet = m_bmpBack.LoadFile(szFile); // load new
- // m_pWnd->ResetPalette();
- m_pPalMH->DoRealizePalette(TRUE);
-
- return bRet;
- }
-
-
- // -------------------------------------------------------------------------
- // Function to create a CPerson3Row
- // -------------------------------------------------------------------------
- VRow* CPerson3VF::InitRow()
- {
- CPerson3Row *pRow = new CPerson3Row(this);
- pRow->SetIcon(m_hIcon);
- return(pRow);
- }
-
- // -------------------------------------------------------------------------
- // Called when a row needs to be put on the screen
- // -------------------------------------------------------------------------
- BOOL CPerson3VF::OnGetRow(VRow *pRow)
- {
- CString s1;
- CPerson3Row *r = (CPerson3Row*) pRow;
- long idx;
- VTreeItem *pItem;
- VTIPerson *pPerson;
- VTIPersonPhone *pPhone;
-
- idx = r->RowId();
- pItem = m_tree.GetVisItem(idx);
- ASSERT(pItem);
-
- switch(pItem->IsA())
- {
- case P2PROFILE_PERSON:
- pPerson = (VTIPerson *) pItem;
- r->m_name.SetWindowText(pPerson->m_name);
- r->m_note.SetWindowText(pPerson->m_note);
- r->SetProfileIdx(P2PROFILE_PERSON);
- if(pPerson->m_nPhoneCnt == 0)
- r->m_btnPlus.Visible(FALSE);
- else
- {
- r->m_btnPlus.Visible(TRUE);
- if(pPerson->IsExpanded())
- r->m_btnPlus.Text(_T("-"));
- else
- r->m_btnPlus.Text(_T("+"));
- }
- break;
- case P2PROFILE_PHONE:
- pPhone = (VTIPersonPhone *) pItem;
- r->m_phoneDesc.SetWindowText(pPhone->m_phoneDesc);
- r->m_phone.SetWindowText(pPhone->m_phone);
- r->SetProfileIdx(P2PROFILE_PHONE);
- break;
- default:
- break;
- }
-
- s1.Format(_T("%ld"), idx+1);
- r->m_recno.SetWindowText(s1);
-
- return TRUE;
- }
-
- // -------------------------------------------------------------------------
- // Called when a row needs to be saved (in the data)
- // -------------------------------------------------------------------------
- BOOL CPerson3VF::OnSaveRow(VRow *pRow)
- {
- CPerson3Row *r = (CPerson3Row*) pRow;
- long idx;
- CPerson2 data;
- sPerson2Phone *pPhoneData;
-
- VTreeItem *pItem;
- VTIPerson *pPerson;
- VTIPersonPhone *pPhone;
-
- idx = r->RowId();
- long nRecId;
- pItem = m_tree.GetVisItem(idx);
- ASSERT(pItem);
-
- switch(pItem->IsA())
- {
- case P2PROFILE_PERSON:
- pPerson = (VTIPerson *) pItem;
- nRecId = pPerson->m_nRecNo;
- if(!m_pPersonDB->GetRec(nRecId, data)) return FALSE;
-
- // --- Update our m_tree data ---
- _tcscpy(pPerson->m_name, r->m_name.Text());
- _tcscpy(pPerson->m_note, r->m_note.Text());
-
- // --- now update the database ---
- _tcscpy(data.m_name, r->m_name.Text());
- _tcscpy(data.m_note, r->m_note.Text());
-
- if(!m_pPersonDB->UpdateRec(nRecId, data)) return FALSE;
- break;
- case P2PROFILE_PHONE:
- pPhone = (VTIPersonPhone *) pItem;
- nRecId = pPhone->m_nRecNo;
- if(!m_pPersonDB->GetRec(nRecId, data)) return FALSE;
-
- // --- Update our m_tree data ---
- _tcscpy(pPhone->m_phoneDesc, r->m_phoneDesc.Text());
- _tcscpy(pPhone->m_phone, r->m_phone.Text());
-
- // --- now update the database ---
- pPhoneData = &data.m_phones[pPhone->m_nPhoneIdx];
- _tcscpy(pPhoneData->m_phoneDesc, r->m_phoneDesc.Text());
- _tcscpy(pPhoneData->m_phone, r->m_phone.Text());
-
- if(!m_pPersonDB->UpdateRec(nRecId, data)) return FALSE;
- break;
- default:
- break;
- }
-
- return TRUE;
- }
-
- // -------------------------------------------------------------------------
- // Called when row(s) needs to be deleted from the data
- // -------------------------------------------------------------------------
- BOOL CPerson3VF::OnDelete()
- {
- CString s1;
- long nNumSelected = m_selectedList.Count();
-
- s1.Format(
- _T("You have selected to delete %ld records\nActual delete not enabled in this demo"),
- nNumSelected);
- AfxMessageBox(s1);
- return TRUE; // Dont let delete key pass through
- }
-
- // -------------------------------------------------------------------------
- // Called when a row needs to be added to the data
- // -------------------------------------------------------------------------
- BOOL CPerson3VF::OnAddRow(VRow *pRow)
- {
- CPerson3Row *r = (CPerson3Row*) pRow;
- int idx;
- CPerson2 data;
- long nItem;
- int nRecId;
- // nRecId = m_tree.GetRootCount(); // Next Person Id
-
- idx = r->RowId();
-
- _tcscpy(data.m_name, r->m_name.Text());
- _tcscpy(data.m_note, r->m_note.Text());
- data.m_deleted = 'N';
-
- if(!m_pPersonDB->AddRec(nRecId, data))
- return FALSE;
-
- // We must also add the record to the tree
- VTIPerson *pTPerson = new VTIPerson;
- pTPerson->m_nRecNo = nRecId;
- _tcscpy(pTPerson->m_name, data.m_name);
- _tcscpy(pTPerson->m_note, data.m_note);
- if(!m_tree.InsertItem(pTPerson, VTI_ROOT, VTI_LASTCHILD))
- {
- AfxMessageBox(_T("Error adding Person to VTree"));
- return FALSE;
- }
- nItem = m_tree.CurItem();
- ASSERT(nItem >= 0);
-
- return TRUE;
- }
-
- // -------------------------------------------------------------------------
- // Called when a row is initially being added
- // -------------------------------------------------------------------------
- void CPerson3VF::OnStartAdd(VRow *pRow)
- {
- CString s1;
- CPerson3Row *r = (CPerson3Row*) pRow;
- long idx;
- // CPerson2 data;
-
- idx = r->RowId();
-
- s1.Format(_T("%ld"), idx+1);
- r->m_recno.SetWindowText(s1);
-
- r->m_btnPlus.Visible(FALSE);
- r->m_name.SetWindowText(_T(""));
- r->m_note.SetWindowText(_T(""));
- r->m_phoneDesc.SetWindowText(_T(""));
- r->m_phone.SetWindowText(_T(""));
- }
-
- // -------------------------------------------------------------------------
- // Called when a row is initially being added
- // -------------------------------------------------------------------------
- int CPerson3VF::SortFunc(VTreeItem **ppItem1, VTreeItem **ppItem2)
- // int SortFunc(const void *p1, const void *p2)
- {
- VTreeItem *pItem1 = *ppItem1;
- VTreeItem *pItem2 = *ppItem2;
- int nType1 = pItem1->IsA();
- int nType2 = pItem2->IsA();
-
- if(nType1 != nType2)
- return nType2 - nType1;
-
- switch(nType1)
- {
- case P2PROFILE_PERSON: // Comparing 2 Person recs
- {
- VTIPerson *p1 = (VTIPerson *) pItem1;
- VTIPerson *p2 = (VTIPerson *) pItem2;
- return _tcscmp(p1->m_name, p2->m_name);
- }
- break;
- case P2PROFILE_PHONE:
- {
- VTIPersonPhone *p1 = (VTIPersonPhone *) pItem1;
- VTIPersonPhone *p2 = (VTIPersonPhone *) pItem2;
- return _tcscmp(p1->m_phoneDesc, p2->m_phoneDesc);
- }
- break;
- }
-
- return 0; // Should never get here
- }
-
-
- // -------------------------------------------------------------------------
- // Called when a button is clicked
- // -------------------------------------------------------------------------
- void CPerson3VF::OnClick(VRow *pRow, int nId)
- {
- CString s1, sBmpFile;
- CPerson3Row *pPersonRow = (CPerson3Row*) pRow;
- static _TCHAR szFilter[] = _T("Bitmaps (*.bmp)|*.bmp|All Files (*.*)|*.*||");
-
- switch(nId)
- {
- case IDVC_CHK_SELECTORS:
- {
- CPerson3Hdr *pHdr = (CPerson3Hdr *)Header();
- if(pHdr->m_chkSelectors.Checked())
- UseSelectors(TRUE);
- else
- UseSelectors(FALSE);
- break;
- }
- case IDVCTREE_BTNPLUS:
- {
- // User wants to expand or contract row
- long idx = pRow->RowId();
- VTIPerson *pPerson;
- pPerson = (VTIPerson*)m_tree.GetVisItem(idx);
- ASSERT(pPerson);
- if(pPerson->IsExpanded())
- {
- pPerson->Collapse();
- pPersonRow->m_btnPlus.Text(_T("+"));
- pPersonRow->m_btnPlus.Draw();
- }
- else
- {
- pPerson->Expand();
- pPersonRow->m_btnPlus.Text(_T("-"));
- pPersonRow->m_btnPlus.Draw();
- }
-
- long nNewRowCnt = m_tree.GetVisibleCount();
- ResetNumRows(nNewRowCnt);
- break;
- }
- case IDVC_SET_BMP:
- {
- CFileDialog dlg(TRUE, _T("bmp"), sBmpFile,
- OFN_SHAREAWARE | OFN_PATHMUSTEXIST, szFilter);
- if(dlg.DoModal() != IDOK)
- break;
-
- sBmpFile = dlg.GetPathName();
- if(SetBackBmp(sBmpFile) && m_nBackIdx == 4)
- {
- RefreshScreen(VFR_BOTH);
- }
- break;
- }
- }
- }
-
- // -------------------------------------------------------------------------
- // Called when list is closed is clicked
- // -------------------------------------------------------------------------
- BOOL CPerson3VF::OnEndList(VCtl* pCtl, CListBox* pLB)
- {
- CPerson3Row *pRow;
- CPerson3Hdr *pHdr;
- int i;
- int nBgStyle = VROW_BG_DEFAULT;
-
- switch(pCtl->Id())
- {
- case IDVC_BG_OPTION:
- m_nBackIdx = pLB->GetCurSel();
-
- switch(m_nBackIdx)
- {
- case 0: nBgStyle = VROW_BG_DEFAULT; break;
- case 1: nBgStyle = VROW_BG_GREENBAR; break;
- case 2: nBgStyle = VROW_BG_PAPER; break;
- case 3: nBgStyle = VROW_BG_FLAT; break;
- case 4: nBgStyle = VROW_BG_BMP; break;
- }
-
- // Reset detail rows to this style
- pHdr = (CPerson3Hdr *)Header();
- pHdr->SetStyle(nBgStyle);
-
- pRow = (CPerson3Row *)m_pDtlRow;
- pRow->SetBG(nBgStyle);
- pRow = (CPerson3Row *)m_pTmpRow;
- pRow->SetBG(nBgStyle);
-
- RefreshScreen(VFR_BOTH);
- break;
- case IDVC_BOX_STYLE:
- i = pLB->GetCurSel();
-
- switch(i)
- {
- case 0: m_nEffect = VEFFECT_NORMAL; break;
- case 1: m_nEffect = VEFFECT_SHADOW; break;
- case 2: m_nEffect = VEFFECT_SUNKEN; break;
- case 3: m_nEffect = VEFFECT_RAISED; break;
- default: m_nEffect = VEFFECT_NORMAL; break;
- }
-
- // Reset detail rows to this style
- pRow = (CPerson3Row *)m_pDtlRow;
- pRow->SetEffect(m_nEffect);
- pRow = (CPerson3Row *)m_pTmpRow;
- pRow->SetEffect(m_nEffect);
-
- RefreshScreen(VFR_BOTH);
- }
- return TRUE;
- }
-
-
-
- // -------------------------------------------------------------------------
- // Start a timer for the form
- // -------------------------------------------------------------------------
- int CPerson3VF::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (VForm::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- return 0;
- }
-
-