Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(developer): add help site links #10939

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading