On Sat, 04 Mar 2006 12:31:05 +0100
darekm <[EMAIL PROTECTED]> wrote:

>[...]
> I talk about tSpeedButton not tButton

A normal TSpeedButton should look like a normal button.
Only if you set some custom colors, then it can paint some non theme button.

> >>>I don't know, what windows can do with DrawFrameControl, but under gtk
> >it >>draws an area in a specific style. If this is a button style, and
> >the >>theme defines an image, it paints it.
> >>>
> >>>      
> >>>
> >>If I want (as programmer) to one of buttons will be red, user should'n 
> >>change it by change theme
> >>    
> >>
> >
> >Correct. But if you want a 'red' button, then you want a custom drawn
> >button, not a TButton.
> >If 'red' buttons are needed that often, then we should add a
> >TCustomDrawnButton (or whatever name fits) with properties like Color,
> >Frame, BorderWidth, TextAlignment, WordWrap, ... .
> >This has five advantages:
> >- the button will really look the same under all platforms
> >- less code in LCL interfaces
> >- better for smartlinking
> >- more flexibility
> >- cleaner design (themed and non themed controls)
> >  
> >
> that's what for is property color,
> and maybe order should be different: first without theme and second 
> (inherited) with.
> or (better) tControl should have property - with or without theme

The theme is the default. And painting the theme requires only a call to the
widgetset, while custom painting requires extra code. I don't see, why a
themed control would descend from a non themed control. Or maybe I
misunderstood you here?
About the Theme property: IMHO this property would be redundant and/or
readonly. Can you give an example, where it is needed?

> >>>>for tButton all depend from widgets, but for me in tSpeedButton all 
> >>>>should be independent. (GTK has't two widgets)
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>Gtk has less widgets, because the idea is combine them. A TGroupbox is
> >a >>single widget under windows, while under gtk it needs two. For gtk it
> >is >>pretty normal to put a 'listbox' into a menu. That's why you have
> >more >>possibilties.
> >>>A TSpeedButton that is used a button and that draws some rectangles,
> >when >>all other widgets on the application have shaded round widgets
> >looks very >>ugly. Especially if you use broken themes, that merely
> >defines images and >>no colors.
> >>>      
> >>>
> >>DrawFrameControl not avoid this
> >>    
> >>
> >
> >It should. If not, you found a bug.
> >  
> >
> 
> DrawFrameControl use only two function
>       If (Shadow=GTK_SHADOW_NONE) then
>         gtk_paint_flat_box(aStyle,aDC.Drawable,
>       else
>         gtk_paint_box(aStyle,aDC.Drawable,
> 
> both draw rectangle,
> As I know, Style either don't have place to set rounded widgets
> It can only set pixmap (that's is only difference to windows)

Correct. They look as if they are round, but it's an illusion. Just as
Frame3D - the frame is not 3D.
But Frame3D only paints a frame without content, while DrawFrameControl
draws a whole control.
Of course this is an extension to the winapi definition. It is done so,
because all the Delphi code using those functions, will look pretty on other
platforms.


> and we not use this to tButton, then why use it to tSpeedButton

TButton has less properties, so it represents the normal button of the
widgetset.
TSpeedButton has some more features (group, down, flat).


> >>>>it's only my suggestion
> >>>>        
> >>>>
> >>>What is the trouble with theme painted speedbuttons?
> >>>      
> >>>
> >>it's not work
> >>    
> >>
> >
> >Can you give more details?
> >  
> >
> 
> simple: when I set color:=clRed then not change color (like in others 
> controls)

The solution is simple: if color<>clBtnFace then paint a custom button.
The question is only, how to implement it.
The easiest would be to extend TSpeedButton.Paint with a 

if (Color<>clBtnFace) or (... other properties ...) then 
  PaintCustomSpeedButton
else 
  PaintThemeButton


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to