mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 21:20:28 +02:00
added form editor options for rubberband and colors
git-svn-id: trunk@3667 -
This commit is contained in:
parent
b1d507eccf
commit
b608081566
@ -41,7 +41,9 @@ uses
|
||||
EnvironmentOpts, DesignerProcs, Menus;
|
||||
|
||||
type
|
||||
EGenException = class(Exception);
|
||||
TControlSelection = class;
|
||||
|
||||
{ TGrabber }
|
||||
|
||||
TGrabberMoveEvent = procedure(Sender: TObject; dx, dy: Integer) of object;
|
||||
|
||||
@ -81,31 +83,43 @@ type
|
||||
end;
|
||||
|
||||
|
||||
{ TSelectedControl }
|
||||
|
||||
TSelectedControlFlag = (
|
||||
scfParentInSelection,
|
||||
scfChildInSelection
|
||||
);
|
||||
TSelectedControlFlags = set of TSelectedControlFlag;
|
||||
|
||||
TSelectedControl = class
|
||||
private
|
||||
FComponent:TComponent;
|
||||
FOldLeft: integer;
|
||||
FOldTop: integer;
|
||||
FOldWidth: integer;
|
||||
FOldHeight: integer;
|
||||
FOldFormRelativeLeftTop: TPoint;
|
||||
FCachedLeft: integer;
|
||||
FCachedTop: integer;
|
||||
FCachedWidth: integer;
|
||||
FCachedHeight: integer;
|
||||
FCachedFormRelativeLeftTop: TPoint;
|
||||
FComponent:TComponent;
|
||||
FFlags: TSelectedControlFlags;
|
||||
FOldLeft: integer;
|
||||
FOldTop: integer;
|
||||
FOldWidth: integer;
|
||||
FOldHeight: integer;
|
||||
FOldFormRelativeLeftTop: TPoint;
|
||||
FOwner: TControlSelection;
|
||||
FUseCache: boolean;
|
||||
function GetLeft: integer;
|
||||
procedure SetLeft(ALeft: integer);
|
||||
function GetTop: integer;
|
||||
procedure SetOwner(const AValue: TControlSelection);
|
||||
procedure SetTop(ATop: integer);
|
||||
function GetWidth: integer;
|
||||
procedure SetUseCache(const AValue: boolean);
|
||||
procedure SetWidth(AWidth: integer);
|
||||
function GetHeight: integer;
|
||||
procedure SetHeight(AHeight: integer);
|
||||
procedure SetFlags(const AValue: TSelectedControlFlags);
|
||||
public
|
||||
constructor Create(AComponent:TComponent);
|
||||
constructor Create(AnOwner: TControlSelection; AComponent: TComponent);
|
||||
destructor Destroy; override;
|
||||
function ParentForm: TCustomForm;
|
||||
procedure SetBounds(ALeft, ATop, AWidth, AHeight: integer);
|
||||
@ -113,8 +127,11 @@ type
|
||||
procedure SaveBounds;
|
||||
procedure UpdateCache;
|
||||
function IsTopLvl: boolean;
|
||||
function ChildInSelection: boolean;
|
||||
function ParentInSelection: boolean;
|
||||
|
||||
property Component:TComponent read FComponent write FComponent;
|
||||
property Component: TComponent read FComponent write FComponent;
|
||||
property Owner: TControlSelection read FOwner write SetOwner;
|
||||
property Left: integer read GetLeft write SetLeft;
|
||||
property Top: integer read GetTop write SetTop;
|
||||
property Width: integer read GetWidth write SetWidth;
|
||||
@ -125,8 +142,10 @@ type
|
||||
property OldHeight:integer read FOldHeight write FOldHeight;
|
||||
property OldFormRelativeLeftTop: TPoint
|
||||
read FOldFormRelativeLeftTop write FOldFormRelativeLeftTop;
|
||||
property Flags: TSelectedControlFlags read FFlags write SetFlags;
|
||||
property UseCache: boolean read FUseCache write SetUseCache;
|
||||
end;
|
||||
|
||||
|
||||
TComponentAlignment = (csaNone, csaSides1, csaCenters, csaSides2,
|
||||
csaCenterInWindow, csaSpaceEqually, csaSide1SpaceEqually,
|
||||
@ -154,6 +173,9 @@ type
|
||||
rbtSelection,
|
||||
rbtCreating
|
||||
);
|
||||
|
||||
|
||||
{ TControlSelection }
|
||||
|
||||
TControlSelState = (
|
||||
cssOnlyNonVisualNeedsUpdate,
|
||||
@ -168,7 +190,8 @@ type
|
||||
cssChangedDuringLock,
|
||||
cssRubberbandActive,
|
||||
cssCacheGuideLines,
|
||||
cssVisible
|
||||
cssVisible,
|
||||
cssParentChildFlagsNeedUpdate
|
||||
);
|
||||
TControlSelStates = set of TControlSelState;
|
||||
|
||||
@ -207,9 +230,7 @@ type
|
||||
FCustomForm: TCustomForm;
|
||||
FGrabbers: array[TGrabIndex] of TGrabber;
|
||||
FGrabberSize: integer;
|
||||
FGrabberColor: TColor;
|
||||
FMarkerSize: integer;
|
||||
FMarkerColor: integer;
|
||||
FActiveGrabber: TGrabber;
|
||||
FRubberBandBounds: TRect;
|
||||
FRubberbandType: TRubberbandType;
|
||||
@ -220,7 +241,11 @@ type
|
||||
FOnChange: TNotifyEvent;
|
||||
|
||||
function GetCacheGuideLines: boolean;
|
||||
function GetGrabberColor: TColor;
|
||||
function GetMarkerColor: TColor;
|
||||
function GetRubberbandActive: boolean;
|
||||
function GetRubberbandCreationColor: TColor;
|
||||
function GetRubberbandSelectionColor: TColor;
|
||||
function GetSnapping: boolean;
|
||||
function GetVisible: boolean;
|
||||
procedure SetCacheGuideLines(const AValue: boolean);
|
||||
@ -230,8 +255,6 @@ type
|
||||
procedure SetGrabberSize(const NewSize: integer);
|
||||
procedure DoChange;
|
||||
procedure SetRubberbandActive(const AValue: boolean);
|
||||
procedure SetRubberbandCreationColor(const AValue: TColor);
|
||||
procedure SetRubberbandSelectionColor(const AValue: TColor);
|
||||
procedure SetRubberbandType(const AValue: TRubberbandType);
|
||||
procedure SetSnapping(const AValue: boolean);
|
||||
procedure SetVisible(const AValue: Boolean);
|
||||
@ -250,6 +273,7 @@ type
|
||||
procedure AdjustGrabbers;
|
||||
procedure DoApplyUserBounds;
|
||||
procedure UpdateRealBounds;
|
||||
procedure UpdateParentChildFlags;
|
||||
|
||||
// snapping
|
||||
function CleanGridSizeX: integer;
|
||||
@ -320,13 +344,13 @@ type
|
||||
function ParentLevel: integer;
|
||||
|
||||
property GrabberSize:integer read FGrabberSize write SetGrabberSize;
|
||||
property GrabberColor: TColor read FGrabberColor write FGrabberColor;
|
||||
property GrabberColor: TColor read GetGrabberColor;
|
||||
procedure DrawGrabbers(DC: TDesignerDeviceContext);
|
||||
function GrabberAtPos(X,Y: integer):TGrabber;
|
||||
property Grabbers[AGrabIndex: TGrabIndex]:TGrabber
|
||||
read GetGrabbers write SetGrabbers;
|
||||
property MarkerSize:integer read FMarkerSize write FMarkerSize;
|
||||
property MarkerColor: TColor read FMarkerColor write FMarkerColor;
|
||||
property MarkerColor: TColor read GetMarkerColor;
|
||||
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
||||
procedure DrawMarker(AComponent: TComponent; DC: TDesignerDeviceContext);
|
||||
procedure DrawMarkerAt(DC: TDesignerDeviceContext;
|
||||
@ -355,9 +379,9 @@ type
|
||||
property RubberbandType: TRubberbandType
|
||||
read FRubberbandType write SetRubberbandType;
|
||||
property RubberbandSelectionColor: TColor
|
||||
read FRubberbandSelectionColor write SetRubberbandSelectionColor;
|
||||
read GetRubberbandSelectionColor;
|
||||
property RubberbandCreationColor: TColor
|
||||
read FRubberbandCreationColor write SetRubberbandCreationColor;
|
||||
read GetRubberbandCreationColor;
|
||||
procedure DrawRubberband(DC: TDesignerDeviceContext);
|
||||
procedure SelectWithRubberBand(ACustomForm:TCustomForm;
|
||||
ClearBefore, ExclusiveOr: boolean; var SelectionChanged: boolean;
|
||||
@ -410,9 +434,11 @@ end;
|
||||
|
||||
{ TSelectedControl }
|
||||
|
||||
constructor TSelectedControl.Create(AComponent:TComponent);
|
||||
constructor TSelectedControl.Create(AnOwner: TControlSelection;
|
||||
AComponent:TComponent);
|
||||
begin
|
||||
inherited Create;
|
||||
FOwner:=AnOwner;
|
||||
FComponent:=AComponent;
|
||||
end;
|
||||
|
||||
@ -477,6 +503,26 @@ begin
|
||||
Result:=(FComponent is TControl) and (TControl(FComponent).Parent=nil);
|
||||
end;
|
||||
|
||||
function TSelectedControl.ChildInSelection: boolean;
|
||||
begin
|
||||
if Owner<>nil then begin
|
||||
Owner.UpdateParentChildFlags;
|
||||
Result:=scfChildInSelection in FFlags;
|
||||
end else begin
|
||||
Result:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSelectedControl.ParentInSelection: boolean;
|
||||
begin
|
||||
if Owner<>nil then begin
|
||||
Owner.UpdateParentChildFlags;
|
||||
Result:=scfParentInSelection in FFlags;
|
||||
end else begin
|
||||
Result:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSelectedControl.GetLeft: integer;
|
||||
begin
|
||||
if FUseCache then
|
||||
@ -485,6 +531,12 @@ begin
|
||||
Result:=GetComponentLeft(FComponent);
|
||||
end;
|
||||
|
||||
procedure TSelectedControl.SetFlags(const AValue: TSelectedControlFlags);
|
||||
begin
|
||||
if FFlags=AValue then exit;
|
||||
FFlags:=AValue;
|
||||
end;
|
||||
|
||||
procedure TSelectedControl.SetLeft(ALeft: integer);
|
||||
begin
|
||||
if FComponent is TControl then
|
||||
@ -502,6 +554,12 @@ begin
|
||||
Result:=GetComponentTop(FComponent);
|
||||
end;
|
||||
|
||||
procedure TSelectedControl.SetOwner(const AValue: TControlSelection);
|
||||
begin
|
||||
if FOwner=AValue then exit;
|
||||
FOwner:=AValue;
|
||||
end;
|
||||
|
||||
procedure TSelectedControl.SetTop(ATop: integer);
|
||||
begin
|
||||
if FComponent is TControl then
|
||||
@ -558,9 +616,7 @@ begin
|
||||
inherited;
|
||||
FControls:=TList.Create;
|
||||
FGrabberSize:=5;
|
||||
FGrabberColor:=clBlack;
|
||||
FMarkerSize:=5;
|
||||
FMarkerColor:=clDkGray;
|
||||
for g:=Low(TGrabIndex) to High(TGrabIndex) do begin
|
||||
FGrabbers[g]:=TGrabber.Create;
|
||||
FGrabbers[g].Positions:=GRAB_POSITIONS[g];
|
||||
@ -643,11 +699,31 @@ begin
|
||||
Result:=cssRubberbandActive in FStates;
|
||||
end;
|
||||
|
||||
function TControlSelection.GetRubberbandCreationColor: TColor;
|
||||
begin
|
||||
Result:=EnvironmentOptions.RubberbandCreationColor;
|
||||
end;
|
||||
|
||||
function TControlSelection.GetRubberbandSelectionColor: TColor;
|
||||
begin
|
||||
Result:=EnvironmentOptions.RubberbandSelectionColor;
|
||||
end;
|
||||
|
||||
function TControlSelection.GetCacheGuideLines: boolean;
|
||||
begin
|
||||
Result:=cssCacheGuideLines in FStates;
|
||||
end;
|
||||
|
||||
function TControlSelection.GetGrabberColor: TColor;
|
||||
begin
|
||||
Result:=EnvironmentOptions.GrabberColor;
|
||||
end;
|
||||
|
||||
function TControlSelection.GetMarkerColor: TColor;
|
||||
begin
|
||||
Result:=EnvironmentOptions.MarkerColor;
|
||||
end;
|
||||
|
||||
procedure TControlSelection.SetCustomForm;
|
||||
var
|
||||
OldCustomForm, NewCustomForm: TCustomForm;
|
||||
@ -750,11 +826,11 @@ begin
|
||||
writeln('[TControlSelection.DoApplyUserBounds] M Old=',FOldLeft,',',FOldTop,',',FOldWidth,',',FOldHeight,
|
||||
' User=',FLeft,',',FTop,',',FWidth,',',FHeight);
|
||||
{$ENDIF}
|
||||
|
||||
// ToDo: sort selection with parent level and size/move parents first
|
||||
|
||||
if (FOldWidth<>0) and (FOldHeight<>0) then begin
|
||||
for i:=0 to Count-1 do begin
|
||||
|
||||
// ToDo: if a parent and a child is selected, only move the parent
|
||||
|
||||
OldLeftTop:=Items[i].OldFormRelativeLeftTop;
|
||||
NewLeft:=FLeft + (((OldLeftTop.X-FOldLeft) * FWidth) div FOldWidth);
|
||||
NewTop:=FTop + (((OldLeftTop.Y-FOldTop) * FHeight) div FOldHeight);
|
||||
@ -810,6 +886,33 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TControlSelection.UpdateParentChildFlags;
|
||||
var
|
||||
i, j, Cnt: integer;
|
||||
Control1, Control2: TControl;
|
||||
begin
|
||||
if not (cssParentChildFlagsNeedUpdate in FStates) then exit;
|
||||
Cnt:=Count;
|
||||
for i:=0 to Cnt-1 do begin
|
||||
Control1:=TControl(Items[i].Component);
|
||||
Items[i].FFlags:=Items[i].FFlags-[scfParentInSelection,scfChildInSelection];
|
||||
end;
|
||||
for i:=0 to Cnt-1 do begin
|
||||
Control1:=TControl(Items[i].Component);
|
||||
if not (Control1 is TControl) then continue;
|
||||
for j:=0 to Cnt-1 do begin
|
||||
Control2:=TControl(Items[j].Component);
|
||||
if not (Control2 is TControl) then continue;
|
||||
if i=j then continue;
|
||||
if Control1.IsParentOf(Control2) then begin
|
||||
Include(Items[i].FFlags,scfChildInSelection);
|
||||
Include(Items[j].FFlags,scfParentInSelection);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Exclude(FStates,cssParentChildFlagsNeedUpdate);
|
||||
end;
|
||||
|
||||
function TControlSelection.CleanGridSizeX: integer;
|
||||
begin
|
||||
Result:=EnvironmentOptions.GridSizeX;
|
||||
@ -1288,18 +1391,6 @@ begin
|
||||
Exclude(FStates,cssRubberbandActive);
|
||||
end;
|
||||
|
||||
procedure TControlSelection.SetRubberbandCreationColor(const AValue: TColor);
|
||||
begin
|
||||
if FRubberbandCreationColor=AValue then exit;
|
||||
FRubberbandCreationColor:=AValue;
|
||||
end;
|
||||
|
||||
procedure TControlSelection.SetRubberbandSelectionColor(const AValue: TColor);
|
||||
begin
|
||||
if FRubberbandSelectionColor=AValue then exit;
|
||||
FRubberbandSelectionColor:=AValue;
|
||||
end;
|
||||
|
||||
procedure TControlSelection.SetRubberbandType(const AValue: TRubberbandType);
|
||||
begin
|
||||
if FRubberbandType=AValue then exit;
|
||||
@ -1379,11 +1470,11 @@ function TControlSelection.Add(AComponent: TComponent):integer;
|
||||
var NewSelectedControl:TSelectedControl;
|
||||
begin
|
||||
BeginUpdate;
|
||||
NewSelectedControl:=TSelectedControl.Create(AComponent);
|
||||
NewSelectedControl:=TSelectedControl.Create(Self,AComponent);
|
||||
if NewSelectedControl.ParentForm<>FCustomForm then Clear;
|
||||
Result:=FControls.Add(NewSelectedControl);
|
||||
FStates:=FStates+[cssOnlyNonVisualNeedsUpdate,cssOnlyVisualNeedsUpdate,
|
||||
cssParentLevelNeedsUpdate];
|
||||
cssParentLevelNeedsUpdate,cssParentChildFlagsNeedUpdate];
|
||||
if Count=1 then SetCustomForm;
|
||||
DoChange;
|
||||
UpdateBounds;
|
||||
@ -1416,7 +1507,7 @@ begin
|
||||
Items[Index].Free;
|
||||
FControls.Delete(Index);
|
||||
FStates:=FStates+[cssOnlyNonVisualNeedsUpdate,cssOnlyVisualNeedsUpdate,
|
||||
cssParentLevelNeedsUpdate];
|
||||
cssParentLevelNeedsUpdate,cssParentChildFlagsNeedUpdate];
|
||||
if Count=0 then SetCustomForm;
|
||||
UpdateBounds;
|
||||
SaveBounds;
|
||||
@ -1431,7 +1522,7 @@ begin
|
||||
for i:=0 to FControls.Count-1 do Items[i].Free;
|
||||
FControls.Clear;
|
||||
FStates:=FStates+[cssOnlyNonVisualNeedsUpdate,cssOnlyVisualNeedsUpdate,
|
||||
cssParentLevelNeedsUpdate];
|
||||
cssParentLevelNeedsUpdate,cssParentChildFlagsNeedUpdate];
|
||||
FCustomForm:=nil;
|
||||
UpdateBounds;
|
||||
SaveBounds;
|
||||
@ -1586,7 +1677,7 @@ var
|
||||
DC.Save;
|
||||
with DC.Canvas do begin
|
||||
OldBrushColor:=Brush.Color;
|
||||
Brush.Color:=FGrabberColor;
|
||||
Brush.Color:=GrabberColor;
|
||||
end;
|
||||
RestoreBrush:=true;
|
||||
end;
|
||||
@ -1628,7 +1719,7 @@ var
|
||||
if not RestoreBrush then begin
|
||||
DC.Save;
|
||||
OldBrushColor:=DC.Canvas.Brush.Color;
|
||||
DC.Canvas.Brush.Color:=FMarkerColor;
|
||||
DC.Canvas.Brush.Color:=MarkerColor;
|
||||
RestoreBrush:=true;
|
||||
end;
|
||||
DC.Canvas.FillRect(Rect(RLeft,RTop,RRight,RBottom));
|
||||
@ -1742,15 +1833,25 @@ procedure TControlSelection.SelectWithRubberBand(ACustomForm:TCustomForm;
|
||||
var i:integer;
|
||||
|
||||
function ControlInRubberBand(AComponent:TComponent):boolean;
|
||||
var ALeft,ATop,ARight,ABottom:integer;
|
||||
Origin:TPoint;
|
||||
var
|
||||
ALeft, ATop, ARight, ABottom: integer;
|
||||
Origin: TPoint;
|
||||
AControl: TControl;
|
||||
begin
|
||||
Result:=false;
|
||||
if (AComponent is TMenuItem) then exit;
|
||||
if (AComponent is TControl) then begin
|
||||
if not ControlIsDesignerVisible(TControl(AComponent)) then exit;
|
||||
if (MaxParentControl<>nil)
|
||||
and (not MaxParentControl.IsParentOf(TControl(AComponent))) then exit;
|
||||
AControl:=TControl(AComponent);
|
||||
// check if control is visible on form
|
||||
if not ControlIsDesignerVisible(AControl) then exit;
|
||||
// check if control
|
||||
if (MaxParentControl<>nil) then begin
|
||||
// select only controls, that are childs of MaxParentControl
|
||||
if (not MaxParentControl.IsParentOf(AControl)) then exit;
|
||||
// check if control is a grand child
|
||||
if (not EnvironmentOptions.RubberbandSelectsGrandChilds)
|
||||
and (AControl.Parent<>MaxParentControl) then exit;
|
||||
end;
|
||||
end;
|
||||
Origin:=GetParentFormRelativeTopLeft(AComponent);
|
||||
ALeft:=Origin.X;
|
||||
|
@ -159,6 +159,11 @@ type
|
||||
FShowComponentCaptions: boolean;
|
||||
FShowEditorHints: boolean;
|
||||
FAutoCreateForms: boolean;
|
||||
FGrabberColor: TColor;
|
||||
FMarkerColor: TColor;
|
||||
FRubberbandSelectionColor: TColor;
|
||||
FRubberbandCreationColor: TColor;
|
||||
FRubberbandSelectsGrandChilds: boolean;
|
||||
|
||||
// object inspector
|
||||
FObjectInspectorOptions: TOIOptions;
|
||||
@ -250,6 +255,14 @@ type
|
||||
read FShowComponentCaptions write FShowComponentCaptions;
|
||||
property ShowEditorHints: boolean read FShowEditorHints write FShowEditorHints;
|
||||
property AutoCreateForms: boolean read FAutoCreateForms write FAutoCreateForms;
|
||||
property GrabberColor: TColor read FGrabberColor write FGrabberColor;
|
||||
property MarkerColor: TColor read FMarkerColor write FMarkerColor;
|
||||
property RubberbandSelectionColor: TColor
|
||||
read FRubberbandSelectionColor write FRubberbandSelectionColor;
|
||||
property RubberbandCreationColor: TColor
|
||||
read FRubberbandCreationColor write FRubberbandCreationColor;
|
||||
property RubberbandSelectsGrandChilds: boolean
|
||||
read FRubberbandSelectsGrandChilds write FRubberbandSelectsGrandChilds;
|
||||
|
||||
// object inspector
|
||||
property ObjectInspectorOptions: TOIOptions
|
||||
@ -382,6 +395,16 @@ type
|
||||
ShowComponentCaptionsCheckBox: TCheckBox;
|
||||
ShowEditorHintsCheckBox: TCheckBox;
|
||||
AutoCreateFormsCheckBox: TCheckBox;
|
||||
GrabberColorLabel: TLabel;
|
||||
GrabberColorButton: TColorButton;
|
||||
MarkerColorLabel: TLabel;
|
||||
MarkerColorButton: TColorButton;
|
||||
RubberbandGroupBox: TGroupBox;
|
||||
RubberbandSelectColorLabel: TLabel;
|
||||
RubberbandSelectColorButton: TColorButton;
|
||||
RubberbandCreateColorLabel: TLabel;
|
||||
RubberbandCreateColorButton: TColorButton;
|
||||
RubberbandSelectsGrandChildsCheckBox: TCheckBox;
|
||||
|
||||
// object inspector
|
||||
ObjectInspectorGroupBox: TGroupBox;
|
||||
@ -592,6 +615,11 @@ begin
|
||||
FShowComponentCaptions:=false;
|
||||
FShowEditorHints:=false;
|
||||
FAutoCreateForms:=true;
|
||||
FGrabberColor:=clBlack;
|
||||
FMarkerColor:=clDkGray;
|
||||
FRubberbandSelectionColor:=clNavy;
|
||||
FRubberbandCreationColor:=clMaroon;
|
||||
FRubberbandSelectsGrandChilds:=true;
|
||||
|
||||
// object inspector
|
||||
FObjectInspectorOptions:=TOIOptions.Create;
|
||||
@ -791,6 +819,19 @@ begin
|
||||
'EnvironmentOptions/FormEditor/ShowEditorHints',FShowEditorHints);
|
||||
FAutoCreateForms:=XMLConfig.GetValue(
|
||||
'EnvironmentOptions/FormEditor/AutoCreateForms',FAutoCreateForms);
|
||||
FGrabberColor:=XMLConfig.GetValue(
|
||||
'EnvironmentOptions/FormEditor/GrabberColor/Value',FGrabberColor);
|
||||
FMarkerColor:=XMLConfig.GetValue(
|
||||
'EnvironmentOptions/FormEditor/MarkerColor/Value',FMarkerColor);
|
||||
FRubberbandSelectionColor:=XMLConfig.GetValue(
|
||||
'EnvironmentOptions/FormEditor/Rubberband/SelectionColor/Value',
|
||||
FRubberbandSelectionColor);
|
||||
FRubberbandCreationColor:=XMLConfig.GetValue(
|
||||
'EnvironmentOptions/FormEditor/Rubberband/CreationColor/Value',
|
||||
FRubberbandCreationColor);
|
||||
FRubberbandSelectsGrandChilds:=XMLConfig.GetValue(
|
||||
'EnvironmentOptions/FormEditor/Rubberband/SelectsGrandChilds/Value',
|
||||
FRubberbandSelectsGrandChilds);
|
||||
|
||||
if not OnlyDesktop then begin
|
||||
// files
|
||||
@ -980,6 +1021,19 @@ begin
|
||||
'EnvironmentOptions/FormEditor/ShowEditorHints',FShowEditorHints);
|
||||
XMLConfig.SetValue(
|
||||
'EnvironmentOptions/FormEditor/AutoCreateForms',FAutoCreateForms);
|
||||
XMLConfig.SetValue(
|
||||
'EnvironmentOptions/FormEditor/GrabberColor/Value',FGrabberColor);
|
||||
XMLConfig.SetValue(
|
||||
'EnvironmentOptions/FormEditor/MarkerColor/Value',FMarkerColor);
|
||||
XMLConfig.SetValue(
|
||||
'EnvironmentOptions/FormEditor/Rubberband/SelectionColor/Value',
|
||||
FRubberbandSelectionColor);
|
||||
XMLConfig.SetValue(
|
||||
'EnvironmentOptions/FormEditor/Rubberband/CreationColor/Value',
|
||||
FRubberbandCreationColor);
|
||||
XMLConfig.SetValue(
|
||||
'EnvironmentOptions/FormEditor/Rubberband/SelectsGrandChilds/Value',
|
||||
FRubberbandSelectsGrandChilds);
|
||||
|
||||
if not OnlyDesktop then begin
|
||||
// files
|
||||
@ -2132,7 +2186,6 @@ procedure TEnvironmentOptionsDialog.SetupFormEditorPage(Page: integer);
|
||||
Top:=GuideLineColorRightBottomButton.Top+2;
|
||||
Width:=GuideLineColorLeftTopLabel.Width;
|
||||
Caption:=dlgRightBottomClr;
|
||||
Visible:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2146,7 +2199,6 @@ procedure TEnvironmentOptionsDialog.SetupFormEditorPage(Page: integer);
|
||||
Left:=5;
|
||||
Width:=Parent.ClientWidth-2*Left;
|
||||
Caption:=dlgShowCaps;
|
||||
Visible:=true;
|
||||
end;
|
||||
|
||||
ShowEditorHintsCheckBox:=TCheckBox.Create(Self);
|
||||
@ -2158,7 +2210,6 @@ procedure TEnvironmentOptionsDialog.SetupFormEditorPage(Page: integer);
|
||||
Left:=ShowComponentCaptionsCheckBox.Left;
|
||||
Width:=ShowComponentCaptionsCheckBox.Width;
|
||||
Caption:=dlgShowEdrHints;
|
||||
Visible:=true;
|
||||
end;
|
||||
|
||||
AutoCreateFormsCheckBox:=TCheckBox.Create(Self);
|
||||
@ -2169,7 +2220,99 @@ procedure TEnvironmentOptionsDialog.SetupFormEditorPage(Page: integer);
|
||||
Left:=ShowEditorHintsCheckBox.Left;
|
||||
Width:=ShowEditorHintsCheckBox.Width;
|
||||
Caption:=dlgAutoForm;
|
||||
Visible:=true;
|
||||
end;
|
||||
|
||||
GrabberColorButton:=TColorButton.Create(Self);
|
||||
with GrabberColorButton do begin
|
||||
Name:='GrabberColorButton';
|
||||
Parent:=FormEditMiscGroupBox;
|
||||
Left:=200;
|
||||
Top:=0;
|
||||
Width:=50;
|
||||
Height:=25;
|
||||
end;
|
||||
|
||||
GrabberColorLabel:=TLabel.Create(Self);
|
||||
with GrabberColorLabel do begin
|
||||
Name:='GrabberColorLabel';
|
||||
Parent:=FormEditMiscGroupBox;
|
||||
Left:=GrabberColorButton.Left+GrabberColorButton.Width+5;
|
||||
Top:=GrabberColorButton.Top+2;
|
||||
Width:=110;
|
||||
Caption:=dlgGrabberColor;
|
||||
end;
|
||||
|
||||
MarkerColorButton:=TColorButton.Create(Self);
|
||||
with MarkerColorButton do begin
|
||||
Name:='MarkerColorButton';
|
||||
Parent:=FormEditMiscGroupBox;
|
||||
Left:=GrabberColorButton.Left;
|
||||
Top:=GrabberColorButton.Top+GrabberColorButton.Height+5;
|
||||
Width:=50;
|
||||
Height:=25;
|
||||
end;
|
||||
|
||||
MarkerColorLabel:=TLabel.Create(Self);
|
||||
with MarkerColorLabel do begin
|
||||
Name:='MarkerColorLabel';
|
||||
Parent:=FormEditMiscGroupBox;
|
||||
Left:=MarkerColorButton.Left+MarkerColorButton.Width+5;
|
||||
Top:=MarkerColorButton.Top+2;
|
||||
Width:=110;
|
||||
Caption:=dlgMarkerColor;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure SetupRubberbandBox;
|
||||
begin
|
||||
RubberbandSelectColorButton:=TColorButton.Create(Self);
|
||||
with RubberbandSelectColorButton do begin
|
||||
Name:='RubberbandSelectColorButton';
|
||||
Parent:=RubberbandGroupBox;
|
||||
Left:=2;
|
||||
Top:=2;
|
||||
Width:=50;
|
||||
Height:=25;
|
||||
end;
|
||||
|
||||
RubberbandSelectColorLabel:=TLabel.Create(Self);
|
||||
with RubberbandSelectColorLabel do begin
|
||||
Name:='RubberbandSelectColorLabel';
|
||||
Parent:=RubberbandGroupBox;
|
||||
Left:=RubberbandSelectColorButton.Left+RubberbandSelectColorButton.Width+2;
|
||||
Top:=RubberbandSelectColorButton.Top+2;
|
||||
Width:=100;
|
||||
Caption:=dlgRuberbandSelectionColor;
|
||||
end;
|
||||
|
||||
RubberbandCreateColorButton:=TColorButton.Create(Self);
|
||||
with RubberbandCreateColorButton do begin
|
||||
Name:='RubberbandCreateColorButton';
|
||||
Parent:=RubberbandGroupBox;
|
||||
Left:=2;
|
||||
Top:=RubberbandSelectColorButton.Top+RubberbandSelectColorButton.Height+5;
|
||||
Width:=50;
|
||||
Height:=25;
|
||||
end;
|
||||
|
||||
RubberbandCreateColorLabel:=TLabel.Create(Self);
|
||||
with RubberbandCreateColorLabel do begin
|
||||
Name:='RubberbandCreateColorLabel';
|
||||
Parent:=RubberbandGroupBox;
|
||||
Left:=RubberbandCreateColorButton.Left+RubberbandCreateColorButton.Width+2;
|
||||
Top:=RubberbandCreateColorButton.Top+2;
|
||||
Width:=100;
|
||||
Caption:=dlgRuberbandCreationColor;
|
||||
end;
|
||||
|
||||
RubberbandSelectsGrandChildsCheckBox:=TCheckBox.Create(Self);
|
||||
with RubberbandSelectsGrandChildsCheckBox do begin
|
||||
Name:='RubberbandSelectsGrandChildsCheckBox';
|
||||
Parent:=RubberbandGroupBox;
|
||||
Left:=5;
|
||||
Top:=RubberbandCreateColorButton.Top+RubberbandCreateColorButton.Height+5;
|
||||
Width:=150;
|
||||
Caption:=dlgRubberbandSelectsGrandChilds;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2184,7 +2327,6 @@ begin
|
||||
Width:=((Parent.ClientWidth-3*Left) div 2);
|
||||
Height:=170;
|
||||
Caption:=dlgEnvGrid ;
|
||||
Visible:=true;
|
||||
end;
|
||||
|
||||
SetupGridGroupBox;
|
||||
@ -2198,7 +2340,6 @@ begin
|
||||
Width:=GridGroupBox.Width;
|
||||
Height:=GridGroupBox.Height;
|
||||
Caption:=dlgEnvLGuideLines;
|
||||
Visible:=true;
|
||||
end;
|
||||
|
||||
SetupGuideLinesGroupBox;
|
||||
@ -2212,10 +2353,22 @@ begin
|
||||
Width:=Parent.ClientWidth-2*Left;
|
||||
Height:=100;
|
||||
Caption:=dlgEnvMisc;
|
||||
Visible:=true;
|
||||
end;
|
||||
|
||||
SetupMiscGroupBox;
|
||||
|
||||
RubberbandGroupBox:=TGroupBox.Create(Self);
|
||||
with RubberbandGroupBox do begin
|
||||
Name:='RubberbandGroupBox';
|
||||
Parent:=Notebook.Page[Page];
|
||||
Left:=5;
|
||||
Top:=FormEditMiscGroupBox.Top+FormEditMiscGroupBox.Height+5;
|
||||
Width:=GridGroupBox.Width;
|
||||
Height:=120;
|
||||
Caption:='Rubberband';
|
||||
end;
|
||||
|
||||
SetupRubberbandBox;
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptionsDialog.SetupNamingPage(Page: integer);
|
||||
@ -2966,6 +3119,11 @@ begin
|
||||
ShowComponentCaptionsCheckBox.Checked:=ShowComponentCaptions;
|
||||
ShowEditorHintsCheckBox.Checked:=ShowEditorHints;
|
||||
AutoCreateFormsCheckBox.Checked:=AutoCreateForms;
|
||||
GrabberColorButton.ButtonColor:=GrabberColor;
|
||||
MarkerColorButton.ButtonColor:=MarkerColor;
|
||||
RubberbandSelectColorButton.ButtonColor:=RubberbandSelectionColor;
|
||||
RubberbandCreateColorButton.ButtonColor:=RubberbandCreationColor;
|
||||
RubberbandSelectsGrandChildsCheckBox.Checked:=RubberbandSelectsGrandChilds;
|
||||
|
||||
// files
|
||||
LazarusDirComboBox.Items.Assign(LazarusDirHistory);
|
||||
@ -3082,6 +3240,11 @@ begin
|
||||
ShowComponentCaptions:=ShowComponentCaptionsCheckBox.Checked;
|
||||
ShowEditorHints:=ShowEditorHintsCheckBox.Checked;
|
||||
AutoCreateForms:=AutoCreateFormsCheckBox.Checked;
|
||||
GrabberColor:=GrabberColorButton.ButtonColor;
|
||||
MarkerColor:=MarkerColorButton.ButtonColor;
|
||||
RubberbandSelectionColor:=RubberbandSelectColorButton.ButtonColor;
|
||||
RubberbandCreationColor:=RubberbandCreateColorButton.ButtonColor;
|
||||
RubberbandSelectsGrandChilds:=RubberbandSelectsGrandChildsCheckBox.Checked;
|
||||
|
||||
// files
|
||||
LazarusDirectory:=LazarusDirComboBox.Text;
|
||||
|
@ -347,9 +347,14 @@ resourcestring
|
||||
dlgShowCaps = 'Show component captions';
|
||||
dlgShowEdrHints = 'Show editor hints';
|
||||
dlgAutoForm = 'Auto create forms';
|
||||
dlgGrabberColor = 'Grabber color';
|
||||
dlgMarkerColor = 'Marker color';
|
||||
dlgEnvGrid = 'Grid';
|
||||
dlgEnvLGuideLines = 'Guide lines';
|
||||
dlgEnvMisc = 'Miscellaneous';
|
||||
dlgRuberbandSelectionColor = 'Selection';
|
||||
dlgRuberbandCreationColor = 'Creation';
|
||||
dlgRubberbandSelectsGrandChilds = 'Select grand childs';
|
||||
dlgPasExt = 'Default pascal extension';
|
||||
dlgPasLower = 'Save pascal files lowercase';
|
||||
dlgAmbigFileAct = 'Ambigious file action:';
|
||||
|
@ -49,9 +49,9 @@
|
||||
|
||||
Create a new TRadioButton
|
||||
------------------------------------------------------------------------------}
|
||||
constructor TRadioButton.Create(AOwner : TComponent);
|
||||
constructor TRadioButton.Create(AnOwner : TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
inherited Create(AnOwner);
|
||||
fCompStyle := csRadioButton;
|
||||
AutoSize := True;
|
||||
end;
|
||||
@ -82,7 +82,7 @@ var
|
||||
R : TRect;
|
||||
DC : hDC;
|
||||
begin
|
||||
If Autosizing or not AutoSize then
|
||||
If Autosizing or (not AutoSize) then
|
||||
Exit;
|
||||
if (not HandleAllocated) or (csLoading in ComponentState) then exit;
|
||||
AutoSizing := True;
|
||||
@ -105,6 +105,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.10 2002/11/27 14:37:37 mattias
|
||||
added form editor options for rubberband and colors
|
||||
|
||||
Revision 1.9 2002/11/14 14:11:51 lazarus
|
||||
MG: fixed TRadioButton.DoAutoSize during loading
|
||||
|
||||
|
@ -795,7 +795,7 @@ type
|
||||
procedure DoAutoSize; override;
|
||||
procedure SetText(const Value: TCaption); override;
|
||||
public
|
||||
constructor Create (AOwner: TComponent); override;
|
||||
constructor Create (AnOwner: TComponent); override;
|
||||
published
|
||||
property Anchors;
|
||||
property AutoSize;
|
||||
@ -1382,6 +1382,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.68 2002/11/27 14:37:37 mattias
|
||||
added form editor options for rubberband and colors
|
||||
|
||||
Revision 1.67 2002/11/16 11:22:56 mbukovjan
|
||||
Fixes to MaxLength. TCustomMemo now has MaxLength, too.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user