home *** CD-ROM | disk | FTP | other *** search
/ Shareware Supreme Volume 6 #1 / swsii.zip / swsii / 215 / DDJ9302.ZIP / DFPP01.ZIP / MENUSEL.CPP < prev    next >
C/C++ Source or Header  |  1992-11-22  |  2KB  |  76 lines

  1. // ------- menusel.cpp
  2.  
  3. #include <string.h>
  4. #include "menusel.h"
  5.  
  6. MenuSelection SelectionSeparator(SEPARATOR);
  7. MenuSelection SelectionTerminator(TERMINATOR);
  8.  
  9. void MenuSelection::NullSelection()
  10. {
  11.     label = NULL;
  12.     cmdfunction = NULL;
  13.     type = NORMAL;
  14.     cascade = NULL;
  15.     isenabled = True;
  16.     accelerator = 0;
  17.     cascade = NULL;
  18.     toggle = Off;
  19. }
  20.  
  21. void MenuSelection::CommonConstructor(    char *Label,
  22.                                         int Accelerator,
  23.                                         void (DFWindow::*CmdFunction)(),
  24.                                         Bool Active,
  25.                                         MenuType Type,
  26.                                         Toggle Tgl,
  27.                                         MenuSelection **Cascaders)
  28. {
  29.     NullSelection();
  30.     if (Label != NULL)
  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(    char *Label,
  41.                                 void (DFWindow::*CmdFunction)(),
  42.                                 int Accelerator,
  43.                                 Bool Active )
  44. {
  45.     CommonConstructor(Label, Accelerator, CmdFunction,
  46.                                 Active, NORMAL, Off);
  47. }
  48.  
  49. MenuSelection::MenuSelection(    char *Label,
  50.                                 void (DFWindow::*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(char *Label,
  60.                             MenuSelection **Cascaders,
  61.                             int Accelerator,
  62.                             Bool Active )
  63. {
  64.     CommonConstructor(Label, Accelerator, NULL,
  65.                             Active, CASCADER, Off, Cascaders);
  66. }
  67.  
  68. MenuSelection::MenuSelection(MenuType Type)
  69. {
  70.     NullSelection();
  71.     type = Type;
  72. }
  73.  
  74.  
  75.  
  76.