allow user to set time for OnePicAudio in General tab
[marukotoolbox.git] / mp4box / InputBox.cs
blobc6fba9c74f2523b03644ebff2c8cd58fe2bef1d8
1 // ------------------------------------------------------------------
2 // Copyright (C) 2016 Maruko Toolbox Project
3 //
4 //
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
15 // express or implied.
16 // See the License for the specific language governing permissions
17 // and limitations under the License.
18 // -------------------------------------------------------------------
21 using System;
22 using System.Collections.Generic;
23 using System.ComponentModel;
24 using System.Data;
25 using System.Drawing;
26 using System.Linq;
27 using System.Text;
28 using System.Windows.Forms;
30 namespace mp4box
32 public partial class InputBox : Form
34 public InputBox()
36 InitializeComponent();
39 private void qqButton1_Click(object sender, EventArgs e)
41 DialogResult = DialogResult.OK;
42 Close();
45 private void btnCancel_Click(object sender, EventArgs e)
47 DialogResult = DialogResult.Cancel;
48 Close();
51 internal static string Show(string message, string title, string text)
53 using (InputBox inbox = new InputBox())
55 inbox.lblMessage.Text = message;
56 inbox.text.Text = text;
57 inbox.Text = title;
58 if (inbox.ShowDialog() == DialogResult.OK)
59 return inbox.text.Text;
60 return null;
64 private void text_KeyPress(object sender, KeyPressEventArgs e)
66 if (e.KeyChar == 13)
68 qqButton1_Click(null, null);
70 else if (e.KeyChar == 27)
72 btnCancel_Click(null, null);