Permalink
Browse files

Correct PianoWin assumed parentage.

  • Loading branch information...
David Register
David Register committed Jun 12, 2012
1 parent 5b8c8b4 commit 3cf459cc1ddb68a9c0eea98308dca9df3945a5ab
Showing with 6 additions and 8 deletions.
  1. +0 −1 include/statwin.h
  2. +6 −7 src/statwin.cpp
View
@@ -114,7 +114,6 @@ class PianoWin: public wxWindow
wxBrush m_cBrush;
wxBrush m_scBrush;
MyFrame *gparent;
ArrayOfInts m_key_array;
ArrayOfInts m_noshow_index_array;
ArrayOfInts m_active_index_array;
View
@@ -47,6 +47,7 @@
//------------------------------------------------------------------------------
extern ChartDB *ChartData;
extern ocpnStyle::StyleManager* g_StyleManager;
extern MyFrame *gFrame;
//------------------------------------------------------------------------------
@@ -242,8 +243,6 @@ PianoWin::PianoWin(wxFrame *frame):
m_hover_last = -1;
m_brounded = false;
gparent = (MyFrame *)GetGrandParent();
m_nRegions = 0;
SetBackgroundStyle(wxBG_STYLE_CUSTOM); // on WXMSW, this prevents flashing on color scheme change
@@ -554,15 +553,15 @@ void PianoWin::MouseEvent(wxMouseEvent& event)
if(-1 != sel_index)
{
gparent->HandlePianoClick(sel_index, sel_dbindex);
gFrame->HandlePianoClick(sel_index, sel_dbindex);
}
}
else if(event.RightDown())
{
if(-1 != sel_index)
{
gparent->HandlePianoRClick(x, y, sel_index, sel_dbindex);
gFrame->HandlePianoRClick(x, y, sel_index, sel_dbindex);
}
}
@@ -571,16 +570,16 @@ void PianoWin::MouseEvent(wxMouseEvent& event)
if(sel_index != m_hover_last)
{
gparent->HandlePianoRollover(sel_index, sel_dbindex);
gFrame->HandlePianoRollover(sel_index, sel_dbindex);
m_hover_last = sel_index;
}
}
if(event.Leaving())
{
gparent->HandlePianoRollover(-1, -1);
gparent->HandlePianoRolloverIcon(-1, -1);
gFrame->HandlePianoRollover(-1, -1);
gFrame->HandlePianoRolloverIcon(-1, -1);
m_index_last = -1;
m_hover_icon_last = -1;

0 comments on commit 3cf459c

Please sign in to comment.