home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************
- $Archive: $
- $Workfile: $
- $Author: $
- $Date: $
- $Revision: $
- *******************************************************************/
-
- #include "StdAfx.h"
- #include "resource.h"
- #include "MyPropertyPage1.h"
- #include "Controls.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- IMPLEMENT_DYNCREATE(CMyPropertyPage1, CPropertyPage)
-
- /////////////////////////////////////////////////////////////////////////////
- // CMyPropertyPage1 property page
-
- CMyPropertyPage1::CMyPropertyPage1() : CPropertyPage(CMyPropertyPage1::IDD)
- {
- //{{AFX_DATA_INIT(CMyPropertyPage1)
- m_nCombo1 = 0;
- m_nCombo3 = 0;
- m_edit2 = 0;
- //}}AFX_DATA_INIT
- m_psp.dwFlags &= ~PSH_HASHELP;
- }
-
- CMyPropertyPage1::~CMyPropertyPage1()
- {
- }
-
- void CMyPropertyPage1::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMyPropertyPage1)
- DDX_Control(pDX, IDC_PROGRESS1, m_progress1);
- DDX_Control(pDX, IDC_LIST1, m_listBox);
- DDX_CBIndex(pDX, IDC_COMBO3, m_nCombo3);
- DDX_Text(pDX, IDC_EDIT2, m_edit2);
- //}}AFX_DATA_MAP
- }
-
- BEGIN_MESSAGE_MAP(CMyPropertyPage1, CPropertyPage)
- //{{AFX_MSG_MAP(CMyPropertyPage1)
- ON_EN_CHANGE(IDC_EDIT2, OnChangeEdit2)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- BOOL CMyPropertyPage1::OnInitDialog()
- {
- CPropertyPage::OnInitDialog();
-
- m_listBox.AddString("Hispanic");
- m_listBox.AddString("White");
- m_listBox.AddString("American Indian");
- m_listBox.AddString("Black/African American");
- m_listBox.AddString("Chicano/Mexican American");
- m_listBox.AddString("Asian");
- m_listBox.AddString("Latino");
- m_listBox.AddString("Puerto Rican");
- m_listBox.AddString("Caucasian");
- m_listBox.AddString("Multi-Racial");
- m_listBox.AddString("Other");
-
- m_progress1.SetRange( 0, 100 );
- m_edit2 = 25;
- m_progress1.SetPos( m_edit2 );
-
- UpdateData(FALSE);
-
- return TRUE;
- }
-
- /*static int __stdcall BrowseProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
- {
- switch(uMsg)
- {
- case BFFM_INITIALIZED:
- {
-
- HKEY hk;
- DWORD dwData;
-
- if (RegCreateKey(HKEY_LOCAL_MACHINE,
- "Software\\SkinCrafter\\SkinCrafter Demo", &hk))
- int err = 1;
-
- char skinPath[_MAX_PATH] = "";
- RegQueryValueEx(hk,"SkinPath",NULL,NULL,(LPBYTE)skinPath,&dwData);
-
-
- RegCloseKey(hk);
-
- SHFILEINFO shinfo;
- DWORD dw = SHGetFileInfo( skinPath, NULL,
- &shinfo,
- sizeof(shinfo),
- SHGFI_DISPLAYNAME );
- if(dw == 0 || skinPath[0] == 0)
- strcpy(skinPath,theApp.m_ExePath.GetBuffer(theApp.m_ExePath.GetLength()));
-
- SendMessage(hWnd,BFFM_SETSELECTION,TRUE,(LPARAM)skinPath);
- theApp.m_ExePath.ReleaseBuffer();
- break;
- }
- default:
- break;
- }
- return 0;
- }*/
-
- /*void CMyPropertyPage1::OnButton2()
- {
- BROWSEINFO bi;
- char foldername[MAX_PATH];
- ZeroMemory(&bi,sizeof(bi));
- bi.pszDisplayName=foldername;
- bi.hwndOwner=m_hWnd;
- bi.lpfn=(BFFCALLBACK)BrowseProc;
-
- CString title("Select Skin Directory");
- bi.lpszTitle=title;
-
- bi.ulFlags=BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
- LPITEMIDLIST lpid= SHBrowseForFolder(&bi);
- if(lpid)
- { IMalloc* pMalloc;
- SHGetPathFromIDList(lpid,foldername);
- SHGetMalloc(&pMalloc);
- pMalloc->Free((void*) lpid);
- pMalloc->Release();
- CEdit * m_folder=(CEdit*)GetDlgItem(IDC_EDIT_SKIN);
- m_folder->SetWindowText(foldername);
- m_strSkinDir.Format("%s",foldername);
- }
- FillSkinCombo();
- }*/
-
- /*void CMyPropertyPage1::FillSkinCombo()
- {
- CFileFind findFile;
- m_strSkinDir+="\\*.skf";
- BOOL bWorking(findFile.FindFile(m_strSkinDir));
- ((CComboBox*)GetDlgItem(IDC_COMBO_SKIN))->ResetContent();
- int count = 0;
- m_comboMap.RemoveAll();
- while (bWorking)
- {
- bWorking = findFile.FindNextFile();
- if (findFile.IsDots() || findFile.IsDirectory())// skip . and .. files; otherwise, we'd recur infinitely!
- continue;
-
- CString filepath= findFile.GetFilePath();
- CString filename = findFile.GetFileName();
- BSTR a, n, e, d;
- theApp.m_pSkin.GetSkinCopyRight(filepath,&n,&a,&d,&e);
-
- CString key;
- key.Format("%d",count);
- m_comboMap.SetAt(key,filepath);
-
- if(a)
- SysFreeString(a);
- if(d)
- SysFreeString(d);
- if(e)
- SysFreeString(e);
-
- if(n)
- {
- CString name(n);
- SysFreeString(n);
- ((CComboBox*)GetDlgItem(IDC_COMBO_SKIN))->InsertString(count,name);
- }
- else
- ((CComboBox*)GetDlgItem(IDC_COMBO_SKIN))->InsertString(count,filename);
- count++;
- }
- findFile.Close();
-
- }*/
-
-
- void CMyPropertyPage1::OnChangeEdit2()
- {
- if (m_edit2!=0)
- {
- UpdateData(TRUE);
- m_progress1.SetPos( m_edit2 );
- UpdateData(FALSE);
- }
- }
-