}
}
+inline void HexView::drawCaret(bool visible)
+{
+ drawCaret(visible, config_.top(), height());
+}
+
void HexView::drawCaret(bool visible, int ytop, int ymax)
{
qDebug("drawCaret visible:%d ytop:%d ymax:%d sel:%llu top:%llu", visible, ytop, ymax, cur_->Position, cur_->Top);
if (ev->button() == Qt::LeftButton) {
grabMouse();
drawSelected(true);
- bool enable = cur_->HexTimerId;
- if (enable) {
- setCaretBlink(false);
- drawCaret(false, config_.top(), height());
+ if (cur_->HexTimerId) {
+ drawCaret(false);
}
cur_->SelBegin = cur_->SelEnd = cur_->SelEndO = moveByMouse(ev->pos().x(), ev->pos().y());
cur_->Toggle = true;
- if (enable) {
- drawCaret(true, config_.top(), height());
- setCaretBlink(true);
+ if (cur_->HexTimerId) {
+ drawCaret(true);
}
qDebug("press - begin:%lld", cur_->SelBegin);
}
{
if (cur_->Toggle) {
cur_->SelEndO = cur_->SelEnd;
+
+ if (cur_->HexTimerId) {
+ cur_->Position = cur_->SelEnd;
+ drawCaret(false);
+ }
+
cur_->SelEnd = moveByMouse(ev->pos().x(), ev->pos().y());
cur_->refreshSelected();
drawSelected();
+
+ if (cur_->HexTimerId) {
+ cur_->Position = cur_->SelEnd;
+ drawCaret(true);
+ }
}
}
quint64 oldBegin = cur_->SelBegin;
quint64 oldEnd = cur_->SelEnd;
- if (cur_->HexTimerId) {
- cur_->Position = cur_->SelEnd;
- drawCaret(true, config_.top(), height());
- }
-
cur_->SelEnd = moveByMouse(ev->pos().x(), ev->pos().y());
cur_->refreshSelected();
cur_->Toggle = false;
void HexView::timerEvent(QTimerEvent *ev)
{
if (cur_->HexTimerId == ev->timerId()) {
- drawCaret(cur_->HexCaretVisible, config_.top(), height());
+ drawCaret(cur_->HexCaretVisible);
cur_->HexCaretVisible = !cur_->HexCaretVisible;
}
}
void isSelected(bool &selected, quint64 &sb, quint64 &se, quint64 top, int yCount, uint size);
void drawSelected(bool reset = false);
+ void drawCaret(bool visible);
void drawCaret(bool visible, int ytop, int ymax);
void byteToHex(uchar c, QString &h);