1 |
schoenebeck |
2610 |
/* |
2 |
|
|
Copyright (c) 2014 Christian Schoenebeck |
3 |
|
|
|
4 |
|
|
This file is part of "gigedit" and released under the terms of the |
5 |
|
|
GNU General Public License version 2. |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
#ifndef GIGEDIT_SCRIPTSLOTS_H |
9 |
|
|
#define GIGEDIT_SCRIPTSLOTS_H |
10 |
|
|
|
11 |
|
|
#include <gig.h> |
12 |
|
|
#include <gtkmm.h> |
13 |
|
|
#include "compat.h" |
14 |
|
|
#include <vector> |
15 |
|
|
|
16 |
|
|
class ScriptSlots : public Gtk::Window { |
17 |
|
|
public: |
18 |
|
|
ScriptSlots(); |
19 |
|
|
~ScriptSlots(); |
20 |
|
|
void setInstrument(gig::Instrument* instrument); |
21 |
|
|
protected: |
22 |
|
|
struct Row { |
23 |
|
|
int id; |
24 |
|
|
Gtk::HBox* hbox; |
25 |
|
|
Gtk::Label* label; |
26 |
|
|
Gtk::Button* upButton; |
27 |
|
|
Gtk::Button* downButton; |
28 |
|
|
Gtk::Button* deleteButton; |
29 |
|
|
gig::Script* script; |
30 |
|
|
}; |
31 |
|
|
|
32 |
|
|
Gtk::VBox m_vbox; |
33 |
|
|
Gtk::Label m_generalInfoLabel; |
34 |
|
|
Gtk::HButtonBox m_buttonBox; |
35 |
|
|
Gtk::ScrolledWindow m_scrolledWindow; |
36 |
|
|
Gtk::VBox m_vboxSlots; |
37 |
|
|
Gtk::Label m_dragHintLabel; |
38 |
|
|
Gtk::Button m_closeButton; |
39 |
|
|
|
40 |
|
|
gig::Instrument* m_instrument; |
41 |
|
|
std::vector<Row> m_slots; |
42 |
|
|
|
43 |
|
|
void onScriptDragNDropDataReceived( |
44 |
|
|
const Glib::RefPtr<Gdk::DragContext>& context, int, int, |
45 |
|
|
const Gtk::SelectionData& selection_data, guint, guint time); |
46 |
|
|
void appendNewSlot(gig::Script* script); |
47 |
|
|
void moveSlotUp(int slotID); |
48 |
|
|
void moveSlotDown(int slotID); |
49 |
|
|
void deleteSlot(int slotID); |
50 |
|
|
void refreshSlots(); |
51 |
|
|
void onButtonClose(); |
52 |
|
|
void onWindowHide(); |
53 |
|
|
void clearSlots(); |
54 |
|
|
}; |
55 |
|
|
|
56 |
|
|
#endif // GIGEDIT_SCRIPTSLOTS_H |