// #pragma implementation
#endif
-#include "wx/wx.h"
-#include "wx/image.h"
-#include "wx/notebook.h"
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#include <math.h>
+
+#ifndef WX_PRECOMP
+
#include "wx/splitter.h"
-#include "wx/wfstream.h"
#include "wx/datstrm.h"
#include "wx/file.h"
#include "wx/listctrl.h"
-#include "wx/tokenzr.h"
#include "wx/process.h"
-#include "wx/mimetype.h"
#include "wx/variant.h"
-#include "wx/cshelp.h"
#include "wx/cmdline.h"
-#include "wx/imaglist.h"
-
-#include <math.h>
+#include "wx/msgdlg.h"
+#include "wx/log.h"
+#include "wx/sizer.h"
+#include "wx/icon.h"
-#ifdef __WXMSW__
-#include <windows.h>
-#include "wx/msw/winundef.h"
#endif
+#include "wx/wfstream.h"
+#include "wx/cshelp.h"
+#include "wx/image.h"
+#include "wx/imaglist.h"
+#include "wx/tokenzr.h"
+#include "wx/notebook.h"
+#include "wx/mimetype.h"
#include "utils.h"
// Returns the image type, or -1, determined from the extension.
// Convert 6-digit hex string to a colour
wxColour apHexStringToColour(const wxString& hex)
{
- unsigned int r = wxHexToDec(hex.Mid(0, 2));
- unsigned int g = wxHexToDec(hex.Mid(2, 2));
- unsigned int b = wxHexToDec(hex.Mid(4, 2));
+ unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2));
+ unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2));
+ unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}
pointSize = 8;
if (pointSize == 9)
pointSize = 10;
-#endif
+#endif
}
else if (i == 1)
family = StringToInt(token);
#if defined(__WXMAC__) && !defined(__DARWIN__)
dir = wxMacFindFolder( (short) kOnSystemDisk, kTemporaryFolderType, kCreateFolder ) ;
#else // !Mac
- dir = wxGetenv(_T("TMP"));
+ wxString dirEnv(wxGetenv(_T("TMP")));
+ dir = dirEnv;
if ( dir.empty() )
{
- dir = wxGetenv(_T("TEMP"));
+ wxString envVar(wxGetenv(_T("TEMP")));
+ dir = envVar;
}
-
+
if ( dir.empty() )
{
// default
wxString apFindAppPath(const wxString& argv0, const wxString& cwd, const wxString& appVariableName)
{
- wxString str;
-
// Try appVariableName
if (!appVariableName.IsEmpty())
{
- str = wxGetenv(appVariableName);
- if (!str.IsEmpty())
- return str;
+ wxString strVar(wxGetenv(appVariableName.c_str()));
+ if (!strVar.IsEmpty())
+ return strVar;
}
if (wxIsAbsolutePath(argv0))
if (currentDir.Last() != wxFILE_SEP_PATH)
currentDir += wxFILE_SEP_PATH;
- str = currentDir + argv0;
- if (wxFileExists(str))
- return wxPathOnly(str);
+ currentDir += argv0;
+ if (wxFileExists(currentDir))
+ return wxPathOnly(currentDir);
}
// OK, it's neither an absolute path nor a relative path.
wxPathList pathList;
pathList.AddEnvList(wxT("PATH"));
- str = pathList.FindAbsoluteValidPath(argv0);
- if (!str.IsEmpty())
- return wxPathOnly(str);
+ wxString strPath = pathList.FindAbsoluteValidPath(argv0);
+ if (!strPath.IsEmpty())
+ return wxPathOnly(strPath);
// Failed
return wxEmptyString;
}
// Adds a context-sensitive help button, for non-Windows platforms
-void apAddContextHelpButton(wxWindow*
+void apAddContextHelpButton(wxWindow*
#if defined(__WXGTK__) || defined(__WXMAC__)
parent
#else
WXUNUSED(parent)
#endif
- , wxSizer*
+ , wxSizer*
#if defined(__WXGTK__) || defined(__WXMAC__)
sizer
#else
WXUNUSED(sizer)
#endif
- , int
+ , int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerFlags
#else
WXUNUSED(sizerFlags)
#endif
- , int
+ , int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerBorder
#else
{
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
wxASSERT ( state < m_maxStates );
-
+
return m_states[state * 2 + (enabled ? 0 : 1)];
}
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
if (state+1 > m_maxStates)
m_maxStates = state+1;
-
+
m_states[state * 2 + (enabled ? 0 : 1)] = iconId;
}
wxIconTable::wxIconTable(wxImageList* imageList)
{
m_imageList = imageList;
- DeleteContents(true);
+ WX_CLEAR_LIST(wxIconTable,*this);
}
void wxIconTable::AppendInfo(wxIconInfo* info)
bool wxIconTable::AddInfo(const wxString& name, const wxIcon& icon, int state, bool enabled)
{
wxASSERT (m_imageList != NULL);
-
+
wxIconInfo* info = FindInfo(name);
if (!info)
{
wxIconInfo* wxIconTable::FindInfo(const wxString& name) const
{
- wxNode* node = GetFirst();
+ wxObjectList::compatibility_iterator node = GetFirst();
while (node)
{
wxIconInfo* info = (wxIconInfo*) node->GetData();