|
@@ -36,6 +36,9 @@ const
|
|
SplineStyleToStr : array[TSplineStyle] of string =
|
|
SplineStyleToStr : array[TSplineStyle] of string =
|
|
('Inside','Inside + ends','Crossing','Crossing + ends','Outside','Round outside','Vertex to side','Easy Bézier');
|
|
('Inside','Inside + ends','Crossing','Crossing + ends','Outside','Round outside','Vertex to side','Easy Bézier');
|
|
|
|
|
|
|
|
+ FontBidiModeToStr : array[TFontBidiMode] of string =
|
|
|
|
+ ('Auto', 'Left to right', 'Right to left');
|
|
|
|
+
|
|
type
|
|
type
|
|
{ TForm1 }
|
|
{ TForm1 }
|
|
|
|
|
|
@@ -150,20 +153,31 @@ type
|
|
FPenWidth: single;
|
|
FPenWidth: single;
|
|
FPenStyle: TBGRAPenStyle;
|
|
FPenStyle: TBGRAPenStyle;
|
|
FPenJoinStyle: TPenJoinStyle;
|
|
FPenJoinStyle: TPenJoinStyle;
|
|
|
|
+ FPenStyleMenu: TPopupMenu;
|
|
FFlattened: TBGRABitmap;
|
|
FFlattened: TBGRABitmap;
|
|
FLastEditorBounds: TRect;
|
|
FLastEditorBounds: TRect;
|
|
FUpdatingFromShape: boolean;
|
|
FUpdatingFromShape: boolean;
|
|
FUpdatingSpinEditPenWidth: boolean;
|
|
FUpdatingSpinEditPenWidth: boolean;
|
|
FCurrentTool: TPaintTool;
|
|
FCurrentTool: TPaintTool;
|
|
|
|
+
|
|
FSplineStyle: TSplineStyle;
|
|
FSplineStyle: TSplineStyle;
|
|
FSplineStyleMenu: TPopupMenu;
|
|
FSplineStyleMenu: TPopupMenu;
|
|
FComboboxSplineStyle: TBCButton;
|
|
FComboboxSplineStyle: TBCButton;
|
|
FSplineToolbar: TToolBar;
|
|
FSplineToolbar: TToolBar;
|
|
- FPenStyleMenu: TPopupMenu;
|
|
|
|
|
|
+
|
|
FPhongShapeKind: TPhongShapeKind;
|
|
FPhongShapeKind: TPhongShapeKind;
|
|
FPhongShapeKindToolbar: TToolBar;
|
|
FPhongShapeKindToolbar: TToolBar;
|
|
FUpDownPhongBorderSize: TBCTrackbarUpdown;
|
|
FUpDownPhongBorderSize: TBCTrackbarUpdown;
|
|
FPhongShapeAltitude,FPhongBorderSize: single;
|
|
FPhongShapeAltitude,FPhongBorderSize: single;
|
|
|
|
+
|
|
|
|
+ FTextToolbar: TToolbar;
|
|
|
|
+ FTextDirectionButton: TToolButton;
|
|
|
|
+ FTextFontHeight: single;
|
|
|
|
+ FTextAlign: TBidiTextAlignment;
|
|
|
|
+ FTextAlignButton: array[TAlignment] of TToolButton;
|
|
|
|
+ FTextDirection: TFontBidiMode;
|
|
|
|
+ FTextDirectionMenu: TPopupMenu;
|
|
|
|
+
|
|
FInRemoveShapeIfEmpty: Boolean;
|
|
FInRemoveShapeIfEmpty: Boolean;
|
|
FFullIconHeight: integer;
|
|
FFullIconHeight: integer;
|
|
FVectorImageList: TBGRAImageList;
|
|
FVectorImageList: TBGRAImageList;
|
|
@@ -219,6 +233,11 @@ type
|
|
procedure UpdateSplineToolbar;
|
|
procedure UpdateSplineToolbar;
|
|
function SnapToGrid(APoint: TPointF): TPointF;
|
|
function SnapToGrid(APoint: TPointF): TPointF;
|
|
function ImgCoordToOriginalCoord(APoint: TPointF): TPointF;
|
|
function ImgCoordToOriginalCoord(APoint: TPointF): TPointF;
|
|
|
|
+ procedure TextAlignClick(Sender: TObject);
|
|
|
|
+ procedure OnTextFontHeightChange(Sender: TObject; AByUser: boolean);
|
|
|
|
+ procedure TextDirClick(Sender: TObject);
|
|
|
|
+ procedure OnClickTextDirectionItem(Sender: TObject);
|
|
|
|
+ procedure UpdateTextAlignment;
|
|
public
|
|
public
|
|
{ public declarations }
|
|
{ public declarations }
|
|
img: TBGRALazPaintImage;
|
|
img: TBGRALazPaintImage;
|
|
@@ -300,6 +319,7 @@ var
|
|
ss: TSplineStyle;
|
|
ss: TSplineStyle;
|
|
toolImageList: TBGRAImageList;
|
|
toolImageList: TBGRAImageList;
|
|
i: Integer;
|
|
i: Integer;
|
|
|
|
+ td: TFontBidiMode;
|
|
begin
|
|
begin
|
|
baseCaption:= Caption;
|
|
baseCaption:= Caption;
|
|
if ToolIconSize <> ToolImageList48.Width then
|
|
if ToolIconSize <> ToolImageList48.Width then
|
|
@@ -357,11 +377,20 @@ begin
|
|
for ss := low(TSplineStyle) to high(TSplineStyle) do
|
|
for ss := low(TSplineStyle) to high(TSplineStyle) do
|
|
begin
|
|
begin
|
|
item := TMenuItem.Create(FSplineStyleMenu); item.Caption := SplineStyleToStr[ss];
|
|
item := TMenuItem.Create(FSplineStyleMenu); item.Caption := SplineStyleToStr[ss];
|
|
- item.OnClick:=@OnClickSplineStyleItem;
|
|
|
|
- item.Tag := ord(ss);
|
|
|
|
|
|
+ item.OnClick:=@OnClickSplineStyleItem; item.Tag := ord(ss);
|
|
FSplineStyleMenu.Items.Add(item);
|
|
FSplineStyleMenu.Items.Add(item);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ FTextDirectionMenu := TPopupMenu.Create(nil);
|
|
|
|
+ FTextDirectionMenu.Images := VectorImageList24;
|
|
|
|
+ for td := low(TFontBidiMode) to high(TFontBidiMode) do
|
|
|
|
+ begin
|
|
|
|
+ item := TMenuItem.Create(FTextDirectionMenu); item.Caption := FontBidiModeToStr[td];
|
|
|
|
+ item.OnClick:=@OnClickTextDirectionItem; item.Tag := ord(td);
|
|
|
|
+ item.ImageIndex:= 31+ord(td);
|
|
|
|
+ FTextDirectionMenu.Items.Add(item);
|
|
|
|
+ end;
|
|
|
|
+
|
|
newShape:= nil;
|
|
newShape:= nil;
|
|
penWidth := 5;
|
|
penWidth := 5;
|
|
penStyle := SolidPenStyle;
|
|
penStyle := SolidPenStyle;
|
|
@@ -370,6 +399,9 @@ begin
|
|
splineStyle:= ssEasyBezier;
|
|
splineStyle:= ssEasyBezier;
|
|
FPhongShapeAltitude := DefaultPhongShapeAltitudePercent;
|
|
FPhongShapeAltitude := DefaultPhongShapeAltitudePercent;
|
|
FPhongBorderSize := DefaultPhongBorderSizePercent;
|
|
FPhongBorderSize := DefaultPhongBorderSizePercent;
|
|
|
|
+ FTextDirection:= fbmAuto;
|
|
|
|
+ FTextAlign:= btaNatural;
|
|
|
|
+ FTextFontHeight:= TTextShape.DefaultFontEmHeight;
|
|
UpdateTitleBar;
|
|
UpdateTitleBar;
|
|
UpdateBackToolFillPoints;
|
|
UpdateBackToolFillPoints;
|
|
UpdatePenToolFillPoints;
|
|
UpdatePenToolFillPoints;
|
|
@@ -403,7 +435,11 @@ begin
|
|
SetEditorGrid(ssCtrl in Shift);
|
|
SetEditorGrid(ssCtrl in Shift);
|
|
img.MouseDown(Button=mbRight, Shift, imgPtF.x, imgPtF.y, cur, handled);
|
|
img.MouseDown(Button=mbRight, Shift, imgPtF.x, imgPtF.y, cur, handled);
|
|
UpdateViewCursor(cur);
|
|
UpdateViewCursor(cur);
|
|
- if handled then exit;
|
|
|
|
|
|
+ if handled then
|
|
|
|
+ begin
|
|
|
|
+ UpdateTextAlignment;
|
|
|
|
+ exit;
|
|
|
|
+ end;
|
|
|
|
|
|
if not justDown and not Assigned(newShape) then
|
|
if not justDown and not Assigned(newShape) then
|
|
begin
|
|
begin
|
|
@@ -621,6 +657,7 @@ begin
|
|
imgPtF := VirtualScreenToImgCoord(X,Y);
|
|
imgPtF := VirtualScreenToImgCoord(X,Y);
|
|
SetEditorGrid(ssCtrl in Shift);
|
|
SetEditorGrid(ssCtrl in Shift);
|
|
img.MouseMove(Shift, imgPtF.X, imgPtF.Y, cur, handled);
|
|
img.MouseMove(Shift, imgPtF.X, imgPtF.Y, cur, handled);
|
|
|
|
+ if handled then UpdateTextAlignment;
|
|
UpdateViewCursor(cur);
|
|
UpdateViewCursor(cur);
|
|
|
|
|
|
ptF := ImgCoordToOriginalCoord(imgPtF);
|
|
ptF := ImgCoordToOriginalCoord(imgPtF);
|
|
@@ -676,7 +713,11 @@ begin
|
|
imgPtF := VirtualScreenToImgCoord(X,Y);
|
|
imgPtF := VirtualScreenToImgCoord(X,Y);
|
|
SetEditorGrid(ssCtrl in Shift);
|
|
SetEditorGrid(ssCtrl in Shift);
|
|
img.MouseUp(Button = mbRight, Shift, imgPtF.X, imgPtF.Y, cur, handled);
|
|
img.MouseUp(Button = mbRight, Shift, imgPtF.X, imgPtF.Y, cur, handled);
|
|
- if handled then RenderAndUpdate(false);
|
|
|
|
|
|
+ if handled then
|
|
|
|
+ begin
|
|
|
|
+ UpdateTextAlignment;
|
|
|
|
+ RenderAndUpdate(false);
|
|
|
|
+ end;
|
|
UpdateViewCursor(cur);
|
|
UpdateViewCursor(cur);
|
|
|
|
|
|
if justDown and (Button = newButton) then
|
|
if justDown and (Button = newButton) then
|
|
@@ -728,6 +769,7 @@ begin
|
|
ButtonPenStyle.DropDownMenu := nil;
|
|
ButtonPenStyle.DropDownMenu := nil;
|
|
FPenStyleMenu.Free;
|
|
FPenStyleMenu.Free;
|
|
FSplineStyleMenu.Free;
|
|
FSplineStyleMenu.Free;
|
|
|
|
+ FTextDirectionMenu.Free;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
|
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
|
@@ -737,7 +779,11 @@ begin
|
|
if Assigned(img) then
|
|
if Assigned(img) then
|
|
begin
|
|
begin
|
|
img.KeyDown(Shift, LCLKeyToSpecialKey(Key, Shift), AHandled);
|
|
img.KeyDown(Shift, LCLKeyToSpecialKey(Key, Shift), AHandled);
|
|
- if AHandled then Key := 0;
|
|
|
|
|
|
+ if AHandled then
|
|
|
|
+ begin
|
|
|
|
+ Key := 0;
|
|
|
|
+ UpdateTextAlignment;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
if (Key = VK_X) and (ssCtrl in Shift) then
|
|
if (Key = VK_X) and (ssCtrl in Shift) then
|
|
@@ -769,7 +815,11 @@ begin
|
|
if Assigned(img) then
|
|
if Assigned(img) then
|
|
begin
|
|
begin
|
|
img.KeyUp(Shift, LCLKeyToSpecialKey(Key, Shift), AHandled);
|
|
img.KeyUp(Shift, LCLKeyToSpecialKey(Key, Shift), AHandled);
|
|
- if AHandled then Key:= 0;
|
|
|
|
|
|
+ if AHandled then
|
|
|
|
+ begin
|
|
|
|
+ Key:= 0;
|
|
|
|
+ UpdateTextAlignment;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -779,7 +829,11 @@ begin
|
|
if Assigned(img) then
|
|
if Assigned(img) then
|
|
begin
|
|
begin
|
|
img.KeyPress(UTF8Key, AHandled);
|
|
img.KeyPress(UTF8Key, AHandled);
|
|
- if AHandled then UTF8Key:= '';
|
|
|
|
|
|
+ if AHandled then
|
|
|
|
+ begin
|
|
|
|
+ UTF8Key:= '';
|
|
|
|
+ UpdateTextAlignment;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -888,6 +942,34 @@ begin
|
|
UpdateSplineToolbar;
|
|
UpdateSplineToolbar;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TForm1.OnClickTextDirectionItem(Sender: TObject);
|
|
|
|
+var
|
|
|
|
+ itm: TMenuItem;
|
|
|
|
+ td: TFontBidiMode;
|
|
|
|
+begin
|
|
|
|
+ itm := TMenuItem(Sender);
|
|
|
|
+ td := TFontBidiMode(itm.Tag);
|
|
|
|
+ FTextDirection:= td;
|
|
|
|
+ if Assigned(FTextDirectionButton) then
|
|
|
|
+ FTextDirectionButton.ImageIndex:= 31 + ord(FTextDirection);
|
|
|
|
+ if Assigned(vectorOriginal) and Assigned(vectorOriginal.SelectedShape) and
|
|
|
|
+ (vectorOriginal.SelectedShape is TTextShape) then
|
|
|
|
+ TTextShape(vectorOriginal.SelectedShape).FontBidiMode:= td
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TForm1.UpdateTextAlignment;
|
|
|
|
+var
|
|
|
|
+ alignment: TAlignment;
|
|
|
|
+begin
|
|
|
|
+ if Assigned(vectorOriginal) and Assigned(vectorOriginal.SelectedShape) and
|
|
|
|
+ (vectorOriginal.SelectedShape is TTextShape) then
|
|
|
|
+ begin
|
|
|
|
+ FTextAlign:= TTextShape(vectorOriginal.SelectedShape).BidiParagraphAlignment;
|
|
|
|
+ alignment := TTextShape(vectorOriginal.SelectedShape).ParagraphAlignment;
|
|
|
|
+ if Assigned(FTextAlignButton[alignment]) then FTextAlignButton[alignment].Down := true;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TForm1.OnEditingChange(ASender: TObject;
|
|
procedure TForm1.OnEditingChange(ASender: TObject;
|
|
AOriginal: TBGRALayerCustomOriginal);
|
|
AOriginal: TBGRALayerCustomOriginal);
|
|
begin
|
|
begin
|
|
@@ -965,6 +1047,19 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TForm1.OnTextFontHeightChange(Sender: TObject; AByUser: boolean);
|
|
|
|
+begin
|
|
|
|
+ if AByUser then
|
|
|
|
+ begin
|
|
|
|
+ FTextFontHeight:= TBCTrackbarUpdown(Sender).Value;
|
|
|
|
+ if not FUpdatingFromShape and Assigned(vectorOriginal) and Assigned(vectorOriginal.SelectedShape) then
|
|
|
|
+ begin
|
|
|
|
+ if vectorOriginal.SelectedShape is TTextShape then
|
|
|
|
+ TTextShape(vectorOriginal.SelectedShape).FontEmHeight:= FTextFontHeight;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TForm1.PhongShapeKindClick(Sender: TObject);
|
|
procedure TForm1.PhongShapeKindClick(Sender: TObject);
|
|
begin
|
|
begin
|
|
if (Sender as TToolButton).Down then
|
|
if (Sender as TToolButton).Down then
|
|
@@ -1092,6 +1187,31 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TForm1.TextDirClick(Sender: TObject);
|
|
|
|
+var
|
|
|
|
+ btn: TToolButton;
|
|
|
|
+begin
|
|
|
|
+ btn := TToolButton(Sender);
|
|
|
|
+ with btn.ClientToScreen(Point(0,btn.Height)) do
|
|
|
|
+ FTextDirectionMenu.PopUp(X,Y);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TForm1.TextAlignClick(Sender: TObject);
|
|
|
|
+var
|
|
|
|
+ alignment: TAlignment;
|
|
|
|
+begin
|
|
|
|
+ alignment := TAlignment(TToolButton(Sender).Tag);
|
|
|
|
+ FTextAlign:= AlignmentToBidiTextAlignment(alignment, FTextDirection=fbmRightToLeft);
|
|
|
|
+ if not FUpdatingFromShape and Assigned(vectorOriginal) and Assigned(vectorOriginal.SelectedShape) then
|
|
|
|
+ begin
|
|
|
|
+ if vectorOriginal.SelectedShape is TTextShape then
|
|
|
|
+ begin
|
|
|
|
+ TTextShape(vectorOriginal.SelectedShape).ParagraphAlignment:= alignment;
|
|
|
|
+ FTextAlign:= TTextShape(vectorOriginal.SelectedShape).BidiParagraphAlignment;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TForm1.UpdateViewCursor(ACursor: TOriginalEditorCursor);
|
|
procedure TForm1.UpdateViewCursor(ACursor: TOriginalEditorCursor);
|
|
begin
|
|
begin
|
|
case ACursor of
|
|
case ACursor of
|
|
@@ -1193,19 +1313,22 @@ end;
|
|
procedure TForm1.UpdateToolbarFromShape(AShape: TVectorShape);
|
|
procedure TForm1.UpdateToolbarFromShape(AShape: TVectorShape);
|
|
var
|
|
var
|
|
f: TVectorShapeFields;
|
|
f: TVectorShapeFields;
|
|
- showSplineStyle, showPhongStyle: boolean;
|
|
|
|
nextControlPos: TPoint;
|
|
nextControlPos: TPoint;
|
|
mode: TVectorShapeUsermode;
|
|
mode: TVectorShapeUsermode;
|
|
sk: TPhongShapeKind;
|
|
sk: TPhongShapeKind;
|
|
btn: TToolButton;
|
|
btn: TToolButton;
|
|
|
|
+ toolClass: TVectorShapeAny;
|
|
|
|
+ alignment : TAlignment;
|
|
begin
|
|
begin
|
|
RemoveExtendedStyleControls;
|
|
RemoveExtendedStyleControls;
|
|
|
|
+ alignment := BidiTextAlignmentToAlignment(FTextAlign, FTextDirection=fbmRightToLeft);
|
|
|
|
|
|
if AShape <> nil then
|
|
if AShape <> nil then
|
|
begin
|
|
begin
|
|
FUpdatingFromShape := true;
|
|
FUpdatingFromShape := true;
|
|
mode := AShape.Usermode;
|
|
mode := AShape.Usermode;
|
|
f := AShape.Fields;
|
|
f := AShape.Fields;
|
|
|
|
+ toolClass := TVectorShapeAny(AShape.ClassType);
|
|
if vsfPenFill in f then PenFillControl.AssignFill(AShape.PenFill);
|
|
if vsfPenFill in f then PenFillControl.AssignFill(AShape.PenFill);
|
|
if vsfPenWidth in f then penWidth:= AShape.PenWidth;
|
|
if vsfPenWidth in f then penWidth:= AShape.PenWidth;
|
|
if vsfPenStyle in f then penStyle:= AShape.PenStyle;
|
|
if vsfPenStyle in f then penStyle:= AShape.PenStyle;
|
|
@@ -1214,40 +1337,38 @@ begin
|
|
if vsfBackFill in f then BackFillControl.AssignFill(AShape.BackFill);
|
|
if vsfBackFill in f then BackFillControl.AssignFill(AShape.BackFill);
|
|
|
|
|
|
if AShape is TCurveShape then
|
|
if AShape is TCurveShape then
|
|
- begin
|
|
|
|
- showSplineStyle:= true;
|
|
|
|
splineStyle:= TCurveShape(AShape).SplineStyle;
|
|
splineStyle:= TCurveShape(AShape).SplineStyle;
|
|
- end else
|
|
|
|
- showSplineStyle:= false;
|
|
|
|
|
|
|
|
if AShape is TPhongShape then
|
|
if AShape is TPhongShape then
|
|
begin
|
|
begin
|
|
- showPhongStyle := true;
|
|
|
|
phongShapeKind:= TPhongShape(AShape).ShapeKind;
|
|
phongShapeKind:= TPhongShape(AShape).ShapeKind;
|
|
FPhongShapeAltitude:= TPhongShape(AShape).ShapeAltitudePercent;
|
|
FPhongShapeAltitude:= TPhongShape(AShape).ShapeAltitudePercent;
|
|
FPhongBorderSize:= TPhongShape(AShape).BorderSizePercent;
|
|
FPhongBorderSize:= TPhongShape(AShape).BorderSizePercent;
|
|
- end else
|
|
|
|
- showPhongStyle := false;
|
|
|
|
|
|
+ end;
|
|
|
|
+ if AShape is TTextShape then
|
|
|
|
+ begin
|
|
|
|
+ FTextAlign:= TTextShape(AShape).BidiParagraphAlignment;
|
|
|
|
+ alignment := TTextShape(AShape).ParagraphAlignment;
|
|
|
|
+ FTextFontHeight:= TTextShape(AShape).FontEmHeight;
|
|
|
|
+ FTextDirection:= TTextShape(AShape).FontBidiMode;
|
|
|
|
+ end;
|
|
|
|
|
|
FUpdatingFromShape := false;
|
|
FUpdatingFromShape := false;
|
|
PanelPenFill.Visible := vsfPenFill in f;
|
|
PanelPenFill.Visible := vsfPenFill in f;
|
|
PanelBackFill.Visible := vsfBackFill in f;
|
|
PanelBackFill.Visible := vsfBackFill in f;
|
|
end else
|
|
end else
|
|
begin
|
|
begin
|
|
|
|
+ toolClass:= PaintToolClass[currentTool];
|
|
mode := vsuEdit;
|
|
mode := vsuEdit;
|
|
if IsCreateShapeTool(currentTool) then
|
|
if IsCreateShapeTool(currentTool) then
|
|
begin
|
|
begin
|
|
f := PaintToolClass[currentTool].Fields;
|
|
f := PaintToolClass[currentTool].Fields;
|
|
- showSplineStyle:= PaintToolClass[currentTool] = TCurveShape;
|
|
|
|
- showPhongStyle := PaintToolClass[currentTool] = TPhongShape;
|
|
|
|
PanelPenFill.Visible := vsfPenFill in f;
|
|
PanelPenFill.Visible := vsfPenFill in f;
|
|
PanelBackFill.Visible := vsfBackFill in f;
|
|
PanelBackFill.Visible := vsfBackFill in f;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
f := [];
|
|
f := [];
|
|
- showSplineStyle:= false;
|
|
|
|
- showPhongStyle:= false;
|
|
|
|
PanelPenFill.Visible := true;
|
|
PanelPenFill.Visible := true;
|
|
PanelBackFill.Visible := true;
|
|
PanelBackFill.Visible := true;
|
|
end;
|
|
end;
|
|
@@ -1261,7 +1382,8 @@ begin
|
|
|
|
|
|
PanelExtendedStyle.Visible := false;
|
|
PanelExtendedStyle.Visible := false;
|
|
nextControlPos := Point(1,1);
|
|
nextControlPos := Point(1,1);
|
|
- if showSplineStyle then
|
|
|
|
|
|
+
|
|
|
|
+ if toolClass = TCurveShape then
|
|
begin
|
|
begin
|
|
PanelExtendedStyle.Visible := true;
|
|
PanelExtendedStyle.Visible := true;
|
|
|
|
|
|
@@ -1300,7 +1422,8 @@ begin
|
|
|
|
|
|
nextControlPos.X := FSplineToolbar.Left + FSplineToolbar.Width;
|
|
nextControlPos.X := FSplineToolbar.Left + FSplineToolbar.Width;
|
|
end;
|
|
end;
|
|
- if showPhongStyle then
|
|
|
|
|
|
+
|
|
|
|
+ if toolClass = TPhongShape then
|
|
begin
|
|
begin
|
|
PanelExtendedStyle.Visible := true;
|
|
PanelExtendedStyle.Visible := true;
|
|
|
|
|
|
@@ -1333,6 +1456,36 @@ begin
|
|
|
|
|
|
nextControlPos.X := FPhongShapeKindToolbar.Left + FPhongShapeKindToolbar.Width;
|
|
nextControlPos.X := FPhongShapeKindToolbar.Left + FPhongShapeKindToolbar.Width;
|
|
end;
|
|
end;
|
|
|
|
+
|
|
|
|
+ if toolClass = TTextShape then
|
|
|
|
+ begin
|
|
|
|
+ PanelExtendedStyle.Visible := true;
|
|
|
|
+
|
|
|
|
+ FTextToolbar := CreateToolBar(FVectorImageList);
|
|
|
|
+ FTextToolbar.Left := nextControlPos.X;
|
|
|
|
+ FTextToolbar.Top := nextControlPos.Y;
|
|
|
|
+ FTextToolbar.Wrapable := false;
|
|
|
|
+
|
|
|
|
+ AddToolbarLabel(FTextToolbar, 'Text', self);
|
|
|
|
+ FTextDirectionButton := AddToolbarButton(FTextToolbar, 'Text direction', 31 + ord(FTextDirection), @TextDirClick);
|
|
|
|
+ FTextAlignButton[taLeftJustify] := AddToolbarCheckButton(FTextToolbar, 'Left align', 26, @TextAlignClick, alignment = taLeftJustify, True, ord(taLeftJustify));
|
|
|
|
+ FTextAlignButton[taCenter] := AddToolbarCheckButton(FTextToolbar, 'Center', 27, @TextAlignClick, alignment = taCenter, True, ord(taCenter));
|
|
|
|
+ FTextAlignButton[taRightJustify] := AddToolbarCheckButton(FTextToolbar, 'Right align', 28, @TextAlignClick, alignment = taRightJustify, True, ord(taRightJustify));
|
|
|
|
+ FTextAlignButton[taRightJustify].Wrap:=true;
|
|
|
|
+
|
|
|
|
+ AddToolbarLabel(FTextToolbar, 'Height', self);
|
|
|
|
+ AddToolbarUpdown(FTextToolbar, 'Font height', 1, 900, round(FTextFontHeight), @OnTextFontHeightChange);
|
|
|
|
+
|
|
|
|
+ PanelExtendedStyle.InsertControl(FTextToolbar);
|
|
|
|
+ with GetToolbarSize(FTextToolbar,0) do
|
|
|
|
+ begin
|
|
|
|
+ FTextToolbar.Width := cx+1;
|
|
|
|
+ FTextToolbar.Height := cy+1;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ nextControlPos.X := FTextToolbar.Left + FTextToolbar.Width;
|
|
|
|
+ end;
|
|
|
|
+
|
|
PanelExtendedStyle.Width := nextControlPos.X+1;
|
|
PanelExtendedStyle.Width := nextControlPos.X+1;
|
|
|
|
|
|
AdjustToolbarTop;
|
|
AdjustToolbarTop;
|
|
@@ -1376,6 +1529,7 @@ begin
|
|
BorderSizePercent:= FPhongBorderSize;
|
|
BorderSizePercent:= FPhongBorderSize;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+ if result is TTextShape then TTextShape(result).FontEmHeight:= FTextFontHeight;
|
|
result.QuickDefine(APoint1,APoint2);
|
|
result.QuickDefine(APoint1,APoint2);
|
|
if vsfBackFill in result.Fields then
|
|
if vsfBackFill in result.Fields then
|
|
begin
|
|
begin
|
|
@@ -1392,6 +1546,8 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TForm1.RemoveExtendedStyleControls;
|
|
procedure TForm1.RemoveExtendedStyleControls;
|
|
|
|
+var
|
|
|
|
+ a: TAlignment;
|
|
begin
|
|
begin
|
|
if Assigned(FSplineToolbar) then
|
|
if Assigned(FSplineToolbar) then
|
|
begin
|
|
begin
|
|
@@ -1405,6 +1561,14 @@ begin
|
|
FreeAndNil(FPhongShapeKindToolbar);
|
|
FreeAndNil(FPhongShapeKindToolbar);
|
|
FUpDownPhongBorderSize := nil;
|
|
FUpDownPhongBorderSize := nil;
|
|
end;
|
|
end;
|
|
|
|
+ if Assigned(FTextToolbar) then
|
|
|
|
+ begin
|
|
|
|
+ PanelExtendedStyle.RemoveControl(FTextToolbar);
|
|
|
|
+ FreeAndNil(FTextToolbar);
|
|
|
|
+ FTextDirectionButton := nil;
|
|
|
|
+ for a := low(TAlignment) to high(TAlignment) do
|
|
|
|
+ FTextAlignButton[a] := nil;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TForm1.UpdateBackToolFillPoints;
|
|
procedure TForm1.UpdateBackToolFillPoints;
|