2015-08-09 23:47:08 +02:00
|
|
|
// fmenubar.h
|
|
|
|
// class FMenuBar
|
|
|
|
|
|
|
|
#ifndef _FMENUBAR_H
|
|
|
|
#define _FMENUBAR_H
|
|
|
|
|
|
|
|
#include "fwindow.h"
|
|
|
|
#include "fmenulist.h"
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class FMenuBar
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
|
|
|
class FMenuBar : public FWindow, public FMenuList
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
bool mouse_down;
|
|
|
|
int x;
|
|
|
|
|
|
|
|
private:
|
|
|
|
FMenuBar (const FMenuBar&);
|
|
|
|
FMenuBar& operator = (const FMenuBar&);
|
|
|
|
void init();
|
2015-08-16 20:05:39 +02:00
|
|
|
bool isMenu (FMenuItem*) const;
|
|
|
|
int getHotkeyPos (wchar_t*&, wchar_t*&, uInt);
|
2015-08-09 23:47:08 +02:00
|
|
|
void draw();
|
|
|
|
void drawItems();
|
|
|
|
void adjustSize();
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit FMenuBar (FWidget* parent=0); // constructor
|
|
|
|
virtual ~FMenuBar(); // destructor
|
|
|
|
virtual const char* getClassName() const;
|
|
|
|
|
|
|
|
void onMouseDown (FMouseEvent*);
|
|
|
|
void onMouseUp (FMouseEvent*);
|
|
|
|
void onMouseMove (FMouseEvent*);
|
|
|
|
void hide();
|
2015-09-22 04:18:20 +02:00
|
|
|
// make every setGeometry from FWidget available
|
|
|
|
using FWidget::setGeometry;
|
2015-08-09 23:47:08 +02:00
|
|
|
void setGeometry (int, int, int, int, bool adjust=true);
|
2015-08-16 20:05:39 +02:00
|
|
|
void cb_item_activated (FWidget*, void*);
|
2015-08-09 23:47:08 +02:00
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
|
|
|
|
// FMenuBar inline functions
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline const char* FMenuBar::getClassName() const
|
|
|
|
{ return "FMenuBar"; }
|
|
|
|
|
|
|
|
#endif // _FMENUBAR_H
|