Ejemplo n.º 1
0
 private void killToolTip()
 {
     if (toolTip != null)
     {
         toolTip.Dispose();
         toolTip = null;
     }
 }
Ejemplo n.º 2
0
        public FilterBar()
        {
            this.AllowEvents    = false;
            this.DoubleBuffered = true;
            this.Height         = 31;
            this.locked         = false;

            this.splitArray = new char[] { ' ' };
            searchStrings   = new string[MAX_SEARCH_STRINGS + 1];

            for (int i = 0; i < MAX_SEARCH_STRINGS + 1; i++)
            {
                searchStrings[i] = String.Empty;
            }

            setupControls();

            textArray = new Func <TrackQueue, TrackQueue> [MAX_SEARCH_STRINGS + 1];

            textArray[0] = t => t;

            textArray[1] = t => t.FindAll(ti => ti.FilterBy(searchStrings[0]));

            textArray[2] = t => t.FindAll(ti => ti.FilterBy(searchStrings[0]) &&
                                          ti.FilterBy(searchStrings[1]));

            textArray[3] = t => t.FindAll(ti => ti.FilterBy(searchStrings[0]) &&
                                          ti.FilterBy(searchStrings[1]) &&
                                          ti.FilterBy(searchStrings[2]));

            textArray[4] = t => t.FindAll(ti => ti.FilterBy(searchStrings[0]) &&
                                          ti.FilterBy(searchStrings[1]) &&
                                          ti.FilterBy(searchStrings[2]) &&
                                          ti.FilterBy(searchStrings[3]));

            textArray[5] = t => t.FindAll(ti => ti.FilterBy(searchStrings[0]) &&
                                          ti.FilterBy(searchStrings[1]) &&
                                          ti.FilterBy(searchStrings[2]) &&
                                          ti.FilterBy(searchStrings[3]) &&
                                          ti.FilterBy(searchStrings[4]));

            tex = textArray[0];

            ply = t => t;
            gen = t => t;
            art = t => t;
            alb = t => t;
            yr  = t => t;
            gpg = t => t;

            ttFilterTextBox = new QToolTip(txtFilter, Localization.Get(UI_Key.ToolTip_Filter_Textbox));
            ttClearFilter   = new QToolTip(this, String.Empty);

            fltPlaylist.Select();
        }
Ejemplo n.º 3
0
        public FilterButton(FilterType Type)
        {
            this.filterType = Type;

            this.Height         = 25;
            this.Top            = 3;
            this.DoubleBuffered = true;
            this.font           = Styles.FontBold;
            this.valueType      = FilterValueType.None;

            toolTip = new QToolTip(this, "foo");

            updateToolTip();

            this.Invalidate();
        }
Ejemplo n.º 4
0
        protected override void OnMouseEnter(EventArgs e)
        {
            base.OnMouseEnter(e);

            this.Opacity = OPAQUE;

            Track t = controller.PlayingTrack;

            if (t != null)
            {
                toolTipText = t.ToShortString();
                toolTip     = new QToolTip(this, toolTipText);
                toolTip.SetToolTip(this, toolTipText);
            }
            else
            {
                killToolTip();
            }
        }
Ejemplo n.º 5
0
        public ControlPanel()
        {
            this.DoubleBuffered = true;

            this.Height = 45;
            this.Locked = false;

            nowPlayingRectangle = new Rectangle(NOW_PLAYING_LEFT, CONTROL_TOP, CONTROL_WIDTH, CONTROL_HEIGHT);
            radioRectangle      = new Rectangle(RADIO_LEFT, CONTROL_TOP, CONTROL_WIDTH, CONTROL_HEIGHT);
            shuffleRectangle    = new Rectangle(SHUFFLE_LEFT, CONTROL_TOP, CONTROL_WIDTH, CONTROL_HEIGHT);
            repeatRectangle     = new Rectangle(REPEAT_LEFT, CONTROL_TOP, CONTROL_WIDTH, CONTROL_HEIGHT);
            advanceRectangle    = new Rectangle(ADVANCE_LEFT, CONTROL_TOP, CONTROL_WIDTH, CONTROL_HEIGHT);
            stopRectangle       = new Rectangle(STOP_LEFT, CONTROL_TOP, CONTROL_WIDTH, CONTROL_HEIGHT);
            backRectangle       = new Rectangle(BACK_LEFT, CONTROL_TOP, WIDE_CONTROL_WIDTH, CONTROL_HEIGHT);
            playRectangle       = new Rectangle(PLAY_LEFT, CONTROL_TOP, CONTROL_WIDTH, CONTROL_HEIGHT);
            fwdRectangle        = new Rectangle(FWD_LEFT, CONTROL_TOP, WIDE_CONTROL_WIDTH, CONTROL_HEIGHT);
            muteRectangle       = new Rectangle(MUTE_LEFT, CONTROL_TOP, CONTROL_WIDTH, CONTROL_HEIGHT);
            volumeRectangle     = new Rectangle(VOLUME_LEFT, CONTROL_TOP, VOLUME_WIDTH, CONTROL_HEIGHT);

            toolTip = new QToolTip(this, String.Empty);
        }
Ejemplo n.º 6
0
        public frmIndex(FilterBar Parent, Point Anchor, IndexCallback Callback, FilterButton Button) : base(String.Empty, ButtonCreateType.None)
        {
            this.DoubleBuffered = true;

            callback = Callback;
            button   = Button;

            this.filterChar = '\0';

            this.FormBorderStyle = FormBorderStyle.None;
            this.StartPosition   = FormStartPosition.Manual;
            this.KeyPreview      = true;
            this.FilterTypeBasis = button.FilterType;

            setCaption();

            buttons = new List <QButton>();

            var aa = getChars(Parent, Button.FilterType).ToList();

            aa.RemoveAll(c => c <= ' ' || c == CLEAR_CHAR);

            if (aa.Count() == 0)
            {
                this.NoData = true;
                this.Close();
                this.callback(this);
                return;
            }

            this.NoData = false;

            aa.Sort();

            if (button.ValueType != FilterValueType.None)
            {
                aa.Add(CLEAR_CHAR);
            }

            aa = aa.Take(55).ToList();

            bool filterBadChars;

            switch (System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName)
            {
            case "en":
            case "de":
            case "it":
            case "cs":
            case "fr":
            case "pt":
                filterBadChars = true;
                break;

            default:
                filterBadChars = false;
                break;
            }

            foreach (char c in aa)
            {
                QButton b;
                if (Button.FilterType == FilterType.Year && c != CLEAR_CHAR)
                {
                    b = new QButton(c.ToString() + "0s", false, true);
                }
                else
                {
                    b = new QButton(c.ToString(), false, true);
                }

                if ((!filterBadChars) || (c < 0xFF))
                {
                    b.Tag = c;
                    buttons.Add(b);
                    b.BackColor      = this.BackColor;
                    b.ButtonPressed += new QButton.ButtonDelegate(click);
                    this.Controls.Add(b);
                }
            }

            this.MinimumSize = Size.Empty;

            buttons.Add(new QButton("~", false, true)); // placeholder for close button

            desiredWidth = arrangeButtons() + BORDER_WIDTH + 2;

            closeButtonRect = new Rectangle(buttons[buttons.Count - 1].Location, Properties.Resources.filter_index_close_hover.Size);

            buttons.RemoveAt(buttons.Count - 1);

            this.ClientSize = new System.Drawing.Size(desiredWidth,
                                                      rows * buttons[0].Height + BORDER_WIDTH * 2);


            Point p = Parent.PointToScreen(new Point(Math.Min(Anchor.X - this.Width / 2, Parent.Right - this.Width), Anchor.Y));

            p             = new Point(Math.Max(0, p.X), p.Y);
            this.Location = p;

            this.Owner = Lib.MainForm;

            this.Show(Lib.MainForm);

            QButton lastButton = buttons[buttons.Count - 1];

            if (lastButton.Text[0] == '_')
            {
                QToolTip clearToolTip = new QToolTip(lastButton, String.Empty);
                clearToolTip.SetToolTip(lastButton, Localization.Get(UI_Key.Filter_Index_Clear));
            }
            tooltip        = new QToolTip(this, Localization.Get(UI_Key.Filter_Index_Cancel));
            tooltip.Active = false;
        }