diff --git a/Lib/D2007/UnitSwitcherD2007.bpl b/Lib/D2007/UnitSwitcherD2007.bpl new file mode 100644 index 0000000..e94f262 Binary files /dev/null and b/Lib/D2007/UnitSwitcherD2007.bpl differ diff --git a/Packages/D2007/UnitSwitcher.bdsproj b/Packages/D2007/UnitSwitcher.bdsproj new file mode 100644 index 0000000..6039fbf --- /dev/null +++ b/Packages/D2007/UnitSwitcher.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + UnitSwitcher.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + UnitSwitcher + + + + ..\..\Lib\D2006 + ..\..\Lib\D2006 + + + + + + False + + + + + + False + + + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1043 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + UnitSwitcher + + + + + diff --git a/Packages/D2007/UnitSwitcher.dpk b/Packages/D2007/UnitSwitcher.dpk new file mode 100644 index 0000000..e72b6d7 --- /dev/null +++ b/Packages/D2007/UnitSwitcher.dpk @@ -0,0 +1,64 @@ +package UnitSwitcher; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'UnitSwitcher'} +{$LIBSUFFIX 'D2007'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcl, + xmlrtl, + vclactnband, + vclx; + +contains + UnSwClient in '..\..\Source\UnSwClient.pas', + UnSwObjects in '..\..\Source\UnSwObjects.pas', + UnSwDialog in '..\..\Source\UnSwDialog.pas' {frmUnSwDialog}, + UnSwFilters in '..\..\Source\UnSwFilters.pas', + UnSwConfiguration in '..\..\Source\UnSwConfiguration.pas' {frmUnSwConfiguration}, + UnSwSettings in '..\..\Source\UnSwSettings.pas', + UnSwShortcuts in '..\..\Source\UnSwShortcuts.pas' {frmUnSwShortcuts}, + CmpSwClient in '..\..\Source\CmpSwClient.pas', + BaseSwClient in '..\..\Source\BaseSwClient.pas', + BaseSwDialog in '..\..\Source\BaseSwDialog.pas' {frmBaseSwDialog}, + BaseSwFilters in '..\..\Source\BaseSwFilters.pas', + BaseSwObjects in '..\..\Source\BaseSwObjects.pas', + UnSwReg in '..\..\Source\UnSwReg.pas', + CmpSwDialog in '..\..\Source\CmpSwDialog.pas' {frmCmpSwDialog}, + CmpSwObjects in '..\..\Source\CmpSwObjects.pas', + CmpSwFilters in '..\..\Source\CmpSwFilters.pas', + CmpSwSettings in '..\..\Source\CmpSwSettings.pas', + BaseSwSettings in '..\..\Source\BaseSwSettings.pas', + CmpSwConfiguration in '..\..\Source\CmpSwConfiguration.pas' {frmCmpSwConfiguration}, + CmpSwFilterConfiguration in '..\..\Source\CmpSwFilterConfiguration.pas' {frmCmpSwFilterConfiguration}, + ProjSwClient in '..\..\Source\ProjSwClient.pas', + ProjSwDialog in '..\..\Source\ProjSwDialog.pas' {frmProjSwDialog}, + ProjSwObjects in '..\..\Source\ProjSwObjects.pas', + ProjSwSettings in '..\..\Source\ProjSwSettings.pas'; + +end. diff --git a/Packages/D2007/UnitSwitcher.dproj b/Packages/D2007/UnitSwitcher.dproj new file mode 100644 index 0000000..36895d3 --- /dev/null +++ b/Packages/D2007/UnitSwitcher.dproj @@ -0,0 +1,90 @@ + + + {9dce4f2a-aaf1-4f8e-aca7-c36afc829e47} + UnitSwitcher.dpk + Debug + AnyCPU + DCC32 + ..\..\Lib\D2007\UnitSwitcherD2007.bpl + + + 7.0 + False + False + 0 + ..\..\Lib\D2006 + ..\..\Lib\D2006 + ..\..\Lib\D2006 + ..\..\Lib\D2006 + RELEASE + + + 7.0 + ..\..\Lib\D2007 + ..\..\Lib\D2007 + ..\..\Lib\D2007 + ..\..\Lib\D2007 + + + Delphi.Personality + Package + +FalseTrueFalseUnitSwitcherFalseTrueFalseD2007TrueFalse1000FalseFalseFalseFalseFalse104312521.0.0.01.0.0.0 + + + UnitSwitcher + UnitSwitcher.dpk + + + + + MainSource + + + +
frmBaseSwDialog
+
+ + + + + +
frmCmpSwConfiguration
+
+ +
frmCmpSwDialog
+
+ +
frmCmpSwFilterConfiguration
+
+ + + + + +
frmProjSwDialog
+
+ + + + +
frmUnSwConfiguration
+
+ +
frmUnSwDialog
+
+ + + + + +
frmUnSwShortcuts
+
+ + + + + + +
+
\ No newline at end of file diff --git a/Packages/D2007/UnitSwitcher.res b/Packages/D2007/UnitSwitcher.res new file mode 100644 index 0000000..9f71601 Binary files /dev/null and b/Packages/D2007/UnitSwitcher.res differ diff --git a/Resources/ProjectBDS.ico b/Resources/ProjectBDS.ico new file mode 100644 index 0000000..7490745 Binary files /dev/null and b/Resources/ProjectBDS.ico differ diff --git a/Source/BaseSwClient.pas b/Source/BaseSwClient.pas index 25f467d..2e23ad7 100644 --- a/Source/BaseSwClient.pas +++ b/Source/BaseSwClient.pas @@ -29,6 +29,8 @@ type private FHookedActions: TList; protected + function GetIDEActionList: TCustomActionList; + function GetHookedActionIndex(AAction: TContainedAction): Integer; function GetHookedAction(AAction: TContainedAction): PHookedAction; @@ -76,6 +78,20 @@ begin end; +function TBaseSwitcherHook.GetIDEActionList: TCustomActionList; +var + ntaServices: INTAServices; + +begin + Assert(Assigned(BorlandIDEServices), 'BorlandIDEServices not available.'); + Assert(Supports(BorlandIDEServices, INTAServices, ntaServices), + 'BorlandIDEServices does not support the ' + + 'INTAServices interface.'); + + Result := ntaServices.ActionList; +end; + + function TBaseSwitcherHook.GetHookedActionIndex(AAction: TContainedAction): Integer; var actionIndex: Integer; @@ -132,20 +148,17 @@ end; function TBaseSwitcherHook.HookIDEAction(const AName: String; AOnExecute, AOnUpdate: TNotifyEvent): TContainedAction; var + actionList: TCustomActionList; actionIndex: Integer; - ntaServices: INTAServices; action: TContainedAction; begin - Result := nil; - Assert(Assigned(BorlandIDEServices), 'BorlandIDEServices not available.'); - Assert(Supports(BorlandIDEServices, INTAServices, ntaServices), - 'BorlandIDEServices does not support the ' + - 'INTAServices interface.'); + Result := nil; + actionList := GetIDEActionList; - for actionIndex := 0 to Pred(ntaServices.ActionList.ActionCount) do + for actionIndex := 0 to Pred(actionList.ActionCount) do begin - action := ntaServices.ActionList.Actions[actionIndex]; + action := actionList.Actions[actionIndex]; if action.Name = AName then begin Result := action; diff --git a/Source/BaseSwDialog.dfm b/Source/BaseSwDialog.dfm index 28087b6..47761ef 100644 --- a/Source/BaseSwDialog.dfm +++ b/Source/BaseSwDialog.dfm @@ -1,10 +1,10 @@ object frmBaseSwDialog: TfrmBaseSwDialog Left = 284 Top = 120 - Width = 320 - Height = 425 BorderIcons = [biSystemMenu] Caption = 'UnitSwitcher' + ClientHeight = 389 + ClientWidth = 304 Color = clBtnFace Constraints.MinHeight = 240 Constraints.MinWidth = 290 @@ -32,8 +32,8 @@ object frmBaseSwDialog: TfrmBaseSwDialog TextHeight = 13 object sbStatus: TStatusBar Left = 0 - Top = 379 - Width = 312 + Top = 370 + Width = 304 Height = 19 Panels = < item @@ -43,8 +43,8 @@ object frmBaseSwDialog: TfrmBaseSwDialog object pnlMain: TPanel Left = 0 Top = 0 - Width = 312 - Height = 343 + Width = 304 + Height = 334 Align = alClient BevelOuter = bvNone BorderWidth = 4 @@ -52,13 +52,13 @@ object frmBaseSwDialog: TfrmBaseSwDialog object pnlSearch: TPanel Left = 4 Top = 24 - Width = 304 + Width = 296 Height = 25 Align = alTop BevelOuter = bvNone TabOrder = 0 DesignSize = ( - 304 + 296 25) object cmbSearch: TComboBox Left = 0 @@ -78,8 +78,8 @@ object frmBaseSwDialog: TfrmBaseSwDialog object lstItems: TListBox Left = 4 Top = 49 - Width = 304 - Height = 290 + Width = 296 + Height = 281 Style = lbVirtualOwnerDraw Align = alClient ItemHeight = 20 @@ -95,14 +95,14 @@ object frmBaseSwDialog: TfrmBaseSwDialog object pnlSubFilters: TPanel Left = 4 Top = 4 - Width = 304 + Width = 296 Height = 20 Align = alTop BevelOuter = bvNone TabOrder = 2 Visible = False DesignSize = ( - 304 + 296 20) object lblSubFilters: TLabel Left = 0 @@ -117,14 +117,14 @@ object frmBaseSwDialog: TfrmBaseSwDialog end object pnlButtons: TPanel Left = 0 - Top = 343 - Width = 312 + Top = 334 + Width = 304 Height = 36 Align = alBottom BevelOuter = bvNone TabOrder = 1 DesignSize = ( - 312 + 304 36) object btnCancel: TButton Left = 233 diff --git a/Source/BaseSwDialog.pas b/Source/BaseSwDialog.pas index 5b14098..7051737 100644 --- a/Source/BaseSwDialog.pas +++ b/Source/BaseSwDialog.pas @@ -119,6 +119,7 @@ type procedure SaveSettings(); virtual; procedure SettingsChanged(); virtual; + procedure SelectItem(AItemIndex: Integer); procedure DrawItemText(ACanvas: TCanvas; AItem: TBaseSwItem; ARect: TRect; AState: TOwnerDrawState); virtual; protected property ActiveItem: TBaseSwItem read FActiveItem write FActiveItem; @@ -313,14 +314,21 @@ begin activeUnit := activeUnits[itemIndex]; listIndex := FInputFilteredList.IndexOf(activeUnit); if listIndex > -1 then - lstItems.Selected[listIndex] := True; + SelectItem(listIndex); end; finally FreeAndNil(activeUnits); end; - if lstItems.SelCount = 0 then - lstItems.Selected[0] := True; + if lstItems.MultiSelect then + begin + if lstItems.SelCount = 0 then + SelectItem(0); + end else + begin + if lstItems.ItemIndex = -1 then + SelectItem(0); + end; end; if Assigned(lstItems.OnClick) then @@ -382,24 +390,38 @@ end; function TfrmBaseSwDialog.GetActiveItems(): TBaseSwItemList; var itemIndex: Integer; + hasSelection: Boolean; begin Result := nil; + if lstItems.MultiSelect then + hasSelection := (lstItems.SelCount > 0) + else + hasSelection := (lstItems.ItemIndex > -1); + if Assigned(ActiveItem) then begin Result := CreateItemList(); Result.OwnsObjects := False; Result.Add(ActiveItem); ActiveItem := nil; - end else if lstItems.SelCount > 0 then + end else if hasSelection then begin Result := CreateItemList(); Result.OwnsObjects := False; - - for itemIndex := 0 to Pred(lstItems.Items.Count) do - if lstItems.Selected[itemIndex] then + + if lstItems.MultiSelect then + begin + for itemIndex := 0 to Pred(lstItems.Items.Count) do + if lstItems.Selected[itemIndex] then + Result.Add(FInputFilteredList[itemIndex]); + end else + begin + itemIndex := lstItems.ItemIndex; + if itemIndex > -1 then Result.Add(FInputFilteredList[itemIndex]); + end; end; end; @@ -451,8 +473,11 @@ var iItem: Integer; begin - for iItem := Pred(lstItems.Count) downto 0 do - lstItems.Selected[iItem] := not lstItems.Selected[iItem]; + if lstItems.MultiSelect then + begin + for iItem := Pred(lstItems.Count) downto 0 do + lstItems.Selected[iItem] := not lstItems.Selected[iItem]; + end; end; @@ -558,6 +583,15 @@ begin end; +procedure TfrmBaseSwDialog.SelectItem(AItemIndex: Integer); +begin + if lstItems.MultiSelect then + lstItems.Selected[AItemIndex] := True + else + lstItems.ItemIndex := AItemIndex; +end; + + procedure TfrmBaseSwDialog.DrawItemText(ACanvas: TCanvas; AItem: TBaseSwItem; ARect: TRect; AState: TOwnerDrawState); var text: String; @@ -627,7 +661,7 @@ begin if (itemIndex > -1) and (not lstItems.Selected[itemIndex]) then begin lstItems.ClearSelection; - lstItems.Selected[itemIndex] := True; + SelectItem(itemIndex); UpdateItemActions(); end; end; diff --git a/Source/CmpSwClient.pas b/Source/CmpSwClient.pas index daf06dd..b5ec9de 100644 --- a/Source/CmpSwClient.pas +++ b/Source/CmpSwClient.pas @@ -90,28 +90,32 @@ begin begin formComponent := formEditor.GetRootComponent; itemList := TBaseSwItemList.Create(); - - for componentIndex := Pred(formComponent.GetComponentCount) downto 0 do - begin - component := formComponent.GetComponent(componentIndex); - item := TCmpSwComponent.TryCreate(component); - - if Assigned(item) then - itemList.Add(item); - end; - - if itemList.Count > 0 then - begin - selectedItems := TfrmCmpSwDialog.Execute(itemList); - - if Assigned(selectedItems) then + try + for componentIndex := Pred(formComponent.GetComponentCount) downto 0 do begin - for componentIndex := 0 to Pred(selectedItems.Count) do - begin - item := TCmpSwComponent(selectedItems[componentIndex]); - item.Activate(componentIndex = 0); + component := formComponent.GetComponent(componentIndex); + item := TCmpSwComponent.TryCreate(component); + + if Assigned(item) then + itemList.Add(item); + end; + + if itemList.Count > 0 then + begin + selectedItems := TfrmCmpSwDialog.Execute(itemList); + if Assigned(selectedItems) then + try + for componentIndex := 0 to Pred(selectedItems.Count) do + begin + item := TCmpSwComponent(selectedItems[componentIndex]); + item.Activate(componentIndex = 0); + end; + finally + FreeAndNil(selectedItems); end; end; + finally + FreeAndNil(itemList); end; end; end; diff --git a/Source/CmpSwDialog.dfm b/Source/CmpSwDialog.dfm index 3dae2ba..b0032fa 100644 --- a/Source/CmpSwDialog.dfm +++ b/Source/CmpSwDialog.dfm @@ -1,47 +1,63 @@ inherited frmCmpSwDialog: TfrmCmpSwDialog - Width = 358 - Height = 557 Caption = 'ComponentSwitcher' + ClientHeight = 521 + ClientWidth = 342 + ExplicitWidth = 358 + ExplicitHeight = 557 PixelsPerInch = 96 TextHeight = 13 inherited sbStatus: TStatusBar - Top = 511 - Width = 350 + Top = 502 + Width = 342 + ExplicitTop = 502 + ExplicitWidth = 342 end inherited pnlMain: TPanel - Width = 350 - Height = 402 + Width = 342 + Height = 393 + ExplicitWidth = 342 + ExplicitHeight = 393 inherited pnlSearch: TPanel - Width = 342 + Width = 334 TabOrder = 1 + ExplicitWidth = 334 inherited cmbSearch: TComboBox Width = 342 + ExplicitWidth = 342 end end inherited lstItems: TListBox - Width = 342 - Height = 349 + Width = 334 + Height = 340 TabOrder = 2 + ExplicitWidth = 334 + ExplicitHeight = 340 end inherited pnlSubFilters: TPanel - Width = 342 + Width = 334 TabOrder = 0 + ExplicitWidth = 334 inherited lblSubFilters: TLabel Width = 343 + ExplicitWidth = 343 end end end inherited pnlButtons: TPanel - Top = 475 - Width = 350 + Top = 466 + Width = 342 TabOrder = 2 + ExplicitTop = 466 + ExplicitWidth = 342 inherited btnCancel: TButton - Left = 271 + Left = 263 TabOrder = 2 + ExplicitLeft = 263 end inherited btnOK: TButton - Left = 190 + Left = 182 TabOrder = 1 + ExplicitLeft = 182 end object btnConfiguration: TButton Left = 4 @@ -55,8 +71,8 @@ inherited frmCmpSwDialog: TfrmCmpSwDialog end object pnlFilters: TPanel [3] Left = 0 - Top = 402 - Width = 350 + Top = 393 + Width = 342 Height = 73 Align = alBottom BevelOuter = bvNone @@ -65,15 +81,15 @@ inherited frmCmpSwDialog: TfrmCmpSwDialog object gbFilters: TGroupBox Left = 4 Top = 4 - Width = 342 + Width = 334 Height = 65 Align = alClient TabOrder = 0 DesignSize = ( - 342 + 334 65) object btnMoreFilters: TButton - Left = 304 + Left = 296 Top = 32 Width = 31 Height = 25 diff --git a/Source/ProjSwClient.pas b/Source/ProjSwClient.pas new file mode 100644 index 0000000..f4336ef --- /dev/null +++ b/Source/ProjSwClient.pas @@ -0,0 +1,129 @@ +{: Connects ProjectSwitcher to the IDE. + + Last changed: $Date$ + Revision: $Rev$ + Author: $Author$ +} +unit ProjSwClient; + + +interface +uses + ActnList, + Classes, + Dialogs, + SysUtils, + ToolsAPI, + + BaseSwClient; + + +type + TProjectSwitcherHook = class(TBaseSwitcherHook) + private + FSwitchAction: TAction; + protected + procedure SwitchExecute(Sender: TObject); + public + constructor Create; + destructor Destroy; override; + end; + + +implementation +uses + Menus, + Windows, + + BaseSwObjects, + ProjSwDialog, + ProjSwObjects; + + +{ TProjectSwitcherHook} +constructor TProjectSwitcherHook.Create; +var + actionList: TCustomActionList; + +begin + inherited; + + actionList := GetIDEActionList; + FSwitchAction := TAction.Create(actionList); + + FSwitchAction.Caption := 'ProjectSwitcher'; + FSwitchAction.ShortCut := ShortCut(VK_F12, [ssCtrl, ssAlt, ssShift]); + FSwitchAction.OnExecute := SwitchExecute; + FSwitchAction.ActionList := actionList; +end; + + +destructor TProjectSwitcherHook.Destroy; +begin + FreeAndNil(FSwitchAction); + + inherited; +end; + + +function SortByName(Item1, Item2: Pointer): Integer; +begin + Result := CompareText(TProjSwProject(Item1).Name, TProjSwProject(Item2).Name) +end; + + +procedure TProjectSwitcherHook.SwitchExecute(Sender: TObject); +var + projectList: TBaseSwItemList; + activeItem: TProjSwProject; + projectItem: TProjSwProject; + moduleServices: IOTAModuleServices; + project: IOTAProject; + activeProject: IOTAProject; + projectIndex: Integer; + selectedItems: TBaseSwItemList; + +begin + projectList := TBaseSwItemList.Create; + try + activeItem := nil; + moduleServices := (BorlandIDEServices as IOTAModuleServices); + + if not Assigned(moduleServices.MainProjectGroup) then + Exit; + + activeProject := moduleServices.GetActiveProject; + + for projectIndex := Pred(moduleServices.MainProjectGroup.ProjectCount) downto 0 do + begin + project := moduleServices.MainProjectGroup.Projects[projectIndex]; + projectItem := TProjSwProject.Create(project); + + if project = activeProject then + activeItem := projectItem; + + projectList.Add(projectItem); + end; + + if projectList.Count > 0 then + begin + projectList.Sort(SortByName); + + selectedItems := TfrmProjSwDialog.Execute(projectList, activeItem); + if Assigned(selectedItems) then + try + if selectedItems.Count > 0 then + begin + projectItem := TProjSwProject(selectedItems[0]); + projectItem.Activate(True); + end; + finally + FreeAndNil(selectedItems); + end; + end; + finally + FreeAndNil(projectList); + end; +end; + +end. diff --git a/Source/ProjSwDialog.dfm b/Source/ProjSwDialog.dfm new file mode 100644 index 0000000..ab2e995 --- /dev/null +++ b/Source/ProjSwDialog.dfm @@ -0,0 +1,163 @@ +inherited frmProjSwDialog: TfrmProjSwDialog + Caption = 'ProjectSwitcher' + ExplicitHeight = 425 + PixelsPerInch = 96 + TextHeight = 13 + inherited pnlMain: TPanel + inherited lstItems: TListBox + MultiSelect = False + PopupMenu = nil + end + end + inherited pnlButtons: TPanel + inherited btnCancel: TButton + Left = 225 + ExplicitLeft = 225 + end + inherited btnOK: TButton + Left = 144 + ExplicitLeft = 144 + end + end + inherited ilsTypes: TImageList + Bitmap = { + 494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 000000000000000000000000000000000000000000000000000000000000A5A5 + A500636363006363630063636300636363006363630063636300A5A5A5000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000006363 + 6300DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00636363000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000A5A5A500636363006363 + 6300DEFFFF00A5A5A500737373007373730073737300DEFFFF00636363000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000063636300DEFFFF006363 + 6300DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00636363000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000063636300DEFFFF006363 + 6300DEFFFF00A5A5A500737373007373730073737300DEFFFF0063636300A5A5 + A5006363630063636300A5A5A500000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000063636300DEFFFF006363 + 6300DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF0063636300A5F7 + FF00A5F7FF00A5F7FF0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000063636300DEFFFF006363 + 6300DEFFFF00A5A5A500737373007373730073737300DEFFFF0063636300DEFF + FF00DEFFFF00A5F7FF0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000063636300DEFFFF006363 + 6300DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF0063636300DEFF + FF00DEFFFF00A5F7FF0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000063636300DEFFFF00A5A5 + A500636363006363630063636300636363006363630063636300A5A5A500DEFF + FF00DEFFFF00A5F7FF0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000063636300DEFFFF00DEFF + FF00DEFFFF00DEFFFF00DEFFFF00DEFFFF0063636300DEFFFF00DEFFFF00DEFF + FF00DEFFFF00A5F7FF0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000A5A5A500636363006363 + 630063636300636363006363630063636300A5A5A500DEFFFF00DEFFFF00DEFF + FF00DEFFFF00A5F7FF0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000A5A5 + A500DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFFFF00DEFF + FF00DEFFFF00A5F7FF0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000006331 + 6300636363006363630063636300636363006363630063636300636363006363 + 6300636363006363630063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000006331 + 6300633163006331630063316300633163006331630063316300633163006331 + 6300633163006331630063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000CE73 + CE00CE73CE00CE73CE00CE73CE00CE73CE00CE73CE00CE73CE00CE73CE00CE73 + CE00CE73CE00CE73CE00CE73CE00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00E01F000000000000E01F000000000000 + 801F000000000000801F00000000000080010000000000008001000000000000 + 8001000000000000800100000000000080010000000000008001000000000000 + 8001000000000000E001000000000000E001000000000000E001000000000000 + E001000000000000FFFF00000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/Source/ProjSwDialog.pas b/Source/ProjSwDialog.pas new file mode 100644 index 0000000..0d740e4 --- /dev/null +++ b/Source/ProjSwDialog.pas @@ -0,0 +1,130 @@ +unit ProjSwDialog; + +interface +uses + ActnList, + Classes, + ComCtrls, + Contnrs, + Controls, + ExtCtrls, + Graphics, + ImgList, + IniFiles, + Menus, + StdCtrls, + Windows, + + BaseSwDialog, + BaseSwObjects; + + +type + TProjSwStyleVisitor = class(TBaseSwStyleVisitor) + protected + procedure VisitItem(const AItem: TBaseSwItem); override; + end; + + + TfrmProjSwDialog = class(TfrmBaseSwDialog) + protected + function InternalExecute: TBaseSwItemList; override; + + function CreateStyleVisitor: TBaseSwStyleVisitor; override; + + function AllowEmptyResult: Boolean; override; + function ColorsEnabled: Boolean; override; + function Wildchars: Boolean; override; + + procedure LoadSettings; override; + procedure SaveSettings; override; + end; + + +implementation +uses + SysUtils, + ToolsAPI, + + ProjSwObjects, + ProjSwSettings; + + +{$R *.dfm} + + +{ TProjSwStyleVisitor } +procedure TProjSwStyleVisitor.VisitItem(const AItem: TBaseSwItem); +begin + ImageIndex := 0; +end; + + +{ TfrmProjSwDialog } +function TfrmProjSwDialog.InternalExecute: TBaseSwItemList; +begin + Result := inherited InternalExecute; +end; + + +function TfrmProjSwDialog.CreateStyleVisitor: TBaseSwStyleVisitor; +begin + Result := TProjSwStyleVisitor.Create; +end; + + +procedure TfrmProjSwDialog.LoadSettings; +begin + Self.ClientWidth := Settings.Dialog.Width; + Self.ClientHeight := Settings.Dialog.Height; + MRUList.Assign(Settings.Dialog.MRUList); + + inherited LoadSettings; +end; + + +procedure TfrmProjSwDialog.SaveSettings; +begin + // #ToDo2 (MvR) 12-12-2007: save 'sort by ...' + + Settings.Dialog.Width := Self.ClientWidth; + Settings.Dialog.Height := Self.ClientHeight; + Settings.Dialog.MRUList.Assign(MRUList); + Settings.Save; + + inherited SaveSettings; +end; + + + +function TfrmProjSwDialog.AllowEmptyResult: Boolean; +begin + Result := Settings.Filter.AllowEmptyResult; +end; + + +function TfrmProjSwDialog.ColorsEnabled: Boolean; +begin + Result := inherited ColorsEnabled; +end; + + +function TfrmProjSwDialog.Wildchars: Boolean; +begin + Result := Settings.Filter.Wildchars; +end; + + +(* +procedure TfrmProjSwDialog.btnConfigurationClick(Sender: TObject); +begin + if TfrmProjSwConfiguration.Execute then + begin + SettingsChanged; + UpdateClassFilter; + UpdateSubFilters; + end; +end; +*) + +end. diff --git a/Source/ProjSwObjects.pas b/Source/ProjSwObjects.pas new file mode 100644 index 0000000..ed54341 --- /dev/null +++ b/Source/ProjSwObjects.pas @@ -0,0 +1,58 @@ +unit ProjSwObjects; + +interface +uses + ToolsAPI, + + BaseSwObjects; + + +type + TProjSwProject = class(TBaseSwItem) + private + FProject: IOTAProject; + FName: String; + protected + function GetName: String; override; + public + constructor Create(AProject: IOTAProject); + + procedure Activate(const AClearSelection: Boolean); + end; + + +implementation +uses + SysUtils, Dialogs; + + +{ TProjSwProject } +constructor TProjSwProject.Create(AProject: IOTAProject); +begin + inherited Create; + + FProject := AProject; + FName := ExtractFileName(FProject.ProjectOptions.TargetName); +end; + + +procedure TProjSwProject.Activate(const AClearSelection: Boolean); +var + moduleServices: IOTAModuleServices; + projectGroup: IOTAProjectGroup; + +begin + moduleServices := (BorlandIDEServices as IOTAModuleServices); + projectGroup := moduleServices.MainProjectGroup; + + if Assigned(projectGroup) then + projectGroup.ActiveProject := FProject; +end; + + +function TProjSwProject.GetName: String; +begin + Result := FName; +end; + +end. diff --git a/Source/ProjSwSettings.pas b/Source/ProjSwSettings.pas new file mode 100644 index 0000000..db551d6 --- /dev/null +++ b/Source/ProjSwSettings.pas @@ -0,0 +1,247 @@ +{: Encapsulates the ProjectSwitcher settings. + + Last changed: $Date$ + Revision: $Rev$ + Author: $Author$ +} +unit ProjSwSettings; + +interface +uses + Classes, + Registry, + + BaseSwSettings; + + +type + TProjSwDialogSettings = class(TBaseSwSettings) + private + FHeight: Integer; + FMRUList: TStrings; + FWidth: Integer; + protected + procedure Load(const ARegistry: TRegistry); override; + procedure Save(const ARegistry: TRegistry); override; + public + constructor Create; + destructor Destroy; override; + public + property Height: Integer read FHeight write FHeight; + property MRUList: TStrings read FMRUList write FMRUList; + property Width: Integer read FWidth write FWidth; + end; + + + TProjSwFilterSettings = class(TBaseSwSettings) + private + FAllowEmptyResult: Boolean; + FWildchars: Boolean; + protected + procedure Load(const ARegistry: TRegistry); override; + procedure Save(const ARegistry: TRegistry); override; + public + property AllowEmptyResult: Boolean read FAllowEmptyResult write FAllowEmptyResult; + property Wildchars: Boolean read FWildchars write FWildchars; + end; + + + TProjSwSettings = class(TObject) + private + FDialog: TProjSwDialogSettings; + FFilter: TProjSwFilterSettings; + + FRegistryKey: String; + protected + procedure Load; + public + constructor Create; + destructor Destroy; override; + + procedure ResetDefaults; + procedure Save; + + property Dialog: TProjSwDialogSettings read FDialog write FDialog; + property Filter: TProjSwFilterSettings read FFilter write FFilter; + end; + + function Settings: TProjSwSettings; + + +implementation +uses + SysUtils, + ToolsAPI, + Windows; + + +var + GSettings: TProjSwSettings; + + +function Settings: TProjSwSettings; +begin + if not Assigned(GSettings) then + GSettings := TProjSwSettings.Create; + + Result := GSettings; +end; + + +{ TProjSwDialogSettings } +constructor TProjSwDialogSettings.Create; +begin + inherited Create; + + FMRUList := TStringList.Create; + TStringList(FMRUList).CaseSensitive := False +end; + + +destructor TProjSwDialogSettings.Destroy; +begin + FreeAndNil(FMRUList); + + inherited; +end; + + +procedure TProjSwDialogSettings.Load(const ARegistry: TRegistry); +var + sMRU: String; + +begin + ReadIntegerDef(ARegistry, FWidth, 'Width'); + ReadIntegerDef(ARegistry, FHeight, 'Height'); + + if ARegistry.ValueExists(GetKeyName('MRU')) then + begin + SetLength(sMRU, ARegistry.GetDataSize(GetKeyName('MRU'))); + if Length(sMRU) > 0 then + begin + ARegistry.ReadBinaryData(GetKeyName('MRU'), PChar(sMRU)^, Length(sMRU)); + FMRUList.Text := Trim(sMRU); + end; + end; +end; + + +procedure TProjSwDialogSettings.Save(const ARegistry: TRegistry); +var + sMRU: String; + +begin + WriteInteger(ARegistry, FWidth, 'Width'); + WriteInteger(ARegistry, FHeight, 'Height'); + + if FMRUList.Count > 0 then + begin + sMRU := FMRUList.Text; + ARegistry.WriteBinaryData(GetKeyName('MRU'), PChar(sMRU)^, Length(sMRU)); + end else + ARegistry.DeleteValue(GetKeyName('MRU')); +end; + + +{ TProjSwFilterSettings } +procedure TProjSwFilterSettings.Load(const ARegistry: TRegistry); +begin + ReadBoolDef(ARegistry, FAllowEmptyResult, 'AllowEmptyResult'); + ReadBoolDef(ARegistry, FWildchars, 'Wildchars'); +end; + + +procedure TProjSwFilterSettings.Save(const ARegistry: TRegistry); +begin + WriteBool(ARegistry, FAllowEmptyResult, 'AllowEmptyResult'); + WriteBool(ARegistry, FWildchars, 'Wildchars'); +end; + + +{ TProjSwSettings } +constructor TProjSwSettings.Create; +begin + inherited; + + FRegistryKey := (BorlandIDEServices as IOTAServices).GetBaseRegistryKey + + '\ComponentSwitcher'; + + FDialog := TProjSwDialogSettings.Create; + FFilter := TProjSwFilterSettings.Create; + + ResetDefaults; + Load; +end; + + +destructor TProjSwSettings.Destroy; +begin + FreeAndNil(FFilter); + FreeAndNil(FDialog); + + inherited; +end; + + +procedure TProjSwSettings.Load; +var + ideRegistry: TRegistry; + +begin + ideRegistry := TRegistry.Create; + with ideRegistry do + try + RootKey := HKEY_CURRENT_USER; + + if OpenKey(FRegistryKey, False) then + begin + FDialog.Load(ideRegistry); + FFilter.Load(ideRegistry); + + CloseKey; + end; + finally + Free; + end; +end; + + +procedure TProjSwSettings.ResetDefaults; +begin + Filter.AllowEmptyResult := True; + Filter.Wildchars := True; + + Dialog.Width := 350; + Dialog.Height := 530; +end; + + +procedure TProjSwSettings.Save; +var + ideRegistry: TRegistry; + +begin + ideRegistry := TRegistry.Create; + with ideRegistry do + try + RootKey := HKEY_CURRENT_USER; + + if OpenKey(FRegistryKey, True) then + begin + FDialog.Save(ideRegistry); + FFilter.Save(ideRegistry); + + CloseKey; + end; + finally + Free; + end; +end; + + +initialization +finalization + FreeAndNil(GSettings); + +end. + diff --git a/Source/UnSwDialog.dfm b/Source/UnSwDialog.dfm index 158b77e..168c193 100644 --- a/Source/UnSwDialog.dfm +++ b/Source/UnSwDialog.dfm @@ -2,15 +2,23 @@ inherited frmUnSwDialog: TfrmUnSwDialog PixelsPerInch = 96 TextHeight = 13 inherited pnlMain: TPanel - Height = 307 + Height = 298 + ExplicitHeight = 298 inherited lstItems: TListBox - Height = 254 + Height = 245 + ExplicitHeight = 245 end end inherited pnlButtons: TPanel TabOrder = 2 + inherited btnCancel: TButton + Left = 225 + ExplicitLeft = 225 + end inherited btnOK: TButton + Left = 144 TabOrder = 2 + ExplicitLeft = 144 end object btnConfiguration: TButton Left = 4 @@ -24,8 +32,8 @@ inherited frmUnSwDialog: TfrmUnSwDialog end object pnlIncludeTypes: TPanel [3] Left = 0 - Top = 307 - Width = 312 + Top = 298 + Width = 304 Height = 36 Align = alBottom BevelOuter = bvNone @@ -70,135 +78,7 @@ inherited frmUnSwDialog: TfrmUnSwDialog inherited ilsTypes: TImageList Bitmap = { 494C010106000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 - 0000000000003600000028000000400000003000000001002000000000000030 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000003600000028000000400000002000000001002000000000000020 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 @@ -456,12 +336,8 @@ inherited frmUnSwDialog: TfrmUnSwDialog 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000424D3E000000000000003E000000 - 2800000040000000300000000100010000000000800100000000000000000000 - 000000000000000000000000FFFFFF0000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000003FFC3000000000003FF8100000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF000003FFC3000000000003FF8100000000 0003FF00000000000000FF00000000000000FF00000000000000FF0000000000 0000FF81000000000000FFC3000000000000FFFF000000000000FFFF00000000 0000FFFF000000000003FFFF000000000003FFFF000000000003FFFF00000000 diff --git a/Source/UnSwReg.pas b/Source/UnSwReg.pas index b21832f..21de7f7 100644 --- a/Source/UnSwReg.pas +++ b/Source/UnSwReg.pas @@ -1,24 +1,33 @@ unit UnSwReg; +{$I BaseSwDefines.inc} + interface implementation uses SysUtils, CmpSwClient, + ProjSwClient, UnSwClient; var GComponentSwitcher: TComponentSwitcherHook; GUnitSwitcher: TUnitSwitcherHook; + GProjectSwitcher: TProjectSwitcherHook; initialization - GComponentSwitcher := TComponentSwitcherHook.Create(); - GUnitSwitcher := TUnitSwitcherHook.Create(); + GComponentSwitcher := TComponentSwitcherHook.Create; + GUnitSwitcher := TUnitSwitcherHook.Create; + + {$IFNDEF DELPHI7ORLOWER} + GProjectSwitcher := TProjectSwitcherHook.Create; + {$ENDIF} finalization + FreeAndNil(GProjectSwitcher); FreeAndNil(GUnitSwitcher); FreeAndNil(GComponentSwitcher);