home *** CD-ROM | disk | FTP | other *** search
- /*
- Program which uses tests simple dialog resources
- */
-
- #include <owl\applicat.h>
- #include <owl\framewin.h>
- #include <owl\dialog.h>
- #include "rwdlg1.h"
-
- // declare the custom application class as
- // a subclass of TApplication
-
- class TWinApp : public TApplication
- {
- public:
- TWinApp() : TApplication() {}
-
- protected:
- virtual void InitMainWindow();
- };
-
- // expand the functionality of TWindow by deriving class TMainWindow
- class TMainWindow : public TWindow
- {
- public:
- TMainWindow() : TWindow(0, 0, 0) {}
-
- protected:
-
- // handle clicking the left mouse button
- void EvLButtonDown(UINT, TPoint&);
-
- // handle clicking the right mouse button
- void EvRButtonDown(UINT, TPoint&);
-
- // handle confirming closing the window
- virtual BOOL CanClose();
-
- // declare the response table
- DECLARE_RESPONSE_TABLE(TMainWindow);
-
- };
-
- DEFINE_RESPONSE_TABLE1(TMainWindow, TWindow)
- EV_WM_LBUTTONDOWN,
- EV_WM_RBUTTONDOWN,
- END_RESPONSE_TABLE;
-
- void TMainWindow::EvLButtonDown(UINT, TPoint&)
- {
- TDialog* pDlg = new TDialog(this, TResId(IDD_LCLICK_DLG));
-
- pDlg->Execute();
- }
-
- void TMainWindow::EvRButtonDown(UINT, TPoint&)
- {
- TDialog* pDlg = new TDialog(this, TResId(IDD_RCLICK_DLG));
-
- pDlg->Execute();
- }
-
- BOOL TMainWindow::CanClose()
- {
- return MessageBox("Want to close this application?",
- "Query", MB_YESNO | MB_ICONQUESTION) == IDYES;
- }
-
- void TWinApp::InitMainWindow()
- {
- MainWindow = new TFrameWindow(0,
- "Simple Dialog Box Resource Tester",
- new TMainWindow);
- // load the menu resource
- MainWindow->AssignMenu(TResId(EXITMENU));
- }
-
- int OwlMain(int /* argc */, char** /*argv[] */)
- {
- TWinApp app;
- return app.Run();
- }
-
-