[med-svn] [Git][med-team/edfbrowser][upstream] New upstream version 2.09+dfsg

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Wed May 8 17:00:31 BST 2024



Étienne Mollier pushed to branch upstream at Debian Med / edfbrowser


Commits:
979b653c by Étienne Mollier at 2024-05-08T16:12:49+02:00
New upstream version 2.09+dfsg
- - - - -


19 changed files:

- check_edf_file.c
- cnvs/bdf2edf.cpp
- doc/manual.html
- edfbrowser.pro
- global.h
- import_annotations.cpp
- mainwindow.cpp
- mainwindow.h
- mainwindow_constr.cpp
- options_dialog.cpp
- options_dialog.h
- show_edf_hdr.cpp
- signals_dialog.cpp
- + tmessagebox.cpp
- + tmessagebox.h
- vc_painter.cpp
- version.txt
- viewbuf.cpp
- viewcurve.cpp


Changes:

=====================================
check_edf_file.c
=====================================
@@ -1301,18 +1301,38 @@ edfhdrblck_t * check_edf_file(FILE *inputfile, char *txt_string, int txt_len, in
   for(i=0; i<edfhdr->edfsignals; i++)
   {
     strncpy(scratchpad, edf_hdr + 256 + (edfhdr->edfsignals * 224) + (i * 32), 32);
-    for(j=0; j<32; j++)
+    if(edfhdr->edf || edfhdr->bdfplus)
     {
-      if(scratchpad[j] != ' ')
+      for(j=0; j<32; j++)
       {
-        snprintf(txt_string, txt_len, "Error, %ith character of reserved field of signal %i is not a space.\n"
-                                      "You can repair the file with the header editor, have a look at the manual for the details.",
-        j + 1,
-        i + 1);
-        free(edf_hdr);
-        free(edfhdr->edfparam);
-        free(edfhdr);
-        return NULL;
+        if(scratchpad[j] != ' ')
+        {
+          snprintf(txt_string, txt_len, "Error, %ith character of reserved field of signal %i is not a space.\n"
+                                        "You can repair the file with the header editor, have a look at the manual for the details.",
+          j + 1,
+          i + 1);
+          free(edf_hdr);
+          free(edfhdr->edfparam);
+          free(edfhdr);
+          return NULL;
+        }
+      }
+    }
+    else
+    {
+      for(j=0; j<32; j++)
+      {
+        if((scratchpad[j] < 32) || (scratchpad[j] > 126))
+        {
+          snprintf(txt_string, txt_len, "Error, %ith character of reserved field of signal %i is not a valid 7-bit ASCII character.\n"
+                                        "You can repair the file with the header editor, have a look at the manual for the details.",
+          j + 1,
+          i + 1);
+          free(edf_hdr);
+          free(edfhdr->edfparam);
+          free(edfhdr);
+          return NULL;
+        }
       }
     }
     strncpy(edfhdr->edfparam[i].reserved, edf_hdr + 256 + (edfhdr->edfsignals * 224) + (i * 32), 32);


=====================================
cnvs/bdf2edf.cpp
=====================================
@@ -70,6 +70,7 @@ UI_BDF2EDFwindow::UI_BDF2EDFwindow(QWidget *w_parent)
   spinBox2->setDecimals(3);
   spinBox2->setRange(1.0, 256.0);
   spinBox2->setValue(1.0);
+  spinBox2->setToolTip("Increasing the divider lowers the amplitude resolution but increases the amplitude range (physical maximum and minimum)");
 
   pushButton1 = new QPushButton;
   pushButton1->setText("Select File");
@@ -92,13 +93,16 @@ UI_BDF2EDFwindow::UI_BDF2EDFwindow(QWidget *w_parent)
   HPFcheckBox = new QCheckBox;
   HPFcheckBox->setTristate(false);
   HPFcheckBox->setChecked(true);
+  HPFcheckBox->setToolTip("The highpass filter is usually necessary in order to remove the DC-offset");
 
   QFormLayout *flayout = new QFormLayout;
   flayout->addRow("Enable HPF:", HPFcheckBox);
+  flayout->labelForField(HPFcheckBox)->setToolTip("The highpass filter is usually necessary in order to remove the DC-offset");
   flayout->addRow(" ", (QWidget *)NULL);
   flayout->addRow("Highpass filter:", spinBox1);
   flayout->addRow(" ", (QWidget *)NULL);
   flayout->addRow("Divider:", spinBox2);
+  flayout->labelForField(spinBox2)->setToolTip("Increasing the divider lowers the amplitude resolution but increases the amplitude range (physical maximum and minimum)");
 
   QHBoxLayout *hlayout3 = new QHBoxLayout;
   hlayout3->addWidget(pushButton4);


=====================================
doc/manual.html
=====================================
@@ -21,7 +21,7 @@
     </style>
 </head><body>
 
-<h1>EDFbrowser 2.07 manual</h1>
+<h1>EDFbrowser 2.09 manual</h1>
 
 <p><br></p>
 


=====================================
edfbrowser.pro
=====================================
@@ -72,6 +72,7 @@ MOC_DIR = ./moc
 HEADERS += global.h
 HEADERS += mainwindow.h
 HEADERS += viewcurve.h
+HEADERS += tmessagebox.h
 HEADERS += check_edf_file.h
 HEADERS += show_edf_hdr.h
 HEADERS += signals_dialog.h
@@ -189,6 +190,7 @@ HEADERS += third_party/kiss_fft/kiss_fftr.h
 SOURCES += main.cpp
 SOURCES += mainwindow_constr.cpp
 SOURCES += mainwindow.cpp
+SOURCES += tmessagebox.cpp
 SOURCES += rc_host.cpp
 SOURCES += viewbuf.cpp
 SOURCES += load_session.cpp


=====================================
global.h
=====================================
@@ -63,7 +63,7 @@
 #endif
 
 #define PROGRAM_NAME                "EDFbrowser"
-#define PROGRAM_VERSION                   "2.07"
+#define PROGRAM_VERSION                   "2.09"
 #define PROGRAM_BETA_SUFFIX                   ""
 #define MINIMUM_QT4_VERSION           (0x040807)
 #define MINIMUM_QT5_VERSION           (0x050C06)


=====================================
import_annotations.cpp
=====================================
@@ -195,7 +195,7 @@ UI_ImportAnnotationswindow::UI_ImportAnnotationswindow(QWidget *w_parent)
     tab[i] = new QWidget;
   }
 
-///////////////////////////////////////////////// ACSII/CSV //////////////////////////////////////////////////
+///////////////////////////////////////////////// ASCII/CSV //////////////////////////////////////////////////
 
   SeparatorLineEdit = new QLineEdit;
   SeparatorLineEdit->setMaxLength(3);


=====================================
mainwindow.cpp
=====================================
@@ -1522,6 +1522,13 @@ void UI_Mainwindow::annotation_editor()
 
 //  stop_playback();
 
+  if(annotationEditDock)
+  {
+    delete annotationEditDock;
+    annotationEditDock = NULL;
+    return;
+  }
+
   if(playback_realtime_active)
   {
     playback_realtime_timer->stop();
@@ -1749,7 +1756,7 @@ void UI_Mainwindow::open_new_file()
 
   int i, len, present, position, button_nr=0, err=0;
 
-  char str[2048]="";
+  char str1[2048]="";
 
   QAction *act=NULL;
 
@@ -1932,9 +1939,9 @@ void UI_Mainwindow::open_new_file()
       }
       else
       {
-        snprintf(str, 2048, "File has an unknown extension:\n \n%s", path);
+        snprintf(str1, 2048, "File has an unknown extension:\n \n%s", path);
 
-        QMessageBox::critical(this, "Error", QString::fromLocal8Bit(str));
+        QMessageBox::critical(this, "Error", QString::fromLocal8Bit(str1));
       }
       rc_file_open_requested = 0;
       drop_path[0] = 0;
@@ -1951,9 +1958,9 @@ void UI_Mainwindow::open_new_file()
       }
       else
       {
-        snprintf(str, 2048, "Cannot open file for reading:\n \n%s\n \n"
-                            "Check if you have the right permissions.", path);
-        QMessageBox::critical(this, "Error", QString::fromLocal8Bit(str));
+        snprintf(str1, 2048, "Cannot open file for reading:\n \n%s\n \n"
+                             "Check if you have the right permissions.", path);
+        QMessageBox::critical(this, "Error", QString::fromLocal8Bit(str1));
       }
       rc_file_open_requested = 0;
       drop_path[0] = 0;
@@ -1963,7 +1970,7 @@ void UI_Mainwindow::open_new_file()
 
     get_directory_from_path(recent_opendir, path, MAX_PATH_LENGTH);
 
-    edfhdr = check_edf_file(newfile, str, 2048, live_stream_active, 0);
+    edfhdr = check_edf_file(newfile, str1, 2048, live_stream_active, 0);
     if(edfhdr==NULL)
     {
       fclose(newfile);
@@ -1976,11 +1983,14 @@ void UI_Mainwindow::open_new_file()
       }
       else
       {
-        if(strstr(str, "If you want to import annotations from this file") == NULL)
+        if(strstr(str1, "If you want to import annotations from this file") != NULL)
         {
-          strlcat(str, "\n File is not a valid EDF or BDF file.", 2048);
+          QMessageBox::critical(this, "Error", str1);
+        }
+        else
+        {
+          tmessagebox(QMessageBox::Critical, "Error", "File is not a valid EDF or BDF file.", str1, this);
         }
-        QMessageBox::critical(this, "Error", str);
       }
       rc_file_open_requested = 0;
       drop_path[0] = 0;
@@ -1998,17 +2008,18 @@ void UI_Mainwindow::open_new_file()
       {
         if(edfhdr->edf)
         {
-          QMessageBox::critical(this, "Error", "EDFbrowser cannot show EDF+D (discontiguous) files. "
-                                               "Convert this file to EDF+C first. You can find this converter "
-                                               "in the Tools menu (EDF+D to EDF+C converter).");
-        }
-
-        if(edfhdr->bdf)
-        {
-          QMessageBox::critical(this, "Error", "EDFbrowser cannot show BDF+D (discontiguous) files."
-                                               "Convert this file to BDF+C first. You can find this converter "
-                                               "in the Tools menu (EDF+D to EDF+C converter).");
+          tmessagebox(QMessageBox::Critical, "Error",
+                      "EDFbrowser cannot show EDF+D (discontiguous) files",
+                      "Convert this file to EDF+C first. You can find this converter\n"
+                      "in the Tools menu (EDF+D to EDF+C converter).", this);
         }
+        else if(edfhdr->bdf)
+          {
+            tmessagebox(QMessageBox::Critical, "Error",
+                        "EDFbrowser cannot show BDF+D (discontiguous) files",
+                        "Convert this file to BDF+C first. You can find this converter\n"
+                        "in the Tools menu (EDF+D to EDF+C converter).", this);
+          }
       }
 
       free(edfhdr->edfparam);
@@ -4544,64 +4555,64 @@ void UI_Mainwindow::show_help()
 
 void UI_Mainwindow::show_kb_shortcuts()
 {
-  QMessageBox messagewindow(QMessageBox::NoIcon,
-   "Keyboard shortcuts",
-   "PgDn\t\tnext page\n"
-   "PgUp\t\tformer page\n"
-   "Right Arrow\tshift right one tenth of pagetime\n"
-   "Left Arrow\t\tshift left one tenth of pagetime\n"
-   "Plus\t\tincrease amplitude\n"
-   "Minus\t\tdecrease amplitude\n"
-   "Up Arrow\t\tshift traces up\n"
-   "Down Arrow\tshift traces down\n"
-   "Shift+Up Arrow\tmove vertical scrollbar (if enabled)\n"
-   "Shift+Down Arrow\tmove vertical scrollbar (if enabled)\n"
-   "Ctrl-Home\t\tgo to start of file\n"
-   "Ctrl-End\t\tgo to end of file\n"
-   "Ctrl++\t\tzoom in horizontally\n"
-   "Ctrl+-\t\tzoom out horizontally\n"
-   "F1 - F8\t\tload predefined montage\n"
-   "Alt+Shift+C\tcrosshair (repeat for second crosshair)\n"
-   "Esc\t\tremove crosshairs or floating ruler\n"
-   "Ctrl+M\t\ttoggle annotation markers\n"
-
-   "\nafter zooming in by drawing a rectangle:\n"
-   "Backspace\t\tzoom back\n"
-   "Insert\t\tzoom in\n"
+  const char str1[]={
+    "<table>\n"
+    "<tr> <td> </td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>Next page</td> <td>  :  </td> <td>PgDn</td> </tr>\n"
+    "<tr> <td>Former page</td> <td>  :  </td> <td>PgUp</td> </tr>\n"
+    "<tr> <td>Shift right one tenth of page</td> <td>  :  </td> <td>Right arrow</td> </tr>\n"
+    "<tr> <td>Shift left one tenth of page</td> <td>  :  </td> <td>Left arrow</td> </tr>\n"
+    "<tr> <td>Increase amplitude</td> <td>  :  </td> <td>Plus</td> </tr>\n"
+    "<tr> <td>Decrease amplitude</td> <td>  :  </td> <td>Minus</td> </tr>\n"
+    "<tr> <td>Shift traces up</td> <td>  :  </td> <td>Up arrow</td> </tr>\n"
+    "<tr> <td>Shift traces down</td> <td>  :  </td> <td>Down arrow</td> </tr>\n"
+    "<tr> <td>Move vertical scrollbar</td> <td>  :  </td> <td>Shift + Up Arrow</td> </tr>\n"
+    "<tr> <td>Move vertical scrollbar</td> <td>  :  </td> <td>Shift + Down Arrow</td> </tr>\n"
+    "<tr> <td>Go to start of file</td> <td>  :  </td> <td>Ctrl + Home</td> </tr>\n"
+    "<tr> <td>Go to end of file</td> <td>  :  </td> <td>Ctrl + End</td> </tr>\n"
+    "<tr> <td>Zoom in horizontally</td> <td>  :  </td> <td>Ctrl + Plus</td> </tr>\n"
+    "<tr> <td>Zoom out horizontally</td> <td>  :  </td> <td>Ctrl + Minus</td> </tr>\n"
+    "<tr> <td>Load predefined montage</td> <td>  :  </td> <td>F1 - F8</td> </tr>\n"
+    "<tr> <td>Crosshair (repeat for second crosshair)</td> <td>  :  </td> <td>Alt + Shift + C</td> </tr>\n"
+    "<tr> <td>Remove crosshairs and floating ruler</td> <td>  :  </td> <td>Esc</td> </tr>\n"
+    "<tr> <td>Toggle annotation markers</td> <td>  :  </td> <td>Ctrl + M</td> </tr>\n"
+    "<tr> <td> </td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>After zooming in by drawing a rectangle:</td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>Zoom back</td> <td>  :  </td> <td>Backspace</td> </tr>\n"
+    "<tr> <td>Zoom in</td> <td>  :  </td> <td>Insert</td> </tr>\n"
+    "<tr> <td> </td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>Open a file</td> <td>  :  </td> <td>Ctrl + O</td> </tr>\n"
+    "<tr> <td>Open a stream</td> <td>  :  </td> <td>Ctrl + Shift + O</td> </tr>\n"
 #ifdef Q_OS_WIN32
-   "\nCtrl+O\t\tOpen a file\n"
-   "Ctrl+Shift+O\tOpen a stream\n"
-   "Ctrl+F4\tClose all files\n"
-   "Alt+F4\tExit program\n"
+    "<tr> <td>Close all files</td> <td>  :  </td> <td>Ctrl + F4</td> </tr>\n"
+    "<tr> <td>Exit program</td> <td>  :  </td> <td>Alt + F4</td> </tr>\n"
 #else
-   "\nCtrl+O\t\tOpen a file\n"
-   "Ctrl+Shift+O\tOpen a stream\n"
-   "Ctrl+W\t\tClose all files\n"
-   "Ctrl+Q\t\tExit program\n"
+    "<tr> <td>Close all files</td> <td>  :  </td> <td>Ctrl+W</td> </tr>\n"
+    "<tr> <td>Exit program</td> <td>  :  </td> <td>Ctrl + Q</td> </tr>\n"
 #endif
-   "\nMousewheel\tshift left or right\n"
-   "Ctrl+Mousewheel\tzoom in or out horizontally\n"
-   "Keep middle mousebutton pressed to drag horizontally\n"
-
-   "\nCtrl+Space\tToggle Playback or Pause\n"
-   "Ctrl+Shift+V\tToggle Playback with video\n"
-
-   "\nAnnotation editor:\n"
-   "user buttons: press 1, 2, 3, etc.\n"
-   "Shift+draw rectangle\tcreate annotation\n"
-   "Ctrl+draw rectangle\tcreate signal linked annotation\n"
-   "A+crosshair(s) active\tcreate annotation,\n \tuse Ctrl to print amplitude difference\n",
-   QMessageBox::Close
-  );
-
-  char str[1024]={""};
-  snprintf(str, 1024, "QLabel{min-width:%i px;}", (int)(400 * w_scaling));
-  messagewindow.setStyleSheet(str);
-
-  messagewindow.exec();
+    "<tr> <td>Shift left or right</td> <td>  :  </td> <td>Mousewheel</td> </tr>\n"
+    "<tr> <td>Zoom in or out horizontally</td> <td>  :  </td> <td>Ctrl + Mousewheel</td> </tr>\n"
+    "<tr> <td>Drag horizontally</td> <td>  :  </td> <td>Keep middle mousebutton pressed</td> </tr>\n"
+    "<tr> <td> </td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>Toggle Playback or Pause</td> <td>  :  </td> <td>Ctrl + Space</td> </tr>\n"
+    "<tr> <td>Toggle Playback with video</td> <td>  :  </td> <td>Ctrl + Shift + V</td> </tr>\n"
+    "<tr> <td> </td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>Annotation editor:</td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>Toggle annotation editor</td> <td>  :  </td> <td>Ctrl + E</td> </tr>\n"
+    "<tr> <td>User buttons</td> <td>  :  </td> <td>Press 1, 2, 3, etc.</td> </tr>\n"
+    "<tr> <td>Create annotation</td> <td>  :  </td> <td>Shift + draw rectangle</td> </tr>\n"
+    "<tr> <td>Create signal linked annotation</td> <td>  :  </td> <td>Ctrl + draw rectangle</td> </tr>\n"
+    "<tr> <td> </td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>Annotation editor + crosshair(s) active:</td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td>Create annotation</td> <td>  :  </td> <td>A</td> </tr>\n"
+    "<tr> <td>Create annotation with amplitude difference</td> <td>  :  </td> <td>Ctrl + A</td> </tr>\n"
+    "<tr> <td> </td> <td> </td> <td> </td> </tr>\n"
+    "<tr> <td> </td> <td> </td> <td> </td> </tr>\n"
+    "</table>\n"};
+
+  tmessagebox(QMessageBox::Information, "Keyboard Shortcuts", "Hotkeys", str1, this);
 }
 
