Author Topic: Zoom Plug-in  (Read 9954 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Zoom Plug-in
« on: November 10, 2005, 12:37:31 am »
Dear all,

2 days ago during a presentation of Herb Sutter at the c++ connections conference in Vegas, Herb needed to show something in a browser. Since he actually works at M$ he asked to the crowd which browser he should use, and everyone was going like "Firefox ... Firefox". Well, Herb did, and even told us what he thinks was the best feature : it was the ctrl-+ and ctrl-- zoom in / zoom out functions. Dynamically increase/decrease the font size in the current tab. Very cool during presentations, no need to adjust those resolutions for the laptop/pc itself, causing all those icons to reposition on the desktop.

Immediately I got the idea, hey , cool, would be nice to have this in Code::Blocks also.
Back in the hotel room, first looked if CB already had this : NO.
Really, within 5 (!) minutes I had implemented it as a plug-in.
Only one small problem, I don't seem to get it bind to ctrl-+ and ctrl--, but for the rest it works.

So the plugin adds :
- zoom in / zoom out entries to the "View" menu
- zoom in / zoom out entries to the context menu of the editor pane

Installation :
Copy the dll from the attached Zoom.zip to the CB-plug-in directory.
In the dll is also included the source code and the cbp project file (build on windows).

kind regards and happy zooming,
Lieven

PS : once I know how to bind with ctrl-+/- I will post a new zip file.

[attachment deleted by admin]

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Zoom Plug-in
« Reply #1 on: November 10, 2005, 03:21:10 am »
As far as I know, RC2 *already* supports this feature. In fact, i pressed ctrl + and ctrl - and it worked. I'm using Windows, btw.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: Zoom Plug-in
« Reply #2 on: November 10, 2005, 04:40:00 am »
strange, when I tried it out, it didn't seem so. Will have to try once more.

This would not be the first time that something strange happened. Yesterday I filed a bug, about renaming the workspace, someone replied that for him it worked. I have tried again and each time I could rename the workspace now. So this might be identical. Well if it already worked, then I wrote a nearly useless plug-in :-) , nearly useless, cause I learned some more methods of the scintilla interface.



Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Zoom Plug-in
« Reply #3 on: November 10, 2005, 09:46:59 am »
Um... you know that not only RC2 supports zooming, but that's been around like... forever? It's a Scintilla feature :)

Hold down the control key and use the mouse wheel ;)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline squizzz

  • Almost regular
  • **
  • Posts: 132
Re: Zoom Plug-in
« Reply #4 on: November 10, 2005, 01:56:05 pm »
strange, when I tried it out, it didn't seem so. Will have to try once more.

Try ctrl + numerical plus/minus (it's how it works for me).
The bad news is that there may be no "back to original size" option, or I just can't find it. :)

this space is for rent

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Zoom Plug-in
« Reply #5 on: November 10, 2005, 02:05:35 pm »
The bad news is that there may be no "back to original size" option, or I just can't find it. :)
Control + Numpad-"/"
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Zoom Plug-in
« Reply #6 on: November 10, 2005, 02:27:33 pm »
Hello,

Cool the zoom in/out feature. But for those working with a laptop and do not have Control+Numpad-"/" ?

Thank you very much.

Best wishes,
Michael

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Zoom Plug-in
« Reply #7 on: November 10, 2005, 03:09:58 pm »
Cool the zoom in/out feature. But for those working with a laptop and do not have Control+Numpad-"/" ?
Are you sure? Because I do. The numpad is a third layer over the default notebook-keyboard. I furthermore have the numlock key to permanently switch on the numerical pad (...and special notebook-function-key for non-permanent switch). I thought every notebook has such a keyboard?!

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Zoom Plug-in
« Reply #8 on: November 10, 2005, 03:20:56 pm »
Hello,

I have find the solution to my problem. I do not have Ctrl+Numpad-"/", but Ctrl+Numpad-"arithmetic division symbol (or two points with a line in the middle)" :).

Thank you for you help.

Best wishes,
Michael

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Zoom Plug-in
« Reply #9 on: November 10, 2005, 04:25:26 pm »
The CTRL+wheel mouse tip is in the first C::B tips of the day (which obviously everybody skips it, me too :P)

