diff options
Diffstat (limited to 'linden/indra/newview/llfolderview.cpp')
-rw-r--r-- | linden/indra/newview/llfolderview.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index 1007bc4..7bc9cd8 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -90,7 +91,7 @@ void copy_selected_item(void* user_data); | |||
90 | void open_selected_items(void* user_data); | 91 | void open_selected_items(void* user_data); |
91 | void properties_selected_items(void* user_data); | 92 | void properties_selected_items(void* user_data); |
92 | void paste_items(void* user_data); | 93 | void paste_items(void* user_data); |
93 | void top_view_lost( LLView* handler ); | 94 | void renamer_focus_lost( LLUICtrl* handler, void* user_data ); |
94 | 95 | ||
95 | ///---------------------------------------------------------------------------- | 96 | ///---------------------------------------------------------------------------- |
96 | /// Class LLFolderViewItem | 97 | /// Class LLFolderViewItem |
@@ -607,7 +608,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask ) | |||
607 | { | 608 | { |
608 | // No handler needed for focus lost since this class has no | 609 | // No handler needed for focus lost since this class has no |
609 | // state that depends on it. | 610 | // state that depends on it. |
610 | gViewerWindow->setMouseCapture( this, NULL ); | 611 | gViewerWindow->setMouseCapture( this ); |
611 | 612 | ||
612 | if (!mIsSelected) | 613 | if (!mIsSelected) |
613 | { | 614 | { |
@@ -642,7 +643,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask ) | |||
642 | 643 | ||
643 | BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) | 644 | BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) |
644 | { | 645 | { |
645 | if( gViewerWindow->hasMouseCapture( this ) && isMovable() ) | 646 | if( hasMouseCapture() && isMovable() ) |
646 | { | 647 | { |
647 | S32 screen_x; | 648 | S32 screen_x; |
648 | S32 screen_y; | 649 | S32 screen_y; |
@@ -742,10 +743,10 @@ BOOL LLFolderViewItem::handleMouseUp( S32 x, S32 y, MASK mask ) | |||
742 | 743 | ||
743 | mSelectPending = FALSE; | 744 | mSelectPending = FALSE; |
744 | 745 | ||
745 | if( gViewerWindow->hasMouseCapture( this ) ) | 746 | if( hasMouseCapture() ) |
746 | { | 747 | { |
747 | getRoot()->setShowSelectionContext(FALSE); | 748 | getRoot()->setShowSelectionContext(FALSE); |
748 | gViewerWindow->setMouseCapture( NULL, NULL ); | 749 | gViewerWindow->setMouseCapture( NULL ); |
749 | } | 750 | } |
750 | return TRUE; | 751 | return TRUE; |
751 | } | 752 | } |
@@ -2615,9 +2616,9 @@ LLFolderView::~LLFolderView( void ) | |||
2615 | 2616 | ||
2616 | LLView::deleteViewByHandle(mPopupMenuHandle); | 2617 | LLView::deleteViewByHandle(mPopupMenuHandle); |
2617 | 2618 | ||
2618 | if(gViewerWindow->hasTopView(mRenamer)) | 2619 | if(gViewerWindow->hasTopCtrl(mRenamer)) |
2619 | { | 2620 | { |
2620 | gViewerWindow->setTopView(NULL, NULL); | 2621 | gViewerWindow->setTopCtrl(NULL); |
2621 | } | 2622 | } |
2622 | 2623 | ||
2623 | mAutoOpenItems.removeAllNodes(); | 2624 | mAutoOpenItems.removeAllNodes(); |
@@ -3194,7 +3195,7 @@ void LLFolderView::finishRenamingItem( void ) | |||
3194 | mRenamer->setFocus( FALSE ); | 3195 | mRenamer->setFocus( FALSE ); |
3195 | mRenamer->setVisible( FALSE ); | 3196 | mRenamer->setVisible( FALSE ); |
3196 | mRenamer->setCommitOnFocusLost( TRUE ); | 3197 | mRenamer->setCommitOnFocusLost( TRUE ); |
3197 | gViewerWindow->setTopView( NULL, NULL ); | 3198 | gViewerWindow->setTopCtrl( NULL ); |
3198 | 3199 | ||
3199 | if( mRenameItem ) | 3200 | if( mRenameItem ) |
3200 | { | 3201 | { |
@@ -3212,7 +3213,7 @@ void LLFolderView::revertRenamingItem( void ) | |||
3212 | mRenamer->setFocus( FALSE ); | 3213 | mRenamer->setFocus( FALSE ); |
3213 | mRenamer->setVisible( FALSE ); | 3214 | mRenamer->setVisible( FALSE ); |
3214 | mRenamer->setCommitOnFocusLost( TRUE ); | 3215 | mRenamer->setCommitOnFocusLost( TRUE ); |
3215 | gViewerWindow->setTopView( NULL, NULL ); | 3216 | gViewerWindow->setTopCtrl( NULL ); |
3216 | 3217 | ||
3217 | if( mRenameItem ) | 3218 | if( mRenameItem ) |
3218 | { | 3219 | { |
@@ -3610,7 +3611,8 @@ void LLFolderView::startRenamingSelectedItem( void ) | |||
3610 | mRenamer->setVisible( TRUE ); | 3611 | mRenamer->setVisible( TRUE ); |
3611 | // set focus will fail unless item is visible | 3612 | // set focus will fail unless item is visible |
3612 | mRenamer->setFocus( TRUE ); | 3613 | mRenamer->setFocus( TRUE ); |
3613 | gViewerWindow->setTopView( mRenamer, top_view_lost ); | 3614 | mRenamer->setFocusLostCallback(renamer_focus_lost); |
3615 | gViewerWindow->setTopCtrl( mRenamer ); | ||
3614 | } | 3616 | } |
3615 | } | 3617 | } |
3616 | 3618 | ||
@@ -3939,6 +3941,7 @@ void LLFolderView::onFocusLost( ) | |||
3939 | { | 3941 | { |
3940 | gEditMenuHandler = NULL; | 3942 | gEditMenuHandler = NULL; |
3941 | } | 3943 | } |
3944 | LLUICtrl::onFocusLost(); | ||
3942 | } | 3945 | } |
3943 | 3946 | ||
3944 | BOOL LLFolderView::search(LLFolderViewItem* first_item, const LLString &search_string, BOOL backward) | 3947 | BOOL LLFolderView::search(LLFolderViewItem* first_item, const LLString &search_string, BOOL backward) |
@@ -4096,9 +4099,9 @@ BOOL LLFolderView::handleScrollWheel(S32 x, S32 y, S32 clicks) | |||
4096 | 4099 | ||
4097 | void LLFolderView::deleteAllChildren() | 4100 | void LLFolderView::deleteAllChildren() |
4098 | { | 4101 | { |
4099 | if(gViewerWindow->hasTopView(mRenamer)) | 4102 | if(gViewerWindow->hasTopCtrl(mRenamer)) |
4100 | { | 4103 | { |
4101 | gViewerWindow->setTopView(NULL, NULL); | 4104 | gViewerWindow->setTopCtrl(NULL); |
4102 | } | 4105 | } |
4103 | LLView::deleteViewByHandle(mPopupMenuHandle); | 4106 | LLView::deleteViewByHandle(mPopupMenuHandle); |
4104 | mPopupMenuHandle = LLViewHandle::sDeadHandle; | 4107 | mPopupMenuHandle = LLViewHandle::sDeadHandle; |
@@ -4334,9 +4337,12 @@ bool sort_item_date(LLFolderViewItem* a, LLFolderViewItem* b) | |||
4334 | } | 4337 | } |
4335 | } | 4338 | } |
4336 | 4339 | ||
4337 | void top_view_lost( LLView* view ) | 4340 | void renamer_focus_lost( LLUICtrl* ctrl, void* userdata) |
4338 | { | 4341 | { |
4339 | if( view ) view->setVisible( FALSE ); | 4342 | if( ctrl ) |
4343 | { | ||
4344 | ctrl->setVisible( FALSE ); | ||
4345 | } | ||
4340 | } | 4346 | } |
4341 | 4347 | ||
4342 | void delete_selected_item(void* user_data) | 4348 | void delete_selected_item(void* user_data) |