Announcement

Collapse
No announcement yet.

Text Window Dilemma

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Text Window Dilemma

    Greetings All!

    I'm having a problem in the middle of some wonderful progress and I'm frustrated with butting my head against the wall in my ignorance. Hopefully someone can give me a gentle nudge (well, a shove would probably be better) in the algorithm department and send me in a better direction.

    I'm attempting to create a user-friendly interface for my fairly functional program, RPGSort. The purpose of RPGSort is to rename and sort all of the available RPG e-books whether they be fan-based or purchased from Wizards of the Coast. The program is fully working but just a little lacking in the customer service area though. So, I've spent my lone day off tackling this ugly program and have come up with a pleasant screen to astound the future users.

    Code:
     +                                ··------------------------------------------+
       ¯¦¯¯_  ¯¦¯¯_   _¯¯¯_                       RPGSort release 8.9.01          ¦
        ¦   ¦  ¦   ¦ ¦                    Code by Kurt Reonis ([email protected])  ¦
       ¯¦¯¦¯  ¯¦¯¯¯  ¦   __¯            Data by Max Amum ([email protected]) ¦
        ¦  ¯_  ¦     ¦  ¯ ¦           ··------------------------------------------¦
       ¯    ¯ ¯      ¯____¯              File  ¦ Current Operation:               ¦
                                      ·········+----------------------------------¦
         _¯¯¯_  _¯¯¯_ ¯¦¯¯_  ¦¯¯_¯¯¦  .                                           ¦
        ¦      ¦    ¦  ¦   ¦    ¦     :                                           ¦
         ¯¯__  ¦    ¦ ¯¦¯¦¯     ¦     ¦                                           ¦
             ¦ ¦    ¦  ¦  ¯_    ¦     ¦                                           ¦
        ¯____¯ ¯____¯ ¯    ¯   _¦_    ¦                                           ¦
                                      ¦                                           ¦
     .                                ¦                                           ¦
     :                                ¦                                           ¦
     +--------------------------------¦                                           ¦
     ¦ (   %) ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ¦                                           ¦
     +--------------------------------¦                                           ¦
     ¦ Sort Scheme:                   ¦                                           ¦
     ¦ Rename Scheme:                 ¦                                           ¦
     ¦ Separator:                     ¦                                           ¦
     ¦ Log File:                      ¦                                           ¦
     +----------------------------------------------------------------------------+
    .my problem lies in updating many things at once. On the left you see the progress bar that will update after comparing and renaming each file. On the upper right, a field for the current operation. This will showcase what my program is actually doing, importing the database, creating the batch files, creating the missing/have lists.et cetera. The large empty gap in the lower right is my problem. It should show what files have been scanned and what the result of the scan was.

    Everything is running quite smoothly except this area. I need to figure out a way to scroll this area as more files are brought in to be examined. This means that I can scan fifteen files and they will all be displayed with results and when the sixteenth is scanned, the first should disappear as the second becomes the first and so on.

    I've worked with the "VIEW TEXT" until my eyes are strained and my fingers numb and I'm having no success. I can print to the newly created text window and things will scroll nicely; but, my other areas won't be updated with their "LOCATE" and "PRINT" statements.

    So, if anyone can provide a little guidance in creating a window that I can easily send data to as well as update my other fields, please direct me.

    Kurt Reonis
    mailto:[email protected][email protected]</A>
    Donnie Ewald
    [email protected]

  • #2
    You could try a couple of DOS function calls that will let you
    scroll portions of the text screen independantly of the rest of
    the screen.

    Interrupt h10, function 6 will scroll any portion of the screen up.
    Any text scrolled out of the scrolling area won't affect the text
    above it.

    AH = function number (06)
    AL = number of lines to scroll up.
    BH = color for blank lines scrolled in from the bottom.
    CH, CL = Row, Column of the upper left corner of the scrolled area.
    DH, DL = Row, Column of the lower right corner of the scrolled area.


    Interrupt h10, function 7 will scroll any portion of the screen down.
    Any text scrolled out of the scrolling area won't affect the text
    below it.

    AH = function number (07)
    AL = number of lines to scroll down.
    BH = color for blank lines scrolled in from the top.
    CH, CL = Row, Column of the upper left corner of the scrolled area.
    DH, DL = Row, Column of the lower right corner of the scrolled area.


    The upper left of the screen for these functions is 0, 0, unlike
    LOCATE, which is 1, 1.

    Set up and call these functions like this:

    REG 1, &h0601 ;function 6 (scroll screen up) in AH, number of lines to scroll up (1) in AL
    REG 2, &h0000 ;color of blank lines at the bottom in BH (ignore BL)
    REG 3, &h0000 ;Row, Column for upper left corner of scroll area in CH, CL (0, 0)
    REG 4, &h0A0A ;Row, Column for lower right corner of scroll area in DH, DL (10, 10)
    CALL INTERRUPT &h10 ;call the interrupt


    From your description, I think this is what you're looking for.
    Good luck.

    ------------------

    Comment


    • #3
      VIEW TEXT should work fine for this approach... I use it in the PBFAX library I co-wrote. To update the non-viewport region of the screen, I use a direct POKE technique, while using standard PRINT to display text in the viewport region (so that scrolling works exactly es you require.

      Essentially, when you define a viewport, the top/left character in the view port is at location 1,1. Therefore, you should be able to use VIEW TEXT aand then LOCATE 1,1 and just start PRINTing your output.

      JFYI, the freeware version of PBFAX containing the viewport screen handling code can be downloaded from the PBDOS DOWNLOADS section of this web site.


      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        As far as I remember, as long as you have defined a viewport, you
        cannot print anything outside that viewport. So if you want to update
        text areas outside your window, you would have to change temporarily the
        viewport definition in order to do that.

        Regards,

        Hans Ruegg.

        Comment


        • #5
          ... sorry, except if you POKE directly to the video memory instead
          of using PRINT (I had missed that part of Lance's post when I wrote
          the above reply.)

          Comment


          • #6
            Greetings All!

            Many thanks for the good replies. I took the advice of Lance and used “VIEW TEXT” to scroll through the information and “POKE”d the updates to the other parts of the screen. I do appreciate the thought from Grant but, your suggestion is above my understanding.

            Kurt Reonis
            mailto:[email protected][email protected]</A>


            ------------------
            Donnie Ewald
            [email protected]

            Comment

            Working...
            X