LiveBindings 绑定界面元素和存储数据的对象

Delphi中MVC模式程序设计与实战详解 MVC(Model-View-Controller)作为一种经典软件架构模式,通过将数据管理、用户界面与控制逻辑分离,为复杂应用提供了清晰的结构边界。在Delphi中,依托Object Pascal的强类型面向对象特性、丰富的VCL组件库以及强大的RTTI机制,MVC不仅可实现传统意义上的职责解耦,还能结合接口回调与事件通知构建松耦合系统。相较于早期基于窗体直接操作数据库的单体开发方式,MVC提升了代码复用性与测试可行性,尤其适用于企业级桌面系统的迭代维护。// 示例:一个典型的MVC调用流程。 阅读详情

Delphi 的 LiveBindings 的例子,绑定数据库控件 TDataSet 的比较多。对于 TDataSet 来说,用 LiveBindings 框架,只是可以让更多的非 TDBEdit ... 这样的数据敏感控件,可以用来显示数据。

对于 FireMonkey 来说,已经没有了数据敏感控件,要绑定数据库,只能使用 LiveBindings 框架了。

除了数据库,如果数据源是对象,该怎么个做法?我之前写过一篇,和现在网上能够搜到的多数文章一样,讲了简单的做法,但并没有讲透。尤其是,在实际使用中,该怎么做?如果纯按网上的例子来做,无法把界面和数据分开。

把界面和数据分开,有很多模式。其中一个是所谓的 MVVM 模式。什么是 MVVM 模式,在 DELPHI 里面怎么用它,请参考:

https://blog.grijjy.com/2018/01/22/mvvm-starter-kit-part-1-of-3/

什么是 MVVM?

研究过上面那篇文章及其代码,我的总结是:

1. MVVM 是所谓的 Model -- ViewModel -- View。这里的 Model 是指数据模块;ViewModel 是指包含数据显示逻辑的代码模块;View 才是真正的显示界面。这样分开的好处是,降低了代码的耦合程度。显示逻辑和显示界面分开,显示界面纯显示。数据及数据逻辑和显示逻辑分开。对于真正的大型代码,这样分开是有明显的好处的。

2. 研究了上述文章的代码,我发现它的实现虽然看起来挺复杂,归纳起来,和我们通常做 Delphi 的数据库软件类似:把数据也就是 TDataSet 放在一个 DataModule 里面,而显示界面是另外一个或多个单元。每个显示界面的界面元素 TDBEdit, TDBLabel 等等通过 TDataSource 和 DataModule 里面的 TDataSet 连接,实现双向通讯的功能。所谓双向通讯就是,

2.1. 界面上用户修改了 TDBEdit 的值,会自动反馈到 TDataSet 里面去,也会同时反应到其它界面上的其它 TDBGrid 等等绑定到对应字段的界面元素。

2.2. 如果用代码直接修改了 TDataSet 里面的数据,界面上的元素的显示会自动跟随变化。

符合 MVVM 模式的对象做 LiveBinding 到界面

那么,如果数据源不是 TDataSet 而是普通对象,该怎么做?

假设有一个 TUser 类,用它来存放一些数据,比如 ID, Age, FullName 等等,都是它的属性(public 就可以,无需 publish)。

1. 创建一个 DataModule,在这个 DataModule 里面,定义一个 FUser: TUser;这个 DataModule 就是 MVVM 里面的 Model,

2. 在这个 DataModule 里面,拖一个 AdapterBindSource1 进去,再拖一个 DataGeneratorAdapter1 进去。

3. 右键点 DataGeneratorAdapter1 下拉菜单选 Fields Editor, 给 DataGeneratorAdapter1 创建几个字段,对应 TUser 的属性。字段名要和属性名相同。同时设置前述的 AdapterBindSource1 的 Adapter 属性为这个 DataGeneratorAdapter1。这个 DataGeneratorAdapter1 纯粹是用于设计期可视化建立绑定连接用。运行期它会被替换掉。替换的代码请看:

procedure TDataModule2.AdapterBindSource1CreateAdapter(Sender: TObject;
  var ABindSourceAdapter: TBindSourceAdapter);
begin
  if not Assigned(FUser) then
  begin
    FUser := TUser.Create(Self);
    FUser.Numb := 666;
    FUser.UserID := 'pcplayer';
    FUser.FullName := 'abcdefg';
  end;


  ABindSourceAdapter := TObjectBindSourceAdapter<TNLUserInfo>.Create(AdapterBindSource1,
                                                               FUser, True);

  ABindSourceAdapter.AutoPost := False;
end;

上述代码的框架,是 AdapterBindSource1 的事件 OnCreateAdapter 双击产生。

到此,数据模块就做好了。

4. 界面:在 Form 上面拖放几个 Label1, Edit1 用来显示数据。右键点击 Form 下拉菜单选则 BindVisually,IDE 底部出来绑定的界面,问题来了,按照网上例子,AdapterBindSource1 就在这个 Form 里面,因此在可视化绑定的界面里,可以看到这个作为绑定数据源的 AdapterBindSource1,然后从 AdapterBindSource1 里面挑选字段拉线到 Label 或者 Edit 就可以了。但现在这个 AdapterBindSource1 不在 Form 本地,而是在另外一个模块里面,这里就看不见。无法拉线的方式来建立绑定。

