You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#if METRO || WPF || WINDOWS_UWP
+
+ using System.Linq;
#if METRO || WPF
-using System.Linq;
using DotNetTextStore.UnmanagedAPI.WinDef;
using DotNetTextStore.UnmanagedAPI.TSF;
using DotNetTextStore;
+#endif
namespace FooEditEngine
{
document.UndoManager.EndUndoGroup();
}
+#if METRO || WPF
public static bool ScrollToCompstionUpdated(TextStoreBase textStore,EditView view,int start, int end)
{
if (textStore.IsLocked() == false)
}
return false;
}
+#endif
public static void GetStringExtent(Document document,EditView view,int i_startIndex,int i_endIndex,out Point startPos,out Point endPos)
{
startPos = view.GetPostionFromTextPoint(view.LayoutLines.GetTextPointFromIndex(i_startIndex));
endTextPoint = view.GetLayoutLineFromIndex(endIndex);
endPos = view.GetPostionFromTextPoint(endTextPoint);
- //変換候補リストに隙間があるので、ユーザーが見えるように少し移動させる
- endPos.Y += view.LayoutLines.GetLayout(endTextPoint.row).Height;
+ //アンダーラインを描くことがあるので少しずらす
+ endPos.Y += view.LayoutLines.GetLayout(endTextPoint.row).Height + 5;
}
- public static void GetSelection(Controller controller, SelectCollection selectons, out DotNetTextStore.TextSelection[] sels)
+ public static void GetSelection(Controller controller, SelectCollection selectons, out TextRange sel)
{
- sels = new TextSelection[1];
- sels[0] = new TextSelection();
if (controller.RectSelection && selectons.Count > 0)
{
- sels[0].start = selectons[0].start;
- sels[0].end = sels[0].start + selectons[0].length;
+ sel.Index = selectons[0].start;
+ sel.Length = selectons[0].length;
}
else
{
- sels[0].start = controller.SelectionStart;
- sels[0].end = sels[0].start + controller.SelectionLength;
+ sel.Index = controller.SelectionStart;
+ sel.Length = controller.SelectionLength;
}
}
- public static void SetSelectionIndex(Controller controller,EditView view,DotNetTextStore.TextSelection[] sels)
+ public static void SetSelectionIndex(Controller controller,EditView view,int i_startIndex,int i_endIndex)
{
- int i_startIndex = sels[0].start, i_endIndex = sels[0].end;
if (controller.IsRectInsertMode())
{
TextPoint start = view.LayoutLines.GetTextPointFromIndex(i_startIndex);
}
}
- public static void InsertTextAtSelection(Controller controller,string i_value)
+ public static void InsertTextAtSelection(Controller controller,string i_value, bool fromTIP = true)
{
- controller.DoInputString(i_value, true);
+ controller.DoInputString(i_value, fromTIP);
}
+#if METRO || WPF
public static void NotifyTextChanged(TextStoreBase textStore, int startIndex,int removeLength,int insertLength)
{
#if METRO
#endif
textStore.NotifyTextChanged(startIndex, oldend, newend);
}
+#endif
}
}
#endif