This commit is contained in:
Mikhalkovich Stanislav 2019-04-23 14:51:25 +03:00
parent 795b4e79f8
commit b8e6248094
8 changed files with 47 additions and 11 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "4";
public const string Build = "2";
public const string Revision = "2036";
public const string Revision = "2037";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=4
%REVISION%=2036
%COREVERSION%=2
%REVISION%=2037
%MINOR%=4
%MAJOR%=3

Binary file not shown.

View file

@ -1 +1 @@
!define VERSION '3.4.2.2036'
!define VERSION '3.4.2.2037'

View file

@ -242,7 +242,7 @@ type
/// Правый нижний угол графического объекта
property RightBottom: Point read Pnt(Left + Height,Top + Height);
/// Угол поворота графического объекта (по часовой стрелке)
property RotateAngle: real read InvokeReal(()->rot.Angle) write Invoke(procedure->rot.Angle := value);
property RotateAngle: real read InvokeReal(()->rot.Angle) write Invoke(procedure->begin rot.CenterX := Width/2; rot.CenterY := Height/2; rot.Angle := value end);
/// Множитель масштабирования объекта
property ScaleFactor: real read InvokeReal(()->sca.ScaleX) write Invoke(()->begin (sca.ScaleX, sca.ScaleY) := (value,value); end);
// Центр поворота графического объекта - запретил, т.к. это будет сбивать координаты объекта
@ -439,13 +439,24 @@ type
CircleWPF = class(BoundedObjectWPF)
private
procedure InitOb2(x,y,r: real; c: GColor) := InitOb1(x-r,y-r,2*r,2*r,c,new System.Windows.Shapes.Ellipse());
procedure WT(value: real) := (ob.Width,ob.Height) := (value,value);
procedure HT(value: real) := (ob.Width,ob.Height) := (value,value);
procedure WT(value: real) := begin (ob.Width,ob.Height) := (value,value); (gr.Width,gr.Height) := (value,value); end;
procedure HT(value: real) := begin (ob.Width,ob.Height) := (value,value); (gr.Width,gr.Height) := (value,value); end;
{procedure Rad(value: real);
begin
var delta := value - gr.Width/2;
Left -= delta;
Top -= delta;
(gr.Width,gr.Height) := (value*2,value*2);
Element.Points := ChangePointCollection(value,n);
end;}
procedure Rad(value: real);
begin
//(ob as Ellipse).RenderedGeometry
Left -= value - ob.Width/2;
Top -= value - ob.Width/2;
Left -= value - gr.Width/2;
Top -= value - gr.Width/2;
(gr.Width,gr.Height) := (value*2,value*2);
(ob.Width,ob.Height) := (value*2,value*2);
end;
function GetInternalGeometry: Geometry; override := (ob as Shape).RenderedGeometry;
@ -662,7 +673,7 @@ type
write Invoke(()->begin Self.Element.bc := value; Self.Element.RecreateFormText; ob.InvalidateVisual end);
/// Текст графического объекта
property Text: string read InvokeString(()->Element.Text)
write Invoke(procedure->begin Self.Element.Text := value; Self.Element.RecreateFormText; ; Width := Self.Element.Width; Height := Self.Element.Height; ob.InvalidateVisual end); override;
write Invoke(procedure->begin Self.Element.Text := value; Self.Element.RecreateFormText; Width := Self.Element.Width; Height := Self.Element.Height; ob.InvalidateVisual end); override;
/// Декоратор поворота объекта
function WithRotate(da: real): TextWPF := inherited WithRotate(da) as TextWPF;
end;

View file

@ -0,0 +1,5 @@
begin
var x: integer?;
var a := x?.ToString();
Assert(a=nil);
end.

View file

@ -0,0 +1,14 @@
type
T = record
y := 1;
function ToString: string; override := y.ToString;
end;
function F(x: T?): string;
begin
Result := x?.ToString();
end;
begin
assert(f(new T)='1');
end.

View file

@ -108,7 +108,13 @@ namespace PascalABCCompiler.TreeConverter
public void semantic_check_dot_question(SyntaxTree.question_colon_expression qce)
{
var av = convert_strong((qce.condition as bin_expr).left);
if (!av.type.is_class)
Type t = null;
if (av.type is compiled_generic_instance_type_node ctn2)
t = ctn2.compiled_original_generic.compiled_type;
else if (av.type is compiled_type_node ctn1)
t = ctn1.compiled_type;
if (!av.type.is_class && !(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)))
AddError(av.location, "OPERATOR_DQ_MUST_BE_USED_WITH_A_REFERENCE_TYPE_VALUETYPE");
}