/[H6]/h6-udlånssystemDlg.cpp
ViewVC logotype

Diff of /h6-udlånssystemDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by torben, Wed Aug 30 06:32:35 2006 UTC revision 31 by torben, Sun Sep 3 10:10:19 2006 UTC
# Line 1  Line 1 
1  // h6-udlånssystemDlg.cpp : implementation file  /*
2  //   * Developed by Torben H. Nielsen
3     */
4    
5    
6  #include "stdafx.h"  #include "stdafx.h"
7  #include "h6-udlånssystem.h"  #include "h6-udlånssystem.h"
8  #include "h6-udlånssystemDlg.h"  #include "h6-udlånssystemDlg.h"
9    #include ".\h6-udlånssystemdlg.h"
10    
11    #include "commonstorage.h"
12    #include "databaselayer.h"
13    
14  #ifdef _DEBUG  #ifdef _DEBUG
15  #define new DEBUG_NEW  #define new DEBUG_NEW
# Line 54  Ch6udlnssystemDlg::Ch6udlnssystemDlg(CWn Line 60  Ch6udlnssystemDlg::Ch6udlnssystemDlg(CWn
60  void Ch6udlnssystemDlg::DoDataExchange(CDataExchange* pDX)  void Ch6udlnssystemDlg::DoDataExchange(CDataExchange* pDX)
61  {  {
62          CDialog::DoDataExchange(pDX);          CDialog::DoDataExchange(pDX);
63            DDX_Control(pDX, IDC_TAB, m_tabs);
64  }  }
65    
66  BEGIN_MESSAGE_MAP(Ch6udlnssystemDlg, CDialog)  BEGIN_MESSAGE_MAP(Ch6udlnssystemDlg, CDialog)
# Line 61  BEGIN_MESSAGE_MAP(Ch6udlnssystemDlg, CDi Line 68  BEGIN_MESSAGE_MAP(Ch6udlnssystemDlg, CDi
68          ON_WM_PAINT()          ON_WM_PAINT()
69          ON_WM_QUERYDRAGICON()          ON_WM_QUERYDRAGICON()
70          //}}AFX_MSG_MAP          //}}AFX_MSG_MAP
71            ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout)
72            ON_COMMAND(ID_FILE_EXIT, OnFileExit)
73  END_MESSAGE_MAP()  END_MESSAGE_MAP()
74    
75    
# Line 69  END_MESSAGE_MAP() Line 78  END_MESSAGE_MAP()
78  BOOL Ch6udlnssystemDlg::OnInitDialog()  BOOL Ch6udlnssystemDlg::OnInitDialog()
79  {  {
80          CDialog::OnInitDialog();          CDialog::OnInitDialog();
81            CWaitCursor wait;
82    
83          // Add "About..." menu item to system menu.          // Add "About..." menu item to system menu.
84    
# Line 93  BOOL Ch6udlnssystemDlg::OnInitDialog() Line 103  BOOL Ch6udlnssystemDlg::OnInitDialog()
103          SetIcon(m_hIcon, TRUE);                 // Set big icon          SetIcon(m_hIcon, TRUE);                 // Set big icon
104          SetIcon(m_hIcon, FALSE);                // Set small icon          SetIcon(m_hIcon, FALSE);                // Set small icon
105    
106            m_tabs.InsertItem(0,"Search");
107            m_tabs.InsertItem(1,"Result");
108            m_tabs.InsertItem(2,"Administration");
109            m_tabs.Init();
110            m_tabs.SetCurSel(0);
111    
112    
113            try {
114                    DatabaseLayer *dbl = new DatabaseLayer;
115                    CommonStorage::Instance()->setDBLayer(dbl);
116            } catch (...) {
117                    MessageBox(CString("Could not establish connection to the database server\r\n") +
118                                       "Please contact your network administrator\r\n" +
119                                       "(This application shuts down automatically)");
120                    OnOK();
121            }
122    
123    
124          // TODO: Add extra initialization here          // TODO: Add extra initialization here
125                    
126          return TRUE;  // return TRUE  unless you set the focus to a control          return TRUE;  // return TRUE  unless you set the focus to a control
# Line 146  HCURSOR Ch6udlnssystemDlg::OnQueryDragIc Line 174  HCURSOR Ch6udlnssystemDlg::OnQueryDragIc
174  {  {
175          return static_cast<HCURSOR>(m_hIcon);          return static_cast<HCURSOR>(m_hIcon);
176  }  }
177    
178    void Ch6udlnssystemDlg::OnHelpAbout()
179    {
180            MessageBox("DA6H :: Udlånssystem\r\nLavet af:\r\nKevin, Hedin & Torben");
181    }
182    
183    void Ch6udlnssystemDlg::OnFileExit()
184    {
185            // TODO: Add your command handler code here
186            OnOK();
187    }

Legend:
Removed from v.1  
changed lines
  Added in v.31

  ViewVC Help
Powered by ViewVC 1.1.20