Permalink
Browse files

Preparing 64bit version

  • Loading branch information...
pyscripter committed Nov 26, 2011
1 parent 43de543 commit 902ea9e1162e7badb69438164b9a6814fd934e88
Showing with 3,461 additions and 2,979 deletions.
  1. +36 −30 SpTBXItem.pas
  2. +3 −3 TB2Item.pas
  3. +3 −3 VirtualExplorerTree.pas
  4. +3,414 −2,936 VirtualTrees.pas
  5. +0 −2 frmPyIDEMain.dfm
  6. +5 −5 frmPyIDEMain.pas
View
@@ -1,7 +1,7 @@
unit SpTBXItem;
{==============================================================================
-Version 2.4.5
+Version 2.4.6
The contents of this file are subject to the SpTBXLib License; you may
not use or distribute this file except in compliance with the
@@ -71,7 +71,7 @@
-
History:
-7 September 2010 - version 2.4.6
+25 June 2011 - version 2.4.6
- Fixed TSpTBXTitleBar bug, OnSystemMenuPopup was not fired
when the system menu was showed, thanks to Sebastien for
reporting this.
@@ -384,7 +384,7 @@
interface
{$BOOLEVAL OFF} // Unit depends on short-circuit boolean evaluation
-{$I TB2Ver.inc}
+{$I SpTBXVer.inc}
uses
Windows, Messages, Classes, SysUtils, Forms, Controls, Graphics, ImgList,
@@ -2678,7 +2678,7 @@ procedure SpDrawXPToolbarButton(ACanvas: TCanvas; ARect: TRect; State: TSpTBXSki
sknsChecked: Flags := TS_CHECKED;
sknsCheckedAndHotTrack: Flags := TS_HOTCHECKED;
end;
- DrawThemeBackground(ThemeServices.Theme[teToolBar], ACanvas.Handle, XPPart[ComboPart], Flags, ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teToolBar], ACanvas.Handle, XPPart[ComboPart], Flags, ARect, nil);
end;
sknSkin:
begin
@@ -2733,7 +2733,7 @@ procedure SpDrawXPMenuItem(ACanvas: TCanvas; ARect: TRect; ItemInfo: TSpTBXMenuI
sknsPushed: Flags := MBI_PUSHED;
end;
- DrawThemeBackground(ThemeServices.Theme[teMenu], ACanvas.Handle, MENU_BARITEM, Flags, ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teMenu], ACanvas.Handle, MENU_BARITEM, Flags, ARect, nil);
end
else
if ItemInfo.State in [sknsHotTrack, sknsPushed, sknsChecked, sknsCheckedAndHotTrack] then
@@ -2770,7 +2770,7 @@ procedure SpDrawXPMenuItem(ACanvas: TCanvas; ARect: TRect; ItemInfo: TSpTBXMenuI
// Use the new API on Windows Vista
if ItemInfo.Enabled then Flags := MPI_HOT
else Flags := MPI_DISABLEDHOT;
- DrawThemeBackground(ThemeServices.Theme[teMenu], ACanvas.Handle, MENU_POPUPITEM, Flags, ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teMenu], ACanvas.Handle, MENU_POPUPITEM, Flags, ARect, nil);
end
else
SpFillRect(ACanvas, ARect, clHighlight);
@@ -2853,7 +2853,7 @@ procedure SpDrawXPMenuItem(ACanvas: TCanvas; ARect: TRect; ItemInfo: TSpTBXMenuI
if ItemInfo.State = sknsDisabled then Flags := MCB_DISABLED
else if ItemInfo.ImageShown then Flags := MCB_BITMAP
else Flags := MCB_NORMAL;
- DrawThemeBackground(ThemeServices.Theme[teMenu], ACanvas.Handle, MENU_POPUPCHECKBACKGROUND, Flags, R, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teMenu], ACanvas.Handle, MENU_POPUPCHECKBACKGROUND, Flags, R, nil);
end
else
if ItemInfo.SkinType = sknSkin then
@@ -2898,9 +2898,9 @@ procedure SpDrawXPMenuSeparator(ACanvas: TCanvas; ARect: TRect; MenuItemStyle, V
sknWindows:
if MenuItemStyle and SpIsWinVistaOrUp then begin
// Use the new API in Windows Vista
- GetThemePartSize(ThemeServices.Theme[teMenu], 0, MENU_POPUPSEPARATOR, 0, nil, TS_TRUE, VistaSeparatorSize);
+ GetThemePartSize({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teMenu], 0, MENU_POPUPSEPARATOR, 0, nil, TS_TRUE, VistaSeparatorSize);
R := SpCenterRectVert(R, VistaSeparatorSize.cy);
- DrawThemeBackground(ThemeServices.Theme[teMenu], ACanvas.Handle, MENU_POPUPSEPARATOR, 0, R, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teMenu], ACanvas.Handle, MENU_POPUPSEPARATOR, 0, R, nil);
end
else begin
if MenuItemStyle then begin
@@ -2917,7 +2917,7 @@ procedure SpDrawXPMenuSeparator(ACanvas: TCanvas; ARect: TRect; MenuItemStyle, V
end;
end
else
- DrawThemeBackground(ThemeServices.Theme[teToolbar], ACanvas.Handle, ToolbarXPFlags[Vertical], TS_NORMAL, R, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teToolbar], ACanvas.Handle, ToolbarXPFlags[Vertical], TS_NORMAL, R, nil);
end;
sknSkin:
if not Vertical then begin
@@ -2986,7 +2986,7 @@ procedure SpDrawXPMenuGutter(ACanvas: TCanvas; ARect: TRect; SkinType: TSpTBXSki
begin
// Only Windows Vista painting, XP just fills the background
if SpIsWinVistaOrUp then
- DrawThemeBackground(ThemeServices.Theme[teMenu], ACanvas.Handle, MENU_POPUPGUTTER, 0, ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teMenu], ACanvas.Handle, MENU_POPUPGUTTER, 0, ARect, nil);
end;
sknSkin:
begin
@@ -3031,13 +3031,13 @@ procedure SpDrawXPMenuPopupWindow(ACanvas: TCanvas; ARect, OpenIVRect: TRect;
sknWindows: // Only Windows Vista painting, XP just fills the background
begin
// Use the new API in Windows Vista
- DrawThemeBackground(ThemeServices.Theme[teMenu], ACanvas.Handle, MENU_POPUPBACKGROUND, 0, ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teMenu], ACanvas.Handle, MENU_POPUPBACKGROUND, 0, ARect, nil);
// Now paint the borders, clip the background
SaveIndex := SaveDC(ACanvas.Handle);
try
ExcludeClipRect(ACanvas.Handle, ARect.Left + 2, ARect.Top + 2, ARect.Right - 2, ARect.Bottom - 2);
- DrawThemeBackground(ThemeServices.Theme[teMenu], ACanvas.Handle, MENU_POPUPBORDERS, 0, ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teMenu], ACanvas.Handle, MENU_POPUPBORDERS, 0, ARect, nil);
finally
RestoreDC(ACanvas.Handle, SaveIndex);
end;
@@ -3107,9 +3107,9 @@ procedure SpDrawXPStatusBar(ACanvas: TCanvas; ARect, AGripRect: TRect; SkinType:
sknWindows:
begin
if not IsRectEmpty(ARect) then
- DrawThemeBackground(ThemeServices.Theme[teStatus], ACanvas.Handle, 0, 0, ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teStatus], ACanvas.Handle, 0, 0, ARect, nil);
if not IsRectEmpty(AGripRect) then
- DrawThemeBackground(ThemeServices.Theme[teStatus], ACanvas.Handle, SP_GRIPPER, 0, AGripRect, nil)
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teStatus], ACanvas.Handle, SP_GRIPPER, 0, AGripRect, nil)
end;
sknSkin:
begin
@@ -3155,7 +3155,7 @@ procedure SpDrawXPTitleBar(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean; Dr
end;
sknWindows:
// If WP_CAPTION is used instead of WP_SMALLCAPTION the top borders are rounded
- DrawThemeBackground(ThemeServices.Theme[teWindow], ACanvas.Handle, WP_SMALLCAPTION, XpFlags[IsActive], ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teWindow], ACanvas.Handle, WP_SMALLCAPTION, XpFlags[IsActive], ARect, nil);
sknSkin:
CurrentSkin.PaintBackground(ACanvas, ARect, skncWindowTitleBar, sknsNormal, True, DrawBorders);
end;
@@ -3193,14 +3193,14 @@ procedure SpDrawXPTitleBarBody(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean
Flags := FS_INACTIVE;
R := ARect;
R.Top := R.Bottom - BorderSize.Y;
- DrawThemeBackground(ThemeServices.Theme[teWindow], ACanvas.Handle, WP_SMALLFRAMEBOTTOM, Flags, R, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teWindow], ACanvas.Handle, WP_SMALLFRAMEBOTTOM, Flags, R, nil);
R.Top := ARect.Top + BorderSize.Y;
R.Bottom := ARect.Bottom - BorderSize.Y;
R.Right := R.Left + BorderSize.X;
- DrawThemeBackground(ThemeServices.Theme[teWindow], ACanvas.Handle, WP_SMALLFRAMELEFT, Flags, R, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teWindow], ACanvas.Handle, WP_SMALLFRAMELEFT, Flags, R, nil);
R.Right := ARect.Right;
R.Left := R.Right - BorderSize.X;
- DrawThemeBackground(ThemeServices.Theme[teWindow], ACanvas.Handle, WP_SMALLFRAMERIGHT, Flags, R, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teWindow], ACanvas.Handle, WP_SMALLFRAMERIGHT, Flags, R, nil);
// Don't know how to paint a captionless window frame
// We have to mirror the bottom frame and paint it on the top
@@ -3210,7 +3210,7 @@ procedure SpDrawXPTitleBarBody(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean
R.Bottom := R.Top + BorderSize.Y;
B.Width := R.Right - R.Left;
B.Height := R.Bottom - R.Top;
- DrawThemeBackground(ThemeServices.Theme[teWindow], B.Canvas.Handle, WP_SMALLFRAMEBOTTOM, Flags, R, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teWindow], B.Canvas.Handle, WP_SMALLFRAMEBOTTOM, Flags, R, nil);
// Mirror
MirrorR := Rect(0, B.Height - 1, B.Width, -1);
@@ -3238,7 +3238,7 @@ procedure SpDrawXPDock(ACanvas: TCanvas; ARect: TRect; SkinType: TSpTBXSkinType;
sknWindows:
begin
if Vertical then Inc(ARect.Bottom, 1); // Fix WindowsXP bug
- DrawThemeBackground(ThemeServices.Theme[teRebar], ACanvas.Handle, 0, 0, ARect, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teRebar], ACanvas.Handle, 0, 0, ARect, nil);
end;
sknSkin:
CurrentSkin.PaintBackground(ACanvas, ARect, skncDock, sknsNormal, True, True, Vertical);
@@ -3454,14 +3454,14 @@ procedure SpDrawXPToolbarGrip(W: TTBCustomDockableWindow; ACanvas: TCanvas; ARec
GripR.Top := GripR.Top - 1 + (Z and $3) shr 1;
GripR.Bottom := GripR.Top + Z and not $3 + 1;
end;
- DrawThemeBackground(ThemeServices.Theme[teRebar], ACanvas.Handle, GripperPart[Vertical], 0, GripR, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teRebar], ACanvas.Handle, GripperPart[Vertical], 0, GripR, nil);
// Close button
if Toolbar.CloseButtonWhenDocked then begin
Flags := TS_NORMAL;
if Toolbar.CloseButtonDown then Flags := TS_PRESSED
else if Toolbar.CloseButtonHover then Flags := TS_HOT;
- DrawThemeBackground(ThemeServices.Theme[teToolbar], ACanvas.Handle, TP_BUTTON, Flags, CloseR, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teToolbar], ACanvas.Handle, TP_BUTTON, Flags, CloseR, nil);
if Toolbar.CloseButtonDown then OffsetRect(CloseR, 1, 1);
SpDrawGlyphPattern(ACanvas.Handle, CloseR, 7, 7, Pattern[0], clBtnText);
end;
@@ -3501,11 +3501,15 @@ procedure SpDrawXPTooltipBackground(ACanvas: TCanvas; ARect: TRect);
var
ClipRect: TRect;
begin
+ {$IFNDEF JR_D16}
if SpIsWinVistaOrUp and ThemeServices.ThemesEnabled then begin
+ {$ELSE}
+ if SpIsWinVistaOrUp and StyleServices.Enabled then begin
+ {$ENDIF}
// Paint Vista gradient background if themes enabled
ClipRect := ARect;
InflateRect(ARect, 4, 4);
- DrawThemeBackground(ThemeServices.Theme[teToolTip], ACanvas.Handle, TTP_STANDARD, TTSS_NORMAL, ARect, @ClipRect);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teToolTip], ACanvas.Handle, TTP_STANDARD, TTSS_NORMAL, ARect, @ClipRect);
end
else
ACanvas.FillRect(ARect);
@@ -7978,7 +7982,7 @@ procedure TSpTBXFloatingWindowParent.DrawNCArea(const DrawToDC: Boolean;
if CloseButtonDown then Flags := CBS_PUSHED
else if FCloseButtonHover then Flags := CBS_HOT
else Flags := CBS_NORMAL;
- DrawThemeBackground(ThemeServices.Theme[teWindow], ACanvas.Handle, WP_SMALLCLOSEBUTTON, Flags, CloseR, nil);
+ DrawThemeBackground({$IFNDEF JR_D16}ThemeServices{$ELSE}StyleServices{$ENDIF}.Theme[teWindow], ACanvas.Handle, WP_SMALLCLOSEBUTTON, Flags, CloseR, nil);
end;
sknSkin:
begin
@@ -8010,7 +8014,7 @@ procedure TSpTBXFloatingWindowParent.RedrawCloseButton;
procedure TSpTBXFloatingWindowParent.UpdateDwmNCSize;
var
- Style: Integer;
+ Style: {$IFDEF JR_D15} NativeInt {$ELSE} Integer {$ENDIF};
begin
if HandleAllocated then begin
// Make sure WS_THICKFRAME is setted only when Windows themes are used with
@@ -9484,7 +9488,8 @@ destructor TSpTBXCustomTitleBar.Destroy;
end;
if Assigned(Application) and Assigned(FNewAppWndProc) then begin
- SetWindowLong(Application.Handle, GWL_WNDPROC, Longint(FOldAppWndProc));
+ SetWindowLong(Application.Handle, GWL_WNDPROC,
+ {$IFDEF JR_D11} LONG_PTR {$ELSE} Longint {$ENDIF}(FOldAppWndProc));
Classes.FreeObjectInstance(FNewAppWndProc);
FNewAppWndProc := nil;
end;
@@ -9512,7 +9517,8 @@ procedure TSpTBXCustomTitleBar.Loaded;
// When Application.MainForm asume FParentForm as the MainForm
FOldAppWndProc := Pointer(GetWindowLong(Application.Handle, GWL_WNDPROC));
FNewAppWndProc := Classes.MakeObjectInstance(AppWndProc);
- SetWindowLong(Application.Handle, GWL_WNDPROC, Longint(FNewAppWndProc));
+ SetWindowLong(Application.Handle, GWL_WNDPROC,
+ {$IFDEF JR_D11} LONG_PTR {$ELSE} Longint {$ENDIF}(FNewAppWndProc));
end;
ChangeTitleBarState(Active);
@@ -9683,7 +9689,7 @@ procedure TSpTBXCustomTitleBar.NewParentFormWndProc(var Message: TMessage);
procedure TSpTBXCustomTitleBar.ChangeTitleBarState(Activate: Boolean);
var
FloatingBorderSize: TPoint;
- Style: Integer;
+ Style: {$IFDEF JR_D15} NativeInt {$ELSE} Integer {$ENDIF};
RestoreR: TRect;
WState: TWindowState;
OnParentFormShow: TNotifyEvent;
@@ -9962,7 +9968,7 @@ procedure TSpTBXCustomTitleBar.WMEraseBkgnd(var Message: TMessage);
B: TBitmap;
begin
Message.Result := 1;
- if not DoubleBuffered or (Message.wParam = Message.lParam) then begin
+ if not DoubleBuffered or (Message.wParam = {$IFDEF JR_D16}UINT_PTR({$ENDIF}Message.lParam{$IFDEF JR_D16}){$ENDIF}) then begin
B := TBitmap.Create;
try
ARect := GetClientRect;
View
@@ -5673,9 +5673,9 @@ procedure TTBView.ExecuteSelected(AGivePriority: Boolean);
end
else
EndModal;
- {$IFNDEF CLR}
- Exit; asm db 0,'Toolbar2000 (C) 1998-2008 Jordan Russell',0 end;
- {$ENDIF}
+// {$IFNDEF CLR}
+// Exit; asm db 0,'Toolbar2000 (C) 1998-2008 Jordan Russell',0 end;
+// {$ENDIF}
end;
procedure TTBView.Scroll(ADown: Boolean);
View
@@ -1504,7 +1504,7 @@ TCustomVirtualExplorerTree = class(TCustomVirtualStringTree, IVirtualShellNoti
procedure DoUpdating(State: TVTUpdateState); override;
function DragDrop(const DataObject: IDataObject; KeyState: Integer; Pt: TPoint; var Effect: Integer): HResult; override;
function DragEnter(KeyState: Integer; Pt: TPoint; var Effect: Integer): HResult; override;
- procedure DragAndDrop(AllowedEffects: Integer; DataObject: IDataObject; DragEffect: Integer); override;
+ procedure DragAndDrop(AllowedEffects: Integer; DataObject: IDataObject; var DragEffect: Integer); override;
procedure DragLeave; override;
function DragOver(Source: TObject; KeyState: Integer; DragState: TDragState; Pt: TPoint; var Effect: Integer): HResult; override;
procedure DummyOnDragOver(Sender: TBaseVirtualTree; Source: TObject; Shift: TShiftState; State: TDragState; Pt: TPoint; Mode: TDropMode; var Effect: Integer; var Accept: Boolean);
@@ -5177,7 +5177,7 @@ function TCustomVirtualExplorerTree.DragEnter(KeyState: Integer; Pt: TPoint;
end;
procedure TCustomVirtualExplorerTree.DragAndDrop(AllowedEffects: Integer;
- DataObject: IDataObject; DragEffect: Integer);
+ DataObject: IDataObject; var DragEffect: Integer);
begin
if (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion >= 6) and Assigned(SHDoDragDrop_MP) then
SHDoDragDrop_MP(Handle, DataObject, nil, AllowedEffects, DragEffect)
@@ -6661,7 +6661,7 @@ procedure TCustomVirtualExplorerTree.ReReadAndRefreshNode(Node: PVirtualNode; So
Inc(j); // Node exists move on
Inc(i)
end else
- if Compare > 0 then
+ if Compare < 0 then
begin
// Must be a new node, don't Inc j
Allow := True;
Oops, something went wrong.

0 comments on commit 902ea9e

Please sign in to comment.