setCommitOnReturn moved to from llbutton to lluictrl, cleanup some focus/key handling, avoid needless reshape calls.

This commit is contained in:
Shyotl
2013-10-26 18:12:56 -05:00
parent 30c5b9514e
commit edf75a7174
5 changed files with 52 additions and 53 deletions

View File

@@ -56,7 +56,8 @@ LLUICtrl::LLUICtrl() :
mDoubleClickSignal(NULL),
mTentative(FALSE),
mTabStop(TRUE),
mIsChrome(FALSE)
mIsChrome(FALSE),
mCommitOnReturn(FALSE)
{
}
@@ -78,7 +79,8 @@ LLUICtrl::LLUICtrl(const std::string& name, const LLRect rect, BOOL mouse_opaque
mDoubleClickSignal(NULL),
mTentative( FALSE ),
mTabStop( TRUE ),
mIsChrome(FALSE)
mIsChrome(FALSE),
mCommitOnReturn(FALSE)
{
if(commit_callback)
setCommitCallback(commit_callback);
@@ -178,6 +180,13 @@ BOOL LLUICtrl::handleDoubleClick(S32 x, S32 y, MASK mask)
return handled;
}
// can't tab to children of a non-tab-stop widget
BOOL LLUICtrl::canFocusChildren() const
{
return TRUE;//hasTabStop();
}
void LLUICtrl::onCommit()
{
if (mCommitSignal)
@@ -528,7 +537,8 @@ BOOL LLUICtrl::focusNextItem(BOOL text_fields_only)
{
// this assumes that this method is called on the focus root.
LLCtrlQuery query = getTabOrderQuery();
if(text_fields_only || LLUI::sConfigGroup->getBOOL("TabToTextFieldsOnly"))
static LLUICachedControl<bool> tab_to_text_fields_only ("TabToTextFieldsOnly", false);
if(text_fields_only || tab_to_text_fields_only)
{
query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance());
}
@@ -540,7 +550,8 @@ BOOL LLUICtrl::focusPrevItem(BOOL text_fields_only)
{
// this assumes that this method is called on the focus root.
LLCtrlQuery query = getTabOrderQuery();
if(text_fields_only || LLUI::sConfigGroup->getBOOL("TabToTextFieldsOnly"))
static LLUICachedControl<bool> tab_to_text_fields_only ("TabToTextFieldsOnly", false);
if(text_fields_only || tab_to_text_fields_only)
{
query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance());
}
@@ -552,7 +563,7 @@ LLUICtrl* LLUICtrl::findRootMostFocusRoot()
{
LLUICtrl* focus_root = NULL;
LLUICtrl* next_view = this;
while(next_view)
while(next_view/* && next_view->hasTabStop()*/)
{
if (next_view->isFocusRoot())
{