Sfoglia il codice sorgente

Removing unused code and useless Delphi-version conditionals

Source commit: bf30a081cf28d3ef11bb8e3371d22e48f9b10351
Martin Prikryl 8 anni fa
parent
commit
b7576cab41

+ 1 - 1
source/packages/tb2k/TB2Acc.pas

@@ -151,7 +151,7 @@ var
 implementation
 
 uses
-  {$IFDEF JR_D6} Variants, {$ENDIF} ActiveX, Menus, TB2Common, Winapi.oleacc, Types;
+  Variants, ActiveX, Menus, TB2Common, Winapi.oleacc, Types;
 
 const
   { Constants from OleAcc.h }

+ 0 - 34
source/packages/tb2k/TB2Common.pas

@@ -55,9 +55,6 @@ procedure DrawInvertRect(const DC: HDC; const NewRect, OldRect: PRect;
   const NewSize, OldSize: TSize; const Brush: HBRUSH; BrushLast: HBRUSH);
 function EscapeAmpersands(const S: String): String;
 function FindAccelChar(const S: String): Char;
-{$IFNDEF JR_D5}
-procedure FreeAndNil(var Obj);
-{$ENDIF}
 function GetInputLocaleCodePage: UINT;
 function GetMenuShowDelay: Integer;
 function GetRectOfMonitorContainingPoint(const P: TPoint; const WorkArea: Boolean): TRect;
@@ -102,26 +99,6 @@ begin
   Result := GetActiveWindow <> 0;
 end;
 
-{$IFNDEF JR_D3}
-function CopyPalette(Palette: HPALETTE): HPALETTE;
-var
-  PaletteSize: Integer;
-  LogPal: TMaxLogPalette;
-begin
-  Result := 0;
-  if Palette = 0 then Exit;
-  PaletteSize := 0;
-  if GetObject(Palette, SizeOf(PaletteSize), @PaletteSize) = 0 then Exit;
-  if PaletteSize = 0 then Exit;
-  with LogPal do begin
-    palVersion := $0300;
-    palNumEntries := PaletteSize;
-    GetPaletteEntries(Palette, 0, PaletteSize, palPalEntry);
-  end;
-  Result := CreatePalette(PLogPalette(@LogPal)^);
-end;
-{$ENDIF}
-
 procedure ListSortEx(const List: TList; const Compare: TListSortExCompare;
   const ExtraData: Pointer);
 { Similar to TList.Sort, but lets you pass a user-defined ExtraData pointer }
@@ -794,17 +771,6 @@ begin
   Result := TrackMouseEvent(Track);
 end;
 
-{$IFNDEF JR_D5}
-procedure FreeAndNil(var Obj);
-var
-  P: TObject;
-begin
-  P := TObject(Obj);
-  TObject(Obj) := nil;
-  P.Free;
-end;
-{$ENDIF}
-
 function EnumFontsProc(const lplf: TLogFont; const lptm: TTextMetric;
   dwType: DWORD; lpData: LPARAM): Integer; stdcall;
 begin

+ 26 - 109
source/packages/tb2k/TB2Dock.pas

@@ -40,8 +40,6 @@ uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms;
 
 type
-  TTBCustomForm = {$IFDEF JR_D3} TCustomForm {$ELSE} TForm {$ENDIF};
-
   { TTBDock }
 
   TTBDockBoundLinesValues = (blTop, blBottom, blLeft, blRight);
@@ -75,9 +73,6 @@ type
     FLimitToOneRow: Boolean;
     FOnInsertRemoveBar: TTBInsertRemoveEvent;
     FOnRequestDock: TTBRequestDockEvent;
-    {$IFNDEF JR_D4}
-    FOnResize: TNotifyEvent;
-    {$ENDIF}
 
     { Internal }
     FDisableArrangeToolbars: Integer;  { Increment to disable ArrangeToolbars }
@@ -120,9 +115,6 @@ type
     {$ENDIF}
     procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
     procedure WMMove(var Message: TWMMove); message WM_MOVE;
-    {$IFNDEF JR_D4}
-    procedure WMSize(var Message: TWMSize); message WM_SIZE;
-    {$ENDIF}
     procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
     procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT;
     procedure WMPrint(var Message: TMessage); message WM_PRINT;
@@ -179,22 +171,15 @@ type
     property LimitToOneRow: Boolean read FLimitToOneRow write FLimitToOneRow default False;
     property PopupMenu;
     property Position: TTBDockPosition read FPosition write SetPosition default dpTop;
-    //property Version: TToolbar97Version read GetVersion write SetVersion stored False;
     property Visible;
 
-    {$IFDEF JR_D5}
     property OnContextPopup;
-    {$ENDIF}
     property OnInsertRemoveBar: TTBInsertRemoveEvent read FOnInsertRemoveBar write FOnInsertRemoveBar;
     property OnMouseDown;
     property OnMouseMove;
     property OnMouseUp;
     property OnRequestDock: TTBRequestDockEvent read FOnRequestDock write FOnRequestDock;
-    {$IFDEF JR_D4}
     property OnResize;
-    {$ELSE}
-    property OnResize: TNotifyEvent read FOnResize write FOnResize;
-    {$ENDIF}
   end;
 
   { TTBFloatingWindowParent - internal }
@@ -207,7 +192,7 @@ type
   private
     FCloseButtonDown: Boolean; { True if Close button is currently depressed }
     FDockableWindow: TTBCustomDockableWindow;
-    FParentForm: TTBCustomForm;
+    FParentForm: TCustomForm;
     FShouldShow: Boolean;
 
     procedure SetCloseButtonState(Pushed: Boolean);
@@ -237,7 +222,7 @@ type
     property DockableWindow: TTBCustomDockableWindow read FDockableWindow;
     property CloseButtonDown: Boolean read FCloseButtonDown;
   public
-    property ParentForm: TTBCustomForm read FParentForm;
+    property ParentForm: TCustomForm read FParentForm;
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
   end;
@@ -284,7 +269,7 @@ type
     FCurrentSize: Integer;
     FFloating: Boolean;
     FOnClose, FOnDockChanged, FOnMove, FOnRecreated,
-      FOnRecreating, {$IFNDEF JR_D4} FOnResize, {$ENDIF}
+      FOnRecreating,
       FOnVisibleChanged: TNotifyEvent;
     FOnCloseQuery: TCloseQueryEvent;
     FOnDockChanging, FOnDockChangingHidden: TTBDockChangingEvent;
@@ -370,9 +355,7 @@ type
     procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
     procedure CMShowingChanged(var Message: TMessage); message CM_SHOWINGCHANGED;
     procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED;
-    {$IFDEF JR_D5}
     procedure WMContextMenu(var Message: TWMContextMenu); message WM_CONTEXTMENU;
-    {$ENDIF}
     procedure WMEnable(var Message: TWMEnable); message WM_ENABLE;
     procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
     procedure WMMove(var Message: TWMMove); message WM_MOVE;
@@ -388,9 +371,6 @@ type
     procedure WMPrint(var Message: TMessage); message WM_PRINT;
     procedure WMPrintClient(var Message: TMessage); message WM_PRINTCLIENT;
     procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
-    {$IFNDEF JR_D4}
-    procedure WMSize(var Message: TWMSize); message WM_SIZE;
-    {$ENDIF}
   protected
     property ActivateParent: Boolean read FActivateParent write FActivateParent default True;
     property AutoResize: Boolean read FAutoResize write SetAutoResize default True;
@@ -414,7 +394,6 @@ type
     property SmoothDrag: Boolean read FSmoothDrag write FSmoothDrag default True;
     property Stretch: Boolean read FStretch write SetStretch default False;
     property UseLastDock: Boolean read FUseLastDock write SetUseLastDock default True;
-    //property Version: TToolbar97Version read GetVersion write SetVersion stored False;
 
     property OnClose: TNotifyEvent read FOnClose write FOnClose;
     property OnCloseQuery: TCloseQueryEvent read FOnCloseQuery write FOnCloseQuery;
@@ -424,9 +403,6 @@ type
     property OnMove: TNotifyEvent read FOnMove write FOnMove;
     property OnRecreated: TNotifyEvent read FOnRecreated write FOnRecreated;
     property OnRecreating: TNotifyEvent read FOnRecreating write FOnRecreating;
-    {$IFNDEF JR_D4}
-    property OnResize: TNotifyEvent read FOnResize write FOnResize;
-    {$ENDIF}
     property OnVisibleChanged: TNotifyEvent read FOnVisibleChanged write FOnVisibleChanged;
 
     { Overridden methods }
@@ -493,7 +469,7 @@ type
     function HasParent: Boolean; override;
     procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
 
-    procedure AddDockForm(const Form: TTBCustomForm);
+    procedure AddDockForm(const Form: TCustomForm);
     procedure AddDockedNCAreaToSize(var S: TPoint; const LeftRight: Boolean);
     procedure AddFloatingNCAreaToSize(var S: TPoint);
     procedure BeginMoving(const InitX, InitY: Integer);
@@ -508,7 +484,7 @@ type
     function IsMovable: Boolean;
     procedure MoveOnScreen(const OnlyIfFullyOffscreen: Boolean);
     procedure ReadPositionData(const Data: TTBReadPositionData); dynamic;
-    procedure RemoveDockForm(const Form: TTBCustomForm);
+    procedure RemoveDockForm(const Form: TCustomForm);
     procedure WritePositionData(const Data: TTBWritePositionData); dynamic;
   published
     property Height stored IsWidthAndHeightStored;
