Thread: [Wgui-cvs] wgui/wgui_ex/src wgex_bufferdisplay.cpp,1.9,1.10 wgex_button.cpp,1.3,1.4 wgex_display.cpp
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2005-01-07 22:08:50
|
Update of /cvsroot/wgui/wgui/wgui_ex/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/wgui_ex/src Modified Files: wgex_bufferdisplay.cpp wgex_button.cpp wgex_display.cpp wgex_joystick.cpp wgex_keypiano.cpp wgex_popupmenu.cpp Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: wgex_joystick.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_joystick.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wgex_joystick.cpp 24 Nov 2003 17:36:05 -0000 1.4 --- wgex_joystick.cpp 7 Jan 2005 22:08:39 -0000 1.5 *************** *** 72,79 **** m_iPosX = m_DeltaOffset.XPos() + (int)( m_fValueX * m_DeltaSize.XPos() ); m_iPosY = m_DeltaOffset.YPos() + (int)( m_fValueY * m_DeltaSize.YPos() ); ! CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, this, this, m_fValueX) ); // CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, this, this, m_fValueY) ); ! StartDrawProc(); } --- 72,79 ---- m_iPosX = m_DeltaOffset.XPos() + (int)( m_fValueX * m_DeltaSize.XPos() ); m_iPosY = m_DeltaOffset.YPos() + (int)( m_fValueY * m_DeltaSize.YPos() ); ! CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, this, this, m_fValueX) ); // CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, this, this, m_fValueY) ); ! StartDrawProc(); } *************** *** 85,89 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { --- 85,89 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { *************** *** 91,100 **** CMessage::EMessageType MessageType = CMessage::UNKNOWN; ! switch( m_iMouseButton ) { case CMouseMessage::LEFT: // picker { ! MessageType = CMessage::CTRL_LCLICK; CApplication::Instance()->SetMouseVisibility( 0 ); CApplication::Instance()->SetMouseFocus( this ); --- 91,100 ---- CMessage::EMessageType MessageType = CMessage::UNKNOWN; ! switch( m_iMouseButton ) { case CMouseMessage::LEFT: // picker { ! MessageType = CMessage::CTRL_SINGLELCLICK; CApplication::Instance()->SetMouseVisibility( 0 ); CApplication::Instance()->SetMouseFocus( this ); *************** *** 103,110 **** break; } ! case CMouseMessage::MIDDLE: // random { ! MessageType = CMessage::CTRL_MCLICK; double newPosX = rand() / (double)( RAND_MAX + 1 ); double newPosY = rand() / (double)( RAND_MAX + 1 ); --- 103,110 ---- break; } ! case CMouseMessage::MIDDLE: // random { ! MessageType = CMessage::CTRL_SINGLEMCLICK; double newPosX = rand() / (double)( RAND_MAX + 1 ); double newPosY = rand() / (double)( RAND_MAX + 1 ); *************** *** 117,121 **** case CMouseMessage::RIGHT: // inverse { ! MessageType = CMessage::CTRL_RCLICK; CApplication::Instance()->SetMouseVisibility( 0 ); CApplication::Instance()->SetMouseFocus( this ); --- 117,121 ---- case CMouseMessage::RIGHT: // inverse { ! MessageType = CMessage::CTRL_SINGLERCLICK; CApplication::Instance()->SetMouseVisibility( 0 ); CApplication::Instance()->SetMouseFocus( this ); *************** *** 126,130 **** } ! } return bResult; --- 126,130 ---- } ! } return bResult; *************** *** 207,211 **** SetSliderPos( newPosX, newPosY ); ! bHandled = true; break; --- 207,211 ---- SetSliderPos( newPosX, newPosY ); ! bHandled = true; break; *************** *** 266,270 **** m_WindowRect.Top() + m_WindowRect.Height() / 2, COLOR_BLACK, 50 ); ! // mid y line Painter.DrawVLineAlpha( --- 266,270 ---- m_WindowRect.Top() + m_WindowRect.Height() / 2, COLOR_BLACK, 50 ); ! // mid y line Painter.DrawVLineAlpha( Index: wgex_display.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_display.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wgex_display.cpp 16 Jul 2004 16:41:36 -0000 1.14 --- wgex_display.cpp 7 Jan 2005 22:08:39 -0000 1.15 *************** *** 195,199 **** case CMouseMessage::LEFT: { ! MessageType = CMessage::CTRL_LCLICK; // reset release mode --- 195,199 ---- case CMouseMessage::LEFT: { ! MessageType = CMessage::CTRL_SINGLELCLICK; // reset release mode *************** *** 213,217 **** case CMouseMessage::MIDDLE: { ! MessageType = CMessage::CTRL_MCLICK; // reset release mode --- 213,217 ---- case CMouseMessage::MIDDLE: { ! MessageType = CMessage::CTRL_SINGLEMCLICK; // reset release mode *************** *** 235,239 **** case CMouseMessage::RIGHT: { ! MessageType = CMessage::CTRL_RCLICK; // set mouse stuff --- 235,239 ---- case CMouseMessage::RIGHT: { ! MessageType = CMessage::CTRL_SINGLERCLICK; // set mouse stuff Index: wgex_keypiano.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_keypiano.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wgex_keypiano.cpp 25 Nov 2003 17:25:55 -0000 1.3 --- wgex_keypiano.cpp 7 Jan 2005 22:08:39 -0000 1.4 *************** *** 44,48 **** { 38, 2, 5, 16 }, // G# { 41, 1, 8, 32 }, // A ! { 46, 2, 5, 16 }, // A# { 49, 1, 8, 32 } // B }; --- 44,48 ---- { 38, 2, 5, 16 }, // G# { 41, 1, 8, 32 }, // A ! { 46, 2, 5, 16 }, // A# { 49, 1, 8, 32 } // B }; *************** *** 79,83 **** if( m_iKeyPressed >= 0 ) DrawSingleKey( m_iKeyPressed ); ! if( ( m_iKeyLower >= 0 && m_iKeyLower <= 60 ) && ( m_iKeyUpper >= 0 && m_iKeyUpper <= 60 ) && --- 79,83 ---- if( m_iKeyPressed >= 0 ) DrawSingleKey( m_iKeyPressed ); ! if( ( m_iKeyLower >= 0 && m_iKeyLower <= 60 ) && ( m_iKeyUpper >= 0 && m_iKeyUpper <= 60 ) && *************** *** 94,98 **** int iOctaveNumber = iNoteNumber / 12; int iNoteOffset = iNoteNumber % 12; ! int w = KeysOffset[iNoteOffset].wOffset; int h = KeysOffset[iNoteOffset].hOffset; --- 94,98 ---- int iOctaveNumber = iNoteNumber / 12; int iNoteOffset = iNoteNumber % 12; ! int w = KeysOffset[iNoteOffset].wOffset; int h = KeysOffset[iNoteOffset].hOffset; *************** *** 136,140 **** int note = ( PointHit.XPos() - m_WindowRect.Left() ) % 57; int off_x, off_y = ( PointHit.YPos() - m_WindowRect.Top() ); ! // int off_x; int k = 0; --- 136,140 ---- int note = ( PointHit.XPos() - m_WindowRect.Left() ) % 57; int off_x, off_y = ( PointHit.YPos() - m_WindowRect.Top() ); ! // int off_x; int k = 0; *************** *** 154,158 **** k = 0; } ! if( k < 0 ) { octave--; --- 154,158 ---- k = 0; } ! if( k < 0 ) { octave--; *************** *** 163,167 **** } ! //________________________________________________________________ bool CKeyPiano::OnMouseButtonDown(CPoint Point, unsigned int Button) --- 163,167 ---- } ! //________________________________________________________________ bool CKeyPiano::OnMouseButtonDown(CPoint Point, unsigned int Button) *************** *** 169,173 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { --- 169,173 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { *************** *** 175,179 **** CMessage::EMessageType MessageType = CMessage::UNKNOWN; ! switch( m_iMouseButton ) { --- 175,179 ---- CMessage::EMessageType MessageType = CMessage::UNKNOWN; ! switch( m_iMouseButton ) { *************** *** 181,188 **** { m_iKeyPressed = PointToKey( Point ); ! CMessageServer::Instance().QueueMessage( ! new TIntMessage(CMessage::CTRL_LCLICK, m_pParentWindow, this, m_iKeyPressed) ); ! CApplication::Instance()->SetMouseFocus( this ); StartDrawProc(); --- 181,188 ---- { m_iKeyPressed = PointToKey( Point ); ! CMessageServer::Instance().QueueMessage( ! new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, m_iKeyPressed) ); ! CApplication::Instance()->SetMouseFocus( this ); StartDrawProc(); *************** *** 190,194 **** break; } ! case CMouseMessage::RIGHT: { --- 190,194 ---- break; } ! case CMouseMessage::RIGHT: { *************** *** 206,210 **** } ! } return bResult; --- 206,210 ---- } ! } return bResult; *************** *** 241,245 **** break; } ! default: break; --- 241,245 ---- break; } ! default: break; *************** *** 271,277 **** { m_iKeyPressed = PointToKey( pMouseMessage->Point ); ! CMessageServer::Instance().QueueMessage( ! new TIntMessage(CMessage::CTRL_LCLICK, m_pParentWindow, this, m_iKeyPressed) ); StartDrawProc(); --- 271,277 ---- { m_iKeyPressed = PointToKey( pMouseMessage->Point ); ! CMessageServer::Instance().QueueMessage( ! new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, m_iKeyPressed) ); StartDrawProc(); *************** *** 283,290 **** { m_iKeyUpper = PointToKey( pMouseMessage->Point ); ! CMessageServer::Instance().QueueMessage( new TIntMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, m_iKeyUpper) ); ! StartDrawProc(); bHandled = true; --- 283,290 ---- { m_iKeyUpper = PointToKey( pMouseMessage->Point ); ! CMessageServer::Instance().QueueMessage( new TIntMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, m_iKeyUpper) ); ! StartDrawProc(); bHandled = true; Index: wgex_bufferdisplay.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_bufferdisplay.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wgex_bufferdisplay.cpp 16 Jul 2004 16:41:36 -0000 1.9 --- wgex_bufferdisplay.cpp 7 Jan 2005 22:08:39 -0000 1.10 *************** *** 174,178 **** // CMessageClient overrides ! //! CControl handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_LCLICK messages //! \param pMessage A pointer to the message bool CBufferDisplay::HandleMessage( CMessage* pMessage ) --- 174,178 ---- // CMessageClient overrides ! //! CControl handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_SINGLELCLICK messages //! \param pMessage A pointer to the message bool CBufferDisplay::HandleMessage( CMessage* pMessage ) Index: wgex_popupmenu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_popupmenu.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wgex_popupmenu.cpp 21 Nov 2003 17:12:48 -0000 1.4 --- wgex_popupmenu.cpp 7 Jan 2005 22:08:39 -0000 1.5 *************** *** 208,212 **** pDestination = m_pParentMenu; } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_LCLICK, pDestination, this, iter->first.iItemId)); HideAll(); } --- 208,212 ---- pDestination = m_pParentMenu; } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, pDestination, this, iter->first.iItemId)); HideAll(); } *************** *** 353,357 **** Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Top(), COLOR_WHITE); Painter.DrawVLine( m_WindowRect.Left(), m_WindowRect.Top(), m_WindowRect.Bottom(), COLOR_WHITE); ! // draws the darkgray stuff Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Bottom(), COLOR_DARKGRAY); --- 353,357 ---- Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Top(), COLOR_WHITE); Painter.DrawVLine( m_WindowRect.Left(), m_WindowRect.Top(), m_WindowRect.Bottom(), COLOR_WHITE); ! // draws the darkgray stuff Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Bottom(), COLOR_DARKGRAY); *************** *** 364,368 **** if (m_pHighlightedItem == &(iter->first)) Painter.DrawFilledRectAlpha(iter->second.second, m_HighlightColor, m_iAlpha ); ! CRect TextRect(iter->second.second); TextRect.Grow(-2); --- 364,368 ---- if (m_pHighlightedItem == &(iter->first)) Painter.DrawFilledRectAlpha(iter->second.second, m_HighlightColor, m_iAlpha ); ! CRect TextRect(iter->second.second); TextRect.Grow(-2); Index: wgex_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_button.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wgex_button.cpp 21 Nov 2003 17:12:48 -0000 1.3 --- wgex_button.cpp 7 Jan 2005 22:08:39 -0000 1.4 *************** *** 79,83 **** Painter.DrawMcLineAlpha( Inset.BottomLeft(), Inset.BottomRight(), Lighter, Light, 50 ); Painter.DrawMcLineAlpha( Inset.TopRight(), Inset.BottomRight(), Lighter, Light, 50 ); ! Painter.DrawText( m_sWindowText, Inset, Inset.Center()+CPoint(1,1), COLOR_BLACK ); } --- 79,83 ---- Painter.DrawMcLineAlpha( Inset.BottomLeft(), Inset.BottomRight(), Lighter, Light, 50 ); Painter.DrawMcLineAlpha( Inset.TopRight(), Inset.BottomRight(), Lighter, Light, 50 ); ! Painter.DrawText( m_sWindowText, Inset, Inset.Center()+CPoint(1,1), COLOR_BLACK ); } *************** *** 108,112 **** StartDrawProc(); ! bResult = true; } --- 108,112 ---- StartDrawProc(); ! bResult = true; } *************** *** 127,141 **** { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_LCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_RCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_MCLICK; break; } CMessageServer::Instance().QueueMessage( new TIntMessage(MessageType, m_pParentWindow, this, 0) ); ! CApplication::Instance()->SetMouseFocus( 0 ); --- 127,141 ---- { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_SINGLELCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_SINGLERCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_SINGLEMCLICK; break; } CMessageServer::Instance().QueueMessage( new TIntMessage(MessageType, m_pParentWindow, this, 0) ); ! CApplication::Instance()->SetMouseFocus( 0 ); *************** *** 195,205 **** { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_LCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_RCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_MCLICK; break; } --- 195,205 ---- { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_SINGLELCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_SINGLERCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_SINGLEMCLICK; break; } *************** *** 294,298 **** CRect RectInset = m_WindowRect; RectInset.Grow( -1 ); ! // painter.PanelInset( middleInset, true ); Painter.DrawRectAlpha( RectInset, *ActiveColor, 200 ); --- 294,298 ---- CRect RectInset = m_WindowRect; RectInset.Grow( -1 ); ! // painter.PanelInset( middleInset, true ); Painter.DrawRectAlpha( RectInset, *ActiveColor, 200 ); |