|
From: <pst...@us...> - 2008-04-08 23:58:18
|
Revision: 447
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=447&view=rev
Author: pstieber
Date: 2008-04-08 16:58:16 -0700 (Tue, 08 Apr 2008)
Log Message:
-----------
Changed PrepareDC to DoPrepareDC and made some cosmetic changes.
Modified Paths:
--------------
trunk/jazz/src/PianoWindow.cpp
Modified: trunk/jazz/src/PianoWindow.cpp
===================================================================
--- trunk/jazz/src/PianoWindow.cpp 2008-04-08 23:56:56 UTC (rev 446)
+++ trunk/jazz/src/PianoWindow.cpp 2008-04-08 23:58:16 UTC (rev 447)
@@ -228,7 +228,7 @@
wxClientDC Dc(Win);
// to translate scrolled coordinates
- Win->PrepareDC(Dc);
+ Win->DoPrepareDC(Dc);
Win->DrawEvent(Dc, Copy, wxWHITE_BRUSH, 0);
Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 1, 1);
@@ -250,7 +250,7 @@
int tKeyLengthDragger::Dragging(wxMouseEvent& Event)
{
wxClientDC Dc(Win);
- Win->PrepareDC(Dc); //to translate scrolled coordinates
+ Win->DoPrepareDC(Dc); //to translate scrolled coordinates
Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 1, 1);
int fx, fy;
Win->LogicalMousePosition(Event, fx, fy);
@@ -339,7 +339,7 @@
Win->GetSong()->NewUndoBuffer();
//
wxClientDC Dc(Win);
- Win->PrepareDC(Dc);
+ Win->DoPrepareDC(Dc);
Win->DrawEvent(Dc, Copy, wxWHITE_BRUSH, 0);
Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 1, 1);
}
@@ -360,7 +360,7 @@
int tPlayTrackLengthDragger::Dragging(wxMouseEvent& Event)
{
wxClientDC Dc(Win);
- Win->PrepareDC(Dc);
+ Win->DoPrepareDC(Dc);
Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 1, 1);
int fx, fy;
Win->LogicalMousePosition(Event, fx, fy);
@@ -377,7 +377,7 @@
int tPlayTrackLengthDragger::ButtonUp(wxMouseEvent& Event)
{
wxClientDC Dc(Win);
- Win->PrepareDC(Dc);
+ Win->DoPrepareDC(Dc);
Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 1, 1);
Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 0, 1);
@@ -437,7 +437,7 @@
Win->ApplyToTrack(mpKeyOn, Copy);
wxClientDC Dc(Win);
- Win->PrepareDC(Dc);
+ Win->DoPrepareDC(Dc);
Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 0, 1);
Win->UpdateControl();
@@ -1753,7 +1753,9 @@
int x;
int y;
LogicalMousePosition(Event, x, y);
- if (mEventsX < x && x < mEventsX + mEventsWidth && mEventsY < y && y < mEventsY + mEventsHeight)
+ if (
+ mEventsX < x && x < mEventsX + mEventsWidth &&
+ mEventsY < y && y < mEventsY + mEventsHeight)
{
if (Event.LeftDown())
{
@@ -1762,7 +1764,9 @@
if (mpSnapSel->Selected)
{
- Refresh(); //redraw the whole window instead(inefficient, we should rather invalidate a rect)
+ // Redraw the whole window instead (inefficient, we should rather
+ // invalidate a rect).
+ Refresh();
}
mpSnapSel->Event(Event);
mpMouseAction = mpSnapSel;
@@ -1781,7 +1785,10 @@
if (mpMouseAction == mpSnapSel)
{
SnapSelStop(Event);
- Refresh(); //ineficcient, invalidate rect first instead
+
+ // inefficient, invalidate rect first instead.
+ Refresh();
+
mpMouseAction = 0;
return 1;
}
@@ -1792,11 +1799,14 @@
return 0;
}
+//-----------------------------------------------------------------------------
+// Description:
// Indicate which key on the pianoroll that the mouse is hovering over by
// highlighting it. This function is bad because it draws directly in the dc,
// rather it should invalidate and let OnDraw do the actual painting.
// Currently the code doesn't work because it doesn't care about scrolling
// (because I get the dc the wrong way).
+//-----------------------------------------------------------------------------
void JZPianoWindow::ShowPitch(int Pitch)
{
// This is the current position of the mouse. mMouseLine is the last
@@ -1807,7 +1817,7 @@
wxClientDC Dc(this);
// Translate scrolled coordinates.
- PrepareDC(Dc);
+ DoPrepareDC(Dc);
Dc.SetLogicalFunction(wxXOR);
@@ -1875,7 +1885,7 @@
{
wxClientDC Dc(this);
- PrepareDC(Dc);
+ DoPrepareDC(Dc);
// Convert physical coordinates to logical (scrolled) coordinates.
wxPoint Point = Event.GetLogicalPosition(Dc);
@@ -2660,7 +2670,7 @@
}
wxClientDC Dc(this);
- PrepareDC(Dc);
+ DoPrepareDC(Dc);
DrawEvent(Dc, pEvent, wxWHITE_BRUSH, 0);
pTrack->Kill(pEvent);
pTrack->Cleanup();
@@ -2745,7 +2755,7 @@
}
}
wxClientDC Dc(this);
- PrepareDC(Dc);
+ DoPrepareDC(Dc);
DrawEvent(Dc, c, c->GetBrush(), 0, 1);
pTrack->Put(c);
pEvent = Iterator.Next();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|