Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: Pecan on December 09, 2005, 08:52:27 pm

Title: Right Mouse Drag and Scroll Plugin
Post by: Pecan on December 09, 2005, 08:52:27 pm
cbDragScroll plugin

Find attached a plugin for right mouse key drag scrolling.
Just grab a source line with the right mouse key and move it
in any direction.

The scroller is adaptive. The faster you move the faster the scroll.

thanks
pecan

EDIT: This version has a bug. See the correction in the
          following messages.
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: takeshimiya on December 10, 2005, 03:35:09 am
Great!

May I ask for this:
Mouse wheel panning (press the 3rd mouse button and then move the mouse).
Like it's done in Office or Firefox :)
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on December 10, 2005, 04:36:53 pm
Great!

May I ask for this:
Mouse wheel panning (press the 3rd mouse button and then move the mouse).
Like it's done in Office or Firefox :)

Ok, just after the new "stopgap" cbKeybinder.

I love the mouse scrolling. I'm so lazy about moving my hands from
one place to another. And with a small jerk, I can go from top to bottom of
a source file. Or just one line at a time. With a little practice, I've learned to
"jerk" from one bookmark to another.

thanks
pecan

Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on December 11, 2005, 05:38:56 pm
New cbDragScroll v0.4

Found a bug in the previous version while testing keyBinder.
cbDragScroll was poping the top EventHandler instead of
its own.

Please find attached: cbDragScroll04.zip

Also: if you change the RC2/RC3 #define in the header file
and recompile under HEAD, it can be used with HEAD

thanks
pecan
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: tiwag on December 30, 2005, 02:05:40 am
thanks for this fine plugin,

in the course of switching CodeBlocks to unicode build as standard development version
i've done some necessary modifications to your code and also updated the project file to
the NewBuild global variable system.

attached cbDragScroll 0.4 NewBuild unicode


[attachment deleted by admin]
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on December 30, 2005, 07:31:21 pm
@tiwag

acknowledged, thankyou
pecan
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: tiwag on January 19, 2006, 06:52:56 pm
updated cbDragScroll so that it builds with CB versions past SVN rev 1807 again

Quote from: rev 1808
* Changed the signature of cbPlugin::BuildModuleMenu(). It now contains an argument that prefectly describes the item in question. As a result, right-clicking on folders works just fine now.




[attachment deleted by admin]
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on January 19, 2006, 07:14:00 pm
updated cbDragScroll so that it builds with CB versions past SVN rev 1807 again

Quote from: rev 1808
* Changed the signature of cbPlugin::BuildModuleMenu(). It now contains an argument that prefectly describes the item in question. As a result, right-clicking on folders works just fine now.

Ok, thanks

But what's that all about.

thanks
pecan
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on January 22, 2006, 10:22:20 pm
1/22/2006 4:18 PM

Please find attached cbDragScrollR013.zip

This version supports unix/GTK and MSwindows.
It also scrolls any window/control that allows
itself to be scrolled.

Note that some controls allow vertical scrolling
but don't allow horizontal scrolling.

Under GTK, some controls dont allow themselves
to be scrolled at all.

The editor windows are scrollable in both directions;

thanks
pecan
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 03, 2006, 07:51:09 pm
2/3/2006 1:24 PM

Please find attached cbDragScrollV015.zip

Added editor configuration panel to:
    Enable/Disable mouse scrolling
    Choose direction of  the scroll
    Choose right/middle mouse key
    Set adaptive speed sensitivity
    Set mouse movement to line scrolling ratio

Added png icons for config panel. These must be moved
to "...{datafolder}.../images/settings". Else the default
plugin puzzle piece will be used.

(http://forums.codeblocks.org/index.php?action=dlattach;topic=1594.0;attach=732;image)

The values on the slider for the "adaptive speed sensitivity"
represent the number: 100-(sensitivity*10)  divided into the
mouse moves (for which an additional line is scrolled).

The movement ratio is simply the percentage of mouse moves
needed to represent a text line.

I have been unable to test this under unix. Although the GTK code is present.

thanks
pecan

EDIT: I erroneously left LOGGING defined in cbDragScroll.h
Change it to #define LOGGING 0


[attachment deleted by admin]
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 04, 2006, 10:41:27 pm
2/4/2006 4:39 PM

Attached: cbDragScrollV016.zip

Fixes for Unix/GTK users of cbDragScroll

thanks
pecan


[attachment deleted by admin]
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 14, 2006, 04:13:49 am
2/13/2006 10:10 PM

Attached: cbDragScrollV017.zip

Added: required CB_IMPLEMENT_PLUGIN(cbDragScroll, "cbDragScroll" );
Added: Focus editor when mouse enters windows

thanks
pecan



[attachment deleted by admin]
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: tiwag on February 14, 2006, 08:30:38 am
Added: Focus editor when mouse enters windows

is this feature configurable ?
i didn't try your latest version - but id don't like it.
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: kkez on February 14, 2006, 01:17:39 pm
Could you please provide a binary version too? I don't have wxwidgets headers..
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 14, 2006, 06:15:32 pm
Added: Focus editor when mouse enters windows

is this feature configurable ?
i didn't try your latest version - but id don't like it.

I will make it configurable soon. In the meantime, comment out the following
lines in cbdragscroll.cpp at line 610
Code
     // set focus to editor window if mouse is in it
     if (event.GetEventType() eq wxEVT_ENTER_WINDOW)
       if (p_cbStyledTextCtrl && (m_pEvtObject == p_cbStyledTextCtrl))
            p_cbStyledTextCtrl->SetFocus();



As an aside, could you tell me why you would not want the editor to have
the focus if the mouse cursor is in the editor window?
Just for my own education.

thanks
pecan
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 14, 2006, 06:22:22 pm
Could you please provide a binary version too? I don't have wxwidgets headers..

kkez,

Since this is a plugin, and the plugin SVN plugin interface is changing so
fast, sometimes nightly, I don't think a binary would work very long.

The only way a binary would work, is if this was a Contrib plugin. And since
it's highest download count has been 7. That means me, tiwag and maybe 5 other are using it. I'm not sure its worth making it a contrib.

However, If, you'll tell me what version, SVN number, nightly build you are
using, I'll see if I can make a version for ya.

thanks
pecan
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: tiwag on February 14, 2006, 09:41:56 pm
... could you tell me why you would not want the editor to have the focus if the mouse cursor is in the editor window? ...
because sometimes i have open two instances of C::B during debugging and i use the mouse as reading-positioning-helper in one editor while editing in another editor and/or watches edit-dialog.

and before some time i tried X-mouse behaviour (window activation follows mouse) and found out that i hate it. ;-)
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 14, 2006, 11:09:04 pm
2/14/2006 5:02 PM

Attached: cbDragScrollV018.zip

  Added configuration item for "Focus Editor on Mouse Entry"

Note: The "Editor Focused on Mouse Entry" does not cause
the windows or unix app window to activate. It ONLY causes
the editor frame to focus if the Window already has the
operating system focus.

This is done so that the cursor and caret stay in the same
location when moving back into the editor after clicking/working outside
the editor frame. You simply move the mouse back into the editor and
its as if you had not left. It affects no other frames or windows.

thanks
pecan


[attachment deleted by admin]
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: tiwag on February 15, 2006, 04:07:25 am
good work ! thanks pecan
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: kkez on February 16, 2006, 03:11:56 pm
Could you please provide a binary version too? I don't have wxwidgets headers..

kkez,

Since this is a plugin, and the plugin SVN plugin interface is changing so
fast, sometimes nightly, I don't think a binary would work very long.

The only way a binary would work, is if this was a Contrib plugin. And since
it's highest download count has been 7. That means me, tiwag and maybe 5 other are using it. I'm not sure its worth making it a contrib.

However, If, you'll tell me what version, SVN number, nightly build you are
using, I'll see if I can make a version for ya.

thanks
pecan

Oh, ok. Never mind, i'll download the wxwidgets and i'll compile it by myself  :D
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: MortenMacFly on February 16, 2006, 03:31:23 pm
Also the new version works very well for me. Thanks! It's really useful.
Morten.
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: takeshimiya on February 16, 2006, 04:15:48 pm
The only way a binary would work, is if this was a Contrib plugin. And since
it's highest download count has been 7. That means me, tiwag and maybe 5 other are using it. I'm not sure its worth making it a contrib.

