summaryrefslogtreecommitdiffstats
path: root/qtsharp/src/examples/samples/quantumfractals.cs
diff options
context:
space:
mode:
Diffstat (limited to 'qtsharp/src/examples/samples/quantumfractals.cs')
-rw-r--r--qtsharp/src/examples/samples/quantumfractals.cs124
1 files changed, 62 insertions, 62 deletions
diff --git a/qtsharp/src/examples/samples/quantumfractals.cs b/qtsharp/src/examples/samples/quantumfractals.cs
index 484b5640..9303b831 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 : TTQMainWindow {
+ public class FractalViewer : TQMainWindow {
//Menuing
- private TTQMenuBar menubar;
- private TTQPopupMenu filemenu;
- private TTQPopupMenu shapemenu;
- private TTQPopupMenu 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
- TTQApplication app = new TTQApplication (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 TTQPopupMenu (null, "filemenu");
+ filemenu = new TQPopupMenu (null, "filemenu");
filemenu.InsertItem ("&Screenshot", display, TQT_SLOT ("SlotScreenshot()"));
filemenu.InsertSeparator ();
filemenu.InsertItem ("&Quit", qApp, TQT_SLOT ("quit()"));
//Setup the shapemenu
- shapemenu = new TTQPopupMenu (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
- TTQObject.Connect (shapemenu, TQT_SIGNAL ("activated(int)"),
+ TQObject.Connect (shapemenu, TQT_SIGNAL ("activated(int)"),
display, TQT_SLOT("SlotShapeMenu(int)"));
//Setup the settingsmenu
- settingsmenu = new TTQPopupMenu (null, "settingsmenu");
+ settingsmenu = new TQPopupMenu (null, "settingsmenu");
settingsmenu.InsertItem ("&Alpha", display, TQT_SLOT ("SlotSetAlpha()"));
//Setup the menubar
- menubar = new TTQMenuBar (this, "");
+ menubar = new TQMenuBar (this, "");
menubar.InsertItem ("&File", filemenu);
menubar.InsertItem ("&Shape", shapemenu);
menubar.InsertItem ("&Settings", settingsmenu);
}
}
- public class Display: TTQWidget, IQuantumFractal {
+ public class Display: TQWidget, IQuantumFractal {
//Labels
- TTQLabel count;
- TTQLabel shape;
- TTQLabel alpha;
+ TQLabel count;
+ TQLabel shape;
+ TQLabel alpha;
//Buttons
- TTQPushButton start;
- TTQPushButton stop;
- TTQPushButton reset;
- TTQPushButton gray;
- TTQPushButton intense;
+ TQPushButton start;
+ TQPushButton stop;
+ TQPushButton reset;
+ TQPushButton gray;
+ TQPushButton intense;
//Drawable region
TQPaintBuffer buffer;
//Layouts
- TTQVBoxLayout layout;
- TTQHBoxLayout buttons;
- TTQVBoxLayout 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 (TTQWidget parent): base (parent)
+ public Display (TQWidget parent): base (parent)
{
//Setup the sizes
- TTQSize size = new TTQSize (resolution, resolution);
+ TQSize size = new TQSize (resolution, resolution);
parent.SetBaseSize (size);
//Some nice colors
- SetPaletteBackgroundColor (new TTQColor ("Black"));
- SetPaletteForegroundColor (new TTQColor ("LightBlue"));
+ SetPaletteBackgroundColor (new TQColor ("Black"));
+ SetPaletteForegroundColor (new TQColor ("LightBlue"));
//Setup the buttons
- start = new TTQPushButton ("Start", this);
- stop = new TTQPushButton ("Stop", this);
- reset = new TTQPushButton ("Reset", this);
- gray = new TTQPushButton ("Color", this);
- intense = new TTQPushButton ("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 TTQLabel (this);
- alpha = new TTQLabel (this);
- shape = new TTQLabel (this);
+ count = new TQLabel (this);
+ alpha = new TQLabel (this);
+ shape = new TQLabel (this);
//Setup the drawable
buffer = new TQPaintBuffer (this);
buffer.SetMinimumSize (size);
//Create the layouts
- layout = new TTQVBoxLayout (this);
- buttons = new TTQHBoxLayout (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
- TTQObject.Connect (start, TQT_SIGNAL ("clicked()"),
+ TQObject.Connect (start, TQT_SIGNAL ("clicked()"),
this, TQT_SLOT ("SlotStart()"));
- TTQObject.Connect (stop, TQT_SIGNAL ("clicked()"),
+ TQObject.Connect (stop, TQT_SIGNAL ("clicked()"),
this, TQT_SLOT ("SlotStop()"));
- TTQObject.Connect (reset, TQT_SIGNAL ("clicked()"),
+ TQObject.Connect (reset, TQT_SIGNAL ("clicked()"),
this, TQT_SLOT ("SlotReset()"));
- TTQObject.Connect (gray, TQT_SIGNAL ("clicked()"),
+ TQObject.Connect (gray, TQT_SIGNAL ("clicked()"),
this, TQT_SLOT ("SlotGray()"));
- TTQObject.Connect (intense, TQT_SIGNAL ("clicked()"),
+ TQObject.Connect (intense, TQT_SIGNAL ("clicked()"),
this, TQT_SLOT ("SlotIntense()"));
- TTQObject.Connect (buffer, TQT_SIGNAL ("Painted()"),
+ TQObject.Connect (buffer, TQT_SIGNAL ("Painted()"),
this, TQT_SLOT ("SlotSetLabels()"));
- TTQObject.Connect (qApp, TQT_SIGNAL ("lastWindowClosed ()"),
+ TQObject.Connect (qApp, TQT_SIGNAL ("lastWindowClosed ()"),
this, TQT_SLOT ("SlotQuit ()"));
//Layout labels
- labels = new TTQVBoxLayout (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 = TTQFileDialog.GetSaveFileName (
+ string filename = TQFileDialog.GetSaveFileName (
- TTQDir.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 (TTQResizeEvent 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 TQPaintBuffer : TTQFrame {
+ public class TQPaintBuffer : TQFrame {
//Drawables
- private TTQPixmap buffer;
- private TTQImage image;
+ private TQPixmap buffer;
+ private TQImage image;
//Timer
private TimerCallback call;
private Timer timer;
- public TQPaintBuffer (TTQWidget parent) : base (parent)
+ public TQPaintBuffer (TQWidget parent) : base (parent)
{
SetBackgroundMode (Qt.BackgroundMode.NoBackground);
//Create drawables
- buffer = new TTQPixmap ();
- image = new TTQImage (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 TTQPixmap ();
- image = new TTQImage (Size (), 32);
+ buffer = new TQPixmap ();
+ image = new TQImage (Size (), 32);
PaintImage (null);
}
@@ -484,24 +484,24 @@ namespace Qf {
}
//Receive focus events
- private void TouchFocus (TTQFocusEvent e)
+ private void TouchFocus (TQFocusEvent e)
{
PerformPaint ();
}
//Receive paint events
- private void TouchPaint (TTQPaintEvent e)
+ private void TouchPaint (TQPaintEvent e)
{
PerformPaint ();
}
//Receive resize events
- private void TouchResize (TTQResizeEvent e)
+ private void TouchResize (TQResizeEvent e)
{
- image = new TTQImage (e.Size (), 32);
+ image = new TQImage (e.Size (), 32);
buffer.Resize (e.Size());
- buffer.Fill (new TTQColor("black"));
- BitBlt (buffer, 0, 0, new TTQPixmap (buffer),
+ buffer.Fill (new TQColor("black"));
+ BitBlt (buffer, 0, 0, new TQPixmap (buffer),
0, 0, -1, -1, RasterOp.CopyROP, false);
}