Index: tools/ddd/Functions.cpp
===================================================================
--- tools/ddd/Functions.cpp	(revision 81)
+++ tools/ddd/Functions.cpp	(revision 82)
@@ -19,7 +19,12 @@
 void ddd::OpenDatafile() {
   
+  if(Socket->state() == QAbstractSocket::ConnectedState) { // do not execute if socket is open
+    MakeConnection();
+  }
+
   CloseDatafile();	// Close previous file if open
 
   // Write run header to temporary file  
+  ftruncate(fileno(Tmpfile),0);
   rewind(Tmpfile);
   switch (RD->OpenDataFile(FilenameBox->text().toAscii().data(), Tmpfile)) {
@@ -51,13 +56,8 @@
   M0Start->setEnabled(true);
   M0Stop->setEnabled(true);
-  EventNo->setValue(1);
   EventNo->setRange(1, RD->RHeader->Events);
-  M0Start->setValue(0);
-  M0Stop->setValue((RD->RHeader->Samples)-1);
   M0Start->setRange(0,(RD->RHeader->Samples)-1);  
   M0Stop->setRange(0,(RD->RHeader->Samples)-1);
-  ChannelNo->setValue(0);
   ChannelNo->setRange(0, RD->RHeader->NChannels*RD->RHeader->NChips-1);
-  BoardNo->setValue(0);
   BoardNo->setRange(0, RD->RHeader->NBoards-1);
   DisplayEvent();
@@ -86,4 +86,5 @@
   
   // Read event
+  ftruncate(fileno(Tmpfile),0);
   rewind(Tmpfile);
   if (RD->ReadEvent(EventNo->value(), Tmpfile) != CTX_OK) {
@@ -251,7 +252,4 @@
       ManualDisconnect = false;
 
-      OpenAction->setEnabled(false);      
-      FilenameBox->setEnabled(false);
-      LoadButton->setEnabled(false);
       FilenameBox->clear();
       CloseDatafile();
@@ -330,4 +328,12 @@
 }
 
+// +++ Reset graph axes to autoscale when fully unzoomed +++
+void ddd::HandleZoom(const QwtDoubleRect &) {
+  if(Zoomer->zoomRectIndex() == 0) {
+    Graph->setAxisAutoScale(QwtPlot::xBottom);
+    Graph->setAxisAutoScale(QwtPlot::yLeft);
+  }
+}
+
 // +++ Disconnect from socket +++
 void ddd::GotDisconnected() {
@@ -339,7 +345,4 @@
 
   GetButton->setEnabled(false);
-  FilenameBox->setEnabled(true);
-  OpenAction->setEnabled(true);    
-  LoadButton->setEnabled(true);
   ChannelNo->setEnabled(false);
   BoardNo->setEnabled(false);
@@ -402,5 +405,8 @@
      "1. Reading and displaying the content of a raw data file written by the drsdaq program\n"
      "2. Acquiring and displaying online data from a running drsdaq program via the socket interface\n\n"
-     "With an established socket connection, displaying of raw data files is disabled.");
+     "With an established socket connection, displaying of raw data files is disabled.\n\n"
+     "Navigation in signal display: Left mouse button to zoom, right to unzoom fully, middle to unzoom one level. Left mouse button plus shift key to pan.\n"
+     "When unzoomed, the axes are rescaled automatically.");
+
    Message.setWindowTitle("ddd Help"); 
    Message.exec();
@@ -410,4 +416,5 @@
   QMessageBox::about(this, "ddd About","DRS Data Display\n\n"
     "Written by Oliver Grimm, IPP, ETH Zurich\n"
+    "Event display by Quirin Weitzel.\n\n"
     "This version compiled "__DATE__".\n\n"
     "Graphical user interface implemented with Qt.\n"
Index: tools/ddd/GUI.cpp
===================================================================
--- tools/ddd/GUI.cpp	(revision 81)
+++ tools/ddd/GUI.cpp	(revision 82)
@@ -102,6 +102,6 @@
   Graph->setAutoReplot(true);
   Graph->setCanvasBackground(QColor(Qt::yellow));
-  Graph->setToolTip("Left mouse button to zoom (+Shift to pan)");
   Zoomer = new QwtPlotZoomer(QwtPlot::xBottom,QwtPlot::yLeft,Graph->canvas());
+  connect(Zoomer, SIGNAL(zoomed(const QwtDoubleRect &)), this, SLOT(HandleZoom(const QwtDoubleRect &)));
   Panner = new QwtPlotPanner(Graph->canvas());
   Panner->setMouseButton(Qt::LeftButton, Qt::ShiftModifier);
@@ -112,12 +112,4 @@
   Signal->attach(Graph);
   Signal->setStyle(QwtPlotCurve::Steps);
-
-  AutoscaleBox = new QCheckBox("Autoscale", Central);
-  AutoscaleBox->setFont(QFont("Times", 10, QFont::Bold));
-  AutoscaleBox->setToolTip("Scale axes automatically");
-
-  GraphLayout = new QVBoxLayout;
-  GraphLayout->addWidget(Graph);
-  GraphLayout->addWidget(AutoscaleBox);
 
   // Text boxes for run and event header
@@ -246,4 +238,6 @@
   M0Stop = new QSpinBox(M0Window);
   M0Stop->setEnabled(false);
+  M0Stop->setRange(0,1023);
+  M0Stop->setValue(1023);
   connect(M0Stop, SIGNAL(valueChanged(int)), this, SLOT(DisplayEvent(int)));
   M0Stop->setToolTip("Last bin/sample of time window");
Index: tools/ddd/GUI.h
===================================================================
--- tools/ddd/GUI.h	(revision 81)
+++ tools/ddd/GUI.h	(revision 82)
@@ -29,5 +29,5 @@
 
     QPushButton *GetButton, *SocketButton, *Connect, *M0Display;
-    QCheckBox *ContinuousBox, *AutoscaleBox;
+    QCheckBox *ContinuousBox;
     QToolButton *LoadButton;
     QLineEdit *FilenameBox, *IPAddress, *Command, *PixelID;
@@ -39,5 +39,4 @@
     QAction *OpenAction, *ConnectAction;
     QGridLayout *SocketLayout, *MainLayout, *M0Layout;
-    QVBoxLayout *GraphLayout;
     QFormLayout *CommandLayout, *PortLayout, *AddressLayout, *FormLayout, *SpinLayout, *M0StartLayout, *M0StopLayout;
     
@@ -73,4 +72,5 @@
     void ReadFromSocket();
     void GotDisconnected();
+    void HandleZoom(const QwtDoubleRect &);
     void TranslatePixelID();
     