That's because it's not in contrib.
[It's in contrib -> more users see it -> more need to be in contrib]
[It's not in contrib -> no users see it -> no idea this plugin existed]


This is something called retroalimentation/publicity. :)
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: killerbot on February 16, 2006, 04:24:10 pm
let me see ..... maybe I can add it to the nightly builds.
But then we should keep in mind if problems arise the plug-in "might" be the guilty party.
Plug-in can do harm, remember when the keybinder blockes some icons in the debug and build menu.

But this weekend I'll create a nightly containing it, just keep me posted of new versions (please PM me in such a case) I might overlook it in the forum.

kind regards,
Lieven

PS : personal request, I am allergic to compiler warnings ;-)
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: tiwag on February 16, 2006, 05:11:51 pm
cbDragScroll doesn't harm - i use it regularly and have no problems - just fun
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 16, 2006, 05:52:01 pm
Lieven,

If you want to make it a contrib, I'd be happy to maintain it.
If you'll give me the same permissions to update, like I have in keybinder,
I'll make sure it works for both Windows and Ubuntu.


thanks
pecan

Edit: There WILL be bugs. Every time the interface changes, the contribs have bugs. So, we fix 'em like always. When we suspect a contrib, we should turn 'em off and carry on until its fixed. Right? That's what I do anyway.
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 16, 2006, 05:59:12 pm

PS : personal request, I am allergic to compiler warnings ;-)

Lieven, are you getting warnings out of cbDragScroll. If so, what are they. I'm not getting any here. Could you send me a log of 'em.

thanks
pecan
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Michael on February 16, 2006, 06:59:15 pm
Lieven,

If you want to make it a contrib, I'd be happy to maintain it.
If you'll can give me the same permissions to update, like I have in keybinder,
I'll make sure it works for both Windows and Ubuntu.

IMHO it would be a good idea to make it a contrib. plugin. If the C::B admins/devs agree, of course :).

Michael
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: killerbot on February 16, 2006, 11:10:54 pm
I haven't compiled it yet, so no idea of warnings. I can't decide on it being a contrib plugin, you will have to ask the "don" himself., I am just a humble servant ;-)  But I will create a nightly this weekend which contains it ( a special weekend extra, so more people will have it then, and hopefully use it and like it). To be honest I have never used it, but I promise I will.

Cheers,
Lieven

Title: Re: Right Mouse Drag and Scroll Plugin
Post by: killerbot on February 17, 2006, 01:56:55 pm
compiled it, dropped the dll in the plug-ins dir (still have to copy the 2 jpg-s), but does not show up in the editor config.
Any idea why ?

EDIT :  I am going blind !!!!! It is ok

EDIT2 : could it be that dragscroll-of.png is not used ??
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: Pecan on February 17, 2006, 02:19:35 pm
EDIT2 : could it be that dragscroll-of.png is not used ??

That name should be "dragscroll-off.png". It's the greyed out
.png They should be put in the "...\share\CodeBlocks\images\settings\"
directory. If they're not there, the pluging specifies that the default plugin
png be used (the pluzzle piece .png)

It should look like the attachment...
thanks
pecan



[attachment deleted by admin]
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: tiwag on February 17, 2006, 02:31:17 pm
compiled it, dropped the dll in the plug-ins dir (still have to copy the 2 jpg-s), but does not show up in the editor config.
Any idea why ?

EDIT :  I am going blind !!!!! It is ok

EDIT2 : could it be that dragscroll-of.png is not used ??

attached you'll find a cbDragScroll CB-project-file which uses an automated installer script,
which updates the /devel CB version with all needed files, the /output CB version is updated by running update.bat


just copy the project in an folder according to the following structure:

<your_codeblocks_bas_dir>/src/plugins/_others/cbDragScroll

this is the directory where i have it residing

HTH

[attachment deleted by admin]
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: killerbot on February 17, 2006, 03:08:43 pm
woops stupid typo : and the other png ?
In the code I only see references to dragscroll.png, not to the -off version.
Title: Re: Right Mouse Drag and Scroll Plugin
Post by: mandrav on February 17, 2006, 03:09:50 pm
woops stupid typo : and the other png ?
In the code I only see references to dragscroll.png, not to the -off version.

The -off version is used automatically by the settings dialogs. That's why you don't see the extension either.