Commit b7d2a844 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed nav in flow.

parent d3440f5e
...@@ -1030,7 +1030,6 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb, ...@@ -1030,7 +1030,6 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb,
statusbar->addWidget(label); statusbar->addWidget(label);
add_expanding(statusbar, textinput); add_expanding(statusbar, textinput);
subpane = new QSplitter(Qt::Vertical);
QHBoxLayout* palbox = new QHBoxLayout(); QHBoxLayout* palbox = new QHBoxLayout();
node_palctx = new PalQt(this, "Objects", ldhsession, "PlcEditorPalette", node_palctx = new PalQt(this, "Objects", ldhsession, "PlcEditorPalette",
&node_palette, &sts); &node_palette, &sts);
...@@ -1047,13 +1046,13 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb, ...@@ -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, con_palette);
add_expanding(palbox, nav_palette); add_expanding(palbox, nav_palette);
subpane = new QSplitter(Qt::Vertical);
add_expanding(subpane, palbox); add_expanding(subpane, palbox);
pane = new QSplitter(Qt::Horizontal); pane = new QSplitter(Qt::Horizontal);
gre = new WGreQt(this, "Name"); gre = new WGreQt(this, "Name");
((WGreQt*)gre)->new_navigator(subpane); subpane->addWidget(((WGreQt*)gre)->create_navigator());
subpane->addWidget(((WGreQt*)gre)->nav_widget);
add_expanding(pane, ((WGreQt*)gre)->form_widget); add_expanding(pane, ((WGreQt*)gre)->form_widget);
pane->addWidget(subpane); pane->addWidget(subpane);
......
...@@ -66,10 +66,10 @@ WGreQt::~WGreQt() ...@@ -66,10 +66,10 @@ WGreQt::~WGreQt()
} }
} }
int WGreQt::new_navigator(QWidget* parent) QWidget* WGreQt::create_navigator()
{ {
nav_widget = flownavwidgetqt_new(flow_widget); nav_widget = flownavwidgetqt_new(flow_widget);
return 1; return nav_widget;
} }
int WGreQt::new_navigator_popup() int WGreQt::new_navigator_popup()
...@@ -106,4 +106,4 @@ void WGreQt::get_popup_position(int* x, int* y) ...@@ -106,4 +106,4 @@ void WGreQt::get_popup_position(int* x, int* y)
CoWowQt::PopupPosition(form_widget, *x, *y, &wind_x, &wind_y); CoWowQt::PopupPosition(form_widget, *x, *y, &wind_x, &wind_y);
*x = wind_x; *x = wind_x;
*y = wind_y; *y = wind_y;
} }
\ No newline at end of file
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
void trace_stop(); void trace_stop();
void get_popup_position(int* x, int* y); void get_popup_position(int* x, int* y);
int new_navigator(QWidget* parent); QWidget* create_navigator();
int new_navigator_popup(); int new_navigator_popup();
private: private:
...@@ -79,4 +79,4 @@ private: ...@@ -79,4 +79,4 @@ private:
WGreQt* wgre; WGreQt* wgre;
}; };
#endif #endif
\ No newline at end of file
...@@ -200,7 +200,7 @@ FlowDrawQt::FlowDrawQt(QWidget* x_toplevel, void** flow_ctx, ...@@ -200,7 +200,7 @@ FlowDrawQt::FlowDrawQt(QWidget* x_toplevel, void** flow_ctx,
assert(dynamic_cast<QtScrollWidgetFlow*>(toplevel) != NULL); assert(dynamic_cast<QtScrollWidgetFlow*>(toplevel) != NULL);
m_wind.window = dynamic_cast<QtScrollWidgetFlow*>(toplevel); m_wind.window = dynamic_cast<QtScrollWidgetFlow*>(toplevel);
m_wind.buffer = &(((QtScrollWidgetFlow*)m_wind.window)->image); m_wind.buffer = &(dynamic_cast<QtScrollWidgetFlow*>(toplevel)->image);
ctx->mw = &m_wind; ctx->mw = &m_wind;
ctx->navw = &nav_wind; ctx->navw = &nav_wind;
...@@ -216,7 +216,7 @@ void FlowDrawQt::init_nav(QWidget* nav_widget, void* flow_ctx) ...@@ -216,7 +216,7 @@ void FlowDrawQt::init_nav(QWidget* nav_widget, void* flow_ctx)
{ {
assert(dynamic_cast<QtScrollWidgetFlow*>(nav_widget) != NULL); assert(dynamic_cast<QtScrollWidgetFlow*>(nav_widget) != NULL);
nav_wind.window = dynamic_cast<QtScrollWidgetFlow*>(nav_widget); nav_wind.window = dynamic_cast<QtScrollWidgetFlow*>(nav_widget);
nav_wind.buffer = &(((QtScrollWidgetFlow*)nav_wind.window)->image); nav_wind.buffer = &(dynamic_cast<QtScrollWidgetFlow*>(nav_widget)->image);
QPalette pal; QPalette pal;
pal.setColor(QPalette::Background, background); pal.setColor(QPalette::Background, background);
...@@ -744,18 +744,22 @@ void FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target) ...@@ -744,18 +744,22 @@ void FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
} }
break; break;
} }
case QEvent::Show: { case QEvent::Paint:
sts = ctx->event_handler_nav(flow_eEvent_Map, 0, 0); case QEvent::UpdateRequest: {
QPaintEvent* paintEvent = ((QPaintEvent*)event);
sts = ctx->event_handler_nav(
flow_eEvent_Exposure, paintEvent->rect().x(), paintEvent->rect().y());
nav_wind.window->update();
break; break;
} }
case QEvent::MouseMove: { case QEvent::MouseMove: {
QPoint pos = QCursor::pos(); QMouseEvent* mouseEvent = ((QMouseEvent*)event);
if (button1_pressed || button2_pressed || button3_pressed) { if (button1_pressed || button2_pressed || button3_pressed) {
sts = ctx->event_handler_nav( sts = ctx->event_handler_nav(
flow_eEvent_ButtonMotion, pos.x(), pos.y()); flow_eEvent_ButtonMotion, mouseEvent->x(), mouseEvent->y());
} else { } else {
sts = ctx->event_handler_nav( sts = ctx->event_handler_nav(
flow_eEvent_CursorMotion, pos.x(), pos.y()); flow_eEvent_CursorMotion, mouseEvent->x(), mouseEvent->y());
} }
break; break;
} }
......
...@@ -1954,8 +1954,7 @@ GeQt::GeQt(void* x_parent_ctx, ldh_tSesContext x_ldhses, int x_exit_when_close, ...@@ -1954,8 +1954,7 @@ GeQt::GeQt(void* x_parent_ctx, ldh_tSesContext x_ldhses, int x_exit_when_close,
add_expanding(vpaned, palbox); add_expanding(vpaned, palbox);
vpaned->addWidget(colpal_main_widget); vpaned->addWidget(colpal_main_widget);
((GraphQt*)graph)->create_navigator(); vpaned->addWidget(((GraphQt*)graph)->create_navigator());
vpaned->addWidget(((GraphQt*)graph)->nav_widget);
graph_list = new GeItemViewQt(this); graph_list = new GeItemViewQt(this);
......
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