[mapguide-commits] r6511 - trunk/Tools/Maestro/Maestro.Base/UI
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Feb 13 20:25:54 EST 2012
Author: jng
Date: 2012-02-13 17:25:54 -0800 (Mon, 13 Feb 2012)
New Revision: 6511
Modified:
trunk/Tools/Maestro/Maestro.Base/UI/OpenResourceIdDialog.Designer.cs
trunk/Tools/Maestro/Maestro.Base/UI/OpenResourceIdDialog.cs
Log:
#1937: Add a resource picker browsing mode (as redundant as that seems) to the Open Resource Dialog
Modified: trunk/Tools/Maestro/Maestro.Base/UI/OpenResourceIdDialog.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/OpenResourceIdDialog.Designer.cs 2012-02-13 15:56:19 UTC (rev 6510)
+++ trunk/Tools/Maestro/Maestro.Base/UI/OpenResourceIdDialog.Designer.cs 2012-02-14 01:25:54 UTC (rev 6511)
@@ -35,6 +35,7 @@
this.btnOpen = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.lblMessage = new System.Windows.Forms.Label();
+ this.btnBrowse = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
@@ -48,13 +49,13 @@
//
// cmbConnection
//
- this.cmbConnection.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.cmbConnection.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.cmbConnection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbConnection.FormattingEnabled = true;
this.cmbConnection.Location = new System.Drawing.Point(110, 10);
this.cmbConnection.Name = "cmbConnection";
- this.cmbConnection.Size = new System.Drawing.Size(264, 21);
+ this.cmbConnection.Size = new System.Drawing.Size(321, 21);
this.cmbConnection.TabIndex = 1;
//
// label2
@@ -68,17 +69,17 @@
//
// txtResourceId
//
- this.txtResourceId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtResourceId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.txtResourceId.Location = new System.Drawing.Point(110, 37);
this.txtResourceId.Name = "txtResourceId";
- this.txtResourceId.Size = new System.Drawing.Size(264, 20);
+ this.txtResourceId.Size = new System.Drawing.Size(291, 20);
this.txtResourceId.TabIndex = 3;
//
// btnOpen
//
this.btnOpen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnOpen.Location = new System.Drawing.Point(218, 68);
+ this.btnOpen.Location = new System.Drawing.Point(275, 68);
this.btnOpen.Name = "btnOpen";
this.btnOpen.Size = new System.Drawing.Size(75, 23);
this.btnOpen.TabIndex = 4;
@@ -90,7 +91,7 @@
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.btnCancel.Location = new System.Drawing.Point(299, 68);
+ this.btnCancel.Location = new System.Drawing.Point(356, 68);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 5;
@@ -100,22 +101,34 @@
//
// lblMessage
//
- this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.lblMessage.ForeColor = System.Drawing.Color.Red;
this.lblMessage.Location = new System.Drawing.Point(13, 73);
this.lblMessage.Name = "lblMessage";
- this.lblMessage.Size = new System.Drawing.Size(199, 18);
+ this.lblMessage.Size = new System.Drawing.Size(256, 18);
this.lblMessage.TabIndex = 6;
//
+ // btnBrowse
+ //
+ this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnBrowse.Location = new System.Drawing.Point(407, 35);
+ this.btnBrowse.Name = "btnBrowse";
+ this.btnBrowse.Size = new System.Drawing.Size(24, 23);
+ this.btnBrowse.TabIndex = 7;
+ this.btnBrowse.Text = "...";
+ this.btnBrowse.UseVisualStyleBackColor = true;
+ this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
+ //
// OpenResourceIdDialog
//
this.AcceptButton = this.btnOpen;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
- this.ClientSize = new System.Drawing.Size(386, 103);
+ this.ClientSize = new System.Drawing.Size(443, 103);
this.ControlBox = false;
+ this.Controls.Add(this.btnBrowse);
this.Controls.Add(this.lblMessage);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOpen);
@@ -140,5 +153,6 @@
private System.Windows.Forms.Button btnOpen;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label lblMessage;
+ private System.Windows.Forms.Button btnBrowse;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Base/UI/OpenResourceIdDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/OpenResourceIdDialog.cs 2012-02-13 15:56:19 UTC (rev 6510)
+++ trunk/Tools/Maestro/Maestro.Base/UI/OpenResourceIdDialog.cs 2012-02-14 01:25:54 UTC (rev 6511)
@@ -29,6 +29,7 @@
using OSGeo.MapGuide.MaestroAPI;
using Maestro.Base.Services;
using System.Collections;
+using Maestro.Editors.Generic;
namespace Maestro.Base.UI
{
@@ -83,5 +84,16 @@
{
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
}
+
+ private void btnBrowse_Click(object sender, EventArgs e)
+ {
+ using (var picker = new ResourcePicker(SelectedConnection.ResourceService, ResourcePickerMode.OpenResource))
+ {
+ if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ {
+ txtResourceId.Text = picker.ResourceID;
+ }
+ }
+ }
}
}
More information about the mapguide-commits
mailing list