home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / central / UMenuUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.8 KB  |  68 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. //    UMenuUtils.h
  20.  
  21. #pragma once
  22.  
  23. #include <PP_Prefix.h>
  24.  
  25. #ifndef __MENUS__
  26. #include <Menus.h>
  27. #endif
  28.  
  29. class cstring;
  30.  
  31. class UMenuUtils
  32. {
  33.     public:
  34.         
  35.         static void        PurgeMenuItems(MenuHandle inMenu, Int16 inAfter = 0);
  36.  
  37.         static Int16    InsertMenuItem(
  38.                             MenuHandle         inMenu,
  39.                             ConstStringPtr    inText,
  40.                             Int16             inAfter,
  41.                             Boolean            inEnabled = true);
  42.                             
  43.         static Int16    AppendMenuItem(
  44.                             MenuHandle        inMenu,
  45.                             ConstStringPtr    inText,
  46.                             Boolean            inEnabled = true);
  47.                             
  48.         static void        AppendSeparator(MenuHandle inMenu);
  49.  
  50.         static Int32     PopupWithTraits(
  51.                             MenuHandle        inMenu,
  52.                             Point             inGlobalWhere,
  53.                             Int16             inTopItem = 1,
  54.                             ResIDT             inTraitsID = 0);
  55.  
  56.         static void        AdjustStringForMenuTitle(cstring& inString);
  57.  
  58.         static void        ConvertToIconMenu(MenuHandle inMenu, ResIDT inIconResID);
  59.     
  60.         static UInt16     GetMenuBarWidth();
  61.         
  62.     protected:
  63.         static Uint8 sEnabledDummy[];
  64.         static Uint8 sDisabledDummy[];
  65.         static Uint8 sDisabledSep[];
  66. };
  67.  
  68.