mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 22:00:16 +08:00
Unify help calls in helpers.Help(), and pass sending control for "place" parameter in help url.
This commit is contained in:
@ -1393,7 +1393,7 @@ object AboutBox: TAboutBox
|
||||
Font.Style = []
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
OnClick = OpenURL
|
||||
OnClick = lblCreditsClick
|
||||
OnMouseMove = MouseOver
|
||||
end
|
||||
object btnClose: TButton
|
||||
@ -1407,8 +1407,6 @@ object AboutBox: TAboutBox
|
||||
Default = True
|
||||
ModalResult = 1
|
||||
TabOrder = 3
|
||||
ExplicitLeft = 499
|
||||
ExplicitTop = 429
|
||||
end
|
||||
object btnUpdateCheck: TButton
|
||||
Left = 117
|
||||
|
@ -30,6 +30,7 @@ type
|
||||
procedure editDonatedEnter(Sender: TObject);
|
||||
procedure editDonatedExit(Sender: TObject);
|
||||
procedure btnDonatedOKClick(Sender: TObject);
|
||||
procedure lblCreditsClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
@ -123,11 +124,15 @@ begin
|
||||
lblAppCompiled.Caption := _('Compiled on:') + ' ' + DateTimeToStr(GetImageLinkTimeStamp(Application.ExeName));
|
||||
lblAppWebpage.Caption := AppDomain;
|
||||
lblAppWebpage.Hint := AppDomain+'?place='+EncodeURLParam(lblAppWebpage.Name);
|
||||
lblCredits.Hint := AppDomain + 'help.php?place='+EncodeURLParam(lblCredits.Name)+'#credits';
|
||||
|
||||
Screen.Cursor := crDefault;
|
||||
end;
|
||||
|
||||
|
||||
procedure TAboutBox.lblCreditsClick(Sender: TObject);
|
||||
begin
|
||||
Help(Sender, 'credits');
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
object connform: Tconnform
|
||||
Left = 288
|
||||
Top = 129
|
||||
BorderIcons = [biSystemMenu]
|
||||
BorderIcons = [biSystemMenu, biHelp]
|
||||
Caption = 'Session manager'
|
||||
ClientHeight = 364
|
||||
ClientWidth = 494
|
||||
|
@ -10,7 +10,7 @@ interface
|
||||
|
||||
uses
|
||||
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||
VirtualTrees, Menus, Graphics, Generics.Collections, ActiveX, extra_controls,
|
||||
VirtualTrees, Menus, Graphics, Generics.Collections, ActiveX, extra_controls, Messages,
|
||||
dbconnection, gnugettext;
|
||||
|
||||
type
|
||||
@ -168,6 +168,8 @@ type
|
||||
procedure ValidateControls;
|
||||
function NodeSessionNames(Node: PVirtualNode; var RegKey: String): TStringList;
|
||||
procedure MenuDatabasesClick(Sender: TObject);
|
||||
procedure WMNCLBUTTONDOWN(var Msg: TWMNCLButtonDown) ; message WM_NCLBUTTONDOWN;
|
||||
procedure WMNCLBUTTONUP(var Msg: TWMNCLButtonUp) ; message WM_NCLBUTTONUP;
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
@ -182,6 +184,25 @@ uses Main, helpers, grideditlinks;
|
||||
{$R *.DFM}
|
||||
|
||||
|
||||
procedure Tconnform.WMNCLBUTTONDOWN(var Msg: TWMNCLButtonDown) ;
|
||||
begin
|
||||
if Msg.HitTest = HTHELP then
|
||||
Msg.Result := 0 // "eat" the message
|
||||
else
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
procedure Tconnform.WMNCLBUTTONUP(var Msg: TWMNCLButtonUp) ;
|
||||
begin
|
||||
if Msg.HitTest = HTHELP then begin
|
||||
Msg.Result := 0;
|
||||
Help(Self, 'connecting');
|
||||
end else
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
procedure Tconnform.FormCreate(Sender: TObject);
|
||||
var
|
||||
LastActiveSession: String;
|
||||
|
@ -13,7 +13,7 @@ uses
|
||||
Windows, ShlObj, ActiveX, VirtualTrees, SynRegExpr, Messages, Math,
|
||||
Registry, DateUtils, Generics.Collections, StrUtils, AnsiStrings, TlHelp32, Types,
|
||||
dbconnection, mysql_structures, SynMemo, Menus, WinInet, gnugettext, Themes,
|
||||
Character, ImgList, System.UITypes;
|
||||
Character, ImgList, System.UITypes, ActnList;
|
||||
|
||||
type
|
||||
|
||||
@ -322,6 +322,7 @@ type
|
||||
function GetSystemImageList: TImageList;
|
||||
function GetSystemImageIndex(Filename: String): Integer;
|
||||
function GetExecutableBits: Byte;
|
||||
procedure Help(Sender: TObject; Anchor: String);
|
||||
|
||||
|
||||
var
|
||||
@ -2657,6 +2658,21 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure Help(Sender: TObject; Anchor: String);
|
||||
var
|
||||
Place: String;
|
||||
begin
|
||||
// Go to online help page
|
||||
if Sender is TAction then
|
||||
Place := (Sender as TAction).ActionComponent.Name
|
||||
else if Sender is TControl then
|
||||
Place := (Sender as TControl).Name
|
||||
else
|
||||
Place := 'unhandled-'+Sender.ClassName;
|
||||
if IsNotEmpty(Anchor) then
|
||||
Anchor := '#'+Anchor;
|
||||
ShellExec(APPDOMAIN+'help.php?place='+EncodeURLParam(Place)+Anchor);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
@ -2045,8 +2045,8 @@ end;
|
||||
|
||||
procedure TMainForm.actHelpExecute(Sender: TObject);
|
||||
begin
|
||||
// Display readme document
|
||||
ShellExec(APPDOMAIN+'help.php?place='+EncodeURLParam((Sender as TAction).ActionComponent.Name));
|
||||
// Display help document
|
||||
Help(Sender, '');
|
||||
end;
|
||||
|
||||
procedure TMainForm.FormResize(Sender: TObject);
|
||||
|
Reference in New Issue
Block a user