Patch #8488: UserPref to switch between pan/paste on MMB in text editor.

This commit is contained in:
Ricki Myers 2008-03-13 15:12:19 +00:00
parent 4d3c9e88ed
commit b3dab57232
3 changed files with 13 additions and 4 deletions

@ -266,6 +266,7 @@ extern UserDef U; /* from usiblender.c !!!! */
// old flag for #define USER_KEYINSERTNEED (1 << 19)
#define USER_ZOOM_TO_MOUSEPOS (1 << 20)
#define USER_SHOW_FPS (1 << 21)
#define USER_MMB_PASTE (1 << 22)
/* Auto-Keying mode */
/* AUTOKEY_ON is a bitflag */

@ -1546,13 +1546,16 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
} else if (event==MIDDLEMOUSE) {
if (val) {
#if defined(_WIN32) || defined(__APPLE__)
do_textscroll(st, 1);
#else
if (U.uiflag & USER_MMB_PASTE)
{
do_selection(st, G.qual&LR_SHIFTKEY);
get_selection_buffer(text);
do_draw= 1;
#endif
}
else
{
do_textscroll(st, 1);
}
}
} else if (event==RIGHTMOUSE) {
if (val) {

@ -3694,6 +3694,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
(xpos+edgsp+(3*mpref)+(4*midsp)),y3,mpref,buth,
&(U.flag), 0, 0, 0, 0,
"Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)");
uiDefButBitI(block, TOG, USER_MMB_PASTE, B_DRAWINFO, "Paste on MMB",
(xpos+edgsp+(3*mpref)+(4*midsp)),y2,mpref,buth,
&(U.uiflag), 0, 0, 0, 0,
"In text window, paste with MMB instead of panning");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
uiDefButBitI(block, TOG, USER_SHOW_ROTVIEWICON, B_DRAWINFO, "Mini Axis",