Calculator in input fields

Bug #171282 reported by Bug Importer
140
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Johan Engelen

Bug Description

It would be very handy to have the inputs [x,y,h,w]
filterd similar to those in scribus, where you can
specifiy width as a mathematical epression eg 60/2 for
a result of 30. This makes specific locations eaiser to
stipulate relative to other objects and the page as
this allows for more usability, also keywords such as
pagewidth and pageheight, So that pageheight/3 would be
calculated.

Also where the x and y are located on an object is also
helpful, eg, topleft, bottom right. If this can be set
for each object.

Tags: ui
Revision history for this message
Jim Van Zandt (jrvz) wrote :

I'll second this request.

I'm designing a woodworking project, and would very much like to enter sizes in fractions of an inch. (Yes, I know, but they don't have mm size lumber here.)

It would also be nice to enter distances and sizes with units, e.g. "35 mm" even if your default units were inches.
As a quick hack, the expression could be exported to the Unix program "units".

Revision history for this message
Hystrix (hystrix-) wrote :

I also think this would be a very handy addition. In my case I would like to be able to type "+30" and have the current number increased by 30.

Changed in inkscape:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
mahfiaz (mahfiaz) wrote :

There is a blueprint related to this feature: https://blueprints.launchpad.net/inkscape/+spec/smart-edit-box

Revision history for this message
Devon (devonfyson) wrote :

This would be a very useful feature. It would be great to see this in Inkscape, Gimp, and any other programs with number input boxes. Maybe this would/could be better implemented as a system wide feature by the OS so any number inputboxes (irrelevant of the program) could have the option of parsing formulas.

Revision history for this message
su_v (suv-lp) wrote :

New duplicate:
Bug #720694 “Mathematical operators in numeric input fields”

su_v (suv-lp)
Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
Johan Engelen (johanengelen) wrote :

working on it :)

Changed in inkscape:
assignee: nobody → Johan Engelen (johanengelen)
status: Triaged → In Progress
Revision history for this message
Johan Engelen (johanengelen) wrote :

Marking as Fix Committed. Most spinboxes should have this functionality now. Please open a new bug report if you find that it does not work somewhere.
"Pagewidth" and "pageheight" does not work.
For some dialogs (like the guideline dialog), I am thinking about adding support for the % unit, that specifies the percentage of pageheight / pagewidth.

Changed in inkscape:
milestone: none → 0.49
status: In Progress → Fix Committed
Revision history for this message
pygmee (pygmee) wrote :

That looks great Johan and working well.
Questions are :
- could i use object name in calculations (this is kind of similar to keyword usage like pagewidth). For example, if i want the size of an object to be half of another, i'd just write : object2.height=object1.height/2
- only the result of the calculation is kept in the field. Would it be feasible to keep the formula so that (taking previous example) if i change object1 size, object2 would be affected.

I know, clone can do that but using clones assumes the objects have the same shape.
In fact, i don't know if that's not too much, these are just ideas

Revision history for this message
Johan Engelen (johanengelen) wrote : Re: [Bug 171282] Re: Calculator in input fields

On 17-4-2011 17:57, pygmee wrote:
> - could i use object name in calculations (this is kind of similar to keyword usage like pagewidth). For example, if i want the size of an object to be half of another, i'd just write : object2.height=object1.height/2

Although this functionality is somewhat easier to add than the next
point, I think it will only make sense in conjunction with the next:

> - only the result of the calculation is kept in the field. Would it be feasible to keep the formula so that (taking previous example) if i change object1 size, object2 would be affected.

I think SVG supports defining sizes of objects in terms of variables.
But it will be a lot of work to implement this in Inkscape. Although I
see some benefit of this, it is just too much for me to do. (and it
seems a bit too much for Inkscape at this moment too)

Revision history for this message
pygmee (pygmee) wrote :

Of course. you've already done a very nice add. Thanks again.

Revision history for this message
su_v (suv-lp) wrote :

Follow-up report (as requested in comment #7):
Bug #773636 “Use expression evaluator for spinboxes of the 'Tiled Clones' dialog”
<https://bugs.launchpad.net/inkscape/+bug/773636>

Revision history for this message
su_v (suv-lp) wrote :

Follow-up report to enhance the current implementation:
 Bug #1024362 “RFE: enhance expression evaluator in input boxes”

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.