void JBlotPiece::MoveToHomePos() { Frame ext = GetLocalExt(); ext.x = m_HomePos.x; ext.y = m_HomePos.y; m_MovePos.x = ext.x; m_MovePos.y = ext.y; m_bAtHome = true; SetLocalExt( ext ); } // JBlotPiece::MoveToHomePos
void JButton::Unpress() { if (m_bPressed) { Frame ext = GetLocalExt(); ext.x -= float( m_PressDX ); ext.y -= float( m_PressDY ); SetLocalExt( ext ); } m_bPressed = false; SendSignal( "Unpress" ); SendSignal( "Pressed" ); OnUnpress(); } // JButton::Unpress
void JButton::Press() { if (!m_bPressed) { Frame ext = GetLocalExt(); ext.x += float( m_PressDX ); ext.y += float( m_PressDY ); SetLocalExt( ext ); } m_bPressed = true; SendSignal( "Press" ); SendSignal( "Pressed" ); OnPress(); } // JButton::Press
void JBlotPiece::MoveTo( Vec2 pos, bool bImmediately ) { if (bImmediately) { Frame ext = GetLocalExt(); ext.x = pos.x; ext.y = pos.y; SetLocalExt( ext ); m_bAtHome = (m_HomePos.dist( pos ) < c_FltEpsilon); } else { m_bMoving = true; m_StartMoveTime = JAnimServer::s_pInstance->GetCurTime(); } m_MovePos = pos; }
JObjectTree::JObjectTree() { m_DefaultRootPos = Vec2( 10, 400 ); m_RootPos = m_DefaultRootPos; m_NodeCaptionPos = Vec2( 2.0f, 1.0f ); m_pRoot = NULL; m_pSelected = NULL; m_pExpanded = NULL; m_ConnectColor = 0xBB2222FF; m_NodeHeight = 15.0f; m_NodeWidth = 90.0f; m_pDraggedNode = NULL; m_bCanDrop = false; m_DragShift = Vec2::null; m_InsExt = Frame::null; m_InsColor = 0x88FF3333; SetLocalExt( Frame( 0.0f, 0.0f, 1600.0f, 1200.0f ) ); } // JObjectTree::JObjectTree