StringGadget()
Syntax
Result = StringGadget(#Gadget, x, y, Width, Height, Content$ [, Flags])Description
Creates a String gadget in the current GadgetList. If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. #Gadget will be the number returned by EventGadget() command. 'Content$' specifies the initial content of this StringGadget. This gadget accepts only one line of text. To get multiline input, use the EditorGadget() command.
'Flags' are always optional and can be composed (using the '|' OR operator) of one of the following constants:#PB_String_Numeric : Only (positive) integer numbers are accepted. #PB_String_Password : Password mode, displaying only '*' instead of normal characters. #PB_String_ReadOnly : Read only mode. No text can be entered. #PB_String_LowerCase : All characters are converted to lower case automatically. #PB_String_UpperCase : All characters are converted to upper case automatically. #PB_String_BorderLess : No borders are drawn around the gadget.Later the content can be changed with SetGadgetText() and received with GetGadgetText().
The following events are supported through EventType():#PB_EventType_Change : The text has been modified by the user. #PB_EventType_Focus : The StringGadget got the focus. #PB_EventType_LostFocus : The StringGadget lost the focus.This gadget supports the SetGadgetColor() and GetGadgetColor() commands with the following values as 'ColorType':#PB_Gadget_FrontColor: Textcolor #PB_Gadget_BackColor : BackgroundcolorYou can add a 'mini help' to this gadget by using GadgetToolTip().
Example:; Shows possible flags of StringGadget in action... If OpenWindow(0, 0, 0, 322, 205, "StringGadget Flags", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) StringGadget(0, 8, 10, 306, 20, "Normal StringGadget...") StringGadget(1, 8, 35, 306, 20, "1234567", #PB_String_Numeric) StringGadget(2, 8, 60, 306, 20, "Readonly StringGadget", #PB_String_ReadOnly) StringGadget(3, 8, 85, 306, 20, "lowercase...", #PB_String_LowerCase) StringGadget(4, 8, 110, 306, 20, "uppercase...", #PB_String_UpperCase) StringGadget(5, 8, 140, 306, 20, "Borderless StringGadget", #PB_String_BorderLess) StringGadget(6, 8, 170, 306, 20, "Password", #PB_String_Password) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf
Supported OS
All