livebindings

how to (correctly) use an enumerated type with livebindings (TObjectBindSourceAdapter)

此生再无相见时 提交于 2021-02-09 11:01:51
问题 I'm using TObjectBindSourceAdapter to use livebindings with an object. One of the properties of the object i'm using with TObjectBindSourceAdapter has an enumerated type, but the field in the adapter is never generated when i use an enumerated type in my object The Only solution i have found for now is to define the enumerated type as an integer in my object and typecast it. This seems to work fine but you have to keep type casting from and back the enumerated type and integers. Here is some

Delphi XE LiveBindings - Bits to Byte

十年热恋 提交于 2021-01-27 12:43:20
问题 I just discovered livebindings with Delphi. And created my first components for handling a control-word for a frequency converter. The component it self seems to work well testing it in the form designer. However, compiling and running the application things doesn't work. Screenshot from livbindings like this: And here is the code for the component unit cBits2Byte; interface uses System.SysUtils, System.Classes; type TBits2Byte = class(TComponent) private { Private declarations } fBit00,

Using Livebindings to Assign Several Field Values to an FMX MetropolisUI TListBox Item.Text

空扰寡人 提交于 2020-01-03 02:27:11
问题 I am coding a FMX Metropolis UI application and trying to assign two field values of type string to the Item.Title member of TListBox by LiveBindings technology (using expression engine). When I use a TBindList in the following way: object BindList1: TBindList Category = 'Lists' ControlComponent = ListBox1 SourceComponent = BindSourceDB1 FormatExpressions = < item ControlExpression = 'Text' SourceExpression = 'FieldByName("name1").Text + " " + Field' + 'ByName("name2").Text' end>

Delphi: Making a component visible to live binding

梦想的初衷 提交于 2020-01-01 15:38:08
问题 I have been trying to make a test object that has a string property visible to the visual binding form. The component is registered with the appropriate properties. Using XE8 and Firemonkey. I can get it to show on the visual binder by selecting it using the hide show elements, however I cannot get it to bind the Foo string to a TEdit text property, the readonly (which does nothing yet) will bind to the Text Property. how do I get it show in it with default class visibility why doesn't the

Using Format in a livebindings CustomFormat

我们两清 提交于 2019-12-24 13:03:39
问题 I'm trying to use LiveBindings to format a number for display in a TEdit on a FireMonkey form. I'm trying to use the Format method in the CustomFormat of the binding to format the number with two decimal places. I can 'hard code' the output: Format("Hello", %s) which is working, but I can't work out what formatting string to use. If I try a standard formatting string such as, Format("%.2f", %s) I get a runtime error "Format invalid or incompatible with argument". Indeed I get an error

How to write live binding expression that control TEdit.PasswordChar based on TCheckBox.Checked?

孤街醉人 提交于 2019-12-22 22:26:05
问题 I have 2 controls on a form, TCheckBox and TEdit. I want to use Live Binding to perform this: When TCheckBox.Checked = True, set TEdit.PasswordChar = * When TCheckBox.Checked = False, set TEdit.PasswordChar = #0 How may I write ControlExpression to achieve this? It would be great if I can avoid register custom method. 回答1: Here's a simple example. I couldn't find a boolean expression evaluator so I registered a new one, and also a string-to-char converter (seems to be missing, too). The form:

Livebinding JSON objects and arrays

回眸只為那壹抹淺笑 提交于 2019-12-22 18:18:25
问题 Good evening all. I'm currently trying to get to grips with livebindings in Delphi as I'd like to refresh one of my current projects (complete rework from the base for the purpose of pushing to other platforms, optimizing performance and minimizing the code). I'm working with a web API which returns JSON data. The returned JSON format for one example call would look like this; { "response": { "ips": [ { "ip": "111.222.333.444", "classification": "regular", "hits": 134, "latitude": 0.0000,

How do I get the SelectedValue of a ComboBox from code?

旧城冷巷雨未停 提交于 2019-12-21 05:41:12
问题 I am trying to build something like a TLookupComboBox using LiveBindings. I have placed a normal TComboBox on a VCL form. I also have a data set with some rows that have the two fields id and text . Then I used the LiveBindings editor to create a TBindSourceDB and a TBindingsList . There is just one binding in it: object BindingsList1: TBindingsList Methods = <> OutputConverters = <> UseAppManager = True Left = 244 Top = 229 object LinkFillControlToField1: TLinkFillControlToField Category =

How do I get the SelectedValue of a ComboBox from code?

倖福魔咒の 提交于 2019-12-21 05:41:00
问题 I am trying to build something like a TLookupComboBox using LiveBindings. I have placed a normal TComboBox on a VCL form. I also have a data set with some rows that have the two fields id and text . Then I used the LiveBindings editor to create a TBindSourceDB and a TBindingsList . There is just one binding in it: object BindingsList1: TBindingsList Methods = <> OutputConverters = <> UseAppManager = True Left = 244 Top = 229 object LinkFillControlToField1: TLinkFillControlToField Category =

How to concatenate 2 fields from a dataset using LiveBindings?

不打扰是莪最后的温柔 提交于 2019-12-11 11:42:28
问题 Is there a way to use the Live Binding Designer to concatenate 2 database fields to a component? For example I have a MemTable for client, I want to concatenate the FirstName and LastName (fullname) to a label. If there is a way to do that, I understand that the binding will be in one direction only (Database fields --> ComponentProperty). 回答1: For something simple like this...you can use the AfterScroll Event of your Dataset if Dataset.Active and (Dataset.RecordCount > 0) then label1.Caption