Page 1 of 1

Posted: Mon Jun 10, 2002 9:03 am
by BackupUser
Restored from previous forum. Originally posted by fweil.

I used to check EventType() = #PB_EventType_ReturnKey like in the following example to make input string gadget in my programs. The example program allows to look all events types in the debugger.

It seems that it does not respond like before using the 3.20.

Do I use it bad ?

;*******************************************
Quit.w

WEvent.l
GEvent.l
MEvent.l
TEvent.l
IEvent.l

UserInput.s

Quit = #FALSE

If OpenWindow(0, 0, 0, 320 + 20 , 240 + 20 , #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar, "")

CreateMenu(0, WindowID())
MenuItem(9, "Quit")
CreateGadgetList(WindowID())
StringGadget(10, 10, 10, 300, 20, "input gadget", #PB_String_BorderLess)
ButtonGadget(18, 220, 210, 40, 20, "OK")
ButtonGadget(19, 270, 210, 40, 20, "Quit")

Repeat
WEvent = WaitWindowEvent()
GEvent = EventGadgetID()
MEvent = EventMenuID()
TEvent = EventType()
IEvent = EventWindowID()

If GEvent = 10 And TEvent = #PB_EventType_ReturnKey
UserInput = GetGadgetText(10)
EndIf

If GEvent = 18
UserInput = GetGadgetText(10)
endif

If GEvent = 19
Quit = #TRUE
EndIf

If MEvent = 9
Quit = #TRUE
EndIf

If WEvent = #PB_EventCloseWindow
QUit = #TRUE
EndIf

Until Quit

EndIf

End
;*******************************************


Francois Weil
14, rue Douer
F64100 Bayonne

Posted: Mon Jun 10, 2002 9:18 am
by BackupUser
Restored from previous forum. Originally posted by fred.

That's true, this event was returned with a MutliLine string gadget. You can add the #PB_String_MultiLine flags if you absolutely need it. Anyway, better use keyboard shortcuts (AddKeyboardShortcut(Window, #PB_Shortcut_Return)) now...

Fred - AlphaSND

Posted: Mon Jun 10, 2002 9:23 am
by BackupUser
Restored from previous forum. Originally posted by fweil.

Correct Fred ... addkeyboardshortcut ! I was not there

Anyway congrats for this new release. It seems to make few updates in my sources and have lots of interesting adds.


Francois Weil
14, rue Douer
F64100 Bayonne