mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 23:25:56 +02:00
lcl: ignore BorderStyle changes for TForm during the design time (issue #0017099)
git-svn-id: trunk@26993 -
This commit is contained in:
parent
5256b68374
commit
83e5f75727
@ -1677,7 +1677,6 @@ var
|
||||
AdaptBorderIcons: boolean;
|
||||
begin
|
||||
if FFormBorderStyle = NewStyle then exit;
|
||||
//TODO: Finish SETBORDERSTYLE
|
||||
|
||||
// AutoScroll is only available for bsSizeable, bsSizeToolWin windows
|
||||
if not (NewStyle in BorderStylesAllowAutoScroll) then
|
||||
@ -1687,19 +1686,22 @@ begin
|
||||
(BorderIcons = DefaultBorderIcons[FFormBorderStyle]);
|
||||
FFormBorderStyle := NewStyle;
|
||||
|
||||
// if Form had default border icons before change, it should keep the default
|
||||
if AdaptBorderIcons then
|
||||
BorderIcons := DefaultBorderIcons[FFormBorderStyle];
|
||||
|
||||
Include(FFormState, fsBorderStyleChanged);
|
||||
// ToDo: implement it.
|
||||
// We can not use inherited SetBorderStyle(NewStyle),
|
||||
// because TBorderStyle <> TFormBorderStyle;
|
||||
if HandleAllocated then
|
||||
if not (csDesigning in ComponentState) then
|
||||
begin
|
||||
TWSCustomFormClass(WidgetSetClass).SetFormBorderStyle(Self, NewStyle);
|
||||
Perform(CM_ICONCHANGED, 0, 0);
|
||||
UpdateMenu;
|
||||
// if Form had default border icons before change, it should keep the default
|
||||
if AdaptBorderIcons then
|
||||
BorderIcons := DefaultBorderIcons[FFormBorderStyle];
|
||||
|
||||
Include(FFormState, fsBorderStyleChanged);
|
||||
// ToDo: implement it.
|
||||
// We can not use inherited SetBorderStyle(NewStyle),
|
||||
// because TBorderStyle <> TFormBorderStyle;
|
||||
if HandleAllocated then
|
||||
begin
|
||||
TWSCustomFormClass(WidgetSetClass).SetFormBorderStyle(Self, NewStyle);
|
||||
Perform(CM_ICONCHANGED, 0, 0);
|
||||
UpdateMenu;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -371,7 +371,7 @@ begin
|
||||
pClassName := @ClsName[0];
|
||||
WindowTitle := StrCaption;
|
||||
AdjustFormBounds(lForm, Bounds);
|
||||
if lForm.Position in [poDefault, poDefaultPosOnly] then
|
||||
if (lForm.Position in [poDefault, poDefaultPosOnly]) and not (csDesigning in lForm.ComponentState) then
|
||||
begin
|
||||
Left := CW_USEDEFAULT;
|
||||
Top := CW_USEDEFAULT;
|
||||
@ -381,7 +381,7 @@ begin
|
||||
Left := Bounds.Left;
|
||||
Top := Bounds.Top;
|
||||
end;
|
||||
if lForm.Position in [poDefault, poDefaultSizeOnly] then
|
||||
if (lForm.Position in [poDefault, poDefaultSizeOnly]) and not (csDesigning in lForm.ComponentState) then
|
||||
begin
|
||||
Width := CW_USEDEFAULT;
|
||||
Height := CW_USEDEFAULT;
|
||||
@ -401,12 +401,12 @@ begin
|
||||
end;
|
||||
SetStdBiDiModeParams(AWinControl, Params);
|
||||
// create window
|
||||
FinishCreateWindow(AWinControl, Params, false);
|
||||
FinishCreateWindow(AWinControl, Params, False);
|
||||
|
||||
Result := Params.Window;
|
||||
|
||||
// remove system menu items for bsDialog
|
||||
if lForm.BorderStyle = bsDialog then
|
||||
if (lForm.BorderStyle = bsDialog) and not (csDesigning in lForm.ComponentState) then
|
||||
begin
|
||||
SystemMenu := GetSystemMenu(Result, False);
|
||||
DeleteMenu(SystemMenu, SC_RESTORE, MF_BYCOMMAND);
|
||||
|
Loading…
Reference in New Issue
Block a user