Skip to content

Commit

Permalink
Merge pull request #10939 from keymanapp/docs/developer/10550-ldml-wi…
Browse files Browse the repository at this point in the history
…ndow-help-links

docs(developer): add help site links
  • Loading branch information
mcdurdin authored Mar 26, 2024
2 parents 54633dd + d406329 commit 9cba6e7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ TfrmLdmlKeyboardEditor = class(TfrmEditor)
protected
procedure LoadSettings; override;
procedure SaveSettings(SaveProject: Boolean); override;
function GetHelpTopic: string; override;
public
procedure StartDebugging;
procedure StopDebugging;
Expand All @@ -45,6 +46,7 @@ implementation
uses
keymanstrings,
KeymanDeveloperOptions,
Keyman.Developer.System.HelpTopics,
Keyman.System.Debug.DebugUIStatus,
Keyman.Developer.System.Project.xmlLdmlProjectFile,
Keyman.Developer.UI.Project.ProjectFileUI,
Expand All @@ -65,6 +67,11 @@ procedure TfrmLdmlKeyboardEditor.FormCreate(Sender: TObject);
SetupDebugForm;
end;

function TfrmLdmlKeyboardEditor.GetHelpTopic: string;
begin
Result := SHelpTopic_Context_LdmlEditor;
end;

function TfrmLdmlKeyboardEditor.GetIsDebugVisible: Boolean;
begin
Result := panDebugHost.Visible;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ interface
SHelpTopic_Context_CharacterMap = 'context/character-map';
SHelpTopic_Context_CharacterIdentifier = 'context/character-identifier';
SHelpTopic_Context_Debug = 'context/debug';
SHelpTopic_Context_LdmlDebug = 'context/ldml-debug';
SHelpTopic_Context_LdmlEditor = 'context/ldml-editor';
SHelpTopic_Context_DebugStatus = 'context/debug#toc-state';
SHelpTopic_Context_DebugStatus_CallStack = 'context/debug#toc-call-stack';
SHelpTopic_Context_DebugStatus_DeadKeys = 'context/debug#toc-deadkeys';
Expand All @@ -25,6 +27,7 @@ interface
SHelpTopic_Context_NewProject = 'context/new-project';
SHelpTopic_Context_NewProjectParameters = 'context/new-project-parameters';
SHelpTopic_Context_NewModelProjectParameters = 'context/new-model-project-parameters';
SHelpTopic_Context_NewLdmlProjectParameters = 'context/new-ldml-project-parameters';
SHelpTopic_Context_NewFileDetails = 'context/new-file-details';
SHelpTopic_Context_OnScreenKeyboardEditor = 'context/keyboard-editor#toc-on-screen-tab';
SHelpTopic_Context_Options = 'context/options';
Expand Down
11 changes: 11 additions & 0 deletions developer/src/tike/main/UframeTextEditor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ TframeTextEditor = class(TTIKEForm, IKMDEditActions, IKMDSearchActions, IKMDTe
State: TDragState; var Accept: Boolean);
procedure DelayedFindError;
procedure DoOpenLinkIfExternal(const url: string; var handled: Boolean);
procedure cefHelpTopic(Sender: TObject);

protected
function GetHelpTopic: string; override;
Expand Down Expand Up @@ -349,6 +350,7 @@ procedure TframeTextEditor.FormCreate(Sender: TObject);
cef.OnCommand := cefCommand;
cef.OnLoadEnd := cefLoadEnd;
cef.OnBeforeBrowseSync := cefBeforeBrowseSync;
cef.OnHelpTopic := cefHelpTopic;

cef.cef.OnBeforeContextMenu := cefBeforeContextMenu;
cef.cef.OnContextMenuCommand := cefContextMenuCommand;
Expand All @@ -364,6 +366,11 @@ procedure TframeTextEditor.SetupCharMapDrop;
GetCharMapDropTool.Handle(cef, cmimDefault, CharMapDragOver, CharMapDragDrop);
end;

procedure TframeTextEditor.cefHelpTopic(Sender: TObject);
begin
frmKeymanDeveloper.HelpTopic(Self);
end;

procedure TframeTextEditor.cefLoadEnd(Sender: TObject);
begin
FHasBeenLoaded := True;
Expand Down Expand Up @@ -1126,7 +1133,11 @@ procedure TframeTextEditor.UpdateToken(command: string);
function TframeTextEditor.GetHelpTopic: string;
begin
if FEditorFormat <> efKMN then
begin
if Parent is TTIKEForm then
Exit((Parent as TTIKEForm).HelpTopic);
Exit(SHelpTopic_Context_TextEditor);
end;

Result := HelpKeyword;
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function TfrmNewLDMLKeyboardProjectParameters.GetFullCopyright: string;

function TfrmNewLDMLKeyboardProjectParameters.GetHelpTopic: string;
begin
Result := SHelpTopic_Context_NewProjectParameters;
Result := SHelpTopic_Context_NewLdmlProjectParameters;
end;

function TfrmNewLDMLKeyboardProjectParameters.GetKeyboardID: string;
Expand Down

0 comments on commit 9cba6e7

Please sign in to comment.