home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
215
/
DDJ9302.ZIP
/
DFPP01.ZIP
/
POPDOWN.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-21
|
2KB
|
67 lines
// -------- popdown.h
#ifndef POPDOWN_H
#define POPDOWN_H
#include "desktop.h"
#include "listbox.h"
const unsigned char LEDGE = '\xc3';
const unsigned char REDGE = '\xb4';
const unsigned char CASCADEPOINTER = '\x10';
inline unsigned char CheckMark()
{
return desktop.screen().Height() == 25 ? 251 : 4;
}
class MenuSelection;
class MenuBar;
class PopDown : public ListBox {
MenuSelection **selections; // array of selections
Bool isopen; // True = menu is open
Bool iscascaded; // True = menu is cascaded
int menuwidth; // width of menu
int menuheight; // height of menu
void BuildMenuLine(int sel);
void MenuDimensions();
void SetColors();
void DisplayMenuLine(int lno);
Bool ShortCutKey(int key);
protected:
void ClearSelection();
public:
PopDown(DFWindow *par, MenuSelection **Selections = NULL)
: ListBox(5, 5, par)
{ selections = Selections; OpenWindow(); }
virtual ~PopDown()
{ if (windowstate != CLOSED) CloseWindow(); }
// -------- listbox API messages
void OpenWindow();
void CloseWindow();
void OpenMenu(int left, int top);
void CloseMenu(Bool SendESC);
void Show();
void Paint();
void Border();
void Keyboard(int key);
void ShiftChanged(int sk);
void ButtonReleased(int mx, int my);
void LeftButton(int mx, int my);
void DoubleClick(int mx, int my);
void Choose();
void SetSelection(int sel);
Bool isOpen() { return isopen; }
Bool &isCascaded() { return iscascaded; }
Bool AcceleratorKey(int key);
Bool ParentisMenu(DFWindow &wnd);
Bool ParentisMenu() { return ParentisMenu(*this); }
};
#endif