public frmFileInfo(Track Track) : base(Track.ToShortString(), ButtonCreateType.OKOnly) { this.ClientSize = new System.Drawing.Size(550, 400); SPACING = 4; this.KeyPreview = true; btnOK.Text = Localization.Get(UI_Key.File_Info_Done); track = Track; track.Load(); art = new Artwork(); art.CurrentTrack = track; art.Size = new Size(ART_SIZE, ART_SIZE); art.Location = new Point(this.ClientRectangle.Width - ART_SIZE - MARGIN, MARGIN); this.Controls.Add(art); if (track.ConfirmExists) { btnEdit = new QButton(Localization.Get(UI_Key.File_Info_Edit), false, false); btnEdit.ButtonPressed += (s) => { edit(); }; this.Controls.Add(btnEdit); } this.EditFile = false; }
private void setupArtwork() { if (art == null) { art = new Artwork(); art.BlankMessage = Localization.Get(UI_Key.Edit_Tags_Artwork_Blank_Message); art.DragEnter += artDragEnter; art.DragDrop += artDragDrop; art.MouseDown += artDoDrag; art.AllowDrop = true; art.OverlayInfo = true; this.Controls.Add(art); //if (isMultiple) { chkArt = new QCheckBox(String.Empty, this.BackColor); chkArt.CheckedChanged += (s, e) => { ImageDirty = chkArt.Checked; Dirty |= chkArt.Checked; }; this.Controls.Add(chkArt); } btnLoadArt = new QButton(Localization.Get(UI_Key.Edit_Tags_Load), false, true); btnLoadArt.ButtonPressed += (s) => { loadArt(); }; this.Controls.Add(btnLoadArt); btnClearArt = new QButton(Localization.Get(UI_Key.Edit_Tags_Clear), false, true); btnClearArt.ButtonPressed += (s) => { clearArt(); }; this.Controls.Add(btnClearArt); btnCopyArt = new QButton(Localization.Get(UI_Key.Edit_Tags_Copy), false, true); btnCopyArt.ButtonPressed += (s) => { copyArt(); }; this.Controls.Add(btnCopyArt); btnPasteArt = new QButton(Localization.Get(UI_Key.Edit_Tags_Paste), false, true); btnPasteArt.ButtonPressed += (s) => { pasteArt(); }; this.Controls.Add(btnPasteArt); } Image = null; art.CurrentTrack = tracks[0]; }
public AlbumDetails() { this.BackColor = Color.Black; this.Click += (s, e) => { this.RequestAction(QActionType.AdvanceScreen); }; artwork = new Artwork(); artwork.Click += (s, e) => { this.RequestAction(QActionType.AdvanceScreen); }; artwork.HideMousePointer = false; this.Controls.Add(artwork); txtDescription = new QTextArea(); this.Controls.Add(txtDescription); btnLink = new QButton(Localization.Get(UI_Key.Album_Details_View_On_Web), false, false); btnLink.BackColor = this.BackColor; btnLink.ButtonPressed += new QButton.ButtonDelegate(link_ButtonPressed); btnLink.Enabled = false; this.Controls.Add(btnLink); btnPlay = new QButton(Localization.Get(UI_Key.Album_Details_Play_This_Album), false, false); btnPlay.BackColor = this.BackColor; btnPlay.ButtonPressed += new QButton.ButtonDelegate(btnLink_ButtonPressed); btnPlay.Enabled = true; this.Controls.Add(btnPlay); btnNext = new QButton(Localization.Get(UI_Key.Album_Details_Next_Screen), false, false); btnNext.BackColor = this.BackColor; btnNext.ButtonPressed += new QButton.ButtonDelegate(btnNext_ButtonPressed); btnNext.Enabled = true; this.Controls.Add(btnNext); btnCopyToClipboard = new QButton(Localization.Get(UI_Key.Album_Details_Copy_Info_To_Clipboard), false, false); btnCopyToClipboard.BackColor = this.BackColor; btnCopyToClipboard.ButtonPressed += new QButton.ButtonDelegate(btnCopyToClipboard_ButtonPressed); btnCopyToClipboard.Enabled = true; this.Controls.Add(btnCopyToClipboard); this.view = AlbumDetailView.Lyrics; artwork.SendToBack(); txtDescription.Focus(); }
public NormalView(frmMain MainForm) { this.mainForm = MainForm; instance = this; this.trackList = new TrackList(this); this.filterValueList = new FilterValueList(); this.filterBar = new FilterBar(); this.artwork = new Artwork(); this.splMain = new QSplitContainer(); this.splMain.Panel1.Controls.Add(filterValueList); this.splMain.Panel2.Controls.Add(trackList); this.Controls.Add(splMain); this.Controls.Add(filterBar); splMain.Resize += (s, e) => { arrangeSplitterControls(); }; splMain.SplitterMoved += (s, e) => { arrangeSplitterControls(); }; splMain.VisibleChanged += (s, e) => { if (splMain.Visible) { splMain.SplitterDistance = Setting.SplitterDistance; } }; this.artwork = Artwork; splMain.Panel1.Controls.Add(artwork); filterBar.FilterReleased += filterBarFilterCleared; filterBar.FilterValueChanged += filterBarFilterValueChanged; filterValueList.FilterValueSelected += new FilterValueList.FilterValueSelect(filterValueChanged); filterValueList.ValueChanged += (oldVal, newVal) => { changePlaylistName(oldVal, newVal); }; arrangeSplitterControls(); splMain.Panel1.Paint += new PaintEventHandler(Panel1_Paint); artwork.Click += (s, e) => { controller.RequestAction(QActionType.FindPlayingTrack); }; }
private void doIt() { if ((track = controller.PlayingTrack) != null && (this.Visible || !controller.AppActive) && this.touch()) { int artSize = HEIGHT - MARGIN - MARGIN - 1; line2 = track.Title; if (track.MainGroup.Length > 0) { line3 = track.MainGroup + " / " + Lib.GetTimeString(track.Duration); } else { line3 = Lib.GetTimeString(track.Duration); } if (track.YearString.Length > 0) { line3 += " / " + track.YearString; } int w = TextRenderer.MeasureText(line2, Styles.Font).Width - 4; if (track.TrackNumString.Length > 0) { trackNumOffset = TextRenderer.MeasureText(track.TrackNumString, Styles.FontSmall).Width; w += trackNumOffset; } w = Math.Max(w, TextRenderer.MeasureText(line3, Styles.FontItalic).Width); w += MARGIN * 4 + artSize; w = Math.Max(200, w); w = Math.Min(350, w); Rectangle r = new Rectangle(Screen.PrimaryScreen.WorkingArea.Right - w, Screen.PrimaryScreen.WorkingArea.Height - HEIGHT, w, HEIGHT); frmMiniPlayer mp; if ((mp = frmMiniPlayer.GetInstance()) != null) { if (r.IntersectsWith(mp.Bounds)) { r = new Rectangle(r.X, mp.Top - HEIGHT, r.Width, r.Height); } } this.Bounds = r; if (art == null) { art = new Artwork(); art.Bounds = new Rectangle(MARGIN, MARGIN, artSize, artSize); art.Click += (s, e) => { this.click(); }; this.Controls.Add(art); } art.CurrentTrack = track; this.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); if (this.Visible) { this.Invalidate(); } else { this.Show(); } this.BringToFront(); } else { System.Diagnostics.Debug.WriteLine("Suppress"); } }