Rename String to Input
- nblackburn
- User
- Posts: 67
- Joined: Mon Aug 19, 2013 1:22 am
- Location: United Kingdom
- Contact:
Rename String to Input
Rename the String gadget to Input as a string cannot be a control as it is traditionally a sequence of characters.
Re: Rename String to Input
against!
"String" is the name of content of the gadget, like ImageGadget, DateGadget, TreeGadget, ...
In all gadgets you can input something, like values or events.
"String" is the name of content of the gadget, like ImageGadget, DateGadget, TreeGadget, ...
In all gadgets you can input something, like values or events.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: Rename String to Input
> "String" is the name of content of the gadget, like
> ImageGadget, DateGadget, TreeGadget
Good rationalization.
nblackburn, PureBasic has macros for what you want. Macros
let you alter the language to what YOU desire. You can create
a macro to rename the StringGadget as easily as the below.
(Note: I've removed the Flags parameter for this demo).
Also, you really shouldn't request something that breaks all
existing code found on these forums and for everyone else.
> ImageGadget, DateGadget, TreeGadget
Good rationalization.

nblackburn, PureBasic has macros for what you want. Macros
let you alter the language to what YOU desire. You can create
a macro to rename the StringGadget as easily as the below.
(Note: I've removed the Flags parameter for this demo).
Code: Select all
Macro InputGadget(Gadget, x, y, Width, Height, Content)
StringGadget(Gadget, x, y, Width, Height, Content)
EndMacro
OpenWindow(0,100,100,300,100,"test")
InputGadget(0,20,20,200,20,"This is an InputGadget!")
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
existing code found on these forums and for everyone else.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
- Crusiatus Black
- Enthusiast
- Posts: 389
- Joined: Mon May 12, 2008 1:25 pm
- Location: The Netherlands
- Contact:
Re: Rename String to Input
Nathanial, let's not make PB into AMS! :p /jk
- nblackburn
- User
- Posts: 67
- Joined: Mon Aug 19, 2013 1:22 am
- Location: United Kingdom
- Contact:
Re: Rename String to Input
I have to say now I have spent more time with PB, I also think it sounds like a stupid idea, haha 
P.S - AMS is generally pretty terrible for most things, why would I do that?

P.S - AMS is generally pretty terrible for most things, why would I do that?
- Crusiatus Black
- Enthusiast
- Posts: 389
- Joined: Mon May 12, 2008 1:25 pm
- Location: The Netherlands
- Contact:
Re: Rename String to Input
Renaming it to Input is one step towards that... :pnblackburn wrote:I have to say now I have spent more time with PB, I also think it sounds like a stupid idea, haha
P.S - AMS is generally pretty terrible for most things, why would I do that?
-
- Enthusiast
- Posts: 542
- Joined: Tue Apr 24, 2012 5:08 pm
- Location: Ontario, Canada
Re: Rename String to Input
Don't start thinking like that, otherwise you'll close your mind to perfectly valid coding solutions.nblackburn wrote:I have to say now I have spent more time with PB, I also think it sounds like a stupid idea, haha
PB is a powerful language that can be made to do things that "can't" be done. But it also has its limitations, so don't be afraid to push its limits if you feel that something isn't as it should be.
Macros are my preferred weapon of choice.
For example, I prefer to write:
Code: Select all
PrivateSubroutine(DvsML06, DD2765Attach) (ByVal(Me, strDvsML06))
If NotObject(Me\proPanelDD2765)
Me\proPanelDD2765 = CreateObject(PanelItem)
Set(Me\proPanelDD2765, exoParent, Me\proAppPanel)
Set(Me\proPanelDD2765, exsTabText, "Structures")
SetCallBack(Me\proPanelDD2765, expCBDesign, DvsML06, DD2765Design)
ObjectCall(Me\proPanelDD2765, Build) ()
Else
ObjectCall(Me\proPanelDD2765, Show) ()
EndIf
EndSubroutine
Code: Select all
Procedure clsDvsML06_subDD2765Attach (*Self.strDvsML06)
If *Self\proPanelDD2765 = 0
*Self\proPanelDD2765 = clsPanelItem_funCreate()
*Self\proPanelDD2765\setexoParent(*Self\proAppPanel)
*Self\proPanelDD2765\setexsTabText("Structures")
*Self\proPanelDD2765\setexpCBDesign(1, @clsDvsML06_subDD2765Design())
*Self\proPanelDD2765\setexpCBDesign(2, *Self)
*Self\proPanelDD2765\subBuild ()
Else
*Self\proPanelDD2765\subShow ()
EndIf
EndProcedure
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
~ Spike Milligan
Re: Rename String to Input
I like pizza.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
-
- Enthusiast
- Posts: 542
- Joined: Tue Apr 24, 2012 5:08 pm
- Location: Ontario, Canada
Re: Rename String to Input
My food of choice is a Bedfordshire Clanger.luis wrote:I like pizza.

For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
~ Spike Milligan
Re: Rename String to Input
I like bratwurst with sauerkraut and salzkartoffelnluis wrote:I like pizza.

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

- Crusiatus Black
- Enthusiast
- Posts: 389
- Joined: Mon May 12, 2008 1:25 pm
- Location: The Netherlands
- Contact:
Re: Rename String to Input
Kartoffelsalat, Sauerkraut und bratwurst oder currywurst. ^^ts-soft wrote:I like bratwurst with sauerkraut and salzkartoffelnluis wrote:I like pizza.
- nblackburn
- User
- Posts: 67
- Joined: Mon Aug 19, 2013 1:22 am
- Location: United Kingdom
- Contact:
Re: Rename String to Input
I haven't started to think like that at all don't worry, just on this occasion just after careful consideration I feel it makes sense they way it is and that it doesn't need to be changed.BorisTheOld wrote:Don't start thinking like that, otherwise you'll close your mind to perfectly valid coding solutions.nblackburn wrote:I have to say now I have spent more time with PB, I also think it sounds like a stupid idea, haha

Last edited by nblackburn on Mon Aug 26, 2013 2:04 am, edited 4 times in total.
Re: Rename String to Input
@nblackburn and to everyone interested really... a TIP
You can just use:
@BorisTheOld
instead of re-quoting his post entirely. Very rarely is needed.
This tip is especially directed to people quoting sometimes a 1+ screen long code to say "Nice!"
This is not just something cosmetic, or to save disk space, it also simplify forum's searches avoiding redundant results.
It's also logical IMHO (in a programmers' forum should be something cherished I hope).
To QUOTE is different from I_JUST_REPEAT_ALL_YOU_JUST_SAID_BEFORE_REPLYING_TO_YOU.
Would you do that in real life ?
*SIGH*
http://www.purebasic.fr/english/viewtop ... 66#p422866
http://www.purebasic.fr/english/viewtop ... 60#p422860
You can just use:
@BorisTheOld
instead of re-quoting his post entirely. Very rarely is needed.
This tip is especially directed to people quoting sometimes a 1+ screen long code to say "Nice!"
This is not just something cosmetic, or to save disk space, it also simplify forum's searches avoiding redundant results.
It's also logical IMHO (in a programmers' forum should be something cherished I hope).
To QUOTE is different from I_JUST_REPEAT_ALL_YOU_JUST_SAID_BEFORE_REPLYING_TO_YOU.
Would you do that in real life ?
*SIGH*
http://www.purebasic.fr/english/viewtop ... 66#p422866
http://www.purebasic.fr/english/viewtop ... 60#p422860
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
-
- Enthusiast
- Posts: 542
- Joined: Tue Apr 24, 2012 5:08 pm
- Location: Ontario, Canada
Re: Rename String to Input
+1luis wrote:@nblackburn and to everyone interested really... a TIP
You can just use:
@BorisTheOld
instead of re-quoting his post entirely. Very rarely is needed.
This tip is especially directed to people quoting sometimes a 1+ screen long code to say "Nice!"
This is not just something cosmetic, or to save disk space, it also simplify forum's searches avoiding redundant results.
It's also logical IMHO (in a programmers' forum should be something cherished I hope).
To QUOTE is different from I_JUST_REPEAT_ALL_YOU_JUST_SAID_BEFORE_REPLYING_TO_YOU.
Would you do that in real life ?
*SIGH*
http://www.purebasic.fr/english/viewtop ... 66#p422866
http://www.purebasic.fr/english/viewtop ... 60#p422860

And of course, anyone who quotes any of my long obtuse posts deserves to get flamed.

For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
~ Spike Milligan
Re: Rename String to Input

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )