From: <pst...@us...> - 2013-04-06 17:41:38
|
Revision: 1003 http://sourceforge.net/p/jazzplusplus/code/1003 Author: pstieber Date: 2013-04-06 17:41:36 +0000 (Sat, 06 Apr 2013) Log Message: ----------- Added code to create a toolbar in the rhythm frame. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-02 20:27:58 UTC (rev 1002) +++ trunk/jazz/src/Rhythm.cpp 2013-04-06 17:41:36 UTC (rev 1003) @@ -52,6 +52,15 @@ using namespace std; +#include "Bitmaps/open.xpm" +#include "Bitmaps/save.xpm" +#include "Bitmaps/rrgadd.xpm" +#include "Bitmaps/rrgdel.xpm" +#include "Bitmaps/rrgup.xpm" +#include "Bitmaps/rrgdown.xpm" +#include "Bitmaps/rrggen.xpm" +#include "Bitmaps/help.xpm" + void tRhyGroup::write(ostream& Os) const { Os << listen << ' '; @@ -1351,8 +1360,11 @@ gpConfig->GetValue(C_RhythmXpos), gpConfig->GetValue(C_RhythmYpos)), wxSize(640, 580)), + mpToolBar(0), mpRhythmGeneratorWindow(0) { + CreateToolBar(); + wxMenu* pFileMenu = new wxMenu; pFileMenu->Append(wxID_OPEN, "&Load..."); pFileMenu->Append(wxID_SAVEAS, "Save &As..."); @@ -1384,6 +1396,28 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorFrame::CreateToolBar() +{ + JZToolDef ToolBarDefinitions[] = + { + { wxID_OPEN, false, open_xpm, "open rhythm file" }, + { wxID_SAVE, false, save_xpm, "save into rhythm file" }, + { JZToolBar::eToolBarSeparator }, + { ID_INSTRUMENT_ADD, false, rrgadd_xpm, "add instrument" }, + { ID_INSTRUMENT_DELETE, false, rrgdel_xpm, "remove instrument" }, + { ID_INSTRUMENT_UP, false, rrgup_xpm, "move instrument up" }, + { ID_INSTRUMENT_DOWN, false, rrgdown_xpm, "move instrument down" }, + { ID_INSTRUMENT_GENERATE, false, rrggen_xpm, "generate events into trackwin selection" }, + { JZToolBar::eToolBarSeparator }, + { wxID_HELP_CONTENTS, false, help_xpm, "help" }, + { JZToolBar::eToolBarEnd } + }; + + mpToolBar = new JZToolBar(this, ToolBarDefinitions); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRhythmGeneratorFrame::~JZRhythmGeneratorFrame() { delete mpRhythmGeneratorWindow; Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-04-02 20:27:58 UTC (rev 1002) +++ trunk/jazz/src/Rhythm.h 2013-04-06 17:41:36 UTC (rev 1003) @@ -25,8 +25,6 @@ #include "Globals.h" #include "Random.h" -#include "ToolBar.h" - #include <wx/frame.h> #include <iostream> @@ -34,6 +32,7 @@ class JZBarInfo; class JZEventWindow; class JZSong; +class JZToolBar; class JZTrack; class wxButton; class wxCheckBox; @@ -275,12 +274,16 @@ private: + void CreateToolBar(); + void OnHelp(wxCommandEvent& Event); void OnHelpContents(wxCommandEvent& Event); private: + JZToolBar* mpToolBar; + JZRhythmGeneratorWindow* mpRhythmGeneratorWindow; DECLARE_EVENT_TABLE() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |