LCL Application: help key depends on widgetset

git-svn-id: trunk@12923 -
This commit is contained in:
tombo 2007-11-19 14:39:55 +00:00
parent deb98c5756
commit b81ab6be63
4 changed files with 11 additions and 4 deletions

View File

@ -1033,7 +1033,7 @@ type
function HelpKeyword(Sender: TObject; const Position: TPoint;
const Keyword: String): Boolean;
function HelpKeyword(const Keyword: String): Boolean;
procedure ShowHelpForObjecct(Sender: TObject);
procedure ShowHelpForObject(Sender: TObject);
procedure HideAllFormsWithStayOnTop;
function IsWaiting: boolean;
procedure CancelHint;

View File

@ -978,7 +978,7 @@ begin
Result:=HelpKeyword(nil,Point(0,0),Keyword);
end;
procedure TApplication.ShowHelpForObjecct(Sender: TObject);
procedure TApplication.ShowHelpForObject(Sender: TObject);
begin
if Sender is TControl then begin
TControl(Sender).ShowHelp;
@ -1293,8 +1293,8 @@ begin
i:=FApplicationHandlers[ahtKeyDownAfter].Count;
while FApplicationHandlers[ahtKeyDownAfter].NextDownIndex(i) do
TKeyEvent(FApplicationHandlers[ahtKeyDownAfter][i])(Sender,Key,Shift);
if (Shift=[]) and (Key=VK_F1) then
ShowHelpForObjecct(Sender);
if WidgetSet.IsHelpKey(Key, Shift) then
ShowHelpForObject(Sender);
end;
procedure TApplication.ControlKeyDown(Sender: TObject; var Key: Word;

View File

@ -1030,6 +1030,12 @@ begin
Result := false;
end;
function TWidgetSet.IsHelpKey(Key: Word; Shift: TShiftState): Boolean;
{ Asks if the passed key is determined by widgetset to show help }
begin
Result := (Shift = []) and (Key = VK_F1);
end;
function TWidgetSet.AppHandle: Thandle;
begin
DebugLn('Warning: AppHandle is not implemented for this widgetset yet');

View File

@ -93,6 +93,7 @@ type
procedure SetDesigning(AComponent: TComponent); virtual; abstract;
function InitHintFont(HintFont: TObject): Boolean; virtual;
function IsHelpKey(Key: Word; Shift: TShiftState): Boolean; virtual;
// create and destroy
function CreateComponent(Sender : TObject): THandle; virtual; abstract;