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:
parent
3502e687e2
commit
8fc613f14f
@ -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"
|
||||
// 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
|
||||
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
|
||||
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
||||
Contact->whereStr += Contact->tableName;
|
||||
Contact->whereStr += ")";
|
||||
//Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
||||
//Contact->whereStr += Contact->tableName;
|
||||
//Contact->whereStr += ")";
|
||||
|
||||
Contact->where = (char*) (const char*) Contact->whereStr;
|
||||
if (!Contact->Query())
|
||||
{
|
||||
@ -832,9 +836,12 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||
// display it, if the query string has changed.
|
||||
if (strcmp(qryWhere, (const char*) Contact->qryWhereStr))
|
||||
{
|
||||
Contact->orderBy = "NAME";
|
||||
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
||||
Contact->whereStr += CONTACT_TABLE_NAME;
|
||||
|
||||
// commented out because PostgreSQL can't do this
|
||||
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)
|
||||
Contact->qryWhereStr = qryWhere;
|
||||
@ -844,7 +851,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||
Contact->whereStr += Contact->qryWhereStr;
|
||||
}
|
||||
// Close the expression with a right paren
|
||||
Contact->whereStr += ")";
|
||||
// Contact->whereStr += ")";
|
||||
// Requery the table
|
||||
Contact->where = (char*) (const char*) Contact->whereStr;
|
||||
if (!Contact->Query())
|
||||
@ -876,9 +883,10 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||
// Query the first record in the table
|
||||
Contact->orderBy = "NAME";
|
||||
|
||||
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
||||
Contact->whereStr += CONTACT_TABLE_NAME;
|
||||
Contact->whereStr += ")";
|
||||
// commented out because PostgreSQL can't do this
|
||||
//Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
||||
//Contact->whereStr += CONTACT_TABLE_NAME;
|
||||
//Contact->whereStr += ")";
|
||||
|
||||
Contact->where = (char*) (const char*) Contact->whereStr;
|
||||
if (!Contact->Query())
|
||||
@ -1199,10 +1207,11 @@ bool CeditorDlg::GetNextRec()
|
||||
{
|
||||
wxString w;
|
||||
|
||||
|
||||
w = "NAME = (SELECT MIN(NAME) FROM ";
|
||||
w += Contact->tableName;
|
||||
w += " WHERE NAME > '";
|
||||
// commented out because PostgreSQL can't do this
|
||||
//w = "NAME = (SELECT MIN(NAME) FROM ";
|
||||
//w += Contact->tableName;
|
||||
// w += " WHERE NAME > '";
|
||||
w = "(NAME > '";
|
||||
w += Contact->Name;
|
||||
w += "'";
|
||||
|
||||
@ -1229,9 +1238,11 @@ bool CeditorDlg::GetPrevRec()
|
||||
{
|
||||
wxString w;
|
||||
|
||||
w = "NAME = (SELECT MAX(NAME) FROM ";
|
||||
w += Contact->tableName;
|
||||
w += " WHERE NAME < '";
|
||||
// commented out because PostgreSQL can't do this
|
||||
//w = "NAME = (SELECT MAX(NAME) FROM ";
|
||||
//w += Contact->tableName;
|
||||
//w += " WHERE NAME < '";
|
||||
w = "(NAME < '";
|
||||
w += Contact->Name;
|
||||
w += "'";
|
||||
|
||||
|
@ -1031,8 +1031,8 @@ void wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName)
|
||||
} currentToken = Field_Type;
|
||||
|
||||
// the flags and field values on the current line
|
||||
bool needsterminal = false,
|
||||
copiousoutput = false;
|
||||
bool needsterminal = FALSE,
|
||||
copiousoutput = FALSE;
|
||||
wxString strType,
|
||||
strOpenCmd,
|
||||
strPrintCmd,
|
||||
|
@ -30,7 +30,8 @@
|
||||
#endif
|
||||
#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"
|
||||
{
|
||||
void usleep(unsigned long usec);
|
||||
|
@ -329,7 +329,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
|
||||
|
||||
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
|
||||
|
||||
return (sm_overlayWindow);
|
||||
return (sm_overlayWindow != NULL);
|
||||
}
|
||||
|
||||
bool wxScreenDC::EndDrawingOnTop(void)
|
||||
|
@ -108,8 +108,7 @@ wxFont::wxFont( char *xFontName )
|
||||
M_FONTDATA->m_font = gdk_font_load( xFontName );
|
||||
}
|
||||
|
||||
wxFont::wxFont( int pointSize, int family, int style, int weight, bool underlined = FALSE,
|
||||
const wxString& face = wxEmptyString )
|
||||
wxFont::wxFont( int pointSize, int family, int style, int weight, bool underlined, const wxString& face )
|
||||
{
|
||||
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 min_size = point_size - 20 * (1 + (point_size/180));
|
||||
|
||||
int i;
|
||||
|
||||
/* 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 );
|
||||
|
||||
/* 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 );
|
||||
|
||||
/* Try default family */
|
||||
|
@ -33,13 +33,13 @@ class wxPaletteRefData: public wxObjectRefData
|
||||
|
||||
wxPaletteRefData::wxPaletteRefData()
|
||||
{
|
||||
m_colormap = (GdkColormap *) NULL;
|
||||
};
|
||||
m_colormap = (GdkColormap *) NULL;
|
||||
}
|
||||
|
||||
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( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue )
|
||||
{
|
||||
m_refData = new wxPaletteRefData();
|
||||
Create( n, red, green, blue );
|
||||
};
|
||||
m_refData = new wxPaletteRefData();
|
||||
Create( n, red, green, blue );
|
||||
}
|
||||
|
||||
wxPalette::wxPalette( const wxPalette& palette )
|
||||
{
|
||||
Ref( palette );
|
||||
};
|
||||
Ref( palette );
|
||||
}
|
||||
|
||||
wxPalette::~wxPalette()
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
wxPalette& wxPalette::operator = ( const wxPalette& palette )
|
||||
{
|
||||
if (*this == palette) return (*this);
|
||||
Ref( palette );
|
||||
return *this;
|
||||
};
|
||||
if (*this == palette) return (*this);
|
||||
Ref( palette );
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool wxPalette::operator == ( const wxPalette& palette )
|
||||
{
|
||||
return m_refData == palette.m_refData;
|
||||
};
|
||||
return m_refData == palette.m_refData;
|
||||
}
|
||||
|
||||
bool wxPalette::operator != ( const wxPalette& palette )
|
||||
{
|
||||
return m_refData != palette.m_refData;
|
||||
};
|
||||
return m_refData != palette.m_refData;
|
||||
}
|
||||
|
||||
bool wxPalette::Ok(void) const
|
||||
{
|
||||
return (m_refData);
|
||||
};
|
||||
return (m_refData != NULL);
|
||||
}
|
||||
|
||||
bool wxPalette::Create( int WXUNUSED(n),
|
||||
const unsigned char *WXUNUSED(red),
|
||||
const unsigned char *WXUNUSED(green),
|
||||
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),
|
||||
const unsigned char WXUNUSED(green),
|
||||
const unsigned char WXUNUSED(blue) ) const
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
wxFAIL_MSG("not implemented");
|
||||
|
||||
return 0;
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxPalette::GetRGB( int WXUNUSED(pixel),
|
||||
unsigned char *WXUNUSED(red),
|
||||
unsigned char *WXUNUSED(green),
|
||||
unsigned char *WXUNUSED(blue) ) const
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
|
||||
return 0;
|
||||
};
|
||||
wxFAIL_MSG("not implemented");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ wxSize wxRadioBox::LayoutItems()
|
||||
|
||||
int max_len = 0;
|
||||
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() );
|
||||
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
|
||||
@ -181,7 +181,7 @@ wxSize wxRadioBox::LayoutItems()
|
||||
// we don't know the max_len before
|
||||
|
||||
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() );
|
||||
|
||||
|
@ -30,7 +30,8 @@
|
||||
#endif
|
||||
#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"
|
||||
{
|
||||
void usleep(unsigned long usec);
|
||||
|
@ -329,7 +329,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
|
||||
|
||||
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
|
||||
|
||||
return (sm_overlayWindow);
|
||||
return (sm_overlayWindow != NULL);
|
||||
}
|
||||
|
||||
bool wxScreenDC::EndDrawingOnTop(void)
|
||||
|
@ -108,8 +108,7 @@ wxFont::wxFont( char *xFontName )
|
||||
M_FONTDATA->m_font = gdk_font_load( xFontName );
|
||||
}
|
||||
|
||||
wxFont::wxFont( int pointSize, int family, int style, int weight, bool underlined = FALSE,
|
||||
const wxString& face = wxEmptyString )
|
||||
wxFont::wxFont( int pointSize, int family, int style, int weight, bool underlined, const wxString& face )
|
||||
{
|
||||
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 min_size = point_size - 20 * (1 + (point_size/180));
|
||||
|
||||
int i;
|
||||
|
||||
/* 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 );
|
||||
|
||||
/* 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 );
|
||||
|
||||
/* Try default family */
|
||||
|
@ -33,13 +33,13 @@ class wxPaletteRefData: public wxObjectRefData
|
||||
|
||||
wxPaletteRefData::wxPaletteRefData()
|
||||
{
|
||||
m_colormap = (GdkColormap *) NULL;
|
||||
};
|
||||
m_colormap = (GdkColormap *) NULL;
|
||||
}
|
||||
|
||||
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( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue )
|
||||
{
|
||||
m_refData = new wxPaletteRefData();
|
||||
Create( n, red, green, blue );
|
||||
};
|
||||
m_refData = new wxPaletteRefData();
|
||||
Create( n, red, green, blue );
|
||||
}
|
||||
|
||||
wxPalette::wxPalette( const wxPalette& palette )
|
||||
{
|
||||
Ref( palette );
|
||||
};
|
||||
Ref( palette );
|
||||
}
|
||||
|
||||
wxPalette::~wxPalette()
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
wxPalette& wxPalette::operator = ( const wxPalette& palette )
|
||||
{
|
||||
if (*this == palette) return (*this);
|
||||
Ref( palette );
|
||||
return *this;
|
||||
};
|
||||
if (*this == palette) return (*this);
|
||||
Ref( palette );
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool wxPalette::operator == ( const wxPalette& palette )
|
||||
{
|
||||
return m_refData == palette.m_refData;
|
||||
};
|
||||
return m_refData == palette.m_refData;
|
||||
}
|
||||
|
||||
bool wxPalette::operator != ( const wxPalette& palette )
|
||||
{
|
||||
return m_refData != palette.m_refData;
|
||||
};
|
||||
return m_refData != palette.m_refData;
|
||||
}
|
||||
|
||||
bool wxPalette::Ok(void) const
|
||||
{
|
||||
return (m_refData);
|
||||
};
|
||||
return (m_refData != NULL);
|
||||
}
|
||||
|
||||
bool wxPalette::Create( int WXUNUSED(n),
|
||||
const unsigned char *WXUNUSED(red),
|
||||
const unsigned char *WXUNUSED(green),
|
||||
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),
|
||||
const unsigned char WXUNUSED(green),
|
||||
const unsigned char WXUNUSED(blue) ) const
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
wxFAIL_MSG("not implemented");
|
||||
|
||||
return 0;
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxPalette::GetRGB( int WXUNUSED(pixel),
|
||||
unsigned char *WXUNUSED(red),
|
||||
unsigned char *WXUNUSED(green),
|
||||
unsigned char *WXUNUSED(blue) ) const
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
|
||||
return 0;
|
||||
};
|
||||
wxFAIL_MSG("not implemented");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ wxSize wxRadioBox::LayoutItems()
|
||||
|
||||
int max_len = 0;
|
||||
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() );
|
||||
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
|
||||
@ -181,7 +181,7 @@ wxSize wxRadioBox::LayoutItems()
|
||||
// we don't know the max_len before
|
||||
|
||||
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() );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user