From: <pst...@us...> - 2010-07-17 23:53:00
|
Revision: 814 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=814&view=rev Author: pstieber Date: 2010-07-17 23:52:54 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Enabled keyboard handling in the piano window. 2. Removed commented computer keyboard code from the event window. Modified Paths: -------------- trunk/jazz/src/EventWindow.cpp trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2010-07-17 23:38:12 UTC (rev 813) +++ trunk/jazz/src/EventWindow.cpp 2010-07-17 23:52:54 UTC (rev 814) @@ -590,35 +590,3 @@ } } } - - -// JAVE the OnChar method seems to be gone in wxwin232, but its documented, so -// I don't know what happened. The OnCharHook should do the same thing -// basically. It was there from the start. OnChar seemd redundant. - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// void JZEventWindow::OnChar(wxKeyEvent& KeyEvent) -// { -// if (!EventWin->OnKeyEvent(KeyEvent)) -// { -// wxWindow::OnChar(KeyEvent); -// } -// } - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// void JZEventWindow::OnChar(wxKeyEvent& KeyEvent) -// { -// if (!OnKeyEvent(KeyEvent)) -// { -// wxFrame::OnChar(KeyEvent); -// } -// } - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//bool JZEventWindow::OnCharHook(wxKeyEvent& KeyEvent) -//{ -// return EventWin->OnKeyEvent(KeyEvent); -//} Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2010-07-17 23:38:12 UTC (rev 813) +++ trunk/jazz/src/PianoWindow.cpp 2010-07-17 23:52:54 UTC (rev 814) @@ -625,6 +625,8 @@ EVT_PAINT(JZPianoWindow::OnPaint) + EVT_CHAR(JZPianoWindow::OnChar) + EVT_MOUSE_EVENTS(JZPianoWindow::OnMouseEvent) EVT_SCROLLWIN(JZPianoWindow::OnScroll) @@ -1122,13 +1124,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool JZPianoWindow::OnCharHook(wxKeyEvent& Event) -{ - return OnKeyEvent(Event); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void JZPianoWindow::OnMenuCommand(int Id) { switch (Id) @@ -1141,7 +1136,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool JZPianoWindow::OnKeyEvent(wxKeyEvent& Event) +void JZPianoWindow::OnChar(wxKeyEvent& Event) { if (Event.ControlDown()) { @@ -1149,17 +1144,17 @@ { case 'Z': OnMenuCommand(wxID_UNDO); - return true; + return; case 'Y': OnMenuCommand(wxID_REDO); - return true; + return; case 'X': OnMenuCommand(wxID_CUT); - return true; + return; case 'C': case WXK_INSERT: OnMenuCommand(wxID_COPY); - return true; + return; } } else if (Event.ShiftDown()) @@ -1172,14 +1167,14 @@ --mTrackIndex; NewPosition(mTrackIndex, -1); } - return true; + return; case WXK_DOWN: if (mTrackIndex < mpProject->GetTrackCount() - 1) { ++mTrackIndex; NewPosition(mTrackIndex, -1); } - return true; + return; } } else @@ -1188,11 +1183,11 @@ { case WXK_DELETE: OnMenuCommand(wxID_DELETE); - return true; + return; } } - return false; + Event.Skip(); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2010-07-17 23:38:12 UTC (rev 813) +++ trunk/jazz/src/PianoWindow.h 2010-07-17 23:52:54 UTC (rev 814) @@ -280,12 +280,8 @@ void MousePiano(wxMouseEvent& MouseEvent); - bool OnCharHook(wxKeyEvent& Event); - void OnChar(wxKeyEvent& Event); - bool OnKeyEvent(wxKeyEvent& Event); - void OnMenuCommand(int Id); void InitColors(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |