#define wxCRT_Lstat wxCRT_Stat
#endif
-inline int wxStat(const wxString& path, wxStructStat *buf)
- { return wxCRT_Stat(path.fn_str(), buf); }
-inline int wxLstat(const wxString& path, wxStructStat *buf)
- { return wxCRT_Lstat(path.fn_str(), buf); }
inline int wxAccess(const wxString& path, mode_t mode)
{ return wxCRT_Access(path.fn_str(), mode); }
inline int wxOpen(const wxString& path, int flags, mode_t mode)
{ return wxCRT_Open(path.fn_str(), flags, mode); }
+
+// FIXME-CE: provide our own implementations of the missing CRT functions
+#ifndef __WXWINCE__
+inline int wxStat(const wxString& path, wxStructStat *buf)
+ { return wxCRT_Stat(path.fn_str(), buf); }
+inline int wxLstat(const wxString& path, wxStructStat *buf)
+ { return wxCRT_Lstat(path.fn_str(), buf); }
inline int wxRmDir(const wxString& path)
{ return wxCRT_RmDir(path.fn_str()); }
#ifdef __WINDOWS__
inline int wxMkDir(const wxString& path, mode_t mode)
{ return wxCRT_MkDir(path.fn_str(), mode); }
#endif
+#endif // !__WXWINCE__
#ifdef O_BINARY
#define wxO_BINARY O_BINARY
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
- // override base class virtuals
- virtual void DoDeleteOneItem(unsigned int n);
-
// items may be checked
virtual bool IsChecked(unsigned int uiIndex) const;
virtual void Check(unsigned int uiIndex, bool bCheck = true);
// public interface derived from wxListBox and lower classes
- virtual void Clear();
+ virtual void DoClear();
+ virtual void DoDeleteOneItem(unsigned int n);
virtual unsigned int GetCount() const;
virtual int GetSelection() const;
virtual int GetSelections(wxArrayInt& aSelections) const;
#ifndef _WX_MSW_WINCE_CHKCONF_H_
#define _WX_MSW_WINCE_CHKCONF_H_
-// Standard SDK lacks a few things, forcefully disable them
-#ifdef WCE_PLATFORM_STANDARDSDK
- // no shell functions support
- #undef wxUSE_STDPATHS
- #define wxUSE_STDPATHS 0
-#endif // WCE_PLATFORM_STANDARDSDK
+// ----------------------------------------------------------------------------
+// Disable features which don't work or don't make sense under CE
+// ----------------------------------------------------------------------------
+
+// please keep the list in alphabetic order except for closely related settings
+// (e.g. wxUSE_ENH_METAFILE is put immediately after wxUSE_METAFILE)
+
+#undef wxUSE_DEBUGREPORT
+#define wxUSE_DEBUGREPORT 0
#if _WIN32_WCE < 400
// not enough API and lack of ddraw.h
#define wxUSE_DISPLAY 0
#endif
+// wxFSVolume currently doesn't compile under CE and it's not clear if it makes
+// sense at all there (the drives and their names are fixed on CE systems)
+#undef wxUSE_FSVOLUME
+#define wxUSE_FSVOLUME 0
+
+// no .INI files API under CE
+#undef wxUSE_INICONF
+#define wxUSE_INICONF 0
+
// DDE doesn't exist under WinCE and wxIPC is DDE-based under MSW
#undef wxUSE_IPC
#define wxUSE_IPC 0
+// and they're disabled for WinCE in build/bakefiles/{tiff|regex}.bkl so can't
+// be enabled here
+#undef wxUSE_LIBTIFF
+#define wxUSE_LIBTIFF 0
+
+// no MDI under CE
+#undef wxUSE_MDI
+#define wxUSE_MDI 0
+#undef wxUSE_MDI_ARCHITECTURE
+#define wxUSE_MDI_ARCHITECTURE 0
+
// metafiles are not supported neither
+#undef wxUSE_METAFILE
+#define wxUSE_METAFILE 0
#undef wxUSE_ENH_METAFILE
#define wxUSE_ENH_METAFILE 0
-#undef wxUSE_METAFILE
-#define wxUSE_METAFILE 0
+// not sure if this is supported by CE but it doesn't compile currently anyhow
+#undef wxUSE_MS_HTML_HELP
+#define wxUSE_MS_HTML_HELP 0
// eVC doesn't support SEH
#undef wxUSE_ON_FATAL_EXCEPTION
#define wxUSE_ON_FATAL_EXCEPTION 0
-#undef wxUSE_WXHTML_HELP
-#define wxUSE_WXHTML_HELP 0
+// no owner drawn controls (not sure if this is possible at all but in any case
+// the code doesn't currently compile)
+#undef wxUSE_OWNER_DRAWN
+#define wxUSE_OWNER_DRAWN 0
// libtiff and regex apparently don't compile with eVC (to check with eVC4?)
-// and they're disabled for WinCE in build/bakefiles/{tiff|regex}.bkl so can't
-// be enabled here
-#undef wxUSE_LIBTIFF
-#define wxUSE_LIBTIFF 0
+// other MSW settings not supported by CE
+#undef wxUSE_PRINTING_ARCHITECTURE
+#define wxUSE_PRINTING_ARCHITECTURE 0
#undef wxUSE_REGEX
#define wxUSE_REGEX 0
-#undef wxUSE_DEBUGREPORT
-#define wxUSE_DEBUGREPORT 0
-
-// other MSW settings not supported by CE
#undef wxUSE_RICHEDIT
#define wxUSE_RICHEDIT 0
#undef wxUSE_RICHEDIT2
#define wxUSE_RICHEDIT2 0
-#undef wxUSE_UXTHEME
-#define wxUSE_UXTHEME 0
+// Standard SDK lacks a few things, forcefully disable them
+#ifdef WCE_PLATFORM_STANDARDSDK
+ // no shell functions support
+ #undef wxUSE_STDPATHS
+ #define wxUSE_STDPATHS 0
+#endif // WCE_PLATFORM_STANDARDSDK
+
+// not sure if this is supported by eVC but VC8 SDK lacks the tooltips control
+// related declarations
+#if defined(__VISUALC__) && __VISUALC__ >= 1400
+ #undef wxUSE_TOOLTIPS
+ #define wxUSE_TOOLTIPS 0
+#endif
#undef wxUSE_UNICODE_MSLU
#define wxUSE_UNICODE_MSLU 0
+#undef wxUSE_UXTHEME
+#define wxUSE_UXTHEME 0
+
+#undef wxUSE_WXHTML_HELP
+#define wxUSE_WXHTML_HELP 0
+
+
// Disable features which don't make sense for MS Smartphones
// (due to pointer device usage, limited controls or dialogs, file system)
#if defined(__SMARTPHONE__)
wxObject *clientData,
const wxString& shortHelp,
const wxString& longHelp);
- virtual wxToolBarToolBase *CreateTool(wxControl *control);
+ virtual wxToolBarToolBase *CreateTool(wxControl *control,
+ const wxString& label);
// The menubar associated with this toolbar
wxMenuBar* m_menuBar;
# define wxONLY_WATCOM_EARLIER_THAN(major,minor) ( __WATCOMC__ < wxWATCOM_VERSION(major,minor) )
#endif
-/*
- check the consistency of the settings in setup.h: note that this must be
- done after setting wxUSE_UNICODE correctly as it is used in wx/chkconf.h
- */
-#include "wx/chkconf.h"
-
-
-/*
- some compilers don't support iostream.h any longer, while some of theme
- are not updated with <iostream> yet, so override the users setting here
- in such case.
- */
-#if defined(_MSC_VER) && (_MSC_VER >= 1310)
-# undef wxUSE_IOSTREAMH
-# define wxUSE_IOSTREAMH 0
-#elif defined(__DMC__) || defined(__WATCOMC__)
-# undef wxUSE_IOSTREAMH
-# define wxUSE_IOSTREAMH 1
-#elif defined(__MINGW32__)
-# undef wxUSE_IOSTREAMH
-# define wxUSE_IOSTREAMH 0
-#endif /* compilers with/without iostream.h */
-
-/*
- old C++ headers (like <iostream.h>) declare classes in the global namespace
- while the new, standard ones (like <iostream>) do it in std:: namespace,
- unless it's an old gcc version.
-
- using this macro allows constuctions like "wxSTD iostream" to work in
- either case
- */
-#if !wxUSE_IOSTREAMH && (!defined(__GNUC__) || ( __GNUC__ > 2 ) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
-# define wxSTD std::
-#else
-# define wxSTD
-#endif
-
/*
OS: first of all, test for MS-DOS platform. We must do this before testing
for Unix, because DJGPP compiler defines __unix__ under MS-DOS
# endif
#endif
+/*
+ check the consistency of the settings in setup.h: note that this must be
+ done after setting wxUSE_UNICODE correctly as it is used in wx/chkconf.h
+ and after defining the compiler macros which are used in it too
+ */
+#include "wx/chkconf.h"
+
+
+/*
+ some compilers don't support iostream.h any longer, while some of theme
+ are not updated with <iostream> yet, so override the users setting here
+ in such case.
+ */
+#if defined(_MSC_VER) && (_MSC_VER >= 1310)
+# undef wxUSE_IOSTREAMH
+# define wxUSE_IOSTREAMH 0
+#elif defined(__DMC__) || defined(__WATCOMC__)
+# undef wxUSE_IOSTREAMH
+# define wxUSE_IOSTREAMH 1
+#elif defined(__MINGW32__)
+# undef wxUSE_IOSTREAMH
+# define wxUSE_IOSTREAMH 0
+#endif /* compilers with/without iostream.h */
+
+/*
+ old C++ headers (like <iostream.h>) declare classes in the global namespace
+ while the new, standard ones (like <iostream>) do it in std:: namespace,
+ unless it's an old gcc version.
+
+ using this macro allows constuctions like "wxSTD iostream" to work in
+ either case
+ */
+#if !wxUSE_IOSTREAMH && (!defined(__GNUC__) || ( __GNUC__ > 2 ) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
+# define wxSTD std::
+#else
+# define wxSTD
+#endif
+
/* Choose which method we will use for updating menus
* - in OnIdle, or when we receive a wxEVT_MENU_OPEN event.
* Presently, only Windows and GTK+ support wxEVT_MENU_OPEN.
{ return s1.CmpNoCase(s2); }
WX_STRCMP_FUNC(wxStricmp, wxCRT_StricmpA, wxCRT_StricmpW, wxStricmp_String)
+#if defined(wxCRT_StrcollA) && defined(wxCRT_StrcollW)
// GCC 3.3 and other compilers have a bug that causes it to fail compilation if
// the template's implementation uses overloaded function declared later (see
WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String)
#endif
+#endif // defined(wxCRT_Strcoll[AW])
template<typename T>
inline int wxStrspn_String(const wxString& s1, const T& s2)
#undef WX_STR_FUNC
#undef WX_STR_FUNC_NO_INVERT
+#if defined(wxCRT_StrxfrmA) && defined(wxCRT_StrxfrmW)
+
inline size_t wxStrxfrm(char *dest, const char *src, size_t n)
{ return wxCRT_StrxfrmA(dest, src, n); }
inline size_t wxStrxfrm(wchar_t *dest, const wchar_t *src, size_t n)
inline size_t wxStrxfrm(wchar_t *dest, const wxCStrData& src, size_t n)
{ return wxCRT_StrxfrmW(dest, src.AsWCharBuf(), n); }
+#endif // defined(wxCRT_Strxfrm[AW])
+
inline char *wxStrtok(char *str, const char *delim, char **saveptr)
{ return wxCRT_StrtokA(str, delim, saveptr); }
inline wchar_t *wxStrtok(wchar_t *str, const wchar_t *delim, wchar_t **saveptr)
#undef WX_STRTOX_FUNC
+// there is no command interpreter under CE, hence no system()
+#ifndef __WXWINCE__
+
// mingw32 doesn't provide _tsystem() even though it provides other stdlib.h
// functions in their wide versions
#ifdef wxCRT_SystemW
inline int wxSystem(const wxString& str) { return wxCRT_SystemA(str.mb_str()); }
#endif
+#endif // !__WXWINCE__/__WXWINCE__
+
inline char* wxGetenv(const char *name) { return wxCRT_GetenvA(name); }
inline wchar_t* wxGetenv(const wchar_t *name) { return wxCRT_GetenvW(name); }
inline char* wxGetenv(const wxString& name) { return wxCRT_GetenvA(name.mb_str()); }
inline char* wxGetenv(const wxCharBuffer& name) { return wxCRT_GetenvA(name.data()); }
inline wchar_t* wxGetenv(const wxWCharBuffer& name) { return wxCRT_GetenvW(name.data()); }
-
// ----------------------------------------------------------------------------
// time.h functions
// ----------------------------------------------------------------------------
#include <wctype.h>
#include <time.h>
-#ifdef __WINDOWS__
-#include <io.h>
+#if defined(__WINDOWS__) && !defined(__WXWINCE__)
+ #include <io.h>
#endif
#if defined(HAVE_STRTOK_R) && defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
#define wxCRT_StrcatA strcat
#define wxCRT_StrchrA strchr
#define wxCRT_StrcmpA strcmp
-#define wxCRT_StrcollA strcoll
#define wxCRT_StrcpyA strcpy
#define wxCRT_StrcspnA strcspn
#define wxCRT_StrlenA strlen
#define wxCRT_StrrchrA strrchr
#define wxCRT_StrspnA strspn
#define wxCRT_StrstrA strstr
-#define wxCRT_StrxfrmA strxfrm
#define wxCRT_StrcatW wcscat
#define wxCRT_StrchrW wcschr
#define wxCRT_StrcmpW wcscmp
-#define wxCRT_StrcollW wcscoll
#define wxCRT_StrcpyW wcscpy
#define wxCRT_StrcspnW wcscspn
#define wxCRT_StrncatW wcsncat
#define wxCRT_StrrchrW wcsrchr
#define wxCRT_StrspnW wcsspn
#define wxCRT_StrstrW wcsstr
-#define wxCRT_StrxfrmW wcsxfrm
+
+/* these functions are not defined under CE, at least in VC8 CRT */
+#ifndef __WXWINCE__
+ #define wxCRT_StrcollA strcoll
+ #define wxCRT_StrxfrmA strxfrm
+
+ #define wxCRT_StrcollW wcscoll
+ #define wxCRT_StrxfrmW wcsxfrm
+#endif /* __WXWINCE__ */
/* Almost all compiler have strdup(), but not quite all: CodeWarrior under
Mac and VC++ for Windows CE don't provide it; additionally, gcc under
#define wxCRT_Rename rename
#else /* Unicode filenames */
-
/* special case: these functions are missing under Win9x with Unicows so we
have to implement them ourselves */
#if wxUSE_UNICODE_MSLU
#define wxCRT_Remove wxMSLU__wremove
#define wxCRT_Rename wxMSLU__wrename
#else
- #define wxCRT_Rename _wrename
- #define wxCRT_Fopen _wfopen
- #define wxCRT_Freopen _wfreopen
+ /* WinCE CRT doesn't provide these functions so use our own */
#ifdef __WXWINCE__
- /* carefully: wxCRT_Remove() must return 0 on success while
- DeleteFile() returns 0 on error, so don't just define one as
- the other */
- int wxCRT_Remove(const wchar_t *path);
+ WXDLLIMPEXP_BASE int wxCRT_Rename(const wchar_t *src,
+ const wchar_t *dst);
+ WXDLLIMPEXP_BASE int wxCRT_Remove(const wchar_t *path);
#else
+ #define wxCRT_Rename _wrename
#define wxCRT_Remove _wremove
#endif
+ #define wxCRT_Fopen _wfopen
+ #define wxCRT_Freopen _wfreopen
#endif
#endif /* wxMBFILES/!wxMBFILES */
*/
#define wxTmpnam(x) wxTmpnam_is_insecure_use_wxTempFile_instead
+/* FIXME-CE: provide our own perror() using ::GetLastError() */
+#ifndef __WXWINCE__
+
#define wxCRT_PerrorA perror
#ifdef wxHAVE_TCHAR_SUPPORT
#define wxCRT_PerrorW _wperror
#endif
+#endif /* !__WXWINCE__ */
+
/* -------------------------------------------------------------------------
stdlib.h
------------------------------------------------------------------------- */
/* there are no env vars at all under CE, so no _tgetenv neither */
#ifdef __WXWINCE__
/* can't define as inline function as this is a C file... */
- #define wxCRT_GetenvA(name) ((char*)NULL)
- #define wxCRT_GetenvW(name) ((wchar_t*)NULL)
+ #define wxCRT_GetenvA(name) (name, NULL)
+ #define wxCRT_GetenvW(name) (name, NULL)
#else
#define wxCRT_GetenvA getenv
#ifdef _tgetenv
#if wxUSE_INTL
void wxAppTraitsBase::SetLocale()
{
- setlocale(LC_ALL, "");
+ wxSetlocale(LC_ALL, "");
wxUpdateLocaleIsUtf8();
}
#endif
{
if (charset)
{
- m_name = strdup(charset);
+ m_name = wxStrdup(charset);
m_deferred = true;
}
}
char* wxSetlocale(int category, const char *locale)
{
+#ifdef __WXWINCE__
+ // FIXME-CE: there is no setlocale() in CE CRT, use SetThreadLocale()?
+ wxUnusedVar(category);
+ wxUnusedVar(locale);
+
+ return NULL;
+#else // !__WXWINCE__
char *rv = setlocale(category, locale);
if ( locale != NULL /* setting locale, not querying */ &&
rv /* call was successful */ )
wxUpdateLocaleIsUtf8();
}
return rv;
+#endif // __WXWINCE__/!__WXWINCE__
}
// ============================================================================
#endif // __WXWINCE__ <= 211
-#ifdef __WXWINCE__
-int wxCRT_RemoveW(const wchar_t *path)
-{
- return ::DeleteFile(path) == 0;
-}
-#endif
-
-
-
// ============================================================================
// wxLocaleIsUtf8
// ============================================================================
#endif
}
+#ifdef wxCRT_PerrorA
+
void wxPerror(const wxString& s)
{
#ifdef wxCRT_PerrorW
#endif
}
+#endif // wxCRT_PerrorA
+
wchar_t *wxFgets(wchar_t *s, int size, FILE *stream)
{
wxCHECK_MSG( s, NULL, "empty buffer passed to wxFgets()" );
#ifdef __WXWINCE__
wxString tmp = GetAppName();
tmp += wxT("ClassName");
- wxCanvasClassName = wxStrdup( tmp.c_str() );
+ wxCanvasClassName = wxStrdup( tmp.wc_str() );
tmp += wxT("NR");
- wxCanvasClassNameNR = wxStrdup( tmp.c_str() );
+ wxCanvasClassNameNR = wxStrdup( tmp.wc_str() );
HWND hWnd = FindWindow( wxCanvasClassNameNR, NULL );
if (hWnd)
{
return true;
#else // __WXMICROWIN__ || __WXWINCE__
wxUnusedVar(icon);
+ wxUnusedVar(transp);
+
return false;
#endif // !__WXWINCE__/__WXWINCE__
}
const wxRect& rectButton = m_btnArea;
wxRect rectTextField = m_tcArea;
- const bool isEnabled = IsEnabled();
wxColour bgCol = GetBackgroundColour();
+#if wxUSE_UXTHEME
+ const bool isEnabled = IsEnabled();
+
HDC hDc = GetHdcOf(dc);
HWND hWnd = GetHwndOf(this);
-#if wxUSE_UXTHEME
wxUxThemeEngine* theme = NULL;
wxUxThemeHandle hTheme(this, L"COMBOBOX");
if ( hTheme )
theme = wxUxThemeEngine::GetIfActive();
-#endif
+#endif // wxUSE_UXTHEME
wxRect borderRect(0,0,sz.x,sz.y);
}
// Windows CE only has Unicode API, so even we have an ANSI string here, we
- // still need to use GetModuleHandleW() there and so do it everywhere to
- // avoid #ifdefs -- this code is not performance-critical anyhow...
-#ifdef __WINCE__
+ // still need to use GetModuleHandleW() there
+#ifdef __WXWINCE__
return ::GetModuleHandleW(wxConvLibc.cMB2WC(name).data());
#else
return ::GetModuleHandleA((char *)name);
#ifdef __WXWINCE__
::EnumFontFamilies(hDC,
- m_facename.empty() ? NULL : m_facename.c_str(),
+ m_facename.empty() ? NULL : m_facename.wx_str(),
(wxFONTENUMPROC)wxFontEnumeratorProc,
(LPARAM)this) ;
#else // __WIN32__
info.fMask = MIIM_TYPE;
info.fType = MFT_STRING;
info.cch = m_title.length();
- info.dwTypeData = (LPTSTR) m_title.c_str();
+ info.dwTypeData = wx_const_cast(wxChar *, m_title.wx_str());
if ( !SetMenuItemInfo(hMenu, 0, TRUE, & info) )
{
wxLogLastError(wxT("SetMenuItemInfo"));
HMENU hPopupMenu = (HMENU) GetMenu(i)->GetHMenu() ;
tbButton.dwData = (DWORD)hPopupMenu;
wxString label = wxStripMenuCodes(GetLabelTop(i));
- tbButton.iString = (int) label.c_str();
+ tbButton.iString = (int) label.wx_str();
int position = i;
info.fMask = MIIM_TYPE;
info.fType = MFT_STRING;
info.cch = label.length();
- info.dwTypeData = (LPTSTR) label.c_str();
+ info.dwTypeData = wx_const_cast(wxChar *, label.wx_str());
if ( !SetMenuItemInfo(GetHmenu(), id, TRUE, & info) )
{
wxLogLastError(wxT("SetMenuItemInfo"));
HMENU hPopupMenu = (HMENU) menu->GetHMenu() ;
tbButton.dwData = (DWORD)hPopupMenu;
wxString label = wxStripMenuCodes(title);
- tbButton.iString = (int) label.c_str();
+ tbButton.iString = (int) label.wx_str();
tbButton.idCommand = NewControlId();
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton))
HMENU hPopupMenu = (HMENU) menu->GetHMenu() ;
tbButton.dwData = (DWORD)hPopupMenu;
wxString label = wxStripMenuCodes(title);
- tbButton.iString = (int) label.c_str();
+ tbButton.iString = (int) label.wx_str();
tbButton.idCommand = NewControlId();
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton))
// wxPenRefData HPEN management
// ----------------------------------------------------------------------------
-#ifdef wxHAVE_EXT_CREATE_PEN
-
static int ConvertPenStyle(int style)
{
switch ( style )
{
- case wxDOT:
- return PS_DOT;
-
- case wxDOT_DASH:
- return PS_DASHDOT;
-
case wxSHORT_DASH:
case wxLONG_DASH:
return PS_DASH;
case wxTRANSPARENT:
return PS_NULL;
- case wxUSER_DASH:
- return PS_USERSTYLE;
-
default:
wxFAIL_MSG( _T("unknown pen style") );
// fall through
+#ifdef wxHAVE_EXT_CREATE_PEN
+ case wxDOT:
+ return PS_DOT;
+
+ case wxDOT_DASH:
+ return PS_DASHDOT;
+
+ case wxUSER_DASH:
+ return PS_USERSTYLE;
+
case wxSTIPPLE:
case wxBDIAGONAL_HATCH:
case wxCROSSDIAG_HATCH:
case wxHORIZONTAL_HATCH:
case wxVERTICAL_HATCH:
case wxSOLID:
+#endif // wxHAVE_EXT_CREATE_PEN
+
return PS_SOLID;
}
}
+#ifdef wxHAVE_EXT_CREATE_PEN
+
static int ConvertJoinStyle(int join)
{
switch( join )
wxWindowsPrinter::wxWindowsPrinter(wxPrintDialogData *data)
: wxPrinterBase(data)
{
- m_lpAbortProc = (WXFARPROC) MakeProcInstance((FARPROC) wxAbortProc, wxGetInstance());
+ m_lpAbortProc = (WXFARPROC)wxAbortProc;
}
wxWindowsPrinter::~wxWindowsPrinter()
#define HSAS_SORTEDDOWN 2
#endif
-#if defined(__WXWINCE__) && !defined(DFCS_FLAT)
- #define DFCS_FLAT 0
+#if defined(__WXWINCE__)
+ #ifndef DFCS_FLAT
+ #define DFCS_FLAT 0
+ #endif
+ #ifndef DFCS_MONO
+ #define DFCS_MONO 0
+ #endif
#endif
#ifndef DFCS_HOT
else
msStyle |= SS_LEFT;
+#ifdef SS_ENDELLIPSIS
// this style is necessary to receive mouse events
// Win NT and later have the SS_ENDELLIPSIS style which is useful to us:
if (wxGetOsVersion() == wxOS_WINDOWS_NT)
if ( style & wxST_ELLIPSIZE_END )
msStyle |= SS_ENDELLIPSIS;
}
+#endif // SS_ENDELLIPSIS
msStyle |= SS_NOTIFY;
// note: we first need to set the size and _then_ call UpdateLabel
wxStaticTextBase::DoSetSize(x, y, w, h, sizeFlags);
+#ifdef SS_ENDELLIPSIS
// do we need to ellipsize the contents?
long styleReal = ::GetWindowLong(GetHwnd(), GWL_STYLE);
if ( !(styleReal & SS_ENDELLIPSIS) )
UpdateLabel();
}
//else: we don't or the OS will do it for us
+#endif // SS_ENDELLIPSIS
// we need to refresh the window after changing its size as the standard
// control doesn't always update itself properly
void wxStaticText::SetLabel(const wxString& label)
{
+#ifdef SS_ENDELLIPSIS
long styleReal = ::GetWindowLong(GetHwnd(), GWL_STYLE);
if ( HasFlag(wxST_ELLIPSIZE_END) &&
wxGetOsVersion() == wxOS_WINDOWS_NT )
styleReal &= ~SS_ENDELLIPSIS;
::SetWindowLong(GetHwnd(), GWL_STYLE, styleReal);
}
+#endif // SS_ENDELLIPSIS
// this call will save the label in m_labelOrig and set it into this window
// (through wxWindow::SetLabel)
m_labelOrig = label;
- if ((styleReal & SS_ENDELLIPSIS) == 0)
- DoSetLabel(GetEllipsizedLabelWithoutMarkup());
- else
+#ifdef SS_ENDELLIPSIS
+ if ( styleReal & SS_ENDELLIPSIS )
DoSetLabel(RemoveMarkup(label));
+ else
+#endif // SS_ENDELLIPSIS
+ DoSetLabel(GetEllipsizedLabelWithoutMarkup());
// adjust the size of the window to fit to the label unless autoresizing is
// disabled
// toolbar-specific post initialisation
::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
+#ifdef TB_SETEXTENDEDSTYLE
if ( wxApp::GetComCtl32Version() >= 471 )
::SendMessage(GetHwnd(), TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS);
+#endif
return true;
}
// interface derived from wxListBox and lower classes
// --------------------------------------------------
-void wxCheckListBox::Clear()
+void wxCheckListBox::DoClear()
{
unsigned int n = GetCount();
while ( n > 0 )
{
n--;
- Delete(n);
+ DoDeleteOneItem(n);
}
- m_itemsClientData.Clear();
-
- wxCHECK_RET( n == GetCount(),
- _T("broken wxCheckListBox::Clear()") );
+ wxASSERT_MSG( IsEmpty(), _T("logic error in DoClear()") );
}
unsigned int wxCheckListBox::GetCount() const
unsigned int pos,
void **clientData, wxClientDataType type)
{
- ListView_SetItemCount( GetHwnd(), GetCount() + count );
-
const unsigned int count = items.GetCount();
+ ListView_SetItemCount( GetHwnd(), GetCount() + count );
+
int n = wxNOT_FOUND;
for( unsigned int i = 0; i < count; i++ )
return NULL;
}
+int wxCRT_Rename(const wchar_t *src, const wchar_t *dst)
+{
+ return ::MoveFile(src, dst) ? 0 : -1;
+}
+
+int wxCRT_Remove(const wchar_t *path)
+{
+ return ::DeleteFile(path) ? 0 : -1;
+}
+
const wxString& label = tool->GetLabel();
if ( !label.empty() )
{
- button.iString = (int)label.c_str();
+ button.iString = (int)label.wx_str();
}
}