eric b wrote:
Hi,
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.
The actual hit testing is done in the overloaded
SalGraphics::hitTestNativeControl method, so you can implement your own
sensitive areas there. The getNativeControlRegion is used for drawing
purposes (so the buttons are drawn at the positions you tell there).
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.
That is exactly the same, yes.
Before to investigate further in this direction, we need someone confirm
we are not too wrong.
I think you are on the right track.
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.
I think it should be possible to achieve native look by just changing
you overload SalGraphics implementation. If the independent layer does
not support something (or has bugs) then of course we can change that.
Last but not least ... maybe a documentation does exist ? :-)
Sorry, no documentation available :-(
Kind regards, pl
--
If you give someone a program, you will frustrate them for a day;
if you teach them how to program, you will frustrate them for a lifetime.
-- Author unknown
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]