Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - markup + horizontal scrolling
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

markup + horizontal scrolling

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: markup + horizontal scrolling
    Posted: 03 August 2009 at 10:29pm
Hi all

I can get vertical scrolling working fine with a scrollview (?) element, but can't get any vertical scrolling. It doesn't matter what sort of child element is inside it.

I can understand if you've got a vertical stackpanel, but for anything that does not resize horizontally (or has min width) this means you can't scroll to view it all.

Is this a bug?

Adrien
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2009 at 12:38am
Do you route events to markup with CXTPMarkupContext::OnWndMsg ?
 
BOOL CMarkupStatic::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
 // To Handle Hyperlinks:
 if (m_pUIElement)
 {
  CXTPMarkupContext::m_hContextWnd = m_hWnd;
  if (CXTPMarkupContext::OnWndMsg(m_pUIElement, message, wParam, lParam, pResult))
   return TRUE;
 }
 return CStatic::OnWndMsg(message, wParam, lParam, pResult);
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2009 at 11:35am
this is even in MarkupPad. It scrolls vertically but clips horizontally. Can check with using MinWidth on something inside a scrollpanel.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2009 at 4:08am
Hi,
Please paste XAML you tried.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2009 at 7:41pm
<Grid xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
TextElement.FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
     <Border>
          <ScrollViewer Width = "100" Height="100" Margin="4">
          <StackPanel Orientation="Horizontal" Background="Gold">
               <RadioButton Content="Item 1"/>
               <RadioButton Content="Item 2"/>
               <RadioButton Content="Item 3"/>
               <RadioButton Content="Item 4"/>
               <RadioButton Content="Item 5"/>
               <RadioButton Content="Item 6"/>
               <RadioButton Content="Item 7"/>
               <RadioButton Content="Item 8"/>
               <RadioButton Content="Item 9"/>
          </StackPanel>
          </ScrollViewer>     
     </Border>
</Grid>

I've never been able to do anything that will get a scrollpanel to display a horizontal scrollbar, only vertical.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 09 August 2009 at 12:19pm
Add a HorizontalScrollBarVisibility='Auto' attribute to your ScrollViewer:


          <ScrollViewer Width = "100" Height="100" Margin="4" HorizontalScrollBarVisibility='Auto'>


And you should see the horizontal scrollbar.

On a semi-related note to CJ though - try using Adrien's XAML with my modification and you will see that the scroll thumb bitmap gets chopped off at the right edge (this happens when the thumb gets small due to wide objects in ScrollViewer). Any chance of a fix for this?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 09 August 2009 at 6:42pm
thanks!
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 09 August 2009 at 7:48pm
Still some bugs in it.

Relating to TextBlock elements. If you have a large textblock, and put it inside a ScrollViewer, and set horizontal scrolling to auto, then the text block presumes it has infinite width, and won't wrap. It then forces any border around it to be too big etc.

I want to do some text that will always just wrap to the width of the actual screen it's in, but when the screen gets smaller than say 400px, it will start scrolling horizontally at that point.

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 09 August 2009 at 8:02pm
I think you need to explicitly declare the width of your TextBox, and set the TextWrapping attribute to Wrap. If you put that in a ScrollViewer with the HorizontalScrollBarVisibility='Auto' attribute set, you will only see a horizontal scrollbar when the width of the Markup window < the width of your TextBox. Something like:


<ScrollViewer HorizontalScrollBarVisibility='Auto'>
    <TextBlock Width='400px' TextWrapping='Wrap'>
    This is a test of really long text to make sure that it wraps at 400px, but to also ensure that the horizontal scrollbar will not appear unless needed!
    </TextBlock>
</ScrollViewer>

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 09 August 2009 at 11:41pm
Here's a sample image that shows the chopped scroll thumb problem:



This is a problem in Vista, seems okay in Win2K, not sure about XP (can anyone confirm for XP)?

Thanks.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.