Bug in Normal View Mode?

  • Hi,

    I'm evaluating the TextDynamic OCX for my software. Basically, we have our own form generation software that currently uses a RichTextBox, but we would like to add more functionality. My hope was to use the TextDynamic control as a replacement. What I don't want to have to do is redesign our form system completely in TextDynamic, just use the control to simulate a textarea on a page.

    Our forms have 2 pages for layout - page 1 and page 2+. The text area for page one is a certain size & position (i.e. 7 inches wide by 3 inches tall) and the text area for pages 2 and up is a different size and position (i.e. 7.5 inches wide by 8 inches tall). Only one page gets show at a time for entry. I have been able to simulate this by putting the TextDynamic control in a PictureBox and changing the .Top property to simulate switching from page 1 to 2 to 3, etc... by tracking page changes in the OnChangePosition event.

    Of course, since I don't want the TextDynamic control to represent a whole page (just the text area that goes onto our form), I set the LayoutMode to wplayNormal. The problem is that it seems that the word wrapping for the control stays at the page 1 width even when you are one page 2. I'm just wondering if I am doing something wrong, or if there is a bug? Here's a stripped down example to illustrate the bug:

    Place a TextDynamic control (WPDLLInt1) and a CommandButton (Command1) on a form, then add this code:

    Code
    Private Sub Command1_Click()
       With Me.WPDLLInt1
          .CurrMemo.AutoZoom = wpAutoZoomOff
          .CurrMemo.LayoutMode = wplayNormal
          .CurrMemo.PageSizeList.Add Me.ScaleX(3, vbInches, vbTwips), Me.ScaleX(3, vbInches, vbTwips)
          .CurrMemo.PageSizeList.Add Me.ScaleX(5, vbInches, vbTwips), Me.ScaleX(5, vbInches, vbTwips)
          .CurrMemo.PageSizeList.Active = True
          .CurrMemo.ReformatAll True, True
       End With
    End Sub

    Now start the project and click the CommandButton. Then start typing wide text. Everything looks and wraps fine on page 1, but when you get to page 2 the wrapping will still be at page 1 width even though the ruler shows that the page width is wider. Any ideas?

    • Offizieller Beitrag

    Hi,

    sorry, I overlooked your question.

    Zitat

    Of course, since I don't want the TextDynamic control to represent a whole page (just the text area that goes onto our form), I set the LayoutMode to wplayNormal. The problem is that it seems that the word wrapping for the control stays at the page 1 width even when you are one page 2. I'm just wondering if I am doing something wrong, or if there is a bug? Here's a stripped down example to illustrate the bug:

    I don't understand what this effect is: page 1, but when you get to page 2 the wrapping will still be at page 1 .

    Maybe the approach is too complicated.

    Using the property WordWrap you can adjust the size of the form to the window automatically. Using AutoZoom you can adjust the size of the fonts to always fill the window.

    The pageList is not really made for the normal mode - maybe there is really a problem.

    What happens if you use the page layout mode?

    All margins can be 0 of course.

    Julian

  • Hi Julian,

    No problem on the delay, and thank you for responding. I've put together a quick demo of what I am trying to do (in VB6). You can download it here:


    Basically I want the ability to use all of TextDynamics formatting features in a description area that the user can edit, while locking out other parts of our form. The description area will change size and position between page 1 and pages 2+.

    The demo I wrote is just a rough example. For example, it doesn't take into account the text area size exactly to not show cut-off lines at the bottom of a page, but it should give you an idea as to what I am trying to accomplish.

    What I need to know is:

    1) Is it possible to have different page margins & sizes using Normal view? I have been able to get the page heights to be different (you will see in my demo that switching from page 1 to 2 works), but not the page widths (the text overflows the right edge of the box in my demo).
    2) Is it possible to get the exact height of the text that fits on a page? In my demo you will see a cut-off line of text at the bottom of the page

    Thanks a lot for your help,
    Jason

    • Offizieller Beitrag

    I again overlooked it - you can reach me at support@wptools.de when I don't see your post.

    Thanks for the sample.

    What about a solution of having the complete from in TextDynamic - I mean all the pages.

    TextDynamic supports different page sizes for each page, also different margins. A future version can allow it to set special rectangles on a page which can be editied.

    The result will be similar to your demo but without any flipping. It will be possible to scroll between the pages, view them at different zoom levels and so on. And printing is one line of code.

    The only code you have to add is one event handler to define the page size for each page.

    Zitat

    What I need to know is:

    1) Is it possible to have different page margins & sizes using Normal view? I have been able to get the page heights to be different (you will see in my demo that switching from page 1 to 2 works), but not the page widths (the text overflows the right edge of the box in my demo).

    NormalView supports different page sizes as well. The property "WordWrap" overwrites the page width though.

    Zitat

    2) Is it possible to get the exact height of the text that fits on a page? In my demo you will see a cut-off line of text at the bottom of the page

    Internally the possibility exists, but it is not available yet as command or API.

    Julian