On Sat, 14 Jan 2006 14:31:34 +0100
Martin Smat <[EMAIL PROTECTED]> wrote:
> 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.
If you call a function, at least one WSSpeedButton class must be registered.
Since you define a default method, you must register TWSSpeedButton in
wsbuttons.pp and the win32 override.
> But for example GTK2 does not register TGtk2WSButton at
> all and is working.
The gtk2 inherites from gtk, so it includes the gtk.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives