diff --git a/windows/src/developer/TIKE/actions/KMDActionInterfaces.pas b/windows/src/developer/TIKE/actions/KMDActionInterfaces.pas index 0d7c31d8e6..724275d2b9 100644 --- a/windows/src/developer/TIKE/actions/KMDActionInterfaces.pas +++ b/windows/src/developer/TIKE/actions/KMDActionInterfaces.pas @@ -71,10 +71,13 @@ type IKMDTextEditorActions = interface(IKMDSearchActions) ['{118B5CF5-7FED-4669-9A51-7DC58BF571D4}'] + function GetText: string; + procedure SetText(const Value: string); function GetSelectedRow: Integer; function GetEditorFormat: TEditorFormat; property EditorFormat: TEditorFormat read GetEditorFormat; property SelectedRow: Integer read GetSelectedRow; + property Text: string read GetText write SetText; end; implementation diff --git a/windows/src/developer/TIKE/actions/dmActionsTextEditor.pas b/windows/src/developer/TIKE/actions/dmActionsTextEditor.pas index 2f4965c463..028d47627d 100644 --- a/windows/src/developer/TIKE/actions/dmActionsTextEditor.pas +++ b/windows/src/developer/TIKE/actions/dmActionsTextEditor.pas @@ -178,9 +178,11 @@ begin end; procedure TmodActionsTextEditor.actTextEditor_ReformatXMLExecute(Sender: TObject); +var + a: IKMDTextEditorActions; begin -{TODO: with Screen.ActiveControl as TKeymanDeveloperMemo do - SetTextBuf(PWideChar(FormatXMLData(Text)));} + a := KMDActions.GetTextEditorController(Screen.ActiveControl); + a.Text := FormatXMLData(a.Text); end; procedure TmodActionsTextEditor.actTextEditor_ReformatXMLUpdate( diff --git a/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas b/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas index 4724130cbd..c6b1912fd0 100644 --- a/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas +++ b/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas @@ -3142,6 +3142,7 @@ begin if pagesTouchLayout.ActivePage = pageTouchLayoutCode then begin frameTouchLayoutSource.EditorText := frameTouchLayout.SaveToString; + DoFocus(frameTouchLayout); end; FLoading := False; end; diff --git a/windows/src/developer/TIKE/main/UframeOnScreenKeyboardEditor.dfm b/windows/src/developer/TIKE/main/UframeOnScreenKeyboardEditor.dfm index a38cc80e7e..44ab2026a9 100644 --- a/windows/src/developer/TIKE/main/UframeOnScreenKeyboardEditor.dfm +++ b/windows/src/developer/TIKE/main/UframeOnScreenKeyboardEditor.dfm @@ -19,6 +19,7 @@ inherited frameOnScreenKeyboardEditor: TframeOnScreenKeyboardEditor Align = alClient TabOrder = 0 TabPosition = tpBottom + OnChange = pagesChange OnChanging = pagesChanging object pageDesign: TTabSheet Caption = 'Design' @@ -365,10 +366,6 @@ inherited frameOnScreenKeyboardEditor: TframeOnScreenKeyboardEditor object pageCode: TTabSheet Caption = 'Code' ImageIndex = -1 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 380 end end object dlgVKImportXML: TOpenDialog diff --git a/windows/src/developer/TIKE/main/UframeOnScreenKeyboardEditor.pas b/windows/src/developer/TIKE/main/UframeOnScreenKeyboardEditor.pas index 7f47555785..57aeed2f6d 100644 --- a/windows/src/developer/TIKE/main/UframeOnScreenKeyboardEditor.pas +++ b/windows/src/developer/TIKE/main/UframeOnScreenKeyboardEditor.pas @@ -140,6 +140,7 @@ type procedure tmrUpdateCharacterMapTimer(Sender: TObject); procedure TntFormDestroy(Sender: TObject); procedure pagesChanging(Sender: TObject; var AllowChange: Boolean); + procedure pagesChange(Sender: TObject); private FVKSetup: Boolean; @@ -185,9 +186,11 @@ type protected function GetHelpTopic: string; override; public + procedure Load; procedure Save; procedure UpdateControls; + procedure SetFocus; override; property UnderlyingLayout: HKL read GetUnderlyingLayout write SetUnderlyingLayout; property KeyFont: TFont read GetKeyFont write SetKeyFont; // I4057 property VKModified: Boolean read FVKModified write SetVKModified; @@ -226,6 +229,9 @@ uses procedure TframeOnScreenKeyboardEditor.FormCreate(Sender: TObject); begin inherited; + + pages.ActivePage := pageDesign; + FVKUnicode := True; kbdOnScreen.SelectedKey := kbdOnScreen.Keys[0]; @@ -251,6 +257,13 @@ begin FreeAndNil(FVK); // I2794 end; +procedure TframeOnScreenKeyboardEditor.SetFocus; +begin + inherited; + if pages.ActivePage = pageCode then + frameSource.SetFocus; +end; + procedure TframeOnScreenKeyboardEditor.SetKeyFont(const Value: TFont); // I4057 begin if not FVKUnicode @@ -311,6 +324,13 @@ end; { - Tab interactions - } { ---------------------------------------------------------------------------- } +procedure TframeOnScreenKeyboardEditor.pagesChange(Sender: TObject); +begin + inherited; + if pages.ActivePage = pageCode then + frameSource.SetFocus; +end; + procedure TframeOnScreenKeyboardEditor.pagesChanging(Sender: TObject; var AllowChange: Boolean); begin diff --git a/windows/src/developer/TIKE/main/UframeTextEditor.pas b/windows/src/developer/TIKE/main/UframeTextEditor.pas index 0c0007b720..347f312d87 100644 --- a/windows/src/developer/TIKE/main/UframeTextEditor.pas +++ b/windows/src/developer/TIKE/main/UframeTextEditor.pas @@ -18,7 +18,7 @@ uses type TParColourLineType = (pcltNone, pcltBreakpoint, pcltExecutionPoint, pcltError); - TframeTextEditor = class(TTIKEForm, IKMDSearchActions, IKMDEditActions, IKMDTextEditorActions) + TframeTextEditor = class(TTIKEForm, IKMDEditActions, IKMDSearchActions, IKMDTextEditorActions) lstImages: TMenuImgList; dlgFonts: TFontDialog; dlgPrintSetup: TPrinterSetupDialog; @@ -65,6 +65,7 @@ type procedure ExecuteCommand(const command: string; const parameters: TJSONValue = nil); procedure UpdateToken(command: string); procedure SetCursorPosition(AColumn, ARow: Integer); + protected function GetHelpTopic: string; override; @@ -78,6 +79,10 @@ type function CanEditFindNext: Boolean; { IKMDEditActions } + function IKMDTextEditorActions_GetText: string; + procedure IKMDTextEditorActions_SetText(const Value: string); + function IKMDTextEditorActions.GetText = IKMDTextEditorActions_GetText; + procedure IKMDTextEditorActions.SetText = IKMDTextEditorActions_SetText; procedure CutToClipboard; procedure CopyToClipboard; procedure PasteFromClipboard; @@ -252,6 +257,16 @@ begin Result := modWebHttpServer.AppSource.GetSource(FFileName); end; +function TframeTextEditor.IKMDTextEditorActions_GetText: string; +begin + Result := GetText; +end; + +procedure TframeTextEditor.IKMDTextEditorActions_SetText(const Value: string); +begin + SetText(Value); +end; + procedure TframeTextEditor.LoadFromFile(AFileName: WideString); var fs: TFileStream; @@ -483,6 +498,7 @@ end; procedure TframeTextEditor.SetFocus; begin + inherited; cef.SetFocus; end;