home *** CD-ROM | disk | FTP | other *** search
- unit GraphSvr;
-
- { Conversion log:
- Array property TGraphicsServer.Label renamed to Label_: Identifier is a reserved word }
-
- interface
-
- uses Ole2, OleCtl, Classes, Graphics, OleCtrls;
-
- const
-
- { AutoIncConstants }
-
- gphOff = 0;
- gphOn = 1;
-
- { BackgroundConstants }
-
- gphBlack = 0;
- gphBlue = 1;
- gphGreen = 2;
- gphCyan = 3;
- gphRed = 4;
- gphMagenta = 5;
- gphBrown = 6;
- gphLightGray = 7;
- gphDarkGray = 8;
- gphLightBlue = 9;
- gphLightGreen = 10;
- gphLightCyan = 11;
- gphLightRed = 12;
- gphLightMagenta = 13;
- gphYellow = 14;
- gphWhite = 15;
-
- { ColorDataConstants }
-
- //gphBlack = 0;
- //gphBlue = 1;
- //gphGreen = 2;
- //gphCyan = 3;
- //gphRed = 4;
- //gphMagenta = 5;
- //gphBrown = 6;
- //gphLightGray = 7;
- //gphDarkGray = 8;
- //gphLightBlue = 9;
- //gphLightGreen = 10;
- //gphLightCyan = 11;
- //gphLightRed = 12;
- //gphLightMagenta = 13;
- //gphYellow = 14;
- //gphWhite = 15;
-
- { DataResetConstants }
-
- gphNone = 0;
- gphGraphData = 1;
- gphColorData = 2;
- gphExtraData = 3;
- gphLabelText = 4;
- gphLegendText = 5;
- gphPatternData = 6;
- gphSymbolData = 7;
- gphXPosData = 8;
- gphAllData = 9;
- gphFontInfo = 10;
-
- { DrawModeConstants }
-
- gphNoAction = 0;
- gphClear = 1;
- gphDraw = 2;
- gphBlit = 3;
- gphCopy = 4;
- gphPrint = 5;
- gphWrite = 6;
-
- { DrawStyleConstants }
-
- gphMonochrome = 0;
- gphColor = 1;
-
- { FontFamilyConstants }
-
- gphRoman = 0;
- gphSwiss = 1;
- gphModern = 2;
-
- { FontStyleConstants }
-
- gphDefault = 0;
- gphItalic = 1;
- gphBold = 2;
- gphBoldItalic = 3;
- gphUnderlined = 4;
- gphUnderlinedItalic = 5;
- gphUnderlinedBold = 6;
- gphUnderlinedBoldItalic = 7;
-
- { FontUseConstants }
-
- gphGraphTitle = 0;
- gphOtherTitles = 1;
- gphLabels = 2;
- gphLegend = 3;
- gphAllText = 4;
-
- { ForegroundConstants }
-
- //gphBlack = 0;
- //gphBlue = 1;
- //gphGreen = 2;
- //gphCyan = 3;
- //gphRed = 4;
- //gphMagenta = 5;
- //gphBrown = 6;
- //gphLightGray = 7;
- //gphDarkGray = 8;
- //gphLightBlue = 9;
- //gphLightGreen = 10;
- //gphLightCyan = 11;
- //gphLightRed = 12;
- //gphLightMagenta = 13;
- //gphYellow = 14;
- //gphWhite = 15;
- gphAutoBlackWhite = 16;
-
- { GraphTypeConstants }
-
- //gphNone = 0;
- gphPie2D = 1;
- gphPie3D = 2;
- gphBar2D = 3;
- gphBar3D = 4;
- gphGantt = 5;
- gphLine = 6;
- gphLogLin = 7;
- gphArea = 8;
- gphScatter = 9;
- gphPolar = 10;
- gphHLC = 11;
-
- { GridStyleConstants }
-
- //gphNone = 0;
- gphHorizontal = 1;
- gphVertical = 2;
- gphBoth = 3;
-
- { IndexStyleConstants }
-
- gphStandard = 0;
- gphEnhanced = 1;
-
- { LabelsConstants }
-
- //gphOff = 0;
- //gphOn = 1;
- gphXAxisLabelsOnly = 2;
- gphYAxisLabelsOnly = 3;
-
- { LegendStyleConstants }
-
- //gphMonochrome = 0;
- //gphColor = 1;
-
- { LineStatsConstants }
-
- //gphNone = 0;
- gphMean = 1;
- gphMinmax = 2;
- gphMeanMinmax = 3;
- gphStddev = 4;
- gphStddevMean = 5;
- gphStddevMinmax = 6;
- gphStddevMinmaxMean = 7;
- gphBestfit = 8;
- gphBestfitMean = 9;
- gphBestfitMinmax = 10;
- gphBestfitMinmaxMean = 11;
- gphBestfitStddev = 12;
- gphBestfitStddevMean = 13;
- gphBestfitStddevMinmax = 14;
- gphAll = 15;
-
- { PaletteConstants }
-
- //gphDefault = 0;
- gphPastel = 1;
- gphGrayscale = 2;
-
- { PatternedLinesConstants }
-
- gphPatternOff = 0;
- gphPatternOn = 1;
-
- { PrintStyleConstants }
-
- //gphMonochrome = 0;
- //gphColor = 1;
- gphMonochromeWithBorder = 2;
- gphColorWithBorder = 3;
-
- { RandomDataConstants }
-
- //gphOff = 0;
- //gphOn = 1;
-
- { SymbolDataConstants }
-
- gphCrossPlus = 0;
- gphCrossTimes = 1;
- gphTriangleUp = 2;
- gphSolidTriangleUp = 3;
- gphTriangleDown = 4;
- gphSolidTriangleDown = 5;
- gphSquare = 6;
- gphSolidSquare = 7;
- gphDiamond = 8;
- gphSolidDiamond = 9;
-
- { ThickLinesConstants }
-
- gphLinesOff = 0;
- gphLinesOn = 1;
-
- { TicksConstants }
-
- gphTicksOff = 0;
- gphTicksOn = 1;
- gphXAxisTicksOnly = 2;
- gphYAxisTicksOnly = 3;
-
- { YAxisPosConstants }
-
- //gphDefault = 0;
- gphAlignLeft = 1;
- gphAlignRight = 2;
-
- { YAxisStyleConstants }
-
- //gphDefault = 0;
- gphVariableOrigin = 1;
- gphUserDefined = 2;
-
- { BorderStyleConstants }
-
- //gphNone = 0;
- gphFixedSingle = 1;
-
- type
-
- TGraphicsServer = class(TOleControl)
- private
- function Get_Color(index: Smallint): Smallint; stdcall;
- procedure Set_Color(index: Smallint; Value: Smallint); stdcall;
- function Get_Data(index: Smallint): Single; stdcall;
- procedure Set_Data(index: Smallint; Value: Single); stdcall;
- function Get_Extra(index: Smallint): Smallint; stdcall;
- procedure Set_Extra(index: Smallint; Value: Smallint); stdcall;
- function Get_FFamily(index: Smallint): Smallint; stdcall;
- procedure Set_FFamily(index: Smallint; Value: Smallint); stdcall;
- function Get_FSize(index: Smallint): Smallint; stdcall;
- procedure Set_FSize(index: Smallint; Value: Smallint); stdcall;
- function Get_FStyle(index: Smallint): Smallint; stdcall;
- procedure Set_FStyle(index: Smallint; Value: Smallint); stdcall;
- function Get_Label_(index: Smallint): string; stdcall;
- procedure Set_Label_(index: Smallint; const Value: string); stdcall;
- function Get_Legend(index: Smallint): string; stdcall;
- procedure Set_Legend(index: Smallint; const Value: string); stdcall;
- function Get_Pattern(index: Smallint): Smallint; stdcall;
- procedure Set_Pattern(index: Smallint; Value: Smallint); stdcall;
- function Get_Symbol(index: Smallint): Smallint; stdcall;
- procedure Set_Symbol(index: Smallint; Value: Smallint); stdcall;
- function Get_XPos(index: Smallint): Single; stdcall;
- procedure Set_XPos(index: Smallint; Value: Single); stdcall;
- protected
- procedure InitControlData; override;
- public
- procedure Refresh; stdcall;
- procedure AboutBox; stdcall;
- property Picture: Variant index 35 read GetVariantProp write SetVariantProp;
- property QuickData: string index 37 read GetStringProp write SetStringProp;
- property SeeThru: Smallint index 39 read GetSmallintProp write SetSmallintProp;
- property Color[index: Smallint]: Smallint read Get_Color write Set_Color;
- property Data[index: Smallint]: Single read Get_Data write Set_Data;
- property Extra[index: Smallint]: Smallint read Get_Extra write Set_Extra;
- property FFamily[index: Smallint]: Smallint read Get_FFamily write Set_FFamily;
- property FSize[index: Smallint]: Smallint read Get_FSize write Set_FSize;
- property FStyle[index: Smallint]: Smallint read Get_FStyle write Set_FStyle;
- property Label_[index: Smallint]: string read Get_Label_ write Set_Label_;
- property Legend[index: Smallint]: string read Get_Legend write Set_Legend;
- property Pattern[index: Smallint]: Smallint read Get_Pattern write Set_Pattern;
- property Symbol[index: Smallint]: Smallint read Get_Symbol write Set_Symbol;
- property XPos[index: Smallint]: Single read Get_XPos write Set_XPos;
- published
- property TabStop;
- property DragCursor;
- property DragMode;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property Visible;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnStartDrag;
- property OnClick;
- property OnDblClick;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property AutoInc: TOleEnum index 1 read GetOleEnumProp write SetOleEnumProp stored False;
- property Background: TOleEnum index 2 read GetOleEnumProp write SetOleEnumProp stored False;
- property BottomTitle: string index 3 read GetStringProp write SetStringProp stored False;
- property ColorData: TOleEnum index 4 read GetOleEnumProp write SetOleEnumProp stored False;
- property CtlVersion: string index 5 read GetStringProp write SetStringProp stored False;
- property DataReset: TOleEnum index 6 read GetOleEnumProp write SetOleEnumProp stored False;
- property DrawMode: TOleEnum index 7 read GetOleEnumProp write SetOleEnumProp stored False;
- property DrawStyle: TOleEnum index 8 read GetOleEnumProp write SetOleEnumProp stored False;
- property ExtraData: Smallint index 9 read GetSmallintProp write SetSmallintProp stored False;
- property FontFamily: TOleEnum index 10 read GetOleEnumProp write SetOleEnumProp stored False;
- property FontSize: Smallint index 11 read GetSmallintProp write SetSmallintProp stored False;
- property FontStyle: TOleEnum index 12 read GetOleEnumProp write SetOleEnumProp stored False;
- property FontUse: TOleEnum index 13 read GetOleEnumProp write SetOleEnumProp stored False;
- property Foreground: TOleEnum index 14 read GetOleEnumProp write SetOleEnumProp stored False;
- property GraphCaption: string index 15 read GetStringProp write SetStringProp stored False;
- property GraphData: Single index 16 read GetSingleProp write SetSingleProp stored False;
- property GraphStyle: Smallint index 17 read GetSmallintProp write SetSmallintProp stored False;
- property GraphTitle: string index 18 read GetStringProp write SetStringProp stored False;
- property GraphType: TOleEnum index 19 read GetOleEnumProp write SetOleEnumProp stored False;
- property GridStyle: TOleEnum index 20 read GetOleEnumProp write SetOleEnumProp stored False;
- property ImageFile: string index 21 read GetStringProp write SetStringProp stored False;
- property IndexStyle: TOleEnum index 22 read GetOleEnumProp write SetOleEnumProp stored False;
- property LabelEvery: Smallint index 23 read GetSmallintProp write SetSmallintProp stored False;
- property Labels: TOleEnum index 24 read GetOleEnumProp write SetOleEnumProp stored False;
- property LabelText: string index 25 read GetStringProp write SetStringProp stored False;
- property LeftTitle: string index 26 read GetStringProp write SetStringProp stored False;
- property LegendStyle: TOleEnum index 27 read GetOleEnumProp write SetOleEnumProp stored False;
- property LegendText: string index 28 read GetStringProp write SetStringProp stored False;
- property LineStats: TOleEnum index 29 read GetOleEnumProp write SetOleEnumProp stored False;
- property NumPoints: Smallint index 30 read GetSmallintProp write SetSmallintProp stored False;
- property NumSets: Smallint index 31 read GetSmallintProp write SetSmallintProp stored False;
- property Palette: TOleEnum index 32 read GetOleEnumProp write SetOleEnumProp stored False;
- property PatternData: Smallint index 33 read GetSmallintProp write SetSmallintProp stored False;
- property PatternedLines: TOleEnum index 34 read GetOleEnumProp write SetOleEnumProp stored False;
- property PrintStyle: TOleEnum index 36 read GetOleEnumProp write SetOleEnumProp stored False;
- property RandomData: TOleEnum index 38 read GetOleEnumProp write SetOleEnumProp stored False;
- property SymbolData: TOleEnum index 40 read GetOleEnumProp write SetOleEnumProp stored False;
- property ThickLines: TOleEnum index 41 read GetOleEnumProp write SetOleEnumProp stored False;
- property ThisPoint: Smallint index 42 read GetSmallintProp write SetSmallintProp stored False;
- property ThisSet: Smallint index 43 read GetSmallintProp write SetSmallintProp stored False;
- property TickEvery: Smallint index 44 read GetSmallintProp write SetSmallintProp stored False;
- property Ticks: TOleEnum index 45 read GetOleEnumProp write SetOleEnumProp stored False;
- property XPosData: Single index 46 read GetSingleProp write SetSingleProp stored False;
- property YAxisMax: Single index 47 read GetSingleProp write SetSingleProp stored False;
- property YAxisMin: Single index 48 read GetSingleProp write SetSingleProp stored False;
- property YAxisPos: TOleEnum index 49 read GetOleEnumProp write SetOleEnumProp stored False;
- property YAxisStyle: TOleEnum index 50 read GetOleEnumProp write SetOleEnumProp stored False;
- property YAxisTicks: Smallint index 51 read GetSmallintProp write SetSmallintProp stored False;
- property Enabled: TOleBool index -514 read GetOleBoolProp write SetOleBoolProp stored False;
- property BorderStyle: TOleEnum index -504 read GetOleEnumProp write SetOleEnumProp stored False;
- property hWnd: Integer index -515 read GetIntegerProp write SetIntegerProp stored False;
- end;
-
- procedure Register;
-
- implementation
-
- {$J+}
-
- procedure TGraphicsServer.InitControlData;
- const
- CControlData: TControlData = (
- ClassID: (
- D1:$0842D100;D2:$1E19;D3:$101B;D4:($9A,$AF,$1A,$16,$26,$55,$1E,$7C));
- EventIID: (
- D1:$0842D102;D2:$1E19;D3:$101B;D4:($9A,$AF,$1A,$16,$26,$55,$1E,$7C));
- EventCount: 0;
- EventDispIDs: nil;
- LicenseKey: nil;
- Flags: $00000008);
- begin
- ControlData := @CControlData;
- end;
-
- procedure TGraphicsServer.Refresh;
- const
- DispInfo: array[0..7] of Byte = ($DA,$FD,$FF,$FF,$00,$01,$00,$00);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- procedure TGraphicsServer.AboutBox;
- const
- DispInfo: array[0..7] of Byte = ($D8,$FD,$FF,$FF,$00,$01,$00,$00);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_Color;
- const
- DispInfo: array[0..8] of Byte = ($34,$00,$00,$00,$02,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_Color;
- const
- DispInfo: array[0..9] of Byte = ($34,$00,$00,$00,$00,$04,$02,$00,$02,$02);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_Data;
- const
- DispInfo: array[0..8] of Byte = ($35,$00,$00,$00,$04,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_Data;
- const
- DispInfo: array[0..9] of Byte = ($35,$00,$00,$00,$00,$04,$02,$00,$02,$04);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_Extra;
- const
- DispInfo: array[0..8] of Byte = ($36,$00,$00,$00,$02,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_Extra;
- const
- DispInfo: array[0..9] of Byte = ($36,$00,$00,$00,$00,$04,$02,$00,$02,$02);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_FFamily;
- const
- DispInfo: array[0..8] of Byte = ($37,$00,$00,$00,$02,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_FFamily;
- const
- DispInfo: array[0..9] of Byte = ($37,$00,$00,$00,$00,$04,$02,$00,$02,$02);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_FSize;
- const
- DispInfo: array[0..8] of Byte = ($38,$00,$00,$00,$02,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_FSize;
- const
- DispInfo: array[0..9] of Byte = ($38,$00,$00,$00,$00,$04,$02,$00,$02,$02);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_FStyle;
- const
- DispInfo: array[0..8] of Byte = ($39,$00,$00,$00,$02,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_FStyle;
- const
- DispInfo: array[0..9] of Byte = ($39,$00,$00,$00,$00,$04,$02,$00,$02,$02);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_Label_;
- const
- DispInfo: array[0..8] of Byte = ($3A,$00,$00,$00,$08,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_Label_;
- const
- DispInfo: array[0..9] of Byte = ($3A,$00,$00,$00,$00,$04,$02,$00,$02,$08);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_Legend;
- const
- DispInfo: array[0..8] of Byte = ($3B,$00,$00,$00,$08,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_Legend;
- const
- DispInfo: array[0..9] of Byte = ($3B,$00,$00,$00,$00,$04,$02,$00,$02,$08);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_Pattern;
- const
- DispInfo: array[0..8] of Byte = ($3C,$00,$00,$00,$02,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_Pattern;
- const
- DispInfo: array[0..9] of Byte = ($3C,$00,$00,$00,$00,$04,$02,$00,$02,$02);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_Symbol;
- const
- DispInfo: array[0..8] of Byte = ($3D,$00,$00,$00,$02,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_Symbol;
- const
- DispInfo: array[0..9] of Byte = ($3D,$00,$00,$00,$00,$04,$02,$00,$02,$02);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- function TGraphicsServer.Get_XPos;
- const
- DispInfo: array[0..8] of Byte = ($3E,$00,$00,$00,$04,$02,$01,$00,$02);
- begin
- InvokeMethod(DispInfo, @Result);
- end;
-
- procedure TGraphicsServer.Set_XPos;
- const
- DispInfo: array[0..9] of Byte = ($3E,$00,$00,$00,$00,$04,$02,$00,$02,$04);
- begin
- InvokeMethod(DispInfo, nil);
- end;
-
- procedure Register;
- begin
- RegisterComponents('OCX', [TGraphicsServer]);
- end;
-
- end.
-