# HG changeset patch # User sl # Date 1413973072 -7200 # Node ID f444344fc20514171fd5a3e79eea4359bdca4c49 # Parent dcd2bbb90d422422355118e0a8582d9f72aee4e2 Better client documentation regarding our bitmap layout. diff -r dcd2bbb90d42 -r f444344fc205 Client/MainForm.Designer.cs --- a/Client/MainForm.Designer.cs Tue Oct 14 19:32:09 2014 +0200 +++ b/Client/MainForm.Designer.cs Wed Oct 22 12:17:52 2014 +0200 @@ -37,7 +37,7 @@ this.buttonSetTopText = new System.Windows.Forms.Button(); this.buttonLayoutUpdate = new System.Windows.Forms.Button(); this.buttonSetBitmap = new System.Windows.Forms.Button(); - this.buttonLayoutUpdatWithSpan = new System.Windows.Forms.Button(); + this.buttonBitmapLayout = new System.Windows.Forms.Button(); this.SuspendLayout(); // // buttonSetText @@ -124,22 +124,22 @@ this.buttonSetBitmap.UseVisualStyleBackColor = true; this.buttonSetBitmap.Click += new System.EventHandler(this.buttonSetBitmap_Click); // - // buttonLayoutUpdatWithSpan + // buttonBitmapLayout // - this.buttonLayoutUpdatWithSpan.Location = new System.Drawing.Point(176, 189); - this.buttonLayoutUpdatWithSpan.Name = "buttonLayoutUpdatWithSpan"; - this.buttonLayoutUpdatWithSpan.Size = new System.Drawing.Size(75, 23); - this.buttonLayoutUpdatWithSpan.TabIndex = 27; - this.buttonLayoutUpdatWithSpan.Text = "Layout span"; - this.buttonLayoutUpdatWithSpan.UseVisualStyleBackColor = true; - this.buttonLayoutUpdatWithSpan.Click += new System.EventHandler(this.buttonLayoutUpdatWithSpan_Click); + this.buttonBitmapLayout.Location = new System.Drawing.Point(176, 189); + this.buttonBitmapLayout.Name = "buttonBitmapLayout"; + this.buttonBitmapLayout.Size = new System.Drawing.Size(75, 35); + this.buttonBitmapLayout.TabIndex = 27; + this.buttonBitmapLayout.Text = "Bitmap Layout"; + this.buttonBitmapLayout.UseVisualStyleBackColor = true; + this.buttonBitmapLayout.Click += new System.EventHandler(this.buttonBitmapLayout_Click); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(443, 252); - this.Controls.Add(this.buttonLayoutUpdatWithSpan); + this.Controls.Add(this.buttonBitmapLayout); this.Controls.Add(this.buttonSetBitmap); this.Controls.Add(this.buttonLayoutUpdate); this.Controls.Add(this.buttonSetTopText); @@ -169,7 +169,7 @@ private System.Windows.Forms.Button buttonSetTopText; private System.Windows.Forms.Button buttonLayoutUpdate; private System.Windows.Forms.Button buttonSetBitmap; - private System.Windows.Forms.Button buttonLayoutUpdatWithSpan; + private System.Windows.Forms.Button buttonBitmapLayout; } } diff -r dcd2bbb90d42 -r f444344fc205 Client/MainForm.cs --- a/Client/MainForm.cs Tue Oct 14 19:32:09 2014 +0200 +++ b/Client/MainForm.cs Wed Oct 22 12:17:52 2014 +0200 @@ -182,12 +182,21 @@ iClient.SetBitmap(field); } - private void buttonLayoutUpdatWithSpan_Click(object sender, EventArgs e) + private void buttonBitmapLayout_Click(object sender, EventArgs e) + { + SetLayoutWithBitmap(); + } + + /// + /// Define a layout with a bitmap field on the left and two lines of text on the right. + /// + private void SetLayoutWithBitmap() { //Define a 2 by 2 layout TableLayout layout = new TableLayout(2, 2); - //Second column only takes up 25% + //First column only takes 25% layout.Columns[0].Width = 25F; + //Second column takes up 75% layout.Columns[1].Width = 75F; //Send layout to server iClient.SetLayout(layout); @@ -208,8 +217,11 @@ graphics.DrawLine(blackPen, x1, y2, x2, y1); } + //Create a bitmap field from the bitmap we just created BitmapField field = new BitmapField(0, bitmap); + //We want our bitmap field to span across two rows field.RowSpan = 2; + //Send it to our server iClient.SetBitmap(field); //Set texts