1 // AnimateDialog.h
2 // this file is part of Context Free
3 // ---------------------
4 // Copyright (C) 2017 John Horigan - john@glyphic.com
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 //
20 // John Horigan can be contacted at john@glyphic.com or at
21 // John Horigan, 1209 Villa St., Mountain View, CA 94041-1123, USA
22 //
23 //
24 
25 #pragma once
26 
27 #include "RenderParameters.h"
28 
29 namespace ContextFreeNet {
30 
31 
32 	/// <summary>
33 	/// Summary for AnimateDialog
34 	///
35 	/// WARNING: If you change the name of this class, you will need to change the
36 	///          'Resource File Name' property for the managed resource compiler tool
37 	///          associated with all .resx files this class depends on.  Otherwise,
38 	///          the designers will not be able to interact properly with localized
39 	///          resources associated with this form.
40 	/// </summary>
41 	public ref class AnimateDialog : public System::Windows::Forms::Form
42 	{
43 	public:
AnimateDialog(RenderParameters * rp)44 		AnimateDialog(RenderParameters* rp)
45         : renderParameters(rp)
46 		{
47 			InitializeComponent();
48 			//
49 			//TODO: Add the constructor code here
50 			//
51             this->Load += gcnew System::EventHandler(this, &AnimateDialog::setup_dialog);
52 		}
53     private: System::Windows::Forms::TextBox^  widthBox;
54     public:
55     private: System::Windows::Forms::TextBox^  heightBox;
56     private: System::Windows::Forms::CheckBox^  zoom;
57     private: System::Windows::Forms::TextBox^  lengthBox;
58     private: System::Windows::Forms::ComboBox^  frameRate;
59     private: System::Windows::Forms::Label^  label13;
60     private: System::Windows::Forms::Label^  label14;
61     private: System::Windows::Forms::Label^  label15;
62     private: System::Windows::Forms::Label^  label16;
63     public: System::Windows::Forms::TextBox^  frameNumber;
64     private:
65 
66     private:
67 
68     private:
69 
70     private: System::Windows::Forms::Label^  frameLabel;
71     private: System::Windows::Forms::Label^  codecLabel;
72     private: System::Windows::Forms::ComboBox^  codec;
73     private: System::Windows::Forms::CheckBox^  showPreview;
74     private: System::Windows::Forms::CheckBox^ loopPreview;
75 
76 
77              RenderParameters* renderParameters;
78 
79 	protected:
80 		/// <summary>
81 		/// Clean up any resources being used.
82 		/// </summary>
~AnimateDialog()83 		~AnimateDialog()
84 		{
85 			if (components)
86 			{
87 				delete components;
88 			}
89 		}
90 
91 
92     private: System::Windows::Forms::Label^  label1;
93     private: System::Windows::Forms::Label^  label2;
94     private: System::Windows::Forms::Label^  label3;
95 
96     private: System::Windows::Forms::Label^  label4;
97     private: System::Windows::Forms::Label^  label5;
98     private: System::Windows::Forms::Label^  label6;
99     private: System::Windows::Forms::TrackBar^  borderTrackBar;
100 
101     private: System::Windows::Forms::Label^  label7;
102     private: System::Windows::Forms::Label^  label8;
103     private: System::Windows::Forms::Label^  label9;
104     private: System::Windows::Forms::Label^  label10;
105     private: System::Windows::Forms::Label^  label11;
106     private: System::Windows::Forms::Label^  label12;
107     private: System::Windows::Forms::Button^  OKbutton;
108     private: System::Windows::Forms::Button^  cancelButton;
109     private: System::Windows::Forms::TextBox^  minimumSizeBox;
110     protected:
111 
112     protected:
113 
114 	private:
115 		/// <summary>
116 		/// Required designer variable.
117 		/// </summary>
118 		System::ComponentModel::Container ^components;
119 
120 #pragma region Windows Form Designer generated code
121 		/// <summary>
122 		/// Required method for Designer support - do not modify
123 		/// the contents of this method with the code editor.
124 		/// </summary>
InitializeComponent(void)125 		void InitializeComponent(void)
126 		{
127             this->label1 = (gcnew System::Windows::Forms::Label());
128             this->label2 = (gcnew System::Windows::Forms::Label());
129             this->label3 = (gcnew System::Windows::Forms::Label());
130             this->label4 = (gcnew System::Windows::Forms::Label());
131             this->label5 = (gcnew System::Windows::Forms::Label());
132             this->label6 = (gcnew System::Windows::Forms::Label());
133             this->borderTrackBar = (gcnew System::Windows::Forms::TrackBar());
134             this->label7 = (gcnew System::Windows::Forms::Label());
135             this->label8 = (gcnew System::Windows::Forms::Label());
136             this->label9 = (gcnew System::Windows::Forms::Label());
137             this->label10 = (gcnew System::Windows::Forms::Label());
138             this->label11 = (gcnew System::Windows::Forms::Label());
139             this->label12 = (gcnew System::Windows::Forms::Label());
140             this->OKbutton = (gcnew System::Windows::Forms::Button());
141             this->cancelButton = (gcnew System::Windows::Forms::Button());
142             this->minimumSizeBox = (gcnew System::Windows::Forms::TextBox());
143             this->widthBox = (gcnew System::Windows::Forms::TextBox());
144             this->heightBox = (gcnew System::Windows::Forms::TextBox());
145             this->zoom = (gcnew System::Windows::Forms::CheckBox());
146             this->lengthBox = (gcnew System::Windows::Forms::TextBox());
147             this->frameRate = (gcnew System::Windows::Forms::ComboBox());
148             this->label13 = (gcnew System::Windows::Forms::Label());
149             this->label14 = (gcnew System::Windows::Forms::Label());
150             this->label15 = (gcnew System::Windows::Forms::Label());
151             this->label16 = (gcnew System::Windows::Forms::Label());
152             this->frameNumber = (gcnew System::Windows::Forms::TextBox());
153             this->frameLabel = (gcnew System::Windows::Forms::Label());
154             this->codecLabel = (gcnew System::Windows::Forms::Label());
155             this->codec = (gcnew System::Windows::Forms::ComboBox());
156             this->showPreview = (gcnew System::Windows::Forms::CheckBox());
157             this->loopPreview = (gcnew System::Windows::Forms::CheckBox());
158             (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->borderTrackBar))->BeginInit();
159             this->SuspendLayout();
160             //
161             // label1
162             //
163             this->label1->AutoSize = true;
164             this->label1->Location = System::Drawing::Point(35, 89);
165             this->label1->Name = L"label1";
166             this->label1->Size = System::Drawing::Size(35, 13);
167             this->label1->TabIndex = 3;
168             this->label1->Text = L"Width";
169             //
170             // label2
171             //
172             this->label2->AutoSize = true;
173             this->label2->Location = System::Drawing::Point(112, 89);
174             this->label2->Name = L"label2";
175             this->label2->Size = System::Drawing::Size(38, 13);
176             this->label2->TabIndex = 4;
177             this->label2->Text = L"Height";
178             //
179             // label3
180             //
181             this->label3->AutoSize = true;
182             this->label3->Location = System::Drawing::Point(74, 136);
183             this->label3->Name = L"label3";
184             this->label3->Size = System::Drawing::Size(117, 13);
185             this->label3->TabIndex = 10;
186             this->label3->Text = L"size of smallest element";
187             //
188             // label4
189             //
190             this->label4->AutoSize = true;
191             this->label4->Location = System::Drawing::Point(156, 108);
192             this->label4->Name = L"label4";
193             this->label4->Size = System::Drawing::Size(44, 13);
194             this->label4->TabIndex = 8;
195             this->label4->Text = L"in pixels";
196             //
197             // label5
198             //
199             this->label5->AutoSize = true;
200             this->label5->Font = (gcnew System::Drawing::Font(L"Symbol", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
201                 static_cast<System::Byte>(2)));
202             this->label5->Location = System::Drawing::Point(74, 106);
203             this->label5->Name = L"label5";
204             this->label5->Size = System::Drawing::Size(17, 16);
205             this->label5->TabIndex = 6;
206             this->label5->Text = L"�";
207             //
208             // label6
209             //
210             this->label6->AutoSize = true;
211             this->label6->Location = System::Drawing::Point(12, 164);
212             this->label6->Name = L"label6";
213             this->label6->Size = System::Drawing::Size(93, 13);
214             this->label6->TabIndex = 11;
215             this->label6->Text = L"Image border size:";
216             //
217             // borderTrackBar
218             //
219             this->borderTrackBar->Location = System::Drawing::Point(15, 179);
220             this->borderTrackBar->Maximum = 99;
221             this->borderTrackBar->Name = L"borderTrackBar";
222             this->borderTrackBar->Size = System::Drawing::Size(185, 45);
223             this->borderTrackBar->TabIndex = 12;
224             this->borderTrackBar->TickFrequency = 33;
225             this->borderTrackBar->Value = 1;
226             //
227             // label7
228             //
229             this->label7->AutoSize = true;
230             this->label7->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
231                 static_cast<System::Byte>(0)));
232             this->label7->Location = System::Drawing::Point(8, 212);
233             this->label7->Name = L"label7";
234             this->label7->Size = System::Drawing::Size(41, 12);
235             this->label7->TabIndex = 13;
236             this->label7->Text = L"negative";
237             //
238             // label8
239             //
240             this->label8->AutoSize = true;
241             this->label8->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
242                 static_cast<System::Byte>(0)));
243             this->label8->Location = System::Drawing::Point(70, 213);
244             this->label8->Name = L"label8";
245             this->label8->Size = System::Drawing::Size(25, 12);
246             this->label8->TabIndex = 14;
247             this->label8->Text = L"none";
248             //
249             // label9
250             //
251             this->label9->AutoSize = true;
252             this->label9->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
253                 static_cast<System::Byte>(0)));
254             this->label9->Location = System::Drawing::Point(123, 213);
255             this->label9->Name = L"label9";
256             this->label9->Size = System::Drawing::Size(25, 12);
257             this->label9->TabIndex = 15;
258             this->label9->Text = L"fixed";
259             //
260             // label10
261             //
262             this->label10->AutoSize = true;
263             this->label10->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
264                 static_cast<System::Byte>(0)));
265             this->label10->Location = System::Drawing::Point(169, 212);
266             this->label10->Name = L"label10";
267             this->label10->Size = System::Drawing::Size(38, 12);
268             this->label10->TabIndex = 16;
269             this->label10->Text = L"variable";
270             //
271             // label11
272             //
273             this->label11->Location = System::Drawing::Point(12, 9);
274             this->label11->Name = L"label11";
275             this->label11->Size = System::Drawing::Size(232, 40);
276             this->label11->TabIndex = 1;
277             this->label11->Text = L"The image will be animated to the dimensions entered here, using the current vari"
278                 L"ation.";
279             this->label11->Click += gcnew System::EventHandler(this, &AnimateDialog::label11_Click);
280             //
281             // label12
282             //
283             this->label12->Location = System::Drawing::Point(12, 46);
284             this->label12->Name = L"label12";
285             this->label12->Size = System::Drawing::Size(232, 41);
286             this->label12->TabIndex = 2;
287             this->label12->Text = L"When complete, the movie will be displayed scaled within the window";
288             //
289             // OKbutton
290             //
291             this->OKbutton->DialogResult = System::Windows::Forms::DialogResult::OK;
292             this->OKbutton->Location = System::Drawing::Point(90, 322);
293             this->OKbutton->Name = L"OKbutton";
294             this->OKbutton->Size = System::Drawing::Size(75, 23);
295             this->OKbutton->TabIndex = 26;
296             this->OKbutton->Text = L"OK";
297             this->OKbutton->UseVisualStyleBackColor = true;
298             this->OKbutton->Click += gcnew System::EventHandler(this, &AnimateDialog::OKbutton_Click);
299             //
300             // cancelButton
301             //
302             this->cancelButton->DialogResult = System::Windows::Forms::DialogResult::Cancel;
303             this->cancelButton->Location = System::Drawing::Point(171, 322);
304             this->cancelButton->Name = L"cancelButton";
305             this->cancelButton->Size = System::Drawing::Size(75, 23);
306             this->cancelButton->TabIndex = 27;
307             this->cancelButton->Text = L"Cancel";
308             this->cancelButton->UseVisualStyleBackColor = true;
309             this->cancelButton->Click += gcnew System::EventHandler(this, &AnimateDialog::cancelButton_Click);
310             //
311             // minimumSizeBox
312             //
313             this->minimumSizeBox->Location = System::Drawing::Point(14, 133);
314             this->minimumSizeBox->Name = L"minimumSizeBox";
315             this->minimumSizeBox->Size = System::Drawing::Size(55, 20);
316             this->minimumSizeBox->TabIndex = 9;
317             //
318             // widthBox
319             //
320             this->widthBox->Location = System::Drawing::Point(15, 105);
321             this->widthBox->MaxLength = 5;
322             this->widthBox->Name = L"widthBox";
323             this->widthBox->Size = System::Drawing::Size(55, 20);
324             this->widthBox->TabIndex = 5;
325             this->widthBox->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
326             //
327             // heightBox
328             //
329             this->heightBox->Location = System::Drawing::Point(94, 105);
330             this->heightBox->MaxLength = 5;
331             this->heightBox->Name = L"heightBox";
332             this->heightBox->Size = System::Drawing::Size(55, 20);
333             this->heightBox->TabIndex = 7;
334             this->heightBox->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
335             //
336             // zoom
337             //
338             this->zoom->AutoSize = true;
339             this->zoom->Location = System::Drawing::Point(15, 239);
340             this->zoom->Margin = System::Windows::Forms::Padding(2);
341             this->zoom->Name = L"zoom";
342             this->zoom->Size = System::Drawing::Size(101, 17);
343             this->zoom->TabIndex = 19;
344             this->zoom->Text = L"Zoom animation";
345             this->zoom->UseVisualStyleBackColor = true;
346             //
347             // lengthBox
348             //
349             this->lengthBox->Location = System::Drawing::Point(15, 288);
350             this->lengthBox->Margin = System::Windows::Forms::Padding(2);
351             this->lengthBox->MaxLength = 5;
352             this->lengthBox->Name = L"lengthBox";
353             this->lengthBox->Size = System::Drawing::Size(52, 20);
354             this->lengthBox->TabIndex = 21;
355             this->lengthBox->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
356             //
357             // frameRate
358             //
359             this->frameRate->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
360             this->frameRate->FormattingEnabled = true;
361             this->frameRate->Items->AddRange(gcnew cli::array< System::Object^  >(7) { L"8", L"10", L"12", L"15", L"30", L"50", L"60" });
362             this->frameRate->Location = System::Drawing::Point(94, 288);
363             this->frameRate->Margin = System::Windows::Forms::Padding(2);
364             this->frameRate->Name = L"frameRate";
365             this->frameRate->Size = System::Drawing::Size(62, 21);
366             this->frameRate->TabIndex = 22;
367             //
368             // label13
369             //
370             this->label13->AutoSize = true;
371             this->label13->Font = (gcnew System::Drawing::Font(L"Symbol", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
372                 static_cast<System::Byte>(2)));
373             this->label13->Location = System::Drawing::Point(72, 286);
374             this->label13->Name = L"label13";
375             this->label13->Size = System::Drawing::Size(17, 16);
376             this->label13->TabIndex = 25;
377             this->label13->Text = L"�";
378             //
379             // label14
380             //
381             this->label14->AutoSize = true;
382             this->label14->Location = System::Drawing::Point(162, 288);
383             this->label14->Name = L"label14";
384             this->label14->Size = System::Drawing::Size(73, 13);
385             this->label14->TabIndex = 26;
386             this->label14->Text = L"seconds � fps";
387             //
388             // label15
389             //
390             this->label15->AutoSize = true;
391             this->label15->Location = System::Drawing::Point(95, 269);
392             this->label15->Name = L"label15";
393             this->label15->Size = System::Drawing::Size(62, 13);
394             this->label15->TabIndex = 24;
395             this->label15->Text = L"Frame Rate";
396             //
397             // label16
398             //
399             this->label16->AutoSize = true;
400             this->label16->Location = System::Drawing::Point(28, 269);
401             this->label16->Name = L"label16";
402             this->label16->Size = System::Drawing::Size(40, 13);
403             this->label16->TabIndex = 23;
404             this->label16->Text = L"Length";
405             //
406             // frameNumber
407             //
408             this->frameNumber->Location = System::Drawing::Point(171, 253);
409             this->frameNumber->MaxLength = 5;
410             this->frameNumber->Name = L"frameNumber";
411             this->frameNumber->Size = System::Drawing::Size(55, 20);
412             this->frameNumber->TabIndex = 24;
413             this->frameNumber->Text = L"1";
414             this->frameNumber->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
415             //
416             // frameLabel
417             //
418             this->frameLabel->AutoSize = true;
419             this->frameLabel->Location = System::Drawing::Point(191, 238);
420             this->frameLabel->Name = L"frameLabel";
421             this->frameLabel->Size = System::Drawing::Size(36, 13);
422             this->frameLabel->TabIndex = 27;
423             this->frameLabel->Text = L"Frame";
424             //
425             // codecLabel
426             //
427             this->codecLabel->AutoSize = true;
428             this->codecLabel->Location = System::Drawing::Point(188, 237);
429             this->codecLabel->Name = L"codecLabel";
430             this->codecLabel->Size = System::Drawing::Size(38, 13);
431             this->codecLabel->TabIndex = 28;
432             this->codecLabel->Text = L"Codec";
433             //
434             // codec
435             //
436             this->codec->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
437             this->codec->FormattingEnabled = true;
438             this->codec->Items->AddRange(gcnew cli::array< System::Object^  >(2) { L"H.264", L"ProRes" });
439             this->codec->Location = System::Drawing::Point(171, 252);
440             this->codec->Margin = System::Windows::Forms::Padding(2);
441             this->codec->Name = L"codec";
442             this->codec->Size = System::Drawing::Size(62, 21);
443             this->codec->TabIndex = 23;
444             //
445             // showPreview
446             //
447             this->showPreview->AutoSize = true;
448             this->showPreview->Location = System::Drawing::Point(15, 316);
449             this->showPreview->Margin = System::Windows::Forms::Padding(2);
450             this->showPreview->Name = L"showPreview";
451             this->showPreview->Size = System::Drawing::Size(64, 17);
452             this->showPreview->TabIndex = 25;
453             this->showPreview->Text = L"Preview";
454             this->showPreview->UseVisualStyleBackColor = true;
455             this->showPreview->CheckedChanged += gcnew System::EventHandler(this, &AnimateDialog::showPreview_CheckedChanged);
456             //
457             // loopPreview
458             //
459             this->loopPreview->AutoSize = true;
460             this->loopPreview->Location = System::Drawing::Point(15, 337);
461             this->loopPreview->Name = L"loopPreview";
462             this->loopPreview->Size = System::Drawing::Size(50, 17);
463             this->loopPreview->TabIndex = 29;
464             this->loopPreview->Text = L"Loop";
465             this->loopPreview->UseVisualStyleBackColor = true;
466             //
467             // AnimateDialog
468             //
469             this->AcceptButton = this->OKbutton;
470             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
471             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
472             this->CancelButton = this->cancelButton;
473             this->ClientSize = System::Drawing::Size(258, 357);
474             this->Controls->Add(this->loopPreview);
475             this->Controls->Add(this->showPreview);
476             this->Controls->Add(this->codec);
477             this->Controls->Add(this->codecLabel);
478             this->Controls->Add(this->frameNumber);
479             this->Controls->Add(this->frameLabel);
480             this->Controls->Add(this->label13);
481             this->Controls->Add(this->label14);
482             this->Controls->Add(this->label15);
483             this->Controls->Add(this->label16);
484             this->Controls->Add(this->frameRate);
485             this->Controls->Add(this->lengthBox);
486             this->Controls->Add(this->zoom);
487             this->Controls->Add(this->heightBox);
488             this->Controls->Add(this->widthBox);
489             this->Controls->Add(this->minimumSizeBox);
490             this->Controls->Add(this->cancelButton);
491             this->Controls->Add(this->OKbutton);
492             this->Controls->Add(this->label12);
493             this->Controls->Add(this->label11);
494             this->Controls->Add(this->label10);
495             this->Controls->Add(this->label9);
496             this->Controls->Add(this->label8);
497             this->Controls->Add(this->label7);
498             this->Controls->Add(this->borderTrackBar);
499             this->Controls->Add(this->label6);
500             this->Controls->Add(this->label5);
501             this->Controls->Add(this->label4);
502             this->Controls->Add(this->label3);
503             this->Controls->Add(this->label2);
504             this->Controls->Add(this->label1);
505             this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
506             this->MaximizeBox = false;
507             this->MinimizeBox = false;
508             this->Name = L"AnimateDialog";
509             this->ShowInTaskbar = false;
510             this->SizeGripStyle = System::Windows::Forms::SizeGripStyle::Hide;
511             this->Text = L"Animate";
512             (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->borderTrackBar))->EndInit();
513             this->ResumeLayout(false);
514             this->PerformLayout();
515 
516         }
517 #pragma endregion
518 private:
519     System::Void setup_dialog(System::Object^  sender, System::EventArgs^  e)
520     {
521         renderParameters->initFromPrefs();
522         widthBox->Text = renderParameters->animateWidth.ToString();
523         heightBox->Text = renderParameters->animateHeight.ToString();
524         borderTrackBar->Value = (int)((renderParameters->borderSize + 1.0) * 33.0);
525         minimumSizeBox->Text = renderParameters->minimumSize.ToString();
526         zoom->Checked = renderParameters->animateZoom;
527         lengthBox->Text = renderParameters->length.ToString();
528         int i = frameRate->FindStringExact(renderParameters->frameRate.ToString());
529         frameRate->SelectedIndex = i < 0 ? 3 : i;
530         if (renderParameters->animateFrame) {
531             if (renderParameters->frame < 1)
532                 renderParameters->frame = 1;
533             frameNumber->Text = renderParameters->frame.ToString();
534             this->Text = L"Animate a Frame";
535             frameNumber->Visible = true;
536             frameLabel->Visible = true;
537             showPreview->Visible = false;
538             loopPreview->Visible = false;
539             codecLabel->Visible = false;
540             codec->Visible = false;
541         } else {
542             codec->SelectedIndex = renderParameters->codec;
543             showPreview->Checked = renderParameters->preview;
544             loopPreview->Checked = renderParameters->loop;
545             loopPreview->Enabled = renderParameters->preview;
546             frameNumber->Visible = false;
547             frameLabel->Visible = false;
548             showPreview->Visible = true;
549             loopPreview->Visible = true;
550             codecLabel->Visible = true;
551             codec->Visible = true;
552         }
553     }
554 private:
555     System::Void OKbutton_Click(System::Object^  sender, System::EventArgs^  e)
556     {
557         try {
558             renderParameters->animateWidth = System::Int32::Parse(widthBox->Text);
559             renderParameters->animateHeight = System::Int32::Parse(heightBox->Text);
560             renderParameters->borderSize = (double) (borderTrackBar->Value) / 33.0 - 1.0;
561             renderParameters->minimumSize = System::Single::Parse(minimumSizeBox->Text);
562             renderParameters->length = System::Int32::Parse(lengthBox->Text);
563             renderParameters->frameRate = System::Int32::Parse(frameRate->Text);
564             renderParameters->animateZoom = zoom->Checked;
565             renderParameters->animateFrameCount = renderParameters->length * renderParameters->frameRate;
566             if (renderParameters->animateFrame) {
567                 renderParameters->frame = System::Int32::Parse(frameNumber->Text);
568                 if (renderParameters->frame < 1 ||
569                     renderParameters->frame > renderParameters->animateFrameCount)
570                 {
571                     this->DialogResult = System::Windows::Forms::DialogResult::None;
572                     this->Text = L"Illegal frame number";
573                     System::Media::SystemSounds::Asterisk->Play();
574                     return;
575                 }
576             } else {
577                 renderParameters->codec = codec->SelectedIndex;
578                 renderParameters->preview = showPreview->Checked;
579                 renderParameters->loop = loopPreview->Checked;
580             }
581             renderParameters->saveToPrefs();
582         } catch (System::SystemException^) {
583             this->DialogResult = System::Windows::Forms::DialogResult::Cancel;
584             System::Media::SystemSounds::Asterisk->Play();
585         }
586         this->Close();
587     }
588 private:
589     System::Void cancelButton_Click(System::Object^  sender, System::EventArgs^  e)
590     {
591         this->Close();
592     }
593 private: System::Void label11_Click(System::Object^  sender, System::EventArgs^  e) {
594 }
595 private: System::Void showPreview_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
596     loopPreview->Enabled = showPreview->Checked;
597 }
598 };
599 }
600