summaryrefslogtreecommitdiffstats
path: root/qtsharp/src/examples/samples/mandelbrot2.cs
diff options
context:
space:
mode:
Diffstat (limited to 'qtsharp/src/examples/samples/mandelbrot2.cs')
-rw-r--r--qtsharp/src/examples/samples/mandelbrot2.cs90
1 files changed, 45 insertions, 45 deletions
diff --git a/qtsharp/src/examples/samples/mandelbrot2.cs b/qtsharp/src/examples/samples/mandelbrot2.cs
index 2b83579e..0e9436e2 100644
--- a/qtsharp/src/examples/samples/mandelbrot2.cs
+++ b/qtsharp/src/examples/samples/mandelbrot2.cs
@@ -108,7 +108,7 @@ public class Mandelbrot
public static void Main (string[] args)
{
- TQApplication app = new TQApplication (args);
+ TTQApplication app = new TTQApplication (args);
dialog = new ImageDialog (null, "Mandelbrot", false, 0);
dialog.SetGeometry(0, 0, 550, 300 );
@@ -120,13 +120,13 @@ public class Mandelbrot
}
-public class PicLabel: QFrame
+public class PicLabel: TQFrame
{
- TQPixmap newPixmap;
+ TTQPixmap newPixmap;
int newWidth = 400;
int newHeight = 300;
- public PicLabel( TQWidget parent, string name, WidgetFlags flags ):
+ public PicLabel( TTQWidget parent, string name, WidgetFlags flags ):
base( parent, name, flags )
{
SetBackgroundMode (Qt.BackgroundMode.NoBackground);
@@ -135,7 +135,7 @@ public class PicLabel: QFrame
}
- protected void PerformResize (TQResizeEvent e)
+ protected void PerformResize (TTQResizeEvent e)
{
Console.WriteLine("Resizing to {0} by {1}",
e.Size().Width(), e.Size().Height() );
@@ -146,12 +146,12 @@ public class PicLabel: QFrame
}
- protected void PerformPaint(TQPaintEvent e )
+ protected void PerformPaint(TTQPaintEvent e )
{
Console.WriteLine("Making a new image {0} by {1}", newWidth, newHeight );
- TQImage image = Mandelbrot.dialog.MandelbrotImage( newWidth, newHeight );
- newPixmap = new TQPixmap( image );
+ TTQImage image = Mandelbrot.dialog.MandelbrotImage( newWidth, newHeight );
+ newPixmap = new TTQPixmap( image );
BitBlt(this, 0, 0, newPixmap,
0, 0, -1, -1, RasterOp.CopyROP, false);
@@ -161,123 +161,123 @@ public class PicLabel: QFrame
-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;
+ TTQHBoxLayout dialogLayout;
+ TTQGridLayout gridLayout;
+ TTQVBoxLayout leftLayout;
+ TTQHBoxLayout buttonLayout;
+ TTQPushButton redrawButton;
public PicLabel pixmapLabel;
- TQSizePolicy fixedSizePolicy;
+ 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 ( TQSizePolicy.SizeType.Fixed,
- TQSizePolicy.SizeType.Fixed, false );
+ fixedSizePolicy = new TTQSizePolicy ( TTQSizePolicy.SizeType.Fixed,
+ TTQSizePolicy.SizeType.Fixed, false );
- 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.SetSizePolicy( fixedSizePolicy );
editXMin.SetText (Convert.ToString (DefaultPlotXMin));
editXMin.SetValidator (validator);
gridLayout.AddWidget (editXMin, 0, 1);
- editXMax = new TQLineEdit (this, "editXMax");
+ editXMax = new TTQLineEdit (this, "editXMax");
editXMax.SetSizePolicy( fixedSizePolicy );
editXMax.SetText (Convert.ToString(DefaultPlotXMax));
editXMax.SetValidator (validator);
gridLayout.AddWidget (editXMax, 1, 1);
- editYMin = new TQLineEdit (this, "editYMin");
+ editYMin = new TTQLineEdit (this, "editYMin");
editYMin.SetSizePolicy( fixedSizePolicy );
editYMin.SetText (Convert.ToString(DefaultPlotYMin));
editYMin.SetValidator (validator);
gridLayout.AddWidget (editYMin, 2, 1);
- editYMax = new TQLineEdit (this, "editYMax");
+ editYMax = new TTQLineEdit (this, "editYMax");
editYMax.SetSizePolicy( fixedSizePolicy );
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.SetSizePolicy ( fixedSizePolicy );
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 PicLabel (this, "pixmapLabel", 0);
//pixmapLabel.SetScaledContents (true);
- pixmapLabel.SetSizePolicy( TQSizePolicy.SizeType.Minimum,
- TQSizePolicy.SizeType.Minimum, false );
+ pixmapLabel.SetSizePolicy( TTQSizePolicy.SizeType.Minimum,
+ TTQSizePolicy.SizeType.Minimum, false );
pixmapLabel.SetGeometry( 0, 0, 400, 300 );
pixmapLabel.Show();
pixmapLabel.Resize(400,300);
dialogLayout.AddWidget (pixmapLabel);
- //TQImage image = MandelbrotImage( 400, 300 );
- //pixmapLabel.SetPixmap( new TQPixmap( image ) );
+ //TTQImage image = MandelbrotImage( 400, 300 );
+ //pixmapLabel.SetPixmap( new TTQPixmap( image ) );
- TQObject.Connect (redrawButton, TQT_SIGNAL ("clicked()"), pixmapLabel, TQT_SLOT ("Repaint()"));
+ TTQObject.Connect (redrawButton, TQT_SIGNAL ("clicked()"), pixmapLabel, TQT_SLOT ("Repaint()"));
//Redraw ();
}
- public TQImage MandelbrotImage ( int width, int height)
+ public TTQImage MandelbrotImage ( int width, int height)
{
int depth;
double real, imag;
@@ -290,7 +290,7 @@ public class ImageDialog : TQDialog {
int ImageXMax = width;
int ImageYMax = 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) {