4.1. 首先,这个 Form 的单元里面,需要 Uses 上述 DataModule 的单元名称。但 User 以后,可视化绑定的界面里面,依然不会出现 DataModule 里面的 AdapterBindSource1,无法做拉线绑定操作。

4.2. 拖一个 BindingsList 控件到 Form 上,双击它,弹出绑定连接对话框。如果做了可视化的拉线绑定,这里面会出来绑定对象。现在里面是空的。鼠标右键点这个绑定对话框,下拉菜单选择 New Binding,出现一个绑定类型对话框,在里面选择 LinkControlToField,产生一个连接,这时候 IDE 左边的属性面板,会有这个连接的属性,设置属性里面的:Control 设置为 Edit1;DataSource 下拉,就可以看到 DataModule2.AdapterBindSource1,选择它;然后选择 FieldName 下拉,可以看到字段名字,选择一个字段。绑定建立。如果绑定的界面元素是 Label,则在新建连接时,选择 LinkPropertyToField,其它操作类似。

4.3. 多个界面元素可以同时绑定到同一个 AdapterBindSource1 的相同字段;多个不同的 Form 上的界面元素也可以同时绑定到 AdapterBindSource1 的相同字段。当在一个界面里面用户修改 Edit1 的值的时候,其它界面里对应该字段的界面元素的显示会自动跟随变化。

5. 问题:用代码修改了 FUser 的属性值,界面元素没有自动跟随变化。如果是 TDataSet,修改了里面的值,界面元素的显示是会自动跟随变化的。这里,如果用代码修改了 FUser 的属性值,必须调用一次 AdapterBindSource1.Refresh; 才能让界面元素的显示自动跟随变化。因为 AdapterBindSource1 就在 DataModule 里面,因此,作为 MVVM 里面的 ViewModel 的 DataModule2 本身无需知道界面,无需和 Form 有耦合代码。而作为数据源的 TUser 也无需知道 DataModule2.

6. 在 Edit1 里面修改了一个字段值,其它 Form 里面绑定到对应字段的 Label 的显示也会自动跟随同步,但这时候,FUser 的值是否也被同步修改了?这时候取决于代码的写法。注意上述代码里面的  ABindSourceAdapter.AutoPost := False;

6.1. 如果是 ABindSourceAdapter.AutoPost := True;则用户在界面上的手动修改操作会自动反映到 FUser。

6.2. 如果是 ABindSourceAdapter.AutoPost := False; 则不会。这里看起来就是仅仅是 AdapterBindSource1 作为一个类似 ClientDataSet 的东西它内部的数据变化了,但并没有提交到数据对象 FUser,这时候如果用代码执行一次 AdapterBindSource1.Post; 则可以发现 FUser 的对应的属性值跟着改变了。

总结:

1. 这个 AdapterBindSource1 有点类似 TClientDataSet,连接到它的各个界面上的界面元素,修改了一个,另外一个会自动跟随变化;

2. AdapterBindSource1 对应的数据对象 FUser 类似数据库。如果 AdapterBindSource1 没有 Post 则修改的数据只是在 AdapterBindSource1 里面,不会更新到 FUser。

3. 因此,从 MVVM 的角度来看,正确的做法应该是把 AdapterBindSource1 和数据对象放在一个模块。或者说,数据对象一个模块(Model),AdapterBindSource1 在一个模块(ViewModel),而界面则属于 View 这个模块。这样就避免了数据对象和界面的耦合。数据对象的代码可以单独写,和界面完全无关。ViewModel 的代码也和界面无关,而且可以多个界面绑定到一个 ViewModel 上面。

 

 

 

31、借助 FireMonkey 开启移动开发革命 本文深入探讨了在FireMonkey框架下进行移动开发的关键技术与实践,涵盖LiveBindings数据绑定、避免阻塞主线程的异步REST请求实现,以及使用自定义样式的TListView高效处理长列表数据。通过构建一个获取天气预报的应用实例,详细展示了从界面绑定、后台异步通信到高性能列表渲染的完整流程,帮助开发者提升移动应用的性能与用户体验。 阅读详情

相关推荐

mvvm-in-delphi范例源码

MVVM是Model-View-ViewModel的简写。它本质上就是MVC 的改进版。MVVM 就是将其中的View 的状态和行为抽象化,让我们将视图 UI 和业务逻辑分开。

【Delphi】中的数据绑定(LiveBindings)

介绍Delphi中的数据绑定概念

sensor_WU 博客 2033

Delphi LiveBinding对象及对象序列化为JSON的例子

在Delphi里将对象和界面用LiveBinding方式绑定,用户操作界面改变对象属性值,对象属性值序列化为JSON字符串保存。

Delphi 利用LiveBindings绑定JSON数据到列表控件

为了提供数据绑定方案,Delphi FMX 框架提供了 LiveBindings 的技术。LiveBindings 基本上是一种基于表达式的机制,其中通常有一个源组件和一个目标组件,目的是将一个或多个涉及源成员的表达式绑定到目标的一个或多个属性。为了实现这一点,系统需要在某个地方存储涉及组件(在表单、框架或数据模块中)的绑定表达式集合(TBindingList 组件)。为了使数据对表达式引擎可用,您需要使用中间组件(BindSources)在表达式引擎和实际数据存储之间充当中介。

longchanghua_enshi的专栏 1032

TMS Pack for FireMonkey2.3.0.1

********************************************************************** Author: TMS Software Copyright ?1996-2014 E-mail: info@tmssoftware.com Web: http://www.tmssoftware.com ********************************************************************** TMS Pack for FireMonkey TMS Pack for FireMonkey contains components for use in user interfaces designed with the Embarcadero FireMonkey framework. The components have been designed from the ground up based on the core concepts of the FireMonkey framework: made up of styles, fully cross-platform, scalable and compatible with FireMonkey抯 effects, rotation, livebindings. Release 2.3.0.1: ----------------- Highly styleable cross-platform FireMonkey controls Support for Windows 32 bit, 64 bit, Mac OS X, iOS and Android Support for HTML formatted text, including hyperlinks in various parts of the components Built-in support for LiveBindings in TTMSFMXTableView and TTMSFMXTileList, allows to bind any item element to data Includes various demos and an extensive PDF developers guide Includes various helper controls (badge, button and html enabled text controls) that can be used separately as well Includes several Sample applications for the TTMSFMXGrid component History : --------- v1.0 : first release v1.0.0.1 Fixed : Issue with setting the focus on the form (Can be activated / deactivated with ShowActivated property) in TTMSFMXPopup Fixed : Issue with BitmapContainer assignment V1.1.0.0 New : Introducing TTMSFMXSpeedButton New : Introducing TTMSFMXHotSpotImage with separate editor Improved : TMSIOS Define Fixed : Issue with initial state when State is ssOn in TTMSFMXSlider Fixed : Issue with Opacity in HTML Drawing in TTMSFMXHTMLText v1.1.0.1 Fixed : Issue with parent in TTMSFMXPopup v1.1.0.2 Fixed : Issue with lfm file missing in package v1.1.0.3 New : Support for update 4 hotfix 1 Fixed : Issue with order of freeing objects in TTMSFMXTableView v1.1.0.4 Fixed : Issue with state changing with mouse out of bounds in TTMSFMXSlider Fixed : Issue with resizing detail view in TTMSFMXTableView v1.5.0.0 New : Components TTMSFMXGrid, TTMSFMXNavBar, TTMSFMXEdit and TTMSFMXEditBtn, TTMSFMXProgressBar New : Helper components: TTMSFMXGridPrintPreview, TTMSFMXFindDialog, TTMSFMXReplaceDialog, TTMSFMXExcelIO, TTMSFMXRTFIO. Improved : Performance for handling hover & click of hotspots in TTMSFMXHotSpotImage Fixed : Issue with mouse capturing in TTMSFMXTableView Fixed : Issue with alignment and resizing of detail view container when item has no detail view assigned in TTMSFMXTableview v1.6.0.0 New : XE3 Support New : OnSearchOpen / OnSearchClose called when swiping done or showing the filter with the ShowFilter property in TMSFMXTableView New : OnCanColumnDrag, OnCanRowDrag events added in TTMSFMXGrid New : OnColumnDragged, OnRowDragged events added in TTMSFMXGrid New : LiveBindings support in TTMSFMXGrid Fixed : Issue with Options.Mouse.ColumnDragging = false / Options.Mouse.RowDragging = false in TTMSFMXGrid Fixed : Issue with OnCanInsertRow/OnCanDeleteRow triggering in TTMSFMXGrid Fixed : Issue with selection on top when dragging in touch mode in TTMSFMXGrid Fixed : Access violation when touching outside the grid in touch mode in TTMSFMXGrid Fixed : Enabling touch mode in none selection mode in TTMSFMXGrid Fixed : Issue with OnClick / OnDblClick in instrumentation components Fixed : Issue with scrolling and selecting value in iOS in TTMSFMXSpinner Fixed : Issue with escape key not cancelling edit mode in TTMSFMXGrid v1.6.0.1 Fixed : Issue with double databinding registration in XE2 ios package v1.7.0.0 : New : added components TTMSFMXCalendar and TTMSFMXCalendarPicker New : Fixed cell single and range selection in TTMSFMXGrid New : Autosizing columns / rows on double-click in TTMSFMXGrid New : Column persistence in TTMSFMXGrid Improved : Data reset when toggling active in TTMSFMXScope Fixed : Issue with checkbox and radiobutton not rendering correctly on iOS project in TTMSFMXGrid Fixed : Issue with accessing and adding progressbar cells in TTMSFMXGrid Fixed : Repaint bug in XE3 in TTMSFMXTileList Fixed : ShowGroupGount implement in TTMSFMXGrid Fixed : GroupCountFormat implemented in TTMSFMXGrid Fixed : Issue with memoryleak in TTMSFMXLedBar Fixed : Access violation when clicking edit button in TTMSFMXTableView Fixed : Issue with OnDblClick not triggered in TTMSFMXTableView Fixed : Issue with popupmenu on background interfering with scrolling interaction in TTMSFMXTableView Fixed : Issue with selection persistence of items when scrolling in TTMSFMXTableView Fixed : Access violation Loading footer at designtime in TTMSFMXPanel v1.7.5.0 New: Capability to export multiple grids to a single RTF file in TTMSFMXGridRtfIO New : Options.Filtering.MultiColumn added to perform automatic multicolumn filtering in TTMSFMXGrid Fixed : Issue with Delphi XE3 compatibility in TTMSFMXCalendar Fixed : Issue with ApplyPlacement for plTop/plTopCenter in TTMSFMXPopup Fixed : Issue with sorting & filtering in TTMSFMXGrid Fixed : Issue with InsertRow on non-initialized grid in TTMSFMXGrid Fixed : Issue with XE3 Mac filtering in TTMSFMXGrid v1.7.5.1 Fixed : Issue with anchor detection when scrolling in TTMSFMXGrid Fixed : Issue with ccCount column calc in TTMSFMXGrid v1.7.5.2 New : Exposed functions CancelEdit / StopEdit in TTMSFMXGrid Fixed : Issue with text initialization in constructor in TTMSFMXGrid Fixed : Issue with default values for ArrowHeight and ArrowWidth in TTMSFMXPopup Fixed : Issue with focusing calendar in TTMSFMXCalendar Fixed : Issue with lookuplist in TTMSFMXEdit in XE3 Fixed : Issue with absoluteopacity in TTMSFMXLED v1.8.0.0 New : PDF Export component for Windows (QuickPDF), Mac and iOS v1.8.0.1 Fixed : Issue with absolute opacity in TTMSFMXBitmap Fixed : Issue with editing cell functionality while selecting all cells in TTMSFMXGrid v1.8.0.2 Fixed : Issue with peristing column states Fixed : Issue with printing DPI on different real and virtual printers v1.8.0.3 Fixed : Issue with dblclick in TTMSFMXGrid Fixed : Issue with dropdown window visible after editing in TTMSFMXGrid Fixed : Issue with wordwrapping and strikeout font style in html engine v1.8.0.4 : Fixed : Issue with debug message in TTMSFMXGrid v1.8.0.5 Fixed : Issue with dblclick focusing issue in TTMSFMXGrid Improved : comment popup in cell configurable in TTMSFMXGridCell v1.8.0.6 Improved : PDF Export engine v1.8.0.7 Package build options change v1.8.0.8 Fixed : Issue with text repainting at runtime in TTMSFMXHTMLText Fixed : Issue with text fill color initialization in TTMSFMXHTMLText Fixed : Repaint bug in XE3 in drag/drop tiles in TTMSFMXTileList Fixed : Issue with memoryleak when reparenting items in TTMSFMXTableView Fixed : Issue with hidden radio button checked property in TTMSFMXGrid v1.8.1.0 Fixed : Issue with clipboard on empty grid in TTMSFMXGrid New : Event OnTopLeftChanged event v1.8.1.1 Improved : block refreshing columns when destroying the component in TTMSFMXSpinner Fixed : Small issue in HTML Rendering engine for anchor rendering in TTMSFMXHTMLEngine Fixed : Issue with hidecolumn in TTMSFMXGrid v1.8.1.2 Issue with C++Builder OSX library paths not updated when installing v1.8.1.3 Issue compilation in FPC with TMSPlatforms constant v1.8.1.4 Improved : Added Event OnCellEditCancel in TTMSFMXGrid Improved : OnTileAnchorClick event exposed in TTMSFMXTileList Improved : Escape key handling in TTMSFMXCalendarPicker to cancel date selection Fixed : Issue with TMSFMXEdit signed float Fixed : Issue with dblclick in TTMSFMXEdit Fixed : Issue with dropdown access violation in TTMSFMXEdit Fixed : Access violation in TTMSFMXPopup v2.0.0.0 New : Syntax highlighting and editing component TTMSFMXMemo New : Persisted Columns collection in TTMSFMXGrid New : KeyBoard and Mouse Wheel handling support in TTMSFMXSpinner Improved : Escape to cancel date selection and return to previous selected date in TTMSFMXCalendar Fixed: Issue with autosizing and client-aligned captions v2.0.1.0 New : Pointer direction property in TTMSFMXBarButton Fixed : Issue with repainting header and footer text in TTMSFMXTableView Fixed : Selection changed notification to observer in TTMSFMXTableView Fixed : Issue with list read access in TTMSFMXNavBar Fixed : incorrect Gutter behavior when gutter is visible false or width = 0 in TTMSFMXMemo Fixed : Issue with XE2 FMI package memo registration v2.0.1.1 Fixed : Issue with height of tabs in TTMSFMXNavBar v2.0.2.0 New : OnButtonClick event in TTMSFMXEditBtn Fixed : Issue with fixed cell property persistence in TTMSFMXGrid Fixed : Issue with Excel font color import in TTMSFMXGrid Fixed : Issue with border width in new columns persistence collection in TTMSFMXGrid Fixed : Issue with bitmap assignment in TTMSFMXTableView Fixed : Issue with clearing cells in TTMSFMXGrid v2.0.2.1 Fixed : Issue with anchors & readonly cells in TTMSFMXGrid Fixed : Issue with handling Columns[x].ReadOnly Improved : Published events for Find and Replaced dialog in TTMSFMXMemo v2.1.0.0 New : XE4 support Fixed : Issue with memory leak in TTMSFMXGrid Fixed : Issue with triggering OnCursorChange in TTMSFMXMemo Fixed : Issue with UpdateMemo call when client-aligning Fixed : Issue with index out of bounds in empty grid connected to dataset v2.1.0.1 Improved : NextPage and PreviousPage methods in TTMSFMXGrid Fixed : Issue compiling demo's in trial version Fixed : Issue with LoadFromFile column widths in TTMSFMXGrid v2.1.0.2 Improved : GetTextHeight function in TTMSFMXHTMLText Fixed : Issue with iOS cell objects not being freed in TTMSFMXGrid Fixed : Issue with Scrolling when scrollbars are not visible in TTMSFMXGrid Fixed : Issue with readonly cells when using columns in TTMSFMXGrid Fixed : Issue accessing correct cell colors in TTMSFMXGrid Fixed : Issue with displaying DetailView in TTMSFMXTableView v2.1.0.3 Improved : Added Fixed Disjunct Row and Column Selection in TTMSFMXGrid Fixed : Issue with LiveBindings editing and row selection in TTMSFMXGrid Fixed : Replacement for TScrollBox issues at designtime / runtime. Fixed : Issue with Form Key handling in TTMSFMXEdit Fixed : Issue with designtime initialization of caption in TTMSFMXPanel Fixed : Issue with autocompletion popup in TTMSFMXMemo Fixed : Issue with font persistence in TTMSFMXMemo Fixed : Issue with ShowImage in TTMSFMXBarButton Fixed : Issue on iOS with categories in TTMSFMXTableView v2.1.0.4 Fixed : Issue with grid editing / inserting in LiveBindings in TTMSFMXGrid v2.1.0.5 Fixed : Memory leak with panel list in TTMSFMXNavBar Fixed : Access violation in TTMSFMXMemo v2.1.1.0 New : VisibleRowCount and VisibleColumnCount functionality in TTMSFMXGrid Fixed : Issue with disjunct selection and sorting in TTMSFMXGrid v2.1.1.2 New : LiveBinding support for Notes in TTMSFMXTileList v2.1.1.3 New : Published Anchors property Fixed : Issue inserting and deleting records in LiveBindings in TTMSFMXGrid v2.1.1.4 Fixed : Issue with RadioButtons in TTMSFMXGrid Fixed : Issue with Text position and width in TTMSFMXRotarySwitch v2.1.1.5 Fixed : Issue with rtf exporting on iOS in TTMSFMXGrid Fixed : Issue with ColumnStatesToString and column swapping in TTMSFMXGrid Fixed : Issue with lookup list on Mac in TTMSFMXEdit v2.1.1.6 Fixed : Issue with assign procedure collection item in TTMSFMXTableView Fixed : Issue with TTMSFMXPopup component on the form already exists v2.1.1.7 Improved: Assign() handling in TTMSFMXTableView Improved : conditionally use XOpenURL or XOpenFile for cell anchors in TTMSFMXGrid Fixed : Issue with Padding vs Margins in TTMSFMXPageSlider Fixed : Issue with comment resizing in TTMSFMXGrid Fixed : Issue with TableView resizing in TTMSFMXTableView Fixed : issue with column alignment settings for cell states different from normal in TTMSFMXGrid Fixed: Do not set TopMost = true in GetStyleObject, interferes with use on a popup in TTMSFMXEdit Fixed : Issue with initialization years in popup picker in TTMSFMXCalendarPicker Fixed : issue with setting Collaps = true at design time in TTMSFMXPanel Fixed : Issue with pressing ESC when date is empty in TTMSFMXCalendarPicker v2.2.0.0 New : XE5 support New : Android support New : Width and Height properties on lookup list in TTMSFMXEdit New : Redesign of TTMSFMXPopup to support iOS / Android Fixed : Issue with lookup autosize calculation in TTMSFMXEdit Fixed : Hints in TTMSFMXHTMLText and TTMSFMXBitmap Fixed : Issue with OnColumnSorted event not triggered in TTMSFMXGrid v2.2.0.1 Fixed : Issue with deleting rows in TTMSFMXGrid Fixed : Issue with date parsing in TTMSFMXCalendar Fixed : CSV parsing on iOS / Android in TTMSFMXGrid v2.2.1.0 New : OnMonthChanged and OnYearChanged events in TTMSFMXCalendar Fixed : Issue with money editing in TTMSFMXGrid v2.2.1.1 Fixed : Issue with disposing objects on iOS in TTMSFMXGrid Fixed : Issue with items return with incorrect CategoryID in TTMSFMXTableView v2.2.1.2 Fixed : Issue with column moving & column sizes in TTMSFMXGrid Fixed : Issue with save to file & linebreaks on iOS / Android in TTMSFMXGrid Fixed : Issue with column, row dragging out of the grid boundaries in TTMSFMXGrid Fixed : Issue with resizing in TTMSFMXTableView v2.2.1.3 Fixed : Issue with scrollbox and applystyle empty text initialization in TTMSFMXEdit Fixed : Issue with string conversion on iOS / Android in TTMSFMXGrid Fixed : Issue with column, row dragging out of the grid boundaries in TTMSFMXGrid Fixed : Issue with Livebindings in TTMSFMXCalendarPicker v2.2.1.4 Fixed : Issue with badge in TTMSFMXTileList Fixed : Issue with row sorting and objects in TTMSFMXGrid v2.2.2.0 Improved : Disjunct deselection of column, rows and cells in TTMSFMXGrid Fixed : Issue with horizontal scrolling and text trimming in TTMSFMXMemo Fixed : Issue with displaylist on XE5 in TTMSFMXEdit Fixed : Issue with assignment of item an OnItemClick in TTMSFMXTableView Fixed : Floating point division by zero in TTMSFMXPopup Fixed : Issue with OnCellEditDone event and focus changes v2.2.2.1 Fixed: Issue with Keyboard handling for ComboBox editor type in TTMSFMXGrid v2.2.2.2 Fixed : Issue with saving hotspot images in TTMSFMXHotSpotImage Fixed : Issue with memo find & replace dialog up and down search in TTMSFMXMemo Fixed : Issue with naming for led elements in TTMSFMX7SegLed Fixed : Issue with mouse enter/leave in TTMSFMXCalendar Fixed : Issue with column hiding and memory leak in sorting data in TTMSFMXGrid v2.2.2.3 Fixed : Issue with column/row hiding combinations in TTMSFMXGrid Fixed : Issue with Escape key in TTMSFMXGrid v2.2.2.4 Fixed : Issues with column/row handling in TTMSFMXGrid Fixed : Issue with calculation setpoints, needles and sections with minimumvalue > 0 in TTMSFMXLinearGauge v2.2.2.5 Improved: Signed numeric not being handled in GetInt/SetInt in TTMSFMXEdit Fixed: Issue with unhiding row combinations in TTMSFMXGrid v2.2.2.6 Improved : OnFormatCellDataExpression in TTMSFMXGrid Fixed : Issue with selection initialization in TTMSFMXGrid Fixed : Issue with cell creation in xls export v2.2.2.7 Fixed : Issue with using semi opaque hover, selected, down color in TTMSHotSpotImage Fixed : Issue with row insertion in TTMSFMXGrid v2.2.2.8 Fixed : Issue with grouping / ungrouping and row / column insertion changes v2.2.2.9 Improved : Clearing grid offset in TTMSFMXScope Fixed : Issue with initializing grid with default no. columns in TTMSFMXGrid Fixed : Issue with adding data without animation in TTMSFMXScope v2.3.0.0 New : XE6 Support v2.3.0.1 Fixed : XE6 Style compatibility issues Usage: ------ Use of TMS software components in applications requires a license. A license can be obtained by registration. A single developer license registration is available as well as a site license. With the purchase of one single developer license, one developer in the company is entitled to: - use of registered version that contains full source code and no limitations - free updates for a full version cycle - free email priority support & access to support newsgroups - discounts to purchases of other products With a site license, multiple developers in the company are entitled to: - use of registered version that contains full source code and no limitations - add additional developers at any time who make use of the components - free updates for a full version cycle - free email priority support & access to support newsgroups - discounts to purchases of other products Online order information can be found at: http://www.tmssoftware.com/go/?orders Note: ----- The components are also part of the TMS Component Pack bundle, see http://www.tmssoftware.com/go/?tmspack Help, hints, tips, bug reports: ------------------------------- Send any questions/remarks/suggestions to : help@tmssoftware.com Before contacting support about a possible issue with the component you encounter, make sure that you are using the latest version of the component. If a problem persists with the latest version, provide information about which Delphi or C++Builder version you are using as well as the operating system and if possible, steps to reproduce the problem you encounter. That will guarantee the fastest turnaround times for your support case.

