Flow Graph |
Post Reply |
Author | |
lrenoux
Groupie Joined: 20 April 2009 Status: Offline Points: 62 |
Post Options
Thanks(0)
Posted: 14 January 2019 at 5:32am |
Hi,
Codejock version : no matter, the problem is here since the beginning.
It seems there is a lot of problems on size for nodes in FlowGraph control. First : When saving a node, some weird modifications will be done only on height. void CXTPFlowGraphNode::DoCommonPropExchange(CXTPPropExchange* pPX) { ... // when saving it's required to check, because XTPMeasureMarkupElement // returns 2px more for the whole markup CSize szStoredSize = m_szUserSize; szStoredSize.cy -= 2; Why height and not width ? And i think, because UserSize is saved and not ActualSize, you don't have to do this (see below). Second : Take the flowgraph sample, select a node, resize it only on height, you will see that the width will be enlarge by 2 pixels. Finally : It seems that the function SetSize on a node enlarge all dimensions given by 2. In memory, we have UserSize + 2 = ActualSize. All calls on this method must be done with UserSize. When a node is serialized, the call to SetSize is made with UserSize but in the resize function (CXTPFlowGraphControl::StartResizeNode) is made with ActualSize. L. |
|
lrenoux
Groupie Joined: 20 April 2009 Status: Offline Points: 62 |
Post Options
Thanks(0)
|
The matter came from the function SetSize which set the size of the element "nodeContent" which is include in an xaml element border with a "BorderThickness" equal to 1.
ActualSize memorise the size of the markup ("nodeFrame") with border element, UserSize memorise the size of "nodeContent" without element border. Fichier "FlowGraph\res\Node.xaml" <Border xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' x:Name='nodeFrame' VerticalAlignment='Center' HorizontalAlignment='Center' Padding='0' BorderThickness='1' BorderBrush='#717171' > <StackPanel x:Name='nodeContent' VerticalAlignment='Center' HorizontalAlignment='Center' Background='#DCDCDC'> <Border x:Name='nodeCaptionBorder' BorderThickness='1' BorderBrush='#717171' Background='#ACACAC' Padding='20, 0, 20, 0' CanSetColor='True'> <WrapPanel> <Image x:Name='nodeImage' Margin='-20,0,0,0'/><TextBlock x:Name='nodeCaption' FontWeight='Bold' VerticalAlignment='Center' HorizontalAlignment='Center'/> </WrapPanel> </Border> <StackPanel x:Name='nodeCustomControl'/> <StackPanel x:Name='nodeItemsCollection'/> </StackPanel> <!-- nodeContent --> </Border> <!-- nodeFrame --> L.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |