If you’re looking for a quick and easy way to update an in-memory data table, the Update Switch Demo is the perfect solution. Built in Delphi, this cross-platform application is designed to work on Android, iOS, macOS, Windows, and Linux. With a single code base and single UI, it’s easy to keep your data updated across all your devices. Plus, the Live Bindings feature makes it super simple to update your data when a switch control changes. So if you need a fast and reliable way to keep your data up-to-date, the Update Switch Demo is the perfect tool for the job.
フルクロスプラットフォームのデータバインディング スイッチデモをGithubからダウンロード
このデモは、カメラデモ、絵文字デモ、ペイントデモなど、100以上のクロスプラットフォームデモの一部です。
目次
ソフトウェア開発におけるスイッチボタン
switch button is a graphical control element that allows the user to switch between different options. It is typically used to switch between different views or modes in a software application. For example, a switch button could be used to switch between the “design” and “code” views in a web development IDE. Switch buttons are also commonly used to switch between different sets of options in a settings menu. For example, a switch button could be used totoggle between different display modes (e.g., landscape and portrait). In general, switch buttons provide a quick and convenient way for users to switch between different options in a software application.
画面ショット
デモのソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.クラス, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.StorageBin, Data.Bind.EngExt, Fmx.Bind.DBEngExt, System.Rtti, System.Bindings.Outputs, Fmx.Bind.Editors, FMX.StdCtrls, Data.Bind.Components, Data.Bind.DBScope, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, FMX.Effects, FMX.Controls.Presentation; type TForm1 = class(TForm) MaterialOxfordBlueSB: TStyleBook; ToolBar1: TToolBar; ShadowEffect4: TShadowEffect; Label1: TLabel; Label2: TLabel; <strong> FDMemTable1: TFDMemTable; BindSourceDB1: TBindSourceDB; BindingsList1: TBindingsList; LinkPropertyToFieldText: TLinkPropertyToField; Switch1: TSwitch; LinkControlToField2: TLinkControlToField;</strong> private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} end. |
データバインディングの定義
Formのプロパティ設定
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
object BindSourceDB1: TBindSourceDB DataSet = FDMemTable1 ScopeMappings = <> Left = 144 Top = 224 end object BindingsList1: TBindingsList Methods = <> OutputConverters = <> Left = 20 Top = 5 object LinkPropertyToFieldText: TLinkPropertyToField Category = 'Quick Bindings' DataSource = BindSourceDB1 FieldName = 'Value' Component = Label2 ComponentProperty = 'Text' end object LinkControlToField2: TLinkControlToField Category = 'Quick Bindings' DataSource = BindSourceDB1 FieldName = 'Value' Control = Switch1 Track = True end end |
クロスプラットフォームアプリのプログラミング手法を学ぶには
今すぐ Coding Boot Camp 2022に登録してください。ゲーム、JavaScript、Web、Python、SQL、データベース、iOS、MacOS、Android、モバイル、Linux、Windows、デスクトップ、サーバー、Arduinoなど、プログラミングに関するさまざまなトピックを学ぶことができます。