lazarus/lcl/interfaces/gtk/gtkwscontrols.pp
marc 2d80402433 * Fixed compilation for gtk2
git-svn-id: trunk@5414 -
2004-04-19 09:30:04 +00:00

146 lines
4.9 KiB
ObjectPascal

{ $Id$}
{
*****************************************************************************
* GtkWSControls.pp *
* ---------------- *
* *
* *
*****************************************************************************
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.LCL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
unit GtkWSControls;
{$mode objfpc}{$H+}
interface
uses
{$IFDEF GTK2} Gtk2, {$ELSE} Gtk, {$ENDIF}
////////////////////////////////////////////////////
// I M P O R T A N T
////////////////////////////////////////////////////
// To get as little as posible circles,
// uncomment only when needed for registration
////////////////////////////////////////////////////
Controls,
////////////////////////////////////////////////////
Classes, LMessages,
WSControls, WSLCLClasses;
type
{ TGtkWSDragImageList }
TGtkWSDragImageList = class(TWSDragImageList)
private
protected
public
end;
{ TGtkWSControl }
TGtkWSControl = class(TWSControl)
private
protected
public
end;
{ TGtkWSWinControl }
TGtkWSWinControl = class(TWSWinControl)
private
protected
public
class procedure SetCallbacks(const AGTKObject: PGTKObject; const AComponent: TComponent);
class procedure SetCursor(const AControl: TControl; const ACursor: TCursor); override;
end;
{ TGtkWSGraphicControl }
TGtkWSGraphicControl = class(TWSGraphicControl)
private
protected
public
end;
{ TGtkWSCustomControl }
TGtkWSCustomControl = class(TWSCustomControl)
private
protected
public
end;
{ TGtkWSImageList }
TGtkWSImageList = class(TWSImageList)
private
protected
public
end;
implementation
uses
GtkProc, GtkDef, GtkInt;
{ TGtkWSWinControl }
procedure TGtkWSWinControl.SetCallbacks(const AGTKObject: PGTKObject; const AComponent: TComponent);
//TODO: Remove ALCLObject when the creation splitup is finished
begin
GtkWidgetSet.SetCallback(LM_SHOWWINDOW, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_DESTROY, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_FOCUS, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_WINDOWPOSCHANGED, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_PAINT, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_EXPOSEEVENT, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_KEYDOWN, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_KEYUP, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_CHAR, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_MOUSEMOVE, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_LBUTTONDOWN, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_LBUTTONUP, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_RBUTTONDOWN, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_RBUTTONUP, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_MBUTTONDOWN, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_MBUTTONUP, AGTKObject, AComponent);
GtkWidgetSet.SetCallback(LM_MOUSEWHEEL, AGTKObject, AComponent);
end;
procedure TGtkWSWinControl.SetCursor(const AControl: TControl; const ACursor: TCursor);
begin
GtkProc.SetCursor(AControl as TWinControl, ACursor);
end;
initialization
////////////////////////////////////////////////////
// I M P O R T A N T
////////////////////////////////////////////////////
// To improve speed, register only classes
// which actually implement something
////////////////////////////////////////////////////
// RegisterWSComponent(TDragImageList, TGtkWSDragImageList);
// RegisterWSComponent(TControl, TGtkWSControl);
RegisterWSComponent(TWinControl, TGtkWSWinControl);
// RegisterWSComponent(TGraphicControl, TGtkWSGraphicControl);
// RegisterWSComponent(TCustomControl, TGtkWSCustomControl);
// RegisterWSComponent(TImageList, TGtkWSImageList);
////////////////////////////////////////////////////
end.