home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / taman002.zip / TASKMANA.ZIP / src / kClickDlg.cpp < prev    next >
C/C++ Source or Header  |  2000-04-29  |  3KB  |  109 lines

  1. /* $Id: kClickDlg.cpp,v 1.1 2000/04/29 19:06:34 stknut Exp $
  2.  *
  3.  * kClickDlg (kClassLib) - Implementation of kClickDlg.
  4.  *
  5.  * Copyright (c) 1999-2000 knut st. osmundsen
  6.  *
  7.  */
  8.  
  9.  
  10. /*******************************************************************************
  11. *   Defined Constants And Macros                                               *
  12. *******************************************************************************/
  13. #define INCL_WINERRORS
  14. #define INCL_WINDIALOG
  15. #define INCL_WININPUT
  16. #define INCL_WINDIALOGS
  17. #define INCL_WINFRAMEMGR
  18.  
  19.  
  20.  
  21. /*******************************************************************************
  22. *   Header Files                                                               *
  23. *******************************************************************************/
  24. #include <os2.h>
  25. #ifdef USE_KLIB
  26.     #include <kAssert.h>
  27.     #include <kLog.h>
  28.     #include <kHeap.h>
  29. #endif
  30. #include "kError.h"
  31. #include "kDlgBase.h"
  32. #include "kClickDlg.h"
  33.  
  34.  
  35. /**
  36.  * overrides the default buttonNDown events. Dismiss the dialog when this event occurs.
  37.  */
  38. BOOL kClickDlg::button1Down(POINTS ptsPointerPos, USHORT fsHitTestres, USHORT fsFlags)
  39. {
  40.    ptsPointerPos = ptsPointerPos;
  41.    fsHitTestres = fsHitTestres;
  42.    fsFlags = fsFlags;
  43.    return WinDismissDlg(hwnd, DID_OK);
  44. }
  45.  
  46.  
  47.  
  48. /**
  49.  * overrides the default buttonNDown events. Dismiss the dialog when this event occurs.
  50.  */
  51. BOOL kClickDlg::button2Down(POINTS ptsPointerPos, USHORT fsHitTestres, USHORT fsFlags)
  52. {
  53.    ptsPointerPos = ptsPointerPos;
  54.    fsHitTestres = fsHitTestres;
  55.    fsFlags = fsFlags;
  56.    return WinDismissDlg(hwnd, DID_OK);
  57. }
  58.  
  59.  
  60.  
  61. /**
  62.  * overrides the default buttonNDown events. Dismiss the dialog when this event occurs.
  63.  */
  64. BOOL kClickDlg::button3Down(POINTS ptsPointerPos, USHORT fsHitTestres, USHORT fsFlags)
  65. {
  66.    ptsPointerPos = ptsPointerPos;
  67.    fsHitTestres = fsHitTestres;
  68.    fsFlags = fsFlags;
  69.    return WinDismissDlg(hwnd, DID_OK);
  70. }
  71.  
  72.  
  73.  
  74. /**
  75.  * Creates a kClickDlg.
  76.  * @param     hwndOwner  handle to owner window.
  77.  * @param     usId       Dialog resource id.
  78.  * @param     hmod       Resource module handle.
  79.  */
  80. kClickDlg::kClickDlg(HWND hwndOwner, USHORT usId, HMODULE hmod) throw (kError)
  81.    : kDlgBase(usId, hmod, hwndOwner)
  82. {
  83.    /* do noting else */
  84. }
  85.  
  86.  
  87.  
  88. /**
  89.  * Invokes a Click dialog.
  90.  * @returns   TRUE / FALSE according to the result.
  91.  * @param     hwndOwner  handle of owner.
  92.  * @param     usId       Dialog resource id.
  93.  * @param     hmod       Resource module handle.
  94.  */
  95. BOOL kClickDlg::invoke(HWND hwndOwner, USHORT usId, HMODULE hmod)
  96. {
  97.    try
  98.    {
  99.       kClickDlg ClickDlg(hwndOwner, usId, hmod);
  100.       return ClickDlg.showModal();
  101.    }
  102.    catch (kError err)
  103.    {
  104.       err.showError("kClickDlg - Error");
  105.       return FALSE;
  106.    }
  107. }
  108.  
  109.