// ----------------------------------------------------------------------------
#if wxUSE_GUI
- #if defined(__PALMOS__)
+ #if defined(__WXPALMOS__)
#include "wx/palmos/app.h"
#elif defined(__WXMSW__)
#include "wx/msw/app.h"
// wxStandardPaths object is normally the same for wxBase and wxGUI
// except in the case of wxMac and wxCocoa
+#ifndef __WXPALMOS__
virtual wxStandardPathsBase& GetStandardPaths();
+#endif
// functions abstracting differences between GUI and console modes
// ------------------------------------------------------------------------
// NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the
// Unix code (and otherwise __UNIX__ wouldn't be defined)
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/apptbase.h"
#elif defined(__WXMSW__)
#include "wx/msw/apptbase.h"
// include the platform-specific version of the classes above
// ----------------------------------------------------------------------------
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/apptrait.h"
#elif defined(__WXMSW__)
#include "wx/msw/apptrait.h"
};
#endif
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/bitmap.h"
#elif defined(__WXMSW__)
#include "wx/msw/bitmap.h"
{ return (GetStyle()>=wxFIRST_HATCH) && (GetStyle()<=wxLAST_HATCH); }
};
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/brush.h"
#elif defined(__WXMSW__)
#include "wx/msw/brush.h"
Compiler-specific checking.
*/
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
# include "wx/palmos/chkconf.h"
#elif defined(__WXMSW__)
# include "wx/msw/chkconf.h"
#ifndef _WX_COLOUR_H_BASE_
#define _WX_COLOUR_H_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/colour.h"
#elif defined(__WXMSW__)
#include "wx/msw/colour.h"
#if defined(__WXUNIVERSAL__)
#include "wx/univ/control.h"
-#elif defined(__PALMOS__)
+#elif defined(__WXPALMOS__)
#include "wx/palmos/control.h"
#elif defined(__WXMSW__)
#include "wx/msw/control.h"
#ifndef _WX_CURSOR_H_BASE_
#define _WX_CURSOR_H_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/cursor.h"
#elif defined(__WXMSW__)
#include "wx/msw/cursor.h"
// now include the declaration of wxDC class
// ----------------------------------------------------------------------------
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/dc.h"
#elif defined(__WXMSW__)
#include "wx/msw/dc.h"
#ifndef _WX_DCCLIENT_H_BASE_
#define _WX_DCCLIENT_H_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/dcclient.h"
#elif defined(__WXMSW__)
#include "wx/msw/dcclient.h"
#ifndef _WX_DCMEMORY_H_BASE_
#define _WX_DCMEMORY_H_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/dcmemory.h"
#elif defined(__WXMSW__)
#include "wx/msw/dcmemory.h"
#ifndef _WX_DCPRINT_H_BASE_
#define _WX_DCPRINT_H_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/dcprint.h"
#elif defined(__WXMSW__)
#include "wx/msw/dcprint.h"
#ifndef _WX_DCSCREEN_H_BASE_
#define _WX_DCSCREEN_H_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/dcscreen.h"
#elif defined(__WXMSW__)
#include "wx/msw/dcscreen.h"
/* Make sure the environment is set correctly */
# if defined(__WXMSW__) && defined(__X__)
# error "Target can't be both X and Windows"
+# elif defined(__WXMSW__) && defined(__PALMOS__)
+# error "Target can't be both PalmOS and Windows"
# elif !defined(__WXMOTIF__) && \
!defined(__WXMSW__) && \
+ !defined(__WXPALMOS__)&& \
!defined(__WXGTK__) && \
!defined(__WXPM__) && \
!defined(__WXMAC__) && \
*/
/* 32bit */
-#ifdef __WINDOWS__
+#ifdef __PALMOS__
+ typedef int wxInt32;
+ typedef unsigned int wxUint32;
+ #define SIZEOF_INT 4
+ #define SIZEOF_LONG 4
+ #define SIZEOF_WCHAR_T 2
+ #define SIZEOF_SIZE_T 4
+ #define wxSIZE_T_IS_UINT
+ #define SIZEOF_VOID_P 4
+ #define SIZEOF_SIZE_T 4
+#elif defined(__WINDOWS__)
/* Win64 uses LLP64 model and so ints and longs have the same size as in */
/* Win32 */
#if defined(__WIN32__)
typedef WX_NSView WXWidget; /* wxWidgets BASE definition */
#endif /* __WXCOCOA__ */
-#ifdef __WXMSW__
+#if defined(__WXMSW__) || defined(__WXPALMOS__)
/* the keywords needed for WinMain() declaration */
#ifndef WXFAR
#if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
#include "wx/univ/dialog.h"
#else
- #if defined(__PALMOS__)
+ #if defined(__WXPALMOS__)
#include "wx/palmos/dialog.h"
#elif defined(__WXMSW__)
#include "wx/msw/dialog.h"
struct WXDLLEXPORT wxNativeEncodingInfo
{
wxString facename; // may be empty meaning "any"
-#ifndef __PALMOS__
+#ifndef __WXPALMOS__
wxFontEncoding encoding; // so that we know what this struct represents
#if defined(__WXMSW__) || \
// can sometimes be very useful (e.g. under MSW this is necessary for
// integration with MFC) but currently this is done for MSW only, other ports
// should follow a.s.a.p.
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/evtloop.h"
#elif defined(__WXMSW__)
#include "wx/msw/evtloop.h"
// detect compilers which have support for huge files (currently only
// Digital Mars doesn't)
- #ifndef __PALMOS__
+ #ifndef __WXPALMOS__
#include "wx/msw/private.h"
#endif
#endif
// constants (unless already defined by the user code)
- #if !defined(__BORLANDC__) && !defined(__WATCOMC__) && !defined(__PALMOS__)
+ #if !defined(__BORLANDC__) && !defined(__WATCOMC__) && !defined(__WXPALMOS__)
#ifndef O_RDONLY
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
int family, // see wxFontFamily enum
int style, // see wxFontStyle enum
int weight, // see wxFontWeight enum
- bool underlined = FALSE, // not underlined by default
+ bool underlined = false, // not underlined by default
const wxString& face = wxEmptyString, // facename
wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ...
};
// include the real class declaration
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/font.h"
#elif defined(__WXMSW__)
#include "wx/msw/font.h"
#include "wx/font.h" // for wxFont and wxFontEncoding
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
#include "wx/msw/wrapwin.h"
#endif
// set the XFLD
void SetXFontName(const wxString& xFontName);
-#elif defined(__WXMSW__) && !defined(__PALMOS__)
+#elif defined(__WXMSW__) && !defined(__WXPALMOS__)
LOGFONT lf;
#elif defined(__WXPM__)
// OS/2 native structures that define a font
#if defined(__WXUNIVERSAL__) // && !defined(__WXMICROWIN__)
#include "wx/univ/frame.h"
#else // !__WXUNIVERSAL__
- #if defined(__PALMOS__)
+ #if defined(__WXPALMOS__)
#include "wx/palmos/frame.h"
#elif defined(__WXMSW__)
#include "wx/msw/frame.h"
#ifndef _WX_GDIOBJ_H_BASE_
#define _WX_GDIOBJ_H_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/gdiobj.h"
#elif defined(__WXMSW__)
#include "wx/msw/gdiobj.h"
#include "wx/msw/wince/helpwce.h"
#define wxHelpController wxWinceHelpController
-#elif defined(__PALMOS__)
+#elif defined(__WXPALMOS__)
#include "wx/palmos/help.h"
#define wxHelpController wxPalmHelpController
#include "wx/iconloc.h"
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/icon.h"
#elif defined(__WXMSW__)
#include "wx/msw/icon.h"
#else // !wxUSE_BASE_CLASSES_ONLY
#if defined(__WXUNIVERSAL__)
#include "wx/univ/menu.h"
-#elif defined(__PALMOS__)
+#elif defined(__WXPALMOS__)
#include "wx/palmos/menu.h"
#elif defined(__WXMSW__)
#include "wx/msw/menu.h"
#else // !wxUSE_BASE_CLASSES_ONLY
#if defined(__WXUNIVERSAL__)
#include "wx/univ/menuitem.h"
-#elif defined(__PALMOS__)
+#elif defined(__WXPALMOS__)
#include "wx/palmos/menuitem.h"
#elif defined(__WXMSW__)
#include "wx/msw/menuitem.h"
#if defined(__WXMSW__)
#if wxUSE_ENH_METAFILE
- #if defined(__PALMOS__)
+ #if defined(__WXPALMOS__)
#include "wx/palmos/enhmeta.h"
#else
#include "wx/msw/enhmeta.h"
#define wxMETAFILE_IS_ENH
#endif // wxUSE_WIN_METAFILES_ALWAYS
#else // !wxUSE_ENH_METAFILE
- #if defined(__PALMOS__)
+ #if defined(__WXPALMOS__)
#include "wx/palmos/metafile.h"
#else
#include "wx/msw/metafile.h"
#ifndef _WX_MINIFRAM_H_BASE_
#define _WX_MINIFRAMH_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/minifram.h"
#elif defined(__WXMSW__)
#include "wx/msw/minifram.h"
#if defined(__WXUNIVERSAL__) || defined(__WXGPE__)
#include "wx/generic/msgdlgg.h"
-#elif defined(__PALMOS__)
+#elif defined(__WXPALMOS__)
#include "wx/palmos/msgdlg.h"
#elif defined(__WXMSW__)
#include "wx/msw/msgdlg.h"
virtual int GetColoursCount() const { wxFAIL_MSG( _T("not implemented") ); return 0; };
};
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/palette.h"
#elif defined(__WXMSW__)
#include "wx/msw/palette.h"
// Author: William Osborne
// Modified by:
// Created: 10/17/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
extern int WXDLLEXPORT
wxEntry();
-#include <PalmOS.h>
#define IMPLEMENT_WXWIN_MAIN \
uint32_t PilotMain(uint16_t cmd, MemPtr cmdPBP, uint16_t launchFlags) \
{ \
} \
return errNone; \
}
-
+
#endif // _WX_APP_H_
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#endif // wxUSE_IMAGE
private:
-#ifdef __WIN32__
- // common part of CopyFromIcon/CopyFromCursor for Win32
- bool CopyFromIconOrCursor(const wxGDIImage& icon);
-#endif // __WIN32__
-
DECLARE_DYNAMIC_CLASS(wxBitmap)
};
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// avoide switching into owner-drawn mode
wxControl::SetBackgroundColour(bg);
}
-
-#ifdef __WIN32__
- // coloured buttons support
- virtual bool SetBackgroundColour(const wxColour &colour);
- virtual bool SetForegroundColour(const wxColour &colour);
-
- virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
-
-private:
- void MakeOwnerDrawn();
-#endif // __WIN32__
protected:
- // send a notification event, return TRUE if processed
+ // send a notification event, return true if processed
bool SendClickEvent();
// default button handling
* Author: William Osborne
* Modified by:
* Created: 10/13/04
- * RCS-ID: $Id:
+ * RCS-ID: $Id:
* Copyright: (c) William Osborne
* Licence: wxWindows licence
*/
#define wxUSE_CHECKLISTBOX 0
#endif
-#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
-/* BC++ 4.0 can't compile JPEG library */
-#undef wxUSE_LIBJPEG
-#define wxUSE_LIBJPEG 0
-#endif
-
-/* wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode */
-#if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL))
-#undef wxUSE_DEBUG_NEW_ALWAYS
-#define wxUSE_DEBUG_NEW_ALWAYS 0
-#endif
-
-#if defined(__WXMSW__) && (defined(__WATCOMC__) && __WATCOMC__ < 1200)
-#undef wxUSE_WCHAR_T
-#define wxUSE_WCHAR_T 0
-#endif
-
#endif
/* _WX_PALMOS_CHKCONF_H_ */
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event)
{
-#ifdef __WXMSW__
- ::UpdateWindow((HWND) GetHWND()); // We need to implement this in wxWidgets
-#endif
-
CaptureMouse();
m_dragImage = new wxDragImage(* this, itemId);
// Do some updating of the window, such as highlighting the drop target
...
-#ifdef __WXMSW__
- if (updateWindow)
- ::UpdateWindow((HWND) GetHWND());
-#endif
-
// Move and show the image again
m_dragImage->Move(event.GetPosition(), this);
m_dragImage->Show(this);
// Begin drag. hotspot is the location of the drag position relative to the upper-left
// corner of the image.
- bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = FALSE, wxRect* rect = (wxRect*) NULL);
+ bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = false, wxRect* rect = (wxRect*) NULL);
// Begin drag. hotspot is the location of the drag position relative to the upper-left
// corner of the image. This is full screen only. fullScreenRect gives the
///////////////////////////////////////////////////////////////////////////////
// Name: wx/palmos/enhmeta.h
-// Purpose: wxEnhMetaFile class for Win32
+// Purpose: wxEnhMetaFile class for PalmOS
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// Author: William Osborne
// Modified by:
// Created: 10/14/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
virtual WXHANDLE GetResourceHandle() const;
virtual bool FreeResource(bool force = false);
- // for consistency with other wxMSW classes
- WXHFONT GetHFONT() const;
-
- /*
- virtual bool UseResource();
- virtual bool ReleaseResource();
- */
-
protected:
// real font creation function, used in all cases
bool DoCreate(int size,
#ifndef _WX_MSW_GCCPRIV_H_
#define _WX_MSW_GCCPRIV_H_
+#include <PalmOS.h>
+#undef Abs
+
#if defined(__MINGW32__) && !defined(__GNUWIN32__)
#define __GNUWIN32__
#endif
#endif
#endif
#elif defined( __CYGWIN__ ) && !defined( HAVE_W32API_H )
- #if ( __GNUC__ > 2 )
+ #if ( __GNUC__ > 2 )
#define HAVE_W32API_H
#endif
#endif
-#if (defined(__WATCOMC__) && __WATCOMC__ >= 1200)
+#if (defined(__WATCOMC__) && __WATCOMC__ >= 1200)
#define HAVE_W32API_H
#endif
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// terminate the current radio group, if any
void EndRadioGroup();
- // if TRUE, insert a break before appending the next item
+ // if true, insert a break before appending the next item
bool m_doBreak;
// the position of the first item in the current radio group or -1
wxMenuInfo() { m_menu = NULL ; }
virtual ~wxMenuInfo() { }
- void Create( wxMenu *menu , const wxString &title )
+ void Create( wxMenu *menu , const wxString &title )
{ m_menu = menu ; m_title = title ; }
wxMenu* GetMenu() const { return m_menu ; }
wxString GetTitle() const { return m_title ; }
class WXDLLEXPORT wxMenuBar : public wxMenuBarBase
{
public:
- // ctors & dtor
+ // ctors & dtor
// default constructor
wxMenuBar();
void LoadMenu();
int ProcessCommand(int ItemID);
-#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
- // Under WinCE, a menubar is owned by the frame's toolbar
- void SetToolBar(wxToolBar* toolBar) { m_toolBar = toolBar; }
- wxToolBar* GetToolBar() const { return m_toolBar; }
-#endif
-
-#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
- WXHWND GetCommandBar() const { return m_commandBar; }
- bool AddAdornments(long style);
-#endif
-
#if wxUSE_ACCEL
// get the accel table for all the menus
const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; }
#if defined(__WXWINCE__) && wxUSE_TOOLBAR
wxToolBar* m_toolBar;
#endif
- // Not using a combined wxToolBar/wxMenuBar? then use
- // a commandbar in WinCE .NET to implement the
- // menubar, since there is no ::SetMenu function.
-#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
- WXHWND m_commandBar;
- bool m_adornmentsAdded;
-#endif
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenuBar)
#include "wx/wxchar.h"
#if !wxUSE_UNICODE_MSLU
-inline bool wxUsingUnicowsDll() { return FALSE; }
+inline bool wxUsingUnicowsDll() { return false; }
#else
// Returns true if we are running under Unicode emulation in Win9x environment.
#if wxUSE_GUI
-WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc,
- WXLPARAM lData, WXWPARAM wData,
- int x, int y, int cx, int cy,
+WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc,
+ WXLPARAM lData, WXWPARAM wData,
+ int x, int y, int cx, int cy,
unsigned int flags);
#define DrawStateW(dc, br, func, ld, wd, x, y, cx, cy, flags) \
wxMSLU_DrawStateW((WXHDC)dc,(WXHBRUSH)br,(WXFARPROC)func, \
WXDLLEXPORT int wxMSLU__trename(const wxChar *oldname, const wxChar *newname);
WXDLLEXPORT int wxMSLU__tremove(const wxChar *name);
-#if defined( __VISUALC__ ) \
- || ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \
- || ( defined(__MWERKS__) && defined(__WXMSW__) ) \
- || ( defined(__BORLANDC__) && (__BORLANDC__ > 0x460) )
-WXDLLEXPORT int wxMSLU__wopen(const wxChar *name, int flags, int mode);
-WXDLLEXPORT int wxMSLU__waccess(const wxChar *name, int mode);
-WXDLLEXPORT int wxMSLU__wmkdir(const wxChar *name);
-WXDLLEXPORT int wxMSLU__wrmdir(const wxChar *name);
-WXDLLEXPORT int wxMSLU__wstat(const wxChar *name, struct _stat *buffer);
-#endif
-
#endif // wxUSE_UNICODE_MSLU
#endif // _WX_MSLU_H_
///////////////////////////////////////////////////////////////////////////////
// Name: wx/palmos/popupwin.h
-// Purpose: wxPopupWindow class for wxMSW
+// Purpose: wxPopupWindow class for PalmOS
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
- virtual bool Show(bool show = TRUE);
+ virtual bool Show(bool show = true);
protected:
// popups handle the position like wxTopLevelWindow, not wxWindow
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// class wxRegKey encapsulates window HKEY handle
// ----------------------------------------------------------------------------
-class WXDLLIMPEXP_BASE wxRegKey
+class WXDLLIMPEXP_BASE wxRegKey
{
public:
// NB: do _not_ change the values of elements in these enumerations!
{
Type_None, // No value type
Type_String, // Unicode nul terminated string
-#ifdef __WIN32__
- Type_Expand_String, // Unicode nul terminated string
- // (with environment variable references)
- Type_Binary, // Free form binary
- Type_Dword, // 32-bit number
- Type_Dword_little_endian // 32-bit number
- = Type_Dword, // (same as Type_DWORD)
- Type_Dword_big_endian, // 32-bit number
- Type_Link, // Symbolic Link (unicode)
- Type_Multi_String, // Multiple Unicode strings
- Type_Resource_list, // Resource list in the resource map
- Type_Full_resource_descriptor, // Resource list in the hardware description
- Type_Resource_requirements_list // ???
-#endif //WIN32
};
// predefined registry keys
enum StdKey
{
HKCR // classes root
-#ifdef __WIN32__
- ,
- HKCU, // current user
- HKLM, // local machine
- HKUSR, // users
- HKPD // performance data (WinNT/2K only)
-#if WINVER >= 0x0400
- ,
- HKCC, // current config (starting from Win95/NT 4.0)
- HKDD // dynamic data (Win95/98 only)
-#endif // Winver
-#endif // Win32/16
};
// access mode for the key
// get infomation about the key
// get the (full) key name. Abbreviate std root keys if bShortPrefix.
- wxString GetName(bool bShortPrefix = TRUE) const;
+ wxString GetName(bool bShortPrefix = true) const;
// return true if the key exists
bool Exists() const;
// get the info about key (any number of these pointers may be NULL)
// which need the key to be opened if the key is not opened yet)
bool Open(AccessMode mode = Write);
// create the key: will fail if the key already exists and !bOkIfExists
- bool Create(bool bOkIfExists = TRUE);
+ bool Create(bool bOkIfExists = true);
// rename a value from old name to new one
bool RenameValue(const wxChar *szValueOld, const wxChar *szValueNew);
// rename the key
// access to values and subkeys
// get value type
ValueType GetValueType(const wxChar *szValue) const;
- // returns TRUE if the value contains a number (else it's some string)
+ // returns true if the value contains a number (else it's some string)
bool IsNumericValue(const wxChar *szValue) const;
// assignment operators set the default value of the key
wxRegKey& operator=(const wxString& strValue)
{ SetValue(NULL, strValue); return *this; }
- wxRegKey& operator=(long lValue)
- { SetValue(NULL, lValue); return *this; }
// query the default value of the key: implicitly or explicitly
wxString QueryDefaultValue() const;
bool SetValue(const wxChar *szValue, const wxString& strValue);
// retrieve the string value
bool QueryValue(const wxChar *szValue, wxString& strValue) const
- { return QueryValue(szValue, strValue, FALSE); }
+ { return QueryValue(szValue, strValue, false); }
// retrieve raw string value
bool QueryRawValue(const wxChar *szValue, wxString& strValue) const
- { return QueryValue(szValue, strValue, TRUE); }
+ { return QueryValue(szValue, strValue, true); }
// retrieve either raw or expanded string value
bool QueryValue(const wxChar *szValue, wxString& strValue, bool raw) const;
-#ifdef __WIN32__
- // set the numeric value
- bool SetValue(const wxChar *szValue, long lValue);
- // return the numeric value
- bool QueryValue(const wxChar *szValue, long *plValue) const;
-#endif //Win32
-
// query existence of a key/value
// return true if value exists
bool HasValue(const wxChar *szKey) const;
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
virtual void WriteText(const wxString& text);
virtual void AppendText(const wxString& text);
-#ifdef __WIN32__
- virtual bool EmulateKeyPress(const wxKeyEvent& event);
-#endif // __WIN32__
-
#if wxUSE_RICHEDIT
// apply text attribute to the range of text (only works with richedit
// controls)
// replace the contents of the selection or of the entire control with the
// given text
- void DoWriteText(const wxString& text, bool selectionOnly = TRUE);
+ void DoWriteText(const wxString& text, bool selectionOnly = true);
// set the selection possibly without scrolling the caret into view
- void DoSetSelection(long from, long to, bool scrollCaret = TRUE);
+ void DoSetSelection(long from, long to, bool scrollCaret = true);
// return true if there is a non empty selection in the control
bool HasSelection() const;
// position
long GetLengthOfLineContainingPos(long pos) const;
- // send TEXT_UPDATED event, return TRUE if it was handled, FALSE otherwise
+ // send TEXT_UPDATED event, return true if it was handled, false otherwise
bool SendUpdateEvent();
// override some base class virtuals
int m_verRichEdit;
#endif // wxUSE_RICHEDIT
- // if TRUE, SendUpdateEvent() will eat the next event (see comments in the
+ // if true, SendUpdateEvent() will eat the next event (see comments in the
// code as to why this is needed)
bool m_suppressNextUpdate;
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#pragma interface "toplevel.h"
#endif
-#ifdef __PALMOS__
- #include <PalmOS.h>
-#endif
-
// ----------------------------------------------------------------------------
// wxTopLevelWindowPalm
// ----------------------------------------------------------------------------
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
-
+
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
long style,
const wxString& name,
wxFrame* PFrame);
-
+
virtual ~wxTopLevelWindowPalm();
// implement base class pure virtuals
- virtual void Maximize(bool maximize = TRUE);
+ virtual void Maximize(bool maximize = true);
virtual bool IsMaximized() const;
- virtual void Iconize(bool iconize = TRUE);
+ virtual void Iconize(bool iconize = true);
virtual bool IsIconized() const;
virtual void SetIcon(const wxIcon& icon);
virtual void SetIcons(const wxIconBundle& icons );
virtual bool SetShape(const wxRegion& region);
#endif // __WXWINCE__
- virtual bool Show(bool show = TRUE);
+ virtual bool Show(bool show = true);
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
virtual bool IsFullScreen() const { return m_fsIsShowing; }
- // wxPalm only: EnableCloseButton(FALSE) may be used to remove the "Close"
+ // wxPalm only: EnableCloseButton(false) may be used to remove the "Close"
// button from the title bar
- bool EnableCloseButton(bool enable = TRUE);
+ bool EnableCloseButton(bool enable = true);
// implementation from now on
// --------------------------
// common part of all ctors
void Init();
- // create a new frame, return FALSE if it couldn't be created
+ // create a new frame, return false if it couldn't be created
bool CreateFrame(const wxString& title,
const wxPoint& pos,
const wxSize& size);
// create a new dialog using the given dialog template from resources,
- // return FALSE if it couldn't be created
+ // return false if it couldn't be created
bool CreateDialog(const void *dlgTemplate,
const wxString& title,
const wxPoint& pos,
#ifndef _WX_WINDOW_H_
#define _WX_WINDOW_H_
-#ifdef __PALMOS__
- #include <PalmOS.h>
-#endif
-
-
// ---------------------------------------------------------------------------
// headers
// ---------------------------------------------------------------------------
#if wxUSE_ACCEL
bool HandleHotKey(WXWPARAM wParam, WXLPARAM lParam);
#endif
-#ifdef __WIN32__
- int HandleMenuChar(int chAccel, WXLPARAM lParam);
-#endif
bool HandleQueryDragIcon(WXHICON *hIcon);
#ifndef _WX_PEN_H_BASE_
#define _WX_PEN_H_BASE_
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/pen.h"
#elif defined(__WXMSW__)
#include "wx/msw/pen.h"
# endif
#endif
+#if defined(__PALMOS__)
+# ifndef __WXPALMOS__
+# define __WXPALMOS__
+# endif
+# ifdef __WXMSW__
+# undef __WXMSW__
+# endif
+# ifdef __WINDOWS__
+# undef __WINDOWS__
+# endif
+# ifdef __WIN32__
+# undef __WIN32__
+# endif
+# ifdef WIN32
+# undef WIN32
+# endif
+# ifdef _WIN32
+# undef _WIN32
+# endif
+#endif
+
#if defined(_WIN64)
# ifndef _WIN32
/*
# endif
# define wxSIZE_T_IS_UINT
+#elif defined(__PALMOS__)
+# ifdef __WIN32__
+# error "__WIN32__ should not be defined for PalmOS"
+# endif
+# ifdef __WINDOWS__
+# error "__WINDOWS__ should not be defined for PalmOS"
+# endif
+# ifdef __WXMSW__
+# error "__WXMSW__ should not be defined for PalmOS"
+# endif
+
#else /* Windows */
# ifndef __WINDOWS__
# define __WINDOWS__
This macro can be used to check that the version of mingw32 compiler is
at least maj.min
*/
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
# include "wx/palmos/gccpriv.h"
#elif ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \
defined( __CYGWIN__ ) || \
#endif
/*
- We need AvailabilityMacros.h for ifdefing out things that don't exist on
+ We need AvailabilityMacros.h for ifdefing out things that don't exist on
OSX 10.2 and lower
FIXME: We need a better way to detect for 10.3 then including a system header
*/
#include "wx/colour.h"
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/region.h"
#elif defined(__WXMSW__)
#include "wx/msw/region.h"
#include "wx/gdicmn.h" // for wxPoint
// some platforms have their own renderers, others use the generic one
-#if (defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXGTK__)) && !defined(__PALMOS__)
+#if (defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXGTK__)) && !defined(__WXPALMOS__)
#define wxHAS_NATIVE_RENDERER
#else
#undef wxHAS_NATIVE_RENDERER
#define wxStatusBarUniv wxStatusBar
#include "wx/univ/statusbr.h"
-#elif defined(__PALMOS__)
+#elif defined(__WXPALMOS__)
#define wxStatusBarPalm wxStatusBar
#include "wx/palmos/statusbr.h"
#include <strings.h> // for strcasecmp()
#endif // HAVE_STRCASECMP_IN_STRINGS_H
-#ifdef __PALMOS__
+#ifdef __WXPALMOS__
#include <StringMgr.h>
#endif
public:
wxStringBufferLength(wxString& str, size_t lenWanted = 1024)
: m_str(str), m_buf(NULL), m_len(0), m_lenSet(false)
- {
- m_buf = m_str.GetWriteBuf(lenWanted);
+ {
+ m_buf = m_str.GetWriteBuf(lenWanted);
wxASSERT(m_buf != NULL);
}
// now include the actual class declaration
// ----------------------------------------------------------------------------
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/taskbar.h"
#elif defined(__WXMSW__)
#include "wx/msw/taskbar.h"
#else // wxUSE_TOOLBAR_NATIVE
#if defined(__WXUNIVERSAL__)
#include "wx/univ/toolbar.h"
- #elif defined(__PALMOS__)
+ #elif defined(__WXPALMOS__)
#include "wx/palmos/toolbar.h"
#elif defined(__WXMSW__) && (!defined(_WIN32_WCE) || (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)))
#include "wx/msw/tbar95.h"
// include the real class declaration
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#include "wx/palmos/toplevel.h"
#define wxTopLevelWindowNative wxTopLevelWindowPalm
#elif defined(__WXMSW__)
#if defined(__WXUNIVERSAL__)
#include "wx/generic/treectlg.h"
-#elif defined(__PALMOS__)
+#elif defined(__WXPALMOS__)
#include "wx/palmos/treectrl.h"
#elif defined(__WXMSW__)
#include "wx/msw/treectrl.h"
// ----------------------------------------------------------------------------
// include the declaration of the platform-specific class
-#if defined(__PALMOS__)
+#if defined(__WXPALMOS__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowPalm
#else // !wxUniv
#define wxHAVE_TCHAR_SUPPORT
#elif defined(__DMC__)
#define wxHAVE_TCHAR_SUPPORT
-#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) && !defined(__PALMOS__)
+#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) && !defined(__WXPALMOS__)
#define wxHAVE_TCHAR_SUPPORT
#include <stddef.h>
#include <string.h>
#else
#define WXWCHAR_T_CAST(c) c
#endif
-
+
/* ctype.h functions */
#define wxIsalnum(c) _istalnum(WXWCHAR_T_CAST(c))
#define wxIsalpha(c) _istalpha(WXWCHAR_T_CAST(c))
#else /* !TCHAR-aware compilers */
#if !defined(__MWERKS__) && defined(__DARWIN__) && ( MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 )
- /* even though they are defined and "implemented", they are bad and just
+ /* even though they are defined and "implemented", they are bad and just
stubs so we need our own - we need these even in ANSI builds!! */
#define mbstowcs wxInternalMbstowcs
#define wcstombs wxInternalWcstombs
-
+
WXDLLIMPEXP_BASE size_t wxInternalMbstowcs (wchar_t *, const char *, size_t);
- WXDLLIMPEXP_BASE size_t wxInternalWcstombs (char *, const wchar_t *, size_t);
+ WXDLLIMPEXP_BASE size_t wxInternalWcstombs (char *, const wchar_t *, size_t);
#endif
-
+
/* No UNICODE in the c library except wchar_t typedef on mac OSX 10.2 and less - roll our own */
#if !defined(__MWERKS__) && wxUSE_UNICODE && defined(__DARWIN__) && ( MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 )
-
+
/* we need everything! */
#define wxNEED_WX_STRING_H
#define wxNEED_WX_CTYPE_H
-
+
#define wxFgetchar(c) wxFgetc(c, stdin)
#define wxFputc wxPutc
#define wxFputchar(c) wxPutc(c, stdout)
#define wxNEED_FPUTS
#define wxNEED_PUTS
#define wxNEED_PUTC
-
+
int wxFputs(const wxChar *ch, FILE *stream);
int wxPuts(const wxChar *ws);
int wxPutc(wxChar ch, FILE *stream);
-
+
#ifdef __cplusplus
extern "C" {
#endif
#endif
#define wxPutchar(wch) wxPutc(wch, stdout)
-
+
#define wxNEED_PRINTF_CONVERSION
#define wxNEED_WX_STDIO_H
#define wxNEED_WX_STDLIB_H
#define wxNEED_WX_TIME_H
-
+
#elif wxUSE_UNICODE
#include <wctype.h>
defined(__EMX__) || defined(__DJGPP__)
#define wxStricmp stricmp
#define wxStrnicmp strnicmp
- #elif defined(__PALMOS__)
- /* FIXME: There is no equivalent to strnicmp in the Palm OS API. This
- * quick hack should do until one can be written.
+ #elif defined(__WXPALMOS__)
+ /* FIXME: There is no equivalent to strnicmp in the Palm OS API. This
+ * quick hack should do until one can be written.
*/
#define wxStricmp StrCaselessCompare
- #define wxStrnicmp strnicmp
+ #define wxStrnicmp strnicmp
#elif defined(__SYMANTEC__) || defined(__VISUALC__) || \
(defined(__MWERKS__) && defined(__INTEL__))
#define wxStricmp _stricmp
WXDLLIMPEXP_BASE char *strdup(const char* s);
#endif
-/* RN: Used only under OSX <= 10.2 currently
+/* RN: Used only under OSX <= 10.2 currently
The __cplusplus ifdefs are messy, but they are required to build
the regex library, since c does not support function overloading
*/
#ifdef wxNEED_WX_STRING_H
-# ifdef __cplusplus
+# ifdef __cplusplus
extern "C" {
-# endif
+# endif
WXDLLIMPEXP_BASE wxChar * wxStrcat(wxChar *dest, const wxChar *src);
WXDLLIMPEXP_BASE const wxChar * wxStrchr(const wxChar *s, wxChar c);
WXDLLIMPEXP_BASE int wxStrcmp(const wxChar *s1, const wxChar *s2);
WXDLLIMPEXP_BASE const wxChar * wxStrrchr(const wxChar *s, wxChar c);
WXDLLIMPEXP_BASE size_t wxStrspn(const wxChar *s, const wxChar *accept);
WXDLLIMPEXP_BASE const wxChar * wxStrstr(const wxChar *haystack, const wxChar *needle);
-# ifdef __cplusplus
+# ifdef __cplusplus
}
-# endif
+# endif
/* These functions use C++, so we can't c extern them */
WXDLLIMPEXP_BASE double wxStrtod(const wxChar *nptr, wxChar **endptr);
//
// RN: The following are not normal versions of memcpy et al., rather
-// these are either char or widechar versions depending on
+// these are either char or widechar versions depending on
// if unicode is used or not.
//
#ifdef __cplusplus
//
- // RN: We could do the usual tricky compiler detection here,
+ // RN: We could do the usual tricky compiler detection here,
// and use their variant (such as wmemchr, etc.). The problem
- // is that these functions are quite rare, even though they are
+ // is that these functions are quite rare, even though they are
// part of the current POSIX standard. In addition, most compilers
// (including even MSC) inline them just like we do right in their
// headers.
//
#if wxUSE_UNICODE
#include <string.h> //for mem funcs
-
+
//implement our own wmem variants
inline wxChar* wxTmemchr(const wxChar* s, wxChar c, size_t l)
{
#include <signal.h> // for SIGTRAP used by wxTrap()
#endif //Win/Unix
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
#include "wx/msw/wrapwin.h" // includes windows.h for MessageBox()
#endif
this->argc = argc;
this->argv = argv;
-#ifndef __PALMOS__
+#ifndef __WXPALMOS__
if ( m_appName.empty() && argv )
{
// the application name is, by default, the name of its executable file
#include "wx/utils.h"
#include "wx/ptr_scpd.h"
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
#include "wx/msw/private.h" // includes windows.h for LOGFONT
#endif
// but we want to delete them now
delete wxTopLevelWindows.GetFirst()->GetData();
}
-
+
// undo everything we did in Initialize() above
wxBitmap::CleanUpHandlers();
#include "wx/paper.h"
#endif // wxUSE_PRINTING_ARCHITECTURE
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
#include <windowsx.h>
#include "wx/msw/private.h"
wxPrintData::~wxPrintData()
{
m_nativeData->m_ref--;
- if (m_nativeData->m_ref == 0)
+ if (m_nativeData->m_ref == 0)
delete m_nativeData;
-
+
#ifdef __WXMAC__
delete m_nativePrintData ;
#endif
m_paperSize = data.m_paperSize;
m_bin = data.m_bin;
m_printMode = data.m_printMode;
- m_filename = data.m_filename;
+ m_filename = data.m_filename;
- // UnRef old m_nativeData
+ // UnRef old m_nativeData
if (m_nativeData)
{
m_nativeData->m_ref--;
- if (m_nativeData->m_ref == 0)
+ if (m_nativeData->m_ref == 0)
delete m_nativeData;
}
// Set Ref new one
m_nativeData = data.GetNativeData();
m_nativeData->m_ref++;
-
+
#ifdef __WXMAC__
m_nativePrintData->CopyFrom( data.m_nativePrintData ) ;
#endif
m_printSelection = false;
m_printEnableSelection = false;
m_printEnablePageNumbers = true;
-
+
wxPrintFactory* factory = wxPrintFactory::GetFactory();
m_printEnablePrintToFile = ! factory->HasOwnPrintToFile();
-
+
m_printEnableHelp = false;
#if WXWIN_COMPATIBILITY_2_4
m_printSetupDialog = false;
wxWindow *child = node->GetData();
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
bool is_not_msw_rb = !m_winLastFocused ||
!wxIsKindOf(m_winLastFocused,wxRadioButton);
#else
// direction we're coming
event.SetEventObject(m_winParent);
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
// we need to hop to the next activated
// radio button, not just the next radio
// button under MSW
#include "wx/gdicmn.h"
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
#include "wx/msw/private.h" // includes windows.h for LOGFONT
#include "wx/msw/winundef.h"
#endif
#include "wx/log.h"
#include <string.h>
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
#include "wx/msw/wrapwin.h"
#endif
{
#ifdef __WXWINCE__
::ExitThread(3); // the same exit code as abort()
-#elif __PALMOS__
+#elif __WXPALMOS__
return -1;
#else
::ExitProcess(3); // the same exit code as abort()
#include <stdarg.h>
#include <stdio.h>
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
#include "wx/msw/private.h"
#endif
#ifdef __WXMAC__
out.PrintfV(format, args);
va_end(args);
-#if defined(__WXMSW__) && !defined(__WXMICROWIN__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXMICROWIN__) && !defined(__WXPALMOS__)
out.Replace(wxT("\t"), wxT(" "));
out.Replace(wxT("\n"), wxT("\r\n"));
::OutputDebugString(out);
// - Mac when compiling with CodeWarrior (__WXMAC__)
const wxTextFileType wxTextBuffer::typeDefault =
-#if defined(__WINDOWS__) || defined(__DOS__)
+#if defined(__WINDOWS__) || defined(__DOS__) || defined(__PALMOS__)
wxTextFileType_Dos;
#elif defined(__UNIX__)
wxTextFileType_Unix;
return text;
// nor if it is empty
- if ( text.IsEmpty() )
+ if ( text.empty() )
return text;
wxString eol = GetEOL(type), result;
bool wxTextBuffer::Create()
{
// buffer name must be either given in ctor or in Create(const wxString&)
- wxASSERT( !m_strBufferName.IsEmpty() );
+ wxASSERT( !m_strBufferName.empty() );
// if the buffer already exists do nothing
if ( Exists() ) return false;
bool wxTextBuffer::Open(wxMBConv& conv)
{
// buffer name must be either given in ctor or in Open(const wxString&)
- wxASSERT( !m_strBufferName.IsEmpty() );
+ wxASSERT( !m_strBufferName.empty() );
// open buffer in read-only mode
if ( !OnOpen(m_strBufferName, ReadAccess) )
#include <sys/stat.h>
#endif
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__) && !defined(__WXPALMOS__)
#include "wx/msw/private.h"
#endif
wxString email;
wxString host = wxGetFullHostName();
- if ( !host.IsEmpty() )
+ if ( !host.empty() )
{
wxString user = wxGetUserId();
- if ( !user.IsEmpty() )
+ if ( !user.empty() )
{
email << user << wxT('@') << host;
}
#include "wx/defs.h"
-#ifndef __PALMOS__
+#ifndef __WXPALMOS__
#include "wx/generic/imaglist.h"
return true;
}
-#endif // __PALMOS__
+#endif // __WXPALMOS__
// headers
// ----------------------------------------------------------------------------
-#ifndef __PALMOS__
-
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "notebook.h"
#endif
#pragma hdrstop
#endif
+#ifndef __WXPALMOS__
+
#include "wx/string.h"
#include "wx/log.h"
#include "wx/settings.h"
return retval;
}
-#endif // __PALMOS__
+#endif // __WXPALMOS__
// Author: William Osborne
// Modified by:
// Created: 10/08/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
info.versionMajor = baseInfo.versionMajor;
info.versionMinor = baseInfo.versionMinor;
info.os = baseInfo.os;
- info.shortName = _T("msw");
- info.name = _T("wxMSW");
+ info.shortName = _T("palmos");
+ info.name = _T("wxPalmOS");
#ifdef __WXUNIVERSAL__
info.shortName << _T("univ");
info.name << _T("/wxUniversal");
// to create a window of this class is made.
bool wxApp::RegisterWindowClasses()
{
- return TRUE;
+ return true;
}
// ---------------------------------------------------------------------------
bool wxApp::UnregisterWindowClasses()
{
- bool retval = TRUE;
+ bool retval = true;
return retval;
}
void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
{
if (GetTopWindow())
- GetTopWindow()->Close(TRUE);
+ GetTopWindow()->Close(true);
}
// Default behaviour: close the application with prompts. The
if (GetTopWindow())
{
if (!GetTopWindow()->Close(!event.CanVeto()))
- event.Veto(TRUE);
+ event.Veto(true);
}
}
// Author: William Osborne
// Modified by:
// Created: 10/08/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#endif
m_isDIB =
- m_hasAlpha = FALSE;
+ m_hasAlpha = false;
}
void wxBitmapRefData::Free()
return NULL;
}
-#ifdef __WIN32__
-
-bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon)
-{
- return FALSE;
-}
-
-#endif // Win32
-
bool wxBitmap::CopyFromCursor(const wxCursor& cursor)
{
- return FALSE;
+ return false;
}
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
{
- return FALSE;
+ return false;
}
#ifndef NEVER_USE_DIB
bool wxBitmap::CopyFromDIB(const wxDIB& dib)
{
- return FALSE:
+ return false:
}
#endif // NEVER_USE_DIB
bool wxBitmap::CreateFromXpm(const char **WXUNUSED(data))
#endif
{
- return FALSE;
+ return false;
}
wxBitmap::wxBitmap(int w, int h, int d)
bool wxBitmap::Create(int width, int height, int depth)
{
- return FALSE;
+ return false;
}
bool wxBitmap::Create(int width, int height, const wxDC& dc)
{
- return FALSE;
+ return false;
}
bool wxBitmap::DoCreate(int w, int h, int d, WXHDC hdc)
{
- return FALSE;
+ return false;
}
#if wxUSE_IMAGE
bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
{
- return FALSE;
+ return false;
}
bool wxBitmap::CreateFromImage(const wxImage& image, const wxDC& dc)
{
- return FALSE;
+ return false;
}
bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
{
- return FALSE;
+ return false;
}
wxImage wxBitmap::ConvertToImage() const
bool wxBitmap::LoadFile(const wxString& filename, long type)
{
- return FALSE;
+ return false;
}
bool wxBitmap::Create(void *data, long type, int width, int height, int depth)
{
- return FALSE;
+ return false;
}
bool wxBitmap::SaveFile(const wxString& filename,
int type,
const wxPalette *palette)
{
- return FALSE;
+ return false;
}
// ----------------------------------------------------------------------------
bool wxBitmap::HasAlpha() const
{
- return FALSE;
+ return false;
}
// ----------------------------------------------------------------------------
// Create a mask from a mono bitmap (copies the bitmap).
bool wxMask::Create(const wxBitmap& bitmap)
{
- return FALSE;
+ return false;
}
// Create a mask from a bitmap and a palette index indicating
// the transparent area
bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
{
- return FALSE;
+ return false;
}
// Create a mask from a bitmap and a colour indicating
// the transparent area
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
{
- return FALSE;
+ return false;
}
// ----------------------------------------------------------------------------
long flags,
int width, int height, int depth)
{
- return FALSE;
+ return false;
}
bool wxBitmapHandler::Load(wxGDIImage *image,
long flags,
int width, int height)
{
- return FALSE;
+ return false;
}
bool wxBitmapHandler::Save(wxGDIImage *image,
const wxString& name,
int type)
{
- return FALSE;
+ return false;
}
bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap),
int WXUNUSED(height),
int WXUNUSED(depth))
{
- return FALSE;
+ return false;
}
bool wxBitmapHandler::LoadFile(wxBitmap *WXUNUSED(bitmap),
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight))
{
- return FALSE;
+ return false;
}
bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap),
int WXUNUSED(type),
const wxPalette *WXUNUSED(palette))
{
- return FALSE;
+ return false;
}
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
return false;
}
-// ----------------------------------------------------------------------------
-// owner-drawn buttons support
-// ----------------------------------------------------------------------------
-
-#ifdef __WIN32__
-
-// drawing helpers
-
-static void DrawButtonText(HDC hdc,
- RECT *pRect,
- const wxString& text,
- COLORREF col)
-{
-}
-
-static void DrawRect(HDC hdc, const RECT& r)
-{
-}
-
-void wxButton::MakeOwnerDrawn()
-{
-}
-
-bool wxButton::SetBackgroundColour(const wxColour &colour)
-{
- return false;
-}
-
-bool wxButton::SetForegroundColour(const wxColour &colour)
-{
- return false;
-}
-
-static void DrawButtonFrame(HDC hdc, const RECT& rectBtn,
- bool selected, bool pushed)
-{
-}
-
-bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis)
-{
- return true;
-}
-
-#endif // __WIN32__
-
#endif // wxUSE_BUTTON
DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED)
DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED)
-// This needs to be written using Palm OS Network API calls, but for now this
+// This needs to be written using Palm OS Network API calls, but for now this
// will do.
-#if (!defined(__PALMOS__)
+#if (!defined(__WXPALMOS__)
#include <ras.h>
#include <raserror.h>
virtual bool HangUp();
virtual bool IsAlwaysOnline() const;
virtual bool IsOnline() const;
- virtual void SetOnlineStatus(bool isOnline = TRUE);
+ virtual void SetOnlineStatus(bool isOnline = true);
virtual bool EnableAutoCheckOnlineStatus(size_t nSeconds);
virtual void DisableAutoCheckOnlineStatus();
virtual void SetWellKnownHost(const wxString& hostname, int port);
static HRASCONN FindActiveConnection();
// notify the application about status change
- void NotifyApp(bool connected, bool fromOurselves = FALSE) const;
+ void NotifyApp(bool connected, bool fromOurselves = false) const;
// destroy the thread data and the thread itself
void CleanUpThreadData();
ms_dialer = NULL;
- NotifyApp(FALSE /* !connected */, TRUE /* we dialed ourselves */);
+ NotifyApp(false /* !connected */, true /* we dialed ourselves */);
}
else if ( rasconnstate == RASCS_Connected )
{
ms_isConnected = TRUE;
ms_dialer = NULL;
- NotifyApp(TRUE /* connected */, TRUE /* we dialed ourselves */);
+ NotifyApp(true /* connected */, true /* we dialed ourselves */);
}
}
bool async)
{
// check preconditions
- wxCHECK_MSG( IsOk(), FALSE, wxT("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), false, wxT("using uninitialized wxDialUpManager") );
if ( ms_hRasConnection )
{
wxFAIL_MSG(wxT("there is already an active connection"));
- return TRUE;
+ return true;
}
// get the default ISP if none given
// no known ISPs, abort
wxLogError(_("Failed to connect: no ISP to dial."));
- return FALSE;
+ return false;
case 1:
// only one ISP, choose it
if ( !entryName )
{
// cancelled by user
- return FALSE;
+ return false;
}
}
}
{
wxLogError(_("Failed to connect: missing username/password."));
- return FALSE;
+ return false;
}
}
else
ms_dialer = NULL;
- return FALSE;
+ return false;
}
// for async dialing, we're not yet connected
ms_isConnected = TRUE;
}
- return TRUE;
+ return true;
}
bool wxDialUpManagerMSW::IsDialing() const
if ( !GetDialer() )
{
// silently ignore
- return FALSE;
+ return false;
}
wxASSERT_MSG( ms_hRasConnection, wxT("dialing but no connection?") );
bool wxDialUpManagerMSW::HangUp()
{
- wxCHECK_MSG( IsOk(), FALSE, wxT("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), false, wxT("using uninitialized wxDialUpManager") );
// we may terminate either the connection we initiated or another one which
// is active now
{
wxLogError(_("Cannot hang up - no active dialup connection."));
- return FALSE;
+ return false;
}
DWORD dwRet = ms_pfnRasHangUp(hRasConn);
ms_isConnected = FALSE;
- return TRUE;
+ return true;
}
bool wxDialUpManagerMSW::IsAlwaysOnline() const
{
// assume no permanent connection by default
- bool isAlwaysOnline = FALSE;
+ bool isAlwaysOnline = false;
// try to use WinInet functions
bool wxDialUpManagerMSW::IsOnline() const
{
- wxCHECK_MSG( IsOk(), FALSE, wxT("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), false, wxT("using uninitialized wxDialUpManager") );
if ( IsAlwaysOnline() )
{
}
else
{
- // return TRUE if there is at least one active connection
+ // return true if there is at least one active connection
return FindActiveConnection() != 0;
}
}
bool wxDialUpManagerMSW::EnableAutoCheckOnlineStatus(size_t nSeconds)
{
- wxCHECK_MSG( IsOk(), FALSE, wxT("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), false, wxT("using uninitialized wxDialUpManager") );
if ( m_autoCheckLevel++ )
{
// already checking
- return TRUE;
+ return true;
}
bool ok = ms_pfnRasConnectionNotification != 0;
if ( m_hThread != 0 )
{
if ( ::ResumeThread(m_hThread) != (DWORD)-1 )
- return TRUE;
+ return true;
// we're leaving a zombie thread... but what else can we do?
wxLogLastError(wxT("ResumeThread(RasThread)"));
- ok = FALSE;
+ ok = false;
}
}
{
wxLogLastError(wxT("CreateEvent(RasStatus)"));
- ok = FALSE;
+ ok = false;
}
}
CleanUpThreadData();
- ok = FALSE;
+ ok = false;
}
}
CleanUpThreadData();
- ok = FALSE;
+ ok = false;
}
// and subclass it
}
else
{
- return TRUE;
+ return true;
}
}
}
m_timerStatusPolling.Start(nSeconds * 1000);
- return TRUE;
+ return true;
}
void wxDialUpManagerMSW::DisableAutoCheckOnlineStatus()
handles[0] = data->hEventRas;
handles[1] = data->hEventQuit;
- bool cont = TRUE;
+ bool cont = true;
while ( cont )
{
DWORD dwRet = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
break;
case WAIT_OBJECT_0 + 1:
- cont = FALSE;
+ cont = false;
break;
default:
rasconnstate, dwError);
}
-#endif // __PALMOS__
+#endif // __WXPALMOS__
#endif // wxUSE_DIALUP_MANAGER
/////////////////////////////////////////////////////////////////////////////
// Name: palmos/dir.cpp
-// Purpose: wxDir implementation for Win32
+// Purpose: wxDir implementation for PalmOS
// Author: William Osborne
// Modified by:
// Created: 10.13.04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Author: William Osborne
// Modified by:
// Created: 10/14/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// constructors
wxFontRefData()
{
- Init(-1, wxSize(0, 0), FALSE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
- wxFONTWEIGHT_NORMAL, FALSE, wxEmptyString,
+ Init(-1, wxSize(0, 0), false, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL, false, wxEmptyString,
wxFONTENCODING_DEFAULT);
}
else
{
m_pointSize = pointSize;
- m_sizeUsingPixels = FALSE;
+ m_sizeUsingPixels = false;
}
}
else
{
m_pixelSize = pixelSize;
- m_sizeUsingPixels = TRUE;
+ m_sizeUsingPixels = true;
}
}
const wxString& faceName,
wxFontEncoding encoding)
{
- return false;
+ return false;
}
wxFont::~wxFont()
bool wxFont::RealizeResource()
{
- return false;
+ return false;
}
bool wxFont::FreeResource(bool WXUNUSED(force))
return (WXHANDLE)0;
}
-WXHFONT wxFont::GetHFONT() const
-{
- return 0;
-}
-
bool wxFont::IsFree() const
{
return false;
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#endif
#include "wx/string.h"
-#include "wx/window.h"
-
-#if !defined(__WIN32__) && !defined(_MMRESULT_)
-typedef UINT MMRESULT;
-#endif
-
#include "wx/window.h"
#include "wx/palmos/joystick.h"
// Author: William Osborne
// Modified by:
// Created: 10/12/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// other standard headers
#include <string.h>
-#ifdef __PALMOS__
- #include <PalmOS.h>
- #include <Menu.h>
-#endif
+#include <Menu.h>
// ----------------------------------------------------------------------------
// global variables
wxBEGIN_HANDLERS_TABLE(wxMenuInfo)
wxEND_HANDLERS_TABLE()
-wxCONSTRUCTOR_2( wxMenuInfo , wxMenu* , Menu , wxString , Title )
+wxCONSTRUCTOR_2( wxMenuInfo , wxMenu* , Menu , wxString , Title )
wxCOLLECTION_TYPE_INFO( wxMenuInfo * , wxMenuInfoList ) ;
{
if ( IsAttached() && GetMenuBar()->IsAttached() )
{
- // Regenerate the menu resource
+ // Regenerate the menu resource
GetMenuBar()->Refresh();
}
-
- return TRUE;
+
+ return true;
}
void wxMenu::EndRadioGroup()
}
else if(IsAttached() && GetMenuBar()->IsAttached())
{
- // Regenerate the menu resource
+ // Regenerate the menu resource
GetMenuBar()->Refresh();
}
-
- return item;
+
+ return item;
}
wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item)
if (wxMenuBase::DoInsert(pos, item) && DoInsertOrAppend(item, pos))
return item;
else
- return NULL;
+ return NULL;
}
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
// remove the item from the menu
wxMenuItem *ret=wxMenuBase::DoRemove(item);
-
+
if ( IsAttached() && GetMenuBar()->IsAttached() )
{
- // Regenerate the menu resource
+ // Regenerate the menu resource
GetMenuBar()->Refresh();
}
-
+
return ret;
}
if ( IsAttached() && GetMenuBar()->IsAttached() )
{
- // Regenerate the menu resource
+ // Regenerate the menu resource
GetMenuBar()->Refresh();
}
}
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
{
if ( !wxMenuBarBase::Insert(pos, menu, title) )
- return FALSE;
+ return false;
m_titles.Insert(wxStripMenuCodes(title), pos);
Refresh();
}
- return TRUE;
+ return true;
}
bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
{
if ( !wxMenuBarBase::Append(menu, title) )
- return FALSE;
+ return false;
m_titles.Add(wxStripMenuCodes(title));
Refresh();
}
- return TRUE;
+ return true;
}
wxMenu *wxMenuBar::Remove(size_t pos)
{
if(!IsAttached())
return -1;
-
+
int MenuNum=(ItemID/1000)-1;
int ItemNum=(ItemID-(1000*(MenuNum+1)));
-
+
// Should never happen, but it doesn't hurt to check anyway.
if(MenuNum>GetMenuCount())
return -1;
// Get the menu
wxMenu *ActiveMenu=GetMenu(MenuNum);
-
+
// Make sure this is a valid item.
if(ItemNum>ActiveMenu->GetMenuItemCount())
return -1;
return ActiveID;
}
-/* Palm OS does not have good dynamic menu support. About all you can do with
- * the standard API calls is to add new items to an existing drop-down menu and
- * hide/show items in a drop-down menu. It is impossible to add, hide, or
- * change the label on a drop-down menu.
- *
- * The easiest and simplest way around this limitation is to modify the Palm OS
- * MenuBarType structure directly. This gives limited ability to change the
- * label on a drop-down menu. I have not been able to find a safe way to add,
+/* Palm OS does not have good dynamic menu support. About all you can do with
+ * the standard API calls is to add new items to an existing drop-down menu and
+ * hide/show items in a drop-down menu. It is impossible to add, hide, or
+ * change the label on a drop-down menu.
+ *
+ * The easiest and simplest way around this limitation is to modify the Palm OS
+ * MenuBarType structure directly. This gives limited ability to change the
+ * label on a drop-down menu. I have not been able to find a safe way to add,
* delete, or resize drop-down menus in OS 6.
- *
+ *
* The following routine attempt to work around these limitations present in the
- * Palm OS API to provide limited dynamic menu support. This solution is far
+ * Palm OS API to provide limited dynamic menu support. This solution is far
* from perfect, but the only other option is to wait for PalmSource to add full
* dynamic menu support, or to recreate the Palm OS menu system from scratch.
- *
+ *
* This system is limited in that no more than 4 drop-down menus are allowed per
* menu bar, and the label for each drop-down menu is limited to 8 characters of
* text. However, this menu system should work for most applications.
- *
- * Basically the menu routines select one of four menu bars, depending on
- * whether or not the requested menu bar has one, two, three, or four drop-down
+ *
+ * Basically the menu routines select one of four menu bars, depending on
+ * whether or not the requested menu bar has one, two, three, or four drop-down
* menus.
- *
- * These four "template" menu bars contain one, two, three, or four drop-down
- * menus. Each menu has a dummy menu item attached to it to allow the Palm OS
+ *
+ * These four "template" menu bars contain one, two, three, or four drop-down
+ * menus. Each menu has a dummy menu item attached to it to allow the Palm OS
* MenuAddItem function to add the real items.
- *
- * The labels on the drop-down menus are then replaced with the labels of the
+ *
+ * The labels on the drop-down menus are then replaced with the labels of the
* real menus.
- *
- * The menu is then attached to the active window and the MenuAddItem API
- * function is called to add the items to each drop-down menu. Finally,
+ *
+ * The menu is then attached to the active window and the MenuAddItem API
+ * function is called to add the items to each drop-down menu. Finally,
* MenuHideItem is called to remove the dummy items from each drop-down menu.
*/
void wxMenuBar::LoadMenu()
{
int i=0;
int j=0;
-
+
// Handle to the currently running application database
DmOpenRef AppDB;
int NumMenus=GetMenuCount();
// Set up the pointers and handles
- char *PalmOSMenuBarPtr;
+ char *PalmOSMenuBarPtr;
MemHandle PalmOSMenuBar;
-
+
// Load the menu template and set up the menu pointers
if(NumMenus==1)
{
PalmOSMenuBar=DmGetResource(AppDB,'MBAR',1000);
PalmOSMenuBarPtr=(char *)MemHandleLock(PalmOSMenuBar);
- PalmOSMenuBarPtr+=74;
+ PalmOSMenuBarPtr+=74;
}
else if(NumMenus==2)
{
}
else
{
- // We support a maximum of 4 menus, so make sure that do not create
+ // We support a maximum of 4 menus, so make sure that do not create
// more than we can handle.
NumMenus=4;
PalmOSMenuBarPtr+=200;
}
-
+
// Set the proper names for the drop-down triggers.
for(i=0;i<NumMenus;i++)
{
// Clear out the old label
char buffer[8]={' ',' ',' ',' ',' ',' ',' ',' '};
MemMove(PalmOSMenuBarPtr,buffer,8);
-
+
wxString MenuTitle=m_titles.Item(i);
// Make sure we don't copy more than 8 bytes for the label
}
// We are done with the menu pointer.
- MemHandleUnlock(PalmOSMenuBar);
+ MemHandleUnlock(PalmOSMenuBar);
DmReleaseResource(PalmOSMenuBar);
- // We must make the menu active before we can add items to the drop-down
+ // We must make the menu active before we can add items to the drop-down
// triggers.
FrmSetMenu(FrmGetActiveForm(),AppDB,NumMenus*1000);
- /* Add the menu items to the drop-down triggers. This must be done after
- * setting the triggers, because setting the names of drop-down triggers
- * that have a variable number of items requires carefull calculation of
+ /* Add the menu items to the drop-down triggers. This must be done after
+ * setting the triggers, because setting the names of drop-down triggers
+ * that have a variable number of items requires carefull calculation of
* the offsets in the MenuBarType structure. Setting the triggers first
* avoids this.
*/
for(i=0;i<NumMenus;i++)
{
wxMenu *CurrentMenu=GetMenu(i);
-
+
for(j=0;j<CurrentMenu->GetMenuItemCount();j++)
{
wxMenuItem *CurrentItem=CurrentMenu->FindItemByPosition(j);
wxString ItemLabel=CurrentItem->GetLabel();
-
+
if(CurrentItem->IsSeparator()==true)
{
char Separator=MenuSeparatorChar;
MenuAddItem(((i*1000)+1000)+j-1,((i*1000)+1000)+j,0x00,ItemLabel);
}
}
-
+
// Hide the dummy menu item, since we don't need it anymore.
MenuHideItem(9000+i);
}
void wxMenuBar::Attach(wxFrame *frame)
{
wxMenuBarBase::Attach(frame);
-
- LoadMenu();
-}
-#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
-bool wxMenuBar::AddAdornments(long style)
-{
- return false;
+ LoadMenu();
}
-#endif
void wxMenuBar::Detach()
{
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// wxMakeMetafilePlaceable
// ----------------------------------------------------------------------------
-#ifdef __WIN32__
-struct RECT32
-{
- short left;
- short top;
- short right;
- short bottom;
-};
-
-struct mfPLACEABLEHEADER {
- DWORD key;
- short hmf;
- RECT32 bbox;
- WORD inch;
- DWORD reserved;
- WORD checksum;
-};
-#else
struct mfPLACEABLEHEADER {
DWORD key;
HANDLE hmf;
DWORD reserved;
WORD checksum;
};
-#endif
/*
* Pass filename of existing non-placeable metafile, and bounding box.
#endif
// This really doesn't apply to Palm OS
-#ifdef __PALMOS__
+#ifdef __WXPALMOS__
#if wxUSE_MIMETYPE
#include "wx/dynarray.h"
#include "wx/confbase.h"
-#ifdef __WXMSW__
- #include "wx/palmos/registry.h"
- #include "wx/palmos/private.h"
-#endif // OS
-
#include "wx/palmos/mimetype.h"
// other standard headers
void wxFileTypeImpl::Init(const wxString& strFileType, const wxString& ext)
{
// VZ: does it? (FIXME)
- wxCHECK_RET( !ext.IsEmpty(), _T("needs an extension") );
+ wxCHECK_RET( !ext.empty(), _T("needs an extension") );
if ( ext[0u] != wxT('.') ) {
m_ext = wxT('.');
wxArrayString *commands,
const wxFileType::MessageParameters& params) const
{
- wxCHECK_MSG( !m_ext.IsEmpty(), 0, _T("GetAllCommands() needs an extension") );
+ wxCHECK_MSG( !m_ext.empty(), 0, _T("GetAllCommands() needs an extension") );
- if ( m_strFileType.IsEmpty() )
+ if ( m_strFileType.empty() )
{
// get it from the registry
wxFileTypeImpl *self = wxConstCast(this, wxFileTypeImpl);
{
wxLogError(_("Failed to create registry entry for '%s' files."),
m_ext.c_str());
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
*openCmd = wxFileType::ExpandCommand(cmd, params);
- return !openCmd->IsEmpty();
+ return !openCmd->empty();
}
bool
*printCmd = wxFileType::ExpandCommand(cmd, params);
- return !printCmd->IsEmpty();
+ return !printCmd->empty();
}
// ----------------------------------------------------------------------------
// TODO this function is half implemented
bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
{
- if ( m_ext.IsEmpty() ) {
+ if ( m_ext.empty() ) {
// the only way to get the list of extensions from the file type is to
// scan through all extensions in the registry - too slow...
- return FALSE;
+ return false;
}
else {
extensions.Empty();
extensions.Add(m_ext);
// it's a lie too, we don't return _all_ extensions...
- return TRUE;
+ return true;
}
}
if ( !GetMimeType(&s) )
{
- return FALSE;
+ return false;
}
mimeTypes.Clear();
mimeTypes.Add(s);
- return TRUE;
+ return true;
}
// index may be omitted, in which case BeforeLast(',') is empty and
// AfterLast(',') is the whole string
- if ( strFullPath.IsEmpty() ) {
+ if ( strFullPath.empty() ) {
strFullPath = strIndex;
strIndex = wxT("0");
}
iconLoc->SetIndex(wxAtoi(strIndex));
}
- return TRUE;
+ return true;
}
}
// no such file type or no value or incorrect icon entry
- return FALSE;
+ return false;
}
bool wxFileTypeImpl::GetDescription(wxString *desc) const
if ( key.Open(wxRegKey::Read) ) {
// it's the default value of the key
if ( key.QueryValue(wxEmptyString, *desc) ) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
// helper function
// suppress possible error messages
wxLogNull nolog;
- bool knownExtension = FALSE;
+ bool knownExtension = false;
wxString strFileType;
wxRegKey key(wxRegKey::HKCR, str);
// this extension doesn't have a filetype, but it's known to the
// system and may be has some other useful keys (open command or
// content-type), so still return a file type object for it
- knownExtension = TRUE;
+ knownExtension = true;
}
}
const wxString& verb,
bool WXUNUSED(overwriteprompt))
{
- wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), FALSE,
+ wxCHECK_MSG( !m_ext.empty() && !verb.empty(), false,
_T("SetCommand() needs an extension and a verb") );
if ( !EnsureExtKeyExists() )
- return FALSE;
+ return false;
wxRegKey rkey(wxRegKey::HKCR, GetVerbPath(verb));
#if 0
#endif // wxUSE_GUI
{
// cancelled by user
- return FALSE;
+ return false;
}
}
#endif
/* // no longer used
bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig)
{
- wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("SetMimeType() needs extension") );
+ wxCHECK_MSG( !m_ext.empty(), false, _T("SetMimeType() needs extension") );
if ( !EnsureExtKeyExists() )
- return FALSE;
+ return false;
// VZ: is this really useful? (FIXME)
wxString mimeType;
bool wxFileTypeImpl::SetDefaultIcon(const wxString& cmd, int index)
{
- wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("SetDefaultIcon() needs extension") );
- wxCHECK_MSG( !m_strFileType.IsEmpty(), FALSE, _T("File key not found") );
+ wxCHECK_MSG( !m_ext.empty(), false, _T("SetDefaultIcon() needs extension") );
+ wxCHECK_MSG( !m_strFileType.empty(), false, _T("File key not found") );
// the next line fails on a SMBshare, I think because it is case mangled
-// wxCHECK_MSG( !wxFileExists(cmd), FALSE, _T("Icon file not found.") );
+// wxCHECK_MSG( !wxFileExists(cmd), false, _T("Icon file not found.") );
if ( !EnsureExtKeyExists() )
- return FALSE;
+ return false;
wxRegKey rkey(wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon"));
bool wxFileTypeImpl::SetDescription (const wxString& desc)
{
- wxCHECK_MSG( !m_strFileType.IsEmpty(), FALSE, _T("File key not found") );
- wxCHECK_MSG( !desc.IsEmpty(), FALSE, _T("No file description supplied") );
+ wxCHECK_MSG( !m_strFileType.empty(), false, _T("File key not found") );
+ wxCHECK_MSG( !desc.empty(), false, _T("No file description supplied") );
if ( !EnsureExtKeyExists() )
- return FALSE;
+ return false;
wxRegKey rkey(wxRegKey::HKCR, m_strFileType );
bool wxFileTypeImpl::Unassociate()
{
- bool result = TRUE;
+ bool result = true;
if ( !RemoveOpenCommand() )
- result = FALSE;
+ result = false;
if ( !RemoveDefaultIcon() )
- result = FALSE;
+ result = false;
if ( !RemoveMimeType() )
- result = FALSE;
+ result = false;
if ( !RemoveDescription() )
- result = FALSE;
+ result = false;
/*
//this might hold other keys, eg some have CSLID keys
bool wxFileTypeImpl::RemoveCommand(const wxString& verb)
{
- wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), FALSE,
+ wxCHECK_MSG( !m_ext.empty() && !verb.empty(), false,
_T("RemoveCommand() needs an extension and a verb") );
wxString sKey = m_strFileType;
bool wxFileTypeImpl::RemoveMimeType()
{
- wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("RemoveMimeType() needs extension") );
+ wxCHECK_MSG( !m_ext.empty(), false, _T("RemoveMimeType() needs extension") );
wxRegKey rkey(wxRegKey::HKCR, m_ext);
return !rkey.Exists() || rkey.DeleteSelf();
bool wxFileTypeImpl::RemoveDefaultIcon()
{
- wxCHECK_MSG( !m_ext.IsEmpty(), FALSE,
+ wxCHECK_MSG( !m_ext.empty(), false,
_T("RemoveDefaultIcon() needs extension") );
wxRegKey rkey (wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon"));
bool wxFileTypeImpl::RemoveDescription()
{
- wxCHECK_MSG( !m_ext.IsEmpty(), FALSE,
+ wxCHECK_MSG( !m_ext.empty(), false,
_T("RemoveDescription() needs extension") );
wxRegKey rkey (wxRegKey::HKCR, m_strFileType );
}
#endif // wxUSE_MIMETYPE
-#endif // __PALMOS__
+#endif // __WXPALMOS__
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-// This may or may not apply to Palm OS in the future, but for right now Unicode
+// This may or may not apply to Palm OS in the future, but for right now Unicode
// is not supported.
-#ifndef __PALMOS__
+#ifndef __WXPALMOS__
#ifdef __BORLANDC__
#pragma hdrstop
return _tremove(name);
}
-#if defined( __VISUALC__ ) \
- || ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \
- || ( defined(__MWERKS__) && defined(__WXMSW__) ) \
- || ( defined(__BORLANDC__) && (__BORLANDC__ > 0x460) )
-
-WXDLLEXPORT int wxMSLU__wopen(const wxChar *name, int flags, int mode)
-{
- if ( wxUsingUnicowsDll() )
-#ifdef __BORLANDC__
- return open(wxConvFile.cWX2MB(name), flags, mode);
-#else
- return _open(wxConvFile.cWX2MB(name), flags, mode);
-#endif
- else
- return _wopen(name, flags, mode);
-}
-
-WXDLLEXPORT int wxMSLU__waccess(const wxChar *name, int mode)
-{
- if ( wxUsingUnicowsDll() )
- return _access(wxConvFile.cWX2MB(name), mode);
- else
- return _waccess(name, mode);
-}
-
-WXDLLEXPORT int wxMSLU__wmkdir(const wxChar *name)
-{
- if ( wxUsingUnicowsDll() )
- return _mkdir(wxConvFile.cWX2MB(name));
- else
- return _wmkdir(name);
-}
-
-WXDLLEXPORT int wxMSLU__wrmdir(const wxChar *name)
-{
- if ( wxUsingUnicowsDll() )
- return _rmdir(wxConvFile.cWX2MB(name));
- else
- return _wrmdir(name);
-}
-
-WXDLLEXPORT int wxMSLU__wstat(const wxChar *name, struct _stat *buffer)
-{
- if ( wxUsingUnicowsDll() )
- return _stat((const char*)wxConvFile.cWX2MB(name), buffer);
- else
- return _wstat(name, buffer);
-}
-
-#endif // compilers having wopen() &c
-
#endif // wxUSE_BASE
#endif // wxUSE_UNICODE_MSLU
-#endif // __PALMOS__
+#endif // __WXPALMOS__
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
virtual bool OnInit()
{
ms_systemMenuFont = new wxFont;
-
-#if defined(__WXMSW__) && defined(__WIN32__) && defined(SM_CXMENUCHECK)
- NONCLIENTMETRICS nm;
- nm.cbSize = sizeof(NONCLIENTMETRICS);
- SystemParametersInfo(SPI_GETNONCLIENTMETRICS,0,&nm,0);
-
- ms_systemMenuButtonWidth = nm.iMenuHeight;
- ms_systemMenuHeight = nm.iMenuHeight;
-
- // create menu font
- wxNativeFontInfo info;
- memcpy(&info.lf, &nm.lfMenuFont, sizeof(LOGFONT));
- ms_systemMenuFont->Create(info);
-#endif
-
return true;
}
// - add high level functions (RegisterOleServer, ...)
///////////////////////////////////////////////////////////////////////////////
-// This really doesn't apply to the Palm OS platform. It would be better to
-// support the Palm OS preference database instead.
-#ifndef __PALMOS__
-
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "registry.h"
#endif
#pragma hdrstop
#endif
+// This really doesn't apply to the Palm OS platform. It would be better to
+// support the Palm OS preference database instead.
+#ifndef __WXPALMOS__
+
// other wxWidgets headers
#include "wx/string.h"
#include "wx/intl.h"
}
else {
strKey = strKey.After(REG_SEPARATOR);
- if ( !strKey.IsEmpty() && strKey.Last() == REG_SEPARATOR )
+ if ( !strKey.empty() && strKey.Last() == REG_SEPARATOR )
strKey.Truncate(strKey.Len() - 1);
}
: m_strKey(keyParent.m_strKey)
{
// combine our name with parent's to get the full name
- if ( !m_strKey.IsEmpty() &&
- (strKey.IsEmpty() || strKey[0] != REG_SEPARATOR) ) {
+ if ( !m_strKey.empty() &&
+ (strKey.empty() || strKey[0] != REG_SEPARATOR) ) {
m_strKey += REG_SEPARATOR;
}
// next line!
m_strKey.clear();
m_strKey += keyParent.m_strKey;
- if ( !strKey.IsEmpty() && strKey[0] != REG_SEPARATOR )
+ if ( !strKey.empty() && strKey[0] != REG_SEPARATOR )
m_strKey += REG_SEPARATOR;
m_strKey += strKey;
// info about the key
// ----------------------------------------------------------------------------
-// returns TRUE if the key exists
+// returns true if the key exists
bool wxRegKey::Exists() const
{
// opened key has to exist, try to open it if not done yet
- return IsOpened() ? TRUE : KeyExists(m_hRootKey, m_strKey);
+ return IsOpened() ? true : KeyExists(m_hRootKey, m_strKey);
}
// returns the full name of the key (prefix is abbreviated if bShortPrefix)
StdKey key = GetStdKeyFromHkey((WXHKEY) m_hRootKey);
wxString str = bShortPrefix ? aStdKeys[key].szShortName
: aStdKeys[key].szName;
- if ( !m_strKey.IsEmpty() )
+ if ( !m_strKey.empty() )
str << _T("\\") << m_strKey;
return str;
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("Can't get info about registry key '%s'"),
GetName().c_str());
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
bool wxRegKey::Open(AccessMode mode)
{
if ( IsOpened() )
- return TRUE;
+ return true;
HKEY tmpKey;
m_dwLastError = ::RegOpenKeyEx
{
wxLogSysError(m_dwLastError, _("Can't open registry key '%s'"),
GetName().c_str());
- return FALSE;
+ return false;
}
m_hKey = (WXHKEY) tmpKey;
- return TRUE;
+ return true;
}
// creates key, failing if it exists and !bOkIfExists
bool wxRegKey::Create(bool bOkIfExists)
{
- // check for existence only if asked (i.e. order is important!)
- if ( !bOkIfExists && Exists() )
- return FALSE;
+ // check for existence only if asked (i.e. order is important!)
+ if ( !bOkIfExists && Exists() )
+ return false;
- if ( IsOpened() )
- return TRUE;
+ if ( IsOpened() )
+ return true;
- HKEY tmpKey;
+ HKEY tmpKey;
#ifdef __WXWINCE__
- DWORD disposition;
- m_dwLastError = RegCreateKeyEx((HKEY) m_hRootKey, m_strKey,
- NULL, // reserved
- NULL, // class string
- 0,
- 0,
- NULL,
- &tmpKey,
- &disposition);
+ DWORD disposition;
+ m_dwLastError = RegCreateKeyEx((HKEY) m_hRootKey, m_strKey,
+ NULL, // reserved
+ NULL, // class string
+ 0,
+ 0,
+ NULL,
+ &tmpKey,
+ &disposition);
#else
- m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey, &tmpKey);
+ m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey, &tmpKey);
#endif
- if ( m_dwLastError != ERROR_SUCCESS ) {
- wxLogSysError(m_dwLastError, _("Can't create registry key '%s'"),
- GetName().c_str());
- return FALSE;
- }
- else
- {
- m_hKey = (WXHKEY) tmpKey;
- return TRUE;
- }
+ if ( m_dwLastError != ERROR_SUCCESS ) {
+ wxLogSysError(m_dwLastError, _("Can't create registry key '%s'"),
+ GetName().c_str());
+ return false;
+ }
+ else
+ {
+ m_hKey = (WXHKEY) tmpKey;
+ return true;
+ }
}
// close the key, it's not an error to call it when not opened
bool wxRegKey::Close()
{
- if ( IsOpened() ) {
- m_dwLastError = RegCloseKey((HKEY) m_hKey);
- m_hKey = 0;
+ if ( IsOpened() ) {
+ m_dwLastError = RegCloseKey((HKEY) m_hKey);
+ m_hKey = 0;
- if ( m_dwLastError != ERROR_SUCCESS ) {
- wxLogSysError(m_dwLastError, _("Can't close registry key '%s'"),
- GetName().c_str());
+ if ( m_dwLastError != ERROR_SUCCESS ) {
+ wxLogSysError(m_dwLastError, _("Can't close registry key '%s'"),
+ GetName().c_str());
- return FALSE;
+ return false;
+ }
}
- }
- return TRUE;
+ return true;
}
bool wxRegKey::RenameValue(const wxChar *szValueOld, const wxChar *szValueNew)
{
- bool ok = TRUE;
+ bool ok = true;
if ( HasValue(szValueNew) ) {
wxLogError(_("Registry value '%s' already exists."), szValueNew);
- ok = FALSE;
+ ok = false;
}
if ( !ok ||
wxLogError(_("Failed to rename registry value '%s' to '%s'."),
szValueOld, szValueNew);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
bool wxRegKey::CopyValue(const wxChar *szValue,
// exactly they should be copied and because they shouldn't
// occur among the application keys (supposedly created with
// this class)
-#ifdef __WIN32__
- case Type_None:
- case Type_Expand_String:
- case Type_Binary:
- case Type_Dword_big_endian:
- case Type_Link:
- case Type_Multi_String:
- case Type_Resource_list:
- case Type_Full_resource_descriptor:
- case Type_Resource_requirements_list:
-#endif // Win32
default:
wxLogError(_("Can't copy values of unsupported type %d."),
GetValueType(szValue));
- return FALSE;
+ return false;
}
}
bool wxRegKey::Rename(const wxChar *szNewName)
{
- wxCHECK_MSG( !!m_strKey, FALSE, _T("registry hives can't be renamed") );
+ wxCHECK_MSG( !!m_strKey, false, _T("registry hives can't be renamed") );
if ( !Exists() ) {
wxLogError(_("Registry key '%s' does not exist, cannot rename it."),
GetFullName(this));
- return FALSE;
+ return false;
}
// do we stay in the same hive?
keyDst.SetName(szNewName);
}
- bool ok = keyDst.Create(FALSE /* fail if alredy exists */);
+ bool ok = keyDst.Create(false /* fail if alredy exists */);
if ( !ok ) {
wxLogError(_("Registry key '%s' already exists."),
GetFullName(&keyDst));
{
// create the new key first
wxRegKey keyDst(szNewName);
- bool ok = keyDst.Create(FALSE /* fail if alredy exists */);
+ bool ok = keyDst.Create(false /* fail if alredy exists */);
if ( ok ) {
ok = Copy(keyDst);
bool wxRegKey::Copy(wxRegKey& keyDst)
{
- bool ok = TRUE;
+ bool ok = true;
// copy all sub keys to the new location
wxString strKey;
wxLogNull nolog;
if ( !Open() ) {
// it already doesn't exist - ok!
- return TRUE;
+ return true;
}
}
// prevent a buggy program from erasing one of the root registry keys or an
// immediate subkey (i.e. one which doesn't have '\\' inside) of any other
// key except HKCR (HKCR has some "deleteable" subkeys)
- if ( m_strKey.IsEmpty() ||
+ if ( m_strKey.empty() ||
((m_hRootKey != (WXHKEY) aStdKeys[HKCR].hkey) &&
(m_strKey.Find(REG_SEPARATOR) == wxNOT_FOUND)) ) {
wxLogError(_("Registry key '%s' is needed for normal system operation,\ndeleting it will leave your system in unusable state:\noperation aborted."), GetFullName(this));
- return FALSE;
+ return false;
}
// we can't delete keys while enumerating because it confuses GetNextKey, so
for ( size_t nKey = 0; nKey < nKeyCount; nKey++ ) {
wxRegKey key(*this, astrSubkeys[nKey]);
if ( !key.DeleteSelf() )
- return FALSE;
+ return false;
}
// now delete this key itself
m_dwLastError != ERROR_FILE_NOT_FOUND ) {
wxLogSysError(m_dwLastError, _("Can't delete key '%s'"),
GetName().c_str());
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
bool wxRegKey::DeleteKey(const wxChar *szKey)
{
if ( !Open() )
- return FALSE;
+ return false;
wxRegKey key(*this, szKey);
return key.DeleteSelf();
bool wxRegKey::DeleteValue(const wxChar *szValue)
{
if ( !Open() )
- return FALSE;
+ return false;
m_dwLastError = RegDeleteValue((HKEY) m_hKey, WXSTRINGCAST szValue);
(m_dwLastError != ERROR_FILE_NOT_FOUND) ) {
wxLogSysError(m_dwLastError, _("Can't delete value '%s' from key '%s'"),
szValue, GetName().c_str());
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
// access to values and subkeys
// ----------------------------------------------------------------------------
-// return TRUE if value exists
+// return true if value exists
bool wxRegKey::HasValue(const wxChar *szValue) const
{
// this function should be silent, so suppress possible messages from Open()
wxLogNull nolog;
if ( !CONST_CAST Open() )
- return FALSE;
+ return false;
LONG dwRet = ::RegQueryValueEx((HKEY) m_hKey,
WXSTRINGCAST szValue,
return dwRet == ERROR_SUCCESS;
}
-// returns TRUE if this key has any values
+// returns true if this key has any values
bool wxRegKey::HasValues() const
{
// suppress possible messages from GetFirstValue()
return CONST_CAST GetFirstValue(str, l);
}
-// returns TRUE if this key has any subkeys
+// returns true if this key has any subkeys
bool wxRegKey::HasSubkeys() const
{
// suppress possible messages from GetFirstKey()
return CONST_CAST GetFirstKey(str, l);
}
-// returns TRUE if given subkey exists
+// returns true if given subkey exists
bool wxRegKey::HasSubKey(const wxChar *szKey) const
{
// this function should be silent, so suppress possible messages from Open()
wxLogNull nolog;
if ( !CONST_CAST Open() )
- return FALSE;
+ return false;
return KeyExists(m_hKey, szKey);
}
return (ValueType)dwType;
}
-#ifdef __WIN32__
-bool wxRegKey::SetValue(const wxChar *szValue, long lValue)
-{
- if ( CONST_CAST Open() ) {
- m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_DWORD,
- (RegString)&lValue, sizeof(lValue));
- if ( m_dwLastError == ERROR_SUCCESS )
- return TRUE;
- }
-
- wxLogSysError(m_dwLastError, _("Can't set value of '%s'"),
- GetFullName(this, szValue));
- return FALSE;
-}
-
-bool wxRegKey::QueryValue(const wxChar *szValue, long *plValue) const
-{
- if ( CONST_CAST Open() ) {
- DWORD dwType, dwSize = sizeof(DWORD);
- RegString pBuf = (RegString)plValue;
- m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
- &dwType, pBuf, &dwSize);
- if ( m_dwLastError != ERROR_SUCCESS ) {
- wxLogSysError(m_dwLastError, _("Can't read value of key '%s'"),
- GetName().c_str());
- return FALSE;
- }
- else {
- // check that we read the value of right type
- wxASSERT_MSG( IsNumericValue(szValue),
- wxT("Type mismatch in wxRegKey::QueryValue().") );
-
- return TRUE;
- }
- }
- else
- return FALSE;
-}
-
-#endif //Win32
-
bool wxRegKey::QueryValue(const wxChar *szValue,
wxString& strValue,
bool raw) const
wxASSERT_MSG( !IsNumericValue(szValue),
wxT("Type mismatch in wxRegKey::QueryValue().") );
- return TRUE;
+ return true;
}
}
}
wxLogSysError(m_dwLastError, _("Can't read value of '%s'"),
GetFullName(this, szValue));
- return FALSE;
+ return false;
}
bool wxRegKey::SetValue(const wxChar *szValue, const wxString& strValue)
(RegString)strValue.c_str(),
(strValue.Len() + 1)*sizeof(wxChar));
if ( m_dwLastError == ERROR_SUCCESS )
- return TRUE;
+ return true;
}
wxLogSysError(m_dwLastError, _("Can't set value of '%s'"),
GetFullName(this, szValue));
- return FALSE;
+ return false;
}
wxString wxRegKey::QueryDefaultValue() const
bool wxRegKey::GetFirstValue(wxString& strValueName, long& lIndex)
{
if ( !Open() )
- return FALSE;
+ return false;
lIndex = 0;
return GetNextValue(strValueName, lIndex);
// are we already at the end of enumeration?
if ( lIndex == -1 )
- return FALSE;
+ return false;
wxChar szValueName[1024]; // @@ use RegQueryInfoKey...
DWORD dwValueLen = WXSIZEOF(szValueName);
GetName().c_str());
}
- return FALSE;
+ return false;
}
strValueName = szValueName;
- return TRUE;
+ return true;
}
bool wxRegKey::GetFirstKey(wxString& strKeyName, long& lIndex)
{
if ( !Open() )
- return FALSE;
+ return false;
lIndex = 0;
return GetNextKey(strKeyName, lIndex);
// are we already at the end of enumeration?
if ( lIndex == -1 )
- return FALSE;
+ return false;
wxChar szKeyName[_MAX_PATH + 1];
GetName().c_str());
}
- return FALSE;
+ return false;
}
strKeyName = szKeyName;
- return TRUE;
+ return true;
}
-// returns TRUE if the value contains a number (else it's some string)
+// returns true if the value contains a number (else it's some string)
bool wxRegKey::IsNumericValue(const wxChar *szValue) const
- {
- ValueType type = GetValueType(szValue);
- switch ( type ) {
+{
+ ValueType type = GetValueType(szValue);
+ switch ( type ) {
case Type_Dword:
/* case Type_Dword_little_endian: == Type_Dword */
case Type_Dword_big_endian:
- return TRUE;
+ return true;
default:
- return FALSE;
- }
- }
+ return false;
+ }
+}
// ============================================================================
// implementation of global private functions
{
// don't close this key itself for the case of empty szKey!
if ( wxIsEmpty(szKey) )
- return TRUE;
+ return true;
HKEY hkeyDummy;
if ( ::RegOpenKeyEx
{
::RegCloseKey(hkeyDummy);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
const wxChar *GetFullName(const wxRegKey *pKey, const wxChar *szValue)
void RemoveTrailingSeparator(wxString& str)
{
- if ( !str.IsEmpty() && str.Last() == REG_SEPARATOR )
+ if ( !str.empty() && str.Last() == REG_SEPARATOR )
str.Truncate(str.Len() - 1);
}
// headers
// ----------------------------------------------------------------------------
-// Palm OS doesn't really have a theme engine, so this is not needed.
-#ifndef __PALMOS__
-
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#pragma hdrstop
#endif
+// Palm OS doesn't really have a theme engine, so this is not needed.
+#ifndef __WXPALMOS__
+
#ifndef WX_PRECOMP
#include "wx/string.h"
#include "wx/window.h"
win, dc, size, position, orient, flags);
return;
}
-
+
// I don't know if it is correct to use the rebar background for the
// splitter but it least this works ok in the default theme
wxUxThemeHandle hTheme(win, L"REBAR");
if ( orient == wxVERTICAL )
{
rect.left = position;
- rect.right = position + SASH_WIDTH;
+ rect.right = position + SASH_WIDTH;
rect.top = 0;
rect.bottom = size.y;
}
0 /* no state */ ,
&rect,
NULL
- );
+ );
}
}
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
IMPLEMENT_DYNAMIC_CLASS_XTI(wxTextCtrl, wxControl,"wx/textctrl.h")
wxBEGIN_PROPERTIES_TABLE(wxTextCtrl)
- wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
+ wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent )
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
{
}
-#ifdef __WIN32__
-
-bool wxTextCtrl::EmulateKeyPress(const wxKeyEvent& event)
-{
- return false;
-}
-
-#endif // __WIN32__
-
// ----------------------------------------------------------------------------
// Clipboard operations
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
-//
+//
// ----------------------------------------------------------------------------
void wxTextCtrl::ShowPosition(long pos)
// Author: William Osborne
// Modified by:
// Created: 10/13/04
-// RCS-ID: $Id:
+// RCS-ID: $Id:
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
return false;
}
-int wxWindowPalm::HandleMenuChar(int chAccel, WXLPARAM lParam)
-{
- return 0;
-}
-
// ---------------------------------------------------------------------------
// joystick
// ---------------------------------------------------------------------------
bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control)
-{
+{
return false;
}