home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / 3DTOSHI2.ZIP / mpgui / source / guimenu.cpp < prev    next >
C/C++ Source or Header  |  1996-04-17  |  1KB  |  55 lines

  1.  
  2. // guimenu.cpp
  3. //
  4. // Copyright (c) 1995 by Toshiaki Tsuji, all rights reserved.
  5.  
  6. #include "stdgfx.h"
  7. #include "guimenu.h"
  8.  
  9. GUIMENU::GUIMENU () : GUIOBJECT ()
  10.   {
  11.     hMenu = NULL;
  12.   } // End of Constructor for GUIMENU
  13.  
  14. GUIMENU::~GUIMENU ()
  15.   {
  16.     #if defined (__FORWINDOWS__)
  17.       if (hMenu!=NULL)
  18.         DestroyMenu ( hMenu );
  19.     #endif
  20.   } // End of Destructor for GUIMENU
  21.  
  22. BOOLEAN GUIMENU::Load ( STRING Name )
  23.   {
  24.     #if defined (__FORWINDOWS__)
  25.       if (hMenu!=NULL)
  26.         DestroyMenu ( hMenu );
  27.  
  28.       hMenu = LoadMenu ( hInstance, Name );
  29.       if (hMenu==NULL)
  30.         return FAILURE;
  31.       return SUCCESS;
  32.     #else
  33.       if (Name)
  34.         {}
  35.       return SUCCESS;
  36.     #endif
  37.   } // End of Load for GUIMENU
  38.  
  39. VOID GUIMENU::SetItemState ( LONG CommandID, LONG State )
  40.   {
  41.     if (CommandID&State)
  42.       {}  
  43.     #if defined (__FORWINDOWS__)
  44.       #if defined (__FORWIN386__)
  45.         EnableMenuItem ( hMenu, (short)CommandID, (short)(State|MF_BYCOMMAND) );
  46.       #else
  47.         EnableMenuItem ( hMenu, CommandID, State | MF_BYCOMMAND );
  48.       #endif
  49.     #elif defined (__FOROS2__)
  50.     #elif defined (__FORDOS__)
  51.     #endif  
  52.   } // End of SetItemState for GUIMENU
  53.  
  54.   
  55.