home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kolekce / d345 / JWTOOL.ZIP / jwtool / JwWrpBtn.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2001-09-29  |  22.6 KB  |  844 lines

  1. unit JwWrpbtn;
  2.  
  3. {
  4.         **   VERSION History   **
  5.    Version     Date     Notes
  6.     v1.00  - 01APR99    Original Release
  7. }
  8.  
  9. {
  10.      One problem has always been that you have too much information that
  11. you want to place on a button, but not enough room to do so.  What this
  12. component does is simply take a TLabel (yes, that's right, a TLabel) and
  13. redo the painting so that it draws to look just like a button.  Also
  14. since we want a button effect, it has different procedures painting procedures
  15. if the mouse is down or up.  Remember:  This does offer the benefit of
  16. "borrowing" it's owner's canvas to draw itself, and therefore doesn't take
  17. as much memory.
  18.      Borrowing a bit from the JwLabel, we're going to make this button rotatable,
  19. and have a few "special effects."
  20.     NOTE:  I have to admit that I borrowed some of the *ideas* to make the 3D effect
  21. from the "Raize" components published in the Coriolis book on creating components,
  22. however, it is not a DIRECT code-theft.
  23.  
  24.   Created By:
  25.     Joseph Wilcock
  26.     Coockoo@hotmail.com
  27.     http://msnhomepages.talkcity.com/RedmondAve/coockoo/
  28.  
  29. }
  30.  
  31. interface
  32.  
  33. uses {$IFDEF WIN32} Windows, {$ELSE} WinProcs, WinTypes, {$ENDIF}
  34.      Messages, SysUtils, Classes, Controls, Forms, Graphics, Stdctrls;
  35.  
  36. type
  37.   TWButtonState = (bsUp, bsDisabled, bsDown, bsExclusive);
  38.   TTextStyle = ( tsNone, tsRaised, tsRecessed, tsShadow );
  39.   {TFontWeightOption = ( fwDontCare, fwThin, fwExtraLight, fwLight, fwNormal,
  40.                     fwRegular, fwMedium}
  41.   TFontCharSet = ( fcANSI, fcDEFAULT, fcSYMBOL, fsSHIFTJIS, fsOEM );
  42.   TJwWrapButton = class(TLabel)
  43.     private
  44.       { Private fields of TJwWrapButton }
  45.  
  46.       { Private methods of TJwWrapButton }
  47.         FTextStyle : TTextStyle;
  48.         FShadowColor : TColor;
  49.         FShadowDepth : Integer;
  50.         {Special Font Information}
  51.         FFontHeight: Integer;
  52.         FFontWidth: Integer;
  53.         FFontEscapement: Integer;
  54.         FFontOrientation: Integer;
  55.         FFontWeight: Integer;
  56.         FFontItalic: Byte;
  57.         FFontUnderline: Byte;
  58.         FFontStrikeOut: Byte;
  59.         FFontCharSet: Byte;
  60.         FFontOutPrecision: Byte;
  61.         FFontClipPrecision: Byte;
  62.         FFontQuality: Byte;
  63.         FFontPitchAndFamily: Byte;
  64.         FFontFaceName: String;
  65.         FOffsetX: Integer;
  66.         FOffsetY: Integer;
  67.         FCentered: Boolean;
  68.         FAllowDown: Boolean;
  69.         F3dFont: Boolean;
  70.         FButtonFace: TColor;
  71.         FHighLight: TColor;
  72.         FButtonShadow: TColor;
  73.         FWindowFrame: TColor;
  74.         Procedure Set3DFont( Value: Boolean );
  75.         Procedure SetFontHeight( Value: Integer );
  76.         Procedure SetFontWidth( Value: Integer );
  77.         Procedure SetFontEscapement( Value: Integer );
  78.         Procedure SetFontOrientation( Value: Integer );
  79.         Procedure SetFontWeight( Value: Integer );
  80.         Procedure SetFontItalic( Value: Byte );
  81.         Procedure SetFontUnderline( Value: Byte );
  82.         Procedure SetFontStrikeOut( Value: Byte );
  83.         Procedure SetFontCharSet( Value: Byte );
  84.         Procedure SetFontOutPrecision( Value: Byte );
  85.         Procedure SetFontClipPrecision( Value: Byte );
  86.         Procedure SetFontQuality( Value: Byte );
  87.         Procedure SetFontPitchAndFamily( Value: Byte );
  88.         Procedure SetFontFaceName( Value: String );
  89.         Procedure SetOffsetX( Value: Integer );
  90.         Procedure SetOffsetY( Value: Integer );
  91.         Procedure SetCentered( Value: Boolean );
  92.         {*****************}
  93.         procedure SetTextStyle( Value : TTextStyle );
  94.         procedure SetShadowColor( Value : TColor );
  95.         procedure SetShadowDepth( Value : Integer );
  96.         procedure SetButtonFace( Value: TColor );
  97.         procedure SetHightLight( Value: TColor );
  98.         procedure SetButtonShadow( Value: TColor );
  99.         procedure SetWindowFrame( Value: TColor );
  100.         procedure WMSize(var Message: TWMSize); message WM_SIZE;
  101.         function DrawButtonFace( const Client: TRect;
  102.                                        IsDown: Boolean ): TRect;
  103.     protected
  104.       { Protected fields of TJwWrapButton }
  105.         FState: TWButtonState;
  106.         FBevelWidth: Integer;
  107.         FBorderWidth: Integer;
  108.         Procedure SetBevelWidth( Value: Integer );
  109.         Procedure SetBorderWidth( Value: Integer );
  110.  
  111.       { Protected methods of TJwWrapButton }
  112.         procedure Click; override;
  113.         procedure Loaded; override;
  114.         { Add code to make this a button }
  115.         procedure Paint; override;
  116.         procedure DoDrawText(var Rect: TRect; Flags: Word);
  117.         procedure Draw3DText( R : TRect; Flags : Word );
  118.         procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
  119.         procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP;
  120.     public
  121.       { Public fields and properties of TJwWrapButton }
  122.  
  123.       { Public methods of TJwWrapButton }
  124.         constructor Create(AOwner: TComponent); override;
  125.         destructor Destroy; override;
  126.  
  127.     published
  128.       { Published properties of TJwWrapButton }
  129.         Property Use3dFont: Boolean
  130.           Read F3DFont
  131.           Write Set3DFont
  132.           Default False;
  133.  
  134.         property BevelWidth: Integer
  135.           Read FBevelWidth
  136.           Write SetBevelWidth
  137.           default 2;
  138.  
  139.         property BorderWidth: Integer
  140.           Read FBorderWidth
  141.           Write SetBorderWidth
  142.           default 2;
  143.  
  144.         property ShadowColor : TColor
  145.           read FShadowColor
  146.           write SetShadowColor
  147.           default clBtnShadow;
  148.  
  149.         property ShadowDepth : Integer
  150.           read FShadowDepth
  151.           write SetShadowDepth
  152.           default 2;
  153.  
  154.         property TextStyle : TTextStyle
  155.           read FTextStyle
  156.           write SetTextStyle
  157.           default tsRecessed;
  158.  
  159.         property FontHeight: Integer
  160.           read FFontHeight
  161.           write SetFontHeight
  162.           default 10;
  163.  
  164.         property FontWidth: Integer
  165.           read FFontWidth
  166.           write SetFontWidth
  167.           default 10;
  168.  
  169.         property FontEscapement: Integer
  170.           read FFontEscapement
  171.           write SetFontEscapement
  172.           default 0;
  173.  
  174.         property FontOrientation: Integer
  175.           read FFontOrientation
  176.           write SetFontOrientation
  177.           default 0;
  178.  
  179.         property FontWeight: Integer
  180.           read FFontWeight
  181.           write SetFontWeight
  182.           default 100;
  183.  
  184.         property FontItalic: Byte
  185.           read FFontItalic
  186.           write SetFontItalic
  187.           default 0;
  188.  
  189.         property FontUnderline: Byte
  190.           read FFontUnderline
  191.           write SetFontUnderline
  192.           default 0;
  193.  
  194.         property FontStrikout: Byte
  195.           read FFontStrikeOut
  196.           write SetFontStrikeOut
  197.           default 0;
  198.  
  199.         property FontCharSet: Byte
  200.           read FFontCharSet
  201.           write SetFontCharSet
  202.           default 0;
  203.  
  204.         property FontOutPrecision: Byte
  205.           read FFontOutPrecision
  206.           write SetFontOutPrecision
  207.           default 0;
  208.  
  209.         property FontClipPrecision: Byte
  210.           read FFontClipPrecision
  211.           write SetFontClipPrecision
  212.           default 0;
  213.  
  214.         property FontQuality: Byte
  215.           read FFontQuality
  216.           write SetFontQuality
  217.           default 0;
  218.  
  219.         property FontPitchAndFamily: Byte
  220.           read FFontPitchAndFamily
  221.           write SetFontPitchAndFamily
  222.           default 0;
  223.  
  224.         property FontFaceName: String
  225.           read FFontFaceName
  226.           write SetFontFaceName;
  227.  
  228.         property OffsetX: Integer
  229.           read FOffsetX
  230.           write SetOffsetX
  231.           default 0;
  232.  
  233.         property OffsetY: Integer
  234.           read FOffsetY
  235.           write SetOffsetY
  236.           default 0;
  237.  
  238.         property Centered: Boolean
  239.           read FCentered
  240.           write SetCentered
  241.           default False;
  242.  
  243.         property AllowDown: Boolean
  244.           Read FAllowDown
  245.           Write FAllowDown
  246.           Default True;
  247.  
  248.         property ButtonFace: TColor
  249.           Read FButtonFace
  250.           Write SetButtonFace
  251.           default clbtnFace;
  252.  
  253.         property HighLight: TColor
  254.           Read FHighLight
  255.           Write SetHightLight
  256.           default clBtnHighlight;
  257.  
  258.         property ButtonShadow: TColor
  259.           Read FButtonShadow
  260.           Write SetButtonShadow
  261.           default clBtnShadow;
  262.  
  263.         property WindowFrame: TColor
  264.           Read FWindowFrame
  265.           Write SetWindowFrame
  266.           default clWindowFrame;
  267.  
  268.         Property Anchors;
  269.         property OnClick;
  270.         property OnDblClick;
  271.         property OnDragDrop;
  272.         property OnMouseDown;
  273.         property OnMouseMove;
  274.         property OnMouseUp;
  275.  
  276.   end;
  277.  
  278. procedure Register;
  279.  
  280.  
  281.  
  282. implementation
  283.  
  284. uses ExtCtrls;
  285.  
  286. procedure Register;
  287. begin
  288.      { Register TJwWrapButton with Standard as its
  289.        default page on the Delphi component palette }
  290.      RegisterComponents('JwTools', [TJwWrapButton]);
  291. end;
  292.  
  293. { Override OnClick handler from TLabel }
  294. procedure TJwWrapButton.Click;
  295. begin
  296.      { Code to execute before activating click
  297.        behavior of component's parent class }
  298.  
  299.      { Activate click behavior of parent }
  300.      inherited Click;
  301.  
  302.      { Code to execute after click behavior
  303.        of parent }
  304.  
  305. end;
  306.  
  307. constructor TJwWrapButton.Create(AOwner: TComponent);
  308. begin
  309.      { Call the Create method of the parent class }
  310.      inherited Create(AOwner);
  311.  
  312.      FBevelwidth := 2;
  313.      FBorderWidth := 2;
  314.      FAllowDown := True;
  315.      FTextStyle := tsRecessed;
  316.      FShadowDepth := 2;
  317.      FShadowColor := clBtnShadow;
  318.      FFontOutPrecision := OUT_TT_PRECIS;
  319.      FFontClipPrecision := CLIP_TT_ALWAYS;
  320.      FFontPitchAndFamily := VARIABLE_PITCH or TMPF_TRUETYPE or FF_SWISS;
  321.      FFontFaceName := 'Arial';
  322.      FFontHeight := 20;
  323.      FFontWeight := 100;
  324.      FFontCharSet := DEFAULT_CHARSET;
  325.      FCentered := False;
  326.      F3DFont := False;
  327.  
  328.      FButtonFace := clBtnFace;
  329.      FHighLight := clBtnHighLight;
  330.      FButtonShadow := clBtnShadow;
  331.      FWindowFrame := clWindowFrame;
  332.  
  333.      FState := bsUp;
  334.      AutoSize := false;
  335.      WordWrap := True;
  336.      Self.Width := 60;
  337.      Self.Height := 60;
  338. end;
  339.  
  340. Procedure TJwWrapButton.Set3DFont( Value: Boolean );
  341. begin
  342.   if Value <> F3DFont then
  343.     begin
  344.       F3DFont := Value;
  345.       InValidate;
  346.     end;
  347. end;
  348.  
  349. Procedure TJwWrapButton.SetBevelWidth( Value: Integer );
  350. begin
  351.   if Value <> FBevelWidth then
  352.     begin
  353.       FBevelWidth := Value;
  354.       InValidate;
  355.     end;
  356. end;
  357.  
  358. Procedure TJwWrapButton.SetBorderWidth( Value: Integer );
  359. begin
  360.   if Value <> FBorderWidth then
  361.     begin
  362.       FBorderWidth := Value;
  363.       InValidate;
  364.     end;
  365. end;
  366.  
  367. destructor TJwWrapButton.Destroy;
  368. begin
  369.   inherited Destroy;
  370. end;
  371.  
  372. procedure TJwWrapButton.Loaded;
  373. begin
  374.   inherited Loaded;
  375. end;
  376.  
  377. { Add code to make this a button }
  378. procedure TJwWrapButton.Paint;
  379. const
  380.   Alignments: array[TAlignment] of Word = (DT_LEFT, DT_RIGHT, DT_CENTER);
  381. var
  382.   PaintRect: TRect;
  383.   TextBounds: TRect;
  384.  
  385. begin
  386.  
  387.      { To change the appearance of the component, use the methods
  388.        supplied by the component's Canvas property (which is of
  389.        type TCanvas).  For example, }
  390.   if not Enabled and not (csDesigning in ComponentState) then
  391.   begin
  392.     FState := bsDisabled;
  393.     {FDragging := False;}
  394.   end
  395.   else if FState = bsDisabled then FState := bsUp;
  396.  
  397.   Canvas.Font := Self.Font;
  398.   Canvas.Brush.Color := Self.Color;
  399.  
  400.   PaintRect := DrawButtonFace( Rect(0, 0, Width, Height), FState in [bsDown] );
  401.  
  402.   with Canvas do
  403.   begin
  404.     Brush.Color := Self.Color;
  405.     Brush.Style := bsClear;
  406.  
  407.     if F3dFont then
  408.       begin
  409.         PaintRect := ClientRect;
  410.         Draw3DText( PaintRect, (DT_EXPANDTABS or DT_WORDBREAK) or
  411.            Alignments[Self.Alignment] );
  412.       end
  413.     else
  414.       begin
  415.         PaintRect.Top := FBevelWidth + FBorderWidth;
  416.         PaintRect.Left := FBevelWidth + FBorderWidth;
  417.         PaintRect.Bottom := Height - FBevelWidth - FBorderWidth;
  418.         PaintRect.Right := Width - FBevelWidth - FBorderWidth;
  419.         DoDrawText( PaintRect, (DT_EXPANDTABS or DT_WORDBREAK) or
  420.            Alignments[Self.Alignment] );
  421.       end;
  422.   end;
  423. end;
  424.  
  425. procedure TJwWrapButton.WMLButtonDown(var Message: TWMLButtonDown);
  426. begin
  427.   Inherited;
  428.   if FAllowDown then
  429.     begin
  430.       FState := bsDown;
  431.       Invalidate;
  432.     end;
  433. end;
  434.  
  435. procedure TJwWrapButton.WMLButtonUp(var Message: TWMLButtonUp);
  436. begin
  437.   Inherited;
  438.   if FAllowDown then
  439.     begin
  440.       FState := bsUp;
  441.       Invalidate;
  442.     end;
  443. end;
  444.  
  445. procedure TJwWrapButton.WMSize(var Message: TWMSize);
  446. var
  447.      W, H: Integer;
  448. begin
  449.      { Our Label will imitate a button, so we want to make
  450.      sure that caption is painted in the right place.  Hopefully,
  451.      this will allow it, but it may require overriding some other
  452.      "autosize" features of the TLabel to work completly}
  453.  
  454.      if NOT( F3dFont ) then
  455.        begin
  456.          W := Width + ( ( FBorderWidth + FBevelWidth ) * 2 );
  457.          H := Height + ( ( FBorderWidth + FBevelWidth ) * 2 );
  458.        end
  459.      else
  460.        begin
  461.          W := Width;
  462.          H := Height;
  463.        end;
  464.  
  465.      { Code to check and adjust W and H }
  466.  
  467.      { Update the component size if we adjusted W or H }
  468.      if (W <> Width) or (H <> Height) then
  469.         inherited SetBounds(Left, Top, W, H);
  470.  
  471.      { Code to update dimensions of any owned sub-components
  472.        by reading their Height and Width properties and updating
  473.        via their SetBounds methods }
  474.  
  475.      Message.Result := 0;
  476. end;
  477.  
  478. procedure TJwWrapButton.DoDrawText(var Rect: TRect; Flags: Word);
  479. var
  480.   Text: array[0..255] of Char;
  481. begin
  482.   GetTextBuf(Text, SizeOf(Text));
  483.   if (Flags and DT_CALCRECT <> 0) and ((Text[0] = #0) {or FShowAccelChar} and
  484.     (Text[0] = '&') and (Text[1] = #0)) then StrCopy(Text, ' ');
  485.   {if not FShowAccelChar then Flags := Flags or DT_NOPREFIX;}
  486.   Canvas.Font := Font;
  487.   if not Enabled then Canvas.Font.Color := clGrayText;
  488.   DrawText(Canvas.Handle, Text, StrLen(Text), Rect, Flags);
  489. end;
  490.  
  491. procedure TJwWrapButton.Draw3DText( R : TRect; Flags : Word );
  492. var
  493.   CaptionStz : array[ 0..255 ] of Char;
  494.   TempRct : TRect;
  495.   TmpWidth: Integer;
  496.   ULColor : TColor;
  497.   LRColor : TColor;
  498. begin
  499.   with Canvas do
  500.     begin
  501.       StrPCopy( CaptionStz, Caption );
  502.  
  503.       TmpWidth := TextWidth( Caption );
  504.  
  505.       if WordWrap then
  506.         Flags := Flags or dt_WordBreak;
  507.  
  508.       if not ShowAccelChar then
  509.         Flags := Flags or dt_NoPrefix;
  510.  
  511.       Font := Self.Font;
  512.  
  513.       FFontFaceName := Font.Name;
  514.  
  515.       Font.Handle := CreateFont(   FFontHeight,  {Height}
  516.                                     FFontWidth,  {Width}
  517.                                FFontEscapement,  {Escapement}
  518.                               FFontOrientation,  {Orientation}
  519.                                    FFontWeight,  {Weight}
  520.                                    FFontItalic,  {Italic}
  521.                                 FFontUnderline,  {Underline}
  522.                                 FFontStrikeOut,  {StrikeOut}
  523.                                   FFontCharSet,  {CharSet}
  524.                              FFontOutPrecision,  {OutputPrecision}
  525.                             FFontClipPrecision,  {ClipPrecision}
  526.                                   FFontQuality,  {Quality}
  527.                            FFontPitchAndFamily,  {PitchAndFamily}
  528.                              @FFontFaceName[1] );{FaceName}
  529.  
  530.  
  531.  
  532.       if FTextStyle in [ tsRecessed, tsRaised ] then
  533.         begin
  534.           if FTextStyle = tsRaised then
  535.             begin
  536.               ULColor := clBtnHighlight;
  537.               LRColor := clBtnShadow;
  538.             end
  539.           else
  540.             begin
  541.               ULColor := clBtnShadow;
  542.               LRColor := clBtnHighlight;
  543.             end;
  544.  
  545.           TempRct := R;
  546.           OffsetRect( TempRct, 1, 1 );
  547.           Font.Color := LRColor;
  548.           {DrawText( Handle, CaptionStz, -1, TempRct, Flags );}
  549.           if FCentered then
  550.             TempRct.Left := TempRct.Left - ( TmpWidth div 2 );
  551.           Textout( TempRct.Left+FOffsetX, TempRct.Top+FOffsetY, Caption );
  552.  
  553.           TempRct := R;
  554.           OffsetRect( TempRct, -1, -1 );
  555.           Canvas.Font.Color := ULColor;
  556.           {DrawText( Handle, CaptionStz, -1, TempRct, Flags );}
  557.           if FCentered then
  558.             TempRct.Left := TempRct.Left - ( TmpWidth div 2 );
  559.           Textout( TempRct.Left+FOffsetX, TempRct.Top+FOffsetY, Caption );
  560.           Font.Color := Self.Font.Color;
  561.           if not Enabled then
  562.             Font.Color := clGrayText;
  563.           Textout( TempRct.Left+FOffsetX, TempRct.Top+FOffsetY, Caption );
  564.         end
  565.       else if FTextStyle = tsShadow then
  566.         begin
  567.           TempRct := R;
  568.           OffsetRect( TempRct, FShadowDepth, FShadowDepth );
  569.           Font.Color := FShadowColor;
  570.           {DrawText( Handle, CaptionStz, -1, TempRct, Flags );}
  571.           if FCentered then
  572.             TempRct.Left := TempRct.Left - ( TmpWidth div 2 );
  573.           Textout( TempRct.Left+FOffsetX, TempRct.Top+FOffsetY, Caption );
  574.           Font.Color := Self.Font.Color;
  575.           if not Enabled then
  576.             Font.Color := clGrayText;
  577.           Textout( TempRct.Left+FOffsetX, TempRct.Top+FOffsetY, Caption );
  578.         end
  579.       else
  580.         begin
  581.           Font.Color := Self.Font.Color;
  582.           if not Enabled then
  583.             Font.Color := clGrayText;
  584.           {DrawText( Handle, CaptionStz, -1, R, Flags );}
  585.           if FCentered then
  586.             TempRct.Left := TempRct.Left - ( TmpWidth div 2 );
  587.           Textout( TempRct.Left+FOffsetX, TempRct.Top+FOffsetY, Caption );
  588.         end;
  589.     end;  {with Canvas}
  590. end;
  591.  
  592. function TJwWrapButton.DrawButtonFace( const Client: TRect;
  593.                                        IsDown: Boolean ): TRect;
  594. var
  595.   R: TRect;
  596. begin
  597.   R := Client;
  598.   with Canvas do
  599.   begin
  600.     Brush.Style := bsSolid;
  601.     FillRect(R);
  602.  
  603.     {Frame3D is an actual API function!  It will draw a 3-D-ish frame around
  604.     a specific rectangle.  One for border, and another for the "bevel"}
  605.     if IsDown then
  606.     begin
  607.       Frame3D( Canvas, R, FButtonShadow, FHighLight, FBorderWidth );
  608.       Frame3D( Canvas, R, FWindowFrame, FButtonShadow, FBevelWidth );
  609.     end
  610.     else
  611.     begin
  612.       Frame3D( Canvas, R, FButtonShadow, FWindowFrame, FBorderWidth );
  613.       Frame3D( Canvas, R, FHighLight, FButtonShadow, FBevelWidth );
  614.     end;
  615.   end;
  616.  
  617.  
  618.   Result := Client;
  619.   InflateRect(Result, -BevelWidth, -BevelWidth);
  620.   if IsDown then OffsetRect(Result, FBevelWidth, FBevelWidth);
  621. end;
  622.  
  623. Procedure TJwWrapButton.SetFontHeight( Value: Integer );
  624. begin
  625.   if Value <> FFontHeight then
  626.     begin
  627.       FFontHeight := Value;
  628.       Invalidate;
  629.     end;
  630. end;
  631.  
  632. Procedure TJwWrapButton.SetFontWidth( Value: Integer );
  633. begin
  634.   if Value <> FFontWidth then
  635.     begin
  636.       FFontWidth := Value;
  637.       Invalidate;
  638.     end;
  639. end;
  640.  
  641. Procedure TJwWrapButton.SetFontEscapement( Value: Integer );
  642. begin
  643.   if Value <> FFontEscapement then
  644.     begin
  645.       FFontEscapement := Value;
  646.       Invalidate;
  647.     end;
  648. end;
  649.  
  650. Procedure TJwWrapButton.SetFontOrientation( Value: Integer );
  651. begin
  652.   if Value <> FFontOrientation then
  653.     begin
  654.       FFontOrientation := Value;
  655.       Invalidate;
  656.     end;
  657. end;
  658.  
  659. Procedure TJwWrapButton.SetFontWeight( Value: Integer );
  660. begin
  661.   if Value <> FFontWeight then
  662.     begin
  663.       FFontWeight := Value;
  664.       Invalidate;
  665.     end;
  666. end;
  667.  
  668. Procedure TJwWrapButton.SetFontItalic( Value: Byte );
  669. begin
  670.   if Value <> FFontItalic then
  671.     begin
  672.       FFontItalic := Value;
  673.       Invalidate;
  674.     end;
  675. end;
  676.  
  677. Procedure TJwWrapButton.SetFontUnderline( Value: Byte );
  678. begin
  679.   if Value <> FFontUnderline then
  680.     begin
  681.       FFontUnderline := Value;
  682.       Invalidate;
  683.     end;
  684. end;
  685.  
  686. Procedure TJwWrapButton.SetFontStrikeOut( Value: Byte );
  687. begin
  688.   if Value <> FFontStrikeOut then
  689.     begin
  690.       FFontStrikeOut := Value;
  691.       Invalidate;
  692.     end;
  693. end;
  694.  
  695. Procedure TJwWrapButton.SetFontCharSet( Value: Byte );
  696. begin
  697.   if Value <> FFontCharSet then
  698.     begin
  699.       FFontCharSet := Value;
  700.       Invalidate;
  701.     end;
  702. end;
  703.  
  704. Procedure TJwWrapButton.SetFontOutPrecision( Value: Byte );
  705. begin
  706.   if Value <> FFontOutPrecision then
  707.     begin
  708.       FFontOutPrecision := Value;
  709.       Invalidate;
  710.     end;
  711. end;
  712.  
  713. Procedure TJwWrapButton.SetFontClipPrecision( Value: Byte );
  714. begin
  715.   if Value <> FFontClipPrecision then
  716.     begin
  717.       FFontClipPrecision := Value;
  718.       Invalidate;
  719.     end;
  720. end;
  721.  
  722. Procedure TJwWrapButton.SetFontQuality( Value: Byte );
  723. begin
  724.   if Value <> FFontQuality then
  725.     begin
  726.       FFontQuality := Value;
  727.       Invalidate;
  728.     end;
  729. end;
  730.  
  731. Procedure TJwWrapButton.SetFontPitchAndFamily( Value: Byte );
  732. begin
  733.   if Value <> FFontPitchAndFamily then
  734.     begin
  735.       FFontPitchAndFamily := Value;
  736.       Invalidate;
  737.     end;
  738. end;
  739.  
  740. Procedure TJwWrapButton.SetFontFaceName( Value: String );
  741. begin
  742.   if Value <> FFontFaceName then
  743.     begin
  744.       FFontFaceName := Value;
  745.       Invalidate;
  746.     end;
  747. end;
  748.  
  749. Procedure TJwWrapButton.SetOffsetX( Value: Integer );
  750. begin
  751.   if Value <> FOffsetX then
  752.     begin
  753.       FOffsetX := Value;
  754.       Invalidate;
  755.     end;
  756. end;
  757.  
  758. Procedure TJwWrapButton.SetOffsetY( Value: Integer );
  759. begin
  760.   if Value <> FOffsetY then
  761.     begin
  762.       FOffsetY := Value;
  763.       Invalidate;
  764.     end;
  765. end;
  766.  
  767. Procedure TJwWrapButton.SetCentered( Value: Boolean );
  768. begin
  769.   if Value <> FCentered then
  770.     begin
  771.       FCentered := Value;
  772.       Invalidate;
  773.     end;
  774. end;
  775.  
  776.  
  777. {**********************}
  778.  
  779. procedure TJwWrapButton.SetShadowColor( Value : TColor );
  780. begin
  781.   if Value <> FShadowColor then
  782.   begin
  783.     FShadowColor := Value;
  784.     Invalidate;
  785.   end;
  786. end;
  787.  
  788. procedure TJwWrapButton.SetButtonFace( Value: TColor );
  789. begin
  790.   if Value <> FButtonFace then
  791.   begin
  792.     FButtonFace := Value;
  793.     Invalidate;
  794.   end;
  795. end;
  796.  
  797. procedure TJwWrapButton.SetHightLight( Value: TColor );
  798. begin
  799.   if Value <> FHighLight then
  800.   begin
  801.     FHighLight := Value;
  802.     Invalidate;
  803.   end;
  804. end;
  805. procedure TJwWrapButton.SetButtonShadow( Value: TColor );
  806. begin
  807.   if Value <> FButtonShadow then
  808.   begin
  809.     FButtonShadow := Value;
  810.     Invalidate;
  811.   end;
  812. end;
  813. procedure TJwWrapButton.SetWindowFrame( Value: TColor );
  814. begin
  815.   if Value <> FWindowFrame then
  816.   begin
  817.     FWindowFrame := Value;
  818.     Invalidate;
  819.   end;
  820. end;
  821.  
  822. procedure TJwWrapButton.SetShadowDepth( Value : Integer );
  823. begin
  824.   if Value <> FShadowDepth then
  825.   begin
  826.     FShadowDepth := Value;
  827.     Invalidate;
  828.   end;
  829. end;
  830.  
  831.  
  832. procedure TJwWrapButton.SetTextStyle( Value : TTextStyle );
  833. begin
  834.   if Value <> FTextStyle then
  835.   begin
  836.     FTextStyle := Value;
  837.     Invalidate;
  838.   end;
  839. end;
  840.  
  841.  
  842. end.
  843.  
  844.