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
3d0816e4
Commit
3d0816e4
authored
Apr 18, 2018
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge script FindObjectByName() and SetObjectText() added
parent
726de6ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
xtt/lib/ge/src/ge_graph_command.cpp
xtt/lib/ge/src/ge_graph_command.cpp
+69
-0
No files found.
xtt/lib/ge/src/ge_graph_command.cpp
View file @
3d0816e4
...
...
@@ -4255,6 +4255,71 @@ static int graph_getobjecttext_func(
return
1
;
}
static
int
graph_setobjecttext_func
(
void
*
filectx
,
ccm_sArg
*
arg_list
,
int
arg_count
,
int
*
return_decl
,
ccm_tFloat
*
return_float
,
ccm_tInt
*
return_int
,
char
*
return_string
)
{
Graph
*
graph
;
int
type
;
grow_tObject
o
;
ccm_sArg
*
arg_p2
;
// Text
if
(
arg_count
!=
2
)
return
CCM__ARGMISM
;
arg_p2
=
arg_list
->
next
;
if
(
arg_list
->
value_decl
!=
CCM_DECL_INT
)
return
CCM__ARGMISM
;
if
(
arg_p2
->
value_decl
!=
CCM_DECL_STRING
)
return
CCM__ARGMISM
;
o
=
(
grow_tObject
)
arg_list
->
value_int
;
graph_get_stored_graph
(
&
graph
);
type
=
grow_GetObjectType
(
o
);
if
(
type
==
glow_eObjectType_GrowText
)
{
grow_SetObjectText
(
o
,
arg_p2
->
value_string
);
}
return
1
;
}
static
int
graph_findobjectbyname_func
(
void
*
filectx
,
ccm_sArg
*
arg_list
,
int
arg_count
,
int
*
return_decl
,
ccm_tFloat
*
return_float
,
ccm_tInt
*
return_int
,
char
*
return_string
)
{
Graph
*
graph
;
grow_tObject
object
;
int
sts
;
if
(
arg_count
!=
1
)
return
CCM__ARGMISM
;
if
(
arg_list
->
value_decl
!=
CCM_DECL_STRING
)
return
CCM__ARGMISM
;
graph_get_stored_graph
(
&
graph
);
sts
=
grow_FindObjectByName
(
graph
->
grow
->
ctx
,
arg_list
->
value_string
,
&
object
);
if
(
ODD
(
sts
))
*
return_int
=
(
long
int
)
object
;
else
*
return_int
=
0
;
*
return_decl
=
CCM_DECL_INT
;
return
1
;
}
static
int
graph_reload_func
(
void
*
filectx
,
ccm_sArg
*
arg_list
,
...
...
@@ -5205,6 +5270,10 @@ int Graph::readcmdfile( char *incommand)
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"Ge"
,
"GetObjectText"
,
graph_getobjecttext_func
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"Ge"
,
"SetObjectText"
,
graph_setobjecttext_func
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"Ge"
,
"FindObjectByName"
,
graph_findobjectbyname_func
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"Ge"
,
"Reload"
,
graph_reload_func
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"Ge"
,
"SetObjectAttribute"
,
graph_setobjectattribute_func
);
...
...
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