Graph widget Error Message ..erm grammar_full.g

Moderators: LCMark, LCfraser

Post Reply
AndyP
Posts: 294
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Graph widget Error Message ..erm grammar_full.g

Post by AndyP » Tue Feb 07, 2017 5:48 pm

I've started playing around with widgets and have jumped into the deep end doing some mods to the graph widget.

I want to add a line width scale similar to the existing marker scale.

So added this to start off.

/**
Added by Andy Piddock 07/02/2017
Summary: A scale factor to apply to lines

Syntax:
set the lineScale of <widget> to <real>
get the lineScale of <widget>

Value (real): A scale factor to apply to graph lines

Description:
The default scale factor is 1

*/
property lineScale get mLineSize set SetLineSize
metadata lineScale.default is "1"
metadata lineScale.editor is "com.livecode.pi.number"
metadata lineScale.step is "0.05"
metadata lineScale.min is "0"
metadata lineScale.max is "5"
metadata lineScale.label is "Line scale"

and tried to build just to check all is ok so far and got this error

Error: No rule applicable in "grammar_full.g", line 1322

Line 1322 is the last line of the graph widget lcb file.

Any pointers to what this means please.
Last edited by AndyP on Wed Feb 08, 2017 6:48 am, edited 1 time in total.
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3189
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Error Message ..erm grammar_full.g

Post by bn » Tue Feb 07, 2017 6:14 pm

Hi Andy,

I assume you did add handlers to set and get the property? And you did initialize variable "mLineSize"? And set the initial value in onCreate?

AndyP
Posts: 294
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Error Message ..erm grammar_full.g

Post by AndyP » Tue Feb 07, 2017 6:34 pm

Yes done all that.

But now double checking.
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

LiveCode_Panos
Posts: 306
Joined: Fri Feb 06, 2015 4:03 pm

Re: Error Message ..erm grammar_full.g

Post by LiveCode_Panos » Tue Feb 07, 2017 7:05 pm

Could it be the case that you have something like:

variable mLineSize as undefined_type

If yes, this currently throws an error "No rule applicable in "grammar_full.g", line 1322", instead of "Identifier 'undefined_type' not declared"

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3189
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Error Message ..erm grammar_full.g

Post by bn » Tue Feb 07, 2017 7:07 pm

Hi Andy,

got it working now. But I used LC9 DP2 because the debugging info indicated a line number instead of "grammar_full.g", line 1322.

Much easier that way... :)

then recompile in DP4, works then too.

It is a nice hack to the graph widget.

Kind regards
Bernd

AndyP
Posts: 294
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Error Message ..erm grammar_full.g

Post by AndyP » Tue Feb 07, 2017 9:23 pm

Hi Bernd,

Great, can you post the lcb script so I can compare with mine to help me see where my error(s) are..thanks.
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3189
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Error Message ..erm grammar_full.g

Post by bn » Tue Feb 07, 2017 9:25 pm

Hi Andy,

actually I mailed you the .lcb script to the address you use for the use-list.

Kind regards
Bernd

AndyP
Posts: 294
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Error Message ..erm grammar_full.g

Post by AndyP » Tue Feb 07, 2017 9:30 pm

Hi Bernd,

Many thanks...digesting now.

edit.. Ok this is what i was missing, at line 1186

if mLinesShow is true then
set the stroke width of this canvas to mLineSize
stroke tPath on this canvas
end if

so near...
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

AndyP
Posts: 294
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Graph widget Error Message ..erm grammar_full.g

Post by AndyP » Wed Feb 08, 2017 7:09 am

Hi Bernd,

I've changed that topic heading to make it more descriptive.

Are you going to add this to git so it can be updated in a future LC build?

I've added a link to the amended lineGraph widget in my dropbox account so that others can use now..hope this is ok?

https://www.dropbox.com/sh/muvbj54uyq6x ... AUUJa?dl=0

I started this as a response to this thread, so there is at least one person who would like this.

http://forums.livecode.com/viewtopic.php?f=9&t=28789

Screengrab of amended Linegraph widget

https://de.pinterest.com/pin/797840890206584847/
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3189
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Graph widget Error Message ..erm grammar_full.g

Post by bn » Wed Feb 08, 2017 5:07 pm

Hi Andy,
I've added a link to the amended lineGraph widget in my dropbox account so that others can use now..hope this is ok?
I consider this your idea and implementation. I only helped a bit.

Kind regards
Bernd

AndyP
Posts: 294
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Graph widget Error Message ..erm grammar_full.g

Post by AndyP » Wed Feb 08, 2017 6:08 pm

Very gracious Bernd.
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

Post Reply

Return to “LiveCode Builder”