Forum > LCL

Can't get Item's Text property

(1/2) > >>

Hi, I'm making an unit to translate applications made with Lazarus.
I save in an ini file all captions, hints and text value and then I set them automatically using SetPropValue function.
But before set properties values, I have to find them and I do it using GetPropList function.

This is an example:
Count := GetPropList(comboBox, PropList);

This works perfectly, finds every combobox's property, but the next example does not work:
Count := GetPropList(comboBox.Items, PropList);

It return nothing, and the property ("Text") I have to set is owned by Items, not combobox.

In short, what I need is to find the "Items.Text" property, not the "ComboBox.Text" property.

Thanks in advance.

According to the docs GetPropList returns a list with published properties ( TStrings (the type of 'Items') does not have any published props.



--- Quote from: fafastrungen on February 28, 2011, 08:49:53 pm ---Hi, I'm making an unit to translate applications made with Lazarus.

--- End quote ---

You mean translating the GUI texts?
"resourcestring" is the way to go:


Thank you both, very helpful.

Is there a way to assign ComboBox.Items.Text property at run time ?
I store in a xml file all properties I want to assign, for example:

  <items text="Item 1\nItem 2" />

I search for "comboBox" component, if I found it I search for "Items" property, if I found it I try to assign property using SetPropValue, but I can't assign it because "Items" has no published "Text" property, so how can I assign it ?


[0] Message Index

[#] Next page

Go to full version