Set Lisp Symbol Names and Clear Lisp Symbol Names

Started by Kelie, June 10, 2009, 04:20:12 PM

Previous topic - Next topic

Kelie

What do they do? I see the "VarName" in Property Palette being changed. But anything else happens behind the scene? It does not modify the associated lisp files, does it? When are you supposed use Set Lisp Symbol Names and Clear Lisp Symbol Names? Thanks.

BazzaCAD

They are there for legacy code.
No they don't modify the LSP code.
Legacy code used to only be able to use the "VarName" property to refer to a control. Now OpenDCL figures it out at runtime, based on the Project name_Form name_Control name. So the "VarName" property isn't used for new project files.
If you want to convert old code to the new method, you can use the "Clear" tool.
And if you want new projects to use the old method (for some strange reason) you'd use the "Set" tool.

That remands me, Owen can we hide the "VarName" property for new projects & only show it when it's set? (to avoid confusion)
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Kelie


owenwengerd

I think Fred uses the VarName property extensively, even in new projects, to create custom symbol names that suit his tastes and naming convention. I could easily mark it as a hidden property, but I don't think that would be popular among some of the old timers.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

No no no  :o :o :o please, please, please, please, keep it urgently, please. Not because of legacy code but it makes me coding new code much, much, much faster. It would mean horror to me.

I do ask myself everyday how do others have access to the controls if the VarName property isn't filled automatically. I can't really imagine that they copy each accessing line from the control browser  ???

Mostly, I write my code by hand and only if I'm unsure about new arguments then I copy it from the control browser.

Event function names won't be changed. And that's correct. In some cases (also already dicussed in the forum) some events may call the same event function by design. But it's worth to discuss about optionally replacing old varname with new varname in the event function names if the old name is a part of the event name.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

BazzaCAD

Calm down Fred. :)  I wasn't suggesting getting read of it, just hiding it for new users.

I have one last suggestion, if you both don't like it, then I'll drop it.
How about making it an option in the Studio? Anther check mark menu item under the Tools pull-down like "Copy Events to Clipboard". It could say something like "Show (VarName) Property" and would be OFF by default. It would be a system setting, so Fred (or other old timers) would only have to enable it once...

Just a thought.  ;D
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Fred Tomke

Sorry for the long delay until I could answer. Was in hospital 'cause of a heart attack because of being frightened losing my lovely VarName property ;).

No, let's be serious now:

The only reason why I use the VarName property now is to copy it to clipboard, because I'm too lazy to call the control browser each time only to copy the automatically generated VarName into clipboard. How could we solve this? Indeed, I would clear my VarName values, too, if there would be a simplier solution than (or as simple as) copy the content of VarName into clipboard! Maybe I miss something for years!

I do not override VarName content, in fact, in some cases I override event function names. I always remove the "_OnClicked"-suffix from Imagebuttons, Textbuttons, OptionButtons, Checkboxes, cause I only activate this event at these controls. In some cases I use one event name for different controls. But these are exceptions. Barry you are right, automatic copy into clipboard at the time of activating an event could be a helpful option.

Let's add it as a feature request!

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Kerry


I do the same as Fred .. Have VarNames ON and Select/Copy the name to post into code.

.. OLD habit I guess ( for us OLD guys )  :P Barry
Perfection is not optional.
My other home is TheSwamp

owenwengerd

I'm all for eliminating any extra work. I'm inclined to leave the VarName property editable as it is now, but anything that eliminates the need to override it for convenience would be a good improvement, I think.
Owen Wengerd (Outside The Box) / ManuSoft

Kelie

Quote from: Fred Tomke on June 11, 2009, 12:52:31 AM
I do ask myself everyday how do others have access to the controls if the VarName property isn't filled automatically.

Fred, do you mean there is a function that will return a control based on its name? What is the function? I only found dcl_Form_GetControls which returns all the controls on a form. Thanks.

Fred Tomke

#10
QuoteFred, do you mean there is a function that will return a control based on its name?

Kelie, no, I don't mean this. I mean, when I'm painting my form and I'm coding at the same time then I want to have the VarName in clipboard to add additional (accessing) lines in my source code files. At this time I call "Set Lisp Symbol Names" at first to copy the VarName value from the property's pane into my lisp file. In most of the cases I have the needed dcl_control_...-functions in mind and then I paste the VarName into the VLISP editor. The "nice-to-have" I mean is a command in the context menu that the VarName of the currently selected control or form can be copied as text into clipboard to fasten the coding process and to avoid that the VarName property must be filled before.

I hope it was a little understandable.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

BazzaCAD

#11
It sounds like the guys are only using the VarNames because they need an easy way to copy the control name to the clipboard.... (Am I right guys?)

When you select a control it's full name is shown in the status bar across the bottom, but you can't copy it.
How about adding something to do so... Maybe clicking on the status bar, or a button on the status bar, a new button in the properties panel, or a new toolbar button... Just a few ideas.
I'm open to suggestions, but I do see their point. I have found myself opening the control browser just to copy a controls name or copying it out of the Event field.
So I think something like this would make things more efficient.
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Jim Short

Quote from: Fred Tomke on June 12, 2009, 04:45:03 AM
QuoteFred, do you mean there is a function that will return a control based on its name?

Kelie, no, I don't mean this. I mean, when I'm painting my form and I'm coding at the same time then I want to have the VarName in clipboard to add additional (accessing) lines in my source code files. At this time I call "Set Lisp Symbol Names" at first to copy the VarName value from the property's pane into my lisp file. In most of the cases I have the needed dcl_control_...-functions in mind and then I paste the VarName into the VLISP editor. The "nice-to-have" I mean is a command in the context menu that the VarName of the currently selected control or form can be copied as text into clipboard to fasten the coding process and to avoid that the VarName property must be filled before.

I hope it was a little understandable.
Fred

Fred, Can you please explain how this works: At this time I call "Set Lisp Symbol Names"
Jim Short