ReadOnly ComboBoxes in dlgSelectConnection.cpp

Поиск
Список
Период
Сортировка
Искать

ReadOnly ComboBoxes in dlgSelectConnection.cpp

От:
Steffen Kuhn <pg@kuhnsteffen.de>
Дата:
Вложения:
Hi ,

if pgAdmin is startet with option 'S' and there are no QuickConnect 
informations in the settings
the readonly comboboxes make no sense.

I tried following code:
if (form == NULL)
{
         cbServer->SetValue(settings->Read(wxT("QuickConnect/server"), 
wxEmptyString));
         if (cbServer->IsEmpty())
             cbServer->SetWindowStyleFlag(cbServer->GetWindowStyleFlag() 
& ~wxCB_READONLY);
         
cbDatabase->SetValue(settings->Read(wxT("QuickConnect/database"), 
wxEmptyString));
         if (cbDatabase->IsEmpty())
             
cbDatabase->SetWindowStyleFlag(cbDatabase->GetWindowStyleFlag() & 
~wxCB_READONLY);
         
cbUsername->SetValue(settings->Read(wxT("QuickConnect/username"), 
wxEmptyString));
}

but the combobox didn't change to be editable.
So find another patch attached.
Also fixed height of username combobox.

Regards
Steffen

Re: ReadOnly ComboBoxes in dlgSelectConnection.cpp

От:
Guillaume Lelarge <guillaume@lelarge.info>
Дата:
Вложения:
Hi,

Le 22/08/2010 11:48, Steffen Kuhn a écrit :
> [...]
> if pgAdmin is startet with option 'S' and there are no QuickConnect
> informations in the settings
> the readonly comboboxes make no sense.
> 

Yes, this was a known bug (at least to me), but didn't find the time to
work on it.

> I tried following code:
> if (form == NULL)
> {
>         cbServer->SetValue(settings->Read(wxT("QuickConnect/server"),
> wxEmptyString));
>         if (cbServer->IsEmpty())
>             cbServer->SetWindowStyleFlag(cbServer->GetWindowStyleFlag()
> & ~wxCB_READONLY);
>        
> cbDatabase->SetValue(settings->Read(wxT("QuickConnect/database"),
> wxEmptyString));
>         if (cbDatabase->IsEmpty())
>            
> cbDatabase->SetWindowStyleFlag(cbDatabase->GetWindowStyleFlag() &
> ~wxCB_READONLY);
>        
> cbUsername->SetValue(settings->Read(wxT("QuickConnect/username"),
> wxEmptyString));
> }
> 
> but the combobox didn't change to be editable.

The wxwxidgets doc says a refresh is needed. I did it, but it still
didn't work.

> So find another patch attached.
> Also fixed height of username combobox.
> 

I did a few changes to your patch. Here is the one I commited on 1.12.
See patch attached.

I commited a slightly modified fix for 1.13 to take care of the new
rolename combobox.

Thanks for your report and patch.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
FAQ