Page 1 of 1
Critical error!!!
Posted: Sun Nov 29, 2009 10:29 am
by 10552878
Hello!
I have found out very unpleasant error.
Do the following:
1) open the editor.
2) Create TTreeNodeShape
3) Establish values:
Left: = 0;
Top: = 0;
Height: = 1300 Pix (the figure height should be more heights of visible area of a window of the designer)
Width: = 1000 pix;
4) Click on an empty place (on the form)
5) Anew click Shape.
Result:
You will see spontaneous moving of object on a vertical.
Help to eliminate please this problem as it is possible faster.
Re: Critical error!!!
Posted: Mon Nov 30, 2009 11:19 am
by 10552878
The problem disappears, when
Selected.ScrollToView: = false;
Re: Critical error!!!
Posted: Mon Nov 30, 2009 12:49 pm
by 10552878
When you add TGridShape
Top: = 1000;
Also you scroll page downwards.
Instal on any cell focus.
Grid cells are incorrectly allocated.
The position of a strip of scrolling (at least Vertical) in method Draw is not considered.
Re: Critical error!!!
Posted: Tue Dec 01, 2009 2:22 pm
by yeray
Hi BoikovSoft,
I've tried to reproduce it but couldn't. Please, try to prepare a simple example project we can run as-is to reproduce the problem here.
Re: Critical error!!!
Posted: Wed Dec 02, 2009 5:16 am
by 10552878
Error modelling:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
Var
obj : TGridShape;
begin
Tree1.Designing := true;
OBJ := Tree1.AddShapeClass(0, 0,'', nil, TGridShape) as TGridShape;
obj.Top := Form1.Height + 10;
obj.Left := 400;
Tree1.HorzScrollBar.Automatic := false;
Tree1.VertScrollBar.Automatic := false;
Tree1.HorzScrollBar.Visible := true;
Tree1.VertScrollBar.Visible := true;
Tree1.Selected.ScrollToCenter := false; // If objects very big it is better to switch-off this option.
OBJ := Tree1.AddShapeClass(0, 0,'', nil, TGridShape) as TGridShape;
obj.Top := 10;
obj.Left := 400;
OBJ.Selected := true;
end;
With mouse click cells of the top object, then bottom.
You will see, that Allocation of objects occurs not correctly and on a miscellaneous.
Re: Critical error!!!
Posted: Wed Dec 02, 2009 6:04 am
by 10552878
Here other error:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
Var
tr: TTree;
obj : TTreeNodeShape;
r1, R2: TTreeRuler;
begin
Tr := TTree.Create(Form1);
tr.Parent := form1;
tr.Align := alClient;
Tr.Designing := true;
r1 := TTreeRuler.Create(Form1);
r1.Parent := form1;
r1.Align := alTop;
r1.Tree := tr;
r1.Height := 20;
r2 := TTreeRuler.Create(Form1);
r2.Parent := form1;
r2.Align := alLeft;
r2.Tree := tr;
r2.Width := 20;
Tr.HorzScrollBar.Automatic := true;
Tr.VertScrollBar.Automatic := true;
Tr.HorzScrollBar.Visible := true;
Tr.VertScrollBar.Visible := true;
{ If objects very big it is better to switch-off this option.
This option works if it to establish in Design-mode}
//Tr.Selected.ScrollToCenter := false;
{When True - the Object is displaced in a bottom,
False - the object is not displaced.
It is easy for tracing, if in addition on the form to add rulers (TreeRuler)}
OBJ := Tr.AddShapeClass(0, 0,'qwerty', nil, TTextShape);
obj.Top := 10;
obj.Left := 400;
obj.Height := Form1.Height + 100;
obj.Width := 300;
obj.Border.Visible := true;
OBJ.Selected := true;
end;
Now try to click on an empty place. Again on TTextShape. Again an empty place. Again on TTextShape. And so some times. On a vertical Ruler (R2) it will be visible as the object escapes downwards.
Re: Critical error!!!
Posted: Wed Dec 02, 2009 10:17 am
by yeray
Hi BoikovSoft,
BoikovSoft wrote:Error modelling:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
Var
obj : TGridShape;
begin
Tree1.Designing := true;
OBJ := Tree1.AddShapeClass(0, 0,'', nil, TGridShape) as TGridShape;
obj.Top := Form1.Height + 10;
obj.Left := 400;
Tree1.HorzScrollBar.Automatic := false;
Tree1.VertScrollBar.Automatic := false;
Tree1.HorzScrollBar.Visible := true;
Tree1.VertScrollBar.Visible := true;
Tree1.Selected.ScrollToCenter := false; // If objects very big it is better to switch-off this option.
OBJ := Tree1.AddShapeClass(0, 0,'', nil, TGridShape) as TGridShape;
obj.Top := 10;
obj.Left := 400;
OBJ.Selected := true;
end;
With mouse click cells of the top object, then bottom.
You will see, that Allocation of objects occurs not correctly and on a miscellaneous.
This Allocation problem seems to be reproducible randomly with that code. I'll add this to the wish list to be fixed in future releases (TV52014581).
Also note that the demo at
What's New ?\Welcome !\Custom shapes\Grid shape looks stable.
BoikovSoft wrote:Here other error:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
Var
tr: TTree;
obj : TTreeNodeShape;
r1, R2: TTreeRuler;
begin
Tr := TTree.Create(Form1);
tr.Parent := form1;
tr.Align := alClient;
Tr.Designing := true;
r1 := TTreeRuler.Create(Form1);
r1.Parent := form1;
r1.Align := alTop;
r1.Tree := tr;
r1.Height := 20;
r2 := TTreeRuler.Create(Form1);
r2.Parent := form1;
r2.Align := alLeft;
r2.Tree := tr;
r2.Width := 20;
Tr.HorzScrollBar.Automatic := true;
Tr.VertScrollBar.Automatic := true;
Tr.HorzScrollBar.Visible := true;
Tr.VertScrollBar.Visible := true;
{ If objects very big it is better to switch-off this option.
This option works if it to establish in Design-mode}
//Tr.Selected.ScrollToCenter := false;
{When True - the Object is displaced in a bottom,
False - the object is not displaced.
It is easy for tracing, if in addition on the form to add rulers (TreeRuler)}
OBJ := Tr.AddShapeClass(0, 0,'qwerty', nil, TTextShape);
obj.Top := 10;
obj.Left := 400;
obj.Height := Form1.Height + 100;
obj.Width := 300;
obj.Border.Visible := true;
OBJ.Selected := true;
end;
Now try to click on an empty place. Again on TTextShape. Again an empty place. Again on TTextShape. And so some times. On a vertical Ruler (R2) it will be visible as the object escapes downwards.
That's right too. Thanks for reporting it. I've also added this to the wish list to be fixed in future releases (TV52014582).