Quantum Fog  0.9.3
UTextMenus.h
1 // ===========================================================================
2 // UTextMenus.h ©1993 Metrowerks Inc. All rights reserved.
3 // ===========================================================================
4 //
5 // This file contains classes to handle the Font, Size and Style menus
6 // It relies on the fact that the menu IDs of these menus are MENU_Font
7 // MENU_Size, and MENU_Style as defined in PP_Resources.h.
8 //
9 
10 
11 #pragma once
12 
13 #include <Menus.h>
14 #include <PP_Prefix.h>
15 
16 class LMenu;
17 //******************************************
19 
20 protected:
21  static void XAble(LMenu * inMenu, Boolean inEnable);
22  static void XAble(ResIDT inMenuID, Boolean inEnable);
23  static void XAble(MenuHandle inMenuH, Boolean inEnable);
24 
25  static void XAbleEveryItem(LMenu * inMenu, Boolean inEnable,
26  Boolean inUnmarkAll, Boolean inSetStyleNormal);
27  static void XAbleEveryItem(ResIDT inMenuID, Boolean inEnable,
28  Boolean inUnmarkAll, Boolean inSetStyleNormal);
29  static void XAbleEveryItem(MenuHandle inMenuH, Boolean inEnable,
30  Boolean inUnmarkAll, Boolean inSetStyleNormal);
31 
32  static LMenu *sFontMenu;
33  static MenuHandle sFontMenuH;
34  static LMenu *sSizeMenu;
35  static MenuHandle sSizeMenuH;
36  static LMenu *sStyleMenu;
37  static MenuHandle sStyleMenuH;
38 };
39 //******************************************
40 class UFontMenu : public UTextMenusBase {
41 
42 public:
43  static void Initialize(Boolean inEnabled = true);
44  static void AdjustMenu(SInt16 inCurrentFont);
45  static void DisableMenu();
46  static void EnableMenu();
47  static void DisableEveryItem();
48  static void EnableEveryItem();
49  static SInt16 GetFontNumber(SInt16 inMenuItem);
50  static SInt16 GetFontItemNumber(SInt16 inFontNumber);
51 };
52 
53 //******************************************
54 class USizeMenu : public UTextMenusBase {
55 
56 public:
57  static void Initialize(SInt16 inReservedItems, Boolean inEnabled = true);
58  static void AdjustMenu(SInt16 inMenuItem, SInt16 inCurrentSize, SInt16 inCurrentFont,
59  Boolean & outEnabled, Boolean & outUsesMark, UInt16 & outMark);
60  static void DisableMenu();
61  static void EnableMenu();
62  static void DisableEveryItem();
63  static void EnableEveryItem();
64  static SInt16 GetFontSize(SInt16 inMenuItem);
65 
66 private:
67  static SInt16 mReservedItems;
68 };
69 
70 const SInt16 kDefaultReservedItems = 5;
71 
72 //******************************************
73 class UStyleMenu : public UTextMenusBase {
74 
75 public:
76  static void Initialize(Boolean inEnabled = true);
77  static void DisableMenu();
78  static void EnableMenu();
79 };
80 
Definition: UTextMenus.h:54
Definition: UTextMenus.h:18
Definition: UTextMenus.h:73
Definition: UTextMenus.h:40