git-svn-id: svn://db.shs.com.ru/libs@406 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -27,7 +27,7 @@ BlockView::~BlockView() {
|
|||||||
|
|
||||||
|
|
||||||
void BlockView::_init() {
|
void BlockView::_init() {
|
||||||
grid_visible = grid_snap = pm_connect = navigation = m_connect = m_trace_with_buses = minimap = true;
|
grid_visible = grid_snap = pm_connect = navigation = m_connect = m_trace_with_buses = prev_tcb = minimap = true;
|
||||||
mm_drag = moved = new_branch = new_bus = mm_cancel = iconnect = mm_copy = m_pin_mc = mm_thumb = move_bus_point = false;
|
mm_drag = moved = new_branch = new_bus = mm_cancel = iconnect = mm_copy = m_pin_mc = mm_thumb = move_bus_point = false;
|
||||||
match_bus = bus_from = 0;
|
match_bus = bus_from = 0;
|
||||||
mm_ci = 0;
|
mm_ci = 0;
|
||||||
@@ -310,6 +310,7 @@ bool BlockView::eventFilter(QObject * o, QEvent * e) {
|
|||||||
addItem(tmp_buses.back());
|
addItem(tmp_buses.back());
|
||||||
}
|
}
|
||||||
//qDebug() << "new" << ;
|
//qDebug() << "new" << ;
|
||||||
|
prev_tcb = m_trace_with_buses;
|
||||||
newBusStarted(tmp_bus.busType());
|
newBusStarted(tmp_bus.busType());
|
||||||
markPins(tmp_bus.busType());
|
markPins(tmp_bus.busType());
|
||||||
if (qgraphicsitem_cast<BlockItemPin*>(mm_ci)->alignment() == Qt::AlignLeft ||
|
if (qgraphicsitem_cast<BlockItemPin*>(mm_ci)->alignment() == Qt::AlignLeft ||
|
||||||
@@ -670,13 +671,21 @@ void BlockView::keyPressEvent(QKeyEvent * e) {
|
|||||||
highlightNearPins(pin, e->modifiers());
|
highlightNearPins(pin, e->modifiers());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e->key() == Qt::Key_Shift) {
|
if (tmp_bus.isVisible()) {
|
||||||
if (tmp_bus.isVisible()) {
|
bool retrace = false;
|
||||||
|
if (e->key() == Qt::Key_Shift) {
|
||||||
|
retrace = true;
|
||||||
switch (wavetrace.preferredDirection()) {
|
switch (wavetrace.preferredDirection()) {
|
||||||
case BlockViewWavetrace::NoTrace: wavetrace.setPreferredDirection(BlockViewWavetrace::Horizontal); break;
|
case BlockViewWavetrace::NoTrace: wavetrace.setPreferredDirection(BlockViewWavetrace::Horizontal); break;
|
||||||
case BlockViewWavetrace::Horizontal: wavetrace.setPreferredDirection(BlockViewWavetrace::Vertical); break;
|
case BlockViewWavetrace::Horizontal: wavetrace.setPreferredDirection(BlockViewWavetrace::Vertical); break;
|
||||||
case BlockViewWavetrace::Vertical: wavetrace.setPreferredDirection(BlockViewWavetrace::NoTrace); break;
|
case BlockViewWavetrace::Vertical: wavetrace.setPreferredDirection(BlockViewWavetrace::NoTrace); break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (e->key() == Qt::Key_Alt) {
|
||||||
|
retrace = true;
|
||||||
|
m_trace_with_buses = !m_trace_with_buses;
|
||||||
|
}
|
||||||
|
if (retrace) {
|
||||||
trace(last_trace_from, trace_to, &tmp_bus);
|
trace(last_trace_from, trace_to, &tmp_bus);
|
||||||
for (int i = 0; i < qMin(tmp_buses.size(), last_multiconnect_pl.size()); ++i) {
|
for (int i = 0; i < qMin(tmp_buses.size(), last_multiconnect_pl.size()); ++i) {
|
||||||
QPointF dp = last_multiconnect_pl[i]->scenePos() - last_trace_from;
|
QPointF dp = last_multiconnect_pl[i]->scenePos() - last_trace_from;
|
||||||
@@ -1545,6 +1554,7 @@ void BlockView::hideTmpBuses(bool clear) {
|
|||||||
qDeleteAll(tmp_buses);
|
qDeleteAll(tmp_buses);
|
||||||
tmp_buses.clear();
|
tmp_buses.clear();
|
||||||
}
|
}
|
||||||
|
m_trace_with_buses = prev_tcb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1608,6 +1618,7 @@ void BlockView::adjustThumb() {
|
|||||||
|
|
||||||
void BlockView::newBranch(BlockBusItem * item) {
|
void BlockView::newBranch(BlockBusItem * item) {
|
||||||
bus_from = item;
|
bus_from = item;
|
||||||
|
prev_tcb = m_trace_with_buses;
|
||||||
newBusStarted(item->busType());
|
newBusStarted(item->busType());
|
||||||
markPins(item->busType());
|
markPins(item->busType());
|
||||||
new_branch = true;
|
new_branch = true;
|
||||||
@@ -1622,6 +1633,7 @@ void BlockView::newBranch(BlockBusItem * item) {
|
|||||||
|
|
||||||
void BlockView::startBusPointMove(int bus_type) {
|
void BlockView::startBusPointMove(int bus_type) {
|
||||||
move_bus_point = true;
|
move_bus_point = true;
|
||||||
|
prev_tcb = m_trace_with_buses;
|
||||||
newBusStarted(bus_type);
|
newBusStarted(bus_type);
|
||||||
markPins(bus_type);
|
markPins(bus_type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ protected:
|
|||||||
QPropertyAnimation thumb_anim, nav_anim;
|
QPropertyAnimation thumb_anim, nav_anim;
|
||||||
int timer_thumb, thumb_hide_delay, thick;
|
int timer_thumb, thumb_hide_delay, thick;
|
||||||
bool mm_drag, new_bus, new_branch, moved, mm_cancel, iconnect, mm_copy, mm_thumb, ae_enabled, is_nav_anim, is_block_anim, move_bus_point;
|
bool mm_drag, new_bus, new_branch, moved, mm_cancel, iconnect, mm_copy, mm_thumb, ae_enabled, is_nav_anim, is_block_anim, move_bus_point;
|
||||||
bool grid_visible, grid_snap, pm_connect, navigation, m_connect, m_trace_with_buses, m_pin_mc, minimap;
|
bool grid_visible, grid_snap, pm_connect, navigation, m_connect, m_trace_with_buses, m_pin_mc, minimap, prev_tcb;
|
||||||
bool nav_prev_aa, nav_prev_imaa, nav_prev_grid;
|
bool nav_prev_aa, nav_prev_imaa, nav_prev_grid;
|
||||||
double grid_step, grid_points, cur_scl, _talpha, thumb_scl;
|
double grid_step, grid_points, cur_scl, _talpha, thumb_scl;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user