1 /*
2  *  "GEDKeeper", the personal genealogical database editor.
3  *  Copyright (C) 2009-2018 by Sergey V. Zhdanovskih.
4  *
5  *  This file is part of "GEDKeeper".
6  *
7  *  This program is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation, either version 3 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 using System;
22 using System.Windows.Forms;
23 using GDModel;
24 using GKCore;
25 using GKCore.Controllers;
26 using GKCore.Interfaces;
27 using GKCore.MVP.Controls;
28 using GKCore.MVP.Views;
29 using GKUI.Components;
30 
31 namespace GKUI.Forms
32 {
33     public sealed partial class PortraitSelectDlg : EditorDialog, IPortraitSelectDlg
34     {
35         private readonly PortraitSelectDlgController fController;
36 
37         public GDMMultimediaLink MultimediaLink
38         {
39             get { return fController.MultimediaLink; }
40             set { fController.MultimediaLink = value; }
41         }
42 
43         #region View Interface
44 
45         IImageView IPortraitSelectDlg.ImageCtl
46         {
47             get { return imageView1; }
48         }
49 
50         #endregion
51 
btnAccept_Click(object sender, EventArgs e)52         private void btnAccept_Click(object sender, EventArgs e)
53         {
54             DialogResult = fController.Accept() ? DialogResult.OK : DialogResult.None;
55         }
56 
PortraitSelectDlg(IBaseWindow baseWin)57         public PortraitSelectDlg(IBaseWindow baseWin)
58         {
59             InitializeComponent();
60 
61             btnAccept.Image = UIHelper.LoadResourceImage("Resources.btn_accept.gif");
62             btnCancel.Image = UIHelper.LoadResourceImage("Resources.btn_cancel.gif");
63 
64             imageView1.SelectionMode = ImageBoxSelectionMode.Rectangle;
65 
66             // SetLocale()
67             btnAccept.Text = LangMan.LS(LSID.LSID_DlgAccept);
68             btnCancel.Text = LangMan.LS(LSID.LSID_DlgCancel);
69             Title = LangMan.LS(LSID.LSID_PortraitSelect);
70 
71             fController = new PortraitSelectDlgController(this);
72             fController.Init(baseWin);
73         }
74     }
75 }
76