Phil, If you elect to go with plan (a), I could help if you like.
- Don On Jul 7, 2011, at 8:26 AM, P T Withington wrote: > Ah. Not so easy. > > I'm pretty sure that literal % constraints on width/height are handled in the > compiler. This is mostly for legacy reasons -- we used to try to do as much > as possible at compile time to make things faster (at a loss of dynamicity). > > Nowadays we have a lot more power at runtime so we should dispense with the > compiler "optimization" and just let these things be handled at runtime. > (With the added benefit that you could change the percentage dynamically at > run time.) > > The short/kludge answer is: > > a) Find the place in the compiler that handles %'s and make it store a copy > of the original % in something like _source_width, or > > b) Just know that it is a percent and back-calculate it. > > The long/right answer is: > > 2) Use CSS and write a presentation type that parses both absolute and > percent dimensions and can unparse those same dimensions. (See the color > presentation type for instance, for a p-t that has multiple representations. > The unparser has an optional argument that lets you specify the desired > representation format.) > > > On 2011-07-07, at 08:15, [email protected] wrote: > >> I'm looking for something different. If the user enters '79%' for the width, >> I want to obtain the string '79%', not the size which represents 79% of the >> canvas width. >> >> Thanks! >> >> Phil >> >> >> >> On Wed, Jul 6, 2011 at 7:43 PM, P T Withington wrote: >> >>> Well a constraint is really just a handler for the dependent variables that >>> updates the actual value, so in this case if you ask for the elements width >>> or height, you will get the current real value. The best way to forward >>> those values (and track them) is to make another constraint. Constraints >>> are easy to write in OL, but hard to write in JS. You can get an inkling >>> of a hand-written constraint by looking at the implementation of the align >>> and valign attributes that let you say things like 'center', 'top', etc. >>> Those get interpreted into constraints on the parent bound. >>> >>> Hope that helps. >>> >>> On 2011-07-06, at 19:30, [email protected] wrote: >>> >>>> Hi Tucker, >>>> >>>> Is it possible to retrieve the raw constraint values of an attribute? For >>>> example, >>>> >>>> <html width="100%" height="100%" .../> >>>> >>>> I'd like to obtain the 100% values for width and height so I can forward >>>> them to the iframemanager. >>>> >>>> Thanks! >>>> >>>> Phil > > -- Don Anderson Java/C/C++, Berkeley DB, systems consultant voice: 617-306-2057 email: [email protected] www: http://www.ddanderson.com blog: http://libdb.wordpress.com
