mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-07-12 22:04:17 -04:00
Merged from trunk:
------------------------------------------------------------------------ r8179 | k1jt | 2017-10-23 14:41:11 +0100 (Mon, 23 Oct 2017) | 2 lines Clarify some User Guide text about AP decoding. ------------------------------------------------------------------------ r8181 | k1jt | 2017-10-23 19:59:42 +0100 (Mon, 23 Oct 2017) | 2 lines Clarify some wording of command-line startup options for wsjtx. ------------------------------------------------------------------------ r8183 | k1jt | 2017-10-24 18:47:05 +0100 (Tue, 24 Oct 2017) | 2 lines Improve User Guide text on AP decoding. ------------------------------------------------------------------------ r8184 | k1jt | 2017-10-25 21:20:39 +0100 (Wed, 25 Oct 2017) | 2 lines Make the "Controls" label slightly wider. ------------------------------------------------------------------------ r8185 | k1jt | 2017-10-25 21:21:48 +0100 (Wed, 25 Oct 2017) | 2 lines Add a tip. ------------------------------------------------------------------------ r8186 | bsomervi | 2017-10-27 13:38:25 +0100 (Fri, 27 Oct 2017) | 5 lines Add a contextual pop up menu to the wide graph Initial button added is to set both Tx and Rx offset. Tidied up encapsulation issue in CPlotter class. ------------------------------------------------------------------------ Bumped RC number. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx-1.8@8187 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+48
-24
@@ -10,6 +10,7 @@
|
||||
|
||||
CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
|
||||
QFrame {parent},
|
||||
m_set_freq_action {new QAction {tr ("&Set Rx && Tx Offset"), this}},
|
||||
m_bScaleOK {false},
|
||||
m_bReference {false},
|
||||
m_bReference0 {false},
|
||||
@@ -42,6 +43,19 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
|
||||
setAutoFillBackground(false);
|
||||
setAttribute(Qt::WA_OpaquePaintEvent, false);
|
||||
setAttribute(Qt::WA_NoSystemBackground, true);
|
||||
|
||||
// contextual pop up menu
|
||||
setContextMenuPolicy (Qt::CustomContextMenu);
|
||||
connect (this, &QWidget::customContextMenuRequested, [this] (QPoint const& pos) {
|
||||
QMenu menu {this};
|
||||
menu.addAction (m_set_freq_action);
|
||||
auto const& connection = connect (m_set_freq_action, &QAction::triggered, [this, pos] () {
|
||||
int newFreq = FreqfromX (pos.x ()) + .5;
|
||||
emit setFreq1 (newFreq, newFreq);
|
||||
});
|
||||
menu.exec (mapToGlobal (pos));
|
||||
disconnect (connection);
|
||||
});
|
||||
}
|
||||
|
||||
CPlotter::~CPlotter() { } // Destructor
|
||||
@@ -629,35 +643,45 @@ void CPlotter::setRxFreq (int x) //setRxFreq
|
||||
|
||||
int CPlotter::rxFreq() {return m_rxFreq;} //rxFreq
|
||||
|
||||
void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
|
||||
void CPlotter::mouseReleaseEvent (QMouseEvent * event)
|
||||
{
|
||||
int x=event->x();
|
||||
if(x<0) x=0;
|
||||
if(x>m_Size.width()) x=m_Size.width();
|
||||
bool ctrl = (event->modifiers() & Qt::ControlModifier);
|
||||
bool shift = (event->modifiers() & Qt::ShiftModifier);
|
||||
int newFreq = int(FreqfromX(x)+0.5);
|
||||
int oldTxFreq = m_txFreq;
|
||||
int oldRxFreq = m_rxFreq;
|
||||
if (ctrl) {
|
||||
emit setFreq1 (newFreq, newFreq);
|
||||
} else if (shift) {
|
||||
emit setFreq1 (oldRxFreq, newFreq);
|
||||
} else {
|
||||
emit setFreq1(newFreq,oldTxFreq);
|
||||
}
|
||||
if (Qt::LeftButton == event->button ()) {
|
||||
int x=event->x();
|
||||
if(x<0) x=0;
|
||||
if(x>m_Size.width()) x=m_Size.width();
|
||||
bool ctrl = (event->modifiers() & Qt::ControlModifier);
|
||||
bool shift = (event->modifiers() & Qt::ShiftModifier);
|
||||
int newFreq = int(FreqfromX(x)+0.5);
|
||||
int oldTxFreq = m_txFreq;
|
||||
int oldRxFreq = m_rxFreq;
|
||||
if (ctrl) {
|
||||
emit setFreq1 (newFreq, newFreq);
|
||||
} else if (shift) {
|
||||
emit setFreq1 (oldRxFreq, newFreq);
|
||||
} else {
|
||||
emit setFreq1(newFreq,oldTxFreq);
|
||||
}
|
||||
|
||||
int n=1;
|
||||
if(ctrl) n+=100;
|
||||
emit freezeDecode1(n);
|
||||
int n=1;
|
||||
if(ctrl) n+=100;
|
||||
emit freezeDecode1(n);
|
||||
}
|
||||
else {
|
||||
event->ignore (); // let parent handle
|
||||
}
|
||||
}
|
||||
|
||||
void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click
|
||||
void CPlotter::mouseDoubleClickEvent (QMouseEvent * event)
|
||||
{
|
||||
bool ctrl = (event->modifiers() & Qt::ControlModifier);
|
||||
int n=2;
|
||||
if(ctrl) n+=100;
|
||||
emit freezeDecode1(n);
|
||||
if (Qt::LeftButton == event->button ()) {
|
||||
bool ctrl = (event->modifiers() & Qt::ControlModifier);
|
||||
int n=2;
|
||||
if(ctrl) n+=100;
|
||||
emit freezeDecode1(n);
|
||||
}
|
||||
else {
|
||||
event->ignore (); // let parent handle
|
||||
}
|
||||
}
|
||||
|
||||
void CPlotter::setNsps(int ntrperiod, int nsps) //setNsps
|
||||
|
||||
Reference in New Issue
Block a user