kicad-developers team mailing list archive
Mailing list archive
Wayne Stambaugh <stambaughw@...>
Mon, 07 Dec 2009 09:49:41 -0500
Thunderbird 18.104.22.168 (Windows/20090812)
Dick Hollenbeck wrote:
>> I added this so that developers wouldn't have to relearn what I had to
>> figure out the hard way. It's like section on the set focus to get the
>> escape key to cancel dialog bug in GTK.
>>> I fear a minimum size is fraught with platform dependencies, some of
>>> which can only be known at runtime, due to font sizes, etc.
> If done programmatically then the platform dependencies are minimized.
> The above sentence was in reference to trying to set the minimum while
> in wxformbuilder.
>>> If to be done at runtime, and I feel this is the only sensible way, then
>>> maybe we need to start deriving all dialogs from our own common base
>>> class so we can take care of all these things in a common way.
>> If you could come up with a clean method of guaranteeing that anytime
>> the contents of a control was changed that the dialog got resized
>> correctly then yes it would make sense to create a base dialog class.
> This criterion (of automatically being called after a resize) is
> unnecessary. Just having a member function to encapsulate the details
> of setting the minimum would be useful. But this can also be done in a
> non-member function.
This depends on the developer to remember to call it after changing the
dialog control contents. The key to this is getting the necessary
information to developers. I'm not sure UIPolicies.txt is the best way
to accomplish this task but it's what we have for now.
>> Off the top of my head, I think this would be a very complex object and
>> would be difficult to integrate with wxFormBuilder.
> No, wxformbuilder lets you derive your dialog from any base class you
> want. But I am not strongly advocating this member function at this
> time. An external function in common.c would be useful. If and when we
> ever want to do things accross all dialogs, such as supporting context
> sensitive help or printing dialog windows or whatever, then a common
> base dialog class is not hard and can be handled easily by wxformbuilder.
I was thinking about a base dialog class that would be responsible
watching the control contents and automatically resizing the dialog when
they are changed. That would be tricky. A base dialog class that
provides the three function calls to resize the dialog and set the
minimum size would be trivial.