/[svn]/gigedit/trunk/src/gigedit/scriptslots.h
ViewVC logotype

Contents of /gigedit/trunk/src/gigedit/scriptslots.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2894 - (show annotations) (download) (as text)
Sat Apr 30 14:42:14 2016 UTC (7 years, 10 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 2009 byte(s)
* Enabled auto save & restore of window size & position of all
  remaining windows.
* Bumped version (1.0.0.svn7).

1 /*
2 Copyright (c) 2014 - 2016 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 #include "Settings.h"
16 #include "ManagedWindow.h"
17
18 class ScriptSlots : public ManagedWindow {
19 public:
20 ScriptSlots();
21 ~ScriptSlots();
22 void setInstrument(gig::Instrument* instrument);
23
24 // implementation for abstract methods of interface class "ManagedWindow"
25 virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->scriptSlotsWindowX; }
26 virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->scriptSlotsWindowY; }
27 virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->scriptSlotsWindowW; }
28 virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->scriptSlotsWindowH; }
29
30 protected:
31 struct Row {
32 int id;
33 Gtk::HBox* hbox;
34 Gtk::Label* label;
35 Gtk::Button* upButton;
36 Gtk::Button* downButton;
37 Gtk::Button* deleteButton;
38 gig::Script* script;
39 };
40
41 Gtk::VBox m_vbox;
42 Gtk::Label m_generalInfoLabel;
43 Gtk::HButtonBox m_buttonBox;
44 Gtk::ScrolledWindow m_scrolledWindow;
45 Gtk::VBox m_vboxSlots;
46 Gtk::Label m_dragHintLabel;
47 Gtk::Button m_closeButton;
48
49 gig::Instrument* m_instrument;
50 std::vector<Row> m_slots;
51
52 void onScriptDragNDropDataReceived(
53 const Glib::RefPtr<Gdk::DragContext>& context, int, int,
54 const Gtk::SelectionData& selection_data, guint, guint time);
55 void appendNewSlot(gig::Script* script);
56 void moveSlotUp(int slotID);
57 void moveSlotDown(int slotID);
58 void deleteSlot(int slotID);
59 void refreshSlots();
60 void onButtonClose();
61 void onWindowHide();
62 void clearSlots();
63 };
64
65 #endif // GIGEDIT_SCRIPTSLOTS_H

  ViewVC Help
Powered by ViewVC