On 5 Mar 2001, Lars Clausen wrote:
> On Tue, 6 Mar 2001, James Henstridge wrote:
>
> > On 5 Mar 2001, Lars Clausen wrote:
> >
> >>
> >> I've looked a bit at making defaults dialogs from properties. I see
> >> three problems that need to be resolved:
> >>
> >> 1) Should the defaults be object-specific or name-based? I'd say
> >> name-based, but then we get the possibility of accidentally
> >> transferring defaults between sheets. Is that going to be a problem?
> >>
> >> 2) More serious: Each property should have a default value. If the
> >> defaults are name-based, there can only be one default value for any
> >> property of that name, which might not please everyone.
> >
> > In most cases, we probably want per property rather than per object
> > (eg. at the moment, default colours, line styles, line widths and fonts
> > are shared between all types). I am sure there are some cases where
> > having things per object is useful as well.
>
> Maybe we could have it be the combination of the name and the default value
> that identifies a grouping? And maybe I should check how many cases there
> are of this before I do large nasty designs.
I don't think it is safe to assume that properties of the same name on
different object types are always going to be the same, and hence use the
same default. However, in a lot of cases (the shared ones I mentioned
above), it is.
>
> >> 3) How does an object specify the default value? I'd like to add it to
> >> the PropDescription struct, but that would break binary
> >> compatability. Adding another struct for this would be plain silly.
> >
> > Well, at the moment PropDescription structs are static, whereas the
> > default values for properties are mutable in dia. Is this feature worth
> > preserving? How do we handle multiple objects types which should share a
> > default, yet have separate (identical) PropDescription structs?
>
> What do you mean, the default values for properties are mutable? The only
> default values currently used (except for the standard properties) are
> hardcoded.
Things like the "draw background" or "corner rounding" for the standard
box have defaults that can be changed from the defaults dialog. Hence,
they are mutable during the run of the program. All the other data in the
PropDescription struct (name, description, prop type, etc) is fixed.
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/