Skip to content

Commit

Permalink
Some changes for 64-bit version
Browse files Browse the repository at this point in the history
  • Loading branch information
vladk1973 committed Feb 19, 2018
1 parent 5848316 commit 0c65dfd
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 47 deletions.
7 changes: 5 additions & 2 deletions connectionFormUnit.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ inherited connectionForm: TconnectionForm
KeyPreview = True
OnCreate = FormCreate
OnDestroy = FormDestroy
OnHide = FormHide
ExplicitWidth = 876
ExplicitHeight = 663
PixelsPerInch = 96
Expand Down Expand Up @@ -172,7 +173,7 @@ inherited connectionForm: TconnectionForm
Left = 208
Top = 64
Bitmap = {
494C010116009000640110001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
494C010116009000680110001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000006000000001002000000000000060
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Expand Down Expand Up @@ -977,6 +978,7 @@ inherited connectionForm: TconnectionForm
Items = <
item
Action = OpenListBDAction
Caption = '&Connections'
ImageIndex = 13
ShowCaption = False
end
Expand Down Expand Up @@ -1023,6 +1025,7 @@ inherited connectionForm: TconnectionForm
Items = <
item
Action = OpenListBDAction
Caption = '&Connections'
ImageIndex = 13
ShowCaption = False
end
Expand Down Expand Up @@ -1119,7 +1122,7 @@ inherited connectionForm: TconnectionForm
Left = 32
Top = 552
Bitmap = {
494C010106001D00440010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
494C010106001D00480010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000002000000001002000000000000020
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
Expand Down
37 changes: 34 additions & 3 deletions connectionFormUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ TconnectionForm = class(TNppDockingForm)
procedure DeleteTabActionUpdate(Sender: TObject);
procedure DeleteTabActionExecute(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormHide(Sender: TObject);
private
msTreeView: TTreeViewEx;
sybTreeView: TTreeViewEx;
odbcTreeView: TTreeViewEx;

FCurrentNode: TTreeNode;
FMenuItemCheck: TMenuItemCheck;
procedure SetMenuItemCheck(const Value: TMenuItemCheck);

const MaxTabIndex = 10;

Expand All @@ -92,6 +95,8 @@ TconnectionForm = class(TNppDockingForm)
public
procedure DoSql(const SqlText: string);
procedure DoConnect;
procedure Carousel;
property MenuItemCheck: TMenuItemCheck read FMenuItemCheck write SetMenuItemCheck;
end;

implementation
Expand Down Expand Up @@ -158,6 +163,17 @@ procedure TconnectionForm.DisonnectSQLActionUpdate(Sender: TObject);
TAction(Sender).Enabled := False;
end;

procedure TconnectionForm.Carousel;
begin
if MenuItemCheck = miShown then
Hide
else
begin
Show;
MenuItemCheck := miShown;
end;
end;

procedure TconnectionForm.ConnectActionExecute(Sender: TObject);
var
FBDLoginForm: TBDLoginForm;
Expand Down Expand Up @@ -252,7 +268,6 @@ procedure TconnectionForm.AfterSQLActionExecute(Sender: TObject);
begin
if Length(Value) > 3 then
begin
//RefreshButton.Hint := Value;
for i := 0 to RefreshMenu.Items.Count - 1 do
if RefreshMenu.Items[i].Hint = Value then Exit;

Expand All @@ -274,8 +289,9 @@ procedure TconnectionForm.AfterSQLActionExecute(Sender: TObject);
if Obj.ErrMessage = '' then
begin
FillResultGrid(Obj.Grids);
SetItem(Obj.Description);//Äîáàâëÿåì ïóíêò ìåíþ
Show;
SetItem(Obj.Description);//Add menu Item

if MenuItemCheck = miHidden then Carousel;
end
else
MessageError(Obj.ErrMessage,cnstErroCaption);
Expand Down Expand Up @@ -322,6 +338,7 @@ procedure TconnectionForm.DoSql(const SqlText: string);
procedure TconnectionForm.FormCreate(Sender: TObject);
begin
NppDefaultDockingMask := DWS_DF_FLOATING;
FMenuItemCheck := miHidden;

msTreeView := TTreeViewEx.Create(Self);
msTreeView.Parent := BasesPanel;
Expand Down Expand Up @@ -365,6 +382,11 @@ procedure TconnectionForm.FormDestroy(Sender: TObject);
end;
end;

procedure TconnectionForm.FormHide(Sender: TObject);
begin
MenuItemCheck := miHidden;
end;

procedure TconnectionForm.FillResultGrid(Results: TObjectStrings);
var i,j,k,maxWidthGrid,aTop: integer;
Temp: TComponent;
Expand Down Expand Up @@ -515,6 +537,15 @@ procedure TconnectionForm.SetCurrentNode(const Value: TTreeNode);
FCurrentNode := Value;
end;

procedure TconnectionForm.SetMenuItemCheck(const Value: TMenuItemCheck);
begin
if Value <> FMenuItemCheck then
begin
SendMessage(Npp.NppData.NppHandle, NPPM_SETMENUITEMCHECK, CmdId, LPARAM(Value));
FMenuItemCheck := Value;
end;
end;

procedure TconnectionForm.SQLActionExecute(Sender: TObject);
var
S: string;
Expand Down
10 changes: 0 additions & 10 deletions ds.notepad.stat

This file was deleted.

58 changes: 50 additions & 8 deletions npp.connections.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<MainSource>npp.connections.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<TargetedPlatforms>3</TargetedPlatforms>
<AppType>Library</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>18.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<Platform Condition="'$(Platform)'==''">Win64</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
Expand All @@ -18,6 +18,11 @@
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
Expand All @@ -29,6 +34,12 @@
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
<Cfg_1_Win64>true</Cfg_1_Win64>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
Expand All @@ -40,6 +51,12 @@
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
<Cfg_2_Win64>true</Cfg_2_Win64>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_S>false</DCC_S>
<DCC_ImageBase>00400000</DCC_ImageBase>
Expand All @@ -54,11 +71,26 @@
<VerInfo_Locale>1049</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Define>NPPUNICODE;$(DCC_Define)</DCC_Define>
<Manifest_File>(None)</Manifest_File>
<DCC_DcuOutput>.\$(Platform)\$(Config)\DCU</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName)</VerInfo_Keys>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_Define>NPPUNICODE;$(DCC_Define)</DCC_Define>
<Manifest_File>(None)</Manifest_File>
<DCC_DcuOutput>.\$(Platform)\$(Config)\DCU</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
Expand All @@ -67,24 +99,34 @@
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_Define>NPPUNICODE;$(DCC_Define)</DCC_Define>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<Manifest_File>(None)</Manifest_File>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Release>2</VerInfo_Release>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.2.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=npp.connections;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_Define>NPPUNICODE;$(DCC_Define)</DCC_Define>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<Manifest_File>(None)</Manifest_File>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Build>1</VerInfo_Build>
<VerInfo_Release>2</VerInfo_Release>
<VerInfo_DLL>true</VerInfo_DLL>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.2.1;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=npp.connections;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
Expand Down Expand Up @@ -138,7 +180,7 @@
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
<Platform value="Win64">True</Platform>
</Platforms>
<Deployment Version="3">
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
Expand Down
18 changes: 0 additions & 18 deletions npp.connections.dproj.local

This file was deleted.

Binary file removed npp.connections.identcache
Binary file not shown.
Binary file modified npp.connections.res
Binary file not shown.
Binary file added npp.connections.rsm
Binary file not shown.
16 changes: 10 additions & 6 deletions plugin.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface

TItemType = (itServerMS,itServerSYB,itODBC,itBase,itBaseRTI,itLogin);

TMenuItemCheck = (miHidden,miShown);

TdsPlugin = class(TNppPlugin)
private
{ Private declarations }
Expand Down Expand Up @@ -52,6 +54,8 @@ TdsPlugin = class(TNppPlugin)
cnstErroCaption = 'Error';
cnstNoBaseSelected = 'You must select Server and Base before executing SQL!';

cnstMainDlgId = 0;

var
NPlugin: TdsPlugin;

Expand Down Expand Up @@ -93,10 +97,10 @@ procedure TdsPlugin.DoNppnToolbarModification;
begin
tb.ToolbarIcon := 0;
tb.ToolbarBmp := LoadImage(Hinstance, 'TREE', IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE));
Npp_Send(NPPM_ADDTOOLBARICON, WPARAM(self.CmdIdFromDlgId(0)), LPARAM(@tb));
Npp_Send(NPPM_ADDTOOLBARICON, WPARAM(self.CmdIdFromDlgId(cnstMainDlgId)), LPARAM(@tb));

tb.ToolbarBmp := LoadImage(Hinstance, 'SQL', IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE));
Npp_Send(NPPM_ADDTOOLBARICON, WPARAM(self.CmdIdFromDlgId(1)), LPARAM(@tb));
Npp_Send(NPPM_ADDTOOLBARICON, WPARAM(self.CmdIdFromDlgId(cnstMainDlgId+1)), LPARAM(@tb));
end;

procedure TdsPlugin.FuncExecSQL;
Expand All @@ -105,7 +109,7 @@ procedure TdsPlugin.FuncExecSQL;
begin
if not Assigned(FForm) then
begin
FForm := TconnectionForm.Create(self, 0);
FuncLog;
TconnectionForm(FForm).DoConnect;
end
else
Expand All @@ -119,7 +123,7 @@ procedure TdsPlugin.FuncExecSQL;
N := Length(S);
end;

if (N > 1) and Assigned(FForm) then
if N > 1 then
begin
TconnectionForm(FForm).DoSql(S);
end;
Expand All @@ -128,8 +132,8 @@ procedure TdsPlugin.FuncExecSQL;

procedure TdsPlugin.FuncLog;
begin
if not Assigned(FForm) then FForm := TconnectionForm.Create(self, 0);
(FForm as TconnectionForm).Show;
if not Assigned(FForm) then FForm := TconnectionForm.Create(self, cnstMainDlgId);
(FForm as TconnectionForm).Carousel;
end;

end.

0 comments on commit 0c65dfd

Please sign in to comment.