Пример #1
0
        private void lstTextures_MouseDown(object sender, MouseEventArgs e)
        {
            int index = lstTextures.IndexFromPoint(e.X, e.Y);

            if (lstTextures.SelectedIndex != index)
            {
                lstTextures.SelectedIndex = index;
            }

            if (e.Button == MouseButtons.Right)
            {
                if (_selectedTexture != null)
                {
                    lstTextures.ContextMenuStrip = ctxTextures;
                }
                else
                {
                    lstTextures.ContextMenuStrip = null;
                }
            }
        }
Пример #2
0
        private void questTypeList_MouseMove(object sender, MouseEventArgs e)
        {
            _lastList = (CheckedListBox)sender;

            int index = _lastList.IndexFromPoint(e.X, e.Y);

            // no valid index found in list skip display of tooltip
            if (index < 0)
                return;

            Object item = _lastList.Items[index];

            if (item == null)
            {
                // The mouse isn't over any item -- hide the tooltip
                toolTip.Active = false;
                tooltipTimer.Enabled = false;
            }
            else if (item != _lastItem)
            {
                // The item has changed, hide the tooltip
                // and restart the timer.
                toolTip.Active = false;
                tooltipTimer.Tick += new EventHandler(tooltipTimer_Tick);
                tooltipTimer.Enabled = true;

                if (sender == triggerTypeList)
                {
                    _lastItemText = GetTriggerHelp(GetTriggerTypeForDescription(Convert.ToString(triggerTypeList.Items[index])));
                }
                else if (sender == requirementTypeList)
                {
                    _lastItemText = GetRequirementHelp(GetRequirementTypeForDescription(Convert.ToString(requirementTypeList.Items[index])));
                } if (sender == actionTypeList)
                {
                    _lastItemText = GetActionHelp(GetActionTypeForDescription(Convert.ToString(actionTypeList.Items[index])));
                }
            }
            else
            {
                // It's the same item -- ignore it.
            }

            _lastItem = item;
        }