Re: function to resize a UML class object's extent?



On 2001.11.28 11:54 Lars Clausen wrote:
On Wed, 28 Nov 2001, Andrew S. wrote:

Like this:

      /* the {persistent} tag should be made optional (or at least
     concealable) eventually */
      nameprop->string_data =
      g_strdup_printf("%s {persistent}",
                      gschema_element->base_table_def_sql->table_sql->str);
      /* this compulsory capitalization of class-names-as-table-names
     should be made optional eventually */
      nameprop->string_data[0] =
      (char) toupper((int)
             gschema_element->base_table_def_sql->table_sql->str[0]);
      g_strdown(nameprop->string_data + 1);

      umlclass_obj->ops->set_props(umlclass_obj, props);

      /* need some code here to fit the size of the class box to the
     size of the class name (which doesn't happen automatically) a
     la Properties->Apply button */

Well, it should happen automatically when set_props is called.  That it
doesn't is a problem in object.c, or possibly deeper, in the properties.
The text is a sub-object, and its width doesn't get updated after
set_props.  The update_data function doesn't update the width of the text
object, obviously that object is expected to handle it itself.  But somehow
the text change is propagated to the text object without the width being
set?  I'm a little confused about this.  Your code looks good to me.
Cyrille, do you have any comments on the property updates?

Clicking on Dialogs->Properties->Apply (after the import plug-in finishes) sets
everything to rights on an individual class object, but after studying the code,
I'm still not sure why.

Andy




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]