home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
215
/
DDJ9304.ZIP
/
DFPP01.ZIP
/
MENUBAR.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-21
|
1KB
|
55 lines
// -------- menubar.h
#ifndef MENUBAR_H
#define MENUBAR_H
#include "textbox.h"
#include "popdown.h"
enum MenuTerminator { MENU_TERMINATOR };
class MenuBarItem {
public:
String *title; // menu bar selection label
int x1; // 1st label position on bar
int x2; // last " " " "
MenuSelection **ms; // popdown selection list
PopDown *popdown; // popdown window
void (*menuprep)(); // menu prep function
Bool terminator; // true = terminator entry
MenuBarItem(char *Title, MenuSelection **Ms,
void (*MenuPrep)() = NULL);
MenuBarItem(MenuTerminator Type);
~MenuBarItem() { if (title) delete title; }
};
class MenuBar : public TextBox {
MenuBarItem *menuitems; // list of popdowns
int menucount; // count of popdowns
int selection; // current selection on the bar
Bool ispoppeddown; // True = a menu is down
DFWindow *oldfocus; // previous focus
void SetColors();
void Select();
Bool AcceleratorKey(int key);
Bool ShortCutKey(int key);
public:
MenuBar(MenuBarItem *MenuItems, DFWindow *par);
~MenuBar();
// -------- menubar API messages
void Keyboard(int key);
void LeftButton(int mx, int my);
Bool SetFocus();
void ResetFocus();
void Paint();
void Select(int sel);
void SetSelection(int sel);
void ParentSized(int xdif, int ydif);
};
#endif