diff options
Diffstat (limited to 'qtsharp/src/examples/samples/quantumfractals.cs')
-rw-r--r-- | qtsharp/src/examples/samples/quantumfractals.cs | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/qtsharp/src/examples/samples/quantumfractals.cs b/qtsharp/src/examples/samples/quantumfractals.cs index 56898912..fe6c914e 100644 --- a/qtsharp/src/examples/samples/quantumfractals.cs +++ b/qtsharp/src/examples/samples/quantumfractals.cs @@ -9,18 +9,18 @@ namespace Qf { using System; using System.Threading; - public class FractalViewer : QMainWindow { + public class FractalViewer : TQMainWindow { //Menuing - private QMenuBar menubar; - private QPopupMenu filemenu; - private QPopupMenu shapemenu; - private QPopupMenu settingsmenu; + private TQMenuBar menubar; + private TQPopupMenu filemenu; + private TQPopupMenu shapemenu; + private TQPopupMenu settingsmenu; public static int Main (string[] args) { //Initialize and start the main event loop - QApplication app = new QApplication (args); + TQApplication app = new TQApplication (args); FractalViewer view = new FractalViewer (); app.SetMainWidget (view); view.Show (); @@ -36,13 +36,13 @@ namespace Qf { SetCentralWidget (display); //Setup the filemenu - filemenu = new QPopupMenu (null, "filemenu"); - filemenu.InsertItem ("&Screenshot", display, SLOT ("SlotScreenshot()")); + filemenu = new TQPopupMenu (null, "filemenu"); + filemenu.InsertItem ("&Screenshot", display, TQT_SLOT ("SlotScreenshot()")); filemenu.InsertSeparator (); - filemenu.InsertItem ("&Quit", qApp, SLOT ("quit()")); + filemenu.InsertItem ("&Quit", qApp, TQT_SLOT ("quit()")); //Setup the shapemenu - shapemenu = new QPopupMenu (null, "typemenu"); + shapemenu = new TQPopupMenu (null, "typemenu"); shapemenu.InsertItem( "&Tetrahedron", 0); shapemenu.InsertItem( "&Cube", 1); shapemenu.InsertItem( "&Octahedron", 2); @@ -52,42 +52,42 @@ namespace Qf { shapemenu.InsertItem( "&Icosidodecahedron", 6); //Connect the shapemenu - QObject.Connect (shapemenu, SIGNAL ("activated(int)"), - display, SLOT("SlotShapeMenu(int)")); + TQObject.Connect (shapemenu, TQT_SIGNAL ("activated(int)"), + display, TQT_SLOT("SlotShapeMenu(int)")); //Setup the settingsmenu - settingsmenu = new QPopupMenu (null, "settingsmenu"); - settingsmenu.InsertItem ("&Alpha", display, SLOT ("SlotSetAlpha()")); + settingsmenu = new TQPopupMenu (null, "settingsmenu"); + settingsmenu.InsertItem ("&Alpha", display, TQT_SLOT ("SlotSetAlpha()")); //Setup the menubar - menubar = new QMenuBar (this, ""); + menubar = new TQMenuBar (this, ""); menubar.InsertItem ("&File", filemenu); menubar.InsertItem ("&Shape", shapemenu); menubar.InsertItem ("&Settings", settingsmenu); } } - public class Display: QWidget, IQuantumFractal { + public class Display: TQWidget, IQuantumFractal { //Labels - QLabel count; - QLabel shape; - QLabel alpha; + TQLabel count; + TQLabel shape; + TQLabel alpha; //Buttons - QPushButton start; - QPushButton stop; - QPushButton reset; - QPushButton gray; - QPushButton intense; + TQPushButton start; + TQPushButton stop; + TQPushButton reset; + TQPushButton gray; + TQPushButton intense; //Drawable region QPaintBuffer buffer; //Layouts - QVBoxLayout layout; - QHBoxLayout buttons; - QVBoxLayout labels; + TQVBoxLayout layout; + TQHBoxLayout buttons; + TQVBoxLayout labels; //Engine controller variables int[] topDensity = new int[0]; @@ -106,35 +106,35 @@ namespace Qf { QuantumFractals qf; Thread engine; - public Display (QWidget parent): base (parent) + public Display (TQWidget parent): base (parent) { //Setup the sizes - QSize size = new QSize (resolution, resolution); + TQSize size = new TQSize (resolution, resolution); parent.SetBaseSize (size); //Some nice colors - SetPaletteBackgroundColor (new QColor ("Black")); - SetPaletteForegroundColor (new QColor ("LightBlue")); + SetPaletteBackgroundColor (new TQColor ("Black")); + SetPaletteForegroundColor (new TQColor ("LightBlue")); //Setup the buttons - start = new QPushButton ("Start", this); - stop = new QPushButton ("Stop", this); - reset = new QPushButton ("Reset", this); - gray = new QPushButton ("Color", this); - intense = new QPushButton ("Intensity", this); + start = new TQPushButton ("Start", this); + stop = new TQPushButton ("Stop", this); + reset = new TQPushButton ("Reset", this); + gray = new TQPushButton ("Color", this); + intense = new TQPushButton ("Intensity", this); //Setup the labels - count = new QLabel (this); - alpha = new QLabel (this); - shape = new QLabel (this); + count = new TQLabel (this); + alpha = new TQLabel (this); + shape = new TQLabel (this); //Setup the drawable buffer = new QPaintBuffer (this); buffer.SetMinimumSize (size); //Create the layouts - layout = new QVBoxLayout (this); - buttons = new QHBoxLayout (layout); + layout = new TQVBoxLayout (this); + buttons = new TQHBoxLayout (layout); //Add some buttons buttons.AddWidget (start); @@ -144,23 +144,23 @@ namespace Qf { buttons.AddWidget (intense); //Connect the buttons and SlotQuit - QObject.Connect (start, SIGNAL ("clicked()"), - this, SLOT ("SlotStart()")); - QObject.Connect (stop, SIGNAL ("clicked()"), - this, SLOT ("SlotStop()")); - QObject.Connect (reset, SIGNAL ("clicked()"), - this, SLOT ("SlotReset()")); - QObject.Connect (gray, SIGNAL ("clicked()"), - this, SLOT ("SlotGray()")); - QObject.Connect (intense, SIGNAL ("clicked()"), - this, SLOT ("SlotIntense()")); - QObject.Connect (buffer, SIGNAL ("Painted()"), - this, SLOT ("SlotSetLabels()")); - QObject.Connect (qApp, SIGNAL ("lastWindowClosed ()"), - this, SLOT ("SlotQuit ()")); + TQObject.Connect (start, TQT_SIGNAL ("clicked()"), + this, TQT_SLOT ("SlotStart()")); + TQObject.Connect (stop, TQT_SIGNAL ("clicked()"), + this, TQT_SLOT ("SlotStop()")); + TQObject.Connect (reset, TQT_SIGNAL ("clicked()"), + this, TQT_SLOT ("SlotReset()")); + TQObject.Connect (gray, TQT_SIGNAL ("clicked()"), + this, TQT_SLOT ("SlotGray()")); + TQObject.Connect (intense, TQT_SIGNAL ("clicked()"), + this, TQT_SLOT ("SlotIntense()")); + TQObject.Connect (buffer, TQT_SIGNAL ("Painted()"), + this, TQT_SLOT ("SlotSetLabels()")); + TQObject.Connect (qApp, TQT_SIGNAL ("lastWindowClosed ()"), + this, TQT_SLOT ("SlotQuit ()")); //Layout labels - labels = new QVBoxLayout (layout); + labels = new TQVBoxLayout (layout); labels.AddWidget (count); labels.AddWidget (shape); labels.AddWidget (alpha); @@ -367,9 +367,9 @@ namespace Qf { WasRunning = Running ? true : false; SlotStop (); - string filename = QFileDialog.GetSaveFileName ( + string filename = TQFileDialog.GetSaveFileName ( - QDir.HomeDirPath (), "*", this, "save", + TQDir.HomeDirPath (), "*", this, "save", "Save Screenshot", "*.png", true ); @@ -405,7 +405,7 @@ namespace Qf { } //Need to reset the resolution upon resize - private void TouchResize (QResizeEvent e) + private void TouchResize (TQResizeEvent e) { int height = buffer.Size ().Height (); int width = buffer.Size ().Width (); @@ -415,23 +415,23 @@ namespace Qf { } [DeclareQtSignal ("Painted()")] - public class QPaintBuffer : QFrame { + public class QPaintBuffer : TQFrame { //Drawables - private QPixmap buffer; - private QImage image; + private TQPixmap buffer; + private TQImage image; //Timer private TimerCallback call; private Timer timer; - public QPaintBuffer (QWidget parent) : base (parent) + public QPaintBuffer (TQWidget parent) : base (parent) { SetBackgroundMode (Qt.BackgroundMode.NoBackground); //Create drawables - buffer = new QPixmap (); - image = new QImage (Size (), 32); + buffer = new TQPixmap (); + image = new TQImage (Size (), 32); //Setup the event handlers paintEvent += new PaintEvent (TouchPaint); @@ -448,8 +448,8 @@ namespace Qf { //Resets the drawables public void Reset () { - buffer = new QPixmap (); - image = new QImage (Size (), 32); + buffer = new TQPixmap (); + image = new TQImage (Size (), 32); PaintImage (null); } @@ -484,24 +484,24 @@ namespace Qf { } //Receive focus events - private void TouchFocus (QFocusEvent e) + private void TouchFocus (TQFocusEvent e) { PerformPaint (); } //Receive paint events - private void TouchPaint (QPaintEvent e) + private void TouchPaint (TQPaintEvent e) { PerformPaint (); } //Receive resize events - private void TouchResize (QResizeEvent e) + private void TouchResize (TQResizeEvent e) { - image = new QImage (e.Size (), 32); + image = new TQImage (e.Size (), 32); buffer.Resize (e.Size()); - buffer.Fill (new QColor("black")); - BitBlt (buffer, 0, 0, new QPixmap (buffer), + buffer.Fill (new TQColor("black")); + BitBlt (buffer, 0, 0, new TQPixmap (buffer), 0, 0, -1, -1, RasterOp.CopyROP, false); } |