Pleas test this patch

problem was when speedbutton.transparent=true

there is problem with tGroupBox on GTK2, MouseEnter is not triggered and then Flat not work






Marien van Westen wrote:



On 5/20/06, *DarekM* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Marien van Westen napisał(a):



    On 5/20/06, *DarekM* <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:

        Micha Nelissen napisał(a):

On Sat, 20 May 2006 10:37:01 +0200
DarekM <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> wrote:

Transparency work both,
with flat=true button  has border only when mouse is over
with transparency=true don't fill inner area
That contradicts Marien's picture
'speedbuttons-panel-delphi-runtime.png' (the first one).

        This is slide from my application write in Delphi
        all buttons are transparent=true and flat=true
        only button under mouse has border

        different is when we work on IDE,
        then button has always border


    In my app I have a signal generater and the speedbuttons only
    have a Caption to select frequency range.
    In Delphi I can see the different buttons, but not in Lazarus.

    Have You property Flat=true ?


    I attach two pictures to show the difference.
    N.B. I tried to improve things bij placing the buttons in a
    groupbox in the Lazarus version, hence the line above the buttons
    (as you can see that's not an improvement).

I`m not sure if You have problem with line above, but to disable it uncheck ToolBar2.edgeBorder.top

Darek

Index: include/speedbutton.inc
===================================================================
--- include/speedbutton.inc     (wersja 9299)
+++ include/speedbutton.inc     (kopia robocza)
@@ -279,6 +279,8 @@
   if FFlat and not FMouseInControl and not (FState in [bsDown, bsExclusive]) 
then
   begin
     Result := DFCS_FLAT;
+    if not Enabled then
+      inc(Result,DFCS_INACTIVE)
   end else begin
     Result:=DFCS_BUTTONPUSH;
     if FState in [bsDown, bsExclusive] then 
@@ -413,13 +415,9 @@
   // do not draw anything if flat and mouse not in control (simplified)
   if Transparent then begin
     if (FLastDrawFlags and DFCS_FLAT) = 0 then begin
-      if MouseInControl then begin
        if (FLastDrawFlags and DFCS_PUSHED) <>0 then xBevel := bvLowered
                                                else xBevel := bvRaised;
         Canvas.Frame3D(PaintRect,1,xBevel);
-      end else if (FLastDrawFlags and DFCS_PUSHED) <>0 then begin
-        Canvas.Frame3D(PaintRect,1,bvLowered);
-      end;
       InflateRect(PaintRect, -1, -1);
     end;
   end else begin
@@ -745,7 +743,6 @@
 begin
   inherited MouseEnter;
   if csDesigning in ComponentState then exit;
-
   if not FMouseInControl
   and Enabled and (GetCapture = 0)
   then begin

Reply via email to