-
 #ifdef Q_OS_WIN32
 
 QString UI_Mainwindow::specialFolder(int type)


=====================================
mainwindow.h
=====================================
@@ -59,6 +59,7 @@
 
 #include "global.h"
 #include "viewcurve.h"
+#include "tmessagebox.h"
 #include "check_edf_file.h"
 #include "show_edf_hdr.h"
 #include "signals_dialog.h"


=====================================
mainwindow_constr.cpp
=====================================
@@ -1233,7 +1233,11 @@ UI_Mainwindow::UI_Mainwindow()
   windowmenu = new QMenu(this);
   windowmenu->setTitle("&Window");
   windowmenu->addAction("Annotations", this, SLOT(show_annotations()));
-  windowmenu->addAction("Annotation editor", this, SLOT(annotation_editor()));
+#if QT_VERSION < 0x060000
+  windowmenu->addAction("Annotation editor", this, SLOT(annotation_editor()), QKeySequence(Qt::CTRL + Qt::Key_E));
+#else
+  windowmenu->addAction("Annotation editor", QKeySequence(Qt::CTRL | Qt::Key_E), this, SLOT(annotation_editor()));
+#endif
   windowmenu->addAction("Power Spectrum", this, SLOT(show_spectrum_dock()));
   windowmenu->addAction("Color Density Spectral Array", this, SLOT(show_cdsa_dock()));
   windowmenu->addAction("amplitude EEG", this, SLOT(show_aeeg_dock()));
@@ -1242,11 +1246,8 @@ UI_Mainwindow::UI_Mainwindow()
 
   helpmenu = new QMenu(this);
   helpmenu->setTitle("&Help");
-#ifdef Q_OS_LINUX
-  helpmenu->addAction("Manual",  this, SLOT(show_help()));
-#endif
-#ifdef Q_OS_WIN32
-  helpmenu->addAction("Manual",  this, SLOT(show_help()));
+#if defined(Q_OS_LINUX) || defined(Q_OS_WIN32)
+  helpmenu->addAction("Manual", this, SLOT(show_help()));
 #endif
   helpmenu->addAction("Keyboard shortcuts", this, SLOT(show_kb_shortcuts()));
   helpmenu->addAction("About EDFbrowser", this, SLOT(show_about_dialog()));


=====================================
options_dialog.cpp
=====================================
@@ -406,16 +406,25 @@ UI_OptionsDialog::UI_OptionsDialog(QWidget *w_parent)
   vlayout1_2->addStretch(1000);
 
   QVBoxLayout *vlayout1_3 = new QVBoxLayout;
-  vlayout1_3->addStretch(200);
   vlayout1_3->addWidget(groupbox1);
   vlayout1_3->addWidget(groupbox2);
   vlayout1_3->addStretch(1000);
 
+  QFrame *frame1 = new QFrame;
+  frame1->setFrameStyle(QFrame::VLine | QFrame::Plain);
+
+  QFrame *frame2 = new QFrame;
+  frame2->setFrameStyle(QFrame::VLine | QFrame::Plain);
+
   QHBoxLayout *hlayout1_1 = new QHBoxLayout;
   hlayout1_1->addLayout(vlayout1_1);
-  hlayout1_1->addSpacing(40);
+  hlayout1_1->addSpacing(20);
+  hlayout1_1->addWidget(frame1);
+  hlayout1_1->addSpacing(20);
   hlayout1_1->addLayout(vlayout1_2);
-  hlayout1_1->addStretch(500);
+  hlayout1_1->addSpacing(20);
+  hlayout1_1->addWidget(frame2);
+  hlayout1_1->addSpacing(20);
   hlayout1_1->addLayout(vlayout1_3);
   hlayout1_1->addStretch(500);
 
@@ -558,7 +567,11 @@ UI_OptionsDialog::UI_OptionsDialog(QWidget *w_parent)
   slabel2_3->setMaximumSize(355, 10);
   slabel2_3->setColor(Qt::black);
 
-  QLabel *label2_2 = new QLabel("Measure the length of the black\nrectangles and enter the values.");
+  label2_2 = new QLabel("Measure the length of the black\nrectangles and enter the values.");
+  if(mainwindow->auto_dpi)
+  {
+    label2_2->setEnabled(false);
+  }
 
   spinbox2_1 = new QSpinBox;
   spinbox2_1->setSuffix(" mm");
@@ -1703,11 +1716,15 @@ UI_OptionsDialog::UI_OptionsDialog(QWidget *w_parent)
   flayout4_2->labelForField(hlayout_tmp)->setToolTip("If enabled annotationlist will scroll to items visible on the page when browsing");
   QObject::connect(checkbox4_17, SIGNAL(stateChanged(int)), this, SLOT(checkbox4_17Clicked(int)));
 
+  QFrame *frame3 = new QFrame;
+  frame3->setFrameStyle(QFrame::VLine | QFrame::Plain);
+
   hlayout_tmp = new QHBoxLayout;
   hlayout_tmp->setAlignment(Qt::AlignCenter);
   hlayout_tmp->addLayout(flayout4_1);
   hlayout_tmp->addSpacing(20);
-  hlayout_tmp->addStretch(300);
+  hlayout_tmp->addWidget(frame3);
+  hlayout_tmp->addSpacing(20);
   hlayout_tmp->addLayout(flayout4_2);
   hlayout_tmp->addStretch(1000);
 
@@ -1724,7 +1741,7 @@ UI_OptionsDialog::UI_OptionsDialog(QWidget *w_parent)
   tab5 = new QWidget;
 
   QFormLayout *flayout5_1 = new QFormLayout;
-  flayout5_1->setSpacing(20);
+  flayout5_1->setSpacing(40);
 
   spinbox5_1 = new QSpinBox;
   spinbox5_1->setRange(8, 24);
