You've already forked lazarus-ccr
LazStats: Fix help callback to be usable for the help context assigned to menu items.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7472 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
Binary file not shown.
Binary file not shown.
@ -298,7 +298,7 @@ object OS3MainFrm: TOS3MainFrm
|
|||||||
object MenuItem2: TMenuItem
|
object MenuItem2: TMenuItem
|
||||||
Caption = 'Variables'
|
Caption = 'Variables'
|
||||||
object DefineVar: TMenuItem
|
object DefineVar: TMenuItem
|
||||||
Caption = 'Define'
|
Caption = 'Define...'
|
||||||
OnClick = DefineVarClick
|
OnClick = DefineVarClick
|
||||||
end
|
end
|
||||||
object PrintDefs: TMenuItem
|
object PrintDefs: TMenuItem
|
||||||
@ -322,14 +322,17 @@ object OS3MainFrm: TOS3MainFrm
|
|||||||
Caption = 'Tools'
|
Caption = 'Tools'
|
||||||
object FormatGrid: TMenuItem
|
object FormatGrid: TMenuItem
|
||||||
Caption = 'Format Grid Cells'
|
Caption = 'Format Grid Cells'
|
||||||
|
HelpContext = 15
|
||||||
OnClick = FormatGridClick
|
OnClick = FormatGridClick
|
||||||
end
|
end
|
||||||
object SortCases: TMenuItem
|
object SortCases: TMenuItem
|
||||||
Caption = 'Sort Cases'
|
Caption = 'Sort Cases'
|
||||||
|
HelpContext = 16
|
||||||
OnClick = SortCasesClick
|
OnClick = SortCasesClick
|
||||||
end
|
end
|
||||||
object PrintGrid: TMenuItem
|
object PrintGrid: TMenuItem
|
||||||
Caption = 'Print Grid File'
|
Caption = 'Print Grid File'
|
||||||
|
HelpContext = 17
|
||||||
OnClick = PrintGridClick
|
OnClick = PrintGridClick
|
||||||
end
|
end
|
||||||
object MenuItem28: TMenuItem
|
object MenuItem28: TMenuItem
|
||||||
@ -338,6 +341,7 @@ object OS3MainFrm: TOS3MainFrm
|
|||||||
end
|
end
|
||||||
object SelectCases: TMenuItem
|
object SelectCases: TMenuItem
|
||||||
Caption = 'Select Cases'
|
Caption = 'Select Cases'
|
||||||
|
HelpContext = 18
|
||||||
OnClick = SelectCasesClick
|
OnClick = SelectCasesClick
|
||||||
end
|
end
|
||||||
object LoadSubFile: TMenuItem
|
object LoadSubFile: TMenuItem
|
||||||
@ -375,10 +379,12 @@ object OS3MainFrm: TOS3MainFrm
|
|||||||
Caption = 'Edit'
|
Caption = 'Edit'
|
||||||
object blockcopy: TMenuItem
|
object blockcopy: TMenuItem
|
||||||
Caption = 'Copy a Block of Cells'
|
Caption = 'Copy a Block of Cells'
|
||||||
|
HelpContext = 20
|
||||||
OnClick = blockcopyClick
|
OnClick = blockcopyClick
|
||||||
end
|
end
|
||||||
object BlockPaste: TMenuItem
|
object BlockPaste: TMenuItem
|
||||||
Caption = 'Paste a Block of Cells'
|
Caption = 'Paste a Block of Cells'
|
||||||
|
HelpContext = 21
|
||||||
OnClick = BlockPasteClick
|
OnClick = BlockPasteClick
|
||||||
end
|
end
|
||||||
object BlockCut: TMenuItem
|
object BlockCut: TMenuItem
|
||||||
@ -389,19 +395,23 @@ object OS3MainFrm: TOS3MainFrm
|
|||||||
Caption = '-'
|
Caption = '-'
|
||||||
end
|
end
|
||||||
object InsNewCol: TMenuItem
|
object InsNewCol: TMenuItem
|
||||||
Caption = 'Insert New Column Before Current One'
|
Caption = 'Insert New Column'
|
||||||
|
HelpContext = 22
|
||||||
OnClick = InsNewColClick
|
OnClick = InsNewColClick
|
||||||
end
|
end
|
||||||
object CopyCol: TMenuItem
|
object CopyCol: TMenuItem
|
||||||
Caption = 'Copy Column'
|
Caption = 'Copy Column'
|
||||||
|
HelpContext = 23
|
||||||
OnClick = CopyColClick
|
OnClick = CopyColClick
|
||||||
end
|
end
|
||||||
object CutCol: TMenuItem
|
object CutCol: TMenuItem
|
||||||
Caption = 'Cut Column'
|
Caption = 'Cut Column'
|
||||||
|
HelpContext = 24
|
||||||
OnClick = CutColClick
|
OnClick = CutColClick
|
||||||
end
|
end
|
||||||
object PasteCol: TMenuItem
|
object PasteCol: TMenuItem
|
||||||
Caption = 'Paste Column'
|
Caption = 'Paste Column'
|
||||||
|
HelpContext = 25
|
||||||
OnClick = PasteColClick
|
OnClick = PasteColClick
|
||||||
end
|
end
|
||||||
object MenuItem48: TMenuItem
|
object MenuItem48: TMenuItem
|
||||||
@ -409,18 +419,22 @@ object OS3MainFrm: TOS3MainFrm
|
|||||||
end
|
end
|
||||||
object NewRow: TMenuItem
|
object NewRow: TMenuItem
|
||||||
Caption = 'Insert New Row'
|
Caption = 'Insert New Row'
|
||||||
|
HelpContext = 26
|
||||||
OnClick = NewRowClick
|
OnClick = NewRowClick
|
||||||
end
|
end
|
||||||
object CopyRowMenu: TMenuItem
|
object CopyRowMenu: TMenuItem
|
||||||
Caption = 'Copy Row'
|
Caption = 'Copy Row'
|
||||||
|
HelpContext = 27
|
||||||
OnClick = CopyRowMenuClick
|
OnClick = CopyRowMenuClick
|
||||||
end
|
end
|
||||||
object CutRowMenu: TMenuItem
|
object CutRowMenu: TMenuItem
|
||||||
Caption = 'Cut Row'
|
Caption = 'Cut Row'
|
||||||
|
HelpContext = 28
|
||||||
OnClick = CutRowMenuClick
|
OnClick = CutRowMenuClick
|
||||||
end
|
end
|
||||||
object PasteRowMenu: TMenuItem
|
object PasteRowMenu: TMenuItem
|
||||||
Caption = 'Paste Row'
|
Caption = 'Paste Row'
|
||||||
|
HelpContext = 29
|
||||||
OnClick = PasteRowMenuClick
|
OnClick = PasteRowMenuClick
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1588,20 +1588,30 @@ end;
|
|||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
// Call HTML help (.chm file)
|
// Call HTML help (.chm file)
|
||||||
// Is is expected that help topics are specified as HelpKeyword (HelpType = htContext).
|
// Is is expected that help topics are specified as HelpKeyword (HelpType = htContext).
|
||||||
// Using numeric HelpContext values will crash the application.
|
// Since the menu items provide only a HelpContext number some ticks must be
|
||||||
|
// applied to distinguish between number and string...
|
||||||
function TOS3MainFrm.HelpHandler(Command: Word; Data: PtrInt;
|
function TOS3MainFrm.HelpHandler(Command: Word; Data: PtrInt;
|
||||||
var CallHelp: Boolean): Boolean;
|
var CallHelp: Boolean): Boolean;
|
||||||
var
|
var
|
||||||
topic: UnicodeString;
|
topic: UnicodeString;
|
||||||
|
res: Integer;
|
||||||
|
fn: UnicodeString;
|
||||||
begin
|
begin
|
||||||
topic := Application.HelpFile + '::/' + PChar(Data);
|
if Data < 10000 then // hopefully these are not pointers...
|
||||||
htmlhelp.HtmlHelpW(0, PWideChar(topic), HH_DISPLAY_TOPIC, 0);
|
begin
|
||||||
|
// see: http://www.helpware.net/download/delphi/hh_doc.txt
|
||||||
|
fn := UnicodeString(Application.HelpFile);
|
||||||
|
res := htmlhelp.HtmlHelpW(0, PWideChar(fn), HH_HELP_CONTEXT, Data);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
topic := Application.HelpFile + '::/' + PChar(Data);
|
||||||
|
res := htmlhelp.HtmlHelpW(0, PWideChar(topic), HH_DISPLAY_TOPIC, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
// Don't call regular help
|
// Don't call regular help
|
||||||
CallHelp := False;
|
CallHelp := False;
|
||||||
|
|
||||||
// silence the compiler, function result not needed
|
Result := res <> 0;
|
||||||
Result := true;
|
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
Reference in New Issue
Block a user