From: <ste...@us...> - 2007-09-25 05:30:34
|
Revision: 196 http://freetrain.svn.sourceforge.net/freetrain/?rev=196&view=rev Author: stevenhoefel Date: 2007-09-24 22:30:37 -0700 (Mon, 24 Sep 2007) Log Message: ----------- Nearly forgot my button class. Modified Paths: -------------- branches/FreeTrainSDL/core/controllers/AbstractControllerForm.cs branches/FreeTrainSDL/core/controllers/AbstractControllerForm.resx branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs branches/FreeTrainSDL/core/controllers/rail/RailRoadController.resx branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs Added Paths: ----------- branches/FreeTrainSDL/SDLGUIButton.cs Added: branches/FreeTrainSDL/SDLGUIButton.cs =================================================================== --- branches/FreeTrainSDL/SDLGUIButton.cs (rev 0) +++ branches/FreeTrainSDL/SDLGUIButton.cs 2007-09-25 05:30:37 UTC (rev 196) @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Drawing; +using System.Windows.Forms; +using Tao.Sdl; +using SDL.net; + +namespace FreeTrainSDL +{ + class SDLGUIButton + { + private int x_pos, y_pos; + Surface btnon, btnoff; + private string button_name, tooltip_text; + bool button_down = false, draw_tooltip = false; + + public EventHandler ButtonClick; + + IntPtr fnt; + + public SDLGUIButton(string name, string tooltip, int x, int y, ref EventHandler click) + { + tooltip_text = tooltip; + x_pos = x; + y_pos = y; + + ButtonClick += click; + + btnoff = new Surface(Application.StartupPath + "\\gui\\" + name + ".png"); + btnon = new Surface(Application.StartupPath + "\\gui\\" + name + "_down.png"); + + fnt = SdlTtf.TTF_OpenFont(Application.StartupPath + "\\gui\\freesans.ttf", 12); + + button_name = name; + } + + public void draw(IntPtr screen) + { + Sdl.SDL_Rect dst = new Sdl.SDL_Rect((short)x_pos,(short)y_pos,btnon.clipSDLRect.w,btnon.clipSDLRect.h); + Sdl.SDL_Rect src = btnon.clipSDLRect; + + if (button_down) Tao.Sdl.Sdl.SDL_BlitSurface(btnon.surfacePtr(),ref src,screen,ref dst); + else Tao.Sdl.Sdl.SDL_BlitSurface(btnoff.surfacePtr(), ref src, screen, ref dst); + + //TOOL TIPS!?!?! + if (draw_tooltip) + { + SDLGUI.drawText(screen, fnt, tooltip_text, Color.White, new Point(x_pos,y_pos + btnon.clipRect.Height + 6), 0, true, false); + } + } + + public void checkMovement(Sdl.SDL_MouseMotionEvent e) + { + draw_tooltip = false; + button_down = false; + if (e.x >= x_pos && e.x <= (x_pos + btnon.clipSDLRect.w)) + if (e.y >= y_pos && e.y <= (y_pos + btnon.clipSDLRect.h)) + { + draw_tooltip = true; + } + + } + + public bool checkClick(Sdl.SDL_MouseButtonEvent e) + { + bool wasGUIClick = false; + button_down = false; + int x = e.x, y = e.y; + if (e.x >= x_pos && e.x <= (x_pos + btnon.clipSDLRect.w)) + { + if (e.y >= y_pos && e.y <= (y_pos + btnon.clipSDLRect.h)) + { + if (e.button == Sdl.SDL_BUTTON_LEFT) + { + button_down = true; + if (ButtonClick != null) ButtonClick(button_name,null); + } + wasGUIClick = true; + } + } + return wasGUIClick; + } + } +} Modified: branches/FreeTrainSDL/core/controllers/AbstractControllerForm.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractControllerForm.cs 2007-09-25 05:29:05 UTC (rev 195) +++ branches/FreeTrainSDL/core/controllers/AbstractControllerForm.cs 2007-09-25 05:30:37 UTC (rev 196) @@ -14,7 +14,9 @@ /// Pop-up tool window to host modal controllers. /// </summary> public class AbstractControllerForm : Form - { + { + private Point mouse_offset; + public AbstractControllerForm() { InitializeComponent(); try @@ -51,25 +53,165 @@ } } - public virtual void updatePreview(){} + public virtual void updatePreview(){} + + protected Label lblTitle; + protected Label lblExit; #region Windows Form Designer generated code private System.ComponentModel.Container components = null; private void InitializeComponent() - { - // - // AbstractControllerImpl - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 12); - this.ClientSize = new System.Drawing.Size(292, 271); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AbstractControllerImpl"; - this.ShowInTaskbar = false; - - } - #endregion + { + this.lblTitle = new System.Windows.Forms.Label(); + this.lblExit = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // lblTitle + // + this.lblTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblTitle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(220)))), ((int)(((byte)(84))))); + this.lblTitle.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblTitle.Location = new System.Drawing.Point(5, 5); + this.lblTitle.Margin = new System.Windows.Forms.Padding(0); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size(275, 15); + this.lblTitle.TabIndex = 0; + this.lblTitle.Text = "AbstractController"; + this.lblTitle.TextAlign = System.Drawing.ContentAlignment.TopLeft; + this.lblTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AbstractControllerForm_MouseDown); + this.lblTitle.MouseMove += new System.Windows.Forms.MouseEventHandler(this.AbstractControllerForm_MouseMove); + this.lblTitle.Paint += new System.Windows.Forms.PaintEventHandler(this.lblTitle_Paint); + // + // lblExit + // + this.lblExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.lblExit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(220)))), ((int)(((byte)(84))))); + this.lblExit.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblExit.Location = new System.Drawing.Point(241, 5); + this.lblExit.Margin = new System.Windows.Forms.Padding(0); + this.lblExit.Name = "lblExit"; + this.lblExit.Size = new System.Drawing.Size(39, 15); + this.lblExit.TabIndex = 1; + this.lblExit.Text = "EXIT"; + this.lblExit.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.lblExit.MouseLeave += new System.EventHandler(this.lblExit_MouseLeave); + this.lblExit.Click += new System.EventHandler(this.lblExit_Click); + this.lblExit.MouseEnter += new System.EventHandler(this.lblExit_MouseEnter); + // + // AbstractControllerForm + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(236)))), ((int)(((byte)(184))))); + this.ClientSize = new System.Drawing.Size(292, 271); + this.Controls.Add(this.lblExit); + this.Controls.Add(this.lblTitle); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AbstractControllerForm"; + this.ShowInTaskbar = false; + this.TopMost = true; + this.Paint += new System.Windows.Forms.PaintEventHandler(this.AbstractControllerForm_Paint); + this.Resize += new System.EventHandler(this.AbstractControllerForm_Resize); + this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.AbstractControllerForm_MouseMove); + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AbstractControllerForm_MouseDown); + this.Load += new System.EventHandler(this.AbstractControllerForm_Load); + this.ResumeLayout(false); + + } + + void lblTitle_Paint(object sender, PaintEventArgs e) + { + System.Drawing.Graphics gr = e.Graphics; + gr.DrawLine(new Pen(Brushes.Black, 1), new Point(this.lblExit.Left - this.lblTitle.Left - 1, -1), new Point(this.lblExit.Left - this.lblTitle.Left - 1, this.lblTitle.Height)); + } + + void lblExit_MouseLeave(object sender, EventArgs e) + { + this.lblExit.BackColor = Color.FromArgb(236, 220, 84); + this.lblExit.ForeColor = Color.Black; + } + + void lblExit_MouseEnter(object sender, EventArgs e) + { + this.lblExit.BackColor = Color.Black; + this.lblExit.ForeColor = Color.White; + } + #endregion + + void AbstractControllerForm_Resize(object sender, EventArgs e) + { + this.lblTitle.Width = this.Width - (this.lblTitle.Left * 2); + this.lblExit.Left = this.lblTitle.Left + this.lblTitle.Width - this.lblExit.Width; + } + + protected void AbstractControllerForm_MouseDown(object sender, MouseEventArgs e) + { + mouse_offset = new Point(-e.X, -e.Y); + } + + protected void AbstractControllerForm_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + Point mousePos = Control.MousePosition; + mousePos.Offset(mouse_offset.X, mouse_offset.Y); + this.Location = mousePos; + } + } + + void AbstractControllerForm_Paint(object sender, PaintEventArgs e) + { + System.Drawing.Graphics gr = e.Graphics; + Point[] pts = new Point[4]; + pts[0] = new Point(0,0); + pts[1] = new Point(this.Width - 1, 0); + pts[2] = new Point(this.Width-1,this.Height-1); + pts[3] = new Point(0, this.Height - 1); + gr.DrawPolygon(new Pen(Brushes.Black, 1), pts); + + pts[0].X += 2; pts[0].Y += 2; + pts[1].X -= 2; pts[1].Y += 2; + pts[2].X -= 2; pts[2].Y -= 2; + pts[3].X += 2; pts[3].Y -= 2; + gr.DrawPolygon(new Pen(Color.FromArgb(206,204,170), 3), pts); + + pts[0].X += 1; pts[0].Y += 1; + pts[1].X -= 1; pts[1].Y += 1; + pts[2].X -= 1; pts[2].Y -= 1; + pts[3].X += 1; pts[3].Y -= 1; + gr.DrawPolygon(new Pen(Brushes.Black, 1), pts); + + pts[0].X -= 1; pts[0].Y -= 1; + pts[1].Y -= 1; + gr.DrawLine(new Pen(Color.FromArgb(120,119,102),1), pts[0], pts[1]); + + pts[3].X -= 1;// pts[3].Y += 1; + gr.DrawLine(new Pen(Color.FromArgb(120, 119, 102), 1), pts[0], pts[3]); + + pts[1].X += 2; pts[1].Y -= 1; + pts[2].X += 2; pts[2].Y += 2; + gr.DrawLine(new Pen(Color.FromArgb(120, 119, 102), 1), pts[1], pts[2]); + + pts[3].X -= 1; pts[3].Y += 2; + gr.DrawLine(new Pen(Color.FromArgb(120, 119, 102), 1), pts[3], pts[2]); + + gr.DrawLine(new Pen(Brushes.White, 1), new Point(this.lblTitle.Left-1, this.lblTitle.Top-1), new Point(this.lblTitle.Left + this.lblTitle.Width, this.lblTitle.Top-1)); + gr.DrawLine(new Pen(Brushes.White, 1), new Point(this.lblTitle.Left-1, this.lblTitle.Top-1), new Point(this.lblTitle.Left-1, this.lblTitle.Top + this.lblTitle.Height + 1)); + gr.DrawLine(new Pen(Brushes.Black, 1), new Point(this.lblTitle.Left - 1, this.lblTitle.Top + this.lblTitle.Height), new Point(this.lblTitle.Left + this.lblTitle.Width, this.lblTitle.Top + this.lblTitle.Height )); + gr.DrawLine(new Pen(Brushes.Black, 1), new Point(this.lblTitle.Left + this.lblTitle.Width , this.lblTitle.Top - 1), new Point(this.lblTitle.Left + this.lblTitle.Width , this.lblTitle.Top + this.lblTitle.Height )); + } + + private void AbstractControllerForm_Load(object sender, EventArgs e) + { + + } + + private void lblExit_Click(object sender, EventArgs e) + { + this.Close(); + } } } Modified: branches/FreeTrainSDL/core/controllers/AbstractControllerForm.resx =================================================================== --- branches/FreeTrainSDL/core/controllers/AbstractControllerForm.resx 2007-09-25 05:29:05 UTC (rev 195) +++ branches/FreeTrainSDL/core/controllers/AbstractControllerForm.resx 2007-09-25 05:30:37 UTC (rev 196) @@ -1,42 +1,120 @@ -<?xml version="1.0" encoding="utf-8" ?> -<root> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="ResMimeType"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="Version"> - <value>1.0.0.0</value> - </resheader> - <resheader name="Reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="Writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> -</root> +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Modified: branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs 2007-09-25 05:29:05 UTC (rev 195) +++ branches/FreeTrainSDL/core/controllers/rail/RailRoadController.cs 2007-09-25 05:30:37 UTC (rev 196) @@ -31,8 +31,8 @@ if(theInstance==null) theInstance = new RailRoadController(); theInstance.Show(); - theInstance.Activate(); - } + theInstance.Activate(); + } private static RailRoadController theInstance; @@ -51,13 +51,13 @@ public override void updatePreview() { - using( PreviewDrawer drawer = new PreviewDrawer( picture.Size, new Size(1,10), 0 ) ) + /*using( PreviewDrawer drawer = new PreviewDrawer( picture.Size, new Size(1,10), 0 ) ) { for( int i=0; i<10; i++ ) drawer.draw( RailPattern.get( Direction.NORTH, Direction.SOUTH ), 0, i ); if(picture.Image!=null) picture.Image.Dispose(); picture.Image = drawer.createBitmap(); - } + }*/ } protected override void Dispose( bool disposing ) { @@ -92,103 +92,95 @@ #region Windows Form Designer generated code private System.Windows.Forms.RadioButton buttonPlace; private System.Windows.Forms.RadioButton buttonRemove; - private freetrain.controls.CostBox costBox; - private System.Windows.Forms.Label message; - private System.Windows.Forms.PictureBox picture; + private freetrain.controls.CostBox costBox; + private System.Windows.Forms.Label message; private System.ComponentModel.Container components = null; private void InitializeComponent() - { - this.picture = new System.Windows.Forms.PictureBox(); - this.message = new System.Windows.Forms.Label(); - this.buttonPlace = new System.Windows.Forms.RadioButton(); - this.buttonRemove = new System.Windows.Forms.RadioButton(); - this.costBox = new freetrain.controls.CostBox(); - ((System.ComponentModel.ISupportInitialize)(this.picture)).BeginInit(); - this.SuspendLayout(); - // - // picture - // - this.picture.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.picture.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.picture.Location = new System.Drawing.Point(8, 9); - this.picture.Name = "picture"; - this.picture.Size = new System.Drawing.Size(113, 113); - this.picture.TabIndex = 0; - this.picture.TabStop = false; - // - // message - // - this.message.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.message.Location = new System.Drawing.Point(8, 125); - this.message.Name = "message"; - this.message.Size = new System.Drawing.Size(113, 26); - this.message.TabIndex = 1; - this.message.Text = "Click on two points on the map to place tracks"; - this.message.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - //! this.message.Text = "マップの2点をクリックして敷設"; - // - // buttonPlace - // - this.buttonPlace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonPlace.Appearance = System.Windows.Forms.Appearance.Button; - this.buttonPlace.Checked = true; - this.buttonPlace.Location = new System.Drawing.Point(8, 185); - this.buttonPlace.Name = "buttonPlace"; - this.buttonPlace.Size = new System.Drawing.Size(48, 26); - this.buttonPlace.TabIndex = 2; - this.buttonPlace.TabStop = true; - this.buttonPlace.Text = "Place"; - //!this.buttonPlace.Text = "敷設"; - this.buttonPlace.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.buttonPlace.CheckedChanged += new System.EventHandler(this.modeChanged); - // - // buttonRemove - // - this.buttonRemove.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRemove.Appearance = System.Windows.Forms.Appearance.Button; - this.buttonRemove.Location = new System.Drawing.Point(56, 185); - this.buttonRemove.Name = "buttonRemove"; - this.buttonRemove.Size = new System.Drawing.Size(65, 26); - this.buttonRemove.TabIndex = 3; - this.buttonRemove.Text = "Remove"; - //! this.buttonRemove.Text = "撤去"; - this.buttonRemove.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.buttonRemove.CheckedChanged += new System.EventHandler(this.modeChanged); - // - // costBox - // - this.costBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.costBox.cost = 0; - this.costBox.label = "Cost:"; - this.costBox.Location = new System.Drawing.Point(8, 154); - //! this.costBox.label = "費用:"; - this.costBox.Name = "costBox"; - this.costBox.Size = new System.Drawing.Size(113, 25); - this.costBox.TabIndex = 4; - // - // RailRoadController - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(129, 220); - this.Controls.Add(this.costBox); - this.Controls.Add(this.buttonRemove); - this.Controls.Add(this.buttonPlace); - this.Controls.Add(this.message); - this.Controls.Add(this.picture); - this.Resize += new System.EventHandler(this.updateAfterResize); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.Name = "RailRoadController"; - this.Text = "Track construction"; - //! this.Text = "線路工事"; - ((System.ComponentModel.ISupportInitialize)(this.picture)).EndInit(); - this.ResumeLayout(false); - + { + this.message = new System.Windows.Forms.Label(); + this.buttonPlace = new System.Windows.Forms.RadioButton(); + this.buttonRemove = new System.Windows.Forms.RadioButton(); + this.costBox = new freetrain.controls.CostBox(); + this.SuspendLayout(); + // + // message + // + this.message.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.message.Location = new System.Drawing.Point(12, 46); + this.message.Name = "message"; + this.message.Size = new System.Drawing.Size(105, 26); + this.message.TabIndex = 1; + this.message.Text = "Click on two points on the map to place tracks"; + this.message.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.message.MouseDown += new MouseEventHandler(this.AbstractControllerForm_MouseDown); + this.message.MouseMove += new MouseEventHandler(this.AbstractControllerForm_MouseMove); + // + // buttonPlace + // + this.buttonPlace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonPlace.Appearance = System.Windows.Forms.Appearance.Button; + this.buttonPlace.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(236))))); + this.buttonPlace.Checked = true; + this.buttonPlace.Location = new System.Drawing.Point(12, 115); + this.buttonPlace.Name = "buttonPlace"; + this.buttonPlace.Size = new System.Drawing.Size(46, 26); + this.buttonPlace.TabIndex = 2; + this.buttonPlace.TabStop = true; + this.buttonPlace.Text = "Place"; + this.buttonPlace.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.buttonPlace.UseVisualStyleBackColor = false; + this.buttonPlace.CheckedChanged += new System.EventHandler(this.modeChanged); + // + // buttonRemove + // + this.buttonRemove.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRemove.Appearance = System.Windows.Forms.Appearance.Button; + this.buttonRemove.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(236))))); + this.buttonRemove.Location = new System.Drawing.Point(58, 115); + this.buttonRemove.Name = "buttonRemove"; + this.buttonRemove.Size = new System.Drawing.Size(59, 26); + this.buttonRemove.TabIndex = 3; + this.buttonRemove.Text = "Remove"; + this.buttonRemove.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.buttonRemove.UseVisualStyleBackColor = false; + this.buttonRemove.CheckedChanged += new System.EventHandler(this.modeChanged); + // + // costBox + // + this.costBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.costBox.cost = 0; + this.costBox.label = "Cost:"; + this.costBox.Location = new System.Drawing.Point(12, 84); + this.costBox.Name = "costBox"; + this.costBox.Size = new System.Drawing.Size(105, 25); + this.costBox.TabIndex = 4; + this.costBox.MouseDown += new MouseEventHandler(this.AbstractControllerForm_MouseDown); + this.costBox.MouseMove += new MouseEventHandler(this.AbstractControllerForm_MouseMove); + + // + // RailRoadController + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(129, 153); + this.Controls.Add(this.buttonRemove); + this.Controls.Add(this.buttonPlace); + this.Controls.Add(this.costBox); + this.Controls.Add(this.message); + this.Name = "RailRoadController"; + this.Text = "Track construction"; + this.lblTitle.Text = "RAILROAD"; + this.Resize += new System.EventHandler(this.updateAfterResize); + this.Load += new System.EventHandler(this.RailRoadController_Load); + this.Controls.SetChildIndex(this.message, 0); + this.Controls.SetChildIndex(this.costBox, 0); + this.Controls.SetChildIndex(this.buttonPlace, 0); + this.Controls.SetChildIndex(this.buttonRemove, 0); + this.ResumeLayout(false); + } #endregion @@ -226,10 +218,10 @@ } protected virtual void updateAfterResize(object sender, System.EventArgs e){ - this.buttonPlace.Width = this.picture.Width / 2; - this.buttonRemove.Left = (this.buttonPlace.Left + this.buttonPlace.Width); - this.buttonRemove.Width = this.buttonPlace.Width; - updatePreview(); + //this.buttonPlace.Width = this.picture.Width / 2; + //this.buttonRemove.Left = (this.buttonPlace.Left + this.buttonPlace.Width); + //this.buttonRemove.Width = this.buttonPlace.Width; + //updatePreview(); } public override void onMouseMove( MapViewWindow view, Location loc, Point ab ) { @@ -307,7 +299,12 @@ } public void drawAfter( QuarterViewDrawer view, DrawContextEx canvas ) { - } + } + + private void RailRoadController_Load(object sender, EventArgs e) + { + this.lblTitle.Text = "Railroad"; + } } } Modified: branches/FreeTrainSDL/core/controllers/rail/RailRoadController.resx =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/RailRoadController.resx 2007-09-25 05:29:05 UTC (rev 195) +++ branches/FreeTrainSDL/core/controllers/rail/RailRoadController.resx 2007-09-25 05:30:37 UTC (rev 196) @@ -1,102 +1,120 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 1.3 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">1.3</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1">this is my long string</data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - [base64 mime encoded serialized .NET Framework object] - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - [base64 mime encoded string representing a byte array form of the .NET Framework object] - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>1.3</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="$this.Name"> - <value>RailRoadController</value> - </data> +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> </root> \ No newline at end of file Modified: branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs =================================================================== --- branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs 2007-09-25 05:29:05 UTC (rev 195) +++ branches/FreeTrainSDL/core/controllers/rail/TrainTradingDialog.cs 2007-09-25 05:30:37 UTC (rev 196) @@ -119,366 +119,367 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.label2 = new System.Windows.Forms.Label(); - this.length = new System.Windows.Forms.NumericUpDown(); - this.label3 = new System.Windows.Forms.Label(); - this.count = new System.Windows.Forms.NumericUpDown(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.label4 = new System.Windows.Forms.Label(); - this.buttonOK = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.label5 = new System.Windows.Forms.Label(); - this.speed = new System.Windows.Forms.Label(); - this.totalPrice = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.passenger = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.typeTree = new System.Windows.Forms.TreeView(); - this.label1 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.description = new System.Windows.Forms.TextBox(); - this.author = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.name = new System.Windows.Forms.Label(); - this.preview = new System.Windows.Forms.PictureBox(); - this.buttonImages = new System.Windows.Forms.ImageList(this.components); - this.toolBarDayNight = new System.Windows.Forms.ToolBar(); - this.tbDay = new System.Windows.Forms.ToolBarButton(); - this.tbNight = new System.Windows.Forms.ToolBarButton(); - ((System.ComponentModel.ISupportInitialize)(this.length)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.count)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.preview)).BeginInit(); - this.SuspendLayout(); - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.label2.Location = new System.Drawing.Point(202, 257); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(76, 24); - this.label2.TabIndex = 2; - this.label2.Text = "&Length:"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // length - // - this.length.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.length.Location = new System.Drawing.Point(283, 258); - this.length.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.length.Name = "length"; - this.length.Size = new System.Drawing.Size(77, 21); - this.length.TabIndex = 4; - this.length.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.length.Value = new decimal(new int[] { - 3, - 0, - 0, - 0}); - this.length.ValueChanged += new System.EventHandler(this.onAmountChanged); - // - // label3 - // - this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.label3.Location = new System.Drawing.Point(409, 259); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(30, 20); - this.label3.TabIndex = 5; - this.label3.Text = "x"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // count - // - this.count.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.count.Location = new System.Drawing.Point(435, 258); - this.count.Name = "count"; - this.count.Size = new System.Drawing.Size(76, 21); - this.count.TabIndex = 6; - this.count.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.count.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.count.ValueChanged += new System.EventHandler(this.onAmountChanged); - // - // groupBox1 - // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.Location = new System.Drawing.Point(180, 291); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(458, 4); - this.groupBox1.TabIndex = 4; - this.groupBox1.TabStop = false; - // - // label4 - // - this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.label4.Location = new System.Drawing.Point(517, 257); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(39, 22); - this.label4.TabIndex = 7; - this.label4.Text = "set(s)"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // buttonOK - // - this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonOK.Location = new System.Drawing.Point(356, 346); - this.buttonOK.Name = "buttonOK"; - this.buttonOK.Size = new System.Drawing.Size(96, 28); - this.buttonOK.TabIndex = 8; - this.buttonOK.Text = "&Buy"; - this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); - // - // buttonCancel - // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonCancel.Location = new System.Drawing.Point(460, 346); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(96, 28); - this.buttonCancel.TabIndex = 9; - this.buttonCancel.Text = "&Close"; - // - // label5 - // - this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.label5.Location = new System.Drawing.Point(202, 229); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(76, 19); - this.label5.TabIndex = 10; - this.label5.Text = "Speed:"; - this.label5.TextAlign = System.Drawing.ContentAlignment.BottomRight; - // - // speed - // - this.speed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.speed.Location = new System.Drawing.Point(286, 229); - this.speed.Name = "speed"; - this.speed.Size = new System.Drawing.Size(264, 19); - this.speed.TabIndex = 11; - this.speed.Text = "Rapid"; - this.speed.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // - // totalPrice - // - this.totalPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.totalPrice.Location = new System.Drawing.Point(283, 298); - this.totalPrice.Name = "totalPrice"; - this.totalPrice.Size = new System.Drawing.Size(273, 20); - this.totalPrice.TabIndex = 14; - this.totalPrice.Text = "100,000"; - this.totalPrice.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // - // label8 - // - this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.label8.Location = new System.Drawing.Point(202, 298); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(76, 20); - this.label8.TabIndex = 15; - this.label8.Text = "Total cost:"; - this.label8.TextAlign = System.Drawing.ContentAlignment.BottomRight; - // - // passenger - // - this.passenger.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.passenger.Location = new System.Drawing.Point(283, 318); - this.passenger.Name = "passenger"; - this.passenger.Size = new System.Drawing.Size(267, 19); - this.passenger.TabIndex = 17; - this.passenger.Text = "100"; - this.passenger.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // - // label9 - // - this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.label9.Location = new System.Drawing.Point(202, 318); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(76, 19); - this.label9.TabIndex = 16; - this.label9.Text = "Capacity:"; - this.label9.TextAlign = System.Drawing.ContentAlignment.BottomRight; - // - // typeTree - // - this.typeTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.typeTree.Location = new System.Drawing.Point(0, 0); - this.typeTree.Name = "typeTree"; - this.typeTree.Size = new System.Drawing.Size(194, 380); - this.typeTree.TabIndex = 18; - this.typeTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.onTypeChanged); - // - // label1 - // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label1.Location = new System.Drawing.Point(202, 130); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(76, 20); - this.label1.TabIndex = 19; - this.label1.Text = "Author:"; - this.label1.TextAlign = System.Drawing.ContentAlignment.BottomRight; - // - // label6 - // - this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label6.Location = new System.Drawing.Point(202, 154); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(76, 19); - this.label6.TabIndex = 20; - this.label6.Text = "Description:"; - this.label6.TextAlign = System.Drawing.ContentAlignment.BottomRight; - // - // description - // - this.description.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.description.BackColor = System.Drawing.SystemColors.Control; - this.description.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.description.Location = new System.Drawing.Point(286, 158); - this.description.Multiline = true; - this.description.Name = "description"; - this.description.ReadOnly = true; - this.description.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.description.Size = new System.Drawing.Size(264, 68); - this.description.TabIndex = 21; - this.description.Text = "tadasdffas"; - // - // author - // - this.author.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.author.Location = new System.Drawing.Point(283, 130); - this.author.Name = "author"; - this.author.Size = new System.Drawing.Size(267, 20); - this.author.TabIndex = 22; - this.author.Text = "477"; - this.author.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // - // label7 - // - this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.label7.Location = new System.Drawing.Point(370, 257); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(40, 22); - this.label7.TabIndex = 23; - this.label7.Text = "car(s)"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label10 - // - this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label10.Location = new System.Drawing.Point(202, 10); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(76, 18); - this.label10.TabIndex = 24; - this.label10.Text = "Name:"; - this.label10.TextAlign = System.Drawing.ContentAlignment.BottomRight; - // - // name - // - this.name.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.name.Location = new System.Drawing.Point(286, 10); - this.name.Name = "name"; - this.name.Size = new System.Drawing.Size(264, 18); - this.name.TabIndex = 25; - this.name.Text = "123 Series ABCDEF"; - this.name.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // - // preview - // - this.preview.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.preview.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.preview.Location = new System.Drawing.Point(283, 38); - this.preview.Name = "preview"; - this.preview.Size = new System.Drawing.Size(267, 84); - this.preview.TabIndex = 26; - this.preview.TabStop = false; - // - // buttonImages - // - this.buttonImages.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; - this.buttonImages.ImageSize = new System.Drawing.Size(16, 15); - this.buttonImages.TransparentColor = System.Drawing.Color.Transparent; - // - // toolBarDayNight - // - this.toolBarDayNight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.toolBarDayNight.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { - this.tbDay, - this.tbNight}); - this.toolBarDayNight.Dock = System.Windows.Forms.DockStyle.None; - this.toolBarDayNight.DropDownArrows = true; - this.toolBarDayNight.ImageList = this.buttonImages; - this.toolBarDayNight.Location = new System.Drawing.Point(230, 38); - this.toolBarDayNight.Name = "toolBarDayNight"; - this.toolBarDayNight.ShowToolTips = true; - this.toolBarDayNight.Size = new System.Drawing.Size(46, 48); - this.toolBarDayNight.TabIndex = 27; - this.toolBarDayNight.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick); - // - // tbDay - // - this.tbDay.ImageIndex = 1; - this.tbDay.Name = "tbDay"; - this.tbDay.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; - this.tbDay.Tag = freetrain.views.NightSpriteMode.AlwaysDay; - // - // tbNight - // - this.tbNight.ImageIndex = 2; - this.tbNight.Name = "tbNight"; - this.tbNight.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; - this.tbNight.Tag = freetrain.views.NightSpriteMode.AlwaysNight; - // - // TrainTradingDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); - this.ClientSize = new System.Drawin... [truncated message content] |