diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-03 19:23:40 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-03 19:23:40 +0000 |
commit | cfbb1096706f6234cf8ac8fb0feefaae8b881ba9 (patch) | |
tree | f86d7fb67c7568cdd8284743f07a47cf457851ca /prototypes/miglayout/gui_mig_lc.pas | |
parent | cec78aca668fb7b5eba7f60852854697619573ca (diff) | |
download | fpGUI-cfbb1096706f6234cf8ac8fb0feefaae8b881ba9.tar.xz |
* Added my MiG Layout Manager code to the prototypes diretory while I continue working on the port from Java.
Diffstat (limited to 'prototypes/miglayout/gui_mig_lc.pas')
-rw-r--r-- | prototypes/miglayout/gui_mig_lc.pas | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/prototypes/miglayout/gui_mig_lc.pas b/prototypes/miglayout/gui_mig_lc.pas new file mode 100644 index 00000000..49316592 --- /dev/null +++ b/prototypes/miglayout/gui_mig_lc.pas @@ -0,0 +1,80 @@ +{ + Layout Manager Constraint. +} + +unit gui_mig_lc; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, gui_mig_unitvalue, gui_mig_boundsize, gui_mig_exceptions; + +type + + { TLC } + + TLC = class(TObject) + private + FDebugMillis: integer; + FFillX: Boolean; + FFillY: Boolean; + FFlowX: Boolean; + FGridGapX: TBoundSize; + FGridGapY: TBoundSize; + FHideMode: integer; + FNoCache: Boolean; + FAlignX: TUnitValue; + FAlignY: TUnitValue; + FLeftToRight: Boolean; + FTopToBottom: Boolean; + procedure SetHideMode(const AValue: integer); + public + constructor Create; + property NoCache: Boolean read FNoCache write FNoCache default False; + property AlignX: TUnitValue read FAlignX write FAlignX; + property AlignY: TUnitValue read FAlignY write FAlignY; + property DebugMillis: integer read FDebugMillis write FDebugMillis default 0; + property FillX: Boolean read FFillX write FFillX default False; + property FillY: Boolean read FFillY write FFillY default False; + property FlowX: Boolean read FFlowX write FFlowX default True; + property GridGapX: TBoundSize read FGridGapX write FGridGapX; + property GridGapY: TBoundSize read FGridGapY write FGridGapY; + property HideMode: integer read FHideMode write SetHideMode; + property LeftToRight: Boolean read FLeftToRight write FLeftToRight; + property TopToBottom: Boolean read FTopToBottom write FTopToBottom; + end; + + +implementation + +{ TLC } + +procedure TLC.SetHideMode(const AValue: integer); +begin + if FHideMode=AValue then exit; + + if (AValue < 0) or (AValue > 3) then + raise EIllegalArgument.CreateFmt('Wrong HideMode: %d', [AValue]); + + FHideMode:=AValue; +end; + +constructor TLC.Create; +begin + FNoCache := False; + FAlignX := nil; + FAlignY := nil; + FDebugMillis := 0; + FFillX := False; + FFillY := False; + FFlowX := True; + FGridGapX := nil; + FGridGapY := nil; + FLeftToRight := True; + FTopToBottom := True; +end; + +end. + |