Commit 993ff7af authored by Christoffer Ackelman's avatar Christoffer Ackelman Committed by Esteban Blanc

QT: Fixed nav in flow.

parent 40d83890
......@@ -1030,7 +1030,6 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb,
statusbar->addWidget(label);
add_expanding(statusbar, textinput);
subpane = new QSplitter(Qt::Vertical);
QHBoxLayout* palbox = new QHBoxLayout();
node_palctx = new PalQt(this, "Objects", ldhsession, "PlcEditorPalette",
&node_palette, &sts);
......@@ -1047,13 +1046,13 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb,
add_expanding(palbox, con_palette);
add_expanding(palbox, nav_palette);
subpane = new QSplitter(Qt::Vertical);
add_expanding(subpane, palbox);
pane = new QSplitter(Qt::Horizontal);
gre = new WGreQt(this, "Name");
((WGreQt*)gre)->new_navigator(subpane);
subpane->addWidget(((WGreQt*)gre)->nav_widget);
subpane->addWidget(((WGreQt*)gre)->create_navigator());
add_expanding(pane, ((WGreQt*)gre)->form_widget);
pane->addWidget(subpane);
......
......@@ -66,10 +66,10 @@ WGreQt::~WGreQt()
}
}
int WGreQt::new_navigator(QWidget* parent)
QWidget* WGreQt::create_navigator()
{
nav_widget = flownavwidgetqt_new(flow_widget);
return 1;
return nav_widget;
}
int WGreQt::new_navigator_popup()
......
......@@ -59,7 +59,7 @@ public:
void trace_stop();
void get_popup_position(int* x, int* y);
int new_navigator(QWidget* parent);
QWidget* create_navigator();
int new_navigator_popup();
private:
......
......@@ -728,9 +728,9 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
case QEvent::Wheel: {
QWheelEvent* wheelEvent = ((QWheelEvent*)event);
if (wheelEvent->delta() > 0) {
sts = ctx->event_handler(flow_eEvent_ScrollUp, 0, 0, 0, 0);
sts = ctx->event_handler(flow_eEvent_ScrollUp, wheelEvent->x(), wheelEvent->y(), 0, 0);
} else if (wheelEvent->delta() < 0) {
sts = ctx->event_handler(flow_eEvent_ScrollDown, 0, 0, 0, 0);
sts = ctx->event_handler(flow_eEvent_ScrollDown, wheelEvent->x(), wheelEvent->y(), 0, 0);
}
break;
}
......@@ -786,18 +786,19 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
}
break;
}
case QEvent::Show: {
sts = ctx->event_handler_nav(flow_eEvent_Map, 0, 0);
case QEvent::Paint:
case QEvent::UpdateRequest: {
sts = ctx->event_handler_nav(flow_eEvent_Exposure, 0, 0);
break;
}
case QEvent::MouseMove: {
QPoint pos = QCursor::pos();
QMouseEvent* mouseEvent = ((QMouseEvent*)event);
if (button1_pressed || button2_pressed || button3_pressed) {
sts = ctx->event_handler_nav(
flow_eEvent_ButtonMotion, pos.x(), pos.y());
flow_eEvent_ButtonMotion, mouseEvent->x(), mouseEvent->y());
} else {
sts = ctx->event_handler_nav(
flow_eEvent_CursorMotion, pos.x(), pos.y());
flow_eEvent_CursorMotion, mouseEvent->x(), mouseEvent->y());
}
break;
}
......
......@@ -1963,8 +1963,7 @@ GeQt::GeQt(void* x_parent_ctx, ldh_tSesContext x_ldhses, int x_exit_when_close,
add_expanding(vpaned, palbox);
vpaned->addWidget(colpal_main_widget);
((GraphQt*)graph)->create_navigator();
vpaned->addWidget(((GraphQt*)graph)->nav_widget);
vpaned->addWidget(((GraphQt*)graph)->create_navigator());
graph_list = new GeItemViewQt(this);
......
......@@ -852,10 +852,6 @@ int GlowDrawQt::event_handler(QEvent* event, QWidget* target)
glow_eEvent_ButtonRelease, mouseEvent->x(), mouseEvent->y());
break;
}
case QEvent::Show: {
sts = ctx->event_handler_nav(glow_eEvent_Exposure, 0, 0);
break;
}
case QEvent::Paint:
case QEvent::UpdateRequest: {
ctx->nav_clear();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment