 
 /*------------------------------------------------------------------------
    File        : Form1
    Purpose     : 
    Syntax      : 
    Description : 
    Author(s)   : 
    Created     : 
    Notes       : 
  ----------------------------------------------------------------------*/

USING Progress.Lang.*.
USING Progress.Windows.Form.
USING System.Windows.Forms.DialogResult FROM ASSEMBLY.

BLOCK-LEVEL ON ERROR UNDO, THROW.

CLASS Form1 INHERITS Form: 
	
    DEFINE PRIVATE VARIABLE BtnSaveFile AS System.Windows.Forms.Button NO-UNDO.
    DEFINE PRIVATE VARIABLE BtnOpenFile AS System.Windows.Forms.Button NO-UNDO.
    DEFINE PRIVATE VARIABLE CheckStdDialogs AS System.Windows.Forms.CheckBox NO-UNDO.
	DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO.
    DEFINE PRIVATE VARIABLE groupBox1 AS System.Windows.Forms.GroupBox NO-UNDO.
    
    DEFINE PRIVATE VARIABLE m_VirtualUI AS CLASS Cybele.Thinfinity.VirtualUI NO-UNDO.
    DEFINE PRIVATE VARIABLE OpenFileDlg AS System.Windows.Forms.OpenFileDialog NO-UNDO.
    DEFINE PRIVATE VARIABLE SaveFileDlg AS System.Windows.Forms.SaveFileDialog NO-UNDO.
	
	CONSTRUCTOR PUBLIC Form1 (  ):
        InitializeComponent().
        
        m_VirtualUI = NEW Cybele.Thinfinity.VirtualUI().
        m_VirtualUI:Enabled = TRUE.
        m_VirtualUI:DevMode = TRUE.
        m_VirtualUI:DevServer:Enabled = TRUE.
        m_VirtualUI:Start(30).
        
        THIS-OBJECT:ComponentsCollection:Add(THIS-OBJECT:components).
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.

	END CONSTRUCTOR.

	@VisualDesigner.
	METHOD PRIVATE VOID BtnOpenFile_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
	    IF OpenFileDlg:ShowDialog() = DialogResult:Ok THEN
	       MESSAGE OpenFileDlg:FileName VIEW-AS ALERT-BOX INFORMATION BUTTONS OK TITLE "OpenDialog Filename".
	END METHOD.

	@VisualDesigner.
	METHOD PRIVATE VOID BtnSaveFile_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
		IF SaveFileDlg:ShowDialog() = DialogResult:Ok THEN
           MESSAGE SaveFileDlg:FileName VIEW-AS ALERT-BOX INFORMATION BUTTONS OK TITLE "SaveDialog Filename".
	END METHOD.

	@VisualDesigner.
	METHOD PRIVATE VOID CheckStdDialogs_CheckedChanged( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
		m_VirtualUI:StdDialogs = CheckStdDialogs:Checked.
	END METHOD.

	METHOD PRIVATE VOID InitializeComponent(  ):
		
        /* NOTE: The following method is automatically generated.
        
        We strongly suggest that the contents of this method only be modified using the
        Visual Designer to avoid any incompatible modifications.
        
        Modifying the contents of this method using a code editor will invalidate any support for this file. */
        THIS-OBJECT:groupBox1 = NEW System.Windows.Forms.GroupBox().
        THIS-OBJECT:BtnSaveFile = NEW System.Windows.Forms.Button().
        THIS-OBJECT:BtnOpenFile = NEW System.Windows.Forms.Button().
        THIS-OBJECT:CheckStdDialogs = NEW System.Windows.Forms.CheckBox().
        THIS-OBJECT:OpenFileDlg = NEW System.Windows.Forms.OpenFileDialog().
        THIS-OBJECT:SaveFileDlg = NEW System.Windows.Forms.SaveFileDialog().
        THIS-OBJECT:groupBox1:SuspendLayout().
        THIS-OBJECT:SuspendLayout().
        /*  */
        /* groupBox1 */
        /*  */
        THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:BtnSaveFile).
        THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:BtnOpenFile).
        THIS-OBJECT:groupBox1:Controls:Add(THIS-OBJECT:CheckStdDialogs).
        THIS-OBJECT:groupBox1:Location = NEW System.Drawing.Point(12, 12).
        THIS-OBJECT:groupBox1:Name = "groupBox1".
        THIS-OBJECT:groupBox1:Size = NEW System.Drawing.Size(200, 110).
        THIS-OBJECT:groupBox1:TabIndex = 0.
        THIS-OBJECT:groupBox1:TabStop = FALSE.
        THIS-OBJECT:groupBox1:Text = "Dialogs".
        THIS-OBJECT:groupBox1:UseCompatibleTextRendering = TRUE.
        /*  */
        /* BtnSaveFile */
        /*  */
        THIS-OBJECT:BtnSaveFile:Location = NEW System.Drawing.Point(106, 65).
        THIS-OBJECT:BtnSaveFile:Name = "BtnSaveFile".
        THIS-OBJECT:BtnSaveFile:Size = NEW System.Drawing.Size(75, 23).
        THIS-OBJECT:BtnSaveFile:TabIndex = 2.
        THIS-OBJECT:BtnSaveFile:Text = "Save File".
        THIS-OBJECT:BtnSaveFile:UseCompatibleTextRendering = TRUE.
        THIS-OBJECT:BtnSaveFile:UseVisualStyleBackColor = TRUE.
        THIS-OBJECT:BtnSaveFile:Click:Subscribe(THIS-OBJECT:BtnSaveFile_Click).
        /*  */
        /* BtnOpenFile */
        /*  */
        THIS-OBJECT:BtnOpenFile:Location = NEW System.Drawing.Point(15, 65).
        THIS-OBJECT:BtnOpenFile:Name = "BtnOpenFile".
        THIS-OBJECT:BtnOpenFile:Size = NEW System.Drawing.Size(75, 23).
        THIS-OBJECT:BtnOpenFile:TabIndex = 1.
        THIS-OBJECT:BtnOpenFile:Text = "Open File".
        THIS-OBJECT:BtnOpenFile:UseCompatibleTextRendering = TRUE.
        THIS-OBJECT:BtnOpenFile:UseVisualStyleBackColor = TRUE.
        THIS-OBJECT:BtnOpenFile:Click:Subscribe(THIS-OBJECT:BtnOpenFile_Click).
        /*  */
        /* CheckStdDialogs */
        /*  */
        THIS-OBJECT:CheckStdDialogs:Location = NEW System.Drawing.Point(15, 28).
        THIS-OBJECT:CheckStdDialogs:Name = "CheckStdDialogs".
        THIS-OBJECT:CheckStdDialogs:Size = NEW System.Drawing.Size(154, 18).
        THIS-OBJECT:CheckStdDialogs:TabIndex = 0.
        THIS-OBJECT:CheckStdDialogs:Text = "Standard dialogs".
        THIS-OBJECT:CheckStdDialogs:UseCompatibleTextRendering = TRUE.
        THIS-OBJECT:CheckStdDialogs:UseVisualStyleBackColor = TRUE.
        THIS-OBJECT:CheckStdDialogs:CheckedChanged:Subscribe(THIS-OBJECT:CheckStdDialogs_CheckedChanged).
        /*  */
        /* Form1 */
        /*  */
        THIS-OBJECT:ClientSize = NEW System.Drawing.Size(334, 419).
        THIS-OBJECT:Controls:Add(THIS-OBJECT:groupBox1).
        THIS-OBJECT:Name = "Form1".
        THIS-OBJECT:Text = "VirtualUI demo".
        THIS-OBJECT:groupBox1:ResumeLayout(FALSE).
        THIS-OBJECT:ResumeLayout(FALSE).
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.
	END METHOD.

	DESTRUCTOR PUBLIC Form1 ( ):

	END DESTRUCTOR.

END CLASS.