1 /* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 * Ingo Weinhold <bonefish@cs.tu-berlin.de> 8 */ 9 10 #include "PopupView.h" 11 12 #include "PopupWindow.h" 13 14 // constructor 15 PopupView::PopupView(const char* name) 16 : BView(BRect(0.0, 0.0, 10.0, 10.0), name, 17 B_FOLLOW_NONE, B_WILL_DRAW), 18 fWindow(NULL) 19 { 20 } 21 22 // destructor 23 PopupView::~PopupView() 24 { 25 } 26 27 // SetPopupWindow 28 void 29 PopupView::SetPopupWindow(PopupWindow* window) 30 { 31 fWindow = window; 32 if (fWindow) 33 SetEventMask(B_POINTER_EVENTS); 34 else 35 SetEventMask(0); 36 } 37 38 // PopupDown 39 void 40 PopupView::PopupDone(bool canceled) 41 { 42 if (fWindow) 43 fWindow->PopupDone(canceled); 44 } 45 46