Results 1 to 9 of 9

Thread: Window display and menu

  1. #1

    Window display and menu

    Hi,


    In my program I wanted to allow the user/player to optionally be able to turn off the window thinbasic menubar. (see pic menuON)


    The problem I get is when the menu is removed I lose the right vertical scrollbar and the statusbar is not re-shown correctly. (see pic menuOFF)


    However, If i resize the window physically by even a pixel with the mouse then the display snaps back to display all controls correctly - and the problem is gone! (see pic menuOK)


    Is there a way or how do I send a message event to the window callback routine to do this automatically by firing some kind of resize event that will trigger the desired effect and avoid the situation in pic menuOFF ?


    Thanks.
    catventure.


    PS. Same thing happens if I were to invoke maximize window with;


    win_show hwnd, %SW_MAXIMIZE


    I lose right vertical scrollbar and statusbar not positioned properly UNTIL I use mouse on window restore button - everything now OK!
    Attached Images Attached Images
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    I think your script does not adapt controls to some events, for example change of window client area.
    Have you tried to SendMessage a %WM_SIZE message to main window just after you hide menu?
    Last edited by ErosOlmi; 27-01-2018 at 05:32.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    I think the events that your main window receive when removing main menu, so the client area change, is %WM_NCCALCSIZE
    More info at:
    https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

    At receiving that events you should resize your controls over the window to adjust them to the new window client area.
    That's the idea I would follow.

    Let me know if it works.
    If it doesn't work I need to recreate a window similar the one you have (main menu, a rich edit, a statusbar) and try.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    Thanks Eros,
    I will try a few things today and let you know.
    catventure.
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Looking better to your images, I saw that in you menu off image in reality scrollbar is there but it seems that richedit control is sized too wide and scrollbar seems just outsize the client window.
    Because there is also space at the bottom, the idea is that maybe you inverted width with height when you remove menu.

    NoMenu.jpg
    Last edited by ErosOlmi; 28-01-2018 at 12:33.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6
    Quote Originally Posted by ErosOlmi View Post
    Looking better to your images, I saw that in you menu off image in reality scrollbar is there but it seems that richedit control is sized too wide and scrollbar seems just outsize the client window.
    Because there is also space at the bottom, the idea is that maybe you inverted width with height when you remove menu.

    NoMenu.jpg
    The weird thing I now found is that the controls and scrollbar display exactly as they should do every time these commands for turning on and off the menu are called as I wanted... but only AFTER the first menu off call and only if I've physically resized the window even just a fraction by hand to auto-correct the display as I showed in the pics. After that the menu on and menu off commands (and also maximize window too) works fine EVERY TIME when they are typed into the lower textbox.
    I'm slowly getting closer to a resolution. I'll check out the scrollbar issue you mentioned because that may be causing it...

    Regards,
    catventure.
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

  7. #7
    I finally got it working now
    Seems to be OK.
    I didn't change much at all - just made sure the menubar was properly attached and activated during initial display and anomaly just seemed now to go away.
    Thanks.
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

  8. #8

    Justin Langer

    You completed a number of nice points there. I did a search on the issue and found nearly all people will have the same opinion with your post.

  9. #9
    Quote Originally Posted by gaminglaptop View Post
    You completed a number of nice points there. I did a search on the issue and found nearly all people will have the same opinion with your post.
    Thanks. Yes - this works fine now in TAB text or graphic versions.
    The creator can allow the player to turn the menu on/off by using the TAB language "action" commands.

    All the menu options such as QUIT, RESTART, SAVE, LOAD, TRANSCRIPT ON/OFF, EXIT have equivalent text inputs that can be typed in by the player to achieve the same thing as the menu.

    Regards,
    catventure.

    men_off_demo.jpg
    Last edited by catventure; 10-05-2020 at 11:16.
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

Similar Threads

  1. Grid Cell Display Problem
    By gungadout in forum thinBasic General
    Replies: 19
    Last Post: 26-06-2011, 18:48
  2. Forum Display Problems
    By danbaron in forum Shout Box Area
    Replies: 13
    Last Post: 24-02-2011, 07:58
  3. display 2 textures
    By Lionheart008 in forum TBGL module by Petr Schreiber
    Replies: 2
    Last Post: 29-07-2009, 19:31
  4. Flexible display
    By ErosOlmi in forum Technology
    Replies: 1
    Last Post: 02-11-2008, 21:53

Members who have read this thread: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •