OSX Status
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
Re: OSX Status
От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
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
Re: OSX Status
От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
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
Properties
Address
5,7d
70,5d
15,-1d
Description
5,22d
70,20d
15,-1d
Service
5,37d
70,35d
15,-1d
Port
5,52d
70,50d
26,-1d
SSL
10,52d
10,50d
15,12d
Initial DB
5,67d
70,65d
15,12d
Username
5,82d
70,80d
15,-1d
need password
5,97d
1
70,95d
12,12d
Password
5,112d
70,110d
135,-1d
100,5d
100,75d
txt
5,5d
90,-1d
1
2,2d
214,145d
Help
2,150d
OK
1
113,150d
Cancel
166,150d
218,168d
Re: OSX Status
От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
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
Re: OSX Status
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
Re: OSX Status
От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
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
Properties
Address
1005,7d
1005,5d
100,-1d
some decent text
5,5d
100,-1d
some decent text
5,20d
100,-1d
Description
1005,22d
1070,20d
135,-1d
Service
1005,37d
1070,35d
135,-1d
Port
1005,52d
1070,50d
26,-1d
SSL
1000,52d
1120,50d
85,12d
Initial DB
1005,67d
1070,65d
135,12d
Username
1005,82d
1070,80d
135,-1d
need password
1005,97d
1
1070,95d
12,12d
Password
1005,112d
1070,110d
135,-1d
testpanel
some decent text
5,5d
80,-1d
5,35d
100,75d
1
5,5d
200,150d
Help
2,190d
some decent text
5,160d
80,-1d
OK
1
113,190d
Cancel
166,190d
218,200d
//////////////////////////////////////////////////////////////////////////
//
// 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
// 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;
}
OSX wxMac-2.5.4 error
От:
Patrick Hatcher <PHatcher@macys.com>
Дата:
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
Re: OSX wxMac-2.5.4 error
От:
Patrick Hatcher <PHatcher@macys.com>
Дата:
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
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)
Re: OSX Status
От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
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