Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
75ee0127
Commit
75ee0127
authored
7 years ago
by
andreykproductengine
Browse files
Options
Downloads
Patches
Plain Diff
MAINT-1614 Fixed Object changed its position inworld but value in Edit tool was not changed
parent
65208b77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llui/llspinctrl.cpp
+26
-0
26 additions, 0 deletions
indra/llui/llspinctrl.cpp
indra/llui/llspinctrl.h
+1
-0
1 addition, 0 deletions
indra/llui/llspinctrl.h
with
27 additions
and
0 deletions
indra/llui/llspinctrl.cpp
+
26
−
0
View file @
75ee0127
...
...
@@ -130,6 +130,7 @@ LLSpinCtrl::LLSpinCtrl(const LLSpinCtrl::Params& p)
params
.
follows
.
flags
(
FOLLOWS_LEFT
|
FOLLOWS_BOTTOM
);
mEditor
=
LLUICtrlFactory
::
create
<
LLLineEditor
>
(
params
);
mEditor
->
setFocusReceivedCallback
(
boost
::
bind
(
&
LLSpinCtrl
::
onEditorGainFocus
,
_1
,
this
));
mEditor
->
setFocusLostCallback
(
boost
::
bind
(
&
LLSpinCtrl
::
onEditorLostFocus
,
_1
,
this
));
if
(
p
.
allow_digits_only
)
{
mEditor
->
setPrevalidateInput
(
LLTextValidate
::
validateNonNegativeS32NoSpace
);
...
...
@@ -239,6 +240,31 @@ void LLSpinCtrl::onEditorGainFocus( LLFocusableElement* caller, void *userdata )
self
->
onFocusReceived
();
}
// static
void
LLSpinCtrl
::
onEditorLostFocus
(
LLFocusableElement
*
caller
,
void
*
userdata
)
{
LLSpinCtrl
*
self
=
(
LLSpinCtrl
*
)
userdata
;
llassert
(
caller
==
self
->
mEditor
);
self
->
onFocusLost
();
std
::
string
text
=
self
->
mEditor
->
getText
();
LLLocale
locale
(
LLLocale
::
USER_LOCALE
);
F32
val
=
(
F32
)
atof
(
text
.
c_str
());
F32
saved_val
=
self
->
getValueF32
();
if
(
saved_val
!=
val
&&
!
self
->
mEditor
->
isDirty
())
{
// Editor was focused when value update arrived, string
// in editor is different from one in spin control.
// Since editor is not dirty, it won't commit, so either
// attempt to commit value from editor or revert to a more
// recent value from spin control
self
->
updateEditor
();
}
}
void
LLSpinCtrl
::
setValue
(
const
LLSD
&
value
)
{
F32
v
=
(
F32
)
value
.
asReal
();
...
...
This diff is collapsed.
Click to expand it.
indra/llui/llspinctrl.h
+
1
−
0
View file @
75ee0127
...
...
@@ -93,6 +93,7 @@ class LLSpinCtrl
void
onEditorCommit
(
const
LLSD
&
data
);
static
void
onEditorGainFocus
(
LLFocusableElement
*
caller
,
void
*
userdata
);
static
void
onEditorLostFocus
(
LLFocusableElement
*
caller
,
void
*
userdata
);
static
void
onEditorChangeFocus
(
LLUICtrl
*
caller
,
S32
direction
,
void
*
userdata
);
void
onUpBtn
(
const
LLSD
&
data
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment