Update of /cvsroot/csdopenglnet/csdOpenGL/samples
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5648
Modified Files:
gtkFrame.cs
Log Message:
the sample now uses box layouts
Index: gtkFrame.cs
===================================================================
RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkFrame.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** gtkFrame.cs 30 Jul 2004 11:58:36 -0000 1.5
--- gtkFrame.cs 31 Jul 2004 11:19:16 -0000 1.6
***************
*** 14,18 ****
protected float propRotY = 0.0f;
protected float propRotZ = 0.0f;
- protected Fixed fixedLayout;
protected Gtk.Window window;
protected VScale scaleRotX;
--- 14,17 ----
***************
*** 34,41 ****
window.Resize( 640, 480 );
- fixedLayout = new Fixed();
- fixedLayout.SizeAllocated += new SizeAllocatedHandler( OnResize );
- fixedLayout.Show();
- window.Add( fixedLayout );
window.ShowAll();
--- 33,36 ----
***************
*** 48,52 ****
glarea.UnmapEvent += new UnmapEventHandler (OnUnmap);
- fixedLayout.Put( glarea, 55, 10 );
Debug.WriteLine( "Init scaleRotX" );
--- 43,46 ----
***************
*** 54,58 ****
scaleRotX.ValuePos = PositionType.Bottom;
scaleRotX.ValueChanged += new EventHandler( valueChanged );
- fixedLayout.Put( scaleRotX, 10, 10 );
Debug.WriteLine( "Init scaleRotY" );
--- 48,51 ----
***************
*** 60,68 ****
scaleRotY.ValuePos = PositionType.Left;
scaleRotY.ValueChanged += new EventHandler( valueChanged );
! fixedLayout.Put( scaleRotY, 10, 100 );
! oldWidth = 1;
! fixedLayout.ShowAll();
!
Debug.WriteLine( "MainLoop" );
Application.Run ();
--- 53,70 ----
scaleRotY.ValuePos = PositionType.Left;
scaleRotY.ValueChanged += new EventHandler( valueChanged );
!
! Debug.WriteLine( "Init HBox 1" );
! HBox hbox1 = new HBox( false, 2 );
! hbox1.PackStart( scaleRotX, false, true, 5 );
! hbox1.PackEnd( glarea, true, true, 5 );
! Debug.WriteLine( "Init VBox 1" );
! VBox vbox1 = new VBox( false, 2 );
! vbox1.PackStart( hbox1, true, true, 5 );
! vbox1.PackEnd( scaleRotY, false, true, 5 );
!
! window.Add( vbox1 );
! window.ShowAll();
!
Debug.WriteLine( "MainLoop" );
Application.Run ();
***************
*** 76,108 ****
if (obj==scaleRotY) rotY = (float)scaleRotY.Value;
}
!
! protected void OnResize( object obj, SizeAllocatedArgs args ) {
! if ( (oldWidth!=args.Allocation.Width) || (oldHeight!=args.Allocation.Height) ) {
! oldWidth = args.Allocation.Width;
! oldHeight = args.Allocation.Height;
! OnResize( oldWidth, oldHeight );
! }
! }
!
! protected void OnResize( int width, int height ) {
! resize( glarea, height - 65, width - 65 );
! resize( scaleRotX, height - 45, 35 );
! resize( scaleRotY, 35, width - 20 );
! move( scaleRotY, 10, height - 45 );
! }
!
! protected void resize( Widget wdg, int h, int w ) {
! if (wdg!=null) {
! if ( (h>0) && (wdg.HeightRequest!=h) ) wdg.HeightRequest = h;
! if ( (w>0) && (wdg.WidthRequest!=w) ) wdg.WidthRequest = w;
! }
! }
!
! protected void move( Widget wdg, int x, int y ) {
! if ( (fixedLayout!=null) && (wdg!=null) ) {
! fixedLayout.Move( scaleRotY, x, y );
! }
! }
!
protected void OnDeleteEvent (object obj, DeleteEventArgs args) {
Application.Quit ();
--- 78,82 ----
if (obj==scaleRotY) rotY = (float)scaleRotY.Value;
}
!
protected void OnDeleteEvent (object obj, DeleteEventArgs args) {
Application.Quit ();
|