IonicWind Software

IWBasic => GUI Central => Topic started by: Alyce on November 19, 2008, 03:13:36 PM

Title: Richedit question. CTRL+mouse wheel zooming.
Post by: Alyce on November 19, 2008, 03:13:36 PM
One can hit the CTRL key and scroll with the middle mouse wheel and cause the text in a richedit control to zoom in or out. This is a problem in my app.

I want to disable this ability, or find a way to know when such an event has happened, or find a way to know how large the character size has become.

I've searched the forum. I've searched MSDN. I've succeeded... in confusing myself and giving myself a headache.

If you want to see this in action, just try Paul's richedit demo that comes with ebasic. Run it, type something, then hit CTRL and scroll the mouse wheel. (At least it zooms for me in Vista.)

Ideas? Comments?
Title: Re: Richedit question. CTRL+mouse wheel zooming.
Post by: sapero on November 19, 2008, 03:55:13 PM
Subclassing is your friend :)
sub RicheditWndProc(HWND hwnd,UINT uMsg, WPARAM wParam, LPARAM lParam),LRESULT

if (uMsg = WM_MOUSEWHEEL)
if (wParam & MK_CONTROL) then return 0
endif
Title: Re: Richedit question. CTRL+mouse wheel zooming.
Post by: Alyce on November 20, 2008, 04:31:14 AM
Thank you. I'd hoped to avoid subclassing, since there is a lot going on in that poor, little richedit control. I'll see if I can integrate it.

Thanks very much, Sapero.

Edited to add: This has been downloaded six times before I got here. Apparently, others want the answer to this as well!
Title: Re: Richedit question. CTRL+mouse wheel zooming.
Post by: aurelCB on November 20, 2008, 05:29:52 AM
My problem is where i can find windowssdk.inc
Title: Re: Richedit question. CTRL+mouse wheel zooming.
Post by: LarryMc on November 20, 2008, 05:43:10 AM
Quote from: aurelCB on November 20, 2008, 05:29:52 AM
My problem is where i can find windowssdk.inc
Click on the link at the bottom of any of Sapero's post.

Larry
Title: Re: Richedit question. CTRL+mouse wheel zooming.
Post by: aurelCB on November 20, 2008, 12:31:12 PM
Yes i download latest headers and i recive this:

Compiling...
richedit_nozoom.eba
File: D:\richedit_nozoom\richedit_nozoom.eba (38) syntax error - =
File: D:\richedit_nozoom\richedit_nozoom.eba (149) unexpected end of file: missing ENDSUB
Error(s) in compiling D:\richedit_nozoom\richedit_nozoom.eba

Very weird?
Title: Re: Richedit question. CTRL+mouse wheel zooming.
Post by: Ionic Wind Support Team on November 20, 2008, 12:43:39 PM
AurelCB,
You need the latest version of Emergence BASIC to use this.  The code uses features added in 1.65

You can try the demo version, if you haven't already used up the 15 day trial period.

Paul.
Title: Re: Richedit question. CTRL+mouse wheel zooming.
Post by: Alyce on November 20, 2008, 12:49:06 PM
I've found a way to do exactly as Sapero does with API calls, but using the OnControl statement. In the ZoomCheck sub, I check for the mousewheel message, and if that is in effect, see if the ctrl key is down.


OnControl d1,1,@ENMSGFILTER,&ZoomCheck

It's a little backwards from the way I'm used to doing callbacks, though.

Sapero's code, using API subclassing:
if (uMsg = WM_MOUSEWHEEL)
if (wParam & MK_CONTROL) then return 0
endif


The API method requires a return value of 0 to stop the window from processing the message further. (I'm used to doing it this way.)

The OnControl method looks like this, and requires a return value of 1 to stop the window from doing further processing:


IF mf.msg = WM_MOUSEWHEEL
if (mf.wparam & 11) then return 1
ENDIF


It appears to work just fine and it traps the abilty of the user to zoom text in a richedit control.
Title: Re: Richedit question. CTRL+mouse wheel zooming.
Post by: aurelCB on November 20, 2008, 01:07:27 PM
Ups i forget this that i need latest version!
Ok !