tvplanit: Store current resourceID of full demo to ini file.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5131 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2016-09-06 19:58:31 +00:00
parent c782c3bc7e
commit ff520cb2d7
2 changed files with 11 additions and 5 deletions

View File

@ -57,7 +57,7 @@ object MainForm: TMainForm
Height = 528
Top = 48
Width = 834
PageIndex = 4
PageIndex = 0
Align = alClient
TabOrder = 1
TabStop = True

View File

@ -122,7 +122,7 @@ type
FLang: String;
FActiveView: Integer;
FVisibleDays: Integer;
// Datastore: TVpCustomDatastore;
FResID: Integer;
procedure PopulateLanguages;
procedure PositionControls;
procedure SetActiveView(AValue: Integer);
@ -448,9 +448,12 @@ begin
MediaFolder := AppendPathDelim(SysUtils.GetEnvironmentVariable('SYSTEMROOT')) + 'media';
{$ENDIF}
// By default select the last resource entered.
if Resources.Count > 0 then
Resource := Resources.Items[Resources.Count-1];
if (Resources.Count > 0) then begin
if FResID = -1 then
Resource := Resources.Items[0]
else
ResourceID := FResID;
end;
end;
Caption := Application.Title;
@ -765,6 +768,7 @@ begin
CbDragDropTransparent.Checked);
CbDragDropTransparentChange(nil);
FResID := ini.ReadInteger('Data', 'ResourceID', -1);
finally
ini.Free;
end;
@ -799,6 +803,8 @@ begin
ini.WriteBool('Settings', 'AllowInplaceEditing', CbAllowInplaceEditing.Checked);
ini.WriteBool('Settings', 'AllowDragAndDrop', CbAllowDragAndDrop.Checked);
ini.WriteBool('Settings', 'DragAndDropTransparent', CbDragDropTransparent.Checked);
ini.WriteInteger('Data', 'ResourceID', VpControlLink1.Datastore.ResourceID);
finally
ini.Free;
end;