/[cits3200i]/branches/gps-running-clean-r116/HighScorePlugin/Util/YesNoDialog.cs


UCC Code Repository

Contents of /branches/gps-running-clean-r116/HighScorePlugin/Util/YesNoDialog.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations) (download)
Sun Sep 5 15:48:34 2010 UTC (11 years, 2 months ago) by rvvs89
File size: 4173 byte(s)
Branching a local copy of the HEAD revision of the gps-running project on Google Code.
We will probably have to use this project as a template for our own plugins if we want to support SportTracks 2.1.
1 /*
2 Copyright (C) 2007, 2008 Kristian Bisgaard Lassen
3 Copyright (C) 2010 Kristian Helkjaer Lassen
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 3 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 using System;
20 using System.Collections.Generic;
21 using System.Text;
22 using System.Windows.Forms;
23 using ZoneFiveSoftware.Common.Visuals;
24
25 namespace GpsRunningPlugin.Util
26 {
27 class YesNoDialog : Form
28 {
29 private ZoneFiveSoftware.Common.Visuals.Button yes;
30 private ZoneFiveSoftware.Common.Visuals.Button no;
31 private ZoneFiveSoftware.Common.Visuals.TextBox textBox1;
32 public bool answer;
33
34 public YesNoDialog(String message)
35 {
36 InitializeComponent();
37 this.textBox1.Text = message;
38 this.StartPosition = FormStartPosition.CenterScreen;
39 this.FormBorderStyle = FormBorderStyle.FixedDialog;
40 }
41 public YesNoDialog(String message, System.Drawing.Icon icon)
42 {
43 InitializeComponent();
44 this.textBox1.Text = message;
45 if (icon != null) { Icon = icon; };
46 this.StartPosition = FormStartPosition.CenterScreen;
47 this.FormBorderStyle = FormBorderStyle.FixedDialog;
48 }
49
50 private void InitializeComponent()
51 {
52 this.yes = new ZoneFiveSoftware.Common.Visuals.Button();
53 this.textBox1 = new ZoneFiveSoftware.Common.Visuals.TextBox();
54 this.no = new ZoneFiveSoftware.Common.Visuals.Button();
55 this.SuspendLayout();
56 //
57 // yes
58 //
59 this.yes.Location = new System.Drawing.Point(54, 96);
60 this.yes.Name = "yes";
61 this.yes.Size = new System.Drawing.Size(75, 23);
62 this.yes.TabIndex = 1;
63 this.yes.Text = CommonResources.Text.ActionYes;
64 //this.yes.UseVisualStyleBackColor = true;
65 this.yes.Click += new System.EventHandler(this.ok_Click);
66 //
67 // textBox1
68 //
69 this.textBox1.Location = new System.Drawing.Point(13, 13);
70 this.textBox1.Multiline = true;
71 this.textBox1.Name = "textBox1";
72 this.textBox1.ReadOnly = true;
73 //this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
74 this.textBox1.Size = new System.Drawing.Size(256, 77);
75 this.textBox1.TabIndex = 2;
76 //
77 // no
78 //
79 this.no.Location = new System.Drawing.Point(135, 96);
80 this.no.Name = "no";
81 this.no.Size = new System.Drawing.Size(75, 23);
82 this.no.TabIndex = 3;
83 this.no.Text = CommonResources.Text.ActionNo;
84 //this.no.UseVisualStyleBackColor = true;
85 this.no.Click += new System.EventHandler(this.no_Click);
86 //
87 // YesNoDialog
88 //
89 this.ClientSize = new System.Drawing.Size(281, 131);
90 this.Controls.Add(this.no);
91 this.Controls.Add(this.textBox1);
92 this.Controls.Add(this.yes);
93 this.Name = "YesNoDialog";
94 this.Text = StringResources.Question;
95 this.ResumeLayout(false);
96 this.PerformLayout();
97
98 }
99
100 private void ok_Click(object sender, EventArgs e)
101 {
102 answer = true;
103 Dispose();
104 }
105
106 private void no_Click(object sender, EventArgs e)
107 {
108 answer = false;
109 Dispose();
110 }
111 }
112 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26