Hello & Thanks ,
Two things I need to do:
1) How to make multi-line textGadget ?
I suspect it invloves CRLF but I don't know how code it .
2) What gadget to use to input a single line of text ?
I am used to a 'single line Edit' gadget , for things like
Name , Address , etc. .
It seems a waste to use a multiLine editor for one line of input .
What can I use ?
Thanks..vm
multi-line textGadget & single line text input ?
multi-line textGadget & single line text input ?
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: multi-line textGadget & single line text input ?
1. Create EditorGadget with #PB_Editor_ReadOnyl
2. It´s Stringgadget
2. It´s Stringgadget
Code: Select all
Enumeration FormWindow
#Window_0
EndEnumeration
Enumeration FormGadget
#Editor_0
#String_0
EndEnumeration
Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400)
OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu)
EditorGadget(#Editor_0, 10, 10, 580, 80, #PB_Editor_ReadOnly)
SetGadgetColor(#Editor_0, #PB_Gadget_BackColor,RGB(0,252,255))
StringGadget(#String_0, 10, 100, 580, 30, "")
EndProcedure
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: multi-line textGadget & single line text input ?
Hi vm. You're right about the #CRLF$ in text gadgets. And for inputting a single line of text, you could use a StringGadget(), as mk-soft had pointed out:vmars316 wrote:1) How to make multi-line textGadget ?
2) What gadget to use to input a single line of text ?
I am used to a 'single line Edit' gadget...
It seems a waste to use a multiLine editor for one line of input .
Code: Select all
Enumeration
#MainWindow
#text1
#text2
#string1
EndEnumeration
LoadFont(0, "Arial", 14)
SetGadgetFont(#PB_Default, FontID(0))
wFlags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
OpenWindow(#MainWindow, 10, 10, 430, 280, "PureBasic String Gadgets", wFlags)
TextGadget(#text1, 10, 10, 200, 200, "Text gadgets are multi-line by default. " +
"They will wrap the text automatically " +
"to fit their widths - but not heights...")
tgStr$ = "But, you can use" + #CRLF$ + "the #CRLF$" + #CRLF$ + "to break" + #CRLF$ +
"the lines" + #CRLF$ + "wherever" + #CRLF$ + "you" + #CRLF$ + "wish..."
TextGadget(#text2, 220, 10, 200, 200, tgStr$)
StringGadget(#string1, 10, 220, 410, 50, "This is a single-line input gadget...")
SetGadgetColor(#text1, #PB_Gadget_BackColor, RGB(0, 252, 255))
SetGadgetColor(#text2, #PB_Gadget_BackColor, RGB(255, 0, 255))
While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend

Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: multi-line textGadget & single line text input ?
I did not even realize that the text gadget wordwrap and multiline can.
From which version it was changed because.
From which version it was changed because.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: multi-line textGadget & single line text input ?
Thanks Folks .
Exactly what I needed !
..vm
Exactly what I needed !
..vm
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."