Lines that can be redefined

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Locked
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Lines that can be redefined

Post by dpayer »

I can think of many uses for a line that can be redrawn based on coordinates. Currently we can get the LEFT/TOP/HEIGHT of a line and we can move that line as originally defined to a new location. We can also change the color, width, height and arrow attributes.

It would be very useful to have new capabilities to set the starting point and ending point location (defined in pixels from the 0,0 upper left point of the app) as well.

With this type of functionality, we could use lines for: bar graphs, progress bars, vumeters, analog clock hands, versatile indictators and more.

I thought of this as I was doing an exercise to create a rotating dial using only NB objects. I wanted to use a line as an arrow to point to the values and redraw the line around an axis as the mouse moved but it is currently not possible with NB line objects in their current form.

Example of proposed usage:

setLINEobject "Line1" "X1,Y1" "X2,Y2"

Image
David Payer
Des Moines, Iowa
USA
mishem
Posts: 581
Joined: Mon Oct 08, 2012 1:51 pm

Re: Lines that can be redefined

Post by mishem »

If you suddenly need to watch NB look at this plugin.

or download
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: Lines that can be redefined

Post by Gaev »

David P:

I am not sure what you are asking here.

If you want to be able to "create Line objects at run time via script" ... yes, the ability to "create all objects at run time" has been a long standing request of mine.

But if by "redefined" (as in your topic title), you mean ... just reposition and resize it in a single NeoBook command ... this could be achieved by defining a Function that you Call ... the function could do the necessary calculations for SIzeObject ... and then invoke the MoveObject and SizeObject commands ... the style, color and thickness of the line can be requested in the same Call ... am i missing something ?
mishem
Posts: 581
Joined: Mon Oct 08, 2012 1:51 pm

Re: Lines that can be redefined

Post by mishem »

I think he means not to move, and rotate the object.
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Lines that can be redefined

Post by dpayer »

Gaev wrote:David P:

I am not sure what you are asking here.

If you want to be able to "create Line objects at run time via script" ... yes, the ability to "create all objects at run time" has been a long standing request of mine.

But if by "redefined" (as in your topic title), you mean ... just reposition and resize it in a single NeoBook command ... this could be achieved by defining a Function that you Call ... the function could do the necessary calculations for SIzeObject ... and then invoke the MoveObject and SizeObject commands ... the style, color and thickness of the line can be requested in the same Call ... am i missing something ?
Gaev, I don't want to create something at runtime. I understand that limit.

Try to create a line in NB. Then have that line remain the same length and have it change its direction based on a function. You can make the line "wider" but it will not retain the same length.

Here is a sample app: (create new blank 800x600 app - copy / paste this code into it)
It allows you to adjust all available settings for a line's dimensions. Left, Width, Top, Height

I think I see a possible workaround for this. It involves doing a trigonometric function for each move but there appears to be some odd fluxuation of 'direction' (as indicated by arrow point) when moves are made. Also transitioning from one "quadrant" of change to another will involve some significant trig operations to retain same length of line with one point remaining constant.

Code: Select all

{NeoBook 5 Objects}
NeoBookVer=5.80
ObjectType=7
Name=Line1
X1=327
Y1=138
X2=330
Y2=412
EndCaps=1
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=3
ObjectType=16
Name=TrackBar1
X=470
Y=524
W=266
H=26
Anchor=0
Align=0
VarName=[top]
Min=-200
Max=200
InitState=137
ThumbSize=10
TrackSize=3
ObjAction=MoveObject "Line1" "[left]" "[top]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=4
ObjectType=8
Name=Text1
X=747
Y=524
W=29
H=24
Anchor=0
Font=Trebuchet MS
FontSize=9
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Trebuchet MS;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Top}}}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=5
ObjectType=16
Name=TrackBar2
X=470
Y=557
W=266
H=26
Anchor=0
Align=0
VarName=[height]
Min=-300
Max=300
InitState=200
ThumbSize=10
TrackSize=3
ObjAction=SizeObject "Line1" "[width]" "[height]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=6
ObjectType=8
Name=Text2
X=747
Y=553
W=39
H=24
Anchor=0
Font=Trebuchet MS
FontSize=9
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Trebuchet MS;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Height}}}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=7
ObjectType=16
Name=TrackBar3
X=470
Y=494
W=266
H=26
Anchor=0
Align=0
VarName=[width]
Min=-200
Max=200
InitState=8
ThumbSize=10
TrackSize=3
ObjAction=SizeObject "Line1" "[width]" "[height]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=8
ObjectType=8
Name=Text3
X=747
Y=494
W=40
H=24
Anchor=0
Font=Trebuchet MS
FontSize=9
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Trebuchet MS;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Width}}}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=9
ObjectType=16
Name=TrackBar4
X=469
Y=462
W=266
H=26
Anchor=0
Align=0
VarName=[left]
Min=-400
Max=400
InitState=323
ThumbSize=10
TrackSize=3
ObjAction=MoveObject "Line1" "[left]" "[top]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=10
ObjectType=8
Name=Text4
X=747
Y=457
W=40
H=24
Anchor=0
Font=Trebuchet MS
FontSize=9
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Trebuchet MS;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Left}}}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=11
Change of 'height' can change directionality, as can width. At certain points, the line appears to 'flip' as one of the values is incremented.

Image
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Lines that can be redefined

Post by dpayer »

mishem wrote:If you suddenly need to watch NB look at this plugin.

or download

Thank you for the information. I downloaded and installed this plugin on my system (win7) but the demo app doesn't seem to run properly.

I tried to get the caption of the button to do a translation to see what it is supposed to do and the characters I see inside of NB for the top button is not the same as displays on the button and the one I can get does not translate via Google. I am sure it is a character code issue but I don't know how to address it.

Image
Image
David Payer
Des Moines, Iowa
USA
mishem
Posts: 581
Joined: Mon Oct 08, 2012 1:51 pm

Re: Lines that can be redefined

Post by mishem »

I apologize. I did not see that the image files are laid below the post.

download files and put in a folder with the project.

I have a HP and plug-in works.
With the mark of the characters in the seven problem. Try to change the font properties for the button mark symbols. There, the idea is Cyrillic.
The top button Create. Lower the Disconnect button.
:)
User avatar
Garic
Posts: 107
Joined: Wed Sep 26, 2012 8:42 am

Re: Lines that can be redefined

Post by Garic »

dpayer wrote:I can think of many uses for a line that can be redrawn based on coordinates. Currently we can get the LEFT/TOP/HEIGHT of a line and we can move that line as originally defined to a new location. We can also change the color, width, height and arrow attributes.

It would be very useful to have new capabilities to set the starting point and ending point location (defined in pixels from the 0,0 upper left point of the app) as well.

With this type of functionality, we could use lines for: bar graphs, progress bars, vumeters, analog clock hands, versatile indictators and more.

I thought of this as I was doing an exercise to create a rotating dial using only NB objects. I wanted to use a line as an arrow to point to the values and redraw the line around an axis as the mouse moved but it is currently not possible with NB line objects in their current form.
I worked over creation of a similar plug-in and already there are certain results, but unfortunately I have not enough time to finish work.
In the future I will try to finish a plug-in, and can Dave will add these additional possibilities in following version NB.

Example on the basis of a plug-in:
Image
Image
Image

http://my-files.ru/f866.ksFreeLine_Test.rar
Last edited by Garic on Fri Aug 30, 2013 9:21 am, edited 1 time in total.
ks
.............
Image
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: Lines that can be redefined

Post by David de Argentina »

Image

Very nice sample !
Are there any way to set the background color for transparency ?

Thanks in advance,
David de Argentina
User avatar
Garic
Posts: 107
Joined: Wed Sep 26, 2012 8:42 am

Re: Lines that can be redefined

Post by Garic »

David de Argentina wrote: Are there any way to set the background color for transparency ?
Directly to make a transparent background it will not turn out, only if in advance to copy area under rectangle and to insert into the image with a dial.
ks
.............
Image
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: Lines that can be redefined

Post by David de Argentina »

Another question:

I need put 4 clocks into a program.
Each clock has different time zone (Buenos Aires, New York, London & Moscow)
Are there any way to set the time for each clock manually ?

Thanks in advance,
David de Argentina
User avatar
Garic
Posts: 107
Joined: Wed Sep 26, 2012 8:42 am

Re: Lines that can be redefined

Post by Garic »

Unfortunately such possibility in a plug-in is not provided.
ks
.............
Image
User avatar
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: Lines that can be redefined

Post by dec »

Hello,
David de Argentina wrote:Another question:

I need put 4 clocks into a program.
Each clock has different time zone (Buenos Aires, New York, London & Moscow)
Are there any way to set the time for each clock manually ?

Thanks in advance,
David de Argentina
If you like can take a look at my npHour plugin, which allows you to set the time for any of the created clocks. So you can create a couple of clocks and active a Timer just like:

Code: Select all

npHourCreate "ClockOneRect" "[Result]"
npHourCreate "ClockTwoRect" "[Result]"
TimerStart "ClocksTimer" "1000"
And in the Timer event write this other code in order to update the clocks, the first, with the current time, the second with the current time plus two hours:

Code: Select all

npHourSetTime "ClockOneRect" "[Hour]" "[Minute]" "[Second]" "[Result]"
npHourSetTime "ClockTwoRect" "[Hour] + 2" "[Minute]" "[Second]" "[Result]"
Hope this can be useful. ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
Locked