mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 04:29:25 +02:00
TPageControl: AutoSizing is now delayed until page handle was added to the parent handle
git-svn-id: trunk@9635 -
This commit is contained in:
parent
8b1f47f873
commit
1ecaec575c
@ -110,7 +110,7 @@ type
|
||||
function IndexOf(ARelation: TKeyCommandRelation): integer;
|
||||
function CommandToShortCut(ACommand: word): TShortCut;
|
||||
function LoadFromXMLConfig(XMLConfig:TXMLConfig; const Prefix: String):boolean;
|
||||
function SaveToXMLConfig(XMLConfig:TXMLConfig; const Prefix: String):boolean;
|
||||
function SaveToXMLConfig(XMLConfig:TXMLConfig; const Path: String):boolean;
|
||||
procedure AssignTo(ASynEditKeyStrokes:TSynEditKeyStrokes;
|
||||
IDEWindowClass: TCustomFormClass);
|
||||
procedure Assign(List: TKeyCommandRelationList);
|
||||
@ -198,7 +198,7 @@ implementation
|
||||
|
||||
|
||||
const
|
||||
KeyMappingFormatVersion = 3;
|
||||
KeyMappingFormatVersion = 4;
|
||||
|
||||
VirtualKeyStrings: TStringHashList = nil;
|
||||
|
||||
@ -2475,7 +2475,7 @@ var a,b,p:integer;
|
||||
Result:=IntToStr(ShortcutA.Key1) + ',' + ShiftStateToStr(ShortcutA.Shift1) + ',' +
|
||||
IntToStr(ShortcutB.Key1) + ',' + ShiftStateToStr(ShortcutB.Shift1);
|
||||
end;
|
||||
|
||||
|
||||
// LoadFromXMLConfig
|
||||
var
|
||||
FileVersion: integer;
|
||||
@ -2527,15 +2527,18 @@ begin
|
||||
end;
|
||||
|
||||
function TKeyCommandRelationList.SaveToXMLConfig(
|
||||
XMLConfig:TXMLConfig; const Prefix: String):boolean;
|
||||
XMLConfig:TXMLConfig; const Path: String):boolean;
|
||||
var a,b: integer;
|
||||
Name: String;
|
||||
CurKeyStr: String;
|
||||
DefaultKeyStr: string;
|
||||
TheKeyA, TheKeyB: TIDEShortCut;
|
||||
//SavedCount: Integer;
|
||||
//SubPath: String;
|
||||
begin
|
||||
XMLConfig.SetValue(Prefix+'Version/Value',KeyMappingFormatVersion);
|
||||
XMLConfig.SetDeleteValue(Prefix+'ExternalToolCount/Value',ExtToolCount,0);
|
||||
XMLConfig.SetValue(Path+'Version/Value',KeyMappingFormatVersion);
|
||||
XMLConfig.SetDeleteValue(Path+'ExternalToolCount/Value',ExtToolCount,0);
|
||||
//SavedCount:=0;
|
||||
for a:=0 to FRelations.Count-1 do begin
|
||||
Name:=lowercase(Relations[a].Name);
|
||||
for b:=1 to length(Name) do
|
||||
@ -2545,9 +2548,16 @@ begin
|
||||
GetDefaultKeyForCommand(Command,TheKeyA,TheKeyB);
|
||||
DefaultKeyStr:=KeyValuesToStr(TheKeyA, TheKeyB);
|
||||
end;
|
||||
//debugln(['TKeyCommandRelationList.SaveToXMLConfig A ',Prefix+Name,' ',CurKeyStr=DefaultKeyStr]);
|
||||
XMLConfig.SetDeleteValue(Prefix+Name+'/Value',CurKeyStr,DefaultKeyStr);
|
||||
XMLConfig.SetDeleteValue(Path+Name+'/Value',CurKeyStr,DefaultKeyStr);
|
||||
//debugln(['TKeyCommandRelationList.SaveToXMLConfig A ',Path+Name,' ',CurKeyStr=DefaultKeyStr]);
|
||||
{if CurKeyStr<>DefaultKeyStr then begin
|
||||
inc(SavedCount);
|
||||
SubPath:=Path+'Item'+IntToStr(SavedCount);
|
||||
XMLConfig.SetDeleteValue(SubPath+'/Name',Name,'');
|
||||
XMLConfig.SetValue(SubPath+'/Value',CurKeyStr);
|
||||
end;}
|
||||
end;
|
||||
//XMLConfig.SetDeleteValue(Path+'KeyMap/Count',SavedCount,0);
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
|
@ -44,6 +44,7 @@ type
|
||||
|
||||
TPageFlag = (
|
||||
pfAdded, // page handle added to notebook handle
|
||||
pfAdding, // currently page handle adding to notebook handle
|
||||
pfRemoving
|
||||
);
|
||||
TPageFlags = set of TPageFlag;
|
||||
@ -69,6 +70,7 @@ type
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
procedure AdjustClientRect(var ARect: TRect); override;
|
||||
function CanTab: boolean; override;
|
||||
function AutoSizeDelayed: boolean; override;
|
||||
function IsVisible: Boolean; override;
|
||||
function VisibleIndex: integer;
|
||||
property PageIndex: Integer read GetPageIndex write SetPageIndex;
|
||||
|
@ -423,10 +423,11 @@ begin
|
||||
if fPageIndex = AValue then exit;
|
||||
if not CanChangePageIndex then exit;
|
||||
//debugln('TCustomNotebook.SetPageIndex B ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated));
|
||||
if not Page[AValue].TabVisible and not (csDesigning in ComponentState) then exit;
|
||||
fPageIndex := AValue;
|
||||
UpdateAllDesignerFlags;
|
||||
DoSendPageIndex;
|
||||
if Page[AValue].TabVisible or (csDesigning in ComponentState) then begin
|
||||
fPageIndex := AValue;
|
||||
UpdateAllDesignerFlags;
|
||||
DoSendPageIndex;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -510,8 +511,10 @@ begin
|
||||
if (not (csDestroying in APage.ComponentState))
|
||||
and (APage.TabVisible or (csDesigning in ComponentState)) then begin
|
||||
if (pfAdded in APage.FFlags) then exit;
|
||||
Include(APage.FFlags,pfAdded);
|
||||
Include(APage.FFlags,pfAdding);
|
||||
TWSCustomNotebookClass(WidgetSetClass).AddPage(Self, APage, APage.VisibleIndex);
|
||||
APage.FFlags:=APage.FFlags+[pfAdded]-[pfAdding];
|
||||
APage.ResizeDelayedAutoSizeChildren
|
||||
end else begin
|
||||
if not (pfAdded in APage.FFlags) then exit;
|
||||
Exclude(APage.FFlags,pfAdded);
|
||||
|
@ -226,4 +226,9 @@ begin
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
function TCustomPage.AutoSizeDelayed: boolean;
|
||||
begin
|
||||
Result:=(not (pfAdded in FFlags)) or (inherited AutoSizeDelayed);
|
||||
end;
|
||||
|
||||
// included by extctrls.pp
|
||||
|
Loading…
Reference in New Issue
Block a user