mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Replace out-dated code which does not compile in 64bit mode in helpers.SetWindowSizeGrip. Use a TForm descendant in the new unit "extra_controls". Code parts taken from http://www.delphigroups.info/2/4/326787.html
This commit is contained in:
@ -40,7 +40,8 @@ uses
|
|||||||
exportgrid in '..\..\source\exportgrid.pas' {frmExportGrid},
|
exportgrid in '..\..\source\exportgrid.pas' {frmExportGrid},
|
||||||
syncdb in '..\..\source\syncdb.pas' {frmSyncDB},
|
syncdb in '..\..\source\syncdb.pas' {frmSyncDB},
|
||||||
gnugettext in '..\..\source\gnugettext.pas',
|
gnugettext in '..\..\source\gnugettext.pas',
|
||||||
JumpList in '..\..\source\JumpList.pas';
|
JumpList in '..\..\source\JumpList.pas',
|
||||||
|
extra_controls in '..\..\source\extra_controls.pas';
|
||||||
|
|
||||||
{$R ..\..\res\icon.RES}
|
{$R ..\..\res\icon.RES}
|
||||||
{$R ..\..\res\version.RES}
|
{$R ..\..\res\version.RES}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{32493ED6-4F48-45D7-9D50-E4FA13F59063}</ProjectGuid>
|
<ProjectGuid>{32493ED6-4F48-45D7-9D50-E4FA13F59063}</ProjectGuid>
|
||||||
<MainSource>heidisql.dpr</MainSource>
|
<MainSource>heidisql.dpr</MainSource>
|
||||||
@ -184,6 +184,7 @@
|
|||||||
</DCCReference>
|
</DCCReference>
|
||||||
<DCCReference Include="..\..\source\gnugettext.pas"/>
|
<DCCReference Include="..\..\source\gnugettext.pas"/>
|
||||||
<DCCReference Include="..\..\source\JumpList.pas"/>
|
<DCCReference Include="..\..\source\JumpList.pas"/>
|
||||||
|
<DCCReference Include="..\..\source\extra_controls.pas"/>
|
||||||
<BuildConfiguration Include="Debug">
|
<BuildConfiguration Include="Debug">
|
||||||
<Key>Cfg_2</Key>
|
<Key>Cfg_2</Key>
|
||||||
<CfgParent>Base</CfgParent>
|
<CfgParent>Base</CfgParent>
|
||||||
|
@ -4,12 +4,12 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Classes, Graphics, Forms, Controls, StdCtrls, VirtualTrees,
|
Windows, Classes, Graphics, Forms, Controls, StdCtrls, VirtualTrees,
|
||||||
ComCtrls, ToolWin, Dialogs, SysUtils, gnugettext;
|
ComCtrls, ToolWin, Dialogs, SysUtils, gnugettext, extra_controls;
|
||||||
|
|
||||||
{$I const.inc}
|
{$I const.inc}
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrmBinEditor = class(TForm)
|
TfrmBinEditor = class(TFormWithSizeGrip)
|
||||||
memoText: TMemo;
|
memoText: TMemo;
|
||||||
tlbStandard: TToolBar;
|
tlbStandard: TToolBar;
|
||||||
btnWrap: TToolButton;
|
btnWrap: TToolButton;
|
||||||
@ -101,7 +101,6 @@ begin
|
|||||||
btnWrap.Click;
|
btnWrap.Click;
|
||||||
// Fix label position:
|
// Fix label position:
|
||||||
lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2;
|
lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2;
|
||||||
SetWindowSizeGrip(Handle, True);
|
|
||||||
memoText.SelectAll;
|
memoText.SelectAll;
|
||||||
memoText.SetFocus;
|
memoText.SetFocus;
|
||||||
memoTextChange(Sender);
|
memoTextChange(Sender);
|
||||||
|
@ -4,10 +4,10 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Classes, Controls, Forms, StdCtrls, CheckLst, ExtCtrls,
|
Windows, Classes, Controls, Forms, StdCtrls, CheckLst, ExtCtrls,
|
||||||
helpers, gnugettext;
|
helpers, gnugettext, extra_controls;
|
||||||
|
|
||||||
type
|
type
|
||||||
TColumnSelectionForm = class(TForm)
|
TColumnSelectionForm = class(TFormWithSizeGrip)
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
btnOK: TButton;
|
btnOK: TButton;
|
||||||
chkSelectAll: TCheckBox;
|
chkSelectAll: TCheckBox;
|
||||||
@ -45,7 +45,6 @@ procedure TColumnSelectionForm.FormCreate(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
TranslateComponent(Self);
|
TranslateComponent(Self);
|
||||||
SetWindowSizeGrip(Self.Handle, True);
|
|
||||||
Width := AppSettings.ReadInt(asColumnSelectorWidth);
|
Width := AppSettings.ReadInt(asColumnSelectorWidth);
|
||||||
Height := AppSettings.ReadInt(asColumnSelectorHeight);
|
Height := AppSettings.ReadInt(asColumnSelectorHeight);
|
||||||
end;
|
end;
|
||||||
|
@ -10,11 +10,11 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||||
VirtualTrees, Menus, Graphics, Generics.Collections, ActiveX,
|
VirtualTrees, Menus, Graphics, Generics.Collections, ActiveX, extra_controls,
|
||||||
dbconnection, gnugettext;
|
dbconnection, gnugettext;
|
||||||
|
|
||||||
type
|
type
|
||||||
Tconnform = class(TForm)
|
Tconnform = class(TFormWithSizeGrip)
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
btnOpen: TButton;
|
btnOpen: TButton;
|
||||||
btnSave: TButton;
|
btnSave: TButton;
|
||||||
@ -178,7 +178,6 @@ begin
|
|||||||
// Fix GUI stuff
|
// Fix GUI stuff
|
||||||
TranslateComponent(Self);
|
TranslateComponent(Self);
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
SetWindowSizeGrip(Handle, True);
|
|
||||||
Width := AppSettings.ReadInt(asSessionManagerWindowWidth);
|
Width := AppSettings.ReadInt(asSessionManagerWindowWidth);
|
||||||
Height := AppSettings.ReadInt(asSessionManagerWindowHeight);
|
Height := AppSettings.ReadInt(asSessionManagerWindowHeight);
|
||||||
ListSessions.Width := AppSettings.ReadInt(asSessionManagerListWidth);
|
ListSessions.Width := AppSettings.ReadInt(asSessionManagerListWidth);
|
||||||
|
@ -4,11 +4,11 @@ unit copytable;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
|
Windows, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, extra_controls,
|
||||||
dbconnection, VirtualTrees, SynEdit, SynMemo, Menus, gnugettext;
|
dbconnection, VirtualTrees, SynEdit, SynMemo, Menus, gnugettext;
|
||||||
|
|
||||||
type
|
type
|
||||||
TCopyTableForm = class(TForm)
|
TCopyTableForm = class(TFormWithSizeGrip)
|
||||||
editNewTablename: TEdit;
|
editNewTablename: TEdit;
|
||||||
lblNewTablename: TLabel;
|
lblNewTablename: TLabel;
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
@ -71,7 +71,6 @@ begin
|
|||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
Width := AppSettings.ReadInt(asCopyTableWindowWidth);
|
Width := AppSettings.ReadInt(asCopyTableWindowWidth);
|
||||||
Height := AppSettings.ReadInt(asCopyTableWindowHeight);
|
Height := AppSettings.ReadInt(asCopyTableWindowHeight);
|
||||||
SetWindowSizeGrip(Handle, True);
|
|
||||||
MainForm.SetupSynEditors;
|
MainForm.SetupSynEditors;
|
||||||
FixVT(TreeElements);
|
FixVT(TreeElements);
|
||||||
FColumns := TTableColumnList.Create;
|
FColumns := TTableColumnList.Create;
|
||||||
|
@ -4,13 +4,13 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
|
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
|
||||||
dbconnection, mysql_structures, ComCtrls, gnugettext, SynRegExpr;
|
dbconnection, mysql_structures, ComCtrls, gnugettext, SynRegExpr, extra_controls;
|
||||||
|
|
||||||
type
|
type
|
||||||
TVarType = (vtString, vtNumeric, vtBoolean, vtEnum);
|
TVarType = (vtString, vtNumeric, vtBoolean, vtEnum);
|
||||||
EVariableError = class(Exception);
|
EVariableError = class(Exception);
|
||||||
|
|
||||||
TfrmEditVariable = class(TForm)
|
TfrmEditVariable = class(TFormWithSizeGrip)
|
||||||
btnOK: TButton;
|
btnOK: TButton;
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
grpScope: TGroupBox;
|
grpScope: TGroupBox;
|
||||||
@ -57,7 +57,6 @@ procedure TfrmEditVariable.FormCreate(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
TranslateComponent(Self);
|
TranslateComponent(Self);
|
||||||
SetWindowSizeGrip(Handle, True);
|
|
||||||
Width := AppSettings.ReadInt(asEditVarWindowWidth);
|
Width := AppSettings.ReadInt(asEditVarWindowWidth);
|
||||||
Height := AppSettings.ReadInt(asEditVarWindowHeight);
|
Height := AppSettings.ReadInt(asEditVarWindowHeight);
|
||||||
end;
|
end;
|
||||||
|
61
source/extra_controls.pas
Normal file
61
source/extra_controls.pas
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
unit extra_controls;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, Forms, Windows, Messages;
|
||||||
|
|
||||||
|
type
|
||||||
|
// Form with a sizegrip in the lower right corner, without the need for a statusbar
|
||||||
|
TFormWithSizeGrip = class(TForm)
|
||||||
|
private
|
||||||
|
FSizeGripRect: TRect;
|
||||||
|
FSizeGripWidth: Integer;
|
||||||
|
FSizeGripHeight: Integer;
|
||||||
|
procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST;
|
||||||
|
public
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
procedure Paint; override;
|
||||||
|
procedure Resize; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
{ TFormWithSizeGrip }
|
||||||
|
|
||||||
|
constructor TFormWithSizeGrip.Create(AOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
FSizeGripWidth := GetSystemMetrics(SM_CXVSCROLL);
|
||||||
|
FSizeGripHeight := GetSystemMetrics(SM_CYHSCROLL);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormWithSizeGrip.WMNCHitTest(var Msg: TWMNCHitTest);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
if PtInRect(FSizeGripRect, ScreenToClient(SmallPointToPoint(Msg.Pos))) then
|
||||||
|
Msg.Result := HTBOTTOMRIGHT;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormWithSizeGrip.Paint;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
DrawFrameControl(Canvas.Handle, FSizeGripRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormWithSizeGrip.Resize;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
FSizeGripRect := ClientRect;
|
||||||
|
FSizeGripRect.Left := FSizeGripRect.Right - FSizeGripWidth;
|
||||||
|
FSizeGripRect.Top := FSizeGripRect.Bottom - FSizeGripHeight;
|
||||||
|
Refresh;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
@ -915,9 +915,7 @@ begin
|
|||||||
FPanel.Hide;
|
FPanel.Hide;
|
||||||
FPanel.Parent := FParentForm;
|
FPanel.Parent := FParentForm;
|
||||||
FPanel.ParentBackground := False;
|
FPanel.ParentBackground := False;
|
||||||
FPanel.Width := AppSettings.ReadInt(asSetEditorWidth);
|
FPanel.Height := 150;
|
||||||
FPanel.Height := AppSettings.ReadInt(asSetEditorHeight);
|
|
||||||
SetWindowSizeGrip(FPanel.Handle, True);
|
|
||||||
FPanel.OnResize := PanelResize;
|
FPanel.OnResize := PanelResize;
|
||||||
FPanel.OnExit := DoEndEdit;
|
FPanel.OnExit := DoEndEdit;
|
||||||
|
|
||||||
@ -1002,6 +1000,7 @@ begin
|
|||||||
R := GetCellRect(False);
|
R := GetCellRect(False);
|
||||||
FPanel.Top := R.Top;
|
FPanel.Top := R.Top;
|
||||||
FPanel.Left := R.Left;
|
FPanel.Left := R.Left;
|
||||||
|
FPanel.Width := R.Width;
|
||||||
|
|
||||||
FBtnOk.Width := (FPanel.Width - 3*margin) div 2;
|
FBtnOk.Width := (FPanel.Width - 3*margin) div 2;
|
||||||
FBtnOk.Left := margin;
|
FBtnOk.Left := margin;
|
||||||
|
@ -43,14 +43,6 @@ type
|
|||||||
end;
|
end;
|
||||||
TDBObjectEditorClass = class of TDBObjectEditor;
|
TDBObjectEditorClass = class of TDBObjectEditor;
|
||||||
|
|
||||||
TWndProc = function (hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
|
|
||||||
PGripInfo = ^TGripInfo;
|
|
||||||
TGripInfo = record
|
|
||||||
OldWndProc: TWndProc;
|
|
||||||
Enabled: boolean;
|
|
||||||
GripRect: TRect;
|
|
||||||
end;
|
|
||||||
|
|
||||||
TSQLBatch = class;
|
TSQLBatch = class;
|
||||||
TSQLSentence = class(TObject)
|
TSQLSentence = class(TObject)
|
||||||
private
|
private
|
||||||
@ -168,7 +160,7 @@ type
|
|||||||
asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics,
|
asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics,
|
||||||
asLastUsageStatisticCall, asDisplayBars, asBarColor, asMySQLBinaries, asCustomSnippetsDirectory, asPromptSaveFileOnTabClose,
|
asLastUsageStatisticCall, asDisplayBars, asBarColor, asMySQLBinaries, asCustomSnippetsDirectory, asPromptSaveFileOnTabClose,
|
||||||
asCompletionProposal, asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory,
|
asCompletionProposal, asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory,
|
||||||
asFindDialogReplaceHistory, asMaxQueryResults, asSetEditorWidth, asSetEditorHeight, asLogErrors,
|
asFindDialogReplaceHistory, asMaxQueryResults, asLogErrors,
|
||||||
asLogUserSQL, asLogSQL, asLogInfos, asLogDebug, asFieldColorNumeric,
|
asLogUserSQL, asLogSQL, asLogInfos, asLogDebug, asFieldColorNumeric,
|
||||||
asFieldColorReal, asFieldColorText, asFieldColorBinary, asFieldColorDatetime, asFieldColorSpatial,
|
asFieldColorReal, asFieldColorText, asFieldColorBinary, asFieldColorDatetime, asFieldColorSpatial,
|
||||||
asFieldColorOther, asFieldEditorBinary, asFieldEditorDatetime, asFieldEditorDatetimePrefill, asFieldEditorEnum,
|
asFieldColorOther, asFieldEditorBinary, asFieldEditorDatetime, asFieldEditorDatetimePrefill, asFieldEditorEnum,
|
||||||
@ -276,7 +268,6 @@ type
|
|||||||
function FormatByteNumber( Bytes: String; Decimals: Byte = 1 ): String; Overload;
|
function FormatByteNumber( Bytes: String; Decimals: Byte = 1 ): String; Overload;
|
||||||
function FormatTimeNumber(Seconds: Cardinal; DisplaySeconds: Boolean): String;
|
function FormatTimeNumber(Seconds: Cardinal; DisplaySeconds: Boolean): String;
|
||||||
function GetTempDir: String;
|
function GetTempDir: String;
|
||||||
procedure SetWindowSizeGrip(hWnd: HWND; Enable: boolean);
|
|
||||||
procedure SaveUnicodeFile(Filename: String; Text: String);
|
procedure SaveUnicodeFile(Filename: String; Text: String);
|
||||||
procedure OpenTextFile(const Filename: String; out Stream: TFileStream; var Encoding: TEncoding);
|
procedure OpenTextFile(const Filename: String; out Stream: TFileStream; var Encoding: TEncoding);
|
||||||
function DetectEncoding(Stream: TStream): TEncoding;
|
function DetectEncoding(Stream: TStream): TEncoding;
|
||||||
@ -1054,142 +1045,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
Code taken from SizeGripHWND.pas:
|
|
||||||
Copyright (C) 2005, 2006 Volker Siebert <flocke@vssd.de>
|
|
||||||
Alle Rechte vorbehalten.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
copy of this software and associated documentation files (the "Software"),
|
|
||||||
to deal in the Software without restriction, including without limitation
|
|
||||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
}
|
|
||||||
function SizeGripWndProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
|
|
||||||
var
|
|
||||||
Info: PGripInfo;
|
|
||||||
dc: HDC;
|
|
||||||
pt: TPoint;
|
|
||||||
|
|
||||||
// Invalidate the current grip rectangle
|
|
||||||
procedure InvalidateGrip;
|
|
||||||
begin
|
|
||||||
with Info^ do
|
|
||||||
if (GripRect.Right > GripRect.Left) and
|
|
||||||
(GripRect.Bottom > GripRect.Top) then
|
|
||||||
InvalidateRect(hWnd, @GripRect, true);
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Update (and invalidate) the current grip rectangle
|
|
||||||
procedure UpdateGrip;
|
|
||||||
begin
|
|
||||||
with Info^ do
|
|
||||||
begin
|
|
||||||
GetClientRect(hWnd, GripRect);
|
|
||||||
GripRect.Left := GripRect.Right - GetSystemMetrics(SM_CXHSCROLL);
|
|
||||||
GripRect.Top := GripRect.Bottom - GetSystemMetrics(SM_CYVSCROLL);
|
|
||||||
end;
|
|
||||||
|
|
||||||
InvalidateGrip;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function CallOld: LRESULT;
|
|
||||||
begin
|
|
||||||
Result := CallWindowProc(@Info^.OldWndProc, hWnd, Msg, wParam, lParam);
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
|
||||||
Info := PGripInfo(GetProp(hWnd, SizeGripProp));
|
|
||||||
if Info = nil then
|
|
||||||
Result := DefWindowProc(hWnd, Msg, wParam, lParam)
|
|
||||||
else if not Info^.Enabled then
|
|
||||||
Result := CallOld
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
case Msg of
|
|
||||||
WM_NCDESTROY: begin
|
|
||||||
Result := CallOld;
|
|
||||||
|
|
||||||
SetWindowLong(hWnd, GWL_WNDPROC, LongInt(@Info^.OldWndProc));
|
|
||||||
RemoveProp(hWnd, SizeGripProp);
|
|
||||||
Dispose(Info);
|
|
||||||
end;
|
|
||||||
|
|
||||||
WM_PAINT: begin
|
|
||||||
Result := CallOld;
|
|
||||||
if wParam = 0 then
|
|
||||||
begin
|
|
||||||
dc := GetDC(hWnd);
|
|
||||||
DrawFrameControl(dc, Info^.GripRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
|
|
||||||
ReleaseDC(hWnd, dc);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
WM_NCHITTEST: begin
|
|
||||||
pt.x := TSmallPoint(lParam).x;
|
|
||||||
pt.y := TSmallPoint(lParam).y;
|
|
||||||
ScreenToClient(hWnd, pt);
|
|
||||||
if PtInRect(Info^.GripRect, pt) then
|
|
||||||
Result := HTBOTTOMRIGHT
|
|
||||||
else
|
|
||||||
Result := CallOld;
|
|
||||||
end;
|
|
||||||
|
|
||||||
WM_SIZE: begin
|
|
||||||
InvalidateGrip;
|
|
||||||
Result := CallOld;
|
|
||||||
UpdateGrip;
|
|
||||||
end;
|
|
||||||
|
|
||||||
else
|
|
||||||
Result := CallOld;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ Note that SetWindowSizeGrip(..., false) does not really remove the hook -
|
|
||||||
it just sets "Enabled" to false. The hook plus all data is removed when
|
|
||||||
the window is destroyed.
|
|
||||||
}
|
|
||||||
procedure SetWindowSizeGrip(hWnd: HWND; Enable: boolean);
|
|
||||||
var
|
|
||||||
Info: PGripInfo;
|
|
||||||
begin
|
|
||||||
Info := PGripInfo(GetProp(hWnd, SizeGripProp));
|
|
||||||
if (Info = nil) and Enable then
|
|
||||||
begin
|
|
||||||
New(Info);
|
|
||||||
FillChar(Info^, SizeOf(TGripInfo), 0);
|
|
||||||
|
|
||||||
with Info^ do
|
|
||||||
begin
|
|
||||||
Info^.OldWndProc := TWndProc(Pointer(GetWindowLong(hWnd, GWL_WNDPROC)));
|
|
||||||
|
|
||||||
GetClientRect(hWnd, GripRect);
|
|
||||||
GripRect.Left := GripRect.Right - GetSystemMetrics(SM_CXHSCROLL);
|
|
||||||
GripRect.Top := GripRect.Bottom - GetSystemMetrics(SM_CYVSCROLL);
|
|
||||||
end;
|
|
||||||
|
|
||||||
SetProp(hWnd, SizeGripProp, Cardinal(Info));
|
|
||||||
SetWindowLong(hWnd, GWL_WNDPROC, LongInt(@SizeGripWndProc));
|
|
||||||
end;
|
|
||||||
|
|
||||||
if (Info <> nil) then
|
|
||||||
if Enable <> Info^.Enabled then
|
|
||||||
with Info^ do
|
|
||||||
begin
|
|
||||||
Enabled := Enable;
|
|
||||||
if (GripRect.Right > GripRect.Left) and
|
|
||||||
(GripRect.Bottom > GripRect.Top) then
|
|
||||||
InvalidateRect(hWnd, @GripRect, true);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{**
|
{**
|
||||||
Save a textfile with unicode
|
Save a textfile with unicode
|
||||||
}
|
}
|
||||||
@ -3331,8 +3186,6 @@ begin
|
|||||||
InitSetting(asFindDialogSearchHistory, 'FindDialogSearchHistory', 0, False, '');
|
InitSetting(asFindDialogSearchHistory, 'FindDialogSearchHistory', 0, False, '');
|
||||||
InitSetting(asFindDialogReplaceHistory, 'FindDialogReplaceHistory', 0, False, '');
|
InitSetting(asFindDialogReplaceHistory, 'FindDialogReplaceHistory', 0, False, '');
|
||||||
InitSetting(asMaxQueryResults, 'MaxQueryResults', 10);
|
InitSetting(asMaxQueryResults, 'MaxQueryResults', 10);
|
||||||
InitSetting(asSetEditorWidth, 'SetEditorWidth', 100);
|
|
||||||
InitSetting(asSetEditorHeight, 'SetEditorHeight', 130);
|
|
||||||
InitSetting(asLogErrors, 'LogErrors', 0, True);
|
InitSetting(asLogErrors, 'LogErrors', 0, True);
|
||||||
InitSetting(asLogUserSQL, 'LogUserSQL', 0, True);
|
InitSetting(asLogUserSQL, 'LogUserSQL', 0, True);
|
||||||
InitSetting(asLogSQL, 'LogSQL', 0, True);
|
InitSetting(asLogSQL, 'LogSQL', 0, True);
|
||||||
|
@ -4,7 +4,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls,
|
Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls,
|
||||||
ShellApi, Math, Graphics, ComCtrls, ToolWin,
|
ShellApi, Math, Graphics, ComCtrls, ToolWin, extra_controls,
|
||||||
dbconnection, mysql_structures, VirtualTrees, grideditlinks, SynRegExpr, gnugettext, helpers;
|
dbconnection, mysql_structures, VirtualTrees, grideditlinks, SynRegExpr, gnugettext, helpers;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -25,7 +25,7 @@ type
|
|||||||
end;
|
end;
|
||||||
PFileInfo = ^TFileInfo;
|
PFileInfo = ^TFileInfo;
|
||||||
|
|
||||||
TfrmInsertFiles = class(TForm)
|
TfrmInsertFiles = class(TFormWithSizeGrip)
|
||||||
btnInsert: TButton;
|
btnInsert: TButton;
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
OpenDialog: TOpenDialog;
|
OpenDialog: TOpenDialog;
|
||||||
@ -119,7 +119,6 @@ begin
|
|||||||
TranslateComponent(Self);
|
TranslateComponent(Self);
|
||||||
ListFiles.Images := GetSystemImageList;
|
ListFiles.Images := GetSystemImageList;
|
||||||
DragAcceptFiles(Handle, True);
|
DragAcceptFiles(Handle, True);
|
||||||
SetWindowSizeGrip(Self.Handle, True);
|
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
MainForm.RestoreListSetup(ListColumns);
|
MainForm.RestoreListSetup(ListColumns);
|
||||||
MainForm.RestoreListSetup(ListFiles);
|
MainForm.RestoreListSetup(ListFiles);
|
||||||
|
@ -10,11 +10,11 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ComCtrls, CheckLst,
|
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ComCtrls, CheckLst,
|
||||||
SynRegExpr, Buttons, ExtCtrls, ToolWin, ExtDlgs, Math,
|
SynRegExpr, Buttons, ExtCtrls, ToolWin, ExtDlgs, Math, extra_controls,
|
||||||
dbconnection, mysql_structures, gnugettext;
|
dbconnection, mysql_structures, gnugettext;
|
||||||
|
|
||||||
type
|
type
|
||||||
Tloaddataform = class(TForm)
|
Tloaddataform = class(TFormWithSizeGrip)
|
||||||
btnImport: TButton;
|
btnImport: TButton;
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
lblDatabase: TLabel;
|
lblDatabase: TLabel;
|
||||||
@ -94,7 +94,6 @@ procedure Tloaddataform.FormCreate(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
TranslateComponent(Self);
|
TranslateComponent(Self);
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
SetWindowSizeGrip(Handle, True);
|
|
||||||
// Restore settings
|
// Restore settings
|
||||||
Width := AppSettings.ReadInt(asCSVImportWindowWidth);
|
Width := AppSettings.ReadInt(asCSVImportWindowWidth);
|
||||||
Height := AppSettings.ReadInt(asCSVImportWindowHeight);
|
Height := AppSettings.ReadInt(asCSVImportWindowHeight);
|
||||||
|
@ -3,11 +3,11 @@ unit selectdbobject;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Classes, Controls, Forms, StdCtrls, VirtualTrees, Graphics,
|
Windows, Classes, Controls, Forms, StdCtrls, VirtualTrees, Graphics, extra_controls,
|
||||||
dbconnection, gnugettext;
|
dbconnection, gnugettext;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrmSelectDBObject = class(TForm)
|
TfrmSelectDBObject = class(TFormWithSizeGrip)
|
||||||
TreeDBO: TVirtualStringTree;
|
TreeDBO: TVirtualStringTree;
|
||||||
btnOK: TButton;
|
btnOK: TButton;
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
@ -65,7 +65,6 @@ begin
|
|||||||
TranslateComponent(Self);
|
TranslateComponent(Self);
|
||||||
Width := AppSettings.ReadInt(asSelectDBOWindowWidth);
|
Width := AppSettings.ReadInt(asSelectDBOWindowWidth);
|
||||||
Height := AppSettings.ReadInt(asSelectDBOWindowHeight);
|
Height := AppSettings.ReadInt(asSelectDBOWindowHeight);
|
||||||
SetWindowSizeGrip( Self.Handle, True );
|
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
TreeDBO.TreeOptions := MainForm.DBtree.TreeOptions;
|
TreeDBO.TreeOptions := MainForm.DBtree.TreeOptions;
|
||||||
FixVT(TreeDBO);
|
FixVT(TreeDBO);
|
||||||
|
@ -4,12 +4,12 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls,
|
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls,
|
||||||
Buttons, SynMemo, SynEditHighlighter, SynHighlighterURI,
|
Buttons, SynMemo, SynEditHighlighter, SynHighlighterURI, extra_controls,
|
||||||
SynURIOpener, SynEdit, VirtualTrees, Graphics,
|
SynURIOpener, SynEdit, VirtualTrees, Graphics,
|
||||||
dbconnection, gnugettext;
|
dbconnection, gnugettext;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrmSQLhelp = class(TForm)
|
TfrmSQLhelp = class(TFormWithSizeGrip)
|
||||||
URIOpenerDescription: TSynURIOpener;
|
URIOpenerDescription: TSynURIOpener;
|
||||||
URIHighlighter: TSynURISyn;
|
URIHighlighter: TSynURISyn;
|
||||||
URIOpenerExample: TSynURIOpener;
|
URIOpenerExample: TSynURIOpener;
|
||||||
@ -81,7 +81,6 @@ procedure TfrmSQLhelp.FormCreate(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
// Set window-layout
|
// Set window-layout
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
SetWindowSizeGrip(Handle, True);
|
|
||||||
Top := AppSettings.ReadInt(asSQLHelpWindowTop);
|
Top := AppSettings.ReadInt(asSQLHelpWindowTop);
|
||||||
Left := AppSettings.ReadInt(asSQLHelpWindowLeft);
|
Left := AppSettings.ReadInt(asSQLHelpWindowLeft);
|
||||||
Width := AppSettings.ReadInt(asSQLHelpWindowWidth);
|
Width := AppSettings.ReadInt(asSQLHelpWindowWidth);
|
||||||
|
@ -4,11 +4,11 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, StdCtrls, Generics.Collections, VirtualTrees,
|
Dialogs, StdCtrls, Generics.Collections, VirtualTrees, extra_controls,
|
||||||
dbconnection, gnugettext;
|
dbconnection, gnugettext;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrmSyncDB = class(TForm)
|
TfrmSyncDB = class(TFormWithSizeGrip)
|
||||||
treeSource: TVirtualStringTree;
|
treeSource: TVirtualStringTree;
|
||||||
lblSource: TLabel;
|
lblSource: TLabel;
|
||||||
grpTarget: TGroupBox;
|
grpTarget: TGroupBox;
|
||||||
@ -109,7 +109,6 @@ begin
|
|||||||
Caption := MainForm.actSynchronizeDatabase.Caption;
|
Caption := MainForm.actSynchronizeDatabase.Caption;
|
||||||
TranslateComponent(Self);
|
TranslateComponent(Self);
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
SetWindowSizeGrip(Self.Handle, True);
|
|
||||||
FixVT(treeSource);
|
FixVT(treeSource);
|
||||||
FixVT(treeDifferences);
|
FixVT(treeDifferences);
|
||||||
|
|
||||||
|
@ -10,12 +10,12 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, SysUtils, Classes, Controls, Forms, StdCtrls, ComCtrls, Buttons, Dialogs, StdActns,
|
Windows, SysUtils, Classes, Controls, Forms, StdCtrls, ComCtrls, Buttons, Dialogs, StdActns,
|
||||||
VirtualTrees, ExtCtrls, Graphics, SynRegExpr, Math, Generics.Collections,
|
VirtualTrees, ExtCtrls, Graphics, SynRegExpr, Math, Generics.Collections, extra_controls,
|
||||||
dbconnection, helpers, Menus, gnugettext, DateUtils, System.Zip, System.UITypes;
|
dbconnection, helpers, Menus, gnugettext, DateUtils, System.Zip, System.UITypes;
|
||||||
|
|
||||||
type
|
type
|
||||||
TToolMode = (tmMaintenance, tmFind, tmSQLExport, tmBulkTableEdit);
|
TToolMode = (tmMaintenance, tmFind, tmSQLExport, tmBulkTableEdit);
|
||||||
TfrmTableTools = class(TForm)
|
TfrmTableTools = class(TFormWithSizeGrip)
|
||||||
btnCloseOrCancel: TButton;
|
btnCloseOrCancel: TButton;
|
||||||
pnlTop: TPanel;
|
pnlTop: TPanel;
|
||||||
TreeObjects: TVirtualStringTree;
|
TreeObjects: TVirtualStringTree;
|
||||||
@ -221,7 +221,6 @@ begin
|
|||||||
comboExportOutputTarget.Text := '';
|
comboExportOutputTarget.Text := '';
|
||||||
|
|
||||||
// Various
|
// Various
|
||||||
SetWindowSizeGrip( Self.Handle, True );
|
|
||||||
FixVT(TreeObjects);
|
FixVT(TreeObjects);
|
||||||
FixVT(ResultGrid);
|
FixVT(ResultGrid);
|
||||||
FResults := TObjectList<TStringList>.Create;
|
FResults := TObjectList<TStringList>.Create;
|
||||||
|
@ -5,12 +5,12 @@ interface
|
|||||||
uses
|
uses
|
||||||
Windows, Classes, Graphics, Forms, Controls, StdCtrls, VirtualTrees,
|
Windows, Classes, Graphics, Forms, Controls, StdCtrls, VirtualTrees,
|
||||||
ComCtrls, ToolWin, Dialogs, SysUtils, Menus, ExtDlgs,
|
ComCtrls, ToolWin, Dialogs, SysUtils, Menus, ExtDlgs,
|
||||||
helpers, gnugettext, ActnList, StdActns;
|
helpers, gnugettext, ActnList, StdActns, extra_controls, System.Actions;
|
||||||
|
|
||||||
{$I const.inc}
|
{$I const.inc}
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrmTextEditor = class(TForm)
|
TfrmTextEditor = class(TFormWithSizeGrip)
|
||||||
memoText: TMemo;
|
memoText: TMemo;
|
||||||
tlbStandard: TToolBar;
|
tlbStandard: TToolBar;
|
||||||
btnWrap: TToolButton;
|
btnWrap: TToolButton;
|
||||||
@ -198,7 +198,6 @@ begin
|
|||||||
btnWrap.Click;
|
btnWrap.Click;
|
||||||
// Fix label position:
|
// Fix label position:
|
||||||
lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2;
|
lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2;
|
||||||
SetWindowSizeGrip(Handle, True);
|
|
||||||
memoText.SetFocus;
|
memoText.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls,
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls,
|
||||||
ExtCtrls, ToolWin, ClipBrd, Generics.Collections, Generics.Defaults, SynRegExpr,
|
ExtCtrls, ToolWin, ClipBrd, Generics.Collections, Generics.Defaults, SynRegExpr, extra_controls,
|
||||||
dbconnection, helpers, VirtualTrees, Menus, gnugettext;
|
dbconnection, helpers, VirtualTrees, Menus, gnugettext;
|
||||||
|
|
||||||
{$I const.inc}
|
{$I const.inc}
|
||||||
@ -40,7 +40,7 @@ type
|
|||||||
|
|
||||||
EInputError = class(Exception);
|
EInputError = class(Exception);
|
||||||
|
|
||||||
TUserManagerForm = class(TForm)
|
TUserManagerForm = class(TFormWithSizeGrip)
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
btnSave: TButton;
|
btnSave: TButton;
|
||||||
pnlLeft: TPanel;
|
pnlLeft: TPanel;
|
||||||
@ -211,7 +211,6 @@ begin
|
|||||||
Width := AppSettings.ReadInt(asUsermanagerWindowWidth);
|
Width := AppSettings.ReadInt(asUsermanagerWindowWidth);
|
||||||
Height := AppSettings.ReadInt(asUsermanagerWindowHeight);
|
Height := AppSettings.ReadInt(asUsermanagerWindowHeight);
|
||||||
pnlLeft.Width := AppSettings.ReadInt(asUsermanagerListWidth);
|
pnlLeft.Width := AppSettings.ReadInt(asUsermanagerListWidth);
|
||||||
SetWindowSizeGrip( Self.Handle, True );
|
|
||||||
FixVT(listUsers);
|
FixVT(listUsers);
|
||||||
FixVT(treePrivs);
|
FixVT(treePrivs);
|
||||||
Mainform.RestoreListSetup(listUsers);
|
Mainform.RestoreListSetup(listUsers);
|
||||||
|
Reference in New Issue
Block a user