home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / ACDCR032.ZIP / source / MiscFolder / progfolder.hh < prev    next >
Encoding:
Text File  |  1999-07-11  |  4.2 KB  |  131 lines

  1. /*
  2.  *
  3.  * Include file with class definitions for class CWProgFolder
  4.  *
  5.  *             (C) Chris Wohlgenuth 1999
  6.  *
  7.  * This class is intended for programmers and provides functions for some
  8.  * common tasks like:
  9.  *                     - Adding dialogs as frame controls to WPS folders
  10.  *                     - Showing 'About'-dialogs
  11.  *                     - Checking of object pointers
  12.  *                     - ...
  13.  *
  14.  * Use IBM VAC++ V3.00 and Gnu-make 3.74.1 to compile
  15.  *
  16.  */
  17.  
  18. /*
  19.  * This program is free software; you can redistribute it and/or modify
  20.  * it under the terms of the GNU General Public License as published by
  21.  * the Free Software Foundation; either version 2, or (at your option)
  22.  * any later version.
  23.  *
  24.  * This program is distributed in the hope that it will be useful,
  25.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27.  * GNU General Public License for more details.
  28.  *
  29.  * You should have received a copy of the GNU General Public License
  30.  * along with this program; see the file COPYING.  If not, write to
  31.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  32.  */
  33. #define INCL_DOS
  34. #define INCL_WIN
  35. #include <os2.h>
  36.  
  37. /* Structure which holds information about our
  38.    frame controls */
  39. typedef struct {
  40.     HWND hwndCtlLeft;
  41.     BOOL bLeft;
  42.     ULONG ulFlagsLeft;
  43.     SIZEL sizelLeftFrame;
  44.  
  45.     HWND hwndCtlRight;
  46.     BOOL bRight;
  47.     ULONG ulFlagsRight;
  48.     SIZEL sizelRightFrame;
  49.  
  50.     HWND hwndCtlTop;
  51.     BOOL bTop;
  52.     ULONG ulFlagsTop;
  53.     SIZEL sizelTopFrame;
  54.  
  55.     HWND hwndCtlBottom;
  56.     BOOL bBottom;
  57.     ULONG ulFlagsBottom;
  58.     SIZEL sizelBottomFrame;
  59. }FRAMECTRLDATA;
  60.  
  61. /* Some stuff necessary for the compiler */
  62. #pragma SOMAsDefault(on)
  63. #include <som.hh>
  64. #include <somcls.hh>
  65. #pragma SOMNoMangling(on)
  66. /* Include file with definition for WPFolder class */
  67. #include <WPFOLDER.hh>
  68. /* Include file with definition for WPShadow class */
  69. #include <wpshadow.hh>
  70.  
  71. /* Class definition for the Metaclass of our new folder class */
  72. class M_CWProgFolder:public M_WPFolder
  73. {
  74. #pragma SOMClassName(*,"M_CWProgFolder")
  75.   /* Minimal SOM-Version we need. No change necessary */
  76. #pragma SOMClassVersion(*,1,2)
  77. #pragma SOMCallstyle(oidl)
  78. public:
  79.   /* The member functions we want to override */
  80.     virtual PSZ  wpclsQueryTitle();
  81.     virtual ULONG wpclsQueryStyle();
  82.   /* This statement describes new memberfunctions if we introduce them */
  83. #pragma SOMReleaseOrder()
  84. };
  85.  
  86. /* The new folder class. It's a child of WPFolder-class */
  87. class CWProgFolder:public WPFolder
  88. {
  89.   /* The class name */
  90. #pragma SOMClassName(*,"CWProgFolder")
  91.   /* The name of the class' Metaclass */
  92. #pragma SOMMetaClass(CWProgFolder,"M_CWProgFolder")
  93.   /* SOM must be Version 1.2 or above */
  94. #pragma SOMClassVersion(CWProgFolder,1,2)
  95. #pragma SOMCallstyle(oidl)
  96. private:
  97.   /* We have no private data or functions */
  98. public:
  99.   /* Overridden or new functions come here */
  100.   /* This one is overridden */
  101.     virtual HWND wpOpen(HWND hwndCnr,ULONG ulView,ULONG ulParam);
  102.     virtual BOOL cwClose();
  103.   /* This one is a new one */
  104.     virtual ULONG cwNumAdditionalFrameControls(HWND hwndFolder);
  105.     virtual BOOL cwCalculateClient(HWND hwndFolder, PRECTL pRectl);
  106.     virtual ULONG cwFormatFrame(HWND hwndFolder, USHORT countSWP,PSWP pswp);
  107.     virtual BOOL cwAddFrameCtl(HWND hwndFolder,HWND hwndNewCtl,SIZEL sizel, ULONG ulPos, ULONG ulFlags);
  108.     virtual HWND cwQueryFrameCtl(HWND hwndFolder, SIZEL* sizel, ULONG ulPos, ULONG * ulFlags);
  109.     virtual void cwUpdateFrame(HWND hwndFolder);
  110.     virtual WPObject* cwGetFileSystemObject(WPObject* wpObject);
  111.     virtual ULONG cwShowAboutDlg(HMODULE hModule, ULONG idDialog);
  112.     virtual BOOL cwQueryCDDrives(int *iNumCD, char * cFirstDrive);
  113.     //  virtual ULONG cwQueryAudioCDInfo(char * drive);
  114.   /* Tell SOM the order of the new functions. NEVER change the order in
  115.      future versions or you break binary compatibility! */
  116. #pragma SOMReleaseOrder( \
  117. "cwNumAdditionalFrameControls",\
  118. "cwCalculateClient",\
  119. "cwFormatFrame",\
  120. "cwAddFrameCtl",\
  121. "cwQueryFrameCtl",\
  122. "cwUpdateFrame",\
  123. "cwGetFileSystemObject",\
  124. "cwShowAboutDlg",\
  125. "cwQueryCDDrives",\
  126. "cwClose")
  127. };
  128.  
  129.  
  130.  
  131.