View Full Version : Window display and menu
catventure
26-01-2018, 18:37
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!
ErosOlmi
26-01-2018, 23:07
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?
ErosOlmi
27-01-2018, 05:47
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/library/windows/desktop/ms632634(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
catventure
27-01-2018, 14:03
Thanks Eros,
I will try a few things today and let you know.
catventure.
ErosOlmi
28-01-2018, 11:20
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.
9803
catventure
28-01-2018, 13:35
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.
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.
catventure
28-01-2018, 16:56
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.
gaminglaptop
10-05-2020, 04:34
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. (https://letmebest.com/best-gaming-laptop-under-600/)
catventure
10-05-2020, 11:07
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. (https://letmebest.com/best-gaming-laptop-under-600/)
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.
10214