mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Restore maximized WindowStyle of grid text editor, and move some code from FormShow to FormCreate, to overcome a glitch with the window dimensions. Closes #89.
This commit is contained in:
@ -135,7 +135,7 @@ type
|
||||
asLogToFile, asMainWinMaximized, asMainWinLeft, asMainWinTop, asMainWinWidth,
|
||||
asMainWinHeight, asMainWinOnMonitor, asCoolBandIndex, asCoolBandBreak, asCoolBandWidth, asQuerymemoheight, asDbtreewidth,
|
||||
asDataPreviewHeight, asDataPreviewEnabled, asLogHeight, asQueryhelperswidth, asStopOnErrorsInBatchMode,
|
||||
asWrapLongLines, asDisplayBLOBsAsText, asSingleQueries, asMemoEditorWidth, asMemoEditorHeight,
|
||||
asWrapLongLines, asDisplayBLOBsAsText, asSingleQueries, asMemoEditorWidth, asMemoEditorHeight, asMemoEditorMaximized,
|
||||
asMemoEditorWrap, asDelimiter, asSQLHelpWindowLeft, asSQLHelpWindowTop, asSQLHelpWindowWidth,
|
||||
asSQLHelpWindowHeight, asSQLHelpPnlLeftWidth, asSQLHelpPnlRightTopHeight, asTableEditorTabsHeight, asHost,
|
||||
asUser, asPassword, asWindowsAuth, asLoginPrompt, asPort,
|
||||
@ -3351,6 +3351,7 @@ begin
|
||||
InitSetting(asSingleQueries, 'SingleQueries', 0, True);
|
||||
InitSetting(asMemoEditorWidth, 'MemoEditorWidth', 100);
|
||||
InitSetting(asMemoEditorHeight, 'MemoEditorHeight', 100);
|
||||
InitSetting(asMemoEditorMaximized, 'MemoEditorMaximized', 0, False);
|
||||
InitSetting(asMemoEditorWrap, 'MemoEditorWrap', 0, False);
|
||||
InitSetting(asDelimiter, 'Delimiter', 0, False, ';');
|
||||
InitSetting(asSQLHelpWindowLeft, 'SQLHelp_WindowLeft', 0);
|
||||
|
@ -167,26 +167,31 @@ begin
|
||||
menuMacLB.Tag := Integer(lbsMac);
|
||||
menuWideLB.Tag := Integer(lbsWide);
|
||||
menuMixedLB.Tag := Integer(lbsMixed);
|
||||
// Restore form dimensions
|
||||
Width := AppSettings.ReadInt(asMemoEditorWidth);
|
||||
Height := AppSettings.ReadInt(asMemoEditorHeight);
|
||||
if AppSettings.ReadBool(asMemoEditorMaximized) then
|
||||
WindowState := wsMaximized;
|
||||
if AppSettings.ReadBool(asMemoEditorWrap) then
|
||||
btnWrap.Click;
|
||||
// Fix label position:
|
||||
lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmTextEditor.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
if WindowState <> wsMaximized then begin
|
||||
AppSettings.WriteInt(asMemoEditorWidth, Width);
|
||||
AppSettings.WriteInt(asMemoEditorHeight, Height);
|
||||
end;
|
||||
AppSettings.WriteBool(asMemoEditorMaximized, WindowState=wsMaximized);
|
||||
AppSettings.WriteBool(asMemoEditorWrap, btnWrap.Down);
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmTextEditor.FormShow(Sender: TObject);
|
||||
begin
|
||||
// Restore form dimensions
|
||||
Width := AppSettings.ReadInt(asMemoEditorWidth);
|
||||
Height := AppSettings.ReadInt(asMemoEditorHeight);
|
||||
if AppSettings.ReadBool(asMemoEditorWrap) then
|
||||
btnWrap.Click;
|
||||
// Fix label position:
|
||||
lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2;
|
||||
FmemoText.SetFocus;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user