响应式编程实战:DelphiLiveBindings与MVVM模式融合架构.pdf

文档支持目录章节跳转同时还支持阅读器左侧大纲显示和章节快速定位,文档内容完整、条理清晰。文档内所有文字、图表、函数、目录等元素均显示正常,无任何异常情况,敬请您放心查阅与使用。文档仅供学习参考,请勿用作商业用途。 如果你正在寻找一种高效、强大的编程语言来开发跨平台应用,那么Delphi绝对值得考虑!它拥有直观的可视化开发环境,让代码编写变得轻松简单。凭借着快速的编译速度和卓越的性能优化,Delphi能够帮助开发者迅速构建出高质量的应用程序。无论是Windows、macOS、iOS还是Android平台,Delphi都能完美支持,真正实现一次编写,多平台部署。选择Delphi,开启高效开发之旅!

【Delphi】Delphi 中的 LiveBindings 使用场景与概念

LiveBindings 适用于需要快速绑定 UI 控件和数据源的场景,尤其在数据库应用、对象模型绑定等场景中发挥作用。你可以使用 LiveBindings Designer 进行可视化的绑定,也可以通过代码实现更灵活的绑定。LiveBindings 既支持数据库字段的绑定,也支持普通对象和列表的绑定。LiveBindings 通过提供一种灵活、动态的数据绑定机制,极大地简化了 Delphi 应用程序中的数据交互。

sensor_WU 博客 1553

Delphi响应式编程革命:LiveBindings与Observable模式深度融合.pdf

文档支持目录章节跳转同时还支持阅读器左侧大纲显示和章节快速定位,文档内容完整、条理清晰。文档内所有文字、图表、函数、目录等元素均显示正常,无任何异常情况,敬请您放心查阅与使用。文档仅供学习参考,请勿用作商业用途。 如果你正在寻找一种高效、强大的编程语言来开发跨平台应用,那么Delphi绝对值得考虑!它拥有直观的可视化开发环境,让代码编写变得轻松简单。凭借着快速的编译速度和卓越的性能优化,Delphi能够帮助开发者迅速构建出高质量的应用程序。无论是Windows、macOS、iOS还是Android平台,Delphi都能完美支持,真正实现一次编写,多平台部署。选择Delphi,开启高效开发之旅!

再谈 Delphi 的 LiveBindings 绑定界面元素和对象

前言: 本博客前面有文章描述过如何将一个对象的属性和界面元素(比如,Label1)绑定。那篇文章写得有点复杂。这里简化一下操作过程的描述。 Delphi 版本: Delphi 10.4 社区版。 操作方法: 1. 假设有一个类定义: TMyDev = class private FDevID: string; FDevName: string; FIsOnline: Integer; FIsSelected: Integer; public pr

