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

  1. /* $Id: kSFNPage.cpp,v 1.1 2000/04/29 19:06:35 stknut Exp $
  2.  *
  3.  * kSFNPage (kTaskMgr) - System file number overview 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 "kSFNRecord.h"
  45. #include "kSFNContainer.h"
  46. #include "kObjectRecord.h"
  47. #include "kObjectContainer.h"
  48. #include "kSFNPage.h"
  49. #include "kTaskMgr_defs.h"
  50. #include "kTaskMgr.h"
  51.  
  52.  
  53. /**
  54.  * Forwards to the container.
  55.  * @param     usId     Container id.
  56.  * @param     pRecord  Pointer to the record which is selected by either the key
  57.  */
  58. VOID kSFNPage::cnrContextMenu(USHORT usId, PRECORDCORE pRecord)
  59. {
  60.     pContainer->cnrContextMenu(usId, pRecord);
  61. }
  62.  
  63.  
  64. /**
  65.  * Forwards to the container.
  66.  */
  67. VOID kSFNPage::cnrEnter(USHORT usId, HWND hwndCnr, PRECORDCORE pRecord, ULONG fKey)
  68. {
  69.     pContainer->cnrEnter(usId, hwndCnr, pRecord, fKey);
  70. }
  71.  
  72.  
  73.  
  74. /**
  75.  * Create an global SFN page.
  76.  * @param     pNtbk     Pointer to notebook object.
  77.  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  78.  * @remark    Throws kError on error.
  79.  */
  80. kSFNPage::kSFNPage(kNotebookBase *pNtbk) throw (kError)
  81.     : kNotebookPageBase(DL_KSFNPAGE, NULLHANDLE, pNtbk),
  82.     pContainer(NULL)
  83. {
  84.     /*
  85.      * Container border size
  86.      */
  87.     ptlBorder.x = 5;
  88.     ptlBorder.y = 4;
  89.     WinMapDlgPoints(hwnd, &ptlBorder, 1, TRUE);
  90.  
  91.     /*
  92.      * Create detail container
  93.      */
  94.     pContainer = new kSFNContainer(hwnd, KSFNPG_CNR);
  95.     pContainer->update();
  96. }
  97.  
  98.  
  99.  
  100. /**
  101.  * Create an processes SFN/JFN page.
  102.  * @param     pNtbk     Pointer to notebook object.
  103.  * @param     usPid     Process identificator of the process we're to show SFN/JFNs for.
  104.  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  105.  * @remark    Throws kError on error.
  106.  */
  107. kSFNPage::kSFNPage(kNotebookBase *pNtbk, USHORT usPid) throw (kError)
  108.     : kNotebookPageBase(DL_KSFNPAGE, NULLHANDLE, pNtbk),
  109.     pContainer(NULL)
  110. {
  111.     /*
  112.      * Container border size
  113.      */
  114.     ptlBorder.x = 5;
  115.     ptlBorder.y = 4;
  116.     WinMapDlgPoints(hwnd, &ptlBorder, 1, TRUE);
  117.  
  118.     /*
  119.      * Create detail container
  120.      */
  121.     pContainer = new kSFNContainer(hwnd, KSFNPG_CNR, usPid);
  122.     pContainer->update();
  123. }
  124.  
  125.  
  126.  
  127. /**
  128.  * Desctructor stub.
  129.  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
  130.  * @remark
  131.  */
  132. kSFNPage::~kSFNPage()
  133. {
  134.     if (pContainer != NULL)
  135.         delete pContainer;
  136.     pContainer = NULL;
  137. }
  138.  
  139.  
  140. /**
  141.  * Move and size the container and dialog.
  142.  * @param     prctlPage  New size of dialog.
  143.  */
  144. VOID  kSFNPage::ntfySized(LONG cx, LONG cy)
  145. {
  146.     /*
  147.      * Resize the dialog
  148.      */
  149.     resizeAndMove(
  150.         0,
  151.         0,
  152.         cx,
  153.         cy);
  154.  
  155.     /*
  156.      * Resize the container.
  157.      */
  158.     pContainer->resizeAndMove(
  159.         ptlBorder.x,
  160.         ptlBorder.y,
  161.         cx - ptlBorder.x*2,
  162.         cy - ptlBorder.y*2
  163.         );
  164. }
  165.  
  166.