Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / April 2005



Tip: Looking for answers? Try searching our database.

Databrowser scroll wheel support in PP application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kent Sorensen - 20 Apr 2005 21:02 GMT
I'm seing that the databrowsers in my PowerPlant windows are not
responding to the scroll wheel on the mouse.

The databrowser in the BasicDataBrowser sample from Apple does
automatically respond to the scroll wheel.

The window in the sample has the Standard handler attribute set, but
that isn't set for my PowerPlant windows.

That is the only significant difference I can see. Can there be other
reasons for a databrowser not to respond to scroll wheel event ?

I have a kEventClassMouse/kEventMouseWheelMoved handler attached to my
windows in order to scroll my custom views. This works fine, but it
makes no difference to the databrowser whether my own handler is
installed or not.

So, I suppose I need to extend my own handler to detect that a scroll
wheel event occurred over the databrowser and manually call a routine to
scroll the databrowser. Any suggestions about how to do that ?

Kent
Kent Sorensen - 20 Apr 2005 21:55 GMT
I've tried this method to pass the event on to the databrowser control
directly, with no success. The browser does not scroll even when
SendEventToEventTarget returns noErr.

This is part of the event handler for the
kEventClassMouse/kEventMouseWheelMoved event. It is attached to the
window.

ControlPartCode partCode;
ControlRef theControl = FindControlUnderMouse(mouseLoc, window,
                                          &partCode);
if (theControl)
{
    // the databrowser is found and partCode is kControlDataBrowserPart
    OSStatus controlRes = SendEventToEventTarget( inEvent,
                              GetControlEventTarget( theControl ) );
       
    // the call succeeds and controlRes is noErr.
   if (controlRes != noErr)
   {
       SysBeep(0);
   }
}

Kent

> I'm seing that the databrowsers in my PowerPlant windows are not
> responding to the scroll wheel on the mouse.
[quoted text clipped - 18 lines]
>
> Kent
Richard Buckle - 25 Apr 2005 20:45 GMT
> I've tried this method to pass the event on to the databrowser control
> directly, with no success. The browser does not scroll even when
> SendEventToEventTarget returns noErr.
>
> [snip]

Try my public domain class that adds scroll wheel support to PowerPlant:
<http://www.sailmaker.co.uk/progtools.html#CScrollWheelAttachment>.
It's very easy to use, just instantiate it in your app's Initialize()
override and you're done.

Enjoy,
Richard.
Kent Sorensen - 29 Apr 2005 13:56 GMT
> > I've tried this method to pass the event on to the databrowser control
> > directly, with no success. The browser does not scroll even when
[quoted text clipped - 9 lines]
> Enjoy,
> Richard.

Thanks for the suggestion. I have actually used that class for many
years now :-)

It works fine for PowerPlant views. The problem is that it does
obviously not find a LScroller on the LDatabrowser view so it does  
nothing.

Then, as I wrote in the other mail, I tried SendEventToEventTarget if
DoScrollEvent did not find anything. This makes no difference..

Thanks
Kent
Richard Buckle - 30 Apr 2005 04:10 GMT
[snip]
> > Try my public domain class that adds scroll wheel support to PowerPlant:
> > <http://www.sailmaker.co.uk/progtools.html#CScrollWheelAttachment>.
[quoted text clipped - 11 lines]
> nothing.
> [snip]

Kent, YHM. CScrollWheelAttachment has been updated. The latest version
on my website (v1.2.3) *does* support LDataBrowser, courtesy of a
submission by James W Walker. It's controlled by an #ifdef, which is
off by default, merely because LDataBrowser.h is not part of the
standard PowerPlant install.

Share and enjoy,
Richard.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.