/*********************************************************

consumeQOD.js : copyright 2001, Essam Ahmed

This sample is from the book JScript.NET Programming (2001)
by Essam Ahmed

*********************************************************/


import System;
import System.Drawing;
import System.ComponentModel;
import System.Windows.Forms;

import jsNetProgQOD.dll;

package qodNamespace {
    
    public class qodClass extends System.Windows.Forms.Form {
        
        private var txtQuote : System.Windows.Forms.TextBox;
        
        private var button1 : System.Windows.Forms.Button;
        
        private var components : System.ComponentModel.IContainer=null;
        
        public function qodClass() {
            this.InitializeComponent();
            
        }
        
        public static System.STAThreadAttribute() function Main() {
            System.Windows.Forms.Application.Run(new qodClass());
        }
        
        private function InitializeComponent() {
            this.SuspendLayout();
            
            this.txtQuote = new System.Windows.Forms.TextBox();
            this.button1 = new System.Windows.Forms.Button();
            
            // 
            // txtQuote
            // 
            this.txtQuote.Cursor = System.Windows.Forms.Cursors.Default;
            this.txtQuote.Location = new System.Drawing.Point(24, 40);
            this.txtQuote.Multiline = true;
            this.txtQuote.Name = "txtQuote";
            this.txtQuote.Size = new System.Drawing.Size(288, 72);
            this.txtQuote.TabIndex = 0;
            this.txtQuote.Text = "Kliknij przycisk";
            this.txtQuote.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(120, 132);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(88, 40);
            this.button1.TabIndex = 1;
            this.button1.Text = "Pobierz cytat";
            this.button1.add_Click(get_Quote);
            this.button1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            // 
            // Win32Form1
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
            this.ClientSize = new System.Drawing.Size(328, 197);
            this.Controls.AddRange([this.button1, this.txtQuote]);
            this.Font = new System.Drawing.Font("Microsoft Sans Serif", float(9.75), System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, byte(0));
            this.Name = "qodClass";
            this.Text = "Wyświetlanie cytatu dnia - przykład";
            this.ResumeLayout(false);
        }

        public function get_Quote(obj : Object, eArgs : EventArgs) : void  {
			var qod : jsNetProgQOD.QuoteOfTheDay = new  jsNetProgQOD.QuoteOfTheDay();
			txtQuote.Text=qod.getQuote();
        }

    }
}

//qodNamespace.qodClass.Main();
Application.Run(new qodNamespace.qodClass);