Skip to content

Commit

Permalink
#353 geoda blurs on retina display
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Jan 27, 2017
1 parent da6792a commit 5198b1f
Show file tree
Hide file tree
Showing 24 changed files with 279 additions and 141 deletions.
72 changes: 37 additions & 35 deletions BuildTools/macosx/GeoDa.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1484,10 +1484,11 @@
"\"$(SRCROOT)/../..\"",
"\"$(SRCROOT)/../../ogr/ogrsf_frmts/oci\"",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-I./libraries/lib/wx/include/osx_cocoa-unicode-static-3.0",
"-I./libraries/include/wx-3.0/",
"-I./libraries/lib/wx/include/osx_cocoa-unicode-static-3.1",
"-I./libraries/include/wx-3.1/",
"-I./libraries/include/boost",
"-I./libraries/include",
"-D_FILE_OFFSET_BITS=64",
Expand Down Expand Up @@ -1517,24 +1518,24 @@
OpenGL,
"-framework",
AGL,
"./libraries/lib/libwx_osx_cocoau_xrc-3.0.a",
"./libraries/lib/libwx_osx_cocoau_html-3.0.a",
"./libraries/lib/libwx_osx_cocoau_qa-3.0.a",
"./libraries/lib/libwx_osx_cocoau_adv-3.0.a",
"./libraries/lib/libwx_osx_cocoau_core-3.0.a",
"./libraries/lib/libwx_osx_cocoau_webview-3.0.a",
"./libraries/lib/libwx_baseu_xml-3.0.a",
"./libraries/lib/libwx_baseu_net-3.0.a",
"./libraries/lib/libwx_baseu-3.0.a",
"./libraries/lib/libwx_osx_cocoau_gl-3.0.a",
"./libraries/lib/libwx_osx_cocoau_richtext-3.0.a",
"./libraries/lib/libwx_osx_cocoau_aui-3.0.a",
"-lwxpng-3.0",
"-lwxjpeg-3.0",
"./libraries/lib/libwx_osx_cocoau_xrc-3.1.a",
"./libraries/lib/libwx_osx_cocoau_html-3.1.a",
"./libraries/lib/libwx_osx_cocoau_qa-3.1.a",
"./libraries/lib/libwx_osx_cocoau_adv-3.1.a",
"./libraries/lib/libwx_osx_cocoau_core-3.1.a",
"./libraries/lib/libwx_osx_cocoau_webview-3.1.a",
"./libraries/lib/libwx_baseu_xml-3.1.a",
"./libraries/lib/libwx_baseu_net-3.1.a",
"./libraries/lib/libwx_baseu-3.1.a",
"./libraries/lib/libwx_osx_cocoau_gl-3.1.a",
"./libraries/lib/libwx_osx_cocoau_richtext-3.1.a",
"./libraries/lib/libwx_osx_cocoau_aui-3.1.a",
"-lwxpng-3.1",
"-lwxjpeg-3.1",
"-framework",
WebKit,
"-lexpat",
"-lwxregexu-3.0",
"-lwxregexu-3.1",
"-lz",
"-lpthread",
"-liconv",
Expand Down Expand Up @@ -1571,11 +1572,12 @@
"\"$(SRCROOT)/../..\"",
"\"$(SRCROOT)/../../ogr/ogrsf_frmts/oci\"",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-I./libraries/lib/wx/include/osx_cocoa-unicode-static-3.0",
"-I./libraries/include/wx-3.0/",
"-I./libraries/lib/wx/include/osx_cocoa-unicode-static-3.1",
"-I./libraries/include/wx-3.1/",
"-I./libraries/include/boost",
"-I./libraries/include",
"-D_FILE_OFFSET_BITS=64",
Expand Down Expand Up @@ -1603,25 +1605,25 @@
OpenGL,
"-framework",
AGL,
"./libraries/lib/libwx_osx_cocoau_xrc-3.0.a",
"./libraries/lib/libwx_osx_cocoau_html-3.0.a",
"./libraries/lib/libwx_osx_cocoau_qa-3.0.a",
"./libraries/lib/libwx_osx_cocoau_adv-3.0.a",
"./libraries/lib/libwx_osx_cocoau_core-3.0.a",
"./libraries/lib/libwx_osx_cocoau_webview-3.0.a",
"./libraries/lib/libwx_baseu_xml-3.0.a",
"./libraries/lib/libwx_baseu_net-3.0.a",
"./libraries/lib/libwx_baseu-3.0.a",
"./libraries/lib/libwx_osx_cocoau_gl-3.0.a",
"./libraries/lib/libwx_osx_cocoau_richtext-3.0.a",
"./libraries/lib/libwx_osx_cocoau_aui-3.0.a",
"-lwxpng-3.0",
"-lwxjpeg-3.0",
"./libraries/lib/libwx_osx_cocoau_xrc-3.1.a",
"./libraries/lib/libwx_osx_cocoau_html-3.1.a",
"./libraries/lib/libwx_osx_cocoau_qa-3.1.a",
"./libraries/lib/libwx_osx_cocoau_adv-3.1.a",
"./libraries/lib/libwx_osx_cocoau_core-3.1.a",
"./libraries/lib/libwx_osx_cocoau_webview-3.1.a",
"./libraries/lib/libwx_baseu_xml-3.1.a",
"./libraries/lib/libwx_baseu_net-3.1.a",
"./libraries/lib/libwx_baseu-3.1.a",
"./libraries/lib/libwx_osx_cocoau_gl-3.1.a",
"./libraries/lib/libwx_osx_cocoau_richtext-3.1.a",
"./libraries/lib/libwx_osx_cocoau_aui-3.1.a",
"-lwxpng-3.1",
"-lwxjpeg-3.1",
"-framework",
WebKit,
"-lexpat",
"-lwxregexu-3.0",
"-lwxtiff-3.0",
"-lwxregexu-3.1",
"-lwxtiff-3.1",
"-lz",
"-lpthread",
"-liconv",
Expand Down
2 changes: 1 addition & 1 deletion BuildTools/macosx/build-express.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ if ! [ -f "$PREFIX/lib/$LIB_CHECKER" ] ; then
cd $LIB_NAME
cp -rf $GEODA_HOME/dep/$LIB_NAME/* .
make clean
./configure --with-cocoa --disable-shared --enable-mediactrl=no --disable-monolithic --with-opengl --enable-postscript --enable-textfile --without-liblzma --enable-webview --enable-compat28 --prefix=$PREFIX
./configure --with-cocoa --disable-shared --enable-mediactrl=no --disable-monolithic --with-opengl --enable-postscript --enable-textfile --without-liblzma --enable-webview --enable-compat28 --disable-mediactrl --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk --prefix=$PREFIX
$MAKER
make install
cd ..
Expand Down
5 changes: 4 additions & 1 deletion DataViewer/MergeTableDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ void MergeTableDlg::OnOpenClick( wxCommandEvent& ev )
wxLogMessage("Entering MergeTableDlg::OnOpenClick()");
try {
bool showCsvConfigure = GdaConst::show_csv_configure_in_merge;
ConnectDatasourceDlg dlg(this, wxDefaultPosition, wxDefaultSize, showCsvConfigure);
wxPoint pos = GetPosition();
wxSize sz = GetSize();
pos.x += sz.GetWidth();
ConnectDatasourceDlg dlg(this, pos, wxDefaultSize, showCsvConfigure, false);

if (dlg.ShowModal() != wxID_OK)
return;
Expand Down
12 changes: 6 additions & 6 deletions DialogTools/AutoUpdateDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ AutoUpdateDlg::AutoUpdateDlg(wxWindow* parent,

wxBoxSizer* lbl_box = new wxBoxSizer(wxVERTICAL);
lbl_box->AddSpacer(20);
lbl_box->Add(lbl, 1, wxALIGN_CENTER | wxEXPAND |wxALL, 10);
lbl_box->Add(whatsnew, 1, wxALIGN_LEFT | wxEXPAND |wxALL, 10);
lbl_box->Add(lbl, 1, wxALIGN_CENTER | wxALL, 10);
lbl_box->Add(whatsnew, 1, wxALIGN_LEFT | wxALL, 10);
lbl_box->Add(prg_bar, 1, wxEXPAND |wxALL, 10);

wxButton* btn_skip = NULL;
Expand All @@ -299,15 +299,15 @@ AutoUpdateDlg::AutoUpdateDlg(wxWindow* parent,
btn_skip = new wxButton(panel, wxID_ANY, "Skip");
wxButton* btn_update= new wxButton(panel, wxID_ANY, "Update", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
wxBoxSizer* btn_box = new wxBoxSizer(wxHORIZONTAL);
btn_box->Add(btn_cancel, 1, wxALIGN_CENTER |wxEXPAND| wxALL, 10);
btn_box->Add(btn_cancel, 1, wxALIGN_CENTER | wxALL, 10);
if (showSkip) {
btn_box->Add(btn_skip, 1, wxALIGN_CENTER | wxEXPAND | wxALL, 10);
btn_box->Add(btn_skip, 1, wxALIGN_CENTER | wxALL, 10);
btn_skip->Connect(wxEVT_BUTTON, wxCommandEventHandler(AutoUpdateDlg::OnSkipClick), NULL, this);
}
btn_box->Add(btn_update, 1, wxALIGN_CENTER | wxEXPAND | wxALL, 10);
btn_box->Add(btn_update, 1, wxALIGN_CENTER | wxALL, 10);

wxBoxSizer* box = new wxBoxSizer(wxVERTICAL);
box->Add(lbl_box, 0, wxALIGN_TOP | wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10);
box->Add(lbl_box, 0, wxALIGN_TOP | wxLEFT | wxRIGHT | wxTOP, 10);
box->Add(btn_box, 0, wxALIGN_CENTER| wxLEFT | wxRIGHT | wxTOP, 30);

panel->SetSizerAndFit(box);
Expand Down
41 changes: 23 additions & 18 deletions DialogTools/ConnectDatasourceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,19 +368,22 @@ wxString RecentDatasource::GetLayerName(wxString ds_name)
// Class ConnectDatasourceDlg
////////////////////////////////////////////////////////////////////////////////

BEGIN_EVENT_TABLE( ConnectDatasourceDlg, wxDialog )
BEGIN_EVENT_TABLE( ConnectDatasourceDlg, wxFrame)
EVT_BUTTON(XRCID("IDC_OPEN_IASC"), ConnectDatasourceDlg::OnBrowseDSfileBtn)
EVT_BUTTON(XRCID("ID_BTN_LOOKUP_TABLE"), ConnectDatasourceDlg::OnLookupDSTableBtn)
//EVT_BUTTON(XRCID("ID_CARTODB_LOOKUP_TABLE"), ConnectDatasourceDlg::OnLookupCartoDBTableBtn)
//EVT_BUTTON(XRCID("ID_BTN_LOOKUP_WSLAYER"), ConnectDatasourceDlg::OnLookupWSLayerBtn)
EVT_BUTTON(wxID_OK, ConnectDatasourceDlg::OnOkClick )
EVT_BUTTON(wxID_CANCEL, ConnectDatasourceDlg::OnCancelClick )
END_EVENT_TABLE()


ConnectDatasourceDlg::ConnectDatasourceDlg(wxWindow* parent, const wxPoint& pos,
const wxSize& size,
bool showCsvConfigure_)
:datasource(0), scrl(0), recent_panel(0), showCsvConfigure(showCsvConfigure_)
bool showCsvConfigure_,
bool showRecentPanel_)
:datasource(0), scrl(0), recent_panel(0), showCsvConfigure(showCsvConfigure_),
showRecentPanel(showRecentPanel_)
{
base_xrcid_recent_thumb = 7000;
base_xrcid_sample_thumb = 7500;
Expand All @@ -393,7 +396,7 @@ ConnectDatasourceDlg::ConnectDatasourceDlg(wxWindow* parent, const wxPoint& pos,
CreateControls();
SetPosition(pos);

if (GdaConst::show_recent_sample_connect_ds_dialog) {
if (showRecentPanel) {
RecentDatasource recent_ds;
if (recent_ds.GetRecords() > 0) {
wxBoxSizer* sizer;
Expand Down Expand Up @@ -421,6 +424,8 @@ ConnectDatasourceDlg::ConnectDatasourceDlg(wxWindow* parent, const wxPoint& pos,
Move(pos);

GetSizer()->Fit(this);
Restore();
Raise();
}

ConnectDatasourceDlg::~ConnectDatasourceDlg()
Expand Down Expand Up @@ -514,6 +519,8 @@ void ConnectDatasourceDlg::OnRecentDelete(wxCommandEvent& event)
InitRecentPanel();
}



void ConnectDatasourceDlg::OnRecent(wxCommandEvent& event)
{
int xrcid = event.GetId();
Expand All @@ -533,7 +540,7 @@ void ConnectDatasourceDlg::OnRecent(wxCommandEvent& event)
layer_name = project->layername;
}
recent_ds.Add(ds_name, ds_name, layer_name);
EndDialog(wxID_CANCEL);
EndDialog();
} else {

IDataSource* ds = recent_ds.GetDatasource(ds_name);
Expand All @@ -548,7 +555,8 @@ void ConnectDatasourceDlg::OnRecent(wxCommandEvent& event)
SaveRecentDataSource(ds, layername);
layer_name = layername;
datasource = ds;
EndDialog(wxID_OK);
is_ok_clicked = true;
EndDialog();
}
}
}
Expand Down Expand Up @@ -586,7 +594,7 @@ void ConnectDatasourceDlg::InitRecentPanel()
void ConnectDatasourceDlg::CreateControls()
{

bool test = wxXmlResource::Get()->LoadDialog(this, GetParent(),"IDD_CONNECT_DATASOURCE");
bool test = wxXmlResource::Get()->LoadFrame(this, GetParent(),"IDD_CONNECT_DATASOURCE");
FindWindow(XRCID("wxID_OK"))->Enable(true);
// init db_table control that is unique in this class
m_drag_drop_box = XRCCTRL(*this, "IDC_DRAG_DROP_BOX",wxStaticBitmap);
Expand All @@ -606,7 +614,7 @@ void ConnectDatasourceDlg::CreateControls()
noshow_recent = XRCCTRL(*this, "IDC_NOSHOW_RECENT_SAMPLES", wxCheckBox);

noshow_recent->Bind(wxEVT_CHECKBOX, &ConnectDatasourceDlg::OnNoShowRecent, this);
if (!GdaConst::show_recent_sample_connect_ds_dialog) {
if (!showRecentPanel) {
noshow_recent->Hide();
}

Expand All @@ -624,6 +632,7 @@ void ConnectDatasourceDlg::OnNoShowRecent( wxCommandEvent& event)
noshow_recent->Hide();
GetSizer()->Fit(this);

showRecentPanel = false;
GdaConst::show_recent_sample_connect_ds_dialog = false;
OGRDataAdapter::GetInstance().AddEntry("show_recent_sample_connect_ds_dialog", "0");
}
Expand Down Expand Up @@ -682,12 +691,6 @@ void ConnectDatasourceDlg::OnLookupCartoDBTableBtn( wxCommandEvent& event )
}


/**
* This function handles the event of user click OK button.
* When user chooses a data source, validate it first,
* then create a Project() that will be used by the
* main program.
*/
void ConnectDatasourceDlg::OnOkClick( wxCommandEvent& event )
{
LOG_MSG("Entering ConnectDatasourceDlg::OnOkClick");
Expand All @@ -704,7 +707,7 @@ void ConnectDatasourceDlg::OnOkClick( wxCommandEvent& event )
} catch( GdaException ex) {
LOG_MSG(ex.what());
}
EndDialog(wxID_CANCEL);
EndDialog();
}
return;
}
Expand Down Expand Up @@ -763,8 +766,9 @@ void ConnectDatasourceDlg::OnOkClick( wxCommandEvent& event )
wxLogMessage(_("Open Layer:") + layername);

SaveRecentDataSource(datasource, layer_name);

EndDialog(wxID_OK);

is_ok_clicked = true;
EndDialog();

} catch (GdaException& e) {
wxString msg;
Expand Down Expand Up @@ -1079,7 +1083,8 @@ void ConnectDatasourceDlg::OnSample(wxCommandEvent& event)
} else {
datasource = ds;
layer_name = layername;
EndDialog(wxID_OK);
is_ok_clicked = true;
EndDialog();
}

}
Expand Down
10 changes: 7 additions & 3 deletions DialogTools/ConnectDatasourceDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,19 @@ class RecentDatasource



////////////////////////////////////////////////////////////////////////////////
//
// Class ConnectDatasourceDlg
//
//
////////////////////////////////////////////////////////////////////////////////
class ConnectDatasourceDlg: public DatasourceDlg
{
public:
ConnectDatasourceDlg(wxWindow* parent,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
bool showCsvConfigure=true);
bool showCsvConfigure=true,
bool showRecentPanel=GdaConst::show_recent_sample_connect_ds_dialog);
virtual ~ConnectDatasourceDlg();

void CreateControls();
Expand All @@ -102,9 +104,10 @@ class ConnectDatasourceDlg: public DatasourceDlg
void OnLookupCartoDBTableBtn( wxCommandEvent& event );
IDataSource* GetDataSource(){ return datasource; }


protected:
bool showCsvConfigure;
bool showRecentPanel;

wxStaticBitmap* m_drag_drop_box;
wxBitmapButton* m_database_lookup_table;
wxBitmapButton* m_database_lookup_wslayer;
Expand Down Expand Up @@ -136,6 +139,7 @@ class ConnectDatasourceDlg: public DatasourceDlg
void OnRecentDelete(wxCommandEvent& event);

void OnNoShowRecent(wxCommandEvent& event);


DECLARE_EVENT_TABLE()
};
Expand Down
Loading

0 comments on commit 5198b1f

Please sign in to comment.