diff --git a/CB32.APS b/CB32.APS new file mode 100644 index 0000000..fac334d Binary files /dev/null and b/CB32.APS differ diff --git a/CB32.PLG b/CB32.PLG new file mode 100644 index 0000000..e015981 --- /dev/null +++ b/CB32.PLG @@ -0,0 +1,47 @@ +--------------------Configuration: CB32 - Win32 Release-------------------- +Begining build with project "D:\Code\Cb32\CB32.DSP", at root. +Active configuration is Win32 (x86) Application (based on Win32 (x86) Application) + +Project's tools are: + "32-bit C/C++ Compiler for 80x86" with flags "/nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR"Release/" /Fp"Release/CB32.pch" /Yu"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c " + "OLE Type Library Maker" with flags "/nologo /D "NDEBUG" /mktyplib203 /win32 " + "Win32 Resource Compiler" with flags "/l 0x409 /fo"Release/CB32.res" /d "NDEBUG" " + "Browser Database Maker" with flags "/nologo /o"Release/CB32.bsc" " + "COFF Linker for 80x86" with flags "../cexpr/Release/cexpr.lib tapi32.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/CB32.pdb" /machine:I386 /out:"Release/CB32.exe" " + "Custom Build" with flags "" + "" with flags "" + +Creating command line "rc.exe /l 0x409 /fo"Release/CB32.res" /d "NDEBUG" "D:\Code\Cb32\CB32.rc"" +Creating temp file "E:\TEMP\RSP11.tmp" with contents <../cexpr/Release/cexpr.lib tapi32.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/CB32.pdb" /machine:I386 /out:"Release/CB32.exe" +.\Release\CB32.obj +.\Release\CB32Doc.obj +.\Release\CB32View.obj +.\Release\ColPage.obj +.\Release\ComboBar.obj +.\Release\ConvertDlg.obj +.\Release\FindDlg.obj +.\Release\GetNew.obj +.\Release\History.obj +.\Release\HyperLink.obj +.\Release\MainFrm.obj +.\Release\MyHeaderCtrl.obj +.\Release\OrdPage.obj +.\Release\Parser.obj +.\Release\PrefPage.obj +.\Release\PropAdd.obj +.\Release\PropComp.obj +.\Release\PropInfo.obj +.\Release\PropNote.obj +.\Release\PropOnline.obj +.\Release\PropPhone.obj +.\Release\SetPage.obj +.\Release\StdAfx.obj +.\Release\ToolBarEx.obj +.\Release\CB32.res> +Creating command line "link.exe @E:\TEMP\RSP11.tmp" +Compiling resources... +Linking... + + + +CB32.exe - 0 error(s), 0 warning(s) diff --git a/CB32.clw b/CB32.clw new file mode 100644 index 0000000..7794899 --- /dev/null +++ b/CB32.clw @@ -0,0 +1,768 @@ +; CLW file contains information for the MFC ClassWizard + +[General Info] +Version=1 +LastClass=CCB32View +LastTemplate=CPropertyPage +NewFileInclude1=#include "stdafx.h" +NewFileInclude2=#include "cb32.h" +LastPage=0 + +ClassCount=25 +Class1=CMainFrame +Class2=CPropAdd +Class3=CPropInfo +Class4=CPropNote +Class5=CPropOnline +Class6=CPropPhone +Class7=CCB32App +Class8=CAboutDlg +Class9=CCB32Doc +Class10=CCB32View +Class11=CConvertDlg +Class12=CPrefDlg +Class13=CFindDlg +Class14=CTBComboBox +Class15=CComboToolBar + +ResourceCount=15 +Resource1=IDD_PPAGE +Resource2=IDR_CONTEXTMENU +Resource3=IDD_ABOUTBOX +Resource4=IDD_COLPAGE +Resource5=IDD_CONVERT +Resource6=IDR_MAINFRAME +Resource7=IDD_SETPAGE +Resource8=IDR_TRAYMENU +Resource9=IDD_APAGE +Resource10=IDD_OPAGE +Class16=CProgDlg +Class17=CSetPage +Class18=CDefPage +Class19=CColPage +Class20=CPrefPage +Resource11=IDD_CPAGE +Resource12=IDD_GETNEW +Resource13=IDD_ORDPAGE +Class21=CGetNew +Class22=CPropComp +Class23=CMyHeaderCtrl +Class24=CHyperLink +Resource14=IDD_FIND +Class25=COrdPage +Resource15=IDD_NPAGE + +[CLS:CMainFrame] +Type=0 +BaseClass=CFrameWnd +HeaderFile=MainFrm.h +ImplementationFile=MainFrm.cpp +LastObject=ID_VIEW_FLATBAR +Filter=T +VirtualFilter=fWC + +[CLS:CPropAdd] +Type=0 +BaseClass=CPropertyPage +HeaderFile=PropAdd.h +ImplementationFile=PropAdd.cpp +LastObject=CPropAdd + +[CLS:CPropInfo] +Type=0 +BaseClass=CPropertySheet +HeaderFile=PropInfo.h +ImplementationFile=PropInfo.cpp + +[CLS:CPropNote] +Type=0 +BaseClass=CPropertyPage +HeaderFile=PropNote.h +ImplementationFile=PropNote.cpp +LastObject=CPropNote + +[CLS:CPropOnline] +Type=0 +BaseClass=CPropertyPage +HeaderFile=PropOnline.h +ImplementationFile=PropOnline.cpp + +[CLS:CPropPhone] +Type=0 +BaseClass=CPropertyPage +HeaderFile=PropPhone.h +ImplementationFile=PropPhone.cpp + +[CLS:CCB32App] +Type=0 +BaseClass=CWinApp +HeaderFile=CB32.h +ImplementationFile=CB32.cpp +LastObject=CCB32App +Filter=N +VirtualFilter=AC + +[CLS:CAboutDlg] +Type=0 +BaseClass=CDialog +HeaderFile=CB32.cpp +ImplementationFile=CB32.cpp +LastObject=CAboutDlg +Filter=D +VirtualFilter=dWC + +[CLS:CCB32Doc] +Type=0 +BaseClass=CDocument +HeaderFile=CB32Doc.h +ImplementationFile=CB32Doc.cpp +Filter=N +VirtualFilter=DC +LastObject=CCB32Doc + +[CLS:CCB32View] +Type=0 +BaseClass=CListView +HeaderFile=CB32View.h +ImplementationFile=CB32View.cpp +LastObject=CCB32View +Filter=C +VirtualFilter=VWC + +[DLG:IDD_APAGE] +Type=1 +Class=CPropAdd +ControlCount=20 +Control1=IDC_FNAME,edit,1350631552 +Control2=IDC_MI,edit,1350631552 +Control3=IDC_LNAME,edit,1350631552 +Control4=IDC_TITLE,edit,1350631552 +Control5=IDC_ADD1,edit,1350631552 +Control6=IDC_ADD2,edit,1350631552 +Control7=IDC_CITY,edit,1350631552 +Control8=IDC_STATE,edit,1350631552 +Control9=IDC_ZIPCODE,edit,1350631552 +Control10=IDC_COUNTRY,edit,1350631552 +Control11=IDC_STATIC1,static,1342308352 +Control12=IDC_STATIC,static,1342308352 +Control13=IDC_STATIC,static,1342308352 +Control14=IDC_STATIC,static,1342308352 +Control15=IDC_STATIC,static,1342308352 +Control16=IDC_STATIC,static,1342308352 +Control17=IDC_STATIC,static,1342308352 +Control18=IDC_STATIC,static,1342308352 +Control19=IDC_STATIC,static,1342308352 +Control20=IDC_STATIC,static,1342308352 + +[DLG:IDD_NPAGE] +Type=1 +Class=CPropNote +ControlCount=1 +Control1=IDC_NOTES,edit,1350635524 + +[DLG:IDD_OPAGE] +Type=1 +Class=CPropOnline +ControlCount=8 +Control1=IDC_STATIC,static,1342308352 +Control2=IDC_STATIC,static,1342308352 +Control3=IDC_STATIC,static,1342308352 +Control4=IDC_STATIC,static,1342308352 +Control5=IDC_EMAIL1,edit,1350631552 +Control6=IDC_EMAIL2,edit,1350631552 +Control7=IDC_WEB1,edit,1350631552 +Control8=IDC_WEB2,edit,1350631552 + +[DLG:IDD_PPAGE] +Type=1 +Class=CPropPhone +ControlCount=22 +Control1=IDC_HPHONE,edit,1350631552 +Control2=IDC_HPHONEX,edit,1350631552 +Control3=IDC_WPHONE,edit,1350631552 +Control4=IDC_WPHONEX,edit,1350631552 +Control5=IDC_PAGER,edit,1350631552 +Control6=IDC_PAGERX,edit,1350631552 +Control7=IDC_PAGERC,edit,1350631552 +Control8=IDC_FAX,edit,1350631552 +Control9=IDC_FAXX,edit,1350631552 +Control10=IDC_CELLULAR,edit,1350631552 +Control11=IDC_CELLULARX,edit,1350631552 +Control12=IDC_STATIC,static,1342308352 +Control13=IDC_STATIC,static,1342308352 +Control14=IDC_STATIC,static,1342308352 +Control15=IDC_STATIC,static,1342308352 +Control16=IDC_STATIC,static,1342308352 +Control17=IDC_STATIC,static,1342308352 +Control18=IDC_STATIC,static,1342308352 +Control19=IDC_STATIC,static,1342308352 +Control20=IDC_STATIC,static,1342308352 +Control21=IDC_STATIC,static,1342308352 +Control22=IDC_STATIC,static,1342308352 + +[DLG:IDD_ABOUTBOX] +Type=1 +Class=CAboutDlg +ControlCount=8 +Control1=IDC_STATIC,static,1342177283 +Control2=IDC_STATIC,static,1342308480 +Control3=IDC_MYEMAIL,static,1342177793 +Control4=IDOK,button,1342373889 +Control5=IDC_STATIC,static,1342308352 +Control6=IDC_STATIC,static,1342308352 +Control7=IDC_MYWEB,static,1342308865 +Control8=IDC_STATIC,button,1342177287 + +[ACL:IDR_MAINFRAME] +Type=1 +Class=? +Command1=ID_ENTRY_COPY +Command2=ID_EDIT_FIND +Command3=ID_FILE_NEW +Command4=ID_FILE_OPEN +Command5=ID_FILE_PRINT +Command6=ID_FILE_SAVE +Command7=ID_EDIT_PASTE +Command8=ID_EDIT_UNDO +Command9=ID_ENTRY_DELETE +Command10=ID_EDIT_CUT +Command11=ID_HELP_INDEX +Command12=ID_CONTEXT_HELP +Command13=ID_VIEW_FIND_NEXT +Command14=ID_EDIT_FIND_COMBO +Command15=ID_NEXT_PANE +Command16=ID_PREV_PANE +Command17=ID_ENTRY_ADD +Command18=ID_EDIT_COPY +Command19=ID_EDIT_PASTE +Command20=ID_ENTRY_EDIT +Command21=ID_EDIT_CUT +Command22=ID_EDIT_UNDO +CommandCount=22 + +[TB:IDR_MAINFRAME] +Type=1 +Class=? +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_SAVE +Command4=ID_ENTRY_ADD +Command5=ID_ENTRY_EDIT +Command6=ID_ENTRY_DELETE +Command7=ID_ENTRY_COPY +Command8=ID_EDIT_FIND +Command9=ID_TBAR_DIAL +Command10=ID_TBAR_EMAIL +Command11=ID_TBAR_WEB +Command12=ID_APP_PREFS +Command13=ID_HELP_INDEX +CommandCount=13 + +[MNU:IDR_MAINFRAME] +Type=1 +Class=? +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_SAVE +Command4=ID_FILE_SAVE_AS +Command5=ID_IMPORT_CSV +Command6=ID_IMPORT_TAB +Command7=ID_EXPORT_CSV +Command8=ID_EXPORT_TAB +Command9=ID_FILE_MRU_FILE1 +Command10=ID_APP_EXIT +Command11=ID_EDIT_FIND +Command12=ID_VIEW_FIND_NEXT +Command13=ID_APP_PREFS +Command14=ID_ENTRY_ADD +Command15=ID_ENTRY_EDIT +Command16=ID_ENTRY_DELETE +Command17=ID_ENTRY_COPY +Command18=ID_DIAL_HOME +Command19=ID_DIAL_WORK +Command20=ID_DIAL_PAGER +Command21=ID_DIAL_FAX +Command22=ID_DIAL_CELL +Command23=ID_EMAIL_ADD1 +Command24=ID_EMAIL_ADD2 +Command25=ID_URL1 +Command26=ID_URL2 +Command27=ID_VIEW_TOOLBAR +Command28=ID_VIEW_STATUS_BAR +Command29=ID_VIEW_FLATBAR +Command30=ID_VIEW_WNDPOS +Command31=ID_VIEW_COLSET +Command32=ID_VIEW_COLPOS +Command33=ID_HELP_INDEX +Command34=ID_APP_ABOUT +CommandCount=34 + +[DLG:IDD_CONVERT] +Type=1 +Class=CConvertDlg +ControlCount=100 +Control1=IDOK,button,1342242817 +Control2=IDCANCEL,button,1342242816 +Control3=IDC_XLNAME,edit,1350631552 +Control4=IDC_SPINXLNAME,msctls_updown32,1342177334 +Control5=IDC_XFNAME,edit,1350631552 +Control6=IDC_SPINXFNAME,msctls_updown32,1342177334 +Control7=IDC_XMI,edit,1350631552 +Control8=IDC_SPINXMI,msctls_updown32,1342177334 +Control9=IDC_XTITLE,edit,1350631552 +Control10=IDC_SPINXTITLE,msctls_updown32,1342177334 +Control11=IDC_XADD1,edit,1350631552 +Control12=IDC_SPINXADD1,msctls_updown32,1342177334 +Control13=IDC_XADD2,edit,1350631552 +Control14=IDC_SPINXADD2,msctls_updown32,1342177334 +Control15=IDC_XCITY,edit,1350631552 +Control16=IDC_SPINXCITY,msctls_updown32,1342177334 +Control17=IDC_XCOUNTRY,edit,1350631552 +Control18=IDC_SPINXCOUNTRY,msctls_updown32,1342177334 +Control19=IDC_XSTATE,edit,1350631552 +Control20=IDC_SPINXSTATE,msctls_updown32,1342177334 +Control21=IDC_XZIP,edit,1350631552 +Control22=IDC_SPINXZIP,msctls_updown32,1342177334 +Control23=IDC_XCOMP,edit,1350631552 +Control24=IDC_SPINXCOMP,msctls_updown32,1342177334 +Control25=IDC_XDEPT,edit,1350631552 +Control26=IDC_SPINXDEPT,msctls_updown32,1342177334 +Control27=IDC_XPOSN,edit,1350631552 +Control28=IDC_SPINXPOSN,msctls_updown32,1342177334 +Control29=IDC_XMGR,edit,1350631552 +Control30=IDC_SPINXMGR,msctls_updown32,1342177334 +Control31=IDC_XCADD1,edit,1350631552 +Control32=IDC_SPINXCADD1,msctls_updown32,1342177334 +Control33=IDC_XCADD2,edit,1350631552 +Control34=IDC_SPINXCADD2,msctls_updown32,1342177334 +Control35=IDC_XHOMEP,edit,1350631552 +Control36=IDC_SPINXHOMEP,msctls_updown32,1342177334 +Control37=IDC_XHOMEPX,edit,1350631552 +Control38=IDC_SPINXHOMEPX,msctls_updown32,1342177334 +Control39=IDC_XWORKP,edit,1350631552 +Control40=IDC_SPINXWORKP,msctls_updown32,1342177334 +Control41=IDC_XWORKPX,edit,1350631552 +Control42=IDC_SPINXWORKPX,msctls_updown32,1342177334 +Control43=IDC_XCELL,edit,1350631552 +Control44=IDC_SPINXCELL,msctls_updown32,1342177334 +Control45=IDC_XCELLX,edit,1350631552 +Control46=IDC_SPINXCELLX,msctls_updown32,1342177334 +Control47=IDC_XPAGER,edit,1350631552 +Control48=IDC_SPINXPAGER,msctls_updown32,1342177334 +Control49=IDC_XPAGERC,edit,1350631552 +Control50=IDC_SPINXPAGERC,msctls_updown32,1342177334 +Control51=IDC_XPAGERX,edit,1350631552 +Control52=IDC_SPINXPAGERX,msctls_updown32,1342177334 +Control53=IDC_XFAX,edit,1350631552 +Control54=IDC_SPINXFAX,msctls_updown32,1342177334 +Control55=IDC_XFAXX,edit,1350631552 +Control56=IDC_SPINXFAXX,msctls_updown32,1342177334 +Control57=IDC_XEMAIL1,edit,1350631552 +Control58=IDC_SPINXEMAIL1,msctls_updown32,1342177334 +Control59=IDC_XEMAIL2,edit,1350631552 +Control60=IDC_SPINXEMAIL2,msctls_updown32,1342177334 +Control61=IDC_XWEB1,edit,1350631552 +Control62=IDC_SPINXWEB1,msctls_updown32,1342177334 +Control63=IDC_XWEB2,edit,1350631552 +Control64=IDC_SPINXWEB2,msctls_updown32,1342177334 +Control65=IDC_XNOTES,edit,1350631552 +Control66=IDC_SPINXNOTES,msctls_updown32,1342177334 +Control67=IDC_STATIC,static,1342308352 +Control68=IDC_STATIC,static,1342308352 +Control69=IDC_STATIC,static,1342308352 +Control70=IDC_STATIC,static,1342308352 +Control71=IDC_STATIC,static,1342308352 +Control72=IDC_STATIC,static,1342308352 +Control73=IDC_STATIC,static,1342308352 +Control74=IDC_STATIC,static,1342308352 +Control75=IDC_STATIC,static,1342308352 +Control76=IDC_STATIC,static,1342308352 +Control77=IDC_STATIC,static,1342308352 +Control78=IDC_STATIC,static,1342308352 +Control79=IDC_STATIC,static,1342308352 +Control80=IDC_STATIC,static,1342308352 +Control81=IDC_STATIC,static,1342308352 +Control82=IDC_STATIC,static,1342308352 +Control83=IDC_STATIC,static,1342308352 +Control84=IDC_STATIC,static,1342308352 +Control85=IDC_STATIC,static,1342308352 +Control86=IDC_STATIC,static,1342308352 +Control87=IDC_STATIC,static,1342308352 +Control88=IDC_STATIC,static,1342308352 +Control89=IDC_STATIC,static,1342308352 +Control90=IDC_STATIC,static,1342308352 +Control91=IDC_STATIC,static,1342308352 +Control92=IDC_STATIC,static,1342308352 +Control93=IDC_STATIC,static,1342308352 +Control94=IDC_STATIC,static,1342308352 +Control95=IDC_STATIC,static,1342308352 +Control96=IDC_STATIC,static,1342308352 +Control97=IDC_STATIC,static,1342308352 +Control98=IDC_STATIC,static,1342308352 +Control99=IDC_XLINE1,edit,1352730628 +Control100=IDC_STATIC,static,1342177296 + +[CLS:CConvertDlg] +Type=0 +HeaderFile=ConvertDlg.h +ImplementationFile=ConvertDlg.cpp +BaseClass=CDialog +Filter=D +LastObject=IDC_XTITLE +VirtualFilter=dWC + +[CLS:CPrefDlg] +Type=0 +HeaderFile=PrefDlg.h +ImplementationFile=PrefDlg.cpp +BaseClass=CDialog +Filter=D +VirtualFilter=dWC +LastObject=CPrefDlg + +[DLG:IDD_FIND] +Type=1 +Class=CFindDlg +ControlCount=11 +Control1=IDC_COMBO1,combobox,1344339970 +Control2=IDC_FCOMBO,combobox,1344339971 +Control3=IDC_RADIO1,button,1342373897 +Control4=IDC_RADIO2,button,1342242825 +Control5=IDC_CHECK1,button,1342373891 +Control6=IDC_CHECK2,button,1342373891 +Control7=ID_EDIT_FIND_NEXT,button,1342242817 +Control8=IDCANCEL,button,1342242816 +Control9=IDC_STATIC,static,1342177280 +Control10=IDC_STATIC,button,1342177287 +Control11=IDC_STATIC,button,1342177287 + +[CLS:CFindDlg] +Type=0 +HeaderFile=FindDlg.h +ImplementationFile=FindDlg.cpp +BaseClass=CDialog +Filter=D +LastObject=IDC_FCOMBO +VirtualFilter=dWC + +[CLS:CTBComboBox] +Type=0 +HeaderFile=ComboBar.h +ImplementationFile=ComboBar.cpp +BaseClass=CComboBox +Filter=W +LastObject=CTBComboBox +VirtualFilter=cWC + +[CLS:CComboToolBar] +Type=0 +HeaderFile=combobar.h +ImplementationFile=combobar.cpp +BaseClass=CToolBarEx +LastObject=CComboToolBar + +[CLS:CProgDlg] +Type=0 +HeaderFile=ProgDlg.h +ImplementationFile=ProgDlg.cpp +BaseClass=CDialog +Filter=D +VirtualFilter=dWC +LastObject=CProgDlg + +[DLG:IDD_COLPAGE] +Type=1 +Class=CColPage +ControlCount=99 +Control1=IDC_CLNAME,edit,1350631552 +Control2=IDC_SPINCLNAME,msctls_updown32,1342177334 +Control3=IDC_CFNAME,edit,1350631552 +Control4=IDC_SPINCFNAME,msctls_updown32,1342177334 +Control5=IDC_CMI,edit,1350631552 +Control6=IDC_SPINCMI,msctls_updown32,1342177334 +Control7=IDC_CTITLE,edit,1350631552 +Control8=IDC_SPINCTITLE,msctls_updown32,1342177334 +Control9=IDC_CADD1,edit,1350631552 +Control10=IDC_SPINCADD1,msctls_updown32,1342177334 +Control11=IDC_CADD2,edit,1350631552 +Control12=IDC_SPINCADD2,msctls_updown32,1342177334 +Control13=IDC_CCITY,edit,1350631552 +Control14=IDC_SPINCCITY,msctls_updown32,1342177334 +Control15=IDC_CCOUNTRY,edit,1350631552 +Control16=IDC_SPINCCOUNTRY,msctls_updown32,1342177334 +Control17=IDC_CSTATE,edit,1350631552 +Control18=IDC_SPINCSTATE,msctls_updown32,1342177334 +Control19=IDC_CZIP,edit,1350631552 +Control20=IDC_SPINCZIP,msctls_updown32,1342177334 +Control21=IDC_CCOMP,edit,1350631552 +Control22=IDC_SPINCCOMP,msctls_updown32,1342177334 +Control23=IDC_CDEPT,edit,1350631552 +Control24=IDC_SPINCDEPT,msctls_updown32,1342177334 +Control25=IDC_CPOSN,edit,1350631552 +Control26=IDC_SPINCPOSN,msctls_updown32,1342177334 +Control27=IDC_CMGR,edit,1350631552 +Control28=IDC_SPINCMGR,msctls_updown32,1342177334 +Control29=IDC_CCADD1,edit,1350631552 +Control30=IDC_SPINCCADD1,msctls_updown32,1342177334 +Control31=IDC_CCADD2,edit,1350631552 +Control32=IDC_SPINCCADD2,msctls_updown32,1342177334 +Control33=IDC_CHOMEP,edit,1350631552 +Control34=IDC_SPINCHOMEP,msctls_updown32,1342177334 +Control35=IDC_CHOMEPX,edit,1350631552 +Control36=IDC_SPINCHOMEPX,msctls_updown32,1342177334 +Control37=IDC_CWORKP,edit,1350631552 +Control38=IDC_SPINCWORKP,msctls_updown32,1342177334 +Control39=IDC_CWORKPX,edit,1350631552 +Control40=IDC_SPINCWORKPX,msctls_updown32,1342177334 +Control41=IDC_CCELL,edit,1350631552 +Control42=IDC_SPINCCELL,msctls_updown32,1342177334 +Control43=IDC_CCELLX,edit,1350631552 +Control44=IDC_SPINCCELLX,msctls_updown32,1342177334 +Control45=IDC_CPAGER,edit,1350631552 +Control46=IDC_SPINCPAGER,msctls_updown32,1342177334 +Control47=IDC_CPAGERC,edit,1350631552 +Control48=IDC_SPINCPAGERC,msctls_updown32,1342177334 +Control49=IDC_CPAGERX,edit,1350631552 +Control50=IDC_SPINCPAGERX,msctls_updown32,1342177334 +Control51=IDC_CFAX,edit,1350631552 +Control52=IDC_SPINCFAX,msctls_updown32,1342177334 +Control53=IDC_CFAXX,edit,1350631552 +Control54=IDC_SPINCFAXX,msctls_updown32,1342177334 +Control55=IDC_CEMAIL1,edit,1350631552 +Control56=IDC_SPINCEMAIL1,msctls_updown32,1342177334 +Control57=IDC_CEMAIL2,edit,1350631552 +Control58=IDC_SPINCEMAIL2,msctls_updown32,1342177334 +Control59=IDC_CWEB1,edit,1350631552 +Control60=IDC_SPINCWEB1,msctls_updown32,1342177334 +Control61=IDC_CWEB2,edit,1350631552 +Control62=IDC_SPINCWEB2,msctls_updown32,1342177334 +Control63=IDC_STATIC,static,1342308352 +Control64=IDC_STATIC,static,1342308352 +Control65=IDC_STATIC,static,1342308352 +Control66=IDC_STATIC,static,1342308352 +Control67=IDC_STATIC,static,1342308352 +Control68=IDC_STATIC,static,1342308352 +Control69=IDC_STATIC,static,1342308352 +Control70=IDC_STATIC,static,1342308352 +Control71=IDC_STATIC,static,1342308352 +Control72=IDC_STATIC,static,1342308352 +Control73=IDC_STATIC,static,1342308352 +Control74=IDC_STATIC,static,1342308352 +Control75=IDC_STATIC,static,1342308352 +Control76=IDC_STATIC,static,1342308352 +Control77=IDC_STATIC,static,1342308352 +Control78=IDC_STATIC,static,1342308352 +Control79=IDC_STATIC,static,1342308352 +Control80=IDC_STATIC,static,1342308352 +Control81=IDC_STATIC,static,1342308352 +Control82=IDC_STATIC,static,1342308352 +Control83=IDC_STATIC,static,1342308352 +Control84=IDC_STATIC,static,1342308352 +Control85=IDC_STATIC,static,1342308352 +Control86=IDC_STATIC,static,1342308352 +Control87=IDC_STATIC,static,1342308352 +Control88=IDC_STATIC,static,1342308352 +Control89=IDC_STATIC,static,1342308352 +Control90=IDC_STATIC,static,1342308352 +Control91=IDC_STATIC,static,1342308352 +Control92=IDC_STATIC,static,1342308352 +Control93=IDC_STATIC,static,1342308352 +Control94=IDC_STATIC,static,1342308353 +Control95=IDC_CNOTES,edit,1350631552 +Control96=IDC_SPINCNOTES,msctls_updown32,1342177334 +Control97=IDC_STATIC,static,1342308352 +Control98=IDC_RESETSIZE,button,1342242816 +Control99=IDC_STATIC,button,1342177287 + +[DLG:IDD_SETPAGE] +Type=1 +Class=CSetPage +ControlCount=34 +Control1=IDC_SETLASTFILE,button,1342242819 +Control2=IDC_SETSORT,button,1342242819 +Control3=IDC_SETCOL,button,1342242819 +Control4=IDC_SETPOS,button,1342242819 +Control5=IDC_SETIMP,button,1342242819 +Control6=IDC_SETEXP,button,1342242819 +Control7=IDC_SETWIN,button,1342242819 +Control8=IDC_SETDELETE,button,1342242819 +Control9=IDC_SETUSEMRU,button,1342242819 +Control10=IDC_SETMRU,edit,1350631552 +Control11=IDC_SPINSETMRU,msctls_updown32,1342177334 +Control12=IDC_SETTRAY,button,1342242819 +Control13=IDC_SETSTART,button,1342242819 +Control14=IDC_SETCITY,edit,1350631552 +Control15=IDC_SETSTATE,edit,1350631552 +Control16=IDC_SETCOUNTRY,edit,1350631552 +Control17=IDC_SETZIP,edit,1350631552 +Control18=IDC_SETPREFIX,edit,1350631552 +Control19=IDC_SETCOMP,edit,1350631552 +Control20=IDC_SETEMAIL,edit,1350631552 +Control21=IDC_SETWEB,edit,1350631552 +Control22=IDC_STATIC,button,1342177287 +Control23=IDC_STATIC,button,1342177287 +Control24=IDC_STATIC,static,1342177280 +Control25=IDC_STATIC,button,1342177287 +Control26=IDC_STATIC,static,1342308352 +Control27=IDC_STATIC,static,1342308352 +Control28=IDC_STATIC,static,1342308352 +Control29=IDC_STATIC,static,1342308352 +Control30=IDC_STATIC,static,1342308352 +Control31=IDC_STATIC,static,1342308352 +Control32=IDC_STATIC,static,1342308352 +Control33=IDC_STATIC,static,1342308352 +Control34=IDC_STATIC,button,1342177287 + +[CLS:CSetPage] +Type=0 +HeaderFile=SetPage.h +ImplementationFile=SetPage.cpp +BaseClass=CPropertyPage +Filter=D +LastObject=IDC_SETDELETE +VirtualFilter=idWC + +[CLS:CDefPage] +Type=0 +HeaderFile=DefPage.h +ImplementationFile=DefPage.cpp +BaseClass=CPropertyPage +Filter=D +LastObject=CDefPage +VirtualFilter=idWC + +[CLS:CColPage] +Type=0 +HeaderFile=ColPage.h +ImplementationFile=ColPage.cpp +BaseClass=CPropertyPage +Filter=D +LastObject=CColPage +VirtualFilter=idWC + +[CLS:CPrefPage] +Type=0 +HeaderFile=PrefPage.h +ImplementationFile=PrefPage.cpp +BaseClass=CPropertySheet +Filter=W +LastObject=CPrefPage + +[MNU:IDR_TRAYMENU] +Type=1 +Class=? +Command1=ID_TRAY_SHOW +Command2=ID_APP_PREFS +Command3=ID_APP_ABOUT +Command4=ID_HELP_INDEX +Command5=ID_TRAY_EXIT +Command6=ID_DIAL_HOME +Command7=ID_DIAL_WORK +Command8=ID_DIAL_PAGER +Command9=ID_DIAL_FAX +Command10=ID_DIAL_CELL +Command11=ID_EMAIL_ADD1 +Command12=ID_EMAIL_ADD2 +Command13=ID_URL1 +Command14=ID_URL2 +CommandCount=14 + +[MNU:IDR_CONTEXTMENU] +Type=1 +Class=? +Command1=ID_EDIT_FIND +Command2=ID_ENTRY_ADD +Command3=ID_ENTRY_EDIT +Command4=ID_ENTRY_DELETE +Command5=ID_ENTRY_COPY +Command6=ID_DIAL_HOME +Command7=ID_DIAL_WORK +Command8=ID_DIAL_PAGER +Command9=ID_DIAL_FAX +Command10=ID_DIAL_CELL +Command11=ID_EMAIL_ADD1 +Command12=ID_EMAIL_ADD2 +Command13=ID_URL1 +Command14=ID_URL2 +Command15=ID_APP_PREFS +CommandCount=15 + +[DLG:IDD_GETNEW] +Type=1 +Class=CGetNew +ControlCount=5 +Control1=IDC_NEWINFO,edit,1350631552 +Control2=IDC_ADDINFO,button,1342242819 +Control3=IDOK,button,1342242817 +Control4=IDCANCEL,button,1342242816 +Control5=IDC_STATIC,static,1342308352 + +[CLS:CGetNew] +Type=0 +HeaderFile=GetNew.h +ImplementationFile=GetNew.cpp +BaseClass=CDialog +Filter=D +VirtualFilter=dWC +LastObject=CGetNew + +[DLG:IDD_CPAGE] +Type=1 +Class=CPropComp +ControlCount=12 +Control1=IDC_COMP,edit,1350631552 +Control2=IDC_DEPT,edit,1350631552 +Control3=IDC_POSN,edit,1350631552 +Control4=IDC_MGR,edit,1350631552 +Control5=IDC_CADD1,edit,1350631552 +Control6=IDC_CADD2,edit,1350631552 +Control7=IDC_STATIC,static,1342177280 +Control8=IDC_STATIC,static,1342308352 +Control9=IDC_STATIC,static,1342308352 +Control10=IDC_STATIC,static,1342308352 +Control11=IDC_STATIC,static,1342308352 +Control12=IDC_STATIC,static,1342308352 + +[CLS:CPropComp] +Type=0 +HeaderFile=PropComp.h +ImplementationFile=PropComp.cpp +BaseClass=CPropertyPage +Filter=D +VirtualFilter=idWC +LastObject=CPropComp + +[CLS:CMyHeaderCtrl] +Type=0 +HeaderFile=MyHeaderCtrl.h +ImplementationFile=MyHeaderCtrl.cpp +BaseClass=CHeaderCtrl +Filter=W +LastObject=CMyHeaderCtrl + +[CLS:CHyperLink] +Type=0 +HeaderFile=HyperLink.h +ImplementationFile=HyperLink.cpp +BaseClass=CStatic +Filter=W +LastObject=CHyperLink + +[DLG:IDD_ORDPAGE] +Type=1 +Class=COrdPage +ControlCount=4 +Control1=IDC_COLBOX,listbox,1352732673 +Control2=IDC_COLUP,button,1342242816 +Control3=IDC_COLDOWN,button,1342242816 +Control4=IDC_RESETCOL,button,1342242816 + +[CLS:COrdPage] +Type=0 +HeaderFile=OrdPage.h +ImplementationFile=OrdPage.cpp +BaseClass=CPropertyPage +Filter=D +VirtualFilter=idWC +LastObject=IDC_RESETCOL + diff --git a/CB32.cpp b/CB32.cpp new file mode 100644 index 0000000..bd7cb5c --- /dev/null +++ b/CB32.cpp @@ -0,0 +1,276 @@ +// CB32.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "CB32.h" +#include "ComboBar.h" +#include "MainFrm.h" +#include "CB32Doc.h" +#include "CB32View.h" +#include "HyperLink.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CCB32App + +BEGIN_MESSAGE_MAP(CCB32App, CWinApp) + //{{AFX_MSG_MAP(CCB32App) + ON_COMMAND(ID_APP_ABOUT, OnAppAbout) + ON_COMMAND(ID_HELP_INDEX, OnHelpIndex) + //}}AFX_MSG_MAP + // Standard file based document commands + ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) + ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) + // Standard print setup command + ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CCB32App construction + +CCB32App::CCB32App() +{ + m_inStart = TRUE; +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CCB32App object + +CCB32App theApp; + +///////////////////////////////////////////////////////////////////////////// +// CCB32App initialization + +BOOL CCB32App::InitInstance() +{ + // find the location of the exe from Help File Path + CString sHelp, sIni; + sHelp = m_pszHelpFilePath; + sIni = sHelp.Left(sHelp.ReverseFind('.')); + sIni += ".INI"; + free((void*)m_pszProfileName); + m_pszProfileName = _tcsdup((LPCSTR)sIni); + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#else + Enable3dControlsStatic(); // Call this when linking to MFC statically +#endif + + // Load standard INI file options (including MRU) + if (GetProfileInt(_T("Preferences"),_T("UseMRU"),1)) + LoadStdProfileSettings(GetProfileInt(_T("Preferences"), + _T("NumMRU"),2)); + else + LoadStdProfileSettings(0); + + // Register the application's document templates. Document templates + // serve as the connection between documents, frame windows and views. + + CSingleDocTemplate* pDocTemplate; + pDocTemplate = new CSingleDocTemplate( + IDR_MAINFRAME, + RUNTIME_CLASS(CCB32Doc), + RUNTIME_CLASS(CMainFrame), // main SDI frame window + RUNTIME_CLASS(CCB32View)); + AddDocTemplate(pDocTemplate); + + // Enable DDE Execute open + EnableShellOpen(); + RegisterShellFileTypes(TRUE); + + // Parse command line for standard shell commands, DDE, file open + CCommandLineInfo cmdInfo; + ParseCommandLine(cmdInfo); + + // Are we starting minimized? + theApp.m_nCmdShow = !GetProfileInt(_T("Preferences"),_T("StartMinimized"),0); + + if (!ProcessShellCommand(cmdInfo)) + return FALSE; + + // set flag for status messages - AFTER ProcessShellCommand + m_inStart = FALSE; + + // Enable drag/drop open + m_pMainWnd->DragAcceptFiles(); + + // Force immediate refresh + AfxGetMainWnd()->UpdateWindow(); + + // grab last document + if (m_lpCmdLine[0] == '\0') + { + // Open file name saved in private INI file. + if (GetProfileInt(_T("Preferences"),_T("UseLastBook"),0)) + { + CString strDocPath = GetDocPathFromIniFile(); + if (!strDocPath.IsEmpty()) + { + SetStatusMsg(IDS_LOADING); + theApp.m_nCmdShow = !GetProfileInt(_T("Preferences"),_T("StartMinimized"),0); + OpenDocumentFile(strDocPath); + } + } + } + + return TRUE; +} + +int CCB32App::ExitInstance() +{ + int nReturn = CWinApp::ExitInstance(); + //free((void*)m_pszExeName); + //free((void*)m_pszAppName); + //free((void*)m_pszHelpFilePath); + //free((void*)m_pszProfileName); + + return nReturn; +} + +///////////////////////////////////////////////////////////////////////////// +// CAboutDlg dialog used for App About + +class CAboutDlg : public CDialog +{ +public: + CAboutDlg(); + +// Dialog Data + //{{AFX_DATA(CAboutDlg) + enum { IDD = IDD_ABOUTBOX }; + CHyperLink m_WebLink; + CHyperLink m_HyperLink; + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CAboutDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + //{{AFX_MSG(CAboutDlg) + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) +{ + //{{AFX_DATA_INIT(CAboutDlg) + //}}AFX_DATA_INIT +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CAboutDlg) + DDX_Control(pDX, IDC_MYWEB, m_WebLink); + DDX_Control(pDX, IDC_MYEMAIL, m_HyperLink); + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) + //{{AFX_MSG_MAP(CAboutDlg) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +// App command to run the dialog +void CCB32App::OnAppAbout() +{ + CAboutDlg aboutDlg; + aboutDlg.DoModal(); +} + +BOOL CAboutDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + m_HyperLink.SetURL(_T("mailto:tengel@sonic.net")); + m_HyperLink.SetColours(m_HyperLink.GetLinkColour(), RGB(255,0,0)); + m_HyperLink.SetUnderline(FALSE); + m_HyperLink.SetLinkCursor(AfxGetApp()->LoadCursor(IDC_HAND1)); + + m_WebLink.SetURL(_T("http://www.sonic.net/~tengel/ContactBook")); + m_WebLink.SetColours(m_HyperLink.GetLinkColour(), RGB(255,0,0)); + m_WebLink.SetUnderline(FALSE); + m_WebLink.SetLinkCursor(AfxGetApp()->LoadCursor(IDC_HAND1)); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +///////////////////////////////////////////////////////////////////////////// +// CCB32App commands + +///////////////////////////////////////////////////////////////////////////// +// INI file implementation + +static TCHAR BASED_CODE szIniFileSection[] = _T("AddressBookInUse"); +static TCHAR BASED_CODE szIniFileEntry[] = _T("File"); + +void CCB32App::UpdateIniFileWithDocPath(LPCTSTR lpszPathName) +{ + WriteProfileString(szIniFileSection, szIniFileEntry, + lpszPathName); +} + +CString CCB32App::GetDocPathFromIniFile() +{ + return GetProfileString(szIniFileSection, szIniFileEntry, NULL); +} + +void CCB32App::SetStatusMsg(UINT umsg) +{ + CString strTemp; + if (!strTemp.LoadString(umsg)) + return; + SetStatusMsg(strTemp); +} + +void CCB32App::SetStatusMsg(CString msg) +{ + if (!m_inStart) + { + CStatusBar& statusBar = ((CMainFrame *)m_pMainWnd)->GetStatusBar(); + statusBar.SetPaneText(0, msg, TRUE); + AfxGetMainWnd()->UpdateWindow(); + } +} + +void CCB32App::OnHelpIndex() +{ + CWinApp::OnHelpIndex(); +} + +BOOL CCB32App::OnIdle(LONG lCount) +{ + // call the base class + BOOL bBaseIdle = CWinApp::OnIdle(lCount); + + BOOL bMoreIdle = TRUE; + if (lCount == 0) + { + // more important idle time processing + } + else if (lCount == 100) + { + // less important idle time processing + } + else if (lCount == 1000) + { + // occasional tasks during idle + bMoreIdle = bBaseIdle; + } + + // return FALSE when there is no more idle processing to do + + return bMoreIdle; +} diff --git a/CB32.h b/CB32.h new file mode 100644 index 0000000..aa21a59 --- /dev/null +++ b/CB32.h @@ -0,0 +1,69 @@ +// CB32.h : main header file for the CB32 application +// + +#if !defined(AFX_CB32_H__20BFD1E7_4F52_11D1_AF86_000000000000__INCLUDED_) +#define AFX_CB32_H__20BFD1E7_4F52_11D1_AF86_000000000000__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols +// #include // why not... + +// application defines +#define COMBO_HEIGHT 100 // width of edit control for combobox +#define COMBO_WIDTH 160 // drop down height +#define HISTORY_COUNT 10 // number of entries for the last search selections +#define TIMER_ID 2 // timer ID for clock on status bar + +///////////////////////////////////////////////////////////////////////////// +// CCB32App: +// See CB32.cpp for the implementation of this class +// + +class CCB32App : public CWinApp +{ +public: + virtual BOOL OnIdle(LONG lCount); + CCB32App(); + +// Operations +public: + void UpdateIniFileWithDocPath(LPCTSTR lpszPathName); + void SetStatusMsg(UINT umsg); + void SetStatusMsg(CString msg); + +protected: + BOOL m_inStart; + CString GetDocPathFromIniFile(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CCB32App) + public: + virtual BOOL InitInstance(); + virtual int ExitInstance(); + //}}AFX_VIRTUAL + +// Implementation + + //{{AFX_MSG(CCB32App) + afx_msg void OnAppAbout(); + afx_msg void OnHelpIndex(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +extern CCB32App theApp; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_CB32_H__20BFD1E7_4F52_11D1_AF86_000000000000__INCLUDED_) diff --git a/CB32.rc b/CB32.rc new file mode 100644 index 0000000..9b1ca4a --- /dev/null +++ b/CB32.rc @@ -0,0 +1,1229 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif\r\n" + "#include ""res\\CB32.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#include ""afxprint.rc"" // printing/print preview resources\r\n" + "#endif\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,2 + PRODUCTVERSION 1,0,0,2 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "LCNSoft\0" + VALUE "FileDescription", "ContactBook Application\0" + VALUE "FileVersion", "1, 0, 0, 2\0" + VALUE "InternalName", "CB32\0" + VALUE "LegalCopyright", "Copyright (C) 1997\0" + VALUE "OriginalFilename", "CB32.EXE\0" + VALUE "ProductName", "ContactBook\0" + VALUE "ProductVersion", "1, 0, 0, 2\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 161 + TOPMARGIN, 5 + BOTTOMMARGIN, 100 + END + + IDD_COLPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 228 + TOPMARGIN, 7 + BOTTOMMARGIN, 162 + END + + IDD_CONVERT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 243 + TOPMARGIN, 7 + BOTTOMMARGIN, 207 + END + + IDD_CPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 84 + END + + IDD_GETNEW, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 79 + END + + IDD_SETPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 228 + TOPMARGIN, 7 + BOTTOMMARGIN, 162 + END + + IDD_ORDPAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 228 + TOPMARGIN, 7 + BOTTOMMARGIN, 162 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE +BEGIN + "C", ID_ENTRY_COPY, VIRTKEY, CONTROL, NOINVERT + "F", ID_EDIT_FIND, VIRTKEY, CONTROL, NOINVERT + "N", ID_FILE_NEW, VIRTKEY, CONTROL, NOINVERT + "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT + "P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT + "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT + "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT + VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT + VK_DELETE, ID_ENTRY_DELETE, VIRTKEY, NOINVERT + VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT + VK_F1, ID_HELP_INDEX, VIRTKEY, NOINVERT + VK_F1, ID_CONTEXT_HELP, VIRTKEY, SHIFT, NOINVERT + VK_F3, ID_VIEW_FIND_NEXT, VIRTKEY, NOINVERT + VK_F3, ID_EDIT_FIND_COMBO, VIRTKEY, ALT, NOINVERT + VK_F6, ID_NEXT_PANE, VIRTKEY, NOINVERT + VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT, NOINVERT + VK_INSERT, ID_ENTRY_ADD, VIRTKEY, NOINVERT + VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT + VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, ID_ENTRY_EDIT, VIRTKEY, NOINVERT + "X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT + "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 166, 105 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About ContactBook" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,11,16,20,20 + LTEXT "ContactBook Version 1.2",IDC_STATIC,43,10,80,8, + SS_NOPREFIX + CTEXT "Email: tengel@sonic.net",IDC_MYEMAIL,44,52,77,8, + SS_CENTERIMAGE | NOT WS_GROUP + DEFPUSHBUTTON "OK",IDOK,59,83,46,14,WS_GROUP + LTEXT "Troy Engel",IDC_STATIC,65,31,35,8 + LTEXT "by",IDC_STATIC,78,20,8,8 + CTEXT "http://www.sonic.net/~tengel/ContactBook",IDC_MYWEB,13, + 64,140,8,SS_CENTERIMAGE + GROUPBOX "",IDC_STATIC,8,44,149,32 +END + +IDD_APAGE DIALOG DISCARDABLE 0, 0, 210, 90 +STYLE WS_CHILD | WS_CAPTION +CAPTION "Addresses" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_FNAME,44,4,106,12,ES_AUTOHSCROLL + EDITTEXT IDC_MI,179,4,20,12,ES_AUTOHSCROLL + EDITTEXT IDC_LNAME,44,17,106,12,ES_AUTOHSCROLL + EDITTEXT IDC_TITLE,179,17,20,12,ES_AUTOHSCROLL + EDITTEXT IDC_ADD1,44,34,156,12,ES_AUTOHSCROLL + EDITTEXT IDC_ADD2,44,47,156,12,ES_AUTOHSCROLL + EDITTEXT IDC_CITY,44,60,81,12,ES_AUTOHSCROLL + EDITTEXT IDC_STATE,148,60,23,12,ES_AUTOHSCROLL + EDITTEXT IDC_ZIPCODE,44,73,46,12,ES_AUTOHSCROLL + EDITTEXT IDC_COUNTRY,148,73,52,12,ES_AUTOHSCROLL + LTEXT "First Name",IDC_STATIC1,7,7,34,9 + LTEXT "Last Name",IDC_STATIC,7,19,34,10 + LTEXT "Address 1",IDC_STATIC,8,36,32,8 + LTEXT "Address 2",IDC_STATIC,8,49,31,9 + LTEXT "City",IDC_STATIC,7,62,13,8 + LTEXT "State",IDC_STATIC,128,63,17,8 + LTEXT "Zip Code",IDC_STATIC,8,75,32,8 + LTEXT "Country",IDC_STATIC,121,75,25,8 + LTEXT "M.I.",IDC_STATIC,159,7,14,8 + LTEXT "Title",IDC_STATIC,159,19,16,8 +END + +IDD_COLPAGE DIALOG DISCARDABLE 0, 0, 235, 169 +STYLE WS_CHILD | WS_CAPTION +CAPTION "Column Widths" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_CLNAME,7,7,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCLNAME,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,7,9,12 + EDITTEXT IDC_CFNAME,7,20,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCFNAME,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,20,9, + 12 + EDITTEXT IDC_CMI,7,33,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCMI,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,33,9, + 12 + EDITTEXT IDC_CTITLE,7,46,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCTITLE,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,46,9, + 12 + EDITTEXT IDC_CADD1,7,59,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCADD1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,59,9, + 12 + EDITTEXT IDC_CADD2,7,72,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCADD2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,72,9, + 12 + EDITTEXT IDC_CCITY,7,85,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCCITY,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,85,9, + 12 + EDITTEXT IDC_CCOUNTRY,7,98,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCCOUNTRY,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,23,98,9,12 + EDITTEXT IDC_CSTATE,7,111,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCSTATE,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,111,9, + 12 + EDITTEXT IDC_CZIP,7,124,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCZIP,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,124,9, + 12 + EDITTEXT IDC_CCOMP,7,137,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCCOMP,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,137,9, + 12 + EDITTEXT IDC_CDEPT,7,150,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCDEPT,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,23,150,9, + 12 + EDITTEXT IDC_CPOSN,83,7,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCPOSN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,7,9,12 + EDITTEXT IDC_CMGR,83,20,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCMGR,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,20,9, + 12 + EDITTEXT IDC_CCADD1,83,33,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCCADD1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,33,9, + 12 + EDITTEXT IDC_CCADD2,83,46,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCCADD2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,46,9, + 12 + EDITTEXT IDC_CHOMEP,83,58,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCHOMEP,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,58,9, + 12 + EDITTEXT IDC_CHOMEPX,83,71,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCHOMEPX,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,99,71,9,12 + EDITTEXT IDC_CWORKP,83,84,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCWORKP,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,84,9, + 12 + EDITTEXT IDC_CWORKPX,83,97,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCWORKPX,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,99,97,9,12 + EDITTEXT IDC_CCELL,83,111,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCCELL,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,111,9, + 12 + EDITTEXT IDC_CCELLX,83,124,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCCELLX,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,124,9, + 12 + EDITTEXT IDC_CPAGER,83,137,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCPAGER,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,99,137,9, + 12 + EDITTEXT IDC_CPAGERC,83,150,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCPAGERC,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,99,150,9,12 + EDITTEXT IDC_CPAGERX,161,7,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCPAGERX,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,177,7,9,12 + EDITTEXT IDC_CFAX,161,20,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCFAX,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,177,20,9, + 12 + EDITTEXT IDC_CFAXX,161,33,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCFAXX,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,177,33,9, + 12 + EDITTEXT IDC_CEMAIL1,161,46,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCEMAIL1,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,177,46,9,12 + EDITTEXT IDC_CEMAIL2,161,58,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCEMAIL2,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,177,58,9,12 + EDITTEXT IDC_CWEB1,161,71,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCWEB1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,177,71,9, + 12 + EDITTEXT IDC_CWEB2,161,84,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCWEB2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,177,84,9, + 12 + LTEXT "Column 1",IDC_STATIC,38,9,30,8 + LTEXT "Column 2",IDC_STATIC,38,23,30,8 + LTEXT "Column 3",IDC_STATIC,38,35,30,8 + LTEXT "Column 4",IDC_STATIC,38,48,30,8 + LTEXT "Column 5",IDC_STATIC,38,61,30,8 + LTEXT "Column 6",IDC_STATIC,38,74,30,8 + LTEXT "Column 7",IDC_STATIC,38,87,30,8 + LTEXT "Column 8",IDC_STATIC,38,100,30,8 + LTEXT "Column 9",IDC_STATIC,38,113,30,8 + LTEXT "Column 10",IDC_STATIC,38,126,34,8 + LTEXT "Column 17",IDC_STATIC,114,60,34,8 + LTEXT "Column 18",IDC_STATIC,114,73,34,8 + LTEXT "Column 19",IDC_STATIC,114,87,34,8 + LTEXT "Column 20",IDC_STATIC,114,100,34,8 + LTEXT "Column 21",IDC_STATIC,114,113,34,8 + LTEXT "Column 22",IDC_STATIC,114,126,34,8 + LTEXT "Column 23",IDC_STATIC,114,139,34,8 + LTEXT "Column 24",IDC_STATIC,114,152,34,8 + LTEXT "Column 25",IDC_STATIC,192,9,34,8 + LTEXT "Column 26",IDC_STATIC,192,22,34,8 + LTEXT "Column 27",IDC_STATIC,192,34,34,8 + LTEXT "Column 28",IDC_STATIC,192,47,34,8 + LTEXT "Column 29",IDC_STATIC,192,60,34,8 + LTEXT "Column 30",IDC_STATIC,192,74,34,8 + LTEXT "Column 31",IDC_STATIC,192,87,34,8 + LTEXT "Column 11",IDC_STATIC,38,139,34,8 + LTEXT "Column 12",IDC_STATIC,38,152,34,8 + LTEXT "Column 13",IDC_STATIC,114,9,34,8 + LTEXT "Column 14",IDC_STATIC,114,22,34,8 + LTEXT "Column 15",IDC_STATIC,114,34,34,8 + LTEXT "Column 16",IDC_STATIC,114,47,34,8 + CTEXT "Set column to zero to hide",IDC_STATIC,164,122,57,17 + EDITTEXT IDC_CNOTES,161,98,26,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINCNOTES,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,177,98,9, + 12 + LTEXT "Column 32",IDC_STATIC,192,100,34,8 + PUSHBUTTON "Reset",IDC_RESETSIZE,162,148,61,14 + GROUPBOX "Hint",IDC_STATIC,161,113,62,30 +END + +IDD_CONVERT DIALOG DISCARDABLE 0, 0, 250, 214 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Select Fields" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,193,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,193,25,50,14 + EDITTEXT IDC_XLNAME,7,7,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXLNAME,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,7,9,12 + EDITTEXT IDC_XFNAME,7,20,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXFNAME,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,20,9, + 12 + EDITTEXT IDC_XMI,7,33,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXMI,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,33,9, + 12 + EDITTEXT IDC_XTITLE,7,46,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXTITLE,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,46,9, + 12 + EDITTEXT IDC_XADD1,7,59,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXADD1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,59,9, + 12 + EDITTEXT IDC_XADD2,7,72,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXADD2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,72,9, + 12 + EDITTEXT IDC_XCITY,7,85,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXCITY,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,85,9, + 12 + EDITTEXT IDC_XCOUNTRY,7,98,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXCOUNTRY,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,19,98,9,12 + EDITTEXT IDC_XSTATE,7,111,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXSTATE,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,111,9, + 12 + EDITTEXT IDC_XZIP,7,124,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXZIP,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,124,9, + 12 + EDITTEXT IDC_XCOMP,7,137,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXCOMP,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,137,9, + 12 + EDITTEXT IDC_XDEPT,7,151,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXDEPT,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,19,151,9, + 12 + EDITTEXT IDC_XPOSN,96,7,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXPOSN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,7,9, + 12 + EDITTEXT IDC_XMGR,96,20,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXMGR,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,20,9, + 12 + EDITTEXT IDC_XCADD1,96,33,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXCADD1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,33,9, + 12 + EDITTEXT IDC_XCADD2,96,46,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXCADD2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,46,9, + 12 + EDITTEXT IDC_XHOMEP,96,59,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXHOMEP,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,59,9, + 12 + EDITTEXT IDC_XHOMEPX,96,72,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXHOMEPX,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,108,72,9,12 + EDITTEXT IDC_XWORKP,96,85,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXWORKP,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,85,9, + 12 + EDITTEXT IDC_XWORKPX,96,98,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXWORKPX,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,108,98,9,12 + EDITTEXT IDC_XCELL,96,111,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXCELL,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,111,9, + 12 + EDITTEXT IDC_XCELLX,96,124,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXCELLX,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,124,9, + 12 + EDITTEXT IDC_XPAGER,96,137,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXPAGER,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,137,9, + 12 + EDITTEXT IDC_XPAGERC,96,150,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXPAGERC,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,108,150,9,12 + EDITTEXT IDC_XPAGERX,180,59,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXPAGERX,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,192,59,9,12 + EDITTEXT IDC_XFAX,180,72,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXFAX,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,192,72,9, + 12 + EDITTEXT IDC_XFAXX,180,85,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXFAXX,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,192,85,9, + 12 + EDITTEXT IDC_XEMAIL1,180,98,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXEMAIL1,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,192,98,9,12 + EDITTEXT IDC_XEMAIL2,180,111,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXEMAIL2,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,192,111,9,12 + EDITTEXT IDC_XWEB1,180,124,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXWEB1,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,192,124,9, + 12 + EDITTEXT IDC_XWEB2,180,137,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXWEB2,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,192,137,9, + 12 + EDITTEXT IDC_XNOTES,180,150,22,12,ES_AUTOHSCROLL + CONTROL "Spin2",IDC_SPINXNOTES,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,192,150,9, + 12 + LTEXT "Last Name",IDC_STATIC,34,9,35,8 + LTEXT "First Name",IDC_STATIC,34,23,34,8 + LTEXT "Middle Initial",IDC_STATIC,34,36,40,8 + LTEXT "Title",IDC_STATIC,34,49,14,8 + LTEXT "Address 1",IDC_STATIC,34,61,32,8 + LTEXT "Address 2",IDC_STATIC,34,74,32,8 + LTEXT "City",IDC_STATIC,34,87,12,8 + LTEXT "Country",IDC_STATIC,34,100,25,8 + LTEXT "State",IDC_STATIC,34,113,18,8 + LTEXT "ZipCode",IDC_STATIC,34,127,28,8 + LTEXT "Company",IDC_STATIC,34,140,30,8 + LTEXT "Department",IDC_STATIC,34,153,38,8 + LTEXT "Position",IDC_STATIC,124,9,26,8 + LTEXT "Manager",IDC_STATIC,124,22,29,8 + LTEXT "Additional 1",IDC_STATIC,124,35,38,8 + LTEXT "Additional 2",IDC_STATIC,124,48,38,8 + LTEXT "Home Phone",IDC_STATIC,123,61,42,8 + LTEXT "Home Ext.",IDC_STATIC,123,74,34,8 + LTEXT "Work Phone",IDC_STATIC,123,86,41,8 + LTEXT "Work Ext.",IDC_STATIC,123,100,32,8 + LTEXT "Cell Phone",IDC_STATIC,123,113,35,8 + LTEXT "Cell Ext.",IDC_STATIC,123,126,26,8 + LTEXT "Pager",IDC_STATIC,123,139,20,8 + LTEXT "Pager Card",IDC_STATIC,123,152,36,8 + LTEXT "Pager Ext.",IDC_STATIC,207,61,34,8 + LTEXT "Fax Phone",IDC_STATIC,207,74,35,8 + LTEXT "Fax Ext.",IDC_STATIC,207,87,26,8 + LTEXT "Email 1",IDC_STATIC,207,100,24,8 + LTEXT "Email 2",IDC_STATIC,207,113,24,8 + LTEXT "Web 1",IDC_STATIC,207,126,22,8 + LTEXT "Web 2",IDC_STATIC,207,139,22,8 + LTEXT "Notes",IDC_STATIC,207,153,20,8 + EDITTEXT IDC_XLINE1,7,170,236,37,ES_MULTILINE | ES_READONLY | + WS_VSCROLL + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,166,236,1 +END + +IDD_CPAGE DIALOG DISCARDABLE 0, 0, 210, 90 +STYLE WS_CHILD | WS_CAPTION +CAPTION "Business" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_COMP,48,7,155,12,ES_AUTOHSCROLL + EDITTEXT IDC_DEPT,48,20,155,12,ES_AUTOHSCROLL + EDITTEXT IDC_POSN,48,33,155,12,ES_AUTOHSCROLL + EDITTEXT IDC_MGR,48,46,155,12,ES_AUTOHSCROLL + EDITTEXT IDC_CADD1,48,59,155,12,ES_AUTOHSCROLL + EDITTEXT IDC_CADD2,48,72,155,12,ES_AUTOHSCROLL + LTEXT "Company",IDC_STATIC,7,9,30,8,NOT WS_GROUP + LTEXT "Department",IDC_STATIC,7,22,38,8 + LTEXT "Position",IDC_STATIC,7,35,26,8 + LTEXT "Manager",IDC_STATIC,7,48,29,8 + LTEXT "Additional 1",IDC_STATIC,7,61,38,8 + LTEXT "Additional 2",IDC_STATIC,7,75,38,8 +END + +IDD_FIND DIALOG DISCARDABLE 0, 0, 228, 89 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Find" +FONT 8, "MS Sans Serif" +BEGIN + COMBOBOX IDC_COMBO1,48,7,117,74,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + COMBOBOX IDC_FCOMBO,12,42,61,47,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP + CONTROL "&Up",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | + WS_TABSTOP,94,38,29,10 + CONTROL "&Down",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON | + WS_TABSTOP,94,51,42,10 + CONTROL "Match &Case",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | + WS_GROUP | WS_TABSTOP,10,72,57,10 + CONTROL "&Start at Top of File",IDC_CHECK2,"Button", + BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,94,72,74,10 + DEFPUSHBUTTON "&Find Next",ID_EDIT_FIND_NEXT,172,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,172,24,50,14 + LTEXT "Fi&nd What:",IDC_STATIC,5,9,41,8,NOT WS_GROUP + GROUPBOX "Search Field",IDC_STATIC,5,27,75,38 + GROUPBOX "Direction",IDC_STATIC,89,27,75,38 +END + +IDD_GETNEW DIALOG DISCARDABLE 0, 0, 186, 86 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Empty Phone/Email/URL" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_NEWINFO,7,28,172,14,ES_AUTOHSCROLL + CONTROL "Add to currently selected address",IDC_ADDINFO,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,32,48,121,10 + DEFPUSHBUTTON "OK",IDOK,74,65,50,14 + PUSHBUTTON "Cancel",IDCANCEL,129,65,50,14 + LTEXT "This item is empty. Please enter the information you wish to have used:", + IDC_STATIC,7,7,161,19 +END + +IDD_NPAGE DIALOG DISCARDABLE 0, 0, 210, 90 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Notes" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_NOTES,14,9,180,70,ES_MULTILINE | ES_WANTRETURN +END + +IDD_OPAGE DIALOG DISCARDABLE 0, 0, 210, 90 +STYLE WS_CHILD | WS_CAPTION +CAPTION "Online" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "E-Mail 1",IDC_STATIC,12,9,27,8 + LTEXT "E-Mail 2",IDC_STATIC,12,21,26,8 + LTEXT "Web Page 1",IDC_STATIC,12,35,45,9 + LTEXT "Web Page 2",IDC_STATIC,12,60,45,9 + EDITTEXT IDC_EMAIL1,43,6,152,12,ES_AUTOHSCROLL + EDITTEXT IDC_EMAIL2,43,19,152,12,ES_AUTOHSCROLL + EDITTEXT IDC_WEB1,11,45,184,12,ES_AUTOHSCROLL + EDITTEXT IDC_WEB2,11,71,184,12,ES_AUTOHSCROLL +END + +IDD_PPAGE DIALOG DISCARDABLE 0, 0, 210, 90 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Phones" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_HPHONE,61,5,75,12,ES_AUTOHSCROLL + EDITTEXT IDC_HPHONEX,162,5,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_WPHONE,61,18,75,12,ES_AUTOHSCROLL + EDITTEXT IDC_WPHONEX,162,18,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_PAGER,61,31,75,12,ES_AUTOHSCROLL + EDITTEXT IDC_PAGERX,162,31,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_PAGERC,61,44,75,12,ES_AUTOHSCROLL + EDITTEXT IDC_FAX,61,57,75,12,ES_AUTOHSCROLL + EDITTEXT IDC_FAXX,162,57,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_CELLULAR,61,70,75,12,ES_AUTOHSCROLL + EDITTEXT IDC_CELLULARX,162,70,40,12,ES_AUTOHSCROLL + LTEXT "Home Phone",IDC_STATIC,9,8,43,8 + LTEXT "Work Phone",IDC_STATIC,9,20,43,8 + LTEXT "Pager Phone",IDC_STATIC,9,33,43,8 + LTEXT "Fax Phone",IDC_STATIC,9,59,43,8 + LTEXT "Pager Code",IDC_STATIC,9,46,43,8 + LTEXT "Cellular Phone",IDC_STATIC,9,72,47,8 + LTEXT "ext.",IDC_STATIC,148,8,12,8 + LTEXT "ext.",IDC_STATIC,148,20,12,8 + LTEXT "ext.",IDC_STATIC,148,33,12,8 + LTEXT "ext.",IDC_STATIC,148,59,12,8 + LTEXT "ext.",IDC_STATIC,148,72,12,8 +END + +IDD_SETPAGE DIALOG DISCARDABLE 0, 0, 235, 169 +STYLE WS_POPUP | WS_CAPTION +CAPTION "General Settings" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Last Address Book",IDC_SETLASTFILE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,14,16,75,10 + CONTROL "Last Sort Used",IDC_SETSORT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,14,26,63,10 + CONTROL "Column Widths",IDC_SETCOL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,14,36,63,10 + CONTROL "Column Positions",IDC_SETPOS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,14,46,69,10 + CONTROL "Import Settings",IDC_SETIMP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,14,56,63,10 + CONTROL "Export Settings",IDC_SETEXP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,14,66,63,10 + CONTROL "Window Size",IDC_SETWIN,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,14,76,57,10 + CONTROL "Confirm Deletes",IDC_SETDELETE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,14,86,65,10 + CONTROL "Show on File Menu",IDC_SETUSEMRU,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,14,110,77,10 + EDITTEXT IDC_SETMRU,13,122,22,12,ES_AUTOHSCROLL + CONTROL "Spin1",IDC_SPINSETMRU,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,25,122,9, + 12 + CONTROL "Minimize to Tray",IDC_SETTRAY,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,43,149,67,10 + CONTROL "Start Minimized",IDC_SETSTART,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,129,149,63,10 + EDITTEXT IDC_SETCITY,141,18,80,12,ES_AUTOHSCROLL + EDITTEXT IDC_SETSTATE,141,32,24,12,ES_AUTOHSCROLL + EDITTEXT IDC_SETCOUNTRY,141,46,52,12,ES_AUTOHSCROLL + EDITTEXT IDC_SETZIP,141,60,46,12,ES_AUTOHSCROLL + EDITTEXT IDC_SETPREFIX,141,75,29,12,ES_AUTOHSCROLL + EDITTEXT IDC_SETCOMP,141,91,80,12,ES_AUTOHSCROLL + EDITTEXT IDC_SETEMAIL,127,107,94,12,ES_AUTOHSCROLL + EDITTEXT IDC_SETWEB,127,122,94,12,ES_AUTOHSCROLL + GROUPBOX "Remember These Items",IDC_STATIC,7,7,88,92 + GROUPBOX "Recent Address Books",IDC_STATIC,7,101,88,38 + LTEXT "Address Books",IDC_STATIC,38,124,48,8,NOT WS_GROUP + GROUPBOX "Default Data",IDC_STATIC,100,7,128,132 + LTEXT "City",IDC_STATIC,107,21,12,8 + LTEXT "State",IDC_STATIC,107,35,18,8 + LTEXT "Country",IDC_STATIC,107,49,25,8 + LTEXT "Zip Code",IDC_STATIC,107,63,30,8 + LTEXT "AreaCode",IDC_STATIC,107,78,32,8 + LTEXT "Company",IDC_STATIC,107,93,30,8 + LTEXT "Email",IDC_STATIC,107,109,18,8 + LTEXT "Web",IDC_STATIC,107,124,16,8 + GROUPBOX "",IDC_STATIC,7,141,221,21 +END + +IDD_ORDPAGE DIALOG DISCARDABLE 0, 0, 235, 169 +STYLE WS_POPUP | WS_CAPTION +CAPTION "Column Order" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX IDC_COLBOX,13,12,143,147,LBS_DISABLENOSCROLL | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Move Up",IDC_COLUP,168,44,50,14 + PUSHBUTTON "Move Down",IDC_COLDOWN,168,67,50,14 + PUSHBUTTON "Reset",IDC_RESETCOL,168,98,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "res\\CB32.ico" +IDR_CB32TYPE ICON DISCARDABLE "res\\CB32Doc.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_CONTEXTMENU MENU DISCARDABLE +BEGIN + POPUP "_CM_" + BEGIN + MENUITEM "&Find...", ID_EDIT_FIND + MENUITEM SEPARATOR + MENUITEM "&Add...", ID_ENTRY_ADD + MENUITEM "&Edit...", ID_ENTRY_EDIT + MENUITEM "&Delete", ID_ENTRY_DELETE + MENUITEM "&Copy", ID_ENTRY_COPY + MENUITEM SEPARATOR + POPUP "Dial" + BEGIN + MENUITEM "Home", ID_DIAL_HOME + MENUITEM "Work", ID_DIAL_WORK + MENUITEM "Pager", ID_DIAL_PAGER + MENUITEM "Fax", ID_DIAL_FAX + MENUITEM "Cellular", ID_DIAL_CELL + END + POPUP "Email" + BEGIN + MENUITEM "Address 1", ID_EMAIL_ADD1 + MENUITEM "Address 2", ID_EMAIL_ADD2 + END + POPUP "Web" + BEGIN + MENUITEM "URL 1", ID_URL1 + MENUITEM "URL 2", ID_URL2 + END + MENUITEM SEPARATOR + MENUITEM "&Preferences...", ID_APP_PREFS + END +END + +IDR_MAINFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&New\tCtrl+N", ID_FILE_NEW + MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN + MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE + MENUITEM "Save &As...", ID_FILE_SAVE_AS + MENUITEM SEPARATOR + POPUP "&Import" + BEGIN + MENUITEM "&Comma Delimited", ID_IMPORT_CSV + MENUITEM "&Tab Delimited", ID_IMPORT_TAB + END + POPUP "&Export" + BEGIN + MENUITEM "&Comma Delimited", ID_EXPORT_CSV + MENUITEM "&Tab Delimited", ID_EXPORT_TAB + END + MENUITEM SEPARATOR + MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED + MENUITEM SEPARATOR + MENUITEM "E&xit", ID_APP_EXIT + END + POPUP "&Edit" + BEGIN + MENUITEM "&Find...\tCtrl+F", ID_EDIT_FIND + MENUITEM "Find &Next\tF3", ID_VIEW_FIND_NEXT + MENUITEM SEPARATOR + MENUITEM "&Preferences...", ID_APP_PREFS + END + POPUP "&Address" + BEGIN + MENUITEM "&Add\tIns", ID_ENTRY_ADD + MENUITEM "&Edit\tEnter", ID_ENTRY_EDIT + MENUITEM "&Delete\tDel", ID_ENTRY_DELETE + MENUITEM "&Copy\tCtrl+C", ID_ENTRY_COPY + MENUITEM SEPARATOR + POPUP "Dial" + BEGIN + MENUITEM "Home", ID_DIAL_HOME + MENUITEM "Work", ID_DIAL_WORK + MENUITEM "Pager", ID_DIAL_PAGER + MENUITEM "Fax", ID_DIAL_FAX + MENUITEM "Cellular", ID_DIAL_CELL + END + POPUP "Email" + BEGIN + MENUITEM "Address 1", ID_EMAIL_ADD1 + MENUITEM "Address 2", ID_EMAIL_ADD2 + END + POPUP "Web" + BEGIN + MENUITEM "URL 1", ID_URL1 + MENUITEM "URL 2", ID_URL2 + END + END + POPUP "&View" + BEGIN + MENUITEM "&Toolbar", ID_VIEW_TOOLBAR + MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR + MENUITEM "&Flat Toolbar", ID_VIEW_FLATBAR + MENUITEM SEPARATOR + MENUITEM "Save &Window Size", ID_VIEW_WNDPOS + MENUITEM "Save C&olumn Widths", ID_VIEW_COLSET + MENUITEM "Save Column &Positions", ID_VIEW_COLPOS + END + POPUP "&Help" + BEGIN + MENUITEM "&Help Topics\tF1", ID_HELP_INDEX + MENUITEM SEPARATOR + MENUITEM "&About ContactBook", ID_APP_ABOUT + END +END + +IDR_TRAYMENU MENU DISCARDABLE +BEGIN + POPUP "_TM_" + BEGIN + MENUITEM "&Show", ID_TRAY_SHOW + MENUITEM SEPARATOR + MENUITEM "&Preferences", ID_APP_PREFS + MENUITEM "&About", ID_APP_ABOUT + MENUITEM "&Help", ID_HELP_INDEX + MENUITEM SEPARATOR + MENUITEM "E&xit", ID_TRAY_EXIT + END + POPUP "_DM_" + BEGIN + MENUITEM "Home", ID_DIAL_HOME + MENUITEM "Work", ID_DIAL_WORK + MENUITEM "Pager", ID_DIAL_PAGER + MENUITEM "Fax", ID_DIAL_FAX + MENUITEM "Cellular", ID_DIAL_CELL + END + POPUP "_EM_" + BEGIN + MENUITEM "Address 1", ID_EMAIL_ADD1 + MENUITEM "Address 2", ID_EMAIL_ADD2 + END + POPUP "_WM_" + BEGIN + MENUITEM "URL 1", ID_URL1 + MENUITEM "URL 2", ID_URL2 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Toolbar +// + +IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15 +BEGIN + BUTTON ID_FILE_NEW + BUTTON ID_FILE_OPEN + BUTTON ID_FILE_SAVE + SEPARATOR + BUTTON ID_ENTRY_ADD + BUTTON ID_ENTRY_EDIT + BUTTON ID_ENTRY_DELETE + BUTTON ID_ENTRY_COPY + SEPARATOR + BUTTON ID_EDIT_FIND + SEPARATOR + BUTTON ID_TBAR_DIAL + BUTTON ID_TBAR_EMAIL + BUTTON ID_TBAR_WEB + BUTTON ID_APP_PREFS + SEPARATOR + BUTTON ID_HELP_INDEX +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Cursor +// + +IDC_HAND1 CURSOR DISCARDABLE "res\\hand1.cur" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE PRELOAD DISCARDABLE +BEGIN + IDR_MAINFRAME "ContactBook\n\nContactBook\nContactBook Files (*.cbd)\n.CBD\nCB32.Document\nContactBook Document" + IDW_COMBO "Finds the specified text\nFind" + IDS_LNAME "Last Name" + IDS_FNAME "First Name" + IDS_MI "M.I." + IDS_TITLE "Title" + IDS_ADD1 "Address 1" + IDS_ADD2 "Address 2" + IDS_CITY "City" + IDS_COUNTRY "Country" + IDS_STATE "State" + IDS_ZIPCODE "ZipCode" + IDS_COMP "Company" + IDS_DEPT "Department" + IDS_POSN "Position" + IDS_MGR "Manager" +END + +STRINGTABLE PRELOAD DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "ContactBook" + AFX_IDS_IDLEMESSAGE "For Help, press F1" + AFX_IDS_HELPMODEMESSAGE "Select an object on which to get Help" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_INDICATOR_EXT "EXT" + ID_INDICATOR_CAPS "CAP" + ID_INDICATOR_NUM "NUM" + ID_INDICATOR_SCRL "SCRL" + ID_INDICATOR_OVR "OVR" + ID_INDICATOR_REC "REC" + ID_INDICATOR_CLOCK " " +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_FILE_NEW "Create a new address book\nNew" + ID_FILE_OPEN "Open an existing address book\nOpen" + ID_FILE_CLOSE "Close the active address book\nClose" + ID_FILE_SAVE "Save the active address book\nSave" + ID_FILE_SAVE_AS "Save the active address book with a new name\nSave As" + ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup" + ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup" + ID_FILE_PRINT "Print the active address book\nPrint" + ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview" + ID_FILE_SEND_MAIL "Send the active address book through email\nSend Mail" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_APP_ABOUT "Display program information, version number and copyright\nAbout" + ID_APP_EXIT "Quit the application; prompts to save address book\nExit" + ID_HELP_INDEX "Opens Help\nHelp Topics" + ID_HELP_FINDER "List Help topics\nHelp Topics" + ID_HELP_USING "Display instructions about how to use help\nHelp" + ID_CONTEXT_HELP "Display help for clicked on buttons, menus and windows\nHelp" + ID_HELP "Display help for current task or command\nHelp" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_FILE_MRU_FILE1 "Open this address book" + ID_FILE_MRU_FILE2 "Open this address book" + ID_FILE_MRU_FILE3 "Open this address book" + ID_FILE_MRU_FILE4 "Open this address book" + ID_FILE_MRU_FILE5 "Open this address book" + ID_FILE_MRU_FILE6 "Open this address book" + ID_FILE_MRU_FILE7 "Open this address book" + ID_FILE_MRU_FILE8 "Open this address book" + ID_FILE_MRU_FILE9 "Open this address book" + ID_FILE_MRU_FILE10 "Open this address book" + ID_FILE_MRU_FILE11 "Open this address book" + ID_FILE_MRU_FILE12 "Open this address book" + ID_FILE_MRU_FILE13 "Open this address book" + ID_FILE_MRU_FILE14 "Open this address book" + ID_FILE_MRU_FILE15 "Open this address book" + ID_FILE_MRU_FILE16 "Open this address book" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_NEXT_PANE "Switch to the next window pane\nNext Pane" + ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_WINDOW_SPLIT "Split the active window into panes\nSplit" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_EDIT_CLEAR "Erase the selection\nErase" + ID_EDIT_CLEAR_ALL "Erase everything\nErase All" + ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy" + ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut" + ID_EDIT_FIND "Find the specified text\nFind" + ID_EDIT_PASTE "Insert Clipboard contents\nPaste" + ID_EDIT_REPEAT "Repeat the last action\nRepeat" + ID_EDIT_REPLACE "Replace specific text with different text\nReplace" + ID_EDIT_SELECT_ALL "Select the entire address book\nSelect All" + ID_EDIT_UNDO "Undo the last action\nUndo" + ID_EDIT_REDO "Redo the previously undone action\nRedo" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar" + ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_SCSIZE "Change the window size" + AFX_IDS_SCMOVE "Change the window position" + AFX_IDS_SCMINIMIZE "Reduce the window to an icon" + AFX_IDS_SCMAXIMIZE "Enlarge the window to full size" + AFX_IDS_SCNEXTWINDOW "Switch to the next address book window" + AFX_IDS_SCPREVWINDOW "Switch to the previous address book window" + AFX_IDS_SCCLOSE "Close the active window and prompts to save the address book" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_SCRESTORE "Restore the window to normal size" + AFX_IDS_SCTASKLIST "Activate Task List" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_VIEW_FLATBAR "Change between normal and flat toolbar look\nFlatbar" + ID_EDIT_SELECTALL "Save current column positions\nSave positions" + ID_ENTRY_ADD "Add a New Address\nAdd" + ID_ENTRY_EDIT "Edit the Current Address\nEdit" + ID_ENTRY_DELETE "Delete the Current Address\nDelete" + ID_ENTRY_COPY "Copy the Current Address\nCopy" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_FILE_IMPORT "Import a Text File\nImport" + ID_IMPORT_CSV "Import a Comma Delimited File\nImport CSV" + ID_IMPORT_TAB "Import a Tab Delimited File\nImport TDF" + ID_EXPORT_CSV "Export a Comma Delimited File\nExport CSV" + ID_EXPORT_TAB "Export a Tab Delimited File\nExport TDF" + ID_ENTRY_PREF "Change Program Preferences\nPreferences" + ID_APP_PREFS "Configure ContactBook Settings\nPreferences" + ID_VIEW_FIND_NEXT "Find the specified text again\nFind Next" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_VIEW_WNDPOS "Save the current window size now\nSave Window Size" + ID_VIEW_COLSET "Save the configured column sizes now\nSave column sizes" + ID_TRAY_SHOW "Show ContactBook\nShow" + ID_TRAY_EXIT "Quit ContactBook\nQuit" + ID_DIAL_HOME "Dial the selected Home number\nDial Home" + ID_DIAL_WORK "Dial the selected Work number\nDial Work" + ID_DIAL_CELL "Dial the selected Cellular number\nDial Cellular" + ID_DIAL_PAGER "Dial the selected Pager number\nDial Pager" + ID_DIAL_FAX "Dial the selected Fax number\nDial Fax" + ID_EMAIL_ADD1 "Send Email to Address 1\nEmail Address 1" + ID_EMAIL_ADD2 "Send Email to Address 2\nEmail Address 2" + ID_URL1 "Browse the first URL\nBrowse URL 1" + ID_URL2 "Browse the second URL\nBrowse URL 2" + ID_TBAR_DIAL "Dial a number for selected address\nDial" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_TBAR_EMAIL "Email an entry for selected address\nEmail" + ID_TBAR_WEB "Browse a URL for selected address\nWeb" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CADD1 "Additional 1" + IDS_CADD2 "Additional 2" + IDS_HPHONE "Home Phone" + IDS_HPHONEX "Home Ext." + IDS_WPHONE "Work Phone" + IDS_WPHONEX "Work Ext." + IDS_CELLULAR "Cell Phone" + IDS_CELLULARX "Cell Ext." + IDS_PAGER "Pager" + IDS_PAGERC "Pager Card" + IDS_PAGERX "Pager Ext." + IDS_FAX "Fax Phone" + IDS_FAXX "Fax Ext." + IDS_EMAIL1 "Email 1" + IDS_EMAIL2 "Email 2" + IDS_WEB1 "Web 1" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_WEB2 "Web 2" + IDS_NOTES "Notes" + IDS_COPY " - Copy" + IDS_CONFIRM "Are you sure you wish to delete the selected address?" + IDS_PRINT_PAGE_TITLE "Page %d of %d" + IDS_LOADING "Loading Address Book..." + IDS_SAVING "Saving address book..." + IDS_IMPORTING "Importing addresses..." + IDS_IMPCOUNT "%d addresses imported." + IDS_NOIMPORT "No addresses could be imported." + IDS_NOREAD "Could not read first line of file." + IDS_EXPORTING "Exporting addresses..." + IDS_EXPCOUNT "%d addresses exported." + IDS_WINDSAVE "The window size has been saved." + IDS_ENTRYADD "Add a New Entry" + IDS_ENTRYEDIT "Edit an Existing Entry" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ENTRYCOPY "Copy an Existing Entry" + IDS_NOTEXT "Specified text not found." + IDS_COLSAVE "Column widths have been saved." + IDS_POSSAVE "Column positions have been saved." + IDS_PREFS "Preferences" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif +#include "res\CB32.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#include "afxprint.rc" // printing/print preview resources +#endif +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/CB32.reg b/CB32.reg new file mode 100644 index 0000000..4790e47 --- /dev/null +++ b/CB32.reg @@ -0,0 +1,14 @@ +REGEDIT +; This .REG file may be used by your SETUP program. +; If a SETUP program is not available, the entries below will be +; registered in your InitInstance automatically with a call to +; CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll. + +HKEY_CLASSES_ROOT\.cbd = CB32.Document +HKEY_CLASSES_ROOT\CB32.Document\shell\open\command = CB32.EXE %1 +HKEY_CLASSES_ROOT\CB32.Document\shell\open\ddeexec = [open("%1")] +HKEY_CLASSES_ROOT\CB32.Document\shell\open\ddeexec\application = CB32 + ; note: the application is optional + ; (it defaults to the app name in "command") + +HKEY_CLASSES_ROOT\CB32.Document = CB32 Document diff --git a/CB32Doc.cpp b/CB32Doc.cpp new file mode 100644 index 0000000..4606aab --- /dev/null +++ b/CB32Doc.cpp @@ -0,0 +1,1063 @@ +// CB32Doc.cpp : implementation of the CCB32Doc class +// + +#include "stdafx.h" +#include +#include "CB32.h" +#include "CB32Doc.h" +#include "CB32View.h" +#include "ConvertDlg.h" +#include "Parser.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CCB32Doc + +IMPLEMENT_DYNCREATE(CCB32Doc, CDocument) + +BEGIN_MESSAGE_MAP(CCB32Doc, CDocument) + //{{AFX_MSG_MAP(CCB32Doc) + ON_COMMAND(ID_IMPORT_CSV, OnImportCsv) + ON_COMMAND(ID_IMPORT_TAB, OnImportTab) + ON_COMMAND(ID_EXPORT_CSV, OnExportCsv) + ON_COMMAND(ID_EXPORT_TAB, OnExportTab) + //}}AFX_MSG_MAP + ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail) + ON_UPDATE_COMMAND_UI(ID_FILE_SEND_MAIL, OnUpdateFileSendMail) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CCB32Doc construction/destruction + +CCB32Doc::CCB32Doc() +{ + // TODO: add one-time construction code here +} + +CCB32Doc::~CCB32Doc() +{ + db.ClearDatabase(); +} + +///////////////////////////////////////////////////////////////////////////// +// CCB32Doc serialization + +void CCB32Doc::Serialize(CArchive& ar) +{ + if (ar.IsStoring()) + { + // TODO: add storing code here + } + else + { + // TODO: add loading code here + } +} + +///////////////////////////////////////////////////////////////////////////// +// CCB32Doc diagnostics + +#ifdef _DEBUG +void CCB32Doc::AssertValid() const +{ + CDocument::AssertValid(); +} + +void CCB32Doc::Dump(CDumpContext& dc) const +{ + CDocument::Dump(dc); +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CCB32Doc commands + +BOOL CCB32Doc::OnNewDocument() +{ + if (!CDocument::OnNewDocument()) + return FALSE; + + db.ClearDatabase(); + + return TRUE; +} + +BOOL CCB32Doc::OnOpenDocument(LPCTSTR lpszPathName) +{ + theApp.SetStatusMsg(IDS_LOADING); + db.ClearDatabase(); + if (!db.Read(lpszPathName)) + return FALSE; + UpdateIniFileWithDocPath(lpszPathName); + return TRUE; +} + +BOOL CCB32Doc::OnSaveDocument(LPCTSTR lpszPathName) +{ + CView* pView; + theApp.SetStatusMsg(IDS_SAVING); + db.ClearDatabase(); + POSITION pos = GetFirstViewPosition(); + while (pos != NULL) + { + pView = GetNextView(pos); + CCB32View* pCB32View = DYNAMIC_DOWNCAST(CCB32View, pView); + if (pCB32View != NULL) + pCB32View->MakeDatabase(); + } + + if (!db.Write(lpszPathName)) + return FALSE; + + db.ClearDatabase(); + UpdateIniFileWithDocPath(lpszPathName); + SetModifiedFlag(FALSE); + theApp.SetStatusMsg(AFX_IDS_IDLEMESSAGE); + + return TRUE; +} + +void CCB32Doc::UpdateIniFileWithDocPath(LPCTSTR lpszPathName) +{ + theApp.UpdateIniFileWithDocPath(lpszPathName); +} + +void CCB32Doc::OnImportCsv() +{ + CString fileName; + + CFileDialog FileDlg(TRUE, NULL, NULL, + OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, + TEXT("CSV Files (*.txt;*.csv)|*.txt; *.csv|All Files (*.*)|*.*||"), + AfxGetMainWnd()); + + if (FileDlg.DoModal() == IDOK) + { + fileName = FileDlg.GetPathName(); + char* whitesp={"\t"}; + char* breakch={","}; + FileImport(fileName, whitesp, breakch); + } +} + +void CCB32Doc::OnImportTab() +{ + CString fileName; + + CFileDialog FileDlg(TRUE, NULL, NULL, + OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, + TEXT("TDF Files (*.txt;*.tdf)|*.txt; *.tdf|All Files (*.*)|*.*||"), + AfxGetMainWnd()); + + if (FileDlg.DoModal() == IDOK) + { + fileName = FileDlg.GetPathName(); + char* whitesp={" "}; + char* breakch={"\t"}; + FileImport(fileName, whitesp, breakch); + } +} + +void CCB32Doc::OnExportCsv() +{ + CString fileName; + + CFileDialog FileDlg(FALSE, "csv", NULL, OFN_HIDEREADONLY | + OFN_OVERWRITEPROMPT, + TEXT("CSV Files (*.txt;*.csv)|*.txt; *.csv|All Files (*.*)|*.*||"), + AfxGetMainWnd()); + + if (FileDlg.DoModal() == IDOK) + { + fileName = FileDlg.GetPathName(); + char* breakch = {","}; + FileExport(fileName, breakch); + } +} + +void CCB32Doc::OnExportTab() +{ + CString fileName; + + CFileDialog FileDlg(FALSE, "tdf", NULL, OFN_HIDEREADONLY | + OFN_OVERWRITEPROMPT, + TEXT("TDF Files (*.txt;*.tdf)|*.txt; *.tdf|All Files (*.*)|*.*||"), + AfxGetMainWnd()); + + if (FileDlg.DoModal() == IDOK) + { + fileName = FileDlg.GetPathName(); + char* breakch = {"\t"}; + FileExport(fileName, breakch); + } +} + +//////////////////////////////////////////////////////////////// +// Import/Export routines +BOOL CCB32Doc::FileImport(CString fileName, char* whitesp, char* breakch) +{ + CStdioFile inFile; + CFileException e; + + if (!inFile.Open(fileName, CFile::modeRead | + CFile::shareDenyWrite | CFile::typeText, &e)) + { + AfxThrowFileException(e.m_cause, e.m_lOsError); + return FALSE; + } + + char strLine[512]; + char *newline; + int strpos; + + CConvertDlg convertDlg; + if (inFile.ReadString(strLine,511)!=NULL) + { + newline = strstr(strLine, "\n"); + strpos = newline - strLine; + if (strpos != NULL) + strLine[strpos]='\0'; + + convertDlg.m_xline1 = strLine; + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberImp"),1)) + { + convertDlg.m_xadd1 = theApp.GetProfileInt(_T("Import"), + _T("ImportAddress1"),0); + convertDlg.m_xadd2 = theApp.GetProfileInt(_T("Import"), + _T("ImportAddress2"),0); + convertDlg.m_xcell = theApp.GetProfileInt(_T("Import"), + _T("ImportCellPhone"),0); + convertDlg.m_xcity = theApp.GetProfileInt(_T("Import"), + _T("ImportCity"),0); + convertDlg.m_xcountry = theApp.GetProfileInt(_T("Import"), + _T("ImportCountry"),0); + convertDlg.m_xemail1 = theApp.GetProfileInt(_T("Import"), + _T("ImportEmail1"),0); + convertDlg.m_xemail2 = theApp.GetProfileInt(_T("Import"), + _T("ImportEmail2"),0); + convertDlg.m_xfax = theApp.GetProfileInt(_T("Import"), + _T("ImportFaxPhone"),0); + convertDlg.m_xfaxx = theApp.GetProfileInt(_T("Import"), + _T("ImportFaxExt"),0); + convertDlg.m_xfname = theApp.GetProfileInt(_T("Import"), + _T("ImportFirstname"),0); + convertDlg.m_xhomep = theApp.GetProfileInt(_T("Import"), + _T("ImportHomePhone"),0); + convertDlg.m_xhomepx = theApp.GetProfileInt(_T("Import"), + _T("ImportHomeExt"),0); + convertDlg.m_xlname = theApp.GetProfileInt(_T("Import"), + _T("ImportLastname"),0); + convertDlg.m_xmi = theApp.GetProfileInt(_T("Import"), + _T("ImportMI"),0); + convertDlg.m_xnotes = theApp.GetProfileInt(_T("Import"), + _T("ImportNotes"),0); + convertDlg.m_xpager = theApp.GetProfileInt(_T("Import"), + _T("ImportPager"),0); + convertDlg.m_xpagerc = theApp.GetProfileInt(_T("Import"), + _T("ImportPagerCard"),0); + convertDlg.m_xpagerx = theApp.GetProfileInt(_T("Import"), + _T("ImportPagerExt"),0); + convertDlg.m_xstate = theApp.GetProfileInt(_T("Import"), + _T("ImportState"),0); + convertDlg.m_xtitle = theApp.GetProfileInt(_T("Import"), + _T("ImportTitle"),0); + convertDlg.m_xweb1 = theApp.GetProfileInt(_T("Import"), + _T("ImportWeb1"),0); + convertDlg.m_xweb2 = theApp.GetProfileInt(_T("Import"), + _T("ImportWeb2"),0); + convertDlg.m_xworkp = theApp.GetProfileInt(_T("Import"), + _T("ImportWorkPhone"),0); + convertDlg.m_xworkpx = theApp.GetProfileInt(_T("Import"), + _T("ImportWorkExt"),0); + convertDlg.m_xzip = theApp.GetProfileInt(_T("Import"), + _T("ImportZip"),0); + convertDlg.m_xcellx = theApp.GetProfileInt(_T("Import"), + _T("ImportCellExt"),0); + convertDlg.m_xcomp = theApp.GetProfileInt(_T("Import"), + _T("ImportComp"),0); + convertDlg.m_xdept = theApp.GetProfileInt(_T("Import"), + _T("ImportDept"),0); + convertDlg.m_xposn = theApp.GetProfileInt(_T("Import"), + _T("ImportPosn"),0); + convertDlg.m_xmgr = theApp.GetProfileInt(_T("Import"), + _T("ImportMgr"),0); + convertDlg.m_xcadd1 = theApp.GetProfileInt(_T("Import"), + _T("ImportCAdd1"),0); + convertDlg.m_xcadd2 = theApp.GetProfileInt(_T("Import"), + _T("ImportCAdd2"),0); + } + + if (convertDlg.DoModal()==IDOK) + { + theApp.SetStatusMsg(IDS_IMPORTING); + CWaitCursor wait; + POSITION posIndex; + CStringList inList; + BOOL dodata = FALSE; + char strToken[1024]; + char brkused, quoted; + char *quotech={"\""}; // double quote + char escape='\\'; // "backslash" is escape + + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberImp"),1)) + { + theApp.WriteProfileInt(_T("Import"),_T("ImportAddress1"), + convertDlg.m_xadd1); + theApp.WriteProfileInt(_T("Import"),_T("ImportAddress2"), + convertDlg.m_xadd2); + theApp.WriteProfileInt(_T("Import"),_T("ImportCellPhone"), + convertDlg.m_xcell); + theApp.WriteProfileInt(_T("Import"),_T("ImportCity"), + convertDlg.m_xcity); + theApp.WriteProfileInt(_T("Import"),_T("ImportCountry"), + convertDlg.m_xcountry); + theApp.WriteProfileInt(_T("Import"),_T("ImportEmail1"), + convertDlg.m_xemail1); + theApp.WriteProfileInt(_T("Import"),_T("ImportEmail2"), + convertDlg.m_xemail2); + theApp.WriteProfileInt(_T("Import"),_T("ImportFaxPhone"), + convertDlg.m_xfax); + theApp.WriteProfileInt(_T("Import"),_T("ImportFaxExt"), + convertDlg.m_xfaxx); + theApp.WriteProfileInt(_T("Import"),_T("ImportFirstname"), + convertDlg.m_xfname); + theApp.WriteProfileInt(_T("Import"),_T("ImportHomePhone"), + convertDlg.m_xhomep); + theApp.WriteProfileInt(_T("Import"),_T("ImportHomeExt"), + convertDlg.m_xhomepx); + theApp.WriteProfileInt(_T("Import"),_T("ImportLastname"), + convertDlg.m_xlname); + theApp.WriteProfileInt(_T("Import"),_T("ImportMI"), + convertDlg.m_xmi); + theApp.WriteProfileInt(_T("Import"),_T("ImportNotes"), + convertDlg.m_xnotes); + theApp.WriteProfileInt(_T("Import"),_T("ImportPager"), + convertDlg.m_xpager); + theApp.WriteProfileInt(_T("Import"),_T("ImportPagerCard"), + convertDlg.m_xpagerc); + theApp.WriteProfileInt(_T("Import"),_T("ImportPagerExt"), + convertDlg.m_xpagerx); + theApp.WriteProfileInt(_T("Import"),_T("ImportState"), + convertDlg.m_xstate); + theApp.WriteProfileInt(_T("Import"),_T("ImportTitle"), + convertDlg.m_xtitle); + theApp.WriteProfileInt(_T("Import"),_T("ImportWeb1"), + convertDlg.m_xweb1); + theApp.WriteProfileInt(_T("Import"),_T("ImportWeb2"), + convertDlg.m_xweb2); + theApp.WriteProfileInt(_T("Import"),_T("ImportWorkPhone"), + convertDlg.m_xworkp); + theApp.WriteProfileInt(_T("Import"),_T("ImportWorkExt"), + convertDlg.m_xworkpx); + theApp.WriteProfileInt(_T("Import"),_T("ImportZip"), + convertDlg.m_xzip); + theApp.WriteProfileInt(_T("Import"),_T("ImportCellExt"), + convertDlg.m_xcellx); + theApp.WriteProfileInt(_T("Import"),_T("ImportComp"), + convertDlg.m_xcomp); + theApp.WriteProfileInt(_T("Import"),_T("ImportDept"), + convertDlg.m_xdept); + theApp.WriteProfileInt(_T("Import"),_T("ImportPosn"), + convertDlg.m_xposn); + theApp.WriteProfileInt(_T("Import"),_T("ImportMgr"), + convertDlg.m_xmgr); + theApp.WriteProfileInt(_T("Import"),_T("ImportCAdd1"), + convertDlg.m_xcadd1); + theApp.WriteProfileInt(_T("Import"),_T("ImportCAdd2"), + convertDlg.m_xcadd2); + } + + db.ClearDatabase(); + inFile.SeekToBegin(); + int i=0; + + while(inFile.ReadString(strLine, 1023)!=NULL) + { + newline = strstr(strLine, "\n"); + strpos = newline - strLine; + if (strpos != NULL) + strLine[strpos]='\0'; + + int z=0, next=0; + BOOL addexpr = FALSE; + + CExpr *expr = new CExpr("contact"); + inList.RemoveAll(); + + while(parser(0,strToken,sizeof(strLine),strLine,whitesp,breakch, + quotech,escape,&brkused,&next,"ed)==0) + { + inList.AddTail(strToken); + z++; + } + + if (z>0) + z++; + + if (convertDlg.m_xlname>0 && convertDlg.m_xlnameAddAttributeValueString("LastName", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xfname>0 && convertDlg.m_xfnameAddAttributeValueString("FirstName", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xmi>0 && convertDlg.m_xmiAddAttributeValueString("MiddleInitial", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xtitle>0 && convertDlg.m_xtitleAddAttributeValueString("Title", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xadd1>0 && convertDlg.m_xadd1AddAttributeValueString("Address1", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xadd2>0 && convertDlg.m_xadd2AddAttributeValueString("Address2", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xcity>0 && convertDlg.m_xcityAddAttributeValueString("City", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xcountry>0 && convertDlg.m_xcountryAddAttributeValueString("Country", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xstate>0 && convertDlg.m_xstateAddAttributeValueString("State", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xzip>0 && convertDlg.m_xzipAddAttributeValueString("ZipCode", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xcomp>0 && convertDlg.m_xcompAddAttributeValueString("Company", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xdept>0 && convertDlg.m_xdeptAddAttributeValueString("Department", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xposn>0 && convertDlg.m_xposnAddAttributeValueString("Position", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xmgr>0 && convertDlg.m_xmgrAddAttributeValueString("Manager", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xcadd1>0 && convertDlg.m_xcadd1AddAttributeValueString("Additional1", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xcadd2>0 && convertDlg.m_xcadd2AddAttributeValueString("Additional2", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xhomep>0 && convertDlg.m_xhomepAddAttributeValueString("HomePhone", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xhomepx>0 && convertDlg.m_xhomepxAddAttributeValueString("HomeExt", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xworkp>0 && convertDlg.m_xworkpAddAttributeValueString("WorkPhone", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xworkpx>0 && convertDlg.m_xworkpxAddAttributeValueString("WorkExt", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xcell>0 && convertDlg.m_xcellAddAttributeValueString("CellPhone", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xcellx>0 && convertDlg.m_xcellxAddAttributeValueString("CellExt", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xpager>0 && convertDlg.m_xpagerAddAttributeValueString("Pager", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xpagerc>0 && convertDlg.m_xpagercAddAttributeValueString("PagerCard", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xpagerx>0 && convertDlg.m_xpagerxAddAttributeValueString("PagerExt", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xfax>0 && convertDlg.m_xfaxAddAttributeValueString("FaxPhone", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xfaxx>0 && convertDlg.m_xfaxxAddAttributeValueString("FaxExt", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xemail1>0 && convertDlg.m_xemail1AddAttributeValueString("Email1", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xemail2>0 && convertDlg.m_xemail2AddAttributeValueString("Email2", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xweb1>0 && convertDlg.m_xweb1AddAttributeValueString("Web1", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xweb2>0 && convertDlg.m_xweb2AddAttributeValueString("Web2", inList.GetAt(posIndex)); + addexpr = TRUE; + } + if (convertDlg.m_xnotes>0 && convertDlg.m_xnotesAddAttributeValueString("Notes", inList.GetAt(posIndex)); + addexpr = TRUE; + } + + if (addexpr) + { + db.Append(expr); + dodata = TRUE; + i++; + } + } + + if (dodata) + { + CView* pView; + POSITION pos = GetFirstViewPosition(); + while (pos != NULL) + { + pView = GetNextView(pos); + CCB32View* pCB32View = DYNAMIC_DOWNCAST(CCB32View, pView); + if (pCB32View != NULL) + pCB32View->AddDatabase(); + } + + SetModifiedFlag(TRUE); + inFile.Close(); + + CString strTemp; + strTemp.Format(IDS_IMPCOUNT, i); + AfxMessageBox(strTemp, MB_ICONINFORMATION); + + return TRUE; + } + else // no data to make dbf + { + inFile.Close(); + AfxMessageBox(IDS_NOIMPORT); + return FALSE; + } + + theApp.SetStatusMsg(AFX_IDS_IDLEMESSAGE); + } + else // chose CANCEL from dialog + { + inFile.Close(); + return FALSE; + } + } + else // initial line was NULL + { + inFile.Close(); + AfxMessageBox(IDS_NOREAD); + return FALSE; + } +} + +BOOL CCB32Doc::FileExport(CString fileName, char* breakch) +{ + CStdioFile outFile; + CFileException e; + + if (!outFile.Open(fileName, CFile::modeCreate | CFile::modeWrite | + CFile::shareDenyRead | CFile::shareDenyWrite | + CFile::typeText, &e)) + { + AfxThrowFileException(e.m_cause, e.m_lOsError); + return FALSE; + } + + CConvertDlg convertDlg; + + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberExp"),1)) + { + convertDlg.m_xadd1 = theApp.GetProfileInt(_T("Export"), + _T("ExportAddress1"),0); + convertDlg.m_xadd2 = theApp.GetProfileInt(_T("Export"), + _T("ExportAddress2"),0); + convertDlg.m_xcell = theApp.GetProfileInt(_T("Export"), + _T("ExportCellPhone"),0); + convertDlg.m_xcity = theApp.GetProfileInt(_T("Export"), + _T("ExportCity"),0); + convertDlg.m_xcountry = theApp.GetProfileInt(_T("Export"), + _T("ExportCountry"),0); + convertDlg.m_xemail1 = theApp.GetProfileInt(_T("Export"), + _T("ExportEmail1"),0); + convertDlg.m_xemail2 = theApp.GetProfileInt(_T("Export"), + _T("ExportEmail2"),0); + convertDlg.m_xfax = theApp.GetProfileInt(_T("Export"), + _T("ExportFaxPhone"),0); + convertDlg.m_xfaxx = theApp.GetProfileInt(_T("Export"), + _T("ExportFaxExt"),0); + convertDlg.m_xfname = theApp.GetProfileInt(_T("Export"), + _T("ExportFirstname"),0); + convertDlg.m_xhomep = theApp.GetProfileInt(_T("Export"), + _T("ExportHomePhone"),0); + convertDlg.m_xhomepx = theApp.GetProfileInt(_T("Export"), + _T("ExportHomeExt"),0); + convertDlg.m_xlname = theApp.GetProfileInt(_T("Export"), + _T("ExportLastname"),0); + convertDlg.m_xmi = theApp.GetProfileInt(_T("Export"), + _T("ExportMI"),0); + convertDlg.m_xnotes = theApp.GetProfileInt(_T("Export"), + _T("ExportNotes"),0); + convertDlg.m_xpager = theApp.GetProfileInt(_T("Export"), + _T("ExportPager"),0); + convertDlg.m_xpagerc = theApp.GetProfileInt(_T("Export"), + _T("ExportPagerCard"),0); + convertDlg.m_xpagerx = theApp.GetProfileInt(_T("Export"), + _T("ExportPagerExt"),0); + convertDlg.m_xstate = theApp.GetProfileInt(_T("Export"), + _T("ExportState"),0); + convertDlg.m_xtitle = theApp.GetProfileInt(_T("Export"), + _T("ExportTitle"),0); + convertDlg.m_xweb1 = theApp.GetProfileInt(_T("Export"), + _T("ExportWeb1"),0); + convertDlg.m_xweb2 = theApp.GetProfileInt(_T("Export"), + _T("ExportWeb2"),0); + convertDlg.m_xworkp = theApp.GetProfileInt(_T("Export"), + _T("ExportWorkPhone"),0); + convertDlg.m_xworkpx = theApp.GetProfileInt(_T("Export"), + _T("ExportWorkExt"),0); + convertDlg.m_xzip = theApp.GetProfileInt(_T("Export"), + _T("ExportZip"),0); + convertDlg.m_xcellx = theApp.GetProfileInt(_T("Export"), + _T("ExportCellExt"),0); + convertDlg.m_xcomp = theApp.GetProfileInt(_T("Export"), + _T("ExportComp"),0); + convertDlg.m_xdept = theApp.GetProfileInt(_T("Export"), + _T("ExportDept"),0); + convertDlg.m_xposn = theApp.GetProfileInt(_T("Export"), + _T("ExportPosn"),0); + convertDlg.m_xmgr = theApp.GetProfileInt(_T("Export"), + _T("ExportMgr"),0); + convertDlg.m_xcadd1 = theApp.GetProfileInt(_T("Export"), + _T("ExportCAdd1"),0); + convertDlg.m_xcadd2 = theApp.GetProfileInt(_T("Export"), + _T("ExportCAdd2"),0); + } + + if (convertDlg.DoModal()==IDOK) + { + theApp.SetStatusMsg(IDS_EXPORTING); + CWaitCursor wait; + CView* pView; + + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberExp"),1)) + { + theApp.WriteProfileInt(_T("Export"),_T("ExportAddress1"), + convertDlg.m_xadd1); + theApp.WriteProfileInt(_T("Export"),_T("ExportAddress2"), + convertDlg.m_xadd2); + theApp.WriteProfileInt(_T("Export"),_T("ExportCellPhone"), + convertDlg.m_xcell); + theApp.WriteProfileInt(_T("Export"),_T("ExportCity"), + convertDlg.m_xcity); + theApp.WriteProfileInt(_T("Export"),_T("ExportCountry"), + convertDlg.m_xcountry); + theApp.WriteProfileInt(_T("Export"),_T("ExportEmail1"), + convertDlg.m_xemail1); + theApp.WriteProfileInt(_T("Export"),_T("ExportEmail2"), + convertDlg.m_xemail2); + theApp.WriteProfileInt(_T("Export"),_T("ExportFaxPhone"), + convertDlg.m_xfax); + theApp.WriteProfileInt(_T("Export"),_T("ExportFaxExt"), + convertDlg.m_xfaxx); + theApp.WriteProfileInt(_T("Export"),_T("ExportFirstname"), + convertDlg.m_xfname); + theApp.WriteProfileInt(_T("Export"),_T("ExportHomePhone"), + convertDlg.m_xhomep); + theApp.WriteProfileInt(_T("Export"),_T("ExportHomeExt"), + convertDlg.m_xhomepx); + theApp.WriteProfileInt(_T("Export"),_T("ExportLastname"), + convertDlg.m_xlname); + theApp.WriteProfileInt(_T("Export"),_T("ExportMI"), + convertDlg.m_xmi); + theApp.WriteProfileInt(_T("Export"),_T("ExportNotes"), + convertDlg.m_xnotes); + theApp.WriteProfileInt(_T("Export"),_T("ExportPager"), + convertDlg.m_xpager); + theApp.WriteProfileInt(_T("Export"),_T("ExportPagerCard"), + convertDlg.m_xpagerc); + theApp.WriteProfileInt(_T("Export"),_T("ExportPagerExt"), + convertDlg.m_xpagerx); + theApp.WriteProfileInt(_T("Export"),_T("ExportState"), + convertDlg.m_xstate); + theApp.WriteProfileInt(_T("Export"),_T("ExportTitle"), + convertDlg.m_xtitle); + theApp.WriteProfileInt(_T("Export"),_T("ExportWeb1"), + convertDlg.m_xweb1); + theApp.WriteProfileInt(_T("Export"),_T("ExportWeb2"), + convertDlg.m_xweb2); + theApp.WriteProfileInt(_T("Export"),_T("ExportWorkPhone"), + convertDlg.m_xworkp); + theApp.WriteProfileInt(_T("Export"),_T("ExportWorkExt"), + convertDlg.m_xworkpx); + theApp.WriteProfileInt(_T("Export"),_T("ExportZip"), + convertDlg.m_xzip); + theApp.WriteProfileInt(_T("Export"),_T("ExportCellExt"), + convertDlg.m_xcellx); + theApp.WriteProfileInt(_T("Export"),_T("ExportComp"), + convertDlg.m_xcomp); + theApp.WriteProfileInt(_T("Export"),_T("ExportDept"), + convertDlg.m_xdept); + theApp.WriteProfileInt(_T("Export"),_T("ExportPosn"), + convertDlg.m_xposn); + theApp.WriteProfileInt(_T("Export"),_T("ExportMgr"), + convertDlg.m_xmgr); + theApp.WriteProfileInt(_T("Export"),_T("ExportCAdd1"), + convertDlg.m_xcadd1); + theApp.WriteProfileInt(_T("Export"),_T("ExportCAdd2"), + convertDlg.m_xcadd2); + } + + // add firstline identifier + db.ClearDatabase(); + CExpr *expr = new CExpr("contact"); + expr->AddAttributeValueString("LastName", "LASTNAME"); + expr->AddAttributeValueString("FirstName", "FIRSTNAME"); + expr->AddAttributeValueString("MiddleInitial", "MI"); + expr->AddAttributeValueString("Title", "TITLE"); + expr->AddAttributeValueString("Address1", "ADDRESS1"); + expr->AddAttributeValueString("Address2", "ADDRESS2"); + expr->AddAttributeValueString("City", "CITY"); + expr->AddAttributeValueString("Country", "COUNTRY"); + expr->AddAttributeValueString("State", "STATE"); + expr->AddAttributeValueString("ZipCode", "ZIPCODE"); + expr->AddAttributeValueString("Company", "COMPANY"); + expr->AddAttributeValueString("Department", "DEPARTMENT"); + expr->AddAttributeValueString("Position", "POSITION"); + expr->AddAttributeValueString("Manager", "MANAGER"); + expr->AddAttributeValueString("Additional1", "ADDITIONAL1"); + expr->AddAttributeValueString("Additional2", "ADDITIONAL2"); + expr->AddAttributeValueString("HomePhone", "HOMEPHONE"); + expr->AddAttributeValueString("HomeExt", "HOMEEXT"); + expr->AddAttributeValueString("WorkPhone", "WORKPHONE"); + expr->AddAttributeValueString("WorkExt", "WORKEXT"); + expr->AddAttributeValueString("CellPhone", "CELLPHONE"); + expr->AddAttributeValueString("CellExt", "CELLEXT"); + expr->AddAttributeValueString("Pager", "PAGER"); + expr->AddAttributeValueString("PagerCard", "PAGERCARD"); + expr->AddAttributeValueString("PagerExt", "PAGEREXT"); + expr->AddAttributeValueString("FaxPhone", "FAXPHONE"); + expr->AddAttributeValueString("FaxExt", "FAXEXT"); + expr->AddAttributeValueString("Email1", "EMAIL1"); + expr->AddAttributeValueString("Email2", "EMAIL2"); + expr->AddAttributeValueString("Web1", "WEB1"); + expr->AddAttributeValueString("Web2", "WEB2"); + expr->AddAttributeValueString("Notes", "NOTES"); + db.Append(expr); + + POSITION pos = GetFirstViewPosition(); + while (pos != NULL) + { + pView = GetNextView(pos); + CCB32View* pCB32View = DYNAMIC_DOWNCAST(CCB32View, pView); + if (pCB32View != NULL) + pCB32View->MakeDatabase(); + } + + CStringArray dataArray; + CString strTemp; + int i=0; + dataArray.SetSize(32); + + wxNode *node = db.First(); + while (node) + { + dataArray.RemoveAll(); + + CExpr *expr = (CExpr *)node->Data(); + + if (convertDlg.m_xlname>0) + { + expr->GetAttributeValue("LastName", strTemp); + dataArray.SetAtGrow(convertDlg.m_xlname, strTemp); + } + if (convertDlg.m_xfname>0) + { + expr->GetAttributeValue("FirstName", strTemp); + dataArray.SetAtGrow(convertDlg.m_xfname, strTemp); + } + if (convertDlg.m_xmi>0) + { + expr->GetAttributeValue("MiddleInitial", strTemp); + dataArray.SetAtGrow(convertDlg.m_xmi, strTemp); + } + if (convertDlg.m_xtitle>0) + { + expr->GetAttributeValue("Title", strTemp); + dataArray.SetAtGrow(convertDlg.m_xtitle, strTemp); + } + if (convertDlg.m_xadd1>0) + { + expr->GetAttributeValue("Address1", strTemp); + dataArray.SetAtGrow(convertDlg.m_xadd1, strTemp); + } + if (convertDlg.m_xadd2>0) + { + expr->GetAttributeValue("Address2", strTemp); + dataArray.SetAtGrow(convertDlg.m_xadd2, strTemp); + } + if (convertDlg.m_xcity>0) + { + expr->GetAttributeValue("City", strTemp); + dataArray.SetAtGrow(convertDlg.m_xcity, strTemp); + } + if (convertDlg.m_xcountry>0) + { + expr->GetAttributeValue("Country", strTemp); + dataArray.SetAtGrow(convertDlg.m_xcountry, strTemp); + } + if (convertDlg.m_xstate>0) + { + expr->GetAttributeValue("State", strTemp); + dataArray.SetAtGrow(convertDlg.m_xstate, strTemp); + } + if (convertDlg.m_xzip>0) + { + expr->GetAttributeValue("ZipCode", strTemp); + dataArray.SetAtGrow(convertDlg.m_xzip, strTemp); + } + if (convertDlg.m_xcomp>0) + { + expr->GetAttributeValue("Company", strTemp); + dataArray.SetAtGrow(convertDlg.m_xcomp, strTemp); + } + if (convertDlg.m_xdept>0) + { + expr->GetAttributeValue("Department", strTemp); + dataArray.SetAtGrow(convertDlg.m_xdept, strTemp); + } + if (convertDlg.m_xposn>0) + { + expr->GetAttributeValue("Position", strTemp); + dataArray.SetAtGrow(convertDlg.m_xposn, strTemp); + } + if (convertDlg.m_xmgr>0) + { + expr->GetAttributeValue("Manager", strTemp); + dataArray.SetAtGrow(convertDlg.m_xmgr, strTemp); + } + if (convertDlg.m_xcadd1>0) + { + expr->GetAttributeValue("Additional1", strTemp); + dataArray.SetAtGrow(convertDlg.m_xcadd1, strTemp); + } + if (convertDlg.m_xcadd2>0) + { + expr->GetAttributeValue("Additional2", strTemp); + dataArray.SetAtGrow(convertDlg.m_xcadd2, strTemp); + } + if (convertDlg.m_xhomep>0) + { + expr->GetAttributeValue("HomePhone", strTemp); + dataArray.SetAtGrow(convertDlg.m_xhomep, strTemp); + } + if (convertDlg.m_xhomepx>0) + { + expr->GetAttributeValue("HomeExt", strTemp); + dataArray.SetAtGrow(convertDlg.m_xhomepx, strTemp); + } + if (convertDlg.m_xworkp>0) + { + expr->GetAttributeValue("WorkPhone", strTemp); + dataArray.SetAtGrow(convertDlg.m_xworkp, strTemp); + } + if (convertDlg.m_xworkpx>0) + { + expr->GetAttributeValue("WorkExt", strTemp); + dataArray.SetAtGrow(convertDlg.m_xworkpx, strTemp); + } + if (convertDlg.m_xcell>0) + { + expr->GetAttributeValue("CellPhone", strTemp); + dataArray.SetAtGrow(convertDlg.m_xcell, strTemp); + } + if (convertDlg.m_xcellx>0) + { + expr->GetAttributeValue("CellExt", strTemp); + dataArray.SetAtGrow(convertDlg.m_xcellx, strTemp); + } + if (convertDlg.m_xpager>0) + { + expr->GetAttributeValue("Pager", strTemp); + dataArray.SetAtGrow(convertDlg.m_xpager, strTemp); + } + if (convertDlg.m_xpagerc>0) + { + expr->GetAttributeValue("PagerCard", strTemp); + dataArray.SetAtGrow(convertDlg.m_xpagerc, strTemp); + } + if (convertDlg.m_xpagerx>0) + { + expr->GetAttributeValue("PagerExt", strTemp); + dataArray.SetAtGrow(convertDlg.m_xpagerx, strTemp); + } + if (convertDlg.m_xfax>0) + { + expr->GetAttributeValue("FaxPhone", strTemp); + dataArray.SetAtGrow(convertDlg.m_xfax, strTemp); + } + if (convertDlg.m_xfaxx>0) + { + expr->GetAttributeValue("FaxExt", strTemp); + dataArray.SetAtGrow(convertDlg.m_xfaxx, strTemp); + } + if (convertDlg.m_xemail1>0) + { + expr->GetAttributeValue("Email1", strTemp); + dataArray.SetAtGrow(convertDlg.m_xemail1, strTemp); + } + if (convertDlg.m_xemail2>0) + { + expr->GetAttributeValue("Email2", strTemp); + dataArray.SetAtGrow(convertDlg.m_xemail2, strTemp); + } + if (convertDlg.m_xweb1>0) + { + expr->GetAttributeValue("Web1", strTemp); + dataArray.SetAtGrow(convertDlg.m_xweb1, strTemp); + } + if (convertDlg.m_xweb2>0) + { + expr->GetAttributeValue("Web2", strTemp); + dataArray.SetAtGrow(convertDlg.m_xweb2, strTemp); + } + if (convertDlg.m_xnotes>0) + { + expr->GetAttributeValue("Notes", strTemp); + dataArray.SetAtGrow(convertDlg.m_xnotes, strTemp); + } + + dataArray.FreeExtra(); + strTemp.Empty(); + int total = dataArray.GetUpperBound(); + if (total > -1) + { + for (int z=1;z <= total;z++) + { + strTemp += "\""; //add before quote + strTemp += dataArray.GetAt(z); // add data + strTemp += "\""; // add after quote + strTemp += breakch; // add break char + } + + if (!strTemp.IsEmpty()) + { + strTemp += "\n"; // add termintor + outFile.WriteString(strTemp); + i++; + } + } + + node = node->Next(); + } + + db.ClearDatabase(); + outFile.Close(); + + CString strTemp2; + strTemp2.Format(IDS_EXPCOUNT, i); + AfxMessageBox(strTemp2, MB_ICONINFORMATION); + + theApp.SetStatusMsg(AFX_IDS_IDLEMESSAGE); + + return TRUE; + } + else // chose CANCEL from ConvertDlg + { + outFile.Close(); + return FALSE; + } +} diff --git a/CB32Doc.h b/CB32Doc.h new file mode 100644 index 0000000..0cd760a --- /dev/null +++ b/CB32Doc.h @@ -0,0 +1,69 @@ +// CB32Doc.h : interface of the CCB32Doc class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_CB32DOC_H__20BFD1ED_4F52_11D1_AF86_000000000000__INCLUDED_) +#define AFX_CB32DOC_H__20BFD1ED_4F52_11D1_AF86_000000000000__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#include "..\cexpr\cexpr.h" + +class CCB32Doc : public CDocument +{ +protected: // create from serialization only + CCB32Doc(); + DECLARE_DYNCREATE(CCB32Doc) + +// Attributes +public: + CExprDatabase db; + +// Operations +public: + inline CExprDatabase& GetDB() { return db; } + +protected: + void UpdateIniFileWithDocPath(LPCTSTR lpszPathName); + BOOL FileImport(CString, char*, char*); + BOOL FileExport(CString, char*); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CCB32Doc) + public: + virtual BOOL OnNewDocument(); + virtual void Serialize(CArchive& ar); + virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); + virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CCB32Doc(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + +// Generated message map functions +protected: + //{{AFX_MSG(CCB32Doc) + afx_msg void OnImportCsv(); + afx_msg void OnImportTab(); + afx_msg void OnExportCsv(); + afx_msg void OnExportTab(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_CB32DOC_H__20BFD1ED_4F52_11D1_AF86_000000000000__INCLUDED_) diff --git a/CB32View.cpp b/CB32View.cpp new file mode 100644 index 0000000..acf7dd0 --- /dev/null +++ b/CB32View.cpp @@ -0,0 +1,2695 @@ +// CB32View.cpp : implementation of the CCB32View class +// + +#include "stdafx.h" + +#ifndef TAPI_CURRENT_VERSION +#define TAPI_CURRENT_VERSION 0x00010004 +#endif + +#include +#include "CB32.h" +#include "ComboBar.h" +#include "MainFrm.h" +#include "CB32Doc.h" +#include "CB32View.h" +#include "resource.h" +#include "FindDlg.h" +#include "GetNew.h" +#include "PrefPage.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define HEADER_HEIGHT 2 +#define FOOTER_HEIGHT 2 +#define LEFT_MARGIN 4 +#define RIGHT_MARGIN 4 +#define TOP_MARGIN 1 +#define BOTTOM_MARGIN 1 +#define GAP 1 +#define HIGHLIGHT_NORMAL 1 +#define HIGHLIGHT_ALLCOLUMNS 2 +#define HIGHLIGHT_ROW 3 + +///////////////////////////////////////////////////////////////////////////// +// CCB32View + +IMPLEMENT_DYNCREATE(CCB32View, CListView) + +BEGIN_MESSAGE_MAP(CCB32View, CListView) + //{{AFX_MSG_MAP(CCB32View) + ON_WM_MEASUREITEM_REFLECT() + ON_WM_DRAWITEM_REFLECT() + ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick) + ON_WM_DESTROY() + ON_WM_CREATE() + ON_COMMAND(ID_ENTRY_ADD, OnEntryAdd) + ON_COMMAND(ID_ENTRY_EDIT, OnEntryEdit) + ON_COMMAND(ID_ENTRY_DELETE, OnEntryDelete) + ON_UPDATE_COMMAND_UI(ID_ENTRY_EDIT, OnUpdateEntryEdit) + ON_UPDATE_COMMAND_UI(ID_ENTRY_DELETE, OnUpdateEntryDelete) + ON_WM_LBUTTONDBLCLK() + ON_COMMAND(ID_EDIT_FIND, OnEditFind) + ON_UPDATE_COMMAND_UI(ID_EDIT_FIND, OnUpdateEditFind) + ON_COMMAND(ID_VIEW_FIND_NEXT, OnViewFindNext) + ON_UPDATE_COMMAND_UI(ID_VIEW_FIND_NEXT, OnUpdateViewFindNext) + ON_COMMAND(ID_VIEW_COLSET, OnViewColset) + ON_WM_CONTEXTMENU() + ON_COMMAND(ID_DIAL_HOME, OnDialHome) + ON_COMMAND(ID_DIAL_WORK, OnDialWork) + ON_UPDATE_COMMAND_UI(ID_DIAL_HOME, OnUpdateDialHome) + ON_UPDATE_COMMAND_UI(ID_DIAL_WORK, OnUpdateDialWork) + ON_COMMAND(ID_DIAL_CELL, OnDialCell) + ON_UPDATE_COMMAND_UI(ID_DIAL_CELL, OnUpdateDialCell) + ON_COMMAND(ID_DIAL_PAGER, OnDialPager) + ON_UPDATE_COMMAND_UI(ID_DIAL_PAGER, OnUpdateDialPager) + ON_COMMAND(ID_DIAL_FAX, OnDialFax) + ON_UPDATE_COMMAND_UI(ID_DIAL_FAX, OnUpdateDialFax) + ON_COMMAND(ID_EMAIL_ADD1, OnEmailAdd1) + ON_UPDATE_COMMAND_UI(ID_EMAIL_ADD1, OnUpdateEmailAdd1) + ON_COMMAND(ID_EMAIL_ADD2, OnEmailAdd2) + ON_UPDATE_COMMAND_UI(ID_EMAIL_ADD2, OnUpdateEmailAdd2) + ON_COMMAND(ID_URL1, OnUrl1) + ON_UPDATE_COMMAND_UI(ID_URL1, OnUpdateUrl1) + ON_COMMAND(ID_URL2, OnUrl2) + ON_UPDATE_COMMAND_UI(ID_URL2, OnUpdateUrl2) + ON_COMMAND(ID_APP_PREFS, OnAppPrefs) + ON_COMMAND(ID_TBAR_DIAL, OnTbarDial) + ON_UPDATE_COMMAND_UI(ID_TBAR_DIAL, OnUpdateTbarDial) + ON_COMMAND(ID_TBAR_EMAIL, OnTbarEmail) + ON_UPDATE_COMMAND_UI(ID_TBAR_EMAIL, OnUpdateTbarEmail) + ON_COMMAND(ID_TBAR_WEB, OnTbarWeb) + ON_UPDATE_COMMAND_UI(ID_TBAR_WEB, OnUpdateTbarWeb) + ON_COMMAND(ID_VIEW_COLPOS, OnViewColpos) + ON_COMMAND(ID_ENTRY_COPY, OnEntryCopy) + ON_UPDATE_COMMAND_UI(ID_ENTRY_COPY, OnUpdateEntryCopy) + //}}AFX_MSG_MAP + // Standard printing commands + ON_COMMAND(ID_FILE_PRINT, CListView::OnFilePrint) + ON_COMMAND(ID_FILE_PRINT_DIRECT, CListView::OnFilePrint) + ON_COMMAND(ID_FILE_PRINT_PREVIEW, CListView::OnFilePrintPreview) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CCB32View construction/destruction + +CCB32View::CCB32View() +{ + m_nHighlight = 1; + m_iFirst = 0; + m_pFindDialog = new CFindDlg; + m_headerctrl.SetCallback( this, (void (CWnd::*)(int, int))DragColumn ); + nSortedCol = theApp.GetProfileInt(_T("Preferences"),_T("SortIndex"),0); + if ((nSortedCol<0) || (nSortedCol>(COLS-1))) + nSortedCol = 0; + bSortAscending = theApp.GetProfileInt(_T("Preferences"),_T("SortDirection"),1); +} + +CCB32View::~CCB32View() +{ + delete m_pFindDialog; +} + +BOOL CCB32View::PreCreateWindow(CREATESTRUCT& cs) +{ + if (!CListView::PreCreateWindow (cs)) + return FALSE; + + // Make the list view an owner-drawn control. + cs.style |= LVS_OWNERDRAWFIXED; + + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////// +// CCB32View drawing + +void CCB32View::OnDraw(CDC* pDC) +{ + CCB32Doc* pDoc = GetDocument(); + ASSERT_VALID(pDoc); + + // TODO: add draw code for native data here + +} + +void CCB32View::OnInitialUpdate() +{ + CListView::OnInitialUpdate(); + + // prepare header control + if (m_iFirst == 0) + { + m_headerctrl.SubclassWindow(::GetDlgItem(m_hWnd,0)); + m_iFirst = 1; + } + + // Add items to the list view. + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + FreeItems(); + ctlList.DeleteAllItems(); + ctlList.SetBkColor(GetSysColor(COLOR_WINDOW)); + + AddDatabase(); + theApp.SetStatusMsg(AFX_IDS_IDLEMESSAGE); +} + +void CCB32View::MeasureItem(LPMEASUREITEMSTRUCT lpmis) +{ + // Compute the height of each line in the list view from the font height. + LOGFONT lf; + + CFont* pFont = GetFont(); + pFont->GetLogFont(&lf); + lpmis->itemHeight = abs ((int) lf.lfHeight) + 6; + +} + +void CCB32View::DrawItem(LPDRAWITEMSTRUCT lpdis) +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + // Create a CDC object from the DC handle provided to us. + CDC dc; + dc.Attach (lpdis->hDC); + + // Initialize a CRect object with a rectangle that surrounds the item + // and its subitems. + CRect rect = lpdis->rcItem; + + // Retrieve a pointer to the CStringArray structure that holds the item's + // data. lpdis->itemID is the 0-based index of the item that we're being + // being asked to paint. + CStringArray* pItem = (CStringArray*) ctlList.GetItemData(lpdis->itemID); + + // If the item is selected, paint the rectangle with the system color + // COLOR_HIGHLIGHT. Otherwise, use COLOR_WINDOW. + CBrush* pBrush = new CBrush (::GetSysColor ((lpdis->itemState & + ODS_SELECTED) ? COLOR_HIGHLIGHT : COLOR_WINDOW)); + dc.FillRect (rect, pBrush); + delete pBrush; + + // If the item has the input focus, draw a dotted focus rectangle. + if (lpdis->itemState & ODS_FOCUS) + dc.DrawFocusRect (rect); + + // Draw the text of the item and its subitems. If the item is selected, + // the text color is set to COLOR_HIGHLIGHTTEXT first. Values for the + // item and subitems are retrieved through the CStringArray pointer + // initialized earlier, converted to text, and displayed by our own + // DrawItemText function. + if (lpdis->itemID != -1) + { + COLORREF crOld = NULL; + DWORD myColor; + if (lpdis->itemState & ODS_SELECTED) + myColor = ::GetSysColor(COLOR_HIGHLIGHTTEXT); + else + myColor = ::GetSysColor(COLOR_WINDOWTEXT); + + crOld = dc.SetTextColor(myColor); + + for (int nColumn = 0; nColumnGetAt(z), rect, nWidth, nFormat); + break; + } + } + + rect.left += nWidth; + } + + dc.SetTextColor(crOld); + } + + // Detach the control's DC from our own CDC object so the former won't + // be deleted when this function ends. + dc.Detach(); +} + +void CCB32View::DrawItemText(CDC* pDC, CString text, CRect rect, + int nWidth, int nFormat) +{ + // Make sure the text will fit in the prescribed rectangle, and truncate + // it if it won't. + BOOL bNeedDots = FALSE; + int nMaxWidth = nWidth - 4; + + if (nMaxWidth>1) + { + while (GetListCtrl().GetStringWidth((LPCTSTR) text) > (nMaxWidth - 4)) + { + text = text.Left(text.GetLength() - 1); + bNeedDots = TRUE; + } + } + else + bNeedDots = TRUE; + + if (bNeedDots) + { + if (text.GetLength() >= 1) + text = text.Left(text.GetLength() - 1); + text += "..."; + } + + // Draw the text into the rectangle using MFC's handy CDC::DrawText + // function. + rect.left += 2; + rect.right = rect.left + nMaxWidth; + + UINT nStyle = DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX; + if (nFormat == LVCFMT_LEFT) + nStyle |= DT_LEFT; + else if (nFormat == LVCFMT_CENTER) + nStyle |= DT_CENTER; + else // nFormat == LVCFMT_RIGHT + nStyle |= DT_RIGHT; + + pDC->DrawText(text, rect, nStyle); +} + +///////////////////////////////////////////////////////////////////////////// +// CCB32View printing + +BOOL CCB32View::OnPreparePrinting(CPrintInfo* pInfo) +{ + // default preparation + return DoPreparePrinting(pInfo); +} + +void CCB32View::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo) +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + TEXTMETRIC tm; + CDC *pCurrentDC; + + // OnBeginPrinting() is called after the user has committed to + // printing by OK'ing the Print dialog, and after the framework + // has created a CDC object for the printer or the preview view. + + // This is the right opportunity to set up the page range. + // Given the CDC object, we can determine how many rows will + // fit on a page, so we can in turn determine how many printed + // pages represent the entire document. + + ASSERT(pDC && pInfo); + if (!pDC || !pInfo) return; + + int nMaxRowCount = ctlList.GetItemCount(); + if (!nMaxRowCount) return; + + // Get a DC for the current window (will be a screen DC for print previewing) + VERIFY(pCurrentDC = GetDC()); /* will have dimensions of the client area */ + if (!pCurrentDC) return; + + CSize PaperPixelsPerInch(pDC->GetDeviceCaps(LOGPIXELSX), + pDC->GetDeviceCaps(LOGPIXELSY)); + CSize ScreenPixelsPerInch(pCurrentDC->GetDeviceCaps(LOGPIXELSX), + pCurrentDC->GetDeviceCaps(LOGPIXELSY)); + + // Create the printer font + int nFontSize = -9; + CString strFontName = _T("Times New Roman"); + + nFontSize = MulDiv(nFontSize, PaperPixelsPerInch.cy, ScreenPixelsPerInch.cy); + m_PrinterFont.CreateFont(nFontSize, 0,0,0, FW_NORMAL, 0,0,0, DEFAULT_CHARSET, + OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS, + DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, + strFontName); + + CFont *pOldFont = pDC->SelectObject(&m_PrinterFont); + + // Get the average character width (in ListCtrl units) + pCurrentDC->GetTextMetrics(&tm); + m_nCharWidth = tm.tmAveCharWidth; + m_nCharWidth = MulDiv(m_nCharWidth, PaperPixelsPerInch.cy, + ScreenPixelsPerInch.cy); + + int nMargins = (LEFT_MARGIN+RIGHT_MARGIN)*m_nCharWidth; + + // Scale the x axis to the ListCtrl's device units + CRect rc; + ctlList.GetItemRect(0, &rc, LVIR_BOUNDS); + m_nRowHeight = rc.Height(); + m_nRowHeight = MulDiv(m_nRowHeight, PaperPixelsPerInch.cy, + ScreenPixelsPerInch.cy); + + // Get the page size + CSize LogicalPageSize; + CSize PaperSize(pDC->GetDeviceCaps(HORZRES), + pDC->GetDeviceCaps(VERTRES)); + LogicalPageSize.cx = rc.Width()+nMargins; + LogicalPageSize.cy = MulDiv(LogicalPageSize.cx, PaperSize.cy, + PaperSize.cx); + + pDC->SetMapMode(MM_ANISOTROPIC); + pDC->SetWindowExt(LogicalPageSize); + pDC->SetViewportExt(PaperSize); + + /* This should set the preview DC's extents so preview works. It don't work! :( + if (pInfo->m_bPreview) { + CSize PreviewPageSize = PaperSize; + PreviewPageSize.cx = MulDiv(PaperSize.cx, ScreenPixelsPerInch.cx, + PaperPixelsPerInch.cx); + PreviewPageSize.cy = MulDiv(PaperSize.cy, ScreenPixelsPerInch.cy, + PaperPixelsPerInch.cy); + + SetWindowExtEx(pDC->m_hAttribDC, LogicalPageSize.cx, LogicalPageSize.cy, NULL); + SetViewportExtEx(pDC->m_hAttribDC, PreviewPageSize.cx, PreviewPageSize.cy, NULL); + } + */ + + // Calculate the number of rows per page + m_nRowsPerPage = LogicalPageSize.cy / m_nRowHeight; + m_nRowsPerPage -= (HEADER_HEIGHT+FOOTER_HEIGHT + 2*GAP); // Header and footer + m_nRowsPerPage -= 1; // List control header + int nMaxPage = nMaxRowCount/m_nRowsPerPage + 1; + + pInfo->SetMaxPage(nMaxPage); + pInfo->m_nCurPage = 1; // start printing at page# 1 + + ReleaseDC(pCurrentDC); + pDC->SelectObject(pOldFont); + + /* old code + + // OnBeginPrinting() is called after the user has committed to + // printing by OK'ing the Print dialog, and after the framework + // has created a CDC object for the printer or the preview view. + // This is the right opportunity to set up the page range. + // Given the CDC object, we can determine how many rows will + // fit on a page, so we can in turn determine how many printed + // pages represent the entire document. + if(NULL == pDC || NULL == pInfo) + return; + int nMaxRowCount = ctlList.GetItemCount(); + if(!nMaxRowCount) + return; + + //let us do all dimesions in ListControl units (Device) rather than + //printer device units. Since we have more control on them + CDC *pCtlDC = GetDC(); + if(NULL == pCtlDC) + return; + TEXTMETRIC tm; + pCtlDC->GetTextMetrics(&tm); + m_nCharWidth = tm.tmAveCharWidth; + pDC->SetMapMode(MM_ANISOTROPIC); + CRect rc; + ctlList.GetItemRect(0, &rc, LVIR_BOUNDS); + m_nRowHeight = rc.Height(); + int nMargins = (LEFT_MARGIN+RIGHT_MARGIN)*m_nCharWidth; + + //this will optimize the column widths. If we have more column than + //screen width and horizontal scroll on List control + //this will reduce the column widths proportonately to fit all of them + //on the page. If we have fewer column all the column + //widths will increased propertionately. + pDC->SetWindowExt(rc.Width() + nMargins, pCtlDC->GetDeviceCaps(LOGPIXELSX)); + pDC->SetViewportExt(pDC->GetDeviceCaps(HORZRES),pDC->GetDeviceCaps(LOGPIXELSX)); + double d = (double)pDC->GetDeviceCaps(LOGPIXELSY)/(double)pCtlDC->GetDeviceCaps(LOGPIXELSY); + ReleaseDC(pCtlDC); + nMargins = (int)(m_nRowHeight*d); + int nPageHeight = pDC->GetDeviceCaps(VERTRES); + m_nRowsPerPage = nPageHeight/nMargins; //nMargins reused + m_nRowsPerPage -= (HEADER_HEIGHT+FOOTER_HEIGHT); + m_nRowsPerPage -= 1; //adjustment for list control header + int nMaxPage = nMaxRowCount/m_nRowsPerPage + 1; + pInfo->SetMaxPage(nMaxPage); + pInfo->m_nCurPage = 1; // start printing at page# 1 + + */ // old code +} + +void CCB32View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) +{ + m_PrinterFont.DeleteObject(); +} + +void CCB32View::OnPrint(CDC* pDC, CPrintInfo* pInfo) +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + if (!pDC || !pInfo) return; + + CFont *pOldFont = pDC->SelectObject(&m_PrinterFont); + + // Draw as many rows as will fit on the printed page. + // Clip the printed page so that there is no partially shown + // row at the bottom of the page (the same row which will be fully + // shown at the top of the next page). + int nStartRow = 0; + int nEndRow = 0; + int nMaxRowCount = ctlList.GetItemCount(); + + nStartRow = (pInfo->m_nCurPage - 1)*m_nRowsPerPage; + nEndRow = nStartRow+m_nRowsPerPage; + if(nEndRow > nMaxRowCount) + nEndRow = nMaxRowCount; + + pDC->SetWindowOrg(-LEFT_MARGIN*m_nCharWidth, 0); + CRect rcPage(pInfo->m_rectDraw); + + // Header + pInfo->m_rectDraw.top = 0; + pInfo->m_rectDraw.left = 0; + pInfo->m_rectDraw.right = rcPage.right - (LEFT_MARGIN+RIGHT_MARGIN)*m_nCharWidth; + pInfo->m_rectDraw.bottom = HEADER_HEIGHT*m_nRowHeight; + PrintHeader(pDC, pInfo); + pDC->OffsetWindowOrg(0, -HEADER_HEIGHT*m_nRowHeight); + + // Gap between header and List control heading + pDC->OffsetWindowOrg(0, -GAP*m_nRowHeight); + + // Print the header control. + CRect HeaderCtrlrc; + m_headerctrl.GetClientRect(&HeaderCtrlrc); + pInfo->m_rectDraw.bottom = HeaderCtrlrc.Height(); + PrintColumnHeadings(pDC, pInfo); + //pDC->OffsetWindowOrg(0, -HeaderCtrlrc.Height()); + + // Print the list control + DRAWITEMSTRUCT DrawItemStruct; + DrawItemStruct.hDC = pDC->m_hDC; + for(int i = nStartRow; i < nEndRow; i++) { + DrawItemStruct.itemID = i; + DrawItem(&DrawItemStruct); + } + + // Footer + pInfo->m_rectDraw.bottom = FOOTER_HEIGHT*m_nRowHeight; + pDC->SetWindowOrg(-LEFT_MARGIN*m_nCharWidth, + -rcPage.bottom + pInfo->m_rectDraw.bottom); + PrintFooter(pDC, pInfo); + + // SetWindowOrg back for next page + pDC->SetWindowOrg(0,0); + pDC->SelectObject(pOldFont); + + /* old code + + if(NULL == pDC || NULL == pInfo) + return; + + // Draw as many rows as will fit on the printed page. + // Clip the printed page so that there is no partially shown + // row at the bottom of the page (the same row which will be fully + // shown at the top of the next page). + int nStartRow = 0; + int nEndRow = 0; + int nMaxRowCount = ctlList.GetItemCount(); + nStartRow = (pInfo->m_nCurPage - 1)*m_nRowsPerPage; + nEndRow = nStartRow+m_nRowsPerPage; + if(nEndRow > nMaxRowCount) + nEndRow = nMaxRowCount; + + //create bold font for header and footer + CFont *pOldFont = NULL; + CFont BoldFont; + LOGFONT lf; + pOldFont = GetFont(); + pOldFont->GetLogFont(&lf); + lf.lfWeight = FW_BOLD; + BoldFont.CreateFontIndirect(&lf); + pOldFont = pDC->SelectObject(&BoldFont); + int nPrevBkMode = pDC->SetBkMode(TRANSPARENT); + + //print the header + PrintHeader(pDC, pInfo); + + //Print the footer + PrintFooter(pDC, pInfo); + pDC->SetBkMode(nPrevBkMode); + pDC->SelectObject(pOldFont); + BoldFont.DeleteObject(); + + //Set origin to print header and Header control. Keep Y position at 0 to + //print header information + //Change Y position of origin to print List control header + //Adjust the List control origin to start printing after page margins + pDC->SetWindowOrg(-1*(LEFT_MARGIN*m_nCharWidth), -1*HEADER_HEIGHT*m_nRowHeight); + + //send a message to Header control to print itsef. There is little scope to improve printing header. + //I have m_HeaderCtrl in my class. If not take by HeaderCtrl = GetDlgItem(0); + m_headerctrl.SendMessage(WM_PAINT, (WPARAM)pDC->m_hDC); + + //Chage window position to take care of ListControl Horizontal scrolling. + //if List control is scrolled to left horizontally the above window origin + //will not start painting from first column, instead it starts painting from + //first visible column, because rcBounds etc are will have -ve left value + //Same thing with vertical scrolling also + CRect rcBounds; + ctlList.GetItemRect(nStartRow, &rcBounds, LVIR_BOUNDS); + + //offset top margin of rcBounds by ListControl header + CRect rc; + m_headerctrl.GetClientRect(&rc); + rcBounds.OffsetRect(0, -rc.Height()); + pDC->OffsetWindowOrg(rcBounds.left, rcBounds.top); + + //start printing rows + for(int i = nStartRow; i < nEndRow; i++) + DrawRow(pDC, i); + + //SetWindowOrg back for next page + pDC->SetWindowOrg(0,0); + return; + + */ // old code +} + +void CCB32View::PrintColumnHeadings(CDC *pDC, CPrintInfo *pInfo) +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + int nColumns = m_headerctrl.GetItemCount(); + //int nColumns = GetNumColumns(); + //CHeaderCtrl *pHeader = GetHeaderCtrl(); + int offset = pDC->GetTextExtent(_T(" "), 1 ).cx; + + CFont *pOldFont = pDC->SelectObject(&m_PrinterFont); + + // Get the bounds of the header control + CRect rc; + m_headerctrl.GetClientRect(rc); + rc.bottom = m_nRowHeight; + + // Setup our HD_ITEM to get text, width and format + TCHAR buf[256]; + HD_ITEM hditem; + hditem.mask = HDI_TEXT | HDI_FORMAT | HDI_WIDTH; + hditem.pszText = buf; + hditem.cchTextMax = 255; + + rc.right = 0; + for (int i = 0; i < nColumns; i++) + { + // Get the column text and format and width + m_headerctrl.GetItem(i, &hditem); + //pHeader->GetItem(i, &hditem); + rc.left = rc.right; + rc.right += hditem.cxy; + + // Workout the justification for the column heading + UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER; + if (hditem.fmt & HDF_CENTER) uFormat |= DT_CENTER; + else if( hditem.fmt & HDF_RIGHT) uFormat |= DT_RIGHT; + else uFormat |= DT_LEFT; + + // Draw the column heading + CRect rcLabel(rc); + rcLabel.DeflateRect(offset, 0); + pDC->DrawText(buf,-1, rcLabel, uFormat); + } + + // Draw a border around the header control + // NOTE: CDC::Rectangle doesn't draw to the edges of the bounding rectangle + CBrush* pOldBrush = (CBrush*) pDC->SelectStockObject(NULL_BRUSH); + CPen* pOldPen = (CPen*) pDC->SelectStockObject(BLACK_PEN); + + rc.left = 0; rc.right++; rc.bottom++; + pDC->Rectangle(rc); + + pDC->SelectObject(pOldBrush); + pDC->SelectObject(pOldPen); + pDC->SelectObject(pOldFont); +} + +void CCB32View::PrintHeader(CDC *pDC, CPrintInfo *pInfo) +{ + CRect rc(pInfo->m_rectDraw); + CString sTemp; + CFont BoldFont; + LOGFONT lf; + + //create bold font for header and footer + m_PrinterFont.GetLogFont(&lf); + lf.lfWeight = FW_BOLD; + BoldFont.CreateFontIndirect(&lf); + + CFont *pNormalFont = pDC->SelectObject(&BoldFont); + int nPrevBkMode = pDC->SetBkMode(TRANSPARENT); + + //print App title on top right margin + sTemp.LoadString(AFX_IDS_APP_TITLE); + pDC->DrawText(sTemp, &rc, + DT_RIGHT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER); + + pDC->SetBkMode(nPrevBkMode); + pDC->SelectObject(pNormalFont); + BoldFont.DeleteObject(); + + pDC->MoveTo(rc.left, rc.bottom); + pDC->LineTo(rc.right, rc.bottom); + + /* old code + CRect rc(pInfo->m_rectDraw); + CString sTemp; + + //Print App title + rc.left += LEFT_MARGIN*m_nCharWidth; + rc.right -= RIGHT_MARGIN*m_nCharWidth; + rc.bottom = rc.top+m_nRowHeight; + + //print App title on top right margin + sTemp.LoadString(AFX_IDS_APP_TITLE); + pDC->DrawText(sTemp, &rc, DT_RIGHT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER); + + //print Header. One row for each string + for (int pos = 0; posDrawText(sTemp, &rc, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER); + rc.OffsetRect(0, m_nRowHeight); + } + + */ // old code +} + +//print footer with a line and date, and page number +void CCB32View::PrintFooter(CDC *pDC, CPrintInfo *pInfo) +{ + CRect rc(pInfo->m_rectDraw); + CFont BoldFont; + LOGFONT lf; + + //draw line + pDC->MoveTo(rc.left, rc.top); + pDC->LineTo(rc.right, rc.top); + + //create bold font for header and footer + m_PrinterFont.GetLogFont(&lf); + lf.lfWeight = FW_BOLD; + BoldFont.CreateFontIndirect(&lf); + + CFont *pNormalFont = pDC->SelectObject(&BoldFont); + int nPrevBkMode = pDC->SetBkMode(TRANSPARENT); + + //draw page number + CString sTemp ; + rc.OffsetRect(0, m_nRowHeight/2); + sTemp.Format(IDS_PRINT_PAGE_TITLE, pInfo->m_nCurPage, pInfo->GetMaxPage()); + pDC->DrawText(sTemp,-1,rc, + DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP | DT_VCENTER); + + CTime t = CTime::GetCurrentTime(); + sTemp = t.Format("%c"); + pDC->DrawText(sTemp,-1,rc, + DT_RIGHT | DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP | DT_VCENTER); + + pDC->SetBkMode(nPrevBkMode); + pDC->SelectObject(pNormalFont); + BoldFont.DeleteObject(); + + /* old code + CRect rc(pInfo->m_rectDraw); + + //draw line + rc.left += LEFT_MARGIN*m_nCharWidth; + rc.right -= RIGHT_MARGIN*m_nCharWidth; + rc.top = rc.bottom - FOOTER_HEIGHT*m_nRowHeight; + rc.bottom = rc.top + m_nRowHeight; + pDC->MoveTo(rc.left, rc.top); + pDC->LineTo(rc.right, rc.top); + + //draw page number + CString sTemp ; + rc.OffsetRect(0, m_nRowHeight/2); + sTemp.Format(IDS_PRINT_PAGE_TITLE, pInfo->m_nCurPage); + pDC->DrawText(sTemp,-1,rc, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP | DT_VCENTER); + CTime t = CTime::GetCurrentTime(); + sTemp = t.Format("%c"); + pDC->DrawText(sTemp,-1,rc, DT_RIGHT | DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP | DT_VCENTER); + + */ // old code +} + +//this is drawing code copied RowList sample and from www.codeguru.com site +int CCB32View::DrawRow(CDC *pDC, int nItem) +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + CImageList *pImageList = NULL; + CFont *pOldFont = NULL; + CFont BoldFont; + CString sLabel; + UINT dtFlags = DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER; + int nSaveDC = pDC->SaveDC(); + if(!pDC->IsPrinting()) + dtFlags |= (DT_NOCLIP | DT_END_ELLIPSIS); //no clip because we add ellipsis at the end + + // get item data + LV_ITEM lvi; + lvi.mask = LVIF_IMAGE | LVIF_STATE | LVIF_INDENT; + lvi.iItem=nItem; + lvi.iSubItem=0; + lvi.stateMask=0xFFFF; // get all state flags + ctlList.GetItem(&lvi); + BOOL bHighlight = ((lvi.state & LVIS_DROPHILITED) || ((lvi.state & LVIS_SELECTED) + && ((GetFocus() == this) || (GetStyle() & LVS_SHOWSELALWAYS)))); + + //Get rectangles for painting + CRect rcBounds, rcLabel, rcIcon; + ctlList.GetItemRect(nItem, rcBounds, LVIR_BOUNDS); + ctlList.GetItemRect(nItem, rcLabel, LVIR_LABEL); + ctlList.GetItemRect(nItem, rcIcon, LVIR_ICON); + CRect rcCol(rcBounds); + CRect rcWnd; + sLabel = ctlList.GetItemText(nItem, 0); + + //Label offset + int offset = pDC->GetTextExtent(_T(" "), 1).cx; + CRect rcHighlight; + int nExt = 0; + switch(m_nHighlight) + { + case HIGHLIGHT_NORMAL: + nExt = pDC->GetOutputTextExtent(sLabel).cx + offset; + rcHighlight = rcLabel; + if(rcLabel.left + nExt < rcLabel.right) + rcHighlight.right = rcLabel.left + nExt; + break; + case HIGHLIGHT_ALLCOLUMNS: + rcHighlight = rcBounds; + rcHighlight.left = rcLabel.left; + break; + case HIGHLIGHT_ROW: + GetClientRect(&rcWnd); + rcHighlight = rcBounds; + rcHighlight.left = rcLabel.left; + rcHighlight.right = rcWnd.right; + break; + default: + rcHighlight.left = rcLabel.left; + break; + } + + //draw highlight. printing may not be required + if(bHighlight) + { + pDC->SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT)); + pDC->SetBkColor(::GetSysColor(COLOR_HIGHLIGHT)); + pDC->FillRect(rcHighlight, &CBrush(::GetSysColor(COLOR_HIGHLIGHT))); + } + else { + pDC->SetBkColor(::GetSysColor(COLOR_WINDOW)); + pDC->FillRect(rcHighlight, &CBrush(::GetSysColor(COLOR_WINDOW))); + } + + //set clip region + rcCol.right = rcCol.left + ctlList.GetColumnWidth(0); + + //Nice to have regions but they are not working on printer DC we may need + //to take get device caps to support regions. Does not seems to help much now + //CRgn rgn; + //rgn.CreateRectRgnIndirect(&rcCol); + //pDC->SelectClipRgn(&rgn); + //rgn.DeleteObject(); + + //Draw state icon + if(lvi.state & LVIS_STATEIMAGEMASK) + { + int nImage = ((lvi.state & LVIS_STATEIMAGEMASK) >> 12) - 1; + pImageList = ctlList.GetImageList(LVSIL_STATE); + //offset the state image icon indent levels. + nExt = rcCol.left + lvi.iIndent*rcIcon.Width(); //nExt reused + if(pImageList) + pImageList->Draw(pDC, nImage, CPoint(nExt, rcCol.top), ILD_TRANSPARENT); + } + + //Draw Normal and overlay icon + pImageList = ctlList.GetImageList(LVSIL_SMALL); //assuming printing in report mode only + if(pImageList) + { + UINT nOvlImageMask = lvi.state & LVIS_OVERLAYMASK; + pImageList->Draw(pDC, lvi.iImage, CPoint(rcIcon.left, rcIcon.top), + (bHighlight?ILD_BLEND50:0)|ILD_TRANSPARENT|nOvlImageMask); + } + + //if state image mask is on and indent is 0 then consider it as Server row + if((lvi.state & LVIS_STATEIMAGEMASK) && !lvi.iIndent) + { + //create bold font + LOGFONT lf; + pOldFont = GetFont();; + pOldFont->GetLogFont(&lf); + lf.lfWeight = FW_BOLD; + BoldFont.CreateFontIndirect(&lf); + pOldFont = pDC->SelectObject(&BoldFont); + rcLabel.right = rcBounds.right; //draw server name to full row width + } + + //Draw item label + rcLabel.left += offset/2; + rcLabel.right -= offset; + dtFlags |= DT_LEFT; + pDC->DrawText(sLabel, rcLabel, dtFlags); + if((lvi.state & LVIS_STATEIMAGEMASK) && !lvi.iIndent) + { + pOldFont = pDC->SelectObject(pOldFont); + BoldFont.DeleteObject(); + + //focus rect if required + if(lvi.state & LVIS_FOCUSED && (GetFocus() == this)) + pDC->DrawFocusRect(rcHighlight); + pDC->RestoreDC(nSaveDC); + return 0; + } + + //Draw labels for remaining columns + LV_COLUMN lvc; + lvc.mask = LVCF_FMT|LVCF_WIDTH; + if(m_nHighlight == HIGHLIGHT_NORMAL) + { + pDC->SetTextColor(::GetSysColor(COLOR_WINDOWTEXT)); + pDC->SetBkColor(::GetSysColor(COLOR_WINDOW)); + } + rcBounds.right = rcHighlight.right > rcBounds.right ? rcHighlight.right:rcBounds.right; + + //Nice to have regions but they are not working on printer DC we may need + //to take get device caps to support regions. Does not seems to help much now + //rgn.CreateRectRgnIndirect(&rcBounds); + //pDC->SelectClipRgn(&rgn); + //rgn.DeleteObject(); + + for(int nColumn = 1; ctlList.GetColumn(nColumn, &lvc); nColumn++) + { + rcCol.left = rcCol.right; + rcCol.right += lvc.cx; + + //draw background if needed + if(m_nHighlight == HIGHLIGHT_NORMAL) + pDC->FillRect(rcCol, &CBrush(::GetSysColor(COLOR_WINDOW))); + sLabel = ctlList.GetItemText(nItem, nColumn); + if(sLabel.IsEmpty()) + continue; + + //Get the text justification + UINT nJustify = DT_LEFT; + switch(lvc.fmt & LVCFMT_JUSTIFYMASK) + { + case LVCFMT_RIGHT: + nJustify = DT_RIGHT; + break; + case LVCFMT_CENTER: + nJustify = DT_CENTER; + break; + default: + break; + } + rcLabel = rcCol; + rcLabel.left += offset; + rcLabel.right -= offset; + dtFlags &= ~DT_RIGHT; + dtFlags &= ~DT_CENTER; + dtFlags |= nJustify; + pDC->DrawText(sLabel, -1, rcLabel, dtFlags); + } + + //focus rect if required + if(lvi.state & LVIS_FOCUSED && (GetFocus() == this)) + pDC->DrawFocusRect(rcHighlight); + pDC->RestoreDC(nSaveDC); + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// CCB32View diagnostics + +#ifdef _DEBUG +void CCB32View::AssertValid() const +{ + CListView::AssertValid(); +} + +void CCB32View::Dump(CDumpContext& dc) const +{ + CListView::Dump(dc); +} + +CCB32Doc* CCB32View::GetDocument() // non-debug version is inline +{ + ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCB32Doc))); + return (CCB32Doc*)m_pDocument; +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CCB32View message handlers + +BOOL CCB32View::PreTranslateMessage(MSG* pMsg) +{ + // Shift+F10: show pop-up menu. + if ((((pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN) && // If we hit a key and + (pMsg->wParam == VK_F10) && (GetKeyState(VK_SHIFT) & ~1)) != 0) || // it's Shift+F10 OR + (pMsg->message == WM_CONTEXTMENU)) // Natural keyboard key + { + CRect rect; + GetClientRect(rect); + ClientToScreen(rect); + + CPoint point = rect.TopLeft(); + point.Offset(50, 50); + OnContextMenu(NULL, point); + + return TRUE; + } + + return CListView::PreTranslateMessage(pMsg); +} + +void CCB32View::OnDestroy() +{ + FreeItems(); + + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberCol"),1)) + { + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + CString strCols, strTemp; + strCols.Format("%d",ctlList.GetColumnWidth(0)); + for (int i=1;iDelete (); + return; + } + pItem->SetSize(COLS); + + GetPropData(pItem, propinfo); + AddItemToListView(pItem); + SortDatabase(); + + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + LV_FINDINFO lvfind; + lvfind.flags = LVFI_PARAM; + lvfind.lParam = (LPARAM) pItem; + int iIndex = ctlList.FindItem(&lvfind, -1); + if (iIndex > -1) + { + ctlList.SetItemState(iIndex, LVIS_SELECTED | LVIS_FOCUSED, + LVIS_SELECTED | LVIS_FOCUSED); + ctlList.EnsureVisible(iIndex,FALSE); + } + + GetDocument()->SetModifiedFlag(); + GetDocument()->UpdateAllViews(NULL); + } +} + +void CCB32View::OnEntryEdit() +{ + int iItemIndex; + CStringArray* pItem; + CPropInfo propinfo(IDS_ENTRYEDIT); + propinfo.m_psh.dwFlags |= PSH_NOAPPLYNOW; + + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + iItemIndex = ctlList.GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + + propinfo.AddControlPages(); + SetPropData(propinfo, pItem); + + if (propinfo.DoModal()==IDOK) + { + GetPropData(pItem, propinfo); + UpdateItemInListView(pItem, iItemIndex); + ctlList.SetItemState(iItemIndex, LVIS_SELECTED | LVIS_FOCUSED, + LVIS_SELECTED | LVIS_FOCUSED); + SortDatabase(); + iItemIndex = ctlList.GetNextItem(-1, LVNI_FOCUSED); + ctlList.EnsureVisible(iItemIndex, FALSE); + GetDocument()->SetModifiedFlag(); + GetDocument()->UpdateAllViews(NULL); + } + } +} + +void CCB32View::OnEntryDelete() +{ + int iItemIndex; + CStringArray* pItem; + UINT nState = LVIS_SELECTED | LVIS_FOCUSED; + UINT nMask = LVIS_SELECTED | LVIS_FOCUSED; + + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + iItemIndex = ctlList.GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + if (theApp.GetProfileInt(_T("Preferences"),_T("ConfirmDelete"),1)) + { + if (AfxMessageBox(IDS_CONFIRM, MB_YESNO) == IDNO) + return; + } + + pItem = (CStringArray*) ctlList.GetItemData(iItemIndex); + delete pItem; + ctlList.DeleteItem(iItemIndex); + GetDocument()->SetModifiedFlag(); + GetDocument()->UpdateAllViews(NULL); + + iItemIndex = ctlList.GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + GetParentFrame()->ActivateFrame(); + ctlList.EnsureVisible(iItemIndex, FALSE); + ctlList.SetItemState(iItemIndex, nState, nMask); + ctlList.SetRedraw(TRUE); + ctlList.Invalidate(); + } + } +} + +void CCB32View::OnEntryCopy() +{ + CPropInfo propinfo(IDS_ENTRYCOPY); + propinfo.m_psh.dwFlags |= PSH_NOAPPLYNOW; + CStringArray* pItemOrig; + CStringArray* pItemCopy; + int iItemIndex; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItemOrig = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + + propinfo.AddControlPages(); + SetPropData(propinfo, pItemOrig); + CString strCopy; + strCopy.LoadString(IDS_COPY); + propinfo.m_propadd.m_lname += strCopy; + + if (propinfo.DoModal()==IDOK) + { + try + { + pItemCopy = new CStringArray; + } + catch (CMemoryException* e) + { + e->Delete (); + return; + } + pItemCopy->SetSize(COLS); + + GetPropData(pItemCopy, propinfo); + AddItemToListView(pItemCopy); + SortDatabase(); + + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + LV_FINDINFO lvfind; + lvfind.flags = LVFI_PARAM; + lvfind.lParam = (LPARAM) pItemCopy; + int iIndex = ctlList.FindItem(&lvfind, -1); + if (iIndex > -1) + { + ctlList.SetItemState(iIndex, LVIS_SELECTED | LVIS_FOCUSED, + LVIS_SELECTED | LVIS_FOCUSED); + ctlList.EnsureVisible(iIndex,FALSE); + } + + GetDocument()->SetModifiedFlag(); + GetDocument()->UpdateAllViews(NULL); + } + } +} + +void CCB32View::OnUpdateEntryEdit(CCmdUI* pCmdUI) +{ + int iItemIndex; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_SELECTED); + if (iItemIndex < 0) + { + pCmdUI->Enable(FALSE); + } +} + +void CCB32View::OnUpdateEntryDelete(CCmdUI* pCmdUI) +{ + int iItemIndex; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_SELECTED); + if (iItemIndex < 0) + { + pCmdUI->Enable(FALSE); + } +} + +void CCB32View::OnUpdateEntryCopy(CCmdUI* pCmdUI) +{ + int iItemIndex; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_SELECTED); + if (iItemIndex < 0) + { + pCmdUI->Enable(FALSE); + } +} + +void CCB32View::OnLButtonDblClk(UINT nFlags, CPoint point) +{ + OnEntryEdit(); + + CListView::OnLButtonDblClk(nFlags, point); +} + +void CCB32View::OnContextMenu(CWnd* pWnd, CPoint point) +{ + + CMenu menu; + VERIFY(menu.LoadMenu(IDR_CONTEXTMENU)); + + CMenu* pPopup = menu.GetSubMenu(0); + ASSERT(pPopup != NULL); + + CWnd* pWndPopupOwner = this; + while (pWndPopupOwner->GetStyle() & WS_CHILD) + pWndPopupOwner = pWndPopupOwner->GetParent(); + + pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, + pWndPopupOwner); + +} + +//////////////////////////////////////////////////////////////////// +// Supporting functions + +void CCB32View::ChangeListCtrlStyle(long lStyle, BOOL bSetBit) +{ + long lStyleOld; + lStyleOld = GetWindowLong(m_hWnd, GWL_STYLE); + lStyleOld &= ~lStyle; + if (bSetBit) + lStyleOld |= lStyle; + + SetWindowLong(m_hWnd, GWL_STYLE, lStyleOld); + SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_SHOWWINDOW); +} + +BOOL CCB32View::AddDocItemToListView(CExpr* expr) +{ + // Allocate an CStringArray structure to hold the item's data. + CStringArray* pItem; + try { + pItem = new CStringArray; + } + catch (CMemoryException* e) { + e->Delete (); + return FALSE; + } + pItem->SetSize(COLS); + + // Initialize the CStringArray structure's fields. + CString sText; + if(expr->GetAttributeValue("LastName", sText)) + pItem->SetAt(0, sText); + if(expr->GetAttributeValue("FirstName", sText)) + pItem->SetAt(1, sText); + if(expr->GetAttributeValue("MiddleInitial", sText)) + pItem->SetAt(2, sText); + if(expr->GetAttributeValue("Title", sText)) + pItem->SetAt(3, sText); + if(expr->GetAttributeValue("Address1", sText)) + pItem->SetAt(4, sText); + if(expr->GetAttributeValue("Address2", sText)) + pItem->SetAt(5, sText); + if(expr->GetAttributeValue("City", sText)) + pItem->SetAt(6, sText); + if(expr->GetAttributeValue("Country", sText)) + pItem->SetAt(7, sText); + if(expr->GetAttributeValue("State", sText)) + pItem->SetAt(8, sText); + if(expr->GetAttributeValue("ZipCode", sText)) + pItem->SetAt(9, sText); + + if(expr->GetAttributeValue("Company", sText)) + pItem->SetAt(10, sText); + if(expr->GetAttributeValue("Department", sText)) + pItem->SetAt(11, sText); + if(expr->GetAttributeValue("Position", sText)) + pItem->SetAt(12, sText); + if(expr->GetAttributeValue("Manager", sText)) + pItem->SetAt(13, sText); + if(expr->GetAttributeValue("Additional1", sText)) + pItem->SetAt(14, sText); + if(expr->GetAttributeValue("Additional2", sText)) + pItem->SetAt(15, sText); + + if(expr->GetAttributeValue("HomePhone", sText)) + pItem->SetAt(16, sText); + if(expr->GetAttributeValue("HomeExt", sText)) + pItem->SetAt(17, sText); + if(expr->GetAttributeValue("WorkPhone", sText)) + pItem->SetAt(18, sText); + if(expr->GetAttributeValue("WorkExt", sText)) + pItem->SetAt(19, sText); + if(expr->GetAttributeValue("CellPhone", sText)) + pItem->SetAt(20, sText); + if(expr->GetAttributeValue("CellExt", sText)) + pItem->SetAt(21, sText); + if(expr->GetAttributeValue("Pager", sText)) + pItem->SetAt(22, sText); + if(expr->GetAttributeValue("PagerCard", sText)) + pItem->SetAt(23, sText); + if(expr->GetAttributeValue("PagerExt", sText)) + pItem->SetAt(24, sText); + if(expr->GetAttributeValue("FaxPhone", sText)) + pItem->SetAt(25, sText); + if(expr->GetAttributeValue("FaxExt", sText)) + pItem->SetAt(26, sText); + + if(expr->GetAttributeValue("Email1", sText)) + pItem->SetAt(27, sText); + if(expr->GetAttributeValue("Email2", sText)) + pItem->SetAt(28, sText); + if(expr->GetAttributeValue("Web1", sText)) + pItem->SetAt(29, sText); + if(expr->GetAttributeValue("Web2", sText)) + pItem->SetAt(30, sText); + if(expr->GetAttributeValue("Notes", sText)) + pItem->SetAt(31, sText); + + // Add an item to the list view control, and set the item's lParam + // equal to the address of the corresponding CStringArray structure. + LV_ITEM lvi; + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; + lvi.iItem = GetListCtrl ().GetItemCount (); + lvi.iSubItem = 0; + lvi.iImage = 0; + lvi.pszText = NULL; + lvi.lParam = (LPARAM) pItem; + + if (GetListCtrl ().InsertItem (&lvi) == -1) + return FALSE; + + return TRUE; +} + +BOOL CCB32View::AddItemToListView(CStringArray* pItem) +{ + // Add an item to the list view control, and set the item's lParam + // equal to the address of the corresponding CStringArray structure. + LV_ITEM lvi; + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; + lvi.iItem = GetListCtrl ().GetItemCount (); + lvi.iSubItem = 0; + lvi.iImage = 0; + lvi.pszText = NULL; + lvi.lParam = (LPARAM) pItem; + + if (GetListCtrl ().InsertItem (&lvi) == -1) + return FALSE; + + return TRUE; +} + +BOOL CCB32View::UpdateItemInListView(CStringArray* pItem, int iIndex) +{ + // Update an item to the list view control, and set the item's lParam + // equal to the address of the corresponding CStringArray structure. + LV_ITEM lvi; + lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; + lvi.iItem = iIndex; + lvi.iSubItem = 0; + lvi.iImage = 0; + lvi.pszText = NULL; + lvi.lParam = (LPARAM) pItem; + + if (GetListCtrl().SetItem (&lvi) == -1) + return FALSE; + + return TRUE; +} + +void CCB32View::FreeItems() +{ + // Delete the CStringArray structures allocated when the control was created. + int nCount = GetListCtrl ().GetItemCount (); + if (nCount) { + for (int i=0; iSetAt(0, propinfo.m_propadd.m_lname); + pItem->SetAt(1, propinfo.m_propadd.m_fname); + pItem->SetAt(2, propinfo.m_propadd.m_mi); + pItem->SetAt(3, propinfo.m_propadd.m_title); + pItem->SetAt(4, propinfo.m_propadd.m_add1); + pItem->SetAt(5, propinfo.m_propadd.m_add2); + pItem->SetAt(6, propinfo.m_propadd.m_city); + pItem->SetAt(7, propinfo.m_propadd.m_country); + pItem->SetAt(8, propinfo.m_propadd.m_state); + pItem->SetAt(9, propinfo.m_propadd.m_zipcode); + + pItem->SetAt(10, propinfo.m_propcomp.m_comp); + pItem->SetAt(11, propinfo.m_propcomp.m_dept); + pItem->SetAt(12, propinfo.m_propcomp.m_posn); + pItem->SetAt(13, propinfo.m_propcomp.m_mgr); + pItem->SetAt(14, propinfo.m_propcomp.m_cadd1); + pItem->SetAt(15, propinfo.m_propcomp.m_cadd2); + + pItem->SetAt(16, propinfo.m_propphone.m_hphone); + pItem->SetAt(17, propinfo.m_propphone.m_hphonex); + pItem->SetAt(18, propinfo.m_propphone.m_wphone); + pItem->SetAt(19, propinfo.m_propphone.m_wphonex); + pItem->SetAt(20, propinfo.m_propphone.m_cellular); + pItem->SetAt(21, propinfo.m_propphone.m_cellularx); + pItem->SetAt(22, propinfo.m_propphone.m_pager); + pItem->SetAt(23, propinfo.m_propphone.m_pagerc); + pItem->SetAt(24, propinfo.m_propphone.m_pagerx); + pItem->SetAt(25, propinfo.m_propphone.m_fax); + pItem->SetAt(26, propinfo.m_propphone.m_faxx); + + pItem->SetAt(27, propinfo.m_proponline.m_email1); + pItem->SetAt(28, propinfo.m_proponline.m_email2); + pItem->SetAt(29, propinfo.m_proponline.m_web1); + pItem->SetAt(30, propinfo.m_proponline.m_web2); + pItem->SetAt(31, Sub("\x0d\x0a","

",propinfo.m_propnote.m_notes)); + + return TRUE; +} + +BOOL CCB32View::SetPropData (CPropInfo& propinfo, CStringArray* pItem) +{ + propinfo.m_propadd.m_lname = pItem->GetAt(0); + propinfo.m_propadd.m_fname = pItem->GetAt(1); + propinfo.m_propadd.m_mi = pItem->GetAt(2); + propinfo.m_propadd.m_title = pItem->GetAt(3); + propinfo.m_propadd.m_add1 = pItem->GetAt(4); + propinfo.m_propadd.m_add2 = pItem->GetAt(5); + propinfo.m_propadd.m_city = pItem->GetAt(6); + propinfo.m_propadd.m_country = pItem->GetAt(7); + propinfo.m_propadd.m_state = pItem->GetAt(8); + propinfo.m_propadd.m_zipcode = pItem->GetAt(9); + + propinfo.m_propcomp.m_comp = pItem->GetAt(10); + propinfo.m_propcomp.m_dept = pItem->GetAt(11); + propinfo.m_propcomp.m_posn = pItem->GetAt(12); + propinfo.m_propcomp.m_mgr = pItem->GetAt(13); + propinfo.m_propcomp.m_cadd1 = pItem->GetAt(14); + propinfo.m_propcomp.m_cadd2 = pItem->GetAt(15); + + propinfo.m_propphone.m_hphone = pItem->GetAt(16); + propinfo.m_propphone.m_hphonex = pItem->GetAt(17); + propinfo.m_propphone.m_wphone = pItem->GetAt(18); + propinfo.m_propphone.m_wphonex = pItem->GetAt(19); + propinfo.m_propphone.m_cellular = pItem->GetAt(20); + propinfo.m_propphone.m_cellularx = pItem->GetAt(21); + propinfo.m_propphone.m_pager = pItem->GetAt(22); + propinfo.m_propphone.m_pagerc = pItem->GetAt(23); + propinfo.m_propphone.m_pagerx = pItem->GetAt(24); + propinfo.m_propphone.m_fax = pItem->GetAt(25); + propinfo.m_propphone.m_faxx = pItem->GetAt(26); + + propinfo.m_proponline.m_email1 = pItem->GetAt(27); + propinfo.m_proponline.m_email2 = pItem->GetAt(28); + propinfo.m_proponline.m_web1 = pItem->GetAt(29); + propinfo.m_proponline.m_web2 = pItem->GetAt(30); + propinfo.m_propnote.m_notes = Sub("

","\x0d\x0a",pItem->GetAt(31)); + + return TRUE; +} + +CString CCB32View::Sub(const CString& from, const CString& to, CString& str) +{ + CString strRet = str; + int find = strRet.Find(from); + while (find >=0) { + strRet = strRet.Left(find) + to + (strRet.Right(strRet.GetLength()-find-from.GetLength())); + find = strRet.Find(from); + } + return strRet; +} + +///////////////////////////////////////////////////////////////////////////// +// Callback functions for sorting + +// Ascending +int CALLBACK CCB32View::CompareFuncAsc (LPARAM lParam1, LPARAM lParam2, + LPARAM lParamSort) +{ + CStringArray* pItem1 = (CStringArray*) lParam1; + CStringArray* pItem2 = (CStringArray*) lParam2; + + return pItem1->GetAt(lParamSort).CompareNoCase(pItem2->GetAt(lParamSort)); +} + +// Descending +int CALLBACK CCB32View::CompareFuncDec (LPARAM lParam1, LPARAM lParam2, + LPARAM lParamSort) +{ + CStringArray* pItem1 = (CStringArray*) lParam1; + CStringArray* pItem2 = (CStringArray*) lParam2; + + return pItem2->GetAt(lParamSort).CompareNoCase(pItem1->GetAt(lParamSort)); +} + +///////////////////////////////////////////////////////////////////// +// translate items from ListView to database + +BOOL CCB32View::MakeExpr(CExpr* expr, CStringArray* pItem) +{ + expr->AddAttributeValueString("LastName", pItem->GetAt(0)); + expr->AddAttributeValueString("FirstName", pItem->GetAt(1)); + expr->AddAttributeValueString("MiddleInitial", pItem->GetAt(2)); + expr->AddAttributeValueString("Title", pItem->GetAt(3)); + expr->AddAttributeValueString("Address1", pItem->GetAt(4)); + expr->AddAttributeValueString("Address2", pItem->GetAt(5)); + expr->AddAttributeValueString("City", pItem->GetAt(6)); + expr->AddAttributeValueString("Country", pItem->GetAt(7)); + expr->AddAttributeValueString("State", pItem->GetAt(8)); + expr->AddAttributeValueString("ZipCode", pItem->GetAt(9)); + + expr->AddAttributeValueString("Company", pItem->GetAt(10)); + expr->AddAttributeValueString("Department", pItem->GetAt(11)); + expr->AddAttributeValueString("Position", pItem->GetAt(12)); + expr->AddAttributeValueString("Manager", pItem->GetAt(13)); + expr->AddAttributeValueString("Additional1", pItem->GetAt(14)); + expr->AddAttributeValueString("Additional2", pItem->GetAt(15)); + + expr->AddAttributeValueString("HomePhone", pItem->GetAt(16)); + expr->AddAttributeValueString("HomeExt", pItem->GetAt(17)); + expr->AddAttributeValueString("WorkPhone", pItem->GetAt(18)); + expr->AddAttributeValueString("WorkExt", pItem->GetAt(19)); + expr->AddAttributeValueString("CellPhone", pItem->GetAt(20)); + expr->AddAttributeValueString("CellExt", pItem->GetAt(21)); + expr->AddAttributeValueString("Pager", pItem->GetAt(22)); + expr->AddAttributeValueString("PagerCard", pItem->GetAt(23)); + expr->AddAttributeValueString("PagerExt", pItem->GetAt(24)); + expr->AddAttributeValueString("FaxPhone", pItem->GetAt(25)); + expr->AddAttributeValueString("FaxExt", pItem->GetAt(26)); + + expr->AddAttributeValueString("Email1", pItem->GetAt(27)); + expr->AddAttributeValueString("Email2", pItem->GetAt(28)); + expr->AddAttributeValueString("Web1", pItem->GetAt(29)); + expr->AddAttributeValueString("Web2", pItem->GetAt(30)); + expr->AddAttributeValueString("Notes", pItem->GetAt(31)); + + return TRUE; +} + +void CCB32View::MakeDatabase() +{ + CWaitCursor wait; + CStringArray* pItem; + int iNumItems; + + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + iNumItems = ctlList.GetItemCount(); + CExprDatabase& db = GetDocument()->GetDB(); + // db.ClearDatabase(); + for (int i=0; iGetDB(); + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + // get count of possible items + ctlList.SetRedraw(FALSE); + ctlList.SetItemCount(db.GetItemCount()); + + // add items to listview + wxNode *node = db.First(); + while (node) + { + CExpr *expr = (CExpr *)node->Data(); + CString strType = expr->Functor(); + if (strType == "contact") + { + if (!AddDocItemToListView (expr)) + break; + } + node = node->Next(); + } + db.ClearDatabase(); + SortDatabase(); + ctlList.SetRedraw(TRUE); + ctlList.Invalidate(); +} + + +void CCB32View::OnEditFind() +{ + int iItemIndex; + CComboBox& comboBox = ((CMainFrame*)AfxGetMainWnd())->m_wndToolBar.m_toolBarCombo; + + if(m_pFindDialog->DoModal() != IDOK) + return; + + ASSERT(m_pFindDialog->m_szText.GetLength()); + + // add it to the combo control on the toolbar + comboBox.SetWindowText(m_pFindDialog->m_szText); + m_searchHistory.AddString(m_pFindDialog->m_szText); + + iItemIndex = -1; + if (!m_pFindDialog->m_bStartTop) + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_SELECTED); + + if (m_pFindDialog->m_szText.GetLength()) + FindNextItem(m_pFindDialog->m_szText, m_pFindDialog->m_nWhichName, + m_pFindDialog->m_nDirection, m_pFindDialog->m_bMatchCase, + iItemIndex); +} + +void CCB32View::OnUpdateEditFind(CCmdUI* pCmdUI) +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + pCmdUI->Enable(ctlList.GetItemCount()>0); +} + +void CCB32View::OnViewFindNext(CString &s1) +{ + int iItemIndex = -1; + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + if (!m_pFindDialog->m_bStartTop) + { + iItemIndex = ctlList.GetNextItem(-1, LVNI_SELECTED) +1; + if ((iItemIndex + 1) >= ctlList.GetItemCount()) + iItemIndex = -1; + } + + FindNextItem(s1, m_pFindDialog->m_nWhichName, m_pFindDialog->m_nDirection, + m_pFindDialog->m_bMatchCase, iItemIndex); +} + +void CCB32View::OnViewFindNext() +{ + // if the user presses F3, see if there is a search pattern. if not, ask for one + if (m_pFindDialog->m_szText.GetLength()) + { + int iItemIndex = -1; + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + if (!m_pFindDialog->m_bStartTop) + { + iItemIndex = ctlList.GetNextItem(-1, LVNI_SELECTED) + 1; + if ((iItemIndex + 1) >= ctlList.GetItemCount()) + iItemIndex = -1; + } + + FindNextItem(m_pFindDialog->m_szText, m_pFindDialog->m_nWhichName, + m_pFindDialog->m_nDirection, m_pFindDialog->m_bMatchCase, + iItemIndex); + } + else + PostMessage(WM_COMMAND, ID_EDIT_FIND); +} + +void CCB32View::OnUpdateViewFindNext(CCmdUI* pCmdUI) +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + pCmdUI->Enable(ctlList.GetItemCount()>0); +} + +void CCB32View::FindNextItem(CString szText, int iName, int iDir, + BOOL bMatch, int iStart) +{ + CStringArray* pItem; + int iIndex; + CString szLookFor, szLookIn; + UINT nState = LVIS_SELECTED | LVIS_FOCUSED; + UINT nMask = LVIS_SELECTED | LVIS_FOCUSED; + + if (szText.IsEmpty()) + return; + + szLookFor.Empty(); + szLookIn.Empty(); + + iIndex = ((iStart > -1) ? iStart : 0); + + szLookFor = szText; + if (bMatch == 0) + szLookFor.MakeLower(); + + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + if (ctlList.GetItemCount() < 2) + return; + + while (iIndex > -1) + { + pItem = (CStringArray*) ctlList.GetItemData(iIndex); + szLookIn = pItem->GetAt(iName); + + if (bMatch == 0) + szLookIn.MakeLower(); + + if (szLookIn.Find(szLookFor) > -1) + break; + + iIndex = ctlList.GetNextItem(iIndex, (iDir==1 ? LVNI_BELOW : LVNI_ABOVE)); + } + + if (iIndex > -1) + { + GetParentFrame()->ActivateFrame(); + ctlList.EnsureVisible(iIndex, FALSE); + ctlList.SetItemState(iIndex, nState, nMask); + ctlList.SetRedraw(TRUE); + ctlList.Invalidate(); + } + else + AfxMessageBox(IDS_NOTEXT); + +} + +void CCB32View::SortDatabase() +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberSort"),1)) + { + m_headerctrl.SetSortImage(nSortedCol, bSortAscending); + + // convert column click to contents index + LV_COLUMN lvc; + int iSortCol = nSortedCol; // iSort; + TCHAR sColText[160]; + lvc.mask = LVCF_WIDTH | LVCF_FMT | LVCF_TEXT; + lvc.pszText = sColText; + lvc.cchTextMax = 159; + ctlList.GetColumn(iSortCol, &lvc); + for (int z = 0; z < COLS; z++) + { + if (lvc.pszText == arLabel[z]) + { + iSortCol = z; + break; + } + } + if (bSortAscending) + ctlList.SortItems (CompareFuncAsc, iSortCol); + else + ctlList.SortItems (CompareFuncDec, iSortCol); + } +} + +void CCB32View::OnViewColset() +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + CString strCols, strTemp; + strCols.Format("%d",ctlList.GetColumnWidth(0)); + for (int i=1;i -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToCall(pItem->GetAt(16), pItem->GetAt(1)+' '+pItem->GetAt(0)); + } +} + +void CCB32View::OnUpdateDialHome(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + +void CCB32View::OnDialWork() +{ + int iItemIndex; + CStringArray* pItem; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToCall(pItem->GetAt(18), pItem->GetAt(1)+' '+pItem->GetAt(0)); + } +} + +void CCB32View::OnUpdateDialWork(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + +void CCB32View::OnDialPager() +{ + int iItemIndex; + CStringArray* pItem; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToCall(pItem->GetAt(22), pItem->GetAt(1)+' '+pItem->GetAt(0)); + } +} + +void CCB32View::OnUpdateDialPager(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + +void CCB32View::OnDialFax() +{ + int iItemIndex; + CStringArray* pItem; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToCall(pItem->GetAt(25), pItem->GetAt(1)+' '+pItem->GetAt(0)); + } +} + +void CCB32View::OnUpdateDialFax(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + +void CCB32View::OnDialCell() +{ + int iItemIndex; + CStringArray* pItem; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToCall(pItem->GetAt(20), pItem->GetAt(1)+' '+pItem->GetAt(0)); + } +} + +void CCB32View::OnUpdateDialCell(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + +void CCB32View::TryToCall(CString& dialme, CString myname) +{ + if (!dialme.IsEmpty()) + tapiRequestMakeCall(dialme,"",myname,""); + else + { + CGetNew getnew; + getnew.m_addinfo = theApp.GetProfileInt(_T("Preferences"), + _T("AddNewInfo"),1); + + if (getnew.DoModal()==IDOK) + { + theApp.WriteProfileInt(_T("Preferences"), + _T("AddNewInfo"),getnew.m_addinfo); + + if (!getnew.m_newinfo.IsEmpty()) + { + if (getnew.m_addinfo) + dialme = getnew.m_newinfo; + + tapiRequestMakeCall(getnew.m_newinfo,NULL,myname,NULL); + } + } + } + +} + +///////////////////////////////////////////////////////////////////// +// Email and Web functions + +void CCB32View::OnEmailAdd1() +{ + int iItemIndex; + CStringArray* pItem; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToLaunch(pItem->GetAt(27),"mailto:"); + } +} + +void CCB32View::OnUpdateEmailAdd1(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + + +void CCB32View::OnEmailAdd2() +{ + int iItemIndex; + CStringArray* pItem; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToLaunch(pItem->GetAt(28),"mailto:"); + } +} + +void CCB32View::OnUpdateEmailAdd2(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + +void CCB32View::OnUrl1() +{ + int iItemIndex; + CStringArray* pItem; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToLaunch(pItem->GetAt(29),"http://"); + } +} + +void CCB32View::OnUpdateUrl1(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + +void CCB32View::OnUrl2() +{ + int iItemIndex; + CStringArray* pItem; + + iItemIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + pItem = (CStringArray*) GetListCtrl().GetItemData(iItemIndex); + TryToLaunch(pItem->GetAt(30),"http://"); + } +} + +void CCB32View::OnUpdateUrl2(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(GetListCtrl().GetNextItem(-1,LVNI_FOCUSED) > -1); +} + +void CCB32View::TryToLaunch(CString& launchme, CString prefix) +{ + if (!launchme.IsEmpty()) + { + if (launchme.Find(prefix) == -1) + LaunchShortcut(prefix+launchme); + else + LaunchShortcut(launchme); + } + else + { + CGetNew getnew; + getnew.m_addinfo = theApp.GetProfileInt(_T("Preferences"), + _T("AddNewInfo"),1); + + if (getnew.DoModal()==IDOK) + { + theApp.WriteProfileInt(_T("Preferences"), + _T("AddNewInfo"),getnew.m_addinfo); + + if (!getnew.m_newinfo.IsEmpty()) + { + if (getnew.m_addinfo) + launchme = getnew.m_newinfo; + + if (getnew.m_newinfo.Find(prefix) == -1) + LaunchShortcut(prefix+getnew.m_newinfo); + else + LaunchShortcut(getnew.m_newinfo); + } + } + } + +} + +void CCB32View::LaunchShortcut(CString str_url) +{ + CStdioFile outFile; + CFileException e; + + if (!outFile.Open("CBLaunch.url", CFile::modeCreate | CFile::modeWrite | + CFile::shareDenyRead | CFile::shareDenyWrite | + CFile::typeText, &e)) + { + AfxThrowFileException(e.m_cause, e.m_lOsError); + return; + } + outFile.WriteString("[InternetShortcut]\n"); + outFile.WriteString("URL="+str_url+"\n"); + outFile.Close(); + ShellExecute((HWND)AfxGetMainWnd(),"open","CBLaunch.url",NULL, + NULL,SW_SHOWDEFAULT); +} + +//////////////////////////////////////////////////////////////////// +// Preferences implementation +void CCB32View::OnAppPrefs() +{ + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + CPrefPage prefpage(IDS_PREFS); + prefpage.m_psh.dwFlags |= PSH_NOAPPLYNOW; + prefpage.AddCtrlPages(); + + prefpage.m_prefset.m_setlastfile = theApp.GetProfileInt(_T("Preferences"),_T("UseLastBook"),1); + prefpage.m_prefset.m_setsort = theApp.GetProfileInt(_T("Preferences"),_T("RememberSort"),1); + prefpage.m_prefset.m_setcol = theApp.GetProfileInt(_T("Preferences"),_T("RememberCol"),1); + prefpage.m_prefset.m_setpos = theApp.GetProfileInt(_T("Preferences"),_T("RememberPos"),1); + prefpage.m_prefset.m_setexp = theApp.GetProfileInt(_T("Preferences"),_T("RememberExp"),1); + prefpage.m_prefset.m_setimp = theApp.GetProfileInt(_T("Preferences"),_T("RememberImp"),1); + prefpage.m_prefset.m_setwin = theApp.GetProfileInt(_T("Preferences"),_T("RememberWin"),1); + prefpage.m_prefset.m_settray = theApp.GetProfileInt(_T("Preferences"),_T("RememberTray"),1); + prefpage.m_prefset.m_setstart = theApp.GetProfileInt(_T("Preferences"),_T("StartMinimized"),0); + prefpage.m_prefset.m_setusemru = theApp.GetProfileInt(_T("Preferences"),_T("UseMRU"),1); + prefpage.m_prefset.m_setmru = theApp.GetProfileInt(_T("Preferences"),_T("NumMRU"),2); + prefpage.m_prefset.m_setcity = theApp.GetProfileString(_T("Preferences"),_T("DefaultCity"),NULL); + prefpage.m_prefset.m_setcountry = theApp.GetProfileString(_T("Preferences"),_T("DefaultCountry"),NULL); + prefpage.m_prefset.m_setcomp = theApp.GetProfileString(_T("Preferences"),_T("DefaultComp"),NULL); + prefpage.m_prefset.m_setemail = theApp.GetProfileString(_T("Preferences"),_T("DefaultEmail"),NULL); + prefpage.m_prefset.m_setprefix = theApp.GetProfileString(_T("Preferences"),_T("DefaultPrefix"),NULL); + prefpage.m_prefset.m_setstate = theApp.GetProfileString(_T("Preferences"),_T("DefaultState"),NULL); + prefpage.m_prefset.m_setweb = theApp.GetProfileString(_T("Preferences"),_T("DefaultWeb"),"http://"); + prefpage.m_prefset.m_setzip = theApp.GetProfileString(_T("Preferences"),_T("DefaultZip"),NULL); + prefpage.m_prefset.m_setdelete = theApp.GetProfileInt(_T("Preferences"),_T("ConfirmDelete"),1); + + prefpage.m_prefcol.m_clname = ctlList.GetColumnWidth(0); + prefpage.m_prefcol.m_cfname = ctlList.GetColumnWidth(1); + prefpage.m_prefcol.m_cmi = ctlList.GetColumnWidth(2); + prefpage.m_prefcol.m_ctitle = ctlList.GetColumnWidth(3); + prefpage.m_prefcol.m_cadd1 = ctlList.GetColumnWidth(4); + prefpage.m_prefcol.m_cadd2 = ctlList.GetColumnWidth(5); + prefpage.m_prefcol.m_ccity = ctlList.GetColumnWidth(6); + prefpage.m_prefcol.m_ccountry = ctlList.GetColumnWidth(7); + prefpage.m_prefcol.m_cstate = ctlList.GetColumnWidth(8); + prefpage.m_prefcol.m_czip = ctlList.GetColumnWidth(9); + + prefpage.m_prefcol.m_ccomp = ctlList.GetColumnWidth(10); + prefpage.m_prefcol.m_cdept = ctlList.GetColumnWidth(11); + prefpage.m_prefcol.m_cposn = ctlList.GetColumnWidth(12); + prefpage.m_prefcol.m_cmgr = ctlList.GetColumnWidth(13); + prefpage.m_prefcol.m_ccadd1 = ctlList.GetColumnWidth(14); + prefpage.m_prefcol.m_ccadd2 = ctlList.GetColumnWidth(15); + + prefpage.m_prefcol.m_chomep = ctlList.GetColumnWidth(16); + prefpage.m_prefcol.m_chomepx = ctlList.GetColumnWidth(17); + prefpage.m_prefcol.m_cworkp = ctlList.GetColumnWidth(18); + prefpage.m_prefcol.m_cworkpx = ctlList.GetColumnWidth(19); + prefpage.m_prefcol.m_ccell = ctlList.GetColumnWidth(20); + prefpage.m_prefcol.m_ccellx = ctlList.GetColumnWidth(21); + prefpage.m_prefcol.m_cpager = ctlList.GetColumnWidth(22); + prefpage.m_prefcol.m_cpagerc = ctlList.GetColumnWidth(23); + prefpage.m_prefcol.m_cpagerx = ctlList.GetColumnWidth(24); + prefpage.m_prefcol.m_cfax = ctlList.GetColumnWidth(25); + prefpage.m_prefcol.m_cfaxx = ctlList.GetColumnWidth(26); + + prefpage.m_prefcol.m_cemail1 = ctlList.GetColumnWidth(27); + prefpage.m_prefcol.m_cemail2 = ctlList.GetColumnWidth(28); + prefpage.m_prefcol.m_cweb1 = ctlList.GetColumnWidth(29); + prefpage.m_prefcol.m_cweb2 = ctlList.GetColumnWidth(30); + prefpage.m_prefcol.m_cnotes = ctlList.GetColumnWidth(31); + + if (prefpage.DoModal()==IDOK) + { + theApp.WriteProfileInt(_T("Preferences"),_T("UseLastBook"), + prefpage.m_prefset.m_setlastfile); + theApp.WriteProfileInt(_T("Preferences"),_T("RememberSort"), + prefpage.m_prefset.m_setsort); + theApp.WriteProfileInt(_T("Preferences"),_T("RememberCol"), + prefpage.m_prefset.m_setcol); + theApp.WriteProfileInt(_T("Preferences"),_T("RememberPos"), + prefpage.m_prefset.m_setpos); + theApp.WriteProfileInt(_T("Preferences"),_T("RememberExp"), + prefpage.m_prefset.m_setexp); + theApp.WriteProfileInt(_T("Preferences"),_T("RememberImp"), + prefpage.m_prefset.m_setimp); + theApp.WriteProfileInt(_T("Preferences"),_T("RememberWin"), + prefpage.m_prefset.m_setwin); + theApp.WriteProfileInt(_T("Preferences"),_T("RememberTray"), + prefpage.m_prefset.m_settray); + theApp.WriteProfileInt(_T("Preferences"),_T("StartMinimized"), + prefpage.m_prefset.m_setstart); + theApp.WriteProfileInt(_T("Preferences"),_T("UseMRU"), + prefpage.m_prefset.m_setusemru); + theApp.WriteProfileInt(_T("Preferences"),_T("NumMRU"), + prefpage.m_prefset.m_setmru); + theApp.WriteProfileString(_T("Preferences"),_T("DefaultCity"), + prefpage.m_prefset.m_setcity); + theApp.WriteProfileString(_T("Preferences"),_T("DefaultCountry"), + prefpage.m_prefset.m_setcountry); + theApp.WriteProfileString(_T("Preferences"),_T("DefaultComp"), + prefpage.m_prefset.m_setcomp); + theApp.WriteProfileString(_T("Preferences"),_T("DefaultEmail"), + prefpage.m_prefset.m_setemail); + theApp.WriteProfileString(_T("Preferences"),_T("DefaultPrefix"), + prefpage.m_prefset.m_setprefix); + theApp.WriteProfileString(_T("Preferences"),_T("DefaultState"), + prefpage.m_prefset.m_setstate); + theApp.WriteProfileString(_T("Preferences"),_T("DefaultWeb"), + prefpage.m_prefset.m_setweb); + theApp.WriteProfileString(_T("Preferences"),_T("DefaultZip"), + prefpage.m_prefset.m_setzip); + theApp.WriteProfileInt(_T("Preferences"),_T("ConfirmDelete"), + prefpage.m_prefset.m_setdelete); + + if (prefpage.m_prefset.m_setcol == 1) + { + ctlList.SetRedraw(FALSE); + + ctlList.SetColumnWidth(0,prefpage.m_prefcol.m_clname); + ctlList.SetColumnWidth(1,prefpage.m_prefcol.m_cfname); + ctlList.SetColumnWidth(2,prefpage.m_prefcol.m_cmi); + ctlList.SetColumnWidth(3,prefpage.m_prefcol.m_ctitle); + ctlList.SetColumnWidth(4,prefpage.m_prefcol.m_cadd1); + ctlList.SetColumnWidth(5,prefpage.m_prefcol.m_cadd2); + ctlList.SetColumnWidth(6,prefpage.m_prefcol.m_ccity); + ctlList.SetColumnWidth(7,prefpage.m_prefcol.m_ccountry); + ctlList.SetColumnWidth(8,prefpage.m_prefcol.m_cstate); + ctlList.SetColumnWidth(9,prefpage.m_prefcol.m_czip); + + ctlList.SetColumnWidth(10,prefpage.m_prefcol.m_ccomp); + ctlList.SetColumnWidth(11,prefpage.m_prefcol.m_cdept); + ctlList.SetColumnWidth(12,prefpage.m_prefcol.m_cposn); + ctlList.SetColumnWidth(13,prefpage.m_prefcol.m_cmgr); + ctlList.SetColumnWidth(14,prefpage.m_prefcol.m_ccadd1); + ctlList.SetColumnWidth(15,prefpage.m_prefcol.m_ccadd2); + + ctlList.SetColumnWidth(16,prefpage.m_prefcol.m_chomep); + ctlList.SetColumnWidth(17,prefpage.m_prefcol.m_chomepx); + ctlList.SetColumnWidth(18,prefpage.m_prefcol.m_cworkp); + ctlList.SetColumnWidth(19,prefpage.m_prefcol.m_cworkpx); + ctlList.SetColumnWidth(20,prefpage.m_prefcol.m_ccell); + ctlList.SetColumnWidth(21,prefpage.m_prefcol.m_ccellx); + ctlList.SetColumnWidth(22,prefpage.m_prefcol.m_cpager); + ctlList.SetColumnWidth(23,prefpage.m_prefcol.m_cpagerc); + ctlList.SetColumnWidth(24,prefpage.m_prefcol.m_cpagerx); + ctlList.SetColumnWidth(25,prefpage.m_prefcol.m_cfax); + ctlList.SetColumnWidth(26,prefpage.m_prefcol.m_cfaxx); + + ctlList.SetColumnWidth(27,prefpage.m_prefcol.m_cemail1); + ctlList.SetColumnWidth(28,prefpage.m_prefcol.m_cemail2); + ctlList.SetColumnWidth(29,prefpage.m_prefcol.m_cweb1); + ctlList.SetColumnWidth(30,prefpage.m_prefcol.m_cweb2); + ctlList.SetColumnWidth(31,prefpage.m_prefcol.m_cnotes); + + CString strCols, strTemp; + strCols.Format("%d",ctlList.GetColumnWidth(0)); + for (int i=1;i dest) + source++; + + // Moving a col to position 0 is a special case + if (dest == 0) + for( int i = ctlList.GetItemCount()-1; i > -1 ; i-- ) + ctlList.SetItemText(i, 1, ctlList.GetItemText( i, 0) ); + + // Copy sub item from source to dest + for( int i = ctlList.GetItemCount()-1; i > -1 ; i-- ) + ctlList.SetItemText(i, dest, ctlList.GetItemText( i, source ) ); + + // Delete the source column, but not if it is the first + if( source != 0 ) + ctlList.DeleteColumn( source ); + else + { + // If source col is 0, then copy col# 1 to col#0 + // and then delete col# 1 + ctlList.GetColumn( 1, &lv_col ); + lv_col.iSubItem = 0; + ctlList.SetColumn( 0, &lv_col ); + for( int i = ctlList.GetItemCount()-1; i > -1 ; i-- ) + ctlList.SetItemText(i, 0, ctlList.GetItemText( i, 1) ); + ctlList.DeleteColumn( 1 ); + } + + Invalidate(); + + // Resort columns + for (int y=0; yiSubItem) + bSortAscending = !bSortAscending; + + nSortedCol = pNMListView->iSubItem; + + // convert column click to contents index + LV_COLUMN lvc; + int iSortCol = nSortedCol; // pNMListView->iSubItem; + TCHAR sColText[160]; + lvc.mask = LVCF_WIDTH | LVCF_FMT | LVCF_TEXT; + lvc.pszText = sColText; + lvc.cchTextMax = 159; + ctlList.GetColumn(iSortCol, &lvc); + for (int z = 0; z < COLS; z++) + { + if (lvc.pszText == arLabel[z]) + { + iSortCol = z; + break; + } + } + theApp.WriteProfileInt(_T("Preferences"),_T("SortDirection"),bSortAscending); + + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberSort"),1)) + theApp.WriteProfileInt(_T("Preferences"),_T("SortIndex"),nSortedCol); + + m_headerctrl.SetSortImage(nSortedCol, bSortAscending); + if (bSortAscending) + ctlList.SortItems(CompareFuncAsc, iSortCol); + else + ctlList.SortItems(CompareFuncDec, iSortCol); + + iItemIndex = ctlList.GetNextItem(-1, LVNI_FOCUSED); + if (iItemIndex > -1) + { + GetParentFrame()->ActivateFrame(); + ctlList.EnsureVisible(iItemIndex, FALSE); + ctlList.SetItemState(iItemIndex, nState, nMask); + ctlList.SetRedraw(TRUE); + ctlList.Invalidate(); + } + + *pResult = 0; +} + +void CCB32View::SaveColPos() +{ + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberPos"),1)) + { + CListCtrl& ctlList = (CListCtrl&) GetListCtrl(); + + int colpos[COLS]; + for (int p=0; p= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#define COLS 32 // number of columns + 1 + +class CFindDlg; // forward declarations + +#include "history.h" +#include "PropInfo.h" +#include "MyHeaderCtrl.h" + +class CCB32View : public CListView +{ +protected: // create from serialization only + CCB32View(); + DECLARE_DYNCREATE(CCB32View) + +// Attributes +public: + CCB32Doc* GetDocument(); + CFindDlg* m_pFindDialog; // find dialog + CHistoryList m_searchHistory; // last used search history list + CMyHeaderCtrl m_headerctrl; + CStringArray arLabel; + +protected: + int m_iFirst; + int nSortedCol; + BOOL bSortAscending; + + int m_nCharWidth; + int m_nRowHeight; + int m_nRowsPerPage; + int m_nHighlight; + CFont m_PrinterFont; + +// Operations +public: + void MakeDatabase(); + void AddDatabase(); + void SortDatabase(); + void OnViewFindNext(CString &s1); + CString Sub(const CString& from, const CString& to, CString& str); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CCB32View) + public: + virtual void OnDraw(CDC* pDC); // overridden to draw this view + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void OnInitialUpdate(); // called first time after construct + virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); + virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); + virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); + virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CCB32View(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + void DrawItemText (CDC*, CString, CRect, int, int); + BOOL AddDocItemToListView (CExpr*); + BOOL AddItemToListView (CStringArray*); + BOOL UpdateItemInListView (CStringArray*, int); + void FreeItems (); + BOOL GetPropData (CStringArray*, CPropInfo&); + BOOL SetPropData (CPropInfo&, CStringArray*); + void TryToCall(CString&, CString); + void TryToLaunch(CString&, CString); + void LaunchShortcut(CString); + + static int CALLBACK CompareFuncAsc (LPARAM, LPARAM, LPARAM); + static int CALLBACK CompareFuncDec (LPARAM, LPARAM, LPARAM); + + BOOL MakeExpr (CExpr*, CStringArray*); + + void FindNextItem(CString, int, int, BOOL, int); + + void DragColumn(int source, int dest); + void SaveColPos(); + void SetupColumns(); + + void PrintColumnHeadings(CDC *pDC, CPrintInfo *pInfo); + void PrintHeader(CDC *pDC, CPrintInfo *pInfo); + void PrintFooter(CDC *pDC, CPrintInfo *pInfo); + int DrawRow(CDC *pDC, int nItem); + +// Generated message map functions +protected: + //{{AFX_MSG(CCB32View) + afx_msg void MeasureItem (LPMEASUREITEMSTRUCT); + afx_msg void DrawItem (LPDRAWITEMSTRUCT); + afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDestroy(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnEntryAdd(); + afx_msg void OnEntryEdit(); + afx_msg void OnEntryDelete(); + afx_msg void OnUpdateEntryEdit(CCmdUI* pCmdUI); + afx_msg void OnUpdateEntryDelete(CCmdUI* pCmdUI); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnEditFind(); + afx_msg void OnUpdateEditFind(CCmdUI* pCmdUI); + afx_msg void OnViewFindNext(); + afx_msg void OnUpdateViewFindNext(CCmdUI* pCmdUI); + afx_msg void OnViewColset(); + afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); + afx_msg void OnDialHome(); + afx_msg void OnDialWork(); + afx_msg void OnUpdateDialHome(CCmdUI* pCmdUI); + afx_msg void OnUpdateDialWork(CCmdUI* pCmdUI); + afx_msg void OnDialCell(); + afx_msg void OnUpdateDialCell(CCmdUI* pCmdUI); + afx_msg void OnDialPager(); + afx_msg void OnUpdateDialPager(CCmdUI* pCmdUI); + afx_msg void OnDialFax(); + afx_msg void OnUpdateDialFax(CCmdUI* pCmdUI); + afx_msg void OnEmailAdd1(); + afx_msg void OnUpdateEmailAdd1(CCmdUI* pCmdUI); + afx_msg void OnEmailAdd2(); + afx_msg void OnUpdateEmailAdd2(CCmdUI* pCmdUI); + afx_msg void OnUrl1(); + afx_msg void OnUpdateUrl1(CCmdUI* pCmdUI); + afx_msg void OnUrl2(); + afx_msg void OnUpdateUrl2(CCmdUI* pCmdUI); + afx_msg void OnAppPrefs(); + afx_msg void OnTbarDial(); + afx_msg void OnUpdateTbarDial(CCmdUI* pCmdUI); + afx_msg void OnTbarEmail(); + afx_msg void OnUpdateTbarEmail(CCmdUI* pCmdUI); + afx_msg void OnTbarWeb(); + afx_msg void OnUpdateTbarWeb(CCmdUI* pCmdUI); + afx_msg void OnViewColpos(); + afx_msg void OnEntryCopy(); + afx_msg void OnUpdateEntryCopy(CCmdUI* pCmdUI); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + void ChangeListCtrlStyle(long lStyle, BOOL bSetBit); +}; + +#ifndef _DEBUG // debug version in CB32View.cpp +inline CCB32Doc* CCB32View::GetDocument() + { return (CCB32Doc*)m_pDocument; } +#endif + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_CB32VIEW_H__20BFD1EF_4F52_11D1_AF86_000000000000__INCLUDED_) diff --git a/Cb32.dsp b/Cb32.dsp new file mode 100644 index 0000000..cd9d335 --- /dev/null +++ b/Cb32.dsp @@ -0,0 +1,486 @@ +# Microsoft Developer Studio Project File - Name="CB32" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=CB32 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "CB32.MAK". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "CB32.MAK" CFG="CB32 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "CB32 - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "CB32 - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "CB32 - Win32 Release" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 5 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c +# ADD CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FR /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 ../cexpr/Release/cexpr.lib tapi32.lib /nologo /subsystem:windows /machine:I386 + +!ELSEIF "$(CFG)" == "CB32 - Win32 Debug" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 5 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 +# ADD LINK32 ../cexpr/Debug/cexpr.lib tapi32.lib /nologo /subsystem:windows /debug /machine:I386 + +!ENDIF + +# Begin Target + +# Name "CB32 - Win32 Release" +# Name "CB32 - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\CB32.cpp +# End Source File +# Begin Source File + +SOURCE=.\hlp\CB32.hpj +USERDEP__CB32_="$(ProjDir)\hlp\AfxCore.rtf" "$(ProjDir)\hlp\AfxPrint.rtf" + +!IF "$(CFG)" == "CB32 - Win32 Release" + +# Begin Custom Build - Making help file... +OutDir=.\Release +ProjDir=. +TargetName=CB32 +InputPath=.\hlp\CB32.hpj + +"$(OutDir)\$(TargetName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + call "$(ProjDir)\makehelp.bat" + +# End Custom Build + +!ELSEIF "$(CFG)" == "CB32 - Win32 Debug" + +# Begin Custom Build - Making help file... +OutDir=.\Debug +ProjDir=. +TargetName=CB32 +InputPath=.\hlp\CB32.hpj + +"$(OutDir)\$(TargetName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + call "$(ProjDir)\makehelp.bat" + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\CB32.rc + +!IF "$(CFG)" == "CB32 - Win32 Release" + +!ELSEIF "$(CFG)" == "CB32 - Win32 Debug" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\CB32Doc.cpp +# End Source File +# Begin Source File + +SOURCE=.\CB32View.cpp +# End Source File +# Begin Source File + +SOURCE=.\ColPage.cpp +# End Source File +# Begin Source File + +SOURCE=.\ComboBar.cpp +# End Source File +# Begin Source File + +SOURCE=.\ConvertDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\FindDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\GetNew.cpp +# End Source File +# Begin Source File + +SOURCE=.\History.cpp +# End Source File +# Begin Source File + +SOURCE=.\HyperLink.cpp +# End Source File +# Begin Source File + +SOURCE=.\MainFrm.cpp +# End Source File +# Begin Source File + +SOURCE=.\MyHeaderCtrl.cpp +# End Source File +# Begin Source File + +SOURCE=.\OrdPage.cpp +# End Source File +# Begin Source File + +SOURCE=.\Parser.cpp +# End Source File +# Begin Source File + +SOURCE=.\PrefPage.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropAdd.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropComp.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropInfo.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropNote.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropOnline.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropPhone.cpp +# End Source File +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# Begin Source File + +SOURCE=.\SetPage.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\ToolBarEx.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\CB32.h +# End Source File +# Begin Source File + +SOURCE=.\CB32Doc.h +# End Source File +# Begin Source File + +SOURCE=.\CB32View.h +# End Source File +# Begin Source File + +SOURCE=.\ColPage.h +# End Source File +# Begin Source File + +SOURCE=.\ComboBar.h +# End Source File +# Begin Source File + +SOURCE=.\ConvertDlg.h +# End Source File +# Begin Source File + +SOURCE=.\FindDlg.h +# End Source File +# Begin Source File + +SOURCE=.\GetNew.h +# End Source File +# Begin Source File + +SOURCE=.\History.h +# End Source File +# Begin Source File + +SOURCE=.\HyperLink.h +# End Source File +# Begin Source File + +SOURCE=.\MainFrm.h +# End Source File +# Begin Source File + +SOURCE=.\MyHeaderCtrl.h +# End Source File +# Begin Source File + +SOURCE=.\OrdPage.h +# End Source File +# Begin Source File + +SOURCE=.\Parser.h +# End Source File +# Begin Source File + +SOURCE=.\PrefPage.h +# End Source File +# Begin Source File + +SOURCE=.\PropAdd.h +# End Source File +# Begin Source File + +SOURCE=.\PropComp.h +# End Source File +# Begin Source File + +SOURCE=.\PropInfo.h +# End Source File +# Begin Source File + +SOURCE=.\PropNote.h +# End Source File +# Begin Source File + +SOURCE=.\PropOnline.h +# End Source File +# Begin Source File + +SOURCE=.\PropPhone.h +# End Source File +# Begin Source File + +SOURCE=.\SetPage.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# Begin Source File + +SOURCE=.\ToolBarEx.h +# End Source File +# Begin Source File + +SOURCE=.\TraceWin.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\res\CB32.ico +# End Source File +# Begin Source File + +SOURCE=.\res\CB32.rc2 +# End Source File +# Begin Source File + +SOURCE=.\res\CB32Doc.ico +# End Source File +# Begin Source File + +SOURCE=.\res\hand1.cur +# End Source File +# Begin Source File + +SOURCE=.\res\Toolbar.bmp +# End Source File +# End Group +# Begin Group "Help Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\hlp\AfxCore.rtf +# End Source File +# Begin Source File + +SOURCE=.\hlp\AfxPrint.rtf +# End Source File +# Begin Source File + +SOURCE=.\hlp\AppExit.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\Bullet.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\CB32.cnt +# End Source File +# Begin Source File + +SOURCE=.\hlp\CurArw2.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\CurArw4.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\CurHelp.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\EditCopy.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\EditCut.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\EditPast.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\EditUndo.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\FileNew.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\FileOpen.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\FilePrnt.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\FileSave.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\HlpSBar.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\HlpTBar.bmp +# End Source File +# Begin Source File + +SOURCE=.\MakeHelp.bat +# End Source File +# Begin Source File + +SOURCE=.\hlp\RecFirst.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\RecLast.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\RecNext.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\RecPrev.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\Scmax.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\ScMenu.bmp +# End Source File +# Begin Source File + +SOURCE=.\hlp\Scmin.bmp +# End Source File +# End Group +# Begin Source File + +SOURCE=.\CB32.reg +# End Source File +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project +# Section CB32 : {B6805000-A509-11CE-A5B0-00AA006BBF16} +# 1:12:IDR_POPUP_NL:102 +# End Section diff --git a/Cb32.dsw b/Cb32.dsw new file mode 100644 index 0000000..7f53a89 --- /dev/null +++ b/Cb32.dsw @@ -0,0 +1,41 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "CB32"=.\CB32.DSP - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "cexpr"=..\cexpr\Cexpr.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/Cb32.ini b/Cb32.ini new file mode 100644 index 0000000..f2e346a --- /dev/null +++ b/Cb32.ini @@ -0,0 +1,108 @@ +[AddressBookInUse] +File=C:\CB32\CONTACTS.TBD + +[Preferences] +UseLastBook=1 +DefaultCity= +DefaultCountry= +DefaultEmail= +DefaultPrefix=() +DefaultState= +DefaultWeb=http:// +DefaultZip= +RememberSort=1 +SortIndex=0 +WindowPos=0,1,-1,-1,-1,-1,181,101,695,452 +RememberCol=1 +RememberExp=1 +RememberImp=1 +RememberWin=1 +UseMRU=1 +NumMRU=2 + +[Export] +ExportAddress1=5 +ExportAddress2=6 +ExportCellPhone=15 +ExportCity=7 +ExportCountry=8 +ExportEmail1=22 +ExportEmail2=23 +ExportFaxPhone=20 +ExportFaxExt=21 +ExportFirstname=2 +ExportHomePhone=11 +ExportHomeExt=12 +ExportLastname=1 +ExportMI=3 +ExportNotes=26 +ExportPager=17 +ExportPagerCard=18 +ExportPagerExt=19 +ExportState=9 +ExportTitle=4 +ExportWeb1=24 +ExportWeb2=25 +ExportWorkPhone=13 +ExportWorkExt=14 +ExportZip=10 +ExportCellExt=16 + +[Import] +ImportAddress1=5 +ImportAddress2=6 +ImportCellPhone=15 +ImportCity=7 +ImportCountry=8 +ImportEmail1=22 +ImportEmail2=23 +ImportFaxPhone=20 +ImportFaxExt=21 +ImportFirstname=2 +ImportHomePhone=11 +ImportHomeExt=12 +ImportLastname=1 +ImportMI=3 +ImportNotes=26 +ImportPager=17 +ImportPagerCard=18 +ImportPagerExt=19 +ImportState=9 +ImportTitle=4 +ImportWeb1=24 +ImportWeb2=25 +ImportWorkPhone=13 +ImportWorkExt=14 +ImportZip=10 +ImportCellExt=16 + +[Columns] +Col0=103 +Col1=116 +Col2=0 +Col3=0 +Col4=0 +Col5=0 +Col6=0 +Col7=0 +Col8=0 +Col9=0 +Col10=120 +Col11=0 +Col12=120 +Col13=0 +Col14=0 +Col15=0 +Col16=0 +Col17=0 +Col18=0 +Col19=0 +Col20=0 +Col21=200 +Col22=0 +Col23=0 +Col24=0 + +[Recent File List] +File1=C:\CB32\CONTACTS.TBD + diff --git a/Cb32.opt b/Cb32.opt new file mode 100644 index 0000000..66a1493 Binary files /dev/null and b/Cb32.opt differ diff --git a/ColPage.cpp b/ColPage.cpp new file mode 100644 index 0000000..2e8d71b --- /dev/null +++ b/ColPage.cpp @@ -0,0 +1,219 @@ +// ColPage.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "ColPage.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CColPage property page + +IMPLEMENT_DYNCREATE(CColPage, CPropertyPage) + +CColPage::CColPage() : CPropertyPage(CColPage::IDD) +{ + //{{AFX_DATA_INIT(CColPage) + m_cadd1 = 0; + m_cadd2 = 0; + m_ccell = 0; + m_ccellx = 0; + m_ccity = 0; + m_ccountry = 0; + m_cemail1 = 0; + m_cemail2 = 0; + m_cfax = 0; + m_cfaxx = 0; + m_cfname = 0; + m_chomep = 0; + m_chomepx = 0; + m_clname = 0; + m_cmi = 0; + m_cpager = 0; + m_cpagerc = 0; + m_cpagerx = 0; + m_cstate = 0; + m_ctitle = 0; + m_cweb1 = 0; + m_cweb2 = 0; + m_cworkp = 0; + m_cworkpx = 0; + m_czip = 0; + m_ccadd1 = 0; + m_ccadd2 = 0; + m_ccomp = 0; + m_cdept = 0; + m_cmgr = 0; + m_cposn = 0; + m_cnotes = 0; + //}}AFX_DATA_INIT +} + +CColPage::~CColPage() +{ +} + +void CColPage::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CColPage) + DDX_Control(pDX, IDC_SPINCNOTES, m_spincnotes); + DDX_Control(pDX, IDC_SPINCPOSN, m_spincposn); + DDX_Control(pDX, IDC_SPINCMGR, m_spincmgr); + DDX_Control(pDX, IDC_SPINCDEPT, m_spincdept); + DDX_Control(pDX, IDC_SPINCCOMP, m_spinccomp); + DDX_Control(pDX, IDC_SPINCCADD2, m_spinccadd2); + DDX_Control(pDX, IDC_SPINCCADD1, m_spinccadd1); + DDX_Control(pDX, IDC_SPINCZIP, m_spinczip); + DDX_Control(pDX, IDC_SPINCWORKPX, m_spincworkpx); + DDX_Control(pDX, IDC_SPINCWORKP, m_spincworkp); + DDX_Control(pDX, IDC_SPINCWEB2, m_spincweb2); + DDX_Control(pDX, IDC_SPINCWEB1, m_spincweb1); + DDX_Control(pDX, IDC_SPINCTITLE, m_spinctitle); + DDX_Control(pDX, IDC_SPINCSTATE, m_spincstate); + DDX_Control(pDX, IDC_SPINCPAGERX, m_spincpagerx); + DDX_Control(pDX, IDC_SPINCPAGERC, m_spincpagerc); + DDX_Control(pDX, IDC_SPINCPAGER, m_spincpager); + DDX_Control(pDX, IDC_SPINCMI, m_spincmi); + DDX_Control(pDX, IDC_SPINCLNAME, m_spinclname); + DDX_Control(pDX, IDC_SPINCHOMEPX, m_spinchomepx); + DDX_Control(pDX, IDC_SPINCHOMEP, m_spinchomep); + DDX_Control(pDX, IDC_SPINCFNAME, m_spincfname); + DDX_Control(pDX, IDC_SPINCFAXX, m_spincfaxx); + DDX_Control(pDX, IDC_SPINCFAX, m_spincfax); + DDX_Control(pDX, IDC_SPINCEMAIL2, m_spincemail2); + DDX_Control(pDX, IDC_SPINCEMAIL1, m_spincemail1); + DDX_Control(pDX, IDC_SPINCCOUNTRY, m_spinccountry); + DDX_Control(pDX, IDC_SPINCCITY, m_spinccity); + DDX_Control(pDX, IDC_SPINCCELLX, m_spinccellx); + DDX_Control(pDX, IDC_SPINCCELL, m_spinccell); + DDX_Control(pDX, IDC_SPINCADD2, m_spincadd2); + DDX_Control(pDX, IDC_SPINCADD1, m_spincadd1); + DDX_Text(pDX, IDC_CADD1, m_cadd1); + DDX_Text(pDX, IDC_CADD2, m_cadd2); + DDX_Text(pDX, IDC_CCELL, m_ccell); + DDX_Text(pDX, IDC_CCELLX, m_ccellx); + DDX_Text(pDX, IDC_CCITY, m_ccity); + DDX_Text(pDX, IDC_CCOUNTRY, m_ccountry); + DDX_Text(pDX, IDC_CEMAIL1, m_cemail1); + DDX_Text(pDX, IDC_CEMAIL2, m_cemail2); + DDX_Text(pDX, IDC_CFAX, m_cfax); + DDX_Text(pDX, IDC_CFAXX, m_cfaxx); + DDX_Text(pDX, IDC_CFNAME, m_cfname); + DDX_Text(pDX, IDC_CHOMEP, m_chomep); + DDX_Text(pDX, IDC_CHOMEPX, m_chomepx); + DDX_Text(pDX, IDC_CLNAME, m_clname); + DDX_Text(pDX, IDC_CMI, m_cmi); + DDX_Text(pDX, IDC_CPAGER, m_cpager); + DDX_Text(pDX, IDC_CPAGERC, m_cpagerc); + DDX_Text(pDX, IDC_CPAGERX, m_cpagerx); + DDX_Text(pDX, IDC_CSTATE, m_cstate); + DDX_Text(pDX, IDC_CTITLE, m_ctitle); + DDX_Text(pDX, IDC_CWEB1, m_cweb1); + DDX_Text(pDX, IDC_CWEB2, m_cweb2); + DDX_Text(pDX, IDC_CWORKP, m_cworkp); + DDX_Text(pDX, IDC_CWORKPX, m_cworkpx); + DDX_Text(pDX, IDC_CZIP, m_czip); + DDX_Text(pDX, IDC_CCADD1, m_ccadd1); + DDX_Text(pDX, IDC_CCADD2, m_ccadd2); + DDX_Text(pDX, IDC_CCOMP, m_ccomp); + DDX_Text(pDX, IDC_CDEPT, m_cdept); + DDX_Text(pDX, IDC_CMGR, m_cmgr); + DDX_Text(pDX, IDC_CPOSN, m_cposn); + DDX_Text(pDX, IDC_CNOTES, m_cnotes); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CColPage, CPropertyPage) + //{{AFX_MSG_MAP(CColPage) + ON_BN_CLICKED(IDC_RESETSIZE, OnResetsize) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CColPage message handlers + +BOOL CColPage::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + m_spinclname.SetRange(0,300); + m_spincfname.SetRange(0,300); + m_spincmi.SetRange(0,300); + m_spinctitle.SetRange(0,300); + m_spincadd1.SetRange(0,300); + m_spincadd2.SetRange(0,300); + m_spinccity.SetRange(0,300); + m_spincstate.SetRange(0,300); + m_spinczip.SetRange(0,300); + m_spinccountry.SetRange(0,300); + + m_spinccomp.SetRange(0,300); + m_spincdept.SetRange(0,300); + m_spincposn.SetRange(0,300); + m_spincmgr.SetRange(0,300); + m_spinccadd1.SetRange(0,300); + m_spinccadd2.SetRange(0,300); + + m_spinchomepx.SetRange(0,300); + m_spinchomep.SetRange(0,300); + m_spincworkpx.SetRange(0,300); + m_spincworkp.SetRange(0,300); + m_spincfaxx.SetRange(0,300); + m_spincfax.SetRange(0,300); + m_spincpagerx.SetRange(0,300); + m_spincpagerc.SetRange(0,300); + m_spincpager.SetRange(0,300); + m_spinccellx.SetRange(0,300); + m_spinccell.SetRange(0,300); + + m_spincemail1.SetRange(0,300); + m_spincemail2.SetRange(0,300); + m_spincweb1.SetRange(0,300); + m_spincweb2.SetRange(0,300); + m_spincnotes.SetRange(0,300); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CColPage::OnResetsize() +{ + SetDlgItemInt(IDC_CLNAME,100); + SetDlgItemInt(IDC_CFNAME,100); + SetDlgItemInt(IDC_CMI,40); + SetDlgItemInt(IDC_CTITLE,40); + SetDlgItemInt(IDC_CADD1,170); + SetDlgItemInt(IDC_CADD2,170); + SetDlgItemInt(IDC_CCOUNTRY,110); + SetDlgItemInt(IDC_CSTATE,90); + SetDlgItemInt(IDC_CZIP,60); + SetDlgItemInt(IDC_CCOMP,100); + SetDlgItemInt(IDC_DEPT,100); + SetDlgItemInt(IDC_CPOSN,100); + SetDlgItemInt(IDC_CMGR,100); + SetDlgItemInt(IDC_CCADD1,100); + SetDlgItemInt(IDC_CCADD2,100); + SetDlgItemInt(IDC_CHOMEP,120); + SetDlgItemInt(IDC_CHOMEPX,60); + SetDlgItemInt(IDC_CWORKP,120); + SetDlgItemInt(IDC_CWORKPX,60); + SetDlgItemInt(IDC_CCELL,120); + SetDlgItemInt(IDC_CCELLX,60); + SetDlgItemInt(IDC_CPAGER,120); + SetDlgItemInt(IDC_CPAGERC,120); + SetDlgItemInt(IDC_CPAGERX,60); + SetDlgItemInt(IDC_CFAX,120); + SetDlgItemInt(IDC_CFAXX,60); + SetDlgItemInt(IDC_CEMAIL1,200); + SetDlgItemInt(IDC_CEMAIL2,200); + SetDlgItemInt(IDC_CWEB1,280); + SetDlgItemInt(IDC_CWEB2,280); + SetDlgItemInt(IDC_CNOTES,280); +} diff --git a/ColPage.h b/ColPage.h new file mode 100644 index 0000000..c5b684d --- /dev/null +++ b/ColPage.h @@ -0,0 +1,102 @@ +// ColPage.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CColPage dialog + +class CColPage : public CPropertyPage +{ + DECLARE_DYNCREATE(CColPage) + +// Construction +public: + CColPage(); + ~CColPage(); + +// Dialog Data + //{{AFX_DATA(CColPage) + enum { IDD = IDD_COLPAGE }; + CSpinButtonCtrl m_spincnotes; + CSpinButtonCtrl m_spincposn; + CSpinButtonCtrl m_spincmgr; + CSpinButtonCtrl m_spincdept; + CSpinButtonCtrl m_spinccomp; + CSpinButtonCtrl m_spinccadd2; + CSpinButtonCtrl m_spinccadd1; + CSpinButtonCtrl m_spinczip; + CSpinButtonCtrl m_spincworkpx; + CSpinButtonCtrl m_spincworkp; + CSpinButtonCtrl m_spincweb2; + CSpinButtonCtrl m_spincweb1; + CSpinButtonCtrl m_spinctitle; + CSpinButtonCtrl m_spincstate; + CSpinButtonCtrl m_spincpagerx; + CSpinButtonCtrl m_spincpagerc; + CSpinButtonCtrl m_spincpager; + CSpinButtonCtrl m_spincmi; + CSpinButtonCtrl m_spinclname; + CSpinButtonCtrl m_spinchomepx; + CSpinButtonCtrl m_spinchomep; + CSpinButtonCtrl m_spincfname; + CSpinButtonCtrl m_spincfaxx; + CSpinButtonCtrl m_spincfax; + CSpinButtonCtrl m_spincemail2; + CSpinButtonCtrl m_spincemail1; + CSpinButtonCtrl m_spinccountry; + CSpinButtonCtrl m_spinccity; + CSpinButtonCtrl m_spinccellx; + CSpinButtonCtrl m_spinccell; + CSpinButtonCtrl m_spincadd2; + CSpinButtonCtrl m_spincadd1; + int m_cadd1; + int m_cadd2; + int m_ccell; + int m_ccellx; + int m_ccity; + int m_ccountry; + int m_cemail1; + int m_cemail2; + int m_cfax; + int m_cfaxx; + int m_cfname; + int m_chomep; + int m_chomepx; + int m_clname; + int m_cmi; + int m_cpager; + int m_cpagerc; + int m_cpagerx; + int m_cstate; + int m_ctitle; + int m_cweb1; + int m_cweb2; + int m_cworkp; + int m_cworkpx; + int m_czip; + int m_ccadd1; + int m_ccadd2; + int m_ccomp; + int m_cdept; + int m_cmgr; + int m_cposn; + int m_cnotes; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(CColPage) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CColPage) + virtual BOOL OnInitDialog(); + afx_msg void OnResetsize(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; diff --git a/ComboBar.cpp b/ComboBar.cpp new file mode 100644 index 0000000..71c30b3 --- /dev/null +++ b/ComboBar.cpp @@ -0,0 +1,185 @@ +// combobar.cpp : implementation of the CComboToolBar and CTBComboBox class +// + +#include "stdafx.h" +#include "CB32.h" +#include "ComboBar.h" +#include "MainFrm.h" +#include "CB32Doc.h" +#include "CB32View.h" +#include "FindDlg.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char BASED_CODE THIS_FILE[] = __FILE__; +#endif + +BEGIN_MESSAGE_MAP(CComboToolBar, CToolBarEx) + //{{AFX_MSG_MAP(CComboToolBar) + ON_WM_LBUTTONUP() + //}}AFX_MSG_MAP + ON_CBN_SETFOCUS(IDW_COMBO, OnSetFocus) +END_MESSAGE_MAP() + + +void CComboToolBar::OnSetFocus() +{ + // combobox is gaining focus, highlight text in edit control + m_toolBarCombo.SetEditSel(0,-1); +} + +BOOL CComboToolBar::PreTranslateMessage(MSG* pMsg) +{ + // Note: there is only one control in the toolbar that accepts keyboard input, + // this is the combobox. + + // user hit ENTER + if (pMsg->wParam == VK_RETURN && GetKeyState(VK_RETURN) < 0) + { + // extract the text, update combobox lists, and do the search + CString s1; + m_toolBarCombo.GetWindowText(s1); + + if(s1.GetLength()) + { + CCB32View* pView = GetApplicationView(); + m_toolBarCombo.SetEditSel(0, -1); + pView->m_searchHistory.AddString(s1); // update combobox history list + pView->m_pFindDialog->m_szText = s1; // update last string + pView->OnViewFindNext(s1); // find the string + return TRUE; // key processed + } + else + { + MessageBeep(MB_ICONEXCLAMATION); + return TRUE; // key processed + } + } + + // user hit ESC + if (pMsg->wParam == VK_ESCAPE && GetKeyState(VK_ESCAPE) < 0) + { + GetApplicationView()->SetFocus(); + return TRUE; // key processed + } + + // user hit DELETE + if (pMsg->wParam == VK_DELETE && GetKeyState(VK_DELETE) < 0) + { + m_toolBarCombo.Clear(); + return TRUE; // key processed + } + + // user hit DOWN-ARROW + if (pMsg->wParam == VK_DOWN && GetKeyState(VK_DOWN) < 0 && + m_toolBarCombo.GetDroppedState() == FALSE) + { + m_toolBarCombo.ShowDropDown(); + return TRUE; // key processed + } + + return CToolBarEx::PreTranslateMessage(pMsg); +} + +BEGIN_MESSAGE_MAP(CTBComboBox, CComboBox) + //{{AFX_MSG_MAP(CTBComboBox) + ON_WM_CREATE() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +int CTBComboBox::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CComboBox::OnCreate(lpCreateStruct) == -1) + return -1; + + LOGFONT logFont; + TEXTMETRIC tm; + CClientDC dc(this); + + dc.GetTextMetrics(&tm); + ::EnumFontFamilies(dc.m_hDC, _T("MS Sans Serif"), + CTBComboBox::FontEnumProc, (LPARAM)&logFont); + + // change the weight and create the font + logFont.lfWeight = FW_BOLD; + if (m_font.CreateFontIndirect(&logFont)) + SetFont(&m_font); + + return 0; +} + +int CALLBACK CTBComboBox::FontEnumProc(const LOGFONT *pLogFont, const TEXTMETRIC *pTextMetric, DWORD type, LPARAM pDestLogFont) +{ + memcpy((BYTE*)pDestLogFont, pLogFont, sizeof(LOGFONT)); + return FALSE; // return the first font in the family(i.e. smallest). +} + +void CComboToolBar::OnLButtonUp(UINT nFlags, CPoint point) +{ + CRect rect; + CMenu menu; + int nHit = -1; + TBBUTTON button; + CMenu* pSubMenu = NULL; + + CToolBarCtrl& pBar = GetToolBarCtrl(); + int nButtons = pBar.GetButtonCount(); + + for (int i = 0; i < nButtons; i++) + { + if (pBar.GetItemRect(i, &rect) && rect.PtInRect(point) && + pBar.GetButton(i, &button) && !(button.fsStyle & TBSTYLE_SEP)) + { + nHit = GetItemID(i); + break; + } + } + + switch (nHit) + { + case ID_TBAR_DIAL: + if (menu.LoadMenu(IDR_TRAYMENU)) + pSubMenu = menu.GetSubMenu(1); + if (pSubMenu) + ClientToScreen(&rect); + pSubMenu->TrackPopupMenu(TPM_LEFTALIGN, + rect.left, rect.bottom, AfxGetMainWnd(), NULL); + break; + case ID_TBAR_EMAIL: + if (menu.LoadMenu(IDR_TRAYMENU)) + pSubMenu = menu.GetSubMenu(2); + if (pSubMenu) + ClientToScreen(&rect); + pSubMenu->TrackPopupMenu(TPM_LEFTALIGN, + rect.left, rect.bottom, AfxGetMainWnd(), NULL); + break; + case ID_TBAR_WEB: + if (menu.LoadMenu(IDR_TRAYMENU)) + pSubMenu = menu.GetSubMenu(3); + if (pSubMenu) + ClientToScreen(&rect); + pSubMenu->TrackPopupMenu(TPM_LEFTALIGN, + rect.left, rect.bottom, AfxGetMainWnd(), NULL); + break; + } + + CToolBarEx::OnLButtonUp(nFlags, point); +} + +int CComboToolBar::CheckIfHit(CPoint point) +{ + CToolBarCtrl& pBar = GetToolBarCtrl(); + int nButtons = pBar.GetButtonCount(); + for (int i = 0; i < nButtons; i++) + { + CRect rect; + TBBUTTON button; + if (pBar.GetItemRect(i, &rect) && rect.PtInRect(point) && + pBar.GetButton(i, &button) && !(button.fsStyle & TBSTYLE_SEP)) + { + int nHit = GetItemID(i); + return nHit != 0 ? nHit : -1; + } + } + return -1; +} diff --git a/ComboBar.h b/ComboBar.h new file mode 100644 index 0000000..aa74322 --- /dev/null +++ b/ComboBar.h @@ -0,0 +1,49 @@ +// combobar.h : interface of the CTBComboBox and CComboToolBar class +// +///////////////////////////////////////////////////////////////////////////// + +#include "ToolBarEx.h" + +class CCB32View; // forward declaration + +class CTBComboBox : public CComboBox +{ +// Attributes +protected: + CFont m_font; + +// Implementation +protected: + static int CALLBACK FontEnumProc(const LOGFONT *pLogFont, + const TEXTMETRIC *pTextMetric, + DWORD type, LPARAM pDestLogFont); + // Generated message map functions + //{{AFX_MSG(CTBComboBox) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +class CComboToolBar : public CToolBarEx +{ +// Attributes +public: + CTBComboBox m_toolBarCombo; + +// Implementation +public: + CCB32View* GetView(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + +private: + int CheckIfHit(CPoint point); + +protected: + // Generated message map functions + //{{AFX_MSG(CComboToolBar) + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + //}}AFX_MSG + afx_msg void OnSelectEndOk(); + afx_msg void OnSetFocus(); + DECLARE_MESSAGE_MAP() +}; diff --git a/ConvertDlg.cpp b/ConvertDlg.cpp new file mode 100644 index 0000000..39edab8 --- /dev/null +++ b/ConvertDlg.cpp @@ -0,0 +1,179 @@ +// ConvertDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "ConvertDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CConvertDlg dialog + + +CConvertDlg::CConvertDlg(CWnd* pParent /*=NULL*/) + : CDialog(CConvertDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CConvertDlg) + m_xline1 = _T(""); + m_xadd1 = 0; + m_xadd2 = 0; + m_xcell = 0; + m_xcity = 0; + m_xcountry = 0; + m_xemail1 = 0; + m_xemail2 = 0; + m_xfax = 0; + m_xfaxx = 0; + m_xfname = 0; + m_xhomep = 0; + m_xhomepx = 0; + m_xlname = 0; + m_xmi = 0; + m_xnotes = 0; + m_xpager = 0; + m_xpagerc = 0; + m_xpagerx = 0; + m_xstate = 0; + m_xtitle = 0; + m_xweb1 = 0; + m_xweb2 = 0; + m_xworkp = 0; + m_xworkpx = 0; + m_xzip = 0; + m_xcellx = 0; + m_xcadd1 = 0; + m_xcadd2 = 0; + m_xcomp = 0; + m_xdept = 0; + m_xmgr = 0; + m_xposn = 0; + //}}AFX_DATA_INIT +} + + +void CConvertDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CConvertDlg) + DDX_Control(pDX, IDC_SPINXPOSN, m_spinxposn); + DDX_Control(pDX, IDC_SPINXMGR, m_spinxmgr); + DDX_Control(pDX, IDC_SPINXDEPT, m_spinxdept); + DDX_Control(pDX, IDC_SPINXCOMP, m_spinxcomp); + DDX_Control(pDX, IDC_SPINXCADD2, m_spinxcadd2); + DDX_Control(pDX, IDC_SPINXCADD1, m_spinxcadd1); + DDX_Control(pDX, IDC_SPINXZIP, m_spinxzip); + DDX_Control(pDX, IDC_SPINXWORKPX, m_spinxworkpx); + DDX_Control(pDX, IDC_SPINXWORKP, m_spinxworkp); + DDX_Control(pDX, IDC_SPINXWEB2, m_spinxweb2); + DDX_Control(pDX, IDC_SPINXWEB1, m_spinxweb1); + DDX_Control(pDX, IDC_SPINXTITLE, m_spinxtitle); + DDX_Control(pDX, IDC_SPINXSTATE, m_spinxstate); + DDX_Control(pDX, IDC_SPINXPAGERX, m_spinxpagerx); + DDX_Control(pDX, IDC_SPINXPAGERC, m_spinxpagerc); + DDX_Control(pDX, IDC_SPINXPAGER, m_spinxpager); + DDX_Control(pDX, IDC_SPINXNOTES, m_spinxnotes); + DDX_Control(pDX, IDC_SPINXMI, m_spinxmi); + DDX_Control(pDX, IDC_SPINXLNAME, m_spinxlname); + DDX_Control(pDX, IDC_SPINXHOMEPX, m_spinxhomepx); + DDX_Control(pDX, IDC_SPINXHOMEP, m_spinxhomep); + DDX_Control(pDX, IDC_SPINXFNAME, m_spinxfname); + DDX_Control(pDX, IDC_SPINXFAXX, m_spinxfaxx); + DDX_Control(pDX, IDC_SPINXFAX, m_spinxfax); + DDX_Control(pDX, IDC_SPINXEMAIL2, m_spinxemail2); + DDX_Control(pDX, IDC_SPINXEMAIL1, m_spinxemail1); + DDX_Control(pDX, IDC_SPINXCOUNTRY, m_spinxcountry); + DDX_Control(pDX, IDC_SPINXCITY, m_spinxcity); + DDX_Control(pDX, IDC_SPINXCELLX, m_spinxcellx); + DDX_Control(pDX, IDC_SPINXCELL, m_spinxcell); + DDX_Control(pDX, IDC_SPINXADD2, m_spinxadd2); + DDX_Control(pDX, IDC_SPINXADD1, m_spinxadd1); + DDX_Text(pDX, IDC_XLINE1, m_xline1); + DDX_Text(pDX, IDC_XADD1, m_xadd1); + DDX_Text(pDX, IDC_XADD2, m_xadd2); + DDX_Text(pDX, IDC_XCELL, m_xcell); + DDX_Text(pDX, IDC_XCITY, m_xcity); + DDX_Text(pDX, IDC_XCOUNTRY, m_xcountry); + DDX_Text(pDX, IDC_XEMAIL1, m_xemail1); + DDX_Text(pDX, IDC_XEMAIL2, m_xemail2); + DDX_Text(pDX, IDC_XFAX, m_xfax); + DDX_Text(pDX, IDC_XFAXX, m_xfaxx); + DDX_Text(pDX, IDC_XFNAME, m_xfname); + DDX_Text(pDX, IDC_XHOMEP, m_xhomep); + DDX_Text(pDX, IDC_XHOMEPX, m_xhomepx); + DDX_Text(pDX, IDC_XLNAME, m_xlname); + DDX_Text(pDX, IDC_XMI, m_xmi); + DDX_Text(pDX, IDC_XNOTES, m_xnotes); + DDX_Text(pDX, IDC_XPAGER, m_xpager); + DDX_Text(pDX, IDC_XPAGERC, m_xpagerc); + DDX_Text(pDX, IDC_XPAGERX, m_xpagerx); + DDX_Text(pDX, IDC_XSTATE, m_xstate); + DDX_Text(pDX, IDC_XTITLE, m_xtitle); + DDX_Text(pDX, IDC_XWEB1, m_xweb1); + DDX_Text(pDX, IDC_XWEB2, m_xweb2); + DDX_Text(pDX, IDC_XWORKP, m_xworkp); + DDX_Text(pDX, IDC_XWORKPX, m_xworkpx); + DDX_Text(pDX, IDC_XZIP, m_xzip); + DDX_Text(pDX, IDC_XCELLX, m_xcellx); + DDX_Text(pDX, IDC_XCADD1, m_xcadd1); + DDX_Text(pDX, IDC_XCADD2, m_xcadd2); + DDX_Text(pDX, IDC_XCOMP, m_xcomp); + DDX_Text(pDX, IDC_XDEPT, m_xdept); + DDX_Text(pDX, IDC_XMGR, m_xmgr); + DDX_Text(pDX, IDC_XPOSN, m_xposn); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CConvertDlg, CDialog) + //{{AFX_MSG_MAP(CConvertDlg) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CConvertDlg message handlers + +BOOL CConvertDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + m_spinxzip.SetRange(0,100); + m_spinxworkpx.SetRange(0,100); + m_spinxworkp.SetRange(0,100); + m_spinxweb2.SetRange(0,100); + m_spinxweb1.SetRange(0,100); + m_spinxtitle.SetRange(0,100); + m_spinxstate.SetRange(0,100); + m_spinxpagerx.SetRange(0,100); + m_spinxpagerc.SetRange(0,100); + m_spinxpager.SetRange(0,100); + m_spinxnotes.SetRange(0,100); + m_spinxmi.SetRange(0,100); + m_spinxlname.SetRange(0,100); + m_spinxhomepx.SetRange(0,100); + m_spinxhomep.SetRange(0,100); + m_spinxfname.SetRange(0,100); + m_spinxfaxx.SetRange(0,100); + m_spinxfax.SetRange(0,100); + m_spinxemail2.SetRange(0,100); + m_spinxemail1.SetRange(0,100); + m_spinxcountry.SetRange(0,100); + m_spinxcity.SetRange(0,100); + m_spinxcellx.SetRange(0,100); + m_spinxcell.SetRange(0,100); + m_spinxadd2.SetRange(0,100); + m_spinxadd1.SetRange(0,100); + m_spinxcomp.SetRange(0,100); + m_spinxdept.SetRange(0,100); + m_spinxposn.SetRange(0,100); + m_spinxmgr.SetRange(0,100); + m_spinxcadd1.SetRange(0,100); + m_spinxcadd2.SetRange(0,100); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} diff --git a/ConvertDlg.h b/ConvertDlg.h new file mode 100644 index 0000000..5822fc3 --- /dev/null +++ b/ConvertDlg.h @@ -0,0 +1,99 @@ +// ConvertDlg.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CConvertDlg dialog + +class CConvertDlg : public CDialog +{ +// Construction +public: + CConvertDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CConvertDlg) + enum { IDD = IDD_CONVERT }; + CSpinButtonCtrl m_spinxposn; + CSpinButtonCtrl m_spinxmgr; + CSpinButtonCtrl m_spinxdept; + CSpinButtonCtrl m_spinxcomp; + CSpinButtonCtrl m_spinxcadd2; + CSpinButtonCtrl m_spinxcadd1; + CSpinButtonCtrl m_spinxzip; + CSpinButtonCtrl m_spinxworkpx; + CSpinButtonCtrl m_spinxworkp; + CSpinButtonCtrl m_spinxweb2; + CSpinButtonCtrl m_spinxweb1; + CSpinButtonCtrl m_spinxtitle; + CSpinButtonCtrl m_spinxstate; + CSpinButtonCtrl m_spinxpagerx; + CSpinButtonCtrl m_spinxpagerc; + CSpinButtonCtrl m_spinxpager; + CSpinButtonCtrl m_spinxnotes; + CSpinButtonCtrl m_spinxmi; + CSpinButtonCtrl m_spinxlname; + CSpinButtonCtrl m_spinxhomepx; + CSpinButtonCtrl m_spinxhomep; + CSpinButtonCtrl m_spinxfname; + CSpinButtonCtrl m_spinxfaxx; + CSpinButtonCtrl m_spinxfax; + CSpinButtonCtrl m_spinxemail2; + CSpinButtonCtrl m_spinxemail1; + CSpinButtonCtrl m_spinxcountry; + CSpinButtonCtrl m_spinxcity; + CSpinButtonCtrl m_spinxcellx; + CSpinButtonCtrl m_spinxcell; + CSpinButtonCtrl m_spinxadd2; + CSpinButtonCtrl m_spinxadd1; + CString m_xline1; + int m_xadd1; + int m_xadd2; + int m_xcell; + int m_xcity; + int m_xcountry; + int m_xemail1; + int m_xemail2; + int m_xfax; + int m_xfaxx; + int m_xfname; + int m_xhomep; + int m_xhomepx; + int m_xlname; + int m_xmi; + int m_xnotes; + int m_xpager; + int m_xpagerc; + int m_xpagerx; + int m_xstate; + int m_xtitle; + int m_xweb1; + int m_xweb2; + int m_xworkp; + int m_xworkpx; + int m_xzip; + int m_xcellx; + int m_xcadd1; + int m_xcadd2; + int m_xcomp; + int m_xdept; + int m_xmgr; + int m_xposn; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CConvertDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CConvertDlg) + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; diff --git a/Debug/empty.dir b/Debug/empty.dir new file mode 100644 index 0000000..e69de29 diff --git a/FindDlg.cpp b/FindDlg.cpp new file mode 100644 index 0000000..c44301a --- /dev/null +++ b/FindDlg.cpp @@ -0,0 +1,93 @@ +// finddlg.cpp : implementation file +// + +#include "stdafx.h" +#include +#include "CB32.h" +#include "ComboBar.h" +#include "MainFrm.h" +#include "CB32Doc.h" +#include "CB32View.h" +#include "FindDlg.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char BASED_CODE THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CFindDlg dialog + + +CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/) + : CDialog(CFindDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CFindDlg) + m_bMatchCase = FALSE; + m_szText = _T(""); + m_nDirection = 1; // down by default + m_bStartTop = FALSE; + m_nWhichName = 0; + //}}AFX_DATA_INIT +} + + +void CFindDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CFindDlg) + DDX_Control(pDX, IDC_FCOMBO, m_strList); + DDX_Check(pDX, IDC_CHECK1, m_bMatchCase); + DDX_CBString(pDX, IDC_COMBO1, m_szText); + DDX_Radio(pDX, IDC_RADIO1, m_nDirection); + DDX_Check(pDX, IDC_CHECK2, m_bStartTop); + DDX_CBIndex(pDX, IDC_FCOMBO, m_nWhichName); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CFindDlg, CDialog) + //{{AFX_MSG_MAP(CFindDlg) + ON_BN_CLICKED(ID_EDIT_FIND_NEXT, OnEditFindNext) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// CFindDlg message handlers + +void CFindDlg::OnEditFindNext() +{ + // the user selected to search. see if there is a search pattern in the edit control + // using the default data exchange. + // if no search string is present, keep the dialog box up. + UpdateData(TRUE); + + if (!m_szText.GetLength()) + { + MessageBeep(MB_ICONEXCLAMATION); + GotoDlgCtrl(GetDlgItem(IDC_COMBO1)); + return ; + } + + EndDialog(TRUE); + GetApplicationView()->m_searchHistory.AddString(m_szText); +} + +BOOL CFindDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + CWnd* pWnd = GetDlgItem(IDC_COMBO1); + CCB32View* pView = GetApplicationView(); + + pView->m_searchHistory.FillCombobox(); + + for (int y=0; y < COLS; y++) + m_strList.AddString(pView->arLabel[y]); + + m_strList.SetCurSel(m_nWhichName); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} diff --git a/FindDlg.h b/FindDlg.h new file mode 100644 index 0000000..94f2799 --- /dev/null +++ b/FindDlg.h @@ -0,0 +1,40 @@ +// finddlg.h : interface of the CFindDlg class +// +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CFindDlg dialog + +class CFindDlg : public CDialog +{ +// Construction +public: + CFindDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CFindDlg) + enum { IDD = IDD_FIND }; + CComboBox m_strList; + BOOL m_bMatchCase; + CString m_szText; + int m_nDirection; // search direction 0=down, 1=up + BOOL m_bStartTop; + int m_nWhichName; + //}}AFX_DATA + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CFindDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CFindDlg) + afx_msg void OnEditFindNext(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; diff --git a/GetNew.cpp b/GetNew.cpp new file mode 100644 index 0000000..8c32e67 --- /dev/null +++ b/GetNew.cpp @@ -0,0 +1,44 @@ +// GetNew.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "GetNew.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CGetNew dialog + + +CGetNew::CGetNew(CWnd* pParent /*=NULL*/) + : CDialog(CGetNew::IDD, pParent) +{ + //{{AFX_DATA_INIT(CGetNew) + m_addinfo = FALSE; + m_newinfo = _T(""); + //}}AFX_DATA_INIT +} + + +void CGetNew::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CGetNew) + DDX_Check(pDX, IDC_ADDINFO, m_addinfo); + DDX_Text(pDX, IDC_NEWINFO, m_newinfo); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CGetNew, CDialog) + //{{AFX_MSG_MAP(CGetNew) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CGetNew message handlers diff --git a/GetNew.h b/GetNew.h new file mode 100644 index 0000000..c2dcf5e --- /dev/null +++ b/GetNew.h @@ -0,0 +1,35 @@ +// GetNew.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CGetNew dialog + +class CGetNew : public CDialog +{ +// Construction +public: + CGetNew(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CGetNew) + enum { IDD = IDD_GETNEW }; + BOOL m_addinfo; + CString m_newinfo; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CGetNew) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CGetNew) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; diff --git a/History.cpp b/History.cpp new file mode 100644 index 0000000..34efea3 --- /dev/null +++ b/History.cpp @@ -0,0 +1,83 @@ +// history.cpp : implementation of the CHistoryList class +// +#include "stdafx.h" +#include "CB32.h" +#include "ComboBar.h" +#include "MainFrm.h" +#include "CB32Doc.h" +#include "CB32View.h" +#include "FindDlg.h" +#include + +void CHistoryList::FillCombobox() +{ + CCB32View* pView = GetApplicationView(); + CWnd* pWnd = pView->m_pFindDialog->GetDlgItem(IDC_COMBO1); + ASSERT_VALID(pWnd); + + POSITION pos = GetHeadPosition(); + while(pos) + pWnd->SendMessage(CB_ADDSTRING, 0, (LPARAM)((LPCTSTR)GetNext(pos))); +} + + +BOOL CHistoryList::AddString(CString &s1) +{ + CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd(); + CWnd* pWnd = &pFrame->m_wndToolBar.m_toolBarCombo; + ASSERT_VALID(pWnd); + + if (!s1.GetLength()) + return FALSE; + + POSITION pos = Find(s1); + int nCount = GetCount(); + + if (pos == NULL) + { + // if list is full, remove from the end + if (nCount == HISTORY_COUNT) + { + RemoveTail(); + pWnd->SendMessage(CB_DELETESTRING, nCount-1); + } + + AddHead(s1); + pWnd->SendMessage(CB_INSERTSTRING, 0, (LPARAM)((LPCTSTR)s1)); + } + else + { + SwapStrings(pWnd, s1); + } + + return TRUE; +} + +void CHistoryList::SwapStrings(CWnd* pWnd, CString &s1) +{ + // swap internal list items + POSITION pos = GetHeadPosition(); + ASSERT(pos != NULL); + + CString s2; + int nCount = GetCount(); + int idx=0; + + // Note: combo-box find is not case-sensitive + do + { + s2 = GetNext(pos); + } while(idx < nCount && s1 != s2 && ++idx); + + + // swap internal list + pos = FindIndex(idx); + ASSERT(pos != NULL); + RemoveAt(pos); + AddHead(s2); + + // swap combo box item with combo's edit control + pWnd->SendMessage(CB_DELETESTRING, idx); + pWnd->SendMessage(CB_SETCURSEL, pWnd->SendMessage(CB_INSERTSTRING, 0, (LPARAM)((LPCTSTR)s1))); +} + diff --git a/History.h b/History.h new file mode 100644 index 0000000..16a620f --- /dev/null +++ b/History.h @@ -0,0 +1,16 @@ +// history.h : interface of the CHistoryList class +// +///////////////////////////////////////////////////////////////////////////// + +class CHistoryList : public CStringList +{ +// Operations +public: + void FillCombobox(); + BOOL AddString(CString &s1); + +// Implementation +protected: + void SwapStrings(CWnd* pWnd, CString &s1); +}; + diff --git a/HyperLink.cpp b/HyperLink.cpp new file mode 100644 index 0000000..8934b67 --- /dev/null +++ b/HyperLink.cpp @@ -0,0 +1,285 @@ +// HyperLink.cpp : implementation file +// +// HyperLink static control. Will open the default browser with the given URL +// when the user clicks on the link. +// +// Copyright Chris Maunder, 1997 +// Feel free to use and distribute. +// +// "GotoURL" function by Stuart Patterson +// As seen in the August, 1997 Windows Developer's Journal. +// Copyright 1997 by Miller Freeman, Inc. +// All rights reserved. +// Modified by Chris Maunder to use TCHARs instead of chars, + +#include "stdafx.h" +#include "HyperLink.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define TOOLTIP_ID 1 + +///////////////////////////////////////////////////////////////////////////// +// CHyperLink + +CHyperLink::CHyperLink() +{ + m_crLinkColour = RGB(0, 0, 238); // Blue + m_crVisitedColour = RGB(85, 26, 139); // Purple + m_bVisited = FALSE; // Hasn't been visited yet. + m_bUnderline = TRUE; // Underline the link? + m_strURL.Empty(); +} + +CHyperLink::~CHyperLink() +{ + if ((HFONT)m_Font) + m_Font.DeleteObject(); +} + + +BEGIN_MESSAGE_MAP(CHyperLink, CStatic) + //{{AFX_MSG_MAP(CHyperLink) + ON_CONTROL_REFLECT(STN_CLICKED, OnClicked) + ON_WM_CTLCOLOR_REFLECT() + ON_WM_SETCURSOR() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CHyperLink message handlers + +BOOL CHyperLink::PreTranslateMessage(MSG* pMsg) +{ + m_ToolTip.RelayEvent(pMsg); + return CStatic::PreTranslateMessage(pMsg); +} + +HBRUSH CHyperLink::CtlColor(CDC* pDC, UINT nCtlColor) +{ + ASSERT(nCtlColor == CTLCOLOR_STATIC); + + // Set the approriate colour + if (m_bVisited) + pDC->SetTextColor(m_crVisitedColour); + else + pDC->SetTextColor(m_crLinkColour); + + // Set underline font if required + if (m_bUnderline) { + + if (!(HFONT)m_Font) { // Create font only once. + LOGFONT lf; + GetFont()->GetLogFont(&lf); + lf.lfUnderline = TRUE; + m_Font.CreateFontIndirect(&lf); + } + + pDC->SelectObject(&m_Font); + } + + // transparent text. + pDC->SetBkMode(TRANSPARENT); + return (HBRUSH)GetStockObject(NULL_BRUSH); +} + +BOOL CHyperLink::OnSetCursor(CWnd* /*pWnd*/, UINT /*nHitTest*/, UINT /*message*/) +{ + ::SetCursor(m_hLinkCursor); + return TRUE; +} + +void CHyperLink::PreSubclassWindow() +{ + // We want to get mouse clicks via STN_CLICKED + DWORD dwStyle = GetStyle(); + ::SetWindowLong(m_hWnd, GWL_STYLE, dwStyle | SS_NOTIFY); + + // Set the URL as the window text + if (m_strURL.IsEmpty()) + GetWindowText(m_strURL); + + // Check that the window text isn't empty. If it is, set it as the URL. + CString strWndText; + GetWindowText(strWndText); + if (strWndText.IsEmpty()) { + ASSERT(!m_strURL.IsEmpty()); // Window and URL both NULL. DUH! + SetWindowText(m_strURL); + } + + PositionWindow(); // Adjust size of window to fit URL if necessary + + // Load up the hyperlink cursor + m_hLinkCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW); + + // Create the tooltip + CRect rect; + GetClientRect(rect); + m_ToolTip.Create(this); + m_ToolTip.AddTool(this, m_strURL, rect, TOOLTIP_ID); + + CStatic::PreSubclassWindow(); +} + +///////////////////////////////////////////////////////////////////////////// +// CHyperLink operations + +void CHyperLink::SetURL(CString strURL) +{ + m_strURL = strURL; + PositionWindow(); + m_ToolTip.UpdateTipText(strURL, this, TOOLTIP_ID); +} + +void CHyperLink::SetColours(COLORREF crLinkColour, COLORREF crVisitedColour) +{ + m_crLinkColour = crLinkColour; + m_crVisitedColour = crVisitedColour; + Invalidate(); +} + +void CHyperLink::SetVisited(BOOL bVisited /* = TRUE */) +{ + m_bVisited = bVisited; + Invalidate(); +} + +void CHyperLink::SetUnderline(BOOL bUnderline /* = TRUE */) +{ + m_bUnderline = bUnderline; + Invalidate(); +} + +void CHyperLink::SetAutoSize(BOOL bAutoSize /* = TRUE */) +{ + m_bAdjustToFit = bAutoSize; + PositionWindow(); +} + +void CHyperLink::PositionWindow() +{ + if (!m_bAdjustToFit) return; + + CRect rect; + GetWindowRect(rect); + + CString strWndText; + GetWindowText(strWndText); + + CWnd* pParent = GetParent(); + if (pParent) + pParent->ScreenToClient(rect); + + CDC* pDC = GetDC(); + CSize Extent = pDC->GetTextExtent(strWndText); + ReleaseDC(pDC); + + DWORD dwStyle = GetStyle(); + + if (dwStyle & SS_CENTERIMAGE) + rect.DeflateRect(0, (rect.Height() - Extent.cy)/2); + else + rect.bottom = rect.top + Extent.cy; + + if (dwStyle & SS_CENTER) + rect.DeflateRect((rect.Width() - Extent.cx)/2, 0); + else if (dwStyle & SS_RIGHT) + rect.left = rect.right - Extent.cx; + else // SS_LEFT = 0, so we can't test for it explicitly + rect.right = rect.left + Extent.cx; + + SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER); +} + +///////////////////////////////////////////////////////////////////////////// +// CHyperLink implementation + +void CHyperLink::OnClicked() +{ + int result = (int)GotoURL(m_strURL, SW_SHOW); + m_bVisited = (result > HINSTANCE_ERROR); + if (!m_bVisited) { + MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link + ReportError(result); + } else + SetVisited(); // Repaint to show visited colour +} + +LONG CHyperLink::GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata) +{ + HKEY hkey; + LONG retval = RegOpenKeyEx(key, subkey, 0, KEY_QUERY_VALUE, &hkey); + + if (retval == ERROR_SUCCESS) { + long datasize = MAX_PATH; + TCHAR data[MAX_PATH]; + RegQueryValue(hkey, NULL, data, &datasize); + lstrcpy(retdata,data); + RegCloseKey(hkey); + } + + return retval; +} + +void CHyperLink::ReportError(int nError) +{ + CString str; + switch (nError) { + case 0: str = "The operating system is out\nof memory or resources."; break; + case SE_ERR_PNF: str = "The specified path was not found."; break; + case SE_ERR_FNF: str = "The specified file was not found."; break; + case ERROR_BAD_FORMAT: str = "The .EXE file is invalid\n(non-Win32 .EXE or error in .EXE image)."; break; + case SE_ERR_ACCESSDENIED: str = "The operating system denied\naccess to the specified file."; break; + case SE_ERR_ASSOCINCOMPLETE: str = "The filename association is\nincomplete or invalid."; break; + case SE_ERR_DDEBUSY: str = "The DDE transaction could not\nbe completed because other DDE transactions\nwere being processed."; break; + case SE_ERR_DDEFAIL: str = "The DDE transaction failed."; break; + case SE_ERR_DDETIMEOUT: str = "The DDE transaction could not\nbe completed because the request timed out."; break; + case SE_ERR_DLLNOTFOUND: str = "The specified dynamic-link library was not found."; break; + case SE_ERR_NOASSOC: str = "There is no application associated\nwith the given filename extension."; break; + case SE_ERR_OOM: str = "There was not enough memory to complete the operation."; break; + case SE_ERR_SHARE: str = "A sharing violation occurred. "; + default: str.Format("Unknown Error (%d) occurred.", nError); break; + } + str = "Unable to open hyperlink:\n\n" + str; + AfxMessageBox(str, MB_ICONEXCLAMATION | MB_OK); +} + +HINSTANCE CHyperLink::GotoURL(LPCTSTR url, int showcmd) +{ + TCHAR key[MAX_PATH + MAX_PATH]; + + // First try ShellExecute() + HINSTANCE result = ShellExecute(NULL, _T("open"), url, NULL,NULL, showcmd); + + // If it failed, get the .htm regkey and lookup the program + if ((UINT)result <= HINSTANCE_ERROR) { + + if (GetRegKey(HKEY_CLASSES_ROOT, _T(".htm"), key) == ERROR_SUCCESS) { + lstrcat(key, _T("\\shell\\open\\command")); + + if (GetRegKey(HKEY_CLASSES_ROOT,key,key) == ERROR_SUCCESS) { + TCHAR *pos; + pos = _tcsstr(key, _T("\"%1\"")); + if (pos == NULL) { // No quotes found + pos = strstr(key, _T("%1")); // Check for %1, without quotes + if (pos == NULL) // No parameter at all... + pos = key+lstrlen(key)-1; + else + *pos = '\0'; // Remove the parameter + } + else + *pos = '\0'; // Remove the parameter + + lstrcat(pos, _T(" ")); + lstrcat(pos, url); + result = (HINSTANCE) WinExec(key,showcmd); + } + } + } + + return result; +} diff --git a/HyperLink.h b/HyperLink.h new file mode 100644 index 0000000..4349e1d --- /dev/null +++ b/HyperLink.h @@ -0,0 +1,93 @@ +// HyperLink.h : header file +// +// +// HyperLink static control. Will open the default browser with the given URL +// when the user clicks on the link. +// +// Copyright Chris Maunder, 1997 +// Feel free to use and distribute. + +#if !defined(AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_) +#define AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +///////////////////////////////////////////////////////////////////////////// +// CHyperLink window + +class CHyperLink : public CStatic +{ +// Construction/destruction +public: + CHyperLink(); + virtual ~CHyperLink(); + +// Attributes +public: + +// Operations +public: + + void SetURL(CString strURL); + CString GetURL() { return m_strURL; } + + void SetColours(COLORREF crLinkColour, COLORREF crVisitedColour); + COLORREF GetLinkColour() { return m_crLinkColour; } + COLORREF GetVisitedColour() { return m_crVisitedColour; } + + void SetVisited(BOOL bVisited = TRUE); + BOOL GetVisited() { return m_bVisited; } + + void SetLinkCursor(HCURSOR hCursor) { m_hLinkCursor = hCursor; } + + void SetUnderline(BOOL bUnderline = TRUE); + BOOL GetUnderline() { return m_bUnderline; } + + void SetAutoSize(BOOL bAutoSize = TRUE); + BOOL GetAutoSize() { return m_bAdjustToFit; } + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CHyperLink) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + +// Implementation +protected: + HINSTANCE GotoURL(LPCTSTR url, int showcmd); + void ReportError(int nError); + LONG GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata); + void PositionWindow(); + +// Protected attributes +protected: + COLORREF m_crLinkColour, m_crVisitedColour; // Hyperlink colours + BOOL m_bVisited; // Has it been visited? + BOOL m_bUnderline; // underline hyperlink? + BOOL m_bAdjustToFit; // Adjust window size to fit text? + CString m_strURL; // hyperlink URL + CFont m_Font; // Underline font if necessary + HCURSOR m_hLinkCursor; // Cursor for hyperlink + CToolTipCtrl m_ToolTip; // The tooltip + + // Generated message map functions +protected: + //{{AFX_MSG(CHyperLink) + afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + //}}AFX_MSG + afx_msg void OnClicked(); + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_) diff --git a/Install/empty.dir b/Install/empty.dir new file mode 100644 index 0000000..e69de29 diff --git a/MPL-1.0.txt b/MPL-1.0.txt new file mode 100644 index 0000000..e3f170c --- /dev/null +++ b/MPL-1.0.txt @@ -0,0 +1,360 @@ + MOZILLA PUBLIC LICENSE + Version 1.0 + + ---------------- + +1. Definitions. + + 1.1. ``Contributor'' means each entity that creates or contributes to + the creation of Modifications. + + 1.2. ``Contributor Version'' means the combination of the Original + Code, prior Modifications used by a Contributor, and the Modifications + made by that particular Contributor. + + 1.3. ``Covered Code'' means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each case + including portions thereof. + + 1.4. ``Electronic Distribution Mechanism'' means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + + 1.5. ``Executable'' means Covered Code in any form other than Source + Code. + + 1.6. ``Initial Developer'' means the individual or entity identified as + the Initial Developer in the Source Code notice required by Exhibit A. + + 1.7. ``Larger Work'' means a work which combines Covered Code or + portions thereof with code not governed by the terms of this License. + + 1.8. ``License'' means this document. + + 1.9. ``Modifications'' means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, a + Modification is: + + A. Any addition to or deletion from the contents of a file + containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + + 1.10. ``Original Code'' means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this License + is not already Covered Code governed by this License. + + 1.11. ``Source Code'' means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus any + associated interface definition files, scripts used to control + compilation and installation of an Executable, or a list of source code + differential comparisons against either the Original Code or another + well known, available Covered Code of the Contributor's choice. The + Source Code can be in a compressed or archival form, provided the + appropriate decompression or de-archiving software is widely available + for no charge. + + 1.12. ``You'' means an individual or a legal entity exercising rights + under, and complying with all of the terms of, this License or a future + version of this License issued under Section 6.1. For legal entities, + ``You'' includes any entity which controls, is controlled by, or is + under common control with You. For purposes of this definition, + ``control'' means (a) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (b) ownership of fifty percent (50%) or more of the + outstanding shares or beneficial ownership of such entity. + +2. Source Code License. + + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + + (a) to use, reproduce, modify, display, perform, sublicense and + distribute the Original Code (or portions thereof) with or without + Modifications, or as part of a Larger Work; and + + (b) under patents now or hereafter owned or controlled by Initial + Developer, to make, have made, use and sell (``Utilize'') the + Original Code (or portions thereof), but solely to the extent that + any such patent is reasonably necessary to enable You to Utilize + the Original Code (or portions thereof) and not to any greater + extent that may be necessary to Utilize further Modifications or + combinations. + + 2.2. Contributor Grant. + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + + (a) to use, reproduce, modify, display, perform, sublicense and + distribute the Modifications created by such Contributor (or + portions thereof) either on an unmodified basis, with other + Modifications, as Covered Code or as part of a Larger Work; and + + (b) under patents now or hereafter owned or controlled by + Contributor, to Utilize the Contributor Version (or portions + thereof), but solely to the extent that any such patent is + reasonably necessary to enable You to Utilize the Contributor + Version (or portions thereof), and not to any greater extent that + may be necessary to Utilize further Modifications or combinations. + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be distributed + only under the terms of this License or a future version of this + License released under Section 6.1, and You must include a copy of this + License with every copy of the Source Code You distribute. You may not + offer or impose any terms on any Source Code version that alters or + restricts the applicable version of this License or the recipients' + rights hereunder. However, You may include an additional document + offering the additional rights described in Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve (12) + months after the date it initially became available, or at least six + (6) months after a subsequent version of that particular Modification + has been made available to such recipients. You are responsible for + ensuring that the Source Code version remains available even if the + Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which you contribute to contain a + file documenting the changes You made to create that Covered Code and + the date of any change. You must include a prominent statement that the + Modification is derived, directly or indirectly, from Original Code + provided by the Initial Developer and including the name of the Initial + Developer in (a) the Source Code, and (b) in any notice in an + Executable version or related documentation in which You describe the + origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + + (a) Third Party Claims. + If You have knowledge that a party claims an intellectual property + right in particular functionality or code (or its utilization + under this License), you must include a text file with the source + code distribution titled ``LEGAL'' which describes the claim and + the party making the claim in sufficient detail that a recipient + will know whom to contact. If you obtain such knowledge after You + make Your Modification available as described in Section 3.2, You + shall promptly modify the LEGAL file in all copies You make + available thereafter and shall take other steps (such as notifying + appropriate mailing lists or newsgroups) reasonably calculated to + inform those who received the Covered Code that new knowledge has + been obtained. + + (b) Contributor APIs. + If Your Modification is an application programming interface and + You own or control patents which are reasonably necessary to + implement that API, you must also include this information in the + LEGAL file. + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source + Code, and this License in any documentation for the Source Code, where + You describe recipients' rights relating to Covered Code. If You + created one or more Modification(s), You may add your name as a + Contributor to the notice described in Exhibit A. If it is not possible + to put such notice in a particular Source Code file due to its + structure, then you must include such notice in a location (such as a + relevant directory file) where a user would be likely to look for such + a notice. You may choose to offer, and to charge a fee for, warranty, + support, indemnity or liability obligations to one or more recipients + of Covered Code. However, You may do so only on Your own behalf, and + not on behalf of the Initial Developer or any Contributor. You must + make it absolutely clear than any such warranty, support, indemnity or + liability obligation is offered by You alone, and You hereby agree to + indemnify the Initial Developer and every Contributor for any liability + incurred by the Initial Developer or such Contributor as a result of + warranty, support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of the + Covered Code is available under the terms of this License, including a + description of how and where You have fulfilled the obligations of + Section 3.2. The notice must be conspicuously included in any notice in + an Executable version, related documentation or collateral in which You + describe recipients' rights relating to the Covered Code. You may + distribute the Executable version of Covered Code under a license of + Your choice, which may contain terms different from this License, + provided that You are in compliance with the terms of this License and + that the license for the Executable version does not attempt to limit + or alter the recipient's rights in the Source Code version from the + rights set forth in this License. If You distribute the Executable + version under a different license You must make it absolutely clear + that any terms which differ from this License are offered by You alone, + not by the Initial Developer or any Contributor. You hereby agree to + indemnify the Initial Developer and every Contributor for any liability + incurred by the Initial Developer or such Contributor as a result of + any such terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Covered Code due to statute + or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and + the code they affect. Such description must be included in the LEGAL + file described in Section 3.4 and must be included with all + distributions of the Source Code. Except to the extent prohibited by + statute or regulation, such description must be sufficiently detailed + for a recipient of ordinary skill to be able to understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A, and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + Netscape Communications Corporation (``Netscape'') may publish revised + and/or new versions of the License from time to time. Each version will + be given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the + License, You may always continue to use it under the terms of that + version. You may also choose to use such Covered Code under the terms + of any subsequent version of the License published by Netscape. No one + other than Netscape has the right to modify the terms applicable to + Covered Code created under this License. + + 6.3. Derivative Works. + If you create or use a modified version of this License (which you may + only do in order to apply it to code which is not already Covered Code + governed by this License), you must (a) rename Your license so that the + phrases ``Mozilla'', ``MOZILLAPL'', ``MOZPL'', ``Netscape'', ``NPL'' or + any confusingly similar phrase do not appear anywhere in your license + and (b) otherwise make it clear that your version of the license + contains terms which differ from the Mozilla Public License and + Netscape Public License. (Filling in the name of the Initial Developer, + Original Code or Contributor in the notice described in Exhibit A shall + not of themselves be deemed to be modifications of this License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS'' BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF + DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE + IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE + COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +8. TERMINATION. + + This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to cure + such breach within 30 days of becoming aware of the breach. All + sublicenses to the Covered Code which are properly granted shall + survive any termination of this License. Provisions which, by their + nature, must remain in effect beyond the termination of this License + shall survive. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, + OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER + PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF + GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND + ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE + BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT + EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a ``commercial item,'' as that term is defined in + 48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer + software'' and ``commercial computer software documentation,'' as such + terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 + C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), + all U.S. Government End Users acquire Covered Code with only those + rights set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if any, + provides otherwise), excluding its conflict-of-law provisions. With + respect to disputes in which at least one party is a citizen of, or an + entity chartered or registered to do business in, the United States of + America: (a) unless otherwise agreed in writing, all disputes relating + to this License (excepting any dispute relating to intellectual + property rights) shall be subject to final and binding arbitration, + with the losing party paying all costs of arbitration; (b) any + arbitration relating to this Agreement shall be held in Santa Clara + County, California, under the auspices of JAMS/EndDispute; and (c) any + litigation relating to this Agreement shall be subject to the + jurisdiction of the Federal Courts of the Northern District of + California, with venue lying in Santa Clara County, California, with + the losing party responsible for costs, including without limitation, + court costs and reasonable attorneys fees and expenses. The application + of the United Nations Convention on Contracts for the International + Sale of Goods is expressly excluded. Any law or regulation which + provides that the language of a contract shall be construed against the + drafter shall not apply to this License. + +12. RESPONSIBILITY FOR CLAIMS. + + Except in cases where another Contributor has failed to comply with + Section 3.4, You are responsible for damages arising, directly or + indirectly, out of Your utilization of rights under this License, based + on the number of copies of Covered Code you made available, the + revenues you received from utilizing such rights, and other relevant + factors. You agree to work with affected parties to distribute + responsibility on an equitable basis. + +EXHIBIT A. + + ``The contents of this file are subject to the Mozilla Public License + Version 1.0 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + License for the specific language governing rights and limitations + under the License. + + The Original Code is ______________________________________. + + The Initial Developer of the Original Code is ________________________. + Portions created by ______________________ are Copyright (C) ______ + _______________________. All Rights Reserved. + + Contributor(s): ______________________________________.'' diff --git a/MainFrm.cpp b/MainFrm.cpp new file mode 100644 index 0000000..7c4501b --- /dev/null +++ b/MainFrm.cpp @@ -0,0 +1,875 @@ +// MainFrm.cpp : implementation of the CMainFrame class +// + +#include "stdafx.h" +#include "CB32.h" +#include "ComboBar.h" +#include "MainFrm.h" +#include "CB32Doc.h" +#include "CB32View.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame + +IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) + +BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) + ON_MESSAGE(MYWM_NOTIFYICON, On_MYWM_NOTIFYICON) + //{{AFX_MSG_MAP(CMainFrame) + ON_WM_CREATE() + ON_WM_CLOSE() + ON_COMMAND(ID_VIEW_STATUS_BAR, OnViewStatusBar) + ON_COMMAND(ID_EDIT_FIND_COMBO, OnEditFindCombo) + ON_WM_NCPAINT() + ON_WM_NCACTIVATE() + ON_WM_SYSCOLORCHANGE() + ON_MESSAGE(WM_SETTEXT, OnSetText) + ON_MESSAGE(WM_SETTINGCHANGE, OnSettingChange) + ON_COMMAND(ID_VIEW_WNDPOS, OnViewWndpos) + ON_WM_SYSCOMMAND() + ON_COMMAND(ID_TRAY_SHOW, OnTrayShow) + ON_COMMAND(ID_TRAY_EXIT, OnTrayExit) + ON_WM_DESTROY() + ON_COMMAND(ID_VIEW_FLATBAR, OnViewFlatbar) + ON_UPDATE_COMMAND_UI(ID_VIEW_FLATBAR, OnUpdateViewFlatbar) + //}}AFX_MSG_MAP + ON_UPDATE_COMMAND_UI(ID_VIEW_STATUS_BAR, OnUpdateViewStatusBar) + ON_UPDATE_COMMAND_UI(ID_INDICATOR_CLOCK, OnUpdateClock) +END_MESSAGE_MAP() + +// toolbar buttons - IDs are command buttons +static UINT BASED_CODE buttons[] = +{ + // same order as in the bitmap 'toolbar.bmp' + ID_FILE_NEW, + ID_FILE_OPEN, + ID_FILE_SAVE, + ID_SEPARATOR, + ID_ENTRY_ADD, + ID_ENTRY_EDIT, + ID_ENTRY_DELETE, + ID_ENTRY_COPY, + ID_SEPARATOR, + ID_SEPARATOR, //(10) CComboBox location in the toolbar + ID_EDIT_FIND, + ID_SEPARATOR, + ID_TBAR_DIAL, + ID_TBAR_EMAIL, + ID_TBAR_WEB, + ID_APP_PREFS, + ID_SEPARATOR, + ID_HELP_INDEX, +}; + +static UINT indicators[] = +{ + ID_SEPARATOR, // status line indicator + ID_INDICATOR_CAPS, + ID_INDICATOR_NUM, + ID_INDICATOR_SCRL, + ID_INDICATOR_CLOCK, +}; + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame construction/destruction + +CMainFrame::CMainFrame() +{ + m_bActive = -1; // invalid + // init tray icon tracker + m_inTray = FALSE; +} + +CMainFrame::~CMainFrame() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// Helpers for saving/restoring window state + +BOOL CMainFrame::ReadWindowPlacement(LPWINDOWPLACEMENT pwp) +{ + CString strBuffer = theApp.GetProfileString(_T("Preferences"), + _T("WindowPos")); + if (strBuffer.IsEmpty()) + return FALSE; + + WINDOWPLACEMENT wp; + int nRead = _stscanf(strBuffer, _T("%u,%u,%d,%d,%d,%d,%d,%d,%d,%d"), + &wp.flags, &wp.showCmd, + &wp.ptMinPosition.x, &wp.ptMinPosition.y, + &wp.ptMaxPosition.x, &wp.ptMaxPosition.y, + &wp.rcNormalPosition.left, &wp.rcNormalPosition.top, + &wp.rcNormalPosition.right, &wp.rcNormalPosition.bottom); + + if (nRead != 10) + return FALSE; + + if (m_inTray) + wp.showCmd = SW_HIDE; + + wp.length = sizeof wp; + *pwp = wp; + return TRUE; +} + +void CMainFrame::WriteWindowPlacement(LPWINDOWPLACEMENT pwp) +{ + TCHAR szBuffer[sizeof("-32767")*8 + sizeof("65535")*2]; + + wsprintf(szBuffer, _T("%u,%u,%d,%d,%d,%d,%d,%d,%d,%d"), + pwp->flags, pwp->showCmd, + pwp->ptMinPosition.x, pwp->ptMinPosition.y, + pwp->ptMaxPosition.x, pwp->ptMaxPosition.y, + pwp->rcNormalPosition.left, pwp->rcNormalPosition.top, + pwp->rcNormalPosition.right, pwp->rcNormalPosition.bottom); + theApp.WriteProfileString(_T("Preferences"), _T("WindowPos"), + szBuffer); +} + +void CMainFrame::SaveWndSize() +{ + WINDOWPLACEMENT wp; + wp.length = sizeof wp; + if (GetWindowPlacement(&wp)) + { + wp.flags = 0; + if (IsZoomed()) + wp.flags |= WPF_RESTORETOMAXIMIZED; + if (!IsIconic()) + WriteWindowPlacement(&wp); + } +} + +///////////////////////////////////////////////////////////////////////////// +// Create main window with toolbar, etc + +int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CFrameWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (theApp.GetProfileInt(_T("Preferences"),_T("StartMinimized"),0)) + { + TrayMessage(NIM_ADD,IDR_MAINFRAME, + AfxGetApp()->LoadIcon(IDR_MAINFRAME), + m_strTitle + " " + GetDocTitle()); + m_inTray = TRUE; + } + + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberWin"),1)) + { + WINDOWPLACEMENT wp; + if (ReadWindowPlacement(&wp)) + SetWindowPlacement(&wp); + } + + if (!m_wndToolBar.Create(this) || + !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) || + !m_wndToolBar.SetButtons(buttons, + sizeof(buttons)/sizeof(UINT))) + { + TRACE0("Failed to create toolbar\n"); + return -1; // fail to create + } + + if (!CreateComboBox()) + { + TRACE0("Failed to create combobox in toolbar\n"); + return -1; // fail to create + } + + // TODO: Remove this if you don't want tool tips or a resizeable toolbar + m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | + CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); + + // TODO: Delete these three lines if you don't want the toolbar to + // be dockable + m_wndToolBar.SetWindowText(_T("ContactBook ToolBar")); + m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); + EnableDocking(CBRS_ALIGN_ANY); + DockControlBar(&m_wndToolBar); + + m_wndToolBar.SetFlatLook(theApp.GetProfileInt(_T("Preferences"),_T("Flatbar"),1)); + + if (!m_wndStatusBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM , AFX_IDW_STATUS_BAR) || + !m_wndStatusBar.SetIndicators(indicators, + sizeof(indicators)/sizeof(UINT))) + { + TRACE0("Failed to create status bar\n"); + return -1; // fail to create + } + + // create the timer to update the status bar clock + if(!SetTimer(TIMER_ID, 2000, &CMainFrame::UpdateTime)) + return -1; + + CMainFrame::UpdateTime(m_hWnd, 0, 0, 0); // update the time now + + return 0; +} + +BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) +{ + // TODO: Modify the Window class or styles here by modifying + // the CREATESTRUCT cs + + return CFrameWnd::PreCreateWindow(cs); +} + +void CMainFrame::OnClose() +{ + KillTimer(TIMER_ID); + + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberWin"),1)) + SaveWndSize(); + + DeleteTrayIcon(); + + CFrameWnd::OnClose(); +} + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame diagnostics + +#ifdef _DEBUG +void CMainFrame::AssertValid() const +{ + CFrameWnd::AssertValid(); +} + +void CMainFrame::Dump(CDumpContext& dc) const +{ + CFrameWnd::Dump(dc); +} + +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame message handlers + +// Private MFC function only sets the title if it's different +// +extern void AFXAPI AfxSetWindowText(HWND, LPCTSTR); + +////////////////// +// Override to change title--app name first, then doc name +void CMainFrame::OnUpdateFrameTitle(BOOL bAddToTitle) +{ + AfxSetWindowText(m_hWnd, m_strTitle + " " + GetDocTitle()); +} + +////////////////// +// Get doc title: I use full path name or "untitled" +CString CMainFrame::GetDocTitle() +{ + CString s = ""; + CDocument* pDoc = GetActiveDocument(); + if (pDoc != NULL) + s = pDoc->GetPathName(); + return s.IsEmpty() ? "- [Untitled]" : "- ["+s+"]"; +} + +//////////////// +// Mini-class to get the caption rectangle of a window in window coords. +// This is the area of the title bar inside the window frame, +// including the icon but not the min/max/close buttons. +class CCaptionRect : public CRect { +public: + CCaptionRect(const CWnd& wnd); // use reference to deny NULL ptr +}; + +///////////////// +// Paint non-client area: First let Windows paint, then I'll paint over it. +// +// I use the relatively obscure and poorly documented update region feature +// to prevent Windows from painting the title text. This is to get totally +// flicker-free painting when the user sizes the window. Note that Windows +// sometimes uses WPARAM=1. +void CMainFrame::OnNcPaint() +{ + MSG& msg = AfxGetThreadState()->m_lastSentMsg; + HRGN hRgn = (HRGN)msg.wParam; + + CCaptionRect rc(*this); // caption rectangle in window coords + CRect rcWin; // window rect + GetWindowRect(&rcWin); // .. get window rect + rc += rcWin.TopLeft(); // convert caption rect to screen coords + + // Don't bother painting if the caption doesn't lie within the region. + if (msg.wParam > 1 && !::RectInRegion((HRGN)msg.wParam, &rc)) { + CFrameWnd::OnNcPaint(); // just do default thing + return; // and quit + } + + // Exclude caption from update region + HRGN hRgnCaption = ::CreateRectRgnIndirect(&rc); + HRGN hRgnNew = ::CreateRectRgnIndirect(&rc); + if (msg.wParam > 1) { + // wParam is a valid region: subtract caption from it + ::CombineRgn(hRgnNew, hRgn, hRgnCaption, RGN_DIFF); + } else { + // wParam is not a valid region: create one that's the whole + // window minus the caption bar + HRGN hRgnAll = ::CreateRectRgnIndirect(&rcWin); + CombineRgn(hRgnNew, hRgnAll, hRgnCaption, RGN_DIFF); + DeleteObject(hRgnAll); + } + + // Call Windows to do WM_NCPAINT with altered update region + WPARAM savewp = msg.wParam; // save original wParam + msg.wParam = (WPARAM)hRgnNew; // set new region for DefWindowProc + CFrameWnd::OnNcPaint(); // call it + DeleteObject(hRgnCaption); // clean up + DeleteObject(hRgnNew); // ... + msg.wParam = savewp; // restore original wParam + + PaintCaption(); // Now paint my special caption +} + +////////////////// +// Non-client area (de)activated: paint it +BOOL CMainFrame::OnNcActivate(BOOL bActive) +{ + // Mimic MFC kludge to stay active if WF_STAYACTIVE bit is on + if (m_nFlags & WF_STAYACTIVE) + bActive = TRUE; + if (!IsWindowEnabled()) // but not if disabled + bActive = FALSE; + + if (bActive==m_bActive) + return TRUE; // nothing to do + + // Turn WS_VISIBLE off before callinf DefWindowProc, + // so DefWindowProc won't paint and thereby cause flicker. + DWORD dwStyle = GetStyle(); + if (dwStyle & WS_VISIBLE) + SetWindowLong(m_hWnd, GWL_STYLE, (dwStyle & ~ WS_VISIBLE)); + // do not call the base class because it will call Default() + // and we may have changed bActive. + DefWindowProc(WM_NCACTIVATE, bActive, 0L); + if (dwStyle & WS_VISIBLE) + SetWindowLong(m_hWnd, GWL_STYLE, dwStyle); + + // At this point, nothing has happened (since WS_VISIBLE was off). + // Now it's time to paint. + m_bActive = bActive; // update state + SendMessage(WM_NCPAINT); // paint non-client area (frame too) + return TRUE; // done OK +} + +////////////////// +// Someone called SetWindowText: paint new text. +LRESULT CMainFrame::OnSetText(WPARAM wParam, LPARAM lParam) +{ + // Turn WS_VISIBLE style off before calling Windows to + // set the text, then turn it back on again after. + DWORD dwStyle = GetStyle(); + if (dwStyle & WS_VISIBLE) + SetWindowLong(m_hWnd, GWL_STYLE, dwStyle & ~ WS_VISIBLE); + LRESULT lRet = DefWindowProc(WM_SETTEXT, wParam, lParam); + if (dwStyle & WS_VISIBLE) + SetWindowLong(m_hWnd, GWL_STYLE, dwStyle); + + m_rcCaption.SetRectEmpty(); // invalidate caption + SendMessage(WM_NCPAINT); // paint non-client area (frame too) + PaintCaption(); // ..and paint it + return lRet; +} + +////////////////// +// User changed system settings (possibly font) or colors. +// Invalidate everything to generate anew. +LRESULT CMainFrame::OnSettingChange(WPARAM, LPARAM) +{ + OnSysColorChange(); + return 0; +} +void CMainFrame::OnSysColorChange() +{ + m_fontCaption.DeleteObject(); // generate new fonts + m_fontAcme.DeleteObject(); // ... + m_rcCaption.SetRectEmpty(); // will force new bitmap to be created +} + +////////////////// +// Paint custom caption. Flag tells whether active or not. +// Just blast the bitmap to the title bar, but not iif minimized (iconic). +void CMainFrame::PaintCaption(BOOL bActive) +{ + if (!IsIconic()) { + CWindowDC dcWin(this); + CDC dc; + dc.CreateCompatibleDC(&dcWin); + CBitmap* pOldBitmap = dc.SelectObject(GetCaptionBitmap(bActive)); + const CRect& rc = m_rcCaption; + dcWin.BitBlt(rc.left,rc.top,rc.Width(),rc.Height(),&dc,0,0,SRCCOPY); + } +} + +////////////////// +// Helper function to compute the luminosity for an RGB color. +// Measures how bright the color is. I use this so I can draw the caption +// text using the user's chosen color, unless it's too dark. See MSDN for +// definition of luminosity and how to compute it. +static int GetLuminosity(COLORREF color) +{ +#define HLSMAX 240 // This is what Display Properties uses +#define RGBMAX 255 // max r/g/b value is 255 + int r = GetRValue(color); + int g = GetGValue(color); + int b = GetBValue(color); + int rgbMax = max( max(r,g), b); + int rgbMin = min( min(r,g), b); + return (((rgbMax+rgbMin) * HLSMAX) + RGBMAX ) / (2*RGBMAX); +} + +#define COLOR_WHITE RGB(255,255,255) +#define COLOR_BLACK RGB(0,0,0) +#define NCOLORSHADES 64 // this many shades in gradient + +////////////////// +// Helper to paint rectangle with a color. +static void PaintRect(CDC& dc, int x, int y, int w, int h, COLORREF color) +{ + CBrush brush(color); + CBrush* pOldBrush = dc.SelectObject(&brush); + dc.PatBlt(x, y, w, h, PATCOPY); + dc.SelectObject(pOldBrush); +} + +////////////////// +// Get the appropriate bitmap whether active/inactive. If the size of +// the caption rect has changed since the last time it was generated, +// generate it again. +// +// This is the function that actually does the shading. It creates a +// bitmap that's used to paint the caption. It looks horrible, but it's +// just a lot of bit-twiddling GDI stuff. +CBitmap* CMainFrame::GetCaptionBitmap(BOOL bActive) +{ + CBitmap& bm = m_bmCaption[bActive!=0]; // one of two bitmaps + CCaptionRect rcCap(*this); // caption rectangle in win coords + if (rcCap != m_rcCaption) { // if changed since last time: + m_bmCaption[0].DeleteObject(); // delete both bitmaps, + m_bmCaption[1].DeleteObject(); // ..they are bad + m_rcCaption = rcCap; // note for next time + } + if (bm.m_hObject) + return &bm; // already have bitmap; return it. + + // Either the size changed or the bitmap was never created. Create it. + rcCap -= rcCap.TopLeft(); // convert caption rectangle origin to (0,0) + int w = rcCap.Width(); + int h = rcCap.Height(); + int cxIcon = GetSystemMetrics(SM_CXSIZE); + int cyIcon = GetSystemMetrics(SM_CYSIZE); + + // Create bitmap same size as caption area and select into memory DC + CWindowDC dcWin(this); + CDC dc; + dc.CreateCompatibleDC(&dcWin); + bm.DeleteObject(); + bm.CreateCompatibleBitmap(&dcWin, w, h); + CBitmap* pOldBitmap = dc.SelectObject(&bm); + + // Paint shaded background. Note all painting is into memory DC, + // not window, so there's no flicker. + if (!bActive) { + // Inactive caption: don't do shading, just fill w/bg color + PaintRect(dc, 0, 0, w, h, GetSysColor(COLOR_INACTIVECAPTION)); + + } else { + // Active caption: do shading + COLORREF clrBG = GetSysColor(COLOR_ACTIVECAPTION); // background color + int r = GetRValue(clrBG); // red.. + int g = GetGValue(clrBG); // ..green + int b = GetBValue(clrBG); // ..blue color vals + int x = 5*rcCap.right/6; // start 5/6 of the way right + int w = x - rcCap.left; // width of area to shade + int xDelta= max(w/NCOLORSHADES,1); // width of one shade band + + // Paint far right 1/6 of caption the background color + PaintRect(dc, x, 0, rcCap.right-x, h, clrBG); + + // Compute new color brush for each band from x to x + xDelta. + // Excel uses a linear algorithm from black to normal, i.e. + // + // color = CaptionColor * r + // + // where r is the ratio x/w, which ranges from 0 (x=0, left) + // to 1 (x=w, right). This results in a mostly black title bar, + // since we humans don't distinguish dark colors as well as light + // ones. So instead, I use the formula + // + // color = CaptionColor * [1-(1-r)^2] + // + // which still equals black when r=0 and CaptionColor when r=1, + // but spends more time near CaptionColor. For example, when r=.5, + // the multiplier is [1-(1-.5)^2] = .75, closer to 1 than .5. + // I leave the algebra to the reader to verify that the above formula + // is equivalent to + // + // color = CaptionColor - (CaptionColor*(w-x)*(w-x))/(w*w) + // + // The computation looks horrendous, but it's only done once each + // time the caption changes size; thereafter BitBlt'ed to the screen. + // + while (x > xDelta) { // paint bands right to left + x -= xDelta; // next band + int wmx2 = (w-x)*(w-x); // w minus x squared + int w2 = w*w; // w squared + PaintRect(dc, x, 0, xDelta, h, + RGB(r-(r*wmx2)/w2, g-(g*wmx2)/w2, b-(b*wmx2)/w2)); + } + + PaintRect(dc,0,0,x,h,COLOR_BLACK); // whatever's left ==> black + } + + // Draw icon and caption buttons. + // These are all drawn inside a rectangle of dimensions SM_C[XY]SIZE. + CRect rcButn(0,0,cxIcon,cyIcon); + + // Within the basic button rectangle, Windows 95 uses a 1 or 2 pixel border + // Icon has 2 pixel border on left, 1 pixel on top/bottom, 0 right + rcButn.DeflateRect(0,1); + rcButn.left += 2; + DrawIconEx(dc.m_hDC, rcButn.left, rcButn.top, + (HICON)GetClassLong(m_hWnd, GCL_HICONSM), + rcButn.Width(), rcButn.Height(), 0, NULL, DI_NORMAL); + + // Close box has a 2 pixel border on all sides but left, which is zero + rcButn.DeflateRect(0,1); // shrink top/bottom 1 more + rcButn += CPoint(w-cxIcon-2,0); // move right + dc.DrawFrameControl(&rcButn, DFC_CAPTION, DFCS_CAPTIONCLOSE); + + DWORD dwStyle = GetStyle(); + + // Max/restore button is like close box; just shift rectangle left + if (dwStyle & WS_MAXIMIZEBOX) { + rcButn -= CPoint(cxIcon,0); + dc.DrawFrameControl(&rcButn, DFC_CAPTION, + IsZoomed() ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX); + } + + // Minimize button has 2 pixel border on all sides but right. + if (dwStyle & WS_MINIMIZEBOX) { + rcButn -= CPoint(cxIcon-2,0); + dc.DrawFrameControl(&rcButn, DFC_CAPTION, DFCS_CAPTIONMIN); + } + + // Now draw text. First Create fonts if needed + if (!m_fontCaption.m_hObject) + CreateFonts(); + + // Paint "ACME TEXT" using ACME font, always white + //CString s = m_strTitle + " "; // app title + CRect rcText = rcCap; // caption rectangle + rcText.left += cxIcon+2; // start after icon + rcText.right = rcButn.left-2; // don't draw past buttons + dc.SetBkMode(TRANSPARENT); // draw on top of our shading + //dc.SetTextColor(COLOR_WHITE); // always white + CFont* pOldFont = dc.SelectObject(&m_fontAcme); + //dc.DrawText(s, &rcText, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS); + + // Now paint window title (caption) + //rcText.left += dc.GetTextExtent(s).cx; // move past "ACME EDIT " + if (rcText.right > rcText.left) { // if still room: + COLORREF clrText; // text color + if (bActive) { + // Excel always uses white for title color, but I use the user's + // selected color--unless it's too dark, then I use white. + clrText = GetSysColor(COLOR_CAPTIONTEXT); + if (GetLuminosity(clrText) < 90) // good from trial & error + clrText = COLOR_WHITE; + } else + clrText = GetSysColor(COLOR_INACTIVECAPTIONTEXT); + + // Paint the text. Use DT_END_ELLIPSIS to draw ellipsis if text + // won't fit. Win32 sure is friendly! + COLORREF clrColor; + clrColor = dc.SetTextColor(clrText); + dc.SelectObject(&m_fontCaption); + dc.DrawText(m_strTitle + " " + GetDocTitle(), &rcText, + DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS); + dc.SetTextColor(clrColor); + } + + // Restore DC + dc.SelectObject(pOldFont); + dc.SelectObject(pOldBitmap); + + return &bm; // return bitmap to caller--whew! +} + +////////////////// +// Helper function to build the fonts I need. +// +void CMainFrame::CreateFonts() +{ + // Get current system caption font, just to get its size + NONCLIENTMETRICS ncm; + ncm.cbSize = sizeof(ncm); + VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0)); + m_fontCaption.CreateFontIndirect(&ncm.lfCaptionFont); + + // Create "ACME" font same size as caption font, but use Book Antiqua + m_fontAcme.CreatePointFont(80, _T("MS Sans Serif")); // 12 pt for now + LOGFONT lf; + m_fontAcme.GetLogFont(&lf); // get font info + m_fontAcme.DeleteObject(); // I don't really want 12 pt + lf.lfWeight|=FW_BOLD; // make bold + lf.lfHeight = ncm.lfCaptionFont.lfHeight; // same height as caption font + m_fontAcme.CreateFontIndirect(&lf); // create font +} + +////////////////// +// CCaptionRect: Constructor conputes caption rectangle in window coords. +CCaptionRect::CCaptionRect(const CWnd& wnd) +{ + // Get size of frame around window + DWORD dwStyle = wnd.GetStyle(); + CSize szFrame = (dwStyle & WS_THICKFRAME) ? + CSize(GetSystemMetrics(SM_CXSIZEFRAME), + GetSystemMetrics(SM_CYSIZEFRAME)) : + CSize(GetSystemMetrics(SM_CXFIXEDFRAME), + GetSystemMetrics(SM_CYFIXEDFRAME)); + + int cxIcon = GetSystemMetrics(SM_CXSIZE); // width of caption icon/button + + // Compute rectangle + wnd.GetWindowRect(this); // window rect in screen coords + *this -= CPoint(left, top); // shift origin to (0,0) + left += szFrame.cx; // frame + right -= szFrame.cx; // frame + top += szFrame.cy; // top = end of frame + bottom = top + GetSystemMetrics(SM_CYCAPTION) // height of caption + - GetSystemMetrics(SM_CYBORDER); // minus gray shadow border +} + +/////////////////////////////////////// +// time/combobar +int CMainFrame::CreateComboBox() +{ + CRect rect, comboRect; + m_wndToolBar.SetButtonInfo(9, IDW_COMBO, TBBS_SEPARATOR, COMBO_WIDTH); + m_wndToolBar.GetItemRect(9, &rect); + rect.bottom += COMBO_HEIGHT; + + if (!m_wndToolBar.m_toolBarCombo.Create(CBS_DROPDOWN|WS_VISIBLE|WS_TABSTOP|CBS_AUTOHSCROLL, + rect, &m_wndToolBar, IDW_COMBO)) + { + return FALSE; + } + + // center combo box edit control vertically within tool bar + rect.bottom -= COMBO_HEIGHT; + m_wndToolBar.m_toolBarCombo.GetWindowRect(&comboRect); + m_wndToolBar.m_toolBarCombo.ScreenToClient(&comboRect); + + m_wndToolBar.m_toolBarCombo.SetWindowPos(&m_wndToolBar.m_toolBarCombo, rect.left, + rect.top + (rect.Height() - comboRect.Height())/2+1, 0, 0, + SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE); + + return TRUE; +} + +void CMainFrame::OnViewStatusBar() +{ + CWnd* pStatusBar; + if (pStatusBar = GetDescendantWindow(AFX_IDW_STATUS_BAR)) + { + pStatusBar->ShowWindow(!(pStatusBar->GetStyle() & WS_VISIBLE)); + RecalcLayout(); + } +} + +void CMainFrame::OnUpdateViewStatusBar(CCmdUI* pCmdUI) +{ + CWnd* pStatusBar; + if (pStatusBar = GetDescendantWindow(AFX_IDW_STATUS_BAR)) + pCmdUI->SetCheck((pStatusBar->GetStyle() & WS_VISIBLE)); +} + +void CMainFrame::OnViewWndpos() +{ + SaveWndSize(); + AfxMessageBox(IDS_WINDSAVE, MB_ICONINFORMATION); +} + +void CMainFrame::OnUpdateClock(CCmdUI* pCmdUI) +{ + pCmdUI->Enable(TRUE); +} + +void CMainFrame::OnEditFindCombo() +{ + m_wndToolBar.m_toolBarCombo.SetFocus(); +} + +void CALLBACK EXPORT CMainFrame::UpdateTime(HWND hWnd,UINT nMsg, UINT nIDEvent, DWORD dwTime) +{ + CString time; + BOOL bPM = TRUE; + SYSTEMTIME tm; + + CMainFrame* pFrame = (CMainFrame*)CWnd::FromHandle(hWnd); + CStatusBar* pStatusBar = (CStatusBar*) pFrame->GetDescendantWindow(AFX_IDW_STATUS_BAR); + + if (pStatusBar == NULL) + return; + + GetLocalTime(&tm); + + if (tm.wHour >= 0 && tm.wHour < 12) + bPM = FALSE; + + // convert 24 hour clock + if (tm.wHour > 12) // 13 - 23 + tm.wHour -= 12; + else if (tm.wHour == 0) // midnight + tm.wHour = 12; + + time.Format(_T(" %d:%02.2d %s "), tm.wHour, tm.wMinute, ((bPM) ? _T("PM"):_T("AM"))); + + // get current pane font information and update time + UINT nID, nStyle; + int nWidth, nIndex = pStatusBar->CommandToIndex(ID_INDICATOR_CLOCK); + + CClientDC dc(pStatusBar); + CFont* pOldFont = dc.SelectObject(pStatusBar->GetFont()); + CSize szExtent = dc.GetTextExtent(time, time.GetLength()); + dc.SelectObject(pOldFont); + + pStatusBar->GetPaneInfo(nIndex, nID, nStyle, nWidth); + pStatusBar->SetPaneInfo(nIndex, nID, nStyle, szExtent.cx); + pStatusBar->SetPaneText(nIndex, time); +} + + +void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam) +{ + if ((nID == SC_MINIMIZE) && theApp.GetProfileInt(_T("Preferences"),_T("RememberTray"),1)) + { + TrayMessage(NIM_ADD,IDR_MAINFRAME, + AfxGetApp()->LoadIcon(IDR_MAINFRAME), + m_strTitle + " " + GetDocTitle()); + m_inTray = TRUE; + ShowWindow(SW_HIDE); + } + else + CFrameWnd::OnSysCommand(nID, lParam); +} + +BOOL CMainFrame::TrayMessage(DWORD dwMessage, UINT uID, HICON hIcon, + CString pszTip) +{ + BOOL res; + + tnd.cbSize = sizeof(NOTIFYICONDATA); + tnd.hWnd = m_hWnd; + tnd.uID = uID; + tnd.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP; + tnd.uCallbackMessage = MYWM_NOTIFYICON; + tnd.hIcon = hIcon; + + if (!pszTip.IsEmpty()) + { + lstrcpyn(tnd.szTip, pszTip, sizeof(tnd.szTip)); + } + else + { + tnd.szTip[0] = '\0'; + } + + res = Shell_NotifyIcon(dwMessage, &tnd); + + if (hIcon) + DestroyIcon(hIcon); + + return res; +} + +LONG CMainFrame::On_MYWM_NOTIFYICON(UINT wParam, LONG lParam) +{ + UINT uMouseMsg; + + uMouseMsg = (UINT) lParam; + + switch (uMouseMsg) + { + case WM_LBUTTONUP: + { + ShowWindow(SW_SHOW); + DeleteTrayIcon(); + break; + } + + case WM_RBUTTONUP: + { + CMenu menu; + CMenu* pSubMenu = NULL; + if (menu.LoadMenu(IDR_TRAYMENU)) + pSubMenu = menu.GetSubMenu(0); + if (pSubMenu) + { + ::SetMenuDefaultItem(pSubMenu->m_hMenu, 0, TRUE); + CPoint ptCur; + ::GetCursorPos(&ptCur); + ::SetForegroundWindow(tnd.hWnd); + ::TrackPopupMenu(pSubMenu->m_hMenu, 0, ptCur.x, ptCur.y, 0, tnd.hWnd, NULL); + } + } + } + return 0; +} + +void CMainFrame::OnTrayShow() +{ + ShowWindow(SW_SHOW); + DeleteTrayIcon(); +} + +void CMainFrame::OnTrayExit() +{ + DeleteTrayIcon(); + theApp.HideApplication(); + CDocument* pDoc = GetActiveDocument(); + if (pDoc != NULL) + pDoc->SaveModified(); + theApp.CloseAllDocuments(FALSE); + PostQuitMessage(0); +} + +void CMainFrame::DeleteTrayIcon() +{ + if (m_inTray) + { + TrayMessage(NIM_DELETE,IDR_MAINFRAME,0,""); + m_inTray = FALSE; + } +} + +void CMainFrame::OnDestroy() +{ + CFrameWnd::OnDestroy(); + DeleteTrayIcon(); +} + +void CMainFrame::OnViewFlatbar() +{ + m_wndToolBar.SetFlatLook(!m_wndToolBar.IsFlatLook()); + theApp.WriteProfileInt(_T("Preferences"),_T("Flatbar"), + m_wndToolBar.IsFlatLook()); +} + +void CMainFrame::OnUpdateViewFlatbar(CCmdUI* pCmdUI) +{ + pCmdUI->SetCheck(m_wndToolBar.IsFlatLook()); +} diff --git a/MainFrm.h b/MainFrm.h new file mode 100644 index 0000000..c0367c6 --- /dev/null +++ b/MainFrm.h @@ -0,0 +1,107 @@ +// MainFrm.h : interface of the CMainFrame class +// +///////////////////////////////////////////////////////////////////////////// + +#define MYWM_NOTIFYICON (WM_APP + 100) + +class CMainFrame : public CFrameWnd +{ +protected: // create from serialization only + CMainFrame(); + DECLARE_DYNCREATE(CMainFrame) + +// Attributes +public: + CComboToolBar m_wndToolBar; + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMainFrame) + public: + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CMainFrame(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: // control bar embedded members + CStatusBar m_wndStatusBar; + BOOL m_inTray; + NOTIFYICONDATA tnd; + + BOOL CreateComboBox(); + + // Stuff for painting custom title bar: + CFont m_fontCaption; // normal system font for active caption + CFont m_fontAcme; // "ACME" company font (same active/inactive) + BOOL m_bActive; // whether active or not; + CRect m_rcCaption; // caption rectangle + CBitmap m_bmCaption[2]; // bitmap captions active/inactive + + // Override + void OnUpdateFrameTitle(BOOL bAddToTitle); + + // Helpers + BOOL ReadWindowPlacement(LPWINDOWPLACEMENT pwp); + void WriteWindowPlacement(LPWINDOWPLACEMENT pwp); + void SaveWndSize(); + CString GetDocTitle(); + void PaintCaption(BOOL bActive); + void PaintCaption() { PaintCaption(m_bActive); } + void CreateFonts(); + CBitmap* GetCaptionBitmap(BOOL bActive); + + BOOL TrayMessage(DWORD dwMessage, UINT uID, HICON hIcon, + CString pszTip); + LONG On_MYWM_NOTIFYICON(UINT wParam, LONG lParam); + void DeleteTrayIcon(); + +// Generated message map functions +protected: + //{{AFX_MSG(CMainFrame) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnClose(); + afx_msg void OnViewStatusBar(); + afx_msg void OnEditFindCombo(); + afx_msg void OnNcPaint(); + afx_msg BOOL OnNcActivate(BOOL bActive); + afx_msg void OnSysColorChange(); + afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSettingChange(WPARAM, LPARAM); + afx_msg void OnViewWndpos(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnTrayShow(); + afx_msg void OnTrayExit(); + afx_msg void OnDestroy(); + afx_msg void OnViewFlatbar(); + afx_msg void OnUpdateViewFlatbar(CCmdUI* pCmdUI); + //}}AFX_MSG + afx_msg void OnUpdateViewStatusBar(CCmdUI* pCmdUI); + afx_msg void OnUpdateClock(CCmdUI* pCmdUI); + + // timer call back function + static void CALLBACK EXPORT UpdateTime(HWND hWnd,UINT nMsg, UINT nIDEvent, DWORD dwTime); + + DECLARE_MESSAGE_MAP() + +public: + inline CStatusBar& GetStatusBar() { return m_wndStatusBar; } + +}; + +inline CCB32View* GetApplicationView() +{ + CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd(); + ASSERT(pFrame); + return (CCB32View*)(pFrame)->GetActiveView(); +} + +///////////////////////////////////////////////////////////////////////////// diff --git a/MakeHelp.bat b/MakeHelp.bat new file mode 100644 index 0000000..123cd4a --- /dev/null +++ b/MakeHelp.bat @@ -0,0 +1,39 @@ +@echo off +REM -- First make map file from Microsoft Visual C++ generated resource.h +echo // MAKEHELP.BAT generated Help Map file. Used by CB32.HPJ. >"hlp\CB32.hm" +echo. >>"hlp\CB32.hm" +echo // Commands (ID_* and IDM_*) >>"hlp\CB32.hm" +makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 resource.h >>"hlp\CB32.hm" +echo. >>"hlp\CB32.hm" +echo // Prompts (IDP_*) >>"hlp\CB32.hm" +makehm IDP_,HIDP_,0x30000 resource.h >>"hlp\CB32.hm" +echo. >>"hlp\CB32.hm" +echo // Resources (IDR_*) >>"hlp\CB32.hm" +makehm IDR_,HIDR_,0x20000 resource.h >>"hlp\CB32.hm" +echo. >>"hlp\CB32.hm" +echo // Dialogs (IDD_*) >>"hlp\CB32.hm" +makehm IDD_,HIDD_,0x20000 resource.h >>"hlp\CB32.hm" +echo. >>"hlp\CB32.hm" +echo // Frame Controls (IDW_*) >>"hlp\CB32.hm" +makehm IDW_,HIDW_,0x50000 resource.h >>"hlp\CB32.hm" +REM -- Make help for Project CB32 + + +echo Building Win32 Help files +start /wait hcw /C /E /M "hlp\CB32.hpj" +if errorlevel 1 goto :Error +if not exist "hlp\CB32.hlp" goto :Error +if not exist "hlp\CB32.cnt" goto :Error +echo. +if exist Debug\nul copy "hlp\CB32.hlp" Debug +if exist Debug\nul copy "hlp\CB32.cnt" Debug +if exist Release\nul copy "hlp\CB32.hlp" Release +if exist Release\nul copy "hlp\CB32.cnt" Release +echo. +goto :done + +:Error +echo hlp\CB32.hpj(1) : error: Problem encountered creating help file + +:done +echo. diff --git a/MyHeaderCtrl.cpp b/MyHeaderCtrl.cpp new file mode 100644 index 0000000..c69bb91 --- /dev/null +++ b/MyHeaderCtrl.cpp @@ -0,0 +1,298 @@ +// MyHeaderCtrl.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "MyHeaderCtrl.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMyHeaderCtrl + +CMyHeaderCtrl::CMyHeaderCtrl() + : marker_rect(0,0,0,0), marker_rect2(0,0,0,0) +{ + m_pWidth = NULL; + m_bDragging = FALSE; + m_bCheckForDrag = FALSE; + m_fpDragCol = NULL; + m_pOwnerWnd = NULL; + m_nSortCol = -1; +} + +CMyHeaderCtrl::CMyHeaderCtrl(CWnd *pWnd, void (CWnd::*fpDragCol)(int, int)) + : marker_rect(0,0,0,0), marker_rect2(0,0,0,0) +{ + m_pWidth = NULL; + m_bDragging = FALSE; + m_bCheckForDrag = FALSE; + m_fpDragCol = fpDragCol; + m_pOwnerWnd = pWnd; + m_nSortCol = -1; +} + +CMyHeaderCtrl::~CMyHeaderCtrl() +{ +} + + +BEGIN_MESSAGE_MAP(CMyHeaderCtrl, CHeaderCtrl) + //{{AFX_MSG_MAP(CMyHeaderCtrl) + ON_WM_MOUSEMOVE() + ON_WM_LBUTTONUP() + ON_WM_LBUTTONDOWN() + ON_WM_DRAWITEM_REFLECT() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMyHeaderCtrl message handlers + +void CMyHeaderCtrl::OnMouseMove(UINT nFlags, CPoint point) +{ + if( (MK_LBUTTON & nFlags) == 0) + { + // The left mouse button is not pressed - so reset flags + m_bCheckForDrag = FALSE; + m_bDragging = FALSE; + } + else if( m_bDragging ) + { + // Get column number that falls under the mouse + int i=0, cx = 0; + if( point.x > 0 ) + for( i = 0; i < GetItemCount(); i++ ) + { + if( point.x > cx && point.x < cx + m_pWidth[i] ) + break; + cx += m_pWidth[i]; + } + + if( i != m_nDropPos ) + { + m_nDropPos = i; + + CRect rect; + GetWindowRect( &rect ); + + // Invalidate area occupied by previous marker + InvalidateRect( &marker_rect ); + InvalidateRect( &marker_rect2 ); + + // Draw a new marker + CClientDC dc(this); + POINT pts[3]; + POINT pts2[3]; + + pts[0].x = cx -3; + pts[0].y = rect.Height()/2; + pts[1].x = cx -8; + pts[1].y = rect.Height()-4; + pts[2].x = cx -8; + pts[2].y = 4; + + pts2[0].x = cx +1; + pts2[0].y = rect.Height()/2; + pts2[1].x = cx +6; + pts2[1].y = rect.Height()-4; + pts2[2].x = cx +6; + pts2[2].y = 4; + +// COLORREF clrBG = GetSysColor(COLOR_ACTIVECAPTION); + COLORREF clrBG = RGB(255,0,0); + CBrush brush(clrBG); + CBrush* pOldBrush = dc.SelectObject(&brush); + dc.Polygon( pts, 3 ); + dc.Polygon( pts2, 3 ); + dc.SelectObject(pOldBrush); + + // save marker information + marker_rect.left = cx - 9; + marker_rect.top = rect.Height() -3; + marker_rect.right = cx + 9; + marker_rect.bottom = 3; + + marker_rect2.left = cx + 7; + marker_rect2.top = rect.Height() -3; + marker_rect2.right = cx - 7; + marker_rect2.bottom = 3; + + } + return; + } + else if( m_bCheckForDrag ) + { + // The mouse button was pressed over a column header + // and now the mouse has moved - so start drag + m_bCheckForDrag = FALSE; + m_bDragging = TRUE; + m_nDropPos = m_nDragCol; + + SetCapture(); + + // Store information for later use + int iCount = GetItemCount(); + HD_ITEM hd_item; + m_pWidth = new int[iCount]; + for( int i = 0; i < iCount; i++ ) + { + hd_item.mask = HDI_WIDTH; + GetItem( i, &hd_item ); + m_pWidth[i] = hd_item.cxy; + } + return; + } + + CHeaderCtrl::OnMouseMove(nFlags, point); +} + +void CMyHeaderCtrl::OnLButtonUp(UINT nFlags, CPoint point) +{ + ASSERT( m_pOwnerWnd != NULL && m_fpDragCol != NULL ); + + if( m_bDragging ) + { + m_bDragging = FALSE; + delete[] m_pWidth; + ReleaseCapture(); + Invalidate(); + + // Call the callback function. + if( m_nDragCol != m_nDropPos && m_nDragCol != m_nDropPos -1 ) + + (m_pOwnerWnd->*m_fpDragCol)( m_nDragCol, m_nDropPos ); + } + CHeaderCtrl::OnLButtonUp(nFlags, point); +} + +void CMyHeaderCtrl::OnLButtonDown(UINT nFlags, CPoint point) +{ + // Determine if mouse was pressed over a column header + HD_HITTESTINFO hd_hittestinfo; + hd_hittestinfo.pt = point; + SendMessage(HDM_HITTEST, 0, (LPARAM)(&hd_hittestinfo)); + if( hd_hittestinfo.flags == HHT_ONHEADER ) + { + m_nDragCol = hd_hittestinfo.iItem; + m_bCheckForDrag = TRUE; + } + + CHeaderCtrl::OnLButtonDown(nFlags, point); +} + +void CMyHeaderCtrl::SetCallback( CWnd* pWnd, void (CWnd::*fpDragCol)(int, int) ) +{ + m_fpDragCol = fpDragCol; + m_pOwnerWnd = pWnd; +} + +int CMyHeaderCtrl::SetSortImage(int nCol, BOOL bAsc) +{ + int nPrevCol = m_nSortCol; + m_nSortCol = nCol; + m_bSortAsc = bAsc; + // Change the item to ownder drawn + HD_ITEM hditem; + hditem.mask = HDI_FORMAT; + GetItem( nCol, &hditem ); + hditem.fmt |= HDF_OWNERDRAW; + SetItem( nCol, &hditem ); + // Invalidate header control so that it gets redrawn + Invalidate(); + return nPrevCol; +} + +void CMyHeaderCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) +{ + CDC dc; + dc.Attach( lpDrawItemStruct->hDC ); + // Get the column rect + CRect rcLabel( lpDrawItemStruct->rcItem ); + // Save DC + int nSavedDC = dc.SaveDC(); + // Set clipping region to limit drawing within column + CRgn rgn; + rgn.CreateRectRgnIndirect( &rcLabel ); + dc.SelectObject( &rgn ); + rgn.DeleteObject(); + // Draw the background + dc.FillRect(rcLabel, &CBrush(::GetSysColor(COLOR_3DFACE))); + + // Labels are offset by a certain amount + // This offset is related to the width of a space character + int offset = dc.GetTextExtent(_T(" "), 1 ).cx*2; + // Get the column text and format + TCHAR buf[256]; + HD_ITEM hditem; + + hditem.mask = HDI_TEXT | HDI_FORMAT; + hditem.pszText = buf; + hditem.cchTextMax = 255; + GetItem( lpDrawItemStruct->itemID, &hditem ); + // Determine format for drawing column label + UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP + | DT_VCENTER | DT_END_ELLIPSIS ; + if( hditem.fmt & HDF_CENTER) + uFormat |= DT_CENTER; + else if( hditem.fmt & HDF_RIGHT) + uFormat |= DT_RIGHT; + else + uFormat |= DT_LEFT; + // Adjust the rect if the mouse button is pressed on it + if( lpDrawItemStruct->itemState == ODS_SELECTED ) + { + rcLabel.left++; + rcLabel.top += 2; + rcLabel.right++; + } + // Adjust the rect further if Sort arrow is to be displayed + if( lpDrawItemStruct->itemID == (UINT)m_nSortCol ) + { + rcLabel.right -= 3 * offset; + } + rcLabel.left += offset; + rcLabel.right -= offset; + // Draw column label + if( rcLabel.left < rcLabel.right ) + dc.DrawText(buf,-1,rcLabel, uFormat); + // Draw the Sort arrow + if( lpDrawItemStruct->itemID == (UINT)m_nSortCol ) + { + CRect rcIcon( lpDrawItemStruct->rcItem ); + // Set up pens to use for drawing the triangle + CPen penLight(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT)); + CPen penShadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW)); + CPen *pOldPen = dc.SelectObject( &penLight ); + if( m_bSortAsc ) + { + // Draw triangle pointing upwards + dc.MoveTo( rcIcon.right - 2*offset, offset-1); + dc.LineTo( rcIcon.right - 3*offset/2, rcIcon.bottom - offset ); + dc.LineTo( rcIcon.right - 5*offset/2-2, rcIcon.bottom - offset ); + dc.MoveTo( rcIcon.right - 5*offset/2-1, rcIcon.bottom - offset-1 ); + dc.SelectObject( &penShadow ); + dc.LineTo( rcIcon.right - 2*offset, offset-2); + } + else + { + // Draw triangle pointing downwords + dc.MoveTo( rcIcon.right - 3*offset/2, offset-1); + dc.LineTo( rcIcon.right - 2*offset-1, rcIcon.bottom - offset + 1 ); + dc.MoveTo( rcIcon.right - 2*offset-1, rcIcon.bottom - offset ); + dc.SelectObject( &penShadow ); + dc.LineTo( rcIcon.right - 5*offset/2-1, offset -1 ); + dc.LineTo( rcIcon.right - 3*offset/2, offset -1); + } + // Restore the pen + dc.SelectObject( pOldPen ); + } + // Restore dc + dc.RestoreDC( nSavedDC ); + // Detach the dc before returning + dc.Detach(); +} diff --git a/MyHeaderCtrl.h b/MyHeaderCtrl.h new file mode 100644 index 0000000..008022e --- /dev/null +++ b/MyHeaderCtrl.h @@ -0,0 +1,67 @@ +#if !defined(AFX_MYHEADERCTRL_H__51B74620_2173_11D1_AF55_000000000000__INCLUDED_) +#define AFX_MYHEADERCTRL_H__51B74620_2173_11D1_AF55_000000000000__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// MyHeaderCtrl.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CMyHeaderCtrl window + +class CMyHeaderCtrl : public CHeaderCtrl +{ +// Construction +public: + CMyHeaderCtrl(); + CMyHeaderCtrl(CWnd* pWnd, void (CWnd::*fpDragCol)(int, int)); + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMyHeaderCtrl) + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CMyHeaderCtrl(); + void SetCallback(CWnd* pWnd, void (CWnd::*fpDragCol)(int, int)); + int SetSortImage(int nCol, BOOL bAsc); + +// Generated message map functions +protected: + BOOL m_bCheckForDrag; + BOOL m_bDragging; + int *m_pWidth; + int m_nDragCol; + int m_nDropPos; + CRect marker_rect; + CRect marker_rect2; + void (CWnd::*m_fpDragCol)(int, int); + CWnd *m_pOwnerWnd; + + int m_nSortCol; + BOOL m_bSortAsc; + + //{{AFX_MSG(CMyHeaderCtrl) + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void DrawItem (LPDRAWITEMSTRUCT); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_MYHEADERCTRL_H__51B74620_2173_11D1_AF55_000000000000__INCLUDED_) diff --git a/OrdPage.cpp b/OrdPage.cpp new file mode 100644 index 0000000..cdbc02e --- /dev/null +++ b/OrdPage.cpp @@ -0,0 +1,174 @@ +// OrdPage.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "ComboBar.h" +#include "MainFrm.h" +#include "CB32Doc.h" +#include "CB32View.h" +#include "OrdPage.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// COrdPage property page + +IMPLEMENT_DYNCREATE(COrdPage, CPropertyPage) + +COrdPage::COrdPage() : CPropertyPage(COrdPage::IDD) +{ + //{{AFX_DATA_INIT(COrdPage) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + +COrdPage::~COrdPage() +{ +} + +void COrdPage::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(COrdPage) + DDX_Control(pDX, IDC_COLUP, m_colup); + DDX_Control(pDX, IDC_COLDOWN, m_coldown); + DDX_Control(pDX, IDC_COLBOX, m_colbox); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(COrdPage, CPropertyPage) + //{{AFX_MSG_MAP(COrdPage) + ON_BN_CLICKED(IDC_COLUP, OnColup) + ON_BN_CLICKED(IDC_COLDOWN, OnColdown) + ON_WM_DESTROY() + ON_BN_CLICKED(IDC_RESETCOL, OnResetcol) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// COrdPage message handlers + +BOOL COrdPage::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + CCB32View* pView = GetApplicationView(); + + int colpos[COLS]; + for (int p=0; parLabel[colpos[y]]); + + m_colbox.SetCurSel(0); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void COrdPage::OnColup() +{ + int iIndex; + CString strItem; + + iIndex = m_colbox.GetCurSel(); + if (iIndex <= 0 || iIndex == LB_ERR) + return; + + m_colbox.GetText(iIndex, strItem); + m_colbox.DeleteString(iIndex); + m_colbox.InsertString(iIndex-1, strItem); + m_colbox.SetCurSel(iIndex-1); + + return; +} + +void COrdPage::OnColdown() +{ + int iIndex; + CString strItem; + + iIndex = m_colbox.GetCurSel(); + if ((iIndex >= m_colbox.GetCount()-1) || iIndex == LB_ERR) + return; + + m_colbox.GetText(iIndex, strItem); + m_colbox.DeleteString(iIndex); + m_colbox.InsertString(iIndex+1, strItem); + m_colbox.SetCurSel(iIndex+1); + + return; +} + +void COrdPage::OnDestroy() +{ + if (theApp.GetProfileInt(_T("Preferences"),_T("RememberPos"),1)) + { + CCB32View* pView = GetApplicationView(); + + int colpos[COLS]; + for (int p = 0; parLabel[y]); + if (item != LB_ERR) + colpos[item] = y; + } + + CString strBuffer; + strBuffer.Format("%d",colpos[0]); + for (int z=1; zarLabel[y]); + m_colbox.SetCurSel(0); +} diff --git a/OrdPage.h b/OrdPage.h new file mode 100644 index 0000000..4e3aca0 --- /dev/null +++ b/OrdPage.h @@ -0,0 +1,55 @@ +#if !defined(AFX_ORDPAGE_H__EC09DB72_6EAA_11D1_AFAE_000000000000__INCLUDED_) +#define AFX_ORDPAGE_H__EC09DB72_6EAA_11D1_AFAE_000000000000__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// OrdPage.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// COrdPage dialog + +class COrdPage : public CPropertyPage +{ + DECLARE_DYNCREATE(COrdPage) + +// Construction +public: + COrdPage(); + ~COrdPage(); + +// Dialog Data + //{{AFX_DATA(COrdPage) + enum { IDD = IDD_ORDPAGE }; + CButton m_colup; + CButton m_coldown; + CListBox m_colbox; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(COrdPage) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(COrdPage) + virtual BOOL OnInitDialog(); + afx_msg void OnColup(); + afx_msg void OnColdown(); + afx_msg void OnDestroy(); + afx_msg void OnResetcol(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_ORDPAGE_H__EC09DB72_6EAA_11D1_AFAE_000000000000__INCLUDED_) diff --git a/Parser.cpp b/Parser.cpp new file mode 100644 index 0000000..cd5f0af --- /dev/null +++ b/Parser.cpp @@ -0,0 +1,445 @@ +#ifdef IGNORE_THIS + +/* + PARSER.C Lloyd Zusman, Master Byte Software, Trump User Group + (408) 395-5693 (voice only) + + This program is a generalized, finite state token parser. It's + it is the most powerful parser I've seen on any BBS (if I do say + so myself). It allows you extract tokens one at a time from a + string of characters. The characters used for white space, for + break characters, and for quotes can be specified. Also, + characters in the string can be preceded by a specifiable escape + character which removes any special meaning the character may have. + + There are a lot of formal parameters in this subroutine call, but + once you get familiar with them, this routine is fairly easy to use. + "#define" macros can be used to generate simpler looking calls for + commonly used applications of this routine. + + First, some terminology: + + token used here, a single unit of information in + the form of a group of characters. + + white space space that gets ignored (except within quotes + or when escaped), like blanks and tabs. in + addition, white space terminates a non-quoted + token. + + break character a character that separates non-quoted tokens. + commas are a common break character. the + usage of break characters to signal the end + of a token is the same as that of white space, + except multiple break characters with nothing + or only white space between generate a null + token for each two break characters together. + + for example, if blank is set to be the white + space and comma is set to be the break + character, the line ... + + A, B, C , , DEF + + ... consists of 5 tokens: + + 1) "A" + 2) "B" + 3) "C" + 4) "" (the null string) + 5) "DEF" + + quote character a character that, when surrounding a group + of other characters, causes the group of + characters to be treated as a single token, + no matter how many white spaces or break + characters exist in the group. also, a + token always terminates after the closing + quote. for example, if ' is the quote + character, blank is white space, and comma + is the break character, the following + string ... + + A, ' B, CD'EF GHI + + ... consists of 4 tokens: + + 1) "A" + 2) " B, CD" (note the blanks & comma) + 3) "EF" + 4) "GHI" + + the quote characters themselves do + not appear in the resultant tokens. the + double quotes are delimiters i use here for + documentation purposes only. + + escape character a character which itself is ignored but + which causes the next character to be + used as is. ^ and \ are often used as + escape characters. an escape in the last + position of the string gets treated as a + "normal" (i.e., non-quote, non-white, + non-break, and non-escape) character. + for example, assume white space, break + character, and quote are the same as in the + above examples, and further, assume that + ^ is the escape character. then, in the + string ... + + ABC, ' DEF ^' GH' I ^ J K^ L ^ + + ... there are 7 tokens: + + 1) "ABC" + 2) " DEF ' GH" + 3) "I" + 4) " " (a lone blank) + 5) "J" + 6) "K L" + 7) "^" (passed as is at end of line) + + + OK, now that you have this background, here's how to call "parser": + + result=parser(flag,token,maxtok,string,white,break,quote,escape, + brkused,next,quoted) + + result: 0 if we haven't reached EOS (end of string), and + 1 if we have (this is an "int"). + + flag: right now, only the low order 3 bits are used. + 1 => convert non-quoted tokens to upper case + 2 => convert non-quoted tokens to lower case + 0 => do not convert non-quoted tokens + (this is a "char"). + + token: a character string containing the returned next token + (this is a "char[]"). + + maxtok: the maximum size of "token". characters beyond + "maxtok" are truncated (this is an "int"). + + string: the string to be parsed (this is a "char[]"). + + white: a string of the valid white spaces. example: + + char whitesp[]={" \t"}; + + blank and tab will be valid white space (this is + a "char[]"). + + break: a string of the valid break characters. example: + + char breakch[]={";,"}; + + semicolon and comma will be valid break characters + (this is a "char[]"). + + IMPORTANT: do not use the name "break" as a C + variable, as this is a reserved word in C. + + quote: a string of the valid quote characters. an example + would be + + char whitesp[]={"'\""); + + (this causes single and double quotes to be valid) + note that a token starting with one of these characters + needs the same quote character to terminate it. + + for example, + + "ABC ' + + is unterminated, but + + "DEF" and 'GHI' + + are properly terminated. note that different quote + characters can appear on the same line; only for + a given token do the quote characters have to be + the same (this is a "char[]"). + + escape: the escape character (NOT a string ... only one + allowed). use zero if none is desired (this is + a "char"). + + brkused: the break character used to terminate the current + token. if the token was quoted, this will be the + quote used. if the token is the last one on the + line, this will be zero (this is a pointer to a + "char"). + + next: this variable points to the first character of the + next token. it gets reset by "parser" as it steps + through the string. set it to 0 upon initialization, + and leave it alone after that. you can change it + if you want to jump around in the string or re-parse + from the beginning, but be careful (this is a + pointer to an "int"). + + quoted: set to 1 (true) if the token was quoted and 0 (false) + if not. you may need this information (for example: + in C, a string with quotes around it is a character + string, while one without is an identifier). + + (this is a pointer to a "char"). + + Example 1: + + char *whitesp[]={" \t"); // blank and tab + char *breakch[]={",\r"); // comma and carriage return + char *quotech[]={"'\""}; // single and double quote + char escape='^'; // "uparrow" is escape + + main() + { + char *fgets(),line[81],brkused,quoted,token[81]; + int i,next; + + while(fgets(line,80,stdin)!=NULL) // get line + { + + printf("Line: %s",line); // already has + i=0; + + next=0; // make sure you do this + + while(parser(2,token,80,line,whitesp,breakch,quotech,escape, + &brkused,&next,"ed)==0) + { + printf(" Token %d = (%s)\n",++i,token); + + if(brkchar=='\r') // is a break so it won't be included + break; // in the token. treat as end-of-line here + } + } + } + + + + In the above example, lines are read from stdin and broken up into + tokens. All non-quoted tokens are converted to lower case. Since + fgets() returns the final carriage return, we treat it as a break + character to keep it out of the returned token. Also, since the only + way "parser" will return a non-zero error code is at end of line, + we test "brkchar" to see if we've gotten to the final carriage + return, and we explicitly break out of the inner loop if we've + hit it. Note that since fgets() puts the final right before + the end-of-string, if we left out the "if(brkchar='\r')" test, + we'd get one extra null token (just as if the line ended with a + single comma). Run this example to see how it all works. + + Example 2: + + . + . + . + + next=0; + result=parser(1, newstr, 80, str, "", "", "", 0, &brkused, &next, + "ed); + . + . + . + + this call takes whatever is in "str" and converts it to upper case, + putting the result in "newstr". + + *** end of examples *** + + in case you're interested, "parser.c" was inspired by a system + subroutine that comes as part of the PRIMOS operating system for + the Prime Computer: "gt$par.plp". i loosely patterned this routine + after the Prime routine. + + Revisions: + + 09/30/84 Lloyd Zusman Initial coding + +*/ + +#endif + +#include "stdafx.h" +#include +#include "parser.h" + + +//////////////////////////////////////////////////////////////// +// routine to find character in string +int sindex(char ch,char *string) +{ + char *cp; + for(cp=string;*cp;++cp) + if(ch==*cp) + return (int)(cp-string); // return postion of character + return -1; // eol ... no match found +} + +/////////////////////////////////////////////////////////////// +// routine to store a character in a string +void chstore(char *string,int max,char ch, int *pos, int state, + int flag) +{ + char c; + if(*pos >= 0 && *pos < max-1) + { + if(state==IN_QUOTE) + c=ch; + else + switch(flag) + { + case 1: /* convert to upper */ + c=toupper(ch); + break; + + case 2: /* convert to lower */ + c=tolower(ch); + break; + + default: /* use as is */ + c=ch; + break; + } + string[(*pos)++]=c; + } + return; +} + +////////////////////////////////////////////////////////////////// +// parse a given string for a token +int parser(int inflag,char *token,int tokmax,char *line,char *white, + char *brkchar,char *quote,char eschar,char *brkused,int *next, + char *quoted) +{ + int _p_tokpos; // current token pos + int _p_state; // current state + int _p_flag; // option flag + char _p_curquote; // current quote char + int qp; + char c,nc; + + *brkused=0; /* initialize to null */ + *quoted=0; /* assume not quoted */ + + if(!line[*next]) /* if we're at end of line, indicate such */ + return 1; + + _p_state=IN_WHITE; /* initialize state */ + _p_curquote=0; /* initialize previous quote char */ + _p_flag=inflag; /* set option flag */ + + for(_p_tokpos=0;c=line[*next];++(*next)) /* main loop */ + { + if((qp=sindex(c,brkchar))>=0) /* break */ + { + switch(_p_state) + { + case IN_WHITE: /* these are the same here ... */ + case IN_TOKEN: /* ... just get out */ + case IN_OZONE: /* ditto */ + ++(*next); + *brkused=brkchar[qp]; + goto byebye; + + case IN_QUOTE: /* just keep going */ + chstore(token,tokmax,c,&_p_tokpos,_p_state,_p_flag); + break; + } + } + else if((qp=sindex(c,quote))>=0) /* quote */ + { + switch(_p_state) + { + case IN_WHITE: /* these are identical, */ + _p_state=IN_QUOTE; /* change states */ + _p_curquote=quote[qp]; /* save quote char */ + *quoted=1; /* set to true as long as something is in quotes */ + break; + + case IN_QUOTE: + if(quote[qp]==_p_curquote) /* same as the beginning quote? */ + { + _p_state=IN_OZONE; + _p_curquote=0; + } + else + chstore(token,tokmax,c,&_p_tokpos,_p_state,_p_flag); /* treat as regular char */ + break; + + case IN_TOKEN: + case IN_OZONE: + *brkused=c; /* uses quote as break char */ + goto byebye; + } + } + else if((qp=sindex(c,white))>=0) /* white */ + { + switch(_p_state) + { + case IN_WHITE: + case IN_OZONE: + break; /* keep going */ + + case IN_TOKEN: + _p_state=IN_OZONE; + break; + + case IN_QUOTE: + chstore(token,tokmax,c,&_p_tokpos,_p_state,_p_flag); /* it's valid here */ + break; + } + } + else if(c==eschar) /* escape */ + { + nc=line[(*next)+1]; + if(nc==0) /* end of line */ + { + *brkused=0; + chstore(token,tokmax,c,&_p_tokpos,_p_state,_p_flag); + ++(*next); + goto byebye; + } + switch(_p_state) + { + case IN_WHITE: + --(*next); + _p_state=IN_TOKEN; + break; + + case IN_TOKEN: + case IN_QUOTE: + ++(*next); + chstore(token,tokmax,nc,&_p_tokpos,_p_state,_p_flag); + break; + + case IN_OZONE: + goto byebye; + } + } + else /* anything else is just a real character */ + { + switch(_p_state) + { + case IN_WHITE: + _p_state=IN_TOKEN; /* switch states */ + + case IN_TOKEN: /* these 2 are */ + case IN_QUOTE: /* identical here */ + chstore(token,tokmax,c,&_p_tokpos,_p_state,_p_flag); + break; + + case IN_OZONE: + goto byebye; + } + } +} /* end of main loop */ + +byebye: + token[_p_tokpos]=0; /* make sure token ends with EOS */ + + return 0; + +} diff --git a/Parser.h b/Parser.h new file mode 100644 index 0000000..4c9bc8f --- /dev/null +++ b/Parser.h @@ -0,0 +1,10 @@ +// parser.h - Parser implementation file + +// states +#define IN_WHITE 0 +#define IN_TOKEN 1 +#define IN_QUOTE 2 +#define IN_OZONE 3 + +int parser(int,char*,int,char*,char*, + char*,char*,char,char*,int*,char*); diff --git a/PrefPage.cpp b/PrefPage.cpp new file mode 100644 index 0000000..d58644a --- /dev/null +++ b/PrefPage.cpp @@ -0,0 +1,52 @@ +// PrefPage.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "PrefPage.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPrefPage + +IMPLEMENT_DYNAMIC(CPrefPage, CPropertySheet) + +CPrefPage::CPrefPage(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) + :CPropertySheet(nIDCaption, pParentWnd, iSelectPage) +{ +} + +CPrefPage::CPrefPage(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage) + :CPropertySheet(pszCaption, pParentWnd, iSelectPage) +{ +} + +CPrefPage::~CPrefPage() +{ +} + + +BEGIN_MESSAGE_MAP(CPrefPage, CPropertySheet) + //{{AFX_MSG_MAP(CPrefPage) + // NOTE - the ClassWizard will add and remove mapping macros here. + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPrefPage message handlers + +void CPrefPage::AddCtrlPages() +{ + m_hIcn = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + m_psh.dwFlags |= PSP_USEHICON; + m_psh.hIcon = m_hIcn; + + AddPage(&m_prefset); + AddPage(&m_prefcol); + AddPage(&m_preford); +} diff --git a/PrefPage.h b/PrefPage.h new file mode 100644 index 0000000..1e6133e --- /dev/null +++ b/PrefPage.h @@ -0,0 +1,47 @@ +// PrefPage.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPrefPage +#include "SetPage.h" +#include "ColPage.h" +#include "OrdPage.h" + +class CPrefPage : public CPropertySheet +{ + DECLARE_DYNAMIC(CPrefPage) + +// Construction +public: + CPrefPage(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); + CPrefPage(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); + +// Attributes +public: + CSetPage m_prefset; + CColPage m_prefcol; + COrdPage m_preford; + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPrefPage) + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CPrefPage(); + void AddCtrlPages(void); + + // Generated message map functions +protected: + HICON m_hIcn; + //{{AFX_MSG(CPrefPage) + // NOTE - the ClassWizard will add and remove member functions here. + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// diff --git a/PropAdd.cpp b/PropAdd.cpp new file mode 100644 index 0000000..a60c94b --- /dev/null +++ b/PropAdd.cpp @@ -0,0 +1,64 @@ +// PropAdd.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "PropAdd.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropAdd property page + +IMPLEMENT_DYNCREATE(CPropAdd, CPropertyPage) + +CPropAdd::CPropAdd() : CPropertyPage(CPropAdd::IDD) +{ + //{{AFX_DATA_INIT(CPropAdd) + m_fname = _T(""); + m_lname = _T(""); + m_mi = _T(""); + m_title = _T(""); + m_add1 = _T(""); + m_add2 = _T(""); + m_city = _T(""); + m_country = _T(""); + m_state = _T(""); + m_zipcode = _T(""); + //}}AFX_DATA_INIT +} + +CPropAdd::~CPropAdd() +{ +} + +void CPropAdd::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropAdd) + DDX_Text(pDX, IDC_ADD1, m_add1); + DDX_Text(pDX, IDC_ADD2, m_add2); + DDX_Text(pDX, IDC_CITY, m_city); + DDX_Text(pDX, IDC_COUNTRY, m_country); + DDX_Text(pDX, IDC_FNAME, m_fname); + DDX_Text(pDX, IDC_LNAME, m_lname); + DDX_Text(pDX, IDC_MI, m_mi); + DDX_Text(pDX, IDC_STATE, m_state); + DDX_Text(pDX, IDC_TITLE, m_title); + DDX_Text(pDX, IDC_ZIPCODE, m_zipcode); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropAdd, CPropertyPage) + //{{AFX_MSG_MAP(CPropAdd) + // NOTE: the ClassWizard will add message map macros here + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropAdd message handlers diff --git a/PropAdd.h b/PropAdd.h new file mode 100644 index 0000000..99e3d36 --- /dev/null +++ b/PropAdd.h @@ -0,0 +1,47 @@ +// PropAdd.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropAdd dialog + +class CPropAdd : public CPropertyPage +{ + DECLARE_DYNCREATE(CPropAdd) + +// Construction +public: + CPropAdd(); + ~CPropAdd(); + +// Dialog Data + //{{AFX_DATA(CPropAdd) + enum { IDD = IDD_APAGE }; + CString m_add1; + CString m_add2; + CString m_city; + CString m_country; + CString m_fname; + CString m_lname; + CString m_mi; + CString m_state; + CString m_title; + CString m_zipcode; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(CPropAdd) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CPropAdd) + // NOTE: the ClassWizard will add member functions here + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; diff --git a/PropComp.cpp b/PropComp.cpp new file mode 100644 index 0000000..20ea503 --- /dev/null +++ b/PropComp.cpp @@ -0,0 +1,56 @@ +// PropComp.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "PropComp.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropComp property page + +IMPLEMENT_DYNCREATE(CPropComp, CPropertyPage) + +CPropComp::CPropComp() : CPropertyPage(CPropComp::IDD) +{ + //{{AFX_DATA_INIT(CPropComp) + m_cadd1 = _T(""); + m_cadd2 = _T(""); + m_comp = _T(""); + m_dept = _T(""); + m_mgr = _T(""); + m_posn = _T(""); + //}}AFX_DATA_INIT +} + +CPropComp::~CPropComp() +{ +} + +void CPropComp::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropComp) + DDX_Text(pDX, IDC_CADD1, m_cadd1); + DDX_Text(pDX, IDC_CADD2, m_cadd2); + DDX_Text(pDX, IDC_COMP, m_comp); + DDX_Text(pDX, IDC_DEPT, m_dept); + DDX_Text(pDX, IDC_MGR, m_mgr); + DDX_Text(pDX, IDC_POSN, m_posn); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropComp, CPropertyPage) + //{{AFX_MSG_MAP(CPropComp) + // NOTE: the ClassWizard will add message map macros here + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropComp message handlers diff --git a/PropComp.h b/PropComp.h new file mode 100644 index 0000000..29f55dd --- /dev/null +++ b/PropComp.h @@ -0,0 +1,54 @@ +#if !defined(AFX_PROPCOMP_H__BF3C43C1_CF77_11D0_A30E_444553540000__INCLUDED_) +#define AFX_PROPCOMP_H__BF3C43C1_CF77_11D0_A30E_444553540000__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// PropComp.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropComp dialog + +class CPropComp : public CPropertyPage +{ + DECLARE_DYNCREATE(CPropComp) + +// Construction +public: + CPropComp(); + ~CPropComp(); + +// Dialog Data + //{{AFX_DATA(CPropComp) + enum { IDD = IDD_CPAGE }; + CString m_cadd1; + CString m_cadd2; + CString m_comp; + CString m_dept; + CString m_mgr; + CString m_posn; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(CPropComp) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CPropComp) + // NOTE: the ClassWizard will add member functions here + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_PROPCOMP_H__BF3C43C1_CF77_11D0_A30E_444553540000__INCLUDED_) diff --git a/PropInfo.cpp b/PropInfo.cpp new file mode 100644 index 0000000..3bf9f73 --- /dev/null +++ b/PropInfo.cpp @@ -0,0 +1,53 @@ +// PropInfo.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "PropInfo.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropInfo + +IMPLEMENT_DYNAMIC(CPropInfo, CPropertySheet) + +CPropInfo::CPropInfo(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) + :CPropertySheet(nIDCaption, pParentWnd, iSelectPage) +{ +} + +CPropInfo::CPropInfo(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage) + :CPropertySheet(pszCaption, pParentWnd, iSelectPage) +{ +} + +CPropInfo::~CPropInfo() +{ +} + +BEGIN_MESSAGE_MAP(CPropInfo, CPropertySheet) + //{{AFX_MSG_MAP(CPropInfo) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropInfo message handlers + +void CPropInfo::AddControlPages() +{ + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + m_psh.dwFlags |= PSP_USEHICON; + m_psh.hIcon = m_hIcon; + + AddPage(&m_propadd); + AddPage(&m_propcomp); + AddPage(&m_propphone); + AddPage(&m_proponline); + AddPage(&m_propnote); +} + diff --git a/PropInfo.h b/PropInfo.h new file mode 100644 index 0000000..eb18bfe --- /dev/null +++ b/PropInfo.h @@ -0,0 +1,53 @@ +// PropInfo.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropInfo +#include "PropAdd.h" +#include "PropComp.h" +#include "PropPhone.h" +#include "PropOnline.h" +#include "PropNote.h" + +class CPropInfo : public CPropertySheet +{ + DECLARE_DYNAMIC(CPropInfo) + +// Construction +public: + CPropInfo(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); + CPropInfo(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); + +protected: + +// Attributes +public: + CPropAdd m_propadd; + CPropComp m_propcomp; + CPropPhone m_propphone; + CPropOnline m_proponline; + CPropNote m_propnote; + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropInfo) + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CPropInfo(); + void AddControlPages(void); + + // Generated message map functions +protected: + HICON m_hIcon; + + //{{AFX_MSG(CPropInfo) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// diff --git a/PropNote.cpp b/PropNote.cpp new file mode 100644 index 0000000..96eb479 --- /dev/null +++ b/PropNote.cpp @@ -0,0 +1,46 @@ +// PropNote.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "PropNote.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropNote property page + +IMPLEMENT_DYNCREATE(CPropNote, CPropertyPage) + +CPropNote::CPropNote() : CPropertyPage(CPropNote::IDD) +{ + //{{AFX_DATA_INIT(CPropNote) + m_notes = _T(""); + //}}AFX_DATA_INIT +} + +CPropNote::~CPropNote() +{ +} + +void CPropNote::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropNote) + DDX_Text(pDX, IDC_NOTES, m_notes); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropNote, CPropertyPage) + //{{AFX_MSG_MAP(CPropNote) + // NOTE: the ClassWizard will add message map macros here + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropNote message handlers diff --git a/PropNote.h b/PropNote.h new file mode 100644 index 0000000..8d77fad --- /dev/null +++ b/PropNote.h @@ -0,0 +1,38 @@ +// PropNote.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropNote dialog + +class CPropNote : public CPropertyPage +{ + DECLARE_DYNCREATE(CPropNote) + +// Construction +public: + CPropNote(); + ~CPropNote(); + +// Dialog Data + //{{AFX_DATA(CPropNote) + enum { IDD = IDD_NPAGE }; + CString m_notes; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(CPropNote) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CPropNote) + // NOTE: the ClassWizard will add member functions here + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; diff --git a/PropOnline.cpp b/PropOnline.cpp new file mode 100644 index 0000000..280b544 --- /dev/null +++ b/PropOnline.cpp @@ -0,0 +1,52 @@ +// PropOnline.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "PropOnline.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropOnline property page + +IMPLEMENT_DYNCREATE(CPropOnline, CPropertyPage) + +CPropOnline::CPropOnline() : CPropertyPage(CPropOnline::IDD) +{ + //{{AFX_DATA_INIT(CPropOnline) + m_email1 = _T(""); + m_email2 = _T(""); + m_web1 = _T(""); + m_web2 = _T(""); + //}}AFX_DATA_INIT +} + +CPropOnline::~CPropOnline() +{ +} + +void CPropOnline::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropOnline) + DDX_Text(pDX, IDC_EMAIL1, m_email1); + DDX_Text(pDX, IDC_EMAIL2, m_email2); + DDX_Text(pDX, IDC_WEB1, m_web1); + DDX_Text(pDX, IDC_WEB2, m_web2); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropOnline, CPropertyPage) + //{{AFX_MSG_MAP(CPropOnline) + // NOTE: the ClassWizard will add message map macros here + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropOnline message handlers diff --git a/PropOnline.h b/PropOnline.h new file mode 100644 index 0000000..799c09d --- /dev/null +++ b/PropOnline.h @@ -0,0 +1,41 @@ +// PropOnline.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropOnline dialog + +class CPropOnline : public CPropertyPage +{ + DECLARE_DYNCREATE(CPropOnline) + +// Construction +public: + CPropOnline(); + ~CPropOnline(); + +// Dialog Data + //{{AFX_DATA(CPropOnline) + enum { IDD = IDD_OPAGE }; + CString m_email1; + CString m_email2; + CString m_web1; + CString m_web2; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(CPropOnline) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CPropOnline) + // NOTE: the ClassWizard will add member functions here + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; diff --git a/PropPhone.cpp b/PropPhone.cpp new file mode 100644 index 0000000..f1b4def --- /dev/null +++ b/PropPhone.cpp @@ -0,0 +1,66 @@ +// PropPhone.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "PropPhone.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CPropPhone property page + +IMPLEMENT_DYNCREATE(CPropPhone, CPropertyPage) + +CPropPhone::CPropPhone() : CPropertyPage(CPropPhone::IDD) +{ + //{{AFX_DATA_INIT(CPropPhone) + m_hphone = _T(""); + m_hphonex = _T(""); + m_wphone = _T(""); + m_wphonex = _T(""); + m_cellular = _T(""); + m_cellularx = _T(""); + m_pager = _T(""); + m_pagerc = _T(""); + m_pagerx = _T(""); + m_fax = _T(""); + m_faxx = _T(""); + //}}AFX_DATA_INIT +} + +CPropPhone::~CPropPhone() +{ +} + +void CPropPhone::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPropPhone) + DDX_Text(pDX, IDC_CELLULAR, m_cellular); + DDX_Text(pDX, IDC_CELLULARX, m_cellularx); + DDX_Text(pDX, IDC_FAX, m_fax); + DDX_Text(pDX, IDC_FAXX, m_faxx); + DDX_Text(pDX, IDC_HPHONE, m_hphone); + DDX_Text(pDX, IDC_HPHONEX, m_hphonex); + DDX_Text(pDX, IDC_PAGER, m_pager); + DDX_Text(pDX, IDC_PAGERC, m_pagerc); + DDX_Text(pDX, IDC_PAGERX, m_pagerx); + DDX_Text(pDX, IDC_WPHONE, m_wphone); + DDX_Text(pDX, IDC_WPHONEX, m_wphonex); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CPropPhone, CPropertyPage) + //{{AFX_MSG_MAP(CPropPhone) + // NOTE: the ClassWizard will add message map macros here + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropPhone message handlers diff --git a/PropPhone.h b/PropPhone.h new file mode 100644 index 0000000..321d6be --- /dev/null +++ b/PropPhone.h @@ -0,0 +1,48 @@ +// PropPhone.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CPropPhone dialog + +class CPropPhone : public CPropertyPage +{ + DECLARE_DYNCREATE(CPropPhone) + +// Construction +public: + CPropPhone(); + ~CPropPhone(); + +// Dialog Data + //{{AFX_DATA(CPropPhone) + enum { IDD = IDD_PPAGE }; + CString m_cellular; + CString m_cellularx; + CString m_fax; + CString m_faxx; + CString m_hphone; + CString m_hphonex; + CString m_pager; + CString m_pagerc; + CString m_pagerx; + CString m_wphone; + CString m_wphonex; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(CPropPhone) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CPropPhone) + // NOTE: the ClassWizard will add member functions here + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..202952a --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,122 @@ +======================================================================== + MICROSOFT FOUNDATION CLASS LIBRARY : CB32 +======================================================================== + + +AppWizard has created this CB32 application for you. This application +not only demonstrates the basics of using the Microsoft Foundation classes +but is also a starting point for writing your application. + +This file contains a summary of what you will find in each of the files that +make up your CB32 application. + +CB32.h + This is the main header file for the application. It includes other + project specific headers (including Resource.h) and declares the + CCB32App application class. + +CB32.cpp + This is the main application source file that contains the application + class CCB32App. + +CB32.rc + This is a listing of all of the Microsoft Windows resources that the + program uses. It includes the icons, bitmaps, and cursors that are stored + in the RES subdirectory. This file can be directly edited in Microsoft + Developer Studio. + +res\CB32.ico + This is an icon file, which is used as the application's icon. This + icon is included by the main resource file CB32.rc. + +res\CB32.rc2 + This file contains resources that are not edited by Microsoft + Developer Studio. You should place all resources not + editable by the resource editor in this file. + +CB32.reg + This is an example .REG file that shows you the kind of registration + settings the framework will set for you. You can use this as a .REG + file to go along with your application or just delete it and rely + on the default RegisterShellFileTypes registration. + +CB32.clw + This file contains information used by ClassWizard to edit existing + classes or add new classes. ClassWizard also uses this file to store + information needed to create and edit message maps and dialog data + maps and to create prototype member functions. + +///////////////////////////////////////////////////////////////////////////// + +For the main frame window: + +MainFrm.h, MainFrm.cpp + These files contain the frame class CMainFrame, which is derived from + CFrameWnd and controls all SDI frame features. + +res\Toolbar.bmp + This bitmap file is used to create tiled images for the toolbar. + The initial toolbar and status bar are constructed in the + CMainFrame class. Edit this toolbar bitmap along with the + array in MainFrm.cpp to add more toolbar buttons. + +///////////////////////////////////////////////////////////////////////////// + +AppWizard creates one document type and one view: + +CB32Doc.h, CB32Doc.cpp - the document + These files contain your CCB32Doc class. Edit these files to + add your special document data and to implement file saving and loading + (via CCB32Doc::Serialize). + +CB32View.h, CB32View.cpp - the view of the document + These files contain your CCB32View class. + CCB32View objects are used to view CCB32Doc objects. + + +///////////////////////////////////////////////////////////////////////////// + +Help Support: + +MakeHelp.bat + Use this batch file to create your application's Help file, hlp\CB32.hLP. + +hlp\CB32.hpj + This file is the Help Project file used by the Help compiler to create + your application's Help file. + +hlp\*.bmp + These are bitmap files required by the standard Help file topics for + Microsoft Foundation Class Library standard commands. + +hlp\*.rtf + This file contains the standard help topics for standard MFC + commands and screen objects. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named CB32.pch and a precompiled types file named StdAfx.obj. + +Resource.h + This is the standard header file, which defines new resource IDs. + Microsoft Developer Studio reads and updates this file. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" to indicate parts of the source code you +should add to or customize. + +If your application uses MFC in a shared DLL, and your application is +in a language other than the operating system's current language, you +will need to copy the corresponding localized resources MFC40XXX.DLL +from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, +and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation. +For example, MFC40DEU.DLL contains resources translated to German.) If you +don't do this, some of the UI elements of your application will remain in the +language of the operating system. + +///////////////////////////////////////////////////////////////////////////// diff --git a/Release/empty.dir b/Release/empty.dir new file mode 100644 index 0000000..e69de29 diff --git a/Resource.h b/Resource.h new file mode 100644 index 0000000..7fea75a --- /dev/null +++ b/Resource.h @@ -0,0 +1,315 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by CB32.rc +// +#define IDD_ABOUTBOX 100 +#define IDR_MAINFRAME 128 +#define IDR_CB32TYPE 129 +#define IDW_COMBO 129 +#define IDS_LNAME 130 +#define IDC_HAND1 130 +#define IDD_APAGE 131 +#define IDS_FNAME 131 +#define IDD_PPAGE 132 +#define IDS_MI 132 +#define IDD_OPAGE 133 +#define IDS_TITLE 133 +#define IDD_NPAGE 134 +#define IDS_ADD1 134 +#define IDD_CONVERT 135 +#define IDS_ADD2 135 +#define IDS_CITY 136 +#define IDD_ORDPAGE 136 +#define IDD_FIND 137 +#define IDS_COUNTRY 137 +#define IDS_STATE 138 +#define IDD_COLPAGE 139 +#define IDS_ZIPCODE 139 +#define IDS_COMP 140 +#define IDD_SETPAGE 141 +#define IDS_DEPT 141 +#define IDS_POSN 142 +#define IDS_MGR 143 +#define IDR_TRAYMENU 144 +#define IDS_CADD1 144 +#define IDR_CONTEXTMENU 145 +#define IDS_CADD2 145 +#define IDD_GETNEW 146 +#define IDS_HPHONE 146 +#define IDD_CPAGE 147 +#define IDS_HPHONEX 147 +#define IDS_WPHONE 148 +#define IDS_WPHONEX 149 +#define IDS_CELLULAR 150 +#define IDS_CELLULARX 151 +#define IDS_PAGER 152 +#define IDS_PAGERC 153 +#define IDS_PAGERX 154 +#define IDS_FAX 155 +#define IDS_FAXX 156 +#define IDS_EMAIL1 157 +#define IDS_EMAIL2 158 +#define IDS_WEB1 159 +#define IDS_WEB2 160 +#define IDS_NOTES 161 +#define IDS_COPY 162 +#define IDS_CONFIRM 163 +#define IDS_PRINT_PAGE_TITLE 164 +#define IDS_LOADING 165 +#define IDS_SAVING 166 +#define IDS_IMPORTING 167 +#define IDS_IMPCOUNT 168 +#define IDS_NOIMPORT 169 +#define IDS_NOREAD 170 +#define IDS_EXPORTING 171 +#define IDS_EXPCOUNT 172 +#define IDS_WINDSAVE 173 +#define IDS_ENTRYADD 174 +#define IDS_ENTRYEDIT 175 +#define IDS_ENTRYCOPY 176 +#define IDS_NOTEXT 177 +#define IDS_COLSAVE 178 +#define IDS_POSSAVE 179 +#define IDS_PREFS 180 +#define IDC_FNAME 1000 +#define IDC_SETPOS 1000 +#define IDC_STATIC1 1001 +#define IDC_XCOUNTRY 1001 +#define ID_EDIT_FIND_NEXT 1001 +#define IDC_SETSTART 1001 +#define IDC_LNAME 1002 +#define IDC_COMBO1 1002 +#define IDC_ADD1 1003 +#define IDC_RADIO1 1003 +#define IDC_MYEMAIL 1003 +#define IDC_ADD2 1004 +#define IDC_RADIO2 1004 +#define IDC_CITY 1005 +#define IDC_CHECK1 1005 +#define IDC_STATE 1006 +#define IDC_XHOMEP 1006 +#define IDC_SETDELETE 1006 +#define IDC_COUNTRY 1007 +#define IDC_XHOMEPX 1007 +#define IDC_COLBOX 1007 +#define IDC_XWORKP 1008 +#define IDC_HPHONE 1008 +#define IDC_COLUP 1008 +#define IDC_ZIPCODE 1009 +#define IDC_XWORKPX 1009 +#define IDC_COLDOWN 1009 +#define IDC_XPAGER 1010 +#define IDC_WPHONE 1010 +#define IDC_RESETCOL 1010 +#define IDC_XPAGERC 1011 +#define IDC_EMAIL1 1011 +#define IDC_RESETSIZE 1011 +#define IDC_XPAGERX 1012 +#define IDC_PAGER 1012 +#define IDC_MYWEB 1012 +#define IDC_XFAX 1013 +#define IDC_EMAIL2 1013 +#define IDC_XEMAIL2 1014 +#define IDC_PAGERC 1014 +#define IDC_XWEB1 1015 +#define IDC_WEB1 1015 +#define IDC_XWEB2 1016 +#define IDC_FAX 1016 +#define IDC_MI 1017 +#define IDC_XPOSN 1017 +#define IDC_XSTATE 1018 +#define IDC_WEB2 1018 +#define IDC_XCELL 1019 +#define IDC_CELLULAR 1019 +#define IDC_TITLE 1020 +#define IDC_XCOMP 1020 +#define IDC_XZIP 1021 +#define IDC_HPHONEX 1021 +#define IDC_XCELLX 1022 +#define IDC_NOTES 1022 +#define IDC_XFAXX 1023 +#define IDC_WPHONEX 1023 +#define IDC_XEMAIL1 1024 +#define IDC_PAGERX 1024 +#define IDC_XNOTES 1025 +#define IDC_FAXX 1025 +#define IDC_XDEPT 1026 +#define IDC_CELLULARX 1026 +#define IDC_XMGR 1027 +#define IDC_XCADD1 1028 +#define IDC_XCADD2 1029 +#define IDC_SPINXLNAME 1030 +#define IDC_SPINXFNAME 1031 +#define IDC_SPINXMI 1032 +#define IDC_SPINXTITLE 1033 +#define IDC_SPINXADD1 1034 +#define IDC_SPINXADD2 1035 +#define IDC_SPINXCITY 1036 +#define IDC_SPINXCOUNTRY 1037 +#define IDC_SPINXSTATE 1038 +#define IDC_SPINXZIP 1039 +#define IDC_SPINXHOMEP 1040 +#define IDC_SPINXHOMEPX 1041 +#define IDC_SPINXWORKP 1042 +#define IDC_SPINXWORKPX 1043 +#define IDC_SPINXCELL 1044 +#define IDC_SPINXCELLX 1045 +#define IDC_SPINXPAGER 1046 +#define IDC_SPINXPAGERC 1047 +#define IDC_SPINXPAGERX 1048 +#define IDC_SPINXFAX 1049 +#define IDC_SPINXFAXX 1050 +#define IDC_SPINXEMAIL1 1051 +#define IDC_SPINXEMAIL2 1052 +#define IDC_SPINXWEB1 1053 +#define IDC_SPINXWEB2 1054 +#define IDC_SPINXNOTES 1055 +#define IDC_XLNAME 1056 +#define IDC_XFNAME 1057 +#define IDC_XMI 1058 +#define IDC_XTITLE 1059 +#define IDC_XADD1 1060 +#define IDC_XADD2 1061 +#define IDC_XCITY 1062 +#define IDC_SPINXCOMP 1063 +#define IDC_XLINE1 1064 +#define IDC_SPINXDEPT 1065 +#define IDC_SPINXPOSN 1066 +#define IDC_SPINXMGR 1067 +#define IDC_SPINXCADD1 1068 +#define IDC_SPINXCADD2 1069 +#define IDC_CHECK2 1085 +#define IDC_CLNAME 1086 +#define IDC_SPINCLNAME 1087 +#define IDC_CFNAME 1088 +#define IDC_SPINCFNAME 1089 +#define IDC_CMI 1090 +#define IDC_SPINCMI 1091 +#define IDC_CTITLE 1092 +#define IDC_SPINCTITLE 1093 +#define IDC_SPINCADD1 1094 +#define IDC_CADD2 1095 +#define IDC_SPINCADD2 1096 +#define IDC_CCITY 1097 +#define IDC_SPINCCITY 1098 +#define IDC_CCOUNTRY 1099 +#define IDC_SPINCCOUNTRY 1100 +#define IDC_CSTATE 1101 +#define IDC_SPINCSTATE 1102 +#define IDC_CZIP 1103 +#define IDC_SPINCZIP 1104 +#define IDC_CHOMEP 1105 +#define IDC_SPINCHOMEP 1106 +#define IDC_CHOMEPX 1107 +#define IDC_SPINCHOMEPX 1108 +#define IDC_CWORKP 1109 +#define IDC_SPINCWORKP 1110 +#define IDC_CWORKPX 1111 +#define IDC_SPINCWORKPX 1112 +#define IDC_CCELL 1113 +#define IDC_SPINCCELL 1114 +#define IDC_CCELLX 1115 +#define IDC_SPINCCELLX 1116 +#define IDC_CPAGER 1117 +#define IDC_SPINCPAGER 1118 +#define IDC_CPAGERC 1119 +#define IDC_SPINCPAGERC 1120 +#define IDC_CPAGERX 1121 +#define IDC_SPINCPAGERX 1122 +#define IDC_CFAX 1123 +#define IDC_SPINCFAX 1124 +#define IDC_CFAXX 1125 +#define IDC_SPINCFAXX 1126 +#define IDC_CEMAIL1 1127 +#define IDC_SPINCEMAIL1 1128 +#define IDC_CEMAIL2 1129 +#define IDC_SPINCEMAIL2 1130 +#define IDC_CWEB1 1131 +#define IDC_SPINCWEB1 1132 +#define IDC_CWEB2 1133 +#define IDC_SPINCWEB2 1134 +#define IDC_CCOMP 1135 +#define IDC_SPINCCOMP 1136 +#define IDC_CDEPT 1137 +#define IDC_SPINCDEPT 1138 +#define IDC_CPOSN 1139 +#define IDC_SPINCPOSN 1140 +#define IDC_CMGR 1141 +#define IDC_SPINCMGR 1142 +#define IDC_SETLASTFILE 1142 +#define IDC_CCADD1 1143 +#define IDC_SETSORT 1143 +#define IDC_CADD1 1144 +#define IDC_SPINCCADD1 1145 +#define IDC_SETCOL 1145 +#define IDC_CCADD2 1146 +#define IDC_SETEXP 1146 +#define IDC_SPINCCADD2 1147 +#define IDC_SETIMP 1147 +#define IDC_SETWIN 1148 +#define IDC_CNOTES 1148 +#define IDC_SETMRU 1149 +#define IDC_SPINCNOTES 1149 +#define IDC_SPINSETMRU 1150 +#define IDC_SETUSEMRU 1151 +#define IDC_SETCITY 1152 +#define IDC_SETSTATE 1153 +#define IDC_SETCOUNTRY 1154 +#define IDC_SETZIP 1155 +#define IDC_SETEMAIL 1156 +#define IDC_SETWEB 1157 +#define IDC_SETPREFIX 1158 +#define IDC_SETTRAY 1159 +#define IDC_NEWINFO 1160 +#define IDC_ADDINFO 1161 +#define IDC_COMP 1162 +#define IDC_DEPT 1163 +#define IDC_SETCOMP 1163 +#define IDC_POSN 1164 +#define IDC_FCOMBO 1164 +#define IDC_MGR 1165 +#define ID_VIEW_FLATBAR 32771 +#define ID_EDIT_SELECTALL 32772 +#define ID_VIEW_COLPOS 32772 +#define ID_ENTRY_ADD 32773 +#define ID_ENTRY_EDIT 32774 +#define ID_ENTRY_DELETE 32775 +#define ID_ENTRY_COPY 32776 +#define ID_FILE_IMPORT 32803 +#define ID_IMPORT_CSV 32804 +#define ID_IMPORT_TAB 32805 +#define ID_EXPORT_CSV 32806 +#define ID_EXPORT_TAB 32807 +#define ID_ENTRY_PREF 32808 +#define ID_APP_PREFS 32809 +#define ID_VIEW_FIND_NEXT 32813 +#define ID_EDIT_FIND_COMBO 32814 +#define ID_VIEW_WNDPOS 32817 +#define ID_VIEW_COLSET 32818 +#define ID_TRAY_SHOW 32819 +#define ID_TRAY_EXIT 32820 +#define ID_DIAL_HOME 32822 +#define ID_DIAL_WORK 32823 +#define ID_DIAL_CELL 32824 +#define ID_DIAL_PAGER 32825 +#define ID_DIAL_FAX 32826 +#define ID_EMAIL_ADD1 32827 +#define ID_EMAIL_ADD2 32828 +#define ID_URL1 32829 +#define ID_URL2 32830 +#define ID_TBAR_DIAL 32831 +#define ID_TBAR_EMAIL 32832 +#define ID_TBAR_WEB 32833 +#define ID_INDICATOR_CLOCK 59142 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_3D_CONTROLS 1 +#define _APS_NEXT_RESOURCE_VALUE 137 +#define _APS_NEXT_COMMAND_VALUE 32780 +#define _APS_NEXT_CONTROL_VALUE 1013 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/SetPage.cpp b/SetPage.cpp new file mode 100644 index 0000000..52de2dd --- /dev/null +++ b/SetPage.cpp @@ -0,0 +1,95 @@ +// SetPage.cpp : implementation file +// + +#include "stdafx.h" +#include "CB32.h" +#include "SetPage.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CSetPage property page + +IMPLEMENT_DYNCREATE(CSetPage, CPropertyPage) + +CSetPage::CSetPage() : CPropertyPage(CSetPage::IDD) +{ + //{{AFX_DATA_INIT(CSetPage) + m_setlastfile = FALSE; + m_setsort = FALSE; + m_setcol = FALSE; + m_setexp = FALSE; + m_setimp = FALSE; + m_setwin = FALSE; + m_setmru = 0; + m_setcity = _T(""); + m_setcountry = _T(""); + m_setemail = _T(""); + m_setstate = _T(""); + m_setweb = _T(""); + m_setzip = _T(""); + m_setusemru = FALSE; + m_setprefix = _T(""); + m_settray = FALSE; + m_setcomp = _T(""); + m_setpos = FALSE; + m_setstart = FALSE; + m_setdelete = FALSE; + //}}AFX_DATA_INIT +} + +CSetPage::~CSetPage() +{ +} + +void CSetPage::DoDataExchange(CDataExchange* pDX) +{ + CPropertyPage::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CSetPage) + DDX_Control(pDX, IDC_SPINSETMRU, m_spinsetmru); + DDX_Check(pDX, IDC_SETLASTFILE, m_setlastfile); + DDX_Check(pDX, IDC_SETSORT, m_setsort); + DDX_Check(pDX, IDC_SETCOL, m_setcol); + DDX_Check(pDX, IDC_SETEXP, m_setexp); + DDX_Check(pDX, IDC_SETIMP, m_setimp); + DDX_Check(pDX, IDC_SETWIN, m_setwin); + DDX_Text(pDX, IDC_SETMRU, m_setmru); + DDV_MinMaxInt(pDX, m_setmru, 1, 8); + DDX_Text(pDX, IDC_SETCITY, m_setcity); + DDX_Text(pDX, IDC_SETCOUNTRY, m_setcountry); + DDX_Text(pDX, IDC_SETEMAIL, m_setemail); + DDX_Text(pDX, IDC_SETSTATE, m_setstate); + DDX_Text(pDX, IDC_SETWEB, m_setweb); + DDX_Text(pDX, IDC_SETZIP, m_setzip); + DDX_Check(pDX, IDC_SETUSEMRU, m_setusemru); + DDX_Text(pDX, IDC_SETPREFIX, m_setprefix); + DDX_Check(pDX, IDC_SETTRAY, m_settray); + DDX_Text(pDX, IDC_SETCOMP, m_setcomp); + DDX_Check(pDX, IDC_SETPOS, m_setpos); + DDX_Check(pDX, IDC_SETSTART, m_setstart); + DDX_Check(pDX, IDC_SETDELETE, m_setdelete); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CSetPage, CPropertyPage) + //{{AFX_MSG_MAP(CSetPage) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSetPage message handlers + +BOOL CSetPage::OnInitDialog() +{ + CPropertyPage::OnInitDialog(); + + m_spinsetmru.SetRange(1,8); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} diff --git a/SetPage.h b/SetPage.h new file mode 100644 index 0000000..c86419d --- /dev/null +++ b/SetPage.h @@ -0,0 +1,58 @@ +// SetPage.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CSetPage dialog + +class CSetPage : public CPropertyPage +{ + DECLARE_DYNCREATE(CSetPage) + +// Construction +public: + CSetPage(); + ~CSetPage(); + +// Dialog Data + //{{AFX_DATA(CSetPage) + enum { IDD = IDD_SETPAGE }; + CSpinButtonCtrl m_spinsetmru; + BOOL m_setlastfile; + BOOL m_setsort; + BOOL m_setcol; + BOOL m_setexp; + BOOL m_setimp; + BOOL m_setwin; + int m_setmru; + CString m_setcity; + CString m_setcountry; + CString m_setemail; + CString m_setstate; + CString m_setweb; + CString m_setzip; + BOOL m_setusemru; + CString m_setprefix; + BOOL m_settray; + CString m_setcomp; + BOOL m_setpos; + BOOL m_setstart; + BOOL m_setdelete; + //}}AFX_DATA + + +// Overrides + // ClassWizard generate virtual function overrides + //{{AFX_VIRTUAL(CSetPage) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CSetPage) + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; diff --git a/StdAfx.cpp b/StdAfx.cpp new file mode 100644 index 0000000..7af35e7 --- /dev/null +++ b/StdAfx.cpp @@ -0,0 +1,6 @@ +// stdafx.cpp : source file that includes just the standard includes +// CB32.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + diff --git a/StdAfx.h b/StdAfx.h new file mode 100644 index 0000000..1b39435 --- /dev/null +++ b/StdAfx.h @@ -0,0 +1,27 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__20BFD1E9_4F52_11D1_AF86_000000000000__INCLUDED_) +#define AFX_STDAFX_H__20BFD1E9_4F52_11D1_AF86_000000000000__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include // MFC core and standard components +#include // MFC extensions +#include +#include +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__20BFD1E9_4F52_11D1_AF86_000000000000__INCLUDED_) diff --git a/ToolBarEx.cpp b/ToolBarEx.cpp new file mode 100644 index 0000000..fa29f20 --- /dev/null +++ b/ToolBarEx.cpp @@ -0,0 +1,750 @@ +///////////////////////////////////////////////////////////////////////////// +// Copyright (C) 1997 by Joerg Koenig +// All rights reserved +// +// Distribute freely, except: don't remove my name from the source or +// documentation (don't take credit for my work), mark your changes (don't +// get me blamed for your possible bugs), don't alter or remove this +// notice. +// No warrantee of any kind, express or implied, is included with this +// software; use at your own risk, responsibility for damages (if any) to +// anyone resulting from the use of this software rests entirely with the +// user. +// +// Send bug reports, bug fixes, enhancements, requests, flames, etc., and +// I'll try to keep a version up to date. I can be reached as follows: +// J.Koenig@adg.de (company site) +// Joerg.Koenig@rhein-neckar.de (private site) +///////////////////////////////////////////////////////////////////////////// + + +// ToolBarEx.cpp : implementation file +// +// Description: +// CToolBarEx provides additional features to the standard toolbar +// "CToolBar". The main addition is the flat mode (last seen in +// Developer Studio 5.0). +// There are no special requirements for having the flat mode in your +// application (no special comctl32.dll or what ever)! +// If you need custom draw abilities, then you have to use VC++ >= 4.2 +// However, the flat mode should work with older versions of VC++ too (let +// me know of your experiences!) +// +// Usage: +// The only task you have to perform, is to +// #include "ToolBarEx.h" +// in either StdAfx.h or MainFrm.h and to change the type of +// CMainFrame::m_wndToolBar from CToolBar to CToolBarEx. +// Don't forget to recompile :-) +// +// Acknowledgements: +// o The main idea of how to draw a separator and the gripper is stolen +// from Roger Onslow's MSIE flat toolbar. +// Thanks for saving my time, Roger ;-) +// o The embossed drawing of a disabled image came from +// Victor M. Vogelpoel (victorv@telic.nl) +// o Some hints for buttons with text came from +// David Bates (bates@econ.ubc.ca) +// (I'm still thinking, text on toolbar-buttons is broken. +// That has to be tooltip's work. However, texts on buttons +// now work) +// +// +// (known) bugs and limitations: +// o the CDRF_NEWFONT notification is still untested ... +// o Assigning texts to buttons may cause the buttons to +// resize horizontally without notified by CToolBar. This +// leads to a wrong calculation inside CalcDynamicLayout() +// and CalcFixedLayout(). One could override both these +// functions in derived classes to avoid that problem, +// but that would be a greater pain ... +// +// if you find others (and have a solution for them ?!), please let me know: +// Joerg.Koenig@rhein-neckar.de (private site) or +// J.Koenig@adg.de (company site) +// +// Changes: +// 11/07/97 +// (2 minor bugs have been occured as a result of the last update :) +// o The WRAP state of a separator will be ignored now, if +// the bar is docked vertically +// o Draw an image transparently. This is needed only if one +// uses 256 color images. +// +// 10/30/97 +// o texts on buttons now work +// o gripper improved for a closer look like Office97 +// o disabled images now look embossed +// o a separator is drawn only if it has no WRAP state set + + + +#include "stdafx.h" +#include "ToolBarEx.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + + +///////////////////////////////////////////////////////////////////////////// +// local helper class CCustomDrawInfo +// +// The helper class CCustomDrawInfo handles the messaging to the docking +// frame of the toolbar in flat mode only. If flat-mode is disabled, then +// MFC's own messanger will be used. +// +// A few words about custom draw on toolbars: +// o custom draw is possible for MFC >= 4.2 only (older versions don't know +// anything about certain structures ...) +// o MFC does not set the "rc" member of NMCUSTOMDRAW to the rectangle of the +// button that will be drawn. However, we do, so watch out, wether the +// toolbar is flat or not (or ignore the "rc" member in both cases). +// If the current mode is not "flat", then MFC's art of message arrives ... +// o MFC does not send a message for separators, so we too don't do it. +// o It seems that MFC toolbars never send *ERASE notifications; instead they +// send TBN_QUERYDELETE for instance. +// o The CDRF_NEWFONT notification result is ignored (in flat mode. Never +// tried with original MFC, because it is broken on toolbars). +///////////////////////////////////////////////////////////////////////////// + +class CCustomDrawInfo { + +#if _MFC_VER >= 0x0420 + NMCUSTOMDRAW m_CDRW; // custom draw information holder + LRESULT m_PrePaint; // result from prepaint notification + LRESULT m_ItemPrePaint; // dito for specific item + CToolBarEx * m_pToolBar; // the real sender of the notification + CWnd * m_pReceiver; // the receiver of the notification + + LRESULT NotifyParent(); +#endif // _MFC_VER + + public: // construction + CCustomDrawInfo( CDC & dc, CToolBarEx * pToolBar ); + + public: + // NotifyItemPrePaint() returns TRUE, + // if the user wants to do the default + // (CDRF_DODEFAULT) or FALSE, if the + // user wants to skip (CDRF_SKIPDEFAULT) + // Note that CDRF_SKIPDEFAULT is not + // allowed for CDDS_PREPAINT, CDDS_POSTPAINT ! + // and CDDS_ITEMPOSTPAINT + void NotifyPrePaint(); + BOOL NotifyItemPrePaint(int item); + void NotifyItemPostPaint(int item); + void NotifyPostPaint(); +}; + + +#if _MFC_VER >= 0x420 + + LRESULT CCustomDrawInfo :: NotifyParent() { + LRESULT lRes = CDRF_DODEFAULT; + + if( m_pReceiver ) + lRes = m_pReceiver->SendMessage(WM_NOTIFY, + WPARAM(m_CDRW.hdr.idFrom), + LPARAM(&m_CDRW)); + return lRes; + } + + + CCustomDrawInfo :: CCustomDrawInfo( CDC & dc, CToolBarEx * pBar ) + : m_PrePaint(0) + , m_ItemPrePaint(0) + { + VERIFY((m_pToolBar = pBar) != 0); + VERIFY((m_CDRW.hdc = dc.GetSafeHdc()) != 0); + + HWND hwnd = pBar->GetSafeHwnd(); + VERIFY(::IsWindow(hwnd)); + + // initialise the NMHDR member of the customdraw structure + m_CDRW.hdr.hwndFrom = hwnd; + m_CDRW.hdr.idFrom = UINT(::GetWindowLong(hwnd, GWL_ID)); + m_CDRW.hdr.code = NM_CUSTOMDRAW; + + // Do not use CControlBar::GetDockingFrame() to receive + // the parent. CWnd::GetParent() is inacceptable too. + // Both these functions don't work, if the toolbar is + // floating in the air! + m_pReceiver = pBar->GetParentFrame(); + if( m_pReceiver ) + VERIFY(::IsWindow(m_pReceiver->GetSafeHwnd())); + } + + void CCustomDrawInfo :: NotifyPrePaint() { + // fill the customdraw structure with values for CDDS_PREPAINT + m_CDRW.dwDrawStage = CDDS_PREPAINT; + // the rest of the structure stays undefined in this stage + // of drawing. + m_PrePaint = NotifyParent(); + } + + BOOL CCustomDrawInfo :: NotifyItemPrePaint( int nItem ) { + BOOL bRet = TRUE; // we assume to do the default + if( m_PrePaint & CDRF_NOTIFYITEMDRAW ) { + m_CDRW.dwDrawStage = CDDS_ITEMPREPAINT; + m_pToolBar->GetItemRect(nItem, &m_CDRW.rc); + m_CDRW.dwItemSpec = DWORD(m_pToolBar->GetItemID(nItem)); + UINT uStyle = m_pToolBar->GetButtonStyle(nItem); + BOOL bEnable = m_pToolBar->GetToolBarCtrl() + .IsButtonEnabled(m_CDRW.dwItemSpec); + m_CDRW.uItemState = (bEnable ? 0 : CDIS_DISABLED) | + (((uStyle & TBBS_PRESSED) || (uStyle & TBBS_CHECKED)) ? + CDIS_CHECKED : 0); + m_CDRW.lItemlParam = 0; + m_ItemPrePaint = NotifyParent(); + if( m_ItemPrePaint & CDRF_SKIPDEFAULT ) + bRet = FALSE; + } + return bRet; + } + + void CCustomDrawInfo :: NotifyItemPostPaint( int nItem ) { + if( m_ItemPrePaint & CDRF_NOTIFYPOSTPAINT ) { + m_CDRW.dwDrawStage = CDDS_ITEMPOSTPAINT; + // the rest of the data has not been changed since ITEMPREPAINT + // make sure it is so: + ASSERT(m_pToolBar->GetItemID(nItem) == m_CDRW.dwItemSpec); + NotifyParent(); + } + } + + void CCustomDrawInfo :: NotifyPostPaint() { + if( m_PrePaint & CDRF_NOTIFYPOSTPAINT ) { + m_CDRW.dwDrawStage = CDDS_POSTPAINT; + NotifyParent(); + } + } + +#else // _MFC_VER < 4.2 + + CCustomDrawInfo :: CCustomDrawInfo( CDC & dc, CWnd * pParent ) { + } + + void CCustomDrawInfo :: NotifyPrePaint() { + } + + void CCustomDrawInfo :: NotifyPostPaint() { + } + + BOOL CCustomDrawInfo :: NotifyItemPrePaint( int ) { + return TRUE; // we always make the drawing by ourself + } + + void CCustomDrawInfo :: NotifyItemPostPaint( int ) { + } + +#endif // _MFC_VER + + + +///////////////////////////////////////////////////////////////////////////// +// CToolBarEx + +CToolBarEx::CToolBarEx() + : m_bFlatLook(TRUE) + , m_clrBtnFace(::GetSysColor(COLOR_BTNFACE)) + , m_clrBtnHilight(::GetSysColor(COLOR_BTNHILIGHT)) + , m_clrBtnShadow(::GetSysColor(COLOR_BTNSHADOW)) + , m_nLastBtn(-1) + , m_uTimerEvent(0) +{ + CalculateOffset(); + + // create the default font, used for buttons with text + CFont Font; + BOOL bOldSys = FALSE; + if( ! Font.CreateStockObject( DEFAULT_GUI_FONT ) ) { + // older versions of Windows* (NT 3.51 for instance) + // fail with DEFAULT_GUI_FONT + VERIFY( Font.CreateStockObject( SYSTEM_FONT ) ); + bOldSys = TRUE; + } + LOGFONT logfont ; + Font.GetLogFont( &logfont ) ; + if( bOldSys ) { + logfont.lfWeight = 400; + strcpy(logfont.lfFaceName,_T("MS Sans Serif")); + } + logfont.lfHeight = 6 ; + logfont.lfWidth = 0 ; // let windows compute this. + VERIFY( m_GuiFont.CreateFontIndirect( &logfont ) ) ; +} + +CToolBarEx::~CToolBarEx() +{ +} + + +IMPLEMENT_DYNAMIC(CToolBarEx, CToolBar) + + +BEGIN_MESSAGE_MAP(CToolBarEx, CToolBar) + //{{AFX_MSG_MAP(CToolBarEx) + ON_WM_PAINT() + ON_WM_SYSCOLORCHANGE() + ON_WM_NCCALCSIZE() + ON_WM_MOUSEMOVE() + ON_WM_NCPAINT() + ON_WM_TIMER() + ON_WM_CREATE() + //}}AFX_MSG_MAP + ON_MESSAGE(TB_SETBUTTONSIZE, OnSetButtonSize) + ON_MESSAGE(TB_SETBITMAPSIZE, OnSetBitmapSize) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CToolBarEx message handlers + +LRESULT CToolBarEx :: OnSetButtonSize(WPARAM wParam, LPARAM lParam) { + LRESULT lResult = CToolBar::OnSetButtonSize(wParam, lParam); + if( lResult ) + CalculateOffset(); + return lResult; +} + +LRESULT CToolBarEx :: OnSetBitmapSize(WPARAM wParam, LPARAM lParam) { + LRESULT lResult = CToolBar::OnSetBitmapSize(wParam, lParam); + if( lResult ) + CalculateOffset(); + return lResult; +} + + +void CToolBarEx::OnPaint() +{ + HIMAGELIST hImg = GetImageList(); + +#ifdef _DEBUG + if( hImg == 0 ) { + TRACE0("CToolBarEx::OnPaint(): could not get image list\n"); + } +#endif + + if( m_bFlatLook && hImg ) { + CRect rcUpdate; + if( ! GetUpdateRect(rcUpdate) ) + return; + + if( m_pStringMap && !m_pStringMap->IsEmpty() ) + CalculateOffset(); // strings may have been added + + // attach image-list for even more MFC feeling :) + CImageList imglist; + imglist.Attach(hImg); + + POINT cursor; + ::GetCursorPos(&cursor); + ScreenToClient(&cursor); + + CPaintDC dc(this); // device context for painting + CFont * pOldFont = dc.SelectObject(&m_GuiFont); + + // Now it's time for the first custom-draw-notification... + CCustomDrawInfo cdrw(dc, this); + cdrw.NotifyPrePaint(); + + register const int nBtn = GetToolBarCtrl().GetButtonCount(); + + for( register int i = 0; i < nBtn; ++i ) { + CRect rc; + GetItemRect(i, rc); + + int nBitmap; UINT uID, uStyleState; + GetButtonInfo(i, uID, uStyleState, nBitmap); + WORD wStyle = LOWORD(uStyleState); + WORD wState = HIWORD(uStyleState); + + if( wState & TBSTATE_HIDDEN ) + continue; + + if( wStyle == TBSTYLE_SEP ) { + if( !(wState & TBSTATE_WRAP) || ! IsFloating() ) + DrawSeparator(dc, rc); + } else { + if( ! CRect().IntersectRect(rcUpdate, rc) ) + continue; // this button needs no repaint + + // maybe the button has text + dc.SetTextColor(RGB(0,0,0)); + dc.SetBkColor(m_clrBtnFace); + + // There is a bug in CToolBar: If there are texts assigned + // to buttons, then the button-widths may change transparently + // (without notified by CToolBar), so we recalculate the + // horizontal offset here: + m_sizeOffset.cx = (rc.Width() - m_sizeImage.cx) / 2; + + if( ! cdrw.NotifyItemPrePaint(i) ) + continue; // parent has already drawn the button + + BOOL bBtnDown = (wState & TBSTATE_CHECKED) || (wState & TBSTATE_PRESSED); + BOOL bBtnEnabled = GetToolBarCtrl().IsButtonEnabled(int(uID)); + + dc.FillSolidRect(rc,m_clrBtnFace); + + // it seems, that CDC::Draw3dRect() changes the background color + COLORREF clrBk = dc.GetBkColor(); + + if( bBtnDown ) + // draw a pressed button + dc.Draw3dRect(rc, m_clrBtnShadow, m_clrBtnHilight); + else if( rc.PtInRect(cursor) && ! bBtnDown && bBtnEnabled ) + // draw a normal button + dc.Draw3dRect(rc, m_clrBtnHilight, m_clrBtnShadow); + else if( ! bBtnDown && bBtnEnabled ) + // Draw an invisible rect around the button. + // This prevents us from erasing the background + // if the button was formed before + // (that would cause the button to flicker ...) + dc.Draw3dRect(rc, m_clrBtnFace, m_clrBtnFace); + + dc.SetBkColor(clrBk); + + // the point where to start with the image + CPoint pt(rc.left + m_sizeOffset.cx + bBtnDown, + rc.top + m_sizeOffset.cy + bBtnDown); + + imglist.Draw(&dc, nBitmap, pt, ILD_TRANSPARENT); + CString strText = GetButtonText(i); + if( strText.GetLength() ) { + CRect rectText( + rc.left+3+bBtnDown, + rc.top+m_sizeOffset.cy+m_sizeImage.cy+1+bBtnDown, + rc.right-3+bBtnDown, + rc.bottom-3+bBtnDown + ); + dc.DrawText(strText, rectText, DT_CENTER|DT_VCENTER|DT_NOCLIP); + } + + if( ! bBtnEnabled ) + // gray out that button + DrawDisabledButton(dc, rc); + + cdrw.NotifyItemPostPaint(i); + } + } + + dc.SelectObject(pOldFont); + + if( ! m_bDeleteImgList ) + imglist.Detach(); + + // last but not least: inform the parent for end of painting + cdrw.NotifyPostPaint(); + } else + // classic mode (or couldn't receive imagelist) + CToolBar::OnPaint(); +} + + +void CToolBarEx :: DrawDisabledButton( CDC & dc, const CRect & rc ) const { + // create a monochrome memory DC + CDC ddc; + ddc.CreateCompatibleDC(0); + CBitmap bmp; + bmp.CreateCompatibleBitmap(&ddc, rc.Width(), rc.Height()); + CBitmap * pOldBmp = ddc.SelectObject(&bmp); + + // build a mask + ddc.PatBlt(0, 0, rc.Width(), rc.Height(), WHITENESS); + dc.SetBkColor(m_clrBtnFace); + ddc.BitBlt(0, 0, rc.Width(), rc.Height(), &dc, rc.left, rc.top, SRCCOPY); + dc.SetBkColor(m_clrBtnHilight); + ddc.BitBlt(0, 0, rc.Width(), rc.Height(), &dc, rc.left, rc.top, SRCPAINT); + + // Copy the image from the toolbar into the memory DC + // and draw it (grayed) back into the toolbar. + dc.FillSolidRect(rc.left, rc.top, rc.Width(), rc.Height(), m_clrBtnFace); + dc.SetBkColor(RGB(0, 0, 0)); + dc.SetTextColor(RGB(255, 255, 255)); + CBrush brShadow, brHilight; + brHilight.CreateSolidBrush(m_clrBtnHilight); + brShadow.CreateSolidBrush(m_clrBtnShadow); + CBrush * pOldBrush = dc.SelectObject(&brHilight); + dc.BitBlt(rc.left+1, rc.top+1, rc.Width(), rc.Height(), &ddc, 0, 0, 0x00E20746L); + dc.SelectObject(&brShadow); + dc.BitBlt(rc.left, rc.top, rc.Width(), rc.Height(), &ddc, 0, 0, 0x00E20746L); + + // reset DCs + dc.SelectObject(pOldBrush); + ddc.SelectObject(pOldBmp); + ddc.DeleteDC(); + + bmp.DeleteObject(); +} + + +void CToolBarEx :: DrawSeparator( CDC & dc, CRect & rc ) const { + BOOL bHorz = ((m_dwStyle & CBRS_ORIENT_HORZ) != 0) ? TRUE : FALSE; + // make sure, this separator is not a placeholder for + // another control. + if( rc.Width() <= 8 ) { + if( bHorz ) { + // draw the separator bar in the middle + int x = (rc.left + rc.right) / 2; + rc.left = x-1; rc.right = x+1; + dc.Draw3dRect( + rc, + m_clrBtnShadow, + m_clrBtnHilight + ); + } else { + // draw the separator bar in the middle + rc.left = rc.left - m_sizeButton.cx; + rc.right = rc.left + m_sizeButton.cx; + rc.top = rc.bottom+1; + rc.bottom = rc.top+3; + int y = (rc.top+rc.bottom)/2; + rc.top = y-1; rc.bottom = y+1; + dc.Draw3dRect( + rc, + m_clrBtnShadow, + m_clrBtnHilight + ); + } + } +} + + +void CToolBarEx :: DrawGripper( CDC & dc ) const { + if( m_dwStyle & CBRS_FLOATING ) + return; // no gripper if floating + + CRect gripper; + GetWindowRect(gripper); + ScreenToClient(gripper); + gripper.OffsetRect(-gripper.left, -gripper.top); + + if( m_dwStyle & CBRS_ORIENT_HORZ ) { + // gripper at left + gripper.DeflateRect(4, 4); + gripper.right = gripper.left+3; + dc.Draw3dRect( + gripper, + m_clrBtnHilight, + m_clrBtnShadow + ); + gripper.OffsetRect(3, 0); + dc.Draw3dRect( + gripper, + m_clrBtnHilight, + m_clrBtnShadow + ); + } else { + // gripper at top + gripper.DeflateRect(4, 4); + gripper.bottom = gripper.top+3; + dc.Draw3dRect( + gripper, + m_clrBtnHilight, + m_clrBtnShadow + ); + gripper.OffsetRect(0, 3); + dc.Draw3dRect( + gripper, + m_clrBtnHilight, + m_clrBtnShadow + ); + } +} + +void CToolBarEx :: OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler ) { + if( m_bFlatLook ) { + // save current styles + register const int nBtn = GetToolBarCtrl().GetButtonCount(); + register int nIdx; + for( nIdx = 0; nIdx < nBtn; ++nIdx ) + m_Styles.SetAtGrow(nIdx, GetButtonStyle(nIdx)); + + // do base class processing + CToolBar::OnUpdateCmdUI(pTarget,bDisableIfNoHndler); + + //check wether styles have been changed + for( nIdx = 0; nIdx < nBtn; ++nIdx ) { + if( m_Styles[nIdx] != GetButtonStyle(nIdx) ) { + // invalidate that button + CRect rc; + GetItemRect(nIdx, rc); + InvalidateRect(rc); + } + } + } else + // simply delegate + CToolBar::OnUpdateCmdUI(pTarget,bDisableIfNoHndler); +} + +void CToolBarEx::OnSysColorChange() +{ + CToolBar::OnSysColorChange(); + + m_clrBtnFace = ::GetSysColor(COLOR_BTNFACE); + m_clrBtnHilight = ::GetSysColor(COLOR_BTNHILIGHT); + m_clrBtnShadow = ::GetSysColor(COLOR_BTNSHADOW); +} + + +void CToolBarEx::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp) +{ + CToolBar::OnNcCalcSize(bCalcValidRects, lpncsp); + // adjust non-client area for gripper at left or top + if( m_dwStyle & CBRS_ORIENT_HORZ ) { + lpncsp->rgrc[0].left += 4; + lpncsp->rgrc[0].right += 4; + } else { + lpncsp->rgrc[0].top += 6; + lpncsp->rgrc[0].bottom += 6; + } +} + + +void CToolBarEx::OnMouseMove(UINT nFlags, CPoint point) +{ + if( m_bFlatLook ) { + register const int nBtn = GetToolBarCtrl().GetButtonCount(); + const int nLastBtn = m_nLastBtn; + m_nLastBtn = -1; + + for( register int i = 0 ; i < nBtn ; ++i ) { + CRect rc; + GetItemRect(i, rc); + + const BOOL bBtnEnabled = GetToolBarCtrl().IsButtonEnabled(int(GetItemID(i))); + const BOOL bSep = GetButtonStyle(i) & TBBS_SEPARATOR; + + if( bSep || ! bBtnEnabled ) + continue; + + const BOOL bHasCursor = rc.PtInRect(point); + + if( bHasCursor && bBtnEnabled ) { + if( nLastBtn != i ) { + // force a repaint of the button with the cursor on it + InvalidateRect(rc, FALSE); + } + m_nLastBtn = i; + } else if( !bHasCursor && i == nLastBtn ) { + // force a repaint of the last formed button + InvalidateRect(rc, FALSE); + } + } + // One problem occures with WM_MOUSEMOVE: we cannot detect + // that the mouse leaves the window. If the mouse moves quick + // enough, then the last formed button stays visible. To + // resolve this problem, we set a timer and check, wether + // the mouse is outside the window ... + KillTimer(m_uTimerEvent); + m_uTimerEvent = SetTimer(1, 250, 0); + } + CToolBar::OnMouseMove(nFlags, point); +} + + +void CToolBarEx::OnNcPaint() +{ + if( m_bFlatLook ) { + CToolBar::EraseNonClient(); + CWindowDC dc(this); + DrawGripper(dc); + } else + CToolBar::OnNcPaint(); +} + +void CToolBarEx::OnTimer(UINT nIDEvent) +{ + if( nIDEvent == m_uTimerEvent && m_nLastBtn >= 0 ) { + POINT pt; + ::GetCursorPos(&pt); + CRect rc; + GetWindowRect(rc); + if( ! rc.PtInRect(pt) ) { + GetItemRect(m_nLastBtn, rc); + InvalidateRect(rc, FALSE); + m_nLastBtn = -1; + KillTimer(nIDEvent); + } + } else + CToolBar::OnTimer(nIDEvent); +} + +int CToolBarEx::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CToolBar::OnCreate(lpCreateStruct) == -1) + return -1; + + // Save the parent at creation time. It may change, if + // the toolbar is floating; but we want to know of the + // "real" parent (for notification messages)! + m_hwndParent = lpCreateStruct->hwndParent; + + return 0; +} + +#define PADWIDTH(x) (((x)*8+31)&~31)/8 + + +HIMAGELIST CToolBarEx :: GetImageList() { + m_bDeleteImgList = FALSE; + + HIMAGELIST hImg = HIMAGELIST(SendMessage(TB_GETIMAGELIST)); + +#ifdef _DEBUG + if( hImg == 0 ) { + TRACE0("CToolBarEx::OnPaint(): could not get image list\n"); + } +#endif + + if( ! hImg ) { + // comctl32.dll version prior to 4.70 doesn't know + // anything of the TB_GETIMAGELIST message + if( m_hbmImageWell != 0 ) { + // Yup - we have a valid image. + // But beware: Do not use this bitmap directly. + // We make the copy by ourself. CopyImage() (for + // instace) produces inacceptable copies under + // some circumstances ... + CImageList imglist; + CBitmap bmp; + + // retrieve the size of the bitmap + BITMAP bmHdr; + ::GetObject(m_hbmImageWell, sizeof(BITMAP), &bmHdr); + + DWORD dwWidth, dwHeight = bmHdr.bmHeight; + + if (bmHdr.bmBitsPixel > 8) + dwWidth = PADWIDTH(bmHdr.bmWidth * 3); + else + dwWidth = PADWIDTH(bmHdr.bmWidth); + + // copy the bitmap + CClientDC cdc(this); + CDC dc1, dc2; + dc1.CreateCompatibleDC(&cdc); + dc2.CreateCompatibleDC(&cdc); + bmp.CreateCompatibleBitmap(&cdc, dwWidth, dwHeight); + CBitmap * pOBmp = dc1.SelectObject(&bmp); + HGDIOBJ hOObj = ::SelectObject(dc2.GetSafeHdc(), m_hbmImageWell); + dc1.BitBlt(0,0,dwWidth,dwHeight,&dc2,0,0,SRCCOPY); + ::SelectObject(dc2.GetSafeHdc(), hOObj); + dc1.SelectObject(pOBmp); + dc1.DeleteDC(); + dc2.DeleteDC(); + + imglist.Create(m_sizeImage.cx, m_sizeImage.cy,TRUE,dwWidth/m_sizeImage.cx,1); + imglist.SetBkColor(m_clrBtnFace); + imglist.Add(&bmp,m_clrBtnFace); + hImg = imglist.Detach(); + bmp.DeleteObject(); + m_bDeleteImgList = TRUE; + } + } + + return hImg; +} diff --git a/ToolBarEx.h b/ToolBarEx.h new file mode 100644 index 0000000..59bdc47 --- /dev/null +++ b/ToolBarEx.h @@ -0,0 +1,153 @@ +///////////////////////////////////////////////////////////////////////////// +// Copyright (C) 1997 by Joerg Koenig +// All rights reserved +// +// Distribute freely, except: don't remove my name from the source or +// documentation (don't take credit for my work), mark your changes (don't +// get me blamed for your possible bugs), don't alter or remove this +// notice. +// No warrantee of any kind, express or implied, is included with this +// software; use at your own risk, responsibility for damages (if any) to +// anyone resulting from the use of this software rests entirely with the +// user. +// +// Send bug reports, bug fixes, enhancements, requests, flames, etc., and +// I'll try to keep a version up to date. I can be reached as follows: +// J.Koenig@adg.de (company site) +// Joerg.Koenig@rhein-neckar.de (private site) +///////////////////////////////////////////////////////////////////////////// + + +#if !defined(AFX_TOOLBAREX_H__1E0F37F5_4020_11D1_9FB1_444553540000__INCLUDED_) +#define AFX_TOOLBAREX_H__1E0F37F5_4020_11D1_9FB1_444553540000__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// ToolBarEx.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// CToolBarEx window + +class CToolBarEx : public CToolBar +{ + DECLARE_DYNAMIC(CToolBarEx) + +// data members +private: + BOOL m_bFlatLook; + CSize m_sizeOffset; // real starting point of the image + COLORREF m_clrBtnFace; + COLORREF m_clrBtnHilight; + COLORREF m_clrBtnShadow; + int m_nLastBtn; // index of last formed button + UINT m_uTimerEvent; + CUIntArray m_Styles; + HWND m_hwndParent; // "real" parent (even in floating mode) + BOOL m_bDeleteImgList; // remember the way we've built the image list + CFont m_GuiFont; + +// Construction +public: + CToolBarEx(); + +// Attributes +public: + void SetFlatLook( BOOL bFlat = TRUE ) { + if( bFlat != m_bFlatLook ) { + m_bFlatLook = bFlat; + if( ::IsWindow(GetSafeHwnd()) ) { + // force a repaint of all buttons + Invalidate(); + // erase/draw the gripper + OnNcPaint(); + } + } + } + + BOOL IsFlatLook() const { + return m_bFlatLook; + } + + // This function I've missed in CToolBar for more than one time ... + void GetSizes( CSize & szBtn, CSize & szImg ) const { + szBtn = m_sizeButton; + szImg = m_sizeImage; + } + + // Get the window to which the toolbar initially was docked. This + // is not necessarily the window returned by CWnd::GetParent() or + // CControlBar::GetDockingFrame(). Both these functions don't + // return the expected window, if the toolbar is floating ... + CWnd * GetParentFrame() const { + return ::IsWindow(m_hwndParent) ? CWnd::FromHandle(m_hwndParent) : 0; + } + + +// Operations +public: +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CToolBarEx) + //}}AFX_VIRTUAL + +protected: + virtual void OnUpdateCmdUI( CFrameWnd* pTarget, BOOL bDisableIfNoHndler ); + +// Implementation +public: + virtual ~CToolBarEx(); + + // Generated message map functions +protected: + //{{AFX_MSG(CToolBarEx) + afx_msg void OnPaint(); + afx_msg void OnSysColorChange(); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnNcPaint(); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + afx_msg LRESULT OnSetButtonSize(WPARAM, LPARAM); + afx_msg LRESULT OnSetBitmapSize(WPARAM, LPARAM); + + DECLARE_MESSAGE_MAP() + + +private: + // Recalculate the starting point of the button's image. + void CalculateOffset() { + if( m_pStringMap != 0 && !m_pStringMap->IsEmpty() ) { + // there are strings assigned to at least one button + // center the image horizontal + m_sizeOffset.cx = (m_sizeButton.cx-m_sizeImage.cx)/2; + // the following value calculates as follows: + // The button must be big enough to hold the image: + // + 7 pixels on x + // + 6 pixels on y + // So the y-offset is "min" (6) / 2 == 3 + m_sizeOffset.cy = 3; + } else { + // no button has text assigned: center the image on the button + m_sizeOffset.cx = (m_sizeButton.cx-m_sizeImage.cx)/2; + m_sizeOffset.cy = (m_sizeButton.cy-m_sizeImage.cy)/2; + } + } + + // some special drawing functions: + void DrawDisabledButton( CDC &, const CRect & ) const; + void DrawSeparator( CDC &, CRect & ) const; + void DrawGripper( CDC & ) const; + + HIMAGELIST GetImageList(); +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_TOOLBAREX_H__1E0F37F5_4020_11D1_9FB1_444553540000__INCLUDED_) diff --git a/contacts.cbd b/contacts.cbd new file mode 100644 index 0000000..8570c42 --- /dev/null +++ b/contacts.cbd @@ -0,0 +1,33 @@ +contact('LastName' = "Veteren's Affairs", + 'FirstName' = "", + 'MiddleInitial' = "", + 'Title' = "", + 'Address1' = "Federal Building", + 'Address2' = "125 S. Main St.", + 'City' = "Muskogee", + 'Country' = "", + 'State' = "OK", + 'ZipCode' = "74401", + 'Company' = "", + 'Department' = "", + 'Position' = "", + 'Manager' = "", + 'Additional1' = "", + 'Additional2' = "", + 'HomePhone' = "", + 'HomeExt' = "", + 'WorkPhone' = "", + 'WorkExt' = "", + 'CellPhone' = "", + 'CellExt' = "", + 'Pager' = "", + 'PagerCard' = "", + 'PagerExt' = "", + 'FaxPhone' = "", + 'FaxExt' = "", + 'Email1' = "", + 'Email2' = "", + 'Web1' = "", + 'Web2' = "", + 'Notes' = ""). + diff --git a/hlp/AfxCore.rtf b/hlp/AfxCore.rtf new file mode 100644 index 0000000..d314343 --- /dev/null +++ b/hlp/AfxCore.rtf @@ -0,0 +1,527 @@ +{\rtf1\ansi \deff0\deflang1033{\fonttbl{\f0\froman\fcharset0\fprq2 Tms Rmn;}{\f1\froman\fcharset2\fprq2 Symbol;}{\f2\fswiss\fcharset0\fprq2 Helv;}{\f3\fmodern\fcharset0\fprq1 Courier;} +{\f4\froman\fcharset0\fprq2 Times New Roman;}{\f5\fswiss\fcharset0\fprq2 Arial;}{\f6\froman\fcharset0\fprq2 MS Serif;}{\f7\fswiss\fcharset0\fprq2 MS Sans Serif;}{\f8\froman\fcharset0\fprq2 Times;}{\f9\fswiss\fcharset0\fprq2 Helvetica{\*\falt Arial};} +{\f10\fswiss\fcharset0\fprq2 System;}{\f11\fmodern\fcharset0\fprq1 Courier New;}{\f12\froman\fcharset0\fprq2 New York;}{\f13\fswiss\fcharset0\fprq2 Geneva;}{\f14\fmodern\fcharset0\fprq1 Fixedsys;}{\f15\fmodern\fcharset255\fprq1 Terminal;} +{\f16\fswiss\fcharset0\fprq2 Small Fonts;}{\f17\fswiss\fcharset0\fprq2 MS Dialog;}{\f18\fswiss\fcharset0\fprq2 MS Dialog Light;}{\f19\fswiss\fcharset0\fprq2 MS SystemEx;}{\f20\fnil\fcharset2\fprq2 Marlett;}{\f21\fnil\fcharset2\fprq2 Wingdings;} +{\f22\fmodern\fcharset2\fprq1 MS LineDraw;}{\f23\fdecor\fcharset0\fprq2 Algerian;}{\f24\fswiss\fcharset0\fprq2 Arial Rounded MT Bold;}{\f25\froman\fcharset0\fprq2 Bookman Old Style;}{\f26\fdecor\fcharset0\fprq2 Braggadocio;} +{\f27\fswiss\fcharset0\fprq2 Britannic Bold;}{\f28\fscript\fcharset0\fprq2 Brush Script MT;}{\f29\fswiss\fcharset0\fprq2 Century Gothic;}{\f30\fdecor\fcharset0\fprq2 Colonna MT;}{\f31\fdecor\fcharset0\fprq2 Desdemona;} +{\f32\froman\fcharset0\fprq2 Footlight MT Light;}{\f33\fswiss\fcharset0\fprq2 Impact;}{\f34\fdecor\fcharset0\fprq2 Kino MT;}{\f35\froman\fcharset0\fprq2 Wide Latin;}{\f36\fscript\fcharset0\fprq2 Matura MT Script Capitals;} +{\f37\fdecor\fcharset0\fprq2 Playbill;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128; +\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\nowidctlpar \fs20 \snext0 Normal;}{\s1\sb240\nowidctlpar \b\f2\ul +\sbasedon0\snext0 heading 1;}{\s2\sb120\nowidctlpar \b\f2 \sbasedon0\snext0 heading 2;}{\s3\li360\nowidctlpar \b \sbasedon0\snext17 heading 3;}{\s4\li360\nowidctlpar \ul \sbasedon0\snext17 heading 4;}{\s5\li720\nowidctlpar \b\fs20 \sbasedon0\snext17 +heading 5;}{\s6\li720\nowidctlpar \fs20\ul \sbasedon0\snext17 heading 6;}{\s7\li720\nowidctlpar \i\fs20 \sbasedon0\snext17 heading 7;}{\s8\li720\nowidctlpar \i\fs20 \sbasedon0\snext17 heading 8;}{\s9\li720\nowidctlpar \i\fs20 \sbasedon0\snext17 +heading 9;}{\*\cs10 \additive Default Paragraph Font;}{\*\cs15 \additive\f0\fs16\up6\lang1033 \sbasedon10 footnote reference;}{\s16\nowidctlpar \fs20 \sbasedon0\snext16 footnote text;}{\s17\li720\nowidctlpar \fs20 \sbasedon0\snext17 Normal Indent;}{ +\s18\fi-240\li480\sb80\nowidctlpar\tx480 \f9 \sbasedon0\snext18 nscba;}{\s19\fi-240\li240\sa20\nowidctlpar \f9 \sbasedon0\snext19 j;}{\s20\li480\sa20\nowidctlpar \f9 \sbasedon0\snext20 ij;}{\s21\sb80\sa20\nowidctlpar \f9 \sbasedon0\snext21 btb;}{ +\s22\fi-240\li2400\sb20\sa20\nowidctlpar \f9\fs20 \sbasedon0\snext22 ctcb;}{\s23\fi-240\li480\sa40\nowidctlpar\tx480 \f9 \sbasedon0\snext23 ns;}{\s24\sa120\nowidctlpar \f9\fs28 \sbasedon0\snext24 TT;}{\s25\fi-240\li2400\sa20\nowidctlpar \f9 +\sbasedon0\snext25 crtj;}{\s26\fi-240\li480\nowidctlpar\tx480 \f9 \sbasedon0\snext26 nsca;}{\s27\sa20\nowidctlpar \f9 \sbasedon0\snext27 bt;}{\s28\li240\sb120\sa40\nowidctlpar \f9 \sbasedon0\snext28 Hf;}{\s29\li240\sb120\sa40\nowidctlpar \f9 +\sbasedon0\snext29 Hs;}{\s30\li480\sb120\sa40\nowidctlpar \f9 \sbasedon0\snext30 RT;}{\s31\fi-2160\li2160\sb240\sa80\nowidctlpar\tx2160 \f9 \sbasedon0\snext31 c;}{\s32\li2160\sa20\nowidctlpar \f9 \sbasedon0\snext32 ct;}{\s33\li240\sa20\nowidctlpar \f9 +\sbasedon0\snext33 it;}{\s34\li480\nowidctlpar \f9\fs20 \sbasedon0\snext34 nsct;}{\s35\fi-160\li400\sb80\sa40\nowidctlpar \f9 \sbasedon0\snext35 nscb;}{\s36\fi-2640\li2880\sb120\sa40\nowidctlpar\brdrb\brdrs\brdrw15 \brdrbtw\brdrs\brdrw15 \tx2880 \f9 +\sbasedon0\snext36 HC2;}{\s37\fi-2640\li2880\sb120\sa20\nowidctlpar\tx2880 \f9 \sbasedon0\snext37 C2;}{\s38\fi-240\li2400\sa20\nowidctlpar \f9\fs20 \sbasedon0\snext38 ctc;}{\s39\li2160\sb160\nowidctlpar \f9 \sbasedon0\snext39 crt;}{ +\s40\li480\sb20\sa40\nowidctlpar \f9 \sbasedon0\snext40 or;}{\s41\fi-259\li360\sb40\sa40\nowidctlpar\tx360 \f7\fs20 \sbasedon0\snext41 Ln1;}{\s42\li115\sb80\sa80\nowidctlpar \f7\fs20 \sbasedon0\snext0 *Intro;}{\s43\li115\sb80\sa80\keepn\nowidctlpar \b\f7 +\sbasedon3\snext42 *Title;}{\s44\fi-245\li360\sb80\nowidctlpar \f7\fs20 \snext44 *Jl;}{\s45\li360\sb40\sa40\nowidctlpar \f7\fs20 \snext0 Lp1;}{\s46\fi-1800\li1915\sb60\sl-240\slmult0\nowidctlpar\tx1915 \f7\fs20 \sbasedon0\snext46 Tph;}{ +\s47\li115\sb120\sa80\nowidctlpar \b\f7\fs20 \snext41 Proch;}{\*\cs48 \additive\super \sbasedon10 endnote reference;}}{\info{\title AFXCORE}{\subject MFC Core RTF Help}{\author AFX}{\creatim\yr1992\mo10\dy7\hr11\min4}{\version1}{\edmins1}{\nofpages0} +{\nofwords0}{\nofchars0}{\vern49221}}\widowctrl\ftnbj\aenddoc\hyphcaps0 \fet0\sectd \linex576\endnhere {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3 +\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}} +{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \sl240\slmult0\widctlpar +\fs20 {\cs15\fs16\up6 #{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 #} main_index}}{\fs16\up6 }{\b\f2\fs24\up6 <> Help Index}{\b\f2 +\par }{\f9 +\par }{\b\f2 How To ... +\par }{\f2 \tab <>}{\f9\ulw +\par +\par }{\b\f2 Commands +\par }{\f2 \tab }{\f2\uldb File menu}{\v\f2 menu_file}{\f2 +\par \tab }{\f2\uldb Edit menu}{\v\f2 menu_edit}{\f2\uldb +\par }{\f2 \tab }{\f2\uldb Record menu}{\v\f2 menu_record}{\f2 +\par \tab }{\f2\uldb View menu}{\v\f2 menu_view}{\f2 +\par \tab }{\f2\uldb Window menu}{\v\f2 menu_window}{\f2 +\par \tab }{\f2\uldb Help menu}{\v\f2 menu_help}{\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} menu_file}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16\widctlpar +\fs20 {\cs15\fs16\up6 $} File menu commands}}{\f2 }{\b\f2 File menu commands}{\f2 +\par +\par The File menu offers the following commands: +\par +\par }\trowd \trgaph108\trleft-108 \cellx1302\cellx8622 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb New}{\v\f2 HID_FILE_NEW}{\f2 \cell Creates a new document.\cell }\pard \widctlpar\intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1302\cellx8622 \pard +\sl240\slmult0\widctlpar\intbl {\f2\uldb Open}{\v\f2 HID_FILE_OPEN}{\f2\uldb \cell }{\f2 Opens an existing document.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Close}{\v\f2 HID_FILE_CLOSE}{\f2\uldb \cell }{\f2 +Closes an opened document.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Save}{\v\f2 HID_FILE_SAVE}{\f2\uldb \cell }{\f2 Saves an opened document using the same file name.\cell }\pard \widctlpar\intbl {\f2 \row +}\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Save As}{\v\f2 HID_FILE_SAVE_AS}{\f2\uldb \cell }{\f2 Saves an opened document to a specified file name.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Print}{\v\f2 +HID_FILE_PRINT}{\f2\uldb \cell }{\f2 Prints a document.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Print Preview}{\v\f2 HID_FILE_PRINT_PREVIEW}{\f2\uldb \cell }{\f2 +Displays the document on the screen as it would appear printed.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Print Setup}{\v\f2 HID_FILE_PRINT_SETUP}{\f2\uldb \cell }{\f2 Selects a printer and printer connection. +\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Send...}{\v\f2 HID_FILE_SEND_MAIL}{\f2\uldb \cell }{\f2 Sends the active document through electronic mail.\cell }\pard \widctlpar\intbl {\f2 \row }\trowd +\trgaph108\trleft-108 \cellx1302\cellx8622 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Exit}{\v\f2 HID_APP_EXIT}{\f2 \tab +\par }{\f2\uldb \cell }{\f2 Exits <>.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} menu_edit}}{\b\f2 Edit menu commands}{\f2 +\par +\par The Edit menu offers the following commands: +\par }\pard \fi-720\li720\sl240\slmult0\widctlpar {\f2 +\par }\trowd \trgaph108\trleft-108 \cellx1497\cellx10212 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Undo}{\v\f2 HID_EDIT_UNDO}{\f2 \cell Reverse previous editing operation.\cell }\pard \widctlpar\intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1497 +\cellx10212 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Cut}{\v\f2 HID_EDIT_CUT}{\f2\uldb \cell }{\f2 Deletes data from the document and moves it to the clipboard.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb +Copy}{\v\f2 HID_EDIT_COPY}{\f2\uldb \cell }{\f2 Copies data from the document to the clipboard.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Paste}{\v\f2 HID_EDIT_PASTE}{\f2\uldb \cell }{\f2 +Pastes data from the clipboard into the document.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Paste Link}{\v\f2 HID_EDIT_PASTE_LINK}{\f2\uldb \cell }{\f2 +Pastes from the clipboard a link to data in another application.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Insert New Object}{\v\f2\uldb HID_OLE_INSERT_NEW}{\f2\uldb \cell }{\f2 +Inserts and embeds an object, such as a chart or an equation in a document.\cell }\pard \widctlpar\intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1497\cellx10212 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Links}{\v\f2 HID_OLE_EDIT_LINKS}{ +\f2\uldb \cell }{\f2 List and edit links to embedded documents.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \fi-720\li720\sl240\slmult0\widctlpar {\f2 +\par }\pard \sl240\slmult0\widctlpar {\f2 \tab \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} menu_view}}{\b\f2 View menu commands}{\f2 +\par +\par The View menu offers the following commands: +\par +\par }\trowd \trgaph108\trleft-108 \cellx1272\cellx7452 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Toolbar}{\v\f2 HID_VIEW_TOOLBAR}{\f2\uldb \cell }{\f2 Shows or hides the toolbar.\cell }\pard \widctlpar\intbl {\f2 \row }\trowd \trgaph108\trleft-108 +\cellx1272\cellx7452 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Status Bar}{\v\f2 HID_VIEW_STATUS_BAR}{\f2\uldb \cell }\pard \fi-720\li720\sl240\slmult0\widctlpar\intbl {\f2 Shows or hides the status bar. +\par }\pard \sl240\slmult0\widctlpar\intbl {\f2 \cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} menu_window}}{\b\f2 +Window menu commands}{\f2 +\par +\par The Window menu offers the following commands, which enable you to arrange multiple views of multiple documents in the application window: +\par +\par }\trowd \trgaph108\trleft-108 \cellx1572\cellx7752 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb New Window}{\v\f2 HID_WINDOW_NEW}{\f2\uldb \cell }{\f2 Creates a new window that views the same document.\cell }\pard \widctlpar\intbl {\f2 \row }\trowd +\trgaph108\trleft-108 \cellx1572\cellx7752 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Cascade}{\v\f2 HID_WINDOW_CASCADE}{\f2\uldb \cell }{\f2 Arranges windows in an overlapped fashion.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0 +\widctlpar\intbl {\f2\uldb Tile}{\v\f2 HID_WINDOW_TILE}{\f2\uldb \cell }{\f2 Arranges windows in non-overlapped tiles.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Arrange Icons}{\v\f2 HID_WINDOW_ARRANGE}{ +\f2\uldb \cell }\pard \fi-720\li720\sl240\slmult0\widctlpar\intbl {\f2 Arranges icons of closed windows.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Split}{\v\f2 HID_WINDOW_SPLIT}{\f2\uldb \cell }\pard +\fi-720\li720\sl240\slmult0\widctlpar\intbl {\f2 Split the active window into panes.\cell }\pard \widctlpar\intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1572\cellx7752 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Window 1, 2, ...}{\v\f2 +HID_WINDOW_ALL}{\f2\uldb \cell }\pard \fi-720\li720\sl240\slmult0\widctlpar\intbl {\f2 Goes to specified window.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \fi-720\li720\sl240\slmult0\widctlpar {\f2 +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} menu_help}}{\b\f2 Help menu commands}{\f2 +\par +\par The Help menu offers the following commands, which provide you assistance with this application: +\par +\par }\trowd \trgaph108\trleft-108 \cellx1077\cellx7257 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb Help Topics}{\v\f2 HID_HELP_INDEX}{\f2\uldb \cell }\pard \fi-720\li720\sl240\slmult0\widctlpar\intbl {\f2 +Offers you an index to topics on which you can get help.\cell }\pard \widctlpar\intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1077\cellx7257 \pard \sl240\slmult0\widctlpar\intbl {\f2\uldb About}{\v\f2 HID_APP_ABOUT}{\f2\uldb \cell }\pard +\fi-720\li720\sl240\slmult0\widctlpar\intbl {\f2 Displays the version number of this application.\cell }\pard \widctlpar\intbl {\f2 \row }\pard \fi-720\li720\sl240\slmult0\widctlpar {\f2 +\par +\par }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_FILE_NEW}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 $ +{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 $} File New command}}{\f2 }{\b\f2 New command (File menu)}{\f2 +\par +\par Use this command to create a new document in <>. Select the type of new file you want to create in the }{\f2\uldb File New dialog box}{\v AFX_HIDD_NEWTYPEDLG}. {\f2 +<< Remove previous sentence if your application supports only one document type. >> +\par +\par You can open an existing document with the }{\f2\uldb Open command}{\v HID_FILE_OPEN}{\f2 . +\par +\par }{\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Toolbar:\tab \{bmc filenew.bmp\} +\par Keys:\tab CTRL+N +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDD_NEWTYPEDLG}}{\b\f2 File New dialog box +\par }{\f2 +\par << Delete this help topic if your application supports only one document type. >> +\par +\par Specify the type of document you wish to create: +\par << List your application's document types here >>\page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_FILE_OPEN}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{ +\cs15\fs16\up6 ${\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 $} File Open command}}{\f2 }{\b\f2 Open command (File menu)}{\f2 +\par +\par Use this command to open an existing document in a new window. You can open multiple documents at once. Use the Window menu to switch among the multiple open documents. See }{\f2\uldb Window 1, 2, ... command}{\v\f2 HID_WINDOW_ALL}{\f2 . +\par +\par You can create new documents with the }{\f2\uldb New command}{\v HID_FILE_NEW}{\f2 . +\par +\par }{\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Toolbar:\tab \{bmc fileopen.bmp\} +\par Keys:\tab CTRL+O +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 +\par }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDD_FILEOPEN}}{\b\f2 File Open dialog box +\par }{\f2 +\par The following options allow you to specify which file to open: +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 File Name +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Type or select the filename you want to open. This box lists files with the extension you select in the List Files of Type box. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 List Files of Type +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Select the type of file you want to open: +\par << List your application's file types here. >> +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Drives +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Select the drive in which <> stores the file that you want to open. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Directories +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Select the directory in which <> stores the file that you want to open. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Network... +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Choose this button to connect to a network location, assigning it a new drive letter. +\par +\par }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_FILE_CLOSE}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 $ +{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 $} File Close command}}{\f2 }{\b\f2 Close command (File menu)}{\f2 +\par +\par Use this command to close all windows containing the active document. <> suggests that you save changes to your document before you close it. If you close a document without saving, you lose all changes made since the last time you saved it. B +efore closing an untitled document, <> displays the }{\f2\uldb Save As dialog box}{\v AFX_HIDD_FILESAVE}{\f2 and suggests that you name and save the document. +\par +\par You can also close a document by using the Close icon on the document's window, as shown below: +\par \{bml scmenu.bmp\} +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_FILE_SAVE}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16\widctlpar +\fs20 {\cs15\fs16\up6 $} File Save command}}{\f2 }{\b\f2 Save command (File menu)}{\f2 +\par +\par Use this command to save the active document to its current name and directory. When you save a document for the first time, <> displays the }{\f2\uldb Save As dialog box}{\v AFX_HIDD_FILESAVE}{\f2 + so you can name your document. If you want to change the name and directory of an existing document before you save it, choose the }{\f2\uldb Save As command}{\v HID_FILE_SAVE_AS}{\f2 . +\par +\par }{\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Toolbar:\tab \{bmc filesave.bmp\} +\par Keys:\tab CTRL+S +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_FILE_SAVE_AS}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain +\s16\widctlpar \fs20 {\cs15\fs16\up6 $} File Save As command}}{\f2 }{\b\f2 Save As command (File menu)}{\f2 +\par +\par Use this command to save and name the active document. <> displays the }{\f2\uldb Save As dialog box}{\v AFX_HIDD_FILESAVE}{\f2 so you can name your document. +\par +\par To save a document with its existing name and directory, use the }{\f2\uldb Save command}{\v HID_FILE_SAVE}{\f2 . +\par +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_FILE_SEND_MAIL}}{\b\f2 Send command (File menu)}{\f2 +\par +\par Use this command to send the active document through electronic mail. This command presents a mail window with the active document attached to it. You may then fill out the To: field, Subject: field, etc., and add text to the body of the message if you +wish. When you are finished you may click the "Send" button to send the message. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDD_FILESAVE}}{\b\f2 File Save As dialog box +\par }{\f2 +\par The following options allow you to specify the name and location of the file you're about to save: +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 File Name +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 +Type a new filename to save a document with a different name. A filename can contain up to eight characters and an extension of up to three characters. <> adds the extension you specify in the Save File As Type box. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Drives +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Select the drive in which you want to store the document. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Directories +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Select the directory in which you want to store the document. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Network... +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Choose this button to connect to a network location, assigning it a new drive letter. +\par +\par }\pard \sl240\slmult0\widctlpar {\f2 << Add other File Save As dialog box options depending on which ones your application chooses via the OFN_ flags of the OPENFILENAME structure used by the CFileDialog. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 #} HID_FILE_MRU_FILE1}}{\f2 }{\cs15\fs16\up6 K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote +\pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 $} File 1, 2, 3, 4 command}}{\f2 }{\b\f2 1, 2, 3, 4 command (File menu)}{\f2 +\par +\par Use the numbers and filenames listed at the bottom of the File menu to open the last four documents you closed. Choose the number that corresponds with the document you want to open. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_APP_EXIT}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} exit}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16\widctlpar \fs20 { +\cs15\fs16\up6 $} File Exit command}}{\f2 }{\b\f2 Exit command (File menu)}{\f2 +\par +\par Use this command to end your <> session. You can also use the Close command on the application Control menu. <> prompts you to save documents with unsaved changes. +\par } +\par {\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Mouse:\tab Double-click the application's Control menu button. +\par \tab \{bmc appexit.bmp\} +\par Keys:\tab ALT+F4 +\par }\pard \sl240\slmult0\widctlpar \page {\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_UNDO}}{\b\f2 Undo/Can't Undo command (Edit menu)}{\f2 +\par +\par << Your application's user interface for Undo may differ from the one described below. Modify this help text accordingly. >> +\par +\par Use this command to reverse the last editing action, if possible. The name of the command changes, depending on what the last action was. The Undo command changes to Can't Undo on the menu if you cannot reverse your last action. +\par +\par }{\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Toolbar:\tab \{bmc editundo.bmp\} +\par Keys:\tab CTRL+Z or +\par \tab ALT-BACKSPACE\tab +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_REDO}}{\b\f2 Redo command (Edit menu)}{\f2 +\par +\par << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_CUT}}{\b\f2 Cut command (Edit menu)}{\f2 +\par +\par Use this command to remove the currently selected data from the document and put it on the clipboard. This command is unavailable if there is no data currently selected. +\par +\par Cutting data to the clipboard replaces the contents previously stored there. +\par +\par }{\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Toolbar:\tab \{bmc editcut.bmp\} +\par Keys:\tab CTRL+X +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_COPY}}{\b\f2 Copy command (Edit menu)}{\f2 +\par +\par Use this command to copy selected data onto the clipboard. This command is unavailable if there is no data currently selected. +\par +\par Copying data to the clipboard replaces the contents previously stored there. +\par +\par }{\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Toolbar:\tab \{bmc editcopy.bmp\} +\par Keys:\tab CTRL+C +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_PASTE}}{\b\f2 Paste command (Edit menu)}{\f2 +\par +\par Use this command to insert a copy of the clipboard contents at the insertion point. This command is unavailable if the clipboard is empty. +\par +\par }{\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Toolbar:\tab \{bmc editpast.bmp\} +\par Keys:\tab CTRL+V +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_VIEW_TOOLBAR}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} toolbar}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16\widctlpar \fs20 +{\cs15\fs16\up6 $} View Toolbar command}}{\f2 }{\b\f2 Toolbar command (View menu)}{\f2 +\par +\par Use this command to display and hide the Toolbar, which includes buttons for some of the most common commands in <>, such as File Open. A check mark appears next to the menu item when the Toolbar is displayed. +\par +\par See }{\f2\uldb Toolbar}{\v\f2 AFX_HIDW_TOOLBAR}{\f2 for help on using the toolbar. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDW_TOOLBAR}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} toolbar}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16\widctlpar \fs20 +{\cs15\fs16\up6 $} toolbar}}{\f2 }{\b\f2 Toolbar}{\f2 +\par \{bml hlptbar.bmp\} +\par +\par The toolbar is displayed across the top of the application window, below the menu bar. The toolbar provides quick mouse access to many tools used in <>, +\par +\par To hide or display the Toolbar, choose Toolbar from the View menu (ALT, V, T). +\par +\par << Add or remove toolbar buttons from the list below according to which ones your application offers. >> +\par +\par }\pard \sl240\slmult0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \tx1080 {\b\f2 Click\tab To}{\f2 +\par }\pard \fi-1080\li1080\sl240\slmult0\widctlpar\tx1080 {\f2 \{bmc filenew.bmp\}\tab Open a new document. +\par +\par \{bmc fileopen.bmp\}\tab Open an existing document. <> displays the Open dialog box, in which you can locate and open the desired file. +\par +\par \{bmc filesave.bmp\}\tab Save the active document or template with its current name. If you have not named the document, <> displays the Save As dialog box. +\par +\par \{bmc fileprnt.bmp\}\tab Print the active document. +\par +\par \{bmc editcut.bmp\}\tab Remove selected data from the document and stores it on the clipboard. +\par +\par \{bmc editcopy.bmp\}\tab Copy the selection to the clipboard. +\par +\par \{bmc editpast.bmp\}\tab Insert the contents of the clipboard at the insertion point. +\par +\par \{bmc editundo.bmp\}\tab Reverse the last editing. Note: You cannot undo some actions. +\par +\par \{bmc recfirst.bmp\}\tab Go to the first record in the current selection. +\par +\par \{bmc recprev.bmp\}\tab Go to the previous record in the current selection. +\par +\par \{bmc recnext.bmp\}\tab Go to the next record in the current selection. +\par +\par \{bmc reclast.bmp\}\tab Go to the last record in the current selection. +\par +\par }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_VIEW_STATUS_BAR}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} status bar}}{\f2 }{\cs15\fs16\up6 $ +{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} View Status Bar Command}}{\b\f2 Status Bar command (View menu) +\par }{\f2 +\par Use this command to display and hide the Status Bar, which describes the action to be executed by the selected menu item or depressed toolbar button, and keyboard latch state. A check mark appears next to the menu item when the Status Bar is displayed. + +\par +\par See }{\f2\uldb Status Bar}{\v\f2 AFX_HIDW_STATUS_BAR}{\f2 for help on using the status bar. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDW_STATUS_BAR}K{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 K} status bar}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \sl240\slmult0 +\widctlpar \fs20 {\cs15\fs16\up6 $} status bar}}{\b\f2 Status Bar}{\f2 +\par \{bml hlpsbar.bmp\} +\par +\par The status bar is displayed at the bottom of the <> window. To display or hide the status bar, use the Status Bar command in the View menu. +\par +\par The left area of the status bar describes actions of menu items as you use the arrow keys to navigate through menus. This area similarly shows messages that describe the actions of toolbar buttons as you depress them, before releasing them. If after vie +wing the description of the toolbar button command you wish not to execute the command, then release the mouse button while the pointer is off the toolbar button. +\par +\par The right areas of the status bar indicate which of the following keys are latched down: +\par +\par }\pard \sl240\slmult0\widctlpar\tx1440 {\b\f2 Indicator\tab Description}{\f2 +\par }\pard \fi-1440\li1440\sa120\sl240\slmult0\widctlpar\tx1440 {\f2 CAP\tab The Caps Lock key is latched down. +\par NUM\tab The Num Lock key is latched down. +\par SCRL\tab The Scroll Lock key is latched down. +\par }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_WINDOW_NEW}}{\b\f2 New command (Window menu)}{\f2 +\par +\par Use this command to open a new window with the same contents as the act +ive window. You can open multiple document windows to display different parts or views of a document at the same time. If you change the contents in one window, all other windows containing the same document reflect those changes. When you open a new w +indow, it becomes the active window and is displayed on top of all other open windows. +\par +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_WINDOW_CASCADE}}{\b\f2 Cascade command (Window menu)}{\f2 +\par +\par Use this command to arrange multiple opened windows in an overlapped fashion. +\par +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_WINDOW_TILE}}{\b\f2 Tile command (Window menu)}{\f2 +\par +\par Use this command to arrange multiple opened windows in a non-overlapped fashion. +\par +\par +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_WINDOW_TILE_HORZ}}{\b\f2 Tile Horizontal command (Window menu)}{\f2 +\par +\par Use this command to vertically arrange multiple opened windows in a non-overlapped fashion. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_WINDOW_TILE_VERT}}{\b\f2 Tile Vertical command (Window menu)}{\f2 +\par +\par Use this command to arrange multiple opened windows side by side. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_WINDOW_ARRANGE}}{\b\f2 Window Arrange Icons Command}{\f2 +\par +\par Use this command to arrange the icons for minimized windows at the bottom of the main window. If there is an open document window at the bottom of the main window, then some or all of the icons may not be visible because they will be underneath this docu +ment window.\page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_WINDOW_SPLIT}}{\b\f2 Split Command (Window menu) +\par +\par }{\f2 Use this command to split the active window into panes. You may then use the mouse or the keyboard arrows to move the splitter bars. When you are finished, press the mouse button or enter to le +ave the splitter bars in their new location. Pressing escape keeps the splitter bars in their original location. << In a single document interface application, this command will appear on the View menu. >>\page }{\cs15\fs16\up6 #{\footnote \pard\plain +\sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_WINDOW_ALL}}{\b\f2 1, 2, ... command (Window menu)}{\f2 +\par +\par <> displays a list of currently open document windows at the bottom of the Window menu. A check mark appears in front of the document name of the active window. Choose a document from this list to make its window active. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_HELP_INDEX}}{\b\f2 Index command (Help menu) +\par }{\f2 +\par Use this command to display the opening screen of Help. From the opening screen, you can jump to step-by-step instructions for using <> and various types of reference information. +\par +\par Once you open Help, you can click the Contents button whenever you want to return to the opening screen. +\par +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_HELP_USING}}{\b\f2 Using Help command (Help menu) +\par }{\f2 +\par Use this command for instructions about using Help. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_APP_ABOUT}}{\b\f2 About command (Help menu) +\par }{\f2 +\par Use this command to display the copyright notice and version number of your copy of <>. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_CONTEXT_HELP}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Help Using Help Command}}{\b\f2 Context Help command +\par }{\f2 \{bml curhelp.bmp\} +\par +\par Use the Context Help command to obtain help on some portion of <>. When you choose the Toolbar's Context Help button, the mouse pointer will change to an arrow and question mark. Then click somewhere in the <> window, such as another T +oolbar button. The Help topic will be shown for the item you clicked. +\par +\par }{\b\f2 Shortcut +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Keys:\tab SHIFT+F1 +\par }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_HT_CAPTION}}{\b\f2 Title Bar} +\par +\par {\f2 << Show your application's title bar here. >> +\par +\par }\pard\plain \s42\fi-360\li360\widctlpar\tx360 \f7\fs20 {\f2 The title bar is located along the top of a window. It contains the name of the application and document. +\par }\pard\plain \widctlpar \fs20 {\f2 +\par }\pard\plain \s42\fi-360\li360\widctlpar\tx360 \f7\fs20 {\f2 To move the window, drag the title bar. Note: You can also move dialog boxes by dragging their title bars. +\par }\pard\plain \widctlpar \fs20 {\f2 +\par }\pard \fi-360\li360\widctlpar\tx360 {\f2 A title bar may contain the following elements: +\par }\pard\plain \s41\fi-360\li360\sb40\sa40\widctlpar\tx360 \f7\fs20 {\f2 \{bmc bullet.bmp\}\tab Application Control-menu button +\par \{bmc bullet.bmp\}\tab Document Control-menu button +\par \{bmc bullet.bmp\}\tab Maximize button +\par \{bmc bullet.bmp\}\tab Minimize button +\par \{bmc bullet.bmp\}\tab Name of the application +\par \{bmc bullet.bmp\}\tab Name of the document +\par \{bmc bullet.bmp\}\tab Restore button +\par }\pard\plain \sl240\slmult0\widctlpar \fs20 {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 #} scrollbars}}{\f2 }{\b\f2 Scroll bars}{\f2 +\par +\par Displayed at the right and bottom edges of the document window. The scroll boxes inside the scroll bars indicate your vertical and horizontal location in the document. You can use the mouse to scroll to other parts of the document. +\par +\par << Describe the actions of the various parts of the scrollbar, according to how they behave in your application. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_SIZE}}{\b\f2 Size command (System menu)} +\par +\par {\f2 Use this command to display a four-headed arrow so you can size the active window with the arrow keys. +\par \{bml curarw4.bmp\} +\par +\par After the pointer changes to the four-headed arrow: +\par }\pard \fi-360\li360\sb60\sl240\slmult0\widctlpar {\f2 1.\tab Press one of the DIRECTION keys (left, right, up, or down arrow key) to move the pointer to the border you want to move. +\par 2.\tab Press a DIRECTION key to move the border. +\par 3.\tab Press ENTER when the window is the size you want. +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par Note: This command is unavailable if you maximize the window. +\par } +\par {\b\f2 Shortcut}{\b +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Mouse:\tab Drag the size bars at the corners or edges of the window. +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 +\par }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_MOVE}}{\b\f2 Move command (Control menu) +\par }{\f2 +\par Use this command to display a four-headed arrow so you can move the active window or dialog box with the arrow keys. +\par \{bmc curarw4.bmp\} +\par +\par Note: This command is unavailable if you maximize the window. +\par +\par }{\b\f2 Shortcut +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Keys:\tab CTRL+F7 +\par +\par }\pard \sl240\slmult0\widctlpar\tx1440 {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_MINIMIZE}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} System Minimize Command} +}{\b\f2 Minimize command (application Control menu) +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par Use this command to reduce the <> window to an icon. +\par }\pard \fi-360\li360\sl240\slmult0\widctlpar {\b +\par }{\b\f2 Shortcut}{\f2 +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Mouse:\tab Click the minimize icon \{bmc scmin.bmp\} on the title bar. +\par Keys:\tab ALT+F9 +\par }\pard \fi-360\li1080\sl240\slmult0\widctlpar +\par \pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_MAXIMIZE}}{\b\f2 Maximize command (System menu) +\par }{\f2 +\par Use this command to enlarge the active window to fill the available space. +\par }\pard \fi-360\li360\sl240\slmult0\widctlpar {\b\f2 +\par Shortcut}{\f2 +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Mouse:\tab Click the maximize icon \{bmc scmax.bmp\} on the title bar; or double-click the title bar. +\par Keys:\tab CTRL+F10 enlarges a document window. +\par }\pard \fi-360\li1080\sl240\slmult0\widctlpar +\par \pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_NEXTWINDOW}}{\b\f2 Next Window command (document Control menu) +\par }{\f2 +\par Use this command to switch to the next open document window. <> determines which window is next according to the order in which you opened the windows. +\par +\par }{\b\f2 Shortcut +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Keys:\tab CTRL+F6 +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_PREVWINDOW}}{\b\f2 Previous Window command (document Control menu) +\par }{\f2 +\par Use this command to switch to the previous open document window. <> determines which window is previous according to the order in which you opened the windows. +\par +\par }{\b\f2 Shortcut +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Keys:\tab SHIFT+CTRL+F6 +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_CLOSE}}{\b\f2 Close command (Control menus) +\par }{\f2 +\par Use this command to close the active window or dialog box. +\par +\par Double-clicking a Control-menu box is the same as choosing the Close command. +\par \{bml appexit.bmp\} +\par +\par Note: If you have multiple windows open for a single document, the Close command on the document Control menu closes only one window at a time. You can close all windows at once with the Close command on the File menu. +\par +\par }{\b\f2 Shortcuts +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Keys: \tab CTRL+F4 closes a document window +\par \tab ALT+F4 closes the <> window or dialog box +\par }\pard \sl240\slmult0\widctlpar {\f2 \tab \tab \tab \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_RESTORE}}{\b\f2 Restore command (Control menu) +\par }{\f2 +\par Use this command to return the active window to its size and position before you chose the Maximize or Minimize command. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_SC_TASKLIST}}{\b\f2 Switch to command (application Control menu) +\par }{\f2 +\par Use this command to display a list of all open applications. Use this "Task List" to switch to or close an application on the list. +\par +\par }{\b\f2 Shortcut +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Keys:\tab CTRL+ESC +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par }{\b\f2 Dialog Box Options +\par }{\f2 When you choose the Switch To command, you will be presented with a dialog box with the following options: +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Task List +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Select the application you want to switch to or close. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Switch To +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Makes the selected application active. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 End Task +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Closes the selected application. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Cancel +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Closes the Task List box. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Cascade +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Arranges open applications so they overlap and you can see each title bar. This option does not affect applications reduced to icons. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Tile +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Arranges open applications into windows that do not overlap. This option does not affect applications reduced to icons. +\par }\pard \sb60\sl240\slmult0\widctlpar {\b\f2 Arrange Icons +\par }\pard \li360\sl240\slmult0\widctlpar {\f2 Arranges the icons of all minimized applications across the bottom of the screen. +\par }\pard \sl240\slmult0\widctlpar {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_VIEW_RULER}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} View Ruler Command}}{\b\f2 +Ruler command (View menu) +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDD_FONT}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Choose Font Dialog}}{\b\f2 Choose Font dialog box +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDD_COLOR}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Choose Color Dialog}}{\b\f2 Choose Color dialog box +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_FIND}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Edit Find Command}}{\b\f2 Find command (Edit menu) +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDD_FIND}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Find Dialog}}{\b\f2 Find dialog box +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_REPLACE}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Edit Replace Command}}{\b\f2 Replace command (Edit menu) +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDD_REPLACE}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Replace Dialog}}{\b\f2 Replace dialog box +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_REPEAT}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Edit Repeat Command}}{\b\f2 Repeat command (Edit menu) +\par +\par }{\f2 Use this command to repeat the last editing command carried out. The Repeat menu item changes to Can't Repeat if you cannot repeat your last action. +\par +\par }{\b\f2 Shortcut +\par }\pard \fi-1080\li1440\sl240\slmult0\widctlpar\tx1440 {\f2 Key:\tab F4 +\par }\pard \sl240\slmult0\widctlpar {\f2 +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_CLEAR}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Edit Clear Command}}{\b\f2 Clear command (Edit menu) +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_EDIT_CLEAR_ALL}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Edit Clear All}}{\b\f2 Clear All command (Edit menu) +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_NEXT_PANE}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Next Pane Command}}{\b\f2 Next Pane +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_PREV_PANE}${\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 $} Prev Pane Command}}{\b\f2 Prev Pane +\par +\par }{\f2 << Write application-specific help here. >> +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HIDR_DOC1TYPE}}{\b\f2 Modifying the Document +\par }{\f2 +\par << Write application-specific help here that provides an overview of how the user should modify a document using your application. +\par +\par If your application supports multiple document types and you want to have a distinct help topic for each, then use the help context i.d. generated by running the MAKEHELP.BAT file produced by AppWizard. Alternatively, run MAKEHM as follows: +\par +\par \tab makehm IDR_HIDR_,0x2000 resource.h +\par +\par If the IDR_ symbol for one of your document types is, for example, IDR_CHARTTYPE, then the help context i.d. generated by MAKEHM will be HIDR_CHARTTYPE. +\par +\par Note, AppWizard defines the HIDR_DOC1TYPE help context i.d. used by this help topic for the first document type supported by your appl +ication. AppWizard produces an alias in the .HPJ file for your application, mapping HIDR_DOC1TYPE to the HIDR_ produced by MAKEHM for that document type. >> +\par +\par \page +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #} HID_HT_NOWHERE}}{\b\f2 No Help Available} +\par +\par {\f2 No help is available for this area of the window. +\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 #} AFX_HIDP_default +\par }}{\f2 }{\b\f2 No Help Available +\par } +\par {\f2 No help is available for this message box. +\par } +\par {\f2 << If you wish to author help specific + to each message box prompt, then remove the AFX_HIDP_xxx values from the [ALIAS] section of your .HPJ file, and author a topic for each AFX_HIDP_xxx value. For example, AFX_HIDP_INVALID_FILENAME is the help topic for the Invalid Filename message box. >> + +\par +\par }\pard \widctlpar +\par } \ No newline at end of file diff --git a/hlp/AfxPrint.rtf b/hlp/AfxPrint.rtf new file mode 100644 index 0000000..d24adbc --- /dev/null +++ b/hlp/AfxPrint.rtf @@ -0,0 +1,98 @@ +{\rtf1\ansi \deff0\deflang1024{\fonttbl{\f0\froman Times New Roman;}{\f1\froman Symbol;}{\f2\fswiss Arial;}{\f3\froman Tms Rmn;}{\f4\fswiss Helv;}{\f5\fswiss Helvetica;}{\f6\fswiss MS Sans Serif;}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue127;\red0\green127\blue127;\red0\green127\blue0; +\red127\green0\blue127;\red127\green0\blue0;\red127\green127\blue0;\red127\green127\blue127;\red192\green192\blue192;}{\stylesheet{\s244 \f3\fs16\up6\lang1033 \sbasedon0\snext0 footnote reference;}{\s245 \f3\fs20\lang1033 +\sbasedon0\snext245 footnote text;}{\s246\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 9;}{\s247\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 8;}{\s248\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 7;}{\s249\li720 +\f3\fs20\ul\lang1033 \sbasedon0\snext255 heading 6;}{\s250\li720 \b\f3\fs20\lang1033 \sbasedon0\snext255 heading 5;}{\s251\li360 \f3\ul\lang1033 \sbasedon0\snext255 heading 4;}{\s252\li360 \b\f3\lang1033 \sbasedon0\snext255 heading 3;}{\s253\sb120 +\b\f4\lang1033 \sbasedon0\snext0 heading 2;}{\s254\sb240 \b\f4\ul\lang1033 \sbasedon0\snext0 heading 1;}{\s255\li720 \f3\fs20\lang1033 \sbasedon0\snext255 Normal Indent;}{\f3\fs20\lang1033 \snext0 Normal;}{\s2\fi-240\li480\sb80\tx480 \f5\lang1033 +\sbasedon0\snext2 nscba;}{\s3\fi-240\li240\sa20 \f5\lang1033 \sbasedon0\snext3 j;}{\s4\li480\sa20 \f5\lang1033 \sbasedon0\snext4 ij;}{\s5\sb80\sa20 \f5\lang1033 \sbasedon0\snext5 btb;}{\s6\fi-240\li2400\sb20\sa20 \f5\fs20\lang1033 \sbasedon0\snext6 ctcb;} +{\s7\fi-240\li480\sa40\tx480 \f5\lang1033 \sbasedon0\snext7 ns;}{\s8\sa120 \f5\fs28\lang1033 \sbasedon0\snext8 TT;}{\s9\fi-240\li2400\sa20 \f5\lang1033 \sbasedon0\snext9 crtj;}{\s10\fi-240\li480\tx480 \f5\lang1033 \sbasedon0\snext10 nsca;}{\s11\sa20 +\f5\lang1033 \sbasedon0\snext11 bt;}{\s12\li240\sb120\sa40 \f5\lang1033 \sbasedon0\snext12 Hf;}{\s13\li240\sb120\sa40 \f5\lang1033 \sbasedon0\snext13 Hs;}{\s14\li480\sb120\sa40 \f5\lang1033 \sbasedon0\snext14 RT;}{\s15\fi-2160\li2160\sb240\sa80\tx2160 +\f5\lang1033 \sbasedon0\snext15 c;}{\s16\li2160\sa20 \f5\lang1033 \sbasedon0\snext16 ct;}{\s17\li240\sa20 \f5\lang1033 \sbasedon0\snext17 it;}{\s18\li480 \f5\fs20\lang1033 \sbasedon0\snext18 nsct;}{\s19\fi-160\li400\sb80\sa40 \f5\lang1033 +\sbasedon0\snext19 nscb;}{\s20\fi-2640\li2880\sb120\sa40\brdrb\brdrs\brdrw15 \brdrbtw\brdrs\brdrw15 \tx2880 \f5\lang1033 \sbasedon0\snext20 HC2;}{\s21\fi-2640\li2880\sb120\sa20\tx2880 \f5\lang1033 \sbasedon0\snext21 C2;}{\s22\fi-240\li2400\sa20 +\f5\fs20\lang1033 \sbasedon0\snext22 ctc;}{\s23\li2160\sb160 \f5\lang1033 \sbasedon0\snext23 crt;}{\s24\li480\sb20\sa40 \f5\lang1033 \sbasedon0\snext24 or;}{\s25\fi-259\li360\sb40\sa40\tx360 \f6\fs20\lang1033 \sbasedon0\snext25 Ln1;}{\s26\li115\sb80\sa80 +\f6\fs20\lang1033 \sbasedon0\snext0 *Intro;}{\s27\li115\sb80\sa80\keepn \b\f6\lang1033 \sbasedon252\snext26 *Title;}{\s28\fi-245\li360\sb80 \f6\fs20\lang1033 \snext28 *Jl;}{\s29\li360\sb40\sa40 \f6\fs20\lang1033 \snext0 Lp1;}{ +\s30\fi-1800\li1915\sb60\sl-240\tx1915 \f6\fs20\lang1033 \sbasedon0\snext30 Tph;}{\s31\li115\sb120\sa80 \b\f6\fs20\lang1033 \snext25 Proch;}}{\info{\title AFXPRINT}{\subject MFC Print RTF Help}{\author AFX}{\creatim\yr1992\mo10\dy7\hr12\min33}{\version1} +{\edmins46}{\nofpages1}{\nofwords65536}{\nofchars65536}{\vern16433}}\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0 \widowctrl\ftnbj \sectd \linex0\endnhere \pard\plain \sl240 \f3\fs20\lang1033 {\f4 \page }{\f4 #{\footnote +\pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 $} File Print command} +}{\f4 }{\b\f4 Print command (File menu)}{\b\f4 +\par }{\f4 +\par }{\f4 Use this command to print a document. This command presents a }{\f4\uldb Print dialog box}{\v AFX_HIDD_PRINT}{\f4 +, where you may specify the range of pages to be printed, the number of copies, the destination printer, and other printer setup options.}{\b\f4 +\par }{\b\f4 +\par }{\b\f4 Shortcuts}{\b\f4 +\par }\pard \fi-1080\li1440\sl240\tx1440 {\f4 Toolbar:}{\f4 \tab }{\f4 \{}{\f4 bmc }{\f4 fileprnt.bmp}{\f4 \}}{\f4 +\par }{\f4 Keys:}{\f4 \tab }{\f4 CTRL+P}{\f4 +\par }\pard \sl240 {\f4 +\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINT}}{\b\f4 Print }{\b\f4 dialog box}{\b\f4 +\par }{\f4 +\par }{\f4 The following options allow you to specify how the document should be printed:}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Printer}{\b\f4 +\par }\pard \li360\sl240 {\f4 This is the active printer and printer connection. Choose the Setup option to change the printer and printer connection.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Setup}{\b\f4 +\par }\pard \li360\sl240 {\f4 Displays a }{\f4\uldb Print Setup dialog box}{\v AFX_HIDD_PRINTSETUP}{\f4 , so you can select a printer and printer connection.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Print Range}{\b\f4 +\par }\pard \li360\sl240 {\f4 Specify the pages you want to print:}{\f4 +\par }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 All}{\b\f4 \cell }{\f4 Prints the entire document.}{\f4 \cell }\pard \intbl {\f4 \row }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 Selection}{\b\f4 +\cell }{\f4 Prints the currently selected text.}{\f4 \cell }\pard \intbl {\f4 \row }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 Pages}{\b\f4 \cell }{\f4 Prints the range of pages you specify in }{\f4 the From and To boxes.}{ +\f4 \cell }\pard \intbl {\f4 \row }\pard \sb60\sl240 {\b\f4 Copies}{\b\f4 +\par }\pard \li360\sl240 {\f4 Specify the number of copies you want to print for the above page range.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Collate Copies}{\b\f4 +\par }\pard \li360\sl240 {\f4 Prints copies in page number order, instead of separated multiple copies of each page.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Print Quality}{\b\f4 +\par }\pard \li360\sl240 {\f4 Select the quality of the printing. Generally, lower quality printing takes less time to produce.}{\f4 +\par }\pard \sl240 {\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINTDLG}}{\b\f4 P}{\b\f4 rint Progress Dialog}{\b\f4 +\par }{\f4 +\par }{\f4 The Printing dialog box is shown during the time that <> is sending output to the printer. The page number indicates the progre}{\f4 ss of the printing.}{\f4 +\par }{\f4 +\par }{\f4 To abort printing, choose Cancel.}{\f4 +\par }{\f4 +\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT_PREVIEW}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245 +\f3\fs20\lang1033 {\fs16\up6 $} File Print Preview command}}{\f4 }{\b\f4 Print Preview command (File menu)}{\f4 +\par }{\f4 +\par }{\f4 Use this command to display the active document as it would appear when printed. When you choose this command, the main window will be replaced with a print preview window in which one or two pages will be displayed in their printed format. The }{ +\f4\uldb print preview toolbar}{\v\f4 AFX_HIDW_PREVIEW_BAR}{\f4 offers you options to view either one or two pages at a time; move back and forth through the document; zoom in and out of pages; and initiate a print job.}{\f4 +\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDW_PREVIEW_BAR}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245 +\f3\fs20\lang1033 {\fs16\up6 $} print preview toolbar}}{\f4 }{\b\f4 Print Preview toolbar}{\b\f4 +\par }{\f4 +\par }{\f4 The print preview toolbar offers you the following options:}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Print}{\b\f4 +\par }\pard \li360\sl240 {\f4 Bring up the print dialog box, to start a print job.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Next Page}{\b\f4 +\par }\pard \li360\sl240 {\f4 Preview the next printed page.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Prev Page}{\b\f4 +\par }\pard \li360\sl240 {\f4 Preview the previous printed page.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 One Page / Two Page}{\b\f4 +\par }\pard \li360\sl240 {\f4 Preview one or two printed pages at a time.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Zoom In}{\b\f4 +\par }\pard \li360\sl240 {\f4 Take a closer look at the printed page.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Zoom Out}{\b\f4 +\par }\pard \li360\sl240 {\f4 Take a larger look at the printed page.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Close}{\b\f4 +\par }\pard \li360\sl240 {\f4 Return from print preview to the editing window.}{\f4 +\par }\pard \sl240 {\f4 +\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT_SETUP}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245 +\f3\fs20\lang1033 {\fs16\up6 $} File Print Setup command}}{\f4 }{\b\f4 Print Setup command (File menu)}{\b\f4 +\par }{\f4 +\par }{\f4 Use this command to select a printer and a printer connection. This command presents a }{\f4\uldb Print Setup dialog box}{\v AFX_HIDD_PRINTSETUP}{\f4 , where you specify the printer and its connection.}{\b\f4 +\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINTSETUP}}{\b\f4 Print}{\b\f4 Setup dialog box}{\b\f4 +\par }{\f4 +\par }{\f4 The following options allow you to select the destination printer and its connection.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Printer}{\b\f4 +\par }\pard \li360\sl240 {\f4 +Select the printer you want to use. Choose the Default Printer; or choose the Specific Printer option and select one of the current installed printers shown in the box. You install printers and configure ports using the Windows Control Panel. }{\f4 + +\par }\pard \sb60\sl240 {\b\f4 Orientation}{\b\f4 +\par }\pard \li360\sl240 {\f4 Choose Portrait or Landscape.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Paper Size}{\b\f4 +\par }\pard \li360\sl240 {\f4 Select the size of paper that the document is to be printed on.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Paper Source}{\b\f4 +\par }\pard \li360\sl240 {\f4 Some printers offer multiple trays for different paper sources. Specify the tray here.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Options}{\b\f4 +\par }\pard \li360\sl240 {\f4 Displays a dialog box where you can make additional choices about printing, specific to the type of printer you have selected.}{\f4 +\par }\pard \sb60\sl240 {\b\f4 Network...}{\b\f4 +\par }\pard \li360\sl240 {\f4 Choose this button to connect to a network location, assigning it a new drive letter.}{\f4 +\par }\pard \sl240 {\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PAGE_SETUP}}{\f4 ${\footnote \pard\plain \sl240 \f3\fs20\lang1033 $ File Page Setup Command}}{\b\f4 Page Setup command (File menu)}{\b\f4 +\par }{\b\f4 +\par }{\f4 << Write application-specific help here. >>}{\f4 +\par }\pard +\par } \ No newline at end of file diff --git a/hlp/AppExit.bmp b/hlp/AppExit.bmp new file mode 100644 index 0000000..21eee3c Binary files /dev/null and b/hlp/AppExit.bmp differ diff --git a/hlp/Bullet.bmp b/hlp/Bullet.bmp new file mode 100644 index 0000000..f4e1527 Binary files /dev/null and b/hlp/Bullet.bmp differ diff --git a/hlp/CB32.HLP b/hlp/CB32.HLP new file mode 100644 index 0000000..23e6f66 Binary files /dev/null and b/hlp/CB32.HLP differ diff --git a/hlp/CB32.LOG b/hlp/CB32.LOG new file mode 100644 index 0000000..9bcabc5 --- /dev/null +++ b/hlp/CB32.LOG @@ -0,0 +1,196 @@ +Microsoft (R) Help Compiler +HCRTF 4.03.0002 +Copyright (c) Microsoft Corp 1990 - 1995. All rights reserved. +cb32.hpj + HC3037: Warning: D:\Code\CB32\hlp\CB32.hm : + The map value for "HID_VIEW_COLPOS" is the same as the map value for "HID_EDIT_SELECTALL". + HC1002: Note: + Using existing phrase table: CB32.ph. + HC3025: Warning: topic #1 of D:\Code\Cb32\hlp\.\afxcore.rtf : + Jump to undefined Topic ID: "menu_record". + HC3025: Warning: topic #3 of D:\Code\Cb32\hlp\.\afxcore.rtf : + Jump to undefined Topic ID: "HID_OLE_EDIT_LINKS". + HC3025: Warning: topic #3 of D:\Code\Cb32\hlp\.\afxcore.rtf : + Jump to undefined Topic ID: "HID_EDIT_PASTE_LINK". + HC3025: Warning: topic #3 of D:\Code\Cb32\hlp\.\afxcore.rtf : + Jump to undefined Topic ID: "HID_OLE_INSERT_NEW". + HC1010: Note: + The following mapped Topic IDs were not used in any topic: + HIDD_APAGE + HIDD_CPAGE + HIDD_NPAGE + HIDD_OPAGE + HIDD_PPAGE + HID_ENTRY_EDIT + HID_ENTRY_PREF + HID_TBAR_WEB + AFX_HIDP_GET_NOT_SUPPORTED + HID_RECORD_FIRST + HID_EDIT_SELECT_ALL + HID_FILE_UPDATE + AFX_HIDW_RESIZE_BAR + AFX_HIDP_SQL_NO_DATA_FOUND + AFX_HIDP_SQL_EMPTY_COLUMN_LIST + AFX_HIDP_SQL_ODBC_LOAD_FAILED + AFX_HIDP_FAILED_TO_CREATE + HID_TRAY_EXIT + HID_TRAY_SHOW + HID_VIEW_WNDPOS + AFX_HIDD_BUSY + AFX_HIDP_ARCH_NONE + HID_RECORD_LAST + HID_RECORD_NEXT + HID_RECORD_PREV + AFX_HIDD_OBJECTPROPERTIES + HIDD_SETPAGE + HID_DIAL_CELL + HID_DIAL_HOME + HID_DIAL_WORK + HID_ENTRY_ADD + AFX_HIDP_FILE_TOO_MANY_OPEN + HIDD_FIND + AFX_HIDP_FILE_ACCESS_DENIED + HIDD_GETNEW + HID_FILE_SAVE_COPY_AS + AFX_HIDD_CONVERT + AFX_HIDP_ASK_TO_DISCARD + AFX_HIDP_SQL_FIELD_SCHEMA_MISMATCH + AFX_HIDP_SQL_LOCK_MODE_NOT_SUPPORTED + HID_FORMAT_FONT + AFX_HIDP_FILE_HARD_IO + AFX_HIDD_CHANGESOURCE + HID_EDIT_SELECTALL + AFX_HIDP_FILE_NOT_FOUND + AFX_HIDW_DOCKBAR_TOP + AFX_HIDP_DAO_DFX_BIND + HID_TBAR_DIAL + AFX_HIDP_SQL_ODBC_V2_REQUIRED + AFX_HIDP_SQL_NO_ROWS_AFFECTED + HID_OLE_EDIT_CONVERT + AFX_HIDP_SQL_SQL_CONFORMANCE + AFX_HIDD_INSERTOBJECT + HID_URL1 + HID_URL2 + AFX_HIDP_SQL_RECORDSET_READONLY + AFX_HIDP_PARSE_RADIO_BUTTON + HID_EDIT_PASTE_SPECIAL + AFX_HIDP_DAO_ROWTOOSHORT + AFX_HIDP_SQL_INCORRECT_ODBC + AFX_HIDP_NO_ERROR_AVAILABLE + AFX_HIDW_DOCKBAR_BOTTOM + AFX_HIDP_FILE_DIR_FULL + HID_EMAIL_ADD1 + HID_EMAIL_ADD2 + AFX_HIDP_DAO_BADBINDINFO + HID_VIEW_COLSET + AFX_HIDP_SQL_UPDATE_DELETE_FAILED + AFX_HIDP_PARSE_DATETIME + HID_OLE_EDIT_CHANGE_ICON + AFX_HIDP_ARCH_ENDOFFILE + AFX_HIDP_SQL_SQL_NO_TOTAL + AFX_HIDP_SQL_CONNECT_FAIL + AFX_HIDP_SQL_API_CONFORMANCE + HID_OLE_EDIT_PROPERTIES + AFX_HIDP_FILE_DISKFULL + HID_EDIT_FIND_NEXT + AFX_HIDW_DOCKBAR_LEFT + AFX_HIDP_FILE_REMOVE_CURRENT + HID_TBAR_EMAIL + AFX_HIDP_ARCH_BADCLASS + AFX_HIDP_SQL_NO_POSITIONED_UPDATES + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + HID_OLE_VERB_1 + AFX_HIDP_ARCH_BADINDEX + HID_WIZBACK + HID_WIZNEXT + AFX_HIDP_PARSE_CURRENCY + AFX_HIDP_FILE_NONE + AFX_HIDP_FAILED_TO_CONVERT + HID_HELP_FINDER + AFX_HIDP_FILE_EOF + HIDR_TRAYMENU + AFX_HIDP_FILE_LOCKING + AFX_HIDP_SQL_ILLEGAL_MODE + AFX_HIDD_PREVIEW_TOOLBAR + HIDR_CONTEXTMENU + AFX_HIDP_SQL_NO_CURRENT_RECORD + AFX_HIDP_FILE_BAD_PATH + AFX_HIDP_FILE_BAD_SEEK + AFX_HIDP_SQL_ROW_UPDATE_NOT_SUPPORTED + HIDR_CB32TYPE + AFX_HIDP_FAILED_MAPI_LOAD + AFX_HIDP_FAILED_MAPI_SEND + HID_APP_PREFS + AFX_HIDP_FILE_SHARING + HID_IMPORT_CSV + HID_IMPORT_TAB + HID_FILE_PRINT_DIRECT + HID_FILE_IMPORT + AFX_HIDP_SQL_DYNASET_NOT_SUPPORTED + HID_DIAL_FAX + AFX_HIDP_SQL_ROW_FETCH + AFX_HIDP_SET_NOT_SUPPORTED + AFX_HIDD_CHANGEICON + HID_VIEW_FLATBAR + AFX_HIDP_ARCH_BADSCHEMA + AFX_HIDD_FILEBROWSE + AFX_HIDD_EDITLINKS + AFX_HIDP_SQL_DATA_TRUNCATED + HID_INDICATOR_CLOCK + HID_WIZFINISH + AFX_HIDP_INVALID_MAPI_DLL + AFX_HIDD_PREVIEW_SHORTTOOLBAR + AFX_HIDP_DAO_OBJECT_NOT_OPEN + AFX_HIDP_ARCH_WRITEONLY + HID_OLE_EDIT_LINKS + AFX_HIDP_SQL_MULTIPLE_ROWS_AFFECTED + HID_EDIT_PASTE_LINK + AFX_HIDP_DAO_ENGINE_INITIALIZATION + AFX_HIDW_DOCKBAR_FLOAT + AFX_HIDW_DOCKBAR_RIGHT + AFX_HIDP_PARSE_BYTE + AFX_HIDP_PARSE_UINT + AFX_HIDP_ARCH_GENERIC + AFX_HIDP_SQL_SNAPSHOT_NOT_SUPPORTED + AFX_HIDD_PASTESPECIAL + AFX_HIDP_FILE_GENERIC + HID_EXPORT_CSV + HID_EXPORT_TAB + AFX_HIDP_FILE_INVALID_FILE + AFX_HIDP_ARCH_READONLY + AFX_HIDP_SQL_RECORDSET_FORWARD_ONLY + HID_OLE_INSERT_NEW + HID_DIAL_PAGER + AFX_HIDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED + HIDW_COMBO + HIDD_COLPAGE + HIDD_CONVERT + AFX_HIDP_DAO_COLUMNUNAVAILABLE + HID_VIEW_FIND_NEXT + HID_EDIT_FIND_COMBO + HID_ENTRY_DELETE +72 Topics +48 Jumps +16 Keywords +21 Bitmaps + + +Created D:\Code\Cb32\hlp\CB32.HLP, 39,625 bytes +Bitmaps: 5,348 bytes +Phrase+Zeck compression decreased help file by 14,330 bytes. +Compile time: 0 minutes, 1 second +2 notes, 5 warnings diff --git a/hlp/CB32.cnt b/hlp/CB32.cnt new file mode 100644 index 0000000..0e8dd48 --- /dev/null +++ b/hlp/CB32.cnt @@ -0,0 +1,9 @@ +:Base CB32.hlp +1 Menus +2 File menu=menu_file +2 Edit menu=menu_edit +2 View menu=menu_view +2 Window menu=menu_window +2 Help menu=menu_help +1 <> +2 <>=main_index diff --git a/hlp/CB32.hm b/hlp/CB32.hm new file mode 100644 index 0000000..3573f13 --- /dev/null +++ b/hlp/CB32.hm @@ -0,0 +1,60 @@ +// MAKEHELP.BAT generated Help Map file. Used by CB32.HPJ. + +// Commands (ID_* and IDM_*) +HID_EDIT_FIND_NEXT 0x103E9 +HID_VIEW_FLATBAR 0x18003 +HID_EDIT_SELECTALL 0x18004 +HID_VIEW_COLPOS 0x18004 +HID_ENTRY_ADD 0x18005 +HID_ENTRY_EDIT 0x18006 +HID_ENTRY_DELETE 0x18007 +HID_FILE_IMPORT 0x18023 +HID_IMPORT_CSV 0x18024 +HID_IMPORT_TAB 0x18025 +HID_EXPORT_CSV 0x18026 +HID_EXPORT_TAB 0x18027 +HID_ENTRY_PREF 0x18028 +HID_APP_PREFS 0x18029 +HID_VIEW_FIND_NEXT 0x1802D +HID_EDIT_FIND_COMBO 0x1802E +HID_VIEW_WNDPOS 0x18031 +HID_VIEW_COLSET 0x18032 +HID_TRAY_SHOW 0x18033 +HID_TRAY_EXIT 0x18034 +HID_DIAL_HOME 0x18036 +HID_DIAL_WORK 0x18037 +HID_DIAL_CELL 0x18038 +HID_DIAL_PAGER 0x18039 +HID_DIAL_FAX 0x1803A +HID_EMAIL_ADD1 0x1803B +HID_EMAIL_ADD2 0x1803C +HID_URL1 0x1803D +HID_URL2 0x1803E +HID_TBAR_DIAL 0x1803F +HID_TBAR_EMAIL 0x18040 +HID_TBAR_WEB 0x18041 +HID_INDICATOR_CLOCK 0x1E706 + +// Prompts (IDP_*) + +// Resources (IDR_*) +HIDR_MAINFRAME 0x20080 +HIDR_CB32TYPE 0x20081 +HIDR_TRAYMENU 0x20090 +HIDR_CONTEXTMENU 0x20091 + +// Dialogs (IDD_*) +HIDD_ABOUTBOX 0x20064 +HIDD_APAGE 0x20083 +HIDD_PPAGE 0x20084 +HIDD_OPAGE 0x20085 +HIDD_NPAGE 0x20086 +HIDD_CONVERT 0x20087 +HIDD_FIND 0x20089 +HIDD_COLPAGE 0x2008B +HIDD_SETPAGE 0x2008D +HIDD_GETNEW 0x20092 +HIDD_CPAGE 0x20093 + +// Frame Controls (IDW_*) +HIDW_COMBO 0x50081 diff --git a/hlp/CB32.hpj b/hlp/CB32.hpj new file mode 100644 index 0000000..085c5aa --- /dev/null +++ b/hlp/CB32.hpj @@ -0,0 +1,61 @@ +[OPTIONS] +LCID=0x409 0x0 0x0 ;English (U.S.) +CONTENTS=main_index +TITLE=CB32 Application Help +COMPRESS=true +WARNING=2 +BMROOT= ..,. +ROOT= ..,. +HLP=CB32.HLP +ERRORLOG=CB32.LOG + +[FILES] +afxcore.rtf +afxprint.rtf + +[ALIAS] +HIDR_MAINFRAME = main_index +HIDD_ABOUTBOX = HID_APP_ABOUT + +HID_HT_SIZE = HID_SC_SIZE +HID_HT_HSCROLL = scrollbars +HID_HT_VSCROLL = scrollbars +HID_HT_MINBUTTON = HID_SC_MINIMIZE +HID_HT_MAXBUTTON = HID_SC_MAXIMIZE +AFX_HIDP_INVALID_FILENAME = AFX_HIDP_default +AFX_HIDP_FAILED_TO_OPEN_DOC = AFX_HIDP_default +AFX_HIDP_FAILED_TO_SAVE_DOC = AFX_HIDP_default +AFX_HIDP_ASK_TO_SAVE = AFX_HIDP_default +AFX_HIDP_FAILED_TO_CREATE_DOC = AFX_HIDP_default +AFX_HIDP_FILE_TOO_LARGE = AFX_HIDP_default +AFX_HIDP_FAILED_TO_START_PRINT = AFX_HIDP_default +AFX_HIDP_FAILED_TO_LAUNCH_HELP = AFX_HIDP_default +AFX_HIDP_INTERNAL_FAILURE = AFX_HIDP_default +AFX_HIDP_COMMAND_FAILURE = AFX_HIDP_default +AFX_HIDP_PARSE_INT = AFX_HIDP_default +AFX_HIDP_PARSE_REAL = AFX_HIDP_default +AFX_HIDP_PARSE_INT_RANGE = AFX_HIDP_default +AFX_HIDP_PARSE_REAL_RANGE = AFX_HIDP_default +AFX_HIDP_PARSE_STRING_SIZE = AFX_HIDP_default +AFX_HIDP_FAILED_INVALID_FORMAT = AFX_HIDP_default +AFX_HIDP_FAILED_INVALID_PATH = AFX_HIDP_default +AFX_HIDP_FAILED_DISK_FULL = AFX_HIDP_default +AFX_HIDP_FAILED_ACCESS_READ = AFX_HIDP_default +AFX_HIDP_FAILED_ACCESS_WRITE = AFX_HIDP_default +AFX_HIDP_FAILED_IO_ERROR_READ = AFX_HIDP_default +AFX_HIDP_FAILED_IO_ERROR_WRITE = AFX_HIDP_default +AFX_HIDP_STATIC_OBJECT = AFX_HIDP_default +AFX_HIDP_FAILED_TO_CONNECT = AFX_HIDP_default +AFX_HIDP_SERVER_BUSY = AFX_HIDP_default +AFX_HIDP_BAD_VERB = AFX_HIDP_default +AFX_HIDP_FAILED_MEMORY_ALLOC = AFX_HIDP_default +AFX_HIDP_FAILED_TO_NOTIFY = AFX_HIDP_default +AFX_HIDP_FAILED_TO_LAUNCH = AFX_HIDP_default +AFX_HIDP_ASK_TO_UPDATE = AFX_HIDP_default +AFX_HIDP_FAILED_TO_UPDATE = AFX_HIDP_default +AFX_HIDP_FAILED_TO_REGISTER = AFX_HIDP_default +AFX_HIDP_FAILED_TO_AUTO_REGISTER = AFX_HIDP_default + +[MAP] +#include +#include diff --git a/hlp/CB32.ph b/hlp/CB32.ph new file mode 100644 index 0000000..2fa67ca --- /dev/null +++ b/hlp/CB32.ph @@ -0,0 +1,320 @@ +(Control +(Edit +(File +(Help +(System +(View +(Window +(application +(document +<< Write application-specific help here. >> +<> +<>, +<>. +AFX_HIDP_xxx +About +AppWizard +Arrange Icons +Bar +Cascade +Choose +Choose this button to connect to a network location, assigning it a new drive letter. +Clear +Close +Commands +Context +Control +Control-menu +Copies +Copy +DIRECTION +Directories +Drives +Exit +File +File Name +File New dialog box +File menu commands +Find +Go to the +HIDR_DOC1TYPE +Help +Horizontal +Icons +Keys: +List +Lock +MAKEHM +Minimize +Modify +Mouse: +Name +Name of the +Network... +New +No Help Available +No help is available for this +Note: This command is unavailable if you maximize the window. +Open +Open a +Pane +Prev +Prev Pane +Preview +Print +Print Setup dialog box +Quality +Remove +Repeat +Replace +Save +Save As dialog box +Scroll +Select +Setup +Shortcut +Shortcuts +Split +Status Bar +Toolbar +Toolbar, +Toolbar: +Undo +Use +Vertical +View +When +Window +Write +according +across +action +action. +actions +active +active. +affect +all +allow +also +and +another +appear +appears +application +application's +application, +application-specific +application. +applications +area +arrange +arrow +assigning +author +available +bar. +bars +before +bottom +box +box. +button +button, +button. +buttons +can +cannot +change +changes +changes. +check +choose +click +clipboard +clipboard. +closes +command +command, +command. +commands, +commands: +connect +connection. +contain +contents +create +current +currently +data +depending +describe +describes +description +destination +determines +dialog +different +directory +display +displayed +displayed. +displays +document +document, +document. +documents +documents. +down. +drive +each +editing +electronic +example, +existing +extension +fashion. +field, +filename +files +first +following +for +four-headed +from +generated +have +help. +here. +hide +i.d. +icon +icons. +indicate +insert +instructions +interface +into +item +its +keyboard +keys +last +latched +letter. +location +location, +location. +main +mark +maximize +may +menu +menu) +menu. +message +minimized +mouse +move +multiple +name. +network +next +non-overlapped +not +number +offers +one +only +open. +opened +opening +option +options +options: +other +overlapped +page +page. +pages +panes. +parts +point. +pointer +presents +previous +previously +print preview toolbar +printed +printed. +printer +printers +printing +printing, +printing. +provides +range +record +reduced +replaces +return +reverse +same +screen +screen. +selected +selected. +selection +selection. +should +shown +single +size +some +specific +specified +specify +splitter +status +stored +stores +such +suggests +supports +switch +that +the +their +then +there +there. +they +this +through +time +time. +title +toolbar. +topic +topics +type +type. +types +unavailable +used +using +various +version +views +want +where +which +will +window, +window. +windows +windows. +wish +with +you +your diff --git a/hlp/CurArw2.bmp b/hlp/CurArw2.bmp new file mode 100644 index 0000000..2fb44fc Binary files /dev/null and b/hlp/CurArw2.bmp differ diff --git a/hlp/CurArw4.bmp b/hlp/CurArw4.bmp new file mode 100644 index 0000000..39fa690 Binary files /dev/null and b/hlp/CurArw4.bmp differ diff --git a/hlp/CurHelp.bmp b/hlp/CurHelp.bmp new file mode 100644 index 0000000..a21ba12 Binary files /dev/null and b/hlp/CurHelp.bmp differ diff --git a/hlp/EditCopy.bmp b/hlp/EditCopy.bmp new file mode 100644 index 0000000..5e1e65e Binary files /dev/null and b/hlp/EditCopy.bmp differ diff --git a/hlp/EditCut.bmp b/hlp/EditCut.bmp new file mode 100644 index 0000000..2c14215 Binary files /dev/null and b/hlp/EditCut.bmp differ diff --git a/hlp/EditPast.bmp b/hlp/EditPast.bmp new file mode 100644 index 0000000..0774f8f Binary files /dev/null and b/hlp/EditPast.bmp differ diff --git a/hlp/EditUndo.bmp b/hlp/EditUndo.bmp new file mode 100644 index 0000000..2791c9b Binary files /dev/null and b/hlp/EditUndo.bmp differ diff --git a/hlp/FileNew.bmp b/hlp/FileNew.bmp new file mode 100644 index 0000000..ac4c76c Binary files /dev/null and b/hlp/FileNew.bmp differ diff --git a/hlp/FileOpen.bmp b/hlp/FileOpen.bmp new file mode 100644 index 0000000..a1ada60 Binary files /dev/null and b/hlp/FileOpen.bmp differ diff --git a/hlp/FilePrnt.bmp b/hlp/FilePrnt.bmp new file mode 100644 index 0000000..f4a94f4 Binary files /dev/null and b/hlp/FilePrnt.bmp differ diff --git a/hlp/FileSave.bmp b/hlp/FileSave.bmp new file mode 100644 index 0000000..3e604b3 Binary files /dev/null and b/hlp/FileSave.bmp differ diff --git a/hlp/HlpSBar.bmp b/hlp/HlpSBar.bmp new file mode 100644 index 0000000..4c06d09 Binary files /dev/null and b/hlp/HlpSBar.bmp differ diff --git a/hlp/HlpTBar.bmp b/hlp/HlpTBar.bmp new file mode 100644 index 0000000..4d454c3 Binary files /dev/null and b/hlp/HlpTBar.bmp differ diff --git a/hlp/RecFirst.bmp b/hlp/RecFirst.bmp new file mode 100644 index 0000000..efe803a Binary files /dev/null and b/hlp/RecFirst.bmp differ diff --git a/hlp/RecLast.bmp b/hlp/RecLast.bmp new file mode 100644 index 0000000..b4eb1fd Binary files /dev/null and b/hlp/RecLast.bmp differ diff --git a/hlp/RecNext.bmp b/hlp/RecNext.bmp new file mode 100644 index 0000000..400839b Binary files /dev/null and b/hlp/RecNext.bmp differ diff --git a/hlp/RecPrev.bmp b/hlp/RecPrev.bmp new file mode 100644 index 0000000..6333692 Binary files /dev/null and b/hlp/RecPrev.bmp differ diff --git a/hlp/ScMenu.bmp b/hlp/ScMenu.bmp new file mode 100644 index 0000000..a9aa217 Binary files /dev/null and b/hlp/ScMenu.bmp differ diff --git a/hlp/Scmax.bmp b/hlp/Scmax.bmp new file mode 100644 index 0000000..f135732 Binary files /dev/null and b/hlp/Scmax.bmp differ diff --git a/hlp/Scmin.bmp b/hlp/Scmin.bmp new file mode 100644 index 0000000..8668f5a Binary files /dev/null and b/hlp/Scmin.bmp differ diff --git a/res/CB32.ico b/res/CB32.ico new file mode 100644 index 0000000..d3ddc49 Binary files /dev/null and b/res/CB32.ico differ diff --git a/res/CB32.rc2 b/res/CB32.rc2 new file mode 100644 index 0000000..4cec319 --- /dev/null +++ b/res/CB32.rc2 @@ -0,0 +1,13 @@ +// +// CB32.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// diff --git a/res/CB32Doc.ico b/res/CB32Doc.ico new file mode 100644 index 0000000..a4f6c0b Binary files /dev/null and b/res/CB32Doc.ico differ diff --git a/res/Toolbar.bmp b/res/Toolbar.bmp new file mode 100644 index 0000000..369b8f8 Binary files /dev/null and b/res/Toolbar.bmp differ diff --git a/res/hand1.cur b/res/hand1.cur new file mode 100644 index 0000000..9d13d2b Binary files /dev/null and b/res/hand1.cur differ