BBC BASIC for Windows
« Multi Window problem. »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:56pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Multi Window problem.  (Read 431 times)
KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Multi Window problem.
« Thread started on: Sep 27th, 2015, 01:56am »

I'm not sure whether this should go here or under graphics, so please bear with me.

I have set up a program using MultiWin which creates up to 9 windows which I tile across the screen and in which I display text and/or graphics or pictures. To vary the display I want to temporarily enlarge one of the windows so that it occupies the area of several "tiles". However although "SetWindowPos" duly enlarges the window, the graphics remain confined to the area of the original window.

You can see the effect if you load in the example MULTIDEM program and add these lines just before the UNTIL FALSE line

IFN%=40THEN
SYS"BringWindowToTop",hw1%
SYS"SetWindowPos",hw1%,0,0,0,600,400,6
ENDIF

When N% reaches 40 the first window is brought to the front and enlarges, but the graphics remain constrained to the original window size.

What am I missing?

Thanks.
User IP Logged

sveinioslo
Developer

member is offline

Avatar




PM


Posts: 64
xx Re: Multi Window problem.
« Reply #1 on: Sep 27th, 2015, 8:01pm »

The bitmap is created/reserved with the size specified in FN_createwin, you can change the size of the window later, as you do.
But the bitmap defined is not affected by 'SetWindowPos' only the window.

Try this instead.
Code:
        IFN%=40THEN
          PROC_closewin(1)
          hw1% = FN_createwin(1, "Window one", 100, 100, 600, 400, 0, &96C00000, 0)
        ENDIF
 


Svein
User IP Logged

KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Multi Window problem.
« Reply #2 on: Sep 27th, 2015, 9:19pm »

Thanks. I was afraid that it might be something like that and that the "cure" would be to close and recreate the windows.

A trifle annoying.
User IP Logged

KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Multi Window problem.
« Reply #3 on: Sep 27th, 2015, 9:44pm »

Grrrrr. I might have known that it wouldn't be so simple. The trouble is that all these windows are borderless and when tiled the whole screen is black or whatever. I destroy the window, recreate it and then set it to borderless, but the border and the white background remain visible on the screen with the borderless window overlaid on top of it (and not quite covering it.

Add this to the MultiDem program to see what I mean.

IFN%=40THEN
PROC_closewin(1)
hw1% = FN_createwin(1, "Window one", 100, 100, 300, 200, 0, &96C00000, 0)
SYS"SetWindowLong",hw1%,-16,&16000000
PROC_selectwin(1)
COLOUR128:CLS
ENDIF
User IP Logged

Zaphod
Guest
xx Re: Multi Window problem.
« Reply #4 on: Sep 27th, 2015, 10:59pm »

I think you need to look at the manual on the topic of graphics view port. Changing the size of the window is a Microsoft thing, changing the size of the graphics view port is a BB4W thing. You need to do both!
User IP Logged

KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Multi Window problem.
« Reply #5 on: Sep 28th, 2015, 07:23am »

Well, the problem is (partly) sorted. Use the VDU23 command to set MODE after creating the window and the blue outline disappears, at the expense of a horrible flash of it while the MODE command is executed.

Another problem was that once set to large the other windows remained below it, even when the window was set back to small again, and no amount of bringing them to the top or setting the changed window to bottom would alter that. The only cure was to alter the order in which the windows were created. Whether that will produce other problems, time will tell, but I'm beginning to think that MultiWin may not be the answer for what I want to do.
User IP Logged

sveinioslo
Developer

member is offline

Avatar




PM


Posts: 64
xx Re: Multi Window problem.
« Reply #6 on: Sep 28th, 2015, 09:09am »

Is this somewhat closer to what you were trying to do ?

Code:
      INSTALL @lib$+"WINLIB5A"
      INSTALL @lib$+"MULTIWIN"

      PROC_multiwin(4)

      ON CLOSE PROCcleanup : QUIT
      ON ERROR ON ERROR OFF : PROCcleanup : PRINT 'REPORT$ : END

      hw1% = FN_createwin(1, "Window one", 100, 100, 600, 600, 0, &96C00000, 0)
      hw2% = FN_createwin(2, "Window two", 200, 200, 400, 300, 0, &96C00000, 0)
      hw3% = FN_createwin(3, "Window three", 300, 300, 400, 300, 0, &96C00000, 0)
      hw4% = FN_createwin(4, "Window four", 400, 400, 400, 300, 0, &96C00000, 0)

      PROC_selectwin(1)
      *FONT Ariel,12,B
      COLOUR 4
      PROC_selectwin(4)
      VDU 23,23,3;0;0;0;

      PROC_selectwin(1)
      SYS"SetWindowPos",hw1%,0,0,0,400,300,6
      VDU 26

      B%=0 : M%=0
      REPEAT
        WAIT 20
  
        PROC_selectwin(1)
        COLOUR RND(15)-1
        PRINT '"Hello world!";N%;
  
        PROC_selectwin(2)
        GCOL RND(15)-1
        RECTANGLE FILL RND(800),RND(600),RND(800),RND(600)
  
        PROC_selectwin(3)
        GCOL RND(15)-1
        CIRCLE FILL RND(800), RND(600), RND(200)
  
        PROC_selectwin(4)
        GCOL RND(15)-1
        DRAW RND(800), RND(600)
  
        PROC_selectwin(0)
        PRINT '"Main window "; N%;
        N% += 1
  
        IF N%-M%=30 THEN
          M%=N%
          CASE B% OF
            WHEN 0
              PROC_closewin(1)
              hw1% = FN_createwin(1, "No title", 100, 100, 600, 400, 0, &96400000, 0)
              B%=1
        
            WHEN 1
              PROC_selectwin(1)
              SYS"SetWindowPos",hw1%,0,0,0,300,200,6
              VDU 26 : REM CLS
              B%=2
        
            WHEN 2
              PROC_selectwin(1)
              SYS"SetWindowPos",hw1%,0,0,0,400,300,6
              VDU 26 : REM CLS
              B%=3
        
            WHEN 3
              PROC_selectwin(1)
              SYS"SetWindowPos",hw1%,0,0,0,500,400,6
              VDU 26 : REM CLS
              B%=4
        
            WHEN 4
              PROC_closewin(1)
              hw1% = FN_createwin(1, "New title of today "+TIME$, 100, 100, 400, 300, 0, &96C00000, 0)
              B%=0
          ENDCASE
        ENDIF
  
      UNTIL FALSE
      PROCcleanup
      END

      DEF PROCcleanup
      PROC_selectwin(0)
      PROC_closewin(1)
      PROC_closewin(2)
      PROC_closewin(3)
      PROC_closewin(4)
      ENDPROC
 


Svein
User IP Logged

KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Multi Window problem.
« Reply #7 on: Sep 28th, 2015, 4:21pm »

Gosh! I wish I were clever!!

I spent ages this morning studying the various flags on the Windos website and didn't find (or didn't recognise) anything useful - and I presume it is the &96400000 which makes the difference.

Thanks. I shall try incorporating that in my program and report on progress.
User IP Logged

KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Multi Window problem.
« Reply #8 on: Sep 28th, 2015, 6:21pm »

Even more clever than I thought! It had nothing to do with the flags and everything to do with creating the window with the desire maximum size and then reducing or enlarging it up to that maximum.

Everything is working nicely now.

All I have to work out now is why, when I set the program to run with just one window full screen, that window covers over the icon bar at the bottom of the screen. When I set it to have 4 or 9 windows, created in exactly the same way, the bottom row is partly hidden behind the icon bar.

Annoying.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls