From: <pst...@us...> - 2009-01-19 17:56:33
|
Revision: 685 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=685&view=rev Author: pstieber Date: 2009-01-19 17:56:29 +0000 (Mon, 19 Jan 2009) Log Message: ----------- 1. Added a pointer to the associated event window as a data member. 2. Added event handlers for shifting events. This is a WIP. Modified Paths: -------------- trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-01-19 17:53:36 UTC (rev 684) +++ trunk/jazz/src/EventFrame.cpp 2009-01-19 17:56:29 UTC (rev 685) @@ -1,10 +1,11 @@ #include "EventFrame.h" #include "Command.h" -#include "Dialogs/ShiftDialog.h" #include "Dialogs.h" +#include "EventWindow.h" #include "Filter.h" #include "MouseAction.h" +#include "Resources.h" #include "ToolBar.h" #include <wx/dc.h> @@ -21,18 +22,23 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZEventFrame, wxFrame) + + EVT_UPDATE_UI(ID_SHIFT, JZEventFrame::OnUpdateEditShift) + EVT_MENU(ID_SHIFT, JZEventFrame::OnEditShift) + EVT_SIZE(JZEventFrame::OnSize) + END_EVENT_TABLE() //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZEventFrame::JZEventFrame( - wxWindow* pParent, + JZEventWindow* pEventWindow, const wxString& Title, JZSong* pSong, const wxPoint& Position, const wxSize& Size) - : wxFrame(pParent, wxID_ANY, Title, Position, Size), + : wxFrame(pEventWindow, wxID_ANY, Title, Position, Size), Song(pSong), mpFilter(0), mpFixedFont(0), @@ -60,7 +66,8 @@ MixerForm(0), mpToolBar(0), mpGreyColor(0), - mpGreyBrush(0) + mpGreyBrush(0), + mpEventWindow(pEventWindow) { #ifdef __WXMSW__ mpGreyColor = new wxColor(192, 192, 192); @@ -149,6 +156,20 @@ } //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::OnUpdateEditShift(wxUpdateUIEvent& Event) +{ + Event.Enable(mpEventWindow->AreEventsSelected()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::OnEditShift(wxCommandEvent& Event) +{ +// mpEventWindow->Shift(); +} + +//----------------------------------------------------------------------------- // this onsize handler is supposed to take care of handling of the resizing // the two subwindows sizes to they dont overlap //----------------------------------------------------------------------------- @@ -455,22 +476,7 @@ } //----------------------------------------------------------------------------- -// show the "shift events" dialog //----------------------------------------------------------------------------- -void JZEventFrame::MenShift(int Unit) -{ - if (EventsSelected()) - { - JZShiftDialog ShiftDialog(*this, *mpFilter, this); - - if (ShiftDialog.ShowModal() == wxID_OK) - { - } - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void JZEventFrame::MenDelete() { if (!EventsSelected()) Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-01-19 17:53:36 UTC (rev 684) +++ trunk/jazz/src/EventFrame.h 2009-01-19 17:56:29 UTC (rev 685) @@ -25,6 +25,7 @@ #include <wx/frame.h> +class JZEventWindow; class JZFilter; class JZSnapSelection; class JZSong; @@ -34,10 +35,9 @@ //***************************************************************************** // Description: -// A frame window that containes a scrolled event window. Acts as the -// common base class for JZTrackFrame and JSPianoFrame. -// -// The panel and menu are administered by derived classes. +// A frame window that containes a scrolled event window. This class acts +// as the common base class for the JZTrackFrame class and the JZPianoFrame +// class. // Functionality: // - Settings dialog // - Selection via Snapsel @@ -46,12 +46,9 @@ { public: - bool OnCharHook(wxKeyEvent& event); - void OnChar(wxKeyEvent& event); - // 2-step initialization: 1) constructor JZEventFrame( - wxWindow* pParent, + JZEventWindow* pEventWindow, const wxString& Title, JZSong* pSong, const wxPoint& Position = wxDefaultPosition, @@ -104,7 +101,6 @@ // Events virtual int OnMouseEvent(wxMouseEvent& Event); virtual bool OnKeyEvent(wxKeyEvent& Event); // true = processed by eventwin - virtual void OnSize(wxSizeEvent& Event); virtual void OnMenuCommand(int id); virtual bool OnClose(); @@ -123,10 +119,20 @@ // if selection active: TRUE, else: Errormessage + FALSE int EventsSelected(const char* msg = 0); + private: + + void OnUpdateEditShift(wxUpdateUIEvent& Event); + void OnEditShift(wxCommandEvent& Event); + + void OnSize(wxSizeEvent& Event); + + bool OnCharHook(wxKeyEvent& Event); + + void OnChar(wxKeyEvent& Event); + void MenQuantize(); void MenSetChannel(); void MenTranspose(); - void MenShift(int Unit); void MenDelete(); void MenVelocity(); void MenLength(); @@ -143,6 +149,8 @@ wxColor* mpGreyColor; wxBrush* mpGreyBrush; + JZEventWindow* mpEventWindow; + DECLARE_EVENT_TABLE() }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |