Re: ESC closes window without warning

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: ESC closes window without warning
Дата
Msg-id CA+OCxoyS0REyrr51+zV6g-gcUGGDSevv=gH2f21bXQ0G6oMs7Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ESC closes window without warning  (Michal Kozusznik <kozusznik.michal@ifortuna.cz>)
Список pgadmin-support
On Thu, Feb 7, 2013 at 12:30 PM, Michal Kozusznik
<kozusznik.michal@ifortuna.cz> wrote:
>
>> That's basically what the patch I posted does. The problem is that the
>> base class doesn't have any knowledge of what controls are on an
>> instantiated dialogue, or how to test if they've been changed from
>> whatever the default is (for new objects) or from whatever pgObject
>> derived object exists for edits.
>>
>> The only way I can see to do this is to write a function for each
>> individual dialogue that can compare the values of each control to the
>> defaults or an existing object - pretty similar to what CheckChange()
>> already does - the difference being that it is validating as well.
>
>
> Couldn't method from base class scan all associated editable UI elements
> (members of the window) and store their values just after window opening?

In theory something like that could be done - there's a
wxWindow::GetChildren() function that returns a list of wxWindow
objects. It's somewhat more complex to actually get the values from
each control though - we'd need to try to figure out what type of
object it is, and whether or not it's user-updated, and then stash
away the starting value. It's hard to do that after the window has
been setup though, unless we do it for every class (because we already
do the setup using the event we'd want to use). I'd have to play with
it, but it's still not as easy as you might think.

> Also, I believe there must be some event fired on closing window, also
> processed by this base class. It's good place to do comparison.
> Just ideas. I'm sure you know the architecture better.

There is - that's what I used in my earlier patch.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgadmin-support по дате отправления:

Предыдущее
От: Michal Kozusznik
Дата:
Сообщение: Re: ESC closes window without warning
Следующее
От: Dave Page
Дата:
Сообщение: Re: Possible bug report (comment on database disappered on pgAdmin 1.16.1)