Results 1 to 7 of 7

Thread: Window display and menu

  1. #1
    Senior Member catventure's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    587
    Blog Entries
    1
    Rep Power
    71

    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 Thumbnails Attached Thumbnails Click image for larger version. 

Name:	menuON.jpg 
Views:	36 
Size:	82.9 KB 
ID:	9800   Click image for larger version. 

Name:	menuOFF.jpg 
Views:	34 
Size:	91.0 KB 
ID:	9801   Click image for larger version. 

Name:	menuOK.jpg 
Views:	32 
Size:	87.9 KB 
ID:	9802  
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)
    TAB Forum - http://adventure.rpgdynasty.com/
    TAB Email Group - http://tech.groups.yahoo.com/group/TAB_IF_CREATOR/

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,321
    Blog Entries
    2
    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/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,321
    Blog Entries
    2
    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/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  4. #4
    Senior Member catventure's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    587
    Blog Entries
    1
    Rep Power
    71
    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)
    TAB Forum - http://adventure.rpgdynasty.com/
    TAB Email Group - http://tech.groups.yahoo.com/group/TAB_IF_CREATOR/

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,321
    Blog Entries
    2
    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.

    Click image for larger version. 

Name:	NoMenu.jpg 
Views:	32 
Size:	67.0 KB 
ID:	9803
    Last edited by ErosOlmi; 28-01-2018 at 12:33.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  6. #6
    Senior Member catventure's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    587
    Blog Entries
    1
    Rep Power
    71
    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.

    Click image for larger version. 

Name:	NoMenu.jpg 
Views:	32 
Size:	67.0 KB 
ID:	9803
    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)
    TAB Forum - http://adventure.rpgdynasty.com/
    TAB Email Group - http://tech.groups.yahoo.com/group/TAB_IF_CREATOR/

  7. #7
    Senior Member catventure's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    587
    Blog Entries
    1
    Rep Power
    71
    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)
    TAB Forum - http://adventure.rpgdynasty.com/
    TAB Email Group - http://tech.groups.yahoo.com/group/TAB_IF_CREATOR/

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

Posting Permissions

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