pcplayer的博客 1402

Android 12 HAL开发避坑实录:手把手教你用AIDL在Native层实现一个可开机自启动的Service

本文详细介绍了在Android 12 HAL开发中,如何通过AIDL在Native层实现一个可开机自启动的Service。从环境准备、AIDL接口定义、服务实现到VINTF集成与SELinux策略配置,提供了完整的实战指南,帮助开发者避开常见陷阱,提升开发效率。

weixin_28314575的博客 321

kaggle-NeurIPS - Open Polymer Prediction 2025-0.069

本文摘要: 本研究基于多任务学习框架,开发了聚合物物理化学性质预测模型,能够根据SMILES字符串同步预测玻璃化转变温度(Tg)、分数游离体积(FFV)等5种关键性质。针对数据缺失率高、样本不均衡等挑战,采用"先补充后扩充"策略整合多源数据,并融合RDKit分子描述符、ChemBERTa语义特征和自编码器特征构建多维度表征。模型采用硬参数共享架构,结合动态加权损失函数和早停机制,在验证集上表现出色,其中密度预测R²达0.92。研究为聚合物性能的高通量预测提供了有效解决方案,对材料智能设计具有重要参考价值。

2302_78976920的博客 784

(原创) Delphi中LiveBinding 绑定非数据库类数据的时候显示字段自定义名称(一)

