Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
9f0278a2
Commit
9f0278a2
authored
Dec 03, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Simplified printing, removed flow_printdraw.
parent
44eea749
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
242 additions
and
582 deletions
+242
-582
wb/lib/wb/qt/wb_bckw_qt.cqt
wb/lib/wb/qt/wb_bckw_qt.cqt
+1
-4
wb/lib/wb/qt/wb_expw_qt.cqt
wb/lib/wb/qt/wb_expw_qt.cqt
+1
-4
wb/lib/wb/qt/wb_foe_qt.cqt
wb/lib/wb/qt/wb_foe_qt.cqt
+1
-2
wb/lib/wb/qt/wb_watt_qt.cqt
wb/lib/wb/qt/wb_watt_qt.cqt
+1
-4
wb/lib/wb/qt/wb_wda_qt.cqt
wb/lib/wb/qt/wb_wda_qt.cqt
+1
-4
wb/lib/wb/qt/wb_wnav_qt.cqt
wb/lib/wb/qt/wb_wnav_qt.cqt
+1
-4
wb/lib/wb/qt/wb_xcrr_qt.cqt
wb/lib/wb/qt/wb_xcrr_qt.cqt
+2
-4
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
+1
-2
xtt/lib/cow/qt/cow_logw_qt.cqt
xtt/lib/cow/qt/cow_logw_qt.cqt
+1
-4
xtt/lib/cow/qt/cow_msgwindow_qt.cqt
xtt/lib/cow/qt/cow_msgwindow_qt.cqt
+1
-4
xtt/lib/cow/qt/cow_wow_qt.cqt
xtt/lib/cow/qt/cow_wow_qt.cqt
+216
-88
xtt/lib/cow/qt/cow_wow_qt.h
xtt/lib/cow/qt/cow_wow_qt.h
+2
-18
xtt/lib/cow/qt/cow_xhelp_qt.cqt
xtt/lib/cow/qt/cow_xhelp_qt.cqt
+1
-4
xtt/lib/flow/qt/flow_draw_qt.cqt
xtt/lib/flow/qt/flow_draw_qt.cqt
+5
-7
xtt/lib/flow/qt/flow_printdraw_qt.cpp
xtt/lib/flow/qt/flow_printdraw_qt.cpp
+0
-327
xtt/lib/flow/qt/flow_printdraw_qt.h
xtt/lib/flow/qt/flow_printdraw_qt.h
+0
-82
xtt/lib/xtt/qt/xtt_clog_qt.cqt
xtt/lib/xtt/qt/xtt_clog_qt.cqt
+1
-2
xtt/lib/xtt/qt/xtt_evlist_qt.cpp
xtt/lib/xtt/qt/xtt_evlist_qt.cpp
+1
-2
xtt/lib/xtt/qt/xtt_trace_qt.cqt
xtt/lib/xtt/qt/xtt_trace_qt.cqt
+1
-4
xtt/lib/xtt/qt/xtt_xatt_qt.cqt
xtt/lib/xtt/qt/xtt_xatt_qt.cqt
+1
-3
xtt/lib/xtt/qt/xtt_xcolwind_qt.cqt
xtt/lib/xtt/qt/xtt_xcolwind_qt.cqt
+1
-4
xtt/lib/xtt/qt/xtt_xcrr_qt.cqt
xtt/lib/xtt/qt/xtt_xcrr_qt.cqt
+2
-5
No files found.
wb/lib/wb/qt/wb_bckw_qt.cqt
View file @
9f0278a2
...
...
@@ -118,10 +118,7 @@ WbBckWQt::WbBckWQt(void* bckw_parent_ctx, QWidget* bckw_parent_wid,
void WbBckWQt::print()
{
pwr_tStatus sts;
CoWowQt::CreateBrowPrintDialogQt(name, bckwnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(name, bckwnav->brow->ctx, nav_widget);
}
void WbBckWQtWidget::focusInEvent(QFocusEvent* event)
...
...
wb/lib/wb/qt/wb_expw_qt.cqt
View file @
9f0278a2
...
...
@@ -130,10 +130,7 @@ WbExpWQt::~WbExpWQt()
void WbExpWQt::print()
{
pwr_tStatus sts;
CoWowQt::CreateBrowPrintDialogQt(name, expwnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(name, expwnav->brow->ctx, nav_widget);
}
void WbExpWQtWidget::focusInEvent(QFocusEvent* event)
...
...
wb/lib/wb/qt/wb_foe_qt.cqt
View file @
9f0278a2
...
...
@@ -118,9 +118,8 @@ void WFoeQtWidget::activate_print()
void WFoeQtWidget::activate_printdialog()
{
pwr_tStatus sts;
CoWowQt::CreateFlowPrintDialogQt("PlcEditor", foe->gre->flow_ctx,
flow_eOrientation_Landscape, 1.0, this, &sts
);
((WGreQt*)foe->gre)->flow_widget
);
}
void WFoeQtWidget::activate_printoverv()
...
...
wb/lib/wb/qt/wb_watt_qt.cqt
View file @
9f0278a2
...
...
@@ -200,10 +200,7 @@ void WAttQtWidget::hide_cmd_entry()
void WAttQt::print(const char* title)
{
pwr_tStatus sts;
CoWowQt::CreateBrowPrintDialogQt(title, wattnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, wattnav->brow->ctx, ((WAttNavQt*)wattnav)->brow_widget);
}
void WAttQt::change_value_close()
...
...
wb/lib/wb/qt/wb_wda_qt.cqt
View file @
9f0278a2
...
...
@@ -75,10 +75,7 @@ void WdaQt::set_prompt(const char* prompt)
void WdaQt::print(const char* title)
{
pwr_tStatus sts;
wow->CreateBrowPrintDialog(title, wdanav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, wdanav->brow->ctx, brow_widget);
}
void WdaQt::change_value(int set_focus)
...
...
wb/lib/wb/qt/wb_wnav_qt.cqt
View file @
9f0278a2
...
...
@@ -170,10 +170,7 @@ void WNavQtTraceObject::trace_scan()
void WNavQt::print(const char* title)
{
pwr_tStatus sts;
wow->CreateBrowPrintDialog(
title, brow->ctx, flow_eOrientation_Portrait, 1.0, NULL, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, brow->ctx, brow_widget);
}
int WNavQt::get_selection(char* str, int len)
...
...
wb/lib/wb/qt/wb_xcrr_qt.cqt
View file @
9f0278a2
...
...
@@ -81,20 +81,18 @@ void WCrrQt::pop()
void WCrrQt::print()
{
pwr_tStatus sts;
char* namep;
int size;
pwr_tAName title;
sts = ldh_AttrRefToName(ldhses, &objar, cdh_mNName, &namep, &size);
pwr_tStatus
sts = ldh_AttrRefToName(ldhses, &objar, cdh_mNName, &namep, &size);
if (EVEN(sts)) {
return;
}
strncpy(title, namep, sizeof(title));
CoWowQt::CreateBrowPrintDialogQt(title, xcrrnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, xcrrnav->brow->ctx, brow_widget);
}
void WCrrQtWidget::closeEvent(QCloseEvent* event)
...
...
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
View file @
9f0278a2
...
...
@@ -235,8 +235,7 @@ void XttQt::print()
strcat(title, nodename);
}
wow->CreateBrowPrintDialog(title, xnav->brow->ctx, flow_eOrientation_Portrait,
1.0, (void*)this, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, xnav->brow->ctx, brow_widget);
if (sts == WOW__PRINTDIALOGDISABLED) {
pwr_tFileName filename;
pwr_tCmd cmd;
...
...
xtt/lib/cow/qt/cow_logw_qt.cqt
View file @
9f0278a2
...
...
@@ -89,10 +89,7 @@ CoLogWQt::CoLogWQt(void* logw_parent_ctx, QWidget* logw_parent_wid,
void CoLogWQt::print()
{
pwr_tStatus sts;
CoWowQt::CreateBrowPrintDialogQt(name, logwnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(name, logwnav->brow->ctx, nav_widget);
}
void CoLogWQtWidget::focusInEvent(QFocusEvent* event)
...
...
xtt/lib/cow/qt/cow_msgwindow_qt.cqt
View file @
9f0278a2
...
...
@@ -132,13 +132,10 @@ void MsgWindowQt::unmap()
void MsgWindowQt::print()
{
pwr_tStatus sts;
char title[80];
strncpy(title, qPrintable(translate_utf8(name)), sizeof(title));
CoWowQt::CreateBrowPrintDialogQt(title, msgnav->brow->ctx,
flow_eOrientation_Landscape, 1.4, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, msgnav->brow->ctx, nav_widget);
}
void MsgWindowQtWidget::focusInEvent(QFocusEvent* event)
...
...
xtt/lib/cow/qt/cow_wow_qt.cqt
View file @
9f0278a2
This diff is collapsed.
Click to expand it.
xtt/lib/cow/qt/cow_wow_qt.h
View file @
9f0278a2
...
...
@@ -216,25 +216,9 @@ public:
const
char
*
name
,
void
*
menu
,
int
pixmap
,
int
append
,
void
*
w
);
pwr_tStatus
DeleteMenuItem
(
const
char
*
name
,
void
*
menu
);
void
CreateBrowPrintDialog
(
const
char
*
title
,
void
*
brow_ctx
,
int
orientation
,
double
scale
,
void
*
parent_widget
,
pwr_tStatus
*
sts
)
{
CreateBrowPrintDialogQt
(
title
,
brow_ctx
,
orientation
,
scale
,
parent_widget
,
sts
);
}
static
void
CreateBrowPrintDialogQt
(
const
char
*
title
,
void
*
brow_ctx
,
int
orientation
,
double
scale
,
void
*
parent_widget
,
pwr_tStatus
*
sts
);
void
CreateFlowPrintDialog
(
const
char
*
title
,
void
*
flow_ctx
,
int
orientation
,
double
scale
,
void
*
parent_widget
,
pwr_tStatus
*
sts
)
{
CreateFlowPrintDialogQt
(
title
,
flow_ctx
,
orientation
,
scale
,
parent_widget
,
sts
);
}
static
pwr_tStatus
CreateBrowPrintDialogQt
(
const
char
*
title
,
void
*
flow_ctx
,
QWidget
*
brow_widget
);
static
pwr_tStatus
CreateFlowPrintDialogQt
(
const
char
*
title
,
void
*
flow_ctx
,
QWidget
*
flow_widget
);
static
void
CreateFlowPrintDialogQt
(
const
char
*
title
,
void
*
flow_ctx
,
int
orientation
,
double
scale
,
void
*
parent_widget
,
pwr_tStatus
*
sts
);
CoWowTimer
*
timer_new
();
void
SetParent
(
QWidget
*
parent
);
...
...
xtt/lib/cow/qt/cow_xhelp_qt.cqt
View file @
9f0278a2
...
...
@@ -147,13 +147,10 @@ void CoXHelpQt::set_dimension(int width, int height)
void CoXHelpQt::print()
{
pwr_tStatus sts;
char title[80];
strcpy(title, qPrintable(translate_utf8("Help")));
CoWowQt::CreateBrowPrintDialogQt(title, xhelpnav->brow->ctx,
flow_eOrientation_Portrait, 0.7, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, xhelpnav->brow->ctx, brow_widget);
}
void CoXHelpQtWidget::closeEvent(QCloseEvent* event)
...
...
xtt/lib/flow/qt/flow_draw_qt.cqt
View file @
9f0278a2
...
...
@@ -45,7 +45,6 @@
#include "flow_browwidget_qt.h"
#include "flow_draw_qt.h"
#include "flow_msg.h"
#include "flow_printdraw_qt.h"
#include "flow_scroll_widget_qt.h"
#include "flow_widget_qt.h"
...
...
@@ -1812,10 +1811,9 @@ int FlowDrawQt::image_load(const char* imagefile, float scale, float nav_scale,
return 1;
}
FlowPrintDraw* FlowDrawQt::print_draw_new(void* context, const char* title,
int page, void* flow_ctx, int page_border, int* sts)
{
FlowPrintDrawQt* pd
= new FlowPrintDrawQt(context, title, page, flow_ctx, page_border, sts);
return (FlowPrintDraw*)pd;
FlowPrintDraw* FlowDrawQt::print_draw_new(void* context, const char* title, int page,
void* flow_ctx, int page_border, int* sts) {
fprintf(stderr, "ERROR!\nFlowDrawQt::print_draw_new called.\nThis should never happend!\n");
assert(false);
return NULL;
}
\ No newline at end of file
xtt/lib/flow/qt/flow_printdraw_qt.cpp
deleted
100644 → 0
View file @
44eea749
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2018 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#include <math.h>
#include "cow_qt_helpers.h"
#include "flow_printdraw_qt.h"
FlowPrintDrawQt
::
FlowPrintDrawQt
(
void
*
context
,
const
char
*
t
,
int
p
,
void
*
flow_ctx
,
int
page_border
,
int
*
sts
)
:
painter
((
QPainter
*
)
context
),
border
(
page_border
),
ctx
((
FlowCtx
*
)
flow_ctx
),
show_red
(
1
),
page
(
p
)
{
strncpy
(
title
,
t
,
sizeof
(
title
));
if
(
ctx
->
type
()
==
flow_eCtxType_Flow
)
{
print_margin_x
=
10
;
print_margin_y
=
10
;
}
print_margin_x
=
print_margin_y
=
0
;
*
sts
=
1
;
}
FlowPrintDrawQt
::~
FlowPrintDrawQt
()
{
debug_print
(
"FlowPrintDrawQt::~FlowPrintDrawQt
\n
"
);
}
int
FlowPrintDrawQt
::
print_page
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
)
{
if
(
ctx
->
type
()
==
flow_eCtxType_Flow
)
{
if
(
ur_x
-
ll_x
>
ur_y
-
ll_y
)
{
print_margin_x
=
10
;
print_margin_y
=
60
;
}
else
{
print_margin_x
=
60
;
print_margin_y
=
10
;
}
}
print_margin_x
=
print_margin_y
=
0
;
if
(
ur_x
-
ll_x
>
ur_y
-
ll_y
)
{
ctx
->
print_zoom_factor
=
730
/
(
ur_x
-
ll_x
);
}
else
{
ctx
->
print_zoom_factor
=
730
/
(
ur_y
-
ll_y
);
}
ctx
->
print_zoom
();
page_x
=
ll_x
*
ctx
->
print_zoom_factor
;
page_y
=
ll_y
*
ctx
->
print_zoom_factor
;
double
width
=
painter
->
window
().
width
();
double
height
=
painter
->
window
().
height
();
if
(
ctx
->
type
()
==
flow_eCtxType_Brow
)
{
QPen
pen
=
QPen
(
QColor
::
fromRgbF
(
0
,
0
,
0
));
pen
.
setWidthF
(
0.5
);
painter
->
setPen
(
pen
);
painter
->
drawLine
(
print_margin_x
,
print_margin_y
,
print_margin_x
+
width
,
print_margin_y
);
painter
->
setFont
(
QFont
(
"Lucida Sans"
,
9
));
char
page_str
[
40
];
sprintf
(
page_str
,
"Page %d"
,
page
+
1
);
painter
->
drawText
(
print_margin_x
+
width
-
90
,
print_margin_y
-
height
,
fl
(
page_str
));
painter
->
drawText
(
print_margin_x
,
print_margin_y
-
height
,
fl
(
title
));
}
painter
->
setClipRect
(
print_margin_x
,
print_margin_y
,
(
ur_x
-
ll_x
)
*
ctx
->
print_zoom_factor
,
(
ur_y
-
ll_y
)
*
ctx
->
print_zoom_factor
);
painter
->
setClipping
(
true
);
((
FlowCtx
*
)
ctx
)
->
current_print
=
this
;
((
FlowCtx
*
)
ctx
)
->
print
(
ll_x
,
ll_y
,
ur_x
,
ur_y
);
painter
->
setClipping
(
false
);
return
1
;
}
int
FlowPrintDrawQt
::
rect
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_eDrawType
type
,
double
idx
,
int
highlight
)
{
QPen
pen
;
if
(
highlight
||
type
==
flow_eDrawType_LineRed
)
{
pen
=
QPen
(
QColor
::
fromRgbF
(
1
,
0
,
0
));
}
else
{
pen
=
QPen
(
QColor
::
fromRgbF
(
0
,
0
,
0
));
}
pen
.
setWidth
(
0.5
*
idx
);
painter
->
setPen
(
pen
);
painter
->
setBrush
(
Qt
::
NoBrush
);
painter
->
drawRect
(
print_margin_x
+
x
-
page_x
,
print_margin_y
+
y
-
page_y
,
width
,
height
);
return
1
;
}
int
FlowPrintDrawQt
::
filled_rect
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_eDrawType
type
,
double
idx
)
{
switch
(
type
)
{
case
flow_eDrawType_LineRed
:
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
1
,
0
,
0
)));
break
;
case
flow_eDrawType_Green
:
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
0
,
1
,
0
)));
break
;
case
flow_eDrawType_Yellow
:
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
1
,
1
,
0
)));
break
;
case
flow_eDrawType_DarkGray
:
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
0.3
,
0.3
,
0.3
)));
break
;
default:
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
0
,
0
,
0
)));
}
QPen
pen
=
QPen
(
QColor
::
fromRgbF
(
0
,
0
,
0
));
pen
.
setWidth
(
0.5
*
idx
);
painter
->
setPen
(
pen
);
painter
->
drawRect
(
print_margin_x
+
x
-
page_x
,
print_margin_y
+
y
-
page_y
,
width
,
height
);
return
1
;
}
int
FlowPrintDrawQt
::
arc
(
double
x
,
double
y
,
double
width
,
double
height
,
int
angle1
,
int
angle2
,
flow_eDrawType
type
,
double
idx
,
int
highlight
)
{
QPen
pen
;
if
(
highlight
||
type
==
flow_eDrawType_LineRed
||
type
==
flow_eDrawType_LineDashedRed
)
{
pen
=
QPen
(
QColor
::
fromRgbF
(
1
,
0
,
0
));
}
else
{
pen
=
QPen
(
QColor
::
fromRgbF
(
0
,
0
,
0
));
}
if
(
type
==
flow_eDrawType_LineDashed
||
type
==
flow_eDrawType_LineDashedRed
)
{
QVector
<
double
>
dashes
;
dashes
<<
4
<<
2
;
pen
.
setDashPattern
(
dashes
);
}
pen
.
setWidth
(
0.5
*
idx
);
painter
->
setPen
(
pen
);
painter
->
drawArc
(
print_margin_x
+
x
+
width
/
2
-
page_x
,
print_margin_y
+
y
+
height
/
2
-
page_y
,
width
,
width
,
-
M_PI
*
(
angle1
+
angle2
)
/
180
,
-
M_PI
*
angle1
/
180
);
if
(
type
==
flow_eDrawType_LineDashed
||
type
==
flow_eDrawType_LineDashedRed
)
{
QPen
pen
=
painter
->
pen
();
pen
.
setStyle
(
Qt
::
SolidLine
);
painter
->
setPen
(
pen
);
}
return
1
;
}
int
FlowPrintDrawQt
::
line
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
flow_eDrawType
type
,
double
idx
,
int
highlight
)
{
QPen
pen
;
switch
(
type
)
{
case
flow_eDrawType_LineGray
:
pen
=
QPen
(
QColor
::
fromRgbF
(
0.7
,
0.7
,
0.7
));
break
;
case
flow_eDrawType_LineRed
:
case
flow_eDrawType_LineDashedRed
:
pen
=
QPen
(
QColor
::
fromRgbF
(
1
,
0
,
0
));
break
;
default:
pen
=
QPen
(
QColor
::
fromRgbF
(
0
,
0
,
0
));
break
;
}
if
(
type
==
flow_eDrawType_LineDashed
||
type
==
flow_eDrawType_LineDashedRed
)
{
QVector
<
double
>
dashes
;
dashes
<<
4
<<
2
;
pen
.
setDashPattern
(
dashes
);
}
pen
.
setWidth
(
0.5
*
idx
);
painter
->
setPen
(
pen
);
painter
->
drawLine
(
print_margin_x
+
x1
-
page_x
,
print_margin_y
+
y1
-
page_y
,
print_margin_x
+
x2
-
page_x
,
print_margin_y
+
y2
-
page_y
);
if
(
type
==
flow_eDrawType_LineDashed
||
type
==
flow_eDrawType_LineDashedRed
)
{
QPen
pen
=
painter
->
pen
();
pen
.
setStyle
(
Qt
::
SolidLine
);
painter
->
setPen
(
pen
);
}
return
1
;
}
int
FlowPrintDrawQt
::
text
(
double
x
,
double
y
,
char
*
text
,
int
len
,
flow_eDrawType
type
,
double
size
,
int
line
)
{
QFont
font
;
switch
(
type
)
{
case
flow_eDrawType_TextHelvetica
:
font
=
QFont
(
fl
(
"Lucida Sans"
),
-
1
);
break
;
case
flow_eDrawType_TextHelveticaBold
:
font
=
QFont
(
fl
(
"Lucida Sans"
),
-
1
,
QFont
::
Bold
);
break
;
default:
;
}
font
.
setPointSizeF
(
size
);
char
*
s
;
for
(
s
=
text
;
*
s
;
s
++
)
{
if
(
*
s
==
10
)
{
break
;
}
}
if
(
s
-
text
>
0
)
{
QString
textutf8
=
QString
::
fromLatin1
(
text
,
s
-
text
);
painter
->
setFont
(
font
);
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
0
,
0
,
0
)));
painter
->
drawText
(
print_margin_x
+
x
-
page_x
,
print_margin_y
+
y
-
page_y
,
textutf8
);
}
return
1
;
}
int
FlowPrintDrawQt
::
pixmap
(
double
x
,
double
y
,
flow_sPixmapDataElem
*
data
,
flow_eDrawType
type
)
{
float
scale
=
0.7
;
painter
->
scale
(
scale
,
scale
);
painter
->
drawPixmap
((
print_margin_x
+
x
-
page_x
)
/
scale
,
(
print_margin_y
+
y
-
page_y
)
/
scale
,
*
((
QPixmap
*
)
data
));
painter
->
scale
(
1.0
/
scale
,
1.0
/
scale
);
return
1
;
}
int
FlowPrintDrawQt
::
image
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_tImImage
image
,
flow_eDrawType
type
)
{
float
scale
=
width
/
((
QImage
*
)
image
)
->
width
();
painter
->
scale
(
scale
,
scale
);
painter
->
drawImage
((
print_margin_x
+
x
-
page_x
)
/
scale
,
(
print_margin_y
+
y
-
page_y
)
/
scale
,
*
((
QImage
*
)
image
));
painter
->
scale
(
1.0
/
scale
,
1.0
/
scale
);
return
1
;
}
int
FlowPrintDrawQt
::
arrow
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
x3
,
double
y3
,
flow_eDrawType
type
,
double
idx
)
{
switch
(
type
)
{
case
flow_eDrawType_LineRed
:
painter
->
setPen
(
QColor
::
fromRgbF
(
1
,
0
,
0
));
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
1
,
0
,
0
)));
break
;
case
flow_eDrawType_LineGray
:
painter
->
setPen
(
QColor
::
fromRgbF
(
0.7
,
0.7
,
0.7
));
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
0.7
,
0.7
,
0.7
)));
break
;
default:
painter
->
setPen
(
QColor
::
fromRgbF
(
0
,
0
,
0
));
painter
->
setBrush
(
QBrush
(
QColor
::
fromRgbF
(
0
,
0
,
0
)));
break
;
}
QPainterPath
path
;
path
.
moveTo
(
print_margin_x
+
x1
-
page_x
,
print_margin_y
+
y1
-
page_y
);
path
.
lineTo
(
print_margin_x
+
x2
-
page_x
,
print_margin_y
+
y2
-
page_y
);
path
.
lineTo
(
print_margin_x
+
x3
-
page_x
,
print_margin_y
+
y3
-
page_y
);
path
.
lineTo
(
print_margin_x
+
x1
-
page_x
,
print_margin_y
+
y1
-
page_y
);
painter
->
fillPath
(
path
,
painter
->
brush
());
return
1
;
}
\ No newline at end of file
xtt/lib/flow/qt/flow_printdraw_qt.h
deleted
100644 → 0
View file @
44eea749
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2018 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef flow_printdraw_qt_h
#define flow_printdraw_qt_h
#include "flow_printdraw.h"
#include <QPainter>
class
FlowPrintDrawQt
:
public
FlowPrintDraw
{
public:
FlowPrintDrawQt
(
void
*
context
,
const
char
*
title
,
int
page
,
void
*
flow_ctx
,
int
page_border
,
int
*
sts
);
~
FlowPrintDrawQt
();
int
print_page
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
);
int
rect
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_eDrawType
type
,
double
idx
,
int
highlight
);
int
filled_rect
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_eDrawType
type
,
double
idx
);
int
arc
(
double
x
,
double
y
,
double
width
,
double
height
,
int
angle1
,
int
angle2
,
flow_eDrawType
type
,
double
idx
,
int
highlight
);
int
line
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
flow_eDrawType
type
,
double
idx
,
int
highlight
);
int
text
(
double
x
,
double
y
,
char
*
text
,
int
len
,
flow_eDrawType
type
,
double
size
,
int
line
);
int
pixmap
(
double
x
,
double
y
,
flow_sPixmapDataElem
*
data
,
flow_eDrawType
type
);
int
image
(
double
x
,
double
y
,
double
width
,
double
height
,
flow_tImImage
image
,
flow_eDrawType
type
);
int
arrow
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
double
x3
,
double
y3
,
flow_eDrawType
type
,
double
idx
);
void
set_showred
(
int
show
)
{
show_red
=
show
;
}
QPainter
*
painter
;
int
border
;
FlowCtx
*
ctx
;
int
show_red
;
double
page_x
;
double
page_y
;
char
title
[
80
];
int
page
;
};
#endif
\ No newline at end of file
xtt/lib/xtt/qt/xtt_clog_qt.cqt
View file @
9f0278a2
...
...
@@ -353,8 +353,7 @@ void CLogQt::print()
strcat(title, nodename);
}
wow->CreateBrowPrintDialog(title, clognav->brow->ctx,
flow_eOrientation_Landscape, 1.0, toplevel, &sts);
sts = CoWowQt::CreateBrowPrintDialogQt(title, clognav->brow->ctx, clognav_widget);
if (sts == WOW__PRINTDIALOGDISABLED) {
wow->DisplayError("Disabled", "Print Dialog is disabled");
}
...
...
xtt/lib/xtt/qt/xtt_evlist_qt.cpp
View file @
9f0278a2
...
...
@@ -103,8 +103,7 @@ void EvListQt::print(const char* title)
strcat
(
print_title
,
nodename
);
}
CoWowQt
::
CreateBrowPrintDialogQt
(
print_title
,
brow
->
ctx
,
flow_eOrientation_Landscape
,
1.0
,
form_widget
,
&
sts
);
sts
=
CoWowQt
::
CreateBrowPrintDialogQt
(
print_title
,
brow
->
ctx
,
brow_widget
);
if
(
sts
==
WOW__PRINTDIALOGDISABLED
)
{
pwr_tFileName
filename
;
pwr_tCmd
cmd
;
...
...
xtt/lib/xtt/qt/xtt_trace_qt.cqt
View file @
9f0278a2
...
...
@@ -63,10 +63,7 @@
void RtTraceQtWidget::activate_print()
{
pwr_tStatus sts;
CoWowQt::CreateFlowPrintDialogQt(
"Trace", rt->flow_ctx, flow_eOrientation_Landscape, 1.0, this, &sts);
CoWowQt::CreateFlowPrintDialogQt("Trace", rt->flow_ctx, rt->flow_widget);
}
void RtTraceQtWidget::activate_printselect()
...
...
xtt/lib/xtt/qt/xtt_xatt_qt.cqt
View file @
9f0278a2
...
...
@@ -323,14 +323,12 @@ void XAttQt::pop()
void XAttQt::print()
{
pwr_tAName title;
pwr_tStatus sts = gdh_AttrrefToName(&objar, title, sizeof(title), cdh_mNName);
if (EVEN(sts)) {
return;
}
CoWowQt::CreateBrowPrintDialogQt(title, xattnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, xattnav->brow->ctx, brow_widget);
}
void XAttQtWidget::closeEvent(QCloseEvent* event)
...
...
xtt/lib/xtt/qt/xtt_xcolwind_qt.cqt
View file @
9f0278a2
...
...
@@ -403,10 +403,7 @@ void XColWindQt::get_window_size(int* w, int* h)
void XColWindQt::print()
{
pwr_tStatus sts;
wow->CreateBrowPrintDialog(title, xattnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, xattnav->brow->ctx, brow_widget);
}
void XColWindQtWidget::closeEvent(QCloseEvent* event)
...
...
xtt/lib/xtt/qt/xtt_xcrr_qt.cqt
View file @
9f0278a2
...
...
@@ -86,16 +86,13 @@ void XCrrQt::pop()
void XCrrQt::print()
{
pwr_tStatus sts;
pwr_tAName title;
sts = gdh_AttrrefToName(&objar, title, sizeof(title), cdh_mNName);
pwr_tStatus sts = gdh_AttrrefToName(&objar, title, sizeof(title), cdh_mNName);
if (EVEN(sts)) {
return;
}
CoWowQt::CreateBrowPrintDialogQt(title, xcrrnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, toplevel, &sts);
CoWowQt::CreateBrowPrintDialogQt(title, xcrrnav->brow->ctx, brow_widget);
}
void XCrrQtWidget::closeEvent(QCloseEvent* event)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment