Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Product Manuals » Elevate Web Builder 3 Manual » Using Local Storage » Detecting Local Storage Changes |
uses WebCore, WebComps; procedure TForm1.StorageChange(Sender: TObject; const Key: String; const NewValue: String; const OldValue: String; const URL: String); begin if (Key='') or (Key='DisplayPrefs') then LoadDisplayPrefs; end; procedure TForm1.Form1Create(Sender: TObject); begin DisplayPrefs:=TStringList.Create; LocalStorage.OnChange:=StorageChange; end; procedure TForm1.Form1Destroy(Sender: TObject); begin LocalStorage.OnChange:=nil; DisplayPrefs.Free; DisplayPrefs:=nil; end; procedure TForm1.InitDisplayPrefs; begin with DisplayPrefs do begin Clear; Values['ShowMainMenu']:='True'; Values['ShowToolBar']:='True'; end; end; procedure TForm1.SaveDisplayPrefs; begin LocalStorage.Set('DisplayPrefs',DisplayPrefs.Text); end; procedure TForm1.LoadDisplayPrefs; begin if LocalStorage.Exists('DisplayPrefs') then DisplayPrefs.Text:=LocalStorage['DisplayPrefs'] else InitDisplayPrefs; end;
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |