Dm_Ufa
-
Posts
13 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Dm_Ufa
-
-
TFDQuery(List).Append;
-
Добрый день,
триальная версия, 1.90.0.1563
-
Как можно редактировать строку в TUniDBTreeGrid сразу после вставки? Сейчас пустая строка не появляется.
-
On 1/10/2021 at 1:52 AM, sagt3k said:
Hi Dm_Ufa
I am very interested in generating controls dynamically via fastscript. Can you attach the source code where you clear AddClass and AddObject for TUniButton?
I have problem with this Script example:
Var B:TUniButton;
begin
B:=TUniButton.Create(UniApplication);
B.Parent:=UniPanel1;
B.Caption:='Hello!!!';
B.Left:=100;
end.
fsGlobalUnit.AddClass(TUniCustomButton, 'TButton');
fsGlobalUnit.AddClass(TUniButton, 'TUniCustomButton');fsScript1.AddObject(B.Name, B);
-
On 1/10/2021 at 1:52 AM, sagt3k said:
Hi Dm_Ufa
I am very interested in generating controls dynamically via fastscript. Can you attach the source code where you clear AddClass and AddObject for TUniButton?
I have problem with this Script example:
Var B:TUniButton;
begin
B:=TUniButton.Create(UniApplication);
B.Parent:=UniPanel1;
B.Caption:='Hello!!!';
B.Left:=100;
end.
I will answer later, while the laptop is being repaired
-
31 minutes ago, x11 said:
Если я правильно понял, то UniPropertyGrid не отображает свойство Align.
вот мне и интересно, почему. Я вроде разобрался как добавить, теперь проблема как добавить два редактора свойств. Мне при выборе, например, компонента uniDBEdit1, в PropertyGrid надо добавить свойства Align и DataSource. Делаю так:
UniPropertyGrid1.AddProperty(['DataSource', TDataSource(GetObjectProp(c, 'DataSource')).Name]);
UniPropertyGrid1.AddProperty(['Align', GetEnumName(TypeInfo(TAlign), Ord(TWinControl(c).Align))]);
add := #1'.sourceConfig = {DataSource: {editor: new Ext.grid.CellEditor({field: new Ext.form.field.ComboBox({editable: false, store:["None", "DS1", "DS2"]})})}};';' + #13 +
#1'.sourceConfig = {Align: {editor: new Ext.grid.CellEditor({field: new Ext.form.field.ComboBox({editable: false, store:["alNone", "alTop", "alBottom", "alLeft", "alRight", "alClient", "alCustom"]})})}};';
UniPropertyGrid1.JSInterface.JSCode(add);
TExPGrid(UniPropertyGrid1).PopulateGrid;При этом нормально работает только один редактор (Align), в свойстве DataSource просто имя TDataSource, т.е. нет списка.
-
даже в демо на сайте свойство Align не видно в PropertyGrid
-
Почему при загрузке свойств TUniDBTreeGrid в UniPropertyGrid не видно свойство Align? И как можно исправит?
-
Разобрался...
-
как добавить свойство DataSource в UniPropertyGrid ?
UniPropertyGrid1.AttachedComponent(uniDBGrid1);
UniPropertyGrid1.AddProperty(['DataSource', 'DS1', 'DS2', 'DS3']);
результата нет.
-
A little bit started to turn out. I can load a simple form from the database and execute a simple script. But there is still a lot of work to adapt.
-
Did you manage to make FastScript friends with UniGui ?
if possible load dfm files at runtime using ObjectTextToBinary ?
in General
Posted
Hello! i use two functions:
function LoadDFM(p :TComponent; dfm :TStringList) :string;
var
MemoryStream, FileStream :TMemoryStream;
begin
MemoryStream := TMemoryStream.Create();
FileStream := TMemoryStream.Create();
dfm.SaveToStream(FileStream);
FileStream.Position := 0;
ObjectTextToResource(FileStream, MemoryStream);
MemoryStream.Position := 0;
MemoryStream.ReadComponentRes(p);
MemoryStream.Destroy();
FileStream.Destroy();
Result := p.Name;
end;
function SaveDFM(p :TComponent) :TStringList;
var
MemoryStream, FileStream :TMemoryStream;
begin
MemoryStream := TMemoryStream.Create;
FileStream := TMemoryStream.Create;
MemoryStream.WriteComponentRes('aaa', p);
MemoryStream.Position := 0;
ObjectResourceToText(MemoryStream, FileStream);
FileStream.Position := 0;
Result := TStringList.Create;
Result.LoadFromStream(FileStream);
MemoryStream.Destroy;
FileStream.Destroy;
end;