Forráskód Böngészése

*** empty log message ***

svn path=/trunk/mcs/; revision=15882
Philip Van Hoof 22 éve
szülő
commit
6898bc9107

+ 7 - 9
mcs/class/System.Windows.Forms/Gtk/Form.cs

@@ -49,8 +49,13 @@ namespace System.Windows.Forms {
 			Widget contents = base.CreateWidget ();
 			win = new Window (WindowType.Toplevel);
 			win.DeleteEvent += new DeleteEventHandler (delete_cb);
+
 			win.Title = Text;
 			win.Add(contents);
+			// TODO: The Gtk.Windows does not have a on_show signal ? :(
+			if (Load != null)
+				Load (this, EventArgs.Empty);
+
 			return (Widget) win;
 		}
 
@@ -546,15 +551,8 @@ namespace System.Windows.Forms {
 		//	}
 		//}
 
-		// [MonoTODO]
-		// public event EventHandler  Load {
-		//	add {
-		//		throw new NotImplementedException ();
-		//	}
-		//	remove {
-		//		throw new NotImplementedException ();
-		//	}
-		//}
+		public event EventHandler Load;
+
 		// [MonoTODO]
 		// public event EventHandler  MaximizedBoundsChanged {
 		//	add {

+ 12 - 12
mcs/class/System.Windows.Forms/Gtk/StatusBar.cs

@@ -186,8 +186,7 @@ namespace System.Windows.Forms {
 			}
 			set {
 				stext = value;
-				//if ( IsHandleCreated )
-				//	UpdateStatusText ( );
+				UpdateStatusText ( );
 			}
 		}
 
@@ -213,7 +212,7 @@ namespace System.Windows.Forms {
 			}
 			else {
 			//	Win32.SendMessage( Handle, (int)StatusbarMessages.SB_SIMPLE, 1, 0 );
-			//	UpdateStatusText ( );
+				UpdateStatusText ( );
 			}
 		}
 
@@ -252,7 +251,8 @@ namespace System.Windows.Forms {
 					TextToSet = panels[i].Text;
 				break;
 				}
-
+				//Console.WriteLine (TextToSet);
+				this.statusbar.Push (this.statusbar.GetContextId (i.ToString()), TextToSet);
 				//Win32.SendMessage( Handle, (int)StatusbarMessages.SB_SETTEXT, DrawStyle,
 				//			TextToSet );
 			}
@@ -270,15 +270,13 @@ namespace System.Windows.Forms {
 		}
 
 		internal  void UpdatePanels ( bool updateParts, bool updateText, StatusBarPanel p ) {
-			//if ( IsHandleCreated ) {
-			//	if ( updateParts )
-			//		UpdateParts ( );
+			if ( updateParts )
+				UpdateParts ( );
 
-			//	if ( updateText )
-			//		UpdateText( p );
+			if ( updateText )
+				UpdateText( p );
 
-			//	Invalidate( );
-			//}
+			// Invalidate( );
 		}
 
 		protected void CalculatePanelWidths ( int[] array ) {
@@ -317,7 +315,9 @@ namespace System.Windows.Forms {
 				array[i] = WidthArray[i] + (i == 0 ? 0 : array[i - 1]);
 		}
 
-		internal  void UpdateStatusText ( ){
+		internal  void UpdateStatusText ( )
+		{
+			this.statusbar.Push (0, Text);
 			//Win32.SendMessage( Handle, (int)StatusbarMessages.SB_SETTEXT,
 			//			255 | (int)StatusbarDrawType.SBT_NOBORDERS, Text );
 		}

+ 4 - 1
mcs/class/System.Windows.Forms/Gtk/StatusBarDemo.cs

@@ -62,6 +62,7 @@ namespace WindowsApplication7
 			this.statusBar1.Size = new System.Drawing.Size(292, 22);
 			this.statusBar1.TabIndex = 0;
 			this.statusBar1.Text = "statusBar1";
+			this.statusBar1.Text = "statusBar1xyz";
 			// 
 			// Form1
 			// 
@@ -70,7 +71,7 @@ namespace WindowsApplication7
 			this.Controls.Add(this.statusBar1);
 			this.Name = "Form1";
 			this.Text = "Form1";
-//			this.Load += new System.EventHandler(this.Form1_Load);
+			this.Load += new System.EventHandler(this.Form1_Load);
 //			this.ResumeLayout(false);
 
 		}
@@ -87,6 +88,8 @@ namespace WindowsApplication7
 
 		private void Form1_Load(object sender, System.EventArgs e)
 		{
+			this.statusBar1.Text = "test";
+			Console.WriteLine("Loaded");
 		
 		}
 	}

+ 4 - 1
mcs/class/System.Windows.Forms/Gtk/makefile

@@ -59,7 +59,7 @@ SOURCES = \
 	DockStyle.cs \
 	LayoutEventArgs.cs 
 
-all: demo.exe Demo2.exe Form1.exe
+all: demo.exe Demo2.exe Form1.exe StatusBarDemo.exe
 
 demo.exe: demo.cs System.Windows.Forms.dll
 	$(CSC) demo.cs -r System.Windows.Forms.dll -r System.Drawing 
@@ -73,6 +73,9 @@ singlewidget.exe : singlewidget.cs
 Form1.exe : Form1.cs
 	$(CSC) Form1.cs -r System.Windows.Forms.dll -r System.Drawing
 
+StatusBarDemo.exe : StatusBarDemo.cs
+	$(CSC) StatusBarDemo.cs -r System.Windows.Forms.dll -r System.Drawing -r System.Data
+
 System.Windows.Forms.dll: $(SOURCES)
 	$(CSC) $(SWFF) --target library -o System.Windows.Forms.dll $(SOURCES)