You are not logged in.
Pages: 1
Today I downloaded the "6f2a76894f" Synops of, but completing an error occurs in file "SQLite3UIEdit"at line
aCaption: = CaptionName (OnCaptionName, @ P ^. Name);
I saw that you have modified the file "SQLite3i18n" and you have replaced
text: = TranslateOne (CompName, ppi ^. Name);
with
text: = TranslateOne (CompName, ppi ^. ShortName);
Thank corchi
Offline
Yes, you're right.
Corrected in http://synopse.info/fossil/info/b4c00d1253
Offline
ok thanks
Offline
I have test it your TRecordEditForm with sources dating 2011-06-11. I saw that sets (TGroupBox implementation) could not be editable (the result was not really set to the TSQLRecord on BtnSaveClick).
So I changed the code that it works (at least it looks like that ) and "render" properly and nothing else (several calls to InheritsFrom, this could be changed).
I have done four changes in SetRecord procedure:
procedure TRecordEditForm.SetRecord(aClient: TSQLRestClient;
aRecord: TSQLRecord; CSVFieldNames: PUTF8Char=nil; Ribbon: TSQLRibbon=nil;
FieldHints: string=''; FieldNamesWidth: integer=0; aCaption: string='');
var i,j, aID, Y, aHeight, aWidth, CW: integer;
(...)
C: TWinControl;
Group: TGroupBox absolute C; // -----------------------------------------------------> CHANGE 1
(...)
begin
(...)
sftSet: begin
(...)
for j := 0 to E^.MaxValue do
with TCheckBox.Create(Scroll) do begin // add set checkboxes
(...)
end;
inc(Y,Group.Height+12);
//continue; // --------------------------------------------------------------> CHANGE 2
end;
(...)
if (C<>nil) and (C<>self) and (C<>Scroll) then begin
(...)
if not C.InheritsFrom(TCheckBox) then
if C.InheritsFrom(TLabeledEdit) then begin
(...)
end else if not C.InheritsFrom(TGroupBox) then // -------------------------------> CHANGE 3
with TLabel.Create(Scroll) do begin // add label left-sided to the field
(...)
if C.InheritsFrom(TDateTimePicker) then begin
(...)
end
else if not C.InheritsFrom(TGroupBox) then // -----------------------------------> CHANGE 4
C.SetBounds(FieldNamesWidth,Y,200,22);
fFieldComponents[i] := C;
inc(Y,aHeight);
end;
end;
end;
Last edited by Leander007 (2011-06-16 01:47:27)
"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal
Offline
I forget about this poor little sftSet kind of field.
Sorry for him!
But your fix is not working as expected.
By commenting the continue keyword, you will override a lot of specific behavior of set.
The continue should remain here.
IMHO just one line (setting fFieldComponents[] array) is missing:
inc(Y,Group.Height+12);
fFieldComponents[i] := C;
continue;
See http://synopse.info/fossil/info/2efd86b189
Thanks for the feedback.
Offline
Yes, that was my comment about "several calls to InheritsFrom, this could be changed" , because I realized that fFieldComponents was not assigned for sets .
I did not realized if commenting continue will break something, because I changed the flow control (dirty and long version) where is not set related.
I will test it later if all works with your new version.
"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal
Offline
I did not realized if commenting continue will break something, because I changed the flow control (dirty and long version) where is not set related.
For instance, with the "long version", Tag value was overridden, OnComponentCreated was trigerred twice, Hint property wrongly set, and so on...
Offline
You missed the first change:
C: TWinControl;
Group: TGroupBox absolute C;
Without this the code does not work, because you are assigning different "C" control.
You are still having minor compile errors in SQLite3i18n unit.
Please could you check version in fossil (I must synch each way when I download ), maybe you are having right working copy, but wrong check-in in fossil version control.
unit SQLite3i18n:
procedure ExtractAllResources...
line 2850 is
AddOnceDynArray(WinAnsiString(TSQLRecord.CaptionName(@P^.Name)));
should be
AddOnceDynArray(WinAnsiString(TSQLRecord.CaptionName(@P^.ShortName)));
line 2890 is
AddOnceDynArray(WinAnsiString(CaptionName(@P^.Name)));
should be
AddOnceDynArray(WinAnsiString(CaptionName(@P^.ShortName)));
"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal
Offline
You missed the first change:
Group: TGroupBox absolute C;
Without this the code does not work, because you are assigning different "C" control.
I didn't miss this one, but the correct missing line was this one:
fFieldComponents[i] := Group;
You are still having minor compile errors in SQLite3i18n unit.
Yes, I didn't try compiling it with EXTRACTALLRESOURCES conditional on!!!
I didn't work on the UI part for some weeks... sorry...
Should work with this commit: http://synopse.info/fossil/info/215dfe5ac7
Offline
i don't know how to implement TOnComponentCreated, TOnComponentCreate, TOnComponentValidate in SQLite3UIEdit, and
what is coresponding with SQLite3UIOption.
how i can to override just bound of component coresponding field that setted in SetRecord(..)?
plase give me simple sample code so i can learn it..
and could you fix the SQLitel3UIOption since it's still depend on TAdvGlowButton.?
thanks.
Last edited by coblongpamor (2011-06-17 03:19:59)
Offline
coblongpamor, if you need really customized look of edit form, then don't use TRecordEditForm, but develop custom GUI by "hand" (using Delphi RAD approach) as is done in Main Demo in FileEdit.pas (TEditForm) and manipulate with TSQLRecord as you wish.
Looking at the code should be enough, because basics of the framework are used in it.
"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal
Offline
Arnaud you made lapsus in 215dfe5ac7.
Unit SQLite3UIEdit
line 394:
if E^.MaxValue>31 then // up to 32 elements in tkSet (GetOrdValue)
SetMax := 31 else
SetMax := E^.MaxValue;
Sets := P^.GetOrdValue(aRecord);
E := P^.PropType^^.SetEnumType;
should be:
Sets := P^.GetOrdValue(aRecord);
E := P^.PropType^^.SetEnumType;
if E^.MaxValue>31 then // up to 32 elements in tkSet (GetOrdValue)
SetMax := 31 else
SetMax := E^.MaxValue;
I saw that you did some cleanup in this procedure , but excluding this, is there any real difference with
Group: TGroupBox absolute C;
approach as you did for other controls and this latest code when you assign Group directly?
"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal
Offline
... is there any real difference with
Group: TGroupBox absolute C;
approach as you did for other controls and this latest code when you assign Group directly?
Yes, the TGroupBox is not handled as the active component, but every internal TCheckBox is.
As I stated above:
For instance, with the "long version", Tag value was overridden, OnComponentCreated was trigerred twice, Hint property wrongly set, and so on...
Offline
Leander007 wrote:You missed the first change:
Group: TGroupBox absolute C;
Without this the code does not work, because you are assigning different "C" control.
I didn't miss this one, but the correct missing line was this one:
fFieldComponents[i] := Group;
With first code excerpt goes this too:
fFieldComponents[i] := C;
continue;
I was not thinking about the "long" version, but only about upper comparison, because later you use continue word, so the flow control is changed and the "extra" code
if (C<>nil) and (C<>self) and (C<>Scroll) then begin
is never reached in set case.
So It seems that you were using C only for common handling of controls and TGroupBox does not count in it.
From technical aspect usage of the upper is the same, but cleaner design is assigning Group, not the C.
"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal
Offline
Various minor fixes or changes for this unit.
See http://synopse.info/fossil/info/bdf1f00225
Offline
Pages: 1