Skip to content
Snippets Groups Projects
Commit 9589ee3f authored by richard's avatar richard
Browse files

EXT-1727 Chat history widget has no context menu for copy/paste operations

added ignore for dbghelp.dll

reviewed by James
parent 7f3af8bc
No related branches found
No related tags found
No related merge requests found
......@@ -43,3 +43,4 @@ tarfile_tmp
^indra/web/dataservice/locale.*
^indra/web/dataservice/lib/shared/vault.*
^indra/web/dataservice/vendor.*
glob:indra/newview/dbghelp.dll
......@@ -63,6 +63,7 @@
#include "llpanel.h"
#include "llurlregistry.h"
#include "lltooltip.h"
#include "llmenugl.h"
#include <queue>
#include "llcombobox.h"
......@@ -252,7 +253,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
mHandleEditKeysDirectly( p.handle_edit_keys_directly ),
mMouseDownX(0),
mMouseDownY(0),
mTabsToNextField(p.ignore_tab)
mTabsToNextField(p.ignore_tab),
mContextMenu(NULL)
{
mDefaultFont = p.font;
......@@ -301,6 +303,8 @@ LLTextEditor::~LLTextEditor()
// Scrollbar is deleted by LLView
std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer());
delete mContextMenu;
}
////////////////////////////////////////////////////////////
......@@ -702,6 +706,19 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
return handled;
}
BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
BOOL handled = LLTextBase::handleRightMouseDown(x, y, mask);
if (!handled && hasTabStop())
{
setFocus( TRUE );
showContextMenu(x, y);
handled = TRUE;
}
return handled;
}
BOOL LLTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
......@@ -736,7 +753,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask)
setCursorAtLocalPos( clamped_x, clamped_y, true );
mSelectionEnd = mCursorPos;
}
imageoverlay
lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl;
getWindow()->setCursor(UI_CURSOR_IBEAM);
handled = TRUE;
......@@ -1991,6 +2008,21 @@ void LLTextEditor::setEnabled(BOOL enabled)
}
}
void LLTextEditor::showContextMenu(S32 x, S32 y)
{
if (!mContextMenu)
{
mContextMenu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_text_editor.xml",
LLMenuGL::sMenuContainer,
LLMenuHolderGL::child_registry_t::instance());
}
S32 screen_x, screen_y;
localPointToScreen(x, y, &screen_x, &screen_y);
mContextMenu->show(screen_x, screen_y);
}
void LLTextEditor::drawPreeditMarker()
{
static LLUICachedControl<F32> preedit_marker_brightness ("UIPreeditMarkerBrightness", 0);
......
......@@ -99,6 +99,7 @@ class LLTextEditor :
// mousehandler overrides
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask );
virtual BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask);
......@@ -201,6 +202,7 @@ class LLTextEditor :
void getSelectedSegments(segment_vec_t& segments) const;
protected:
void showContextMenu(S32 x, S32 y);
void drawPreeditMarker();
void assignEmbedded(const std::string &s);
......@@ -328,6 +330,8 @@ class LLTextEditor :
LLCoordGL mLastIMEPosition; // Last position of the IME editor
keystroke_signal_t mKeystrokeSignal;
LLContextMenu* mContextMenu;
}; // end class LLTextEditor
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<context_menu
name="Text editor context menu">
<menu_item_call
label="Cut"
layout="topleft"
name="Cut"
shortcut="control|X">
<menu_item_call.on_click
function="Edit.Cut" />
<menu_item_call.on_enable
function="Edit.EnableCut" />
</menu_item_call>
<menu_item_call
label="Copy"
layout="topleft"
name="Copy"
shortcut="control|C">
<menu_item_call.on_click
function="Edit.Copy" />
<menu_item_call.on_enable
function="Edit.EnableCopy" />
</menu_item_call>
<menu_item_call
label="Paste"
layout="topleft"
name="Paste"
shortcut="control|V">
<menu_item_call.on_click
function="Edit.Paste" />
<menu_item_call.on_enable
function="Edit.EnablePaste" />
</menu_item_call>
<menu_item_call
label="Delete"
layout="topleft"
name="Delete"
shortcut="Del">
<menu_item_call.on_click
function="Edit.Delete" />
<menu_item_call.on_enable
function="Edit.EnableDelete" />
</menu_item_call>
<menu_item_call
label="Select All"
layout="topleft"
name="Select All"
shortcut="control|A">
<menu_item_call.on_click
function="Edit.SelectAll" />
<menu_item_call.on_enable
function="Edit.EnableSelectAll" />
</menu_item_call>
</context_menu>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment