|
@@ -41,71 +41,67 @@ type
|
|
TForm1 = class(TForm)
|
|
TForm1 = class(TForm)
|
|
BackImage: TImage;
|
|
BackImage: TImage;
|
|
BGRAFillImageList16: TBGRAImageList;
|
|
BGRAFillImageList16: TBGRAImageList;
|
|
- PhongImageList: TBGRAImageList;
|
|
|
|
- PenStyleImageList: TBGRAImageList;
|
|
|
|
- CurveImageList: TBGRAImageList;
|
|
|
|
ButtonBackGradInterp: TBCButton;
|
|
ButtonBackGradInterp: TBCButton;
|
|
|
|
+ ButtonBackGradRepetion: TBCButton;
|
|
ButtonBackLoadTex: TBCButton;
|
|
ButtonBackLoadTex: TBCButton;
|
|
- ButtonBackTexRepeat: TBCButton;
|
|
|
|
- ButtonBackTexAdjust: TBCButton;
|
|
|
|
ButtonBackNoTex: TBCButton;
|
|
ButtonBackNoTex: TBCButton;
|
|
- ButtonShapePaste: TBCButton;
|
|
|
|
- ButtonBackGradRepetion: TBCButton;
|
|
|
|
|
|
+ ButtonBackSwapGradColor: TBCButton;
|
|
|
|
+ ButtonBackTexAdjust: TBCButton;
|
|
|
|
+ ButtonBackTexRepeat: TBCButton;
|
|
|
|
+ ButtonMoveBackFillPoints: TToolButton;
|
|
|
|
+ ButtonNewFile: TBCButton;
|
|
|
|
+ ButtonOpenFile: TBCButton;
|
|
|
|
+ ButtonPenStyle: TBCButton;
|
|
|
|
+ ButtonSaveAs: TBCButton;
|
|
|
|
+ ButtonSaveFile: TBCButton;
|
|
|
|
+ ButtonShapeBringToFront: TBCButton;
|
|
|
|
+ ButtonShapeCopy: TBCButton;
|
|
ButtonShapeCut: TBCButton;
|
|
ButtonShapeCut: TBCButton;
|
|
|
|
+ ButtonShapeDelete: TBCButton;
|
|
|
|
+ ButtonShapeMoveDown: TBCButton;
|
|
ButtonShapeMoveUp: TBCButton;
|
|
ButtonShapeMoveUp: TBCButton;
|
|
- ButtonShapeCopy: TBCButton;
|
|
|
|
- ButtonShapeBringToFront: TBCButton;
|
|
|
|
- ButtonPenStyle: TBCButton;
|
|
|
|
- ButtonBackSwapGradColor: TBCButton;
|
|
|
|
|
|
+ ButtonShapePaste: TBCButton;
|
|
ButtonShapeSendToBack: TBCButton;
|
|
ButtonShapeSendToBack: TBCButton;
|
|
- ButtonShapeMoveDown: TBCButton;
|
|
|
|
- ButtonShapeDelete: TBCButton;
|
|
|
|
|
|
+ Label1: TLabel;
|
|
Label2: TLabel;
|
|
Label2: TLabel;
|
|
- PanelBackFillTex: TPanel;
|
|
|
|
- PanelBackFillGrad: TPanel;
|
|
|
|
|
|
+ Label3: TLabel;
|
|
PanelBackFill: TBCPanel;
|
|
PanelBackFill: TBCPanel;
|
|
|
|
+ PanelBackFillGrad: TPanel;
|
|
|
|
+ PanelBackFillTex: TPanel;
|
|
|
|
+ PanelBasicStyle: TBCPanel;
|
|
|
|
+ PanelExtendedStyle: TBCPanel;
|
|
|
|
+ PanelFile: TBCPanel;
|
|
PanelShape: TBCPanel;
|
|
PanelShape: TBCPanel;
|
|
|
|
+ PhongImageList: TBGRAImageList;
|
|
|
|
+ PenStyleImageList: TBGRAImageList;
|
|
|
|
+ CurveImageList: TBGRAImageList;
|
|
ShapeBackColor: TShape;
|
|
ShapeBackColor: TShape;
|
|
ShapeBackEndColor: TShape;
|
|
ShapeBackEndColor: TShape;
|
|
ShapeBackStartColor: TShape;
|
|
ShapeBackStartColor: TShape;
|
|
|
|
+ ShapePenColor: TShape;
|
|
|
|
+ ToolBarTop: TToolBar;
|
|
ToolBar2: TToolBar;
|
|
ToolBar2: TToolBar;
|
|
- ButtonMoveBackFillPoints: TToolButton;
|
|
|
|
ToolBarJoinStyle: TToolBar;
|
|
ToolBarJoinStyle: TToolBar;
|
|
- ToolButtonPhongShape: TToolButton;
|
|
|
|
- ToolButtonJoinRound: TToolButton;
|
|
|
|
ToolButton2: TToolButton;
|
|
ToolButton2: TToolButton;
|
|
- ToolButtonJoinBevel: TToolButton;
|
|
|
|
- ToolButtonJoinMiter: TToolButton;
|
|
|
|
- ToolButtonBackFillNone: TToolButton;
|
|
|
|
- ToolButtonBackFillSolid: TToolButton;
|
|
|
|
- ToolButtonBackFillLinear: TToolButton;
|
|
|
|
- ToolButtonBackFillReflected: TToolButton;
|
|
|
|
ToolButtonBackFillDiamond: TToolButton;
|
|
ToolButtonBackFillDiamond: TToolButton;
|
|
|
|
+ ToolButtonBackFillLinear: TToolButton;
|
|
|
|
+ ToolButtonBackFillNone: TToolButton;
|
|
ToolButtonBackFillRadial: TToolButton;
|
|
ToolButtonBackFillRadial: TToolButton;
|
|
|
|
+ ToolButtonBackFillReflected: TToolButton;
|
|
|
|
+ ToolButtonBackFillSolid: TToolButton;
|
|
ToolButtonBackFillTexture: TToolButton;
|
|
ToolButtonBackFillTexture: TToolButton;
|
|
- UpDownBackAlpha: TBCTrackbarUpdown;
|
|
|
|
- UpDownBackEndAlpha: TBCTrackbarUpdown;
|
|
|
|
- UpDownBackStartAlpha: TBCTrackbarUpdown;
|
|
|
|
- UpDownBackTexAlpha: TBCTrackbarUpdown;
|
|
|
|
- UpDownPenWidth: TBCTrackbarUpdown;
|
|
|
|
- PanelBasicStyle: TBCPanel;
|
|
|
|
- PanelFile: TBCPanel;
|
|
|
|
- PanelExtendedStyle: TBCPanel;
|
|
|
|
|
|
+ ToolButtonJoinBevel: TToolButton;
|
|
|
|
+ ToolButtonJoinMiter: TToolButton;
|
|
|
|
+ ToolButtonJoinRound: TToolButton;
|
|
|
|
+ ToolButtonPhongShape: TToolButton;
|
|
BCPanelToolChoice: TBCPanel;
|
|
BCPanelToolChoice: TBCPanel;
|
|
BCPanelToolbar: TBCPanel;
|
|
BCPanelToolbar: TBCPanel;
|
|
BGRAImageList48: TBGRAImageList;
|
|
BGRAImageList48: TBGRAImageList;
|
|
BGRAVirtualScreen1: TBGRAVirtualScreen;
|
|
BGRAVirtualScreen1: TBGRAVirtualScreen;
|
|
- ButtonOpenFile: TBCButton;
|
|
|
|
- ButtonSaveFile: TBCButton;
|
|
|
|
- ButtonSaveAs: TBCButton;
|
|
|
|
- ButtonNewFile: TBCButton;
|
|
|
|
ColorDialog1: TColorDialog;
|
|
ColorDialog1: TColorDialog;
|
|
- Label1: TLabel;
|
|
|
|
- Label3: TLabel;
|
|
|
|
OpenDialog1: TOpenDialog;
|
|
OpenDialog1: TOpenDialog;
|
|
OpenPictureDialog1: TOpenPictureDialog;
|
|
OpenPictureDialog1: TOpenPictureDialog;
|
|
SaveDialog1: TSaveDialog;
|
|
SaveDialog1: TSaveDialog;
|
|
- ShapePenColor: TShape;
|
|
|
|
ToolBarTools: TToolBar;
|
|
ToolBarTools: TToolBar;
|
|
ToolButtonPolyline: TToolButton;
|
|
ToolButtonPolyline: TToolButton;
|
|
ToolButtonCurve: TToolButton;
|
|
ToolButtonCurve: TToolButton;
|
|
@@ -114,7 +110,14 @@ type
|
|
ToolButtonPolygon: TToolButton;
|
|
ToolButtonPolygon: TToolButton;
|
|
ToolButtonRectangle: TToolButton;
|
|
ToolButtonRectangle: TToolButton;
|
|
ToolButtonEllipse: TToolButton;
|
|
ToolButtonEllipse: TToolButton;
|
|
|
|
+ UpDownBackAlpha: TBCTrackbarUpdown;
|
|
|
|
+ UpDownBackEndAlpha: TBCTrackbarUpdown;
|
|
|
|
+ UpDownBackStartAlpha: TBCTrackbarUpdown;
|
|
|
|
+ UpDownBackTexAlpha: TBCTrackbarUpdown;
|
|
UpDownPenAlpha: TBCTrackbarUpdown;
|
|
UpDownPenAlpha: TBCTrackbarUpdown;
|
|
|
|
+ UpDownPenWidth: TBCTrackbarUpdown;
|
|
|
|
+ procedure BCPanelToolbarResize(Sender: TObject);
|
|
|
|
+ procedure BCPanelToolChoiceResize(Sender: TObject);
|
|
procedure ButtonBackGradInterpClick(Sender: TObject);
|
|
procedure ButtonBackGradInterpClick(Sender: TObject);
|
|
procedure ButtonBackGradRepetionClick(Sender: TObject);
|
|
procedure ButtonBackGradRepetionClick(Sender: TObject);
|
|
procedure ButtonBackTexAdjustClick(Sender: TObject);
|
|
procedure ButtonBackTexAdjustClick(Sender: TObject);
|
|
@@ -292,6 +295,22 @@ begin
|
|
result.Images := AImages;
|
|
result.Images := AImages;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function GetToolbarSize(AToolbar: TToolbar): TSize;
|
|
|
|
+var
|
|
|
|
+ i: Integer;
|
|
|
|
+ r: TRect;
|
|
|
|
+begin
|
|
|
|
+ result := Size(1,1);
|
|
|
|
+ for i := 0 to AToolbar.ControlCount-1 do
|
|
|
|
+ begin
|
|
|
|
+ r := AToolbar.Controls[i].BoundsRect;
|
|
|
|
+ if r.Right > result.cx then result.cx := r.Right;
|
|
|
|
+ if r.Bottom > result.cy then result.cy := r.Bottom;
|
|
|
|
+ end;
|
|
|
|
+ result.cx += 1;
|
|
|
|
+ result.cy += 1;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure AddToolbarCheckButton(AToolbar: TToolbar; ACaption: string; AImageIndex: integer;
|
|
procedure AddToolbarCheckButton(AToolbar: TToolbar; ACaption: string; AImageIndex: integer;
|
|
AOnClick: TNotifyEvent; ADown: boolean; AGrouped: boolean = true; ATag: PtrInt = 0);
|
|
AOnClick: TNotifyEvent; ADown: boolean; AGrouped: boolean = true; ATag: PtrInt = 0);
|
|
var
|
|
var
|
|
@@ -701,6 +720,18 @@ begin
|
|
FBackGradInterpMenu.PopUp(X,Y);
|
|
FBackGradInterpMenu.PopUp(X,Y);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TForm1.BCPanelToolChoiceResize(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ ToolbarTools.Width := GetToolbarSize(ToolbarTools).cx;
|
|
|
|
+ BCPanelToolChoice.Width := ToolbarTools.Width+3;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TForm1.BCPanelToolbarResize(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ ToolBarTop.Height := GetToolbarSize(ToolBarTop).cy;
|
|
|
|
+ BCPanelToolbar.Height := ToolBarTop.Height;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TForm1.UpDownBackGradAlphaChange(Sender: TObject; AByUser: boolean);
|
|
procedure TForm1.UpDownBackGradAlphaChange(Sender: TObject; AByUser: boolean);
|
|
begin
|
|
begin
|
|
if AByUser then
|
|
if AByUser then
|
|
@@ -1300,7 +1331,7 @@ begin
|
|
if btn.Tag = ord(FPhongShapeKind) then btn.Down := true;
|
|
if btn.Tag = ord(FPhongShapeKind) then btn.Down := true;
|
|
end;
|
|
end;
|
|
if Assigned(FUpDownPhongBorderSize) then
|
|
if Assigned(FUpDownPhongBorderSize) then
|
|
- FUpDownPhongBorderSize.Enabled:= (FPhongShapeKind = pskRoundRectangle);
|
|
|
|
|
|
+ FUpDownPhongBorderSize.Enabled:= (FPhongShapeKind in[pskRectangle,pskRoundRectangle]);
|
|
|
|
|
|
if not FUpdatingFromShape and Assigned(vectorOriginal) and Assigned(vectorOriginal.SelectedShape) then
|
|
if not FUpdatingFromShape and Assigned(vectorOriginal) and Assigned(vectorOriginal.SelectedShape) then
|
|
begin
|
|
begin
|
|
@@ -1442,7 +1473,6 @@ var
|
|
f: TVectorShapeFields;
|
|
f: TVectorShapeFields;
|
|
showSplineStyle, showPhongStyle: boolean;
|
|
showSplineStyle, showPhongStyle: boolean;
|
|
nextControlPos: TPoint;
|
|
nextControlPos: TPoint;
|
|
- s: TSplineStyle;
|
|
|
|
texSource: TBGRABitmap;
|
|
texSource: TBGRABitmap;
|
|
mode: TVectorShapeUsermode;
|
|
mode: TVectorShapeUsermode;
|
|
sk: TPhongShapeKind;
|
|
sk: TPhongShapeKind;
|
|
@@ -1529,9 +1559,12 @@ begin
|
|
ButtonPenStyle.Enabled:= vsfPenStyle in f;
|
|
ButtonPenStyle.Enabled:= vsfPenStyle in f;
|
|
EnableDisableToolButtons([ToolButtonJoinRound,ToolButtonJoinBevel,ToolButtonJoinMiter], vsfJoinStyle in f);
|
|
EnableDisableToolButtons([ToolButtonJoinRound,ToolButtonJoinBevel,ToolButtonJoinMiter], vsfJoinStyle in f);
|
|
|
|
|
|
|
|
+ PanelExtendedStyle.Visible := false;
|
|
nextControlPos := Point(ControlMargin,4);
|
|
nextControlPos := Point(ControlMargin,4);
|
|
if showSplineStyle then
|
|
if showSplineStyle then
|
|
begin
|
|
begin
|
|
|
|
+ PanelExtendedStyle.Visible := true;
|
|
|
|
+
|
|
FSplineToolbar := CreateToolBar(CurveImageList);
|
|
FSplineToolbar := CreateToolBar(CurveImageList);
|
|
FSplineToolbar.Left := nextControlPos.X;
|
|
FSplineToolbar.Left := nextControlPos.X;
|
|
FSplineToolbar.Top := nextControlPos.Y;
|
|
FSplineToolbar.Top := nextControlPos.Y;
|
|
@@ -1560,6 +1593,8 @@ begin
|
|
end;
|
|
end;
|
|
if showPhongStyle then
|
|
if showPhongStyle then
|
|
begin
|
|
begin
|
|
|
|
+ PanelExtendedStyle.Visible := true;
|
|
|
|
+
|
|
FPhongShapeKindToolbar := CreateToolBar(PhongImageList);
|
|
FPhongShapeKindToolbar := CreateToolBar(PhongImageList);
|
|
FPhongShapeKindToolbar.Left := nextControlPos.X;
|
|
FPhongShapeKindToolbar.Left := nextControlPos.X;
|
|
FPhongShapeKindToolbar.Top := nextControlPos.Y;
|
|
FPhongShapeKindToolbar.Top := nextControlPos.Y;
|
|
@@ -1597,6 +1632,7 @@ begin
|
|
|
|
|
|
nextControlPos.X := FPhongShapeKindToolbar.Left + FPhongShapeKindToolbar.Width + ControlMargin;
|
|
nextControlPos.X := FPhongShapeKindToolbar.Left + FPhongShapeKindToolbar.Width + ControlMargin;
|
|
end;
|
|
end;
|
|
|
|
+ PanelExtendedStyle.Width := nextControlPos.X;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TForm1.UpdateTitleBar;
|
|
procedure TForm1.UpdateTitleBar;
|