Page 1 of 2
[Implemented] Improve the input requester
Posted: Tue Jan 17, 2023 4:51 pm
by jacdelad
I recently started using two monitors and encountered some inconsistencies in my code beside some annoyances. One it that the input requester is always shown on the primary monitor. So I hereby declare it would be a good idea to add an optional parameter for a parent window, which is used for alignment. A parent window would also give us the possibility to set whether it shall get its own icon on the taskbar or not.
Also I'm aware that I can easy peasy build an own dialogue, which I certainly will. Maybe with some more customizations, maybe worth releasing it into the Tipps&Tricks-section, maybe not.
Re: Improve the input requester
Posted: Tue Jan 17, 2023 6:57 pm
by mk-soft
jacdelad wrote: Tue Jan 17, 2023 4:51 pm
Also I'm aware that I can easy peasy build an own dialogue, which I certainly will. Maybe with some more customizations, maybe worth releasing it into the Tipps&Tricks-section, maybe not.
Not worth it. There are already many ...
Re: Improve the input requester
Posted: Tue Jan 17, 2023 10:16 pm
by BarryG
jacdelad wrote: Tue Jan 17, 2023 4:51 pmI recently started using two monitors and encountered some inconsistencies in my code beside some annoyances. One it that the input requester is always shown on the primary monitor.
Just be aware that some users with multiple monitors actually
want that. I had a custom requester which I opened in the center of multi-monitors, and got negative (but polite) feedback from several people asking for an option to only show it on their main monitor. I even started a topic about it here recently (how to determine the primary monitor).
Re: Improve the input requester
Posted: Tue Jan 17, 2023 11:24 pm
by jacdelad
Oh ok.
Well, that's why I thought a few more options would be nice.
I'll simply create my own requesters, they'll suit me.
Thanks anyway.
Re: Improve the input requester
Posted: Wed Jan 18, 2023 6:15 am
by Rinzwind
It should indeed have an option to declare where it should be shown. Mainly primary monitor or the monitor that contains the active window. A simple quality of life improvement.
Re: Improve the input requester
Posted: Wed Jan 18, 2023 11:15 am
by BarryG
I agree that the request is valid, for sure. An optional parent window is a great idea. Just make that optional in your app for your users, is all I meant. Some will like it; some won't.
Re: Improve the input requester
Posted: Wed Jan 18, 2023 11:59 am
by Axolotl
+1 to all requesters.
I personally use different methods to center dialogs to there parent windows. Would be cool, if that could be done by optional parameter.
In multi-monitor settings, special attention must be paid to the margins. Dialogs should not be displayed on/over two monitors, because the middle is hidden by the monitor margins.
I therefore move the dialogs to the monitor on which the dialog would be displayed predominantly, when I would not intervene....
Only some spontaneous thoughts in addition.
Re: Improve the input requester
Posted: Wed Jan 18, 2023 12:33 pm
by BarryG
Axolotl wrote: Wed Jan 18, 2023 11:59 amDialogs should not be displayed on/over two monitors, because the middle is hidden by the monitor margins.
Huh? No, they're not. The dialog/window is always split evenly over two monitors, with no parts missing. I've never seen part of a dialog/window that isn't visible due to being shared over two monitors at once. If it is for you, then that sounds like a physical monitor display setting issue, rather than the OS hiding the middle of the dialog/window. Show me an example if I'm wrong, because I'd like to see this.
Re: Improve the input requester
Posted: Wed Jan 18, 2023 12:57 pm
by Axolotl
Arghh, sorry.
Of course no information (pixels) is missing.
What I was trying to write is, that it doesn't look nice when a messagebox is drawn over two monitors.
Re: Improve the input requester
Posted: Wed Jan 18, 2023 1:00 pm
by BarryG
Oh, right. I thought you were saying the middle of the dialog was getting cut out by being in the center of two monitors, and I was Googling to find how a monitor margin setting might be doing that. I can stop looking now! Hehe.
Re: Improve the input requester
Posted: Wed Jan 18, 2023 7:29 pm
by Tenaja
There is a case that can create missing pixels when the dialog is overlapping screens... If you have a laptop and a monitor (my laptop is my primary setup), and the resolution does not match. When I got my 4k monitor before I upgraded my laptop, i dealt with this issue when using both screens.
Re: Improve the input requester
Posted: Thu Apr 27, 2023 3:43 am
by Taz
BarryG wrote: Wed Jan 18, 2023 11:15 am
I agree that the request is valid, for sure. An optional parent window is a great idea...
+1
It's annoying the different behavior of the requesters.
situation; Main window is open on Monitor 2:
InputRequester always opens on main screen while MessageRequester opens on monitor 2.
When the main screen is off, the InputRequester opens on it, very stupid!
My opinion is that the requesters should always open on the monitor where the main window is open!
It would be nice if the behavior could be adjusted.
Re: Improve the input requester
Posted: Fri Dec 22, 2023 4:20 pm
by Fred
Implemented in 6.10
Re: [Implemented] Improve the input requester
Posted: Sat Dec 23, 2023 12:58 pm
by Axolotl
Thanks for the new feature.
Just tried, but....
There must be an additional flag or something I do not know?
Code: Select all
EnableExplicit
Enumeration EWindow 1 ; start with 1 (ZERO can be used for error detecting)
#WINDOW_Main
EndEnumeration
Enumeration EGadget 1 ; start with 1 (ZERO can be used for error detecting)
#GADGET_btnShowMessageRequester
#GADGET_btnShowInpuRequester
#GADGET_btnShowPathRequester
EndEnumeration
#Caption = "Test the new Requester Flags [???] "
Procedure CreateMainWindow()
If OpenWindow(#WINDOW_Main, 40, 40, 280, 120, #Caption, #PB_Window_SystemMenu)
ButtonGadget(#GADGET_btnShowMessageRequester, 8, 24, 160, 24, "Show Message Requesters ")
ButtonGadget(#GADGET_btnShowInpuRequester, 8, 48, 160, 24, "Show Input Requesters ")
ButtonGadget(#GADGET_btnShowPathRequester, 8, 72, 160, 24, "Show Path Requesters ")
EndIf
ProcedureReturn IsWindow(#WINDOW_Main) ; non-zero if valid window
EndProcedure
; --- main function ---------------------------------------------------------
Procedure main()
Protected tempStr.s
If CreateMainWindow()
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case #GADGET_btnShowMessageRequester
MessageRequester(#Caption, "No Parent Window." + #LF$ + "So this works as always.", #PB_MessageRequester_Info)
MessageRequester(#Caption, "With Parent Window." + #LF$ + "So this doesn't work as expected.", #PB_MessageRequester_Error, WindowID(#WINDOW_Main))
Case #GADGET_btnShowInpuRequester
tempStr = InputRequester(#Caption, "no parent window", "", 0)
tempStr = InputRequester(#Caption, "with parent window", "", 0, WindowID(#WINDOW_Main))
Case #GADGET_btnShowPathRequester
PathRequester(#Caption, GetTemporaryDirectory())
PathRequester(#Caption, GetTemporaryDirectory(), WindowID(#WINDOW_Main))
EndSelect
EndSelect
ForEver
EndIf
EndProcedure
End main()
Re: [Implemented] Improve the input requester
Posted: Sat Dec 23, 2023 1:23 pm
by Axolotl
I updated the code above...
Fun fact: The other requesters show up close to there parent windows without the new parameter!
Code: Select all
; ColorRequester()
; FontRequester()
; OpenFileRequester()
; SaveFileRequester()
I am pretty sure we need a small text with a brief description of the new parameters.
TIA.