New DnD and Clipboard code

Rearranged wxApp to do the same in the
    same order upon program start-up on
    wxGTK and wxMSW
  ODBC tweaks
  exchanged wxDataFormat for wxIPCFormat


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-01-19 16:33:16 +00:00
parent c75e66953f
commit 0d2a2b601b
30 changed files with 2042 additions and 940 deletions

View File

@@ -438,13 +438,6 @@ void MyPanel::OnPasteFromClipboard( wxCommandEvent &WXUNUSED(event) )
{
#ifdef __WXGTK__
if (!wxTheClipboard->IsSupportedFormat( wxDF_TEXT ))
{
*m_text << "The clipboard doesn't contain any data in the requested format." << "\n";
return;
}
if (!wxTheClipboard->Open())
{
*m_text << "Error opening the clipboard." << "\n";
@@ -485,8 +478,6 @@ void MyPanel::OnCopyToClipboard( wxCommandEvent &WXUNUSED(event) )
if (text.IsEmpty()) return;
wxTextDataObject *data = new wxTextDataObject( text );
if (!wxTheClipboard->Open())
{
*m_text << "Error opening the clipboard." << "\n";
@@ -498,7 +489,11 @@ void MyPanel::OnCopyToClipboard( wxCommandEvent &WXUNUSED(event) )
*m_text << "Successfully opened the clipboard." << "\n";
}
if (!wxTheClipboard->SetData( data ))
wxTextDataObject *data = new wxTextDataObject( text );
wxDataBroker *broker = new wxDataBroker();
broker->Add( data );
if (!wxTheClipboard->SetData( broker ))
{
*m_text << "Error while copying to the clipboard." << "\n";
}

View File

@@ -622,10 +622,7 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
// The constructed where clause below has a sub-query within it "SELECT MIN(NAME) FROM %s"
// to achieve a single row (in this case the first name in alphabetical order).
Contact->whereStr.Printf("NAME = 'Robert'",Contact->tableName);
/*
Contact->whereStr.Printf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->tableName);
*/
// NOTE: (const char*) returns a pointer which may not be valid later, so this is short term use only
Contact->where = (char*) (const char*) Contact->whereStr;
@@ -786,12 +783,9 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
}
// Previous record not available, retrieve first record in table
Contact->whereStr = "NAME = 'Robert' ";
/*
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += Contact->tableName;
Contact->whereStr += ")";
*/
Contact->where = (char*) (const char*) Contact->whereStr;
if (!Contact->Query())
{
@@ -842,10 +836,9 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
if (strcmp(qryWhere, (const char*) Contact->qryWhereStr))
{
Contact->orderBy = "NAME";
/*
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += CONTACT_TABLE_NAME;
*/
// Append the query where string (if there is one)
Contact->qryWhereStr = qryWhere;
if (strlen(qryWhere))
@@ -885,12 +878,11 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
// Query the first record in the table
Contact->orderBy = "NAME";
Contact->whereStr = "NAME = 'Robert' ";
/*
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += CONTACT_TABLE_NAME;
Contact->whereStr += ")";
*/
Contact->where = (char*) (const char*) Contact->whereStr;
if (!Contact->Query())
{
@@ -1210,10 +1202,8 @@ bool CeditorDlg::GetNextRec()
{
wxString w;
/*
w = "NAME = (SELECT MIN(NAME) FROM ";
*/
w = "NAME = (SELECT NAME FROM ";
w += Contact->tableName;
w += " WHERE NAME > '";
w += Contact->Name;

View File

@@ -26,7 +26,7 @@ enum DialogModes {mView,mCreate,mEdit,mSearch};
// Name of the table to be created/opened
const char CONTACT_TABLE_NAME[] = "CONTACTS";
const char CONTACT_TABLE_NAME[] = "contacts";
// Nuber of columns in the above table
const int CONTACT_NO_COLS = 12; // 0-11

View File

@@ -309,8 +309,7 @@ void DnDFrame::OnLeftDown(wxMouseEvent &WXUNUSED(event) )
{
// start drag operation
wxTextDataObject data(m_strText);
wxDropSource dragSource(data, this);
wxDropSource dragSource( new wxTextDataObject (m_strText), this );
const char *pc;
switch ( dragSource.DoDragDrop(TRUE) )