diff options
Diffstat (limited to 'qtsharp/src/examples/samples/mandelbrot.cs')
-rw-r--r-- | qtsharp/src/examples/samples/mandelbrot.cs | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/qtsharp/src/examples/samples/mandelbrot.cs b/qtsharp/src/examples/samples/mandelbrot.cs index 3850b781..cecd6286 100644 --- a/qtsharp/src/examples/samples/mandelbrot.cs +++ b/qtsharp/src/examples/samples/mandelbrot.cs @@ -106,7 +106,7 @@ public class Mandelbrot { public static void Main (string[] args) { - TQApplication app = new TQApplication (args); + TTQApplication app = new TTQApplication (args); ImageDialog dialog = new ImageDialog (null, "Mandelbrot", false, 0); dialog.Show (); @@ -117,109 +117,109 @@ public class Mandelbrot { } -public class ImageDialog : TQDialog { +public class ImageDialog : TTQDialog { const double DefaultPlotXMin = -2.0; const double DefaultPlotXMax = 2.0; const double DefaultPlotYMin = -1.5; const double DefaultPlotYMax = 1.5; - TQHBoxLayout dialogLayout; - TQGridLayout gridLayout; - TQVBoxLayout leftLayout; - TQHBoxLayout buttonLayout; - TQPushButton redrawButton; - TQLabel pixmapLabel; - TQSizePolicy fixedSizePolicy; + TTQHBoxLayout dialogLayout; + TTQGridLayout gridLayout; + TTQVBoxLayout leftLayout; + TTQHBoxLayout buttonLayout; + TTQPushButton redrawButton; + TTQLabel pixmapLabel; + TTQSizePolicy fixedSizePolicy; - TQLabel XMinLabel, XMaxLabel, YMinLabel, YMaxLabel; - TQLineEdit editXMin, editXMax, editYMin, editYMax; + TTQLabel XMinLabel, XMaxLabel, YMinLabel, YMaxLabel; + TTQLineEdit editXMin, editXMax, editYMin, editYMax; - public ImageDialog (TQWidget parent, string name, bool modal, WidgetFlags fl): + public ImageDialog (TTQWidget parent, string name, bool modal, WidgetFlags fl): base (parent, name, modal, fl) { if (name == string.Empty) SetName ("imageDialog"); SetCaption ("Mandelbrot Image"); - dialogLayout = new TQHBoxLayout (this, 11, 6); - gridLayout = new TQGridLayout (null, 1, 1, 0, 6, "gridLayout"); - leftLayout = new TQVBoxLayout (null, 0, 6, "leftLayout"); + dialogLayout = new TTQHBoxLayout (this, 11, 6); + gridLayout = new TTQGridLayout (null, 1, 1, 0, 6, "gridLayout"); + leftLayout = new TTQVBoxLayout (null, 0, 6, "leftLayout"); - fixedSizePolicy = new TQSizePolicy (); - fixedSizePolicy.SetHorData (TQSizePolicy.SizeType.Fixed); - fixedSizePolicy.SetVerData (TQSizePolicy.SizeType.Fixed); + fixedSizePolicy = new TTQSizePolicy (); + fixedSizePolicy.SetHorData (TTQSizePolicy.SizeType.Fixed); + fixedSizePolicy.SetVerData (TTQSizePolicy.SizeType.Fixed); - XMinLabel = new TQLabel ("Xmin", this); + XMinLabel = new TTQLabel ("Xmin", this); XMinLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (XMinLabel, 0, 0); - XMaxLabel = new TQLabel ("Xmax", this); + XMaxLabel = new TTQLabel ("Xmax", this); XMaxLabel.SetSizePolicy(fixedSizePolicy); gridLayout.AddWidget (XMaxLabel, 1, 0); - YMinLabel = new TQLabel ("Ymin", this); + YMinLabel = new TTQLabel ("Ymin", this); YMinLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (YMinLabel, 2, 0); - YMaxLabel = new TQLabel ("Ymax", this); + YMaxLabel = new TTQLabel ("Ymax", this); YMaxLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (YMaxLabel, 3, 0); - TQDoubleValidator validator = new TQDoubleValidator (this); + TTQDoubleValidator validator = new TTQDoubleValidator (this); - editXMin = new TQLineEdit (this, "editXMin"); + editXMin = new TTQLineEdit (this, "editXMin"); editXMin.SetText (Convert.ToString (DefaultPlotXMin)); editXMin.SetValidator (validator); gridLayout.AddWidget (editXMin, 0, 1); - editXMax = new TQLineEdit (this, "editXMax"); + editXMax = new TTQLineEdit (this, "editXMax"); editXMax.SetText (Convert.ToString(DefaultPlotXMax)); editXMax.SetValidator (validator); gridLayout.AddWidget (editXMax, 1, 1); - editYMin = new TQLineEdit (this, "editYMin"); + editYMin = new TTQLineEdit (this, "editYMin"); editYMin.SetText (Convert.ToString(DefaultPlotYMin)); editYMin.SetValidator (validator); gridLayout.AddWidget (editYMin, 2, 1); - editYMax = new TQLineEdit (this, "editYMax"); + editYMax = new TTQLineEdit (this, "editYMax"); editYMax.SetText (Convert.ToString(DefaultPlotYMax)); editYMax.SetValidator (validator); gridLayout.AddWidget (editYMax, 3, 1); leftLayout.AddLayout (gridLayout); - TQSpacerItem spacer1 = new TQSpacerItem (0, 0, 0, 0); + TTQSpacerItem spacer1 = new TTQSpacerItem (0, 0, 0, 0); leftLayout.AddItem (spacer1); - buttonLayout = new TQHBoxLayout (null, 0, 6, "buttonLayout"); - TQSpacerItem spacer2 = new TQSpacerItem (0, 0, 0, 0); + buttonLayout = new TTQHBoxLayout (null, 0, 6, "buttonLayout"); + TTQSpacerItem spacer2 = new TTQSpacerItem (0, 0, 0, 0); buttonLayout.AddItem (spacer2); - redrawButton = new TQPushButton ("Redraw", this); + redrawButton = new TTQPushButton ("Redraw", this); redrawButton.SetDefault (true); buttonLayout.AddWidget (redrawButton); - TQSpacerItem spacer3 = new TQSpacerItem (0, 0, 0, 0); + TTQSpacerItem spacer3 = new TTQSpacerItem (0, 0, 0, 0); buttonLayout.AddItem (spacer3); leftLayout.AddLayout (buttonLayout); dialogLayout.AddLayout (leftLayout); - TQSpacerItem spacer4 = new TQSpacerItem (0, 0, 0, 0); + TTQSpacerItem spacer4 = new TTQSpacerItem (0, 0, 0, 0); dialogLayout.AddItem (spacer4); - pixmapLabel = new TQLabel (this, "pixmapLabel", 0); + pixmapLabel = new TTQLabel (this, "pixmapLabel", 0); pixmapLabel.SetScaledContents (true); dialogLayout.AddWidget (pixmapLabel); - TQObject.Connect (redrawButton, TQT_SIGNAL ("clicked()"), this, TQT_SLOT ("Redraw()")); + TTQObject.Connect (redrawButton, TQT_SIGNAL ("clicked()"), this, TQT_SLOT ("Redraw()")); Redraw (); } - TQImage MandelbrotImage () + TTQImage MandelbrotImage () { int depth; double real, imag; @@ -232,7 +232,7 @@ public class ImageDialog : TQDialog { int ImageXMax = pixmapLabel.Width (); int ImageYMax = pixmapLabel.Height (); - TQImage image = new TQImage (ImageXMax, ImageYMax, 32, 0); + TTQImage image = new TTQImage (ImageXMax, ImageYMax, 32, 0); for (int x = 0; x <= ImageXMax - 1; x+=1) { for (int y = 0; y <= ImageYMax - 1; y+=1) { @@ -248,16 +248,16 @@ public class ImageDialog : TQDialog { public void Redraw () { - TQSize s = pixmapLabel.BaseSize (); + TTQSize s = pixmapLabel.BaseSize (); pixmapLabel.Resize (400,300); - TQApplication.SetOverrideCursor ( new TQCursor( (int) CursorShape.WaitCursor )); - TQImage image = MandelbrotImage (); - TQPixmap pixmap = new TQPixmap (image); + TTQApplication.SetOverrideCursor ( new TTQCursor( (int) CursorShape.WaitCursor )); + TTQImage image = MandelbrotImage (); + TTQPixmap pixmap = new TTQPixmap (image); pixmapLabel.SetPixmap( pixmap); image.Dispose (); pixmap.Dispose (); this.AdjustSize (); - TQApplication.RestoreOverrideCursor (); + TTQApplication.RestoreOverrideCursor (); } } |