Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
problem with PlotIconRef in databrowser custom column
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with PlotIconRef in databrowser custom column



I have a custom column in my databrowser that displays a clickable icon.
My tracking callback looks something like this (details omitted)

do{
TrackMouseRegion(NULL,iconRegion,&inRgn,&result);
EraseRect(&iconRect);
if(inRgn)
PlotIconRef(&iconRect,kAlignAbsoluteCenter,kTransformSelected,kIconServi cesNormalUsageFlag,myIconRef);
else
PlotIconRef(&iconRect,kAlignAbsoluteCenter,kTransformNone,kIconServicesN ormalUsageFlag,myIconRef);

}while(result!=kMouseTrackingMouseUp);
if(inRgn){
//user released button while over icon
}
else{
//user released button while outside icon
}


(iconRect is basically the rect given as a parameter to the callback)

If the user clicks on the icon it hilites, if he moves the mouse out of the icon it unhilites, and it hilites again when he moves it back in.

This works fine in jaguar. In panther (7b21) , i have switched to a composititing window and when i click on the icon it displays in the top left corner of my window, and switches between hilited and non hilited states as I move the mouse over the top left corner of thw window; apparently the coordinates of the rectangle are relative to the control.

I shifted the coordinates of iconRect by the top left coordinates of the databrowser control and now the icon no longer displays at all in its hilited version.
The parameters i pass to TrackMouseRegion seem valid as when i release the mouse button my program correctly works out whether i was over the icon or not when i released the button.

strangely, In my draw callback it was not necessary to shift the coordinates to get my icons to draw in the right place.
I have tried with and without setting the port to my window and it did not make a difference.

what's up?

Fred
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.