Code: Select all
Enumeration
#InputWindow = $FFF
#Input_str
#Input_txt
#Input_btn
EndEnumeration
Procedure.s InputRequesterEx(txt$, width.i=, height.i, Window.i=0)
If OpenWindow(#InputWindow, 0, 0, width, height, "MyWindow", #PB_Window_ScreenCentered|#PB_Window_SystemMenu,Window)
TextGadget(#Input_txt, 10, 10, width-20, 30, txt$)
StringGadget(#Input_str, 10, 40, width-20, 20, "")
ButtonGadget(#Input_btn, 135, 70, 60, 20, "OK")
SetActiveGadget(#Input_str)
AddKeyboardShortcut(#InputWindow, #PB_Shortcut_Return, 15)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_CloseWindow
Quit = 1
ElseIf Event = #PB_Event_Menu
If EventMenu() = 15
If GetActiveGadget() = #Input_str
Quit = 1
ProcedureReturn GetGadgetText(#Input_str)
EndIf
EndIf
ElseIf Event = #PB_Event_Gadget
If EventGadget() = #Input_btn
Quit = 1
ProcedureReturn GetGadgetText(#Input_str)
EndIf
EndIf
Until Quit = 1
EndIf
EndProcedure
Debug InputRequesterEx("Some multiline" + #LF$ + "text here.", 330, 100)