/// <summary> /// Tracks mouse ups. If the user mouse-ups over the same item they /// mouse down'd over, that option is selected and the menu closes. /// </summary> private void TrackMouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { //����OK�H if( !m_isReady ) return; //�v���b�V���O�t�H���X m_pressing = false; if( m_pressedOption == m_lastHoverOption ) { //�����ꂽ���j���[�I�v�V�����̎擾 m_selectedOption = m_pressedOption; //�����ꂽ���j���[�I�v�V�����̃��C�Y�G���h�z�[�o�[ m_selectedOption.RaiseEndHover(); //�����ꂽ���j���[�I�v�V�����̃��C�Y�N���b�N m_selectedOption.RaiseClick(); // ���������I m_lastHoverOption = null; //����I�v�V�������L���ȃ��j���[�̏ꍇ���� if (m_selectedOption.m_click_close) { TriggerClose(); } //TriggerClose(); } else { // They canceled the selection. //RepaintMenu(); } }
/// <summary> /// Tracks mouse ups. If the user mouse-ups over the same item they /// mouse down'd over, that option is selected and the menu closes. /// </summary> private void TrackMouseUp( object sender, System.Windows.Forms.MouseEventArgs e ) { if( !m_isReady ) return; m_pressing = false; if( m_pressedOption == m_lastHoverOption ) { // They selected an option. Deal with events. m_selectedOption = m_pressedOption; m_selectedOption.RaiseEndHover(); m_selectedOption.RaiseClick(); // Close us! m_lastHoverOption = null; TriggerClose(); } else { // They canceled the selection. RepaintMenu(); } }