1
1
//////////////////////////////////////////////////////////////////////////
3
3
// pgAdmin III - PostgreSQL Tools
4
// RCS-ID: $Id: events.cpp 6930 2008-01-02 00:10:01Z dpage $
5
// Copyright (C) 2002 - 2008, The pgAdmin Development Team
6
// This software is released under the Artistic Licence
4
// RCS-ID: $Id: events.cpp 7939 2009-06-23 08:43:51Z dpage $
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
6
// This software is released under the BSD Licence
8
8
// events.cpp - Event handlers for frmMain
37
38
#include "schema/pgTable.h"
38
39
#include "dlg/dlgProperty.h"
40
extern wxString loadPath;
44
42
BEGIN_EVENT_TABLE(frmMain, pgFrame)
45
43
EVT_ERASE_BACKGROUND( frmMain::OnEraseBackground)
259
256
properties->ClearAll();
260
properties->AddColumn(_("Properties"), 500);
257
properties->AddColumn(_("Properties"), properties->GetSize().GetWidth() - 10);
261
258
properties->InsertItem(0, _("No properties are available for the current selection"), PGICON_PROPERTY);
263
260
sqlPane->Clear();
591
588
text = _("Are you sure you wish to drop multiple objects?");
592
589
caption = _("Drop multiple objects?");
594
wxMessageDialog msg(this, text, caption, wxYES_NO | wxICON_QUESTION);
591
wxMessageDialog msg(this, text, caption, wxYES_NO | wxICON_QUESTION | wxNO_DEFAULT);
595
592
if (msg.ShowModal() != wxID_YES)
674
text = wxString::Format(_("Are you sure you wish to drop %s %s?"),
675
data->GetTranslatedTypeName().c_str(), data->GetFullIdentifier().c_str());
672
* curerntObject is set using the following command.
673
* i.e. currentObject = browser->GetObject(item);
674
* While fetching this object using this code, somehow it looses its virtual table pointer.
675
* Hence, it is not able to call the GetFullIdentifier - virtual function from the
676
* particular class, but it will always call this functions from pgObject class always.
677
* To rectify this problem, we need to explicitly check the meta data type and call the
678
* function from the particular class.
680
if (data->GetMetaType() == PGM_SERVER)
681
text = wxString::Format(_("Are you sure you wish to drop %s \"%s\"?"),
682
data->GetTranslatedTypeName().c_str(), ((pgServer*)data)->GetFullIdentifier().c_str());
684
text = wxString::Format(_("Are you sure you wish to drop %s %s?"),
685
data->GetTranslatedTypeName().c_str(), data->GetFullIdentifier().c_str());
676
686
caption = wxString::Format(_("Drop %s?"), data->GetTranslatedTypeName().c_str());
678
wxMessageDialog msg(this, text, caption, wxYES_NO | wxICON_QUESTION);
688
wxMessageDialog msg(this, text, caption, wxYES_NO | wxICON_QUESTION | wxNO_DEFAULT);
679
689
if (msg.ShowModal() != wxID_YES)