TPanel implemented.

Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.

git-svn-id: trunk@653 -
This commit is contained in:
lazarus 2002-02-03 00:24:02 +00:00
parent d2c64aa547
commit c9e180acac
62 changed files with 2537 additions and 1484 deletions

3
.gitattributes vendored
View File

@ -343,6 +343,7 @@ lcl/extctrls.pp svneol=native#text/pascal
lcl/filectrl.pp svneol=native#text/pascal
lcl/forms.pp svneol=native#text/pascal
lcl/graphics.pp svneol=native#text/pascal
lcl/graphtype.pp svneol=native#text/pascal
lcl/imglist.pp svneol=native#text/pascal
lcl/include/alignment.inc svneol=native#text/pascal
lcl/include/application.inc svneol=native#text/pascal
@ -375,6 +376,7 @@ lcl/include/customlistbox.inc svneol=native#text/pascal
lcl/include/customlistview.inc svneol=native#text/pascal
lcl/include/custommemo.inc svneol=native#text/pascal
lcl/include/customnotebook.inc svneol=native#text/pascal
lcl/include/custompanel.inc svneol=native#text/pascal
lcl/include/customradiogroup.inc svneol=native#text/pascal
lcl/include/defaultbitbtnimages.inc svneol=native#text/pascal
lcl/include/dragobject.inc svneol=native#text/pascal
@ -481,6 +483,7 @@ lcl/interfaces/win32/win32winapih.inc svneol=native#text/pascal
lcl/interfaces/win32/winext.pas svneol=native#text/pascal
lcl/lazqueue.pp svneol=native#text/pascal
lcl/lcllinux.pp svneol=native#text/pascal
lcl/lcltype.pp svneol=native#text/pascal
lcl/lmessages.pp svneol=native#text/pascal
lcl/lresources.pp svneol=native#text/pascal
lcl/menus.pp svneol=native#text/pascal

View File

@ -43,6 +43,7 @@ interface
uses
{$IFDEF SYN_LAZARUS}
LCLLinux, LMessages,
LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -65,6 +65,7 @@ interface
uses
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -46,6 +46,7 @@ interface
uses
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -41,6 +41,7 @@ uses
Graphics,
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -43,7 +43,7 @@ interface
uses
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLLinux, LCLType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -44,6 +44,7 @@ interface
uses
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -44,6 +44,7 @@ interface
uses
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -109,6 +109,7 @@ implementation
uses
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -45,6 +45,7 @@ uses
Classes, SysUtils,
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -52,7 +52,7 @@ interface
uses
SysUtils,
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLLinux, LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -50,7 +50,7 @@ interface
uses
SysUtils,
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLLinux, LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -55,6 +55,7 @@ uses
{$ELSE}
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -54,6 +54,7 @@ uses
SysUtils,
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -57,6 +57,7 @@ uses
{$ELSE}
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -62,6 +62,7 @@ uses
{$ELSE}
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -71,7 +71,7 @@ interface
uses
{$IFDEF SYN_LAZARUS}
LCLLinux,
LCLLinux, LCLType, GraphType,
{$ELSE}
Windows,
{$ENDIF}

View File

@ -25,7 +25,7 @@ unit ControlSelection;
interface
uses
Classes, LCLLinux, Controls, Forms, Graphics,SysUtils;
Classes, LCLLinux, LCLType, Controls, Forms, GraphType, Graphics, SysUtils;
type

View File

@ -25,7 +25,7 @@ unit designer;
interface
uses
Classes, LCLLinux, Forms, Controls, LMessages, Graphics, ControlSelection,
Classes, LCLType, LCLLinux, Forms, Controls, LMessages, Graphics, ControlSelection,
CustomFormEditor, FormEditor, UnitEditor, CompReg, Menus, AlignCompsDlg,
SizeCompsDlg, ScaleCompsDlg, ExtCtrls;

View File

@ -28,7 +28,7 @@ unit objectinspector;
interface
uses
Forms, SysUtils, Buttons, Classes, Graphics, StdCtrls, LCLLinux, Controls,
Forms, SysUtils, Buttons, Classes, Graphics, GraphType, StdCtrls, LCLType, LCLLinux, Controls,
ComCtrls, ExtCtrls, PropEdits, TypInfo, Messages, LResources, XMLCfg, Menus,
Dialogs;

View File

@ -28,7 +28,7 @@ unit propedits;
interface
uses
Classes, TypInfo, SysUtils, Forms, Controls, Graphics, StdCtrls, Buttons,
Classes, TypInfo, SysUtils, Forms, Controls, GraphType, Graphics, StdCtrls, Buttons,
ComCtrls;
const

View File

@ -25,13 +25,15 @@ program checkbox;
{$mode objfpc}
uses
classes, stdctrls,forms,buttons,menus,comctrls,sysutils, extctrls;
classes, stdctrls, forms, buttons, menus, comctrls, sysutils,
extctrls, graphtype, controls;
type
TForm1 = class(TFORM)
public
Button2: TButton;
Button3: TButton;
Panel1: TPanel;
mnuMain: TMainMenu;
itmFileQuit: TMenuItem;
itmFile: TMenuItem;
@ -79,6 +81,7 @@ Begin
begin
CheckBox1.Checked := not CheckBox1.Checked;
end;
Panel1.Caption:= 'Changed';
End;
procedure TForm1.Button3Click(Sender : TObject);
@ -183,13 +186,31 @@ begin
label1.Show;
label1.Caption := 'unchecked';
{ Sample panel here }
Panel1:= TPanel.Create(Self);
with Panel1 do begin
Parent := Self;
Left := 320;
Top := 60;
Width := 280;
Height := 81;
Alignment:= taRightJustify;
BevelInner:= bvLowered;
BevelOuter:= bvRaised;
BorderWidth:= 4;
BevelWidth:= 4;
Show;
Caption:= 'Hello world';
end;
{ Create a button which toggles the checkbox }
Button2 := TButton.Create(Self);
Button2.Parent := Self;
Button2.Left := 320;
Button2.Top := 30;
Button2 := TBitBtn.Create(Self);
Button2.Parent := Panel1;
Button2.Left := 5;
Button2.Top := 45;
Button2.Width := 180;
Button2.Height := 30;
Button2.Height := 20;
Button2.Show;
Button2.Caption := 'Toggle checkbox';
Button2.OnClick := @Button2Click;
@ -344,6 +365,14 @@ end.
{
$Log$
Revision 1.2 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.1 2000/07/13 10:28:20 michael
+ Initial import

View File

@ -3,8 +3,7 @@ program SpeedTest;
{$mode Delphi}
uses
forms, sysutils, Buttons, Classes, Graphics,
StdCtrls, LCLLinux;
forms, sysutils, Buttons, Classes, StdCtrls, LCLType, LCLLinux, Graphics;
type
TForm1 = class(TForm)

View File

@ -31,7 +31,7 @@ interface
uses classes, forms, buttons, StdCtrls, controls, menus, ExtCtrls, CListBox,
ComCtrls, SysUtils, Graphics, Dialogs, Inifiles, Spin, clipbrd, lclLinux,
ComCtrls, SysUtils, GraphType, Graphics, Dialogs, Inifiles, Spin, clipbrd, lclLinux,
registry, lresources;
type
@ -2540,6 +2540,14 @@ END.
{
$Log$
Revision 1.6 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.5 2001/12/10 07:47:00 lazarus
MG: minor fixes

View File

@ -25,8 +25,9 @@ interface
uses
LCLLinux,
LCLType,
Forms, Classes, SysUtils, ComCtrls, Buttons, StdCtrls, ExtCtrls, LazConf,
FileCtrl, Graphics, Controls, Dialogs, LResources, IDEProcs,
FileCtrl, GraphType, Graphics, Controls, Dialogs, LResources, IDEProcs,
{$ifdef NEW_EDITOR_SYNEDIT}
SynEdit, SynEditHighlighter, SynEditAutoComplete, SynEditKeyCmds,
SynHighlighterPas, SynHighlighterHTML, SynHighlighterCPP, SynHighlighterXML,

View File

@ -29,7 +29,7 @@ uses
{$IFDEF IDE_MEM_CHECK}
MemCheck,
{$ENDIF}
Classes, SysUtils, LCLLinux, Controls, Forms, Buttons, StdCtrls, ComCtrls,
Classes, SysUtils, LCLType, Controls, Forms, Buttons, StdCtrls, ComCtrls,
Dialogs, ExtCtrls, LResources, XMLCfg, ExtToolEditDlg, Process, KeyMapping,
TransferMacros, IDEProcs, OutputFilter;

View File

@ -32,7 +32,7 @@ uses
{$IFDEF IDE_MEM_CHECK}
MemCheck,
{$ENDIF}
Classes, SysUtils, LCLLinux, Controls, Forms, Buttons, StdCtrls, ComCtrls,
Classes, SysUtils, LCLType, Controls, Forms, Buttons, StdCtrls, ComCtrls,
Dialogs, ExtCtrls, LResources, XMLCfg, KeyMapping, TransferMacros;
{ The xml format version:

View File

@ -25,7 +25,7 @@ unit FindReplaceDialog;
interface
uses
Classes, SysUtils, LCLLinux, Controls, StdCtrls, Forms, Buttons, ExtCtrls,
Classes, SysUtils, LCLType, Controls, StdCtrls, Forms, Buttons, ExtCtrls,
LResources, SynEdit, IDEProcs;
type

View File

@ -301,6 +301,7 @@ begin
RegisterComponents('Standard','Buttons',[TButton]);
RegisterComponents('Standard','StdCtrls',[TEdit,TLabel,TMemo,TCheckBox
,TListBox,TRadioButton,TComboBox,TScrollBar,TGroupBox,TToggleBox]);
RegisterComponents('Standard', 'ExtCtrls',[TPanel]);
RegisterComponents('Additional','Buttons',[TBitBtn,TSpeedButton]);
RegisterComponents('Additional','ExtCtrls',[TNoteBook,TPaintBox
,TBevel,TRadioGroup,TImage]);

View File

@ -25,6 +25,7 @@ interface
uses
LCLLinux,
LCLType,
Forms, Classes, SysUtils, Buttons, LResources, StdCtrls, Controls,
SynEdit, SynEditKeyCmds, XMLCfg, Dialogs;

View File

@ -27,7 +27,7 @@ uses
{$IFDEF IDE_MEM_CHECK}
MemCheck,
{$ENDIF}
Classes, SysUtils, LCLLinux, Controls, Forms, Buttons, StdCtrls, ComCtrls,
Classes, SysUtils, LCLType, Controls, Forms, Buttons, StdCtrls, ComCtrls,
Dialogs, LResources;

View File

@ -32,7 +32,7 @@ uses
{$IFDEF IDE_MEM_CHECK}
MemCheck,
{$ENDIF}
Classes, LclLinux, Compiler, StdCtrls, Forms, Buttons, Menus, ComCtrls, Spin,
Classes, LCLType, LclLinux, Compiler, StdCtrls, Forms, Buttons, Menus, ComCtrls, Spin,
Project, SysUtils, FileCtrl, Controls, Graphics, ExtCtrls, Dialogs, LazConf,
CompReg, CodeToolManager, CodeCache, DefineTemplates, MsgView, NewProjectDlg,
IDEComp, AbstractFormEditor, FormEditor, CustomFormEditor, ObjectInspector,
@ -57,6 +57,8 @@ type
TIDEToolStatus = (itNone, itBuilder, itDebugger, itCustom);
TMainIDE = class(TForm)
pnlSpeedButtons : TPanel;
ViewUnitsSpeedBtn : TSpeedButton;
ViewFormsSpeedBtn : TSpeedButton;
NewUnitSpeedBtn : TSpeedButton;
@ -917,8 +919,8 @@ procedure TMainIDE.LoadSpeedbuttons;
with Result do
begin
Name := AName;
// Parent := pnlSpeedButtons;
Parent := Self;
Parent := pnlSpeedButtons;
// Parent := Self;
Enabled := True;
Top := ATop;
Left := ALeft;
@ -939,21 +941,26 @@ var
ButtonTop, ButtonLeft, n: Integer;
begin
(*
pnlSpeedButtons := TPanel.Create(Self);
with pnlSpeedButtons do
begin
Parent := Self;
pnlSpeedButtons.Parent:= Self;
with pnlSpeedButtons do begin
Visible := True;
Name := 'pnlSpeedButtons';
Top := 0;
Caption := '';
Left:= 0;
// Width:= 160;
// Height:= 60;
Caption:= '';
end;
*)
ButtonTop := 1;
ButtonLeft := 1;
Writeln('XXX Creating NewUnit Button');
NewUnitSpeedBtn := CreateButton('NewUnitSpeedBtn' , 'btn_newunit' , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuNewUnitClicked, 'New Unit');
Writeln('XXX Creating OpenFile Button');
OpenFileSpeedBtn := CreateButton('OpenFileSpeedBtn' , 'btn_openfile' , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuOpenClicked, 'Open');
// store left
@ -978,8 +985,8 @@ begin
StepIntoSpeedButton := CreateButton('StepIntoSpeedButton' , 'btn_stepinto' , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuStepIntoProjectClicked, 'Step Into');
StepOverSpeedButton := CreateButton('StepOverpeedButton' , 'btn_stepover' , 1, ButtonLeft, ButtonTop, [mfLeft, mfTop], @mnuStepOverProjectClicked, 'Step Over');
// pnlSpeedButtons.Width := ButtonLeft;
// pnlSpeedButtons.Height := ButtonTop;
pnlSpeedButtons.Width := ButtonLeft;
pnlSpeedButtons.Height := ButtonTop;
// create the popupmenu for the OpenFileArrowSpeedBtn
@ -5707,6 +5714,14 @@ end.
=======
$Log$
Revision 1.208 2002/02/03 00:23:54 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.207 2002/01/27 19:08:43 lazarus
MWE: Removed ^M
@ -5762,6 +5777,14 @@ end.
<<<<<<< main.pp
$Log$
Revision 1.208 2002/02/03 00:23:54 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.207 2002/01/27 19:08:43 lazarus
MWE: Removed ^M

View File

@ -31,7 +31,7 @@ unit Project;
interface
uses
Classes, SysUtils, LCLLinux, XMLCfg, LazConf, CompilerOptions, FileCtrl,
Classes, SysUtils, LCLLinux, LCLType, XMLCfg, LazConf, CompilerOptions, FileCtrl,
CodeToolManager, CodeCache, Forms, Controls, EditorOptions, Dialogs, IDEProcs,
RunParamsOpts, ProjectDefs;
@ -1287,6 +1287,14 @@ end.
{
$Log$
Revision 1.48 2002/02/03 00:23:55 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.47 2001/12/19 22:09:14 lazarus
MG: added GUID and alias parsing, added DoJumpToCodeToolBossError

View File

@ -35,7 +35,7 @@ uses
FindReplaceDialog, EditorOptions, CustomFormEditor, KeyMapping, StdCtrls,
Compiler, MsgView, WordCompletion, CodeToolManager, CodeCache, SourceLog,
SynEdit, SynEditHighlighter, SynHighlighterPas, SynEditAutoComplete,
SynEditKeyCmds, SynCompletion, Graphics, Extctrls, Menus, Splash,
SynEditKeyCmds, SynCompletion, GraphType, Graphics, Extctrls, Menus, Splash,
FindInFilesDlg, LMessages, IDEProcs;
type
@ -458,7 +458,7 @@ type
implementation
uses
LCLLinux, TypInfo, LResources, LazConf, EnvironmentOpts, UnitInfoDlg;
LCLType, LCLLinux, TypInfo, LResources, LazConf, EnvironmentOpts, UnitInfoDlg;
type
TCompletionType = (ctNone, ctWordCompletion, ctTemplateCompletion,

View File

@ -10,7 +10,7 @@ unit UnitInfoDlg;
interface
uses
Classes, SysUtils, LCLLinux, Controls, StdCtrls, Forms, Buttons, ExtCtrls{,
Classes, SysUtils, Controls, StdCtrls, Forms, Buttons, ExtCtrls{,
LResources, SynEdit};
type

View File

@ -33,7 +33,7 @@ interface
{$ASSERTIONS ON}
{$endif}
uses stdctrls, vclglobals, classes, LCLLinux,graphics,sysutils, controls, lMessages,Forms, messages;
uses stdctrls, vclglobals, classes, LCLType, LCLLinux,graphics,sysutils, controls, lMessages,Forms, messages;
type
TButtonLayout = (blGlyphLeft, blGlyphRight, blGlyphTop, blGlyphBottom);
@ -149,33 +149,29 @@ type
TSpeedButton = class(TGraphicControl)
private
FAllowAllUp : Boolean;
FDown : Boolean;
FDragging : Boolean;
FDown : Boolean;
FFlat : Boolean;
FFlat : Boolean;
FGlyph: TButtonGlyph;
FGroupIndex : Integer;
FLayout: TButtonLayout;
FMargin : Integer;
FMouseInControl : Boolean;
FSpacing : Integer;
FState : TButtonState;
FTransparent : Boolean;
Function GetGlyph : TBitmap;
Function GetNumGlyphs : Integer;
Procedure UpdateExclusive;
Procedure UpdateTracking;
Procedure SetAllowAllUp(Value : Boolean);
Procedure SetDown(Value : Boolean);
Procedure SetFlat(Value : Boolean);
Procedure SetGlyph(value : TBitmap);
Procedure SetGroupIndex(value : Integer);
Procedure SetNumGlyphs(value : Integer);
//there should be a procedure called settransparent but it's not used at this point
Procedure CMButtonPressed(var MEssage : TLMessage); message CM_BUTTONPRESSED;
Procedure CMMouseEnter(var Message :TLMessage); message CM_MouseEnter;
Procedure CMMouseLeave(var Message :TLMessage); message CM_MouseLeave;
Procedure CMEnabledChanged(var Message: TLMessage); message CM_ENABLEDCHANGED;
protected
FState : TButtonState;
function GetNumGlyphs : Integer;
Procedure GlyphChanged(Sender : TObject);
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
@ -183,19 +179,23 @@ type
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
Procedure Paint; override;
procedure SetDown(Value : Boolean);
procedure SetGroupIndex(Value : Integer);
procedure SetFlat(Value : Boolean);
procedure SetNumGlyphs(Value : Integer);
property MouseInControl : Boolean read FMOuseInControl;
public
constructor Create(AOwner : TCOmponent) ; override;
constructor Create(AOwner : TComponent); override;
destructor Destroy; override;
procedure Click; override;
property Down : Boolean read FDown write SetDown default false;
property GroupIndex : Integer read FGroupIndex write SetGroupIndex default 0;
property Flat : Boolean read FFlat write SetFlat default false;
property NumGlyphs : Integer read GetNumGlyphs write SetNumGlyphs default 1;
published
property AllowAllUp : Boolean read FAllowAllUp write SetAllowAllUp default false;
property Down : Boolean read FDown write SetDown default False;
property Enabled;
property Flat : Boolean read FFlat write SetFlat default False;
property Glyph : TBitmap read GetGlyph write SetGlyph;
property GroupIndex : Integer read FGroupIndex write SetGroupIndex default 0;
property NumGlyphs : Integer read GetNumGlyphs write SetNumGlyphs default 1;
property Transparent : Boolean read FTransparent write FTransparent default false;
property Visible;
property OnClick;
@ -237,6 +237,14 @@ end.
{ =============================================================================
$Log$
Revision 1.11 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.10 2001/10/16 10:51:09 lazarus
MG: added clicked event to TButton, MessageDialog reacts to return key

View File

@ -124,7 +124,7 @@ interface
{$endif}
uses
Classes, SysUtils, LCLLinux, Graphics;
Classes, SysUtils, LCLType, LCLLinux, GraphType, Graphics;
type
TClipboardData = record
@ -405,6 +405,14 @@ end.
{
$Log$
Revision 1.6 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.5 2001/11/12 19:30:00 lazarus
MG: added try excepts for clipboard

View File

@ -32,8 +32,8 @@ unit ComCtrls;
interface
uses
SysUtils, Classes, Controls, LclLinux, StdCtrls, ExtCtrls, vclGlobals,
lMessages, Menus, ImgList, Graphics, ToolWin;
SysUtils, Classes, Controls, LclLinux, LCLType, StdCtrls, ExtCtrls, vclGlobals,
lMessages, Menus, ImgList, GraphType, Graphics, ToolWin;
const
@ -1747,6 +1747,14 @@ end.
{ =============================================================================
$Log$
Revision 1.18 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.17 2002/01/08 16:02:43 lazarus
Minor changes to TListView.
Added TImageList to the IDE

View File

@ -36,7 +36,7 @@ interface
uses
Classes, SysUtils, vclglobals, Graphics, LMessages, LCLLinux, ImgList, UTrace,
Menus;
Menus, LCLType;
// Cursor constants
@ -218,6 +218,7 @@ TCMDialogKey = TLMKEY;
TFormStyle = (fsNormal, fsMDIChild, fsMDIFORM, fsStayOnTop);
TFormBorderStyle = (bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin);
TBorderStyle = bsNone..bsSingle;
TControlBorderStyle = TBorderStyle;
TMouseButton = (mbLeft, mbRight, mbMiddle);
@ -239,7 +240,8 @@ TCMDialogKey = TLMKEY;
csDisplayDragImage,
csReflector,
csActionClient,
csMenuEvents);
csMenuEvents,
csNoFocus);
TControlState = set of (csLButtonDown,
csClicked,
@ -728,7 +730,7 @@ TCMDialogKey = TLMKEY;
property ControlCount: Integer read GetControlCount;
property Handle : HWND read GetHandle write SetHandle;
property Showing : Boolean read FShowing;
property TabStop : Boolean read FTabStop write FTabStop;
property TabStop : Boolean read FTabStop write FTabStop default false;
property TabOrder : TTabOrder read GetTabOrder write SetTaborder default -1;
end;
@ -1151,6 +1153,14 @@ end.
{ =============================================================================
$Log$
Revision 1.31 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.30 2002/01/04 21:07:49 lazarus
MG: added TTreeView

View File

@ -41,7 +41,7 @@ interface
{$endif}
uses
SysUtils, Classes, Controls, stdCtrls, vclGlobals, lMessages,Graphics;
SysUtils, Classes, Controls, stdCtrls, vclGlobals, lMessages, GraphType, Graphics, LCLLinux;
type
{ workaround problem with fcl }
@ -332,6 +332,82 @@ type
property OnClick;
end;
TPanelBevel = TBevelCut;
TBevelWidth = 1..Maxint;
TBorderWidth = 0..Maxint;
TCustomPanel = class(TCustomControl)
private
FBevelInner, FBevelOuter : TPanelBevel;
FBevelWidth : TBevelWidth;
FBorderWidth : TBorderWidth;
FBorderStyle : TControlBorderStyle;
FAlignment : TAlignment;
FCaption : TCaption;
procedure SetAlignment(const Value : TAlignment);
procedure SetBevelInner(const Value: TPanelBevel);
procedure SetBevelOuter(const Value: TPanelBevel);
procedure SetBevelWidth(const Value: TBevelWidth);
procedure SetBorderWidth(const Value: TBorderWidth);
procedure SetBorderStyle(const Value: TControlBorderStyle);
protected
procedure AdjustClientRect(var Rect: TRect); override;
function GetText: TCaption; override;
procedure SetText(const Value: TCaption); override;
procedure Paint; override;
property Alignment: TAlignment read FAlignment write SetAlignment default taCenter;
property BevelInner: TPanelBevel read FBevelInner write SetBevelInner default bvNone;
property BevelOuter: TPanelBevel read FBevelOuter write SetBevelOuter default bvRaised;
property BevelWidth: TBevelWidth read FBevelWidth write SetBevelWidth default 1;
property BorderWidth: TBorderWidth read FBorderWidth write SetBorderWidth default 0;
property BorderStyle: TControlBorderStyle read FBorderStyle write SetBorderStyle default bsNone;
property Color default clBtnFace;
property Caption read GetText write SetText;
property ParentColor default True;
public
constructor Create(AOwner: TComponent); override;
procedure Invalidate; override;
end;
TPanel = class(TCustomPanel)
published
property Align default alNone;
property Alignment;
property Anchors;
property BevelInner;
property BevelOuter;
property BevelWidth;
property BorderWidth;
property BorderStyle;
property Caption;
property Color default clBackground;
property DragMode;
property Enabled;
property Font;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop default False;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDrag;
end;
const
TCN_First = 0-550;
TCN_SELCHANGE = TCN_FIRST - 1;
@ -346,6 +422,7 @@ implementation
{$I timer.inc}
{$I paintbox.inc}
{$I customradiogroup.inc}
{$I custompanel.inc}
{$I radiogroup.inc}
{$I bevel.inc}
{$I image.inc}
@ -355,6 +432,14 @@ end.
{
$Log$
Revision 1.17 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.16 2002/01/01 15:50:13 lazarus
MG: fixed initial component aligning

View File

@ -34,7 +34,8 @@ interface
{$ASSERTIONS ON}
{$endif}
uses classes, controls, vclglobals, sysutils,graphics,Menus, LCLLinux,LMessages;
uses classes, controls, vclglobals, sysutils, GraphType, Graphics, Menus,
LCLLinux, LCLType, LMessages;
type
TPosition = (poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly, poScreenCenter, poDesktopCenter, poMainFormCenter, poOwnerFormCenter);

View File

@ -28,14 +28,12 @@ interface
{$endif}
uses
SysUtils, Classes, vclGlobals, LMessages, LCLLinux, LResources;
GraphType, SysUtils, Classes, vclGlobals, LMessages, LCLType, LCLLinux, LResources;
type
TColor = longint; //Also defined in LMessages.pp
const
// The follow colors match the predefined Delphi Colors
// TODO : kick these out into platform specific units!
clBlack = TColor($000000);
clMaroon = TColor($000080);
clGreen = TColor($008000);
@ -111,58 +109,19 @@ const
cmSrcPaint = SRCPAINT;
cmWhiteness = WHITENESS;
type
TFontPitch = (fpDefault, fpVariable, fpFixed);
TFontName = shortstring;
TFontStyle = (fsBold, fsItalic, fsStrikeOut, fsUnderline);
TFontCharSet = 0..255;
TFontDataName = string[LF_FACESIZE -1];
TFontStyles = set of TFontStyle;
TFOntStylesbase = set of TFontStyle;
TFontData = record
Handle : HFont;
Height : Integer;
Pitch : TFontPitch;
Style : TFontStylesBase;
CharSet : TFontCharSet;
Name : TFontDataName;
end;
TPenStyle = (psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideframe);
TPenMode = (pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot,
pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge,pmNotMerge, pmMask,
pmNotMask, pmXor, pmNotXor
);
TPenData = record
Handle : HPen;
Color : TColor;
Width : Integer;
Style : TPenStyle;
end;
TBitmap = class; //forward declaration
TBrushStyle = (bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross);
TBrushData = record
Handle : HBrush;
Color : TColor;
Bitmap : TBitmap;
Style : TBrushStyle;
end;
TGraphicsObject = class(TPersistent)
private
FOnChange: TNotifyEvent;
Procedure DoChange(var msg); message LM_CHANGED;
protected
procedure Changed; dynamic;
Procedure Lock;
Procedure UnLock;
public
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
@ -240,6 +199,14 @@ type
property Width: Integer read FPenData.Width write SetWidth;
end;
TBrushData = record
Handle : HBrush;
Color : TColor;
Bitmap : TBitmap;
Style : TBrushStyle;
end;
TBrush = class(TgraphicsObject)
private
FBrushData : TBrushData;
@ -263,20 +230,6 @@ type
property Style: TBrushStyle read FBrushData.Style write SetStyle;
end;
TFillStyle = (fsSurface, fsBorder);
TFillMode = (fmAlternate, fmWinding);
TCopymode = longint;
TCanvasStates = (csHandleValid, csFontValid, csPenvalid, csBrushValid);
TCanvasState = set of TCanvasStates;
TCanvasOrientation = (csLefttoRight, coRighttoLeft);
TProgressStage = (psStarting, psRunning, psEnding);
TProgressEvent = procedure (Sender: TObject; Stage: TProgressStage;
PercentDone: Byte; RedrawNow: Boolean; const R: TRect;
const Msg: string) of object;
TCanvas = class;
TGraphic = class(TPersistent)
@ -455,13 +408,16 @@ type
NumPts: Integer {$IFDEF VER1_1} = -1{$ENDIF});
procedure Polyline(Points: PPoint; NumPts: Integer);
Procedure FillRect(const Rect : TRect);
procedure Frame3d(var Rect : TRect; const FrameWidth : integer; const Style : TBevelCut);
Procedure Rectangle(X1,Y1,X2,Y2 : Integer);
Procedure Rectangle(const Rect: TRect);
Procedure Line(X1,Y1,X2,Y2 : Integer);
Procedure MoveTo(X1,Y1 : Integer);
Procedure LineTo(X1,Y1 : Integer);
Procedure TextOut(X,Y: Integer; const Text: String);
Procedure TextRect(Rect: TRect; X,Y : Integer; const Text : String);
procedure TextOut(X,Y: Integer; const Text: String);
procedure TextRect(Rect: TRect; X, Y: integer; const Text : string);
overload;
procedure TextRect(Rect: TRect; X, Y: integer; const Text : string; const Style : TTextStyle); overload;
function TextExtent(const Text: string): TSize;
function TextHeight(const Text: string): Integer;
function TextWidth(const Text: string): Integer;
@ -510,10 +466,6 @@ type
destructor Destroy; override;
end;
TPixelFormat = (pfDevice, pf1bit, pf4bit, pf8bit, pf15bit, pf16bit, pf24bit,
pf32bit, pfCustom);
TBitmap = class(TGraphic)
private
FCanvas: TCanvas;
@ -597,14 +549,8 @@ type
TIcon = class(TPixmap)
end;
var
{ Stores information about the current screen }
ScreenInfo : TLMScreenInit;
// Color / Identifier mapping
type
// Color / Identifier mapping
TGetColorStringProc = procedure(const s:ansistring) of object;
function ColorToIdent(Color: Longint; var Ident: AnsiString): Boolean;
@ -613,7 +559,11 @@ function ColorToRGB(Color: TColor): Longint;
function ColorToString(Color: TColor): AnsiString;
function StringToColor(const S: shortstring): TColor;
procedure GetColorValues(Proc: TGetColorStringProc);
var
{ Stores information about the current screen }
ScreenInfo : TLMScreenInit;
(***************************************************************************
***************************************************************************)
@ -702,7 +652,6 @@ begin
then Result := GetSysColor(Color and $000000FF)
else Result := Color;
Result := Result and $FFFFFF;
//WriteLN(Format('[ColorToRGB] Color %8x --> RGB %8x', [Color, Result]));
end;
function ColorToString(Color: TColor): AnsiString;
@ -725,6 +674,7 @@ begin
end;
{$I graphicsobject.inc}
{$I graphic.inc}
{$I picture.inc}
@ -744,6 +694,14 @@ end.
{ =============================================================================
$Log$
Revision 1.22 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.21 2002/01/02 15:24:58 lazarus
MG: added TCanvas.Polygon and TCanvas.Polyline

402
lcl/graphtype.pp Normal file
View File

@ -0,0 +1,402 @@
{ $Id$ }
{
/***************************************************************************
Graphics.pp
-------------------
Graphic related platform independent types
and utility functions.
Initial Revision : Sat Feb 02 0:02:58 2002
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
}
unit GraphType;
{$mode objfpc}{$H+}
interface
uses Classes, LCLType;
{$ifdef Trace}
{$ASSERTIONS ON}
{$endif}
type
TColor = longint; //Also defined in LMessages.pp
TFontPitch = (fpDefault, fpVariable, fpFixed);
TFontName = shortstring;
TFontStyle = (fsBold, fsItalic, fsStrikeOut, fsUnderline);
TFontCharSet = 0..255;
TFontDataName = string[LF_FACESIZE -1];
TFontStyles = set of TFontStyle;
TFontStylesbase = set of TFontStyle;
TFontData = record
Handle : HFont;
Height : Integer;
Pitch : TFontPitch;
Style : TFontStylesBase;
CharSet : TFontCharSet;
Name : TFontDataName;
end;
{ Reflects text style when drawn in a rectangle }
TTextLayout = (tlTop, tlCenter, tlBottom);
TTextStyle = packed record
Alignment : TAlignment; // vertical alignment
Layout : TTextLayout; // horizontal alignment
SingleLine : boolean; // ignored
Clipping : boolean; // if set text will be clipped
ExpandTabs : boolean; // ignored
ShowPrefix : boolean; // ignored
Wordbreak : boolean; // ignored
Opaque : boolean; // text should have opaque background
end;
TPenStyle = (psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideframe);
TPenMode = (pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot,
pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge,pmNotMerge, pmMask,
pmNotMask, pmXor, pmNotXor
);
TPenData = record
Handle : HPen;
Color : TColor;
Width : Integer;
Style : TPenStyle;
end;
TBrushStyle = (bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross);
TFillStyle = (fsSurface, fsBorder);
TFillMode = (fmAlternate, fmWinding);
TCopymode = longint;
TCanvasStates = (csHandleValid, csFontValid, csPenvalid, csBrushValid);
TCanvasState = set of TCanvasStates;
TCanvasOrientation = (csLefttoRight, coRighttoLeft);
TProgressStage = (psStarting, psRunning, psEnding);
TProgressEvent = procedure (Sender: TObject; Stage: TProgressStage;
PercentDone: Byte; RedrawNow: Boolean; const R: TRect;
const Msg: string) of object;
TBevelCut = (bvNone, bvLowered, bvRaised);
TPixelFormat = (pfDevice, pf1bit, pf4bit, pf8bit, pf15bit, pf16bit, pf24bit,
pf32bit, pfCustom);
implementation
end.
{ =============================================================================
$Log$
Revision 1.1 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.21 2002/01/02 15:24:58 lazarus
MG: added TCanvas.Polygon and TCanvas.Polyline
Revision 1.20 2002/01/02 12:10:01 lazarus
MG: fixed typo
Revision 1.19 2001/12/28 11:41:50 lazarus
MG: added TCanvas.Ellipse, TCanvas.Pie
Revision 1.18 2001/12/21 18:16:59 lazarus
Added TImage class
Shane
Revision 1.17 2001/11/12 22:12:57 lazarus
MG: fixed parser: multiple brackets, nil, string[]
Revision 1.16 2001/11/09 19:14:23 lazarus
HintWindow changes
Shane
Revision 1.15 2001/10/25 19:02:18 lazarus
MG: fixed parsing constants with OR, AND, XOR, MOD, DIV, SHL, SHR
Revision 1.14 2001/10/24 00:35:55 lazarus
MG: fixes for fpc 1.1: range check errors
Revision 1.13 2001/09/30 08:34:49 lazarus
MG: fixed mem leaks and fixed range check errors
Revision 1.12 2001/08/05 10:14:50 lazarus
MG: removed double props in OI, small bugfixes
Revision 1.11 2001/06/26 00:08:35 lazarus
MG: added code for form icons from Rene E. Beszon
Revision 1.10 2001/06/04 09:32:17 lazarus
MG: fixed bugs and cleaned up messages
Revision 1.9 2001/03/21 00:20:29 lazarus
MG: fixed memory leaks
Revision 1.7 2001/03/19 14:00:50 lazarus
MG: fixed many unreleased DC and GDIObj bugs
Revision 1.6 2001/03/05 14:20:04 lazarus
added streaming to tgraphic, added tpicture
Revision 1.5 2001/02/04 19:23:26 lazarus
Goto dialog added
Shane
Revision 1.4 2001/02/04 18:24:41 lazarus
Code cleanup
Shane
Revision 1.3 2001/01/31 21:16:45 lazarus
Changed to TCOmboBox focusing.
Shane
Revision 1.2 2000/08/10 18:56:23 lazarus
Added some winapi calls.
Most don't have code yet.
SetTextCharacterExtra
CharLowerBuff
IsCharAlphaNumeric
Shane
Revision 1.1 2000/07/13 10:28:23 michael
+ Initial import
Revision 1.46 2000/05/08 15:56:58 lazarus
MWE:
+ Added support for mwedit92 in Makefiles
* Fixed bug # and #5 (Fillrect)
* Fixed labelsize in ApiWizz
+ Added a call to the resize event in WMWindowPosChanged
Revision 1.45 2000/03/30 18:07:53 lazarus
Added some drag and drop code
Added code to change the unit name when it's saved as a different name. Not perfect yet because if you are in a comment it fails.
Shane
Revision 1.44 2000/03/21 23:47:33 lazarus
MWE:
+ Added TBitmap.MaskHandle & TGraphic.Draw & TBitmap.Draw
Revision 1.43 2000/03/16 23:58:46 lazarus
MWE:
Added TPixmap for XPM support
Revision 1.42 2000/03/15 20:15:31 lazarus
MOdified TBitmap but couldn't get it to work
Shane
Revision 1.41 2000/03/10 13:13:37 lazarus
*** empty log message ***
Revision 1.40 2000/03/09 23:44:03 lazarus
MWE:
* Fixed colorcache
* Fixed black window in new editor
~ Did some cosmetic stuff
From Peter Dyson <peter@skel.demon.co.uk>:
+ Added Rect api support functions
+ Added the start of ScrollWindowEx
Revision 1.39 2000/03/08 23:57:38 lazarus
MWE:
Added SetSysColors
Fixed TEdit text bug (thanks to hans-joachim ott <hjott@compuserve.com>)
Finished GetKeyState
Added changes from Peter Dyson <peter@skel.demon.co.uk>
- a new GetSysColor
- some improvements on ExTextOut
Revision 1.38 2000/03/06 00:05:05 lazarus
MWE: Added changes from Peter Dyson <peter@skel.demon.co.uk> for a new
release of mwEdit (0.92)
Revision 1.37 2000/01/26 19:16:24 lazarus
Implemented TPen.Style properly for GTK. Done SelectObject for pen objects.
Misc bug fixes.
Corrected GDK declaration for gdk_gc_set_slashes.
Revision 1.36 2000/01/17 20:36:25 lazarus
Fixed Makefile again.
Made implementation of TScreen and screen info saner.
Began to implemented DeleteObject in GTKWinAPI.
Fixed a bug in GDI allocation which in turn fixed A LOT of other bugs :-)
Revision 1.35 1999/12/14 22:05:37 lazarus
More changes for TToolbar
Shane
Revision 1.34 1999/12/02 19:00:59 lazarus
MWE:
Added (GDI)Pen
Changed (GDI)Brush
Changed (GDI)Font (color)
Changed Canvas to use/create pen/brush/font
Hacked mwedit to allow setting the number of chars (till it get a WM/LM_SIZE event)
The editor shows a line !
Revision 1.33 1999/11/29 00:46:47 lazarus
MWE:
Added TBrush as gdiobject
commented out some more mwedit MWE_FPC ifdefs
Revision 1.32 1999/11/25 23:45:08 lazarus
MWE:
Added font as GDIobject
Added some API testcode to testform
Commented out some more IFDEFs in mwCustomEdit
Revision 1.31 1999/11/19 01:09:43 lazarus
MWE:
implemented TCanvas.CopyRect
Added StretchBlt
Enabled creation of TCustomControl.Canvas
Added a temp hack in TWinControl.Repaint to get a LM_PAINT
Revision 1.30 1999/11/18 00:13:08 lazarus
MWE:
Partly Implemented SelectObject
Added ExTextOut
Added GetTextExtentPoint
Added TCanvas.TextExtent/TextWidth/TextHeight
Added TSize and HPEN
Revision 1.29 1999/11/17 01:16:39 lazarus
MWE:
Added some more API stuff
Added an initial TBitmapCanvas
Added some DC stuff
Changed and commented out, original gtk linedraw/rectangle code. This
is now called through the winapi wrapper.
Revision 1.28 1999/11/09 17:19:54 lazarus
added the property PITCH to TFONT.
Shane
Revision 1.26 1999/11/05 17:48:17 lazarus
Added a mwedit1 component to lazarus (MAIN.PP)
It crashes on create.
Shane
Revision 1.25 1999/11/01 01:28:29 lazarus
MWE: Implemented HandleNeeded/CreateHandle/CreateWND
Now controls are created on demand. A call to CreateComponent shouldn't
be needed. It is now part of CreateWnd
Revision 1.24 1999/10/28 17:17:42 lazarus
Removed references to FCOmponent.
Shane
Revision 1.23 1999/10/25 17:38:52 lazarus
More stuff added for compatability. Most stuff added was put in the windows.pp file. CONST scroll bar messages and such. 2 functions were also added to that unit that needs to be completed.
Shane
Revision 1.22 1999/10/22 21:01:51 lazarus
Removed calls to InterfaceObjects except for controls.pp. Commented
out any gtk depend lines of code. MAH
Revision 1.21 1999/10/19 21:16:23 lazarus
TColor added to graphics.pp
Revision 1.20 1999/10/18 07:32:42 lazarus
Added definitions for Load methods in the TBitmap class. The
methods have not been implemented yet. They need to be implemented. CAW
Revision 1.19 1999/09/26 16:58:01 lazarus
MWE: Added TBitMap.Mask method
Revision 1.18 1999/08/26 23:36:02 peter
+ paintbox
+ generic keydefinitions and gtk conversion
* gtk state -> shiftstate conversion
Revision 1.17 1999/08/25 18:53:02 lazarus
Added Canvas.pixel property which allows
the user to get/set the pixel color. This will be used in the editor
to create the illusion of the cursor by XORing the pixel with black.
Shane
Revision 1.16 1999/08/20 15:44:37 lazarus
TImageList changes added from Marc Weustink
Revision 1.15 1999/08/17 16:46:25 lazarus
Slight modification to Editor.pp
Shane
Revision 1.14 1999/08/16 20:48:03 lazarus
Added a changed event for TFOnt and code to get the average size of the font. Doesn't seem to work very well yet.
The "average size" code is found in gtkobject.inc.
Revision 1.13 1999/08/16 15:48:49 lazarus
Changes by file:
Control: TCOntrol-Function GetRect added
ClientRect property added
TImageList - Added Count
TWinControl- Function Focused added.
Graphics: TCanvas - CopyRect added - nothing finished on it though
Draw added - nothing finiushed on it though
clbtnhighlight and clbtnshadow added. Actual color values not right.
IMGLIST.PP and IMGLIST.INC files added.
A few other minor changes for compatability added.
Shane
Revision 1.12 1999/08/13 19:55:47 lazarus
TCanvas.MoveTo added for compatability.
Revision 1.11 1999/08/13 19:51:07 lazarus
Minor changes for compatability made.
Revision 1.10 1999/08/11 20:41:33 lazarus
Minor changes and additions made. Lazarus may not compile due to these changes
Revision 1.9 1999/08/02 01:13:33 lazarus
Added new colors and corrected BTNFACE
Need the TSCrollbar class to go further with the editor.
Mouse doesn't seem to be working correctly yet when I click on the editor window
Revision 1.8 1999/08/01 21:46:26 lazarus
Modified the GETWIDTH and GETHEIGHT of TFOnt so you can use it to calculate the length in Pixels of a string. This is now used in the editor.
Shane
Revision 1.7 1999/07/31 06:39:26 lazarus
Modified the IntCNSendMessage3 to include a data variable. It isn't used
yet but will help in merging the Message2 and Message3 features.
Adjusted TColor routines to match Delphi color format
Added a TGdkColorToTColor routine in gtkproc.inc
Finished the TColorDialog added to comDialog example. MAH
}

View File

@ -37,8 +37,7 @@ interface
{$endif}
uses
// Windows,
SysUtils, Classes, Graphics, vclGlobals;
SysUtils, Classes, Graphics, GraphType, vclGlobals;
@ -148,6 +147,14 @@ end.
{
$Log$
Revision 1.5 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.4 2001/06/15 10:31:06 lazarus
MG: set longstrings as default

View File

@ -374,6 +374,19 @@ begin
LCLLinux.FillRect(FHandle, Rect, Brush.Handle);
end;
{------------------------------------------------------------------------------
Method: TCanvas.Frame3d
Params: Rect
, AWidth, AHeight
Returns: Nothing
------------------------------------------------------------------------------}
procedure TCanvas.Frame3d(var Rect : TRect; const FrameWidth : integer; const Style : TBevelCut);
begin
RequiredState([csHandleValid]);
LCLLinux.Frame3d(FHandle, Rect, FrameWidth, Style);
end;
{------------------------------------------------------------------------------
Method: TCanvas.Rectangle
Params: X1,Y1,X2,Y2
@ -410,6 +423,42 @@ begin
MoveTo(X + TextWidth(Text), Y);
end;
{------------------------------------------------------------------------------
Method: TCanvas.TextRect
Params: Rect, X, Y, Text
, Style
Returns: Nothing
------------------------------------------------------------------------------}
procedure TCanvas.TextRect(Rect: TRect; X, Y : Integer; const Text : String; const Style : TTextStyle);
var X1, Y1 : integer;
TS : TSize;
Options : Longint;
begin
RequiredState([csHandleValid, csFontValid, csBrushValid]);
TS:= TextExtent(Text);
{ Compute the rectangle for text }
case Style.Alignment of
taRightJustify : X1:= Rect.Right - TS.cx;
taCenter : X1:= Rect.Left + ((Rect.Right - Rect.Left - TS.cx) div 2);
else X1:= Rect.Left + X;
end;
case Style.Layout of
tlCenter : Y1:= Rect.Top + ((Rect.Bottom - Rect.Top - TS.cy) div 2);
tlBottom : Y1:= Rect.Bottom - TS.cy;
else Y1:= Rect.Top + Y;
end;
if Style.Opaque then Options:= ETO_OPAQUE
else Options:= 0;
if Style.Clipping then Options:= Options or ETO_CLIPPED;
ExtTextOut(FHandle, X1, Y1, Options, @Rect, pChar(Text), Length(Text), nil);
MoveTo(X1 + TS.cx, Y1);
end;
{------------------------------------------------------------------------------
Method: TCanvas.TextOut
Params: X,Y,Text
@ -761,6 +810,14 @@ end;
{ =============================================================================
$Log$
Revision 1.15 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.14 2002/01/02 15:24:58 lazarus
MG: added TCanvas.Polygon and TCanvas.Polyline

142
lcl/include/custompanel.inc Normal file
View File

@ -0,0 +1,142 @@
{******************************************************************************
TCustomRadioBox
******************************************************************************}
{
Delphi compatibility:
- TPanel is compatible with Delphi implementation
}
{------------------------------------------------------------------------------
Method: TCustomRadioGroup.Create
Params: AOwner: the owner of the class
Returns: Nothing
Constructor for the radiogroup
------------------------------------------------------------------------------}
constructor TCustomPanel.Create (AOwner : TComponent);
begin
inherited Create (AOwner);
FCompStyle:= csPanel;
ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents,
csSetCaption, csOpaque, csDoubleClicks, csReplicatable, csNoFocus];
FBevelOuter := bvRaised;
FBevelInner := bvNone;
FBevelWidth := 1;
FAlignment := taCenter;
Height := 41;
Width := 185;
ParentColor := True;
end;
procedure TCustomPanel.SetAlignment(const Value: TAlignment);
begin
if FAlignment <> Value then begin
FAlignment := Value;
Invalidate;
end;
end;
procedure TCustomPanel.SetBevelWidth(const Value: TBevelWidth);
begin
if FBevelWidth <> Value then begin
FBevelWidth := Value;
Invalidate;
end;
end;
procedure TCustomPanel.SetBevelInner(const Value: TPanelBevel);
begin
if BevelInner <> Value then begin
FBevelInner := Value;
Invalidate;
end;
end;
procedure TCustomPanel.SetBevelOuter(const Value: TPanelBevel);
begin
if BevelOuter <> Value then begin
FBevelOuter := Value;
Invalidate;
end;
end;
procedure TCustomPanel.SetBorderWidth(const Value: TBorderWidth);
begin
if FBorderWidth <> Value then begin
FBorderWidth := Value;
Realign;
Invalidate;
end;
end;
procedure TCustomPanel.Paint;
var
Rect: TRect;
InflateSize: Integer;
TS : TTextStyle;
begin
Rect := GetClientRect;
if BorderStyle = bsSingle then begin
Canvas.Rectangle(Rect);
InflateRect(Rect, -1, -1);
end;
if BevelOuter <> bvNone then
Canvas.Frame3d(Rect, BevelWidth, BevelOuter);
if BevelInner <> bvNone then begin
if BorderWidth > 0 then InflateRect(Rect, -BorderWidth, -BorderWidth);
Canvas.Frame3d(Rect, BevelWidth, BevelInner);
end;
if Caption <> '' then begin
TS.Alignment:= Alignment;
TS.Layout:= tlCenter;
TS.Opaque:= false;
TS.Clipping:= false;
Canvas.TextRect(Rect, 0, 0, Caption, TS);
end;
end;
procedure TCustomPanel.AdjustClientRect(var Rect: TRect);
var
BevelSize: Integer;
begin
inherited AdjustClientRect(Rect);
InflateRect(Rect, -BorderWidth, -BorderWidth);
BevelSize := 0;
if BevelOuter <> bvNone then Inc(BevelSize, BevelWidth);
if BevelInner <> bvNone then Inc(BevelSize, BevelWidth);
InflateRect(Rect, -BevelSize, -BevelSize);
end;
procedure TCustomPanel.SetBorderStyle(const Value: TControlBorderStyle);
begin
if FBorderStyle <> Value then begin
FBorderStyle := Value;
Invalidate;
end;
end;
procedure TCustomPanel.Invalidate;
begin
inherited;
// InvalidateRect(ClientRect, True);
end;
function TCustomPanel.GetText: TCaption;
begin
Result := FCaption;
end;
procedure TCustomPanel.SetText(const Value: TCaption);
begin
if Caption <> Value then begin
FCaption := Value;
// TextChanged;
Invalidate;
end;
end;

View File

@ -179,6 +179,11 @@ begin
Result := False;
end;
function TInterfaceBase.Frame3d(DC: HDC; var Rect: TRect; const FrameWidth : integer; const Style : TBevelCut) : boolean;
begin
Result:= false;
end;
Function TInterfaceBase.GetActiveWindow : HWND;
begin
// Your default here
@ -532,6 +537,14 @@ end;
{ =============================================================================
$Log$
Revision 1.25 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.24 2002/01/02 15:24:58 lazarus
MG: added TCanvas.Polygon and TCanvas.Polyline

View File

@ -180,6 +180,11 @@ begin
Result := InterfaceObject.FillRect(DC, Rect, Brush);
end;
function Frame3d(DC : HDC; var Rect : TRect; const FrameWidth : integer; const Style : TBevelCut) : boolean;
begin
Result:= InterfaceObject.Frame3d(DC, Rect, FrameWidth, Style);
end;
Function GetActiveWindow : HWND;
begin
Result := InterfaceObject.GetActiveWindow;
@ -1053,6 +1058,14 @@ end;
{ =============================================================================
$Log$
Revision 1.24 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.23 2002/01/02 15:24:58 lazarus
MG: added TCanvas.Polygon and TCanvas.Polyline

View File

@ -66,6 +66,7 @@ function Ellipse(DC: HDC; x1, y1, x2, y2: Integer): Boolean; {$IFDEF IF_BASE_MEM
function ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function Frame3d(DC: HDC; var Rect: TRect; const FrameWidth : integer; const Style : TBevelCut): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
Function GetActiveWindow : HWND; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function GetCapture : HWND; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
@ -247,6 +248,14 @@ function UnionRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): Boolean
{ =============================================================================
$Log$
Revision 1.20 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.19 2002/01/02 15:24:58 lazarus
MG: added TCanvas.Polygon and TCanvas.Polyline

View File

@ -36,7 +36,7 @@ interface
{$endif}
uses
LCLLinux, VCLGlobals, Classes, Controls, LMessages;
LCLLinux, LCLType, VCLGlobals, Classes, Controls, LMessages, GraphType;
type
@ -82,6 +82,14 @@ end.
{
$Log$
Revision 1.5 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.4 2001/07/01 23:33:13 lazarus
MG: added WaitMessage and HandleEvents is now non blocking

View File

@ -29,7 +29,7 @@ unit gtkdef;
interface
uses
gtk, gdk, LCLLinux, VclGlobals, Classes;
gtk, gdk, LCLLinux, LCLType, VclGlobals, Classes;
type
TGDIType = (gdiBitmap, gdiBrush, gdiFont, gdiPen, gdiRegion);
@ -136,6 +136,14 @@ end.
{ =============================================================================
$Log$
Revision 1.5 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.4 2001/11/12 16:56:08 lazarus
MG: CLIPBOARD

View File

@ -31,8 +31,9 @@ interface
uses
InterfaceBase, gtk, gdk, glib, SysUtils, LMessages, Classes, Controls,
ExtCtrls, Forms, Dialogs, VclGlobals, StdCtrls, ComCtrls, LCLLinux, gtkdef,
DynHashArray, LazQueue,Calendar,Arrow;
ExtCtrls, Forms, Dialogs, VclGlobals, StdCtrls, ComCtrls, LCLLinux, LCLType,
gtkdef,
DynHashArray, LazQueue, Calendar, Arrow, GraphType;
type
TgtkObject = class(TInterfaceBase)
@ -324,6 +325,14 @@ end.
{ =============================================================================
$Log$
Revision 1.26 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.25 2001/12/06 13:39:36 lazarus
Added TArrow component
Shane

View File

@ -2043,9 +2043,9 @@ begin
csBitBtn :
begin
Assert(False, 'Trace:CSBITBTN CREATE*************************');
writeln('Creating a new bit button');
p := gtk_button_new;
if (TBitBtn(Sender).Layout = blGlyphLeft)
or (TBitBtn(Sender).Layout = blGlyphRight) then begin
if ((Sender as TBitBtn).Layout in [blGlyphLeft, blGlyphRight]) then begin
Assert(False, 'Trace:GLYPHLEFT or GLYPHRIGHT');
Box := gtk_hbox_new(False,0);
end
@ -2513,6 +2513,8 @@ begin
csSpeedButton:
Begin
p := gtk_button_new_with_label(StrTemp);
{p := gtk_drawing_area_new();
gtk_drawing_area_size(pGTKDrawingArea(p),22,22);}
//nothing done here. We are only worried about the canvas
@ -2609,7 +2611,15 @@ begin
then P := gtk_hscale_new (PGTKADJUSTMENT (TempWidget))
else P := gtk_vscale_new (PGTKADJUSTMENT (TempWidget));
gtk_scale_set_digits (PGTKSCALE (P), 0);
end;
end;
csPanel:
with (TPanel(Sender)) do begin
p := gtk_fixed_new();
gtk_widget_show (p);
SetFixedWidget(p, p);
SetMainWidget(p, p);
end;
end; //case
@ -3750,6 +3760,14 @@ end;
{ =============================================================================
$Log$
Revision 1.103 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.102 2002/01/24 15:40:59 lazarus
MG: deactivated clipboard setting target list for win32

View File

@ -1713,10 +1713,10 @@ begin
gdk_draw_rectangle(Drawable, GC, 1, Rect^.Left, Rect^.Top, Width, Height);
end;
if (Options and ETO_CLIPPED) <> 0 then
begin
begin
X := Rect^.Left;
Y := Rect^.Top;
end;
end;
SelectGDKTextProps(DC);
Line := 1;
OldText := StrPas(pStr);
@ -1748,7 +1748,7 @@ end;
{------------------------------------------------------------------------------
Function: FillRect
Params: none
Params: none
Returns: Nothing
The FillRect function fills a rectangle by using the specified brush.
@ -1788,6 +1788,37 @@ begin
Assert(False, Format('trace:< [TgtkObject.FillRect] DC:0x%x; Rect: ((%d,%d)(%d,%d)); brush: %x', [Integer(DC), Rect.left, rect.top, rect.right, rect.bottom, brush]));
end;
{------------------------------------------------------------------------------
Function: Frame3d
Params: -
Returns: Nothing
Draws a 3d border in GTK native style.
------------------------------------------------------------------------------}
function TGtkObject.Frame3d(DC : HDC; var Rect : TRect; const FrameWidth : integer; const Style : TBevelCut) : boolean;
const GTKShadowType: array[TBevelCut] of integer = (GTK_SHADOW_NONE, GTK_SHADOW_IN, GTK_SHADOW_OUT);
var Widget : TGtkWidget;
i : integer;
begin
Result := IsValidDC(DC);
if Result
then with PDeviceContext(DC)^ do
begin
if GC = nil
then begin
Result:= False;
end
else begin
Widget:= PGtkFixed(GetFixedWidget(PGtkWidget(PDeviceContext(DC)^.hWnd)))^.Container.Widget;
for i:= 1 to FrameWidth do begin
gtk_paint_shadow(Widget.thestyle, Widget.window, GTK_STATE_NORMAL, GtkShadowType[Style], nil, @Widget, nil,
Rect.left, Rect.top, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top);
InflateRect(Rect, -1, -1);
end;
end;
end;
end;
{------------------------------------------------------------------------------
Function: GetActiveWindow
Params: none
@ -4337,6 +4368,14 @@ end;
{ =============================================================================
$Log$
Revision 1.60 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.59 2002/01/24 15:40:59 lazarus
MG: deactivated clipboard setting target list for win32

View File

@ -49,6 +49,7 @@ function Ellipse(DC: HDC; x1,y1,x2,y2: Integer): Boolean; override;
function ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean; override;
function FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean; override;
function Frame3d(DC : HDC; var Rect: TRect; const FrameWidth: integer; const Style : TBevelCut): boolean; override;
Function GetActiveWindow : HWND; override;
function GetCapture: HWND; override;
@ -132,6 +133,14 @@ Function WindowFromPoint(Point : TPoint) : HWND; override;
{ =============================================================================
$Log$
Revision 1.24 2002/02/03 00:24:02 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.23 2002/01/02 15:24:59 lazarus
MG: added TCanvas.Polygon and TCanvas.Polyline

File diff suppressed because it is too large Load Diff

1456
lcl/lcltype.pp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@ unit lMessages;
interface
uses Classes,vclGlobals,LCLLinux;
uses Classes, vclGlobals, LCLType;
const
@ -788,6 +788,14 @@ end.
{
$Log$
Revision 1.19 2002/02/03 00:24:00 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.18 2002/01/25 19:42:56 lazarus
Keith: Improved events and common dialogs on Win32

View File

@ -41,7 +41,7 @@ interface
{$endif}
uses
Classes, Controls, SysUtils, vclGlobals, lMessages, LCLLinux;
Classes, Controls, SysUtils, vclGlobals, lMessages, LCLType;
type
ERegistryException = class(Exception);
@ -184,6 +184,14 @@ end.
{
$Log$
Revision 1.4 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.3 2001/06/15 10:31:06 lazarus
MG: set longstrings as default

View File

@ -32,7 +32,7 @@ unit stdctrls;
interface
uses VclGlobals, Classes, SysUtils, Graphics, LMessages, Controls, Forms;
uses VclGlobals, Classes, SysUtils, Graphics, GraphType, LMessages, Controls, Forms;
type
@ -329,8 +329,6 @@ type
property OnChange;
end;
TTextLayout = (tlTop, tlCenter, tlBottom);
TCustomLabel = class(TWinControl)
private
FAlignment : TAlignment;
@ -518,7 +516,7 @@ type
implementation {*******}
uses LCLLinux;
uses LCLLinux, LCLType;
type
@ -584,6 +582,14 @@ end.
{ =============================================================================
$Log$
Revision 1.20 2002/02/03 00:24:01 lazarus
TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can
reference it from interface (GTK, Win32) units.
New Frame3d canvas method that uses native (themed) drawing (GTK only).
New overloaded Canvas.TextRect method.
LCLLinux and Graphics was split, so a bunch of files had to be modified.
Revision 1.19 2002/01/09 22:49:25 lazarus
MWE: Converted to Unix fileformat

View File

@ -39,7 +39,8 @@ interface
{$endif}
uses
Classes, Controls, SysUtils, stdCtrls, Graphics, vclGlobals, lMessages,LCLLinux;
Classes, Controls, SysUtils, stdCtrls, GraphType, Graphics, vclGlobals,
lMessages, LCLType, LCLLinux;
type

View File

@ -89,6 +89,8 @@ csHintWindow = 48;
csCalendar = 49;
csArrow = 50;
csPanel = 51;
type
//TODO: check this against lcllinux