@@ -1778,10 +1795,11 @@ UI_OptionsDialog::UI_OptionsDialog(QWidget *w_parent)
   hlayout_tmp->addStretch(1000);
 
   vlayout_tmp = new QVBoxLayout;
-  vlayout_tmp->addStretch(1000);
+  vlayout_tmp->addSpacing(40);
   vlayout_tmp->addLayout(flayout5_1);
-  vlayout_tmp->addStretch(1000);
+  vlayout_tmp->addSpacing(40);
   vlayout_tmp->addLayout(hlayout_tmp);
+  vlayout_tmp->addStretch(1000);
 
   tab5->setLayout(vlayout_tmp);
 
@@ -1881,6 +1899,7 @@ void UI_OptionsDialog::calibrate_checkbox_stateChanged(int state)
     spinbox2_2->setEnabled(true);
     ApplyButton->setEnabled(true);
     mainwindow->auto_dpi = 0;
+    label2_2->setEnabled(true);
   }
   else
   {
@@ -1890,6 +1909,7 @@ void UI_OptionsDialog::calibrate_checkbox_stateChanged(int state)
     mainwindow->auto_dpi = 1;
     mainwindow->y_pixelsizefactor = 2.54 / mainwindow->dpiy;
     mainwindow->x_pixelsizefactor = 2.54 / mainwindow->dpix;
+    label2_2->setEnabled(false);
 
     mainwindow->maincurve->drawCurve_stage_1();
   }


=====================================
options_dialog.h
=====================================
@@ -93,7 +93,8 @@ SpecialButton  *BgColorButton,
                *slabel2_3,
                *annotlistdock_edited_txt_color_button;
 
-QLabel         *label_4_1;
+QLabel         *label_4_1,
+               *label2_2;
 
 QSpinBox       *spinbox1_1,
                *spinbox2_1,


=====================================
show_edf_hdr.cpp
=====================================
@@ -366,7 +366,7 @@ void UI_EDFhdrwindow::show_params(int row)
 
   signal_cnt = mainwindow->edfheaderlist[row]->edfsignals;
 
-  signallist->setColumnCount(11);
+  signallist->setColumnCount(12);
   signallist->setRowCount(signal_cnt);
   signallist->setSelectionMode(QAbstractItemView::NoSelection);
   QStringList horizontallabels;
@@ -381,6 +381,7 @@ void UI_EDFhdrwindow::show_params(int row)
   horizontallabels += "Samples per record";
   horizontallabels += "Prefilter";
   horizontallabels += "Transducer";
+  horizontallabels += "Reserved";
   signallist->setHorizontalHeaderLabels(horizontallabels);
 
   QLineEdit *ql;
@@ -488,6 +489,15 @@ void UI_EDFhdrwindow::show_params(int row)
       ql->setToolTip(str);
     }
     signallist->setCellWidget(i, 10, ql);
+    ql = new QLineEdit(mainwindow->edfheaderlist[row]->edfparam[i].reserved);
+    ql->setReadOnly(true);
+    ql->setCursorPosition(0);
+    if(mainwindow->edf_debug)
+    {
+      snprintf(str, 512, "0x%02x", 256 + (signal_cnt * 224) + (i * 32));
+      ql->setToolTip(str);
+    }
+    signallist->setCellWidget(i, 11, ql);
   }
 
   signallist->resizeColumnsToContents();


=====================================
signals_dialog.cpp
=====================================
@@ -616,7 +616,8 @@ void UI_Signalswindow::AddSubtractButtonsClicked(int subtract)
 {
   int i, j, k, n, s, row, duplicate;
 
-  char str[256];
+  char str1[256]={""},
+       str2[4096]={""};
 
   QListWidgetItem *item;
 
@@ -643,8 +644,7 @@ void UI_Signalswindow::AddSubtractButtonsClicked(int subtract)
     {
       if(smp_per_record!=mainwindow->edfheaderlist[row]->edfparam[s].smp_per_record)
       {
-        QMessageBox messagewindow(QMessageBox::Warning, "Warning", derivation_err_str);
-        messagewindow.exec();
+        tmessagebox(QMessageBox::Warning, "Warning", "Cannot make derivation", derivation_err_str, SignalsDialog);
         continue;
       }
     }
@@ -657,8 +657,7 @@ void UI_Signalswindow::AddSubtractButtonsClicked(int subtract)
     {
       if(strcmp(physdimension, mainwindow->edfheaderlist[row]->edfparam[s].physdimension))
       {
-        QMessageBox messagewindow(QMessageBox::Warning, "Warning", derivation_err_str);
-        messagewindow.exec();
+        tmessagebox(QMessageBox::Warning, "Warning", "Cannot make derivation", derivation_err_str, SignalsDialog);
         continue;
       }
     }
@@ -671,14 +670,11 @@ void UI_Signalswindow::AddSubtractButtonsClicked(int subtract)
     {
       if(dblcmp(bitvalue, mainwindow->edfheaderlist[row]->edfparam[s].bitvalue))
       {
-        QMessageBox messagewindow(QMessageBox::Warning, "Warning", derivation_err_str);
-        messagewindow.exec();
-        messagewindow.setIcon(QMessageBox::Information);
-        messagewindow.setWindowTitle("Help");
-        messagewindow.setText("In this case the problem is that the resolution of the signals selected for the derivation,"
-                              "have different values. You can correct this with the tool \"Unify resolution\" in the tools menu."
-                              "Have a look at the manual for the details.");
-        messagewindow.exec();
+        strlcpy(str2, derivation_err_str, 4096);
+        strlcat(str2, "\n\nIn this case the problem is that the amplitude resolution of the signals selected for the derivation,\n"
+                      "have different values. You can correct this with the tool \"Unify resolution\" in the tools menu.\n"
+                      "Have a look at the manual for the details.", 4096);
+        tmessagebox(QMessageBox::Warning, "Warning", "Cannot make derivation", str2, SignalsDialog);
         continue;
       }
     }
@@ -692,9 +688,9 @@ void UI_Signalswindow::AddSubtractButtonsClicked(int subtract)
     k = compositionlist->rowCount();
     for(j=0; j<k; j++)
     {
-      strlcpy(str, ((QLabel *)(compositionlist->cellWidget(j, 0)))->text().toLatin1().data(), 256);
+      strlcpy(str1, ((QLabel *)(compositionlist->cellWidget(j, 0)))->text().toLatin1().data(), 256);
 
-      if((s + 1) == atoi(str))
+      if((s + 1) == atoi(str1))
       {
         duplicate = 1;
         break;
@@ -714,8 +710,8 @@ void UI_Signalswindow::AddSubtractButtonsClicked(int subtract)
     else
     {
       compositionlist->insertRow(k);
-      snprintf(str, 200, "%i", s + 1);
-      compositionlist->setCellWidget(k, 0, new QLabel(str));
+      snprintf(str1, 200, "%i", s + 1);
+      compositionlist->setCellWidget(k, 0, new QLabel(str1));
       ((QLabel *)(compositionlist->cellWidget(k, 0)))->setAlignment(Qt::AlignCenter);
       compositionlist->setCellWidget(k, 1, new QLabel(mainwindow->edfheaderlist[row]->edfparam[s].label));
       ((QLabel *)(compositionlist->cellWidget(k, 1)))->setAlignment(Qt::AlignCenter);
@@ -734,10 +730,10 @@ void UI_Signalswindow::AddSubtractButtonsClicked(int subtract)
         ((QDoubleSpinBox *)(compositionlist->cellWidget(k, 2)))->setValue(1);
       }
 
-      convert_to_metric_suffix(str, mainwindow->edfheaderlist[row]->edfparam[s].sf_f, 3, 256);
-      remove_trailing_zeros(str);
-      strlcat(str, "Hz", 256);
-      compositionlist->setCellWidget(k, 3, new QLabel(str));
+      convert_to_metric_suffix(str1, mainwindow->edfheaderlist[row]->edfparam[s].sf_f, 3, 256);
+      remove_trailing_zeros(str1);
+      strlcat(str1, "Hz", 256);
+      compositionlist->setCellWidget(k, 3, new QLabel(str1));
       ((QLabel *)(compositionlist->cellWidget(k, 3)))->setAlignment(Qt::AlignCenter);
     }
   }


=====================================
tmessagebox.cpp
=====================================
@@ -0,0 +1,139 @@
+/*
+***************************************************************************
+*
+* Author: Teunis van Beelen
+*
+* Copyright (C) 2024 Teunis van Beelen
+*
+* Email: teuniz at protonmail.com
+*
+***************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, version 3 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+***************************************************************************
+*/
+
+#include <QWidget>
+#include <QDialog>
+#include <QPushButton>
+#include <QLabel>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QScrollBar>
+#include <QFrame>
+#include <QIcon>
+#include <QStyle>
+#include <QFontMetrics>
+#include <QTextEdit>
+
+#include "tmessagebox.h"
+
+
+tmessagebox::tmessagebox(QMessageBox::Icon icon, const char *title_txt, const char *info_txt, const char *detailed_txt, QWidget *w_parent)
+{
+  QDialog *dlg = new QDialog(w_parent);
+  dlg->setWindowTitle(title_txt);
+  dlg->setSizeGripEnabled(true);
+  dlg->setModal(true);
+  dlg->setAttribute(Qt::WA_DeleteOnClose, true);
+
+  QFontMetrics fm(dlg->font());
+  double h_scaling = fm.height() / 18.0;
+  double w_scaling = fm.tightBoundingRect("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789").width() / 260.0;
+
+  dlg->setMinimumSize(400 * w_scaling, 300 * h_scaling);
+
+  int pxmap_h = 40 * w_scaling,
+      pxmap_w = 40 * w_scaling;
+
+  QLabel *info_txt_label = new QLabel;
+  info_txt_label->setText(info_txt);
+
+  QLabel *icon_label = new QLabel;
+  if(icon == QMessageBox::Critical)
+  {
+    icon_label->setPixmap(dlg->style()->standardIcon(QStyle::SP_MessageBoxCritical).pixmap(pxmap_h, pxmap_w));
+  }
+  else if(icon == QMessageBox::Question)
+    {
+      icon_label->setPixmap(dlg->style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(pxmap_h, pxmap_w));
+    }
+    else if(icon == QMessageBox::Information)
+      {
+        icon_label->setPixmap(dlg->style()->standardIcon(QStyle::SP_MessageBoxInformation).pixmap(pxmap_h, pxmap_w));
+      }
+      else if(icon == QMessageBox::Warning)
+        {
+          icon_label->setPixmap(dlg->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(pxmap_h, pxmap_w));
+        }
+
+  QTextEdit *text_edit = new QTextEdit;
+  text_edit->setReadOnly(true);
+  text_edit->setLineWrapMode(QTextEdit::NoWrap);
+  text_edit->append(detailed_txt);
+  int w = text_edit->document()->idealWidth() +
+          text_edit->document()->documentMargin() +
+          text_edit->verticalScrollBar()->width() + 10;
+  if(w > 900) w = 900;
+  text_edit->setMinimumWidth(w);
+  if((w + 40) > (400 * w_scaling))
+  {
+    dlg->setMinimumWidth(w + 40);
+  }
+  int h = text_edit->document()->lineCount() * 25;
+  if(h > 700)  h = 700;
+  if(h > (200 * h_scaling))
+  {
+    dlg->setMinimumHeight(h);
+  }
+  text_edit->moveCursor(QTextCursor::Start);
+  text_edit->verticalScrollBar()->setValue(text_edit->verticalScrollBar()->minimum());
+
+  QPushButton *close_button = new QPushButton;
+  close_button->setText("Close");
+
+  QFrame *frame = new QFrame;
+  frame->setFrameStyle(QFrame::HLine | QFrame::Plain);
+
+  QHBoxLayout *hlayout1 = new QHBoxLayout;
+  hlayout1->addWidget(icon_label);
+  hlayout1->addStretch(150);
+  hlayout1->addWidget(info_txt_label);
+  hlayout1->addStretch(1000);
+
+  QHBoxLayout *hlayout2 = new QHBoxLayout;
+  hlayout2->addStretch(1000);
+  hlayout2->addWidget(close_button);
+
+  QVBoxLayout *vlayout1 = new QVBoxLayout;
+  vlayout1->addSpacing(20);
+  vlayout1->addLayout(hlayout1);
+  vlayout1->addWidget(frame);
+  vlayout1->addWidget(text_edit, 1000);
+  vlayout1->addSpacing(20);
+  vlayout1->addLayout(hlayout2);
+
+  dlg->setLayout(vlayout1);
+
+  QObject::connect(close_button, SIGNAL(clicked()), dlg, SLOT(close()));
+
+  dlg->exec();
+};
+
+
+
+
+
+
+


=====================================
tmessagebox.h
=====================================
@@ -0,0 +1,53 @@
+/*
+***************************************************************************
+*
+* Author: Teunis van Beelen
+*
+* Copyright (C) 2024 Teunis van Beelen
+*
+* Email: teuniz at protonmail.com
+*
+***************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, version 3 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+***************************************************************************
+*/
+
+
+#ifndef UI_TMESSAGEBOXFORM_H
+#define UI_TMESSAGEBOXFORM_H
+
+
+#include <QObject>
+#include <QMessageBox>
+
+
+class tmessagebox : public QObject
+{
+  Q_OBJECT
+
+public:
+  tmessagebox(QMessageBox::Icon, const char *, const char *, const char *, QWidget *w_parent=NULL);
+};
+
+#endif
+
+
+
+
+
+
+
+
+


=====================================
vc_painter.cpp
=====================================
@@ -1394,8 +1394,13 @@ void ViewCurve::drawCurve_stage_2(QPainter *painter, int w_width, int w_height,
 
       if(draw_zoom_rectangle && use_move_events)
       {
-        if((graphicBuf[j].graphic_line[i].x1 >= mouse_press_coordinate_x) &&
-           (graphicBuf[j].graphic_line[i].x1 <= mouse_x))
+        if(((mouse_x >= mouse_press_coordinate_x) &&
+            (graphicBuf[j].graphic_line[i].x1 >= mouse_press_coordinate_x) &&
+            (graphicBuf[j].graphic_line[i].x1 <= mouse_x))
+           ||
+           ((mouse_x < mouse_press_coordinate_x) &&
+            (graphicBuf[j].graphic_line[i].x1 <= mouse_press_coordinate_x) &&
+            (graphicBuf[j].graphic_line[i].x1 >= mouse_x)))
         {
           signalcomp[i]->draw_rectangle_sum_y += graphicBuf[j].graphic_line[i].y1;
 


=====================================
version.txt
=====================================
@@ -1,4 +1,23 @@
 
+ version 2.09      April 4, 2024
+ --------------
+
+ -  Fixed a regression bug that prevented the signal properties dialog from being
+    opened when clicking on the signallabel in the plotting window.
+
+
+ version 2.08      March 23, 2024
+ --------------
+
+ - Fix regression bug releated to BDF files created by Biosemi that caused the file invalid because of
+   the text "Reserved" in the reserved fields of the signals.
+
+ - Draw rectangle with the mouse (zoom-in or creating a channel linked annotation) accepts now
+   also rectangles drawn in any direction (before it accepted only rectangles drawn from up-left to down-right).
+
+ - Added keyboard shortcut Ctrl+E in order to toggle the annotation editor.
+
+
  version 2.07      February 25, 2024
  --------------
 


=====================================
viewbuf.cpp
=====================================
@@ -253,6 +253,7 @@ void UI_Mainwindow::setup_viewbuf()
       QMessageBox::critical(this, "Error", "Somehow you hit the memory limit...\n"
                                            "Decrease the timescale and/or number of traces and try again.");
       remove_all_signals();
+      if(pagetime > TIME_FIXP_SCALING)  pagetime = TIME_FIXP_SCALING;
       return;
     }
 #else
@@ -263,6 +264,7 @@ void UI_Mainwindow::setup_viewbuf()
                                            "Decrease the timescale and/or number of traces and try again.\n"
                                            "Consider switching to the 64-bit version.");
       remove_all_signals();
+      if(pagetime > TIME_FIXP_SCALING)  pagetime = TIME_FIXP_SCALING;
       return;
     }
 #endif
@@ -273,6 +275,7 @@ void UI_Mainwindow::setup_viewbuf()
       QMessageBox::critical(this, "Error", "Internal error: Memory allocation error:\n\"prefilterbuf\"");
       remove_all_signals();
       totalviewbufsize_bytes = 0;
+      if(pagetime > TIME_FIXP_SCALING)  pagetime = TIME_FIXP_SCALING;
       return;
     }
     totalviewbufsize_bytes = totalsize;
@@ -663,6 +666,7 @@ void UI_Mainwindow::setup_viewbuf()
       QMessageBox::critical(this, "Error", "Somehow you hit the memory limit...\n"
                                            "Decrease the timescale and/or number of traces and try again.");
       remove_all_signals();
+      if(pagetime > TIME_FIXP_SCALING)  pagetime = TIME_FIXP_SCALING;
       return;
     }
 #else
@@ -673,6 +677,7 @@ void UI_Mainwindow::setup_viewbuf()
                                            "Decrease the timescale and/or number of traces and try again.\n"
                                            "Consider switching to the 64-bit version.");
       remove_all_signals();
+      if(pagetime > TIME_FIXP_SCALING)  pagetime = TIME_FIXP_SCALING;
       return;
     }
 #endif
@@ -684,6 +689,7 @@ void UI_Mainwindow::setup_viewbuf()
                                            "Decrease the timescale and try again.");
       remove_all_signals();
       totalviewbufsize_bytes = 0;
+      if(pagetime > TIME_FIXP_SCALING)  pagetime = TIME_FIXP_SCALING;
       return;
     }
     totalviewbufsize_bytes = totalsize;


=====================================
viewcurve.cpp
=====================================
@@ -703,6 +703,25 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
 
   sigcompblck_t **signalcomp;
 
+  struct
+  {
+    int x1;
+    int x2;
+    int y1;
+    int y2;
+    int w;
+    int h;
+  }
+  sig_rect_select=
+  {
+    .x1=0,
+    .x2=0,
+    .y1=0,
+    .y2=0,
+    .w=0,
+    .h=0
+  };
+
   if(!mainwindow->files_open)  return;
   if(!mainwindow->signalcomps)  return;
 
