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
79303141
Commit
79303141
authored
Dec 09, 2009
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wb: Default name for created objects in wtt fetched from name of previous sibling
parent
991cb749
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
132 additions
and
2 deletions
+132
-2
src/lib/co/src/co_cdh.c
src/lib/co/src/co_cdh.c
+43
-0
src/lib/co/src/co_cdh.h
src/lib/co/src/co_cdh.h
+2
-0
wb/lib/wb/src/wb_wnav.cpp
wb/lib/wb/src/wb_wnav.cpp
+23
-0
wb/lib/wb/src/wb_wtt.cpp
wb/lib/wb/src/wb_wtt.cpp
+61
-1
xtt/changelog.txt
xtt/changelog.txt
+3
-1
No files found.
src/lib/co/src/co_cdh.c
View file @
79303141
...
...
@@ -2816,6 +2816,49 @@ cdh_StringToObjectName (
return
rs
;
}
//! Create an similar objectname from another object name.
/*!
Converts an object name consisting of a number at the end of the name, The
number is incremented by 1 in the new name. If no number is found error status
is returned.
\param t Out string.
\param s In string.
\return Status.
*/
pwr_tStatus
cdh_NextObjectName
(
char
*
t
,
const
char
*
s
)
{
int
i
;
int
num
;
int
len
=
strlen
(
s
);
char
name
[
80
];
for
(
i
=
len
-
1
;
i
>=
0
;
i
--
)
{
if
(
isdigit
(
s
[
i
])
==
0
)
break
;
}
if
(
i
==
len
-
1
)
return
CDH__NONAME
;
strncpy
(
name
,
s
,
i
+
1
);
sscanf
(
&
s
[
i
+
1
],
"%d"
,
&
num
);
num
++
;
if
(
s
[
i
+
1
]
==
'0'
)
sprintf
(
&
name
[
i
+
1
],
"%0*d"
,
len
-
i
-
1
,
num
);
else
sprintf
(
&
name
[
i
+
1
],
"%d"
,
num
);
if
(
strlen
(
name
)
>
sizeof
(
pwr_tObjName
)
-
1
)
return
CDH__NAMELEN
;
strcpy
(
t
,
name
);
return
CDH__SUCCESS
;
}
/*@}*/
...
...
src/lib/co/src/co_cdh.h
View file @
79303141
...
...
@@ -1039,6 +1039,8 @@ int cdh_TypeToMaxStrSize( pwr_eType type, int attr_size, int attr_elements);
char
*
cdh_StringToObjectName
(
char
*
t
,
const
char
*
s
);
pwr_tStatus
cdh_NextObjectName
(
char
*
t
,
const
char
*
s
);
/*@}*/
#ifdef __cplusplus
...
...
wb/lib/wb/src/wb_wnav.cpp
View file @
79303141
...
...
@@ -1785,6 +1785,7 @@ int WNav::brow_cb( FlowCtx *ctx, flow_tEvent event)
pwr_sAttrRef
*
sel_list
;
int
*
sel_is_attr
;
int
sel_cnt
;
pwr_tOid
prev
;
if
(
wnav
->
get_global_select_cb
)
(
wnav
->
get_global_select_cb
)(
wnav
->
parent_ctx
,
&
sel_list
,
...
...
@@ -1827,6 +1828,28 @@ int WNav::brow_cb( FlowCtx *ctx, flow_tEvent event)
destcode
);
if
(
EVEN
(
sts
))
wnav
->
message
(
' '
,
wnav_get_message
(
sts
));
// Get name from previous sibling
sts
=
ldh_GetPreviousSibling
(
wnav
->
ldhses
,
objid
,
&
prev
);
if
(
ODD
(
sts
))
{
pwr_tObjName
name
;
pwr_tCid
prev_cid
;
int
size
;
sts
=
ldh_GetObjectClass
(
wnav
->
ldhses
,
prev
,
&
prev_cid
);
if
(
EVEN
(
sts
))
break
;
if
(
prev_cid
==
classid
)
{
sts
=
ldh_ObjidToName
(
wnav
->
ldhses
,
prev
,
ldh_eName_Object
,
name
,
sizeof
(
name
),
&
size
);
if
(
EVEN
(
sts
))
break
;
sts
=
cdh_NextObjectName
(
name
,
name
);
if
(
ODD
(
sts
))
sts
=
ldh_SetObjectName
(
wnav
->
ldhses
,
objid
,
name
);
}
}
break
;
default:
;
...
...
wb/lib/wb/src/wb_wtt.cpp
View file @
79303141
...
...
@@ -1008,8 +1008,9 @@ void Wtt::activate_copy()
return
;
}
if
(
sel_cnt
==
1
)
if
(
sel_cnt
==
1
)
{
message
(
'I'
,
"Object copied"
);
}
else
message
(
'I'
,
"Objects copied"
);
...
...
@@ -1095,6 +1096,42 @@ void Wtt::activate_paste()
else
sts
=
ldh_Paste
(
ldhses
,
sel_list2
->
Objid
,
ldh_eDest_After
,
0
,
0
,
0
);
reset_cursor
();
if
(
(
sel_cnt1
==
1
&&
sel_is_attr1
[
0
]
==
0
)
||
(
sel_cnt2
==
1
&&
sel_is_attr2
[
0
]
==
0
))
{
pwr_tOid
oid
;
pwr_tOid
prev
;
if
(
sel_cnt1
)
prev
=
sel_list1
[
0
].
Objid
;
else
prev
=
sel_list2
[
0
].
Objid
;
// Get name from previous sibling
sts
=
ldh_GetNextSibling
(
wnav
->
ldhses
,
prev
,
&
oid
);
if
(
ODD
(
sts
))
{
pwr_tObjName
name
;
pwr_tCid
prev_cid
,
cid
;
int
size
;
sts
=
ldh_GetObjectClass
(
wnav
->
ldhses
,
prev
,
&
prev_cid
);
if
(
EVEN
(
sts
))
return
;
sts
=
ldh_GetObjectClass
(
wnav
->
ldhses
,
oid
,
&
cid
);
if
(
EVEN
(
sts
))
return
;
if
(
prev_cid
==
cid
)
{
sts
=
ldh_ObjidToName
(
wnav
->
ldhses
,
prev
,
ldh_eName_Object
,
name
,
sizeof
(
name
),
&
size
);
if
(
EVEN
(
sts
))
return
;
sts
=
cdh_NextObjectName
(
name
,
name
);
if
(
ODD
(
sts
))
sts
=
ldh_SetObjectName
(
wnav
->
ldhses
,
oid
,
name
);
}
}
}
if
(
sel_cnt1
>
0
)
free
(
(
char
*
)
sel_list1
);
if
(
sel_cnt2
>
0
)
...
...
@@ -1331,6 +1368,29 @@ void Wtt::activate_creaobj( ldh_eDest dest)
else
wnav
->
select_object
(
oid
);
// Get name from previous sibling
pwr_tOid
prev
;
sts
=
ldh_GetPreviousSibling
(
wnav
->
ldhses
,
oid
,
&
prev
);
if
(
ODD
(
sts
))
{
pwr_tObjName
name
;
pwr_tCid
prev_cid
;
int
size
;
sts
=
ldh_GetObjectClass
(
wnav
->
ldhses
,
prev
,
&
prev_cid
);
if
(
EVEN
(
sts
))
return
;
if
(
prev_cid
==
cid
)
{
sts
=
ldh_ObjidToName
(
wnav
->
ldhses
,
prev
,
ldh_eName_Object
,
name
,
sizeof
(
name
),
&
size
);
if
(
EVEN
(
sts
))
return
;
sts
=
cdh_NextObjectName
(
name
,
name
);
if
(
ODD
(
sts
))
sts
=
ldh_SetObjectName
(
wnav
->
ldhses
,
oid
,
name
);
}
}
free
(
(
char
*
)
sel_list
);
free
(
(
char
*
)
sel_is_attr
);
}
...
...
xtt/changelog.txt
View file @
79303141
...
...
@@ -153,4 +153,6 @@
091102 cs ge Menu items for connections changed to radio items.
091103 cs xtt Translation and utf8 conversion of search condition in EventLog window fixed.
091104 cs glow Fixcolor added to arc properties.
091106 cs ge Different ways to show hot object added: linewith, light color, dark color.
\ No newline at end of file
091106 cs ge Different ways to show hot object added: linewith, light color, dark color.
091208 cs xtt New pixmap for weblink in helpwindow.
091208 cs xtt EventSelectList exended to 40 elements.
\ No newline at end of file
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