Page 1 of 1

#PB_Window_Modal

Posted: Wed Feb 22, 2006 1:33 am
by Straker
Pretty please?

[edit]
Oh yeah - and cross-platform.

Posted: Wed Feb 22, 2006 4:40 am
by USCode

Posted: Wed Feb 22, 2006 6:50 am
by Straker
Yeah I saw that thread. Can it be done in one line?

I don't want to start this debate again.... it has been done extensively already. Here is the psuedo-code I am looking for:

Code: Select all

OpenWindow(#Window_0,10,10,100,200,#PB_Window_Modal)
I don't know, but it seems easier to me.

Could just be me though.

Could just be all those braincells I lost in my youth.

Maybe I am just crazy....

Posted: Wed Feb 22, 2006 1:35 pm
by freak
Its a common feature in other languages. So maybe for a future version, why not.

Posted: Wed Feb 22, 2006 5:06 pm
by Straker
Thanks freak.

ShowWindow...

Posted: Wed Feb 22, 2006 6:50 pm
by USCode
:idea: Until it is a formal part of the language, seems like you could create the window as it is currently done and then create your own custom prodedures that encapsulate the DisableWindow, StickyWindow and SetActiveWindow calls to emulate displaying a modal window.

For example, maybe create a routine you could call
"ShowWindowModal(your_window_#)"
and that routine would make your window active with modal behavior.

Or even;

"ShowWindow(your_window_#, boolean)"
with the boolean parameter used to determine the window modality (whether to use DisableWindow or not). I believe Delphi and other languages work like that, determining their modality when the window is shown, not when it is created.

If I have some time I'll try and throw something together to demonstrate what I mean.

HTH

Posted: Wed Feb 22, 2006 7:24 pm
by Straker
Thanks USCode.

Yes, I am not opposed at all in writing my own functions to extend the language. I have done this many times anyway. This one just seems so obvious that it should be in the language.

In the meantime....

SetWindowModal(#Window_0)

Will do.

Thanks for the feedback.

Re: #PB_Window_Modal

Posted: Sat Feb 25, 2006 2:55 am
by PB
And also #PB_Window_ToolWindow would be nice, to avoid having to do it
later like this:

Code: Select all

SetWindowLong_(hWnd,#GWL_EXSTYLE,GetWindowLong_(hWnd,#GWL_EXSTYLE) | #WS_EX_TOOLWINDOW)

Re: #PB_Window_Modal

Posted: Sat Feb 25, 2006 5:39 am
by USCode
PB wrote:And also #PB_Window_ToolWindow would be nice
I haven't worked with it yet but would the new StickyWindow work here for you PB?

Re: #PB_Window_Modal

Posted: Sat Feb 25, 2006 5:44 am
by PB
> would the new StickyWindow work here

StickWindow <> ToolWindow. :)

StickWindow = Always on top -> SetWindowPos_(hWnd,#HWND_TOPMOST,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)
ToolWindow = Not in the Taskbar -> SetWindowLong_(hWnd,#GWL_EXSTYLE,GetWindowLong_(hWnd,#GWL_EXSTYLE)|#WS_EX_TOOLWINDOW)

Re: #PB_Window_Modal

Posted: Fri Mar 07, 2025 4:54 pm
by Axolotl
I came across this topic while browsing today.
From my point of view, this feature would be helpful. That's why I'm pulling it out of the depths of the forum. :oops:
Maybe this comment gives hope:
freak wrote: Wed Feb 22, 2006 1:35 pm Its a common feature in other languages. So maybe for a future version, why not.
BTW: I know about the "workarounds" -- and I am just working on my own.