Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Minimize and Maximize Problem

Author
Message
Sam
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location:
Posted: 23rd Jul 2011 16:49 Edited at: 23rd Jul 2011 16:55
Can someone help me understand why this code works:



And this one does not:



In the first code, the maximize command expands the window to inherit whatever the full screen aspect ratio is. This distorts the GUI on widescreen monitors.

With the second code, I would like to maximize the window and still retain the aspect ratio constraint. It works fine the first time I click the maximize/restore button. But if I try the minimize button even once and then try clicking the maximize/restore button a second time, it causes it to behave like the minimize button, why? It's like the minimize command did not end properly. Is this a bug?

Thanks everyone.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Jul 2011 22:20 Edited at: 24th Jul 2011 01:55
I see what you mean.

Could it be that you are using the same values for the MOUSEX and Y checks when you change the window size? Shouldn't they be different? Or have I misunderstood how it works?

Edit

On reflection, I don't see how that can explain it. Why should the behaviour change after clicking the red button?

Edit2

This seems to work as I think you intended - but I don't see why your second snippet works as it does. As you suggest, it sounds like a bug.

Sam
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location:
Posted: 24th Jul 2011 06:30
I see how you added the restore command in there. It's a good idea, but still not ideal. I see the window minimizing for no reason and then restoring (Not something you would expect professional software to do). And it's creating some unexpected behavior with the close button now (Although I am not able to reproduce it again). This is definitely a bug with the minimize command. It's unfortunate because now I am forced to make do with the first code snipped and write a whole lot more code to make my GUI redraw properly regardless of what the aspect ratio could be. Maybe TGC can look at fixing this bug.

Thanks,
Sam
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Jul 2011 12:59
Quote: "but still not ideal"


I agree.

It would be helpful if someone who knows about DBPro's Window handling could help clarify this situation. At the moment I'm not sure whether it's a bug or some side effect of the Windows Restore/maximize/minimize logic that we've missed.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 24th Jul 2011 13:31 Edited at: 24th Jul 2011 13:37
Try this, there is a small pause when clicking the green button though.


Edit - got rid of the pause

However, when I tried to implement the "sed windows position 0,0" bit it started to play up with the minimize so a possible bug could lie there.

Sam
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location:
Posted: 24th Jul 2011 16:56 Edited at: 24th Jul 2011 17:00
Well, we are definitively getting closer at having a great work around this bug. I was starting to think it had something to do with the re-positioning of the window as well. I even tried to write code in a few different ways, but no luck. I created a link to this forum thread from the Bug Reports form. Hopefully a mad scientist at TGC can help.

Thanks,
Sam
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 25th Jul 2011 06:40
It would appear DBP's MINIMIZE WINDOW command if setting an internal flag for the window style. Therefore any command such as SET WINDOW SIZE that uses that window style flag will minimize the window after MINIMIZE WINDOW has been called. What’s needed is a command to check if it has been restored. Then call RESTORE WINDOW to inform DBP of such. IanM's Matrix1Utils plugins collection has commands for this. Specifically #13.

Login to post a reply

Server time is: 2024-05-06 16:05:58
Your offset time is: 2024-05-06 16:05:58