Skip to content

Commit

Permalink
Merge branch 'InterlinMasterRefactor-2nd-Attempt' of https://github.c…
Browse files Browse the repository at this point in the history
…om/sillsdev/FieldWorks into InterlinMasterRefactor-2nd-Attempt
  • Loading branch information
JakeOliver28 committed May 13, 2024
2 parents 4c8ce06 + 4e6fa1b commit b00e77d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
11 changes: 3 additions & 8 deletions Src/Common/SimpleRootSite/SimpleRootSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1537,15 +1537,10 @@ public virtual Point ScrollPosition
newPos.Y = 0;
}

if (Platform.IsMono)
{
if (AllowPainting == true) // FWNX-235
AutoScrollPosition = newPos;
else
cachedAutoScrollPosition = newPos;
}
else
if (!Platform.IsMono || AllowPainting) // FWNX-235
AutoScrollPosition = newPos;
else
cachedAutoScrollPosition = newPos;
}
}

Expand Down
26 changes: 25 additions & 1 deletion Src/LexText/Interlinear/RawTextPane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public class RawTextPane : RootSite, IInterlinearTabControl, IHandleBookmark
/// </summary>
RecordClerk m_clerk;

private string m_currentTool = "";

public string CurrentTool
{
get { return m_currentTool; }
}

public RawTextPane() : base(null)
{
BackColor = Color.FromKnownColor(KnownColor.Window);
Expand Down Expand Up @@ -158,6 +165,8 @@ public IStText RootObject
}
}



internal int LastFoundAnnotationHvo
{
get
Expand Down Expand Up @@ -652,7 +661,21 @@ protected void MakeTextSelectionAndScrollToView(int ichMin, int ichLim, int ws,
public void SelectBookmark(IStTextBookmark bookmark)
{
CheckDisposed();
MakeTextSelectionAndScrollToView(bookmark.BeginCharOffset, bookmark.EndCharOffset, 0, bookmark.IndexOfParagraph);
if (CanFocus)
MakeTextSelectionAndScrollToView(bookmark.BeginCharOffset, bookmark.EndCharOffset, 0, bookmark.IndexOfParagraph);
else
VisibleChanged += RawTextPane_VisibleChanged;
}

private void RawTextPane_VisibleChanged(object sender, EventArgs e)
{
if (CanFocus)
{
var bookmark = InterlinMaster.m_bookmarks[new Tuple<string, Guid>(CurrentTool, RootObject.Guid)];
MakeTextSelectionAndScrollToView(bookmark.BeginCharOffset, bookmark.EndCharOffset, 0, bookmark.IndexOfParagraph);

VisibleChanged -= RawTextPane_VisibleChanged;
}
}

#endregion
Expand Down Expand Up @@ -891,6 +914,7 @@ public override void Init(Mediator mediator, PropertyTable propertyTable, XmlNod
m_configurationParameters = configurationParameters;
m_clerk = ToolConfiguration.FindClerk(m_propertyTable, m_configurationParameters);
m_styleSheet = FontHeightAdjuster.StyleSheetFromPropertyTable(m_propertyTable);
m_currentTool = configurationParameters.Attributes["clerk"].Value;
}
}

Expand Down

0 comments on commit b00e77d

Please sign in to comment.