Solaris compilation patches

dbtest now works a little


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-02-11 12:44:10 +00:00
parent 3502e687e2
commit 8fc613f14f
12 changed files with 113 additions and 98 deletions

View File

@@ -619,7 +619,8 @@ 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" // 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). // to achieve a single row (in this case the first name in alphabetical order).
Contact->whereStr.Printf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->tableName); // commented out because PostgreSQL can't do this
//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 // 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; Contact->where = (char*) (const char*) Contact->whereStr;
@@ -779,10 +780,13 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
} }
} }
// commented out because PostgreSQL can't do this
// Previous record not available, retrieve first record in table // Previous record not available, retrieve first record in table
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM "; //Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += Contact->tableName; //Contact->whereStr += Contact->tableName;
Contact->whereStr += ")"; //Contact->whereStr += ")";
Contact->where = (char*) (const char*) Contact->whereStr; Contact->where = (char*) (const char*) Contact->whereStr;
if (!Contact->Query()) if (!Contact->Query())
{ {
@@ -832,9 +836,12 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
// display it, if the query string has changed. // display it, if the query string has changed.
if (strcmp(qryWhere, (const char*) Contact->qryWhereStr)) if (strcmp(qryWhere, (const char*) Contact->qryWhereStr))
{ {
Contact->orderBy = "NAME";
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM "; // commented out because PostgreSQL can't do this
Contact->whereStr += CONTACT_TABLE_NAME; Contact->whereStr = "";
//Contact->orderBy = "NAME";
//Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
//Contact->whereStr += CONTACT_TABLE_NAME;
// Append the query where string (if there is one) // Append the query where string (if there is one)
Contact->qryWhereStr = qryWhere; Contact->qryWhereStr = qryWhere;
@@ -844,7 +851,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
Contact->whereStr += Contact->qryWhereStr; Contact->whereStr += Contact->qryWhereStr;
} }
// Close the expression with a right paren // Close the expression with a right paren
Contact->whereStr += ")"; // Contact->whereStr += ")";
// Requery the table // Requery the table
Contact->where = (char*) (const char*) Contact->whereStr; Contact->where = (char*) (const char*) Contact->whereStr;
if (!Contact->Query()) if (!Contact->Query())
@@ -876,9 +883,10 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
// Query the first record in the table // Query the first record in the table
Contact->orderBy = "NAME"; Contact->orderBy = "NAME";
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM "; // commented out because PostgreSQL can't do this
Contact->whereStr += CONTACT_TABLE_NAME; //Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += ")"; //Contact->whereStr += CONTACT_TABLE_NAME;
//Contact->whereStr += ")";
Contact->where = (char*) (const char*) Contact->whereStr; Contact->where = (char*) (const char*) Contact->whereStr;
if (!Contact->Query()) if (!Contact->Query())
@@ -1199,10 +1207,11 @@ bool CeditorDlg::GetNextRec()
{ {
wxString w; wxString w;
// commented out because PostgreSQL can't do this
w = "NAME = (SELECT MIN(NAME) FROM "; //w = "NAME = (SELECT MIN(NAME) FROM ";
w += Contact->tableName; //w += Contact->tableName;
w += " WHERE NAME > '"; // w += " WHERE NAME > '";
w = "(NAME > '";
w += Contact->Name; w += Contact->Name;
w += "'"; w += "'";
@@ -1229,9 +1238,11 @@ bool CeditorDlg::GetPrevRec()
{ {
wxString w; wxString w;
w = "NAME = (SELECT MAX(NAME) FROM "; // commented out because PostgreSQL can't do this
w += Contact->tableName; //w = "NAME = (SELECT MAX(NAME) FROM ";
w += " WHERE NAME < '"; //w += Contact->tableName;
//w += " WHERE NAME < '";
w = "(NAME < '";
w += Contact->Name; w += Contact->Name;
w += "'"; w += "'";

View File

@@ -1031,8 +1031,8 @@ void wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName)
} currentToken = Field_Type; } currentToken = Field_Type;
// the flags and field values on the current line // the flags and field values on the current line
bool needsterminal = false, bool needsterminal = FALSE,
copiousoutput = false; copiousoutput = FALSE;
wxString strType, wxString strType,
strOpenCmd, strOpenCmd,
strPrintCmd, strPrintCmd,

View File

@@ -30,7 +30,8 @@
#endif #endif
#include "unistd.h" #include "unistd.h"
#ifdef __SUN__ // add more here if you run into problems
#if defined(__SUN__) && !defined(__SunOs_5_6) && !defined(__SunOs_5_7)
extern "C" extern "C"
{ {
void usleep(unsigned long usec); void usleep(unsigned long usec);

View File

@@ -329,7 +329,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow ); if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
return (sm_overlayWindow); return (sm_overlayWindow != NULL);
} }
bool wxScreenDC::EndDrawingOnTop(void) bool wxScreenDC::EndDrawingOnTop(void)

View File

@@ -108,8 +108,7 @@ wxFont::wxFont( char *xFontName )
M_FONTDATA->m_font = gdk_font_load( xFontName ); M_FONTDATA->m_font = gdk_font_load( xFontName );
} }
wxFont::wxFont( int pointSize, int family, int style, int weight, bool underlined = FALSE, wxFont::wxFont( int pointSize, int family, int style, int weight, bool underlined, const wxString& face )
const wxString& face = wxEmptyString )
{ {
m_refData = new wxFontRefData(); m_refData = new wxFontRefData();
@@ -442,12 +441,14 @@ static GdkFont *wxLoadQueryNearestFont( int point_size, int family, int style, i
int max_size = point_size + 20 * (1 + (point_size/180)); int max_size = point_size + 20 * (1 + (point_size/180));
int min_size = point_size - 20 * (1 + (point_size/180)); int min_size = point_size - 20 * (1 + (point_size/180));
int i;
/* Search for smaller size (approx.) */ /* Search for smaller size (approx.) */
for (int i=point_size-10; !font && i >= 10 && i >= min_size; i -= 10) for (i=point_size-10; !font && i >= 10 && i >= min_size; i -= 10)
font = wxLoadQueryFont(i, family, style, weight, underlined, facename ); font = wxLoadQueryFont(i, family, style, weight, underlined, facename );
/* Search for larger size (approx.) */ /* Search for larger size (approx.) */
for (int i=point_size+10; !font && i <= max_size; i += 10) for (i=point_size+10; !font && i <= max_size; i += 10)
font = wxLoadQueryFont( i, family, style, weight, underlined, facename ); font = wxLoadQueryFont( i, family, style, weight, underlined, facename );
/* Try default family */ /* Try default family */

View File

@@ -33,13 +33,13 @@ class wxPaletteRefData: public wxObjectRefData
wxPaletteRefData::wxPaletteRefData() wxPaletteRefData::wxPaletteRefData()
{ {
m_colormap = (GdkColormap *) NULL; m_colormap = (GdkColormap *) NULL;
}; }
wxPaletteRefData::~wxPaletteRefData() wxPaletteRefData::~wxPaletteRefData()
{ {
if (m_colormap) gdk_colormap_unref( m_colormap ); if (m_colormap) gdk_colormap_unref( m_colormap );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -49,71 +49,71 @@ IMPLEMENT_DYNAMIC_CLASS(wxPalette,wxGDIObject)
wxPalette::wxPalette() wxPalette::wxPalette()
{ {
}; }
wxPalette::wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue ) wxPalette::wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue )
{ {
m_refData = new wxPaletteRefData(); m_refData = new wxPaletteRefData();
Create( n, red, green, blue ); Create( n, red, green, blue );
}; }
wxPalette::wxPalette( const wxPalette& palette ) wxPalette::wxPalette( const wxPalette& palette )
{ {
Ref( palette ); Ref( palette );
}; }
wxPalette::~wxPalette() wxPalette::~wxPalette()
{ {
}; }
wxPalette& wxPalette::operator = ( const wxPalette& palette ) wxPalette& wxPalette::operator = ( const wxPalette& palette )
{ {
if (*this == palette) return (*this); if (*this == palette) return (*this);
Ref( palette ); Ref( palette );
return *this; return *this;
}; }
bool wxPalette::operator == ( const wxPalette& palette ) bool wxPalette::operator == ( const wxPalette& palette )
{ {
return m_refData == palette.m_refData; return m_refData == palette.m_refData;
}; }
bool wxPalette::operator != ( const wxPalette& palette ) bool wxPalette::operator != ( const wxPalette& palette )
{ {
return m_refData != palette.m_refData; return m_refData != palette.m_refData;
}; }
bool wxPalette::Ok(void) const bool wxPalette::Ok(void) const
{ {
return (m_refData); return (m_refData != NULL);
}; }
bool wxPalette::Create( int WXUNUSED(n), bool wxPalette::Create( int WXUNUSED(n),
const unsigned char *WXUNUSED(red), const unsigned char *WXUNUSED(red),
const unsigned char *WXUNUSED(green), const unsigned char *WXUNUSED(green),
const unsigned char *WXUNUSED(blue) ) const unsigned char *WXUNUSED(blue) )
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG("not implemented");
return FALSE; return FALSE;
}; }
int wxPalette::GetPixel( const unsigned char WXUNUSED(red), int wxPalette::GetPixel( const unsigned char WXUNUSED(red),
const unsigned char WXUNUSED(green), const unsigned char WXUNUSED(green),
const unsigned char WXUNUSED(blue) ) const const unsigned char WXUNUSED(blue) ) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG("not implemented");
return 0; return 0;
}; }
bool wxPalette::GetRGB( int WXUNUSED(pixel), bool wxPalette::GetRGB( int WXUNUSED(pixel),
unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(red),
unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(green),
unsigned char *WXUNUSED(blue) ) const unsigned char *WXUNUSED(blue) ) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG("not implemented");
return 0; return 0;
}; }

View File

@@ -163,7 +163,7 @@ wxSize wxRadioBox::LayoutItems()
int max_len = 0; int max_len = 0;
wxNode *node = m_boxes.Nth( j*num_per_major ); wxNode *node = m_boxes.Nth( j*num_per_major );
for (int i = 0; i< num_per_major; i++) for (int i1 = 0; i1< num_per_major; i1++)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->Data() );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child ); GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
@@ -181,7 +181,7 @@ wxSize wxRadioBox::LayoutItems()
// we don't know the max_len before // we don't know the max_len before
node = m_boxes.Nth( j*num_per_major ); node = m_boxes.Nth( j*num_per_major );
for (int i = 0; i< num_per_major; i++) for (int i2 = 0; i2< num_per_major; i2++)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->Data() );

View File

@@ -30,7 +30,8 @@
#endif #endif
#include "unistd.h" #include "unistd.h"
#ifdef __SUN__ // add more here if you run into problems
#if defined(__SUN__) && !defined(__SunOs_5_6) && !defined(__SunOs_5_7)
extern "C" extern "C"
{ {
void usleep(unsigned long usec); void usleep(unsigned long usec);

View File

@@ -329,7 +329,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow ); if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
return (sm_overlayWindow); return (sm_overlayWindow != NULL);
} }
bool wxScreenDC::EndDrawingOnTop(void) bool wxScreenDC::EndDrawingOnTop(void)

View File

@@ -108,8 +108,7 @@ wxFont::wxFont( char *xFontName )
M_FONTDATA->m_font = gdk_font_load( xFontName ); M_FONTDATA->m_font = gdk_font_load( xFontName );
} }
wxFont::wxFont( int pointSize, int family, int style, int weight, bool underlined = FALSE, wxFont::wxFont( int pointSize, int family, int style, int weight, bool underlined, const wxString& face )
const wxString& face = wxEmptyString )
{ {
m_refData = new wxFontRefData(); m_refData = new wxFontRefData();
@@ -442,12 +441,14 @@ static GdkFont *wxLoadQueryNearestFont( int point_size, int family, int style, i
int max_size = point_size + 20 * (1 + (point_size/180)); int max_size = point_size + 20 * (1 + (point_size/180));
int min_size = point_size - 20 * (1 + (point_size/180)); int min_size = point_size - 20 * (1 + (point_size/180));
int i;
/* Search for smaller size (approx.) */ /* Search for smaller size (approx.) */
for (int i=point_size-10; !font && i >= 10 && i >= min_size; i -= 10) for (i=point_size-10; !font && i >= 10 && i >= min_size; i -= 10)
font = wxLoadQueryFont(i, family, style, weight, underlined, facename ); font = wxLoadQueryFont(i, family, style, weight, underlined, facename );
/* Search for larger size (approx.) */ /* Search for larger size (approx.) */
for (int i=point_size+10; !font && i <= max_size; i += 10) for (i=point_size+10; !font && i <= max_size; i += 10)
font = wxLoadQueryFont( i, family, style, weight, underlined, facename ); font = wxLoadQueryFont( i, family, style, weight, underlined, facename );
/* Try default family */ /* Try default family */

View File

@@ -33,13 +33,13 @@ class wxPaletteRefData: public wxObjectRefData
wxPaletteRefData::wxPaletteRefData() wxPaletteRefData::wxPaletteRefData()
{ {
m_colormap = (GdkColormap *) NULL; m_colormap = (GdkColormap *) NULL;
}; }
wxPaletteRefData::~wxPaletteRefData() wxPaletteRefData::~wxPaletteRefData()
{ {
if (m_colormap) gdk_colormap_unref( m_colormap ); if (m_colormap) gdk_colormap_unref( m_colormap );
}; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -49,71 +49,71 @@ IMPLEMENT_DYNAMIC_CLASS(wxPalette,wxGDIObject)
wxPalette::wxPalette() wxPalette::wxPalette()
{ {
}; }
wxPalette::wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue ) wxPalette::wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue )
{ {
m_refData = new wxPaletteRefData(); m_refData = new wxPaletteRefData();
Create( n, red, green, blue ); Create( n, red, green, blue );
}; }
wxPalette::wxPalette( const wxPalette& palette ) wxPalette::wxPalette( const wxPalette& palette )
{ {
Ref( palette ); Ref( palette );
}; }
wxPalette::~wxPalette() wxPalette::~wxPalette()
{ {
}; }
wxPalette& wxPalette::operator = ( const wxPalette& palette ) wxPalette& wxPalette::operator = ( const wxPalette& palette )
{ {
if (*this == palette) return (*this); if (*this == palette) return (*this);
Ref( palette ); Ref( palette );
return *this; return *this;
}; }
bool wxPalette::operator == ( const wxPalette& palette ) bool wxPalette::operator == ( const wxPalette& palette )
{ {
return m_refData == palette.m_refData; return m_refData == palette.m_refData;
}; }
bool wxPalette::operator != ( const wxPalette& palette ) bool wxPalette::operator != ( const wxPalette& palette )
{ {
return m_refData != palette.m_refData; return m_refData != palette.m_refData;
}; }
bool wxPalette::Ok(void) const bool wxPalette::Ok(void) const
{ {
return (m_refData); return (m_refData != NULL);
}; }
bool wxPalette::Create( int WXUNUSED(n), bool wxPalette::Create( int WXUNUSED(n),
const unsigned char *WXUNUSED(red), const unsigned char *WXUNUSED(red),
const unsigned char *WXUNUSED(green), const unsigned char *WXUNUSED(green),
const unsigned char *WXUNUSED(blue) ) const unsigned char *WXUNUSED(blue) )
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG("not implemented");
return FALSE; return FALSE;
}; }
int wxPalette::GetPixel( const unsigned char WXUNUSED(red), int wxPalette::GetPixel( const unsigned char WXUNUSED(red),
const unsigned char WXUNUSED(green), const unsigned char WXUNUSED(green),
const unsigned char WXUNUSED(blue) ) const const unsigned char WXUNUSED(blue) ) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG("not implemented");
return 0; return 0;
}; }
bool wxPalette::GetRGB( int WXUNUSED(pixel), bool wxPalette::GetRGB( int WXUNUSED(pixel),
unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(red),
unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(green),
unsigned char *WXUNUSED(blue) ) const unsigned char *WXUNUSED(blue) ) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG("not implemented");
return 0; return 0;
}; }

View File

@@ -163,7 +163,7 @@ wxSize wxRadioBox::LayoutItems()
int max_len = 0; int max_len = 0;
wxNode *node = m_boxes.Nth( j*num_per_major ); wxNode *node = m_boxes.Nth( j*num_per_major );
for (int i = 0; i< num_per_major; i++) for (int i1 = 0; i1< num_per_major; i1++)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->Data() );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child ); GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
@@ -181,7 +181,7 @@ wxSize wxRadioBox::LayoutItems()
// we don't know the max_len before // we don't know the max_len before
node = m_boxes.Nth( j*num_per_major ); node = m_boxes.Nth( j*num_per_major );
for (int i = 0; i< num_per_major; i++) for (int i2 = 0; i2< num_per_major; i2++)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() ); GtkWidget *button = GTK_WIDGET( node->Data() );