Page 1 of 1

Rename String to Input

Posted: Wed Aug 21, 2013 1:26 am
by nblackburn
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

Posted: Wed Aug 21, 2013 1:40 am
by STARGĂ…TE
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.

Re: Rename String to Input

Posted: Thu Aug 22, 2013 12:05 pm
by PB
> "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).

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
Also, you really shouldn't request something that breaks all
existing code found on these forums and for everyone else.

Re: Rename String to Input

Posted: Fri Aug 23, 2013 3:33 pm
by Crusiatus Black
Nathanial, let's not make PB into AMS! :p /jk

Re: Rename String to Input

Posted: Sun Aug 25, 2013 10:46 am
by nblackburn
I have to say now I have spent more time with PB, I also think it sounds like a stupid idea, haha :P

P.S - AMS is generally pretty terrible for most things, why would I do that?

Re: Rename String to Input

Posted: Sun Aug 25, 2013 11:22 am
by Crusiatus Black
nblackburn wrote:I have to say now I have spent more time with PB, I also think it sounds like a stupid idea, haha :P

P.S - AMS is generally pretty terrible for most things, why would I do that?
Renaming it to Input is one step towards that... :p

Re: Rename String to Input

Posted: Sun Aug 25, 2013 2:03 pm
by BorisTheOld
nblackburn wrote:I have to say now I have spent more time with PB, I also think it sounds like a stupid idea, haha :P
Don't start thinking like that, otherwise you'll close your mind to perfectly valid coding solutions.

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
rather than:

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

Re: Rename String to Input

Posted: Sun Aug 25, 2013 2:07 pm
by luis
I like pizza.

Re: Rename String to Input

Posted: Sun Aug 25, 2013 2:19 pm
by BorisTheOld
luis wrote:I like pizza.
My food of choice is a Bedfordshire Clanger. :mrgreen:

Re: Rename String to Input

Posted: Sun Aug 25, 2013 2:19 pm
by ts-soft
luis wrote:I like pizza.
I like bratwurst with sauerkraut and salzkartoffeln :wink:

Re: Rename String to Input

Posted: Sun Aug 25, 2013 2:37 pm
by Crusiatus Black
ts-soft wrote:
luis wrote:I like pizza.
I like bratwurst with sauerkraut and salzkartoffeln :wink:
Kartoffelsalat, Sauerkraut und bratwurst oder currywurst. ^^

Re: Rename String to Input

Posted: Mon Aug 26, 2013 12:01 am
by nblackburn
BorisTheOld wrote:
nblackburn wrote:I have to say now I have spent more time with PB, I also think it sounds like a stupid idea, haha :P
Don't start thinking like that, otherwise you'll close your mind to perfectly valid coding solutions.
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. :wink:

Re: Rename String to Input

Posted: Mon Aug 26, 2013 12:28 am
by luis
@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

Re: Rename String to Input

Posted: Tue Aug 27, 2013 3:46 pm
by BorisTheOld
luis 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
+1 :wink:

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

Re: Rename String to Input

Posted: Sun Sep 01, 2013 9:14 pm
by blueznl
:lol: