home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / df3os2.zip / MENUSEL.CPP < prev    next >
C/C++ Source or Header  |  1993-09-23  |  2KB  |  83 lines

  1. // ------- menusel.cpp
  2.  
  3. #include <string.h>
  4. #include "menusel.h"
  5.  
  6. MenuSelection SelectionSeparator(SEPARATOR);
  7.  
  8. void MenuSelection::NullSelection()
  9. {
  10.     label = 0;
  11.     cmdfunction = 0;
  12.     type = NORMAL;
  13.     cascade = 0;
  14.     isenabled = True;
  15.     accelerator = 0;
  16.     cascade = 0;
  17.     toggle = Off;
  18. }
  19.  
  20. void MenuSelection::CommonConstructor(
  21.                                const char *Label,
  22.                                int Accelerator,
  23.                                void (Application::*CmdFunction)(),
  24.                                Bool Active,
  25.                                MenuType Type,
  26.                                Toggle Tgl,
  27.                                MenuSelection **Cascaders)
  28. {
  29.     NullSelection();
  30.     if (Label != 0)
  31.         label = new String(Label);
  32.     accelerator = Accelerator;
  33.     cmdfunction = CmdFunction;
  34.     isenabled = Active;
  35.     type = Type;
  36.     toggle = Tgl;
  37.     cascaders = Cascaders;
  38. }
  39.  
  40. MenuSelection::MenuSelection(  const char *Label,
  41.                                void (Application::*CmdFunction)(),
  42.                                int Accelerator,
  43.                                Bool Active )
  44. {
  45.     CommonConstructor(Label, Accelerator, CmdFunction,
  46.                                 Active, NORMAL, Off);
  47. }
  48.  
  49. MenuSelection::MenuSelection(  const char *Label,
  50.                                void (Application::*CmdFunction)(),
  51.                                Toggle Tgl,
  52.                                int Accelerator,
  53.                                Bool Active)
  54. {
  55.     CommonConstructor(Label, Accelerator, CmdFunction,
  56.                             Active, TOGGLE, Tgl);
  57. }
  58.  
  59. MenuSelection::MenuSelection(const char *Label,
  60.                             MenuSelection **Cascaders,
  61.                             int Accelerator,
  62.                             Bool Active )
  63. {
  64.     CommonConstructor(Label, Accelerator, 0,
  65.                             Active, CASCADER, Off, Cascaders);
  66. }
  67.  
  68. MenuSelection::MenuSelection(const char *Label,Toggle Tgl,
  69.                              int Accelerator, Bool Active)
  70. {
  71.     CommonConstructor(Label, Accelerator, 0,
  72.                             Active, TOGGLE, Tgl);
  73. }
  74.  
  75. MenuSelection::MenuSelection(MenuType Type)
  76. {
  77.     NullSelection();
  78.     type = Type;
  79. }
  80.  
  81.  
  82.  
  83.