Smart edit box and spinedit box

Registered by Yann Papouin on 2008-05-28

A smart edit box can parsed basic math operation after the user pressed Return.

eg : The width of my shape is 135,000 and I want the double, I just write *2 after the width like this : 135,000*2,
the content of the width edit box is updated (and so the canvas), after I pressed return, with the math result.

Blueprint information

Status:
Started
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Approved
Assignee:
None
Definition:
Approved
Series goal:
None
Implementation:
Beta Available
Milestone target:
None
Started by
jazzynico on 2011-05-16

Whiteboard

26-JUN-2008 Pablo Trabajos: This is, indeed, a VERY useful feature. Scribus uses it and it also does units conversions (i. e.: you can type in a box 10pt+5mm and it will calculate the sum automatically). My idea is that this should interact with my "anchor points" blueprrint because it would be even more useful if you could actually control to which side or corner the object should grow/shrink (in case you edit the dimensions).

2009-01-20 Steve Pomeroy: GNU Units is a great program to do this sort of thing conversion. Unfortunately, units doesn't seem to have a library, so you'd need to merge it in or pipe everything through the executable. Another program that does this is Blender, so perhaps some inspiration can be taken from their implementation.

2009-01-22 Yann Papouin: Actually, I don't know to which level it should be implemented because it could be something like the gtk_adjustment class and directly implemented in GTK to be used by other applications. For the moment we can try to implement this spec in Inkscape but I don't know where are the EditBox, SpinBox source code in Inkscape as they need to be inherited from their gtkmm parent class (as a sp-mywidget apparently ?).

With units, you can easily just do:
units -1 '12mm + 1ft' cm

and it will give you 12mm + 1ft in centimeters.

jazzynico, 2011-05-16 - Basic implementation available in the trunk.

Please add constants, such as e, pi and especially phi (golden ratio). The last one is so important.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.