Better client documentation regarding our bitmap layout.
authorsl
Wed, 22 Oct 2014 12:17:52 +0200
changeset 71f444344fc205
parent 70 dcd2bbb90d42
child 72 fd0bb39a7818
Better client documentation regarding our bitmap layout.
Client/MainForm.Designer.cs
Client/MainForm.cs
     1.1 --- a/Client/MainForm.Designer.cs	Tue Oct 14 19:32:09 2014 +0200
     1.2 +++ b/Client/MainForm.Designer.cs	Wed Oct 22 12:17:52 2014 +0200
     1.3 @@ -37,7 +37,7 @@
     1.4              this.buttonSetTopText = new System.Windows.Forms.Button();
     1.5              this.buttonLayoutUpdate = new System.Windows.Forms.Button();
     1.6              this.buttonSetBitmap = new System.Windows.Forms.Button();
     1.7 -            this.buttonLayoutUpdatWithSpan = new System.Windows.Forms.Button();
     1.8 +            this.buttonBitmapLayout = new System.Windows.Forms.Button();
     1.9              this.SuspendLayout();
    1.10              // 
    1.11              // buttonSetText
    1.12 @@ -124,22 +124,22 @@
    1.13              this.buttonSetBitmap.UseVisualStyleBackColor = true;
    1.14              this.buttonSetBitmap.Click += new System.EventHandler(this.buttonSetBitmap_Click);
    1.15              // 
    1.16 -            // buttonLayoutUpdatWithSpan
    1.17 +            // buttonBitmapLayout
    1.18              // 
    1.19 -            this.buttonLayoutUpdatWithSpan.Location = new System.Drawing.Point(176, 189);
    1.20 -            this.buttonLayoutUpdatWithSpan.Name = "buttonLayoutUpdatWithSpan";
    1.21 -            this.buttonLayoutUpdatWithSpan.Size = new System.Drawing.Size(75, 23);
    1.22 -            this.buttonLayoutUpdatWithSpan.TabIndex = 27;
    1.23 -            this.buttonLayoutUpdatWithSpan.Text = "Layout span";
    1.24 -            this.buttonLayoutUpdatWithSpan.UseVisualStyleBackColor = true;
    1.25 -            this.buttonLayoutUpdatWithSpan.Click += new System.EventHandler(this.buttonLayoutUpdatWithSpan_Click);
    1.26 +            this.buttonBitmapLayout.Location = new System.Drawing.Point(176, 189);
    1.27 +            this.buttonBitmapLayout.Name = "buttonBitmapLayout";
    1.28 +            this.buttonBitmapLayout.Size = new System.Drawing.Size(75, 35);
    1.29 +            this.buttonBitmapLayout.TabIndex = 27;
    1.30 +            this.buttonBitmapLayout.Text = "Bitmap Layout";
    1.31 +            this.buttonBitmapLayout.UseVisualStyleBackColor = true;
    1.32 +            this.buttonBitmapLayout.Click += new System.EventHandler(this.buttonBitmapLayout_Click);
    1.33              // 
    1.34              // MainForm
    1.35              // 
    1.36              this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    1.37              this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    1.38              this.ClientSize = new System.Drawing.Size(443, 252);
    1.39 -            this.Controls.Add(this.buttonLayoutUpdatWithSpan);
    1.40 +            this.Controls.Add(this.buttonBitmapLayout);
    1.41              this.Controls.Add(this.buttonSetBitmap);
    1.42              this.Controls.Add(this.buttonLayoutUpdate);
    1.43              this.Controls.Add(this.buttonSetTopText);
    1.44 @@ -169,7 +169,7 @@
    1.45          private System.Windows.Forms.Button buttonSetTopText;
    1.46          private System.Windows.Forms.Button buttonLayoutUpdate;
    1.47          private System.Windows.Forms.Button buttonSetBitmap;
    1.48 -        private System.Windows.Forms.Button buttonLayoutUpdatWithSpan;
    1.49 +        private System.Windows.Forms.Button buttonBitmapLayout;
    1.50      }
    1.51  }
    1.52  
     2.1 --- a/Client/MainForm.cs	Tue Oct 14 19:32:09 2014 +0200
     2.2 +++ b/Client/MainForm.cs	Wed Oct 22 12:17:52 2014 +0200
     2.3 @@ -182,12 +182,21 @@
     2.4              iClient.SetBitmap(field);
     2.5          }
     2.6  
     2.7 -        private void buttonLayoutUpdatWithSpan_Click(object sender, EventArgs e)
     2.8 +        private void buttonBitmapLayout_Click(object sender, EventArgs e)
     2.9 +        {
    2.10 +            SetLayoutWithBitmap();
    2.11 +        }
    2.12 +
    2.13 +        /// <summary>
    2.14 +        /// Define a layout with a bitmap field on the left and two lines of text on the right.
    2.15 +        /// </summary>
    2.16 +        private void SetLayoutWithBitmap()
    2.17          {
    2.18              //Define a 2 by 2 layout
    2.19              TableLayout layout = new TableLayout(2, 2);
    2.20 -            //Second column only takes up 25%
    2.21 +            //First column only takes 25%
    2.22              layout.Columns[0].Width = 25F;
    2.23 +            //Second column takes up 75% 
    2.24              layout.Columns[1].Width = 75F;
    2.25              //Send layout to server
    2.26              iClient.SetLayout(layout);
    2.27 @@ -208,8 +217,11 @@
    2.28                  graphics.DrawLine(blackPen, x1, y2, x2, y1);
    2.29              }
    2.30  
    2.31 +            //Create a bitmap field from the bitmap we just created
    2.32              BitmapField field = new BitmapField(0, bitmap);
    2.33 +            //We want our bitmap field to span across two rows
    2.34              field.RowSpan = 2;
    2.35 +            //Send it to our server
    2.36              iClient.SetBitmap(field);
    2.37  
    2.38              //Set texts