@@ -571,9 +547,9 @@ procedure TBCustomSavePositions(const OwnerComponent: TComponent;
 
 function TBGetDockTypeOf(const Control: TTBDock; const Floating: Boolean): TTBDockType;
 function TBGetToolWindowParentForm(const ToolWindow: TTBCustomDockableWindow):
-  TTBCustomForm;
+  TCustomForm;
 function TBValidToolWindowParentForm(const ToolWindow: TTBCustomDockableWindow):
-  TTBCustomForm;
+  TCustomForm;
 
 implementation
 
@@ -631,7 +607,7 @@ begin
   Result := GetSystemMetricsForControl(Control, SM_CYSMCAPTION);
 end;
 
-function GetMDIParent(const Form: TTBCustomForm): TTBCustomForm;
+function GetMDIParent(const Form: TCustomForm): TCustomForm;
 { Returns the parent of the specified MDI child form. But, if Form isn't a
   MDI child, it simply returns Form. }
 var
@@ -639,7 +615,7 @@ var
 begin
   Result := Form;
   if Form = nil then Exit;
-  if {$IFDEF JR_D3} (Form is TForm) and {$ENDIF}
+  if (Form is TForm) and
      (TForm(Form).FormStyle = fsMDIChild) then
     for I := 0 to Screen.FormCount-1 do
       with Screen.Forms[I] do begin
@@ -667,15 +643,15 @@ begin
   end;
 end;
 
-function TBGetToolWindowParentForm(const ToolWindow: TTBCustomDockableWindow): TTBCustomForm;
+function TBGetToolWindowParentForm(const ToolWindow: TTBCustomDockableWindow): TCustomForm;
 var
   Ctl: TWinControl;
 begin
   Result := nil;
   Ctl := ToolWindow;
   while Assigned(Ctl.Parent) do begin
-    if Ctl.Parent is TTBCustomForm then
-      Result := TTBCustomForm(Ctl.Parent);
+    if Ctl.Parent is TCustomForm then
+      Result := TCustomForm(Ctl.Parent);
     Ctl := Ctl.Parent;
   end;
   { ^ for compatibility with ActiveX controls, that code is used instead of
@@ -685,19 +661,18 @@ begin
     Result := TTBFloatingWindowParent(Result).ParentForm;
 end;
 
-function TBValidToolWindowParentForm(const ToolWindow: TTBCustomDockableWindow): TTBCustomForm;
+function TBValidToolWindowParentForm(const ToolWindow: TTBCustomDockableWindow): TCustomForm;
 begin
   Result := TBGetToolWindowParentForm(ToolWindow);
   if Result = nil then
-    raise EInvalidOperation.{$IFDEF JR_D3}CreateFmt{$ELSE}CreateResFmt{$ENDIF}
-      (SParentRequired, [ToolWindow.Name]);
+    raise EInvalidOperation.CreateFmt(SParentRequired, [ToolWindow.Name]);
 end;
 
 procedure ToolbarHookProc(Code: THookProcCode; Wnd: HWND; WParam: WPARAM; LParam: LPARAM);
 var
   I: Integer;
   ToolWindow: TTBCustomDockableWindow;
-  Form: TTBCustomForm;
+  Form: TCustomForm;
 begin
   case Code of
     hpSendActivate,
@@ -1776,15 +1751,6 @@ begin
     InvalidateBackgrounds;
 end;
 
-{$IFNDEF JR_D4}
-procedure TTBDock.WMSize(var Message: TWMSize);
-begin
-  inherited;
-  if not(csLoading in ComponentState) and Assigned(FOnResize) then
-    FOnResize(Self);
-end;
-{$ENDIF}
-
 procedure TTBDock.WMNCCalcSize(var Message: TWMNCCalcSize);
 begin
   inherited;
@@ -2339,7 +2305,7 @@ end;
 
 procedure TTBFloatingWindowParent.WMClose(var Message: TWMClose);
 var
-  MDIParentForm: TTBCustomForm;
+  MDIParentForm: TCustomForm;
 begin
   { A floating toolbar does not use WM_CLOSE messages when its close button
     is clicked, but Windows still sends a WM_CLOSE message if the user
@@ -2355,7 +2321,7 @@ end;
 
 procedure TTBFloatingWindowParent.WMActivate(var Message: TWMActivate);
 var
-  ParentForm: TTBCustomForm;
+  ParentForm: TCustomForm;
 begin
   if csDesigning in ComponentState then begin
     inherited;
@@ -2394,7 +2360,7 @@ end;
 
 procedure TTBFloatingWindowParent.WMMouseActivate(var Message: TWMMouseActivate);
 var
-  ParentForm, MDIParentForm: TTBCustomForm;
+  ParentForm, MDIParentForm: TCustomForm;
 begin
   if csDesigning in ComponentState then begin
     inherited;
@@ -2679,15 +2645,6 @@ begin
   Moved;
 end;
 
-{$IFNDEF JR_D4}
-procedure TTBCustomDockableWindow.WMSize(var Message: TWMSize);
-begin
-  inherited;
-  if not(csLoading in ComponentState) and Assigned(FOnResize) then
-    FOnResize(Self);
-end;
-{$ENDIF}
-
 procedure TTBCustomDockableWindow.WMEnable(var Message: TWMEnable);
 begin
   inherited;
@@ -2784,7 +2741,7 @@ function TTBCustomDockableWindow.GetShowingState: Boolean;
 
 var
   HideFloatingToolbars: Boolean;
-  ParentForm: TTBCustomForm;
+  ParentForm: TCustomForm;
 begin
   Result := Showing and (FHidden = 0);
   if Floating and not(csDesigning in ComponentState) then begin
@@ -2887,7 +2844,7 @@ const
     SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_NOACTIVATE or SWP_SHOWWINDOW);
 var
   Show: Boolean;
-  Form: TTBCustomForm;
+  Form: TCustomForm;
 begin
   { inherited isn't called since TTBCustomDockableWindow handles CM_SHOWINGCHANGED
     itself. For reference, the original TWinControl implementation is:
@@ -3076,14 +3033,14 @@ begin
     Arrange;
 end;
 
-procedure TTBCustomDockableWindow.AddDockForm(const Form: TTBCustomForm);
+procedure TTBCustomDockableWindow.AddDockForm(const Form: TCustomForm);
 begin
   if Form = nil then Exit;
   if AddToList(FDockForms, Form) then
     Form.FreeNotification(Self);
 end;
 
-procedure TTBCustomDockableWindow.RemoveDockForm(const Form: TTBCustomForm);
+procedure TTBCustomDockableWindow.RemoveDockForm(const Form: TCustomForm);
 begin
   RemoveFromList(FDockForms, Form);
 end;
@@ -4086,7 +4043,7 @@ var
     end;
 
   var
-    ParentForm: TTBCustomForm;
+    ParentForm: TCustomForm;
     DockFormsList: TList;
     I, J: Integer;
   begin
@@ -4098,8 +4055,8 @@ var
     DockFormsList := TList.Create;
     try
       if Assigned(FDockForms) then begin
-        for I := 0 to Screen.{$IFDEF JR_D3}CustomFormCount{$ELSE}FormCount{$ENDIF}-1 do begin
-          J := FDockForms.IndexOf(Screen.{$IFDEF JR_D3}CustomForms{$ELSE}Forms{$ENDIF}[I]);
+        for I := 0 to Screen.CustomFormCount-1 do begin
+          J := FDockForms.IndexOf(Screen.CustomForms[I]);
           if (J <> -1) and (FDockForms[J] <> ParentForm) then
             DockFormsList.Add(FDockForms[J]);
         end;
@@ -4563,47 +4520,9 @@ begin
 end;
 
 procedure TTBCustomDockableWindow.ShowNCContextMenu(const Pos: TSmallPoint);
-
-  {$IFNDEF JR_D5}
-  { Note: this is identical to TControl.CheckMenuPopup (from Delphi 4),
-    except where noted.
-    TControl.CheckMenuPopup is unfortunately 'private', so it can't be called
-    outside of the Controls unit. }
-  procedure CheckMenuPopup;
-  var
-    Control: TControl;
-    PopupMenu: TPopupMenu;
-  begin
-    if csDesigning in ComponentState then Exit;
-    Control := Self;
-    while Control <> nil do
-    begin
-      { Added TControlAccess cast because GetPopupMenu is 'protected' }
-      PopupMenu := TControlAccess(Control).GetPopupMenu;
-      if (PopupMenu <> nil) then
-      begin
-        if not PopupMenu.AutoPopup then Exit;
-        SendCancelMode(nil);
-        PopupMenu.PopupComponent := Control;
-        { Changed the following. LPARAM of WM_NCRBUTTONUP is in screen
-          coordinates, not client coordinates }
-        {with ClientToScreen(SmallPointToPoint(Pos)) do
-          PopupMenu.Popup(X, Y);}
-        PopupMenu.Popup(Pos.X, Pos.Y);
-        Exit;
-      end;
-      Control := Control.Parent;
-    end;
-  end;
-  {$ENDIF}
-
 begin
-  {$IFDEF JR_D5}
   { Delphi 5 and later use the WM_CONTEXTMENU message for popup menus }
   SendMessage(Handle, WM_CONTEXTMENU, 0, LPARAM(Pos));
-  {$ELSE}
-  CheckMenuPopup;
-  {$ENDIF}
 end;
 
 procedure TTBCustomDockableWindow.WMNCRButtonUp(var Message: TWMNCRButtonUp);
@@ -4611,7 +4530,6 @@ begin
   ShowNCContextMenu(TSmallPoint(TMessage(Message).LParam));
 end;
 
-{$IFDEF JR_D5}
 procedure TTBCustomDockableWindow.WMContextMenu(var Message: TWMContextMenu);
 { Unfortunately TControl.WMContextMenu ignores clicks in the non-client area.
   On docked toolbars, we need right clicks on the border, part of the
@@ -4664,7 +4582,6 @@ begin
   if Message.Result = 0 then
     inherited;
 end;
-{$ENDIF}
 
 procedure TTBCustomDockableWindow.GetMinShrinkSize(var AMinimumSize: Integer);
 begin
@@ -5016,7 +4933,7 @@ end;
 
 procedure TTBCustomDockableWindow.SetFloating(Value: Boolean);
 var
-  ParentFrm: TTBCustomForm;
+  ParentFrm: TCustomForm;
   NewFloatParent: TTBFloatingWindowParent;
 begin
   if FFloating <> Value then begin

+ 0 - 6
source/packages/tb2k/TB2DsgnConverter.pas

@@ -86,9 +86,7 @@ var
         else
           Dst := TTBSubmenuItem.Create(Owner);
         Dst.Action := Src.Action;
-        {$IFDEF JR_D6}
         Dst.AutoCheck := Src.AutoCheck;
-        {$ENDIF}
         Dst.Caption := Src.Caption;
         Dst.Checked := Src.Checked;
         if Src.Default then
@@ -99,9 +97,7 @@ var
         Dst.ImageIndex := Src.ImageIndex;
         Dst.RadioItem := Src.RadioItem;
         Dst.ShortCut := Src.ShortCut;
-        {$IFDEF JR_D5}
         Dst.SubMenuImages := Src.SubMenuImages;
-        {$ENDIF}
         Dst.OnClick := Src.OnClick;
       end
       else begin
@@ -123,10 +119,8 @@ var
           Src.OnClick := Dst.OnClick;
       end;
       TBItem.Add(Dst);
-      {$IFDEF JR_D5}
       if @Src.OnAdvancedDrawItem <> nil then
         Log(Format(SPropNotTransferred, ['OnAdvancedDrawItem', Dst.Name]));
-      {$ENDIF}
       if @Src.OnDrawItem <> nil then
         Log(Format(SPropNotTransferred, ['OnDrawItem', Dst.Name]));
       if @Src.OnMeasureItem <> nil then

+ 12 - 82
source/packages/tb2k/TB2DsgnItemEditor.pas

@@ -34,11 +34,7 @@ uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
   StdCtrls, ExtCtrls, Buttons, ComCtrls, ImgList, Menus,
   TB2Item, TB2Toolbar, TB2Dock,
-  {$IFDEF JR_D6}
-    DesignWindows, DesignEditors, DesignIntf;
-  {$ELSE}
-    DsgnIntf, DsgnWnds, LibIntf;
-  {$ENDIF}
+  DesignWindows, DesignEditors, DesignIntf;
 
 type
   TTBItemEditForm = class(TDesignWindow)
@@ -126,11 +122,7 @@ type
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
-    {$IFDEF JR_D6}
     function EditAction(Action: TEditAction): Boolean; override;
-    {$ELSE}
-    procedure EditAction(Action: TEditAction); override;
-    {$ENDIF}
     function GetEditState: TEditState; override;
   end;
 
@@ -166,14 +158,9 @@ uses
   TypInfo, CommCtrl, TB2Version, TB2Common, TB2DsgnConverter;
 
 type
-  {}TTBCustomItemAccess = class(TTBCustomItem);
-  {}TControlAccess = class(TControl);
-{$IFNDEF JR_D5}
-  TDesignerSelectionList = TComponentList;
-{$ENDIF}
-{$IFDEF JR_D6}
+  TTBCustomItemAccess = class(TTBCustomItem);
+  TControlAccess = class(TControl);
   TDesignerSelectionList = IDesignerSelections;
-{$ENDIF}
 
   PItemClassInfo = ^TItemClassInfo;
   TItemClassInfo = record
@@ -187,13 +174,6 @@ var
   ItemImageList: TImageList;
   EditFormHooks: TList;
 
-{$IFNDEF JR_D6}
-function CreateSelectionList: TDesignerSelectionList;
-begin
-  Result := TDesignerSelectionList.Create;
-end;
-{$ENDIF}
-
 procedure FreeItemClasses;
 var
   I: Integer;
@@ -288,7 +268,7 @@ begin
 end;
 
 procedure ShowEditForm(AParentComponent: TComponent; ARootItem: TTBCustomItem;
-  const ADesigner: {$IFDEF JR_D6} IDesigner {$ELSE} IFormDesigner {$ENDIF});
+  const ADesigner: IDesigner);
 var
   I: Integer;
   Form: TCustomForm;
@@ -326,9 +306,7 @@ begin
     EditForm.Caption := 'Editing ' + AParentComponent.Name;
     EditForm.RebuildTree;
     EditForm.RebuildList;
-    {$IFDEF JR_D9}
     EditForm.PopupMode := pmExplicit;
-    {$ENDIF}
     EditForm.Show;
   except
     EditForm.Free;
@@ -440,24 +418,16 @@ begin
   end;
 end;
 
-{$IFDEF JR_D6}
 function TTBItemEditForm.EditAction(Action: TEditAction): Boolean;
-{$ELSE}
-procedure TTBItemEditForm.EditAction(Action: TEditAction);
-{$ENDIF}
 begin
-  {$IFDEF JR_D6}
   Result := True;
-  {$ENDIF}
   case Action of
     eaCut: Cut;
     eaCopy: Copy;
     eaPaste: Paste;
     eaDelete: Delete;
-  {$IFDEF JR_D6}
   else
     Result := False;
-  {$ENDIF}
   end;
 end;
 
@@ -667,31 +637,9 @@ begin
       CompList2.Add(C);
     end;
   end;
-  if CompList1.Count = 0 then begin
-    {$IFNDEF JR_D6}
-    CompList1.Free;
-    CompList2.Free;
-    {$ENDIF}
-  end
-  else begin
+  if CompList1.Count <> 0 then
+  begin
     Designer.SetSelections(CompList1);
-    { Note: Never pass an empty list to SetSelection or Delphi will crash }
-    { History here:
-      - 1.34: SetSelection call remarked out because it fixed Delphi 6 issue
-        with random AV's after the editor was closed.
-      - 1.38: SetSelection call restored because without it, Ctrl+X/C/V didn't
-        work.
-      - 1.40: SetSelection call disabled on Delphi 6 only because AV problem
-        still seems to exist despite another change which I thought fixed it.
-        On D6 it isn't necessary to call SetSelection for Ctrl+X/C/V to work.
-        Note: Using "ComponentDesigner.SetSelection(Designer, nil, CompList2);"
-        instead seems to fix the AV problem, but for consistency with Delphi's
-        TMainMenu editor (which only selects items when its parent form is
-        focused), I decided not to call SetSelection at all on D6.
-    }
-    {$IFNDEF JR_D6}
-    SetSelection(CompList2);
-    {$ENDIF}
   end;
 end;
 
@@ -809,9 +757,6 @@ begin
     end;
     CopyComponents(FParentComponent.Owner, CompList);
   finally
-    {$IFNDEF JR_D6}
-    CompList.Free;
-    {$ENDIF}
     SelList.Free;
   end;
 end;
@@ -822,22 +767,15 @@ var
 begin
   if FSelParentItem = nil then Exit;
   CompList := CreateSelectionList;
-  try
-    PasteComponents(FParentComponent.Owner, FSelParentItem, CompList);
-    if CompList.Count <> 0 then
-      Designer.Modified;
-  finally
-    {$IFNDEF JR_D6}
-    CompList.Free;
-    {$ENDIF}
-  end;
+  PasteComponents(FParentComponent.Owner, FSelParentItem, CompList);
+  if CompList.Count <> 0 then
+    Designer.Modified;
 end;
 
 procedure TTBItemEditForm.DeleteItem(const Item: TTBCustomItem);
 begin
   if csAncestor in Item.ComponentState then
     raise EInvalidOperation.Create('Items introduced in an ancestor form cannot be deleted');
-  //Designer.ValidateRename(Item, Item.Name, '');
   Item.Free;
   Designer.Modified;
 end;
@@ -950,9 +888,7 @@ begin
         if MethodName = '' then begin
           MethodName := SelItem.Name + 'Click';
           Method := Designer.CreateMethod(MethodName, GetTypeData(PropInfo.PropType^));
-          SetMethodProp(SelItem,
-            {$IFDEF JR_D5} {MP}string(PropInfo.Name) {$ELSE} PropInfo {$ENDIF},
-            Method);
+          SetMethodProp(SelItem, string(PropInfo.Name), Method);
           Designer.Modified;
         end;
         if Designer.MethodExists(MethodName) then
@@ -1335,17 +1271,11 @@ end;
 
 procedure TTBItemsPropertyEditor.Edit;
 var
-  Editor: {$IFDEF JR_D6} IComponentEditor {$ELSE} TComponentEditor {$ENDIF};
+  Editor: IComponentEditor;
 begin
   if PropCount <> 1 then Exit;
   Editor := GetComponentEditor(GetComponent(0) as TComponent, Designer);
-  try
-    Editor.Edit;
-  finally
-    {$IFNDEF JR_D6}
-    Editor.Free;
-    {$ENDIF}
-  end;
+  Editor.Edit;
 end;
 
 function TTBItemsPropertyEditor.GetAttributes: TPropertyAttributes;

+ 6 - 43
source/packages/tb2k/TB2Item.pas

@@ -105,9 +105,6 @@ type
   private
     FLastWidth, FLastHeight: Integer;
   end;
-  {$IFNDEF JR_D5}
-  TImageIndex = type Integer;
-  {$ENDIF}
   TTBPopupPositionRec = record
     PositionAsSubmenu: Boolean;
     Alignment: TTBPopupAlignment;
@@ -170,9 +167,7 @@ type
     procedure ImageListChangeHandler(Sender: TObject);
     procedure InternalNotify(Ancestor: TTBCustomItem; NestingLevel: Integer;
       Action: TTBItemChangedAction; Index: Integer; Item: TTBCustomItem);
-    {$IFDEF JR_D6}
     function IsAutoCheckStored: Boolean;
-    {$ENDIF}
     function IsCaptionStored: Boolean;
     function IsCheckedStored: Boolean;
     function IsEnabledStored: Boolean;
@@ -260,7 +255,7 @@ type
     procedure ChangeScale(M, D: Integer); virtual;
 
     property Action: TBasicAction read GetAction write SetAction;
-    property AutoCheck: Boolean read FAutoCheck write FAutoCheck {$IFDEF JR_D6} stored IsAutoCheckStored {$ENDIF} default False;
+    property AutoCheck: Boolean read FAutoCheck write FAutoCheck stored IsAutoCheckStored default False;
     property Caption: String read FCaption write SetCaption stored IsCaptionStored;
     property Count: Integer read FItemCount;
     property Checked: Boolean read FChecked write SetChecked stored IsCheckedStored default False;
@@ -294,9 +289,7 @@ type
   protected
     FClient: TTBCustomItem;
     procedure AssignClient(AClient: TObject); override;
-    {$IFDEF JR_D6}
     function IsAutoCheckLinked: Boolean; virtual;
-    {$ENDIF}
     function IsCaptionLinked: Boolean; override;
     function IsCheckedLinked: Boolean; override;
     function IsEnabledLinked: Boolean; override;
@@ -308,9 +301,7 @@ type
     function IsShortCutLinked: Boolean; override;
     function IsVisibleLinked: Boolean; override;
     function IsOnExecuteLinked: Boolean; override;
-    {$IFDEF JR_D6}
     procedure SetAutoCheck(Value: Boolean); override;
-    {$ENDIF}
     procedure SetCaption(const Value: String); override;
     procedure SetChecked(Value: Boolean); override;
     procedure SetEnabled(Value: Boolean); override;
@@ -771,9 +762,6 @@ type
     procedure SetLinkSubitems(Value: TTBCustomItem);
     procedure SetOptions(Value: TTBItemOptions);
   protected
-    {$IFNDEF JR_D5}
-    procedure DoPopup(Sender: TObject);
-    {$ENDIF}
     function GetRootItemClass: TTBRootItemClass; dynamic;
     procedure SetChildOrder(Child: TComponent; Order: Integer); override;
   public
@@ -924,7 +912,7 @@ const
 procedure DestroyClickWnd;
 begin
   if ClickWnd <> 0 then begin
-    {$IFDEF JR_D6}Classes.{$ENDIF} DeallocateHWnd(ClickWnd);
+    Classes.DeallocateHWnd(ClickWnd);
     ClickWnd := 0;
   end;
   FreeAndNil(ClickList);
@@ -949,7 +937,7 @@ var
   I: Integer;
 begin
   if ClickWnd = 0 then
-    ClickWnd := {$IFDEF JR_D6}Classes.{$ENDIF} AllocateHWnd(TTBCustomItem.ClickWndProc);
+    ClickWnd := Classes.AllocateHWnd(TTBCustomItem.ClickWndProc);
   if ClickList = nil then
     ClickList := TList.Create;
 
@@ -1070,12 +1058,10 @@ begin
   FClient := AClient as TTBCustomItem;
 end;
 
-{$IFDEF JR_D6}
 function TTBCustomItemActionLink.IsAutoCheckLinked: Boolean;
 begin
   Result := (FClient.AutoCheck = (Action as TCustomAction).AutoCheck);
 end;
-{$ENDIF}
 
 function TTBCustomItemActionLink.IsCaptionLinked: Boolean;
 begin
@@ -1141,12 +1127,10 @@ begin
     MethodsEqual(TMethod(FClient.OnClick), TMethod(Action.OnExecute));
 end;
 
-{$IFDEF JR_D6}
 procedure TTBCustomItemActionLink.SetAutoCheck(Value: Boolean);
 begin
   if IsAutoCheckLinked then FClient.AutoCheck := Value;
 end;
-{$ENDIF}
 
 procedure TTBCustomItemActionLink.SetCaption(const Value: string);
 begin
@@ -1249,12 +1233,10 @@ begin
   ReleaseClickWnd;
 end;
 
-{$IFDEF JR_D6}
 function TTBCustomItem.IsAutoCheckStored: Boolean;
 begin
   Result := (ActionLink = nil) or not FActionLink.IsAutoCheckLinked;
 end;
-{$ENDIF}
 
 function TTBCustomItem.IsCaptionStored: Boolean;
 begin
@@ -1325,10 +1307,8 @@ begin
   if Action is TCustomAction then
     with TCustomAction(Sender) do
     begin
-      {$IFDEF JR_D6}
       if not CheckDefaults or (Self.AutoCheck = False) then
         Self.AutoCheck := AutoCheck;
-      {$ENDIF}
       if not CheckDefaults or (Self.Caption = '') then
         Self.Caption := Caption;
       if not CheckDefaults or (Self.Checked = False) then
@@ -1529,12 +1509,8 @@ procedure TTBCustomItem.Click;
 begin
   if Enabled then begin
     { Following code based on D6's TMenuItem.Click }
-    {$IFDEF JR_D6}
     if (not Assigned(ActionLink) and AutoCheck) or
        (Assigned(ActionLink) and not ActionLink.IsAutoCheckLinked and AutoCheck) then
-    {$ELSE}
-    if AutoCheck then
-    {$ENDIF}
       Checked := not Checked;
     { Following code based on D4's TControl.Click }
     { Call OnClick if assigned and not equal to associated action's OnExecute.
@@ -1545,7 +1521,7 @@ begin
       FOnClick(Self)
     else
     if not(csDesigning in ComponentState) and (ActionLink <> nil) then
-      ActionLink.Execute {$IFDEF JR_D6}(Self){$ENDIF}
+      ActionLink.Execute(Self)
     else
     if Assigned(FOnClick) then
       FOnClick(Self);
@@ -5923,7 +5899,7 @@ begin
   if AExistingWnd <> 0 then
     FWnd := AExistingWnd
   else begin
-    FWnd := {$IFDEF JR_D6}Classes.{$ENDIF} AllocateHWnd(WndProc);
+    FWnd := Classes.AllocateHWnd(WndProc);
     FCreatedWnd := True;
   end;
   { Like standard menus, don't allow other apps to steal the focus during
@@ -5968,7 +5944,7 @@ begin
     if FInited then
       NotifyWinEvent(EVENT_SYSTEM_MENUEND, FWnd, OBJID_CLIENT, CHILDID_SELF);
     if FCreatedWnd then
-      {$IFDEF JR_D6}Classes.{$ENDIF} DeallocateHWnd(FWnd);
+      Classes.DeallocateHWnd(FWnd);
   end;
   inherited;
 end;
@@ -6866,13 +6842,6 @@ begin
   DoPopup(Sender);
 end;
 
-{$IFNDEF JR_D5}
-procedure TTBPopupMenu.DoPopup(Sender: TObject);
-begin
-  if Assigned(OnPopup) then OnPopup(Sender);
-end;
-{$ENDIF}
-
 procedure TTBPopupMenu.Popup(X, Y: Integer);
 begin
   PopupEx(X, Y, False);
@@ -6881,13 +6850,7 @@ end;
 function TTBPopupMenu.PopupEx(X, Y: Integer;
   ReturnClickedItemOnly: Boolean = False): TTBCustomItem;
 begin
-  {$IFDEF JR_D5}
-  {$IFDEF JR_D9}
   SetPopupPoint(Point(X, Y));
-  {$ELSE}
-  PPoint(@PopupPoint)^ := Point(X, Y);
-  {$ENDIF}
-  {$ENDIF}
   Result := FItem.Popup(X, Y, TrackButton = tbRightButton,
     TTBPopupAlignment(Alignment), ReturnClickedItemOnly);
 end;

+ 5 - 20
source/packages/tb2k/TB2Reg.pas

@@ -32,20 +32,17 @@ interface
 
 uses
   Windows, SysUtils, Classes, Graphics, Controls, Dialogs, ActnList, ImgList,
-  {$IFDEF JR_D6} DesignIntf, DesignEditors, VCLEditors, {$ELSE} DsgnIntf, {$ENDIF}
+  DesignIntf, DesignEditors, VCLEditors,
   TB2Toolbar, {$IFNDEF MPEXCLUDE}TB2ToolWindow,{$ENDIF} TB2Dock, TB2Item, TB2ExtItems, {$IFNDEF MPEXCLUDE} TB2MRU, TB2MDI, {$ENDIF}
   TB2DsgnItemEditor;
 
-{$IFDEF JR_D5}
-
 { TTBImageIndexPropertyEditor }
 
 { Unfortunately TComponentImageIndexPropertyEditor seems to be gone in
   Delphi 6, so we have to use our own image index property editor class }
 
 type
-  TTBImageIndexPropertyEditor = class(TIntegerProperty
-    {$IFDEF JR_D6} , ICustomPropertyListDrawing {$ENDIF})
+  TTBImageIndexPropertyEditor = class(TIntegerProperty, ICustomPropertyListDrawing)
   public
     function GetAttributes: TPropertyAttributes; override;
     procedure GetValues(Proc: TGetStrProc); override;
@@ -53,11 +50,11 @@ type
 
     // ICustomPropertyListDrawing
     procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas;
-      var AHeight: Integer); {$IFNDEF JR_D6} override; {$ENDIF}
+      var AHeight: Integer);
     procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas;
-      var AWidth: Integer); {$IFNDEF JR_D6} override; {$ENDIF}
+      var AWidth: Integer);
     procedure ListDrawValue(const Value: string; ACanvas: TCanvas;
-      const ARect: TRect; ASelected: Boolean); {$IFNDEF JR_D6} override; {$ENDIF}
+      const ARect: TRect; ASelected: Boolean);
   end;
 
 { TTBItemImageIndexPropertyEditor }
@@ -68,8 +65,6 @@ type
     function GetImageListAt (Index: Integer): TCustomImageList; override;
   end;
 
-{$ENDIF}
-
 procedure Register;
 
 implementation
@@ -77,8 +72,6 @@ implementation
 uses
   ImgEdit, Actions, UITypes;
 
-{$IFDEF JR_D5}
-
 function TTBImageIndexPropertyEditor.GetAttributes: TPropertyAttributes;
 begin
   Result := [paMultiSelect, paValueList, paRevertable];
@@ -163,8 +156,6 @@ begin
   end;
 end;
 
-{$ENDIF}
-
 { TTBCustomImageListEditor }
 
 type
@@ -218,9 +209,7 @@ begin
   RegisterComponents('Toolbar2000', [TTBDock, TTBToolbar, {$IFNDEF MPEXCLUDE}TTBToolWindow,{$ENDIF}
     TTBPopupMenu, TTBImageList, TTBItemContainer{$IFNDEF MPEXCLUDE}, TTBBackground, TTBMRUList,
     TTBMDIHandler{$ENDIF}]);
-  {$IFDEF JR_D4}
   RegisterActions('', [TTBEditAction], nil);
-  {$ENDIF}
   RegisterNoIcon([TTBItem, TTBGroupItem, TTBSubmenuItem, TTBSeparatorItem,
     TTBEditItem, {$IFNDEF MPEXCLUDE} TTBMRUListItem,{$ENDIF} TTBControlItem{$IFNDEF MPEXCLUDE}, TTBMDIWindowItem,
     TTBVisibilityToggleItem{$ENDIF}]);
@@ -233,16 +222,12 @@ begin
   RegisterComponentEditor(TTBPopupMenu, TTBItemsEditor);
   RegisterComponentEditor(TTBCustomImageList, TTBCustomImageListEditor);
   RegisterPropertyEditor(TypeInfo(TTBRootItem), nil, '', TTBItemsPropertyEditor);
-  {$IFDEF JR_D5}
   RegisterPropertyEditor(TypeInfo(TImageIndex), TTBCustomItem, 'ImageIndex',
     TTBItemImageIndexPropertyEditor);
-  {$ENDIF}
-  {$IFDEF JR_D6}
   { TShortCut properties show up like Integer properties in Delphi 6
     without this... }
   RegisterPropertyEditor(TypeInfo(TShortCut), TTBCustomItem, '',
     TShortCutProperty);
-  {$ENDIF}
 
   { Link in images for the toolbar buttons }
   {$R TB2DsgnItemEditor.res}

+ 1 - 18
source/packages/tb2k/TB2Toolbar.pas

@@ -31,7 +31,7 @@ interface
 {$I TB2Ver.inc}
 
 uses
-  {$IFDEF JR_D9} Types, {$ENDIF}
+  Types,
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, ImgList,
   Menus, ActnList,
   TB2Item, TB2Dock;
@@ -127,9 +127,6 @@ type
     procedure WMGetObject(var Message: TMessage); message WM_GETOBJECT;
     procedure WMMouseLeave(var Message: TMessage); message WM_MOUSELEAVE;
     procedure WMNCMouseMove(var Message: TWMNCMouseMove); message WM_NCMOUSEMOVE;
-    {$IFNDEF JR_D5}
-    procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP;
-    {$ENDIF}
     procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
     procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
   protected
@@ -142,9 +139,7 @@ type
       override;
     function DoArrange(CanMoveControls: Boolean; PreviousDockType: TTBDockType;
       NewFloating: Boolean; NewDock: TTBDock): TPoint; override;
-    {$IFDEF JR_D5}
     procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); override;
-    {$ENDIF}
     procedure GetBaseSize(var ASize: TPoint); override;
     procedure GetMinBarSize(var MinimumSize: TPoint);
     procedure GetMinShrinkSize(var AMinimumSize: Integer); override;
@@ -858,24 +853,12 @@ begin
   inherited;
 end;
 
-{$IFDEF JR_D5}
 procedure TTBCustomToolbar.DoContextPopup(MousePos: TPoint;
   var Handled: Boolean);
 begin
   CancelHover;
   inherited;
 end;
-{$ENDIF}
-
-{$IFNDEF JR_D5}
-{ Delphi 4 and earlier don't have a DoContextPopup method; we instead have to
-  trap WM_RBUTTONUP to determine if a popup menu (might) be displayed }
-procedure TTBCustomToolbar.WMRButtonUp(var Message: TWMRButtonUp);
-begin
-  CancelHover;
-  inherited;
-end;
-{$ENDIF}
 
 procedure TTBCustomToolbar.MouseMove(Shift: TShiftState; X, Y: Integer);
 var

+ 0 - 16
source/packages/tb2k/TB2Ver.inc

@@ -4,28 +4,12 @@
 {$IFNDEF WIN32} Delphi 1 is not supported. {$ENDIF}
 {$IFNDEF VER90}  { if it's not Delphi 2.0 }
   {$IFNDEF VER93}  { and it's not C++Builder 1.0 }
-    {$DEFINE JR_D3}  { then it must be at least Delphi 3 or C++Builder 3 }
     {$IFNDEF VER100}  { if it's not Delphi 3.0 }
       {$IFNDEF VER120}  { Delphi 4/5's command line compiler doesn't like the ObjExportAll directive, so don't include it on Delphi 4/5 }
         {$IFNDEF VER130}
           {$ObjExportAll On}  { <- needed for compatibility with run-time packages in C++Builder 3+ }
         {$ENDIF}
       {$ENDIF}
-      {$IFNDEF VER110}  { and it's not C++Builder 3.0 }
-        {$DEFINE JR_D4}  { then it must be at least Delphi 4 or C++Builder 4 }
-        {$IFNDEF VER120} {$IFNDEF VER125}  { if it's not Delphi 4 or C++Builder 4 }
-          {$DEFINE JR_D5}  { then it must be at least Delphi 5 or C++Builder 5 }
-          {$IFNDEF VER130}  { if it's not Delphi 5 or C++Builder 5 }
-            {$DEFINE JR_D6}  { then it must be at least Delphi 6 or C++Builder 6 }
-            {$IFNDEF VER140}  { if it's not Delphi 6 or C++Builder 6 }
-              {$DEFINE JR_D7}  { then it must be at least Delphi 7 }
-              {$IFNDEF VER150}  { if it's not Delphi 7 }
-                {$DEFINE JR_D9}  { then it must be at least Delphi 9 (2005) }
-              {$ENDIF}
-            {$ENDIF}
-          {$ENDIF}
-        {$ENDIF} {$ENDIF}
-      {$ENDIF}
     {$ENDIF}
   {$ENDIF}
 {$ENDIF}

+ 0 - 16
source/packages/tbx/TB2Ver.inc

@@ -4,28 +4,12 @@
 {$IFNDEF WIN32} Delphi 1 is not supported. {$ENDIF}
 {$IFNDEF VER90}  { if it's not Delphi 2.0 }
   {$IFNDEF VER93}  { and it's not C++Builder 1.0 }
-    {$DEFINE JR_D3}  { then it must be at least Delphi 3 or C++Builder 3 }
     {$IFNDEF VER100}  { if it's not Delphi 3.0 }
       {$IFNDEF VER120}  { Delphi 4/5's command line compiler doesn't like the ObjExportAll directive, so don't include it on Delphi 4/5 }
         {$IFNDEF VER130}
           {$ObjExportAll On}  { <- needed for compatibility with run-time packages in C++Builder 3+ }
         {$ENDIF}
       {$ENDIF}
-      {$IFNDEF VER110}  { and it's not C++Builder 3.0 }
-        {$DEFINE JR_D4}  { then it must be at least Delphi 4 or C++Builder 4 }
-        {$IFNDEF VER120} {$IFNDEF VER125}  { if it's not Delphi 4 or C++Builder 4 }
-          {$DEFINE JR_D5}  { then it must be at least Delphi 5 or C++Builder 5 }
-          {$IFNDEF VER130}  { if it's not Delphi 5 or C++Builder 5 }
-            {$DEFINE JR_D6}  { then it must be at least Delphi 6 or C++Builder 6 }
-            {$IFNDEF VER140}  { if it's not Delphi 6 or C++Builder 6 }
-              {$DEFINE JR_D7}  { then it must be at least Delphi 7 }
-              {$IFNDEF VER150}  { if it's not Delphi 7 }
-                {$DEFINE JR_D9}  { then it must be at least Delphi 9 (2005) }
-              {$ENDIF}
-            {$ENDIF}
-          {$ENDIF}
-        {$ENDIF} {$ENDIF}
-      {$ENDIF}
     {$ENDIF}
   {$ENDIF}
 {$ENDIF}

+ 0 - 15
source/packages/tbx/TBX.inc

@@ -1,15 +0,0 @@
-{$IFDEF JR_D7}
-  {$WARN SYMBOL_PLATFORM OFF} // TBX only supports Win32
-{$ENDIF}
-
-{$DEFINE TBX_UNICODE}          // experimental
-{*$DEFINE COMPATIBLE_CTL}      // register duplicate controls with older names
-{*$DEFINE COMPATIBLE_GFX}      // compatibility with third-party themes
-{$DEFINE WIN4_SHADOW}          // enable shadow simulation in Win98/ME
-
-{$DEFINE NARROWCOMBOBUTTON}    // removes gap after a combo item (default theme only)
-{*$DEFINE OFFICE2K_COMBOS}     // alternative border painting in popups of combo boxes
-
-{$DEFINE NEWCOLORPROPERTY}     // register alternative color property editor
-
-{$DEFINE NARROWCOMBOBUTTON}

+ 18 - 62
source/packages/tbx/TBX.pas

@@ -9,11 +9,6 @@ unit TBX;
 interface
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
-
-{x$DEFINE TBX_NO_ANIMATION}
-  { Enabling the above define disables all menu animation. For debugging
-    purpose only. } {vb+}
 
 uses
   Windows, Messages, Classes, SysUtils, Controls, Graphics, ImgList, Forms,
@@ -319,7 +314,7 @@ type
     FControlRect: TRect;
     FShadows: TShadows;
     procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW;
-    procedure CMShowingChanged(var Message: TMessage); message CM_SHOWINGCHANGED; {vb+}
+    procedure CMShowingChanged(var Message: TMessage); message CM_SHOWINGCHANGED;
     procedure TBMGetViewType(var Message: TMessage); message TBM_GETVIEWTYPE;
     procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
     procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT;
@@ -334,7 +329,7 @@ type
     function  GetNCSize: TPoint; override;
     function  GetShowShadow: Boolean; virtual;
     function  GetViewClass: TTBViewClass; override;
-    procedure PaintScrollArrows; override; {vb+}
+    procedure PaintScrollArrows; override;
   public
     destructor Destroy; override;
     function  GetFillColor: TColor;
@@ -375,7 +370,7 @@ type
     function  GetFloatingWindowParentClass: TTBFloatingWindowParentClass; override;
     procedure GetToolbarInfo(out ToolbarInfo: TTBXToolbarInfo); virtual;
     function  GetViewClass: TTBToolbarViewClass; override;
-    procedure Loaded; override; {vb+}
+    procedure Loaded; override;
     procedure SetParent(AParent: TWinControl); override;
     procedure UpdateEffectiveColor;
     procedure Rebuild;
@@ -436,9 +431,7 @@ type
     property Color default clNone;
     property OnClose;
     property OnCloseQuery;
-    {$IFDEF JR_D5}
     property OnContextPopup;
-    {$ENDIF}
     property OnDragDrop;
     property OnDragOver;
     property OnMouseDown;
@@ -582,7 +575,7 @@ type
     property UseParentBackground: Boolean read FUseParentBackground write SetUseParentBackground default False;
   end;
 
-  { TTBXMenuAnimation } {vb+}
+  { TTBXMenuAnimation }
 
   TMenuAnimation = (maNone, maUnfold, maSlide, maFade);
   TAnimationMode = (amNone, amSysDefault, amRandom, amUnfold, amSlide, amFade);
@@ -604,15 +597,7 @@ type
 
 var
   CurrentTheme: TTBXTheme;
-  TBXMenuAnimation: TTBXMenuAnimation; { vb+ }
-
-{$IFNDEF JR_D6}
-var
-  clMoneyGreen: TColor = TColor($C0DCC0);
-  clSkyBlue: TColor = TColor($F0CAA6);
-  clCream: TColor = TColor($F0FBFF);
-  clMedGray: TColor = TColor($A4A0A0);
-{$ENDIF}
+  TBXMenuAnimation: TTBXMenuAnimation;
 
 procedure TBXSetTheme(const AThemeName: string);
 function TBXCurrentTheme: string;
@@ -642,8 +627,7 @@ implementation
 
 uses
   TBXExtItems, TBXLists, TB2Common, UxTheme, MultiMon, TBXOfficeXPTheme,
-  {ComCtrls, Menus;} {vb-}
-  ComCtrls, Menus, MMSystem, Types, UITypes; {vb+}
+  ComCtrls, Menus, MMSystem, Types, UITypes;
 
 type
   TTBItemAccess = class(TTBCustomItem);
@@ -658,7 +642,7 @@ type
   TControlAccess = class(TControl);
   TTBXThemeAccess = class(TTBXTheme);
   TDockAccess = class(TTBDock);
-  TTBPopupWindowAccess = class(TTBPopupWindow); {vb+}
+  TTBPopupWindowAccess = class(TTBPopupWindow);
 
   { TTBNexus }
   TTBXNexus = class
@@ -728,8 +712,8 @@ begin
     try
       SetWindowOrgEx(DC, Shift.X, Shift.Y, nil);
       Msg.Msg := WM_ERASEBKGND;
-      Msg.WParam := Integer(DC); {vb+}
-      Msg.LParam := Integer(DC); {vb+}
+      Msg.WParam := Integer(DC);
+      Msg.LParam := Integer(DC);
       Msg.Result := 0;
       Parent.Dispatch(Msg);
     finally
@@ -1643,7 +1627,6 @@ var
   View: TTBViewAccess;
   ItemInfo: TTBXItemInfo;
 
-  {M: Integer;} {vb-}
   R: TRect;
   ComboRect: TRect;
   CaptionRect: TRect;
@@ -1984,9 +1967,7 @@ begin
       Bottom := Top + CY;
       DrawItemImage(Canvas, ImageRect, ItemInfo);
     end
-    {else if not ToolbarStyle and Item.Checked then
-      CurrentTheme.PaintCheckMark(Canvas, ImageRect, ItemInfo);} {vb-}
-    else {vb+}
+    else
       if not ToolbarStyle and Item.Checked then
       begin
         if Item.RadioItem then
@@ -2197,7 +2178,7 @@ begin
   end;
 end;
 
-procedure TTBXPopupWindow.CMShowingChanged(var Message: TMessage); {vb+}
+procedure TTBXPopupWindow.CMShowingChanged(var Message: TMessage);
 const
   ShowFlags: array[Boolean] of UINT = (
     SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_NOACTIVATE or SWP_HIDEWINDOW,
@@ -2213,7 +2194,6 @@ begin
     Windows 95 and NT 4.0 because there's a difference in the way the
     SetWindowPos works on those versions. See the comment in the
     TBStartAnimation function of TB2Anim.pas. }
-  {$IFNDEF TBX_NO_ANIMATION}
   if ((View.ParentView = nil) or not(vsNoAnimation in View.ParentView.State)) and
      Showing and (View.Selected = nil) and not IsWindowVisible(WindowHandle) and
      (TBXMenuAnimation.AnimationMode <> amNone) then
@@ -2235,7 +2215,6 @@ begin
       end;
     end;
   end;
-  {$ENDIF}
 
   { No animation... }
   if not Showing then begin
@@ -2335,7 +2314,7 @@ begin
   Result := TTBXPopupView;
 end;
 
-procedure TTBXPopupWindow.PaintScrollArrows; {vb+}
+procedure TTBXPopupWindow.PaintScrollArrows;
 
   function _GetPopupMargin: Integer;
   begin
@@ -2739,7 +2718,7 @@ begin
   Invalidate;
 end;
 
-procedure TTBXToolbar.Loaded; {vb+}
+procedure TTBXToolbar.Loaded;
 begin
   inherited;
   UpdateEffectiveColor;
@@ -3118,13 +3097,7 @@ end;
 function TTBXPopupMenu.PopupEx(const ControlRect: TRect;
   ReturnClickedItemOnly: Boolean = False): TTBCustomItem;
 begin
-  {$IFDEF JR_D5}
-  {$IFDEF JR_D9}
   SetPopupPoint(Point(ControlRect.Left, ControlRect.Bottom));
-  {$ELSE}
-  PPoint(@PopupPoint)^ := Point(ControlRect.Left, ControlRect.Bottom);
-  {$ENDIF}
-  {$ENDIF}
   Result := TTBXRootItem(Items).PopupEx(ControlRect, TrackButton = tbRightButton,
     TTBPopupAlignment(Alignment), ReturnClickedItemOnly);
 end;
@@ -3676,19 +3649,6 @@ begin
     Broadcast(TBM_THEMECHANGE, Message.WParam, 0);
 end;
 
-procedure InitAdditionalSysColors;
-begin
-{$IFNDEF JR_D7} {vb+}
-  AddTBXColor(clHotLight, 'clHotLight');
-{$ENDIF} {vb+}
-{$IFNDEF JR_D6}
-  AddTBXColor(clMoneyGreen, 'clMoneyGreen');
-  AddTBXColor(clSkyBlue, 'clSkyBlue');
-  AddTBXColor(clCream, 'clCream');
-  AddTBXColor(clMedGray, 'clMedGray');
-{$ENDIF}
-end;
-
 { TTBXDock }
 
 procedure TTBXDock.CMColorChanged(var Message: TMessage);
@@ -3851,7 +3811,7 @@ begin
   FResizing := False;
 end;
 
-{ TTBXMenuAnimation } {vb+}
+{ TTBXMenuAnimation }
 
 constructor TTBXMenuAnimation.Create(AAnimationMode: TAnimationMode = amSysDefault);
 begin
@@ -3911,7 +3871,7 @@ begin
   Result := SystemParametersInfo(Param, 0, @B, 0) and B;
 end;
 
-{ Work around delayed menu showing in Windows 2000+ } {vb+}
+{ Work around delayed menu showing in Windows 2000+ }
 var
   FixPlaySoundThreadHandle: Cardinal;
 
@@ -3937,18 +3897,14 @@ begin
 end;
 
 initialization
-  FixPlaySoundDelay; {vb+}
-  {CurrentTheme := nil;} {vb-}
+  FixPlaySoundDelay;
   RegisterTBXTheme('OfficeXP', TTBXOfficeXPTheme);
   TBXNexus := TTBXNexus.Create('OfficeXP');
-  TBXMenuAnimation := TTBXMenuAnimation.Create; {vb+}
-  {$IFNDEF JR_D7} {vb+}
-  InitAdditionalSysColors;
-  {$ENDIF} {vb+}
+  TBXMenuAnimation := TTBXMenuAnimation.Create;
 
 finalization
   TBXNexus.Free;
-  FreeAndNil(TBXMenuAnimation); {vb+}
+  FreeAndNil(TBXMenuAnimation);
   ColorRegistry := nil;
 
 end.

+ 5 - 22
source/packages/tbx/TBXExtItems.pas

@@ -10,11 +10,6 @@ unit TBXExtItems;
 interface
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
-
-{$IFNDEF MPEXCLUDE}
-{$DEFINE COMPATIBLE}
-{$ENDIF}
 
 uses
   Windows, Messages, Classes, SysUtils, Graphics, Controls, StdCtrls, ExtCtrls,
@@ -277,11 +272,6 @@ type
     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
   end;
 
-{$IFDEF COMPATIBLE}
-  { For compatibility with previous versions }
-  TTBXComboItem = class(TTBXDropDownItem);
-{$ENDIF}
-
   { TTBXComboBoxItem }
   { A combination of dropdown combo with a stringlist subitem }
   TTBXComboBoxItem = class;
@@ -356,11 +346,6 @@ type
     property OnCancel;
   end;
 
-{$IFDEF COMPATIBLE}
-  { For compatibility with previous versions }
-  TTBXComboList = class(TTBXComboBoxItem);
-{$ENDIF}
-
   TTBXComboBoxItemViewer = class(TTBXDropDownItemViewer)
   protected
     function HandleEditMessage(var Message: TMessage): Boolean; override;
@@ -506,7 +491,7 @@ type
 
 implementation
 
-uses TBXUtils, TB2Common, TB2Consts, TypInfo, Math, ImgList, {MP}Menus, Forms, PasTools {$IFNDEF JR_D5}, DsgnIntf{$ENDIF};
+uses TBXUtils, TB2Common, TB2Consts, TypInfo, Math, ImgList, {MP}Menus, Forms, PasTools;
 
 const
   { Repeat intervals for spin edit items }
@@ -683,8 +668,7 @@ begin
         Edit.SelLength := Length(S2) - Length(S);
         S := S2;
       end;
-      {if S <> FLastEditChange then} {vb-}
-      if AnsiCompareText(S, FLastEditChange) <> 0 then {vb+}
+      if AnsiCompareText(S, FLastEditChange) <> 0 then
       begin
         DoChange(S); // note, Edit.Text may be different from Self.Text
         FLastEditChange := S;
@@ -1223,8 +1207,7 @@ begin
   begin
     if TWMKeyDown(Message).CharCode = VK_F4 then
     begin
-      {TTBViewAccess(View).OpenChildPopup(True);} {vb-}
-      if (View.OpenViewer = Self) // WasAlreadyOpen {vb+}
+      if (View.OpenViewer = Self) // WasAlreadyOpen
         then View.CloseChildPopups
         else View.OpenChildPopup(True);
       Result := True;
@@ -1513,7 +1496,7 @@ begin
     case Message.wParam of
       VK_UP:
         begin
-          if ItemIndex > 0 then {vb+}
+          if ItemIndex > 0 then
             ItemIndex := ItemIndex- 1;
           EditControl.Text := Text;
           EditControl.SelectAll;
@@ -1522,7 +1505,7 @@ begin
 
       VK_DOWN:
         begin
-          if ItemIndex < Strings.Count- 1 then {vb+}
+          if ItemIndex < Strings.Count- 1 then
             ItemIndex := ItemIndex+ 1;
           EditControl.Text := Text;
           EditControl.SelectAll;

+ 4 - 5
source/packages/tbx/TBXLists.pas

@@ -9,7 +9,6 @@ unit TBXLists;
 interface
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
 
 uses
   Windows, Messages, Classes, SysUtils, Controls, Forms, Graphics, TB2Item, TBX,
@@ -192,8 +191,8 @@ type
     procedure Paint(const Canvas: TCanvas; const ClientAreaRect: TRect; IsHoverItem, IsPushed, UseDisabledShadow: Boolean); override;
     procedure UpdateItems;
     property HoverIndex: Integer read FHoverIndex write FHoverIndex;
-    property Offset: Integer read FOffset; {vb+}
-    property VisibleItems: Integer read FVisibleItems; {vb+}
+    property Offset: Integer read FOffset;
+    property VisibleItems: Integer read FVisibleItems;
   public
     constructor Create(AView: TTBView; AItem: TTBCustomItem; AGroupLevel: Integer); override;
     destructor Destroy; override;
@@ -279,7 +278,7 @@ end;
 
 procedure TTBXScrollBar.CreateWnd;
 begin
-  if FHandle = 0 then FHandle := {$IFDEF JR_D6}Classes.{$ENDIF}AllocateHWnd(SBWndProc);
+  if FHandle = 0 then FHandle := Classes.AllocateHWnd(SBWndProc);
 end;
 
 destructor TTBXScrollBar.Destroy;
@@ -292,7 +291,7 @@ procedure TTBXScrollBar.DestroyWnd;
 begin
   if FHandle <> 0 then
   begin
-    {$IFDEF JR_D6}Classes.{$ENDIF}DeallocateHWnd(FHandle);
+    Classes.DeallocateHWnd(FHandle);
     FHandle := 0;
   end;
 end;

+ 1 - 35
source/packages/tbx/TBXOfficeXPTheme.pas

@@ -9,14 +9,10 @@ unit TBXOfficeXPTheme;
 interface
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
 
 uses
   Windows, Messages, Graphics, TBXThemes, ImgList, Controls, TB2Item, Forms;
 
-{$DEFINE ALTERNATIVE_DISABLED_STYLE} // remove the asterisk to change appearance of disabled images
-{$DEFINE NO_IMAGE_DIMMING}
-
 type
   TItemPart = (ipBody, ipText, ipFrame);
   TBtnItemState = (bisNormal, bisDisabled, bisSelected, bisPressed, bisHot,
@@ -781,27 +777,6 @@ begin
       Exit;
     end;
 
-{$IFNDEF ALTERNATIVE_DISABLED_STYLE}
-    if not Enabled then
-    begin
-      DrawTBXIconFlatShadow(Canvas, ARect, ImageList, ImageIndex,
-        BtnItemColors[bisDisabled, ipText]);
-    end
-    else if Selected or Pushed or (HoverKind <> hkNone) then
-    begin
-      if not (Selected or Pushed and not IsPopupParent) then
-      begin
-        OffsetRect(ARect, 1, 1);
-        DrawTBXIconFullShadow(Canvas, ARect, ImageList, ImageIndex, IconShadowColor);
-        OffsetRect(ARect, -2, -2);
-      end;
-      DrawTBXIcon(Canvas, ARect, ImageList, ImageIndex);
-    end
-    else if TBXLoColor then
-      DrawTBXIcon(Canvas, ARect, ImageList, ImageIndex)
-    else
-      HighlightTBXIcon(Canvas, ARect, ImageList, ImageIndex, clWindow, 178);
-{$ELSE}
     if not Enabled then
     begin
       HiContrast := ColorIntensity(GetItemImageBackground(ItemInfo)) < 80;
@@ -822,16 +797,7 @@ begin
       DrawTBXIcon(Canvas, ARect, ImageList, ImageIndex);
     end
       else
-{$IFNDEF NO_IMAGE_DIMMING}
-    if TBXLoColor then
-{$ENDIF}
-      DrawTBXIcon(Canvas, ARect, ImageList, ImageIndex)
-{$IFNDEF NO_IMAGE_DIMMING}
-    else
-      HighlightTBXIcon(Canvas, ARect, ImageList, ImageIndex, clWindow, 178)
-{$ENDIF}
-    ;
-{$ENDIF}
+    DrawTBXIcon(Canvas, ARect, ImageList, ImageIndex)
   end;
 end;
 

+ 4 - 61
source/packages/tbx/TBXReg.pas

@@ -9,11 +9,10 @@ unit TBXReg;
 interface
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
 
 uses
   Windows, Classes, Controls, SysUtils, Graphics, ImgList, Dialogs,
-  {$IFDEF JR_D6} DesignIntf, DesignEditors, VCLEditors, {$ELSE} DsgnIntf, {$ENDIF}
+  DesignIntf, DesignEditors, VCLEditors,
   TB2Reg, TB2Toolbar, TB2Item, TBX, {$IFNDEF MPEXCLUDE}TBXMDI, TBXSwitcher,{$ENDIF} TB2DsgnItemEditor,
   TBXExtItems, TBXLists, {$IFNDEF MPEXCLUDE}TBXDkPanels,{$ENDIF} TBXToolPals, TBXStatusBars;
 
@@ -30,31 +29,23 @@ type
     procedure Edit; override;
   end;
 
-{$IFDEF JR_D5}
   TTBXLinkImageIndexPropertyEditor = class(TTBImageIndexPropertyEditor)
   public
     function GetImageListAt(Index: Integer): TCustomImageList; override;
   end;
-{$ENDIF}
 
   TTBXColorProperty = class(TColorProperty)
   public
     function GetValue: string; override;
     procedure GetValues(Proc: TGetStrProc); override;
     procedure SetValue(const Value: string); override;
-{$IFDEF JR_D5}
     procedure ListDrawValue(const Value: string; ACanvas: TCanvas;
-      const ARect: TRect; ASelected: Boolean);{$IFNDEF JR_D6} override;{$ENDIF}
-{$ENDIF}
+      const ARect: TRect; ASelected: Boolean);
   end;
 
   TTBXStatusBarEditor = class(TDefaultEditor)
   protected
-{$IFDEF JR_D6}
     procedure GetPanelsProp(const Prop: IProperty);
-{$ELSE}
-    procedure GetPanelsProp(Prop: TPropertyEditor);
-{$ENDIF}
   public
     procedure Edit; override;
     procedure ExecuteVerb(Index: Integer); override;
@@ -187,7 +178,6 @@ begin
   Result := inherited GetAttributes + [paDialog];
 end;
 
-{$IFDEF JR_D5}
 { TTBXLinkImageIndexPropertyEditor }
 
 function TTBXLinkImageIndexPropertyEditor.GetImageListAt(Index: Integer): TCustomImageList;
@@ -205,7 +195,6 @@ begin
     Result := TTBXButtonAccess(C).Images;
   {$ENDIF}
 end;
-{$ENDIF}
 
 { TTBXColorProperty }
 
@@ -224,7 +213,6 @@ begin
   SetOrdValue(TBXStringToColor(Value));
 end;
 
-{$IFDEF JR_D5}
 procedure TTBXColorProperty.ListDrawValue(const Value: string; ACanvas: TCanvas;
   const ARect: TRect; ASelected: Boolean);
 
@@ -277,39 +265,16 @@ begin
     ACanvas.TextRect(R, R.Left + 1, R.Top + 1, Value);
   end;
 end;
-{$ENDIF}
 
 { TTBXStatusBarEditor }
 
 procedure TTBXStatusBarEditor.Edit;
 var
-{$IFDEF JR_D6}
   Components: IDesignerSelections;
-{$ELSE}
-  {$IFDEF JR_D5}
-  Components: TDesignerSelectionList;
-  {$ELSE}
-  Components: TComponentList;
-  {$ENDIF}
-{$ENDIF}
 begin
-{$IFDEF JR_D6}
   Components := CreateSelectionList;
-{$ELSE}
-  {$IFDEF JR_D5}
-  Components := TDesignerSelectionList.Create;
-  {$ELSE}
-  Components := TComponentList.Create;
-  {$ENDIF}
-{$ENDIF}
-  try
-    Components.Add(Component);
-    GetComponentProperties(Components, [tkClass], Designer, GetPanelsProp);
-  finally
-{$IFNDEF JR_D6}
-    Components.Free;
-{$ENDIF}
-  end;
+  Components.Add(Component);
+  GetComponentProperties(Components, [tkClass], Designer, GetPanelsProp);
 end;
 
 procedure TTBXStatusBarEditor.ExecuteVerb(Index: Integer);
@@ -327,17 +292,10 @@ begin
   Result := 1;
 end;
 
-{$IFDEF JR_D6}
 procedure TTBXStatusBarEditor.GetPanelsProp(const Prop: IProperty);
 begin
   if SameText(Prop.GetName, 'Panels') then Prop.Edit;
 end;
-{$ELSE}
-procedure TTBXStatusBarEditor.GetPanelsProp(Prop: TPropertyEditor);
-begin
-  if CompareText(Prop.GetName, 'Panels') = 0 then Prop.Edit;
-end;
-{$ENDIF}
 
 { TTBXItemsEditor }
 
@@ -422,17 +380,11 @@ begin
     {$IFNDEF MPEXCLUDE}TTBXVisibilityToggleItem,{$ENDIF} TTBXLabelItem, {$IFNDEF MPEXCLUDE}TTBXMRUListItem,{$ENDIF} TTBXColorItem,
     {$IFNDEF MPEXCLUDE}TTBXMDIWindowItem, TTBXEditItem, TTBXSpinEditItem,{$ENDIF} TTBXDropDownItem,
     TTBXComboBoxItem, TTBXStringList{$IFNDEF MPEXCLUDE}, TTBXUndoList, TTBXToolPalette{$ENDIF}, TTBXColorPalette]);
-{$IFDEF COMPATIBLE_CTL}
-  RegisterNoIcon([TTBXList, TTBXComboItem, TTBXComboList]);
-{$ENDIF}
 
   RegisterClasses([TTBXItem, TTBXSubMenuItem, TTBXSeparatorItem,
     {$IFNDEF MPEXCLUDE}TTBXVisibilityToggleItem,{$ENDIF} TTBXLabelItem, {$IFNDEF MPEXCLUDE}TTBXMRUListItem,{$ENDIF} TTBXColorItem,
     {$IFNDEF MPEXCLUDE}TTBXMDIWindowItem, TTBXEditItem, TTBXSpinEditItem,{$ENDIF} TTBXDropDownItem,
     TTBXComboBoxItem, TTBXStringList{$IFNDEF MPEXCLUDE}, TTBXUndoList, TTBXToolPalette{$ENDIF}, TTBXColorPalette]);
-{$IFDEF COMPATIBLE_CTL}
-  RegisterClasses([TTBXList, TTBXComboItem, TTBXComboList]);
-{$ENDIF}
 
 
   RegisterComponentEditor(TTBXToolbar, TTBXItemsEditor);
@@ -445,15 +397,11 @@ begin
   {$IFNDEF MPEXCLUDE}
   RegisterPropertyEditor(TypeInfo(string), TTBXSwitcher, 'Theme', TThemeProperty);
   {$ENDIF}
-{$IFDEF JR_D5}
   {$IFNDEF MPEXCLUDE}
   RegisterPropertyEditor(TypeInfo(TImageIndex), TTBXCustomLink, 'ImageIndex', TTBXLinkImageIndexPropertyEditor);
   RegisterPropertyEditor(TypeInfo(TImageIndex), TTBXCustomButton, 'ImageIndex', TTBXLinkImageIndexPropertyEditor);
   {$ENDIF}
-{$ENDIF}
-{$IFDEF NEWCOLORPROPERTY}
   RegisterPropertyEditor(TypeInfo(TColor), TPersistent, '', TTBXColorProperty);
-{$ENDIF}
 
   RegisterComponentEditor(TTBXStatusBar, TTBXStatusBarEditor);
 
@@ -481,11 +429,6 @@ begin
   TBRegisterItemClass(TTBXToolPalette, 'New TBX Tool Palette', HInstance);
   {$ENDIF}
   TBRegisterItemClass(TTBXColorPalette, 'New TBX Color Palette', HInstance);
-{$IFDEF COMPATIBLE_CTL}
-  TBRegisterItemClass(TTBXComboItem, 'New TBX Combo Item (use TBX DropDown instead)', HInstance);
-  TBRegisterItemClass(TTBXList, 'New TBX List (use TBX String List instead)', HInstance);
-  TBRegisterItemClass(TTBXComboList, 'New TBX Combo List (use TBX Combo Box Instead)', HInstance);
-{$ENDIF}
 
 end;
 

+ 0 - 3
source/packages/tbx/TBXStatusBars.pas

@@ -9,7 +9,6 @@ unit TBXStatusBars;
 interface
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
 
 uses
   Windows, Messages, Classes, SysUtils, Controls, Forms, Graphics, TBX,
@@ -203,9 +202,7 @@ type
     property Visible;
     property OnAdjustContentRect;
     property OnClick;
-{$IFDEF JR_D5}
     property OnContextPopup;
-{$ENDIF}
     property OnDblClick;
     property OnDragDrop;
     property OnDragOver;

+ 2 - 4
source/packages/tbx/TBXThemes.pas

@@ -9,7 +9,6 @@ unit TBXThemes;
 interface
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
 
 uses
   Windows, Messages, Classes, Forms, Graphics, ImgList, Controls, TB2Item;
@@ -668,14 +667,14 @@ begin
   FEnableVisualStyles := True;
   FFlatMenuStyle := FMS_AUTOMATIC;
   FNotifies := TList.Create;
-  FWindowHandle := {$IFDEF JR_D6}Classes.{$ENDIF}AllocateHWnd(WndProc);
+  FWindowHandle := Classes.AllocateHWnd(WndProc);
   UpdateVariables;
 end;
 
 destructor TTBXThemeManager.Destroy;
 begin
   VisualStylesClose;
-  {$IFDEF JR_D6}Classes.{$ENDIF}DeallocateHWnd(FWindowHandle);
+  Classes.DeallocateHWnd(FWindowHandle);
   FNotifies.Free;
   VisualStylesClose;
   inherited;
@@ -807,7 +806,6 @@ begin
     WM_DISPLAYCHANGE, WM_SYSCOLORCHANGE, WM_THEMECHANGED:
       begin
         UpdateVariables;
-        ResetBrushedFillCache;
         Notify;
       end;
     WM_ACTIVATEAPP:

+ 0 - 1
source/packages/tbx/TBXToolPals.pas

@@ -13,7 +13,6 @@ uses
   TBXThemes;
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
 
 type
   TRowColCount = 1..100;

+ 10 - 1095
source/packages/tbx/TBXUtils.pas

@@ -9,33 +9,15 @@ unit TBXUtils;
 interface
 
 {$I TB2Ver.inc}
-{$I TBX.inc}
 
 uses
   Windows, Messages, Classes, SysUtils, Graphics, Controls, Forms, ImgList;
 
-{$IFDEF TBX_UNICODE}
-function GetTextHeightW(DC: HDC): Integer;
-function GetTextWidthW(DC: HDC; const S: WideString; StripAccelChar: Boolean): Integer;
-procedure DrawRotatedTextW(DC: HDC; AText: WideString; const ARect: TRect; const AFormat: Cardinal);
-function EscapeAmpersandsW(const S: WideString): WideString;
-function FindAccelCharW(const S: WideString): WideChar;
-function StripAccelCharsW(const S: WideString): WideString;
-function StripTrailingPunctuationW(const S: WideString): WideString;
-{$ENDIF}
-
-procedure GetRGB(C: TColor; out R, G, B: Integer);
 function  MixColors(C1, C2: TColor; W1: Integer): TColor;
-function  SameColors(C1, C2: TColor): Boolean;
-function  Lighten(C: TColor; Amount: Integer): TColor;
-function  NearestLighten(C: TColor; Amount: Integer): TColor;
-function  NearestMixedColor(C1, C2: TColor; W1: Integer): TColor;
 function  ColorIntensity(C: TColor): Integer;
 function  IsDarkColor(C: TColor; Threshold: Integer = 100): Boolean;
 function  Blend(C1, C2: TColor; W1: Integer): TColor;
 procedure SetContrast(var Color: TColor; BkgndColor: TColor; Threshold: Integer);
-procedure RGBtoHSL(RGB: TColor; out H, S, L : Single);
-function  HSLtoRGB(H, S, L: Single): TColor;
 function  GetBGR(C: TColorRef): Cardinal;
 
 function TBXScaleByTextHeightRunTime(Canvas: TCanvas; Dimension: Integer): Integer;
@@ -43,74 +25,25 @@ function TBXScaleByTextHeightRunTime(Canvas: TCanvas; Dimension: Integer): Integ
 { A few drawing functions }
 { these functions recognize clNone value of TColor }
 
-procedure SetPixelEx(DC: HDC; X, Y: Integer; C: TColorRef; Alpha: Longword = $FF);
-function  CreatePenEx(Color: TColor): HPen;
-function  CreateBrushEx(Color: TColor): HBrush;
-function  CreateDitheredBrush(C1, C2: TColor): HBrush;
-function  FillRectEx(DC: HDC; const Rect: TRect; Color: TColor): Boolean; {$IFDEF COMPATIBLE_GFX}overload;{$ENDIF}
-function  FrameRectEx(DC: HDC; var Rect: TRect; Color: TColor; Adjust: Boolean): Boolean; {$IFDEF COMPATIBLE_GFX}overload;{$ENDIF}
-procedure DrawLineEx(DC: HDC; X1, Y1, X2, Y2: Integer; Color: TColor); {$IFDEF COMPATIBLE_GFX}overload;{$ENDIF}
+function  FillRectEx(DC: HDC; const Rect: TRect; Color: TColor): Boolean;
+function  FrameRectEx(DC: HDC; var Rect: TRect; Color: TColor; Adjust: Boolean): Boolean;
+procedure DrawLineEx(DC: HDC; X1, Y1, X2, Y2: Integer; Color: TColor);
 function  PolyLineEx(DC: HDC; const Points: array of TPoint; Color: TColor): Boolean;
 procedure PolygonEx(DC: HDC; const Points: array of TPoint; OutlineColor, FillColor: TColor);
-procedure RoundRectEx(DC: HDC; Left, Top, Right, Bottom: Integer; EllipseWidth, EllipseHeight, OutlineColor, FillColor: TColor); overload; {vb+}
-procedure RoundRectEx(DC: HDC; const R: TRect; EllipseWidth, EllipseHeight, OutlineColor, FillColor: TColor); overload; {vb+}
+procedure RoundRectEx(DC: HDC; Left, Top, Right, Bottom: Integer; EllipseWidth, EllipseHeight, OutlineColor, FillColor: TColor);
 procedure EllipseEx(DC: HDC; Left, Top, Right, Bottom: Integer; OutlineColor, FillColor: TColor);
-procedure DitherRect(DC: HDC; const R: TRect; C1, C2: TColor); {$IFDEF COMPATIBLE_GFX}overload;{$ENDIF}
-procedure Frame3D(DC: HDC; var Rect: TRect; TopColor, BottomColor: TColor; Adjust: Boolean); {$IFDEF COMPATIBLE_GFX}overload;{$ENDIF}
-procedure DrawDraggingOutline(DC: HDC; const NewRect, OldRect: TRect);
-
-{ Gradients }
-type
-  TGradientKind = (gkHorz, gkVert);
-
-procedure GradFill(DC: HDC; ARect: TRect; ClrTopLeft, ClrBottomRight: TColor; Kind: TGradientKind);
-procedure BrushedFill(DC: HDC; Origin: PPoint; ARect: TRect; Color: TColor; Roughness: Integer);
-procedure ResetBrushedFillCache;
-
-{ drawing functions for compatibility with previous versions }
-{$IFDEF COMPATIBLE_GFX}
-function  FillRectEx(Canvas: TCanvas; const Rect: TRect; Color: TColor): Boolean; overload;
-function  FrameRectEx(Canvas: TCanvas; var Rect: TRect; Color: TColor; Adjust: Boolean = False): Boolean; overload;
-procedure DrawLineEx(Canvas: TCanvas; X1, Y1, X2, Y2: Integer; Color: TColor); overload;
-procedure DitherRect(Canvas: TCanvas; const R: TRect; C1, C2: TColor); overload;
-procedure Frame3D(Canvas: TCanvas; var Rect: TRect; TopColor, BottomColor: TColor); overload;
-function  FillRectEx2(DC: HDC; const Rect: TRect; Color: TColor): Boolean; deprecated;
-function  FrameRectEx2(DC: HDC; var Rect: TRect; Color: TColor; Adjust: Boolean = False): Boolean; deprecated;
-{$ENDIF}
-
-{ alternatives to fillchar and move routines what work with 32-bit aligned memory blocks }
-procedure FillLongword(var X; Count: Integer; Value: Longword);
-procedure MoveLongword(const Source; var Dest; Count: Integer);
 
 { extended icon painting routines }
 procedure DrawTBXIcon(Canvas: TCanvas; const R: TRect;
   ImageList: TCustomImageList; ImageIndex: Integer);
-procedure BlendTBXIcon(Canvas: TCanvas; const R: TRect;
-  ImageList: TCustomImageList; ImageIndex: Integer; Opacity: Byte);
-procedure HighlightTBXIcon(Canvas: TCanvas; const R: TRect;
-  ImageList: TCustomImageList; ImageIndex: Integer; HighlightColor: TColor; Amount: Byte);
 procedure DrawTBXIconShadow(Canvas: TCanvas; const R: TRect;
   ImageList: TCustomImageList; ImageIndex: Integer; Density: Integer);
 procedure DrawTBXIconFlatShadow(Canvas: TCanvas; const R: TRect;
   ImageList: TCustomImageList; ImageIndex: Integer; ShadowColor: TColor);
-procedure DrawTBXIconFullShadow(Canvas: TCanvas; const R: TRect;
-  ImageList: TCustomImageList; ImageIndex: Integer; ShadowColor: TColor);
 
 procedure DrawGlyph(DC: HDC; X, Y: Integer; ImageList: TCustomImageList; ImageIndex: Integer; Color: TColor); overload;
-procedure DrawGlyph(DC: HDC; const R: TRect; ImageList: TCustomImageList; ImageIndex: Integer; Color: TColor); overload;
-procedure DrawGlyph(DC: HDC; X, Y: Integer; const Bits; Color: TColor); overload;
 procedure DrawGlyph(DC: HDC; const R: TRect; Width, Height: Integer; const Bits; Color: TColor); overload;
 
-function GetClientSizeEx(Control: TWinControl): TPoint;
-
-const
-  SHD_DENSE = 0;
-  SHD_LIGHT = 1;
-
-{ An additional declaration for D4 compiler }
-type
-  PColor = ^TColor;
-
 { Stock Objects }
 var
   StockBitmap1, StockBitmap2: TBitmap;
@@ -184,194 +117,6 @@ implementation
 
 uses TB2Common, Math, Types;
 
-{$IFDEF TBX_UNICODE}
-
-function GetTextHeightW(DC: HDC): Integer;
-var
-  TextMetric: TTextMetricW;
-begin
-  GetTextMetricsW(DC, TextMetric);
-  Result := TextMetric.tmHeight;
-end;
-
-function GetTextWidthW(DC: HDC; const S: WideString; StripAccelChar: Boolean): Integer;
-var
-  Size: TSize;
-  S2: WideString;
-begin
-  if StripAccelChar then
-  begin
-    S2 := StripAccelCharsW(S);
-    GetTextExtentPoint32W(DC, PWideChar(S2), Length(S2), Size);
-  end
-  else GetTextExtentPoint32W(DC, PWideChar(S), Length(S), Size);
-  Result := Size.cx;
-end;
-
-procedure DrawRotatedTextW(DC: HDC; AText: WideString; const ARect: TRect; const AFormat: Cardinal);
-{ Like DrawText, but draws the text at a 270 degree angle.
-  The format flag this function respects are
-  DT_NOPREFIX, DT_HIDEPREFIX, DT_CENTER, DT_END_ELLIPSIS, DT_NOCLIP }
-var
-  RotatedFont, SaveFont: HFONT;
-  TextMetrics: TTextMetricW;
-  X, Y, P, I, SU, FU, W: Integer;
-  SaveAlign: UINT;
-  Clip: Boolean;
-
-  function GetSize(DC: HDC; const S: WideString): Integer;
-  var
-    Size: TSize;
-  begin
-    GetTextExtentPoint32W(DC, PWideChar(S), Length(S), Size);
-    Result := Size.cx;
-  end;
-
-begin
-  if Length(AText) = 0 then Exit;
-
-  RotatedFont := CreateRotatedFont(DC);
-  SaveFont := SelectObject(DC, RotatedFont);
-
-  GetTextMetricsW(DC, TextMetrics);
-  X := ARect.Left + ((ARect.Right - ARect.Left) - TextMetrics.tmHeight) div 2;
-
-  Clip := AFormat and DT_NOCLIP = 0;
-
-  { Find the index of the character that should be underlined. Delete '&'
-    characters from the string. Like DrawText, only the last prefixed character
-    will be underlined. }
-  P := 0;
-  I := 1;
-  if AFormat and DT_NOPREFIX = 0 then
-    while I <= Length(AText) do
-    begin
-      if AText[I] = '&' then
-      begin
-        Delete(AText, I, 1);
-        if PWideChar(AText)[I - 1] <> '&' then P := I;
-      end;
-      Inc(I);
-    end;
-
-  if AFormat and DT_END_ELLIPSIS <> 0 then
-  begin
-    if (Length(AText) > 1) and (GetSize(DC, AText) > ARect.Bottom - ARect.Top) then
-    begin
-      W := ARect.Bottom - ARect.Top;
-      if W > 2 then
-      begin
-        Delete(AText, Length(AText), 1);
-        while (Length(AText) > 1) and (GetSize(DC, AText + '...') > W) do
-          Delete(AText, Length(AText), 1);
-      end
-      else AText := AText[1];
-      if P > Length(AText) then P := 0;
-      AText := AText + '...';
-    end;
-  end;
-
-  if AFormat and DT_CENTER <> 0 then
-    Y := ARect.Top + ((ARect.Bottom - ARect.Top) - GetSize(DC, AText)) div 2
-  else
-    Y := ARect.Top;
-
-  if Clip then
-  begin
-    SaveDC(DC);
-    with ARect do IntersectClipRect(DC, Left, Top, Right, Bottom);
-  end;
-
-  SaveAlign := SetTextAlign(DC, TA_BOTTOM);
-  TextOutW(DC, X, Y, PWideChar(AText), Length(AText));
-  SetTextAlign(DC, SaveAlign);
-
-  { Underline }
-  if (P > 0) and (AFormat and DT_HIDEPREFIX = 0) then
-  begin
-    SU := GetTextWidthW(DC, Copy(AText, 1, P - 1), False);
-    FU := SU + GetTextWidthW(DC, PWideChar(AText)[P - 1], False);
-    Inc(X, TextMetrics.tmDescent - 2);
-    DrawLineEx(DC, X, Y + SU, X, Y + FU, GetTextColor(DC));
-  end;
-
-  if Clip then RestoreDC(DC, -1);
-
-  SelectObject(DC, SaveFont);
-  DeleteObject(RotatedFont);
-end;
-
-function EscapeAmpersandsW(const S: WideString): WideString;
-var
-  I: Integer;
-begin
-  Result := S;
-  I := 1;
-  while I <= Length(Result) do
-  begin
-    if Result[I] = '&' then
-    begin
-      Inc(I);
-      Insert('&', Result, I);
-    end;
-    Inc(I);
-  end;
-end;
-
-function FindAccelCharW(const S: WideString): WideChar;
-var
-  PStart, P: PWideChar;
-begin
-  { locate the last char with '&' prefix }
-  Result := #0;
-  if Length(S) > 0 then
-  begin
-    PStart := PWideChar(S);
-    P := PStart;
-    Inc(P, Length(S) - 2);
-    while P >= PStart do
-    begin
-      if P^ = '&' then
-      begin
-        if (P = PStart) or (PWideChar(Integer(P) - 2)^ <> '&') then
-        begin
-          Result := PWideChar(Integer(P) + 2)^;
-          Exit;
-        end
-        else Dec(P);
-      end;
-      Dec(P);
-    end;
-  end;
-end;
-
-function StripAccelCharsW(const S: WideString): WideString;
-var
-  I: Integer;
-begin
-  Result := S;
-  I := 1;
-  while I <= Length(Result) do
-  begin
-    if Result[I] = '&' then
-      System.Delete(Result, I, 1);
-    Inc(I);
-  end;
-end;
-
-function StripTrailingPunctuationW(const S: WideString): WideString;
-var
-  L: Integer;
-begin
-  Result := S;
-  L := Length(Result);
-  if (L > 1) and (Result[L] = ':') then SetLength(Result, L - 1)
-  else if (L > 3) and (Result[L - 2] = '.') and (Result[L - 1] = '.') and
-     (Result[L] = '.') then SetLength(Result, L - 3);
-end;
-
-{$ENDIF}
-
 type
   PPoints = ^TPoints;
   TPoints = array [0..0] of TPoint;
@@ -381,14 +126,6 @@ const
   WeightG: single = 1.52941;
   WeightB: single = 0.254902;
 
-procedure GetRGB(C: TColor; out R, G, B: Integer);
-begin
-  if Integer(C) < 0 then C := GetSysColor(C and $000000FF);
-  R := C and $FF;
-  G := C shr 8 and $FF;
-  B := C shr 16 and $FF;
-end;
-
 function MixColors(C1, C2: TColor; W1: Integer): TColor;
 var
   W2: Cardinal;
@@ -404,38 +141,6 @@ begin
     (Cardinal(C2) and $00FF00) * W2) and $00FF0000) shr 8;
 end;
 
-function SameColors(C1, C2: TColor): Boolean;
-begin
-  if C1 < 0 then C1 := GetSysColor(C1 and $000000FF);
-  if C2 < 0 then C2 := GetSysColor(C2 and $000000FF);
-  Result := C1 = C2;
-end;
-
-function Lighten(C: TColor; Amount: Integer): TColor;
-var
-  R, G, B: Integer;
-begin
-  if C < 0 then C := GetSysColor(C and $000000FF);
-  R := C and $FF + Amount;
-  G := C shr 8 and $FF + Amount;
-  B := C shr 16 and $FF + Amount;
-  if R < 0 then R := 0 else if R > 255 then R := 255;
-  if G < 0 then G := 0 else if G > 255 then G := 255;
-  if B < 0 then B := 0 else if B > 255 then B := 255;
-  Result := R or (G shl 8) or (B shl 16);
-end;
-
-function NearestLighten(C: TColor; Amount: Integer): TColor;
-begin
-  Result := GetNearestColor(StockCompatibleBitmap.Canvas.Handle, Lighten(C, Amount));
-end;
-
-function NearestMixedColor(C1, C2: TColor; W1: Integer): TColor;
-begin
-  Result := MixColors(C1, C2, W1);
-  Result := GetNearestColor(StockCompatibleBitmap.Canvas.Handle, Result);
-end;
-
 function ColorIntensity(C: TColor): Integer;
 begin
   if C < 0 then C := GetSysColor(C and $FF);
@@ -586,75 +291,6 @@ begin
     AdjustContrast(Integer(Color), BkgndColor, t);
 end;
 
-procedure RGBtoHSL(RGB: TColor; out H, S, L : Single);
-var
-  R, G, B, D, Cmax, Cmin: Single;
-begin
-  if RGB < 0 then RGB := GetSysColor(RGB and $FF);
-  R := GetRValue(RGB) / 255;
-  G := GetGValue(RGB) / 255;
-  B := GetBValue(RGB) / 255;
-  Cmax := Max(R, Max(G, B));
-  Cmin := Min(R, Min(G, B));
-  L := (Cmax + Cmin) / 2;
-
-  if Cmax = Cmin then
-  begin
-    H := 0;
-    S := 0
-  end
-  else
-  begin
-    D := Cmax - Cmin;
-    if L < 0.5 then S := D / (Cmax + Cmin)
-    else S := D / (2 - Cmax - Cmin);
-    if R = Cmax then H := (G - B) / D
-    else
-      if G = Cmax then H  := 2 + (B - R) / D
-      else H := 4 + (R - G) / D;
-    H := H / 6;
-    if H < 0 then H := H + 1
-  end;
-end;
-
-function HSLtoRGB(H, S, L: Single): TColor;
-const
-  OneOverThree = 1 / 3;
-var
-  M1, M2: Single;
-  R, G, B: Byte;
-
-  function HueToColor(Hue: Single): Byte;
-  var
-    V: Double;
-  begin
-    Hue := Hue - Floor(Hue);
-    if 6 * Hue < 1 then V := M1 + (M2 - M1) * Hue * 6
-    else if 2 * Hue < 1 then V := M2
-    else if 3 * Hue < 2 then V := M1 + (M2 - M1) * (2 / 3 - Hue) * 6
-    else V := M1;
-    Result := Round(255 * V);
-  end;
-
-begin
-  if S = 0 then
-  begin
-    R := Round(255 * L);
-    G := R;
-    B := R;
-  end
-  else
-  begin
-    if L <= 0.5 then M2 := L * (1 + S)
-    else M2 := L + S - L * S;
-    M1 := 2 * L - M2;
-    R := HueToColor(H + OneOverThree);
-    G := HueToColor(H);
-    B := HueToColor(H - OneOverThree)
-  end;
-  Result := RGB(R, G, B);
-end;
-
 const
   // This differs from PasTools as we use larger menu fonts
   OurDesignTimeTextHeight = 15;
@@ -697,28 +333,6 @@ asm
         MOV     AX,CX
 end;
 
-procedure SetPixelEx(DC: HDC; X, Y: Integer; C: TColorRef; Alpha: Longword = $FF);
-var
-  W2: Cardinal;
-  B: TColorRef;
-begin
-  if Alpha <= 0 then Exit
-  else if Alpha >= 255 then SetPixelV(DC, X, Y, C)
-  else
-  begin
-    B := GetPixel(DC, X, Y);
-    if B <> CLR_INVALID then
-    begin
-      Inc(Alpha, Integer(Alpha > 127));
-      W2 := 256 - Alpha;
-      B :=
-        ((C and $FF00FF) * Alpha + (B and $FF00FF) * W2 + $007F007F) and $FF00FF00 +
-        ((C and $00FF00) * Alpha + (B and $00FF00) * W2 + $00007F00) and $00FF0000;
-      SetPixelV(DC, X, Y, B shr 8);
-    end;
-  end;
-end;
-
 function CreatePenEx(Color: TColor): HPen;
 begin
   if Color = clNone then Result := CreatePen(PS_NULL, 1, 0)
@@ -735,8 +349,7 @@ begin
     LB.lbStyle := BS_HOLLOW;
     Result := CreateBrushIndirect(LB);
   end
-  {else if Color < 0 then Result := GetSysColorBrush(Color and $000000FF)} {vb-}
-  else begin {vb+}
+  else begin
     if Color < 0 then Color := GetSysColor(Color and $000000FF);
     Result := CreateSolidBrush(Color);
   end;
@@ -752,8 +365,7 @@ begin
     if Color < 0 then Brush := GetSysColorBrush(Color and $000000FF)
     else Brush := CreateSolidBrush(Color);
     Windows.FillRect(DC, Rect, Brush);
-    {DeleteObject(Brush);} {vb-}
-    if Color >= 0 then DeleteObject(Brush); {vb+}
+    if Color >= 0 then DeleteObject(Brush);
   end;
 end;
 
@@ -767,8 +379,7 @@ begin
     if Color < 0 then Brush := GetSysColorBrush(Color and $000000FF)
     else Brush := CreateSolidBrush(Color);
     Windows.FrameRect(DC, Rect, Brush);
-    {DeleteObject(Brush);} {vb-}
-    if Color >= 0 then DeleteObject(Brush); {vb+}
+    if Color >= 0 then DeleteObject(Brush);
   end;
   if Adjust then with Rect do
   begin
@@ -823,7 +434,7 @@ begin
 end;
 
 procedure RoundRectEx(DC: HDC; Left, Top, Right, Bottom: Integer;
-  EllipseWidth, EllipseHeight, OutlineColor, FillColor: TColor); {vb+}
+  EllipseWidth, EllipseHeight, OutlineColor, FillColor: TColor);
 var
   OldBrush, Brush: HBrush;
   OldPen, Pen: HPen;
@@ -840,14 +451,6 @@ begin
   DeleteObject(Pen);
 end;
 
-procedure RoundRectEx(DC: HDC; const R: TRect; EllipseWidth, EllipseHeight,
-  OutlineColor, FillColor: TColor); {vb+}
-begin
-  with R do
-    RoundRectEx(DC, Left, Top, Right, Bottom, EllipseWidth,
-      EllipseHeight, OutlineColor, FillColor);
-end;
-
 procedure EllipseEx(DC: HDC; Left, Top, Right, Bottom: Integer; OutlineColor, FillColor: TColor);
 var
   OldBrush, Brush: HBrush;
@@ -864,113 +467,6 @@ begin
   DeleteObject(Pen);
 end;
 
-function CreateDitheredBrush(C1, C2: TColor): HBrush;
-var
-  B: TBitmap;
-begin
-  B := AllocPatternBitmap(C1, C2);
-  B.HandleType := bmDDB;
-  Result := CreatePatternBrush(B.Handle);
-end;
-
-procedure DitherRect(DC: HDC; const R: TRect; C1, C2: TColor);
-var
-  Brush: HBRUSH;
-begin
-  Brush := CreateDitheredBrush(C1, C2);
-  FillRect(DC, R, Brush);
-  DeleteObject(Brush);
-end;
-
-procedure Frame3D(DC: HDC; var Rect: TRect; TopColor, BottomColor: TColor; Adjust: Boolean);
-var
-  TopRight, BottomLeft: TPoint;
-begin
-  with Rect do
-  begin
-    Dec(Bottom); Dec(Right);
-    TopRight.X := Right;
-    TopRight.Y := Top;
-    BottomLeft.X := Left;
-    BottomLeft.Y := Bottom;
-    PolyLineEx(DC, [BottomLeft, TopLeft, TopRight], TopColor);
-    Dec(BottomLeft.X);
-    PolyLineEx(DC, [TopRight, BottomRight, BottomLeft], BottomColor);
-    if Adjust then
-    begin
-      Inc(Left);
-      Inc(Top);
-    end
-    else
-    begin
-      Dec(Right);
-      Dec(Bottom);
-    end;
-  end;
-end;
-
-
-{$IFDEF COMPATIBLE_GFX}
-procedure DitherRect(Canvas: TCanvas; const R: TRect; C1, C2: TColor);
-begin
-  DitherRect(Canvas.Handle, R, C1, C2);
-end;
-
-procedure Frame3D(Canvas: TCanvas; var Rect: TRect; TopColor, BottomColor: TColor);
-var
-  TopRight, BottomLeft: TPoint;
-begin
-  with Canvas, Rect do
-  begin
-    Pen.Width := 1;
-    Dec(Bottom); Dec(Right);
-    TopRight.X := Right;
-    TopRight.Y := Top;
-    BottomLeft.X := Left;
-    BottomLeft.Y := Bottom;
-    Pen.Color := TopColor;
-    PolyLine([BottomLeft, TopLeft, TopRight]);
-    Pen.Color := BottomColor;
-    Dec(BottomLeft.X);
-    PolyLine([TopRight, BottomRight, BottomLeft]);
-    Inc(Left); Inc(Top);
-  end;
-end;
-
-function FillRectEx(Canvas: TCanvas; const Rect: TRect; Color: TColor): Boolean;
-begin
-  Result := FillRectEx(Canvas.Handle, Rect, Color);
-end;
-
-function  FillRectEx2(DC: HDC; const Rect: TRect; Color: TColor): Boolean; deprecated;
-begin
-  Result := FillRectEx(DC, Rect, Color);
-end;
-
-function FrameRectEx(Canvas: TCanvas; var Rect: TRect; Color: TColor; Adjust: Boolean = False): Boolean;
-begin
-  Result := FrameRectEx(Canvas.Handle, Rect, Color, Adjust);
-end;
-
-function FrameRectEx2(DC: HDC; var Rect: TRect; Color: TColor; Adjust: Boolean = False): Boolean; deprecated;
-begin
-  Result := FrameRectEx(DC, Rect, Color, Adjust);
-end;
-
-procedure DrawLineEx(Canvas: TCanvas; X1, Y1, X2, Y2: Integer; Color: TColor);
-begin
-  DrawLineEx(Canvas.Handle, X1, Y1, X2, Y2, Color);
-end;
-{$ENDIF}
-
-procedure DrawDraggingOutline(DC: HDC; const NewRect, OldRect: TRect);
-var
-  Sz: TSize;
-begin
-  Sz.CX := 3; Sz.CY := 2;
-  DrawHalftoneInvertRect(DC, @NewRect, @OldRect, Sz, Sz);
-end;
-
 procedure FillLongword(var X; Count: Integer; Value: Longword);
 asm
 // EAX = X;  EDX = Count; ECX = Value
@@ -1007,130 +503,6 @@ begin
   ImageList.Draw(Canvas, R.Left, R.Top, ImageIndex);
 end;
 
-procedure BlendTBXIcon(Canvas: TCanvas; const R: TRect;
-  ImageList: TCustomImageList; ImageIndex: Integer; Opacity: Byte);
-{const
-  CWeirdColor = $00203241;} {vb -}
-var
-  ImageWidth, ImageHeight: Integer;
-  I, J: Integer;
-  Src, Dst: ^Cardinal;
-  S, C, CBRB, CBG: Cardinal;
-  Wt1, Wt2: Cardinal;
-begin
-  Wt2 := Opacity;
-  Wt1 := 255 - Wt2;
-  ImageWidth := R.Right - R.Left;
-  ImageHeight := R.Bottom - R.Top;
-  with ImageList do
-  begin
-    if Width < ImageWidth then ImageWidth := Width;
-    if Height < ImageHeight then ImageHeight :=  Height;
-  end;
-
-  StockBitmap1.Width := ImageWidth;
-  StockBitmap1.Height := ImageHeight;
-  StockBitmap2.Width := ImageWidth;
-  StockBitmap2.Height := ImageHeight;
-
-  BitBlt(StockBitmap1.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
-    Canvas.Handle, R.Left, R.Top, SRCCOPY);
-  {BitBlt(StockBitmap2.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
-    StockBitmap1.Canvas.Handle, 0, 0, SRCCOPY);} {vb -}
-  BitBlt(StockBitmap2.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
-    Canvas.Handle, R.Left, R.Top, SRCCOPY); {vb +}
-  ImageList.Draw(StockBitmap2.Canvas, 0, 0, ImageIndex, True);
-
-  for J := 0 to ImageHeight - 1 do
-  begin
-    Src := StockBitmap2.ScanLine[J];
-    Dst := StockBitmap1.ScanLine[J];
-    for I := 0 to ImageWidth - 1 do
-    begin
-      S := Src^;
-      if S <> Dst^ then
-      begin
-        CBRB := (Dst^ and $00FF00FF) * Wt1;
-        CBG  := (Dst^ and $0000FF00) * Wt1;
-        {C := ((S and $FF00FF) * Wt2 + CBRB) and $FF00FF00 +
-          ((S and $00FF00) * Wt2 + CBG) and $00FF0000;} {vb -}
-        C := ((S and $00FF00FF) * Wt2 + CBRB) and $FF00FF00 +
-          ((S and $0000FF00) * Wt2 + CBG) and $00FF0000; {vb +}
-        Dst^ := C shr 8;
-      end;
-      Inc(Src);
-      Inc(Dst);
-    end;
-  end;
-  BitBlt(Canvas.Handle, R.Left, R.Top, ImageWidth, ImageHeight,
-    StockBitmap1.Canvas.Handle, 0, 0, SRCCOPY);
-end;
-
-procedure HighlightTBXIcon(Canvas: TCanvas; const R: TRect;
-  ImageList: TCustomImageList; ImageIndex: Integer; HighlightColor: TColor; Amount: Byte);
-{const
-  CWeirdColor = $00203241;} {vb -}
-var
-  ImageWidth, ImageHeight: Integer;
-  I, J: Integer;
-  {Src, Dst: PColor;} {vb -}
-  Src, Dst: ^Cardinal; {vb +}
-  S, C: Cardinal;
-  CBRB, CBG: Cardinal;
-  W1, W2: Cardinal;
-begin
-  ImageWidth := R.Right - R.Left;
-  ImageHeight := R.Bottom - R.Top;
-  with ImageList do
-  begin
-    if Width < ImageWidth then ImageWidth := Width;
-    if Height < ImageHeight then ImageHeight :=  Height;
-  end;
-
-  StockBitmap1.Width := ImageWidth;
-  StockBitmap1.Height := ImageHeight;
-  StockBitmap2.Width := ImageWidth;
-  StockBitmap2.Height := ImageHeight;
-
-  BitBlt(StockBitmap1.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
-    Canvas.Handle, R.Left, R.Top, SRCCOPY);
-  {for J := 0 to ImageHeight - 1 do
-    FillLongWord(StockBitmap2.ScanLine[J]^, ImageWidth, CWeirdColor);} {vb -}
-  BitBlt(StockBitmap2.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
-    Canvas.Handle, R.Left, R.Top, SRCCOPY); {vb +}
-  ImageList.Draw(StockBitmap2.Canvas, 0, 0, ImageIndex);
-
-  W2 := Amount;
-  W1 := 255 - W2;
-  HighlightColor := GetBGR(ColorToRGB(HighlightColor));
-  CBRB := (Cardinal(HighlightColor) and $00FF00FF) * W1;
-  CBG  := (Cardinal(HighlightColor) and $0000FF00) * W1;
-
-  for J := 0 to ImageHeight - 1 do
-  begin
-    Src := StockBitmap2.ScanLine[J];
-    Dst := StockBitmap1.ScanLine[J];
-    for I := 0 to ImageWidth - 1 do
-    begin
-      {S := Src^ and $00FFFFFF;} {vb -}
-      S := Src^; {vb +}
-      {if S <> CWeirdColor then} {vb -}
-      if S <> Dst^ then {vb +}
-      begin
-        {C := ((S and $FF00FF) * W2 + CBRB) and $FF00FF00 +
-          ((S and $00FF00) * W2 + CBG) and $00FF0000;} {vb -}
-        C := ((S and $00FF00FF) * W2 + CBRB) and $FF00FF00 +
-          ((S and $0000FF00) * W2 + CBG) and $00FF0000; {vb +}
-        Dst^ := C shr 8;
-      end;
-      Inc(Src);
-      Inc(Dst);
-    end;
-  end;
-  BitBlt(Canvas.Handle, R.Left, R.Top, ImageWidth, ImageHeight,
-    StockBitmap1.Canvas.Handle, 0, 0, SRCCOPY);
-end;
-
 procedure DrawTBXIconShadow(Canvas: TCanvas; const R: TRect;
   ImageList: TCustomImageList; ImageIndex: Integer; Density: Integer);
 const
@@ -1159,10 +531,8 @@ begin
 
   BitBlt(StockBitmap1.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
     Canvas.Handle, R.Left, R.Top, SRCCOPY);
-  {BitBlt(StockBitmap2.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
-    StockBitmap1.Canvas.Handle, 0, 0, SRCCOPY);} {vb -}
   BitBlt(StockBitmap2.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
-    Canvas.Handle, R.Left, R.Top, SRCCOPY); {vb +}
+    Canvas.Handle, R.Left, R.Top, SRCCOPY);
   ImageList.Draw(StockBitmap2.Canvas, 0, 0, ImageIndex, True);
 
   for J := 0 to ImageHeight - 1 do
@@ -1176,10 +546,8 @@ begin
       begin
         CBRB := Dst^ and $00FF00FF;
         CBG  := Dst^ and $0000FF00;
-        {C := ((S and $FF0000) shr 16 * 29 + (S and $00FF00) shr 8 * 150 +
-          (S and $0000FF) * 76) shr 8;} {vb -}
         C := ((S and $00FF0000) shr 16 * 29 + (S and $0000FF00) shr 8 * 150 +
-          (S and $000000FF) * 76) shr 8; {vb +}
+          (S and $000000FF) * 76) shr 8;
         C := C div D_DIV[Density] + D_ADD[Density];
         Dst^ := ((CBRB * C and $FF00FF00) or (CBG * C and $00FF0000)) shr 8;
       end;
@@ -1246,57 +614,6 @@ begin
   BitBlt(DstDC, R.Left, R.Top, ImageWidth, ImageHeight, SrcDC, 0, 0, ROP_DSPDxax);
 end;
 
-procedure DrawTBXIconFullShadow(Canvas: TCanvas; const R: TRect;
-  ImageList: TCustomImageList; ImageIndex: Integer; ShadowColor: TColor);
-const
-  CWeirdColor = $00203241;
-var
-  ImageWidth, ImageHeight: Integer;
-  I, J: Integer;
-  P: ^Cardinal;
-  C: Cardinal;
-  SrcDC, DstDC: HDC;
-begin
-  ImageWidth := R.Right - R.Left;
-  ImageHeight := R.Bottom - R.Top;
-  with ImageList do
-  begin
-    if Width < ImageWidth then ImageWidth := Width;
-    if Height < ImageHeight then ImageHeight :=  Height;
-  end;
-
-  StockBitmap2.Width := ImageWidth;
-  StockBitmap2.Height := ImageHeight;
-  for J := 0 to ImageHeight - 1 do
-    FillLongWord(StockBitmap2.ScanLine[J]^, ImageWidth, CWeirdColor);
-  ImageList.Draw(StockBitmap2.Canvas, 0, 0, ImageIndex, True);
-
-  for J := 0 to ImageHeight - 1 do
-  begin
-    P := StockBitmap2.ScanLine[J];
-    for I := 0 to ImageWidth - 1 do
-    begin
-      C := P^ and $00FFFFFF;
-      if C <> CWeirdColor then P^ := $00000000
-      else P^ := $00FFFFFF;
-      Inc(P);
-    end;
-  end;
-
-  StockMonoBitmap.Width := ImageWidth;
-  StockMonoBitmap.Height := ImageHeight;
-  StockMonoBitmap.Canvas.Brush.Color := clBlack;
-  BitBlt(StockMonoBitmap.Canvas.Handle, 0, 0, ImageWidth, ImageHeight,
-    StockBitmap2.Canvas.Handle, 0, 0, SRCCOPY);
-
-  SrcDC := StockMonoBitmap.Canvas.Handle;
-  Canvas.Brush.Color := ColorToRGB(ShadowColor);
-  DstDC := Canvas.Handle;
-  Windows.SetTextColor(DstDC, clWhite);
-  Windows.SetBkColor(DstDC, clBlack);
-  BitBlt(DstDC, R.Left, R.Top, ImageWidth, ImageHeight, SrcDC, 0, 0, ROP_DSPDxax);
-end;
-
 procedure DrawGlyph(DC: HDC; X, Y: Integer; ImageList: TCustomImageList; ImageIndex: Integer; Color: TColor);
 var
   B: TBitmap;
@@ -1320,32 +637,6 @@ begin
   B.Free;
 end;
 
-procedure DrawGlyph(DC: HDC; const R: TRect; ImageList: TCustomImageList; ImageIndex: Integer; Color: TColor); overload;
-begin
-  DrawGlyph(DC, (R.Left + R.Right + 1 - ImageList.Width) div 2, (R.Top + R.Bottom + 1 - ImageList.Height) div 2, ImageList, ImageIndex, Color);
-end;
-
-procedure DrawGlyph(DC: HDC; X, Y: Integer; const Bits; Color: TColor); overload;
-var
-  B: TBitmap;
-  OldTextColor, OldBkColor: Longword;
-  OldBrush, Brush: HBrush;
-begin
-  B := TBitmap.Create;
-  B.Handle := CreateBitmap(8, 8, 1, 1, @Bits);
-  OldTextColor := SetTextColor(DC, clBlack);
-  OldBkColor := SetBkColor(DC, clWhite);
-  if Color < 0 then Brush := GetSysColorBrush(Color and $FF)
-  else Brush := CreateSolidBrush(Color);
-  OldBrush := SelectObject(DC, Brush);
-  BitBlt(DC, X, Y, 8, 8, B.Canvas.Handle, 0, 0, ROP_DSPDxax);
-  SelectObject(DC, OldBrush);
-  if Color >= 0 then DeleteObject(Brush);
-  SetTextColor(DC, OldTextColor);
-  SetBkColor(DC, OldBkColor);
-  B.Free;
-end;
-
 procedure DrawGlyph(DC: HDC; const R: TRect; Width, Height: Integer; const Bits; Color: TColor); overload;
 var
   B: TBitmap;
@@ -1367,22 +658,6 @@ begin
   B.Free;
 end;
 
-type
-  TCustomFormAccess = class(TCustomForm);
-
-function GetClientSizeEx(Control: TWinControl): TPoint;
-var
-  R: TRect;
-begin
-  if (Control is TCustomForm) and (TCustomFormAccess(Control).FormStyle = fsMDIForm)
-    and not (csDesigning in Control.ComponentState) then
-    GetWindowRect(TCustomFormAccess(Control).ClientHandle, R)
-  else
-    R := Control.ClientRect;
-  Result.X := R.Right - R.Left;
-  Result.Y := R.Bottom - R.Top;
-end;
-
 procedure InitializeStock;
 var
   NonClientMetrics: TNonClientMetrics;
@@ -1814,368 +1089,8 @@ begin
   if H3 <> nil then H3.Show(ParentHandle);
 end;
 
-{ Gradients } //////////////////////////////////////////////////////////////////
-
-const
-  GRADIENT_CACHE_SIZE = 16;
-
-type
-  PRGBQuad = ^TRGBQuad;
-  TRGBQuad = Integer;
-  PRGBQuadArray = ^TRGBQuadArray;
-  TRGBQuadArray = array [0..0] of TRGBQuad;
-
-
-var
-  GradientCache: array [0..GRADIENT_CACHE_SIZE] of array of TRGBQuad;
-  NextCacheIndex: Integer = 0;
-
-function FindGradient(Size: Integer; CL, CR: TRGBQuad): Integer;
-begin
-  Assert(Size > 0);
-  Result := GRADIENT_CACHE_SIZE - 1;
-  while Result >= 0 do
-  begin
-    if (Length(GradientCache[Result]) = Size) and
-      (GradientCache[Result][0] = CL) and
-      (GradientCache[Result][Length(GradientCache[Result]) - 1] = CR) then Exit;
-    Dec(Result);
-  end;
-end;
-
-function MakeGradient(Size: Integer; CL, CR: TRGBQuad): Integer;
-var
-  R1, G1, B1: Integer;
-  R2, G2, B2: Integer;
-  R, G, B: Integer;
-  I: Integer;
-  Bias: Integer;
-begin
-  Assert(Size > 0);
-  Result := NextCacheIndex;
-  Inc(NextCacheIndex);
-  if NextCacheIndex >= GRADIENT_CACHE_SIZE then NextCacheIndex := 0;
-  R1 := CL and $FF;
-  G1 := CL shr 8 and $FF;
-  B1 := CL shr 16 and $FF;
-  R2 := CR and $FF - R1;
-  G2 := CR shr 8 and $FF - G1;
-  B2 := CR shr 16 and $FF - B1;
-  SetLength(GradientCache[Result], Size);
-  Dec(Size);
-  Bias := Size div 2;
-  if Size > 0 then
-    for I := 0 to Size do
-    begin
-      R := R1 + (R2 * I + Bias) div Size;
-      G := G1 + (G2 * I + Bias) div Size;
-      B := B1 + (B2 * I + Bias) div Size;
-      GradientCache[Result][I] := R + G shl 8 + B shl 16;
-    end
-  else
-  begin
-    R := R1 + R2 div 2;
-    G := G1 + G2 div 2;
-    B := B1 + B2 div 2;
-    GradientCache[Result][0] := R + G shl 8 + B shl 16;
-  end;
-end;
-
-function GetGradient(Size: Integer; CL, CR: TRGBQuad): Integer;
-begin
-  Result := FindGradient(Size, CL, CR);
-  if Result < 0 then Result := MakeGradient(Size, CL, CR);
-end;
-
-{ GradFill function }
-
-procedure GradFill(DC: HDC; ARect: TRect; ClrTopLeft, ClrBottomRight: TColor; Kind: TGradientKind);
-const
-  GRAD_MODE: array [TGradientKind] of DWORD = (GRADIENT_FILL_RECT_H, GRADIENT_FILL_RECT_V);
-  W: array [TGradientKind] of Integer = (2, 1);
-  H: array [TGradientKind] of Integer = (1, 2);
-type
-  TriVertex = packed record
-    X, Y: Longint;
-    R, G, B, A: Word;
-  end;
-var
-  V: array [0..1] of TriVertex;
-  GR: GRADIENT_RECT;
-begin
-  if not RectVisible(DC, ARect) then Exit;
-
-  ClrTopLeft := ColorToRGB(ClrTopLeft);
-  ClrBottomRight := ColorToRGB(ClrBottomRight);
-
-  with V[0] do
-  begin
-    X := ARect.Left;
-    Y := ARect.Top;
-    R := ClrTopLeft shl 8 and $FF00;
-    G := ClrTopLeft and $FF00;
-    B := ClrTopLeft shr 8 and $FF00;
-    A := 0;
-  end;
-  with V[1] do
-  begin
-    X := ARect.Right;
-    Y := ARect.Bottom;
-    R := ClrBottomRight shl 8 and $FF00;
-    G := ClrBottomRight and $FF00;
-    B := ClrBottomRight shr 8 and $FF00;
-    A := 0;
-  end;
-  GR.UpperLeft := 0; GR.LowerRight := 1;
-  GradientFill(DC, @V, 2, @GR, 1, GRAD_MODE[Kind]);
-end;
-
-{ Brushed Fill } ///////////////////////////////////////////////////////////////
-
-{ Templates }
-
-const
-  NUM_TEMPLATES = 8;
-  MIN_TEMPLATE_SIZE = 100;
-  MAX_TEMPLATE_SIZE = 200;
-
-var
-  ThreadTemplates: array [0..NUM_TEMPLATES - 1] of array of Integer;
-  RandThreadIndex: array [0..1023] of Integer;
-  RandThreadPositions: array [0..1023] of Integer;
-
-procedure InitializeBrushedFill;
-const
-  Pi = 3.14159265358987;
-var
-  TemplateIndex, Size, I, V, V1, V2: Integer;
-  T, R12, R13, R14, R21, R22, R23, R24: Single;
-begin
-  { Make thread templates }
-  for TemplateIndex := 0 to NUM_TEMPLATES - 1 do
-  begin
-    Size := (MIN_TEMPLATE_SIZE + Random(MAX_TEMPLATE_SIZE - MIN_TEMPLATE_SIZE + 1)) div 2;
-    SetLength(ThreadTemplates[TemplateIndex], Size * 2);
-    R12 := Random * 2 * Pi;
-    R13 := Random * 2 * Pi;
-    R14 := Random * 2 * Pi;
-    R21 := Random * 2 * Pi;
-    R22 := Random * 2 * Pi;
-    R23 := Random * 2 * Pi;
-    R24 := Random * 2 * Pi;
-    for I := 0 to Size - 1 do
-    begin
-      T := 2 * Pi * I / Size;
-      V1 := Round(150 * Sin(T) + 100 * Sin(2 * T + R12) + 50 * Sin(3 * T + R13) + 20 * Sin(4 * T + R14));
-      if V1 > 255 then V1 := 255;
-      if V1 < -255 then V1 := -255;
-
-      V2 := Round(150 * Sin(T + R21) + 100 * Sin(2 * T + R22) + 50 * Sin(3 * T + R23) + 20 * Sin(4 * T + R24));
-      if V2 > 255 then V2 := 255;
-      if V2 < -255 then V2 := -255;
-
-      if Abs(V2 - V1) > 300 then
-      begin
-        V := (V1 + V2) div 2;
-        V1 := V - 150;
-        V2 := V + 150;
-      end;
-
-      ThreadTemplates[TemplateIndex][I * 2] := Min(V1, V2);
-      ThreadTemplates[TemplateIndex][I * 2 + 1] := Max(V1, V2);
-    end;
-  end;
-
-  { Initialize Rand arrays }
-  for I := 0 to 1023 do
-  begin
-    RandThreadIndex[I] := Random(NUM_TEMPLATES);
-    V1 := Random(Length(ThreadTemplates[RandThreadIndex[I]])) and not $1;
-    if Odd(I) then Inc(V1);
-    RandThreadPositions[I] := V1;
-  end;
-end;
-
-{ Cache }
-
-const
-  THREAD_CACHE_SIZE = 16;
-
-type
-  TThreadCacheItem = record
-    BaseColor: TColorRef;
-    Roughness: Integer;
-    Bitmaps: array [0..NUM_TEMPLATES - 1] of HBITMAP;
-  end;
-
-var
-  ThreadCache: array [0..THREAD_CACHE_SIZE] of TThreadCacheItem;
-  NextCacheEntry: Integer = 0;
-
-procedure ClearCacheItem(var CacheItem: TThreadCacheItem);
-var
-  I: Integer;
-begin
-  with CacheItem do
-  begin
-    BaseColor := $FFFFFFFF;
-    Roughness := -1;
-    for I := NUM_TEMPLATES - 1 downto 0 do
-    begin
-      if Bitmaps[I] <> 0 then
-      begin
-        DeleteObject(Bitmaps[I]);
-        Bitmaps[I] := 0;
-      end;
-    end;
-  end;
-end;
-
-procedure ResetBrushedFillCache;
-var
-  I: Integer;
-begin
-  { Should be called each time the screen parameters change }
-  for I := THREAD_CACHE_SIZE - 1 downto 0 do ClearCacheItem(ThreadCache[I]);
-end;
-
-procedure FinalizeBrushedFill;
-begin
-  ResetBrushedFillCache;
-end;
-
-procedure MakeCacheItem(var CacheItem: TThreadCacheItem; Color: TColorRef; Roughness: Integer);
-var
-  TemplateIndex, Size, I, V: Integer;
-  CR, CG, CB: Integer;
-  R, G, B: Integer;
-  ScreenDC: HDC;
-  BMI: TBitmapInfo;
-  Bits: PRGBQuadArray;
-  DIBSection: HBITMAP;
-  DIBDC, CacheDC: HDC;
-begin
-  ScreenDC := GetDC(0);
-  FillChar(BMI, SizeOf(TBitmapInfo), 0);
-  with BMI.bmiHeader do
-  begin
-    biSize := SizeOf(TBitmapInfoHeader);
-    biPlanes := 1;
-    biCompression := BI_RGB;
-    biWidth := MAX_TEMPLATE_SIZE;
-    biHeight := -1;
-    biBitCount := 32;
-  end;
-  DIBSection := CreateDIBSection(0, BMI, DIB_RGB_COLORS, Pointer(Bits), 0, 0);
-  DIBDC := CreateCompatibleDC(0);
-  SelectObject(DIBDC, DIBSection);
-  CacheDC := CreateCompatibleDC(0);
-
-  CR := Color shl 8 and $FF00;
-  CG := Color and $FF00;
-  CB := Color shr 8 and $FF00;
-
-  try
-  for TemplateIndex := 0 to NUM_TEMPLATES - 1 do
-  begin
-    CacheItem.BaseColor := Color;
-    CacheItem.Roughness := Roughness;
-    Size := Length(ThreadTemplates[TemplateIndex]);
-
-      if CacheItem.Bitmaps[TemplateIndex] = 0 then
-        CacheItem.Bitmaps[TemplateIndex] := CreateCompatibleBitmap(ScreenDC, Size, 1);
-      SelectObject(CacheDC, CacheItem.Bitmaps[TemplateIndex]);
-
-    for I := 0 to Size - 1 do
-    begin
-      V := ThreadTemplates[TemplateIndex][I];
-      R := CR + V * Roughness;
-      G := CG + V * Roughness;
-      B := CB + V * Roughness;
-      if R < 0 then R := 0;
-      if G < 0 then G := 0;
-      if B < 0 then B := 0;
-      if R > $EF00 then R := $EF00;
-      if G > $EF00 then G := $EF00;
-      if B > $EF00 then B := $EF00;
-      Bits^[I] := (R and $FF00 + (G and $FF00) shl 8 + (B and $FF00) shl 16) shr 8;
-    end;
-
-      BitBlt(CacheDC, 0, 0, Size, 1, DIBDC, 0, 0, SRCCOPY);
-    end;
-
-  finally
-    DeleteDC(CacheDC);
-    DeleteDC(DIBDC);
-    DeleteObject(DIBSection);
-    ReleaseDC(0, ScreenDC);
-  end;
-end;
-
-function FindCacheItem(Color: TColorRef; Roughness: Integer): Integer;
-begin
-  Result := THREAD_CACHE_SIZE - 1;
-  while Result >= 0 do
-    if (ThreadCache[Result].BaseColor = Color) and (ThreadCache[Result].Roughness = Roughness) then Exit
-    else Dec(Result);
-end;
-
-function GetCacheItem(Color: TColorRef; Roughness: Integer): Integer;
-begin
-  Result := FindCacheItem(Color, Roughness);
-  if Result >= 0 then Exit
-  else
-  begin
-    Result := NextCacheEntry;
-    MakeCacheItem(ThreadCache[Result], Color, Roughness);
-    NextCacheEntry := (NextCacheEntry + 1) mod THREAD_CACHE_SIZE;
-  end;
-end;
-
-procedure BrushedFill(DC: HDC; Origin: PPoint; ARect: TRect; Color: TColor; Roughness: Integer);
-const
-  ZeroOrigin: TPoint = (X: 0; Y: 0);
-var
-  CR: TColorRef;
-  X, Y: Integer;
-  CacheIndex: Integer;
-  TemplateIndex: Integer;
-  CacheDC: HDC;
-  Size: Integer;
-  BoxR: TRect;
-begin
-  if (Color = clNone) or not RectVisible(DC, ARect) then Exit;
-  CR := GetBGR(ColorToRGB(Color));
-  if Origin = nil then Origin := @ZeroOrigin;
-  CacheIndex := GetCacheItem(CR, Roughness);
-  GetClipBox(DC, BoxR);
-  IntersectRect(ARect, ARect, BoxR);
-  SaveDC(DC);
-  with ARect do IntersectClipRect(DC, Left, Top, Right, Bottom);
-
-  CacheDC := CreateCompatibleDC(0);
-  for Y := ARect.Top to ARect.Bottom - 1 do
-  begin
-    TemplateIndex := RandThreadIndex[(65536 + Y - Origin.Y) mod 1024];
-    Size := Length(ThreadTemplates[TemplateIndex]);
-    X := -RandThreadPositions[(65536 + Y - Origin.Y) mod 1024] + Origin.X;
-    SelectObject(CacheDC, ThreadCache[CacheIndex].Bitmaps[TemplateIndex]);
-    while X < ARect.Right do
-    begin
-      if X + Size >= ARect.Left then BitBlt(DC, X, Y, Size, 1, CacheDC, 0, 0, SRCCOPY);
-      Inc(X, Size);
-    end;
-  end;
-  DeleteDC(CacheDC);
-
-  RestoreDC(DC, -1);
-end;
-
 initialization
   InitializeStock;
-  InitializeBrushedFill;
-  ResetBrushedFillCache;
 finalization
-  FinalizeBrushedFill;
   FinalizeStock;
 end.

+ 1 - 1
source/tbxp.cbproj

@@ -40,7 +40,7 @@
 		<DCC_EXPLICIT_STRING_CAST_LOSS>true</DCC_EXPLICIT_STRING_CAST_LOSS>
 		<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace)</DCC_Namespace>
 		<DCC_UnitSearchPath>packages\tbx;packages\tb2k;packages\my;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
-		<Defines>MPEXCLUDE;TBX_UNICODE;$(Defines)</Defines>
+		<Defines>MPEXCLUDE;$(Defines)</Defines>
 		<FinalOutputDir>$(INTERM_PATH)\$(Platform)\$(Config)</FinalOutputDir>
 		<ILINK_Description>Toolbar2000 -- TBX Extensions (Alex Denisov)</ILINK_Description>
 		<ILINK_GenerateImportLibrary>true</ILINK_GenerateImportLibrary>