mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-31 05:35:18 +08:00
Update release
This commit is contained in:
+117
-30
@@ -15137,6 +15137,18 @@ GuiDocumentCommonInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiDocumentCommonInterface::EnsureDocumentRectVisible(Rect bounds)
|
||||||
|
{
|
||||||
|
if (bounds != Rect())
|
||||||
|
{
|
||||||
|
bounds.x1 -= 15;
|
||||||
|
bounds.y1 -= 15;
|
||||||
|
bounds.x2 += 15;
|
||||||
|
bounds.y2 += 15;
|
||||||
|
EnsureRectVisible(bounds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GuiDocumentCommonInterface::Move(TextPos caret, bool shift, bool frontSide)
|
void GuiDocumentCommonInterface::Move(TextPos caret, bool shift, bool frontSide)
|
||||||
{
|
{
|
||||||
TextPos begin=documentElement->GetCaretBegin();
|
TextPos begin=documentElement->GetCaretBegin();
|
||||||
@@ -15146,16 +15158,7 @@ GuiDocumentCommonInterface
|
|||||||
TextPos newEnd=caret;
|
TextPos newEnd=caret;
|
||||||
documentElement->SetCaret(newBegin, newEnd, frontSide);
|
documentElement->SetCaret(newBegin, newEnd, frontSide);
|
||||||
documentElement->SetCaretVisible(true);
|
documentElement->SetCaretVisible(true);
|
||||||
|
EnsureDocumentRectVisible(documentElement->GetCaretBounds(newEnd, frontSide));
|
||||||
Rect bounds=documentElement->GetCaretBounds(newEnd, frontSide);
|
|
||||||
if(bounds!=Rect())
|
|
||||||
{
|
|
||||||
bounds.x1-=15;
|
|
||||||
bounds.y1-=15;
|
|
||||||
bounds.x2+=15;
|
|
||||||
bounds.y2+=15;
|
|
||||||
EnsureRectVisible(bounds);
|
|
||||||
}
|
|
||||||
UpdateCaretPoint();
|
UpdateCaretPoint();
|
||||||
SelectionChanged.Execute(documentControl->GetNotifyEventArguments());
|
SelectionChanged.Execute(documentControl->GetNotifyEventArguments());
|
||||||
}
|
}
|
||||||
@@ -15276,6 +15279,7 @@ GuiDocumentCommonInterface
|
|||||||
|
|
||||||
void GuiDocumentCommonInterface::InstallDocumentViewer(
|
void GuiDocumentCommonInterface::InstallDocumentViewer(
|
||||||
GuiControl* _sender,
|
GuiControl* _sender,
|
||||||
|
compositions::GuiGraphicsComposition* _mouseArea,
|
||||||
compositions::GuiGraphicsComposition* _container,
|
compositions::GuiGraphicsComposition* _container,
|
||||||
compositions::GuiGraphicsComposition* eventComposition,
|
compositions::GuiGraphicsComposition* eventComposition,
|
||||||
compositions::GuiGraphicsComposition* focusableComposition
|
compositions::GuiGraphicsComposition* focusableComposition
|
||||||
@@ -15291,11 +15295,7 @@ GuiDocumentCommonInterface
|
|||||||
documentComposition->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElement);
|
documentComposition->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElement);
|
||||||
documentComposition->SetAlignmentToParent(Margin(5, 5, 5, 5));
|
documentComposition->SetAlignmentToParent(Margin(5, 5, 5, 5));
|
||||||
_container->AddChild(documentComposition);
|
_container->AddChild(documentComposition);
|
||||||
|
ReplaceMouseArea(_mouseArea);
|
||||||
documentComposition->GetEventReceiver()->mouseMove.AttachMethod(this, &GuiDocumentCommonInterface::OnMouseMove);
|
|
||||||
documentComposition->GetEventReceiver()->leftButtonDown.AttachMethod(this, &GuiDocumentCommonInterface::OnMouseDown);
|
|
||||||
documentComposition->GetEventReceiver()->leftButtonUp.AttachMethod(this, &GuiDocumentCommonInterface::OnMouseUp);
|
|
||||||
documentComposition->GetEventReceiver()->mouseLeave.AttachMethod(this, &GuiDocumentCommonInterface::OnMouseLeave);
|
|
||||||
|
|
||||||
focusableComposition->GetEventReceiver()->caretNotify.AttachMethod(this, &GuiDocumentCommonInterface::OnCaretNotify);
|
focusableComposition->GetEventReceiver()->caretNotify.AttachMethod(this, &GuiDocumentCommonInterface::OnCaretNotify);
|
||||||
focusableComposition->GetEventReceiver()->gotFocus.AttachMethod(this, &GuiDocumentCommonInterface::OnGotFocus);
|
focusableComposition->GetEventReceiver()->gotFocus.AttachMethod(this, &GuiDocumentCommonInterface::OnGotFocus);
|
||||||
@@ -15315,6 +15315,30 @@ GuiDocumentCommonInterface
|
|||||||
SetDocument(new DocumentModel);
|
SetDocument(new DocumentModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiDocumentCommonInterface::ReplaceMouseArea(compositions::GuiGraphicsComposition* _mouseArea)
|
||||||
|
{
|
||||||
|
if (documentMouseArea)
|
||||||
|
{
|
||||||
|
documentMouseArea->GetEventReceiver()->mouseMove.Detach(onMouseMoveHandler);
|
||||||
|
documentMouseArea->GetEventReceiver()->leftButtonDown.Detach(onMouseDownHandler);
|
||||||
|
documentMouseArea->GetEventReceiver()->leftButtonUp.Detach(onMouseUpHandler);
|
||||||
|
documentMouseArea->GetEventReceiver()->mouseLeave.Detach(onMouseLeaveHandler);
|
||||||
|
|
||||||
|
onMouseMoveHandler = nullptr;
|
||||||
|
onMouseDownHandler = nullptr;
|
||||||
|
onMouseUpHandler = nullptr;
|
||||||
|
onMouseLeaveHandler = nullptr;
|
||||||
|
}
|
||||||
|
documentMouseArea = _mouseArea;
|
||||||
|
if (documentMouseArea)
|
||||||
|
{
|
||||||
|
onMouseMoveHandler = documentMouseArea->GetEventReceiver()->mouseMove.AttachMethod(this, &GuiDocumentCommonInterface::OnMouseMove);
|
||||||
|
onMouseDownHandler = documentMouseArea->GetEventReceiver()->leftButtonDown.AttachMethod(this, &GuiDocumentCommonInterface::OnMouseDown);
|
||||||
|
onMouseUpHandler = documentMouseArea->GetEventReceiver()->leftButtonUp.AttachMethod(this, &GuiDocumentCommonInterface::OnMouseUp);
|
||||||
|
onMouseLeaveHandler = documentMouseArea->GetEventReceiver()->mouseLeave.AttachMethod(this, &GuiDocumentCommonInterface::OnMouseLeave);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GuiDocumentCommonInterface::SetActiveHyperlink(Ptr<DocumentHyperlinkRun::Package> package)
|
void GuiDocumentCommonInterface::SetActiveHyperlink(Ptr<DocumentHyperlinkRun::Package> package)
|
||||||
{
|
{
|
||||||
ActivateActiveHyperlink(false);
|
ActivateActiveHyperlink(false);
|
||||||
@@ -15379,6 +15403,7 @@ GuiDocumentCommonInterface
|
|||||||
caret=TextPos(begin.row+paragraphCount-1, lastParagraphLength);
|
caret=TextPos(begin.row+paragraphCount-1, lastParagraphLength);
|
||||||
}
|
}
|
||||||
documentElement->SetCaret(caret, caret, true);
|
documentElement->SetCaret(caret, caret, true);
|
||||||
|
EnsureDocumentRectVisible(documentElement->GetCaretBounds(caret, true));
|
||||||
documentControl->TextChanged.Execute(documentControl->GetNotifyEventArguments());
|
documentControl->TextChanged.Execute(documentControl->GetNotifyEventArguments());
|
||||||
UpdateCaretPoint();
|
UpdateCaretPoint();
|
||||||
SelectionChanged.Execute(documentControl->GetNotifyEventArguments());
|
SelectionChanged.Execute(documentControl->GetNotifyEventArguments());
|
||||||
@@ -15507,15 +15532,44 @@ GuiDocumentCommonInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiDocumentCommonInterface::UpdateCursor(INativeCursor* cursor)
|
||||||
|
{
|
||||||
|
if (documentMouseArea)
|
||||||
|
{
|
||||||
|
documentMouseArea->SetAssociatedCursor(cursor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Point GuiDocumentCommonInterface::GetMouseOffset()
|
||||||
|
{
|
||||||
|
if (documentMouseArea)
|
||||||
|
{
|
||||||
|
auto documentBounds = documentComposition->GetGlobalBounds();
|
||||||
|
auto mouseAreaBounds = documentMouseArea->GetGlobalBounds();
|
||||||
|
return Point(
|
||||||
|
documentBounds.x1 - mouseAreaBounds.x1,
|
||||||
|
documentBounds.y1 - mouseAreaBounds.y1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Point(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GuiDocumentCommonInterface::OnMouseMove(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments)
|
void GuiDocumentCommonInterface::OnMouseMove(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments)
|
||||||
{
|
{
|
||||||
|
auto offset = GetMouseOffset();
|
||||||
|
auto x = arguments.x - offset.x;
|
||||||
|
auto y = arguments.y - offset.y;
|
||||||
|
|
||||||
if(documentControl->GetVisuallyEnabled())
|
if(documentControl->GetVisuallyEnabled())
|
||||||
{
|
{
|
||||||
switch(editMode)
|
switch(editMode)
|
||||||
{
|
{
|
||||||
case ViewOnly:
|
case ViewOnly:
|
||||||
{
|
{
|
||||||
auto package = documentElement->GetHyperlinkFromPoint({ arguments.x, arguments.y });
|
auto package = documentElement->GetHyperlinkFromPoint({ x, y });
|
||||||
bool handCursor = false;
|
bool handCursor = false;
|
||||||
|
|
||||||
if(dragging)
|
if(dragging)
|
||||||
@@ -15542,11 +15596,11 @@ GuiDocumentCommonInterface
|
|||||||
if(handCursor)
|
if(handCursor)
|
||||||
{
|
{
|
||||||
auto cursor = GetCurrentController()->ResourceService()->GetSystemCursor(INativeCursor::Hand);
|
auto cursor = GetCurrentController()->ResourceService()->GetSystemCursor(INativeCursor::Hand);
|
||||||
documentComposition->SetAssociatedCursor(cursor);
|
UpdateCursor(cursor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
documentComposition->SetAssociatedCursor(nullptr);
|
UpdateCursor(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -15554,7 +15608,7 @@ GuiDocumentCommonInterface
|
|||||||
case Editable:
|
case Editable:
|
||||||
if(dragging)
|
if(dragging)
|
||||||
{
|
{
|
||||||
TextPos caret=documentElement->CalculateCaretFromPoint(Point(arguments.x, arguments.y));
|
TextPos caret=documentElement->CalculateCaretFromPoint(Point(x, y));
|
||||||
TextPos oldCaret=documentElement->GetCaretBegin();
|
TextPos oldCaret=documentElement->GetCaretBegin();
|
||||||
Move(caret, true, (oldCaret==caret?documentElement->IsCaretEndPreferFrontSide():caret<oldCaret));
|
Move(caret, true, (oldCaret==caret?documentElement->IsCaretEndPreferFrontSide():caret<oldCaret));
|
||||||
}
|
}
|
||||||
@@ -15565,18 +15619,22 @@ GuiDocumentCommonInterface
|
|||||||
|
|
||||||
void GuiDocumentCommonInterface::OnMouseDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments)
|
void GuiDocumentCommonInterface::OnMouseDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments)
|
||||||
{
|
{
|
||||||
|
auto offset = GetMouseOffset();
|
||||||
|
auto x = arguments.x - offset.x;
|
||||||
|
auto y = arguments.y - offset.y;
|
||||||
|
|
||||||
if(documentControl->GetVisuallyEnabled())
|
if(documentControl->GetVisuallyEnabled())
|
||||||
{
|
{
|
||||||
switch(editMode)
|
switch(editMode)
|
||||||
{
|
{
|
||||||
case ViewOnly:
|
case ViewOnly:
|
||||||
SetActiveHyperlink(documentElement->GetHyperlinkFromPoint({ arguments.x, arguments.y }));
|
SetActiveHyperlink(documentElement->GetHyperlinkFromPoint({ x, y }));
|
||||||
break;
|
break;
|
||||||
case Selectable:
|
case Selectable:
|
||||||
case Editable:
|
case Editable:
|
||||||
{
|
{
|
||||||
documentControl->SetFocus();
|
documentControl->SetFocus();
|
||||||
TextPos caret=documentElement->CalculateCaretFromPoint(Point(arguments.x, arguments.y));
|
TextPos caret=documentElement->CalculateCaretFromPoint(Point(x, y));
|
||||||
TextPos oldCaret=documentElement->GetCaretEnd();
|
TextPos oldCaret=documentElement->GetCaretEnd();
|
||||||
if(caret!=oldCaret)
|
if(caret!=oldCaret)
|
||||||
{
|
{
|
||||||
@@ -15591,6 +15649,10 @@ GuiDocumentCommonInterface
|
|||||||
|
|
||||||
void GuiDocumentCommonInterface::OnMouseUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments)
|
void GuiDocumentCommonInterface::OnMouseUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments)
|
||||||
{
|
{
|
||||||
|
auto offset = GetMouseOffset();
|
||||||
|
auto x = arguments.x - offset.x;
|
||||||
|
auto y = arguments.y - offset.y;
|
||||||
|
|
||||||
if(documentControl->GetVisuallyEnabled())
|
if(documentControl->GetVisuallyEnabled())
|
||||||
{
|
{
|
||||||
dragging=false;
|
dragging=false;
|
||||||
@@ -15598,7 +15660,7 @@ GuiDocumentCommonInterface
|
|||||||
{
|
{
|
||||||
case ViewOnly:
|
case ViewOnly:
|
||||||
{
|
{
|
||||||
auto package = documentElement->GetHyperlinkFromPoint({ arguments.x, arguments.y });
|
auto package = documentElement->GetHyperlinkFromPoint({ x, y });
|
||||||
if(activeHyperlinks)
|
if(activeHyperlinks)
|
||||||
{
|
{
|
||||||
if (package && CompareEnumerable(activeHyperlinks->hyperlinks, package->hyperlinks) == 0)
|
if (package && CompareEnumerable(activeHyperlinks->hyperlinks, package->hyperlinks) == 0)
|
||||||
@@ -15619,7 +15681,7 @@ GuiDocumentCommonInterface
|
|||||||
|
|
||||||
void GuiDocumentCommonInterface::OnMouseLeave(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments)
|
void GuiDocumentCommonInterface::OnMouseLeave(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments)
|
||||||
{
|
{
|
||||||
SetActiveHyperlink(0);
|
SetActiveHyperlink(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
Point GuiDocumentCommonInterface::GetDocumentViewPosition()
|
Point GuiDocumentCommonInterface::GetDocumentViewPosition()
|
||||||
@@ -15971,12 +16033,12 @@ GuiDocumentCommonInterface
|
|||||||
editMode=value;
|
editMode=value;
|
||||||
if(editMode==ViewOnly)
|
if(editMode==ViewOnly)
|
||||||
{
|
{
|
||||||
documentComposition->SetAssociatedCursor(0);
|
UpdateCursor(nullptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
INativeCursor* cursor=GetCurrentController()->ResourceService()->GetSystemCursor(INativeCursor::IBeam);
|
INativeCursor* cursor=GetCurrentController()->ResourceService()->GetSystemCursor(INativeCursor::IBeam);
|
||||||
documentComposition->SetAssociatedCursor(cursor);
|
UpdateCursor(cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16213,6 +16275,7 @@ GuiDocumentViewer
|
|||||||
|
|
||||||
void GuiDocumentViewer::BeforeControlTemplateUninstalled_()
|
void GuiDocumentViewer::BeforeControlTemplateUninstalled_()
|
||||||
{
|
{
|
||||||
|
ReplaceMouseArea(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiDocumentViewer::AfterControlTemplateInstalled_(bool initialize)
|
void GuiDocumentViewer::AfterControlTemplateInstalled_(bool initialize)
|
||||||
@@ -16224,6 +16287,7 @@ GuiDocumentViewer
|
|||||||
documentElement->SetCaretColor(ct->GetCaretColor());
|
documentElement->SetCaretColor(ct->GetCaretColor());
|
||||||
SetDocument(GetDocument());
|
SetDocument(GetDocument());
|
||||||
}
|
}
|
||||||
|
ReplaceMouseArea(containerComposition->GetParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiDocumentViewer::UpdateDisplayFont()
|
void GuiDocumentViewer::UpdateDisplayFont()
|
||||||
@@ -16261,7 +16325,7 @@ GuiDocumentViewer
|
|||||||
{
|
{
|
||||||
SetAcceptTabInput(true);
|
SetAcceptTabInput(true);
|
||||||
SetFocusableComposition(boundsComposition);
|
SetFocusableComposition(boundsComposition);
|
||||||
InstallDocumentViewer(this, containerComposition, boundsComposition, focusableComposition);
|
InstallDocumentViewer(this, containerComposition->GetParent(), containerComposition, boundsComposition, focusableComposition);
|
||||||
|
|
||||||
SetExtendToFullWidth(true);
|
SetExtendToFullWidth(true);
|
||||||
SetHorizontalAlwaysVisible(false);
|
SetHorizontalAlwaysVisible(false);
|
||||||
@@ -16313,7 +16377,7 @@ GuiDocumentLabel
|
|||||||
{
|
{
|
||||||
SetAcceptTabInput(true);
|
SetAcceptTabInput(true);
|
||||||
SetFocusableComposition(boundsComposition);
|
SetFocusableComposition(boundsComposition);
|
||||||
InstallDocumentViewer(this, containerComposition, boundsComposition, focusableComposition);
|
InstallDocumentViewer(this, containerComposition, containerComposition, boundsComposition, focusableComposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiDocumentLabel::~GuiDocumentLabel()
|
GuiDocumentLabel::~GuiDocumentLabel()
|
||||||
@@ -20572,6 +20636,23 @@ GuiMenu
|
|||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiMenu::Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder)
|
||||||
|
{
|
||||||
|
GuiPopup::Moving(bounds, fixSizeOnly, draggingBorder);
|
||||||
|
if (draggingBorder)
|
||||||
|
{
|
||||||
|
if (auto nativeWindow = GetNativeWindow())
|
||||||
|
{
|
||||||
|
auto newSize = bounds.GetSize();
|
||||||
|
auto nativeOffset = (nativeWindow->GetBounds().GetSize() - nativeWindow->GetClientSize());
|
||||||
|
auto preferredNativeSize = nativeWindow->Convert(preferredMenuClientSizeBeforeUpdating) + nativeOffset;
|
||||||
|
if (newSize.x < preferredNativeSize.x) newSize.x = preferredNativeSize.x;
|
||||||
|
if (newSize.y < preferredNativeSize.y) newSize.y = preferredNativeSize.y;
|
||||||
|
preferredMenuClientSize = nativeWindow->Convert(newSize - nativeOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GuiMenu::UpdateClientSizeAfterRendering(Size preferredSize, Size clientSize)
|
void GuiMenu::UpdateClientSizeAfterRendering(Size preferredSize, Size clientSize)
|
||||||
{
|
{
|
||||||
auto size = preferredSize;
|
auto size = preferredSize;
|
||||||
@@ -20661,6 +20742,7 @@ GuiMenu
|
|||||||
void GuiMenu::SetPreferredMenuClientSize(Size value)
|
void GuiMenu::SetPreferredMenuClientSize(Size value)
|
||||||
{
|
{
|
||||||
preferredMenuClientSize = value;
|
preferredMenuClientSize = value;
|
||||||
|
preferredMenuClientSizeBeforeUpdating = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@@ -29369,6 +29451,7 @@ GuiDocumentElement::GuiDocumentElementRenderer
|
|||||||
|
|
||||||
Ptr<DocumentHyperlinkRun::Package> GuiDocumentElement::GuiDocumentElementRenderer::GetHyperlinkFromPoint(Point point)
|
Ptr<DocumentHyperlinkRun::Package> GuiDocumentElement::GuiDocumentElementRenderer::GetHyperlinkFromPoint(Point point)
|
||||||
{
|
{
|
||||||
|
if (!renderTarget) return nullptr;
|
||||||
vint top=0;
|
vint top=0;
|
||||||
vint index=-1;
|
vint index=-1;
|
||||||
if(GetParagraphIndexFromPoint(point, top, index))
|
if(GetParagraphIndexFromPoint(point, top, index))
|
||||||
@@ -29386,7 +29469,7 @@ GuiDocumentElement::GuiDocumentElementRenderer
|
|||||||
vint caret=cache->graphicsParagraph->GetCaretFromPoint(paragraphPoint);
|
vint caret=cache->graphicsParagraph->GetCaretFromPoint(paragraphPoint);
|
||||||
return element->document->GetHyperlink(index, caret, caret);
|
return element->document->GetHyperlink(index, caret, caret);
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiDocumentElement::GuiDocumentElementRenderer::OpenCaret(TextPos caret, Color color, bool frontSide)
|
void GuiDocumentElement::GuiDocumentElementRenderer::OpenCaret(TextPos caret, Color color, bool frontSide)
|
||||||
@@ -29433,6 +29516,7 @@ GuiDocumentElement::GuiDocumentElementRenderer
|
|||||||
end=TextPos(-1, -1);
|
end=TextPos(-1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!renderTarget) return;
|
||||||
for(vint i=0;i<paragraphCaches.Count();i++)
|
for(vint i=0;i<paragraphCaches.Count();i++)
|
||||||
{
|
{
|
||||||
if(begin.row<=i && i<=end.row)
|
if(begin.row<=i && i<=end.row)
|
||||||
@@ -29466,6 +29550,7 @@ GuiDocumentElement::GuiDocumentElementRenderer
|
|||||||
|
|
||||||
TextPos GuiDocumentElement::GuiDocumentElementRenderer::CalculateCaret(TextPos comparingCaret, IGuiGraphicsParagraph::CaretRelativePosition position, bool& preferFrontSide)
|
TextPos GuiDocumentElement::GuiDocumentElementRenderer::CalculateCaret(TextPos comparingCaret, IGuiGraphicsParagraph::CaretRelativePosition position, bool& preferFrontSide)
|
||||||
{
|
{
|
||||||
|
if (!renderTarget) return comparingCaret;
|
||||||
Ptr<ParagraphCache> cache=EnsureAndGetCache(comparingCaret.row, true);
|
Ptr<ParagraphCache> cache=EnsureAndGetCache(comparingCaret.row, true);
|
||||||
if(cache)
|
if(cache)
|
||||||
{
|
{
|
||||||
@@ -29563,6 +29648,7 @@ GuiDocumentElement::GuiDocumentElementRenderer
|
|||||||
|
|
||||||
TextPos GuiDocumentElement::GuiDocumentElementRenderer::CalculateCaretFromPoint(Point point)
|
TextPos GuiDocumentElement::GuiDocumentElementRenderer::CalculateCaretFromPoint(Point point)
|
||||||
{
|
{
|
||||||
|
if (!renderTarget) return TextPos(-1, -1);
|
||||||
vint top=0;
|
vint top=0;
|
||||||
vint index=-1;
|
vint index=-1;
|
||||||
if(GetParagraphIndexFromPoint(point, top, index))
|
if(GetParagraphIndexFromPoint(point, top, index))
|
||||||
@@ -29577,6 +29663,7 @@ GuiDocumentElement::GuiDocumentElementRenderer
|
|||||||
|
|
||||||
Rect GuiDocumentElement::GuiDocumentElementRenderer::GetCaretBounds(TextPos caret, bool frontSide)
|
Rect GuiDocumentElement::GuiDocumentElementRenderer::GetCaretBounds(TextPos caret, bool frontSide)
|
||||||
{
|
{
|
||||||
|
if (!renderTarget) return Rect();
|
||||||
Ptr<ParagraphCache> cache=EnsureAndGetCache(caret.row, true);
|
Ptr<ParagraphCache> cache=EnsureAndGetCache(caret.row, true);
|
||||||
if(cache)
|
if(cache)
|
||||||
{
|
{
|
||||||
@@ -31840,7 +31927,7 @@ GuiGraphicsHost
|
|||||||
return INativeWindowListener::NoDecision;
|
return INativeWindowListener::NoDecision;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiGraphicsHost::Moving(NativeRect& bounds, bool fixSizeOnly)
|
void GuiGraphicsHost::Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder)
|
||||||
{
|
{
|
||||||
NativeRect oldBounds = hostRecord.nativeWindow->GetBounds();
|
NativeRect oldBounds = hostRecord.nativeWindow->GetBounds();
|
||||||
minSize = windowComposition->GetPreferredBounds().GetSize();
|
minSize = windowComposition->GetPreferredBounds().GetSize();
|
||||||
@@ -33092,7 +33179,7 @@ INativeWindowListener
|
|||||||
return INativeWindowListener::NoDecision;
|
return INativeWindowListener::NoDecision;
|
||||||
}
|
}
|
||||||
|
|
||||||
void INativeWindowListener::Moving(NativeRect& bounds, bool fixSizeOnly)
|
void INativeWindowListener::Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+26
-4
@@ -2414,8 +2414,9 @@ Native Window
|
|||||||
/// Called when the window is moving.
|
/// Called when the window is moving.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="bounds">The bounds. Message handler can change the bounds.</param>
|
/// <param name="bounds">The bounds. Message handler can change the bounds.</param>
|
||||||
/// <param name="fixSizeOnly">True if the message raise only want the message handler to change the size.</param>
|
/// <param name="fixSizeOnly">True if the message raise only want the message handler to change the size, and keep the position unchanged.</param>
|
||||||
virtual void Moving(NativeRect& bounds, bool fixSizeOnly);
|
/// <param name="draggingBorder">True if the message raise because the user is dragging the border to change the size.</param>
|
||||||
|
virtual void Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when the window is moved.
|
/// Called when the window is moved.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -6243,7 +6244,7 @@ Host
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
INativeWindowListener::HitTestResult HitTest(NativePoint location)override;
|
INativeWindowListener::HitTestResult HitTest(NativePoint location)override;
|
||||||
void Moving(NativeRect& bounds, bool fixSizeOnly)override;
|
void Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder)override;
|
||||||
void Moved()override;
|
void Moved()override;
|
||||||
void DpiChanged()override;
|
void DpiChanged()override;
|
||||||
void Paint()override;
|
void Paint()override;
|
||||||
@@ -14369,6 +14370,13 @@ GuiDocumentCommonInterface
|
|||||||
GuiControl* documentControl = nullptr;
|
GuiControl* documentControl = nullptr;
|
||||||
elements::GuiDocumentElement* documentElement = nullptr;
|
elements::GuiDocumentElement* documentElement = nullptr;
|
||||||
compositions::GuiBoundsComposition* documentComposition = nullptr;
|
compositions::GuiBoundsComposition* documentComposition = nullptr;
|
||||||
|
|
||||||
|
compositions::GuiGraphicsComposition* documentMouseArea = nullptr;
|
||||||
|
Ptr<compositions::IGuiGraphicsEventHandler> onMouseMoveHandler;
|
||||||
|
Ptr<compositions::IGuiGraphicsEventHandler> onMouseDownHandler;
|
||||||
|
Ptr<compositions::IGuiGraphicsEventHandler> onMouseUpHandler;
|
||||||
|
Ptr<compositions::IGuiGraphicsEventHandler> onMouseLeaveHandler;
|
||||||
|
|
||||||
Ptr<DocumentHyperlinkRun::Package> activeHyperlinks;
|
Ptr<DocumentHyperlinkRun::Package> activeHyperlinks;
|
||||||
bool dragging = false;
|
bool dragging = false;
|
||||||
EditMode editMode = EditMode::ViewOnly;
|
EditMode editMode = EditMode::ViewOnly;
|
||||||
@@ -14380,9 +14388,18 @@ GuiDocumentCommonInterface
|
|||||||
void InvokeUndoRedoChanged();
|
void InvokeUndoRedoChanged();
|
||||||
void InvokeModifiedChanged();
|
void InvokeModifiedChanged();
|
||||||
void UpdateCaretPoint();
|
void UpdateCaretPoint();
|
||||||
|
void EnsureDocumentRectVisible(Rect bounds);
|
||||||
void Move(TextPos caret, bool shift, bool frontSide);
|
void Move(TextPos caret, bool shift, bool frontSide);
|
||||||
bool ProcessKey(VKEY code, bool shift, bool ctrl);
|
bool ProcessKey(VKEY code, bool shift, bool ctrl);
|
||||||
void InstallDocumentViewer(GuiControl* _sender, compositions::GuiGraphicsComposition* _container, compositions::GuiGraphicsComposition* eventComposition, compositions::GuiGraphicsComposition* focusableComposition);
|
void InstallDocumentViewer(
|
||||||
|
GuiControl* _sender,
|
||||||
|
compositions::GuiGraphicsComposition* _mouseArea,
|
||||||
|
compositions::GuiGraphicsComposition* _container,
|
||||||
|
compositions::GuiGraphicsComposition* eventComposition,
|
||||||
|
compositions::GuiGraphicsComposition* focusableComposition
|
||||||
|
);
|
||||||
|
void ReplaceMouseArea(compositions::GuiGraphicsComposition* _mouseArea);
|
||||||
|
|
||||||
void SetActiveHyperlink(Ptr<DocumentHyperlinkRun::Package> package);
|
void SetActiveHyperlink(Ptr<DocumentHyperlinkRun::Package> package);
|
||||||
void ActivateActiveHyperlink(bool activate);
|
void ActivateActiveHyperlink(bool activate);
|
||||||
void AddShortcutCommand(VKEY key, const Func<void()>& eventHandler);
|
void AddShortcutCommand(VKEY key, const Func<void()>& eventHandler);
|
||||||
@@ -14396,6 +14413,9 @@ GuiDocumentCommonInterface
|
|||||||
void OnLostFocus(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments);
|
void OnLostFocus(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments);
|
||||||
void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments);
|
void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments);
|
||||||
void OnCharInput(compositions::GuiGraphicsComposition* sender, compositions::GuiCharEventArgs& arguments);
|
void OnCharInput(compositions::GuiGraphicsComposition* sender, compositions::GuiCharEventArgs& arguments);
|
||||||
|
|
||||||
|
void UpdateCursor(INativeCursor* cursor);
|
||||||
|
Point GetMouseOffset();
|
||||||
void OnMouseMove(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments);
|
void OnMouseMove(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments);
|
||||||
void OnMouseDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments);
|
void OnMouseDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments);
|
||||||
void OnMouseUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments);
|
void OnMouseUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments);
|
||||||
@@ -15760,6 +15780,7 @@ Menu
|
|||||||
private:
|
private:
|
||||||
IGuiMenuService* parentMenuService = nullptr;
|
IGuiMenuService* parentMenuService = nullptr;
|
||||||
bool hideOnDeactivateAltHost = true;
|
bool hideOnDeactivateAltHost = true;
|
||||||
|
Size preferredMenuClientSizeBeforeUpdating;
|
||||||
Size preferredMenuClientSize;
|
Size preferredMenuClientSize;
|
||||||
|
|
||||||
IGuiMenuService* GetParentMenuService()override;
|
IGuiMenuService* GetParentMenuService()override;
|
||||||
@@ -15768,6 +15789,7 @@ Menu
|
|||||||
bool IsSubMenuActivatedByMouseDown()override;
|
bool IsSubMenuActivatedByMouseDown()override;
|
||||||
void MenuItemExecuted()override;
|
void MenuItemExecuted()override;
|
||||||
|
|
||||||
|
void Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder)override;
|
||||||
void UpdateClientSizeAfterRendering(Size preferredSize, Size clientSize)override;
|
void UpdateClientSizeAfterRendering(Size preferredSize, Size clientSize)override;
|
||||||
protected:
|
protected:
|
||||||
GuiControl* owner;
|
GuiControl* owner;
|
||||||
|
|||||||
+147
-28
@@ -725,7 +725,7 @@ WindowsDirect2DParagraph (Formatting)
|
|||||||
{
|
{
|
||||||
DWRITE_TEXT_METRICS metrics;
|
DWRITE_TEXT_METRICS metrics;
|
||||||
textLayout->GetMetrics(&metrics);
|
textLayout->GetMetrics(&metrics);
|
||||||
return (vint)metrics.height;
|
return (vint)ceil(metrics.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@@ -774,10 +774,68 @@ WindowsDirect2DParagraph (Rendering)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct BackgroundRenderer
|
||||||
|
{
|
||||||
|
IWindowsDirect2DRenderTarget* renderTarget = nullptr;
|
||||||
|
ID2D1SolidColorBrush* lastBackgroundBrush = nullptr;
|
||||||
|
FLOAT lbx1, lby1, lbx2, lby2;
|
||||||
|
|
||||||
|
void RenderBackground()
|
||||||
|
{
|
||||||
|
if (lastBackgroundBrush)
|
||||||
|
{
|
||||||
|
renderTarget->GetDirect2DRenderTarget()->FillRectangle(
|
||||||
|
D2D1::RectF(lbx1, lby1, lbx2, lby2),
|
||||||
|
lastBackgroundBrush
|
||||||
|
);
|
||||||
|
lastBackgroundBrush = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SubmitBackground(ID2D1SolidColorBrush* brush, FLOAT x1, FLOAT y1, FLOAT x2, FLOAT y2)
|
||||||
|
{
|
||||||
|
if (lastBackgroundBrush)
|
||||||
|
{
|
||||||
|
if (lastBackgroundBrush != brush)
|
||||||
|
{
|
||||||
|
RenderBackground();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FLOAT yc = (y1 + y2) / 2;
|
||||||
|
if (yc<lby1 || yc>lby2)
|
||||||
|
{
|
||||||
|
RenderBackground();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastBackgroundBrush)
|
||||||
|
{
|
||||||
|
if (lbx1 > x1) lbx1 = x1;
|
||||||
|
if (lby1 > y1) lby1 = y1;
|
||||||
|
if (lbx2 < x2) lbx2 = x2;
|
||||||
|
if (lby2 < y2) lby2 = y2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastBackgroundBrush = brush;
|
||||||
|
lbx1 = x1;
|
||||||
|
lby1 = y1;
|
||||||
|
lbx2 = x2;
|
||||||
|
lby2 = y2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void Render(Rect bounds)override
|
void Render(Rect bounds)override
|
||||||
{
|
{
|
||||||
paragraphOffset = bounds.LeftTop();
|
paragraphOffset = bounds.LeftTop();
|
||||||
PrepareFormatData();
|
PrepareFormatData();
|
||||||
|
{
|
||||||
|
BackgroundRenderer backgroundRenderer;
|
||||||
|
backgroundRenderer.renderTarget = renderTarget;
|
||||||
|
|
||||||
for (vint i = 0; i < backgroundColors.Count(); i++)
|
for (vint i = 0; i < backgroundColors.Count(); i++)
|
||||||
{
|
{
|
||||||
TextRange key = backgroundColors.Keys()[i];
|
TextRange key = backgroundColors.Keys()[i];
|
||||||
@@ -807,11 +865,7 @@ WindowsDirect2DParagraph (Rendering)
|
|||||||
x2 += 0.5f;
|
x2 += 0.5f;
|
||||||
y2 += 0.5f;
|
y2 += 0.5f;
|
||||||
|
|
||||||
renderTarget->GetDirect2DRenderTarget()->FillRectangle(
|
backgroundRenderer.SubmitBackground(brush, x1, y1, x2, y2);
|
||||||
D2D1::RectF(x1, y1, x2, y2),
|
|
||||||
brush
|
|
||||||
);
|
|
||||||
|
|
||||||
start = hitTest.textPosition + hitTest.length;
|
start = hitTest.textPosition + hitTest.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -819,6 +873,9 @@ WindowsDirect2DParagraph (Rendering)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backgroundRenderer.RenderBackground();
|
||||||
|
}
|
||||||
|
|
||||||
renderTarget->GetDirect2DRenderTarget()->DrawTextLayout(
|
renderTarget->GetDirect2DRenderTarget()->DrawTextLayout(
|
||||||
D2D1::Point2F((FLOAT)bounds.Left(), (FLOAT)bounds.Top()),
|
D2D1::Point2F((FLOAT)bounds.Left(), (FLOAT)bounds.Top()),
|
||||||
textLayout.Obj(),
|
textLayout.Obj(),
|
||||||
@@ -8306,17 +8363,49 @@ WindowsForm
|
|||||||
ImmReleaseContext(handle, imc);
|
ImmReleaseContext(handle, imc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool supressClosePopups = false;
|
||||||
|
|
||||||
|
static void ClosePopupsOf(WindowsForm* owner, SortedList<WindowsForm*>& exceptions)
|
||||||
|
{
|
||||||
|
for (vint i = 0; i < owner->childWindows.Count(); i++)
|
||||||
|
{
|
||||||
|
auto popup = owner->childWindows[i];
|
||||||
|
if (popup->windowMode != Normal && popup->IsVisible())
|
||||||
|
{
|
||||||
|
if (!exceptions.Contains(popup))
|
||||||
|
{
|
||||||
|
popup->Hide(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ClosePopupsOf(popup, exceptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool HandleMessageInternal(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result)
|
bool HandleMessageInternal(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result)
|
||||||
{
|
{
|
||||||
// handling popup windows
|
if (!supressClosePopups)
|
||||||
{
|
{
|
||||||
bool closeChildPopups = false;
|
bool closePopups = false;
|
||||||
|
WindowsForm* activatedWindow = nullptr;
|
||||||
|
WindowsForm* rootWindow = nullptr;
|
||||||
|
SortedList<WindowsForm*> exceptions;
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_ACTIVATE:
|
case WM_ACTIVATEAPP:
|
||||||
if (wParam == WA_INACTIVE && windowMode == Normal)
|
if (wParam == FALSE)
|
||||||
{
|
{
|
||||||
closeChildPopups = true;
|
closePopups = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_ACTIVATE:
|
||||||
|
switch (LOWORD(wParam))
|
||||||
|
{
|
||||||
|
case WA_ACTIVE:
|
||||||
|
case WA_CLICKACTIVE:
|
||||||
|
activatedWindow = this;
|
||||||
|
closePopups = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
@@ -8325,29 +8414,32 @@ WindowsForm
|
|||||||
case WM_NCLBUTTONDOWN:
|
case WM_NCLBUTTONDOWN:
|
||||||
case WM_NCMBUTTONDOWN:
|
case WM_NCMBUTTONDOWN:
|
||||||
case WM_NCRBUTTONDOWN:
|
case WM_NCRBUTTONDOWN:
|
||||||
closeChildPopups = true;
|
activatedWindow = this;
|
||||||
|
closePopups = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (closeChildPopups)
|
if (activatedWindow)
|
||||||
{
|
{
|
||||||
List<WindowsForm*> childPopups;
|
rootWindow = activatedWindow;
|
||||||
childPopups.Add(this);
|
exceptions.Add(rootWindow);
|
||||||
for (vint i = 0; i < childPopups.Count(); i++)
|
while (auto parentWindow = rootWindow->parentWindow)
|
||||||
{
|
{
|
||||||
auto popup = childPopups[i];
|
rootWindow = parentWindow;
|
||||||
for (vint j = 0; j < popup->childWindows.Count(); j++)
|
exceptions.Add(parentWindow);
|
||||||
{
|
|
||||||
auto childPopup = popup->childWindows[j];
|
|
||||||
if (childPopup->windowMode != Normal)
|
|
||||||
{
|
|
||||||
childPopups.Add(childPopup);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (popup != this && popup->IsVisible())
|
if (closePopups)
|
||||||
{
|
{
|
||||||
popup->Hide(false);
|
List<IWindowsForm*> allRootWindows;
|
||||||
|
GetAllCreatedWindows(allRootWindows, true);
|
||||||
|
|
||||||
|
for (vint i = 0; i < allRootWindows.Count(); i++)
|
||||||
|
{
|
||||||
|
if (auto windowsForm = dynamic_cast<WindowsForm*>(allRootWindows[i]))
|
||||||
|
{
|
||||||
|
ClosePopupsOf(windowsForm, exceptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8364,7 +8456,7 @@ WindowsForm
|
|||||||
NativeRect bounds(rawBounds->left, rawBounds->top, rawBounds->right, rawBounds->bottom);
|
NativeRect bounds(rawBounds->left, rawBounds->top, rawBounds->right, rawBounds->bottom);
|
||||||
for(vint i=0;i<listeners.Count();i++)
|
for(vint i=0;i<listeners.Count();i++)
|
||||||
{
|
{
|
||||||
listeners[i]->Moving(bounds, false);
|
listeners[i]->Moving(bounds, false, (uMsg == WM_SIZING));
|
||||||
}
|
}
|
||||||
if( rawBounds->left!=bounds.Left().value
|
if( rawBounds->left!=bounds.Left().value
|
||||||
|| rawBounds->top!=bounds.Top().value
|
|| rawBounds->top!=bounds.Top().value
|
||||||
@@ -9093,7 +9185,7 @@ WindowsForm
|
|||||||
NativeRect newBounds=bounds;
|
NativeRect newBounds=bounds;
|
||||||
for(vint i=0;i<listeners.Count();i++)
|
for(vint i=0;i<listeners.Count();i++)
|
||||||
{
|
{
|
||||||
listeners[i]->Moving(newBounds, true);
|
listeners[i]->Moving(newBounds, true, false);
|
||||||
}
|
}
|
||||||
MoveWindow(handle, (int)newBounds.Left().value, (int)newBounds.Top().value, (int)newBounds.Width().value, (int)newBounds.Height().value, FALSE);
|
MoveWindow(handle, (int)newBounds.Left().value, (int)newBounds.Top().value, (int)newBounds.Width().value, (int)newBounds.Height().value, FALSE);
|
||||||
}
|
}
|
||||||
@@ -9730,6 +9822,24 @@ WindowsController
|
|||||||
return windows.Values()[index];
|
return windows.Values()[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetAllCreatedWindows(collections::List<IWindowsForm*>& createdWindows, bool rootWindowOnly)
|
||||||
|
{
|
||||||
|
if (rootWindowOnly)
|
||||||
|
{
|
||||||
|
FOREACH(WindowsForm*, window, windows.Values())
|
||||||
|
{
|
||||||
|
if (window->GetWindowMode() == INativeWindow::Normal)
|
||||||
|
{
|
||||||
|
createdWindows.Add(window);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CopyFrom(createdWindows, windows.Values());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool HandleMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result)
|
bool HandleMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result)
|
||||||
{
|
{
|
||||||
bool skipDefaultProcedure=false;
|
bool skipDefaultProcedure=false;
|
||||||
@@ -9970,7 +10080,7 @@ Windows Platform Native Controller
|
|||||||
{
|
{
|
||||||
return controller->GetWindowsFormFromHandle(hwnd);
|
return controller->GetWindowsFormFromHandle(hwnd);
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
IWindowsForm* GetWindowsForm(INativeWindow* window)
|
IWindowsForm* GetWindowsForm(INativeWindow* window)
|
||||||
@@ -9978,6 +10088,15 @@ Windows Platform Native Controller
|
|||||||
return dynamic_cast<WindowsForm*>(window);
|
return dynamic_cast<WindowsForm*>(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetAllCreatedWindows(collections::List<IWindowsForm*>& windows, bool rootWindowOnly)
|
||||||
|
{
|
||||||
|
auto controller = dynamic_cast<WindowsController*>(GetCurrentController());
|
||||||
|
if (controller)
|
||||||
|
{
|
||||||
|
controller->GetAllCreatedWindows(windows, rootWindowOnly);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DestroyWindowsNativeController(INativeController* controller)
|
void DestroyWindowsNativeController(INativeController* controller)
|
||||||
{
|
{
|
||||||
delete controller;
|
delete controller;
|
||||||
|
|||||||
@@ -2145,6 +2145,7 @@ Windows Platform Native Controller
|
|||||||
extern INativeController* CreateWindowsNativeController(HINSTANCE hInstance);
|
extern INativeController* CreateWindowsNativeController(HINSTANCE hInstance);
|
||||||
extern IWindowsForm* GetWindowsFormFromHandle(HWND hwnd);
|
extern IWindowsForm* GetWindowsFormFromHandle(HWND hwnd);
|
||||||
extern IWindowsForm* GetWindowsForm(INativeWindow* window);
|
extern IWindowsForm* GetWindowsForm(INativeWindow* window);
|
||||||
|
extern void GetAllCreatedWindows(collections::List<IWindowsForm*>& windows, bool rootWindowOnly);
|
||||||
extern void DestroyWindowsNativeController(INativeController* controller);
|
extern void DestroyWindowsNativeController(INativeController* controller);
|
||||||
extern void EnableCrossKernelCrashing();
|
extern void EnableCrossKernelCrashing();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -622,6 +622,14 @@ Custom Type
|
|||||||
, TBase(typeDescriptorFlags, this)
|
, TBase(typeDescriptorFlags, this)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const WString& GetTypeName() override
|
||||||
|
{
|
||||||
|
// TypeDescriptorImplBase::GetTypeName returns WString(this->typeName, false)
|
||||||
|
// which is this->workflowTypeName.Obj()
|
||||||
|
// will become a dangling pointer after this type is unloaded
|
||||||
|
return workflowTypeName;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class WfCustomType : public WfCustomTypeBase<reflection::description::TypeDescriptorImpl>
|
class WfCustomType : public WfCustomTypeBase<reflection::description::TypeDescriptorImpl>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user