Subversion Repositories DevTools

Rev

Rev 2151 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2151 Rev 2153
Line 31... Line 31...
31
         // out of a background thread managing the ReqPro import.
31
         // out of a background thread managing the ReqPro import.
32
         this.TopMost = true;
32
         this.TopMost = true;
33
 
33
 
34
         // assign a minimum width for the message box based on how many buttons it needs
34
         // assign a minimum width for the message box based on how many buttons it needs
35
         int minWidth = 160;
35
         int minWidth = 160;
36
         int maxWidth = 220;
36
         int maxWidth = 800;
37
         if (msgBoxButtons == MessageBoxButtons.YesNo)
37
         if (msgBoxButtons == MessageBoxButtons.YesNo)
38
         {
38
         {
39
            minWidth = 280;
39
            minWidth = 280;
40
            maxWidth = 360;
-
 
41
         }
40
         }
42
 
41
 
43
         this.SuspendLayout();
42
         this.SuspendLayout();
44
 
43
 
45
         label1.Text = msg;
44
         label1.Text = msg;
46
 
45
 
47
         Size sz = MeasureString(msg, maxWidth, label1.Font);
46
         Size sz = MeasureString(msg, maxWidth, label1.Font);
48
 
47
 
49
         // adjust label dimensions
48
         // adjust label dimensions
50
         if (label1.Width > maxWidth)
49
         if (label1.Width > maxWidth)
51
         {
-
 
52
            label1.Width = maxWidth;
50
            label1.Width = maxWidth;
-
 
51
         if (label1.Width < sz.Width)
53
         }
52
            label1.Width = sz.Width;
-
 
53
 
54
         label1.Height = sz.Height + 20;
54
         label1.Height = sz.Height + 50;
55
 
55
 
56
         // adjust client dimensions
56
         // adjust client dimensions
57
         this.Width = sz.Width + 50;
57
         this.Width = sz.Width + 50;
58
         if (this.Width < minWidth)
58
         if (this.Width < minWidth)
59
            this.Width = minWidth;
59
            this.Width = minWidth;
60
         this.Height = sz.Height + 130;
60
         this.Height = sz.Height + 150;
61
 
61
 
62
         // adjust label position
62
         // adjust label position
63
         label1.Left = (this.Width - sz.Width)/2;
63
         label1.Left = (this.Width - sz.Width)/2;
64
      
64
      
65
         // create buttons
65
         // create buttons
Line 70... Line 70...
70
            button1.Size = new System.Drawing.Size(80, 24);
70
            button1.Size = new System.Drawing.Size(80, 24);
71
            button1.Name = "button1";
71
            button1.Name = "button1";
72
            button1.TabIndex = 0;
72
            button1.TabIndex = 0;
73
            button1.Text = "OK";
73
            button1.Text = "OK";
74
            button1.Visible = true;
74
            button1.Visible = true;
75
            button1.Location = new System.Drawing.Point((this.Width - button1.Width)/2, sz.Height + 50);
75
            button1.Location = new System.Drawing.Point((this.Width - button1.Width)/2, label1.Top + sz.Height + 50);
76
            this.Controls.Add(button1);
76
            this.Controls.Add(button1);
77
         }
77
         }
78
         else if (msgBoxButtons == MessageBoxButtons.YesNo)
78
         else if (msgBoxButtons == MessageBoxButtons.YesNo)
79
         {
79
         {
80
            Button button1 = new Button();
80
            Button button1 = new Button();
81
            button1.DialogResult = DialogResult.Yes;
81
            button1.DialogResult = DialogResult.Yes;
82
            button1.Size = new System.Drawing.Size(80, 24);
82
            button1.Size = new System.Drawing.Size(80, 24);
83
            button1.Name = "button1";
83
            button1.Name = "button1";
84
            button1.TabIndex = 0;
84
            button1.TabIndex = 0;
85
            button1.Text = "Yes";
85
            button1.Text = "Yes";
86
            button1.Location = new Point((this.Width - (button1.Width * 2))/3, sz.Height + 50);
86
            button1.Location = new Point((this.Width - (button1.Width * 2))/3, label1.Top + sz.Height + 50);
87
            this.Controls.Add(button1);
87
            this.Controls.Add(button1);
88
 
88
 
89
            Button button2 = new Button();
89
            Button button2 = new Button();
90
            button2.DialogResult = DialogResult.No;
90
            button2.DialogResult = DialogResult.No;
91
            button2.Size = new System.Drawing.Size(80, 24);
91
            button2.Size = new System.Drawing.Size(80, 24);
92
            button2.Name = "button2";
92
            button2.Name = "button2";
93
            button2.TabIndex = 1;
93
            button2.TabIndex = 1;
94
            button2.Text = "No";
94
            button2.Text = "No";
95
            button2.Location = new Point(button1.Left + button1.Width + ((this.Width - (button2.Width * 2))/3), sz.Height + 50);
95
            button2.Location = new Point(button1.Left + button1.Width + ((this.Width - (button2.Width * 2))/3), label1.Top + sz.Height + 50);
96
            this.Controls.Add(button2);
96
            this.Controls.Add(button2);
97
         }
97
         }
98
 
98
 
99
         this.ResumeLayout(false);
99
         this.ResumeLayout(false);
100
		}
100
		}
Line 152... Line 152...
152
         this.label1 = new System.Windows.Forms.Label();
152
         this.label1 = new System.Windows.Forms.Label();
153
         this.SuspendLayout();
153
         this.SuspendLayout();
154
         // 
154
         // 
155
         // label1
155
         // label1
156
         // 
156
         // 
157
         this.label1.Location = new System.Drawing.Point(8, 8);
157
         this.label1.Location = new System.Drawing.Point(8, 24);
158
         this.label1.Name = "label1";
158
         this.label1.Name = "label1";
159
         this.label1.Size = new System.Drawing.Size(280, 32);
159
         this.label1.Size = new System.Drawing.Size(280, 32);
160
         this.label1.TabIndex = 1;
160
         this.label1.TabIndex = 1;
161
         this.label1.Text = "label1";
161
         this.label1.Text = "label1";
162
         // 
162
         //