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

  1. // -------- popdown.h 
  2.  
  3. #ifndef POPDOWN_H
  4. #define POPDOWN_H
  5.  
  6. #include "desktop.h"
  7. #include "listbox.h"
  8.  
  9. const unsigned char LEDGE          = '\xc3';
  10. const unsigned char REDGE          = '\xb4';
  11. const unsigned char CASCADEPOINTER = '\x10';
  12.  
  13. inline unsigned char CheckMark()
  14. {
  15.     return desktop.screen().Height() == 25 ? 251 : 4;
  16. }
  17.  
  18. class MenuSelection;
  19. class MenuBar;
  20.  
  21. class PopDown : public ListBox    {
  22.     MenuSelection **selections; // array of selections
  23.     Bool isopen;                // True = menu is open
  24.     Bool iscascaded;            // True = menu is cascaded
  25.     int menuwidth;              // width of menu
  26.     int menuheight;             // height of menu
  27.  
  28.     void BuildMenuLine(int sel);
  29.     void MenuDimensions();
  30.     void DisplayMenuLine(int lno);
  31.     Bool ShortcutKey(int key);
  32. protected:
  33.     void ClearSelection();
  34. public:
  35.     PopDown(DFWindow *par, MenuSelection **Selections = 0);
  36.     // -------- listbox API messages
  37.     void CloseWindow();
  38.     void OpenMenu(int left, int top);
  39.     void CloseMenu(Bool SendESC = False);
  40.     void Show();
  41.     void Paint();
  42.     void Border();
  43.     void Keyboard(int key);
  44.     void ShiftChanged(int sk);
  45.     void ButtonReleased(int mx, int my);
  46.     void LeftButton(int mx, int my);
  47.     void DoubleClick(int mx, int my);
  48.     void Choose();
  49.     void SetSelection(int sel);
  50.     Bool isOpen() { return isopen; }
  51.     Bool &isCascaded() { return iscascaded; }
  52.     Bool AcceleratorKey(int key);
  53.     Bool ParentisMenu(DFWindow &wnd);
  54.     Bool ParentisMenu() { return ParentisMenu(*this); }
  55. };
  56.  
  57. #endif
  58.  
  59.  
  60.  
  61.