Announcement

Collapse
No announcement yet.

Graphics Tools Screen Smaller than Console in Win10 - Revisited

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

  • Graphics Tools Screen Smaller than Console in Win10 - Revisited

    As I said in a previous posting, Win10 does something strange with the sizing of the Graphics Window created by PBCC + Contools/GFX. As suggested, I've boiled it down to minimum code which is attached. You'll have to copy in your Perfect Sync authorization code in two places (or am I the only one still using it - love it still!).

    On Win XP and Vista, the attached code shows the Console in black, Stretches it, and finally makes a window which covers the whole screen and draws a red line from top left to bottom right.

    On Win10, the same EXE makes a black Console which covers the whole screen properly, but its gray Graphic Window only covers about 80% of the Console, leaving black stripes on right side and bottom. The red line sometimes goes corner-to-corner on the Graphic Window, and sometimes only goes part way.

    There must be something weird and new that Win10 does, perhaps messing up the ConsoleGfx call and maybe related to the use of ConsoleStretch.

    Any help would be greatly appreciated!
    Attached Files

  • #2
    I do not believe Perfect Sync ever certified Console Tools for use with Windows/10; I think the product dropped into "legacy mode" before Win/10 was ever released.

    My point being one I've made - or at least tried to make - many times here: Software has a shelf life beyond which it is not maintainable - and porting from anything to Win/10 is maintenance. When this happens your best option in my not so humble opinion is to rethink your application and rewrite for current operating conditions.

    If you look at why Console Tools was dropped into legacy mode, IIRC one of the reasons given was the expansion of the PowerBASIC intrinsic console handling features with the newer versions of PBCC. Maybe it's time to start using those new features.

    Any help would be greatly appreciated!
    Yes, I AM going to score this post as "any help" and I accept your appreciation.

    Comment


    • #3
      Hi MIchael - Sadly you are probably correct. I say sadly because my code is about 88,000 lines, and the re-write time will be unpaid. So, do I just keep an XP machine alive for my own use but stop selling it to others, or try to re-write out all the Contools/GFX stuff?

      Or maybe Eric or someone else will see an easier fix. It seems that EVERYTHING else works perfectly on Win10! But all the graphics shows up in a truncated sub-Window.

      Thanks, cheers, and keep up the good work keeping PBCC alive. I guess there is no news about someone getting the rights to continue it, since there hasn't been an announcement.

      Comment


      • #4
        Maybe there is some kind of Windows/10 " backward compatibility" user setting. I just don't know. I'm still figuring out Windows/XP.

        But this was just such an opportunity to make my point about 'shelf life!'

        ... because my code is about 88,000 lines...
        Fortunately for you, you carefully thought about future maintenance when you first wrote this, and all the user I-O code was carefully segregated into only a handful of procedures so it's not like you have to look at all 88,000 lines.

        Um, you DID write it like that, right?

        MCM

        Comment


        • #5
          Mostly...... But not in 5 or 10 clean standalone locations. It'll take 2-8 full-time weeks, my guess, and that's assuming I don't run into anything where Contools/GFX does it easy but PBCC requires adapting Win API routines.

          When I started writing it on my Model 1 IBM PC (64k!), I wasn't thinking this far down the road! Cheers.

          Comment


          • #6
            >When I started writing it on my Model 1 IBM PC (64k!), I wasn't thinking this far down the road

            Cheer up!

            I know for a fact we have a number of members here who did not think ahead as far as Windows/98.

            Comment


            • #7
              Sometimes it can save a lot of time, spending a few hours on developing a little utility that finds and inserts code that fixes problems that arise on system update. Resizing code code should not be too tricky (?), so this sounds like one of those times. Open file(s), instr problem, insert fix, save file(s). Just remember to keep copies of original code.

              Comment


              • #8
                > Resizing code code should not be too tricky (?)..

                Maybe there is some "quickfix" code.... but as of right now the problem is not even defined! Is it something in Win/10 console subsystem? Something in the Console/Graphics Tools? Something in the PBCC code version (whatever)?

                Oh, phooey, let me DL the (demo only) code. I don't have Win10 but let me see what I can do with it.

                Comment


                • #9
                  Thanks Michael. I was hoping that Eric would be interested in this problem since Contools/GFX was his baby, but he's got other things to do and isn't in that business any more.

                  I've spent the last 6 hours looking into how to use PBCC to do what Contools/GFX did. Some things aren't too hard, and I can get a graphics window to be the correct size without any problem. I can't read the mouse in a Graphics Window yet (I hid the Console), but there must be a way. And, I guess I'll have to set up my big pulldown menu and popup boxes using API calls. I'll search the forums right now.

                  I hope it don't put in months getting my code to run in pure PBCC only to have the second anniverary upgrade of Win10 kill it for us.

                  Comment


                  • #10
                    I can't read the mouse in a Graphics Window yet (I hid the Console), but there must be a way.
                    The code at the following link provides for Mouse hovering on a GRAPHIC WINDOW, with it you might be able to extend our collective experience even more!

                    https://forum.powerbasic.com/forum/u...ttons-extended
                    Rod
                    "To every unsung hero in the universe
                    To those who roam the skies and those who roam the earth
                    To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                    Comment


                    • #11
                      Sorry Dan, some days I just scan the forum "Activity Stream" and I didn't realize this was a Graphics Tools question. I have moved it to the Graphics Tools subforum and edited the subject line.

                      > I was hoping that Eric would be interested in this problem
                      > [Eric's] got other things to do and isn't in that business any more.

                      Please don't speak for me, that's completely untrue. I'm definitely "still in the business" and continue to support my products, current and legacy, as always. (If you want to "interest" me in a problem you don't have to "hope", just email support@perfectsync.com as always! )

                      Unfortunately I moved last week and frankly I'm swamped -- the computer I use for Graphics Tools development isn't even hooked up yet -- so it will be a few days before I can look at the problem. But there's NO reason for you to abandon all of the work you have done and build your own pulldowns and popups.

                      > Some things aren't too hard

                      ...until you try to get them to work reliably with a console window on all versions of Windows since 95. I said many times that if I'd known how hard Console Tools Plus Graphics was going to be to write, I would never have started.

                      Since it works sometimes but not others, my first thought is to add some one-second delays (SLEEP 1000) to your program, between the various Graphics Tools and Console Tools functions. Here's why... When you tell windows "resize this window", if you then immediately ask Windows how big the window is, you can get the pre-resize values or something in between. Graphics Tools and Console Tools have strategic built-in delays, but they may not be long enough for Windows 10. If adding the delays fixes the problem you can remove them one by one to find the culprit.
                      "Not my circus, not my monkeys."

                      Comment


                      • #12
                        Eric, old friend - my deepest and sincerest apologies for "speaking for you". I should have just emailed to you my question, but honestly I was feeling guilty to be bothering you again about a product that you are no longer making any income from.

                        Sorry, sorry, and I'm so glad to hear that you are still "in the business" (by which I meant Perfect Sync, not computers in general, but my wording was sloppy.)

                        I posted this question in the general PBCC Forum because I wasn't sure if it was PBCC or Contools/GFX that was having the problem, but now I'm pretty sure it is in lResult& = ConsoleGfx(0,0,0,0) . I did try sticking Sleep statements all around it. It is definately true that the same EXE works on XP and Vista, and messes up on Win10.

                        I spent 6 hours yesterday looking at using PBCC alone, and I don't think I can realistically do it. I looked online for an add-on package that would include pulldown menues and such - found something called "Contools."

                        Perhaps if I was using PBwin it would be possible, but 20 years ago I bought both PBCC and PBwin, studied them both and wrote some sample code, and decided that PBCC was a better product for my purposes (CAD graphics plus engineering calculations). Now, not only has the train left the station, but they tore up the tracks and put in a parking lot where the terminal used to be.

                        Comment


                        • #13
                          Eric - a possible hint: On Win10 the Window frame is extremely small, 1-2 pixels wide. On XP and Vista it looks like the frame around the PBCC editor. Or is that just a Win10 thing?

                          Comment


                          • #14
                            > I was feeling guilty to be bothering you again about
                            > a product that you are no longer making any income from.

                            Old buddy, please don't hesitate to contact me about an issue with one of my products. My goal has always been to stand behind them even after they are retired from active sale and (within practical limits) that includes new versions of Windows. I'm not aware of any other issues with Console Tools or Graphics Tools; I do have a short list of bug-fixes for SQL Tools, which I hope to address after Labor Day.

                            > I posted this question in the general PBCC Forum
                            > because I wasn't sure if it was PBCC or Contools/GFX

                            Understood, and it was a perfectly reasonable thing to do. I was just explaining why I didn't see your post right away.

                            > I spent 6 hours

                            All I can say is that you are probably working WAY to hard on finding the problem yourself. I really wish I could connect-up that old GT dev computer and look at this today, but I simply can't. I'll get to it ASAP.

                            > the Window frame is extremely small

                            Clues like that are appreciated, but I should already have everything I need to find the problem. Please don't flail at this until you hear back from me.



                            "Not my circus, not my monkeys."

                            Comment


                            • #15
                              Another hint - the initial console is about half the total screen width but I'm getting 1536 for ConsoleInfo(%SCREEN_WIDTH) , and 1458 for ConsoleInfo(%DESKTOP_WIDTH) . For Screen and Desktop Height, it returns the same value 864.

                              So maybe Win10 is delivering bad numbers and those are messing up the ConsoleGfx call.

                              Or maybe I have no idea and should stop bothering you while you think about it!

                              Comment


                              • #16
                                Just read your "don't flail" post. Roger that, < /flail >

                                Comment


                                • #17
                                  Hi Dan, I apologize for the LONG delay in getting to this. I experienced (ok, I caused) a multiple hardware failure before Labor Day, and I'm still trying to recover and catch up.

                                  > On Win10, the same EXE makes a black Console which covers the whole screen properly,
                                  > but its gray Graphic Window only covers about 80% of the Console,

                                  I'm not seeing that. I suspect that if you add a GfxRefresh before the WAITKEY$ you won't either but let me know.

                                  I do see a problem with the console resizing on Windows 10. For example on one of my Win10 systems, your program is requesting 87x271 (rows by cols) and Windows is changing the console size to 88x274. The amount of the error seems to vary depending on the console font; sometimes it gives me 86 instead of the requested 87, and sometimes it rounds the column count up to the next multiple of 10. Always even numbers. I tried replacing the relevant Console Tools functions with the PB/CC CON.SCREEN statement and it does exactly the same thing so it's not a ConTools or GfxTools problem. I don't know how you're going to get around that, unless you can find a console font that works predictably. You may be able to set the size and then check the size to see if you got a value that's close enough, and then re-do the re-size based that. Or maybe instead of calculating the size your program could contain a list of screen resolutions and use pre-selected, hard-coded row/col counts that work best for each screen size.

                                  The other problem I see is that the Windows 10 console does not have a dialog-sized border, as with all previous versions of Windows. That should be easy enough to patch; your code will need to detect the Windows Version and not subtract the ConsoleMetrics(%FRAME_WIDTH)*2 number from the calculation if Windows 10 is detected. (Or maybe Win8 or greater?) That alone might be enough to get you in the ballpark.

                                  FWIW, as far as I can tell none of this would have been affected by changing over to the native PB graphics and PBCC console statements.


                                  "Not my circus, not my monkeys."

                                  Comment


                                  • #18
                                    Hi Eric, Thanks - just got back from two busy weeks and saw your post. I'll give those ideas a try. Let you know. /Dan

                                    Comment


                                    • #19
                                      Also see https://forum.powerbasic.com/forum/u...e-resize-quirk
                                      "Not my circus, not my monkeys."

                                      Comment


                                      • #20
                                        Hi Eric. The GFXrefresh fixed the problem where the red line didn't go corner to corner, but didn't fix the problem where the Graphics Window only covers about 80% of the Console screen, leaving black bars to the right and bottom. I'll email you a screen shot.

                                        All I'm doing is starting the EXE, authorizing Contools, authorizing GFX, and doing lResult& = ConsoleGfx(0,0,0,0) . But the Graphics Window doesn't cover the whole Console.

                                        Comment

                                        Working...
                                        X