Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi everyone,

I have searched for an answer to this question for some time. After returning to some very good, somewhat related, Q&A here on Code Project, I thought I would finally post here and cross my fingers for a suitable answer.

I am recently returning to some amateur coding using VB+WPF after a 10 year hiatus and coming from Delphi/Pascal background.

I will use a very simplified example of what I am trying to implement. What I need is essentially a scrolling vertical graph. This needs to be a consistent page(not broken into pages like a word processor). Lets say the height of the screen would represent 60 min, but the document itself may scroll for days worth of data. This application would also have some whitespace to either side of this scaled graph that may have the user input text comments into a movable text box(each comment in a separate text box, that is separately aligned with a given time).There may be a few other graphical elements along this graph as well that user can click/add.

My problem here is that I am absolutely lost on where to start with this. I am thoroughly confused by how to properly draw this scrolling graph so that it is many many pages long. redrawing the data elements with each move up or down does not seem like the solution to me. I am absolutely stuck on this. I can implement all sorts of standard things that are static and limited to what I see on the screen. I recently did a nice cubic spline on a graphic module. But again, none of those lines leave the page. ANY help that is offered will be very much appreciated. I would love to see some simple code showing a long scrolling page with shapes/lines/text. At the moment, I am convinced it would be much easier to draw a scene in 3D than to try an get this understood.

Thanks in advance and I will be watching to answer any questions asked.

Mark
Posted

This is not straignt forward. I am not sure what you really want, but if you want to page from one to the other I would suggest using a scroll bar with a pane and replacing the image in the window with the correct page. If you are willing to just scroll, I would put the pages into a grid, and put the grid in a scroll panel.
 
Share this answer
 
Thanks for the Reply, and apologies for my own delay.

I will give your suggestion a try and see what results. I can see this is not so straight forward.

For clarification, a web page is a better example. Smooth scrolling single document. but can significantly vary in length. ie if the top to bottom of a webpage may represent 60 min of time/data plotted, there may be many hours or even days of data one could scroll through.(this could also be left to right scolling. The direction doesnt seem to be the limitation here).

Perhaps I will be stuck with making it appear to scroll with a scroll panel, redrawing any elements/data I place on it. That seems simple for just a time/data curve, but I have no idea how to move another element like a text box.

I think I remember reading where xcode and/or QT had a viewport to a larger canvas. Though I have never worked in either environment to know, that seems, on the surface, like a solution.

Any other advice is more than welcome.

Perhaps I need to get more into the "guts" of the issue as opposed to thinking there is some component to solve the problem. Can anyone provide a brief explanation of HOW a webpage buffers/draws the page as it scrolls? Or hell, how about just notepad.

My head hurts.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900