Обсуждение: OSX Status
Hi This newest wxMac Version (2.5.5) fixes both the Icon-Distortion Problem in the treeview, and the Help-Window-Is-Attached-To-The-Top-Of-The-Screen Problem. This only remaining showstopper for pgAdminIII on Mac, as far as I can tell, is now the wrong size of all the dialogs. Since most xrc files use absolute positioning, and widgets on OSX tend to be larger than the GTK or Windows ones, I don't know a clean way to fix this. greetings, Florian Pflug
Вложения
Florian G. Pflug wrote: > Hi > > This newest wxMac Version (2.5.5) fixes both the Icon-Distortion Problem > in the treeview, and the > Help-Window-Is-Attached-To-The-Top-Of-The-Screen Problem. Good to hear! > This only remaining showstopper for pgAdminIII on Mac, as far as I can > tell, is now the wrong size of all the dialogs. Since most xrc > files use absolute positioning, and widgets on OSX tend to be larger > than the GTK or Windows ones, I don't know a clean way to fix this. This probably means that the dialog unit calculation, on which all sizing is based, has a problem. Please enable debug logging, when starting pgadmin will log some lines about font calculation: Using fontmetrics ..... Native Description .... Draw size of 'M' Draw size of 'g' Draw size of 'Mg' Please provide this information, hopefully we get this fixed before wx2.6. Regards, Andreas
Please stay on the list!
> Here is the relevant Part of the log:
> 2005-04-07 12:09:25 INFO : Using fontmetrics 7/13, 11 Point
> 2005-04-07 12:09:25 INFO : Native Description '0;11;70;90;90;0;Lucida
> Grande;0'
> 2005-04-07 12:09:25 INFO : Draw size of 'M': w=10, h=13, descent 2,
> external lead 0.
> 2005-04-07 12:09:25 INFO : Draw size of 'g': w=7, h=13, descent 2,
> external lead 0.
> 2005-04-07 12:09:25 INFO : Draw size of 'Mg': w=17, h=13, descent 2,
> external lead 0.
looks ok.
>
> Attached is the complete log, and a screenshot of how the "Add Server"
> Dialog looks on osx.
Apparently there's something wrong with the wxNotebook sizing. It is
designed to be 145d high, and the button's position are at 150d, which
is just twice as much as the difference between the username and the
address textbox vertical position (80d-5d). OTOH, on my screen the
button position 150d equals 66mm, where the textbox difference 75d are
40.5mm, that is not consistent.
The calculation of the dialog size is done in dlgclasses.cpp
pgDialog::PostCreation, but I doubt that the problem is there, because
the button positions look good.
Please use the attached xrc file, and post the resulting image.
Regards,
Andreas
<?xml version="1.0" ?>
<resource>
<object class="wxDialog" name="dlgServer">
<title></title>
<object class="wxNotebook" name="nbNotebook">
<object class="notebookpage">
<label>Properties</label>
<object class="wxPanel" name="pnlProperties">
<object class="wxStaticText" name="stName">
<label>Address</label>
<pos>5,7d</pos>
</object>
<object class="wxTextCtrl" name="txtName">
<pos>70,5d</pos>
<size>15,-1d</size>
</object>
<object class="wxStaticText" name="stDescription">
<label>Description</label>
<pos>5,22d</pos>
</object>
<object class="wxTextCtrl" name="txtDescription">
<pos>70,20d</pos>
<size>15,-1d</size>
</object>
<object class="wxStaticText" name="stService">
<label>Service</label>
<pos>5,37d</pos>
</object>
<object class="wxTextCtrl" name="txtService">
<pos>70,35d</pos>
<size>15,-1d</size>
</object>
<object class="wxStaticText" name="stPort">
<label>Port</label>
<pos>5,52d</pos>
</object>
<object class="wxTextCtrl" name="txtPort">
<pos>70,50d</pos>
<size>26,-1d</size>
</object>
<object class="wxStaticText" name="stSSL">
<label>SSL</label>
<pos>10,52d</pos>
</object>
<object class="wxComboBox" name="cbSSL">
<pos>10,50d</pos>
<size>15,12d</size>
<style>wxCB_READONLY|wxCB_DROPDOWN</style>
<content/>
</object>
<object class="wxStaticText" name="stDatabase">
<label>Initial DB</label>
<pos>5,67d</pos>
</object>
<object class="wxComboBox" name="cbDatabase">
<pos>70,65d</pos>
<size>15,12d</size>
<content/>
<style>wxCB_DROPDOWN</style>
</object>
<object class="wxStaticText" name="stUsername">
<label>Username</label>
<pos>5,82d</pos>
</object>
<object class="wxTextCtrl" name="txtUsername">
<pos>70,80d</pos>
<size>15,-1d</size>
</object>
<object class="wxStaticText" name="stNeedPwd">
<label>need password</label>
<pos>5,97d</pos>
</object>
<object class="wxCheckBox" name="chkNeedPwd">
<label></label>
<checked>1</checked>
<pos>70,95d</pos>
<size>12,12d</size>
</object>
<object class="wxStaticText" name="stPassword">
<label>Password</label>
<pos>5,112d</pos>
</object>
<object class="wxTextCtrl" name="txtPassword">
<pos>70,110d</pos>
<style>wxTE_PASSWORD</style>
<size>135,-1d</size>
</object>
<object class="wxNotebook" name="someTest">
<pos>100,5d</pos>
<size>100,75d</size>
<object class="notebookpage">
<label>txt</label>
<object class="wxPanel">
<object class="wxTextCtrl" name="abc">
<pos>5,5d</pos>
<size>90,-1d</size>
</object>
</object>
</object>
</object>
</object>
<selected>1</selected>
</object>
<pos>2,2d</pos>
<size>214,145d</size>
</object>
<object class="wxButton" name="wxID_HELP">
<label>Help</label>
<pos>2,150d</pos>
</object>
<object class="wxButton" name="wxID_OK">
<label>OK</label>
<default>1</default>
<pos>113,150d</pos>
</object>
<object class="wxButton" name="wxID_CANCEL">
<label>Cancel</label>
<pos>166,150d</pos>
</object>
<size>218,168d</size>
<style></style>
</object>
</resource>
Florian G. Pflug wrote: > > Here it comes... Looks quite strange, I must say.. ;-) Well this wasn't supposed to win any prizes... :-) The inner notebook should be half the height of the outer notebook, but this isn't so. Please use the attached dlgServer.xrc and dlgServer.cpp and post the resulting image as well as the info debug output it creates (three lines "Mac debug"). I believe there's some attribute inheritance problem, which wouldn't be surprising because it took quite a while until msw and gtk did this correctly. Regards, Andreas
Andreas Pflug wrote: > The inner notebook should be half the height of the outer notebook, but > this isn't so. Please use the attached dlgServer.xrc and dlgServer.cpp > and post the resulting image as well as the info debug output it creates > (three lines "Mac debug"). Hm... seems you forgot to actually attach those files... - or they went to the bitbucket somewhere along the way.. ;-) > I believe there's some attribute inheritance problem, which wouldn't be > surprising because it took quite a while until msw and gtk did this > correctly. greetings, Florian Pflug
Вложения
Florian G. Pflug wrote:
> Andreas Pflug wrote:
>
>> The inner notebook should be half the height of the outer notebook,
>> but this isn't so. Please use the attached dlgServer.xrc and
>> dlgServer.cpp and post the resulting image as well as the info debug
>> output it creates (three lines "Mac debug").
>
> Hm... seems you forgot to actually attach those files... - or they
> went to the bitbucket somewhere along the way.. ;-)
Oops, try these...
Regards,
Andreas
<?xml version="1.0" ?>
<resource>
<object class="wxDialog" name="dlgServer">
<title></title>
<object class="wxNotebook" name="nbNotebook">
<object class="notebookpage">
<label>Properties</label>
<object class="wxPanel" name="pnlProperties">
<object class="wxStaticText" name="stName">
<label>Address</label>
<pos>1005,7d</pos>
</object>
<object class="wxTextCtrl" name="txtName">
<pos>1005,5d</pos>
<size>100,-1d</size>
</object>
<object class="wxTextCtrl" name="txtSomething">
<value>some decent text</value>
<pos>5,5d</pos>
<size>100,-1d</size>
</object>
<object class="wxTextCtrl" name="txtSomething2">
<value>some decent text</value>
<pos>5,20d</pos>
<size>100,-1d</size>
</object>
<object class="wxStaticText" name="stDescription">
<label>Description</label>
<pos>1005,22d</pos>
</object>
<object class="wxTextCtrl" name="txtDescription">
<pos>1070,20d</pos>
<size>135,-1d</size>
</object>
<object class="wxStaticText" name="stService">
<label>Service</label>
<pos>1005,37d</pos>
</object>
<object class="wxTextCtrl" name="txtService">
<pos>1070,35d</pos>
<size>135,-1d</size>
</object>
<object class="wxStaticText" name="stPort">
<label>Port</label>
<pos>1005,52d</pos>
</object>
<object class="wxTextCtrl" name="txtPort">
<pos>1070,50d</pos>
<size>26,-1d</size>
</object>
<object class="wxStaticText" name="stSSL">
<label>SSL</label>
<pos>1000,52d</pos>
</object>
<object class="wxComboBox" name="cbSSL">
<pos>1120,50d</pos>
<size>85,12d</size>
<style>wxCB_READONLY|wxCB_DROPDOWN</style>
<content/>
</object>
<object class="wxStaticText" name="stDatabase">
<label>Initial DB</label>
<pos>1005,67d</pos>
</object>
<object class="wxComboBox" name="cbDatabase">
<pos>1070,65d</pos>
<size>135,12d</size>
<content/>
<style>wxCB_DROPDOWN</style>
</object>
<object class="wxStaticText" name="stUsername">
<label>Username</label>
<pos>1005,82d</pos>
</object>
<object class="wxTextCtrl" name="txtUsername">
<pos>1070,80d</pos>
<size>135,-1d</size>
</object>
<object class="wxStaticText" name="stNeedPwd">
<label>need password</label>
<pos>1005,97d</pos>
</object>
<object class="wxCheckBox" name="chkNeedPwd">
<label></label>
<checked>1</checked>
<pos>1070,95d</pos>
<size>12,12d</size>
</object>
<object class="wxStaticText" name="stPassword">
<label>Password</label>
<pos>1005,112d</pos>
</object>
<object class="wxTextCtrl" name="txtPassword">
<pos>1070,110d</pos>
<style>wxTE_PASSWORD</style>
<size>135,-1d</size>
</object>
<object class="wxNotebook" name="testNotebook">
<object class="notebookpage">
<label>testpanel</label>
<object class="wxPanel" name="pnlX">
<object class="wxTextCtrl" name="txt">
<value>some decent text</value>
<pos>5,5d</pos>
<size>80,-1d</size>
</object>
</object>
</object>
<pos>5,35d</pos>
<size>100,75d</size>
</object>
</object>
<selected>1</selected>
</object>
<pos>5,5d</pos>
<size>200,150d</size>
</object>
<object class="wxButton" name="wxID_HELP">
<label>Help</label>
<pos>2,190d</pos>
</object>
<object class="wxTextCtrl" name="txt2">
<value>some decent text</value>
<pos>5,160d</pos>
<size>80,-1d</size>
</object>
<object class="wxButton" name="wxID_OK">
<label>OK</label>
<default>1</default>
<pos>113,190d</pos>
</object>
<object class="wxButton" name="wxID_CANCEL">
<label>Cancel</label>
<pos>166,190d</pos>
</object>
<size>218,200d</size>
<style></style>
</object>
</resource>//////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
// RCS-ID: $Id: dlgServer.cpp,v 1.16 2005/01/10 15:26:30 dpage Exp $
// Copyright (C) 2002 - 2005, The pgAdmin Development Team
// This software is released under the Artistic Licence
//
// dlgServer.cpp - PostgreSQL Database Property
//
//////////////////////////////////////////////////////////////////////////
// wxWindows headers
#include <wx/wx.h>
// App headers
#include "pgAdmin3.h"
#include "misc.h"
#include "frmMain.h"
#include "dlgServer.h"
#include "pgDatabase.h"
// Images
#include "images/server.xpm"
// pointer to controls
#define txtDescription CTRL_TEXT("txtDescription")
#define txtService CTRL_TEXT("txtService")
#define cbDatabase CTRL_COMBOBOX("cbDatabase")
#define txtPort CTRL_TEXT("txtPort")
#define cbSSL CTRL_COMBOBOX("cbSSL")
#define txtUsername CTRL_TEXT("txtUsername")
#define chkNeedPwd CTRL_CHECKBOX("chkNeedPwd")
#define stPassword CTRL_STATIC("stPassword")
#define txtPassword CTRL_TEXT("txtPassword")
extern double libpqVersion;
BEGIN_EVENT_TABLE(dlgServer, dlgProperty)
EVT_NOTEBOOK_PAGE_CHANGED(XRCID("nbNotebook"), dlgServer::OnPageSelect)
EVT_TEXT(XRCID("txtDescription"), dlgProperty::OnChange)
EVT_TEXT(XRCID("txtService"), dlgProperty::OnChange)
EVT_TEXT(XRCID("cbDatabase"), dlgProperty::OnChange)
EVT_COMBOBOX(XRCID("cbDatabase"), dlgProperty::OnChange)
EVT_TEXT(XRCID("txtPort") , dlgProperty::OnChange)
EVT_TEXT(XRCID("txtUsername"), dlgProperty::OnChange)
EVT_COMBOBOX(XRCID("cbSSL"), dlgProperty::OnChange)
EVT_CHECKBOX(XRCID("chkNeedPwd"), dlgServer::OnChangeNeedPwd)
EVT_BUTTON(wxID_OK, dlgServer::OnOK)
END_EVENT_TABLE();
dlgServer::dlgServer(frmMain *frame, pgServer *node)
: dlgProperty(frame, wxT("dlgServer"))
{
SetIcon(wxIcon(server_xpm));
server=node;
objectType = PG_SERVER;
cbDatabase->Append(settings->GetLastDatabase());
cbDatabase->SetSelection(0);
txtPort->SetValue(NumToStr((long)settings->GetLastPort()));
cbSSL->SetSelection(settings->GetLastSSL());
txtUsername->SetValue(settings->GetLastUsername());
chkNeedPwd->SetValue(true);
wxLogInfo(wxT("MAC debug: Dialog: %s %d %d"), GetFont().GetNativeFontInfoDesc().c_str(), GetCharWidth(),
GetCharHeight());
wxWindow *w;
w=CTRL_NOTEBOOK("nbNotebook");
wxLogInfo(wxT("MAC debug: outer notebook: %s %d %d"), w->GetFont().GetNativeFontInfoDesc().c_str(),
w->GetCharWidth(),w->GetCharHeight());
w=CTRL_NOTEBOOK("testNotebook");
wxLogInfo(wxT("MAC debug: inner notebook: %s %d %d"), w->GetFont().GetNativeFontInfoDesc().c_str(),
w->GetCharWidth(),w->GetCharHeight());
}
dlgServer::~dlgServer()
{
if (!server)
{
settings->SetLastDatabase(cbDatabase->GetValue());
settings->SetLastPort(StrToLong(txtPort->GetValue()));
settings->SetLastSSL(cbSSL->GetSelection());
settings->SetLastUsername(txtUsername->GetValue());
}
}
pgObject *dlgServer::GetObject()
{
return server;
}
void dlgServer::OnOK(wxCommandEvent &ev)
{
// notice: changes active after reconnect
EnableOK(false);
if (server)
{
server->iSetName(GetName());
server->iSetDescription(txtDescription->GetValue());
if (txtService->GetValue() != server->GetServiceID())
{
mainForm->StartMsg(_("Checking server status"));
server->iSetServiceID(txtService->GetValue());
mainForm->EndMsg();
}
server->iSetPort(StrToLong(txtPort->GetValue()));
server->iSetSSL(cbSSL->GetSelection());
server->iSetLastDatabase(cbDatabase->GetValue());
server->iSetUsername(txtUsername->GetValue());
server->iSetNeedPwd(chkNeedPwd->GetValue());
mainForm->execSelChange(server->GetId(), true);
mainForm->GetBrowser()->SetItemText(item, server->GetFullName());
}
if (IsModal())
{
EndModal(wxID_OK);
return;
}
else
Destroy();
}
void dlgServer::OnPageSelect(wxNotebookEvent &event)
{
// to prevent dlgProperty from catching it
}
wxString dlgServer::GetHelpPage() const
{
return wxT("pgadmin/connect");
}
int dlgServer::GoNew()
{
if (cbSSL->IsEmpty())
return Go(true);
else
{
CheckChange();
return ShowModal();
}
}
int dlgServer::Go(bool modal)
{
cbSSL->Append(wxT(" "));
#ifdef SSL
cbSSL->Append(_("require"));
cbSSL->Append(_("prefer"));
if (libpqVersion > 7.3)
{
cbSSL->Append(_("allow"));
cbSSL->Append(_("disable"));
}
#endif
if (server)
{
cbDatabase->Append(server->GetDatabaseName());
txtDescription->SetValue(server->GetDescription());
txtService->SetValue(server->GetServiceID());
txtPort->SetValue(NumToStr((long)server->GetPort()));
cbSSL->SetSelection(server->GetSSL());
cbDatabase->SetValue(server->GetDatabaseName());
txtUsername->SetValue(server->GetUsername());
chkNeedPwd->SetValue(server->GetNeedPwd());
stPassword->Disable();
txtPassword->Disable();
if (connection)
{
txtName->Disable();
cbDatabase->Disable();
txtPort->Disable();
cbSSL->Disable();
txtUsername->Disable();
chkNeedPwd->Disable();
}
}
else
{
SetTitle(_("Add server"));
}
int rc=dlgProperty::Go(modal);
CheckChange();
return rc;
}
wxString dlgServer::GetPassword()
{
if (chkNeedPwd->GetValue())
return txtPassword->GetValue();
return wxEmptyString;
}
pgObject *dlgServer::CreateObject(pgCollection *collection)
{
wxString name=GetName();
pgObject *obj=new pgServer(GetName(), txtDescription->GetValue(), cbDatabase->GetValue(),
txtUsername->GetValue(), StrToLong(txtPort->GetValue()), !chkNeedPwd->GetValue(), cbSSL->GetSelection());
return obj;
}
void dlgServer::OnChangeNeedPwd(wxCommandEvent &ev)
{
if (!server)
txtPassword->Enable(chkNeedPwd->GetValue());
OnChange(ev);
}
void dlgServer::CheckChange()
{
wxString name=GetName();
bool enable=true;
if (server)
{
enable = name != server->GetName()
|| txtDescription->GetValue() != server->GetDescription()
|| txtService->GetValue() != server->GetServiceID()
|| StrToLong(txtPort->GetValue()) != server->GetPort()
|| cbDatabase->GetValue() != server->GetDatabaseName()
|| txtUsername->GetValue() != server->GetUsername()
|| cbSSL->GetSelection() != server->GetSSL()
|| chkNeedPwd->GetValue() != server->GetNeedPwd();
}
CheckValid(enable, !name.IsEmpty(), _("Please specify address."));
CheckValid(enable, !txtDescription->GetValue().IsEmpty(), _("Please specify description."));
CheckValid(enable, StrToLong(txtPort->GetValue()) > 0, _("Please specify port."));
CheckValid(enable, !txtUsername->GetValue().IsEmpty(), _("Please specify user name"));
EnableOK(enable);
}
wxString dlgServer::GetSql()
{
return wxEmptyString;
}
I wondered if anyone else experienced this compile error with wxMac-2.5.4 and how they fixed it: Patrick-Hatchers-Computer:~/downloads/wxMac-2.5.4 fd02ph0$ make (test -d utils/wxrc && cd utils/wxrc && make all) || true g++ -o wxrc wxrc_wxrc.o -framework QuickTime -framework IOKit -framework Carbon -framework Cocoa -framework System -L../../lib -lwx_base_carbon_xml-2.5 -lwx_base_carbon-2.5 -lwxtiff-2.5 -lwxjpeg-2.5 -lwxpng-2.5 -lwxexpat-2.5 -framework QuickTime -framework IOKit -framework Carbon -framework Cocoa -framework System -lz -lpthread -liconv ld: Undefined symbols: wxEvtHandler::GetClassInfo() const wxObject::GetClassInfo() const make[1]: *** [wxrc] Error 1 TIA Patrick Hatcher
ignore this message. I just installed 2.5.5 and it worked correctly
Patrick Hatcher
Macys.Com
Legacy Integration Developer
415-422-1610 office
HatcherPT - AIM
Patrick Hatcher
<PHatcher@macys.c
om> To
Sent by: pgadmin-hackers@postgresql.org
pgadmin-hackers-o cc
wner@postgresql.o
rg Subject
[pgadmin-hackers] OSX wxMac-2.5.4
error
04/07/05 10:51 AM
I wondered if anyone else experienced this compile error with wxMac-2.5.4
and how they fixed it:
Patrick-Hatchers-Computer:~/downloads/wxMac-2.5.4 fd02ph0$ make
(test -d utils/wxrc && cd utils/wxrc && make all) || true
g++ -o wxrc wxrc_wxrc.o -framework QuickTime -framework IOKit -framework
Carbon -framework Cocoa -framework System -L../../lib
-lwx_base_carbon_xml-2.5 -lwx_base_carbon-2.5 -lwxtiff-2.5 -lwxjpeg-2.5
-lwxpng-2.5 -lwxexpat-2.5 -framework QuickTime -framework IOKit
-framework Carbon -framework Cocoa -framework System -lz -lpthread -liconv
ld: Undefined symbols:
wxEvtHandler::GetClassInfo() const
wxObject::GetClassInfo() const
make[1]: *** [wxrc] Error 1
TIA
Patrick Hatcher
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Florian G. Pflug wrote: > ... > 2005-04-08 12:25:22 INFO : MAC debug: Dialog: 0;11;70;90;90;0;Lucida > Grande;0 7 13 > 2005-04-08 12:25:22 INFO : MAC debug: outer notebook: > 0;13;70;90;90;0;Lucida Grande;0 9 16 > 2005-04-08 12:25:22 INFO : MAC debug: inner notebook: > 0;13;70;90;90;0;Lucida Grande;0 9 16 These values should be equal for Dialog and other controls, but they aren't. A sample is posted to wx-dev (and CCed to you), please check the sample too (can you supply the values/a snapshot?) Regards, Andreas