home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / ktskmg2.zip / src / kModulePage.cpp < prev    next >
C/C++ Source or Header  |  2000-04-29  |  4KB  |  167 lines

  1. /* $Id: kModulePage.cpp,v 1.1 2000/04/29 19:06:35 stknut Exp $
  2.  *
  3.  * kModulePage - Module overview dialog. (to be notebook page)
  4.  *
  5.  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  6.  *
  7.  */
  8.  
  9.  
  10. /*******************************************************************************
  11. *   Defined Constants And Macros                                               *
  12. *******************************************************************************/
  13. #define INCL_WIN
  14. #define INCL_GPI
  15. #define INCL_BASE
  16.  
  17.  
  18. /*******************************************************************************
  19. *   Header Files                                                               *
  20. *******************************************************************************/
  21. #include <os2.h>
  22. #ifdef USE_KLIB
  23.     #include <kAssert.h>
  24.     #include <kLog.h>
  25.     #include <kHeap.h>
  26. #else
  27.     #include <malloc.h>
  28. #endif
  29. #include <memory.h>
  30. #include <string.h>
  31. #include <stddef.h>
  32. #include <stdio.h>
  33.  
  34. #include "kBase.h"
  35. #include "kError.h"
  36. #include "kDlgBase.h"
  37. #include "kMenuBase.h"
  38. #include "kContainer.h"
  39. #include "kNotebookBase.h"
  40. #include "kNotebookPageBase.h"
  41.  
  42. #include "kQuerySysState.h"
  43. #include "kDetailBase.h"
  44. #include "kModuleRecord.h"
  45. #include "kModuleContainer.h"
  46. #include "kObjectRecord.h"
  47. #include "kObjectContainer.h"
  48. #include "kModulePage.h"
  49. #include "kModuleDetails.h"
  50. #include "kTaskMgr_defs.h"
  51. #include "kTaskMgr.h"
  52.  
  53.  
  54. /**
  55.  * Forwards to the container.
  56.  * @param     usId     Container id.
  57.  * @param     pRecord  Pointer to the record which is selected by either the key
  58.  */
  59. VOID kModulePage::cnrContextMenu(USHORT usId, PRECORDCORE pRecord)
  60. {
  61.     pContainer->cnrContextMenu(usId, pRecord);
  62. }
  63.  
  64.  
  65. /**
  66.  * Forwards to the container.
  67.  */
  68. VOID kModulePage::cnrEnter(USHORT usId, HWND hwndCnr, PRECORDCORE pRecord, ULONG fKey)
  69. {
  70.     pContainer->cnrEnter(usId, hwndCnr, pRecord, fKey);
  71. }
  72.  
  73.  
  74.  
  75. /**
  76.  * Create a all modules overview page.
  77.  * @param     pNtbk  Pointer to notebook object.
  78.  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  79.  * @remark    Throws kError on error.
  80.  */
  81. kModulePage::kModulePage(kNotebookBase *pNtbk) throw (kError)
  82.     : kNotebookPageBase(DL_KMODULEPAGE, NULLHANDLE, pNtbk),
  83.     pContainer(NULL)
  84. {
  85.     /*
  86.      * Container border size
  87.      */
  88.     ptlBorder.x = 5;
  89.     ptlBorder.y = 4;
  90.     WinMapDlgPoints(hwnd, &ptlBorder, 1, TRUE);
  91.  
  92.     /*
  93.      * Create detail container
  94.      */
  95.     pContainer = new kModuleContainer(hwnd, KMODPG_CNR);
  96.     pContainer->update();
  97. }
  98.  
  99.  
  100.  
  101. /**
  102.  * Create a import module page.
  103.  * @param     pNtbk  Pointer to notebook object.
  104.  * @param     hMTE   Handle to module which we are to show the imported modules for.
  105.  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  106.  * @remark    Throws kError on error.
  107.  */
  108. kModulePage::kModulePage(kNotebookBase *pNtbk, USHORT hMTE) throw (kError)
  109.     : kNotebookPageBase(DL_KMODULEPAGE, NULLHANDLE, pNtbk),
  110.     pContainer(NULL)
  111. {
  112.     /*
  113.      * Container border size
  114.      */
  115.     ptlBorder.x = 5;
  116.     ptlBorder.y = 4;
  117.     WinMapDlgPoints(hwnd, &ptlBorder, 1, TRUE);
  118.  
  119.     /*
  120.      * Create detail container
  121.      */
  122.     pContainer = new kModuleContainer(hwnd, KMODPG_CNR, hMTE);
  123.     pContainer->update();
  124. }
  125.  
  126.  
  127.  
  128. /**
  129.  * Desctructor stub.
  130.  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  131.  * @remark
  132.  */
  133. kModulePage::~kModulePage()
  134. {
  135.     if (pContainer != NULL)
  136.         delete pContainer;
  137.     pContainer = NULL;
  138. }
  139.  
  140.  
  141. /**
  142.  * Move and size the container and dialog.
  143.  * @param     prctlPage  New size of dialog.
  144.  */
  145. VOID  kModulePage::ntfySized(LONG cx, LONG cy)
  146. {
  147.     /*
  148.      * Resize the dialog
  149.      */
  150.     resizeAndMove(
  151.         0,
  152.         0,
  153.         cx,
  154.         cy);
  155.  
  156.     /*
  157.      * Resize the container.
  158.      */
  159.     pContainer->resizeAndMove(
  160.         ptlBorder.x,
  161.         ptlBorder.y,
  162.         cx - ptlBorder.x*2,
  163.         cy - ptlBorder.y*2
  164.         );
  165. }
  166.  
  167.