Hi,
Implementing native control on Mac OS X (on aqua version) with Pierre
de Filippis, we need some help for the native scrollbar implementation.
Currently, this scrollbar is drawn, works, and even mousewheel works..
We tried to respect/follow NWF "spirit" :
AquaSalGraphics::IsNativeControlSupported() returns true -> nType is
ok , getstate() works , DrawNativeControl() works fine two, and
several controls are drawn.
Everything seems to work excepted the button control area, because
left/top control button is not located the same way for vcl and for
aqua control : same behaviour, but different places.
Vertical scrollbar
vcl : top (Button1) / bottom (Button2)
aqua: both at bottom
Horizontal scrollbar:
vcl : left (Button1) /right ( Button2)
aqua: both on right
-> our problem is simple : translate the coordinates of the control
area of left/top button under aqua control, else, clicking on the
left of the scrollbar ... the button on right is active :-)
(same bug for vertical bar).
The best way, would be the implementation of
AquaSalGraphics::getNativeControlRegion().
Our tests...
I first found some interesting code in vcl/source/control/scrbar.cxx
where (horizontal bar e.g. ) :
left coordinate of scrollbar is given by maThumbPixPos, the vcl
rectangle (not drawn, just the location), named Button1, starts on
maThumbPixPos (on x axis) and ends on maThumbRect.Left()
after, there is the scrollbar area long of mnThumbPixSize -1 , and
after, on right, the second control area ( called Button2).
What we have to do is simple : translate Button1 coordinates from
left to right with an offset value of mnThumbPixSize , and translate
the area without control on left, from a value equal to
Button1.width, to make vcl control match with aqua control area.
We already tried, but if I'm not too wrong, any modification in this
file won't work. Simply because we use references everywhere... (just
an ill scrollbar is the result of some tries)
So, with Pierre de Filippis, we decided to search another solution in
salnativewidgets-gtk.cxx : there are promising methods like
NWGetButtonArea() and several other.
Pierre told me on IRC he already tried, without any success: values
are modified, but never applied.
Reading more the file (3500 lines .. ) GtkSalGraphics::updateSettings
( AllSettings& rSettings ) looks similar to the abstraction used with
DtIntegrator in Aquacolors cws : using rSettings.SetStyleSettings()
in updatesettings(), I think it should be possible to draw the aqua
theme using this method.
Before to investigate further in this direction, we need someone
confirm we are not too wrong.
Another last possibility could be create a new Button3 with correct
values (means with matching vcl/aqua areas), and available for all
architectures (defined in vcl/inc/scrbar.hxx e.g., implemented in vcl/
source/control/scrbar.cxx ), but this is maybe not a good idea.
Thanks in advance for any tip and/or information ... or even
sugggestions.
Last but not least ... maybe a documentation does exist ? :-)
Regards,
Eric Bachard