home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OMenu.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  5KB  |  179 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // (c) 1994 B. Stein & M. Stübner (!!!)
  5. // OMenu.hpp
  6.  
  7. /*
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  14.  *    endorse or promote products derived from this software
  15.  *    without specific prior written permission.
  16.  * 3. See OCL.INF for a detailed copyright notice.
  17.  *
  18.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  19.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  22.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28.  * SUCH DAMAGE.
  29.  */
  30.  
  31. // $Header: W:/Projects/OCL/Include/rcs/OMenu.hpp 1.50 1996/08/11 23:47:21 B.STEIN Release $
  32.  
  33. //  valid messages
  34. //  MM_DELETEMENU
  35. //  MM_ENDMENUMODE
  36. //  MM_INSERTITEM
  37. //  MM_ISITEMVALID
  38. //  MM_ITEMIDFROMPOSITION
  39. //  MM_QUERYDEFAULTITEMID
  40. //  MM_QUERYITEM
  41. //  MM_QUERYITEMATTR
  42. //  MM_QUERYITEMCOUNT
  43. //  MM_QUERYITEMRECT
  44. //  MM_QUERYITEMTEXT
  45. //  MM_QUERYITEMTEXTLENGTH
  46. //  MM_QUERYSELITEMID
  47. //  MM_REMOVEITEM
  48. //  MM_SELECTITEM
  49. //  MM_SETDEFAULTITEMID
  50. //  MM_SETITEM
  51. //  MM_SETITEMATTR
  52. //  MM_SETITEMHANDLE
  53. //  MM_SETITEMTEXT
  54. //  MM_STARTMENUMODE
  55.  
  56.  
  57. #ifndef OMENU_INCLUDED
  58.   #define OMENU_INCLUDED
  59.  
  60.  
  61. #ifndef OFRAME_INCLUDED
  62.   #include <OFrame.hpp>
  63. #endif
  64.  
  65. #ifndef OPMEXCEPTION_INCLUDED
  66.   #include <OPMException.hpp>
  67. #endif
  68.  
  69.  
  70. #ifndef ODYNAMICLIB_INCLUDED
  71.   #include <ODynamicLib.hpp>
  72. #endif
  73.  
  74.  
  75. #ifndef OMENUITEM_INCLUDED
  76.   #include <OMenuItem.hpp>
  77. #endif
  78.  
  79.  
  80. typedef class OMenu *pOMenu;
  81.  
  82. typedef OList<OMenuItem> lOMenuItem;
  83. typedef lOMenuItem *plOMenuItem;
  84.  
  85. typedef OList<ULONG> lUlong;
  86. typedef lUlong *plUlong;
  87.  
  88. class __CPP_EXPORT__ OMenu
  89.   : public OWindow
  90. {
  91.  private:
  92.    HMODULE             OMenu_resLibrary;
  93.  
  94.  protected:
  95.    OMenu&
  96.       createOMenuObject ();   
  97.  
  98.  public:
  99.  
  100.    OMenu              (const ULONG id,
  101.                        const HWND Parent,
  102.                        const HWND Owner,
  103.                        const pODynamicLib resLibrary);
  104.  
  105.    OMenu              (const ULONG id,
  106.                        const HWND Parent,
  107.                        const HWND Owner,
  108.                        const HMODULE resLibrary);
  109.  
  110.    OMenu              (const ULONG id,
  111.                        const OWindow& Parent,
  112.                        const OWindow& Owner,
  113.                        const pODynamicLib resLibrary);
  114.  
  115.    OMenu              (const ULONG id,
  116.                        const OWindow& Parent,
  117.                        const OWindow& Owner,
  118.                        const HMODULE resLibrary);
  119.  
  120.    OMenu              (const ULONG id,
  121.                        const pOWindow Parent,
  122.                        const pOWindow Owner,
  123.                        const pODynamicLib resLibrary);
  124.  
  125.    OMenu              (const ULONG id,
  126.                        const pOWindow Parent,
  127.                        const pOWindow Owner,
  128.                        const HMODULE resLibrary);
  129.  
  130.    virtual
  131.       ~OMenu          ();
  132.  
  133.    virtual
  134.       PSZ isOfType    () const; 
  135.  
  136.    BOOL
  137.       isEnabled       (const ULONG item),
  138.       isChecked       (const ULONG item);
  139.  
  140.    OMenu
  141.       &insertItem      (const ULONG insertAfter,
  142.                         const pOMenuItem item),
  143.       &insertItemList  (const ULONG insertAfter,
  144.                         const plOMenuItem items),
  145.  
  146.       &removeItem      (const ULONG item),
  147.       &removeItemList  (OList<ULONG>& items),
  148.       &removeItemList  (const ULONG items[],
  149.                         const ULONG elements),
  150.  
  151.       &enableItem      (const ULONG item,
  152.                         BOOL state = TRUE),
  153.       &enableItemList  (OList<ULONG>& items,
  154.                         BOOL state = TRUE),
  155.       &enableItemList  (const ULONG items[],
  156.                         const ULONG elements,
  157.                         BOOL state = TRUE),
  158.  
  159.       &checkItem       (const ULONG item,
  160.                         BOOL state = TRUE),
  161.       &checkItemList   (OList<ULONG>& items,
  162.                         BOOL state = TRUE),
  163.       &checkItemList   (const ULONG items[],
  164.                         const ULONG elements,
  165.                         BOOL state = TRUE), 
  166.  
  167.       &setItemText     (const ULONG item,
  168.                         PCSZ text),
  169.       &setItemText     (const ULONG item,
  170.                         pOString text),
  171.       &setItemText     (const ULONG item,
  172.                         const ULONG resID);
  173. };
  174.  
  175.  
  176. #endif // OMENU_INCLUDED
  177.  
  178. // end of source
  179.