Source cleaning: whitespaces, tabs, TRUE/true, FALSE/false, -1/wxID_ANY/wxDefaultCoord, !!/!IsEmpty().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -92,7 +92,7 @@ protected:
|
|||||||
void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE)
|
void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE)
|
||||||
{
|
{
|
||||||
m_border = border;
|
m_border = border;
|
||||||
m_holiday = FALSE;
|
m_holiday = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
public:
|
public:
|
||||||
@@ -143,7 +143,7 @@ protected:
|
|||||||
void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE)
|
void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE)
|
||||||
{
|
{
|
||||||
m_border = border;
|
m_border = border;
|
||||||
m_holiday = FALSE;
|
m_holiday = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
@@ -205,12 +205,12 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
|
|
||||||
typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&);
|
typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&);
|
||||||
|
|
||||||
#define EVT_CALENDAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DOUBLECLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
#define EVT_CALENDAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DOUBLECLICKED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
||||||
#define EVT_CALENDAR_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
#define EVT_CALENDAR_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_SEL_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
||||||
#define EVT_CALENDAR_DAY(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DAY_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
#define EVT_CALENDAR_DAY(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DAY_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
||||||
#define EVT_CALENDAR_MONTH(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_MONTH_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
#define EVT_CALENDAR_MONTH(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_MONTH_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
||||||
#define EVT_CALENDAR_YEAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_YEAR_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
#define EVT_CALENDAR_YEAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_YEAR_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
||||||
#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_WEEKDAY_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_WEEKDAY_CLICKED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL),
|
||||||
|
|
||||||
#endif // wxUSE_CALENDARCTRL
|
#endif // wxUSE_CALENDARCTRL
|
||||||
|
|
||||||
|
@@ -118,7 +118,7 @@ public:
|
|||||||
// show/hide the caret (should be called by wxWindow when needed):
|
// show/hide the caret (should be called by wxWindow when needed):
|
||||||
// Show() must be called as many times as Hide() + 1 to make the caret
|
// Show() must be called as many times as Hide() + 1 to make the caret
|
||||||
// visible
|
// visible
|
||||||
virtual void Show(bool show = TRUE)
|
virtual void Show(bool show = true)
|
||||||
{
|
{
|
||||||
if ( show )
|
if ( show )
|
||||||
{
|
{
|
||||||
@@ -131,7 +131,7 @@ public:
|
|||||||
DoHide();
|
DoHide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void Hide() { Show(FALSE); }
|
virtual void Hide() { Show(false); }
|
||||||
|
|
||||||
// blink time is measured in milliseconds and is the time elapsed
|
// blink time is measured in milliseconds and is the time elapsed
|
||||||
// between 2 inversions of the caret (blink time of the caret is common
|
// between 2 inversions of the caret (blink time of the caret is common
|
||||||
@@ -156,7 +156,7 @@ protected:
|
|||||||
m_width = width;
|
m_width = width;
|
||||||
m_height = height;
|
m_height = height;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pure virtuals to implement in the derived class
|
// pure virtuals to implement in the derived class
|
||||||
@@ -212,11 +212,11 @@ public:
|
|||||||
wxCaretSuspend(wxWindow *win)
|
wxCaretSuspend(wxWindow *win)
|
||||||
{
|
{
|
||||||
m_caret = win->GetCaret();
|
m_caret = win->GetCaret();
|
||||||
m_show = FALSE;
|
m_show = false;
|
||||||
if ( m_caret && m_caret->IsVisible() )
|
if ( m_caret && m_caret->IsVisible() )
|
||||||
{
|
{
|
||||||
m_caret->Hide();
|
m_caret->Hide();
|
||||||
m_show = TRUE;
|
m_show = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ public:
|
|||||||
|
|
||||||
// check list box specific methods
|
// check list box specific methods
|
||||||
virtual bool IsChecked(size_t item) const = 0;
|
virtual bool IsChecked(size_t item) const = 0;
|
||||||
virtual void Check(size_t item, bool check = TRUE) = 0;
|
virtual void Check(size_t item, bool check = true) = 0;
|
||||||
|
|
||||||
DECLARE_NO_COPY_CLASS(wxCheckListBoxBase)
|
DECLARE_NO_COPY_CLASS(wxCheckListBoxBase)
|
||||||
};
|
};
|
||||||
|
@@ -72,10 +72,10 @@ public:
|
|||||||
// flushes the clipboard: this means that the data which is currently on
|
// flushes the clipboard: this means that the data which is currently on
|
||||||
// clipboard will stay available even after the application exits (possibly
|
// clipboard will stay available even after the application exits (possibly
|
||||||
// eating memory), otherwise the clipboard will be emptied on exit
|
// eating memory), otherwise the clipboard will be emptied on exit
|
||||||
virtual bool Flush() { return FALSE; }
|
virtual bool Flush() { return false; }
|
||||||
|
|
||||||
// X11 has two clipboards which get selected by this call. Empty on MSW.
|
// X11 has two clipboards which get selected by this call. Empty on MSW.
|
||||||
virtual void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
|
virtual void UsePrimarySelection( bool WXUNUSED(primary) = false ) { }
|
||||||
|
|
||||||
// Returns global instance (wxTheClipboard) of the object:
|
// Returns global instance (wxTheClipboard) of the object:
|
||||||
static wxClipboard *Get();
|
static wxClipboard *Get();
|
||||||
|
@@ -129,8 +129,8 @@ public:
|
|||||||
void SetSwitchChars(const wxString& switchChars);
|
void SetSwitchChars(const wxString& switchChars);
|
||||||
|
|
||||||
// long options are not POSIX-compliant, this option allows to disable them
|
// long options are not POSIX-compliant, this option allows to disable them
|
||||||
void EnableLongOptions(bool enable = TRUE);
|
void EnableLongOptions(bool enable = true);
|
||||||
void DisableLongOptions() { EnableLongOptions(FALSE); }
|
void DisableLongOptions() { EnableLongOptions(false); }
|
||||||
|
|
||||||
bool AreLongOptionsEnabled();
|
bool AreLongOptionsEnabled();
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ public:
|
|||||||
//
|
//
|
||||||
// if showUsage is true, Usage() is called in case of syntax error or if
|
// if showUsage is true, Usage() is called in case of syntax error or if
|
||||||
// help was requested
|
// help was requested
|
||||||
int Parse(bool showUsage = TRUE);
|
int Parse(bool showUsage = true);
|
||||||
|
|
||||||
// give the usage message describing all program options
|
// give the usage message describing all program options
|
||||||
void Usage();
|
void Usage();
|
||||||
@@ -176,19 +176,19 @@ public:
|
|||||||
// get the command line arguments
|
// get the command line arguments
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
||||||
// returns TRUE if the given switch was found
|
// returns true if the given switch was found
|
||||||
bool Found(const wxString& name) const;
|
bool Found(const wxString& name) const;
|
||||||
|
|
||||||
// returns TRUE if an option taking a string value was found and stores the
|
// returns true if an option taking a string value was found and stores the
|
||||||
// value in the provided pointer
|
// value in the provided pointer
|
||||||
bool Found(const wxString& name, wxString *value) const;
|
bool Found(const wxString& name, wxString *value) const;
|
||||||
|
|
||||||
// returns TRUE if an option taking an integer value was found and stores
|
// returns true if an option taking an integer value was found and stores
|
||||||
// the value in the provided pointer
|
// the value in the provided pointer
|
||||||
bool Found(const wxString& name, long *value) const;
|
bool Found(const wxString& name, long *value) const;
|
||||||
|
|
||||||
#if wxUSE_DATETIME
|
#if wxUSE_DATETIME
|
||||||
// returns TRUE if an option taking a date value was found and stores the
|
// returns true if an option taking a date value was found and stores the
|
||||||
// value in the provided pointer
|
// value in the provided pointer
|
||||||
bool Found(const wxString& name, wxDateTime *value) const;
|
bool Found(const wxString& name, wxDateTime *value) const;
|
||||||
#endif // wxUSE_DATETIME
|
#endif // wxUSE_DATETIME
|
||||||
|
@@ -29,7 +29,7 @@ class WXDLLEXPORT wxMenu;
|
|||||||
class WXDLLEXPORT wxCommand : public wxObject
|
class WXDLLEXPORT wxCommand : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxCommand(bool canUndoIt = FALSE, const wxString& name = wxEmptyString);
|
wxCommand(bool canUndoIt = false, const wxString& name = wxEmptyString);
|
||||||
~wxCommand();
|
~wxCommand();
|
||||||
|
|
||||||
// Override this to perform a command
|
// Override this to perform a command
|
||||||
@@ -61,8 +61,8 @@ public:
|
|||||||
virtual ~wxCommandProcessor();
|
virtual ~wxCommandProcessor();
|
||||||
|
|
||||||
// Pass a command to the processor. The processor calls Do(); if
|
// Pass a command to the processor. The processor calls Do(); if
|
||||||
// successful, is appended to the command history unless storeIt is FALSE.
|
// successful, is appended to the command history unless storeIt is false.
|
||||||
virtual bool Submit(wxCommand *command, bool storeIt = TRUE);
|
virtual bool Submit(wxCommand *command, bool storeIt = true);
|
||||||
|
|
||||||
// just store the command without executing it
|
// just store the command without executing it
|
||||||
virtual void Store(wxCommand *command);
|
virtual void Store(wxCommand *command);
|
||||||
|
@@ -49,7 +49,7 @@ class WXDLLIMPEXP_BASE wxArrayString;
|
|||||||
|
|
||||||
/// should we use registry instead of configuration files under Windows?
|
/// should we use registry instead of configuration files under Windows?
|
||||||
// (i.e. whether wxConfigBase::Create() will create a wxFileConfig (if it's
|
// (i.e. whether wxConfigBase::Create() will create a wxFileConfig (if it's
|
||||||
// FALSE) or wxRegConfig (if it's true and we're under Win32))
|
// false) or wxRegConfig (if it's true and we're under Win32))
|
||||||
#ifndef wxUSE_CONFIG_NATIVE
|
#ifndef wxUSE_CONFIG_NATIVE
|
||||||
#define wxUSE_CONFIG_NATIVE 1
|
#define wxUSE_CONFIG_NATIVE 1
|
||||||
#endif
|
#endif
|
||||||
@@ -94,7 +94,7 @@ public:
|
|||||||
static wxConfigBase *Set(wxConfigBase *pConfig);
|
static wxConfigBase *Set(wxConfigBase *pConfig);
|
||||||
// get the config object, creates it on demand unless DontCreateOnDemand
|
// get the config object, creates it on demand unless DontCreateOnDemand
|
||||||
// was called
|
// was called
|
||||||
static wxConfigBase *Get(bool createOnDemand = TRUE)
|
static wxConfigBase *Get(bool createOnDemand = true)
|
||||||
{ if ( createOnDemand && (!ms_pConfig) ) Create(); return ms_pConfig; }
|
{ if ( createOnDemand && (!ms_pConfig) ) Create(); return ms_pConfig; }
|
||||||
// create a new config object: this function will create the "best"
|
// create a new config object: this function will create the "best"
|
||||||
// implementation of wxConfig available for the current platform, see
|
// implementation of wxConfig available for the current platform, see
|
||||||
@@ -102,7 +102,7 @@ public:
|
|||||||
// the created object and also sets it as ms_pConfig.
|
// the created object and also sets it as ms_pConfig.
|
||||||
static wxConfigBase *Create();
|
static wxConfigBase *Create();
|
||||||
// should Get() try to create a new log object if the current one is NULL?
|
// should Get() try to create a new log object if the current one is NULL?
|
||||||
static void DontCreateOnDemand() { ms_bAutoCreate = FALSE; }
|
static void DontCreateOnDemand() { ms_bAutoCreate = false; }
|
||||||
|
|
||||||
// ctor & virtual dtor
|
// ctor & virtual dtor
|
||||||
// ctor (can be used as default ctor too)
|
// ctor (can be used as default ctor too)
|
||||||
@@ -137,15 +137,15 @@ public:
|
|||||||
virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0;
|
virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0;
|
||||||
// get number of entries/subgroups in the current group, with or without
|
// get number of entries/subgroups in the current group, with or without
|
||||||
// it's subgroups
|
// it's subgroups
|
||||||
virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const = 0;
|
virtual size_t GetNumberOfEntries(bool bRecursive = false) const = 0;
|
||||||
virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const = 0;
|
virtual size_t GetNumberOfGroups(bool bRecursive = false) const = 0;
|
||||||
|
|
||||||
// tests of existence
|
// tests of existence
|
||||||
// returns TRUE if the group by this name exists
|
// returns true if the group by this name exists
|
||||||
virtual bool HasGroup(const wxString& strName) const = 0;
|
virtual bool HasGroup(const wxString& strName) const = 0;
|
||||||
// same as above, but for an entry
|
// same as above, but for an entry
|
||||||
virtual bool HasEntry(const wxString& strName) const = 0;
|
virtual bool HasEntry(const wxString& strName) const = 0;
|
||||||
// returns TRUE if either a group or an entry with a given name exist
|
// returns true if either a group or an entry with a given name exist
|
||||||
bool Exists(const wxString& strName) const
|
bool Exists(const wxString& strName) const
|
||||||
{ return HasGroup(strName) || HasEntry(strName); }
|
{ return HasGroup(strName) || HasEntry(strName); }
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ public:
|
|||||||
return HasEntry(name) ? Type_String : Type_Unknown;
|
return HasEntry(name) ? Type_String : Type_Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
// key access: returns TRUE if value was really read, FALSE if default used
|
// key access: returns true if value was really read, false if default used
|
||||||
// (and if the key is not found the default value is returned.)
|
// (and if the key is not found the default value is returned.)
|
||||||
|
|
||||||
// read a string from the key
|
// read a string from the key
|
||||||
@@ -210,9 +210,9 @@ public:
|
|||||||
{ return Write(key, wxString(value)); }
|
{ return Write(key, wxString(value)); }
|
||||||
|
|
||||||
// permanently writes all changes
|
// permanently writes all changes
|
||||||
virtual bool Flush(bool bCurrentOnly = FALSE) = 0;
|
virtual bool Flush(bool bCurrentOnly = false) = 0;
|
||||||
|
|
||||||
// renaming, all functions return FALSE on failure (probably because the new
|
// renaming, all functions return false on failure (probably because the new
|
||||||
// name is already taken by an existing entry)
|
// name is already taken by an existing entry)
|
||||||
// rename an entry
|
// rename an entry
|
||||||
virtual bool RenameEntry(const wxString& oldName,
|
virtual bool RenameEntry(const wxString& oldName,
|
||||||
@@ -225,7 +225,7 @@ public:
|
|||||||
// deletes the specified entry and the group it belongs to if
|
// deletes the specified entry and the group it belongs to if
|
||||||
// it was the last key in it and the second parameter is true
|
// it was the last key in it and the second parameter is true
|
||||||
virtual bool DeleteEntry(const wxString& key,
|
virtual bool DeleteEntry(const wxString& key,
|
||||||
bool bDeleteGroupIfEmpty = TRUE) = 0;
|
bool bDeleteGroupIfEmpty = true) = 0;
|
||||||
// delete the group (with all subgroups)
|
// delete the group (with all subgroups)
|
||||||
virtual bool DeleteGroup(const wxString& key) = 0;
|
virtual bool DeleteGroup(const wxString& key) = 0;
|
||||||
// delete the whole underlying object (disk file, registry key, ...)
|
// delete the whole underlying object (disk file, registry key, ...)
|
||||||
@@ -236,9 +236,9 @@ public:
|
|||||||
// we can automatically expand environment variables in the config entries
|
// we can automatically expand environment variables in the config entries
|
||||||
// (this option is on by default, you can turn it on/off at any time)
|
// (this option is on by default, you can turn it on/off at any time)
|
||||||
bool IsExpandingEnvVars() const { return m_bExpandEnvVars; }
|
bool IsExpandingEnvVars() const { return m_bExpandEnvVars; }
|
||||||
void SetExpandEnvVars(bool bDoIt = TRUE) { m_bExpandEnvVars = bDoIt; }
|
void SetExpandEnvVars(bool bDoIt = true) { m_bExpandEnvVars = bDoIt; }
|
||||||
// recording of default values
|
// recording of default values
|
||||||
void SetRecordDefaults(bool bDoIt = TRUE) { m_bRecordDefaults = bDoIt; }
|
void SetRecordDefaults(bool bDoIt = true) { m_bRecordDefaults = bDoIt; }
|
||||||
bool IsRecordingDefaults() const { return m_bRecordDefaults; }
|
bool IsRecordingDefaults() const { return m_bRecordDefaults; }
|
||||||
// does expansion only if needed
|
// does expansion only if needed
|
||||||
wxString ExpandEnvVars(const wxString& str) const;
|
wxString ExpandEnvVars(const wxString& str) const;
|
||||||
|
@@ -65,7 +65,7 @@ public:
|
|||||||
void HandleOnFocus(wxFocusEvent& event);
|
void HandleOnFocus(wxFocusEvent& event);
|
||||||
void HandleOnWindowDestroy(wxWindowBase *child);
|
void HandleOnWindowDestroy(wxWindowBase *child);
|
||||||
|
|
||||||
// should be called from SetFocus(), returns FALSE if we did nothing with
|
// should be called from SetFocus(), returns false if we did nothing with
|
||||||
// the focus and the default processing should take place
|
// the focus and the default processing should take place
|
||||||
bool DoSetFocus();
|
bool DoSetFocus();
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
class WXDLLEXPORT wxContextHelp : public wxObject
|
class WXDLLEXPORT wxContextHelp : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxContextHelp(wxWindow* win = NULL, bool beginHelp = TRUE);
|
wxContextHelp(wxWindow* win = NULL, bool beginHelp = true);
|
||||||
virtual ~wxContextHelp();
|
virtual ~wxContextHelp();
|
||||||
|
|
||||||
bool BeginContextHelp(wxWindow* win);
|
bool BeginContextHelp(wxWindow* win);
|
||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_inHelp;
|
bool m_inHelp;
|
||||||
bool m_status; // TRUE if the user left-clicked
|
bool m_status; // true if the user left-clicked
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxContextHelp)
|
DECLARE_DYNAMIC_CLASS(wxContextHelp)
|
||||||
@@ -117,7 +117,7 @@ public:
|
|||||||
virtual wxString GetHelp(const wxWindowBase *window) = 0;
|
virtual wxString GetHelp(const wxWindowBase *window) = 0;
|
||||||
|
|
||||||
// do show help for the given window (uses GetHelp() internally if
|
// do show help for the given window (uses GetHelp() internally if
|
||||||
// applicable), return TRUE if it was done or FALSE if no help available
|
// applicable), return true if it was done or false if no help available
|
||||||
// for this window
|
// for this window
|
||||||
virtual bool ShowHelp(wxWindowBase *window) = 0;
|
virtual bool ShowHelp(wxWindowBase *window) = 0;
|
||||||
|
|
||||||
|
@@ -143,18 +143,18 @@ public:
|
|||||||
virtual size_t GetDataSize(const wxDataFormat& format) const = 0;
|
virtual size_t GetDataSize(const wxDataFormat& format) const = 0;
|
||||||
|
|
||||||
// copy raw data (in the specified format) to the provided buffer, return
|
// copy raw data (in the specified format) to the provided buffer, return
|
||||||
// TRUE if data copied successfully, FALSE otherwise
|
// true if data copied successfully, false otherwise
|
||||||
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const = 0;
|
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const = 0;
|
||||||
|
|
||||||
// get data from the buffer of specified length (in the given format),
|
// get data from the buffer of specified length (in the given format),
|
||||||
// return TRUE if the data was read successfully, FALSE otherwise
|
// return true if the data was read successfully, false otherwise
|
||||||
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
|
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
|
||||||
size_t WXUNUSED(len), const void * WXUNUSED(buf))
|
size_t WXUNUSED(len), const void * WXUNUSED(buf))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns TRUE if this format is supported
|
// returns true if this format is supported
|
||||||
bool IsSupported(const wxDataFormat& format, Direction dir = Get) const;
|
bool IsSupported(const wxDataFormat& format, Direction dir = Get) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ public:
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxDataObjectSimple is a wxDataObject which only supports one format (in
|
// wxDataObjectSimple is a wxDataObject which only supports one format (in
|
||||||
// both Get and Set directions, but you may return FALSE from GetDataHere() or
|
// both Get and Set directions, but you may return false from GetDataHere() or
|
||||||
// SetData() if one of them is not supported). This is the simplest possible
|
// SetData() if one of them is not supported). This is the simplest possible
|
||||||
// wxDataObject implementation.
|
// wxDataObject implementation.
|
||||||
//
|
//
|
||||||
@@ -218,11 +218,11 @@ public:
|
|||||||
|
|
||||||
// copy our data to the buffer
|
// copy our data to the buffer
|
||||||
virtual bool GetDataHere(void *WXUNUSED(buf)) const
|
virtual bool GetDataHere(void *WXUNUSED(buf)) const
|
||||||
{ return FALSE; }
|
{ return false; }
|
||||||
|
|
||||||
// copy data from buffer to our data
|
// copy data from buffer to our data
|
||||||
virtual bool SetData(size_t WXUNUSED(len), const void *WXUNUSED(buf))
|
virtual bool SetData(size_t WXUNUSED(len), const void *WXUNUSED(buf))
|
||||||
{ return FALSE; }
|
{ return false; }
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
@@ -270,8 +270,8 @@ public:
|
|||||||
|
|
||||||
// add data object (it will be deleted by wxDataObjectComposite, hence it
|
// add data object (it will be deleted by wxDataObjectComposite, hence it
|
||||||
// must be allocated on the heap) whose format will become the preferred
|
// must be allocated on the heap) whose format will become the preferred
|
||||||
// one if preferred == TRUE
|
// one if preferred == true
|
||||||
void Add(wxDataObjectSimple *dataObject, bool preferred = FALSE);
|
void Add(wxDataObjectSimple *dataObject, bool preferred = false);
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
@@ -422,7 +422,7 @@ public:
|
|||||||
|
|
||||||
// the Get() functions do nothing for us
|
// the Get() functions do nothing for us
|
||||||
virtual size_t GetDataSize() const { return 0; }
|
virtual size_t GetDataSize() const { return 0; }
|
||||||
virtual bool GetDataHere(void *WXUNUSED(buf)) const { return FALSE; }
|
virtual bool GetDataHere(void *WXUNUSED(buf)) const { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxArrayString m_filenames;
|
wxArrayString m_filenames;
|
||||||
|
@@ -463,7 +463,7 @@ public:
|
|||||||
// get the current country
|
// get the current country
|
||||||
static Country GetCountry();
|
static Country GetCountry();
|
||||||
|
|
||||||
// return TRUE if the country is a West European one (in practice,
|
// return true if the country is a West European one (in practice,
|
||||||
// this means that the same DST rules as for EEC apply)
|
// this means that the same DST rules as for EEC apply)
|
||||||
static bool IsWestEuropeanCountry(Country country = Country_Default);
|
static bool IsWestEuropeanCountry(Country country = Country_Default);
|
||||||
|
|
||||||
@@ -479,7 +479,7 @@ public:
|
|||||||
// return the current month
|
// return the current month
|
||||||
static Month GetCurrentMonth(Calendar cal = Gregorian);
|
static Month GetCurrentMonth(Calendar cal = Gregorian);
|
||||||
|
|
||||||
// returns TRUE if the given year is a leap year in the given calendar
|
// returns true if the given year is a leap year in the given calendar
|
||||||
static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian);
|
static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian);
|
||||||
|
|
||||||
// get the century (19 for 1999, 20 for 2000 and -5 for 492 BC)
|
// get the century (19 for 1999, 20 for 2000 and -5 for 492 BC)
|
||||||
@@ -508,7 +508,7 @@ public:
|
|||||||
// get the AM and PM strings in the current locale (may be empty)
|
// get the AM and PM strings in the current locale (may be empty)
|
||||||
static void GetAmPmStrings(wxString *am, wxString *pm);
|
static void GetAmPmStrings(wxString *am, wxString *pm);
|
||||||
|
|
||||||
// return TRUE if the given country uses DST for this year
|
// return true if the given country uses DST for this year
|
||||||
static bool IsDSTApplicable(int year = Inv_Year,
|
static bool IsDSTApplicable(int year = Inv_Year,
|
||||||
Country country = Country_Default);
|
Country country = Country_Default);
|
||||||
|
|
||||||
@@ -664,7 +664,7 @@ public:
|
|||||||
inline wxDateTime GetPrevWeekDay(WeekDay weekday) const;
|
inline wxDateTime GetPrevWeekDay(WeekDay weekday) const;
|
||||||
|
|
||||||
// set to Nth occurence of given weekday in the given month of the
|
// set to Nth occurence of given weekday in the given month of the
|
||||||
// given year (time is set to 0), return TRUE on success and FALSE on
|
// given year (time is set to 0), return true on success and false on
|
||||||
// failure. n may be positive (1..5) or negative to count from the end
|
// failure. n may be positive (1..5) or negative to count from the end
|
||||||
// of the month (see helper function SetToLastWeekDay())
|
// of the month (see helper function SetToLastWeekDay())
|
||||||
bool SetToWeekDay(WeekDay weekday,
|
bool SetToWeekDay(WeekDay weekday,
|
||||||
@@ -685,7 +685,7 @@ public:
|
|||||||
int year = Inv_Year);
|
int year = Inv_Year);
|
||||||
|
|
||||||
// sets the date to the given day of the given week in the year,
|
// sets the date to the given day of the given week in the year,
|
||||||
// returns TRUE on success and FALSE if given date doesn't exist (e.g.
|
// returns true on success and false if given date doesn't exist (e.g.
|
||||||
// numWeek is > 53)
|
// numWeek is > 53)
|
||||||
bool SetToTheWeek(wxDateTime_t numWeek,
|
bool SetToTheWeek(wxDateTime_t numWeek,
|
||||||
WeekDay weekday = Mon,
|
WeekDay weekday = Mon,
|
||||||
@@ -759,12 +759,12 @@ public:
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
// transform to any given timezone
|
// transform to any given timezone
|
||||||
inline wxDateTime ToTimezone(const TimeZone& tz, bool noDST = FALSE) const;
|
inline wxDateTime ToTimezone(const TimeZone& tz, bool noDST = false) const;
|
||||||
wxDateTime& MakeTimezone(const TimeZone& tz, bool noDST = FALSE);
|
wxDateTime& MakeTimezone(const TimeZone& tz, bool noDST = false);
|
||||||
|
|
||||||
// transform to GMT/UTC
|
// transform to GMT/UTC
|
||||||
wxDateTime ToGMT(bool noDST = FALSE) const { return ToTimezone(GMT0, noDST); }
|
wxDateTime ToGMT(bool noDST = false) const { return ToTimezone(GMT0, noDST); }
|
||||||
wxDateTime& MakeGMT(bool noDST = FALSE) { return MakeTimezone(GMT0, noDST); }
|
wxDateTime& MakeGMT(bool noDST = false) { return MakeTimezone(GMT0, noDST); }
|
||||||
|
|
||||||
// is daylight savings time in effect at this moment according to the
|
// is daylight savings time in effect at this moment according to the
|
||||||
// rules of the specified country?
|
// rules of the specified country?
|
||||||
@@ -854,20 +854,20 @@ public:
|
|||||||
// comparison (see also functions below for operator versions)
|
// comparison (see also functions below for operator versions)
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
// returns TRUE if the two moments are strictly identical
|
// returns true if the two moments are strictly identical
|
||||||
inline bool IsEqualTo(const wxDateTime& datetime) const;
|
inline bool IsEqualTo(const wxDateTime& datetime) const;
|
||||||
|
|
||||||
// returns TRUE if the date is strictly earlier than the given one
|
// returns true if the date is strictly earlier than the given one
|
||||||
inline bool IsEarlierThan(const wxDateTime& datetime) const;
|
inline bool IsEarlierThan(const wxDateTime& datetime) const;
|
||||||
|
|
||||||
// returns TRUE if the date is strictly later than the given one
|
// returns true if the date is strictly later than the given one
|
||||||
inline bool IsLaterThan(const wxDateTime& datetime) const;
|
inline bool IsLaterThan(const wxDateTime& datetime) const;
|
||||||
|
|
||||||
// returns TRUE if the date is strictly in the given range
|
// returns true if the date is strictly in the given range
|
||||||
inline bool IsStrictlyBetween(const wxDateTime& t1,
|
inline bool IsStrictlyBetween(const wxDateTime& t1,
|
||||||
const wxDateTime& t2) const;
|
const wxDateTime& t2) const;
|
||||||
|
|
||||||
// returns TRUE if the date is in the given range
|
// returns true if the date is in the given range
|
||||||
inline bool IsBetween(const wxDateTime& t1, const wxDateTime& t2) const;
|
inline bool IsBetween(const wxDateTime& t1, const wxDateTime& t2) const;
|
||||||
|
|
||||||
// do these two objects refer to the same date?
|
// do these two objects refer to the same date?
|
||||||
@@ -984,7 +984,7 @@ private:
|
|||||||
// fixed to 1000
|
// fixed to 1000
|
||||||
static const long TIME_T_FACTOR;
|
static const long TIME_T_FACTOR;
|
||||||
|
|
||||||
// returns TRUE if we fall in range in which we can use standard ANSI C
|
// returns true if we fall in range in which we can use standard ANSI C
|
||||||
// functions
|
// functions
|
||||||
inline bool IsInStdRange() const;
|
inline bool IsInStdRange() const;
|
||||||
|
|
||||||
@@ -1096,11 +1096,11 @@ public:
|
|||||||
// are two timespans equal?
|
// are two timespans equal?
|
||||||
inline bool IsEqualTo(const wxTimeSpan& ts) const;
|
inline bool IsEqualTo(const wxTimeSpan& ts) const;
|
||||||
// compare two timestamps: works with the absolute values, i.e. -2
|
// compare two timestamps: works with the absolute values, i.e. -2
|
||||||
// hours is longer than 1 hour. Also, it will return FALSE if the
|
// hours is longer than 1 hour. Also, it will return false if the
|
||||||
// timespans are equal in absolute value.
|
// timespans are equal in absolute value.
|
||||||
inline bool IsLongerThan(const wxTimeSpan& ts) const;
|
inline bool IsLongerThan(const wxTimeSpan& ts) const;
|
||||||
// compare two timestamps: works with the absolute values, i.e. 1
|
// compare two timestamps: works with the absolute values, i.e. 1
|
||||||
// hour is shorter than -2 hours. Also, it will return FALSE if the
|
// hour is shorter than -2 hours. Also, it will return false if the
|
||||||
// timespans are equal in absolute value.
|
// timespans are equal in absolute value.
|
||||||
bool IsShorterThan(const wxTimeSpan& t) const { return !IsLongerThan(t); }
|
bool IsShorterThan(const wxTimeSpan& t) const { return !IsLongerThan(t); }
|
||||||
|
|
||||||
@@ -1301,7 +1301,7 @@ class WXDLLIMPEXP_BASE wxDateTimeHolidayAuthority
|
|||||||
{
|
{
|
||||||
friend class wxDateTimeHolidaysModule;
|
friend class wxDateTimeHolidaysModule;
|
||||||
public:
|
public:
|
||||||
// returns TRUE if the given date is a holiday
|
// returns true if the given date is a holiday
|
||||||
static bool IsHoliday(const wxDateTime& dt);
|
static bool IsHoliday(const wxDateTime& dt);
|
||||||
|
|
||||||
// fills the provided array with all holidays in the given range, returns
|
// fills the provided array with all holidays in the given range, returns
|
||||||
|
@@ -488,13 +488,13 @@ private:
|
|||||||
wxDBMS dbmsType; // Type of datasource - i.e. Oracle, dBase, SQLServer, etc
|
wxDBMS dbmsType; // Type of datasource - i.e. Oracle, dBase, SQLServer, etc
|
||||||
|
|
||||||
// Private member functions
|
// Private member functions
|
||||||
bool getDbInfo(bool failOnDataTypeUnsupported=TRUE);
|
bool getDbInfo(bool failOnDataTypeUnsupported=true);
|
||||||
bool getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo);
|
bool getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo);
|
||||||
bool setConnectionOptions(void);
|
bool setConnectionOptions(void);
|
||||||
void logError(const wxString &errMsg, const wxString &SQLState);
|
void logError(const wxString &errMsg, const wxString &SQLState);
|
||||||
const wxChar *convertUserID(const wxChar *userID, wxString &UserID);
|
const wxChar *convertUserID(const wxChar *userID, wxString &UserID);
|
||||||
void initialize();
|
void initialize();
|
||||||
bool open(bool failOnDataTypeUnsupported=TRUE);
|
bool open(bool failOnDataTypeUnsupported=true);
|
||||||
|
|
||||||
#if !wxODBC_BACKWARD_COMPATABILITY
|
#if !wxODBC_BACKWARD_COMPATABILITY
|
||||||
// ODBC handles
|
// ODBC handles
|
||||||
@@ -606,9 +606,9 @@ public:
|
|||||||
~wxDb();
|
~wxDb();
|
||||||
|
|
||||||
// Data Source Name, User ID, Password and whether open should fail on data type not supported
|
// Data Source Name, User ID, Password and whether open should fail on data type not supported
|
||||||
bool Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported=TRUE);
|
bool Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported=true);
|
||||||
bool Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthStr, bool failOnDataTypeUnsupported=TRUE);
|
bool Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthStr, bool failOnDataTypeUnsupported=true);
|
||||||
bool Open(wxDbConnectInf *dbConnectInf, bool failOnDataTypeUnsupported=TRUE);
|
bool Open(wxDbConnectInf *dbConnectInf, bool failOnDataTypeUnsupported=true);
|
||||||
bool Open(wxDb *copyDb); // pointer to a wxDb whose connection info should be copied rather than re-queried
|
bool Open(wxDb *copyDb); // pointer to a wxDb whose connection info should be copied rather than re-queried
|
||||||
void Close(void);
|
void Close(void);
|
||||||
bool CommitTrans(void);
|
bool CommitTrans(void);
|
||||||
@@ -616,7 +616,7 @@ public:
|
|||||||
bool DispAllErrors(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT);
|
bool DispAllErrors(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT);
|
||||||
bool GetNextError(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT);
|
bool GetNextError(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT);
|
||||||
void DispNextError(void);
|
void DispNextError(void);
|
||||||
bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=TRUE);
|
bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=true);
|
||||||
bool DropView(const wxString &viewName);
|
bool DropView(const wxString &viewName);
|
||||||
bool ExecSql(const wxString &pSqlStmt);
|
bool ExecSql(const wxString &pSqlStmt);
|
||||||
bool GetNext(void);
|
bool GetNext(void);
|
||||||
@@ -669,7 +669,7 @@ public:
|
|||||||
{ logError(errMsg, SQLState); }
|
{ logError(errMsg, SQLState); }
|
||||||
void SetDebugErrorMessages(bool state) { silent = !state; }
|
void SetDebugErrorMessages(bool state) { silent = !state; }
|
||||||
bool SetSqlLogging(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME,
|
bool SetSqlLogging(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME,
|
||||||
bool append = FALSE);
|
bool append = false);
|
||||||
bool WriteSqlLog(const wxString &logMsg);
|
bool WriteSqlLog(const wxString &logMsg);
|
||||||
|
|
||||||
wxDBMS Dbms(void);
|
wxDBMS Dbms(void);
|
||||||
@@ -742,7 +742,7 @@ wxDbSqlLog(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME);
|
|||||||
#if 0
|
#if 0
|
||||||
// MSW/VC6 ONLY!!! Experimental
|
// MSW/VC6 ONLY!!! Experimental
|
||||||
int WXDLLEXPORT wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const wxString &description=wxEmptyString,
|
int WXDLLEXPORT wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const wxString &description=wxEmptyString,
|
||||||
bool sysDSN=FALSE, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL);
|
bool sysDSN=false, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This routine allows you to query a driver manager
|
// This routine allows you to query a driver manager
|
||||||
|
@@ -118,7 +118,7 @@ class WXDLLIMPEXP_DBGRID wxDbGridTableBase : public wxGridTableBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo *ColInfo,
|
wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo *ColInfo,
|
||||||
int count = wxUSE_QUERY, bool takeOwnership = TRUE);
|
int count = wxUSE_QUERY, bool takeOwnership = true);
|
||||||
~wxDbGridTableBase();
|
~wxDbGridTableBase();
|
||||||
|
|
||||||
virtual int GetNumberRows()
|
virtual int GetNumberRows()
|
||||||
@@ -150,12 +150,12 @@ public:
|
|||||||
|
|
||||||
virtual wxString GetColLabelValue(int col);
|
virtual wxString GetColLabelValue(int col);
|
||||||
|
|
||||||
virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=TRUE);
|
virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=true);
|
||||||
virtual void ValidateRow(int row);
|
virtual void ValidateRow(int row);
|
||||||
virtual bool UpdateRow(int row) const
|
virtual bool UpdateRow(int row) const
|
||||||
{
|
{
|
||||||
if (m_row != row)
|
if (m_row != row)
|
||||||
return TRUE;
|
return true;
|
||||||
else
|
else
|
||||||
return Writeback();
|
return Writeback();
|
||||||
}
|
}
|
||||||
|
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
const int wxDB_ROWID_LEN = 24; // 18 is the max, 24 is in case it gets larger
|
const int wxDB_ROWID_LEN = 24; // 18 is the max, 24 is in case it gets larger
|
||||||
const int wxDB_DEFAULT_CURSOR = 0;
|
const int wxDB_DEFAULT_CURSOR = 0;
|
||||||
const bool wxDB_QUERY_ONLY = TRUE;
|
const bool wxDB_QUERY_ONLY = true;
|
||||||
const bool wxDB_DISABLE_VIEW = TRUE;
|
const bool wxDB_DISABLE_VIEW = true;
|
||||||
|
|
||||||
// Used to indicate end of a variable length list of
|
// Used to indicate end of a variable length list of
|
||||||
// column numbers passed to member functions
|
// column numbers passed to member functions
|
||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
SWORD SqlCtype; // C data type; e.g. SQL_C_LONG
|
SWORD SqlCtype; // C data type; e.g. SQL_C_LONG
|
||||||
void *PtrDataObj; // Address of the data object
|
void *PtrDataObj; // Address of the data object
|
||||||
int SzDataObj; // Size, in bytes, of the data object
|
int SzDataObj; // Size, in bytes, of the data object
|
||||||
bool KeyField; // TRUE if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields.
|
bool KeyField; // true if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields.
|
||||||
bool Updateable; // Specifies whether this column is updateable
|
bool Updateable; // Specifies whether this column is updateable
|
||||||
bool InsertAllowed; // Specifies whether this column should be included in an INSERT statement
|
bool InsertAllowed; // Specifies whether this column should be included in an INSERT statement
|
||||||
bool DerivedCol; // Specifies whether this column is a derived value
|
bool DerivedCol; // Specifies whether this column is a derived value
|
||||||
@@ -191,11 +191,11 @@ public:
|
|||||||
|
|
||||||
virtual ~wxDbTable();
|
virtual ~wxDbTable();
|
||||||
|
|
||||||
bool Open(bool checkPrivileges=FALSE, bool checkTableExists=TRUE);
|
bool Open(bool checkPrivileges=false, bool checkTableExists=true);
|
||||||
bool CreateTable(bool attemptDrop=TRUE);
|
bool CreateTable(bool attemptDrop=true);
|
||||||
bool DropTable(void);
|
bool DropTable(void);
|
||||||
bool CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCols,
|
bool CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCols,
|
||||||
wxDbIdxDef *pIdxDefs, bool attemptDrop=TRUE);
|
wxDbIdxDef *pIdxDefs, bool attemptDrop=true);
|
||||||
bool DropIndex(const wxString &idxName);
|
bool DropIndex(const wxString &idxName);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
@@ -238,10 +238,10 @@ public:
|
|||||||
bool Delete(void);
|
bool Delete(void);
|
||||||
bool DeleteWhere(const wxString &pWhereClause);
|
bool DeleteWhere(const wxString &pWhereClause);
|
||||||
bool DeleteMatching(void);
|
bool DeleteMatching(void);
|
||||||
virtual bool Query(bool forUpdate = FALSE, bool distinct = FALSE);
|
virtual bool Query(bool forUpdate = false, bool distinct = false);
|
||||||
bool QueryBySqlStmt(const wxString &pSqlStmt);
|
bool QueryBySqlStmt(const wxString &pSqlStmt);
|
||||||
bool QueryMatching(bool forUpdate = FALSE, bool distinct = FALSE);
|
bool QueryMatching(bool forUpdate = false, bool distinct = false);
|
||||||
bool QueryOnKeyFields(bool forUpdate = FALSE, bool distinct = FALSE);
|
bool QueryOnKeyFields(bool forUpdate = false, bool distinct = false);
|
||||||
bool Refresh(void);
|
bool Refresh(void);
|
||||||
bool GetNext(void) { return(getRec(SQL_FETCH_NEXT)); }
|
bool GetNext(void) { return(getRec(SQL_FETCH_NEXT)); }
|
||||||
bool operator++(int) { return(getRec(SQL_FETCH_NEXT)); }
|
bool operator++(int) { return(getRec(SQL_FETCH_NEXT)); }
|
||||||
@@ -265,8 +265,8 @@ public:
|
|||||||
void BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxString &pWhereClause=wxEmptyString);
|
void BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxString &pWhereClause=wxEmptyString);
|
||||||
void BuildUpdateStmt(wxChar *pSqlStmt, int typeOfUpd, const wxString &pWhereClause=wxEmptyString);
|
void BuildUpdateStmt(wxChar *pSqlStmt, int typeOfUpd, const wxString &pWhereClause=wxEmptyString);
|
||||||
|
|
||||||
void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=FALSE);
|
void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=false);
|
||||||
void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=FALSE);
|
void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=false);
|
||||||
|
|
||||||
#if wxODBC_BACKWARD_COMPATABILITY
|
#if wxODBC_BACKWARD_COMPATABILITY
|
||||||
// The following member functions are deprecated. You should use the BuildXxxxxStmt functions (above)
|
// The following member functions are deprecated. You should use the BuildXxxxxStmt functions (above)
|
||||||
@@ -277,42 +277,42 @@ public:
|
|||||||
void GetUpdateStmt(char *pSqlStmt, int typeOfUpd, const char *pWhereClause = NULL)
|
void GetUpdateStmt(char *pSqlStmt, int typeOfUpd, const char *pWhereClause = NULL)
|
||||||
{ BuildUpdateStmt(pSqlStmt,typeOfUpd,pWhereClause); }
|
{ BuildUpdateStmt(pSqlStmt,typeOfUpd,pWhereClause); }
|
||||||
void GetWhereClause(char *pWhereClause, int typeOfWhere,
|
void GetWhereClause(char *pWhereClause, int typeOfWhere,
|
||||||
const char *qualTableName = NULL, bool useLikeComparison=FALSE)
|
const char *qualTableName = NULL, bool useLikeComparison=false)
|
||||||
{ BuildWhereClause(pWhereClause,typeOfWhere,qualTableName,useLikeComparison); }
|
{ BuildWhereClause(pWhereClause,typeOfWhere,qualTableName,useLikeComparison); }
|
||||||
#endif
|
#endif
|
||||||
bool CanSelectForUpdate(void);
|
bool CanSelectForUpdate(void);
|
||||||
bool CanUpdByROWID(void);
|
bool CanUpdByROWID(void);
|
||||||
void ClearMemberVar(UWORD colNo, bool setToNull=FALSE);
|
void ClearMemberVar(UWORD colNo, bool setToNull=false);
|
||||||
void ClearMemberVars(bool setToNull=FALSE);
|
void ClearMemberVars(bool setToNull=false);
|
||||||
bool SetQueryTimeout(UDWORD nSeconds);
|
bool SetQueryTimeout(UDWORD nSeconds);
|
||||||
|
|
||||||
wxDbColDef *GetColDefs() { return colDefs; }
|
wxDbColDef *GetColDefs() { return colDefs; }
|
||||||
void SetColDefs(UWORD index, const wxString &fieldName, int dataType,
|
void SetColDefs(UWORD index, const wxString &fieldName, int dataType,
|
||||||
void *pData, SWORD cType,
|
void *pData, SWORD cType,
|
||||||
int size, bool keyField = FALSE, bool upd = TRUE,
|
int size, bool keyField = false, bool upd = true,
|
||||||
bool insAllow = TRUE, bool derivedCol = FALSE);
|
bool insAllow = true, bool derivedCol = false);
|
||||||
wxDbColDataPtr *SetColDefs(wxDbColInf *colInfs, UWORD numCols);
|
wxDbColDataPtr *SetColDefs(wxDbColInf *colInfs, UWORD numCols);
|
||||||
|
|
||||||
bool CloseCursor(HSTMT cursor);
|
bool CloseCursor(HSTMT cursor);
|
||||||
bool DeleteCursor(HSTMT *hstmtDel);
|
bool DeleteCursor(HSTMT *hstmtDel);
|
||||||
void SetCursor(HSTMT *hstmtActivate = (void **) wxDB_DEFAULT_CURSOR);
|
void SetCursor(HSTMT *hstmtActivate = (void **) wxDB_DEFAULT_CURSOR);
|
||||||
HSTMT GetCursor(void) { return(hstmt); }
|
HSTMT GetCursor(void) { return(hstmt); }
|
||||||
HSTMT *GetNewCursor(bool setCursor = FALSE, bool bindColumns = TRUE);
|
HSTMT *GetNewCursor(bool setCursor = false, bool bindColumns = true);
|
||||||
#if wxODBC_BACKWARD_COMPATABILITY
|
#if wxODBC_BACKWARD_COMPATABILITY
|
||||||
// The following member function is deprecated. You should use the GetNewCursor
|
// The following member function is deprecated. You should use the GetNewCursor
|
||||||
HSTMT *NewCursor(bool setCursor = FALSE, bool bindColumns = TRUE) { return GetNewCursor(setCursor,bindColumns); }
|
HSTMT *NewCursor(bool setCursor = false, bool bindColumns = true) { return GetNewCursor(setCursor,bindColumns); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ULONG Count(const wxString &args=_T("*"));
|
ULONG Count(const wxString &args=_T("*"));
|
||||||
int DB_STATUS(void) { return(pDb->DB_STATUS); }
|
int DB_STATUS(void) { return(pDb->DB_STATUS); }
|
||||||
|
|
||||||
bool IsColNull(UWORD colNo) const;
|
bool IsColNull(UWORD colNo) const;
|
||||||
bool SetColNull(UWORD colNo, bool set=TRUE);
|
bool SetColNull(UWORD colNo, bool set=true);
|
||||||
bool SetColNull(const wxString &colName, bool set=TRUE);
|
bool SetColNull(const wxString &colName, bool set=true);
|
||||||
#if wxODBC_BACKWARD_COMPATABILITY
|
#if wxODBC_BACKWARD_COMPATABILITY
|
||||||
// The following member functions are deprecated. You should use the SetColNull()
|
// The following member functions are deprecated. You should use the SetColNull()
|
||||||
bool SetNull(int colNo, bool set=TRUE) { return (SetNull(colNo,set)); }
|
bool SetNull(int colNo, bool set=true) { return (SetNull(colNo,set)); }
|
||||||
bool SetNull(const char *colName, bool set=TRUE) { return (SetNull(colName,set)); }
|
bool SetNull(const char *colName, bool set=true) { return (SetNull(colName,set)); }
|
||||||
#endif
|
#endif
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
ULONG GetTableID() { return tableID; }
|
ULONG GetTableID() { return tableID; }
|
||||||
|
@@ -39,7 +39,7 @@ class WXDLLEXPORT wxDrawObject
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
wxDrawObject()
|
wxDrawObject()
|
||||||
: m_isBBoxValid(FALSE)
|
: m_isBBoxValid(false)
|
||||||
, m_minX(0), m_minY(0), m_maxX(0), m_maxY(0)
|
, m_minX(0), m_minY(0), m_maxX(0), m_maxY(0)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_isBBoxValid = TRUE;
|
m_isBBoxValid = true;
|
||||||
|
|
||||||
m_minX = x;
|
m_minX = x;
|
||||||
m_minY = y;
|
m_minY = y;
|
||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
void ResetBoundingBox()
|
void ResetBoundingBox()
|
||||||
{
|
{
|
||||||
m_isBBoxValid = FALSE;
|
m_isBBoxValid = false;
|
||||||
|
|
||||||
m_minX = m_maxX = m_minY = m_maxY = 0;
|
m_minX = m_maxX = m_minY = m_maxY = 0;
|
||||||
}
|
}
|
||||||
@@ -106,10 +106,10 @@ class WXDLLEXPORT wxDCBase : public wxObject
|
|||||||
public:
|
public:
|
||||||
wxDCBase()
|
wxDCBase()
|
||||||
: m_colour(wxColourDisplay())
|
: m_colour(wxColourDisplay())
|
||||||
, m_ok(TRUE)
|
, m_ok(true)
|
||||||
, m_clipping(FALSE)
|
, m_clipping(false)
|
||||||
, m_isInteractive(0)
|
, m_isInteractive(0)
|
||||||
, m_isBBoxValid(FALSE)
|
, m_isBBoxValid(false)
|
||||||
, m_logicalOriginX(0), m_logicalOriginY(0)
|
, m_logicalOriginX(0), m_logicalOriginY(0)
|
||||||
, m_deviceOriginX(0), m_deviceOriginY(0)
|
, m_deviceOriginX(0), m_deviceOriginY(0)
|
||||||
, m_logicalScaleX(1.0), m_logicalScaleY(1.0)
|
, m_logicalScaleX(1.0), m_logicalScaleY(1.0)
|
||||||
@@ -129,7 +129,7 @@ public:
|
|||||||
, m_font()
|
, m_font()
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
, m_palette()
|
, m_palette()
|
||||||
, m_hasCustomPalette(FALSE)
|
, m_hasCustomPalette(false)
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
{
|
{
|
||||||
ResetBoundingBox();
|
ResetBoundingBox();
|
||||||
@@ -251,10 +251,10 @@ public:
|
|||||||
{ DoDrawIcon(icon, pt.x, pt.y); }
|
{ DoDrawIcon(icon, pt.x, pt.y); }
|
||||||
|
|
||||||
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||||
bool useMask = FALSE)
|
bool useMask = false)
|
||||||
{ DoDrawBitmap(bmp, x, y, useMask); }
|
{ DoDrawBitmap(bmp, x, y, useMask); }
|
||||||
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt,
|
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt,
|
||||||
bool useMask = FALSE)
|
bool useMask = false)
|
||||||
{ DoDrawBitmap(bmp, pt.x, pt.y, useMask); }
|
{ DoDrawBitmap(bmp, pt.x, pt.y, useMask); }
|
||||||
|
|
||||||
void DrawText(const wxString& text, wxCoord x, wxCoord y)
|
void DrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||||
@@ -285,14 +285,14 @@ public:
|
|||||||
|
|
||||||
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1)
|
int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord)
|
||||||
{
|
{
|
||||||
return DoBlit(xdest, ydest, width, height,
|
return DoBlit(xdest, ydest, width, height,
|
||||||
source, xsrc, ysrc, rop, useMask, xsrcMask, ysrcMask);
|
source, xsrc, ysrc, rop, useMask, xsrcMask, ysrcMask);
|
||||||
}
|
}
|
||||||
bool Blit(const wxPoint& destPt, const wxSize& sz,
|
bool Blit(const wxPoint& destPt, const wxSize& sz,
|
||||||
wxDC *source, const wxPoint& srcPt,
|
wxDC *source, const wxPoint& srcPt,
|
||||||
int rop = wxCOPY, bool useMask = FALSE, const wxPoint& srcPtMask = wxPoint(-1, -1))
|
int rop = wxCOPY, bool useMask = false, const wxPoint& srcPtMask = wxDefaultPosition)
|
||||||
{
|
{
|
||||||
return DoBlit(destPt.x, destPt.y, sz.x, sz.y,
|
return DoBlit(destPt.x, destPt.y, sz.x, sz.y,
|
||||||
source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y);
|
source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y);
|
||||||
@@ -361,7 +361,7 @@ public:
|
|||||||
|
|
||||||
virtual void Clear() = 0;
|
virtual void Clear() = 0;
|
||||||
|
|
||||||
virtual bool StartDoc(const wxString& WXUNUSED(message)) { return TRUE; }
|
virtual bool StartDoc(const wxString& WXUNUSED(message)) { return true; }
|
||||||
virtual void EndDoc() { }
|
virtual void EndDoc() { }
|
||||||
|
|
||||||
virtual void StartPage() { }
|
virtual void StartPage() { }
|
||||||
@@ -538,7 +538,7 @@ public:
|
|||||||
//
|
//
|
||||||
// FIXME: is this (still) used?
|
// FIXME: is this (still) used?
|
||||||
virtual void SetOptimization(bool WXUNUSED(opt)) { }
|
virtual void SetOptimization(bool WXUNUSED(opt)) { }
|
||||||
virtual bool GetOptimization() { return FALSE; }
|
virtual bool GetOptimization() { return false; }
|
||||||
|
|
||||||
// bounding box
|
// bounding box
|
||||||
// ------------
|
// ------------
|
||||||
@@ -554,7 +554,7 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_isBBoxValid = TRUE;
|
m_isBBoxValid = true;
|
||||||
|
|
||||||
m_minX = x;
|
m_minX = x;
|
||||||
m_minY = y;
|
m_minY = y;
|
||||||
@@ -565,7 +565,7 @@ public:
|
|||||||
|
|
||||||
void ResetBoundingBox()
|
void ResetBoundingBox()
|
||||||
{
|
{
|
||||||
m_isBBoxValid = FALSE;
|
m_isBBoxValid = false;
|
||||||
|
|
||||||
m_minX = m_maxX = m_minY = m_maxY = 0;
|
m_minX = m_maxX = m_minY = m_maxY = 0;
|
||||||
}
|
}
|
||||||
@@ -658,7 +658,7 @@ protected:
|
|||||||
|
|
||||||
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) = 0;
|
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) = 0;
|
||||||
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||||
bool useMask = FALSE) = 0;
|
bool useMask = false) = 0;
|
||||||
|
|
||||||
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) = 0;
|
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) = 0;
|
||||||
virtual void DoDrawRotatedText(const wxString& text,
|
virtual void DoDrawRotatedText(const wxString& text,
|
||||||
@@ -667,7 +667,7 @@ protected:
|
|||||||
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
||||||
wxCoord width, wxCoord height,
|
wxCoord width, wxCoord height,
|
||||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) = 0;
|
int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) = 0;
|
||||||
|
|
||||||
virtual void DoGetSize(int *width, int *height) const = 0;
|
virtual void DoGetSize(int *width, int *height) const = 0;
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const = 0;
|
virtual void DoGetSizeMM(int* width, int* height) const = 0;
|
||||||
|
@@ -188,7 +188,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||||
bool useMask = FALSE)
|
bool useMask = false)
|
||||||
{
|
{
|
||||||
m_dc.DoDrawBitmap(bmp, GetX(x, y), GetY(x, y), useMask);
|
m_dc.DoDrawBitmap(bmp, GetX(x, y), GetY(x, y), useMask);
|
||||||
}
|
}
|
||||||
@@ -209,8 +209,8 @@ protected:
|
|||||||
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
||||||
wxCoord w, wxCoord h,
|
wxCoord w, wxCoord h,
|
||||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int rop = wxCOPY, bool useMask = FALSE,
|
int rop = wxCOPY, bool useMask = false,
|
||||||
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1)
|
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord)
|
||||||
{
|
{
|
||||||
return m_dc.DoBlit(GetX(xdest, ydest), GetY(xdest, ydest),
|
return m_dc.DoBlit(GetX(xdest, ydest), GetY(xdest, ydest),
|
||||||
GetX(w, h), GetY(w, h),
|
GetX(w, h), GetY(w, h),
|
||||||
|
@@ -52,7 +52,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* All debugging macros rely on ASSERT() which in turn calls user-defined */
|
/* All debugging macros rely on ASSERT() which in turn calls user-defined */
|
||||||
/* OnAssert() function. To keep things simple, it's called even when the */
|
/* OnAssert() function. To keep things simple, it's called even when the */
|
||||||
/* expression is TRUE (i.e. everything is ok) and by default does nothing: just */
|
/* expression is true (i.e. everything is ok) and by default does nothing: just */
|
||||||
/* returns the same value back. But if you redefine it to do something more sexy */
|
/* returns the same value back. But if you redefine it to do something more sexy */
|
||||||
/* (popping up a message box in your favourite GUI, sending you e-mail or */
|
/* (popping up a message box in your favourite GUI, sending you e-mail or */
|
||||||
/* whatever) it will affect all ASSERTs, FAILs and CHECKs in your code. */
|
/* whatever) it will affect all ASSERTs, FAILs and CHECKs in your code. */
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
#endif /* __WXDEBUG__ */
|
#endif /* __WXDEBUG__ */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
/* Use of wxFalse instead of FALSE suppresses compiler warnings about testing */
|
/* Use of wxFalse instead of false suppresses compiler warnings about testing */
|
||||||
/* constant expression */
|
/* constant expression */
|
||||||
WXDLLIMPEXP_DATA_BASE(extern const bool) wxFalse;
|
WXDLLIMPEXP_DATA_BASE(extern const bool) wxFalse;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -56,7 +56,7 @@ public:
|
|||||||
static wxDialUpManager *Create();
|
static wxDialUpManager *Create();
|
||||||
|
|
||||||
// could the dialup manager be initialized correctly? If this function
|
// could the dialup manager be initialized correctly? If this function
|
||||||
// returns FALSE, no other functions will work neither, so it's a good idea
|
// returns false, no other functions will work neither, so it's a good idea
|
||||||
// to call this function and check its result before calling any other
|
// to call this function and check its result before calling any other
|
||||||
// wxDialUpManager methods
|
// wxDialUpManager methods
|
||||||
virtual bool IsOk() const = 0;
|
virtual bool IsOk() const = 0;
|
||||||
@@ -78,20 +78,20 @@ public:
|
|||||||
// if no username/password are given, the function will try to do without
|
// if no username/password are given, the function will try to do without
|
||||||
// them, but will ask the user if really needed
|
// them, but will ask the user if really needed
|
||||||
//
|
//
|
||||||
// if async parameter is FALSE, the function waits until the end of dialing
|
// if async parameter is false, the function waits until the end of dialing
|
||||||
// and returns TRUE upon successful completion.
|
// and returns true upon successful completion.
|
||||||
// if async is TRUE, the function only initiates the connection and returns
|
// if async is true, the function only initiates the connection and returns
|
||||||
// immediately - the result is reported via events (an event is sent
|
// immediately - the result is reported via events (an event is sent
|
||||||
// anyhow, but if dialing failed it will be a DISCONNECTED one)
|
// anyhow, but if dialing failed it will be a DISCONNECTED one)
|
||||||
virtual bool Dial(const wxString& nameOfISP = wxEmptyString,
|
virtual bool Dial(const wxString& nameOfISP = wxEmptyString,
|
||||||
const wxString& username = wxEmptyString,
|
const wxString& username = wxEmptyString,
|
||||||
const wxString& password = wxEmptyString,
|
const wxString& password = wxEmptyString,
|
||||||
bool async = TRUE) = 0;
|
bool async = true) = 0;
|
||||||
|
|
||||||
// returns TRUE if (async) dialing is in progress
|
// returns true if (async) dialing is in progress
|
||||||
virtual bool IsDialing() const = 0;
|
virtual bool IsDialing() const = 0;
|
||||||
|
|
||||||
// cancel dialing the number initiated with Dial(async = TRUE)
|
// cancel dialing the number initiated with Dial(async = true)
|
||||||
// NB: this won't result in DISCONNECTED event being sent
|
// NB: this won't result in DISCONNECTED event being sent
|
||||||
virtual bool CancelDialing() = 0;
|
virtual bool CancelDialing() = 0;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ public:
|
|||||||
// online status
|
// online status
|
||||||
// -------------
|
// -------------
|
||||||
|
|
||||||
// returns TRUE if the computer has a permanent network connection (i.e. is
|
// returns true if the computer has a permanent network connection (i.e. is
|
||||||
// on a LAN) and so there is no need to use Dial() function to go online
|
// on a LAN) and so there is no need to use Dial() function to go online
|
||||||
//
|
//
|
||||||
// NB: this functions tries to guess the result and it is not always
|
// NB: this functions tries to guess the result and it is not always
|
||||||
@@ -109,7 +109,7 @@ public:
|
|||||||
// confirmation or give him a possibility to override it
|
// confirmation or give him a possibility to override it
|
||||||
virtual bool IsAlwaysOnline() const = 0;
|
virtual bool IsAlwaysOnline() const = 0;
|
||||||
|
|
||||||
// returns TRUE if the computer is connected to the network: under Windows,
|
// returns true if the computer is connected to the network: under Windows,
|
||||||
// this just means that a RAS connection exists, under Unix we check that
|
// this just means that a RAS connection exists, under Unix we check that
|
||||||
// the "well-known host" (as specified by SetWellKnownHost) is reachable
|
// the "well-known host" (as specified by SetWellKnownHost) is reachable
|
||||||
virtual bool IsOnline() const = 0;
|
virtual bool IsOnline() const = 0;
|
||||||
@@ -118,7 +118,7 @@ public:
|
|||||||
// so, in general, the user should be allowed to override it. This function
|
// so, in general, the user should be allowed to override it. This function
|
||||||
// allows to forcefully set the online status - whatever our internal
|
// allows to forcefully set the online status - whatever our internal
|
||||||
// algorithm may think about it.
|
// algorithm may think about it.
|
||||||
virtual void SetOnlineStatus(bool isOnline = TRUE) = 0;
|
virtual void SetOnlineStatus(bool isOnline = true) = 0;
|
||||||
|
|
||||||
// set misc wxDialUpManager options
|
// set misc wxDialUpManager options
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
@@ -129,7 +129,7 @@ public:
|
|||||||
// Windows, the notification about the change of connection status is
|
// Windows, the notification about the change of connection status is
|
||||||
// instantenous.
|
// instantenous.
|
||||||
//
|
//
|
||||||
// Returns FALSE if couldn't set up automatic check for online status.
|
// Returns false if couldn't set up automatic check for online status.
|
||||||
virtual bool EnableAutoCheckOnlineStatus(size_t nSeconds = 60) = 0;
|
virtual bool EnableAutoCheckOnlineStatus(size_t nSeconds = 60) = 0;
|
||||||
|
|
||||||
// disable automatic check for connection status change - notice that the
|
// disable automatic check for connection status change - notice that the
|
||||||
@@ -192,9 +192,9 @@ typedef void (wxEvtHandler::*wxDialUpEventFunction)(wxDialUpEvent&);
|
|||||||
|
|
||||||
// macros to catch dialup events
|
// macros to catch dialup events
|
||||||
#define EVT_DIALUP_CONNECTED(func) \
|
#define EVT_DIALUP_CONNECTED(func) \
|
||||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_DIALUP_CONNECTED, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDialUpEventFunction, & func ), NULL),
|
DECLARE_EVENT_TABLE_ENTRY( wxEVT_DIALUP_CONNECTED, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDialUpEventFunction, & func ), NULL),
|
||||||
#define EVT_DIALUP_DISCONNECTED(func) \
|
#define EVT_DIALUP_DISCONNECTED(func) \
|
||||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_DIALUP_DISCONNECTED, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDialUpEventFunction, & func ), NULL),
|
DECLARE_EVENT_TABLE_ENTRY( wxEVT_DIALUP_DISCONNECTED, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDialUpEventFunction, & func ), NULL),
|
||||||
|
|
||||||
|
|
||||||
#endif // wxUSE_DIALUP_MANAGER
|
#endif // wxUSE_DIALUP_MANAGER
|
||||||
|
@@ -104,7 +104,7 @@ public:
|
|||||||
// open the directory for enumerating
|
// open the directory for enumerating
|
||||||
bool Open(const wxString& dir);
|
bool Open(const wxString& dir);
|
||||||
|
|
||||||
// returns TRUE if the directory was successfully opened
|
// returns true if the directory was successfully opened
|
||||||
bool IsOpened() const;
|
bool IsOpened() const;
|
||||||
|
|
||||||
// get the full name of the directory (without '/' at the end)
|
// get the full name of the directory (without '/' at the end)
|
||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
// start enumerating all files matching filespec (or all files if it is
|
// start enumerating all files matching filespec (or all files if it is
|
||||||
// empty) and flags, return TRUE on success
|
// empty) and flags, return true on success
|
||||||
bool GetFirst(wxString *filename,
|
bool GetFirst(wxString *filename,
|
||||||
const wxString& filespec = wxEmptyString,
|
const wxString& filespec = wxEmptyString,
|
||||||
int flags = wxDIR_DEFAULT) const;
|
int flags = wxDIR_DEFAULT) const;
|
||||||
|
@@ -97,9 +97,9 @@ public:
|
|||||||
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly) = 0;
|
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly) = 0;
|
||||||
|
|
||||||
// override to give feedback depending on the current operation result
|
// override to give feedback depending on the current operation result
|
||||||
// "effect" and return TRUE if you did something, FALSE to let the library
|
// "effect" and return true if you did something, false to let the library
|
||||||
// give the default feedback
|
// give the default feedback
|
||||||
virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return FALSE; }
|
virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const wxCursor& GetCursor(wxDragResult res) const
|
const wxCursor& GetCursor(wxDragResult res) const
|
||||||
@@ -177,7 +177,7 @@ public:
|
|||||||
virtual void OnLeave() { }
|
virtual void OnLeave() { }
|
||||||
|
|
||||||
// this function is called when data is dropped at position (x, y) - if it
|
// this function is called when data is dropped at position (x, y) - if it
|
||||||
// returns TRUE, OnData() will be called immediately afterwards which will
|
// returns true, OnData() will be called immediately afterwards which will
|
||||||
// allow to retrieve the data dropped.
|
// allow to retrieve the data dropped.
|
||||||
virtual bool OnDrop(wxCoord x, wxCoord y) = 0;
|
virtual bool OnDrop(wxCoord x, wxCoord y) = 0;
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ public:
|
|||||||
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0;
|
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0;
|
||||||
|
|
||||||
// may be called *only* from inside OnData() and will fill m_dataObject
|
// may be called *only* from inside OnData() and will fill m_dataObject
|
||||||
// with the data from the drop source if it returns TRUE
|
// with the data from the drop source if it returns true
|
||||||
virtual bool GetData() = 0;
|
virtual bool GetData() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -72,7 +72,7 @@ public:
|
|||||||
~wxDocument();
|
~wxDocument();
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
void SetFilename(const wxString& filename, bool notifyViews = FALSE);
|
void SetFilename(const wxString& filename, bool notifyViews = false);
|
||||||
wxString GetFilename() const { return m_documentFile; }
|
wxString GetFilename() const { return m_documentFile; }
|
||||||
|
|
||||||
void SetTitle(const wxString& title) { m_documentTitle = title; };
|
void SetTitle(const wxString& title) { m_documentTitle = title; };
|
||||||
@@ -82,7 +82,7 @@ public:
|
|||||||
wxString GetDocumentName() const { return m_documentTypeName; }
|
wxString GetDocumentName() const { return m_documentTypeName; }
|
||||||
|
|
||||||
bool GetDocumentSaved() const { return m_savedYet; }
|
bool GetDocumentSaved() const { return m_savedYet; }
|
||||||
void SetDocumentSaved(bool saved = TRUE) { m_savedYet = saved; }
|
void SetDocumentSaved(bool saved = true) { m_savedYet = saved; }
|
||||||
|
|
||||||
virtual bool Close();
|
virtual bool Close();
|
||||||
virtual bool Save();
|
virtual bool Save();
|
||||||
@@ -103,9 +103,9 @@ public:
|
|||||||
virtual bool OnNewDocument();
|
virtual bool OnNewDocument();
|
||||||
virtual bool OnCloseDocument();
|
virtual bool OnCloseDocument();
|
||||||
|
|
||||||
// Prompts for saving if about to close a modified document. Returns TRUE
|
// Prompts for saving if about to close a modified document. Returns true
|
||||||
// if ok to close the document (may have saved in the meantime, or set
|
// if ok to close the document (may have saved in the meantime, or set
|
||||||
// modified to FALSE)
|
// modified to false)
|
||||||
virtual bool OnSaveModified();
|
virtual bool OnSaveModified();
|
||||||
|
|
||||||
// Called by framework if created automatically by the default document
|
// Called by framework if created automatically by the default document
|
||||||
@@ -198,12 +198,12 @@ public:
|
|||||||
|
|
||||||
// Called by framework if created automatically by the default document
|
// Called by framework if created automatically by the default document
|
||||||
// manager class: gives view a chance to initialise
|
// manager class: gives view a chance to initialise
|
||||||
virtual bool OnCreate(wxDocument *WXUNUSED(doc), long WXUNUSED(flags)) { return TRUE; };
|
virtual bool OnCreate(wxDocument *WXUNUSED(doc), long WXUNUSED(flags)) { return true; };
|
||||||
|
|
||||||
// Checks if the view is the last one for the document; if so, asks user
|
// Checks if the view is the last one for the document; if so, asks user
|
||||||
// to confirm save data (if modified). If ok, deletes itself and returns
|
// to confirm save data (if modified). If ok, deletes itself and returns
|
||||||
// TRUE.
|
// true.
|
||||||
virtual bool Close(bool deleteWindow = TRUE);
|
virtual bool Close(bool deleteWindow = true);
|
||||||
|
|
||||||
// Override to do cleanup/veto close
|
// Override to do cleanup/veto close
|
||||||
virtual bool OnClose(bool deleteWindow);
|
virtual bool OnClose(bool deleteWindow);
|
||||||
@@ -317,7 +317,7 @@ private:
|
|||||||
class WXDLLEXPORT wxDocManager: public wxEvtHandler
|
class WXDLLEXPORT wxDocManager: public wxEvtHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDocManager(long flags = wxDEFAULT_DOCMAN_FLAGS, bool initialize = TRUE);
|
wxDocManager(long flags = wxDEFAULT_DOCMAN_FLAGS, bool initialize = true);
|
||||||
~wxDocManager();
|
~wxDocManager();
|
||||||
|
|
||||||
virtual bool Initialize();
|
virtual bool Initialize();
|
||||||
@@ -363,11 +363,11 @@ public:
|
|||||||
virtual bool FlushDoc(wxDocument *doc);
|
virtual bool FlushDoc(wxDocument *doc);
|
||||||
virtual wxDocTemplate *MatchTemplate(const wxString& path);
|
virtual wxDocTemplate *MatchTemplate(const wxString& path);
|
||||||
virtual wxDocTemplate *SelectDocumentPath(wxDocTemplate **templates,
|
virtual wxDocTemplate *SelectDocumentPath(wxDocTemplate **templates,
|
||||||
int noTemplates, wxString& path, long flags, bool save = FALSE);
|
int noTemplates, wxString& path, long flags, bool save = false);
|
||||||
virtual wxDocTemplate *SelectDocumentType(wxDocTemplate **templates,
|
virtual wxDocTemplate *SelectDocumentType(wxDocTemplate **templates,
|
||||||
int noTemplates, bool sort = FALSE);
|
int noTemplates, bool sort = false);
|
||||||
virtual wxDocTemplate *SelectViewType(wxDocTemplate **templates,
|
virtual wxDocTemplate *SelectViewType(wxDocTemplate **templates,
|
||||||
int noTemplates, bool sort = FALSE);
|
int noTemplates, bool sort = false);
|
||||||
virtual wxDocTemplate *FindTemplateForPath(const wxString& path);
|
virtual wxDocTemplate *FindTemplateForPath(const wxString& path);
|
||||||
|
|
||||||
void AssociateTemplate(wxDocTemplate *temp);
|
void AssociateTemplate(wxDocTemplate *temp);
|
||||||
@@ -383,17 +383,17 @@ public:
|
|||||||
void RemoveDocument(wxDocument *doc);
|
void RemoveDocument(wxDocument *doc);
|
||||||
|
|
||||||
// closes all currently open documents
|
// closes all currently open documents
|
||||||
bool CloseDocuments(bool force = TRUE);
|
bool CloseDocuments(bool force = true);
|
||||||
|
|
||||||
// closes the specified document
|
// closes the specified document
|
||||||
bool CloseDocument(wxDocument* doc, bool force = FALSE);
|
bool CloseDocument(wxDocument* doc, bool force = false);
|
||||||
|
|
||||||
// Clear remaining documents and templates
|
// Clear remaining documents and templates
|
||||||
bool Clear(bool force = TRUE);
|
bool Clear(bool force = true);
|
||||||
|
|
||||||
// Views or windows should inform the document manager
|
// Views or windows should inform the document manager
|
||||||
// when a view is going in or out of focus
|
// when a view is going in or out of focus
|
||||||
virtual void ActivateView(wxView *view, bool activate = TRUE);
|
virtual void ActivateView(wxView *view, bool activate = true);
|
||||||
virtual wxView *GetCurrentView() const;
|
virtual wxView *GetCurrentView() const;
|
||||||
|
|
||||||
wxList& GetDocuments() { return m_docs; }
|
wxList& GetDocuments() { return m_docs; }
|
||||||
|
@@ -141,7 +141,7 @@ protected: \
|
|||||||
T& Item(size_t uiIndex) const \
|
T& Item(size_t uiIndex) const \
|
||||||
{ wxASSERT( uiIndex < size() ); return (T&)operator[](uiIndex); } \
|
{ wxASSERT( uiIndex < size() ); return (T&)operator[](uiIndex); } \
|
||||||
\
|
\
|
||||||
int Index(T e, bool bFromEnd = FALSE) const; \
|
int Index(T e, bool bFromEnd = false) const; \
|
||||||
int Index(T lItem, CMPFUNC fnCompare) const; \
|
int Index(T lItem, CMPFUNC fnCompare) const; \
|
||||||
size_t IndexForInsert(T lItem, CMPFUNC fnCompare) const; \
|
size_t IndexForInsert(T lItem, CMPFUNC fnCompare) const; \
|
||||||
void Add(T lItem, size_t nInsert = 1) \
|
void Add(T lItem, size_t nInsert = 1) \
|
||||||
@@ -189,7 +189,7 @@ protected: \
|
|||||||
{ wxASSERT( uiIndex < m_nCount ); return m_pItems[uiIndex]; } \
|
{ wxASSERT( uiIndex < m_nCount ); return m_pItems[uiIndex]; } \
|
||||||
T& operator[](size_t uiIndex) const { return Item(uiIndex); } \
|
T& operator[](size_t uiIndex) const { return Item(uiIndex); } \
|
||||||
\
|
\
|
||||||
int Index(T lItem, bool bFromEnd = FALSE) const; \
|
int Index(T lItem, bool bFromEnd = false) const; \
|
||||||
int Index(T lItem, CMPFUNC fnCompare) const; \
|
int Index(T lItem, CMPFUNC fnCompare) const; \
|
||||||
size_t IndexForInsert(T lItem, CMPFUNC fnCompare) const; \
|
size_t IndexForInsert(T lItem, CMPFUNC fnCompare) const; \
|
||||||
void Add(T lItem, size_t nInsert = 1); \
|
void Add(T lItem, size_t nInsert = 1); \
|
||||||
@@ -293,7 +293,7 @@ public: \
|
|||||||
T& Last() const \
|
T& Last() const \
|
||||||
{ return Item(Count() - 1); } \
|
{ return Item(Count() - 1); } \
|
||||||
\
|
\
|
||||||
int Index(T e, bool bFromEnd = FALSE) const \
|
int Index(T e, bool bFromEnd = false) const \
|
||||||
{ return base::Index(e, bFromEnd); } \
|
{ return base::Index(e, bFromEnd); } \
|
||||||
\
|
\
|
||||||
void Add(T Item, size_t nInsert = 1) \
|
void Add(T Item, size_t nInsert = 1) \
|
||||||
@@ -342,7 +342,7 @@ public: \
|
|||||||
T& Last() const \
|
T& Last() const \
|
||||||
{ return (T&)(base::operator[](Count() - 1)); } \
|
{ return (T&)(base::operator[](Count() - 1)); } \
|
||||||
\
|
\
|
||||||
int Index(T Item, bool bFromEnd = FALSE) const \
|
int Index(T Item, bool bFromEnd = false) const \
|
||||||
{ return base::Index((base_type)Item, bFromEnd); } \
|
{ return base::Index((base_type)Item, bFromEnd); } \
|
||||||
\
|
\
|
||||||
void Add(T Item, size_t nInsert = 1) \
|
void Add(T Item, size_t nInsert = 1) \
|
||||||
@@ -575,7 +575,7 @@ public: \
|
|||||||
T& Last() const \
|
T& Last() const \
|
||||||
{ return *(T*)(base::operator[](size() - 1)); } \
|
{ return *(T*)(base::operator[](size() - 1)); } \
|
||||||
\
|
\
|
||||||
int Index(const T& Item, bool bFromEnd = FALSE) const; \
|
int Index(const T& Item, bool bFromEnd = false) const; \
|
||||||
\
|
\
|
||||||
void Add(const T& Item, size_t nInsert = 1); \
|
void Add(const T& Item, size_t nInsert = 1); \
|
||||||
void Add(const T* pItem) \
|
void Add(const T* pItem) \
|
||||||
|
@@ -131,7 +131,7 @@ public:
|
|||||||
// to use it polymorphically.
|
// to use it polymorphically.
|
||||||
~wxDynamicLibrary() { Unload(); }
|
~wxDynamicLibrary() { Unload(); }
|
||||||
|
|
||||||
// return TRUE if the library was loaded successfully
|
// return true if the library was loaded successfully
|
||||||
bool IsLoaded() const { return m_handle != 0; }
|
bool IsLoaded() const { return m_handle != 0; }
|
||||||
|
|
||||||
// load the library with the given name (full or not), return true if ok
|
// load the library with the given name (full or not), return true if ok
|
||||||
@@ -220,8 +220,8 @@ public:
|
|||||||
which case the library is searched for in all standard locations
|
which case the library is searched for in all standard locations
|
||||||
(use GetDllExt() to construct the filename)
|
(use GetDllExt() to construct the filename)
|
||||||
|
|
||||||
if success pointer is not NULL, it will be filled with TRUE if everything
|
if success pointer is not NULL, it will be filled with true if everything
|
||||||
went ok and FALSE otherwise
|
went ok and false otherwise
|
||||||
*/
|
*/
|
||||||
static wxDllType LoadLibrary(const wxString& name, bool *success = NULL);
|
static wxDllType LoadLibrary(const wxString& name, bool *success = NULL);
|
||||||
|
|
||||||
|
@@ -155,6 +155,6 @@ WXDLLEXPORT_DATA(const wxChar *) wxUserResourceStr = wxT("TEXT");
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
const wxSize wxDefaultSize(-1, -1);
|
const wxSize wxDefaultSize(wxDefaultCoord, wxDefaultCoord);
|
||||||
const wxPoint wxDefaultPosition(-1, -1);
|
const wxPoint wxDefaultPosition(wxDefaultCoord, wxDefaultCoord);
|
||||||
|
|
||||||
|
@@ -171,7 +171,7 @@ public:
|
|||||||
{
|
{
|
||||||
wxDateTimeHolidayAuthority::AddAuthority(new wxDateTimeWorkDays);
|
wxDateTimeHolidayAuthority::AddAuthority(new wxDateTimeWorkDays);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnExit()
|
virtual void OnExit()
|
||||||
@@ -275,8 +275,8 @@ wxDateTime::wxDateTime_t GetNumOfDaysInMonth(int year, wxDateTime::Month month)
|
|||||||
static int GetTimeZone()
|
static int GetTimeZone()
|
||||||
{
|
{
|
||||||
#ifdef WX_GMTOFF_IN_TM
|
#ifdef WX_GMTOFF_IN_TM
|
||||||
// set to TRUE when the timezone is set
|
// set to true when the timezone is set
|
||||||
static bool s_timezoneSet = FALSE;
|
static bool s_timezoneSet = false;
|
||||||
static long gmtoffset = LONG_MAX; // invalid timezone
|
static long gmtoffset = LONG_MAX; // invalid timezone
|
||||||
|
|
||||||
// ensure that the timezone variable is set by calling localtime
|
// ensure that the timezone variable is set by calling localtime
|
||||||
@@ -288,7 +288,7 @@ static int GetTimeZone()
|
|||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
|
|
||||||
tm = localtime(&t);
|
tm = localtime(&t);
|
||||||
s_timezoneSet = TRUE;
|
s_timezoneSet = true;
|
||||||
|
|
||||||
// note that GMT offset is the opposite of time zone and so to return
|
// note that GMT offset is the opposite of time zone and so to return
|
||||||
// consistent results in both WX_GMTOFF_IN_TM and !WX_GMTOFF_IN_TM
|
// consistent results in both WX_GMTOFF_IN_TM and !WX_GMTOFF_IN_TM
|
||||||
@@ -500,7 +500,7 @@ static bool GetNumericToken(size_t len, const wxChar*& p, unsigned long *number)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !!s && s.ToULong(number);
|
return !s.IsEmpty() && s.ToULong(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
// scans all alphabetic characters and returns the resulting string
|
// scans all alphabetic characters and returns the resulting string
|
||||||
@@ -691,7 +691,7 @@ bool wxDateTime::IsLeapYear(int year, wxDateTime::Calendar cal)
|
|||||||
{
|
{
|
||||||
wxFAIL_MSG(_T("unknown calendar"));
|
wxFAIL_MSG(_T("unknown calendar"));
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1002,7 +1002,7 @@ wxDateTime wxDateTime::GetBeginDST(int year, Country country)
|
|||||||
dt += wxTimeSpan::Hours(1);
|
dt += wxTimeSpan::Hours(1);
|
||||||
|
|
||||||
// disable DST tests because it could result in an infinite recursion!
|
// disable DST tests because it could result in an infinite recursion!
|
||||||
dt.MakeGMT(TRUE);
|
dt.MakeGMT(true);
|
||||||
}
|
}
|
||||||
else switch ( country )
|
else switch ( country )
|
||||||
{
|
{
|
||||||
@@ -1103,7 +1103,7 @@ wxDateTime wxDateTime::GetEndDST(int year, Country country)
|
|||||||
dt += wxTimeSpan::Hours(1);
|
dt += wxTimeSpan::Hours(1);
|
||||||
|
|
||||||
// disable DST tests because it could result in an infinite recursion!
|
// disable DST tests because it could result in an infinite recursion!
|
||||||
dt.MakeGMT(TRUE);
|
dt.MakeGMT(true);
|
||||||
}
|
}
|
||||||
else switch ( country )
|
else switch ( country )
|
||||||
{
|
{
|
||||||
@@ -1662,10 +1662,10 @@ bool wxDateTime::SetToTheWeek(wxDateTime_t numWeek,
|
|||||||
if ( GetYear() != year )
|
if ( GetYear() != year )
|
||||||
{
|
{
|
||||||
// oops... numWeek was too big
|
// oops... numWeek was too big
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime& wxDateTime::SetToLastMonthDay(Month month,
|
wxDateTime& wxDateTime::SetToLastMonthDay(Month month,
|
||||||
@@ -1770,9 +1770,9 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday,
|
|||||||
Month month,
|
Month month,
|
||||||
int year)
|
int year)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( weekday != Inv_WeekDay, FALSE, _T("invalid weekday") );
|
wxCHECK_MSG( weekday != Inv_WeekDay, false, _T("invalid weekday") );
|
||||||
|
|
||||||
// we don't check explicitly that -5 <= n <= 5 because we will return FALSE
|
// we don't check explicitly that -5 <= n <= 5 because we will return false
|
||||||
// anyhow in such case - but may be should still give an assert for it?
|
// anyhow in such case - but may be should still give an assert for it?
|
||||||
|
|
||||||
// take the current month/year if none specified
|
// take the current month/year if none specified
|
||||||
@@ -1824,12 +1824,12 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday,
|
|||||||
{
|
{
|
||||||
*this = dt;
|
*this = dt;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// no such day in this month
|
// no such day in this month
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2087,17 +2087,17 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
|||||||
fmt = _T("%02d");
|
fmt = _T("%02d");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool restart = TRUE;
|
bool restart = true;
|
||||||
while ( restart )
|
while ( restart )
|
||||||
{
|
{
|
||||||
restart = FALSE;
|
restart = false;
|
||||||
|
|
||||||
// start of the format specification
|
// start of the format specification
|
||||||
switch ( *p )
|
switch ( *p )
|
||||||
{
|
{
|
||||||
case _T('a'): // a weekday name
|
case _T('a'): // a weekday name
|
||||||
case _T('A'):
|
case _T('A'):
|
||||||
// second parameter should be TRUE for abbreviated names
|
// second parameter should be true for abbreviated names
|
||||||
res += GetWeekDayName(tm.GetWeekDay(),
|
res += GetWeekDayName(tm.GetWeekDay(),
|
||||||
*p == _T('a') ? Name_Abbr : Name_Full);
|
*p == _T('a') ? Name_Abbr : Name_Full);
|
||||||
break;
|
break;
|
||||||
@@ -2328,7 +2328,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
|||||||
fmt.Prepend(_T('%'));
|
fmt.Prepend(_T('%'));
|
||||||
fmt.Append(_T('d'));
|
fmt.Append(_T('d'));
|
||||||
|
|
||||||
restart = TRUE;
|
restart = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2661,17 +2661,17 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
unsigned long num;
|
unsigned long num;
|
||||||
|
|
||||||
// what fields have we found?
|
// what fields have we found?
|
||||||
bool haveWDay = FALSE,
|
bool haveWDay = false,
|
||||||
haveYDay = FALSE,
|
haveYDay = false,
|
||||||
haveDay = FALSE,
|
haveDay = false,
|
||||||
haveMon = FALSE,
|
haveMon = false,
|
||||||
haveYear = FALSE,
|
haveYear = false,
|
||||||
haveHour = FALSE,
|
haveHour = false,
|
||||||
haveMin = FALSE,
|
haveMin = false,
|
||||||
haveSec = FALSE;
|
haveSec = false;
|
||||||
|
|
||||||
bool hourIsIn12hFormat = FALSE, // or in 24h one?
|
bool hourIsIn12hFormat = false, // or in 24h one?
|
||||||
isPM = FALSE; // AM by default
|
isPM = false; // AM by default
|
||||||
|
|
||||||
// and the value of the items we have (init them to get rid of warnings)
|
// and the value of the items we have (init them to get rid of warnings)
|
||||||
wxDateTime_t sec = 0,
|
wxDateTime_t sec = 0,
|
||||||
@@ -2760,7 +2760,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
haveWDay = TRUE;
|
haveWDay = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _T('b'): // a month name
|
case _T('b'): // a month name
|
||||||
@@ -2774,7 +2774,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
haveMon = TRUE;
|
haveMon = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _T('c'): // locale default date and time representation
|
case _T('c'): // locale default date and time representation
|
||||||
@@ -2805,7 +2805,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
Tm tm = dt.GetTm();
|
Tm tm = dt.GetTm();
|
||||||
|
|
||||||
haveDay = haveMon = haveYear =
|
haveDay = haveMon = haveYear =
|
||||||
haveHour = haveMin = haveSec = TRUE;
|
haveHour = haveMin = haveSec = true;
|
||||||
|
|
||||||
hour = tm.hour;
|
hour = tm.hour;
|
||||||
min = tm.min;
|
min = tm.min;
|
||||||
@@ -2829,7 +2829,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
|
|
||||||
// we can't check whether the day range is correct yet, will
|
// we can't check whether the day range is correct yet, will
|
||||||
// do it later - assume ok for now
|
// do it later - assume ok for now
|
||||||
haveDay = TRUE;
|
haveDay = true;
|
||||||
mday = (wxDateTime_t)num;
|
mday = (wxDateTime_t)num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2840,7 +2840,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveHour = TRUE;
|
haveHour = true;
|
||||||
hour = (wxDateTime_t)num;
|
hour = (wxDateTime_t)num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2851,8 +2851,8 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveHour = TRUE;
|
haveHour = true;
|
||||||
hourIsIn12hFormat = TRUE;
|
hourIsIn12hFormat = true;
|
||||||
hour = (wxDateTime_t)(num % 12); // 12 should be 0
|
hour = (wxDateTime_t)(num % 12); // 12 should be 0
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2863,7 +2863,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveYDay = TRUE;
|
haveYDay = true;
|
||||||
yday = (wxDateTime_t)num;
|
yday = (wxDateTime_t)num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2874,7 +2874,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveMon = TRUE;
|
haveMon = true;
|
||||||
mon = (Month)(num - 1);
|
mon = (Month)(num - 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2885,7 +2885,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveMin = TRUE;
|
haveMin = true;
|
||||||
min = (wxDateTime_t)num;
|
min = (wxDateTime_t)num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2898,7 +2898,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL; // no am/pm strings defined
|
return (wxChar *)NULL; // no am/pm strings defined
|
||||||
if ( token.CmpNoCase(pm) == 0 )
|
if ( token.CmpNoCase(pm) == 0 )
|
||||||
{
|
{
|
||||||
isPM = TRUE;
|
isPM = true;
|
||||||
}
|
}
|
||||||
else if ( token.CmpNoCase(am) != 0 )
|
else if ( token.CmpNoCase(am) != 0 )
|
||||||
{
|
{
|
||||||
@@ -2918,7 +2918,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveHour = haveMin = haveSec = TRUE;
|
haveHour = haveMin = haveSec = true;
|
||||||
|
|
||||||
Tm tm = dt.GetTm();
|
Tm tm = dt.GetTm();
|
||||||
hour = tm.hour;
|
hour = tm.hour;
|
||||||
@@ -2937,7 +2937,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveHour = haveMin = TRUE;
|
haveHour = haveMin = true;
|
||||||
|
|
||||||
Tm tm = dt.GetTm();
|
Tm tm = dt.GetTm();
|
||||||
hour = tm.hour;
|
hour = tm.hour;
|
||||||
@@ -2951,7 +2951,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveSec = TRUE;
|
haveSec = true;
|
||||||
sec = (wxDateTime_t)num;
|
sec = (wxDateTime_t)num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2965,7 +2965,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveHour = haveMin = haveSec = TRUE;
|
haveHour = haveMin = haveSec = true;
|
||||||
|
|
||||||
Tm tm = dt.GetTm();
|
Tm tm = dt.GetTm();
|
||||||
hour = tm.hour;
|
hour = tm.hour;
|
||||||
@@ -2981,7 +2981,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveWDay = TRUE;
|
haveWDay = true;
|
||||||
wday = (WeekDay)num;
|
wday = (WeekDay)num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2998,7 +2998,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
{
|
{
|
||||||
input = result;
|
input = result;
|
||||||
|
|
||||||
haveDay = haveMon = haveYear = TRUE;
|
haveDay = haveMon = haveYear = true;
|
||||||
|
|
||||||
year = 1900 + tm.tm_year;
|
year = 1900 + tm.tm_year;
|
||||||
mon = (Month)tm.tm_mon;
|
mon = (Month)tm.tm_mon;
|
||||||
@@ -3042,7 +3042,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
|
|
||||||
Tm tm = dt.GetTm();
|
Tm tm = dt.GetTm();
|
||||||
|
|
||||||
haveDay = haveMon = haveYear = TRUE;
|
haveDay = haveMon = haveYear = true;
|
||||||
|
|
||||||
year = tm.year;
|
year = tm.year;
|
||||||
mon = tm.mon;
|
mon = tm.mon;
|
||||||
@@ -3064,7 +3064,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveHour = haveMin = haveSec = TRUE;
|
haveHour = haveMin = haveSec = true;
|
||||||
|
|
||||||
hour = tm.tm_hour;
|
hour = tm.tm_hour;
|
||||||
min = tm.tm_min;
|
min = tm.tm_min;
|
||||||
@@ -3092,7 +3092,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveHour = haveMin = haveSec = TRUE;
|
haveHour = haveMin = haveSec = true;
|
||||||
|
|
||||||
Tm tm = dt.GetTm();
|
Tm tm = dt.GetTm();
|
||||||
hour = tm.hour;
|
hour = tm.hour;
|
||||||
@@ -3111,7 +3111,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveYear = TRUE;
|
haveYear = true;
|
||||||
|
|
||||||
// TODO should have an option for roll over date instead of
|
// TODO should have an option for roll over date instead of
|
||||||
// hard coding it here
|
// hard coding it here
|
||||||
@@ -3125,7 +3125,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveYear = TRUE;
|
haveYear = true;
|
||||||
year = (wxDateTime_t)num;
|
year = (wxDateTime_t)num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -3342,10 +3342,10 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
// have the ability to back track.
|
// have the ability to back track.
|
||||||
|
|
||||||
// what do we have?
|
// what do we have?
|
||||||
bool haveDay = FALSE, // the months day?
|
bool haveDay = false, // the months day?
|
||||||
haveWDay = FALSE, // the day of week?
|
haveWDay = false, // the day of week?
|
||||||
haveMon = FALSE, // the month?
|
haveMon = false, // the month?
|
||||||
haveYear = FALSE; // the year?
|
haveYear = false; // the year?
|
||||||
|
|
||||||
// and the value of the items we have (init them to get rid of warnings)
|
// and the value of the items we have (init them to get rid of warnings)
|
||||||
WeekDay wday = Inv_WeekDay;
|
WeekDay wday = Inv_WeekDay;
|
||||||
@@ -3369,21 +3369,21 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
{
|
{
|
||||||
// guess what this number is
|
// guess what this number is
|
||||||
|
|
||||||
bool isDay = FALSE,
|
bool isDay = false,
|
||||||
isMonth = FALSE,
|
isMonth = false,
|
||||||
isYear = FALSE;
|
isYear = false;
|
||||||
|
|
||||||
if ( !haveMon && val > 0 && val <= 12 )
|
if ( !haveMon && val > 0 && val <= 12 )
|
||||||
{
|
{
|
||||||
// assume it is month
|
// assume it is month
|
||||||
isMonth = TRUE;
|
isMonth = true;
|
||||||
}
|
}
|
||||||
else // not the month
|
else // not the month
|
||||||
{
|
{
|
||||||
if ( haveDay )
|
if ( haveDay )
|
||||||
{
|
{
|
||||||
// this can only be the year
|
// this can only be the year
|
||||||
isYear = TRUE;
|
isYear = true;
|
||||||
}
|
}
|
||||||
else // may be either day or year
|
else // may be either day or year
|
||||||
{
|
{
|
||||||
@@ -3395,11 +3395,11 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
if ( (val == 0) || (val > (unsigned long)maxDays) )
|
if ( (val == 0) || (val > (unsigned long)maxDays) )
|
||||||
{
|
{
|
||||||
// no
|
// no
|
||||||
isYear = TRUE;
|
isYear = true;
|
||||||
}
|
}
|
||||||
else // yes, suppose it's the day
|
else // yes, suppose it's the day
|
||||||
{
|
{
|
||||||
isDay = TRUE;
|
isDay = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3409,7 +3409,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
if ( haveYear )
|
if ( haveYear )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
haveYear = TRUE;
|
haveYear = true;
|
||||||
|
|
||||||
year = (wxDateTime_t)val;
|
year = (wxDateTime_t)val;
|
||||||
}
|
}
|
||||||
@@ -3418,13 +3418,13 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
if ( haveDay )
|
if ( haveDay )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
haveDay = TRUE;
|
haveDay = true;
|
||||||
|
|
||||||
day = (wxDateTime_t)val;
|
day = (wxDateTime_t)val;
|
||||||
}
|
}
|
||||||
else if ( isMonth )
|
else if ( isMonth )
|
||||||
{
|
{
|
||||||
haveMon = TRUE;
|
haveMon = true;
|
||||||
|
|
||||||
mon = (Month)(val - 1);
|
mon = (Month)(val - 1);
|
||||||
}
|
}
|
||||||
@@ -3444,7 +3444,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
// no need to check in month range as always < 12, but
|
// no need to check in month range as always < 12, but
|
||||||
// the days are counted from 1 unlike the months
|
// the days are counted from 1 unlike the months
|
||||||
day = (wxDateTime_t)mon + 1;
|
day = (wxDateTime_t)mon + 1;
|
||||||
haveDay = TRUE;
|
haveDay = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3456,7 +3456,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
|
|
||||||
mon = mon2;
|
mon = mon2;
|
||||||
|
|
||||||
haveMon = TRUE;
|
haveMon = true;
|
||||||
}
|
}
|
||||||
else // not a valid month name
|
else // not a valid month name
|
||||||
{
|
{
|
||||||
@@ -3469,7 +3469,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveWDay = TRUE;
|
haveWDay = true;
|
||||||
}
|
}
|
||||||
else // not a valid weekday name
|
else // not a valid weekday name
|
||||||
{
|
{
|
||||||
@@ -3524,7 +3524,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
haveDay = TRUE;
|
haveDay = true;
|
||||||
|
|
||||||
day = (wxDateTime_t)(n + 1);
|
day = (wxDateTime_t)(n + 1);
|
||||||
}
|
}
|
||||||
@@ -3567,10 +3567,10 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
{
|
{
|
||||||
day = year;
|
day = year;
|
||||||
|
|
||||||
haveMon = TRUE;
|
haveMon = true;
|
||||||
haveYear = FALSE;
|
haveYear = false;
|
||||||
}
|
}
|
||||||
//else: no, can't exchange, leave haveMon == FALSE
|
//else: no, can't exchange, leave haveMon == false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3910,11 +3910,11 @@ bool wxDateTimeHolidayAuthority::IsHoliday(const wxDateTime& dt)
|
|||||||
{
|
{
|
||||||
if ( ms_authorities[n]->DoIsHoliday(dt) )
|
if ( ms_authorities[n]->DoIsHoliday(dt) )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
|
@@ -30,10 +30,10 @@
|
|||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxDataInputStream::wxDataInputStream(wxInputStream& s, wxMBConv& conv)
|
wxDataInputStream::wxDataInputStream(wxInputStream& s, wxMBConv& conv)
|
||||||
: m_input(&s), m_be_order(FALSE), m_conv(conv)
|
: m_input(&s), m_be_order(false), m_conv(conv)
|
||||||
#else
|
#else
|
||||||
wxDataInputStream::wxDataInputStream(wxInputStream& s)
|
wxDataInputStream::wxDataInputStream(wxInputStream& s)
|
||||||
: m_input(&s), m_be_order(FALSE)
|
: m_input(&s), m_be_order(false)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -269,10 +269,10 @@ wxDataInputStream& wxDataInputStream::operator>>(float& f)
|
|||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxDataOutputStream::wxDataOutputStream(wxOutputStream& s, wxMBConv& conv)
|
wxDataOutputStream::wxDataOutputStream(wxOutputStream& s, wxMBConv& conv)
|
||||||
: m_output(&s), m_be_order(FALSE), m_conv(conv)
|
: m_output(&s), m_be_order(false), m_conv(conv)
|
||||||
#else
|
#else
|
||||||
wxDataOutputStream::wxDataOutputStream(wxOutputStream& s)
|
wxDataOutputStream::wxDataOutputStream(wxOutputStream& s)
|
||||||
: m_output(&s), m_be_order(FALSE)
|
: m_output(&s), m_be_order(false)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -106,7 +106,7 @@ typedef struct
|
|||||||
wxDbConnectInf::wxDbConnectInf()
|
wxDbConnectInf::wxDbConnectInf()
|
||||||
{
|
{
|
||||||
Henv = 0;
|
Henv = 0;
|
||||||
freeHenvOnDestroy = FALSE;
|
freeHenvOnDestroy = false;
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
} // Constructor
|
} // Constructor
|
||||||
@@ -118,7 +118,7 @@ wxDbConnectInf::wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &u
|
|||||||
const wxString &fileType, const wxString &description)
|
const wxString &fileType, const wxString &description)
|
||||||
{
|
{
|
||||||
Henv = 0;
|
Henv = 0;
|
||||||
freeHenvOnDestroy = FALSE;
|
freeHenvOnDestroy = false;
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ wxDbConnectInf::~wxDbConnectInf()
|
|||||||
/********** wxDbConnectInf::Initialize() **********/
|
/********** wxDbConnectInf::Initialize() **********/
|
||||||
bool wxDbConnectInf::Initialize()
|
bool wxDbConnectInf::Initialize()
|
||||||
{
|
{
|
||||||
freeHenvOnDestroy = FALSE;
|
freeHenvOnDestroy = false;
|
||||||
|
|
||||||
if (freeHenvOnDestroy && Henv)
|
if (freeHenvOnDestroy && Henv)
|
||||||
FreeHenv();
|
FreeHenv();
|
||||||
@@ -163,9 +163,9 @@ bool wxDbConnectInf::Initialize()
|
|||||||
FileType.Empty();
|
FileType.Empty();
|
||||||
DefaultDir.Empty();
|
DefaultDir.Empty();
|
||||||
|
|
||||||
useConnectionStr = FALSE;
|
useConnectionStr = false;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
} // wxDbConnectInf::Initialize()
|
} // wxDbConnectInf::Initialize()
|
||||||
|
|
||||||
|
|
||||||
@@ -180,12 +180,12 @@ bool wxDbConnectInf::AllocHenv()
|
|||||||
if (SQLAllocEnv(&Henv) != SQL_SUCCESS)
|
if (SQLAllocEnv(&Henv) != SQL_SUCCESS)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("A problem occured while trying to get a connection to the data source"));
|
wxLogDebug(wxT("A problem occured while trying to get a connection to the data source"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
freeHenvOnDestroy = TRUE;
|
freeHenvOnDestroy = true;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
} // wxDbConnectInf::AllocHenv()
|
} // wxDbConnectInf::AllocHenv()
|
||||||
|
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ void wxDbConnectInf::FreeHenv()
|
|||||||
SQLFreeEnv(Henv);
|
SQLFreeEnv(Henv);
|
||||||
|
|
||||||
Henv = 0;
|
Henv = 0;
|
||||||
freeHenvOnDestroy = FALSE;
|
freeHenvOnDestroy = false;
|
||||||
|
|
||||||
} // wxDbConnectInf::FreeHenv()
|
} // wxDbConnectInf::FreeHenv()
|
||||||
|
|
||||||
@@ -393,7 +393,7 @@ bool wxDbColInf::Initialize()
|
|||||||
FkTableName[0] = 0;
|
FkTableName[0] = 0;
|
||||||
pColFor = NULL;
|
pColFor = NULL;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
} // wxDbColInf::Initialize()
|
} // wxDbColInf::Initialize()
|
||||||
|
|
||||||
|
|
||||||
@@ -421,7 +421,7 @@ bool wxDbTableInf::Initialize()
|
|||||||
numCols = 0;
|
numCols = 0;
|
||||||
pColInf = NULL;
|
pColInf = NULL;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
} // wxDbTableInf::Initialize()
|
} // wxDbTableInf::Initialize()
|
||||||
|
|
||||||
|
|
||||||
@@ -449,7 +449,7 @@ bool wxDbInf::Initialize()
|
|||||||
numTables = 0;
|
numTables = 0;
|
||||||
pTableInf = NULL;
|
pTableInf = NULL;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
} // wxDbInf::Initialize()
|
} // wxDbInf::Initialize()
|
||||||
|
|
||||||
|
|
||||||
@@ -530,7 +530,7 @@ void wxDb::initialize()
|
|||||||
typeInfBlob.MaximumScale = 0;
|
typeInfBlob.MaximumScale = 0;
|
||||||
|
|
||||||
// Error reporting is turned OFF by default
|
// Error reporting is turned OFF by default
|
||||||
silent = TRUE;
|
silent = true;
|
||||||
|
|
||||||
// Allocate a data source connection handle
|
// Allocate a data source connection handle
|
||||||
if (SQLAllocConnect(henv, &hdbc) != SQL_SUCCESS)
|
if (SQLAllocConnect(henv, &hdbc) != SQL_SUCCESS)
|
||||||
@@ -540,9 +540,9 @@ void wxDb::initialize()
|
|||||||
DB_STATUS = 0;
|
DB_STATUS = 0;
|
||||||
|
|
||||||
// Mark database as not open as of yet
|
// Mark database as not open as of yet
|
||||||
dbIsOpen = FALSE;
|
dbIsOpen = false;
|
||||||
dbIsCached = FALSE;
|
dbIsCached = false;
|
||||||
dbOpenedWithConnectionString = FALSE;
|
dbOpenedWithConnectionString = false;
|
||||||
} // wxDb::initialize()
|
} // wxDb::initialize()
|
||||||
|
|
||||||
|
|
||||||
@@ -589,7 +589,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Mark database as open
|
// Mark database as open
|
||||||
dbIsOpen = TRUE;
|
dbIsOpen = true;
|
||||||
|
|
||||||
// Allocate a statement handle for the database connection
|
// Allocate a statement handle for the database connection
|
||||||
if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS)
|
if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS)
|
||||||
@@ -597,11 +597,11 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
|
|||||||
|
|
||||||
// Set Connection Options
|
// Set Connection Options
|
||||||
if (!setConnectionOptions())
|
if (!setConnectionOptions())
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
// Query the data source for inf. about itself
|
// Query the data source for inf. about itself
|
||||||
if (!getDbInfo(failOnDataTypeUnsupported))
|
if (!getDbInfo(failOnDataTypeUnsupported))
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
// Query the data source regarding data type information
|
// Query the data source regarding data type information
|
||||||
|
|
||||||
@@ -647,7 +647,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
|
|||||||
// VARCHAR = Variable length character string
|
// VARCHAR = Variable length character string
|
||||||
if (!getDataTypeInfo(SQL_VARCHAR, typeInfVarchar))
|
if (!getDataTypeInfo(SQL_VARCHAR, typeInfVarchar))
|
||||||
if (!getDataTypeInfo(SQL_CHAR, typeInfVarchar))
|
if (!getDataTypeInfo(SQL_CHAR, typeInfVarchar))
|
||||||
return(FALSE);
|
return false;
|
||||||
else
|
else
|
||||||
typeInfVarchar.FsqlType = SQL_CHAR;
|
typeInfVarchar.FsqlType = SQL_CHAR;
|
||||||
else
|
else
|
||||||
@@ -661,7 +661,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
|
|||||||
if (!getDataTypeInfo(SQL_NUMERIC,typeInfFloat))
|
if (!getDataTypeInfo(SQL_NUMERIC,typeInfFloat))
|
||||||
{
|
{
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
typeInfFloat.FsqlType = SQL_NUMERIC;
|
typeInfFloat.FsqlType = SQL_NUMERIC;
|
||||||
@@ -682,7 +682,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
|
|||||||
if (!getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger))
|
if (!getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger))
|
||||||
{
|
{
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
typeInfInteger.FsqlType = typeInfFloat.FsqlType;
|
typeInfInteger.FsqlType = typeInfFloat.FsqlType;
|
||||||
@@ -704,7 +704,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
|
|||||||
#endif // SQL_DATETIME defined
|
#endif // SQL_DATETIME defined
|
||||||
{
|
{
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -719,7 +719,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
|
|||||||
if (!getDataTypeInfo(SQL_VARBINARY,typeInfBlob))
|
if (!getDataTypeInfo(SQL_VARBINARY,typeInfBlob))
|
||||||
{
|
{
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
typeInfBlob.FsqlType = SQL_VARBINARY;
|
typeInfBlob.FsqlType = SQL_VARBINARY;
|
||||||
@@ -738,7 +738,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Completed Successfully
|
// Completed Successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported)
|
bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported)
|
||||||
@@ -782,7 +782,7 @@ bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported)
|
|||||||
|
|
||||||
outConnectBuffer[outConnectBufferLen] = 0;
|
outConnectBuffer[outConnectBufferLen] = 0;
|
||||||
outConnectionStr = outConnectBuffer;
|
outConnectionStr = outConnectBuffer;
|
||||||
dbOpenedWithConnectionString = TRUE;
|
dbOpenedWithConnectionString = true;
|
||||||
|
|
||||||
return open(failOnDataTypeUnsupported);
|
return open(failOnDataTypeUnsupported);
|
||||||
}
|
}
|
||||||
@@ -887,7 +887,7 @@ bool wxDb::Open(wxDb *copyDb)
|
|||||||
|
|
||||||
outConnectBuffer[outConnectBufferLen] = 0;
|
outConnectBuffer[outConnectBufferLen] = 0;
|
||||||
outConnectionStr = outConnectBuffer;
|
outConnectionStr = outConnectBuffer;
|
||||||
dbOpenedWithConnectionString = TRUE;
|
dbOpenedWithConnectionString = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -910,7 +910,7 @@ bool wxDb::Open(wxDb *copyDb)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Mark database as open
|
// Mark database as open
|
||||||
dbIsOpen = TRUE;
|
dbIsOpen = true;
|
||||||
|
|
||||||
// Allocate a statement handle for the database connection
|
// Allocate a statement handle for the database connection
|
||||||
if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS)
|
if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS)
|
||||||
@@ -918,7 +918,7 @@ bool wxDb::Open(wxDb *copyDb)
|
|||||||
|
|
||||||
// Set Connection Options
|
// Set Connection Options
|
||||||
if (!setConnectionOptions())
|
if (!setConnectionOptions())
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
// Instead of Querying the data source for info about itself, it can just be copied
|
// Instead of Querying the data source for info about itself, it can just be copied
|
||||||
// from the wxDb instance that was passed in (copyDb).
|
// from the wxDb instance that was passed in (copyDb).
|
||||||
@@ -999,7 +999,7 @@ bool wxDb::Open(wxDb *copyDb)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Completed Successfully
|
// Completed Successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
} // wxDb::Open() 2
|
} // wxDb::Open() 2
|
||||||
|
|
||||||
|
|
||||||
@@ -1066,7 +1066,7 @@ bool wxDb::setConnectionOptions(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Completed Successfully
|
// Completed Successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDb::setConnectionOptions()
|
} // wxDb::setConnectionOptions()
|
||||||
|
|
||||||
@@ -1082,7 +1082,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_DATABASE_NAME, (UCHAR*) dbInf.databaseName, 128, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_DATABASE_NAME, (UCHAR*) dbInf.databaseName, 128, &cb);
|
||||||
@@ -1090,7 +1090,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_DBMS_NAME, (UCHAR*) dbInf.dbmsName, 40, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_DBMS_NAME, (UCHAR*) dbInf.dbmsName, 40, &cb);
|
||||||
@@ -1098,7 +1098,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 16-Mar-1999
|
// 16-Mar-1999
|
||||||
@@ -1109,7 +1109,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_ACTIVE_CONNECTIONS, (UCHAR*) &dbInf.maxConnections, sizeof(dbInf.maxConnections), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_ACTIVE_CONNECTIONS, (UCHAR*) &dbInf.maxConnections, sizeof(dbInf.maxConnections), &cb);
|
||||||
@@ -1117,7 +1117,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_ACTIVE_STATEMENTS, (UCHAR*) &dbInf.maxStmts, sizeof(dbInf.maxStmts), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_ACTIVE_STATEMENTS, (UCHAR*) &dbInf.maxStmts, sizeof(dbInf.maxStmts), &cb);
|
||||||
@@ -1125,7 +1125,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_DRIVER_NAME, (UCHAR*) dbInf.driverName, 40, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_DRIVER_NAME, (UCHAR*) dbInf.driverName, 40, &cb);
|
||||||
@@ -1133,7 +1133,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER, (UCHAR*) dbInf.odbcVer, 60, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER, (UCHAR*) dbInf.odbcVer, 60, &cb);
|
||||||
@@ -1141,7 +1141,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_ODBC_VER, (UCHAR*) dbInf.drvMgrOdbcVer, 60, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_ODBC_VER, (UCHAR*) dbInf.drvMgrOdbcVer, 60, &cb);
|
||||||
@@ -1149,7 +1149,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_DRIVER_VER, (UCHAR*) dbInf.driverVer, 60, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_DRIVER_VER, (UCHAR*) dbInf.driverVer, 60, &cb);
|
||||||
@@ -1157,7 +1157,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_ODBC_API_CONFORMANCE, (UCHAR*) &dbInf.apiConfLvl, sizeof(dbInf.apiConfLvl), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_ODBC_API_CONFORMANCE, (UCHAR*) &dbInf.apiConfLvl, sizeof(dbInf.apiConfLvl), &cb);
|
||||||
@@ -1165,7 +1165,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_ODBC_SAG_CLI_CONFORMANCE, (UCHAR*) &dbInf.cliConfLvl, sizeof(dbInf.cliConfLvl), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_ODBC_SAG_CLI_CONFORMANCE, (UCHAR*) &dbInf.cliConfLvl, sizeof(dbInf.cliConfLvl), &cb);
|
||||||
@@ -1175,7 +1175,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
dbInf.cliConfLvl = 0;
|
dbInf.cliConfLvl = 0;
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_ODBC_SQL_CONFORMANCE, (UCHAR*) &dbInf.sqlConfLvl, sizeof(dbInf.sqlConfLvl), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_ODBC_SQL_CONFORMANCE, (UCHAR*) &dbInf.sqlConfLvl, sizeof(dbInf.sqlConfLvl), &cb);
|
||||||
@@ -1183,7 +1183,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_OUTER_JOINS, (UCHAR*) dbInf.outerJoins, 2, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_OUTER_JOINS, (UCHAR*) dbInf.outerJoins, 2, &cb);
|
||||||
@@ -1191,7 +1191,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_PROCEDURES, (UCHAR*) dbInf.procedureSupport, 2, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_PROCEDURES, (UCHAR*) dbInf.procedureSupport, 2, &cb);
|
||||||
@@ -1199,7 +1199,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_ACCESSIBLE_TABLES, (UCHAR*) dbInf.accessibleTables, 2, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_ACCESSIBLE_TABLES, (UCHAR*) dbInf.accessibleTables, 2, &cb);
|
||||||
@@ -1207,7 +1207,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_CURSOR_COMMIT_BEHAVIOR, (UCHAR*) &dbInf.cursorCommitBehavior, sizeof(dbInf.cursorCommitBehavior), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_CURSOR_COMMIT_BEHAVIOR, (UCHAR*) &dbInf.cursorCommitBehavior, sizeof(dbInf.cursorCommitBehavior), &cb);
|
||||||
@@ -1215,7 +1215,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_CURSOR_ROLLBACK_BEHAVIOR, (UCHAR*) &dbInf.cursorRollbackBehavior, sizeof(dbInf.cursorRollbackBehavior), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_CURSOR_ROLLBACK_BEHAVIOR, (UCHAR*) &dbInf.cursorRollbackBehavior, sizeof(dbInf.cursorRollbackBehavior), &cb);
|
||||||
@@ -1223,7 +1223,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_NON_NULLABLE_COLUMNS, (UCHAR*) &dbInf.supportNotNullClause, sizeof(dbInf.supportNotNullClause), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_NON_NULLABLE_COLUMNS, (UCHAR*) &dbInf.supportNotNullClause, sizeof(dbInf.supportNotNullClause), &cb);
|
||||||
@@ -1231,7 +1231,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_ODBC_SQL_OPT_IEF, (UCHAR*) dbInf.supportIEF, 2, &cb);
|
retcode = SQLGetInfo(hdbc, SQL_ODBC_SQL_OPT_IEF, (UCHAR*) dbInf.supportIEF, 2, &cb);
|
||||||
@@ -1239,7 +1239,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, (UCHAR*) &dbInf.txnIsolation, sizeof(dbInf.txnIsolation), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, (UCHAR*) &dbInf.txnIsolation, sizeof(dbInf.txnIsolation), &cb);
|
||||||
@@ -1247,7 +1247,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_TXN_ISOLATION_OPTION, (UCHAR*) &dbInf.txnIsolationOptions, sizeof(dbInf.txnIsolationOptions), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_TXN_ISOLATION_OPTION, (UCHAR*) &dbInf.txnIsolationOptions, sizeof(dbInf.txnIsolationOptions), &cb);
|
||||||
@@ -1255,7 +1255,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_FETCH_DIRECTION, (UCHAR*) &dbInf.fetchDirections, sizeof(dbInf.fetchDirections), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_FETCH_DIRECTION, (UCHAR*) &dbInf.fetchDirections, sizeof(dbInf.fetchDirections), &cb);
|
||||||
@@ -1263,7 +1263,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_LOCK_TYPES, (UCHAR*) &dbInf.lockTypes, sizeof(dbInf.lockTypes), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_LOCK_TYPES, (UCHAR*) &dbInf.lockTypes, sizeof(dbInf.lockTypes), &cb);
|
||||||
@@ -1271,7 +1271,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_POS_OPERATIONS, (UCHAR*) &dbInf.posOperations, sizeof(dbInf.posOperations), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_POS_OPERATIONS, (UCHAR*) &dbInf.posOperations, sizeof(dbInf.posOperations), &cb);
|
||||||
@@ -1279,7 +1279,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_POSITIONED_STATEMENTS, (UCHAR*) &dbInf.posStmts, sizeof(dbInf.posStmts), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_POSITIONED_STATEMENTS, (UCHAR*) &dbInf.posStmts, sizeof(dbInf.posStmts), &cb);
|
||||||
@@ -1287,7 +1287,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_SCROLL_CONCURRENCY, (UCHAR*) &dbInf.scrollConcurrency, sizeof(dbInf.scrollConcurrency), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_SCROLL_CONCURRENCY, (UCHAR*) &dbInf.scrollConcurrency, sizeof(dbInf.scrollConcurrency), &cb);
|
||||||
@@ -1295,7 +1295,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_SCROLL_OPTIONS, (UCHAR*) &dbInf.scrollOptions, sizeof(dbInf.scrollOptions), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_SCROLL_OPTIONS, (UCHAR*) &dbInf.scrollOptions, sizeof(dbInf.scrollOptions), &cb);
|
||||||
@@ -1303,7 +1303,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_STATIC_SENSITIVITY, (UCHAR*) &dbInf.staticSensitivity, sizeof(dbInf.staticSensitivity), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_STATIC_SENSITIVITY, (UCHAR*) &dbInf.staticSensitivity, sizeof(dbInf.staticSensitivity), &cb);
|
||||||
@@ -1311,7 +1311,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_TXN_CAPABLE, (UCHAR*) &dbInf.txnCapable, sizeof(dbInf.txnCapable), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_TXN_CAPABLE, (UCHAR*) &dbInf.txnCapable, sizeof(dbInf.txnCapable), &cb);
|
||||||
@@ -1319,7 +1319,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLGetInfo(hdbc, SQL_LOGIN_TIMEOUT, (UCHAR*) &dbInf.loginTimeout, sizeof(dbInf.loginTimeout), &cb);
|
retcode = SQLGetInfo(hdbc, SQL_LOGIN_TIMEOUT, (UCHAR*) &dbInf.loginTimeout, sizeof(dbInf.loginTimeout), &cb);
|
||||||
@@ -1327,7 +1327,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc);
|
DispAllErrors(henv, hdbc);
|
||||||
if (failOnDataTypeUnsupported)
|
if (failOnDataTypeUnsupported)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DBDEBUG_CONSOLE
|
#ifdef DBDEBUG_CONSOLE
|
||||||
@@ -1526,7 +1526,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Completed Successfully
|
// Completed Successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDb::getDbInfo()
|
} // wxDb::getDbInfo()
|
||||||
|
|
||||||
@@ -1557,7 +1557,7 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo)
|
|||||||
#endif
|
#endif
|
||||||
DispAllErrors(henv, hdbc, hstmt);
|
DispAllErrors(henv, hdbc, hstmt);
|
||||||
SQLFreeStmt(hstmt, SQL_CLOSE);
|
SQLFreeStmt(hstmt, SQL_CLOSE);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxChar typeName[DB_TYPE_NAME_LEN+1];
|
wxChar typeName[DB_TYPE_NAME_LEN+1];
|
||||||
@@ -1614,7 +1614,7 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo)
|
|||||||
return(DispAllErrors(henv, hdbc, hstmt));
|
return(DispAllErrors(henv, hdbc, hstmt));
|
||||||
|
|
||||||
// Completed Successfully
|
// Completed Successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDb::getDataTypeInfo()
|
} // wxDb::getDataTypeInfo()
|
||||||
|
|
||||||
@@ -1671,7 +1671,7 @@ void wxDb::Close(void)
|
|||||||
wxStrcpy(DBerrorList[i], errorList[i]);
|
wxStrcpy(DBerrorList[i], errorList[i]);
|
||||||
|
|
||||||
dbmsType = dbmsUNIDENTIFIED;
|
dbmsType = dbmsUNIDENTIFIED;
|
||||||
dbIsOpen = FALSE;
|
dbIsOpen = false;
|
||||||
|
|
||||||
} // wxDb::Close()
|
} // wxDb::Close()
|
||||||
|
|
||||||
@@ -1687,7 +1687,7 @@ bool wxDb::CommitTrans(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Completed successfully
|
// Completed successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDb::CommitTrans()
|
} // wxDb::CommitTrans()
|
||||||
|
|
||||||
@@ -1700,7 +1700,7 @@ bool wxDb::RollbackTrans(void)
|
|||||||
return(DispAllErrors(henv, hdbc));
|
return(DispAllErrors(henv, hdbc));
|
||||||
|
|
||||||
// Completed successfully
|
// Completed successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDb::RollbackTrans()
|
} // wxDb::RollbackTrans()
|
||||||
|
|
||||||
@@ -1717,7 +1717,7 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt)
|
|||||||
* If in DBDEBUG_CONSOLE mode, the constructed string will be displayed in the console
|
* If in DBDEBUG_CONSOLE mode, the constructed string will be displayed in the console
|
||||||
* window and program execution will be paused until the user presses a key.
|
* window and program execution will be paused until the user presses a key.
|
||||||
*
|
*
|
||||||
* This function always returns a FALSE, so that functions which call this function
|
* This function always returns a false, so that functions which call this function
|
||||||
* can have a line like "return (DispAllErrors(henv, hdbc));" to indicate the failure
|
* can have a line like "return (DispAllErrors(henv, hdbc));" to indicate the failure
|
||||||
* of the users request, so that the calling code can then process the error msg log
|
* of the users request, so that the calling code can then process the error msg log
|
||||||
*/
|
*/
|
||||||
@@ -1743,7 +1743,7 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(FALSE); // This function always returns FALSE.
|
return false; // This function always returns false.
|
||||||
|
|
||||||
} // wxDb::DispAllErrors()
|
} // wxDb::DispAllErrors()
|
||||||
|
|
||||||
@@ -1752,9 +1752,9 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt)
|
|||||||
bool wxDb::GetNextError(HENV aHenv, HDBC aHdbc, HSTMT aHstmt)
|
bool wxDb::GetNextError(HENV aHenv, HDBC aHdbc, HSTMT aHstmt)
|
||||||
{
|
{
|
||||||
if (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS)
|
if (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS)
|
||||||
return(TRUE);
|
return true;
|
||||||
else
|
else
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
} // wxDb::GetNextError()
|
} // wxDb::GetNextError()
|
||||||
|
|
||||||
@@ -2061,7 +2061,7 @@ bool wxDb::CreateView(const wxString &viewName, const wxString &colList,
|
|||||||
|
|
||||||
// Drop the view first
|
// Drop the view first
|
||||||
if (attemptDrop && !DropView(viewName))
|
if (attemptDrop && !DropView(viewName))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// Build the create view statement
|
// Build the create view statement
|
||||||
sqlStmt = wxT("CREATE VIEW ");
|
sqlStmt = wxT("CREATE VIEW ");
|
||||||
@@ -2092,7 +2092,7 @@ bool wxDb::CreateView(const wxString &viewName, const wxString &colList,
|
|||||||
bool wxDb::DropView(const wxString &viewName)
|
bool wxDb::DropView(const wxString &viewName)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* NOTE: This function returns TRUE if the View does not exist, but
|
* NOTE: This function returns true if the View does not exist, but
|
||||||
* only for identified databases. Code will need to be added
|
* only for identified databases. Code will need to be added
|
||||||
* below for any other databases when those databases are defined
|
* below for any other databases when those databases are defined
|
||||||
* to handle this situation consistently
|
* to handle this situation consistently
|
||||||
@@ -2119,16 +2119,16 @@ bool wxDb::DropView(const wxString &viewName)
|
|||||||
DispNextError();
|
DispNextError();
|
||||||
DispAllErrors(henv, hdbc, hstmt);
|
DispAllErrors(henv, hdbc, hstmt);
|
||||||
RollbackTrans();
|
RollbackTrans();
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit the transaction
|
// Commit the transaction
|
||||||
if (!CommitTrans())
|
if (!CommitTrans())
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
} // wxDb::DropView()
|
} // wxDb::DropView()
|
||||||
|
|
||||||
@@ -2144,12 +2144,12 @@ bool wxDb::ExecSql(const wxString &pSqlStmt)
|
|||||||
if (retcode == SQL_SUCCESS ||
|
if (retcode == SQL_SUCCESS ||
|
||||||
(Dbms() == dbmsDB2 && (retcode == SQL_SUCCESS_WITH_INFO || retcode == SQL_NO_DATA_FOUND)))
|
(Dbms() == dbmsDB2 && (retcode == SQL_SUCCESS_WITH_INFO || retcode == SQL_NO_DATA_FOUND)))
|
||||||
{
|
{
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc, hstmt);
|
DispAllErrors(henv, hdbc, hstmt);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // wxDb::ExecSql()
|
} // wxDb::ExecSql()
|
||||||
@@ -2159,11 +2159,11 @@ bool wxDb::ExecSql(const wxString &pSqlStmt)
|
|||||||
bool wxDb::GetNext(void)
|
bool wxDb::GetNext(void)
|
||||||
{
|
{
|
||||||
if (SQLFetch(hstmt) == SQL_SUCCESS)
|
if (SQLFetch(hstmt) == SQL_SUCCESS)
|
||||||
return(TRUE);
|
return true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc, hstmt);
|
DispAllErrors(henv, hdbc, hstmt);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // wxDb::GetNext()
|
} // wxDb::GetNext()
|
||||||
@@ -2176,11 +2176,11 @@ bool wxDb::GetData(UWORD colNo, SWORD cType, PTR pData, SDWORD maxLen, SDWORD FA
|
|||||||
wxASSERT(cbReturned);
|
wxASSERT(cbReturned);
|
||||||
|
|
||||||
if (SQLGetData(hstmt, colNo, cType, pData, maxLen, cbReturned) == SQL_SUCCESS)
|
if (SQLGetData(hstmt, colNo, cType, pData, maxLen, cbReturned) == SQL_SUCCESS)
|
||||||
return(TRUE);
|
return true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc, hstmt);
|
DispAllErrors(henv, hdbc, hstmt);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // wxDb::GetData()
|
} // wxDb::GetData()
|
||||||
@@ -3239,7 +3239,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName)
|
|||||||
|
|
||||||
FILE *fp = wxFopen(fileName.c_str(),wxT("wt"));
|
FILE *fp = wxFopen(fileName.c_str(),wxT("wt"));
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
SQLFreeStmt(hstmt, SQL_CLOSE);
|
SQLFreeStmt(hstmt, SQL_CLOSE);
|
||||||
|
|
||||||
@@ -3270,14 +3270,14 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName)
|
|||||||
{
|
{
|
||||||
DispAllErrors(henv, hdbc, hstmt);
|
DispAllErrors(henv, hdbc, hstmt);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString outStr;
|
wxString outStr;
|
||||||
tblNameSave.Empty();
|
tblNameSave.Empty();
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
||||||
while (TRUE)
|
while (true)
|
||||||
{
|
{
|
||||||
retcode = SQLFetch(hstmt);
|
retcode = SQLFetch(hstmt);
|
||||||
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
|
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
|
||||||
@@ -3316,7 +3316,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName)
|
|||||||
{
|
{
|
||||||
SQLFreeStmt(hstmt, SQL_CLOSE);
|
SQLFreeStmt(hstmt, SQL_CLOSE);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
@@ -3334,7 +3334,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName)
|
|||||||
|
|
||||||
bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wxString &tablePath)
|
bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wxString &tablePath)
|
||||||
/*
|
/*
|
||||||
* Table name can refer to a table, view, alias or synonym. Returns TRUE
|
* Table name can refer to a table, view, alias or synonym. Returns true
|
||||||
* if the object exists in the database. This function does not indicate
|
* if the object exists in the database. This function does not indicate
|
||||||
* whether or not the user has privleges to query or perform other functions
|
* whether or not the user has privleges to query or perform other functions
|
||||||
* on the table.
|
* on the table.
|
||||||
@@ -3411,7 +3411,7 @@ bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wx
|
|||||||
|
|
||||||
SQLFreeStmt(hstmt, SQL_CLOSE);
|
SQLFreeStmt(hstmt, SQL_CLOSE);
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDb::TableExists()
|
} // wxDb::TableExists()
|
||||||
|
|
||||||
@@ -3472,30 +3472,30 @@ bool wxDb::TablePrivileges(const wxString &tableName, const wxString &priv, cons
|
|||||||
if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO))
|
if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO))
|
||||||
return(DispAllErrors(henv, hdbc, hstmt));
|
return(DispAllErrors(henv, hdbc, hstmt));
|
||||||
|
|
||||||
bool failed = FALSE;
|
bool failed = false;
|
||||||
retcode = SQLFetch(hstmt);
|
retcode = SQLFetch(hstmt);
|
||||||
while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
|
while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
|
||||||
{
|
{
|
||||||
if (SQLGetData(hstmt, 1, SQL_C_CHAR, (UCHAR*) result.tableQual, sizeof(result.tableQual), &cbRetVal) != SQL_SUCCESS)
|
if (SQLGetData(hstmt, 1, SQL_C_CHAR, (UCHAR*) result.tableQual, sizeof(result.tableQual), &cbRetVal) != SQL_SUCCESS)
|
||||||
failed = TRUE;
|
failed = true;
|
||||||
|
|
||||||
if (!failed && SQLGetData(hstmt, 2, SQL_C_CHAR, (UCHAR*) result.tableOwner, sizeof(result.tableOwner), &cbRetVal) != SQL_SUCCESS)
|
if (!failed && SQLGetData(hstmt, 2, SQL_C_CHAR, (UCHAR*) result.tableOwner, sizeof(result.tableOwner), &cbRetVal) != SQL_SUCCESS)
|
||||||
failed = TRUE;
|
failed = true;
|
||||||
|
|
||||||
if (!failed && SQLGetData(hstmt, 3, SQL_C_CHAR, (UCHAR*) result.tableName, sizeof(result.tableName), &cbRetVal) != SQL_SUCCESS)
|
if (!failed && SQLGetData(hstmt, 3, SQL_C_CHAR, (UCHAR*) result.tableName, sizeof(result.tableName), &cbRetVal) != SQL_SUCCESS)
|
||||||
failed = TRUE;
|
failed = true;
|
||||||
|
|
||||||
if (!failed && SQLGetData(hstmt, 4, SQL_C_CHAR, (UCHAR*) result.grantor, sizeof(result.grantor), &cbRetVal) != SQL_SUCCESS)
|
if (!failed && SQLGetData(hstmt, 4, SQL_C_CHAR, (UCHAR*) result.grantor, sizeof(result.grantor), &cbRetVal) != SQL_SUCCESS)
|
||||||
failed = TRUE;
|
failed = true;
|
||||||
|
|
||||||
if (!failed && SQLGetData(hstmt, 5, SQL_C_CHAR, (UCHAR*) result.grantee, sizeof(result.grantee), &cbRetVal) != SQL_SUCCESS)
|
if (!failed && SQLGetData(hstmt, 5, SQL_C_CHAR, (UCHAR*) result.grantee, sizeof(result.grantee), &cbRetVal) != SQL_SUCCESS)
|
||||||
failed = TRUE;
|
failed = true;
|
||||||
|
|
||||||
if (!failed && SQLGetData(hstmt, 6, SQL_C_CHAR, (UCHAR*) result.privilege, sizeof(result.privilege), &cbRetVal) != SQL_SUCCESS)
|
if (!failed && SQLGetData(hstmt, 6, SQL_C_CHAR, (UCHAR*) result.privilege, sizeof(result.privilege), &cbRetVal) != SQL_SUCCESS)
|
||||||
failed = TRUE;
|
failed = true;
|
||||||
|
|
||||||
if (!failed && SQLGetData(hstmt, 7, SQL_C_CHAR, (UCHAR*) result.grantable, sizeof(result.grantable), &cbRetVal) != SQL_SUCCESS)
|
if (!failed && SQLGetData(hstmt, 7, SQL_C_CHAR, (UCHAR*) result.grantable, sizeof(result.grantable), &cbRetVal) != SQL_SUCCESS)
|
||||||
failed = TRUE;
|
failed = true;
|
||||||
|
|
||||||
if (failed)
|
if (failed)
|
||||||
{
|
{
|
||||||
@@ -3507,31 +3507,31 @@ bool wxDb::TablePrivileges(const wxString &tableName, const wxString &priv, cons
|
|||||||
result.grantor, result.grantee);
|
result.grantor, result.grantee);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (UserID.IsSameAs(result.tableOwner,FALSE))
|
if (UserID.IsSameAs(result.tableOwner,false))
|
||||||
{
|
{
|
||||||
SQLFreeStmt(hstmt, SQL_CLOSE);
|
SQLFreeStmt(hstmt, SQL_CLOSE);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UserID.IsSameAs(result.grantee,FALSE) &&
|
if (UserID.IsSameAs(result.grantee,false) &&
|
||||||
!wxStrcmp(result.privilege,priv))
|
!wxStrcmp(result.privilege,priv))
|
||||||
{
|
{
|
||||||
SQLFreeStmt(hstmt, SQL_CLOSE);
|
SQLFreeStmt(hstmt, SQL_CLOSE);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wxStrcmp(result.grantee,curRole) &&
|
if (!wxStrcmp(result.grantee,curRole) &&
|
||||||
!wxStrcmp(result.privilege,priv))
|
!wxStrcmp(result.privilege,priv))
|
||||||
{
|
{
|
||||||
SQLFreeStmt(hstmt, SQL_CLOSE);
|
SQLFreeStmt(hstmt, SQL_CLOSE);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLFetch(hstmt);
|
retcode = SQLFetch(hstmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
SQLFreeStmt(hstmt, SQL_CLOSE);
|
SQLFreeStmt(hstmt, SQL_CLOSE);
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
} // wxDb::TablePrivileges
|
} // wxDb::TablePrivileges
|
||||||
|
|
||||||
@@ -3576,7 +3576,7 @@ bool wxDb::SetSqlLogging(wxDbSqlLogState state, const wxString &filename, bool a
|
|||||||
{
|
{
|
||||||
fpSqlLog = wxFopen(filename, (append ? wxT("at") : wxT("wt")));
|
fpSqlLog = wxFopen(filename, (append ? wxT("at") : wxT("wt")));
|
||||||
if (fpSqlLog == NULL)
|
if (fpSqlLog == NULL)
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // sqlLogOFF
|
else // sqlLogOFF
|
||||||
@@ -3584,13 +3584,13 @@ bool wxDb::SetSqlLogging(wxDbSqlLogState state, const wxString &filename, bool a
|
|||||||
if (fpSqlLog)
|
if (fpSqlLog)
|
||||||
{
|
{
|
||||||
if (fclose(fpSqlLog))
|
if (fclose(fpSqlLog))
|
||||||
return(FALSE);
|
return false;
|
||||||
fpSqlLog = 0;
|
fpSqlLog = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlLogState = state;
|
sqlLogState = state;
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDb::SetSqlLogging()
|
} // wxDb::SetSqlLogging()
|
||||||
|
|
||||||
@@ -3601,16 +3601,16 @@ bool wxDb::WriteSqlLog(const wxString &logMsg)
|
|||||||
wxASSERT(logMsg.Length());
|
wxASSERT(logMsg.Length());
|
||||||
|
|
||||||
if (fpSqlLog == 0 || sqlLogState == sqlLogOFF)
|
if (fpSqlLog == 0 || sqlLogState == sqlLogOFF)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
if (wxFputs(wxT("\n"), fpSqlLog) == EOF)
|
if (wxFputs(wxT("\n"), fpSqlLog) == EOF)
|
||||||
return(FALSE);
|
return false;
|
||||||
if (wxFputs(logMsg, fpSqlLog) == EOF)
|
if (wxFputs(logMsg, fpSqlLog) == EOF)
|
||||||
return(FALSE);
|
return false;
|
||||||
if (wxFputs(wxT("\n"), fpSqlLog) == EOF)
|
if (wxFputs(wxT("\n"), fpSqlLog) == EOF)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDb::WriteSqlLog()
|
} // wxDb::WriteSqlLog()
|
||||||
|
|
||||||
@@ -3638,7 +3638,7 @@ wxDBMS wxDb::Dbms(void)
|
|||||||
* - Does not support the SQL_TIMESTAMP structure
|
* - Does not support the SQL_TIMESTAMP structure
|
||||||
* - Supports only one cursor and one connect (apparently? with Microsoft driver only?)
|
* - Supports only one cursor and one connect (apparently? with Microsoft driver only?)
|
||||||
* - Does not automatically create the primary index if the 'keyField' param of SetColDef
|
* - Does not automatically create the primary index if the 'keyField' param of SetColDef
|
||||||
* is TRUE. The user must create ALL indexes from their program.
|
* is true. The user must create ALL indexes from their program.
|
||||||
* - Table names can only be 8 characters long
|
* - Table names can only be 8 characters long
|
||||||
* - Column names can only be 10 characters long
|
* - Column names can only be 10 characters long
|
||||||
*
|
*
|
||||||
@@ -3764,7 +3764,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName,
|
|||||||
|
|
||||||
// Must specify a columnLength if modifying a VARCHAR type column
|
// Must specify a columnLength if modifying a VARCHAR type column
|
||||||
if (dataType == DB_DATA_TYPE_VARCHAR && !columnLength)
|
if (dataType == DB_DATA_TYPE_VARCHAR && !columnLength)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
wxString dataTypeName;
|
wxString dataTypeName;
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
@@ -3788,7 +3788,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName,
|
|||||||
dataTypeName = typeInfBlob.TypeName;
|
dataTypeName = typeInfBlob.TypeName;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the modify or alter syntax depending on the type of database connected to
|
// Set the modify or alter syntax depending on the type of database connected to
|
||||||
@@ -3801,7 +3801,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName,
|
|||||||
alterSlashModify = _T("ALTER COLUMN");
|
alterSlashModify = _T("ALTER COLUMN");
|
||||||
break;
|
break;
|
||||||
case dbmsUNIDENTIFIED :
|
case dbmsUNIDENTIFIED :
|
||||||
return FALSE;
|
return false;
|
||||||
case dbmsSYBASE_ASA :
|
case dbmsSYBASE_ASA :
|
||||||
case dbmsSYBASE_ASE :
|
case dbmsSYBASE_ASE :
|
||||||
case dbmsMY_SQL :
|
case dbmsMY_SQL :
|
||||||
@@ -3874,7 +3874,7 @@ wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnly
|
|||||||
(!wxStrcmp(pDbConfig->GetConnectionStr(), pList->ConnectionStr)))
|
(!wxStrcmp(pDbConfig->GetConnectionStr(), pList->ConnectionStr)))
|
||||||
{
|
{
|
||||||
// Found a free connection
|
// Found a free connection
|
||||||
pList->Free = FALSE;
|
pList->Free = false;
|
||||||
return(pList->PtrDb);
|
return(pList->PtrDb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3884,7 +3884,7 @@ wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnly
|
|||||||
(!wxStrcmp(pDbConfig->GetDsn(), pList->Dsn)))
|
(!wxStrcmp(pDbConfig->GetDsn(), pList->Dsn)))
|
||||||
{
|
{
|
||||||
// Found a free connection
|
// Found a free connection
|
||||||
pList->Free = FALSE;
|
pList->Free = false;
|
||||||
return(pList->PtrDb);
|
return(pList->PtrDb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3924,7 +3924,7 @@ wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnly
|
|||||||
|
|
||||||
// Initialize new node in the linked list
|
// Initialize new node in the linked list
|
||||||
pList->PtrNext = 0;
|
pList->PtrNext = 0;
|
||||||
pList->Free = FALSE;
|
pList->Free = false;
|
||||||
pList->Dsn = pDbConfig->GetDsn();
|
pList->Dsn = pDbConfig->GetDsn();
|
||||||
pList->Uid = pDbConfig->GetUserID();
|
pList->Uid = pDbConfig->GetUserID();
|
||||||
pList->AuthStr = pDbConfig->GetPassword();
|
pList->AuthStr = pDbConfig->GetPassword();
|
||||||
@@ -3951,8 +3951,8 @@ wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnly
|
|||||||
// Connect to the datasource
|
// Connect to the datasource
|
||||||
if (opened)
|
if (opened)
|
||||||
{
|
{
|
||||||
pList->PtrDb->setCached(TRUE); // Prevent a user from deleting a cached connection
|
pList->PtrDb->setCached(true); // Prevent a user from deleting a cached connection
|
||||||
pList->PtrDb->SetSqlLogging(SQLLOGstate, SQLLOGfn, TRUE);
|
pList->PtrDb->SetSqlLogging(SQLLOGstate, SQLLOGfn, true);
|
||||||
return(pList->PtrDb);
|
return(pList->PtrDb);
|
||||||
}
|
}
|
||||||
else // Unable to connect, destroy list item
|
else // Unable to connect, destroy list item
|
||||||
@@ -3981,11 +3981,11 @@ bool WXDLLIMPEXP_ODBC wxDbFreeConnection(wxDb *pDb)
|
|||||||
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
|
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
|
||||||
{
|
{
|
||||||
if (pList->PtrDb == pDb) // Found it, now free it!!!
|
if (pList->PtrDb == pDb) // Found it, now free it!!!
|
||||||
return (pList->Free = TRUE);
|
return (pList->Free = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Never found the database object, return failure
|
// Never found the database object, return failure
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
} // wxDbFreeConnection()
|
} // wxDbFreeConnection()
|
||||||
|
|
||||||
@@ -4001,7 +4001,7 @@ void WXDLLIMPEXP_ODBC wxDbCloseConnections(void)
|
|||||||
pNext = pList->PtrNext; // Save the pointer to next
|
pNext = pList->PtrNext; // Save the pointer to next
|
||||||
pList->PtrDb->CommitTrans(); // Commit any open transactions on wxDb object
|
pList->PtrDb->CommitTrans(); // Commit any open transactions on wxDb object
|
||||||
pList->PtrDb->Close(); // Close the wxDb object
|
pList->PtrDb->Close(); // Close the wxDb object
|
||||||
pList->PtrDb->setCached(FALSE); // Allows deletion of the wxDb instance
|
pList->PtrDb->setCached(false); // Allows deletion of the wxDb instance
|
||||||
delete pList->PtrDb; // Deletes the wxDb object
|
delete pList->PtrDb; // Deletes the wxDb object
|
||||||
delete pList; // Deletes the linked list object
|
delete pList; // Deletes the linked list object
|
||||||
}
|
}
|
||||||
@@ -4021,7 +4021,7 @@ int WXDLLIMPEXP_ODBC wxDbConnectionsInUse(void)
|
|||||||
// Scan the linked list counting db connections that are currently in use
|
// Scan the linked list counting db connections that are currently in use
|
||||||
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
|
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
|
||||||
{
|
{
|
||||||
if (pList->Free == FALSE)
|
if (pList->Free == false)
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4081,20 +4081,20 @@ const wxChar WXDLLIMPEXP_ODBC *wxDbLogExtendedErrorMsg(const wxChar *userText,
|
|||||||
/********** wxDbSqlLog() **********/
|
/********** wxDbSqlLog() **********/
|
||||||
bool wxDbSqlLog(wxDbSqlLogState state, const wxChar *filename)
|
bool wxDbSqlLog(wxDbSqlLogState state, const wxChar *filename)
|
||||||
{
|
{
|
||||||
bool append = FALSE;
|
bool append = false;
|
||||||
wxDbList *pList;
|
wxDbList *pList;
|
||||||
|
|
||||||
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
|
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
|
||||||
{
|
{
|
||||||
if (!pList->PtrDb->SetSqlLogging(state,filename,append))
|
if (!pList->PtrDb->SetSqlLogging(state,filename,append))
|
||||||
return(FALSE);
|
return false;
|
||||||
append = TRUE;
|
append = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SQLLOGstate = state;
|
SQLLOGstate = state;
|
||||||
SQLLOGfn = filename;
|
SQLLOGfn = filename;
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbSqlLog()
|
} // wxDbSqlLog()
|
||||||
|
|
||||||
@@ -4132,7 +4132,7 @@ int wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const
|
|||||||
int k;
|
int k;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
k = setupStr.Find((wxChar)2,TRUE);
|
k = setupStr.Find((wxChar)2,true);
|
||||||
if (k != wxNOT_FOUND)
|
if (k != wxNOT_FOUND)
|
||||||
setupStr[(UINT)k] = wxT('\0');
|
setupStr[(UINT)k] = wxT('\0');
|
||||||
}
|
}
|
||||||
@@ -4194,9 +4194,9 @@ bool wxDbGetDataSource(HENV henv, wxChar *Dsn, SWORD DsnMax, wxChar *DsDesc,
|
|||||||
|
|
||||||
if (SQLDataSources(henv, direction, (SQLTCHAR FAR *) Dsn, DsnMax, &cb1,
|
if (SQLDataSources(henv, direction, (SQLTCHAR FAR *) Dsn, DsnMax, &cb1,
|
||||||
(SQLTCHAR FAR *) DsDesc, DsDescMax, &cb2) == SQL_SUCCESS)
|
(SQLTCHAR FAR *) DsDesc, DsDescMax, &cb2) == SQL_SUCCESS)
|
||||||
return(TRUE);
|
return true;
|
||||||
else
|
else
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
} // wxDbGetDataSource()
|
} // wxDbGetDataSource()
|
||||||
|
|
||||||
|
@@ -132,7 +132,7 @@ wxDbGridTableBase::wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo* ColInfo,
|
|||||||
m_keys(),
|
m_keys(),
|
||||||
m_data(tab),
|
m_data(tab),
|
||||||
m_dbowner(takeOwnership),
|
m_dbowner(takeOwnership),
|
||||||
m_rowmodified(FALSE)
|
m_rowmodified(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (count == wxUSE_QUERY)
|
if (count == wxUSE_QUERY)
|
||||||
@@ -201,7 +201,7 @@ bool wxDbGridTableBase::CanHaveAttributes()
|
|||||||
// use the default attr provider by default
|
// use the default attr provider by default
|
||||||
SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo));
|
SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -259,8 +259,8 @@ bool wxDbGridTableBase::AssignDbTable(wxDbTable *tab, int count, bool takeOwners
|
|||||||
grid->EndBatch();
|
grid->EndBatch();
|
||||||
}
|
}
|
||||||
m_dbowner = takeOwnership;
|
m_dbowner = takeOwnership;
|
||||||
m_rowmodified = FALSE;
|
m_rowmodified = false;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxDbGridTableBase::GetTypeName(int WXUNUSED(row), int col)
|
wxString wxDbGridTableBase::GetTypeName(int WXUNUSED(row), int col)
|
||||||
@@ -317,19 +317,19 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName
|
|||||||
if (typeName == wxGRID_VALUE_STRING)
|
if (typeName == wxGRID_VALUE_STRING)
|
||||||
{
|
{
|
||||||
//FIXME ummm What about blob field etc.
|
//FIXME ummm What about blob field etc.
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_data->IsColNull(m_ColInfo[col].DbCol))
|
if (m_data->IsColNull(m_ColInfo[col].DbCol))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol)
|
if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol)
|
||||||
{
|
{
|
||||||
//If a virtual column then we can't find it's type. we have to
|
//If a virtual column then we can't find it's type. we have to
|
||||||
// return FALSE to get using wxVariant.
|
// return false to get using wxVariant.
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
|
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
|
||||||
|
|
||||||
@@ -339,9 +339,9 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName
|
|||||||
(sqltype == SQL_C_TIME) ||
|
(sqltype == SQL_C_TIME) ||
|
||||||
(sqltype == SQL_C_TIMESTAMP))
|
(sqltype == SQL_C_TIMESTAMP))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (typeName == wxGRID_VALUE_NUMBER)
|
if (typeName == wxGRID_VALUE_NUMBER)
|
||||||
{
|
{
|
||||||
@@ -350,9 +350,9 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName
|
|||||||
(sqltype == SQL_C_SLONG) ||
|
(sqltype == SQL_C_SLONG) ||
|
||||||
(sqltype == SQL_C_ULONG))
|
(sqltype == SQL_C_ULONG))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (typeName == wxGRID_VALUE_FLOAT)
|
if (typeName == wxGRID_VALUE_FLOAT)
|
||||||
{
|
{
|
||||||
@@ -363,11 +363,11 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName
|
|||||||
(sqltype == SQL_C_FLOAT) ||
|
(sqltype == SQL_C_FLOAT) ||
|
||||||
(sqltype == SQL_C_DOUBLE))
|
(sqltype == SQL_C_DOUBLE))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString& typeName)
|
bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString& typeName)
|
||||||
@@ -375,19 +375,19 @@ bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString
|
|||||||
if (typeName == wxGRID_VALUE_STRING)
|
if (typeName == wxGRID_VALUE_STRING)
|
||||||
{
|
{
|
||||||
//FIXME ummm What about blob field etc.
|
//FIXME ummm What about blob field etc.
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(m_data->GetColDefs()[(m_ColInfo[col].DbCol)].Updateable))
|
if (!(m_data->GetColDefs()[(m_ColInfo[col].DbCol)].Updateable))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol)
|
if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol)
|
||||||
{
|
{
|
||||||
//If a virtual column then we can't find it's type. we have to faulse to
|
//If a virtual column then we can't find it's type. we have to faulse to
|
||||||
//get using wxVairent.
|
//get using wxVairent.
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
|
int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype;
|
||||||
@@ -397,9 +397,9 @@ bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString
|
|||||||
(sqltype == SQL_C_TIME) ||
|
(sqltype == SQL_C_TIME) ||
|
||||||
(sqltype == SQL_C_TIMESTAMP))
|
(sqltype == SQL_C_TIMESTAMP))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (typeName == wxGRID_VALUE_NUMBER)
|
if (typeName == wxGRID_VALUE_NUMBER)
|
||||||
{
|
{
|
||||||
@@ -408,9 +408,9 @@ bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString
|
|||||||
(sqltype == SQL_C_SLONG) ||
|
(sqltype == SQL_C_SLONG) ||
|
||||||
(sqltype == SQL_C_ULONG))
|
(sqltype == SQL_C_ULONG))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (typeName == wxGRID_VALUE_FLOAT)
|
if (typeName == wxGRID_VALUE_FLOAT)
|
||||||
{
|
{
|
||||||
@@ -421,11 +421,11 @@ bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString
|
|||||||
(sqltype == SQL_C_FLOAT) ||
|
(sqltype == SQL_C_FLOAT) ||
|
||||||
(sqltype == SQL_C_DOUBLE))
|
(sqltype == SQL_C_DOUBLE))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDbGridTableBase::GetValueAsLong(int row, int col)
|
long wxDbGridTableBase::GetValueAsLong(int row, int col)
|
||||||
@@ -556,7 +556,7 @@ void wxDbGridTableBase::SetValueAsCustom(int row, int col, const wxString& typeN
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wxVariant val(date);
|
wxVariant val(date);
|
||||||
m_rowmodified = TRUE;
|
m_rowmodified = true;
|
||||||
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -603,7 +603,7 @@ void wxDbGridTableBase::SetValue(int row, int col,const wxString& value)
|
|||||||
ValidateRow(row);
|
ValidateRow(row);
|
||||||
wxVariant val(value);
|
wxVariant val(value);
|
||||||
|
|
||||||
m_rowmodified = TRUE;
|
m_rowmodified = true;
|
||||||
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,7 +615,7 @@ void wxDbGridTableBase::SetValueAsLong(int row, int col, long value)
|
|||||||
ValidateRow(row);
|
ValidateRow(row);
|
||||||
wxVariant val(value);
|
wxVariant val(value);
|
||||||
|
|
||||||
m_rowmodified = TRUE;
|
m_rowmodified = true;
|
||||||
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -627,7 +627,7 @@ void wxDbGridTableBase::SetValueAsDouble(int row, int col, double value)
|
|||||||
ValidateRow(row);
|
ValidateRow(row);
|
||||||
wxVariant val(value);
|
wxVariant val(value);
|
||||||
|
|
||||||
m_rowmodified = TRUE;
|
m_rowmodified = true;
|
||||||
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -640,7 +640,7 @@ void wxDbGridTableBase::SetValueAsBool(int row, int col, bool value)
|
|||||||
ValidateRow(row);
|
ValidateRow(row);
|
||||||
wxVariant val(value);
|
wxVariant val(value);
|
||||||
|
|
||||||
m_rowmodified = TRUE;
|
m_rowmodified = true;
|
||||||
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
m_data->SetCol(m_ColInfo[col].DbCol,val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -687,17 +687,17 @@ void wxDbGridTableBase::ValidateRow(int row)
|
|||||||
|
|
||||||
m_row = row;
|
m_row = row;
|
||||||
}
|
}
|
||||||
m_rowmodified = FALSE;
|
m_rowmodified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDbGridTableBase::Writeback() const
|
bool wxDbGridTableBase::Writeback() const
|
||||||
{
|
{
|
||||||
if (!m_rowmodified)
|
if (!m_rowmodified)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool result=TRUE;
|
bool result=true;
|
||||||
wxLogDebug(wxT("\trow key unknown"));
|
wxLogDebug(wxT("\trow key unknown"));
|
||||||
|
|
||||||
// FIXME: this code requires dbtable support for record status
|
// FIXME: this code requires dbtable support for record status
|
||||||
|
@@ -95,14 +95,14 @@ bool wxDbColDef::Initialize()
|
|||||||
SqlCtype = SQL_C_LONG;
|
SqlCtype = SQL_C_LONG;
|
||||||
PtrDataObj = NULL;
|
PtrDataObj = NULL;
|
||||||
SzDataObj = 0;
|
SzDataObj = 0;
|
||||||
KeyField = FALSE;
|
KeyField = false;
|
||||||
Updateable = FALSE;
|
Updateable = false;
|
||||||
InsertAllowed = FALSE;
|
InsertAllowed = false;
|
||||||
DerivedCol = FALSE;
|
DerivedCol = false;
|
||||||
CbValue = 0;
|
CbValue = 0;
|
||||||
Null = FALSE;
|
Null = false;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
} // wxDbColDef::Initialize()
|
} // wxDbColDef::Initialize()
|
||||||
|
|
||||||
|
|
||||||
@@ -154,9 +154,9 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num
|
|||||||
where.Empty(); // Where clause
|
where.Empty(); // Where clause
|
||||||
orderBy.Empty(); // Order By clause
|
orderBy.Empty(); // Order By clause
|
||||||
from.Empty(); // From clause
|
from.Empty(); // From clause
|
||||||
selectForUpdate = FALSE; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase
|
selectForUpdate = false; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase
|
||||||
queryOnly = qryOnly;
|
queryOnly = qryOnly;
|
||||||
insertable = TRUE;
|
insertable = true;
|
||||||
tablePath.Empty();
|
tablePath.Empty();
|
||||||
tableName.Empty();
|
tableName.Empty();
|
||||||
queryTableName.Empty();
|
queryTableName.Empty();
|
||||||
@@ -165,7 +165,7 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num
|
|||||||
wxASSERT(pDb);
|
wxASSERT(pDb);
|
||||||
|
|
||||||
if (!pDb)
|
if (!pDb)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
tableName = tblName; // Table Name
|
tableName = tblName; // Table Name
|
||||||
if (tblPath.Length())
|
if (tblPath.Length())
|
||||||
@@ -262,7 +262,7 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num
|
|||||||
{
|
{
|
||||||
// Should never happen
|
// Should never happen
|
||||||
pDb->GetNextError(henv, hdbc, hstmtInternal);
|
pDb->GetNextError(henv, hdbc, hstmtInternal);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,11 +291,11 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make the default cursor the active cursor
|
// Make the default cursor the active cursor
|
||||||
hstmtDefault = GetNewCursor(FALSE,FALSE);
|
hstmtDefault = GetNewCursor(false,false);
|
||||||
wxASSERT(hstmtDefault);
|
wxASSERT(hstmtDefault);
|
||||||
hstmt = *hstmtDefault;
|
hstmt = *hstmtDefault;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::initialize()
|
} // wxDbTable::initialize()
|
||||||
|
|
||||||
@@ -312,7 +312,7 @@ void wxDbTable::cleanup()
|
|||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
if (tableID)
|
if (tableID)
|
||||||
{
|
{
|
||||||
bool found = FALSE;
|
bool found = false;
|
||||||
|
|
||||||
wxList::compatibility_iterator pNode;
|
wxList::compatibility_iterator pNode;
|
||||||
pNode = TablesInUse.GetFirst();
|
pNode = TablesInUse.GetFirst();
|
||||||
@@ -320,7 +320,7 @@ void wxDbTable::cleanup()
|
|||||||
{
|
{
|
||||||
if (((wxTablesInUse *)pNode->GetData())->tableID == tableID)
|
if (((wxTablesInUse *)pNode->GetData())->tableID == tableID)
|
||||||
{
|
{
|
||||||
found = TRUE;
|
found = true;
|
||||||
delete (wxTablesInUse *)pNode->GetData();
|
delete (wxTablesInUse *)pNode->GetData();
|
||||||
TablesInUse.Erase(pNode);
|
TablesInUse.Erase(pNode);
|
||||||
}
|
}
|
||||||
@@ -445,7 +445,7 @@ bool wxDbTable::bindParams(bool forUpdate)
|
|||||||
{
|
{
|
||||||
wxASSERT(!queryOnly);
|
wxASSERT(!queryOnly);
|
||||||
if (queryOnly)
|
if (queryOnly)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
SWORD fSqlType = 0;
|
SWORD fSqlType = 0;
|
||||||
SDWORD precision = 0;
|
SDWORD precision = 0;
|
||||||
@@ -526,7 +526,7 @@ bool wxDbTable::bindParams(bool forUpdate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Completed successfully
|
// Completed successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::bindParams()
|
} // wxDbTable::bindParams()
|
||||||
|
|
||||||
@@ -534,14 +534,14 @@ bool wxDbTable::bindParams(bool forUpdate)
|
|||||||
/********** wxDbTable::bindInsertParams() **********/
|
/********** wxDbTable::bindInsertParams() **********/
|
||||||
bool wxDbTable::bindInsertParams(void)
|
bool wxDbTable::bindInsertParams(void)
|
||||||
{
|
{
|
||||||
return bindParams(FALSE);
|
return bindParams(false);
|
||||||
} // wxDbTable::bindInsertParams()
|
} // wxDbTable::bindInsertParams()
|
||||||
|
|
||||||
|
|
||||||
/********** wxDbTable::bindUpdateParams() **********/
|
/********** wxDbTable::bindUpdateParams() **********/
|
||||||
bool wxDbTable::bindUpdateParams(void)
|
bool wxDbTable::bindUpdateParams(void)
|
||||||
{
|
{
|
||||||
return bindParams(TRUE);
|
return bindParams(true);
|
||||||
} // wxDbTable::bindUpdateParams()
|
} // wxDbTable::bindUpdateParams()
|
||||||
|
|
||||||
|
|
||||||
@@ -561,7 +561,7 @@ bool wxDbTable::bindCols(HSTMT cursor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Completed successfully
|
// Completed successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::bindCols()
|
} // wxDbTable::bindCols()
|
||||||
|
|
||||||
@@ -581,7 +581,7 @@ bool wxDbTable::getRec(UWORD fetchType)
|
|||||||
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
|
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
|
||||||
{
|
{
|
||||||
if (retcode == SQL_NO_DATA_FOUND)
|
if (retcode == SQL_NO_DATA_FOUND)
|
||||||
return(FALSE);
|
return false;
|
||||||
else
|
else
|
||||||
return(pDb->DispAllErrors(henv, hdbc, hstmt));
|
return(pDb->DispAllErrors(henv, hdbc, hstmt));
|
||||||
}
|
}
|
||||||
@@ -601,7 +601,7 @@ bool wxDbTable::getRec(UWORD fetchType)
|
|||||||
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
|
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
|
||||||
{
|
{
|
||||||
if (retcode == SQL_NO_DATA_FOUND)
|
if (retcode == SQL_NO_DATA_FOUND)
|
||||||
return(FALSE);
|
return false;
|
||||||
else
|
else
|
||||||
return(pDb->DispAllErrors(henv, hdbc, hstmt));
|
return(pDb->DispAllErrors(henv, hdbc, hstmt));
|
||||||
}
|
}
|
||||||
@@ -616,7 +616,7 @@ bool wxDbTable::getRec(UWORD fetchType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Completed successfully
|
// Completed successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::getRec()
|
} // wxDbTable::getRec()
|
||||||
|
|
||||||
@@ -634,7 +634,7 @@ bool wxDbTable::execDelete(const wxString &pSqlStmt)
|
|||||||
retcode == SQL_SUCCESS_WITH_INFO)
|
retcode == SQL_SUCCESS_WITH_INFO)
|
||||||
{
|
{
|
||||||
// Record deleted successfully
|
// Record deleted successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Problem deleting record
|
// Problem deleting record
|
||||||
@@ -656,7 +656,7 @@ bool wxDbTable::execUpdate(const wxString &pSqlStmt)
|
|||||||
retcode == SQL_SUCCESS_WITH_INFO)
|
retcode == SQL_SUCCESS_WITH_INFO)
|
||||||
{
|
{
|
||||||
// Record updated successfully
|
// Record updated successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
else if (retcode == SQL_NEED_DATA)
|
else if (retcode == SQL_NEED_DATA)
|
||||||
{
|
{
|
||||||
@@ -687,7 +687,7 @@ bool wxDbTable::execUpdate(const wxString &pSqlStmt)
|
|||||||
retcode == SQL_SUCCESS_WITH_INFO)
|
retcode == SQL_SUCCESS_WITH_INFO)
|
||||||
{
|
{
|
||||||
// Record updated successfully
|
// Record updated successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,7 +706,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri
|
|||||||
// The user may wish to select for update, but the DBMS may not be capable
|
// The user may wish to select for update, but the DBMS may not be capable
|
||||||
selectForUpdate = CanSelectForUpdate();
|
selectForUpdate = CanSelectForUpdate();
|
||||||
else
|
else
|
||||||
selectForUpdate = FALSE;
|
selectForUpdate = false;
|
||||||
|
|
||||||
// Set the SQL SELECT string
|
// Set the SQL SELECT string
|
||||||
if (queryType != DB_SELECT_STATEMENT) // A select statement was not passed in,
|
if (queryType != DB_SELECT_STATEMENT) // A select statement was not passed in,
|
||||||
@@ -717,7 +717,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri
|
|||||||
|
|
||||||
// Make sure the cursor is closed first
|
// Make sure the cursor is closed first
|
||||||
if (!CloseCursor(hstmt))
|
if (!CloseCursor(hstmt))
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
// Execute the SQL SELECT statement
|
// Execute the SQL SELECT statement
|
||||||
int retcode;
|
int retcode;
|
||||||
@@ -726,7 +726,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri
|
|||||||
return(pDb->DispAllErrors(henv, hdbc, hstmt));
|
return(pDb->DispAllErrors(henv, hdbc, hstmt));
|
||||||
|
|
||||||
// Completed successfully
|
// Completed successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::query()
|
} // wxDbTable::query()
|
||||||
|
|
||||||
@@ -738,7 +738,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri
|
|||||||
bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
||||||
{
|
{
|
||||||
if (!pDb)
|
if (!pDb)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
@@ -792,7 +792,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
|||||||
p += s;
|
p += s;
|
||||||
pDb->LogError(p.GetData());
|
pDb->LogError(p.GetData());
|
||||||
|
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bind the member variables for field exchange between
|
// Bind the member variables for field exchange between
|
||||||
@@ -800,17 +800,17 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
|||||||
if (!queryOnly)
|
if (!queryOnly)
|
||||||
{
|
{
|
||||||
if (!bindInsertParams()) // Inserts
|
if (!bindInsertParams()) // Inserts
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
if (!bindUpdateParams()) // Updates
|
if (!bindUpdateParams()) // Updates
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bindCols(*hstmtDefault)) // Selects
|
if (!bindCols(*hstmtDefault)) // Selects
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
if (!bindCols(hstmtInternal)) // Internal use only
|
if (!bindCols(hstmtInternal)) // Internal use only
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do NOT bind the hstmtCount cursor!!!
|
* Do NOT bind the hstmtCount cursor!!!
|
||||||
@@ -819,7 +819,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
|||||||
// Build an insert statement using parameter markers
|
// Build an insert statement using parameter markers
|
||||||
if (!queryOnly && noCols > 0)
|
if (!queryOnly && noCols > 0)
|
||||||
{
|
{
|
||||||
bool needComma = FALSE;
|
bool needComma = false;
|
||||||
sqlStmt.Printf(wxT("INSERT INTO %s ("),
|
sqlStmt.Printf(wxT("INSERT INTO %s ("),
|
||||||
pDb->SQLTableName(tableName.c_str()).c_str());
|
pDb->SQLTableName(tableName.c_str()).c_str());
|
||||||
for (i = 0; i < noCols; i++)
|
for (i = 0; i < noCols; i++)
|
||||||
@@ -830,9 +830,9 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
|||||||
sqlStmt += wxT(",");
|
sqlStmt += wxT(",");
|
||||||
sqlStmt += pDb->SQLColumnName(colDefs[i].ColName);
|
sqlStmt += pDb->SQLColumnName(colDefs[i].ColName);
|
||||||
// sqlStmt += colDefs[i].ColName;
|
// sqlStmt += colDefs[i].ColName;
|
||||||
needComma = TRUE;
|
needComma = true;
|
||||||
}
|
}
|
||||||
needComma = FALSE;
|
needComma = false;
|
||||||
sqlStmt += wxT(") VALUES (");
|
sqlStmt += wxT(") VALUES (");
|
||||||
|
|
||||||
int insertableCount = 0;
|
int insertableCount = 0;
|
||||||
@@ -844,7 +844,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
|||||||
if (needComma)
|
if (needComma)
|
||||||
sqlStmt += wxT(",");
|
sqlStmt += wxT(",");
|
||||||
sqlStmt += wxT("?");
|
sqlStmt += wxT("?");
|
||||||
needComma = TRUE;
|
needComma = true;
|
||||||
insertableCount++;
|
insertableCount++;
|
||||||
}
|
}
|
||||||
sqlStmt += wxT(")");
|
sqlStmt += wxT(")");
|
||||||
@@ -856,11 +856,11 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
|||||||
return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
|
return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
insertable = FALSE;
|
insertable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Completed successfully
|
// Completed successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::Open()
|
} // wxDbTable::Open()
|
||||||
|
|
||||||
@@ -879,7 +879,7 @@ bool wxDbTable::QueryBySqlStmt(const wxString &pSqlStmt)
|
|||||||
{
|
{
|
||||||
pDb->WriteSqlLog(pSqlStmt);
|
pDb->WriteSqlLog(pSqlStmt);
|
||||||
|
|
||||||
return(query(DB_SELECT_STATEMENT, FALSE, FALSE, pSqlStmt));
|
return(query(DB_SELECT_STATEMENT, false, false, pSqlStmt));
|
||||||
|
|
||||||
} // wxDbTable::QueryBySqlStmt()
|
} // wxDbTable::QueryBySqlStmt()
|
||||||
|
|
||||||
@@ -908,7 +908,7 @@ bool wxDbTable::GetPrev(void)
|
|||||||
if (pDb->FwdOnlyCursors())
|
if (pDb->FwdOnlyCursors())
|
||||||
{
|
{
|
||||||
wxFAIL_MSG(wxT("GetPrev()::Backward scrolling cursors are not enabled for this instance of wxDbTable"));
|
wxFAIL_MSG(wxT("GetPrev()::Backward scrolling cursors are not enabled for this instance of wxDbTable"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(getRec(SQL_FETCH_PRIOR));
|
return(getRec(SQL_FETCH_PRIOR));
|
||||||
@@ -922,7 +922,7 @@ bool wxDbTable::operator--(int)
|
|||||||
if (pDb->FwdOnlyCursors())
|
if (pDb->FwdOnlyCursors())
|
||||||
{
|
{
|
||||||
wxFAIL_MSG(wxT("operator--:Backward scrolling cursors are not enabled for this instance of wxDbTable"));
|
wxFAIL_MSG(wxT("operator--:Backward scrolling cursors are not enabled for this instance of wxDbTable"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(getRec(SQL_FETCH_PRIOR));
|
return(getRec(SQL_FETCH_PRIOR));
|
||||||
@@ -936,7 +936,7 @@ bool wxDbTable::GetFirst(void)
|
|||||||
if (pDb->FwdOnlyCursors())
|
if (pDb->FwdOnlyCursors())
|
||||||
{
|
{
|
||||||
wxFAIL_MSG(wxT("GetFirst():Backward scrolling cursors are not enabled for this instance of wxDbTable"));
|
wxFAIL_MSG(wxT("GetFirst():Backward scrolling cursors are not enabled for this instance of wxDbTable"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(getRec(SQL_FETCH_FIRST));
|
return(getRec(SQL_FETCH_FIRST));
|
||||||
@@ -950,7 +950,7 @@ bool wxDbTable::GetLast(void)
|
|||||||
if (pDb->FwdOnlyCursors())
|
if (pDb->FwdOnlyCursors())
|
||||||
{
|
{
|
||||||
wxFAIL_MSG(wxT("GetLast()::Backward scrolling cursors are not enabled for this instance of wxDbTable"));
|
wxFAIL_MSG(wxT("GetLast()::Backward scrolling cursors are not enabled for this instance of wxDbTable"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(getRec(SQL_FETCH_LAST));
|
return(getRec(SQL_FETCH_LAST));
|
||||||
@@ -1045,13 +1045,13 @@ void wxDbTable::BuildSelectStmt(wxString &pSqlStmt, int typeOfSelect, bool disti
|
|||||||
|
|
||||||
// Was a FROM clause specified to join tables to the base table?
|
// Was a FROM clause specified to join tables to the base table?
|
||||||
// Available for ::Query() only!!!
|
// Available for ::Query() only!!!
|
||||||
bool appendFromClause = FALSE;
|
bool appendFromClause = false;
|
||||||
#if wxODBC_BACKWARD_COMPATABILITY
|
#if wxODBC_BACKWARD_COMPATABILITY
|
||||||
if (typeOfSelect == DB_SELECT_WHERE && from && wxStrlen(from))
|
if (typeOfSelect == DB_SELECT_WHERE && from && wxStrlen(from))
|
||||||
appendFromClause = TRUE;
|
appendFromClause = true;
|
||||||
#else
|
#else
|
||||||
if (typeOfSelect == DB_SELECT_WHERE && from.Length())
|
if (typeOfSelect == DB_SELECT_WHERE && from.Length())
|
||||||
appendFromClause = TRUE;
|
appendFromClause = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add the column list
|
// Add the column list
|
||||||
@@ -1175,7 +1175,7 @@ void wxDbTable::BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxStrin
|
|||||||
wxString whereClause;
|
wxString whereClause;
|
||||||
whereClause.Empty();
|
whereClause.Empty();
|
||||||
|
|
||||||
bool firstColumn = TRUE;
|
bool firstColumn = true;
|
||||||
|
|
||||||
pSqlStmt.Printf(wxT("UPDATE %s SET "),
|
pSqlStmt.Printf(wxT("UPDATE %s SET "),
|
||||||
pDb->SQLTableName(tableName.c_str()).c_str());
|
pDb->SQLTableName(tableName.c_str()).c_str());
|
||||||
@@ -1190,7 +1190,7 @@ void wxDbTable::BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxStrin
|
|||||||
if (!firstColumn)
|
if (!firstColumn)
|
||||||
pSqlStmt += wxT(",");
|
pSqlStmt += wxT(",");
|
||||||
else
|
else
|
||||||
firstColumn = FALSE;
|
firstColumn = false;
|
||||||
|
|
||||||
pSqlStmt += pDb->SQLColumnName(colDefs[i].ColName);
|
pSqlStmt += pDb->SQLColumnName(colDefs[i].ColName);
|
||||||
// pSqlStmt += colDefs[i].ColName;
|
// pSqlStmt += colDefs[i].ColName;
|
||||||
@@ -1251,7 +1251,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere,
|
|||||||
* They are not included as part of the where clause.
|
* They are not included as part of the where clause.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
bool moreThanOneColumn = FALSE;
|
bool moreThanOneColumn = false;
|
||||||
wxString colValue;
|
wxString colValue;
|
||||||
|
|
||||||
// Loop through the columns building a where clause as you go
|
// Loop through the columns building a where clause as you go
|
||||||
@@ -1269,7 +1269,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere,
|
|||||||
if (moreThanOneColumn)
|
if (moreThanOneColumn)
|
||||||
pWhereClause += wxT(" AND ");
|
pWhereClause += wxT(" AND ");
|
||||||
else
|
else
|
||||||
moreThanOneColumn = TRUE;
|
moreThanOneColumn = true;
|
||||||
|
|
||||||
// Concatenate where phrase for the column
|
// Concatenate where phrase for the column
|
||||||
wxString tStr = colDefs[colNo].ColName;
|
wxString tStr = colDefs[colNo].ColName;
|
||||||
@@ -1360,7 +1360,7 @@ bool wxDbTable::CloseCursor(HSTMT cursor)
|
|||||||
return(pDb->DispAllErrors(henv, hdbc, cursor));
|
return(pDb->DispAllErrors(henv, hdbc, cursor));
|
||||||
|
|
||||||
// Completed successfully
|
// Completed successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::CloseCursor()
|
} // wxDbTable::CloseCursor()
|
||||||
|
|
||||||
@@ -1369,7 +1369,7 @@ bool wxDbTable::CloseCursor(HSTMT cursor)
|
|||||||
bool wxDbTable::CreateTable(bool attemptDrop)
|
bool wxDbTable::CreateTable(bool attemptDrop)
|
||||||
{
|
{
|
||||||
if (!pDb)
|
if (!pDb)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
@@ -1380,7 +1380,7 @@ bool wxDbTable::CreateTable(bool attemptDrop)
|
|||||||
|
|
||||||
// Drop table first
|
// Drop table first
|
||||||
if (attemptDrop && !DropTable())
|
if (attemptDrop && !DropTable())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// Create the table
|
// Create the table
|
||||||
#ifdef DBDEBUG_CONSOLE
|
#ifdef DBDEBUG_CONSOLE
|
||||||
@@ -1413,7 +1413,7 @@ bool wxDbTable::CreateTable(bool attemptDrop)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Build a CREATE TABLE string from the colDefs structure.
|
// Build a CREATE TABLE string from the colDefs structure.
|
||||||
bool needComma = FALSE;
|
bool needComma = false;
|
||||||
|
|
||||||
sqlStmt.Printf(wxT("CREATE TABLE %s ("),
|
sqlStmt.Printf(wxT("CREATE TABLE %s ("),
|
||||||
pDb->SQLTableName(tableName.c_str()).c_str());
|
pDb->SQLTableName(tableName.c_str()).c_str());
|
||||||
@@ -1471,7 +1471,7 @@ bool wxDbTable::CreateTable(bool attemptDrop)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
needComma = TRUE;
|
needComma = true;
|
||||||
}
|
}
|
||||||
// If there is a primary key defined, include it in the create statement
|
// If there is a primary key defined, include it in the create statement
|
||||||
for (i = j = 0; i < noCols; i++)
|
for (i = j = 0; i < noCols; i++)
|
||||||
@@ -1562,17 +1562,17 @@ bool wxDbTable::CreateTable(bool attemptDrop)
|
|||||||
pDb->DispAllErrors(henv, hdbc, hstmt);
|
pDb->DispAllErrors(henv, hdbc, hstmt);
|
||||||
pDb->RollbackTrans();
|
pDb->RollbackTrans();
|
||||||
CloseCursor(hstmt);
|
CloseCursor(hstmt);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit the transaction and close the cursor
|
// Commit the transaction and close the cursor
|
||||||
if (!pDb->CommitTrans())
|
if (!pDb->CommitTrans())
|
||||||
return(FALSE);
|
return false;
|
||||||
if (!CloseCursor(hstmt))
|
if (!CloseCursor(hstmt))
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
// Database table created successfully
|
// Database table created successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::CreateTable()
|
} // wxDbTable::CreateTable()
|
||||||
|
|
||||||
@@ -1580,7 +1580,7 @@ bool wxDbTable::CreateTable(bool attemptDrop)
|
|||||||
/********** wxDbTable::DropTable() **********/
|
/********** wxDbTable::DropTable() **********/
|
||||||
bool wxDbTable::DropTable()
|
bool wxDbTable::DropTable()
|
||||||
{
|
{
|
||||||
// NOTE: This function returns TRUE if the Table does not exist, but
|
// NOTE: This function returns true if the Table does not exist, but
|
||||||
// only for identified databases. Code will need to be added
|
// only for identified databases. Code will need to be added
|
||||||
// below for any other databases when those databases are defined
|
// below for any other databases when those databases are defined
|
||||||
// to handle this situation consistently
|
// to handle this situation consistently
|
||||||
@@ -1614,18 +1614,18 @@ bool wxDbTable::DropTable()
|
|||||||
pDb->DispAllErrors(henv, hdbc, hstmt);
|
pDb->DispAllErrors(henv, hdbc, hstmt);
|
||||||
pDb->RollbackTrans();
|
pDb->RollbackTrans();
|
||||||
// CloseCursor(hstmt);
|
// CloseCursor(hstmt);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit the transaction and close the cursor
|
// Commit the transaction and close the cursor
|
||||||
if (! pDb->CommitTrans())
|
if (! pDb->CommitTrans())
|
||||||
return(FALSE);
|
return false;
|
||||||
if (! CloseCursor(hstmt))
|
if (! CloseCursor(hstmt))
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
} // wxDbTable::DropTable()
|
} // wxDbTable::DropTable()
|
||||||
|
|
||||||
|
|
||||||
@@ -1637,7 +1637,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol
|
|||||||
|
|
||||||
// Drop the index first
|
// Drop the index first
|
||||||
if (attemptDrop && !DropIndex(idxName))
|
if (attemptDrop && !DropIndex(idxName))
|
||||||
return (FALSE);
|
return false;
|
||||||
|
|
||||||
// MySQL (and possibly Sybase ASE?? - gt) require that any columns which are used as portions
|
// MySQL (and possibly Sybase ASE?? - gt) require that any columns which are used as portions
|
||||||
// of an index have the columns defined as "NOT NULL". During initial table creation though,
|
// of an index have the columns defined as "NOT NULL". During initial table creation though,
|
||||||
@@ -1651,11 +1651,11 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol
|
|||||||
{
|
{
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
int i;
|
int i;
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
for (i = 0; i < noIdxCols && ok; i++)
|
for (i = 0; i < noIdxCols && ok; i++)
|
||||||
{
|
{
|
||||||
int j = 0;
|
int j = 0;
|
||||||
bool found = FALSE;
|
bool found = false;
|
||||||
// Find the column definition that has the ColName that matches the
|
// Find the column definition that has the ColName that matches the
|
||||||
// index column name. We need to do this to get the DB_DATA_TYPE of
|
// index column name. We need to do this to get the DB_DATA_TYPE of
|
||||||
// the index column, as MySQL's syntax for the ALTER column requires
|
// the index column, as MySQL's syntax for the ALTER column requires
|
||||||
@@ -1663,7 +1663,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol
|
|||||||
while (!found && (j < this->noCols))
|
while (!found && (j < this->noCols))
|
||||||
{
|
{
|
||||||
if (wxStrcmp(colDefs[j].ColName,pIdxDefs[i].ColName) == 0)
|
if (wxStrcmp(colDefs[j].ColName,pIdxDefs[i].ColName) == 0)
|
||||||
found = TRUE;
|
found = true;
|
||||||
if (!found)
|
if (!found)
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
@@ -1687,14 +1687,14 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ok = FALSE;
|
ok = false;
|
||||||
}
|
}
|
||||||
if (ok)
|
if (ok)
|
||||||
pDb->CommitTrans();
|
pDb->CommitTrans();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pDb->RollbackTrans();
|
pDb->RollbackTrans();
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1769,17 +1769,17 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol
|
|||||||
pDb->DispAllErrors(henv, hdbc, hstmt);
|
pDb->DispAllErrors(henv, hdbc, hstmt);
|
||||||
pDb->RollbackTrans();
|
pDb->RollbackTrans();
|
||||||
CloseCursor(hstmt);
|
CloseCursor(hstmt);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit the transaction and close the cursor
|
// Commit the transaction and close the cursor
|
||||||
if (! pDb->CommitTrans())
|
if (! pDb->CommitTrans())
|
||||||
return(FALSE);
|
return false;
|
||||||
if (! CloseCursor(hstmt))
|
if (! CloseCursor(hstmt))
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
// Index Created Successfully
|
// Index Created Successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::CreateIndex()
|
} // wxDbTable::CreateIndex()
|
||||||
|
|
||||||
@@ -1787,7 +1787,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol
|
|||||||
/********** wxDbTable::DropIndex() **********/
|
/********** wxDbTable::DropIndex() **********/
|
||||||
bool wxDbTable::DropIndex(const wxString &idxName)
|
bool wxDbTable::DropIndex(const wxString &idxName)
|
||||||
{
|
{
|
||||||
// NOTE: This function returns TRUE if the Index does not exist, but
|
// NOTE: This function returns true if the Index does not exist, but
|
||||||
// only for identified databases. Code will need to be added
|
// only for identified databases. Code will need to be added
|
||||||
// below for any other databases when those databases are defined
|
// below for any other databases when those databases are defined
|
||||||
// to handle this situation consistently
|
// to handle this situation consistently
|
||||||
@@ -1835,18 +1835,18 @@ bool wxDbTable::DropIndex(const wxString &idxName)
|
|||||||
pDb->DispAllErrors(henv, hdbc, hstmt);
|
pDb->DispAllErrors(henv, hdbc, hstmt);
|
||||||
pDb->RollbackTrans();
|
pDb->RollbackTrans();
|
||||||
CloseCursor(hstmt);
|
CloseCursor(hstmt);
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit the transaction and close the cursor
|
// Commit the transaction and close the cursor
|
||||||
if (! pDb->CommitTrans())
|
if (! pDb->CommitTrans())
|
||||||
return(FALSE);
|
return false;
|
||||||
if (! CloseCursor(hstmt))
|
if (! CloseCursor(hstmt))
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
} // wxDbTable::DropIndex()
|
} // wxDbTable::DropIndex()
|
||||||
|
|
||||||
|
|
||||||
@@ -1856,7 +1856,7 @@ bool wxDbTable::SetOrderByColNums(UWORD first, ... )
|
|||||||
int colNo = first; // using 'int' to be able to look for wxDB_NO_MORE_COLUN_NUMBERS
|
int colNo = first; // using 'int' to be able to look for wxDB_NO_MORE_COLUN_NUMBERS
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
|
|
||||||
bool abort = FALSE;
|
bool abort = false;
|
||||||
wxString tempStr;
|
wxString tempStr;
|
||||||
|
|
||||||
va_start(argptr, first); /* Initialize variable arguments. */
|
va_start(argptr, first); /* Initialize variable arguments. */
|
||||||
@@ -1868,7 +1868,7 @@ bool wxDbTable::SetOrderByColNums(UWORD first, ... )
|
|||||||
// Valid columns are 0 thru noCols-1
|
// Valid columns are 0 thru noCols-1
|
||||||
if (colNo >= noCols || colNo < 0)
|
if (colNo >= noCols || colNo < 0)
|
||||||
{
|
{
|
||||||
abort = TRUE;
|
abort = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1958,7 +1958,7 @@ bool wxDbTable::Update(void)
|
|||||||
{
|
{
|
||||||
wxASSERT(!queryOnly);
|
wxASSERT(!queryOnly);
|
||||||
if (queryOnly)
|
if (queryOnly)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
|
|
||||||
@@ -1982,7 +1982,7 @@ bool wxDbTable::Update(const wxString &pSqlStmt)
|
|||||||
{
|
{
|
||||||
wxASSERT(!queryOnly);
|
wxASSERT(!queryOnly);
|
||||||
if (queryOnly)
|
if (queryOnly)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
pDb->WriteSqlLog(pSqlStmt);
|
pDb->WriteSqlLog(pSqlStmt);
|
||||||
|
|
||||||
@@ -1996,7 +1996,7 @@ bool wxDbTable::UpdateWhere(const wxString &pWhereClause)
|
|||||||
{
|
{
|
||||||
wxASSERT(!queryOnly);
|
wxASSERT(!queryOnly);
|
||||||
if (queryOnly)
|
if (queryOnly)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
|
|
||||||
@@ -2020,7 +2020,7 @@ bool wxDbTable::Delete(void)
|
|||||||
{
|
{
|
||||||
wxASSERT(!queryOnly);
|
wxASSERT(!queryOnly);
|
||||||
if (queryOnly)
|
if (queryOnly)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
sqlStmt.Empty();
|
sqlStmt.Empty();
|
||||||
@@ -2041,7 +2041,7 @@ bool wxDbTable::DeleteWhere(const wxString &pWhereClause)
|
|||||||
{
|
{
|
||||||
wxASSERT(!queryOnly);
|
wxASSERT(!queryOnly);
|
||||||
if (queryOnly)
|
if (queryOnly)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
sqlStmt.Empty();
|
sqlStmt.Empty();
|
||||||
@@ -2062,7 +2062,7 @@ bool wxDbTable::DeleteMatching(void)
|
|||||||
{
|
{
|
||||||
wxASSERT(!queryOnly);
|
wxASSERT(!queryOnly);
|
||||||
if (queryOnly)
|
if (queryOnly)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
wxString sqlStmt;
|
wxString sqlStmt;
|
||||||
sqlStmt.Empty();
|
sqlStmt.Empty();
|
||||||
@@ -2082,7 +2082,7 @@ bool wxDbTable::DeleteMatching(void)
|
|||||||
bool wxDbTable::IsColNull(UWORD colNo) const
|
bool wxDbTable::IsColNull(UWORD colNo) const
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
This logic is just not right. It would indicate TRUE
|
This logic is just not right. It would indicate true
|
||||||
if a numeric field were set to a value of 0.
|
if a numeric field were set to a value of 0.
|
||||||
|
|
||||||
switch(colDefs[colNo].SqlCtype)
|
switch(colDefs[colNo].SqlCtype)
|
||||||
@@ -2105,11 +2105,11 @@ bool wxDbTable::IsColNull(UWORD colNo) const
|
|||||||
TIMESTAMP_STRUCT *pDt;
|
TIMESTAMP_STRUCT *pDt;
|
||||||
pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj;
|
pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj;
|
||||||
if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0)
|
if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0)
|
||||||
return(TRUE);
|
return true;
|
||||||
else
|
else
|
||||||
return(FALSE);
|
return false;
|
||||||
default:
|
default:
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return (colDefs[colNo].Null);
|
return (colDefs[colNo].Null);
|
||||||
@@ -2120,16 +2120,16 @@ bool wxDbTable::IsColNull(UWORD colNo) const
|
|||||||
bool wxDbTable::CanSelectForUpdate(void)
|
bool wxDbTable::CanSelectForUpdate(void)
|
||||||
{
|
{
|
||||||
if (queryOnly)
|
if (queryOnly)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (pDb->Dbms() == dbmsMY_SQL)
|
if (pDb->Dbms() == dbmsMY_SQL)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if ((pDb->Dbms() == dbmsORACLE) ||
|
if ((pDb->Dbms() == dbmsORACLE) ||
|
||||||
(pDb->dbInf.posStmts & SQL_PS_SELECT_FOR_UPDATE))
|
(pDb->dbInf.posStmts & SQL_PS_SELECT_FOR_UPDATE))
|
||||||
return(TRUE);
|
return true;
|
||||||
else
|
else
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
} // wxDbTable::CanSelectForUpdate()
|
} // wxDbTable::CanSelectForUpdate()
|
||||||
|
|
||||||
@@ -2138,15 +2138,15 @@ bool wxDbTable::CanSelectForUpdate(void)
|
|||||||
bool wxDbTable::CanUpdByROWID(void)
|
bool wxDbTable::CanUpdByROWID(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* NOTE: Returning FALSE for now until this can be debugged,
|
* NOTE: Returning false for now until this can be debugged,
|
||||||
* as the ROWID is not getting updated correctly
|
* as the ROWID is not getting updated correctly
|
||||||
*/
|
*/
|
||||||
return FALSE;
|
return false;
|
||||||
/*
|
/*
|
||||||
if (pDb->Dbms() == dbmsORACLE)
|
if (pDb->Dbms() == dbmsORACLE)
|
||||||
return(TRUE);
|
return true;
|
||||||
else
|
else
|
||||||
return(FALSE);
|
return false;
|
||||||
*/
|
*/
|
||||||
} // wxDbTable::CanUpdByROWID()
|
} // wxDbTable::CanUpdByROWID()
|
||||||
|
|
||||||
@@ -2155,9 +2155,9 @@ bool wxDbTable::CanUpdByROWID(void)
|
|||||||
bool wxDbTable::IsCursorClosedOnCommit(void)
|
bool wxDbTable::IsCursorClosedOnCommit(void)
|
||||||
{
|
{
|
||||||
if (pDb->dbInf.cursorCommitBehavior == SQL_CB_PRESERVE)
|
if (pDb->dbInf.cursorCommitBehavior == SQL_CB_PRESERVE)
|
||||||
return(FALSE);
|
return false;
|
||||||
else
|
else
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::IsCursorClosedOnCommit()
|
} // wxDbTable::IsCursorClosedOnCommit()
|
||||||
|
|
||||||
@@ -2234,7 +2234,7 @@ bool wxDbTable::SetQueryTimeout(UDWORD nSeconds)
|
|||||||
return(pDb->DispAllErrors(henv, hdbc, hstmtInternal));
|
return(pDb->DispAllErrors(henv, hdbc, hstmtInternal));
|
||||||
|
|
||||||
// Completed Successfully
|
// Completed Successfully
|
||||||
return(TRUE);
|
return true;
|
||||||
|
|
||||||
} // wxDbTable::SetQueryTimeout()
|
} // wxDbTable::SetQueryTimeout()
|
||||||
|
|
||||||
@@ -2274,8 +2274,8 @@ void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType,
|
|||||||
// Derived columns by definition would NOT be "Insertable" or "Updateable"
|
// Derived columns by definition would NOT be "Insertable" or "Updateable"
|
||||||
if (derivedCol)
|
if (derivedCol)
|
||||||
{
|
{
|
||||||
colDefs[index].Updateable = FALSE;
|
colDefs[index].Updateable = false;
|
||||||
colDefs[index].InsertAllowed = FALSE;
|
colDefs[index].InsertAllowed = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2283,7 +2283,7 @@ void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType,
|
|||||||
colDefs[index].InsertAllowed = insAllow;
|
colDefs[index].InsertAllowed = insAllow;
|
||||||
}
|
}
|
||||||
|
|
||||||
colDefs[index].Null = FALSE;
|
colDefs[index].Null = false;
|
||||||
|
|
||||||
} // wxDbTable::SetColDefs()
|
} // wxDbTable::SetColDefs()
|
||||||
|
|
||||||
@@ -2419,7 +2419,7 @@ ULONG wxDbTable::Count(const wxString &args)
|
|||||||
// Initialize the Count cursor if it's not already initialized
|
// Initialize the Count cursor if it's not already initialized
|
||||||
if (!hstmtCount)
|
if (!hstmtCount)
|
||||||
{
|
{
|
||||||
hstmtCount = GetNewCursor(FALSE,FALSE);
|
hstmtCount = GetNewCursor(false,false);
|
||||||
wxASSERT(hstmtCount);
|
wxASSERT(hstmtCount);
|
||||||
if (!hstmtCount)
|
if (!hstmtCount)
|
||||||
return(0);
|
return(0);
|
||||||
@@ -2459,7 +2459,7 @@ ULONG wxDbTable::Count(const wxString &args)
|
|||||||
/********** wxDbTable::Refresh() **********/
|
/********** wxDbTable::Refresh() **********/
|
||||||
bool wxDbTable::Refresh(void)
|
bool wxDbTable::Refresh(void)
|
||||||
{
|
{
|
||||||
bool result = TRUE;
|
bool result = true;
|
||||||
|
|
||||||
// Switch to the internal cursor so any active cursors are not corrupted
|
// Switch to the internal cursor so any active cursors are not corrupted
|
||||||
HSTMT currCursor = GetCursor();
|
HSTMT currCursor = GetCursor();
|
||||||
@@ -2503,10 +2503,10 @@ bool wxDbTable::Refresh(void)
|
|||||||
where = whereClause;
|
where = whereClause;
|
||||||
orderBy.Empty();
|
orderBy.Empty();
|
||||||
if (!Query())
|
if (!Query())
|
||||||
result = FALSE;
|
result = false;
|
||||||
|
|
||||||
if (result && !GetNext())
|
if (result && !GetNext())
|
||||||
result = FALSE;
|
result = false;
|
||||||
|
|
||||||
// Switch back to original cursor
|
// Switch back to original cursor
|
||||||
SetCursor(&currCursor);
|
SetCursor(&currCursor);
|
||||||
@@ -2531,14 +2531,14 @@ bool wxDbTable::SetColNull(UWORD colNo, bool set)
|
|||||||
{
|
{
|
||||||
colDefs[colNo].Null = set;
|
colDefs[colNo].Null = set;
|
||||||
if (set) // Blank out the values in the member variable
|
if (set) // Blank out the values in the member variable
|
||||||
ClearMemberVar(colNo, FALSE); // Must call with FALSE here, or infinite recursion will happen
|
ClearMemberVar(colNo, false); // Must call with false here, or infinite recursion will happen
|
||||||
|
|
||||||
setCbValueForColumn(colNo);
|
setCbValueForColumn(colNo);
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
} // wxDbTable::SetColNull()
|
} // wxDbTable::SetColNull()
|
||||||
|
|
||||||
@@ -2557,14 +2557,14 @@ bool wxDbTable::SetColNull(const wxString &colName, bool set)
|
|||||||
{
|
{
|
||||||
colDefs[colNo].Null = set;
|
colDefs[colNo].Null = set;
|
||||||
if (set) // Blank out the values in the member variable
|
if (set) // Blank out the values in the member variable
|
||||||
ClearMemberVar(colNo,FALSE); // Must call with FALSE here, or infinite recursion will happen
|
ClearMemberVar(colNo,false); // Must call with false here, or infinite recursion will happen
|
||||||
|
|
||||||
setCbValueForColumn(colNo);
|
setCbValueForColumn(colNo);
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
} // wxDbTable::SetColNull()
|
} // wxDbTable::SetColNull()
|
||||||
|
|
||||||
@@ -2611,7 +2611,7 @@ HSTMT *wxDbTable::GetNewCursor(bool setCursor, bool bindColumns)
|
|||||||
/********** wxDbTable::DeleteCursor() **********/
|
/********** wxDbTable::DeleteCursor() **********/
|
||||||
bool wxDbTable::DeleteCursor(HSTMT *hstmtDel)
|
bool wxDbTable::DeleteCursor(HSTMT *hstmtDel)
|
||||||
{
|
{
|
||||||
bool result = TRUE;
|
bool result = true;
|
||||||
|
|
||||||
if (!hstmtDel) // Cursor already deleted
|
if (!hstmtDel) // Cursor already deleted
|
||||||
return(result);
|
return(result);
|
||||||
@@ -2624,7 +2624,7 @@ ODBC 3.0 says to use this form
|
|||||||
if (SQLFreeStmt(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
|
if (SQLFreeStmt(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
|
||||||
{
|
{
|
||||||
pDb->DispAllErrors(henv, hdbc);
|
pDb->DispAllErrors(henv, hdbc);
|
||||||
result = FALSE;
|
result = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete hstmtDel;
|
delete hstmtDel;
|
||||||
@@ -2641,7 +2641,7 @@ void wxDbTable::SetRowMode(const rowmode_t rowmode)
|
|||||||
{
|
{
|
||||||
if (!m_hstmtGridQuery)
|
if (!m_hstmtGridQuery)
|
||||||
{
|
{
|
||||||
m_hstmtGridQuery = GetNewCursor(FALSE,FALSE);
|
m_hstmtGridQuery = GetNewCursor(false,false);
|
||||||
if (!bindCols(*m_hstmtGridQuery))
|
if (!bindCols(*m_hstmtGridQuery))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2727,7 +2727,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
|
|||||||
{
|
{
|
||||||
//Returns null if invalid!
|
//Returns null if invalid!
|
||||||
if (!dateval.ParseDate(val.GetString()))
|
if (!dateval.ParseDate(val.GetString()))
|
||||||
SetColNull(colNo, TRUE);
|
SetColNull(colNo, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (colDefs[colNo].SqlCtype)
|
switch (colDefs[colNo].SqlCtype)
|
||||||
@@ -2840,7 +2840,7 @@ void wxDbTable::SetKey(const GenericKey& k)
|
|||||||
{
|
{
|
||||||
if (colDefs[i].KeyField)
|
if (colDefs[i].KeyField)
|
||||||
{
|
{
|
||||||
SetColNull(i, FALSE);
|
SetColNull(i, false);
|
||||||
memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj);
|
memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj);
|
||||||
blkptr += colDefs[i].SzDataObj;
|
blkptr += colDefs[i].SzDataObj;
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
// bool wxDCBase::sm_cacheing = FALSE;
|
// bool wxDCBase::sm_cacheing = false;
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
@@ -291,7 +291,7 @@ static bool wx_spline_add_point(double x, double y)
|
|||||||
point->x = (int) x;
|
point->x = (int) x;
|
||||||
point->y = (int) y;
|
point->y = (int) y;
|
||||||
wx_spline_point_list.Append((wxObject*)point);
|
wx_spline_point_list.Append((wxObject*)point);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wx_spline_draw_point_array(wxDCBase *dc)
|
static void wx_spline_draw_point_array(wxDCBase *dc)
|
||||||
@@ -571,7 +571,7 @@ void wxDCBase::DrawLabel(const wxString& text,
|
|||||||
width0 = width;
|
width0 = width;
|
||||||
if ( bitmap.Ok() )
|
if ( bitmap.Ok() )
|
||||||
{
|
{
|
||||||
DrawBitmap(bitmap, x, y, TRUE /* use mask */);
|
DrawBitmap(bitmap, x, y, true /* use mask */);
|
||||||
|
|
||||||
wxCoord offset = bitmap.GetWidth() + 4;
|
wxCoord offset = bitmap.GetWidth() + 4;
|
||||||
x += offset;
|
x += offset;
|
||||||
|
@@ -103,7 +103,7 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message )
|
|||||||
case wxT('\n'):
|
case wxT('\n'):
|
||||||
if (!line.IsEmpty())
|
if (!line.IsEmpty())
|
||||||
{
|
{
|
||||||
wxStaticText *s = new wxStaticText( this, -1, line );
|
wxStaticText *s = new wxStaticText( this, wxID_ANY, line );
|
||||||
box->Add( s );
|
box->Add( s );
|
||||||
line = wxT("");
|
line = wxT("");
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message )
|
|||||||
int len = line.Len();
|
int len = line.Len();
|
||||||
line.Remove( len-diff, diff );
|
line.Remove( len-diff, diff );
|
||||||
|
|
||||||
wxStaticText *s = new wxStaticText( this, -1, line );
|
wxStaticText *s = new wxStaticText( this, wxID_ANY, line );
|
||||||
box->Add( s );
|
box->Add( s );
|
||||||
|
|
||||||
pos = last_space;
|
pos = last_space;
|
||||||
@@ -157,7 +157,7 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message )
|
|||||||
// remaining text behind last '\n'
|
// remaining text behind last '\n'
|
||||||
if (!line.IsEmpty())
|
if (!line.IsEmpty())
|
||||||
{
|
{
|
||||||
wxStaticText *s2 = new wxStaticText( this, -1, line );
|
wxStaticText *s2 = new wxStaticText( this, wxID_ANY, line );
|
||||||
box->Add( s2 );
|
box->Add( s2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -215,7 +215,7 @@ bool wxDataObjectComposite::GetDataHere(const wxDataFormat& format,
|
|||||||
{
|
{
|
||||||
wxDataObjectSimple *dataObj = GetObject(format);
|
wxDataObjectSimple *dataObj = GetObject(format);
|
||||||
|
|
||||||
wxCHECK_MSG( dataObj, FALSE,
|
wxCHECK_MSG( dataObj, false,
|
||||||
wxT("unsupported format in wxDataObjectComposite"));
|
wxT("unsupported format in wxDataObjectComposite"));
|
||||||
|
|
||||||
return dataObj->GetDataHere(buf);
|
return dataObj->GetDataHere(buf);
|
||||||
@@ -227,7 +227,7 @@ bool wxDataObjectComposite::SetData(const wxDataFormat& format,
|
|||||||
{
|
{
|
||||||
wxDataObjectSimple *dataObj = GetObject(format);
|
wxDataObjectSimple *dataObj = GetObject(format);
|
||||||
|
|
||||||
wxCHECK_MSG( dataObj, FALSE,
|
wxCHECK_MSG( dataObj, false,
|
||||||
wxT("unsupported format in wxDataObjectComposite"));
|
wxT("unsupported format in wxDataObjectComposite"));
|
||||||
|
|
||||||
return dataObj->SetData(len, buf);
|
return dataObj->SetData(len, buf);
|
||||||
@@ -268,7 +268,7 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
|
|||||||
strcpy( (char*) buf, (const char*) buffer );
|
strcpy( (char*) buf, (const char*) buffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextDataObject::SetData(const wxDataFormat& format,
|
bool wxTextDataObject::SetData(const wxDataFormat& format,
|
||||||
@@ -279,7 +279,7 @@ bool wxTextDataObject::SetData(const wxDataFormat& format,
|
|||||||
else
|
else
|
||||||
SetText( wxConvLibc.cMB2WX( (const char*) buf ) );
|
SetText( wxConvLibc.cMB2WX( (const char*) buf ) );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif wxUSE_UNICODE && defined(__WXMAC__)
|
#elif wxUSE_UNICODE && defined(__WXMAC__)
|
||||||
@@ -315,7 +315,7 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
|
|||||||
strcpy( (char*) buf, (const char*) buffer );
|
strcpy( (char*) buf, (const char*) buffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextDataObject::SetData(const wxDataFormat& format,
|
bool wxTextDataObject::SetData(const wxDataFormat& format,
|
||||||
@@ -330,7 +330,7 @@ bool wxTextDataObject::SetData(const wxDataFormat& format,
|
|||||||
else
|
else
|
||||||
SetText( wxConvLibc.cMB2WX( (const char*) buf ) );
|
SetText( wxConvLibc.cMB2WX( (const char*) buf ) );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -344,14 +344,14 @@ bool wxTextDataObject::GetDataHere(void *buf) const
|
|||||||
{
|
{
|
||||||
wxStrcpy((wxChar *)buf, GetText().c_str());
|
wxStrcpy((wxChar *)buf, GetText().c_str());
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextDataObject::SetData(size_t WXUNUSED(len), const void *buf)
|
bool wxTextDataObject::SetData(size_t WXUNUSED(len), const void *buf)
|
||||||
{
|
{
|
||||||
SetText(wxString((const wxChar *)buf));
|
SetText(wxString((const wxChar *)buf));
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -447,11 +447,11 @@ bool wxCustomDataObject::GetDataHere(void *buf) const
|
|||||||
{
|
{
|
||||||
void *data = GetData();
|
void *data = GetData();
|
||||||
if ( !data )
|
if ( !data )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
memcpy(buf, data, GetSize());
|
memcpy(buf, data, GetSize());
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxCustomDataObject::SetData(size_t size, const void *buf)
|
bool wxCustomDataObject::SetData(size_t size, const void *buf)
|
||||||
@@ -460,11 +460,11 @@ bool wxCustomDataObject::SetData(size_t size, const void *buf)
|
|||||||
|
|
||||||
m_data = Alloc(size);
|
m_data = Alloc(size);
|
||||||
if ( !m_data )
|
if ( !m_data )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
memcpy(m_data, buf, m_size = size);
|
memcpy(m_data, buf, m_size = size);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@@ -79,7 +79,7 @@ bool wxDocMDIParentFrame::ProcessEvent(wxEvent& event)
|
|||||||
if (!m_docManager || !m_docManager->ProcessEvent(event))
|
if (!m_docManager || !m_docManager->ProcessEvent(event))
|
||||||
return wxEvtHandler::ProcessEvent(event);
|
return wxEvtHandler::ProcessEvent(event);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDocMDIParentFrame::OnCloseWindow(wxCloseEvent& event)
|
void wxDocMDIParentFrame::OnCloseWindow(wxCloseEvent& event)
|
||||||
@@ -131,10 +131,10 @@ bool wxDocMDIChildFrame::Create(wxDocument *doc, wxView *view, wxMDIParentFrame
|
|||||||
{
|
{
|
||||||
if (view)
|
if (view)
|
||||||
view->SetFrame(this);
|
view->SetFrame(this);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDocMDIChildFrame::~wxDocMDIChildFrame(void)
|
wxDocMDIChildFrame::~wxDocMDIChildFrame(void)
|
||||||
@@ -149,7 +149,7 @@ bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event)
|
|||||||
|
|
||||||
// Break recursion loops
|
// Break recursion loops
|
||||||
if (ActiveEvent == &event)
|
if (ActiveEvent == &event)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
ActiveEvent = &event;
|
ActiveEvent = &event;
|
||||||
|
|
||||||
@@ -160,10 +160,10 @@ bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event)
|
|||||||
if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event))
|
if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event))
|
||||||
ret = wxEvtHandler::ProcessEvent(event);
|
ret = wxEvtHandler::ProcessEvent(event);
|
||||||
else
|
else
|
||||||
ret = TRUE;
|
ret = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret = TRUE;
|
ret = true;
|
||||||
|
|
||||||
ActiveEvent = NULL;
|
ActiveEvent = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
@@ -180,16 +180,16 @@ void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event)
|
|||||||
void wxDocMDIChildFrame::OnCloseWindow(wxCloseEvent& event)
|
void wxDocMDIChildFrame::OnCloseWindow(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
// Close view but don't delete the frame while doing so!
|
// Close view but don't delete the frame while doing so!
|
||||||
// ...since it will be deleted by wxWidgets if we return TRUE.
|
// ...since it will be deleted by wxWidgets if we return true.
|
||||||
if (m_childView)
|
if (m_childView)
|
||||||
{
|
{
|
||||||
bool ans = event.CanVeto()
|
bool ans = event.CanVeto()
|
||||||
? m_childView->Close(FALSE) // FALSE means don't delete associated window
|
? m_childView->Close(false) // false means don't delete associated window
|
||||||
: TRUE; // Must delete.
|
: true; // Must delete.
|
||||||
|
|
||||||
if (ans)
|
if (ans)
|
||||||
{
|
{
|
||||||
m_childView->Activate(FALSE);
|
m_childView->Activate(false);
|
||||||
delete m_childView;
|
delete m_childView;
|
||||||
m_childView = (wxView *) NULL;
|
m_childView = (wxView *) NULL;
|
||||||
m_childDocument = (wxDocument *) NULL;
|
m_childDocument = (wxDocument *) NULL;
|
||||||
|
@@ -133,16 +133,16 @@ static wxString FindExtension(const wxChar *path)
|
|||||||
|
|
||||||
wxDocument::wxDocument(wxDocument *parent)
|
wxDocument::wxDocument(wxDocument *parent)
|
||||||
{
|
{
|
||||||
m_documentModified = FALSE;
|
m_documentModified = false;
|
||||||
m_documentParent = parent;
|
m_documentParent = parent;
|
||||||
m_documentTemplate = (wxDocTemplate *) NULL;
|
m_documentTemplate = (wxDocTemplate *) NULL;
|
||||||
m_commandProcessor = (wxCommandProcessor*) NULL;
|
m_commandProcessor = (wxCommandProcessor*) NULL;
|
||||||
m_savedYet = FALSE;
|
m_savedYet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::DeleteContents()
|
bool wxDocument::DeleteContents()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDocument::~wxDocument()
|
wxDocument::~wxDocument()
|
||||||
@@ -166,7 +166,7 @@ bool wxDocument::Close()
|
|||||||
if (OnSaveModified())
|
if (OnSaveModified())
|
||||||
return OnCloseDocument();
|
return OnCloseDocument();
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::OnCloseDocument()
|
bool wxDocument::OnCloseDocument()
|
||||||
@@ -174,8 +174,8 @@ bool wxDocument::OnCloseDocument()
|
|||||||
// Tell all views that we're about to close
|
// Tell all views that we're about to close
|
||||||
NotifyClosing();
|
NotifyClosing();
|
||||||
DeleteContents();
|
DeleteContents();
|
||||||
Modify(FALSE);
|
Modify(false);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note that this implicitly deletes the document when the last view is
|
// Note that this implicitly deletes the document when the last view is
|
||||||
@@ -191,7 +191,7 @@ bool wxDocument::DeleteAllViews()
|
|||||||
{
|
{
|
||||||
wxView *view = (wxView *)*it;
|
wxView *view = (wxView *)*it;
|
||||||
if (!view->Close())
|
if (!view->Close())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
wxList::iterator next = it; ++next;
|
wxList::iterator next = it; ++next;
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ bool wxDocument::DeleteAllViews()
|
|||||||
if (manager && manager->GetDocuments().Member(this))
|
if (manager && manager->GetDocuments().Member(this))
|
||||||
delete this;
|
delete this;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxView *wxDocument::GetFirstView() const
|
wxView *wxDocument::GetFirstView() const
|
||||||
@@ -221,25 +221,25 @@ wxDocManager *wxDocument::GetDocumentManager() const
|
|||||||
bool wxDocument::OnNewDocument()
|
bool wxDocument::OnNewDocument()
|
||||||
{
|
{
|
||||||
if (!OnSaveModified())
|
if (!OnSaveModified())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (OnCloseDocument()==FALSE) return FALSE;
|
if (OnCloseDocument()==false) return false;
|
||||||
DeleteContents();
|
DeleteContents();
|
||||||
Modify(FALSE);
|
Modify(false);
|
||||||
SetDocumentSaved(FALSE);
|
SetDocumentSaved(false);
|
||||||
|
|
||||||
wxString name;
|
wxString name;
|
||||||
GetDocumentManager()->MakeDefaultName(name);
|
GetDocumentManager()->MakeDefaultName(name);
|
||||||
SetTitle(name);
|
SetTitle(name);
|
||||||
SetFilename(name, TRUE);
|
SetFilename(name, true);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::Save()
|
bool wxDocument::Save()
|
||||||
{
|
{
|
||||||
if (!IsModified() && m_savedYet)
|
if (!IsModified() && m_savedYet)
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
if ( m_documentFile.empty() || !m_savedYet )
|
if ( m_documentFile.empty() || !m_savedYet )
|
||||||
return SaveAs();
|
return SaveAs();
|
||||||
@@ -251,7 +251,7 @@ bool wxDocument::SaveAs()
|
|||||||
{
|
{
|
||||||
wxDocTemplate *docTemplate = GetDocumentTemplate();
|
wxDocTemplate *docTemplate = GetDocumentTemplate();
|
||||||
if (!docTemplate)
|
if (!docTemplate)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__)
|
#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__)
|
||||||
wxString filter = docTemplate->GetDescription() + wxT(" (") + docTemplate->GetFileFilter() + wxT(")|") + docTemplate->GetFileFilter();
|
wxString filter = docTemplate->GetDescription() + wxT(" (") + docTemplate->GetFileFilter() + wxT(")|") + docTemplate->GetFileFilter();
|
||||||
@@ -293,7 +293,7 @@ bool wxDocument::SaveAs()
|
|||||||
GetDocumentWindow());
|
GetDocumentWindow());
|
||||||
|
|
||||||
if (tmp.IsEmpty())
|
if (tmp.IsEmpty())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
wxString fileName(tmp);
|
wxString fileName(tmp);
|
||||||
wxString path, name, ext;
|
wxString path, name, ext;
|
||||||
@@ -319,7 +319,7 @@ bool wxDocument::SaveAs()
|
|||||||
|
|
||||||
// Files that were not saved correctly are not added to the FileHistory.
|
// Files that were not saved correctly are not added to the FileHistory.
|
||||||
if (!OnSaveDocument(m_documentFile))
|
if (!OnSaveDocument(m_documentFile))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// A file that doesn't use the default extension of its document template cannot be opened
|
// A file that doesn't use the default extension of its document template cannot be opened
|
||||||
// via the FileHistory, so we do not add it.
|
// via the FileHistory, so we do not add it.
|
||||||
@@ -332,42 +332,42 @@ bool wxDocument::SaveAs()
|
|||||||
// The user will probably not be able to open the file again, so
|
// The user will probably not be able to open the file again, so
|
||||||
// we could warn about the wrong file-extension here.
|
// we could warn about the wrong file-extension here.
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::OnSaveDocument(const wxString& file)
|
bool wxDocument::OnSaveDocument(const wxString& file)
|
||||||
{
|
{
|
||||||
if ( !file )
|
if ( !file )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if ( !DoSaveDocument(file) )
|
if ( !DoSaveDocument(file) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
Modify(FALSE);
|
Modify(false);
|
||||||
SetFilename(file);
|
SetFilename(file);
|
||||||
SetDocumentSaved(TRUE);
|
SetDocumentSaved(true);
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
wxFileName fn(file) ;
|
wxFileName fn(file) ;
|
||||||
fn.MacSetDefaultTypeAndCreator() ;
|
fn.MacSetDefaultTypeAndCreator() ;
|
||||||
#endif
|
#endif
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::OnOpenDocument(const wxString& file)
|
bool wxDocument::OnOpenDocument(const wxString& file)
|
||||||
{
|
{
|
||||||
if (!OnSaveModified())
|
if (!OnSaveModified())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if ( !DoOpenDocument(file) )
|
if ( !DoOpenDocument(file) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
SetFilename(file, TRUE);
|
SetFilename(file, true);
|
||||||
Modify(FALSE);
|
Modify(false);
|
||||||
m_savedYet = TRUE;
|
m_savedYet = true;
|
||||||
|
|
||||||
UpdateAllViews();
|
UpdateAllViews();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_STD_IOSTREAM
|
#if wxUSE_STD_IOSTREAM
|
||||||
@@ -390,7 +390,7 @@ wxOutputStream& wxDocument::SaveObject(wxOutputStream& stream)
|
|||||||
|
|
||||||
bool wxDocument::Revert()
|
bool wxDocument::Revert()
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -400,17 +400,17 @@ bool wxDocument::GetPrintableName(wxString& buf) const
|
|||||||
if (m_documentTitle != wxT(""))
|
if (m_documentTitle != wxT(""))
|
||||||
{
|
{
|
||||||
buf = m_documentTitle;
|
buf = m_documentTitle;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else if (m_documentFile != wxT(""))
|
else if (m_documentFile != wxT(""))
|
||||||
{
|
{
|
||||||
buf = wxFileNameFromPath(m_documentFile);
|
buf = wxFileNameFromPath(m_documentFile);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf = _("unnamed");
|
buf = _("unnamed");
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,7 +428,7 @@ wxCommandProcessor *wxDocument::OnCreateCommandProcessor()
|
|||||||
return new wxCommandProcessor;
|
return new wxCommandProcessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TRUE if safe to close
|
// true if safe to close
|
||||||
bool wxDocument::OnSaveModified()
|
bool wxDocument::OnSaveModified()
|
||||||
{
|
{
|
||||||
if (IsModified())
|
if (IsModified())
|
||||||
@@ -450,20 +450,20 @@ bool wxDocument::OnSaveModified()
|
|||||||
GetDocumentWindow());
|
GetDocumentWindow());
|
||||||
if (res == wxNO)
|
if (res == wxNO)
|
||||||
{
|
{
|
||||||
Modify(FALSE);
|
Modify(false);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else if (res == wxYES)
|
else if (res == wxYES)
|
||||||
return Save();
|
return Save();
|
||||||
else if (res == wxCANCEL)
|
else if (res == wxCANCEL)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::Draw(wxDC& WXUNUSED(context))
|
bool wxDocument::Draw(wxDC& WXUNUSED(context))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::AddView(wxView *view)
|
bool wxDocument::AddView(wxView *view)
|
||||||
@@ -473,22 +473,22 @@ bool wxDocument::AddView(wxView *view)
|
|||||||
m_documentViews.Append(view);
|
m_documentViews.Append(view);
|
||||||
OnChangedViewList();
|
OnChangedViewList();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::RemoveView(wxView *view)
|
bool wxDocument::RemoveView(wxView *view)
|
||||||
{
|
{
|
||||||
(void)m_documentViews.DeleteObject(view);
|
(void)m_documentViews.DeleteObject(view);
|
||||||
OnChangedViewList();
|
OnChangedViewList();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::OnCreate(const wxString& WXUNUSED(path), long flags)
|
bool wxDocument::OnCreate(const wxString& WXUNUSED(path), long flags)
|
||||||
{
|
{
|
||||||
if (GetDocumentTemplate()->CreateView(this, flags))
|
if (GetDocumentTemplate()->CreateView(this, flags))
|
||||||
return TRUE;
|
return true;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called after a view is added or removed.
|
// Called after a view is added or removed.
|
||||||
@@ -563,17 +563,17 @@ bool wxDocument::DoSaveDocument(const wxString& file)
|
|||||||
(void)wxMessageBox(_("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION,
|
(void)wxMessageBox(_("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION,
|
||||||
GetDocumentWindow());
|
GetDocumentWindow());
|
||||||
// Saving error
|
// Saving error
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
if (!SaveObject(store))
|
if (!SaveObject(store))
|
||||||
{
|
{
|
||||||
(void)wxMessageBox(_("Sorry, could not save this file."), msgTitle, wxOK | wxICON_EXCLAMATION,
|
(void)wxMessageBox(_("Sorry, could not save this file."), msgTitle, wxOK | wxICON_EXCLAMATION,
|
||||||
GetDocumentWindow());
|
GetDocumentWindow());
|
||||||
// Saving error
|
// Saving error
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocument::DoOpenDocument(const wxString& file)
|
bool wxDocument::DoOpenDocument(const wxString& file)
|
||||||
@@ -594,7 +594,7 @@ bool wxDocument::DoOpenDocument(const wxString& file)
|
|||||||
{
|
{
|
||||||
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
|
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
|
||||||
GetDocumentWindow());
|
GetDocumentWindow());
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
#if wxUSE_STD_IOSTREAM
|
#if wxUSE_STD_IOSTREAM
|
||||||
LoadObject(store);
|
LoadObject(store);
|
||||||
@@ -607,10 +607,10 @@ bool wxDocument::DoOpenDocument(const wxString& file)
|
|||||||
{
|
{
|
||||||
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
|
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
|
||||||
GetDocumentWindow());
|
GetDocumentWindow());
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -627,7 +627,7 @@ wxView::wxView()
|
|||||||
|
|
||||||
wxView::~wxView()
|
wxView::~wxView()
|
||||||
{
|
{
|
||||||
GetDocumentManager()->ActivateView(this, FALSE);
|
GetDocumentManager()->ActivateView(this, false);
|
||||||
m_viewDocument->RemoveView(this);
|
m_viewDocument->RemoveView(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,7 +637,7 @@ bool wxView::ProcessEvent(wxEvent& event)
|
|||||||
if ( !GetDocument() || !GetDocument()->ProcessEvent(event) )
|
if ( !GetDocument() || !GetDocument()->ProcessEvent(event) )
|
||||||
return wxEvtHandler::ProcessEvent(event);
|
return wxEvtHandler::ProcessEvent(event);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxView::OnActivateView(bool WXUNUSED(activate), wxView *WXUNUSED(activeView), wxView *WXUNUSED(deactiveView))
|
void wxView::OnActivateView(bool WXUNUSED(activate), wxView *WXUNUSED(activeView), wxView *WXUNUSED(deactiveView))
|
||||||
@@ -675,9 +675,9 @@ void wxView::SetDocument(wxDocument *doc)
|
|||||||
bool wxView::Close(bool deleteWindow)
|
bool wxView::Close(bool deleteWindow)
|
||||||
{
|
{
|
||||||
if (OnClose(deleteWindow))
|
if (OnClose(deleteWindow))
|
||||||
return TRUE;
|
return true;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxView::Activate(bool activate)
|
void wxView::Activate(bool activate)
|
||||||
@@ -691,7 +691,7 @@ void wxView::Activate(bool activate)
|
|||||||
|
|
||||||
bool wxView::OnClose(bool WXUNUSED(deleteWindow))
|
bool wxView::OnClose(bool WXUNUSED(deleteWindow))
|
||||||
{
|
{
|
||||||
return GetDocument() ? GetDocument()->Close() : TRUE;
|
return GetDocument() ? GetDocument()->Close() : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_PRINTING_ARCHITECTURE
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
@@ -881,9 +881,9 @@ bool wxDocManager::CloseDocument(wxDocument* doc, bool force)
|
|||||||
if (m_docs.Member(doc))
|
if (m_docs.Member(doc))
|
||||||
delete doc;
|
delete doc;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocManager::CloseDocuments(bool force)
|
bool wxDocManager::CloseDocuments(bool force)
|
||||||
@@ -895,20 +895,20 @@ bool wxDocManager::CloseDocuments(bool force)
|
|||||||
wxList::compatibility_iterator next = node->GetNext();
|
wxList::compatibility_iterator next = node->GetNext();
|
||||||
|
|
||||||
if (!CloseDocument(doc, force))
|
if (!CloseDocument(doc, force))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// This assumes that documents are not connected in
|
// This assumes that documents are not connected in
|
||||||
// any way, i.e. deleting one document does NOT
|
// any way, i.e. deleting one document does NOT
|
||||||
// delete another.
|
// delete another.
|
||||||
node = next;
|
node = next;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocManager::Clear(bool force)
|
bool wxDocManager::Clear(bool force)
|
||||||
{
|
{
|
||||||
if (!CloseDocuments(force))
|
if (!CloseDocuments(force))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
wxList::compatibility_iterator node = m_templates.GetFirst();
|
wxList::compatibility_iterator node = m_templates.GetFirst();
|
||||||
while (node)
|
while (node)
|
||||||
@@ -918,13 +918,13 @@ bool wxDocManager::Clear(bool force)
|
|||||||
delete templ;
|
delete templ;
|
||||||
node = next;
|
node = next;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocManager::Initialize()
|
bool wxDocManager::Initialize()
|
||||||
{
|
{
|
||||||
m_fileHistory = OnCreateFileHistory();
|
m_fileHistory = OnCreateFileHistory();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFileHistory *wxDocManager::OnCreateFileHistory()
|
wxFileHistory *wxDocManager::OnCreateFileHistory()
|
||||||
@@ -947,7 +947,7 @@ void wxDocManager::OnFileClose(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event))
|
void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
CloseDocuments(FALSE);
|
CloseDocuments(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event))
|
void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -998,7 +998,7 @@ void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (printout)
|
if (printout)
|
||||||
{
|
{
|
||||||
wxPrinter printer;
|
wxPrinter printer;
|
||||||
printer.Print(view->GetFrame(), printout, TRUE);
|
printer.Print(view->GetFrame(), printout, true);
|
||||||
|
|
||||||
delete printout;
|
delete printout;
|
||||||
}
|
}
|
||||||
@@ -1016,7 +1016,7 @@ void wxDocManager::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxPrintDialogData data;
|
wxPrintDialogData data;
|
||||||
|
|
||||||
wxPrintDialog printerDialog(parentWin, &data);
|
wxPrintDialog printerDialog(parentWin, &data);
|
||||||
printerDialog.GetPrintDialogData().SetSetupDialog(TRUE);
|
printerDialog.GetPrintDialogData().SetSetupDialog(true);
|
||||||
printerDialog.ShowModal();
|
printerDialog.ShowModal();
|
||||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
}
|
}
|
||||||
@@ -1044,7 +1044,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxPoint(100, 100), wxSize(600, 650));
|
wxPoint(100, 100), wxSize(600, 650));
|
||||||
frame->Centre(wxBOTH);
|
frame->Centre(wxBOTH);
|
||||||
frame->Initialize();
|
frame->Initialize();
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
}
|
}
|
||||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
}
|
}
|
||||||
@@ -1075,7 +1075,7 @@ void wxDocManager::OnRedo(wxCommandEvent& event)
|
|||||||
|
|
||||||
void wxDocManager::OnUpdateFileOpen(wxUpdateUIEvent& event)
|
void wxDocManager::OnUpdateFileOpen(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable( TRUE );
|
event.Enable( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDocManager::OnUpdateFileClose(wxUpdateUIEvent& event)
|
void wxDocManager::OnUpdateFileClose(wxUpdateUIEvent& event)
|
||||||
@@ -1092,7 +1092,7 @@ void wxDocManager::OnUpdateFileRevert(wxUpdateUIEvent& event)
|
|||||||
|
|
||||||
void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event)
|
void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable( TRUE );
|
event.Enable( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event)
|
void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event)
|
||||||
@@ -1111,7 +1111,7 @@ void wxDocManager::OnUpdateUndo(wxUpdateUIEvent& event)
|
|||||||
{
|
{
|
||||||
wxDocument *doc = GetCurrentDocument();
|
wxDocument *doc = GetCurrentDocument();
|
||||||
if (!doc)
|
if (!doc)
|
||||||
event.Enable(FALSE);
|
event.Enable(false);
|
||||||
else if (!doc->GetCommandProcessor())
|
else if (!doc->GetCommandProcessor())
|
||||||
event.Skip();
|
event.Skip();
|
||||||
else
|
else
|
||||||
@@ -1125,7 +1125,7 @@ void wxDocManager::OnUpdateRedo(wxUpdateUIEvent& event)
|
|||||||
{
|
{
|
||||||
wxDocument *doc = GetCurrentDocument();
|
wxDocument *doc = GetCurrentDocument();
|
||||||
if (!doc)
|
if (!doc)
|
||||||
event.Enable(FALSE);
|
event.Enable(false);
|
||||||
else if (!doc->GetCommandProcessor())
|
else if (!doc->GetCommandProcessor())
|
||||||
event.Skip();
|
event.Skip();
|
||||||
else
|
else
|
||||||
@@ -1143,7 +1143,7 @@ void wxDocManager::OnUpdatePrint(wxUpdateUIEvent& event)
|
|||||||
|
|
||||||
void wxDocManager::OnUpdatePrintSetup(wxUpdateUIEvent& event)
|
void wxDocManager::OnUpdatePrintSetup(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable( TRUE );
|
event.Enable( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDocManager::OnUpdatePreview(wxUpdateUIEvent& event)
|
void wxDocManager::OnUpdatePreview(wxUpdateUIEvent& event)
|
||||||
@@ -1171,7 +1171,7 @@ bool wxDocManager::ProcessEvent(wxEvent& event)
|
|||||||
if (view)
|
if (view)
|
||||||
{
|
{
|
||||||
if (view->ProcessEvent(event))
|
if (view->ProcessEvent(event))
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return wxEvtHandler::ProcessEvent(event);
|
return wxEvtHandler::ProcessEvent(event);
|
||||||
}
|
}
|
||||||
@@ -1213,7 +1213,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
|
|||||||
{
|
{
|
||||||
if (docToClose)
|
if (docToClose)
|
||||||
{
|
{
|
||||||
if (!CloseDocument(docToClose, FALSE))
|
if (!CloseDocument(docToClose, false))
|
||||||
{
|
{
|
||||||
delete[] templates;
|
delete[] templates;
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1239,7 +1239,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
|
|||||||
{
|
{
|
||||||
if (docToClose)
|
if (docToClose)
|
||||||
{
|
{
|
||||||
if (!CloseDocument(docToClose, FALSE))
|
if (!CloseDocument(docToClose, false))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1287,7 +1287,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
|
|||||||
{
|
{
|
||||||
if (docToClose)
|
if (docToClose)
|
||||||
{
|
{
|
||||||
if (!CloseDocument(docToClose, FALSE))
|
if (!CloseDocument(docToClose, false))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1369,7 +1369,7 @@ void wxDocManager::DeleteTemplate(wxDocTemplate *WXUNUSED(temp), long WXUNUSED(f
|
|||||||
// Not yet implemented
|
// Not yet implemented
|
||||||
bool wxDocManager::FlushDoc(wxDocument *WXUNUSED(doc))
|
bool wxDocManager::FlushDoc(wxDocument *WXUNUSED(doc))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDocument *wxDocManager::GetCurrentDocument() const
|
wxDocument *wxDocManager::GetCurrentDocument() const
|
||||||
@@ -1387,7 +1387,7 @@ bool wxDocManager::MakeDefaultName(wxString& name)
|
|||||||
name.Printf(_("unnamed%d"), m_defaultDocumentNameCounter);
|
name.Printf(_("unnamed%d"), m_defaultDocumentNameCounter);
|
||||||
m_defaultDocumentNameCounter++;
|
m_defaultDocumentNameCounter++;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make a frame title (override this to do something different)
|
// Make a frame title (override this to do something different)
|
||||||
@@ -1627,14 +1627,14 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
|
|||||||
if (templates[i]->IsVisible())
|
if (templates[i]->IsVisible())
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
bool want = TRUE;
|
bool want = true;
|
||||||
for (j = 0; j < n; j++)
|
for (j = 0; j < n; j++)
|
||||||
{
|
{
|
||||||
//filter out NOT unique documents + view combinations
|
//filter out NOT unique documents + view combinations
|
||||||
if ( templates[i]->m_docTypeName == data[j]->m_docTypeName &&
|
if ( templates[i]->m_docTypeName == data[j]->m_docTypeName &&
|
||||||
templates[i]->m_viewTypeName == data[j]->m_viewTypeName
|
templates[i]->m_viewTypeName == data[j]->m_viewTypeName
|
||||||
)
|
)
|
||||||
want = FALSE;
|
want = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( want )
|
if ( want )
|
||||||
@@ -1709,12 +1709,12 @@ wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates,
|
|||||||
if ( templ->IsVisible() && !templ->GetViewName().empty() )
|
if ( templ->IsVisible() && !templ->GetViewName().empty() )
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
bool want = TRUE;
|
bool want = true;
|
||||||
for (j = 0; j < n; j++)
|
for (j = 0; j < n; j++)
|
||||||
{
|
{
|
||||||
//filter out NOT unique views
|
//filter out NOT unique views
|
||||||
if ( templates[i]->m_viewTypeName == data[j]->m_viewTypeName )
|
if ( templates[i]->m_viewTypeName == data[j]->m_viewTypeName )
|
||||||
want = FALSE;
|
want = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( want )
|
if ( want )
|
||||||
@@ -1847,7 +1847,7 @@ wxDocChildFrame::~wxDocChildFrame()
|
|||||||
bool wxDocChildFrame::ProcessEvent(wxEvent& event)
|
bool wxDocChildFrame::ProcessEvent(wxEvent& event)
|
||||||
{
|
{
|
||||||
if (m_childView)
|
if (m_childView)
|
||||||
m_childView->Activate(TRUE);
|
m_childView->Activate(true);
|
||||||
|
|
||||||
if ( !m_childView || ! m_childView->ProcessEvent(event) )
|
if ( !m_childView || ! m_childView->ProcessEvent(event) )
|
||||||
{
|
{
|
||||||
@@ -1855,10 +1855,10 @@ bool wxDocChildFrame::ProcessEvent(wxEvent& event)
|
|||||||
if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event))
|
if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event))
|
||||||
return wxEvtHandler::ProcessEvent(event);
|
return wxEvtHandler::ProcessEvent(event);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDocChildFrame::OnActivate(wxActivateEvent& event)
|
void wxDocChildFrame::OnActivate(wxActivateEvent& event)
|
||||||
@@ -1874,12 +1874,12 @@ void wxDocChildFrame::OnCloseWindow(wxCloseEvent& event)
|
|||||||
if (m_childView)
|
if (m_childView)
|
||||||
{
|
{
|
||||||
bool ans = event.CanVeto()
|
bool ans = event.CanVeto()
|
||||||
? m_childView->Close(FALSE) // FALSE means don't delete associated window
|
? m_childView->Close(false) // false means don't delete associated window
|
||||||
: TRUE; // Must delete.
|
: true; // Must delete.
|
||||||
|
|
||||||
if (ans)
|
if (ans)
|
||||||
{
|
{
|
||||||
m_childView->Activate(FALSE);
|
m_childView->Activate(false);
|
||||||
delete m_childView;
|
delete m_childView;
|
||||||
m_childView = (wxView *) NULL;
|
m_childView = (wxView *) NULL;
|
||||||
m_childDocument = (wxDocument *) NULL;
|
m_childDocument = (wxDocument *) NULL;
|
||||||
@@ -1959,7 +1959,7 @@ bool wxDocParentFrame::ProcessEvent(wxEvent& event)
|
|||||||
if (!m_docManager || !m_docManager->ProcessEvent(event))
|
if (!m_docManager || !m_docManager->ProcessEvent(event))
|
||||||
return wxEvtHandler::ProcessEvent(event);
|
return wxEvtHandler::ProcessEvent(event);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define the behaviour for the frame closing
|
// Define the behaviour for the frame closing
|
||||||
@@ -2018,7 +2018,7 @@ bool wxDocPrintout::OnPrintPage(int WXUNUSED(page))
|
|||||||
{
|
{
|
||||||
m_printoutView->OnDraw(dc);
|
m_printoutView->OnDraw(dc);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDocPrintout::HasPage(int pageNum)
|
bool wxDocPrintout::HasPage(int pageNum)
|
||||||
@@ -2029,9 +2029,9 @@ bool wxDocPrintout::HasPage(int pageNum)
|
|||||||
bool wxDocPrintout::OnBeginDocument(int startPage, int endPage)
|
bool wxDocPrintout::OnBeginDocument(int startPage, int endPage)
|
||||||
{
|
{
|
||||||
if (!wxPrintout::OnBeginDocument(startPage, endPage))
|
if (!wxPrintout::OnBeginDocument(startPage, endPage))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDocPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
|
void wxDocPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
|
||||||
@@ -2343,7 +2343,7 @@ bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream)
|
|||||||
{
|
{
|
||||||
wxFFile file(filename, _T("rb"));
|
wxFFile file(filename, _T("rb"));
|
||||||
if ( !file.IsOpened() )
|
if ( !file.IsOpened() )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
@@ -2352,22 +2352,22 @@ bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream)
|
|||||||
{
|
{
|
||||||
nRead = file.Read(buf, WXSIZEOF(buf));
|
nRead = file.Read(buf, WXSIZEOF(buf));
|
||||||
if ( file.Error() )
|
if ( file.Error() )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
stream.write(buf, nRead);
|
stream.write(buf, nRead);
|
||||||
if ( !stream )
|
if ( !stream )
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
while ( !file.Eof() );
|
while ( !file.Eof() );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename)
|
bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename)
|
||||||
{
|
{
|
||||||
wxFFile file(filename, _T("wb"));
|
wxFFile file(filename, _T("wb"));
|
||||||
if ( !file.IsOpened() )
|
if ( !file.IsOpened() )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
do
|
do
|
||||||
@@ -2376,12 +2376,12 @@ bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename)
|
|||||||
if ( !stream.bad() ) // fail may be set on EOF, don't use operator!()
|
if ( !stream.bad() ) // fail may be set on EOF, don't use operator!()
|
||||||
{
|
{
|
||||||
if ( !file.Write(buf, stream.gcount()) )
|
if ( !file.Write(buf, stream.gcount()) )
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ( !stream.eof() );
|
while ( !stream.eof() );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !wxUSE_STD_IOSTREAM
|
#else // !wxUSE_STD_IOSTREAM
|
||||||
@@ -2390,7 +2390,7 @@ bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream)
|
|||||||
{
|
{
|
||||||
wxFFile file(filename, _T("rb"));
|
wxFFile file(filename, _T("rb"));
|
||||||
if ( !file.IsOpened() )
|
if ( !file.IsOpened() )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
@@ -2399,22 +2399,22 @@ bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream)
|
|||||||
{
|
{
|
||||||
nRead = file.Read(buf, WXSIZEOF(buf));
|
nRead = file.Read(buf, WXSIZEOF(buf));
|
||||||
if ( file.Error() )
|
if ( file.Error() )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
stream.Write(buf, nRead);
|
stream.Write(buf, nRead);
|
||||||
if ( !stream )
|
if ( !stream )
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
while ( !file.Eof() );
|
while ( !file.Eof() );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
|
bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
|
||||||
{
|
{
|
||||||
wxFFile file(filename, _T("wb"));
|
wxFFile file(filename, _T("wb"));
|
||||||
if ( !file.IsOpened() )
|
if ( !file.IsOpened() )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
do
|
do
|
||||||
@@ -2423,11 +2423,11 @@ bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
|
|||||||
|
|
||||||
const size_t nRead = stream.LastRead();
|
const size_t nRead = stream.LastRead();
|
||||||
if ( !nRead || !file.Write(buf, nRead) )
|
if ( !nRead || !file.Write(buf, nRead) )
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
while ( !stream.Eof() );
|
while ( !stream.Eof() );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_STD_IOSTREAM/!wxUSE_STD_IOSTREAM
|
#endif // wxUSE_STD_IOSTREAM/!wxUSE_STD_IOSTREAM
|
||||||
|
@@ -326,7 +326,7 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const
|
|||||||
wxCHECK_MSG( IsLoaded(), NULL,
|
wxCHECK_MSG( IsLoaded(), NULL,
|
||||||
_T("Can't load symbol from unloaded library") );
|
_T("Can't load symbol from unloaded library") );
|
||||||
|
|
||||||
bool failed = FALSE;
|
bool failed = false;
|
||||||
void *symbol = 0;
|
void *symbol = 0;
|
||||||
|
|
||||||
wxUnusedVar(symbol);
|
wxUnusedVar(symbol);
|
||||||
@@ -383,7 +383,7 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const
|
|||||||
wxLogError(wxT("%s"), err);
|
wxLogError(wxT("%s"), err);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
failed = TRUE;
|
failed = true;
|
||||||
wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"),
|
wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"),
|
||||||
name.c_str());
|
name.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
@@ -60,7 +60,7 @@ public:
|
|||||||
{
|
{
|
||||||
wxPluginLibrary::ms_classes = new wxDLImports;
|
wxPluginLibrary::ms_classes = new wxDLImports;
|
||||||
wxPluginManager::CreateManifest();
|
wxPluginManager::CreateManifest();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnExit()
|
virtual void OnExit()
|
||||||
@@ -123,10 +123,10 @@ bool wxPluginLibrary::UnrefLib()
|
|||||||
if ( m_linkcount == 0 || --m_linkcount == 0 )
|
if ( m_linkcount == 0 || --m_linkcount == 0 )
|
||||||
{
|
{
|
||||||
delete this;
|
delete this;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
@@ -316,7 +316,7 @@ bool wxPluginManager::UnloadLibrary(const wxString& libname)
|
|||||||
wxLogDebug(_T("Attempt to unload library '%s' which is not loaded."),
|
wxLogDebug(_T("Attempt to unload library '%s' which is not loaded."),
|
||||||
libname.c_str());
|
libname.c_str());
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogTrace(_T("dll"), _T("UnloadLibrary(%s)"), realname.c_str());
|
wxLogTrace(_T("dll"), _T("UnloadLibrary(%s)"), realname.c_str());
|
||||||
@@ -324,12 +324,12 @@ bool wxPluginManager::UnloadLibrary(const wxString& libname)
|
|||||||
if ( !entry->UnrefLib() )
|
if ( !entry->UnrefLib() )
|
||||||
{
|
{
|
||||||
// not really unloaded yet
|
// not really unloaded yet
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ms_manifest->erase(ms_manifest->find(realname));
|
ms_manifest->erase(ms_manifest->find(realname));
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
@@ -420,7 +420,7 @@ wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *success)
|
|||||||
wxFAIL_MSG( _T("Using a library not loaded with wxDllLoader?") );
|
wxFAIL_MSG( _T("Using a library not loaded with wxDllLoader?") );
|
||||||
|
|
||||||
if ( success )
|
if ( success )
|
||||||
*success = FALSE;
|
*success = false;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -551,7 +551,7 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name)
|
|||||||
|
|
||||||
wxString libname = ConstructLibraryName(name);
|
wxString libname = ConstructLibraryName(name);
|
||||||
|
|
||||||
bool success = FALSE;
|
bool success = false;
|
||||||
wxDllType handle = wxDllLoader::LoadLibrary(libname, &success);
|
wxDllType handle = wxDllLoader::LoadLibrary(libname, &success);
|
||||||
if(success)
|
if(success)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user