Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using ScriptMP3;
- using DotNetLib.Common.Util;
- using System.Drawing;
- namespace Scripts {
- public class Script
- {
- public Script() {
- ExpressionDialog dlg = new ExpressionDialog();
- if(dlg.ShowDialog() == DialogResult.OK) {
- MessageBox.Show(Scripting.Push("select->calc(`" + dlg.Expression +"`)"));
- }
- }
- ~Script() {
- }
- }
- #region "Expressiondialog"
- public class ExpressionDialog : Form {
- TextBox tb;
- public string Expression {
- get {
- return tb.Text;
- }
- set {
- tb.Text = value;
- }
- }
- public ExpressionDialog() {
- this.FormBorderStyle = FormBorderStyle.FixedDialog;
- this.Text = "Eingabe";
- this.Size = new Size(275,95);
- this.StartPosition = FormStartPosition.CenterScreen;
- Button ok = new Button();
- ok.Text = "OK";
- ok.Location = new Point(185,35);
- ok.Click += OnOkClicked;
- tb = new TextBox();
- tb.Location = new Point(10,10);
- tb.Size += new Size(150,0);
- this.Controls.Add(tb);
- this.Controls.Add(ok);
- }
- private void OnOkClicked(Object sender, EventArgs e) {
- this.DialogResult = DialogResult.OK;
- }
- }
- #endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement