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 Height = 528
Top = 48 Top = 48
Width = 834 Width = 834
PageIndex = 4 PageIndex = 0
Align = alClient Align = alClient
TabOrder = 1 TabOrder = 1
TabStop = True TabStop = True

View File

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