@@ -790,8 +809,33 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
     {
       draw_zoom_rectangle = 0;
 
-      if((m_x >= (mouse_press_coordinate_x + 15)) && (m_y >= (mouse_press_coordinate_y + 15)))
+      if((abs(m_x - mouse_press_coordinate_x) >= 15) && (abs(m_y - mouse_press_coordinate_y) >= 15))
       {
+        if(m_x > mouse_press_coordinate_x)
+        {
+          sig_rect_select.x1 = mouse_press_coordinate_x;
+          sig_rect_select.x2 = m_x;
+        }
+        else
+        {
+          sig_rect_select.x1 = m_x;
+          sig_rect_select.x2 = mouse_press_coordinate_x;
+        }
+
+        if(m_y > mouse_press_coordinate_y)
+        {
+          sig_rect_select.y1 = mouse_press_coordinate_y;
+          sig_rect_select.y2 = m_y;
+        }
+        else
+        {
+          sig_rect_select.y1 = m_y;
+          sig_rect_select.y2 = mouse_press_coordinate_y;
+        }
+
+        sig_rect_select.w = sig_rect_select.x2 - sig_rect_select.x1;
+        sig_rect_select.h = sig_rect_select.y2 - sig_rect_select.y1;
+
         if((QApplication::keyboardModifiers() == Qt::ControlModifier) ||
            (QApplication::keyboardModifiers() == Qt::ShiftModifier))
         {
@@ -818,7 +862,7 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
 
                   baseline = signalcomp[i]->draw_rectangle_sum_y / signalcomp[i]->draw_rectangle_sum_cnt;
 
-                  dist2 = baseline - ((mouse_press_coordinate_y + m_y) / 2) - scroll_h_offset;
+                  dist2 = baseline - ((sig_rect_select.y1 + sig_rect_select.y2) / 2) - scroll_h_offset;
                   if(dist2 < 0)
                   {
                     dist2 *= -1;
@@ -838,9 +882,9 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
                 mainwindow->annot_created_by_rect_draw_numchan = -1;
               }
 
-            mainwindow->annot_created_by_rect_draw_onset = mainwindow->edfheaderlist[mainwindow->sel_viewtime]->viewtime + (long long)(((double)mainwindow->pagetime / (double)w) * (double)mouse_press_coordinate_x);
+            mainwindow->annot_created_by_rect_draw_onset = mainwindow->edfheaderlist[mainwindow->sel_viewtime]->viewtime + (long long)(((double)mainwindow->pagetime / (double)w) * (double)sig_rect_select.x1);
 
-            mainwindow->annot_created_by_rect_draw_duration = (long long)((double)mainwindow->pagetime / ((double)w / (double)(m_x - mouse_press_coordinate_x)));
+            mainwindow->annot_created_by_rect_draw_duration = (long long)((double)mainwindow->pagetime / ((double)w / (double)sig_rect_select.w));
 
             mainwindow->annot_created_by_rect_draw_active = 1;
 
@@ -849,7 +893,7 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
 
           update();
         }
-        else if((m_x >= (mouse_press_coordinate_x + 25)) && (m_y >= (mouse_press_coordinate_y + 25)))
+        else if((sig_rect_select.w >= 25) && (sig_rect_select.h >= 25))
           {
             for(i=0; i<mainwindow->files_open; i++)
             {
@@ -867,12 +911,12 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
 
             for(i=0; i<mainwindow->files_open; i++)
             {
-              mainwindow->edfheaderlist[i]->viewtime += (long long)(((double)mainwindow->pagetime / (double)w) * (double)mouse_press_coordinate_x);
+              mainwindow->edfheaderlist[i]->viewtime += (long long)(((double)mainwindow->pagetime / (double)w) * (double)sig_rect_select.x1);
             }
-            mainwindow->pagetime = (long long)((double)mainwindow->pagetime / ((double)w / (double)(m_x - mouse_press_coordinate_x)));
+            mainwindow->pagetime = (long long)((double)mainwindow->pagetime / ((double)w / (double)sig_rect_select.w));
             if(mainwindow->pagetime<1)  mainwindow->pagetime = 1;
 
-            v_zoomfactor = h / ((double)(m_y - mouse_press_coordinate_y));
+            v_zoomfactor = h / ((double)sig_rect_select.h);
 
 //             printf("m_y: %i\n"
 //                    "mouse_press_coordinate_y: %i\n"
@@ -889,7 +933,7 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
             {
               mainwindow->signalcomp[i]->screen_offset *= v_zoomfactor;
               mainwindow->signalcomp[i]->screen_offset += ((h * mainwindow->mc_v_scrollarea_ratio * (v_zoomfactor - 1) * (double)(i + 1)) / (signalcomps + 1));
-              mainwindow->signalcomp[i]->screen_offset -= (mouse_press_coordinate_y * v_zoomfactor) + (scroll_h_offset * (v_zoomfactor - 1));
+              mainwindow->signalcomp[i]->screen_offset -= (sig_rect_select.y1 * v_zoomfactor) + (scroll_h_offset * (v_zoomfactor - 1));
               mainwindow->signalcomp[i]->voltpercm /= v_zoomfactor;
               mainwindow->signalcomp[i]->sensitivity *= v_zoomfactor;
             }
@@ -898,6 +942,7 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
             mainwindow->zoomhistory->history_size_head = 0;
 
             mainwindow->setup_viewbuf();
+            signalcomps = mainwindow->signalcomps;
           }
           else
           {
@@ -935,7 +980,7 @@ void ViewCurve::mouseReleaseEvent(QMouseEvent *release_event)
         signallabel_strlen = strlen(signalcomp[i]->signallabel);
       }
 
-      if((m_y<(baseline-(2*h_scaling)))&&(m_y>(baseline-(17*h_scaling)))&&(m_x>(2*w_scaling))&&(m_x<(((signallabel_strlen * 8) + 2) * w_scaling)))
+      if((m_y<(baseline-(2*h_scaling)))&&(m_y>( baseline-(2*h_scaling)-mainwindow->mono_font_pixel_height))&&(m_x>(2*w_scaling))&&(m_x<((signallabel_strlen * mainwindow->mono_font_pixel_width) + (5 * w_scaling))))
       {
         if(pressed_on_label == (i + 1))
         {



View it on GitLab: https://salsa.debian.org/med-team/edfbrowser/-/commit/979b653c310a1434a96702b9a14a96412df5b40b

-- 
View it on GitLab: https://salsa.debian.org/med-team/edfbrowser/-/commit/979b653c310a1434a96702b9a14a96412df5b40b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240508/20dca98b/attachment-0001.htm>


More information about the debian-med-commit mailing list