The "back to original size" is CTRL+0 in Firefox and other programs.
Too bad it isn't that way in Scintilla/Code::Blocks, can it be easily implemented from C::B?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: Zoom Plug-in
« Reply #10 on: November 10, 2005, 04:41:53 pm »
Well, this explains why I did not work (and still does not) with me.
I am using a laptop at the moment --> no numeric keypad.
So I had to use the plus and minus sign that are between the regular character keys.

Is there no way to have both minus and plus signs binding to the same command ??

It is indeed a scintilla feauture, that's way it was so easy to implement my useless plug-in.

Experience is being build from stupid mistakes ....


kind regards,
Lieven

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: Zoom Plug-in
« Reply #11 on: November 14, 2005, 02:44:24 pm »
Ok, back at home I tried it on my desktop machine, and indeed the functionality is in the core.

Here's a little wrap-up of the posts as a convenient how-to :

Zoom In : ctrl + (numeric part of the keyboard (aka the numpad)  !!!)  or ctrl-mousewheel_down
Zoom Out : ctrl -- (numeric part of the keyboard (aka the numpad) !!!)  or ctrl-mousewheel_up

back to original size :
ctrl-/ (numeric part of the keyboard (aka the numpad) !!!)

That's how it works.
A comparison though with FireFox :
Zoom In : ctrl + (regular + and the one on the numeric part of the keyboard (aka the numpad)  !!!)  or ctrl-mousewheel_down
Zoom Out : ctrl - (regular - and the one on the numeric part of the keyboard (aka the numpad) !!!)  or ctrl-mousewheel_up

back to original size :
ctrl-0 (the NON-numeric part of the keyboard (aka the numpad), so the regular 0 just above the apha-chars  !!!)


Therefor : REQUEST to the core developers
- can it be made also to work with the non numpad versions of the keys (+  -  /)

This would be more consistent, and would help out laptop users who don't have a numpad.

kind regards,
Lieven

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Zoom Plug-in
« Reply #12 on: November 14, 2005, 03:02:36 pm »
Hello,

Laptops without numpad :?? I have always thought that laptops have a numpad (at least all what I have bought and seen until now).

Best wishes,
Michael

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: Zoom Plug-in
« Reply #13 on: November 15, 2005, 03:16:34 pm »
Most laptops don't have a numeric pad !!!!!!
The numeric pad being a seperate area where the numeric keys are (usually at the right hand side of your keyboard), which can be either numbers or arrow moving keys depending on the Num-lock status, so not the numeric keys just above the alphabetic keys !!!!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Zoom Plug-in
« Reply #14 on: November 15, 2005, 03:54:28 pm »
Most laptops don't have a numeric pad !!!!!!
I am sorry, but it's really hard to believe. I have seen very lot notebooks in my life and each had a numpad. OK: The numpad isn't seperately (as on a PC keyboard) but they are implemented as a third function over the 7-8-9, U-I-O, J-K-L and M key on the notebook keyboard. Furthermore (normally) the notebook has a num-lock key which enables these keys to react just as an external keypad would do. Are you really sure that you do not have this on your notebook? Do you have a num-lock key???

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: Zoom Plug-in
« Reply #15 on: November 15, 2005, 04:06:02 pm »
Morton,

You are absolutely correct. Indeed with the special [Fn] key I can toggle this on, or even by keeping it down then the  zooming works.

So instead of "ctrl +", I do now "ctrl [Fn] M" (M : azerty keyboard).

Cool, never noticed that. Now that's an experience boost.

Though I think my request is still valid, it is more intuitive I think (like good Foxie does).


cheers,
Lieven

PS : Morton : I owe you a beer.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Zoom Plug-in
« Reply #16 on: November 15, 2005, 04:13:11 pm »
PS : Morton : I owe you a beer.
...sounds very good to me ;-)

Glad I could help.

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Zoom Plug-in
« Reply #17 on: November 15, 2005, 05:23:04 pm »
Hello,

Yes, Morten is right. I should have mentioned the Fn key in my previous message.

Personally, I have never or quite used it (just for the CRT/LCD function  :)  until now). I agree with killerbot's request as it will make the life of laptop users easier.

Best wishes,
Michael