Misc questions (dropdown menus, retrieving path info from files, LPE)
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
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@...173...> 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:
- 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?
- 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?
- 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@...1921...
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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Mon, Jun 23, 2008 at 7:52 PM, Maximilian Albert <Anhalter42@...173...> wrote:
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?
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.
- 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.
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
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:
- 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...
:-)
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
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
On Thu, Jul 3, 2008 at 7:40 AM, Maximilian Albert <Anhalter42@...173...> 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!
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?
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
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
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
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
participants (6)
-
Alexandre Prokoudine
-
bulia byak
-
john cliff
-
Jon A. Cruz
-
Maximilian Albert
-
Valerie