DELPHI默认下,Grid控件通过TAdapterBindSource绑定到一个TObjectList<TObject>列表时,Grid的Header显示的是TObject的属性名称。不能像绑定数据集时显示自定义名称,我们来看看其是怎么实现的。 Grid是如何绑定数据的,通过Grid的绑定类TLinkGridToDataSource,追踪到单元Data.Bind.Grid.pas。TCustomLinkGridToDataSource本身没什么相关的方法,其父类是TCustomLinkGri

舞天涯的专栏 807

CodeBuddy 接入 MCP,一键生成网站!

2024 年 11 月,Anthropic 公司搞了个挺有意思的新玩意 - Model Context Protocol(模型上下文协议)简称为 MCP 协议。简单来说,它就是给 AI 和各类工具数据之间搭了个标准化的”桥梁”,让开发者不用再为对接问题头疼了。mcp.so如下图所示,这是 mcp.so 网站中的 MCP Server。使用百度/高德地图分析旅线计算时间接 Puppeteer 自动操作网页使用 Github/Gitlab 让大模型接管代码仓库。

悟空聊架构的专栏 1946

FireMonkey TListView 使用 LiveBindings 绑定 TObjectList

前言: Delphi FireMonkey 的 LiveBindings 可以用来直接绑定界面元素和一个对象的属性,这样就可以把对象的值显示到界面上。常见的是将数据库 DataSet 的数据显示到界面上。 如果数据是一组对象,放到一个 TObjectList 里面,该如何做? 以下操作在 Delphi 10.4 社区版上测试通过。 正文开始: 1. 有一个对象: TMyDev = class private FDevID: string; FDevName: string;

pcplayer的博客 679

CTF逆向实战:如何快速识别RC4、TEA和Base64的魔改变种?

本文针对CTF逆向比赛中常见的加密算法魔改问题,详细讲解了如何快速识别和破解RC4、TEA和Base64的变种。通过分析算法核心特征、常见魔改手法,并结合动态调试与脚本编写等实战技巧,帮助逆向分析人员有效应对算法混淆,提升解题效率。

agile9scrum的博客 784

OrangePi Kunpeng Pro 安装 ROS2 + Gazebo

OrangePi Kunpeng Pro 的优点很明显,内置openEuler,配备PD电源,做到开箱即用;板子设计也不错,风扇噪音不大,散热良好,昇腾芯片又确保小板子的性能,接口丰富是这类板子共同的优点,也很好的继承了下来,甚至还可以外接固态,可靠性大大提升。使用起来,哪怕不用openEuler的话,也可以很方便的刷Ubuntu来实现一些需要依赖的开发工作,这次没有跑AI模型,所以对算力的优势还没有很明显的感受,下次可以试一下yolo跑跑看。

Arcan 1824

LiveBindings 绑定对象里面的图片字段,对象要平台中立

问题来源: 假设我有一个数据对象 TnUser = class 里面需要存储图片。 因为 Delphi 的 VCL 和 FMX 对图片的处理,引用的单元不同,为了让这个 TnUser 更单纯,平台中立,它只能存储图片的二进制数据,而不是 TBitmap 或者 TJpeg 这样的对象。 因此,我在这里直接用一个 TMemroyStream 来存储图片的数据。 问题来了,我在 View...

pcplayer的博客 2326

linux v3h平台开发系列详解(GMSL摄像头篇):1.11 解串器MIPI 1.5G高速率特殊deskew配置

解串器max96712 deskew配置

xian18809311584的博客 1775

【Delphi】使用 TPrototypeBindSource 和 LiveBindings 设计器示例

Delphi数据绑定示例

sensor_WU 博客 1337

BES2700的PMU

BES2700ZP-BES2700芯片的PMU架构分析摘要:本文档分析了BES2700芯片的电源管理单元(PMU)架构。实际应用中仅需为VBAT引脚供电,其余电源均由芯片内部PMU提供。文档包含架构示意图、问题列表和参考链接,涉及PMU工作原理、外部供电要求等关键技术点。待解决问题包括具体供电参数和内部电源转换机制等。通过添加日志信息和代码片段,为开发人员提供了调试PMU功能的实用方法。

云淡风轻 118

含分布式电源的配电网三段式电流保护影响仿真研究

文章摘要 本文研究了分布式电源(DG)接入对配电网三段式电流保护的影响。通过在Matlab/Simulink平台搭建含同步发电机型DG的10kV配电网模型,设计了基于傅里叶算法的三段式电流保护模块(I段瞬时速断、II段限时速断、III段定时限过流)。研究分析了不同DG接入位置、容量及故障点对保护系统的影响机理。仿真结果表明,DG接入会改变故障电流特性,可能导致三种典型问题:保护范围扩大引起误动、保护灵敏度下降导致拒动,以及保护选择性丧失。该研究为含DG配电网的保护配置与整定提供了理论依据和仿真参考,对保障分

huanghm88的专栏 269

在这个示例中,学习如何使用LiveBindings的TProtoTypeBindSource控件来实现对象间的主从式的数据绑定... ...

(原型绑定源)则是LiveBindings家族中的“隐藏高手”——它不直接连接数据库,而是绑定到内存中的对象或记录,非常适合处理主从式数据关系(比如“一个客户对应多个订单”)。这有点像是“照葫芦画瓢”——你给它一个“葫芦”(原型对象),它就能帮你“画瓢”(绑定到任意同类型的对象上)。在Delphi开发中,LiveBindings是一个强大的数据绑定框架,它允许你将UI组件与数据源直接关联,而无需编写繁琐的事件处理代码。### 第三步:编写绑定逻辑(核心代码)现在,我们写代码来“喂”数据,并建立主从关系。

ZnBcWei7v的博客 188

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Delphi LiveBindings主从数据绑定实战解析

数据绑定是现代应用开发中的核心技术,通过建立UI与数据源的自动同步机制,显著提升开发效率。LiveBindings作为Delphi FireMonkey框架的创新特性,采用声明式编程范式替代传统事件驱动模式,特别适合处理主从关系数据场景。其核心原理是通过TProtoTypeBindSource组件动态适配业务对象,利用属性探测和变更通知机制实现实时数据同步。在订单管理、库存系统等业务场景中,开发者只需配置绑定表达式即可实现复杂数据联动,避免了手动维护状态同步的繁琐工作。结合TObservable通知体系和R

weixin_33417488的博客 216

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

一步一步学习使用LiveBindings() 绑定到自定义外观的ListBox

OnDrawItem初始化OnDrawItem性能开销设计时限制预渲染缓存使用TListBoxOnDrawItem。

zPXeRi8bO的博客 242

包中创建自定义列表项。 . 使用自定义列表项进行数据绑定 . 将天气预报数据保存到本地内存表,通过LiveBindings进行显示。 ...

# 一、项目准备与基础架构### 1.1 创建包和自定义列表项首先,我们需要创建一个Package(包),在其中定义自定义列表项组件。事件触发时,遍历列表项并更新温度显示与天气图标4. 用户滚动列表时,LiveBindings自动管理虚拟化,确保内存高效使用### 3.2 常见问题处理。:数据与视图分离,便于后期修改UI或数据源实战建议:对于更复杂的天气数据(如未来7天预报),可以扩展自定义列表项包含多个子控件,并通过。的持久化功能,可以缓存最近获取的天气数据,提升离线体验。激活后,自动为每条记录创建。

boyVyYVf7的博客 214

LiveBindings Designer或Wizard,编程创建绑定。 . 使用Fluent LiveBindings简化绑定代码 ...

如果EBS CSI组件没有附加对应的IAM role,需要在IAM 控制台中创建附有AmazonEBSCSIDriverPolicy权限且类型为AWS账号的role,否则EKS创建PVC时会报错。点击AWS Prometheus工作区ID进入详情,将提取/收集 中的配置保存为prometheus.yaml,后面会在安装prometheus时使用。为了可以把Prometheus数据写入到AWS managed Prometheus,需要先在AWS Prometheus控制台中创建工作区。

asfaefaha的博客 572
上一篇: 继承一个界面控件,给它增加功能,但继承的类仍然用父类的名字
下一篇: LiveBindings 绑定对象里面的图片字段,对象要平台中立
pcplayer
博客等级 码龄26年 633粉丝 284原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值