home *** CD-ROM | disk | FTP | other *** search
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // MAINDLG.CPP
- // «Denis CHEVRON, 1993, 1994, All rights reserved
- // Main list handling
- //
- // You can use this sample file as you want.
- //
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "vbxdemo.h"
-
- #include "resources.h"
- #include "3ddemo.h"
- #include "animdemo.h"
- #include "combodem.h"
- #include "editdemo.h"
- #include "fcombode.h"
- #include "gaugedem.h"
- #include "linedemo.h"
- #include "listdemo.h"
- #include "flistdem.h"
- #include "spindemo.h"
- #include "textdemo.h"
- #include "picbtnde.h"
- #include "tabdemo.h"
- #include "ddropdem.h"
-
- #include "maindlg.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- LPSTR szMsgNote = "VBNote is not available at run time!\n\n\
- VBNote is a little static text box specially designed\n\
- to be used in a team, to exchange infos or tips between\n\
- developers and inside the resource itself.\n\n\
- With VBNote, you don' t have to worry about visible or color\n\
- and other properties but, if you use this VBX, you must distribute it\n\
- with your applications!";
-
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainDlg dialog
-
-
- CMainDlg::CMainDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CMainDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CMainDlg)
- m_pMainList = NULL;
- //}}AFX_DATA_INIT
- }
-
- void CMainDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMainDlg)
- DDX_VBList(pDX, IDC_VBLIST1, m_pMainList);
- //}}AFX_DATA_MAP
- }
-
- BEGIN_MESSAGE_MAP(CMainDlg, CDialog)
- //{{AFX_MSG_MAP(CMainDlg)
- ON_VBXEVENT(VBN_DBLCLICK, IDC_VBLIST1, OnDblclickVblist1)
- ON_VBXEVENT(VBN_KEYDOWN, IDC_VBLIST1, OnKeydownVblist1)
- ON_BN_CLICKED(IDABOUT, OnAbout)
- ON_BN_CLICKED(IDHELP, OnHelp)
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainDlg message handlers
-
- BOOL CMainDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- UpdateData( FALSE );
- m_pMainList->GetVBX()->SetRedraw( FALSE );
- m_pMainList->GetVBX()->AddItem( "VBList listbox sample...;8", -1 );
- m_pMainList->GetVBX()->AddItem( "VBFList files listbox sample...;9", -1 );
- m_pMainList->GetVBX()->AddItem( "VBCombo combobox sample...;3", -1 );
- m_pMainList->GetVBX()->AddItem( "VBFCombo files combobox sample...;15", -1 );
- m_pMainList->GetVBX()->AddItem( "VBEdit formatted edit sample...;5", -1 );
- m_pMainList->GetVBX()->AddItem( "VBTab tabbed dialog sample...;13", -1 );
- m_pMainList->GetVBX()->AddItem( "VBSpin spin sample...;12", -1 );
- m_pMainList->GetVBX()->AddItem( "VBGauge gauge sample...;6", -1 );
- m_pMainList->GetVBX()->AddItem( "VBPicBtn pictured button sample...;11", -1 );
- m_pMainList->GetVBX()->AddItem( "VBAnim animated picture sample...;2", -1 );
- m_pMainList->GetVBX()->AddItem( "VBLine line sample...;7", -1 );
- m_pMainList->GetVBX()->AddItem( "VBText static text sample...;14", -1 );
- m_pMainList->GetVBX()->AddItem( "VBNote design time note sample...;10", -1 );
- m_pMainList->GetVBX()->AddItem( "VB3D auto. 3D border sample...;1", -1 );
- m_pMainList->GetVBX()->AddItem( "VBDDrop winfile drag and drop sample...;4", -1 );
- m_pMainList->GetVBX()->SetRedraw( TRUE);
- m_pMainList->SetSel2() = 0L;
- if ( !IsHlpHere() )
- GetDlgItem( IDHELP )->EnableWindow( FALSE );
- return TRUE;//FALSE; // return TRUE unless you set the focus to a control
- }
-
- void CMainDlg::OnDblclickVblist1(UINT, int, CWnd*, LPVOID lp)
- {
- int iListID = m_pMainList->EventDblClkID( lp ); // retrieve the current VBList item number
- switch( iListID )
- {
- case 0: ListDemo = new CListDemo( this );
- ListDemo->DoModal( );
- delete ListDemo;
- break;
- case 1: FListDemo = new CFlistDemo( this );
- FListDemo->DoModal( );
- delete FListDemo;
- break;
- case 2: ComboDemo = new CComboDemo( this );
- ComboDemo->DoModal( );
- delete ComboDemo;
- break;
- case 3: FComboDemo = new CFComboDemo( this );
- FComboDemo->DoModal( );
- delete FComboDemo;
- break;
- case 4: EditDemo = new CEditDemo( this );
- EditDemo->DoModal( );
- delete EditDemo;
- break;
-
- case 5: TabDemo = new CTabDemo( this );
- TabDemo->DoModal( );
- delete TabDemo;
- break;
- case 6: SpinDemo = new CSpinDemo( this );
- SpinDemo->DoModal( );
- delete SpinDemo;
- break;
- case 7: GaugeDemo = new CGaugeDemo( this );
- GaugeDemo->DoModal( );
- delete GaugeDemo;
- break;
- case 8: PicBtnDemo = new CPicBtnDemo( this );
- PicBtnDemo->DoModal( );
- delete PicBtnDemo;
- break;
- case 9: AnimDemo = new CAnimDemo( this );
- AnimDemo->DoModal( );
- delete AnimDemo;
- break;
- case 10: LineDemo = new CLineDemo( this );
- LineDemo->DoModal( );
- delete LineDemo;
- break;
- case 11: TextDemo = new CTextDemo( this );
- TextDemo->DoModal( );
- delete TextDemo;
- break;
- case 12: MessageBox( szMsgNote, "VBX Studio demo...", MB_ICONEXCLAMATION | MB_OK );
- break;
- case 13: VB3DDemo = new C3DDemo( this );
- VB3DDemo->DoModal( );
- delete VB3DDemo;
- break;
- case 14: DDropDemo = new CDDropDemo( this );
- DDropDemo->DoModal( );
- delete DDropDemo;
- break;
- }
-
- }
-
- void CMainDlg::OnKeydownVblist1(UINT, int, CWnd*, LPVOID)
- {
- // TODO: Add your VBX event notification handler code here
- // We use the OnOK instead..
- }
-
- void CMainDlg::OnOK()
- {
- int iListID = m_pMainList->GetCurSel();
- switch( iListID )
- {
- case 0: ListDemo = new CListDemo( this );
- ListDemo->DoModal( );
- delete ListDemo;
- break;
- case 1: FListDemo = new CFlistDemo( this );
- FListDemo->DoModal( );
- delete FListDemo;
- break;
- case 2: ComboDemo = new CComboDemo( this );
- ComboDemo->DoModal( );
- delete ComboDemo;
- break;
- case 3: FComboDemo = new CFComboDemo( this );
- FComboDemo->DoModal( );
- delete FComboDemo;
- break;
- case 4: EditDemo = new CEditDemo( this );
- EditDemo->DoModal( );
- delete EditDemo;
- break;
-
- case 5: TabDemo = new CTabDemo( this );
- TabDemo->DoModal( );
- delete TabDemo;
- break;
- case 6: SpinDemo = new CSpinDemo( this );
- SpinDemo->DoModal( );
- delete SpinDemo;
- break;
- case 7: GaugeDemo = new CGaugeDemo( this );
- GaugeDemo->DoModal( );
- delete GaugeDemo;
- break;
- case 8: PicBtnDemo = new CPicBtnDemo( this );
- PicBtnDemo->DoModal( );
- delete PicBtnDemo;
- break;
- case 9: AnimDemo = new CAnimDemo( this );
- AnimDemo->DoModal( );
- delete AnimDemo;
- break;
- case 10: LineDemo = new CLineDemo( this );
- LineDemo->DoModal( );
- delete LineDemo;
- break;
- case 11: TextDemo = new CTextDemo( this );
- TextDemo->DoModal( );
- delete TextDemo;
- break;
- case 12: MessageBox( szMsgNote, "VBX Studio demo...", MB_ICONEXCLAMATION | MB_OK );
- break;
- case 13: VB3DDemo = new C3DDemo( this );
- VB3DDemo->DoModal( );
- delete VB3DDemo;
- break;
- case 14: DDropDemo = new CDDropDemo( this );
- DDropDemo->DoModal( );
- delete DDropDemo;
- break;
- }
- }
-
- void CMainDlg::OnAbout()
- {
- // TODO: Add your control notification handler code here
- LPSTR szMsg = "This sample program demonstrates some of\n\
- the VBX Studio 1.2 VBXs results. To use it you need the\n\
- VBX Studio 1.2 full package.\n\n\
- VBX Studio 1.2 is a shareware and costs 55$-.\n\
- For any questions or comments, you can join us on\n\
- CIS at 100333,27 or EMail at hnet@dialup.francenet.fr.\n\
- You can also register via the CIS SWREG Forum.\n\n\
- VBX Studio 1.2 - COPYRIGHT HEXANET, 1993-1995\n\
- ALL RIGHTS RESERVED";
- MessageBox( szMsg, "About VBX Studio...", MB_OK | MB_ICONINFORMATION );
- }
-
- void CMainDlg::OnHelp()
- {
- CString FAR szWinDir, szName, szMsg;
- GetSystemDirectory( szWinDir.GetBuffer(250), 248 );
- szWinDir.ReleaseBuffer();
- if ( szWinDir.GetLength() > 3 )
- szWinDir += "\\";
- szName = szWinDir;
- szName += "VBXSTD12.HLP";
- if ( !IsHlpHere() )
- return;
- ::WinHelp( m_hWnd, szName, HELP_KEY, (long)"Index" );
-
-
- }
-
-
-
- void CMainDlg::OnDestroy()
- {
- CDialog::OnDestroy();
-
- ::WinHelp( m_hWnd, "VBXSTD12.HLP", HELP_QUIT, NULL );
- }
-