Mattias Gaertner wrote:
I asked because I'm preparing a patch for speedbuttons to shift the
image one pixel right and down when pushed. This feature is dependent on
used interface. This behavior is only for Win32 interface, GTK does not
shift images on pushed buttons.
So I added new procedure to TWSSpeedButton and override it in
TWin32WSSpeedButton where I uncommented the command for registration of
this class: RegisterWSComponent(TCustomSpeedButton, TWin32WSSpeedButton);
After compiling everything seems to work well but my question is if I
have to uncomment the registration command in GTK interface where this
method is not implemented (there is no image shift).
Why do you need a method in the gtk interface for this?
Why not add a flag method TWSSpeedButton.GetPaintStyle(out DownOffset:
TPoint);
with default value 0,0 and overriden in TWin32WSSpeedButton with 2,2 (or
whatever offset)?
Mattias
Maybe I was not very precise. I don't need any gtk interface method.
I have this method: procedure TWSSpeedButton.PreparePaintRect(const
ASpeedBtn: TCustomSpeedButton; const APaintRect: PRect; const
ADrawFlags: integer);
and it is implemented in the TWin32WSSpeedButton:
procedure TWin32WSSpeedButton.PreparePaintRect(const ASpeedBtn:
TCustomSpeedButton; const APaintRect: PRect; const ADrawFlags: integer);
begin
if (ADrawFlags and DFCS_PUSHED) = 0 then OffsetRect(APaintRect^, -1, -1);
end;
There is no implementation of this method in TGtkWSSpeedButton, GTK does
not shift the image.
The question is if I have to uncomment the RegisterWSComponent command
for TGtkWSSpeedButton if it does not implement the method. I would say
yes because when I don't uncomment it for TWin32WSSpeedButton then
Lazarus crashes. But for example GTK2 does not register TGtk2WSButton at
all and is working.
Martin.
Martin.
Hi,
when I comment the command RegisterWSComponent(TCustomBitBtn,
TWin32WSBitBtn); in file win32wsbuttons.pp in win32 interface, Lazarus
crashes.
How is then possible that GTK2 interface is working (I suppose it is
working, did not try) and has this command commented out?
Martin.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives