{***************************************************************************}
{ TMS IntraWeb Component Pack Pro                                           }
{ for Delphi & C++Builder                                                   }
{                                                                           }
{ written by TMS Software                                                   }
{            copyright © 2002 - 2007                                        }
{            Email : info@tmssoftware.com                                   }
{            Web : http://www.tmssoftware.com                               }
{                                                                           }
{ The source code is given as is. The author is not responsible             }
{ for any possible damage done due to the use of this code.                 }
{ The component can be freely used in any application. The complete         }
{ source code remains property of the author and may not be distributed,    }
{ published, given or sold in any form as such. No parts of the source      }
{ code can be included in any other component or application without        }
{ written authorization of the author.                                      }
{***************************************************************************}

unit IWAdvToolButtonDE;

{$I TMSDEFS.INC}

interface

uses
  Classes, IWAdvToolButton, Forms, Graphics
{$IFNDEF LINUX}
  , IWHTMLDE, IWTMSImgDE, IWTMSImg, IWTMSBase
{$ENDIF}
{$IFDEF TMSIW72}
  , IWColor, IWDsnColor
{$ENDIF}

{$IFDEF DELPHI6_LVL}
  , DesignIntf, DesignEditors
{$ELSE}
  , DsgnIntf
{$ENDIF}
  ;


type
  TIWAdvToolButtonEditor = class(TDefaultEditor)
  protected
{$IFNDEF DELPHI6_LVL}
    procedure EditProperty(PropertyEditor: TPropertyEditor;
      var Continue, FreeEditor: Boolean); override;
{$ELSE}
    procedure EditProperty(const PropertyEditor: IProperty; var Continue: Boolean); override;
{$ENDIF}
  public
    function GetVerb(index:integer):string; override;
    function GetVerbCount:integer; override;
    procedure ExecuteVerb(Index:integer); override;

  end;

procedure Register;

implementation

uses
  SysUtils, Dialogs;

{$IFDEF DELPHI6_LVL}
procedure TIWAdvToolButtonEditor.EditProperty(const PropertyEditor: IProperty; var Continue: Boolean);
{$ELSE}
procedure TIWAdvToolButtonEditor.EditProperty(PropertyEditor: TPropertyEditor;
  var Continue, FreeEditor: Boolean);
{$ENDIF}
var
  PropName: string;
begin
  PropName := PropertyEditor.GetName;
  if (CompareText(PropName, 'ITEMS') = 0) then
  begin
    PropertyEditor.Edit;
    Continue := False;
  end;
end;


procedure TIWAdvToolButtonEditor.ExecuteVerb(Index: integer);
var
  MySelector: TTIWAdvToolButton;
begin
  MySelector := (Component as TTIWAdvToolButton);
  case Index of
  0:begin
       with MySelector do
       begin
            Font.Color := clWebBlack;
            //BorderWidth := 1;
            //BorderColor := clNone;

            BackColor := clWebLIGHTCYAN;
            BackColorTo := clWebLIGHTSTEELBLUE;
            BackColorGradientDirection := gdVertical;

            DownBorderColor := clWebSTEELBLUE;
            DownColor := clWebLIGHTSTEELBLUE;
            DownColorTo := clWebLIGHTSTEELBLUE;
            DownColorGradientDirection := gdVertical;

            HotBorderColor := clWebSTEELBLUE;
            HotColor := clWebAZURE;
            HotColorTo := clWebAZURE;
            HotColorGradientDirection := gdVertical;

      end;
    end;
  1:begin
       with MySelector do
       begin
            Font.Color := clWebBLACK;

            //BorderWidth := 1;
            //BorderColor := clNone;

            BackColor := clWebALICEBLUE;
            BackColorTo := clWebLIGHTSKYBLUE;
            BackColorGradientDirection := gdVertical;

            DownBorderColor := clWebLIGHTSTEELBLUE;
            DownColor := clWebYELLOW;
            DownColorTo := clWebORANGE;
            DownColorGradientDirection := gdVertical;

            HotBorderColor := clWebLIGHTSTEELBLUE;
            HotColor := clWebGOLD;
            HotColorTo := clWebORANGE;
            HotColorGradientDirection := gdVertical;

        end;
    end;
  2:begin
       with MySelector do
       begin
            Font.Color := clWebBLACK;

            //BorderWidth := 1;
            //BorderColor := clNone;

            BackColor :=  clBtnFace;
            BackColorTo :=  clBtnFace;
            BackColorGradientDirection := gdVertical;

            DownBorderColor := clInactiveCaption;
            DownColor := clInactiveCaptionText;
            DownColorTo := clInactiveCaptionText;
            DownColorGradientDirection := gdVertical;

            HotBorderColor := clInactiveCaption;
            HotColor := clInactiveCaptionText;
            HotColorTo := clInactiveCaptionText;
            HotColorGradientDirection := gdVertical;

        end;
    end;
  3:begin
       with MySelector do
       begin
            Font.Color := clWebBLACK;

            //BorderWidth := 1;
            //BorderColor := clNone;

            BackColor :=  clWebALICEBLUE;
            BackColorTo :=  clWebLIGHTSTEELBLUE;
            BackColorGradientDirection := gdVertical;

            DownBorderColor := clWebSTEELBLUE;
            DownColor := clWebGHOSTWHITE;
            DownColorTo := clWebWHITESMOKE;
            DownColorGradientDirection := gdVertical;

            HotBorderColor := clWebSTEELBLUE;
            HotColor := clWebGHOSTWHITE;
            HotColorTo := clWebWHITESMOKE;
            HotColorGradientDirection := gdVertical;

       end;
    end;
    4:begin
       with MySelector do
       begin
            Font.Color := clWebLIMEGREEN;

            //BorderWidth := 1;
            //BorderColor := clNone;

            BackColor :=  clWebHONEYDEW;
            BackColorTo :=  clNone;
            BackColorGradientDirection := gdVertical;

            DownBorderColor := clWebBLACK;
            DownColor := clWebGRAY;
            DownColorTo := clNone;
            DownColorGradientDirection := gdVertical;

            HotBorderColor := clWebBLACK;
            HotColor := clWebHONEYDEW;
            HotColorTo := clNone;
            HotColorGradientDirection := gdVertical;

         end;
     end;
   5:begin
       with MySelector do
       begin
            Font.Color := clWebDARKRED;

            //BorderWidth := 1;
            //BorderColor := clNone;

            BackColor :=  clWebGOLD;
            BackColorTo :=  clWebSANDYBROWN;
            BackColorGradientDirection := gdVertical;

            DownBorderColor := clWebINDIANRED;
            DownColor := clWebSEASHELL;
            DownColorTo := clWebLIGHTSALMON;
            DownColorGradientDirection := gdVertical;

            HotBorderColor := clWebINDIANRED;
            HotColor := clWebSANDYBROWN;
            HotColorTo := clWebTAN;
            HotColorGradientDirection := gdVertical;

       end;
    end;
    6:begin
       with MySelector do
       begin
            Font.Color := clWebWHITE;

            //BorderWidth := 1;
            //BorderColor := clNone;

            BackColor :=  clWebROYALBLUE;
            BackColorTo :=  clWebMIDNIGHTBLUE;
            BackColorGradientDirection := gdVertical;

            DownBorderColor := clWebWHITE;
            DownColor := clWebBLACK;
            DownColorTo := clNone;
            DownColorGradientDirection := gdVertical;

            HotBorderColor := clWebWHITE;
            HotColor := clWebMEDIUMBLUE;
            HotColorTo := clWebBLACK;
            HotColorGradientDirection := gdVertical;

       end;
    end;
    7:begin
       with MySelector do
       begin
            Font.Color := clWebSLATEGRAY;

            //BorderWidth := 1;
            //BorderColor := clNone;

            BackColor :=  clInactiveCaptionText;
            BackColorTo :=  clWebWHITE;
            BackColorGradientDirection := gdVertical;

            DownBorderColor := clWebGRAY;
            DownColor := clWebWHITESMOKE;
            DownColorTo := clWebWHITE;
            DownColorGradientDirection := gdVertical;

            HotBorderColor := clWebSLATEGRAY;
            HotColor := clInactiveCaptionText;
            HotColorTo := clWebWHITE;
            HotColorGradientDirection := gdVertical;

       end;
    end;
  end;
  Designer.Modified;
end;

function TIWAdvToolButtonEditor.GetVerb(index: integer): string;
begin
  case index of
  0:Result := 'Standard style';
  1:Result := 'Office 2003 style';
  2:Result := 'XP style';
  3:Result := 'Hotmail style';
  4:Result := 'Terminal Green';
  5:Result := 'Endless Summer';
  6:Result := 'Deep Space';
  7:Result := 'Arctic';

  end;
end;

function TIWAdvToolButtonEditor.GetVerbCount: integer;
begin
  Result := 8;
end;


procedure Register;
begin
  RegisterComponentEditor(TTIWAdvToolButton,TIWAdvToolButtonEditor);
end;

end.
