Misc questions (dropdown menus, retrieving path info from files, LPE)

View: New views
14 Messages — Rating Filter:   Alert me  

Misc questions (dropdown menus, retrieving path info from files, LPE)

by Maximilian Albert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I started working in the direction of Valerie's proposal for a redesigned pen/pencil toolbar (see http://wiki.inkscape.org/wiki/index.php/Vector-brushes), and I have a few quick questions:

1) How can I add images/paths to dropdown menus, e.g., to illustrate the shape that is going to be applied as a PatternAlongPath LPE?

2) I'd like to save the various possible shapes for dropdown menu #6 (cf. the image in the blueprint) in a separate file and read them during runtime rather than to hard-code them in advance. How can I access their path information from my code so that they can be applied as a PatternAlongPath?

3) For the LPE experts (Johan in particular :-) ): Valerie suggests that the width of the shape can be controlled via two spinbuttons. When I apply a given shape to a path (using PatternAlongPath), does the width of the resulting LPE-item depend on the length of the path or is it independent of this length (i.e., does the resulting item become wider when the path is longer and thus the pattern is "stretched" more)?

Thanks in advance,
Max
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by john cliff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'd suggest the maker preview menu as a place to look for code wrt the images of paths in dropdowns.

You can probably modify the stockitems code used to pull markers and patterns from the library files too.


On 23/06/2008, Maximilian Albert <Anhalter42@...> wrote:
Hi all,

I started working in the direction of Valerie's proposal for a redesigned pen/pencil toolbar (see http://wiki.inkscape.org/wiki/index.php/Vector-brushes), and I have a few quick questions:

1) How can I add images/paths to dropdown menus, e.g., to illustrate the shape that is going to be applied as a PatternAlongPath LPE?

2) I'd like to save the various possible shapes for dropdown menu #6 (cf. the image in the blueprint) in a separate file and read them during runtime rather than to hard-code them in advance. How can I access their path information from my code so that they can be applied as a PatternAlongPath?

3) For the LPE experts (Johan in particular :-) ): Valerie suggests that the width of the shape can be controlled via two spinbuttons. When I apply a given shape to a path (using PatternAlongPath), does the width of the resulting LPE-item depend on the length of the path or is it independent of this length (i.e., does the resulting item become wider when the path is longer and thus the pattern is "stretched" more)?

Thanks in advance,
Max
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by bulia byak :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 23, 2008 at 7:52 PM, Maximilian Albert <Anhalter42@...> wrote:
> 1) How can I add images/paths to dropdown menus, e.g., to illustrate the shape that is going to be applied as a PatternAlongPath LPE?
>
> 2) I'd like to save the various possible shapes for dropdown menu #6 (cf. the image in the blueprint) in a separate file and read them during runtime rather than to hard-code them in advance. How can I access their path information from my code so that they can be applied as a PatternAlongPath?

Both these questions are answered by the marker menu code in
fill&stroke. It's all a little cumbersome (creating a sandbox
document, copying the shape to it, rendering it to a bitmap, addiing
bitmap to the menu) but it works.

> 3) For the LPE experts (Johan in particular :-) ): Valerie suggests that the width of the shape can be controlled via two spinbuttons. When I apply a given shape to a path (using PatternAlongPath), does the width of the resulting LPE-item depend on the length of the path or is it independent of this length (i.e., does the resulting item become wider when the path is longer and thus the pattern is "stretched" more)?

By default it's 100% of the original width of the pattern. In this
case, however, I think the expected behavior is for the path to
reproduce the thumbnail of the profile as closely as possible,
including its length/width ratio, i.e. you should set "width in terms
of length". Or maybe the initial width must correspond to the stroke
width of the path before profile is apllied, if it had any stroke.

--
bulia byak
Inkscape. Draw Freely.
http://www.inkscape.org

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Jon A. Cruz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2008-06-24 at 00:52 +0200, Maximilian Albert wrote:
> I started working in the direction of Valerie's proposal for a
> redesigned pen/pencil toolbar (see
> http://wiki.inkscape.org/wiki/index.php/Vector-brushes), and I have a
> few quick questions:
>
> 1) How can I add images/paths to dropdown menus, e.g., to illustrate
> the shape that is going to be applied as a PatternAlongPath LPE?
>

Bulia answered the current state, however I was working on a more
generic mechanism for the gradient toolbar.

In fixing the toolbar containers, I destabilized the layout of the old
gradient toolbar UI, so I need to go ahead and get the new mechanism
fixed and in. As soon as that is set, you should be able to reuse that.

IIRC, the key thing I was doing was making the EgeSelectOneAction handle
previews that would be needed. Your code will still need to provide
things when called-back, but the mechanics should be handled for you.
Among other things it will allow for such dropdowns to be added and
moved by the users at runtime. Soon... soon...

:-)



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Parent Message unknown Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Valerie VK :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

(Yay! :D )

Here's my take on 3) (alternatives are welcome):

I can see 3 types of behavior people could want for LPE width:
- absolute width: most useful for thin lines. Ex: 2 px.
- % of original (%): big clipboard items. Chances are, when
you copy an object you've just made for LPE, you want the object
width to be more or less retained.
- proportional resize: actually, isn't this what "bend path"
more or less does? The object isn't stretched, it's just
resized and bent.

At first I was wondering how to call the last option in just two
letters, but then I realized that it's best to make that a
repeat option:

http://img150.imageshack.us/img150/2599/lpekz5.png

So, apart from the above, you have the following for units
drop-down:

%
--
px
mm
etc.

By the way, there should be an option for the resulting object
to take on the color/fill properties of the original object instead
of the current line properties. This in particular could be set
as default for clipboard items:
- if you copy a green leaf, you probably want it to stay green
- also, if in the future you can copy complex objects with different
fills and strokes for LPE, that'd allow you to retain those
multiple settings

Also, is it possible to implement a "skeleton" mode where
all LPEs are disabled and only the skeletons are visible? The
reasoning is simple: LPEs can consume a vast amount of memory. A
skeleton mode would serve very much the same purpose here as
the Outline mode (indeed, the outline mode itself could be made
to only show skeletons and not rendered effects).



     

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Alexandre Prokoudine :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 24, 2008 at 4:45 AM, bulia byak wrote:

> By default it's 100% of the original width of the pattern. In this
> case, however, I think the expected behavior is for the path to
> reproduce the thumbnail of the profile as closely as possible,
> including its length/width ratio, i.e. you should set "width in terms
> of length". Or maybe the initial width must correspond to the stroke
> width of the path before profile is apllied, if it had any stroke.

I would only add on top of that is that currently a lot of combo boxes
in Inkscape's UI are higher than expected: in toolbars, in
Fill'n'Stroke dialog (marker preview) etc, which is not quite pleasant
visually (especially in toolbars, where height of a spinbox is ~2x
smaller than height of a combobox). It would be great to have this
fixed, of course, not at the cost of quality ;-)

Alexandre

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Maximilian Albert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Maximilian Albert schrieb:

 > I started working in the direction of Valerie's proposal for a
 > redesigned pen/pencil toolbar (see
 > http://wiki.inkscape.org/wiki/index.php/Vector-brushes)
 > [...]

Have a look at latest SVN. It implements a dropdown menu in pencil/pen
toolbar to select various shapes which are applied instantly after
finishing a path. At present it has the options "None", "Clipboard",
"Crescendo" and "Decrescendo". The latter two are just offhand
descriptions for very long triangles (give it a try and the meaning will
become clear :) ).

These verbal descriptions will disappear as soon as I've figured out how
to add a images to the dropdown box like in the fill/stroke dialog. I
succeeded in adding the widget from that dialog to the toolbar, but it
always appeared at the very end (I think even after the "style of new
objects" swatch) -- as if it was put outside some inner hbox containing
all the other widgets. Any ideas what that hbox would be and how to
access it? What precisely does the 'holder' refer to anyway that is
passed as an argument to all the toolbar prep functions?

Apart from adding images to the dropdown, shapes should be made loadable
from an external files (similar to patterns) and more shapes should be
added.

Max


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Jon A. Cruz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 3, 2008, at 3:40 AM, Maximilian Albert wrote:

These verbal descriptions will disappear as soon as I've figured out how 

to add a images to the dropdown box like in the fill/stroke dialog. I 

succeeded in adding the widget from that dialog to the toolbar, but it 

always appeared at the very end (I think even after the "style of new 

objects" swatch) -- as if it was put outside some inner hbox containing 

all the other widgets. Any ideas what that hbox would be and how to 

access it? What precisely does the 'holder' refer to anyway that is 

passed as an argument to all the toolbar prep functions?


What you need to do is have some subclass of GtkAction that will dynamically create your dropdown. Those are passed into the ui builder and at runtime they are called upon to make toolbar items or menu items as needed.

Look to the ege-select-one-action.h/cpp files and their use in widgets/toolbar.cpp

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by bulia byak :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 3, 2008 at 7:40 AM, Maximilian Albert <Anhalter42@...> wrote:
> Have a look at latest SVN. It implements a dropdown menu in pencil/pen
> toolbar to select various shapes which are applied instantly after finishing
> a path. At present it has the options "None", "Clipboard", "Crescendo" and
> "Decrescendo".

Excellent!  But can we make it a fully interactive widget, so it not
only determines what to apply to a new path, but senses a change in
selection and reflects and lets you change the profile of an existing
path? It would then be millions of times more useful.

Also: right now it's impossible to use it with the spiro mode, i.e. it
fails to add the pattern-on-path LPE on top of Spiro LPE. It must be
smarter and be able to combine LPEs. It also must be smart enough to
analyse an LPE stack and see if it contains a pattern-on-path and if
the pattern path has one of the predefined IDs that it uses, and if
so, show that profile selected in the list, and allow the user to
change it even if it is in the middle of a stack. This is a similar
problem to that of the Blur control - it also must be able to find the
blur primitive in a filter stack and change it without disturbing the
rest of effect primitives.

> These verbal descriptions will disappear as soon as I've figured out how to
> add a images to the dropdown box like in the fill/stroke dialog.

I think you don't need to spend time on that now - text labels are
good enough for the time being, so focus on the logic not on the
visual niceness :)

> Apart from adding images to the dropdown, shapes should be made loadable
> from an external files (similar to patterns) and more shapes should be
> added.

Absolutely.

Thanks for the great work!

--
bulia byak
Inkscape. Draw Freely.
http://www.inkscape.org

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Valerie VK :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Have a look at latest SVN. It implements a dropdown menu in
> pencil/pen toolbar to select various shapes which are applied
> instantly after finishing a path. At present it has the options
> "None", "Clipboard", "Crescendo" and "Decrescendo". The
> latter two are just offhand
> descriptions for very long triangles (give it a try and the
> meaning will become clear :) ).

That's awesome! I can't wait to check them out once I get home! :D

I also agree that text descriptions are fine for now. I suggest
including some generic shapes once you figure out how to do the
image drop-downs. I've made a few for personal use:

http://img84.imageshack.us/img84/471/rect2864az5.png

I doubt the more complex ones will be needed, but shapes such as
double-lines, stitches, even rope and chain could be included.
Does anybody needs me to make a few? What's the size of defaults?

By the way, is it me, or is the mailing list archive buggy?


     

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Alexandre Prokoudine :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 3, 2008 at 2:40 PM, Maximilian Albert wrote:

> Have a look at latest SVN. It implements a dropdown menu in pencil/pen
> toolbar to select various shapes which are applied instantly after
> finishing a path. At present it has the options "None", "Clipboard",
> "Crescendo" and "Decrescendo". The latter two are just offhand
> descriptions for very long triangles (give it a try and the meaning will
> become clear :) ).

Awesome! One quick note: as of revision 19126 Spiro LPE was lost when
drawing with shapes.

Alexandre

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Maximilian Albert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alexandre Prokoudine schrieb:

> On Thu, Jul 3, 2008 at 2:40 PM, Maximilian Albert wrote:
>
>> Have a look at latest SVN. It implements a dropdown menu in pencil/pen
>> toolbar to select various shapes which are applied instantly after
>> finishing a path. At present it has the options "None", "Clipboard",
>> "Crescendo" and "Decrescendo". The latter two are just offhand
>> descriptions for very long triangles (give it a try and the meaning will
>> become clear :) ).
>
> Awesome! One quick note: as of revision 19126 Spiro LPE was lost when
> drawing with shapes.

Thanks for the note. I had already fixed that but simply had forgotten
to commit it to SVN. :)

Max

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Alexandre Prokoudine :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jul 4, 2008 at 5:01 PM, Maximilian Albert wrote:

> Thanks for the note. I had already fixed that but simply had forgotten to
> commit it to SVN. :)

Since you are already here... :)

If we are planning to remove "Edit LPE" button, how do we make it
possible to edit a pattern in Patter-to-path LPE without it?

Alexandre

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: Misc questions (dropdown menus, retrieving path info from files, LPE)

by Alexandre Prokoudine :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jun 24, 2008 at 2:52 AM, Maximilian Albert wrote:

> I started working in the direction of Valerie's proposal for a redesigned pen/pencil toolbar (see http://wiki.inkscape.org/wiki/index.php/Vector-brushes), and I have a few quick questions:

So, can we close
https://blueprints.launchpad.net/inkscape/+spec/vector-brush now? :-)

Alexandre

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel