2014-09-02 17:33:29 +03:00
|
|
|
/*
|
|
|
|
|
Copyright (C) 2014 Waves Audio Ltd.
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __gtk2_ardour_waves_dropdown_h__
|
|
|
|
|
#define __gtk2_ardour_waves_dropdown_h__
|
|
|
|
|
|
|
|
|
|
#include "waves_icon_button.h"
|
2014-09-03 10:44:01 +03:00
|
|
|
#include "canvas/xml_ui.h"
|
|
|
|
|
|
|
|
|
|
using namespace ArdourCanvas::XMLUI;
|
2014-09-02 17:33:29 +03:00
|
|
|
|
|
|
|
|
class WavesDropdown : public WavesIconButton
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2014-09-03 10:44:01 +03:00
|
|
|
WavesDropdown (const std::string& title = "");
|
|
|
|
|
virtual ~WavesDropdown ();
|
|
|
|
|
Gtk::Menu& get_menu () { return _menu; }
|
2014-09-29 13:15:37 +03:00
|
|
|
void clear_items ();
|
2014-11-07 14:29:11 +02:00
|
|
|
int get_current_item () { return _current_item_number; }
|
2014-09-02 17:33:29 +03:00
|
|
|
|
2014-11-07 14:29:11 +02:00
|
|
|
void set_current_item (int current_item_number);
|
2014-09-02 17:33:29 +03:00
|
|
|
|
2014-09-29 13:15:37 +03:00
|
|
|
Gtk::MenuItem& add_menu_item (const std::string& item, void* cookie = 0);
|
|
|
|
|
Gtk::RadioMenuItem& add_radio_menu_item (const std::string& item, void* cookie = 0);
|
|
|
|
|
Gtk::CheckMenuItem& add_check_menu_item (const std::string& item, void* cookie = 0);
|
2014-09-02 17:33:29 +03:00
|
|
|
|
2014-09-08 16:20:14 +03:00
|
|
|
|
2014-09-29 13:15:37 +03:00
|
|
|
sigc::signal2<void, WavesDropdown*, void*> selected_item_changed;
|
2014-09-02 17:33:29 +03:00
|
|
|
|
|
|
|
|
private:
|
2014-09-03 10:44:01 +03:00
|
|
|
Gtk::Menu _menu;
|
2014-11-07 14:29:11 +02:00
|
|
|
int _current_item_number;
|
2014-09-29 13:15:37 +03:00
|
|
|
void _on_menu_item (int item_number, void* cookie);
|
2014-09-03 10:44:01 +03:00
|
|
|
void _on_popup_menu_position (int& x, int& y, bool& push_in);
|
2014-09-29 13:15:37 +03:00
|
|
|
bool _on_mouse_pressed (GdkEventButton*);
|
2014-09-02 17:33:29 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* __gtk2_ardour_waves_dropdown_h__ */
|