#ifndef POPUP_CONTROL_H
#define POPUP_CONTROL_H
#include <View.h>
#include <layout.h>
class PopupView;
class PopupWindow;
class PopupControl : public MView, public BView {
public:
PopupControl(const char* name,
PopupView* child);
virtual ~PopupControl();
virtual minimax layoutprefs() = 0;
virtual BRect layout(BRect frame) = 0;
virtual void MessageReceived(BMessage* message);
void SetPopupAlignment(float hPopupAlignment,
float vPopupAlignment);
void SetPopupLocation(BPoint leftTop);
virtual void ShowPopup(BPoint* offset = NULL);
virtual void HidePopup();
virtual void PopupShown();
virtual void PopupHidden(bool canceled);
private:
PopupWindow* fPopupWindow;
PopupView* fPopupChild;
float fHPopupAlignment;
float fVPopupAlignment;
BPoint fPopupLeftTop;
};
#endif