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 5dbd9b85..3850b781 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) { - QApplication app = new QApplication (args); + TQApplication app = new TQApplication (args); ImageDialog dialog = new ImageDialog (null, "Mandelbrot", false, 0); dialog.Show (); @@ -117,109 +117,109 @@ public class Mandelbrot { } -public class ImageDialog : QDialog { +public class ImageDialog : TQDialog { const double DefaultPlotXMin = -2.0; const double DefaultPlotXMax = 2.0; const double DefaultPlotYMin = -1.5; const double DefaultPlotYMax = 1.5; - QHBoxLayout dialogLayout; - QGridLayout gridLayout; - QVBoxLayout leftLayout; - QHBoxLayout buttonLayout; - QPushButton redrawButton; - QLabel pixmapLabel; - QSizePolicy fixedSizePolicy; + TQHBoxLayout dialogLayout; + TQGridLayout gridLayout; + TQVBoxLayout leftLayout; + TQHBoxLayout buttonLayout; + TQPushButton redrawButton; + TQLabel pixmapLabel; + TQSizePolicy fixedSizePolicy; - QLabel XMinLabel, XMaxLabel, YMinLabel, YMaxLabel; - QLineEdit editXMin, editXMax, editYMin, editYMax; + TQLabel XMinLabel, XMaxLabel, YMinLabel, YMaxLabel; + TQLineEdit editXMin, editXMax, editYMin, editYMax; - public ImageDialog (QWidget parent, string name, bool modal, WidgetFlags fl): + public ImageDialog (TQWidget parent, string name, bool modal, WidgetFlags fl): base (parent, name, modal, fl) { if (name == string.Empty) SetName ("imageDialog"); SetCaption ("Mandelbrot Image"); - dialogLayout = new QHBoxLayout (this, 11, 6); - gridLayout = new QGridLayout (null, 1, 1, 0, 6, "gridLayout"); - leftLayout = new QVBoxLayout (null, 0, 6, "leftLayout"); + dialogLayout = new TQHBoxLayout (this, 11, 6); + gridLayout = new TQGridLayout (null, 1, 1, 0, 6, "gridLayout"); + leftLayout = new TQVBoxLayout (null, 0, 6, "leftLayout"); - fixedSizePolicy = new QSizePolicy (); - fixedSizePolicy.SetHorData (QSizePolicy.SizeType.Fixed); - fixedSizePolicy.SetVerData (QSizePolicy.SizeType.Fixed); + fixedSizePolicy = new TQSizePolicy (); + fixedSizePolicy.SetHorData (TQSizePolicy.SizeType.Fixed); + fixedSizePolicy.SetVerData (TQSizePolicy.SizeType.Fixed); - XMinLabel = new QLabel ("Xmin", this); + XMinLabel = new TQLabel ("Xmin", this); XMinLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (XMinLabel, 0, 0); - XMaxLabel = new QLabel ("Xmax", this); + XMaxLabel = new TQLabel ("Xmax", this); XMaxLabel.SetSizePolicy(fixedSizePolicy); gridLayout.AddWidget (XMaxLabel, 1, 0); - YMinLabel = new QLabel ("Ymin", this); + YMinLabel = new TQLabel ("Ymin", this); YMinLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (YMinLabel, 2, 0); - YMaxLabel = new QLabel ("Ymax", this); + YMaxLabel = new TQLabel ("Ymax", this); YMaxLabel.SetSizePolicy (fixedSizePolicy); gridLayout.AddWidget (YMaxLabel, 3, 0); - QDoubleValidator validator = new QDoubleValidator (this); + TQDoubleValidator validator = new TQDoubleValidator (this); - editXMin = new QLineEdit (this, "editXMin"); + editXMin = new TQLineEdit (this, "editXMin"); editXMin.SetText (Convert.ToString (DefaultPlotXMin)); editXMin.SetValidator (validator); gridLayout.AddWidget (editXMin, 0, 1); - editXMax = new QLineEdit (this, "editXMax"); + editXMax = new TQLineEdit (this, "editXMax"); editXMax.SetText (Convert.ToString(DefaultPlotXMax)); editXMax.SetValidator (validator); gridLayout.AddWidget (editXMax, 1, 1); - editYMin = new QLineEdit (this, "editYMin"); + editYMin = new TQLineEdit (this, "editYMin"); editYMin.SetText (Convert.ToString(DefaultPlotYMin)); editYMin.SetValidator (validator); gridLayout.AddWidget (editYMin, 2, 1); - editYMax = new QLineEdit (this, "editYMax"); + editYMax = new TQLineEdit (this, "editYMax"); editYMax.SetText (Convert.ToString(DefaultPlotYMax)); editYMax.SetValidator (validator); gridLayout.AddWidget (editYMax, 3, 1); leftLayout.AddLayout (gridLayout); - QSpacerItem spacer1 = new QSpacerItem (0, 0, 0, 0); + TQSpacerItem spacer1 = new TQSpacerItem (0, 0, 0, 0); leftLayout.AddItem (spacer1); - buttonLayout = new QHBoxLayout (null, 0, 6, "buttonLayout"); - QSpacerItem spacer2 = new QSpacerItem (0, 0, 0, 0); + buttonLayout = new TQHBoxLayout (null, 0, 6, "buttonLayout"); + TQSpacerItem spacer2 = new TQSpacerItem (0, 0, 0, 0); buttonLayout.AddItem (spacer2); - redrawButton = new QPushButton ("Redraw", this); + redrawButton = new TQPushButton ("Redraw", this); redrawButton.SetDefault (true); buttonLayout.AddWidget (redrawButton); - QSpacerItem spacer3 = new QSpacerItem (0, 0, 0, 0); + TQSpacerItem spacer3 = new TQSpacerItem (0, 0, 0, 0); buttonLayout.AddItem (spacer3); leftLayout.AddLayout (buttonLayout); dialogLayout.AddLayout (leftLayout); - QSpacerItem spacer4 = new QSpacerItem (0, 0, 0, 0); + TQSpacerItem spacer4 = new TQSpacerItem (0, 0, 0, 0); dialogLayout.AddItem (spacer4); - pixmapLabel = new QLabel (this, "pixmapLabel", 0); + pixmapLabel = new TQLabel (this, "pixmapLabel", 0); pixmapLabel.SetScaledContents (true); dialogLayout.AddWidget (pixmapLabel); - QObject.Connect (redrawButton, SIGNAL ("clicked()"), this, SLOT ("Redraw()")); + TQObject.Connect (redrawButton, TQT_SIGNAL ("clicked()"), this, TQT_SLOT ("Redraw()")); Redraw (); } - QImage MandelbrotImage () + TQImage MandelbrotImage () { int depth; double real, imag; @@ -232,7 +232,7 @@ public class ImageDialog : QDialog { int ImageXMax = pixmapLabel.Width (); int ImageYMax = pixmapLabel.Height (); - QImage image = new QImage (ImageXMax, ImageYMax, 32, 0); + TQImage image = new TQImage (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 : QDialog { public void Redraw () { - QSize s = pixmapLabel.BaseSize (); + TQSize s = pixmapLabel.BaseSize (); pixmapLabel.Resize (400,300); - QApplication.SetOverrideCursor ( new QCursor( (int) CursorShape.WaitCursor )); - QImage image = MandelbrotImage (); - QPixmap pixmap = new QPixmap (image); + TQApplication.SetOverrideCursor ( new TQCursor( (int) CursorShape.WaitCursor )); + TQImage image = MandelbrotImage (); + TQPixmap pixmap = new TQPixmap (image); pixmapLabel.SetPixmap( pixmap); image.Dispose (); pixmap.Dispose (); this.AdjustSize (); - QApplication.RestoreOverrideCursor (); + TQApplication.RestoreOverrideCursor (); } } |