1 /* 2 * Copyright 2015, Rene Gollent, rene@gollent.com. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef TABLE_CELL_OPTION_POPUP_EDITOR_H 6 #define TABLE_CELL_OPTION_POPUP_EDITOR_H 7 8 #include <OptionPopUp.h> 9 10 #include "TableCellFormattedValueEditor.h" 11 12 13 // common base class for editors that have a fixed set of chooseable 14 // values known up front 15 class TableCellOptionPopUpEditor : public TableCellFormattedValueEditor, 16 protected BOptionPopUp { 17 public: 18 TableCellOptionPopUpEditor( 19 ::Value* initialValue, 20 ValueFormatter* formatter); 21 virtual ~TableCellOptionPopUpEditor(); 22 23 status_t Init(); 24 25 virtual BView* GetView(); 26 27 virtual status_t ConfigureOptions() = 0; 28 29 protected: 30 virtual status_t GetSelectedValue(::Value*& _value) const = 0; 31 32 virtual void AttachedToWindow(); 33 virtual void MessageReceived(BMessage* message); 34 }; 35 36 #endif // TABLE_CELL_TEXT_CONTROL_EDITOR_H 37