Page 1 of 1

Can someone try the following on OSX please...

Posted: Sun Jan 19, 2014 2:26 pm
by srod
Hi,

the second such request I have made recently... feeling a little guilty. :oops: I will be looking for an old second hand mac next week or so, just so I can test and develop on OSX without continually badgering others! ;)

Am busy creating some cross-platform tools (which is a bit daft considering I don't own a Mac at this time!) and am seeing if I can convert a Windows only splitter control of mine to run on all platforms. Am about half way through the conversion and whilst it runs fine on Win 7, there's little point proceeding if what I have thus far doesn't run on OSX.

Whilst there is absolutely no API being used, the way I implement the drag control could well collapse on OSX. I have completed enough of the code that an OSX test is viable right now.

Would someone mind giving the following a quick whirl on OSX please?

Thus far I have implemented vertical split. You can drag and/or anchor the slider (by clicking the gripper).

Thanks.

http://www.purecoder.net/Splitter.zip

Re: Can someone try the following on OSX please...

Posted: Sun Jan 19, 2014 3:07 pm
by Shardik
The color #White is only defined on Windows. For cross-platform programs you should avoid these color constants. After replacing #White by $FFFFFF your Splitter demo works just fine on MacOS 10.6.8 and PB 5.21 x86 and x64.

Re: Can someone try the following on OSX please...

Posted: Sun Jan 19, 2014 3:10 pm
by srod
Ah bugger, I always do that! I have been careful to avoid those kinds of constants in this code, looks like a couple slipped through the net! :)

Thanks for that. I can now finish the control.

Re: Can someone try the following on OSX please...

Posted: Sun Jan 19, 2014 3:26 pm
by Shardik
I have now tested your Splitter also on Windows 7 x64 and detected several differences. On Windows the upper half of a splitter has a light grey background color and the lower half has a somewhat darker grey background color. When the cursor is positioned above a splitter area, the background color changes to a light blue and a somewhat darker blue in the lower half. This doesn't hold true on MacOS where the background color of the Splitter is always about the same as the window background color and the left half of the Splitter is always selected with a blue frame. The dragging and anchoring works similar on MacOS as on Windows although the anchoring works not as reliable on MacOS as on Windows.

Re: Can someone try the following on OSX please...

Posted: Sun Jan 19, 2014 3:41 pm
by srod
I have just run on Win 7 x64 and see no problems.

The demo has 2 buttons inside the splitter. This is just for a test and the splitter automatically resizes the buttons to fill their allotted space (just like the PB splitter). Sounds like you are simply describing the natural behaviour of the buttons! If you mouse over a button on Windows (with themes enabled) then you get a bluish shading going on. This is nothing to do with the splitter and is quite natural. Course, you wouldn't normally embed buttons in a splitter like this.

The anchoring mishaps on OSX is probably due to the fact that the demo only uses a 3 pixel wide slider surrounded by a 1 pixel margin. This would be especially significant if running with a retina display and the program is starting in hires mode.