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
c603c3c1
Commit
c603c3c1
authored
May 20, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Max and Min values connectable
parent
85845255
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
57 deletions
+104
-57
xtt/lib/glow/src/glow_growapi.cpp
xtt/lib/glow/src/glow_growapi.cpp
+5
-0
xtt/lib/glow/src/glow_growapi.h
xtt/lib/glow/src/glow_growapi.h
+7
-0
xtt/lib/glow/src/glow_growaxis.cpp
xtt/lib/glow/src/glow_growaxis.cpp
+77
-57
xtt/lib/glow/src/glow_growbar.cpp
xtt/lib/glow/src/glow_growbar.cpp
+9
-0
xtt/lib/glow/src/glow_growbar.h
xtt/lib/glow/src/glow_growbar.h
+6
-0
No files found.
xtt/lib/glow/src/glow_growapi.cpp
View file @
c603c3c1
...
@@ -4172,6 +4172,11 @@ void grow_SetBarInfo( grow_tObject object, glow_sBarInfo *info)
...
@@ -4172,6 +4172,11 @@ void grow_SetBarInfo( grow_tObject object, glow_sBarInfo *info)
((
GrowBar
*
)
object
)
->
set_bar_info
(
info
);
((
GrowBar
*
)
object
)
->
set_bar_info
(
info
);
}
}
void
grow_GetBarInfo
(
grow_tObject
object
,
glow_sBarInfo
*
info
)
{
((
GrowBar
*
)
object
)
->
get_bar_info
(
info
);
}
void
grow_SetAxisInfo
(
grow_tObject
object
,
glow_sAxisInfo
*
info
)
void
grow_SetAxisInfo
(
grow_tObject
object
,
glow_sAxisInfo
*
info
)
{
{
((
GrowAxis
*
)
object
)
->
set_axis_info
(
info
);
((
GrowAxis
*
)
object
)
->
set_axis_info
(
info
);
...
...
xtt/lib/glow/src/glow_growapi.h
View file @
c603c3c1
...
@@ -2694,6 +2694,13 @@ typedef GlowTraceData glow_sTraceData;
...
@@ -2694,6 +2694,13 @@ typedef GlowTraceData glow_sTraceData;
*/
*/
void
grow_SetBarInfo
(
grow_tObject
object
,
glow_sBarInfo
*
info
);
void
grow_SetBarInfo
(
grow_tObject
object
,
glow_sBarInfo
*
info
);
//! Get parameters for a bar object.
/*!
\param object Bar object.
\param info Info struct.
*/
void
grow_GetBarInfo
(
grow_tObject
object
,
glow_sBarInfo
*
info
);
//! Set parameters for an axis object.
//! Set parameters for an axis object.
/*!
/*!
\param object Axis object.
\param object Axis object.
...
...
xtt/lib/glow/src/glow_growaxis.cpp
View file @
c603c3c1
...
@@ -208,6 +208,7 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -208,6 +208,7 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
if
(
ctx
->
nodraw
)
if
(
ctx
->
nodraw
)
return
;
return
;
int
i
;
int
i
;
int
draw_text
=
(
increment
>
0
);
int
idx
;
int
idx
;
int
x
,
y
;
int
x
,
y
;
char
text
[
20
];
char
text
[
20
];
...
@@ -275,23 +276,27 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -275,23 +276,27 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
glow_draw_line
(
ctx
,
ur_x
,
ll_y
,
ur_x
,
ur_y
,
drawtype
,
idx
,
0
);
glow_draw_line
(
ctx
,
ur_x
,
ll_y
,
ur_x
,
ur_y
,
drawtype
,
idx
,
0
);
// Calculate max value text width
// Calculate max value text width
for
(
i
=
0
;
i
<
lines
;
i
++
)
if
(
draw_text
)
{
{
for
(
i
=
0
;
i
<
lines
;
i
++
)
{
if
(
i
%
valuequotient
==
0
)
{
if
(
i
%
valuequotient
==
0
)
{
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
draw_get_text_extent
(
ctx
,
text
,
strlen
(
text
),
text_drawtype
,
draw_get_text_extent
(
ctx
,
text
,
strlen
(
text
),
text_drawtype
,
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
if
(
max_z_width
<
z_width
)
if
(
max_z_width
<
z_width
)
max_z_width
=
z_width
;
max_z_width
=
z_width
;
}
}
}
x_text
=
ll_x
+
max_z_width
;
line_length
=
ur_x
-
ll_x
-
max_z_width
;
if
(
line_length
<
3
)
line_length
=
3
;
}
else
{
x_text
=
ll_x
;
line_length
=
ur_x
-
ll_x
;
}
}
x_text
=
ll_x
+
max_z_width
;
line_length
=
ur_x
-
ll_x
-
max_z_width
;
if
(
line_length
<
3
)
line_length
=
3
;
for
(
i
=
0
;
i
<
lines
;
i
++
)
for
(
i
=
0
;
i
<
lines
;
i
++
)
{
{
y
=
int
(
ll_y
+
double
(
ur_y
-
ll_y
)
/
(
lines
-
1
)
*
i
);
y
=
int
(
ll_y
+
double
(
ur_y
-
ll_y
)
/
(
lines
-
1
)
*
i
);
if
(
i
%
longquotient
==
0
)
if
(
i
%
longquotient
==
0
)
glow_draw_line
(
ctx
,
ur_x
-
line_length
,
y
,
glow_draw_line
(
ctx
,
ur_x
-
line_length
,
y
,
...
@@ -299,18 +304,20 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -299,18 +304,20 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
else
else
glow_draw_line
(
ctx
,
ur_x
-
int
(
2.0
/
3
*
line_length
),
y
,
glow_draw_line
(
ctx
,
ur_x
-
int
(
2.0
/
3
*
line_length
),
y
,
ur_x
,
y
,
drawtype
,
idx
,
0
);
ur_x
,
y
,
drawtype
,
idx
,
0
);
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
if
(
draw_text
)
{
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
if
(
text_idx
>=
0
&&
max_z_width
<
ur_x
-
ll_x
&&
i
%
valuequotient
==
0
)
{
if
(
text_idx
>=
0
&&
max_z_width
<
ur_x
-
ll_x
&&
if
(
i
==
lines
-
1
)
i
%
valuequotient
==
0
)
{
y_text
=
y
;
if
(
i
==
lines
-
1
)
else
if
(
i
==
0
)
y_text
=
y
;
y_text
=
y
+
z_height
-
z_descent
-
3
;
else
if
(
i
==
0
)
else
y_text
=
y
+
z_height
-
z_descent
-
3
;
y_text
=
y
+
(
z_height
-
z_descent
)
/
2
;
else
glow_draw_text
(
ctx
,
ll_x
,
y_text
,
y_text
=
y
+
(
z_height
-
z_descent
)
/
2
;
text
,
strlen
(
text
),
text_drawtype
,
text_color_drawtype
,
text_idx
,
highlight
,
0
);
glow_draw_text
(
ctx
,
ll_x
,
y_text
,
text
,
strlen
(
text
),
text_drawtype
,
text_color_drawtype
,
text_idx
,
highlight
,
0
);
}
}
}
}
}
}
}
...
@@ -321,15 +328,19 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -321,15 +328,19 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
glow_draw_line
(
ctx
,
ll_x
,
ur_y
,
ur_x
,
ur_y
,
drawtype
,
idx
,
0
);
glow_draw_line
(
ctx
,
ll_x
,
ur_y
,
ur_x
,
ur_y
,
drawtype
,
idx
,
0
);
// Calculate max value text height
// Calculate max value text height
draw_get_text_extent
(
ctx
,
"0"
,
1
,
text_drawtype
,
if
(
draw_text
)
{
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
draw_get_text_extent
(
ctx
,
"0"
,
1
,
text_drawtype
,
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
line_length
=
ur_y
-
ll_y
-
z_height
;
line_length
=
ur_y
-
ll_y
-
z_height
;
if
(
line_length
<
3
)
if
(
line_length
<
3
)
line_length
=
3
;
line_length
=
3
;
}
else
{
line_length
=
ur_y
-
ll_y
;
}
for
(
i
=
0
;
i
<
lines
;
i
++
)
for
(
i
=
0
;
i
<
lines
;
i
++
)
{
{
x
=
int
(
ll_x
+
double
(
ur_x
-
ll_x
)
/
(
lines
-
1
)
*
(
lines
-
1
-
i
));
x
=
int
(
ll_x
+
double
(
ur_x
-
ll_x
)
/
(
lines
-
1
)
*
(
lines
-
1
-
i
));
if
(
i
%
longquotient
==
0
)
if
(
i
%
longquotient
==
0
)
glow_draw_line
(
ctx
,
x
,
ur_y
-
line_length
,
x
,
glow_draw_line
(
ctx
,
x
,
ur_y
-
line_length
,
x
,
...
@@ -338,7 +349,7 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -338,7 +349,7 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
glow_draw_line
(
ctx
,
x
,
ur_y
-
int
(
2.0
/
3
*
line_length
),
x
,
glow_draw_line
(
ctx
,
x
,
ur_y
-
int
(
2.0
/
3
*
line_length
),
x
,
ur_y
,
drawtype
,
idx
,
0
);
ur_y
,
drawtype
,
idx
,
0
);
if
(
i
%
valuequotient
==
0
)
{
if
(
draw_text
&&
i
%
valuequotient
==
0
)
{
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
draw_get_text_extent
(
ctx
,
text
,
strlen
(
text
),
text_drawtype
,
draw_get_text_extent
(
ctx
,
text
,
strlen
(
text
),
text_drawtype
,
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
...
@@ -363,23 +374,27 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -363,23 +374,27 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
glow_draw_line
(
ctx
,
ll_x
,
ll_y
,
ll_x
,
ur_y
,
drawtype
,
idx
,
0
);
glow_draw_line
(
ctx
,
ll_x
,
ll_y
,
ll_x
,
ur_y
,
drawtype
,
idx
,
0
);
// Calculate max value text width
// Calculate max value text width
for
(
i
=
0
;
i
<
lines
;
i
++
)
if
(
draw_text
)
{
{
for
(
i
=
0
;
i
<
lines
;
i
++
)
{
if
(
i
%
valuequotient
==
0
)
{
if
(
i
%
valuequotient
==
0
)
{
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
draw_get_text_extent
(
ctx
,
text
,
strlen
(
text
),
text_drawtype
,
draw_get_text_extent
(
ctx
,
text
,
strlen
(
text
),
text_drawtype
,
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
if
(
max_z_width
<
z_width
)
if
(
max_z_width
<
z_width
)
max_z_width
=
z_width
;
max_z_width
=
z_width
;
}
}
}
x_text
=
ur_x
-
max_z_width
;
line_length
=
ur_x
-
ll_x
-
max_z_width
;
if
(
line_length
<
3
)
line_length
=
3
;
}
else
{
x_text
=
ur_x
;
line_length
=
ur_x
-
ll_x
;
}
}
x_text
=
ur_x
-
max_z_width
;
line_length
=
ur_x
-
ll_x
-
max_z_width
;
if
(
line_length
<
3
)
line_length
=
3
;
for
(
i
=
0
;
i
<
lines
;
i
++
)
for
(
i
=
0
;
i
<
lines
;
i
++
)
{
{
y
=
int
(
ll_y
+
double
(
ur_y
-
ll_y
)
/
(
lines
-
1
)
*
(
lines
-
1
-
i
));
y
=
int
(
ll_y
+
double
(
ur_y
-
ll_y
)
/
(
lines
-
1
)
*
(
lines
-
1
-
i
));
if
(
i
%
longquotient
==
0
)
if
(
i
%
longquotient
==
0
)
glow_draw_line
(
ctx
,
ll_x
,
y
,
glow_draw_line
(
ctx
,
ll_x
,
y
,
...
@@ -389,7 +404,8 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -389,7 +404,8 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
ll_x
+
int
(
2.0
/
3
*
line_length
),
y
,
drawtype
,
idx
,
0
);
ll_x
+
int
(
2.0
/
3
*
line_length
),
y
,
drawtype
,
idx
,
0
);
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
if
(
text_idx
>=
0
&&
max_z_width
<
ur_x
-
ll_x
&&
if
(
draw_text
&&
text_idx
>=
0
&&
max_z_width
<
ur_x
-
ll_x
&&
i
%
valuequotient
==
0
)
{
i
%
valuequotient
==
0
)
{
if
(
i
==
lines
-
1
)
if
(
i
==
lines
-
1
)
y_text
=
y
+
z_height
-
z_descent
-
3
;
y_text
=
y
+
z_height
-
z_descent
-
3
;
...
@@ -409,15 +425,19 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -409,15 +425,19 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
glow_draw_line
(
ctx
,
ll_x
,
ll_y
,
ur_x
,
ll_y
,
drawtype
,
idx
,
0
);
glow_draw_line
(
ctx
,
ll_x
,
ll_y
,
ur_x
,
ll_y
,
drawtype
,
idx
,
0
);
// Calculate max value text height
// Calculate max value text height
draw_get_text_extent
(
ctx
,
"0"
,
1
,
text_drawtype
,
if
(
draw_text
)
{
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
draw_get_text_extent
(
ctx
,
"0"
,
1
,
text_drawtype
,
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
line_length
=
ur_y
-
ll_y
-
(
z_height
-
z_descent
);
line_length
=
ur_y
-
ll_y
-
(
z_height
-
z_descent
);
if
(
line_length
<
3
)
if
(
line_length
<
3
)
line_length
=
3
;
line_length
=
3
;
}
else
{
line_length
=
ur_y
-
ll_y
;
}
for
(
i
=
0
;
i
<
lines
;
i
++
)
for
(
i
=
0
;
i
<
lines
;
i
++
)
{
{
x
=
int
(
ll_x
+
double
(
ur_x
-
ll_x
)
/
(
lines
-
1
)
*
i
);
x
=
int
(
ll_x
+
double
(
ur_x
-
ll_x
)
/
(
lines
-
1
)
*
i
);
if
(
i
%
longquotient
==
0
)
if
(
i
%
longquotient
==
0
)
glow_draw_line
(
ctx
,
x
,
ll_y
,
x
,
glow_draw_line
(
ctx
,
x
,
ll_y
,
x
,
...
@@ -425,7 +445,7 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -425,7 +445,7 @@ void GrowAxis::draw( GlowTransform *t, int highlight, int hot, void *node,
else
else
glow_draw_line
(
ctx
,
x
,
ll_y
,
x
,
glow_draw_line
(
ctx
,
x
,
ll_y
,
x
,
ll_y
+
int
(
2.0
/
3
*
line_length
),
drawtype
,
idx
,
0
);
ll_y
+
int
(
2.0
/
3
*
line_length
),
drawtype
,
idx
,
0
);
if
(
i
%
valuequotient
==
0
)
{
if
(
draw_text
&&
i
%
valuequotient
==
0
)
{
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
sprintf
(
text
,
format
,
max_value
-
i
*
increment
);
draw_get_text_extent
(
ctx
,
text
,
strlen
(
text
),
text_drawtype
,
draw_get_text_extent
(
ctx
,
text
,
strlen
(
text
),
text_drawtype
,
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
max
(
0
,
text_idx
),
&
z_width
,
&
z_height
,
&
z_descent
);
...
...
xtt/lib/glow/src/glow_growbar.cpp
View file @
c603c3c1
...
@@ -751,6 +751,15 @@ void GrowBar::set_bar_info( glow_sBarInfo *info)
...
@@ -751,6 +751,15 @@ void GrowBar::set_bar_info( glow_sBarInfo *info)
bar_borderwidth
=
info
->
bar_borderwidth
;
bar_borderwidth
=
info
->
bar_borderwidth
;
}
}
void
GrowBar
::
get_bar_info
(
glow_sBarInfo
*
info
)
{
info
->
max_value
=
max_value
;
info
->
min_value
=
min_value
;
info
->
bar_drawtype
=
bar_drawtype
;
info
->
bar_bordercolor
=
bar_bordercolor
;
info
->
bar_borderwidth
=
bar_borderwidth
;
}
void
GrowBar
::
convert
(
glow_eConvert
version
)
void
GrowBar
::
convert
(
glow_eConvert
version
)
{
{
switch
(
version
)
{
switch
(
version
)
{
...
...
xtt/lib/glow/src/glow_growbar.h
View file @
c603c3c1
...
@@ -216,6 +216,12 @@ class GrowBar : public GrowRect {
...
@@ -216,6 +216,12 @@ class GrowBar : public GrowRect {
*/
*/
void
set_bar_info
(
glow_sBarInfo
*
info
);
void
set_bar_info
(
glow_sBarInfo
*
info
);
//! Get parameters for the bar.
/*!
\param info Info struct.
*/
void
get_bar_info
(
glow_sBarInfo
*
info
);
//! Export the object as a javabean.
//! Export the object as a javabean.
/*!
/*!
\param t Transform of parent node. Can be zero.
\param t Transform of parent node. Can be zero.
...
...
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