wxDateTime_t millisec = 0);
// from separate values for each component with explicit date
inline wxDateTime(wxDateTime_t day, // day of the month
- Month month = Inv_Month,
+ Month month,
int year = Inv_Year, // 1999, not 99 please!
wxDateTime_t hour = 0,
wxDateTime_t minute = 0,
// from separate values for each component with explicit date
// (defaults for month and year are the current values)
wxDateTime& Set(wxDateTime_t day,
- Month month = Inv_Month,
+ Month month,
int year = Inv_Year, // 1999, not 99 please!
wxDateTime_t hour = 0,
wxDateTime_t minute = 0,
virtual ~wxDrawObject() { }
- virtual void Draw(wxDCBase& dc) const { }
+ virtual void Draw(wxDCBase&) const { }
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
{
#elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
#define __BORLANDC__
#elif defined(__WATCOMC__)
- //#define __WATCOMC__
#elif defined(__SC__)
#define __SYMANTECC__
#endif // compiler
#endif
#endif // __VISUALC__
+// suppress some Watcom C++ warnings
+#ifdef __WATCOMC__
+# pragma warning 849 9 // Disable 'virtual function hidden'
+# pragma warning 549 9 // Disable 'operand contains compiler generated information'
+#endif // __VISUALC__
+
// suppress some Salford C++ warnings
#ifdef __SALFORDC__
# pragma suppress 353 // Possible nested comments
#if defined(__WXMSW__)
-// __declspec works in BC++ 5 and later, as well as VC++ and gcc
-#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__)
+// __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well as VC++ and gcc
+#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
# ifdef WXMAKINGDLL
# define WXDLLEXPORT __declspec( dllexport )
# define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
# define WXDLLIMPORT
#endif
+#ifdef __cplusplus
class WXDLLEXPORT wxObject;
class WXDLLEXPORT wxEvent;
+#endif
/** symbolic constant used by all Find()-like functions returning positive
integer on success as failure indicator */
// ----------------------------------------------------------------------------
// everybody gets the assert and other debug macros
+#ifdef __cplusplus
#include "wx/debug.h"
+#endif
//@{
/// delete pointer if it is not NULL and NULL it afterwards
#endif
// Callback function type definition
+#ifdef __cplusplus
typedef void (*wxFunction) (wxObject&, wxEvent&);
+#endif
// ----------------------------------------------------------------------------
// OS mnemonics -- Identify the running OS (useful for Windows)
wxObject *userData = (wxObject *) NULL )
{ Connect(id, -1, eventType, func, userData); }
- bool Disconnect( int id, int lastId = -1, wxEventType eventType = wxEVT_NULL,
+ bool Disconnect( int id, int lastId, wxEventType eventType,
wxObjectEventFunction func = NULL,
wxObject *userData = (wxObject *) NULL );
// Create a drag image from a bitmap and optional cursor
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor);
- bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot)
+ bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(image, cursor);
// Create a drag image from an icon and optional cursor
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor);
- bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot)
+ bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(image, cursor);
// Create a drag image from a string and optional cursor
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor);
- bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot)
+ bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(str, cursor);
}
bool Create(wxWindow *parent, wxWindowID id,
- long style = 0,
+ long style,
const wxString& name = wxPanelNameStr);
// Create status line
// Name: treelay.h
// Purpose: wxTreeLayout class
// Author: Julian Smart
-// Modified by:
+// Modified by:
// Created: 7/4/98
// RCS-ID: $Id$
// Copyright: (c) 1998 Julian Smart
public:
wxTreeLayout();
-
+
// Redefine these
virtual void GetChildren(long id, wxList& list) = 0;
virtual long GetNextNode(long id) = 0;
virtual void SetNodeY(long id, long y) = 0;
virtual void ActivateNode(long id, bool active) = 0;
virtual bool NodeActive(long id) = 0;
-
+
// Optional redefinition
void Initialize(void);
- inline virtual void SetNodeName(long id, const wxString& name) {}
- inline virtual wxString GetNodeName(long id) { return wxString(""); }
+ inline virtual void SetNodeName(long WXUNUSED(id), const wxString& WXUNUSED(name)) {}
+ inline virtual wxString GetNodeName(long WXUNUSED(id)) { return wxString(""); }
virtual void GetNodeSize(long id, long *x, long *y, wxDC& dc);
virtual void Draw(wxDC& dc);
virtual void DrawNodes(wxDC& dc);
virtual void DrawBranches(wxDC& dc);
virtual void DrawNode(long id, wxDC& dc);
virtual void DrawBranch(long from, long to, wxDC& dc);
-
+
// Don't redefine
virtual void DoLayout(wxDC& dc, long topNode = -1);
-
+
// Accessors -- don't redefine
inline void SetTopNode(long id) { m_parentNode = id; }
inline long GetTopNode(void) const { return m_parentNode; }
inline void SetMargins(long x, long y) { m_leftMargin = x; m_topMargin = y; }
inline long GetTopMargin(void) const { return m_topMargin; }
inline long GetLeftMargin(void) const { return m_leftMargin; }
-
+
inline bool GetOrientation(void) const { return m_orientation; }
inline void SetOrientation(bool orient) { m_orientation = orient; }
-
+
private:
void CalcLayout(long node_id, int level, wxDC& dc);
-
+
// Members
-
+
protected:
long m_parentNode;
long m_lastY;
wxTreeLayoutStored(int noNodes = 200);
~wxTreeLayoutStored(void);
void Initialize(int n);
-
+
wxString HitTest(wxMouseEvent& event, wxDC& dc);
wxStoredNode* GetNode(long id) const;
inline int GetNumNodes() const { return m_maxNodes; };
inline int GetNodeCount() const { return m_num; };
-
+
virtual void GetChildren(long id, wxList& list);
virtual long GetNextNode(long id);
virtual long GetNodeParent(long id);
virtual bool NodeActive(long id);
virtual void SetClientData(long id, long clientData);
virtual long GetClientData(long id) const;
-
+
virtual long AddChild(const wxString& name, const wxString& parent = "");
virtual long NameToId(const wxString& name);
-
+
// Data members
private:
wxStoredNode* m_nodes;
#endif
// _WX_TREELAY_H_
-
+
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket)
* Name: gsocket.h
- * Author: Guilhem Lavaux
+ * Author: Guilhem Lavaux
* Guillermo Rodriguez Garcia <guille@iies.es> (maintainer)
* Purpose: GSocket include file (system independent)
* CVSID: $Id$
* Sets up this socket as a server. The local address must have been
* set with GSocket_SetLocal() before GSocket_SetServer() is called.
* Returns GSOCK_NOERROR on success, one of the following otherwise:
- *
+ *
* Error codes:
* GSOCK_INVSOCK - the socket is in use.
* GSOCK_INVADDR - the local address has not been set.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_SetServer(GSocket *socket);
* GSOCK_TIMEDOUT - timeout, no incoming connections.
* GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking.
* GSOCK_MEMERR - couldn't allocate memory.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocket *GSocket_WaitConnection(GSocket *socket);
* GSOCK_TIMEDOUT - timeout, the connection failed.
* GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only)
* GSOCK_MEMERR - couldn't allocate memory.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_Connect(GSocket *socket, GSocketStream stream);
* Error codes:
* GSOCK_INVSOCK - the socket is in use.
* GSOCK_INVADDR - the local address has not been set.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_SetNonOriented(GSocket *socket);
* operation, there is still data available, the callback function will
* be called again.
* GSOCK_OUTPUT:
- * The socket is available for writing. That is, the next write call
+ * The socket is available for writing. That is, the next write call
* won't block. This event is generated only once, when the connection is
* first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should
size_t EnumAllFileTypes(wxArrayString& mimetypes);
- // these are NOPs under Windows
- bool ReadMailcap(const wxString& filename, bool fallback = TRUE)
+ // this are NOPs under Windows
+ bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = TRUE)
{ return TRUE; }
- bool ReadMimeTypes(const wxString& filename)
+ bool ReadMimeTypes(const wxString& WXUNUSED(filename))
{ return TRUE; }
// create a new filetype association
class WXDLLEXPORT wxDataFormat
{
public:
- // the clipboard formats under Win32 are WORDs
+ // the clipboard formats under Win32 are WORD's
typedef unsigned short NativeFormat;
wxDataFormat(NativeFormat format = wxDF_INVALID) { m_format = format; }
virtual void SetFocus();
- virtual bool Reparent( wxWindow *newParent );
+ virtual bool Reparent( wxWindowBase *newParent );
virtual void WarpPointer(int x, int y);
virtual void CaptureMouse();
bool HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags);
bool HandleMouseMove(int x, int y, WXUINT flags);
- bool HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
- bool HandleKeyDown(WXWORD wParam, WXLPARAM lParam);
- bool HandleKeyUp(WXWORD wParam, WXLPARAM lParam);
+ bool HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII = FALSE);
+ bool HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam);
+ bool HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam);
bool HandleQueryDragIcon(WXHICON *hIcon);
? (className *)(obj) \
: (className *)0)
+// The 'this' pointer is always true, so use this version to cast the this
+// pointer and avoid compiler warnings.
+#define wxDynamicThisCast(obj, className) \
+ (((obj)->IsKindOf(&className::sm_class##className)) \
+ ? (className *)(obj) \
+ : (className *)0)
+
#define wxConstCast(obj, className) ((className *)(obj))
#ifdef __WXDEBUG__
// between the two states.
wxToolBarToolBase *AddTool(int id,
const wxBitmap& bitmap,
- const wxBitmap& pushedBitmap = wxNullBitmap,
+ const wxBitmap& pushedBitmap,
bool toggle = FALSE,
wxObject *clientData = NULL,
const wxString& shortHelpString = wxEmptyString,
m_macPrintSettings = kPMNoPrintSettings;
#else
m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) ) ;
- (**m_macPrintInfo).iPrVersion = 0; // something invalid
+ (**m_macPrintInfo).iPrVersion = 0; // something invalid
(**m_macPrintInfo).prInfo.iHRes = 72;
(**m_macPrintInfo).prInfo.iVRes = 72;
Rect r2 = { -18, -36, 8*72 - 18, 11*72 - 36 } ;
(**m_macPrintInfo).rPaper = r2;
- (**m_macPrintInfo).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch
- (**m_macPrintInfo).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch
+ (**m_macPrintInfo).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch
+ (**m_macPrintInfo).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch
#endif
#endif
m_printOrientation = wxPORTRAIT;
}
#else
wxASSERT( m_macPrintInfo ) ;
- // we should perhaps delete
+ // we should perhaps delete
#endif
#endif
}
m_printData.SetNativeDataDevNames((void*) NULL);
pd->hDC = (HDC) NULL;
- pd->nFromPage = (UINT)m_printFromPage;
- pd->nToPage = (UINT)m_printToPage;
- pd->nMinPage = (UINT)m_printMinPage;
- pd->nMaxPage = (UINT)m_printMaxPage;
- pd->nCopies = (UINT)m_printNoCopies;
+ pd->nFromPage = (WORD)m_printFromPage;
+ pd->nToPage = (WORD)m_printToPage;
+ pd->nMinPage = (WORD)m_printMinPage;
+ pd->nMaxPage = (WORD)m_printMaxPage;
+ pd->nCopies = (WORD)m_printNoCopies;
pd->Flags = PD_RETURNDC ;
m_contextHelp->EndContextHelp();
return TRUE;
}
-
+
if ((event.GetEventType() == wxEVT_CHAR) ||
(event.GetEventType() == wxEVT_KEY_DOWN) ||
(event.GetEventType() == wxEVT_ACTIVATE) ||
m_contextHelp->EndContextHelp();
return TRUE;
}
-
+
if ((event.GetEventType() == wxEVT_PAINT) ||
(event.GetEventType() == wxEVT_ERASE_BACKGROUND))
{
event.Skip();
return FALSE;
}
-
+
return TRUE;
}
wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ;
helpEvent.SetEventObject(this);
eventProcessed = win->GetEventHandler()->ProcessEvent(helpEvent);
-
+
// Go up the window hierarchy until the event is handled (or not).
// I.e. keep submitting ancestor windows until one is recognised
// by the app code that processes the ids and displays help.
{
}
-void wxContextHelpButton::OnContextHelp(wxCommandEvent& event)
+void wxContextHelpButton::OnContextHelp(wxCommandEvent& WXUNUSED(event))
{
wxContextHelp contextHelp(GetParent());
}
#define read _read
#endif
#ifdef __WXMSW__
-int fileno( FILE* ) ;
+//int fileno( FILE* ) ; This is defined in watcom
#else
#if __MSL__ < 0x6000
int fileno( void* ) ;
else
{
time += (time_t)tz.GetOffset();
-#ifdef __VMS__ // time is unsigned so avoid warning
+#if defined(__VMS__) || defined(__WATCOMC__) // time is unsigned so avoid warning
int time2 = (int) time;
if ( time2 >= 0 )
#else
{
time += (int)tz.GetOffset();
-#ifdef __VMS__ // time is unsigned so avoid the warning
+#if defined(__VMS__) || defined(__WATCOMC__) // time is unsigned so avoid warning
int time2 = (int) time;
if ( time2 >= 0 )
#else
haveDay = TRUE;
- day = n + 1;
+ day = (wxDateTime_t)(n + 1);
}
}
}
if (node != NULL)
return ((wxLibrary *)node->Data());
#else // !OS/2
- node = m_loaded.Find(name.GetData());
- if ( node )
+ if ( (node = m_loaded.Find(name.GetData())) != NULL)
return ((wxLibrary *)node->Data());
#endif
// If DLL shares data, this is necessary.
}
// Draw a sunken edge
-void wxEffects::DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize)
+void wxEffects::DrawSunkenEdge(wxDC& dc, const wxRect& rect, int WXUNUSED(borderSize))
{
wxPen highlightPen(m_highlightColour, 1, wxSOLID);
wxPen lightShadowPen(m_lightShadow, 1, wxSOLID);
int w = bitmap.GetWidth();
int h = bitmap.GetHeight();
-
+
wxMemoryDC dcMem;
-
+
if (bitmap.GetPalette() && !hiColour)
{
dc.SetPalette(* bitmap.GetPalette());
else
{
CharsetItem *rev = BuildReverseTable(out_tbl);
- CharsetItem *item, key;
+ CharsetItem *item;
+ CharsetItem key;
for (i = 0; i < 128; i++)
{
if (item)
m_Table[128 + i] = (tchar)item -> c;
else
- m_Table[128 + i] = 128 + i; // don't know => don't touch
+#if wxUSE_WCHAR_T
+ m_Table[128 + i] = (wchar_t)(128 + i);
+#else
+ m_Table[128 + i] = (char)(128 + i);
+#endif
}
delete[] rev;
{
register wxChar *d, *s, *nm;
wxChar lnm[_MAXPATHLEN];
- int q;
+ int q;
// Some compilers don't like this line.
// const wxChar trimchars[] = wxT("\n \t");
}
else
#else
- while ((*d++ = *s)) {
+ while ((*d++ = *s) != NULL) {
# ifndef __WXMSW__
if (*s == wxT('\\')) {
if ((*(d - 1) = *++s)) {
register wxChar *start = d;
register int braces = (*s == wxT('{') || *s == wxT('('));
register wxChar *value;
-#ifdef __VISAGECPP__
- // VA gives assignment in logical expr warning
- while (*d)
- *d++ = *s;
-#else
- while ((*d++ = *s))
-#endif
+ while ((*d++ = *s) != NULL)
if (braces ? (*s == wxT('}') || *s == wxT(')')) : !(wxIsalnum(*s) || *s == wxT('_')) )
break;
else
*--d = 0;
value = wxGetenv(braces ? start + 1 : start);
if (value) {
-#ifdef __VISAGECPP__
- // VA gives assignment in logical expr warning
- for ((d = start - 1); (*d); *d++ = *value++);
-#else
- for ((d = start - 1); (*d++ = *value++););
-#endif
+ for ((d = start - 1); (*d++ = *value++) != NULL;);
d--;
if (braces && *s)
s++;
*(d - 1) = SEP;
}
s = nm;
-#ifdef __VISAGECPP__
- // VA gives assignment in logical expr warning
- while (*d)
- *d++ = *s++;
-#else
- while ((*d++ = *s++));
-#endif
+ while ((*d++ = *s++) != NULL);
delete[] nm_tmp; // clean up alloc
/* Now clean up the buffer */
return wxRealPath(buf);
#elif defined(__WXPM__)
if (::DosCreateDir((PSZ)dirname, NULL) != 0) // enhance for EAB's??
#else // !MSW and !OS/2 VAC++
+ (void)perm;
if ( wxMkDir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 )
#endif // !MSW/MSW
{
pb.ioRefNum = LMGetCurApRefNum();
pb.ioFCBIndx = 0;
error = PBGetFCBInfoSync(&pb);
- if ( error == noErr )
+ if ( error == noErr )
{
cwdSpec.vRefNum = pb.ioFCBVRefNum;
cwdSpec.parID = pb.ioFCBParID;
buf[0] = 0 ;
/*
this version will not always give back the application directory on mac
- enum
- {
- SFSaveDisk = 0x214, CurDirStore = 0x398
+ enum
+ {
+ SFSaveDisk = 0x214, CurDirStore = 0x398
};
FSSpec cwdSpec ;
pattern++;
ret_code = FALSE;
while ((*str!=wxT('\0'))
- && (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
+ && ((ret_code=wxMatchWild(pattern, str++, FALSE)) == 0))
/*loop*/;
if (ret_code) {
while (*str != wxT('\0'))
{
// FIXME: this is probably false for Mac and this is surely wrong for most
// of Unix shells (think about "[...]")
+ (void)format;
return m_name.find_first_of(_T("*?")) != wxString::npos;
}
wxString wxFileName::GetFullPath( wxPathFormat format ) const
{
+ (void)format;
return GetPathWithSep() + GetFullName();
}
typedef DWORD (*GET_LONG_PATH_NAME)(const wxChar *, wxChar *, DWORD);
static bool s_triedToLoad = FALSE;
- static GET_LONG_PATH_NAME s_pfnGetLongPathName = NULL;
if ( !s_triedToLoad )
{
s_triedToLoad = TRUE;
-
+#if 0
wxDllType dllKernel = wxDllLoader::LoadLibrary(_T("kernel32"));
- short avoidCompilerWarning = 0;
- if ( avoidCompilerWarning ) // dllKernel )
+ if ( dllKernel )
{
// may succeed or fail depending on the Windows version
+ static GET_LONG_PATH_NAME s_pfnGetLongPathName = NULL;
#ifdef _UNICODE
s_pfnGetLongPathName = (GET_LONG_PATH_NAME) wxDllLoader::GetSymbol(dllKernel, _T("GetLongPathNameW"));
#else
}
}
}
+#endif
}
if (success)
return pathOut;
SetUnderlined(info.underlined);
SetFaceName(info.faceName);
SetEncoding(info.encoding);
+#else
+ (void)info;
#endif
}
//
// Ignore the version for now
//
-
+
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
while (code != ab_fin);
#ifdef __WXMAC__
- delete [] ab_prefix ;
- delete [] ab_tail ;
- delete [] stack ;
+ delete [] ab_prefix ;
+ delete [] ab_tail ;
+ delete [] stack ;
#endif
return 0;
}
unsigned char type = 0;
unsigned char pal[768];
unsigned char buf[16];
- GIFImage **ppimg, *pimg, *pprev;
+ GIFImage **ppimg;
+ GIFImage *pimg, *pprev;
/* check GIF signature */
if (!CanRead())
}
unsigned width = image->GetWidth();
- unsigned row_width = width * 3 +
+ unsigned row_width = width * 3 +
(((width % 4) == 0) ? 0 : (4 - (width * 3) % 4));
- // each row must be aligned to dwords
+ // each row must be aligned to dwords
struct
{
// BitmapHeader:
wxUint32 filesize; // total file size, inc. headers
wxUint32 reserved; // for future use
wxUint32 data_offset; // image data offset in the file
-
+
// BitmapInfoHeader:
wxUint32 bih_size; // 2nd part's size
wxUint32 width, height; // bitmap's dimensions
hdr.magic = wxUINT16_SWAP_ON_BE(0x4D42/*'BM'*/);
hdr.filesize = wxUINT32_SWAP_ON_BE(
- hdr_size +
+ hdr_size +
row_width * image->GetHeight()
);
hdr.reserved = 0;
hdr.data_offset = wxUINT32_SWAP_ON_BE(hdr_size);
-
+
hdr.bih_size = wxUINT32_SWAP_ON_BE(hdr_size - 14);
hdr.width = wxUINT32_SWAP_ON_BE(image->GetWidth());
hdr.height = wxUINT32_SWAP_ON_BE(image->GetHeight());
hdr.planes = wxUINT16_SWAP_ON_BE(1); // always 1 plane
hdr.bpp = wxUINT16_SWAP_ON_BE(24); // always TrueColor
hdr.compression = 0; // RGB uncompressed
- hdr.size_of_bmp = wxUINT32_SWAP_ON_BE(row_width * image->GetHeight());
+ hdr.size_of_bmp = wxUINT32_SWAP_ON_BE(row_width * image->GetHeight());
hdr.h_res = hdr.v_res = wxUINT32_SWAP_ON_BE(72); // 72dpi is standard
hdr.num_clrs = 0; // maximal possible = 2^24
hdr.num_signif_clrs = 0; // all colors are significant
!stream.Write(&hdr.v_res, 4) ||
!stream.Write(&hdr.num_clrs, 4) ||
!stream.Write(&hdr.num_signif_clrs, 4)
- )
+ )
{
if (verbose)
wxLogError(_("BMP: Couldn't write the file header."));
buffer[3 * x + 0] = buffer[3 * x + 2];
buffer[3 * x + 2] = tmpvar;
}
-
+
if (!stream.Write(buffer, row_width))
{
if (verbose)
int rshift = 0, gshift = 0, bshift = 0;
wxUint8 aByte;
wxUint16 aWord;
- wxInt32 dbuf[4], aDword,
- rmask = 0, gmask = 0, bmask = 0;
+ wxInt32 dbuf[4];
+ wxInt32 aDword, rmask = 0, gmask = 0, bmask = 0;
wxInt8 bbuf[4];
struct _cmap {
unsigned char r, g, b;
* Read the BMP header
*/
- stream.Read( &bbuf, 2 );
+ stream.Read( bbuf, 2 );
stream.Read( dbuf, 4 * 4 );
#if 0 // unused
}
else if (bpp == 24)
{
- stream.Read( &bbuf, 3 );
+ stream.Read( bbuf, 3 );
linepos += 3;
ptr[poffset ] = (unsigned char)bbuf[2];
ptr[poffset + 1] = (unsigned char)bbuf[1];
{
unsigned char hdr[2];
- stream.Read(&hdr, 2);
+ stream.Read(hdr, 2);
stream.SeekI(-2, wxFromCurrent);
return (hdr[0] == 'B' && hdr[1] == 'M');
}
}
return;
}
-
+
if (!HasMask() && image.HasMask())
{
unsigned char r = image.GetMaskRed();
unsigned char g = image.GetMaskGreen();
unsigned char b = image.GetMaskBlue();
-
+
width *= 3;
unsigned char* source_data = image.GetData() + xx*3 + yy*3*image.GetWidth();
int source_step = image.GetWidth()*3;
unsigned char* target_data = GetData() + (x+xx)*3 + (y+yy)*3*M_IMGDATA->m_width;
int target_step = M_IMGDATA->m_width*3;
-
+
for (int j = 0; j < height; j++)
{
for (int i = 0; i < width; i+=3)
{
- if ((source_data[i] != r) &&
- (source_data[i+1] != g) &&
+ if ((source_data[i] != r) &&
+ (source_data[i+1] != g) &&
(source_data[i+2] != b))
{
memcpy( target_data+i, source_data+i, 3 );
}
- }
+ }
source_data += source_step;
target_data += target_step;
}
{
wxHashTable h;
wxObject dummy;
- unsigned char r, g, b, *p;
+ unsigned char r, g, b;
+ unsigned char *p;
unsigned long size, nentries, key;
p = GetData();
//
unsigned long wxImage::ComputeHistogram( wxHashTable &h )
{
- unsigned char r, g, b, *p;
+ unsigned char r, g, b;
+ unsigned char *p;
unsigned long size, nentries, key;
wxHNode *hnode;
#include "wx/app.h"
extern "C"
{
-#ifdef __WATCOMC__
- #define HAVE_BOOLEAN
-#endif
#include "jpeglib.h"
}
#include "wx/filefn.h"
{
my_src_ptr src = (my_src_ptr) cinfo->src;
- while (num_bytes > (long)src->pub.bytes_in_buffer)
+ while (num_bytes > (long)src->pub.bytes_in_buffer)
{
num_bytes -= (long) src->pub.bytes_in_buffer;
src->pub.fill_input_buffer(cinfo);
/* If we get here, the JPEG code has signaled an error.
* We need to clean up the JPEG object, close the input file, and return.
*/
- if (verbose)
+ if (verbose)
wxLogError(_("JPEG: Couldn't load - file is probably corrupted."));
jpeg_destroy_decompress(&cinfo);
if (image->Ok()) image->Destroy();
if (!verbose) cinfo.err->output_message=NULL;
/* Establish the setjmp return context for my_error_exit to use. */
- if (setjmp(jerr.setjmp_buffer))
+ if (setjmp(jerr.setjmp_buffer))
{
/* If we get here, the JPEG code has signaled an error.
* We need to clean up the JPEG object, close the input file, and return.
*/
- if (verbose)
+ if (verbose)
wxLogError(_("JPEG: Couldn't save image."));
jpeg_destroy_compress(&cinfo);
return FALSE;
{
unsigned char hdr[2];
- stream.Read(&hdr, 2);
+ stream.Read(hdr, 2);
stream.SeekI(-2, wxFromCurrent);
return (hdr[0] == 0xFF && hdr[1] == 0xD8);
}
//
if ((data & 0xC0) != 0xC0)
{
- *(p++) = data;
+ *(p++) = (unsigned char)data;
size--;
}
else
cont = data & 0x3F;
data = (unsigned char)s.GetC();
for (i = 1; i <= cont; i++)
- *(p++) = data;
+ *(p++) = (unsigned char)data;
size -= cont;
}
}
hdr[HDR_ENCODING] = 1;
hdr[HDR_NPLANES] = nplanes;
hdr[HDR_BITSPERPIXEL] = 8;
- hdr[HDR_BYTESPERLINE] = bytesperline % 256;
- hdr[HDR_BYTESPERLINE + 1] = bytesperline / 256;
- hdr[HDR_XMAX] = (width - 1) % 256;
- hdr[HDR_XMAX + 1] = (width - 1) / 256;
- hdr[HDR_YMAX] = (height - 1) % 256;
- hdr[HDR_YMAX + 1] = (height - 1) / 256;
+ hdr[HDR_BYTESPERLINE] = (unsigned char)(bytesperline % 256);
+ hdr[HDR_BYTESPERLINE + 1] = (unsigned char)(bytesperline / 256);
+ hdr[HDR_XMAX] = (unsigned char)((width - 1) % 256);
+ hdr[HDR_XMAX + 1] = (unsigned char)((width - 1) / 256);
+ hdr[HDR_YMAX] = (unsigned char)((height - 1) % 256);
+ hdr[HDR_YMAX + 1] = (unsigned char)((height - 1) / 256);
hdr[HDR_PALETTEINFO] = 1;
stream.Write(hdr, 128);
#if wxUSE_LIBPNG
#if defined(__VISAGECPP__)
-#define LINKAGEMODE _Optlink
+#define PNGLINKAGEMODE _Optlink
+#elif defined(__WATCOMC__)
+#define PNGLINKAGEMODE _cdecl
#else
-#define LINKAGEMODE
+#define PNGLINKAGEMODE
#endif
-static void LINKAGEMODE _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length )
+static void PNGLINKAGEMODE _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length )
{
((wxInputStream*) png_get_io_ptr( png_ptr )) -> Read(data, length);
}
-static void LINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, png_size_t length )
+static void PNGLINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, png_size_t length )
{
((wxOutputStream*) png_get_io_ptr( png_ptr )) -> Write(data, length);
}
// from pngerror.c
// so that the libpng doesn't send anything on stderr
void
-LINKAGEMODE png_silent_error(png_structp png_ptr, png_const_charp WXUNUSED(message))
+PNGLINKAGEMODE png_silent_error(png_structp png_ptr, png_const_charp WXUNUSED(message))
{
#ifdef USE_FAR_KEYWORD
{
}
void
-LINKAGEMODE png_silent_warning(png_structp WXUNUSED(png_ptr), png_const_charp WXUNUSED(message))
+PNGLINKAGEMODE png_silent_warning(png_structp WXUNUSED(png_ptr), png_const_charp WXUNUSED(message))
{
}
{
unsigned char hdr[4];
- stream.Read(&hdr, 4);
+ stream.Read(hdr, 4);
stream.SeekI(-4, wxFromCurrent);
return (hdr[0] == 0x89 && hdr[1] == 'P' && hdr[2] == 'N' && hdr[3] == 'G');
}
#if wxUSE_STREAMS
-bool wxXPMHandler::LoadFile(wxImage *image,
+bool wxXPMHandler::LoadFile(wxImage *image,
wxInputStream& stream,
bool verbose, int WXUNUSED(index))
{
}
bool wxXPMHandler::SaveFile(wxImage * image,
- wxOutputStream& stream, bool verbose)
+ wxOutputStream& stream, bool WXUNUSED(verbose))
{
wxString tmp;
char tmp_c;
-
+
// 1. count colours:
#define MaxCixels 92
- static const char Cixel[MaxCixels+1] =
+ static const char Cixel[MaxCixels+1] =
" .XoO+@#$%&*=-;:>,<1234567890qwertyuipasdfghjk"
"lzxcvbnmMNBVCZASDFGHJKLPIUYTREWQ!~^/()_`'][{}|";
int chars_per_pixel;
int cols;
int i, j, k;
-
+
cols = image->CountColours();
chars_per_pixel = 1;
for ( k = MaxCixels; cols > k; k *= MaxCixels)
tmp.Printf("/* XPM */\n"
"static char *xpm_data[] = {\n"
"/* columns rows colors chars-per-pixel */\n"
- "\"%i %i %i %i\",\n",
+ "\"%i %i %i %i\",\n",
image->GetWidth(), image->GetHeight(), cols, chars_per_pixel);
stream.Write(tmp.mb_str(), tmp.Length());
if (image->HasMask())
mask_key = (image->GetMaskRed() << 16) |
(image->GetMaskGreen() << 8) | image->GetMaskBlue();
-
+
// 2b. generate colour table:
table.BeginFind();
wxNode *node = NULL;
else if (key == mask_key)
tmp.Printf(wxT("\"%s c None\",\n"), sym);
else
- tmp.Printf(wxT("\"%s c #%s%s%s\",\n"), sym,
+ tmp.Printf(wxT("\"%s c #%s%s%s\",\n"), sym,
wxDecToHex((unsigned char)(key >> 16)).c_str(),
wxDecToHex((unsigned char)(key >> 8)).c_str(),
wxDecToHex((unsigned char)(key)).c_str());
}
tmp = wxT("};\n");
stream.Write(tmp.mb_str(), 3);
-
+
delete[] symbols;
delete[] symbols_data;
#endif
}
+#ifdef __WXDEBUG__
struct wxDebugStatsStruct
{
long instanceCount;
st->next = head;
return st;
}
+#endif
bool wxDebugContext::PrintStatistics(bool detailed)
{
return TRUE;
#else
+ (void)detailed;
return FALSE;
#endif
}
}
// Trace: send output to the current debugging stream
-void wxTrace(const wxChar *fmt ...)
+void wxTrace(const wxChar * ...)
{
#if 1
wxFAIL_MSG(wxT("wxTrace is now obsolete. Please use wxDebugXXX instead."));
}
// Trace with level
-void wxTraceLevel(int level, const wxChar *fmt ...)
+void wxTraceLevel(int, const wxChar * ...)
{
#if 1
wxFAIL_MSG(wxT("wxTrace is now obsolete. Please use wxDebugXXX instead."));
#elif defined(__UNIX__)
return m_impl->Unassociate(this);
#else
-
wxFAIL_MSG( _T("not implemented") ); // TODO
return FALSE;
#endif
return m_impl->SetCommand(cmd, verb, overwriteprompt);
#else
wxFAIL_MSG(_T("not implemented"));
-
return FALSE;
#endif
}
EnsureImpl();
m_impl->Initialize(mcapStyle, sExtraDir);
+#else
+ (void)mcapStyle;
+ (void)sExtraDir;
#endif // Unix
}
name = item->GetTitle();
if (name == wxT(""))
name = wxT("no name");
-
+
// Delete existing resource, if any.
Delete(name);
-
+
Put(name, item);
}
}
node = Next();
}
-
+
delete item;
return TRUE;
}
{
wxExprDatabase db;
int len = is->StreamSize() ;
-
+
bool eof = FALSE;
while ( is->TellI() + 10 < len) // it's a hack because the streams dont support EOF
{
bool wxResourceTable::ParseResourceFile(const wxString& filename)
{
wxExprDatabase db;
-
+
#if defined(__WXMAC__) && !defined(__UNIX__)
FILE *fd = fopen(wxUnix2MacFilename(filename.fn_str()), "r");
#else
wxLogWarning(_("Ill-formed resource file syntax."));
return FALSE;
}
-
+
return wxResourceInterpretResources(*this, db);
}
int id = childResource->GetId();
if ( id == 0 )
id = -1;
-
+
bool dlgUnits = ((parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0);
-
+
wxControl *control = (wxControl *) NULL;
wxString itemType(childResource->GetType());
-
+
wxPoint pos;
wxSize size;
if (dlgUnits)
pos = wxPoint(childResource->GetX(), childResource->GetY());
size = wxSize(childResource->GetWidth(), childResource->GetHeight());
}
-
+
if (itemType == wxString(wxT("wxButton")) || itemType == wxString(wxT("wxBitmapButton")))
{
if (childResource->GetValue4() != wxT(""))
if (!bitmap.Ok())
bitmap.LoadFile("cross_bmp", wxBITMAP_TYPE_BMP_RESOURCE);
#endif
-
+
if (bitmap.Ok())
control = new wxStaticBitmap(parent, id, bitmap, pos, size,
childResource->GetStyle(), childResource->GetName());
{
control = new wxCheckBox(parent, id, childResource->GetTitle(), pos, size,
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
-
+
((wxCheckBox *)control)->SetValue((childResource->GetValue1() != 0));
}
#if wxUSE_GAUGE
{
control = new wxGauge(parent, id, (int)childResource->GetValue2(), pos, size,
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
-
+
((wxGauge *)control)->SetValue((int)childResource->GetValue1());
}
#endif
*/
((wxScrollBar *)control)->SetScrollbar((int)childResource->GetValue1(),(int)childResource->GetValue2(),
(int)childResource->GetValue3(),(int)(long)childResource->GetValue5(),FALSE);
-
+
}
#endif
else if (itemType == wxString(wxT("wxSlider")))
}
control = new wxListBox(parent, id, pos, size,
noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
-
+
if (strings)
delete[] strings;
}
}
control = new wxChoice(parent, id, pos, size,
noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
-
+
if (strings)
delete[] strings;
}
}
control = new wxComboBox(parent, id, childResource->GetValue4(), pos, size,
noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
-
+
if (strings)
delete[] strings;
}
control = new wxRadioBox(parent, (wxWindowID) id, wxString(childResource->GetTitle()), pos, size,
noStrings, strings, (int)childResource->GetValue1(), childResource->GetStyle(), wxDefaultValidator,
childResource->GetName());
-
+
if (strings)
delete[] strings;
}
-
+
if ((parentResource->GetResourceStyle() & wxRESOURCE_USE_DEFAULTS) != 0)
{
// Don't set font; will be inherited from parent.
if (control && childResource->GetFont().Ok())
{
control->SetFont(childResource->GetFont());
-
+
#ifdef __WXMSW__
// Force the layout algorithm since the size changes the layout
if (control->IsKindOf(CLASSINFO(wxRadioBox)))
{
wxExpr *clause = (wxExpr *)node->Data();
wxString functor(clause->Functor());
-
+
wxItemResource *item = (wxItemResource *) NULL;
if (functor == wxT("dialog"))
item = wxResourceInterpretDialog(table, clause);
item = wxResourceInterpretBitmap(table, clause);
else if (functor == wxT("icon"))
item = wxResourceInterpretIcon(table, clause);
-
+
if (item)
{
// Remove any existing resource of same name
wxString backColourHex = wxT("");
wxString labelColourHex = wxT("");
wxString buttonColourHex = wxT("");
-
+
long windowStyle = wxDEFAULT_DIALOG_STYLE;
if (isPanel)
windowStyle = 0;
-
+
int x = 0; int y = 0; int width = -1; int height = -1;
int isModal = 0;
wxExpr *labelFontExpr = (wxExpr *) NULL;
expr->GetAttributeValue(wxT("background_colour"), backColourHex);
expr->GetAttributeValue(wxT("label_colour"), labelColourHex);
expr->GetAttributeValue(wxT("button_colour"), buttonColourHex);
-
+
int useDialogUnits = 0;
expr->GetAttributeValue(wxT("use_dialog_units"), useDialogUnits);
if (useDialogUnits != 0)
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_DIALOG_UNITS);
-
+
int useDefaults = 0;
expr->GetAttributeValue(wxT("use_system_defaults"), useDefaults);
if (useDefaults != 0)
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS);
-
+
int id = 0;
expr->GetAttributeValue(wxT("id"), id);
dialogItem->SetId(id);
-
+
if (style != wxT(""))
{
windowStyle = wxParseWindowStyle(style);
dialogItem->SetValue1(isModal);
if (windowStyle & wxDIALOG_MODAL) // Uses style in wxWin 2
dialogItem->SetValue1(TRUE);
-
+
dialogItem->SetName(name);
dialogItem->SetTitle(title);
dialogItem->SetSize(x, y, width, height);
if (style.Find(wxT("VERTICAL_LABEL")) != -1)
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_VERTICAL_LABEL);
else if (style.Find(wxT("HORIZONTAL_LABEL")) != -1)
- dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_HORIZONTAL_LABEL);
-
+ dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_HORIZONTAL_LABEL);
+
if (backColourHex != wxT(""))
{
int r = 0;
b = wxHexToDec(buttonColourHex.Mid(4, 2));
dialogItem->SetButtonColour(wxColour((unsigned char)r,(unsigned char)g,(unsigned char)b));
}
-
+
if (fontExpr)
dialogItem->SetFont(wxResourceInterpretFontSpec(fontExpr));
else if (buttonFontExpr)
dialogItem->SetFont(wxResourceInterpretFontSpec(buttonFontExpr));
else if (labelFontExpr)
dialogItem->SetFont(wxResourceInterpretFontSpec(labelFontExpr));
-
+
// Now parse all controls
wxExpr *controlExpr = expr->GetFirst();
while (controlExpr)
wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
{
wxItemResource *controlItem = new wxItemResource;
-
+
// First, find the standard features of a control definition:
// [optional integer/string id], control name, title, style, name, x, y, width, height
-
+
wxString controlType;
wxString style;
wxString title;
long windowStyle = 0;
int x = 0; int y = 0; int width = -1; int height = -1;
int count = 0;
-
+
wxExpr *expr1 = expr->Nth(0);
-
+
if ( expr1->Type() == PrologString || expr1->Type() == PrologWord )
{
if ( wxIsValidControlClass(expr1->StringValue()) )
controlType = expr->Nth(1)->StringValue();
count = 2;
}
-
+
expr1 = expr->Nth(count);
count ++;
if ( expr1 )
title = expr1->StringValue();
-
+
expr1 = expr->Nth(count);
count ++;
if (expr1)
style = expr1->StringValue();
windowStyle = wxParseWindowStyle(style);
}
-
+
expr1 = expr->Nth(count);
count ++;
if (expr1)
name = expr1->StringValue();
-
+
expr1 = expr->Nth(count);
count ++;
if (expr1)
x = (int)expr1->IntegerValue();
-
+
expr1 = expr->Nth(count);
count ++;
if (expr1)
y = (int)expr1->IntegerValue();
-
+
expr1 = expr->Nth(count);
count ++;
if (expr1)
width = (int)expr1->IntegerValue();
-
+
expr1 = expr->Nth(count);
count ++;
if (expr1)
height = (int)expr1->IntegerValue();
-
+
controlItem->SetStyle(windowStyle);
controlItem->SetName(name);
controlItem->SetTitle(title);
controlItem->SetResourceStyle(controlItem->GetResourceStyle() | wxRESOURCE_VERTICAL_LABEL);
else if (style.Find(wxT("HORIZONTAL_LABEL")) != -1)
controlItem->SetResourceStyle(controlItem->GetResourceStyle() | wxRESOURCE_HORIZONTAL_LABEL);
-
+
if (controlType == wxT("wxButton"))
{
// Check for bitmap resource name (in case loading old-style resource file)
{
wxString str(expr->Nth(count)->StringValue());
count ++;
-
+
if (str != wxT(""))
{
controlItem->SetValue4(str);
wxString str(expr->Nth(count)->StringValue());
controlItem->SetValue4(str);
count ++;
-
+
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
{
// controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
{
controlItem->SetValue1(expr->Nth(count)->IntegerValue());
count ++;
-
+
// Check for range
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
{
controlItem->SetValue2(expr->Nth(count)->IntegerValue());
count ++;
-
+
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
{
// Skip past the obsolete label font spec if there are two consecutive specs
{
controlItem->SetValue1(expr->Nth(count)->IntegerValue());
count ++;
-
+
// Check for min
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
{
controlItem->SetValue2(expr->Nth(count)->IntegerValue());
count ++;
-
+
// Check for max
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
{
controlItem->SetValue3(expr->Nth(count)->IntegerValue());
count ++;
-
+
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
{
// controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
// do nothing
count ++;
-
+
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
{
controlItem->SetValue1(expr->Nth(count)->IntegerValue());
count ++;
-
+
// PAGE LENGTH
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
{
controlItem->SetValue2(expr->Nth(count)->IntegerValue());
count ++;
-
+
// OBJECT LENGTH
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
{
controlItem->SetValue3(expr->Nth(count)->IntegerValue());
count ++;
-
+
// VIEW LENGTH
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
controlItem->SetValue5(expr->Nth(count)->IntegerValue());
else if (controlType == wxT("wxListBox"))
{
wxExpr *valueList = (wxExpr *) NULL;
-
- valueList = expr->Nth(count);
- if (valueList && (valueList->Type() == PrologList))
+
+ if (((valueList = expr->Nth(count)) != 0) && (valueList->Type() == PrologList))
{
wxStringList stringList;
wxExpr *stringExpr = valueList->GetFirst();
/*
controlItem->SetValue1(wxLB_SINGLE);
*/
- mult = expr->Nth(count);
- if (mult && ((mult->Type() == PrologString)||(mult->Type() == PrologWord)))
+ if (((mult = expr->Nth(count)) != 0) && ((mult->Type() == PrologString)||(mult->Type() == PrologWord)))
{
/*
wxString m(mult->StringValue());
{
wxExpr *valueList = (wxExpr *) NULL;
// Check for default value list
- valueList = expr->Nth(count);
- if (valueList && (valueList->Type() == PrologList))
+ if (((valueList = expr->Nth(count)) != 0) && (valueList->Type() == PrologList))
{
wxStringList stringList;
wxExpr *stringExpr = valueList->GetFirst();
stringExpr = stringExpr->GetNext();
}
controlItem->SetStringValues(stringList);
-
+
count ++;
-
+
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
{
// Skip past the obsolete label font spec if there are two consecutive specs
{
wxString str(textValue->StringValue());
controlItem->SetValue4(str);
-
+
count ++;
-
+
wxExpr *valueList = (wxExpr *) NULL;
// Check for default value list
- valueList = expr->Nth(count);
- if (valueList && (valueList->Type() == PrologList))
+ if (((valueList = expr->Nth(count)) != 0) && (valueList->Type() == PrologList))
{
wxStringList stringList;
wxExpr *stringExpr = valueList->GetFirst();
stringExpr = stringExpr->GetNext();
}
controlItem->SetStringValues(stringList);
-
+
count ++;
-
+
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
{
// Skip past the obsolete label font spec if there are two consecutive specs
{
wxExpr *valueList = (wxExpr *) NULL;
// Check for default value list
- valueList = expr->Nth(count);
- if (valueList && (valueList->Type() == PrologList))
+ if (((valueList = expr->Nth(count)) != 0) && (valueList->Type() == PrologList))
{
wxStringList stringList;
wxExpr *stringExpr = valueList->GetFirst();
}
controlItem->SetStringValues(stringList);
count ++;
-
+
// majorDim (number of rows or cols)
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
{
}
else
controlItem->SetValue1(0);
-
+
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
{
// Skip past the obsolete label font spec if there are two consecutive specs
wxItemResource *wxResourceInterpretMenuItem(wxResourceTable& table, wxExpr *expr)
{
wxItemResource *item = new wxItemResource;
-
+
wxExpr *labelExpr = expr->Nth(0);
wxExpr *idExpr = expr->Nth(1);
wxExpr *helpExpr = expr->Nth(2);
wxExpr *checkableExpr = expr->Nth(3);
-
+
// Further keywords/attributes to follow sometime...
if (expr->Number() == 0)
{
}
if (checkableExpr)
item->SetValue2(checkableExpr->IntegerValue());
-
+
// Find the first expression that's a list, for submenu
wxExpr *subMenuExpr = expr->GetFirst();
while (subMenuExpr && (subMenuExpr->Type() != PrologList))
subMenuExpr = subMenuExpr->GetNext();
-
+
while (subMenuExpr)
{
wxItemResource *child = wxResourceInterpretMenuItem(table, subMenuExpr);
expr->GetAttributeValue(wxT("menu"), &listExpr);
if (!listExpr)
return (wxItemResource *) NULL;
-
+
wxItemResource *menuResource = wxResourceInterpretMenuItem(table, listExpr);
-
+
if (!menuResource)
return (wxItemResource *) NULL;
-
+
wxString name;
if (expr->GetAttributeValue(wxT("name"), name))
{
menuResource->SetName(name);
}
-
+
return menuResource;
}
expr->GetAttributeValue(wxT("menu"), &listExpr);
if (!listExpr)
return (wxItemResource *) NULL;
-
+
wxItemResource *resource = new wxItemResource;
resource->SetType(wxT("wxMenu"));
// resource->SetType(wxTYPE_MENU);
-
+
wxExpr *element = listExpr->GetFirst();
while (element)
{
resource->GetChildren().Append(menuResource);
element = element->GetNext();
}
-
+
wxString name;
if (expr->GetAttributeValue(wxT("name"), name))
{
resource->SetName(name);
}
-
+
return resource;
}
wxItemResource *bitmapSpec = new wxItemResource;
// bitmapSpec->SetType(wxTYPE_BITMAP);
bitmapSpec->SetType(wxT("wxBitmap"));
-
+
// List is of form: [filename, bitmaptype, platform, colours, xresolution, yresolution]
// where everything after 'filename' is optional.
wxExpr *nameExpr = listExpr->Nth(0);
}
else
bitmapSpec->SetValue1(0);
-
+
if (platformExpr && platformExpr->StringValue() != wxT(""))
{
wxString plat(platformExpr->StringValue());
}
else
bitmapSpec->SetValue2(RESOURCE_PLATFORM_ANY);
-
+
if (coloursExpr)
bitmapSpec->SetValue3(coloursExpr->IntegerValue());
int xres = 0;
if (yresExpr)
yres = (int)yresExpr->IntegerValue();
bitmapSpec->SetSize(0, 0, xres, yres);
-
+
bitmapItem->GetChildren().Append(bitmapSpec);
}
}
}
bitmapExpr = bitmapExpr->GetNext();
}
-
+
return bitmapItem;
}
{
if (expr->Type() != PrologList)
return wxNullFont;
-
+
int point = 10;
int family = wxSWISS;
int style = wxNORMAL;
int weight = wxNORMAL;
int underline = 0;
wxString faceName(wxT(""));
-
+
wxExpr *pointExpr = expr->Nth(0);
wxExpr *familyExpr = expr->Nth(1);
wxExpr *styleExpr = expr->Nth(2);
wxExpr *faceNameExpr = expr->Nth(5);
if (pointExpr)
point = (int)pointExpr->IntegerValue();
-
+
wxString str;
if (familyExpr)
{
underline = (int)underlineExpr->IntegerValue();
if (faceNameExpr)
faceName = faceNameExpr->StringValue();
-
+
wxFont font(point, family, style, weight, (underline != 0), faceName);
return font;
}
static bool wxEatWhiteSpace(FILE *fd)
{
int ch = 0;
-
+
while ((ch = getc(fd)) != EOF)
{
switch (ch)
ungetc(prev_ch, fd);
return TRUE;
}
-
+
if (ch == '*')
{
// Eat C comment
default:
ungetc(ch, fd);
return TRUE;
-
+
}
}
return FALSE;
is->Ungetch(ch);
return TRUE;
}
-
+
// Eat whitespace
while (ch == ' ' || ch == 10 || ch == 13 || ch == 9)
ch = is->GetC();
wxReallocateResourceBuffer();
wxResourceBuffer[0] = 0;
wxEatWhiteSpace(fd);
-
+
int ch = getc(fd);
if (ch == '"')
{
ungetc(newCh, fd);
}
}
-
+
if (wxResourceBufferCount >= wxResourceBufferSize-1)
wxReallocateResourceBuffer();
wxResourceBuffer[wxResourceBufferCount] = (char)actualCh;
wxReallocateResourceBuffer();
wxResourceBuffer[wxResourceBufferCount] = (char)ch;
wxResourceBufferCount ++;
-
+
ch = getc(fd);
}
wxResourceBuffer[wxResourceBufferCount] = 0;
wxReallocateResourceBuffer();
wxResourceBuffer[0] = 0;
wxEatWhiteSpace(is);
-
+
int ch = is->GetC() ;
if (ch == '"')
{
is->Ungetch(newCh);
}
}
-
+
if (wxResourceBufferCount >= wxResourceBufferSize-1)
wxReallocateResourceBuffer();
wxResourceBuffer[wxResourceBufferCount] = (char)actualCh;
wxReallocateResourceBuffer();
wxResourceBuffer[wxResourceBufferCount] = (char)ch;
wxResourceBufferCount ++;
-
+
ch = is->GetC();
}
wxResourceBuffer[wxResourceBufferCount] = 0;
{
if (!table)
table = wxDefaultResourceTable;
-
+
// static or #define
if (!wxGetResourceToken(fd))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "#define") == 0)
{
wxGetResourceToken(fd);
}
delete[] name;
delete[] value;
-
+
return TRUE;
}
else if (strcmp(wxResourceBuffer, "#include") == 0)
wxLogWarning(buf);
return FALSE;
}
-
+
// char
if (!wxGetResourceToken(fd))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "char") != 0)
{
wxLogWarning(_("Expected 'char' whilst parsing resource."));
return FALSE;
}
-
+
// *name
if (!wxGetResourceToken(fd))
{
*eof = TRUE;
return FALSE;
}
-
+
if (wxResourceBuffer[0] != '*')
{
wxLogWarning(_("Expected '*' whilst parsing resource."));
wxChar nameBuf[100];
wxMB2WX(nameBuf, wxResourceBuffer+1, 99);
nameBuf[99] = 0;
-
+
// =
if (!wxGetResourceToken(fd))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "=") != 0)
{
wxLogWarning(_("Expected '=' whilst parsing resource."));
return FALSE;
}
-
+
// String
if (!wxGetResourceToken(fd))
{
{
if (!table)
table = wxDefaultResourceTable;
-
+
// static or #define
if (!wxGetResourceToken(fd))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "#define") == 0)
{
wxGetResourceToken(fd);
}
delete[] name;
delete[] value;
-
+
return TRUE;
}
else if (strcmp(wxResourceBuffer, "#include") == 0)
wxLogWarning(buf);
return FALSE;
}
-
+
// char
if (!wxGetResourceToken(fd))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "char") != 0)
{
wxLogWarning(_("Expected 'char' whilst parsing resource."));
return FALSE;
}
-
+
// *name
if (!wxGetResourceToken(fd))
{
*eof = TRUE;
return FALSE;
}
-
+
if (wxResourceBuffer[0] != '*')
{
wxLogWarning(_("Expected '*' whilst parsing resource."));
}
char nameBuf[100];
strncpy(nameBuf, wxResourceBuffer+1, 99);
-
+
// =
if (!wxGetResourceToken(fd))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "=") != 0)
{
wxLogWarning(_("Expected '=' whilst parsing resource."));
return FALSE;
}
-
+
// String
if (!wxGetResourceToken(fd))
{
{
if (!s)
return (wxChar*) NULL;
-
+
static wxChar buf[150];
int len = wxStrlen(s);
int j = 0;
ii ++;
}
buf[j] = 0;
-
+
// Eat whitespace and conjunction characters
while ((ii < len) &&
((s[ii] == wxT(' ')) || (s[ii] == wxT('|')) || (s[ii] == wxT(','))))
{ wxT("wxLB_SORT"), wxLB_SORT },
{ wxT("wxLB_OWNERDRAW"), wxLB_OWNERDRAW },
{ wxT("wxLB_HSCROLL"), wxLB_HSCROLL },
-
+
/* wxComboxBox */
{ wxT("wxCB_SIMPLE"), wxCB_SIMPLE },
{ wxT("wxCB_DROPDOWN"), wxCB_DROPDOWN },
{ wxT("wxCB_READONLY"), wxCB_READONLY },
{ wxT("wxCB_SORT"), wxCB_SORT },
-
+
/* wxGauge */
{ wxT("wxGA_PROGRESSBAR"), wxGA_PROGRESSBAR },
{ wxT("wxGA_HORIZONTAL"), wxGA_HORIZONTAL },
{ wxT("wxGA_VERTICAL"), wxGA_VERTICAL },
-
+
/* wxTextCtrl */
{ wxT("wxPASSWORD"), wxPASSWORD},
{ wxT("wxPROCESS_ENTER"), wxPROCESS_ENTER},
{ wxT("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER},
{ wxT("wxTE_MULTILINE"), wxTE_MULTILINE},
{ wxT("wxTE_NO_VSCROLL"), wxTE_NO_VSCROLL},
-
+
/* wxRadioBox/wxRadioButton */
{ wxT("wxRB_GROUP"), wxRB_GROUP },
{ wxT("wxRA_SPECIFY_COLS"), wxRA_SPECIFY_COLS },
{ wxT("wxRA_SPECIFY_ROWS"), wxRA_SPECIFY_ROWS },
{ wxT("wxRA_HORIZONTAL"), wxRA_HORIZONTAL },
{ wxT("wxRA_VERTICAL"), wxRA_VERTICAL },
-
+
/* wxSlider */
{ wxT("wxSL_HORIZONTAL"), wxSL_HORIZONTAL },
{ wxT("wxSL_VERTICAL"), wxSL_VERTICAL },
{ wxT("wxSL_BOTTOM"), wxSL_BOTTOM },
{ wxT("wxSL_BOTH"), wxSL_BOTH },
{ wxT("wxSL_SELRANGE"), wxSL_SELRANGE },
-
+
/* wxScrollBar */
{ wxT("wxSB_HORIZONTAL"), wxSB_HORIZONTAL },
{ wxT("wxSB_VERTICAL"), wxSB_VERTICAL },
-
+
/* wxButton */
{ wxT("wxBU_AUTODRAW"), wxBU_AUTODRAW },
{ wxT("wxBU_NOAUTODRAW"), wxBU_NOAUTODRAW },
-
+
/* wxTreeCtrl */
{ wxT("wxTR_HAS_BUTTONS"), wxTR_HAS_BUTTONS },
{ wxT("wxTR_EDIT_LABELS"), wxTR_EDIT_LABELS },
{ wxT("wxTR_LINES_AT_ROOT"), wxTR_LINES_AT_ROOT },
-
+
/* wxListCtrl */
{ wxT("wxLC_ICON"), wxLC_ICON },
{ wxT("wxLC_SMALL_ICON"), wxLC_SMALL_ICON },
{ wxT("wxLC_SINGLE_SEL"), wxLC_SINGLE_SEL },
{ wxT("wxLC_SORT_ASCENDING"), wxLC_SORT_ASCENDING },
{ wxT("wxLC_SORT_DESCENDING"), wxLC_SORT_DESCENDING },
-
+
/* wxSpinButton */
{ wxT("wxSP_VERTICAL"), wxSP_VERTICAL},
{ wxT("wxSP_HORIZONTAL"), wxSP_HORIZONTAL},
{ wxT("wxSP_ARROW_KEYS"), wxSP_ARROW_KEYS},
{ wxT("wxSP_WRAP"), wxSP_WRAP},
-
+
/* wxSplitterWnd */
{ wxT("wxSP_NOBORDER"), wxSP_NOBORDER},
{ wxT("wxSP_3D"), wxSP_3D},
{ wxT("wxSP_BORDER"), wxSP_BORDER},
-
+
/* wxTabCtrl */
{ wxT("wxTC_MULTILINE"), wxTC_MULTILINE},
{ wxT("wxTC_RIGHTJUSTIFY"), wxTC_RIGHTJUSTIFY},
{ wxT("wxTC_FIXEDWIDTH"), wxTC_FIXEDWIDTH},
{ wxT("wxTC_OWNERDRAW"), wxTC_OWNERDRAW},
-
+
/* wxStatusBar95 */
{ wxT("wxST_SIZEGRIP"), wxST_SIZEGRIP},
-
+
/* wxControl */
{ wxT("wxFIXED_LENGTH"), wxFIXED_LENGTH},
{ wxT("wxALIGN_LEFT"), wxALIGN_LEFT},
{ wxT("wxALIGN_CENTRE"), wxALIGN_CENTRE},
{ wxT("wxALIGN_RIGHT"), wxALIGN_RIGHT},
{ wxT("wxCOLOURED"), wxCOLOURED},
-
+
/* wxToolBar */
{ wxT("wxTB_3DBUTTONS"), wxTB_3DBUTTONS},
{ wxT("wxTB_HORIZONTAL"), wxTB_HORIZONTAL},
{ wxT("wxTB_VERTICAL"), wxTB_VERTICAL},
{ wxT("wxTB_FLAT"), wxTB_FLAT},
-
+
/* wxDialog */
{ wxT("wxDIALOG_MODAL"), wxDIALOG_MODAL },
-
+
/* Generic */
{ wxT("wxVSCROLL"), wxVSCROLL },
{ wxT("wxHSCROLL"), wxHSCROLL },
{ wxT("wxCLIP_CHILDREN"), wxCLIP_CHILDREN},
{ wxT("wxCLIP_SIBLINGS"), wxCLIP_SIBLINGS},
{ wxT("wxTAB_TRAVERSAL"), 0}, // Compatibility only
-
+
{ wxT("wxTINY_CAPTION_HORIZ"), wxTINY_CAPTION_HORIZ},
{ wxT("wxTINY_CAPTION_VERT"), wxTINY_CAPTION_VERT},
-
+
// Text font families
{ wxT("wxDEFAULT"), wxDEFAULT},
{ wxT("wxDECORATIVE"), wxDECORATIVE},
{ wxT("wxCAP_ROUND"), wxCAP_ROUND},
{ wxT("wxCAP_PROJECTING"), wxCAP_PROJECTING},
{ wxT("wxCAP_BUTT"), wxCAP_BUTT},
-
+
// Logical ops
{ wxT("wxCLEAR"), wxCLEAR},
{ wxT("wxXOR"), wxXOR},
{ wxT("wxNAND"), wxNAND},
{ wxT("wxOR"), wxOR},
{ wxT("wxSET"), wxSET},
-
+
{ wxT("wxFLOOD_SURFACE"), wxFLOOD_SURFACE},
{ wxT("wxFLOOD_BORDER"), wxFLOOD_BORDER},
{ wxT("wxODDEVEN_RULE"), wxODDEVEN_RULE},
{ wxT("wxUSER_COLOURS"), wxUSER_COLOURS},
{ wxT("wxVERTICAL_LABEL"), 0},
{ wxT("wxHORIZONTAL_LABEL"), 0},
-
+
// Bitmap types (not strictly styles)
{ wxT("wxBITMAP_TYPE_XPM"), wxBITMAP_TYPE_XPM},
{ wxT("wxBITMAP_TYPE_XBM"), wxBITMAP_TYPE_XBM},
{
if (!table)
table = wxDefaultResourceTable;
-
+
wxItemResource *item = table->FindResource(resource);
if (item)
{
}
int thisDepth = wxDisplayDepth();
long thisNoColours = (long)pow(2.0, (double)thisDepth);
-
+
wxItemResource *optResource = (wxItemResource *) NULL;
-
+
// Try to find optimum bitmap for this platform/colour depth
wxNode *node = item->GetChildren().First();
while (node)
int xRes = child->GetWidth();
int yRes = child->GetHeight();
*/
-
+
switch (platform)
{
case RESOURCE_PLATFORM_ANY:
// If no matching resource, fail.
if (!optResource)
return wxNullBitmap;
-
+
wxString name = optResource->GetName();
int bitmapType = (int)optResource->GetValue1();
switch (bitmapType)
{
if (!table)
table = wxDefaultResourceTable;
-
+
wxItemResource *item = table->FindResource(resource);
if (item)
{
}
int thisDepth = wxDisplayDepth();
long thisNoColours = (long)pow(2.0, (double)thisDepth);
-
+
wxItemResource *optResource = (wxItemResource *) NULL;
-
+
// Try to find optimum icon for this platform/colour depth
wxNode *node = item->GetChildren().First();
while (node)
int xRes = child->GetWidth();
int yRes = child->GetHeight();
*/
-
+
switch (platform)
{
case RESOURCE_PLATFORM_ANY:
// If no matching resource, fail.
if (!optResource)
return wxNullIcon;
-
+
wxString name = optResource->GetName();
int bitmapType = (int)optResource->GetValue1();
switch (bitmapType)
{
if (!table)
table = wxDefaultResourceTable;
-
+
wxItemResource *menuResource = table->FindResource(resource);
if (menuResource && (menuResource->GetType() != wxT("")) && (menuResource->GetType() == wxT("wxMenu")))
{
{
if (!table)
table = wxDefaultResourceTable;
-
+
wxItemResource *menuResource = table->FindResource(resource);
if (menuResource && (menuResource->GetType() != wxT("")) && (menuResource->GetType() == wxT("wxMenu")))
// if (menuResource && (menuResource->GetType() == wxTYPE_MENU))
{
if (!table)
table = wxDefaultResourceTable;
-
+
return table->ParseResourceData(resource);
}
{
if (!table)
table = wxDefaultResourceTable;
-
+
return table->ParseResourceFile(filename);
}
{
if (!table)
table = wxDefaultResourceTable;
-
+
return table->RegisterResourceBitmapData(name, bits, width, height);
}
{
if (!table)
table = wxDefaultResourceTable;
-
+
return table->RegisterResourceBitmapData(name, data);
}
{
if (!table)
table = wxDefaultResourceTable;
-
+
table->ClearTable();
}
{
if (!table)
table = wxDefaultResourceTable;
-
+
table->identifiers.Put(name, (wxObject *)(long)value);
return TRUE;
}
{
if (!table)
table = wxDefaultResourceTable;
-
+
return (int)(long)table->identifiers.Get(name);
}
{
if (!table)
table = wxDefaultResourceTable;
-
+
FILE *fd = wxFopen(f, _T("r"));
if (!fd)
{
bool wxEatWhiteSpaceString(char *s)
{
int ch = 0;
-
+
while ((ch = getc_string(s)) != EOF)
{
switch (ch)
ungetc_string();
return TRUE;
}
-
+
if (ch == '*')
{
// Eat C comment
default:
ungetc_string();
return TRUE;
-
+
}
}
return FALSE;
wxReallocateResourceBuffer();
wxResourceBuffer[0] = 0;
wxEatWhiteSpaceString(s);
-
+
int ch = getc_string(s);
if (ch == '"')
{
ungetc_string();
}
}
-
+
if (wxResourceBufferCount >= wxResourceBufferSize-1)
wxReallocateResourceBuffer();
wxResourceBuffer[wxResourceBufferCount] = (char)actualCh;
wxReallocateResourceBuffer();
wxResourceBuffer[wxResourceBufferCount] = (char)ch;
wxResourceBufferCount ++;
-
+
ch = getc_string(s);
}
wxResourceBuffer[wxResourceBufferCount] = 0;
{
if (!table)
table = wxDefaultResourceTable;
-
+
// static or #define
if (!wxGetResourceTokenString(s))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "#define") == 0)
{
wxGetResourceTokenString(s);
}
delete[] name;
delete[] value;
-
+
return TRUE;
}
/*
wxLogWarning(buf);
return FALSE;
}
-
+
// char
if (!wxGetResourceTokenString(s))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "char") != 0)
{
wxLogWarning(_("Expected 'char' whilst parsing resource."));
return FALSE;
}
-
+
// *name
if (!wxGetResourceTokenString(s))
{
*eof = TRUE;
return FALSE;
}
-
+
if (wxResourceBuffer[0] != '*')
{
wxLogWarning(_("Expected '*' whilst parsing resource."));
wxChar nameBuf[100];
wxMB2WX(nameBuf, wxResourceBuffer+1, 99);
nameBuf[99] = 0;
-
+
// =
if (!wxGetResourceTokenString(s))
{
*eof = TRUE;
return FALSE;
}
-
+
if (strcmp(wxResourceBuffer, "=") != 0)
{
wxLogWarning(_("Expected '=' whilst parsing resource."));
return FALSE;
}
-
+
// String
if (!wxGetResourceTokenString(s))
{
{
if (!table)
table = wxDefaultResourceTable;
-
+
if (!s)
return FALSE;
-
+
// Turn backslashes into spaces
if (s)
{
s[i+1] = ' ';
}
}
-
+
wxExprDatabase db;
wxResourceStringPtr = 0;
-
+
bool eof = FALSE;
while (wxResourceReadOneResourceString(s, db, &eof, table) && !eof)
{
{
if (!table)
table = wxDefaultResourceTable;
-
+
wxItemResource *resource = table->FindResource((const wxChar *)resourceName);
// if (!resource || (resource->GetType() != wxTYPE_DIALOG_BOX))
if (!resource || (resource->GetType() == wxT("")) ||
! ((resource->GetType() == wxT("wxDialog")) || (resource->GetType() == wxT("wxPanel"))))
return FALSE;
-
+
wxString title(resource->GetTitle());
long theWindowStyle = resource->GetStyle();
bool isModal = (resource->GetValue1() != 0) ;
int width = resource->GetWidth();
int height = resource->GetHeight();
wxString name = resource->GetName();
-
+
if (IsKindOf(CLASSINFO(wxDialog)))
{
wxDialog *dialogBox = (wxDialog *)this;
long modalStyle = isModal ? wxDIALOG_MODAL : 0;
if (!dialogBox->Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), theWindowStyle|modalStyle, name))
return FALSE;
-
+
// Only reset the client size if we know we're not going to do it again below.
if ((resource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) == 0)
dialogBox->SetClientSize(width, height);
if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name))
return FALSE;
}
-
+
if ((resource->GetResourceStyle() & wxRESOURCE_USE_DEFAULTS) != 0)
{
// No need to do this since it's done in wxPanel or wxDialog constructor.
if (resource->GetBackgroundColour().Ok())
SetBackgroundColour(resource->GetBackgroundColour());
}
-
+
// Should have some kind of font at this point
if (!GetFont().Ok())
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
if (!GetBackgroundColour().Ok())
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
-
+
// Only when we've created the window and set the font can we set the correct size,
// if based on dialog units.
if ((resource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0)
{
wxSize sz = ConvertDialogToPixels(wxSize(width, height));
SetClientSize(sz.x, sz.y);
-
+
wxPoint pt = ConvertDialogToPixels(wxPoint(x, y));
Move(pt.x, pt.y);
}
-
+
// Now create children
wxNode *node = resource->GetChildren().First();
while (node)
{
wxItemResource *childResource = (wxItemResource *)node->Data();
-
+
(void) CreateItem(childResource, resource, table);
-
+
node = node->Next();
}
return TRUE;
size.x = rwidth;
}
}
-
+
// This is what GetPosition() returns. Since we calculate
// borders afterwards, GetPosition() will be the left/top
// corner of the surrounding border.
window->SetSizeHints( size.x, size.y );
}
-wxSize wxSizer::GetMaxWindowSize( wxWindow *window )
+wxSize wxSizer::GetMaxWindowSize( wxWindow *WXUNUSED(window) )
{
wxSize sizeMax = wxGetDisplaySize();
// make the max size a bit smaller than the screen, a window which takes
wxSizerItem *item = (wxSizerItem*) node->Data();
m_stretchable += item->GetOption();
-
+
wxSize size( item->CalcMin() );
if (m_orient == wxHORIZONTAL)
m_fixedWidth = wxMax( m_fixedWidth, size.x );
}
else
- {
+ {
m_fixedWidth += size.x;
m_fixedHeight = wxMax( m_fixedHeight, size.y );
}
else
#endif // __WXGTK__
*borderTop = 15;
-
+ (void)box;
*borderOther = 5;
}
// Get UTC time as seconds since 00:00:00, Jan 1st 1970
long wxGetUTCTime()
{
- struct tm tm, *ptm;
+ struct tm tm;
+ struct tm *ptm;
time_t t0, t1;
// This cannot be made static because mktime can overwrite it
if ( event.GetSetText() )
{
- wxControl *control = wxDynamicCast(this, wxControl);
+ wxControl *control = wxDynamicThisCast(this, wxControl);
if ( control )
{
wxTextCtrl *text = wxDynamicCast(control, wxTextCtrl);
}
#if wxUSE_CHECKBOX
- wxCheckBox *checkbox = wxDynamicCast(this, wxCheckBox);
+ wxCheckBox *checkbox = wxDynamicThisCast(this, wxCheckBox);
if ( checkbox )
{
if ( event.GetSetChecked() )
#endif // wxUSE_CHECKBOX
#if wxUSE_RADIOBTN
- wxRadioButton *radiobtn = wxDynamicCast(this, wxRadioButton);
+ wxRadioButton *radiobtn = wxDynamicThisCast(this, wxRadioButton);
if ( radiobtn )
{
if ( event.GetSetChecked() )
//static const int ID_CHECK = 1005;
#if defined(__WXMSW__) || defined(__WXPM__)
+int setdrive(int drive)
+{
+ char newdrive[3];
+
+ if (drive < 1 || drive > 31)
+ return -1;
+ newdrive[0] = (char)('A' + (char)drive - (char)1);
+ newdrive[1] = ':';
+ newdrive[2] = '\0';
+ if (SetCurrentDirectory((LPSTR)newdrive))
+ return 0;
+ else
+ return -1;
+}
+
static bool wxIsDriveAvailable(const wxString dirName)
{
#ifdef __WIN32__
#else
int currentDrive = _getdrive();
int thisDrive = (int) (dirNameLower[(size_t)0] - 'a' + 1) ;
- int err = _chdrive( thisDrive ) ;
- _chdrive( currentDrive );
+ int err = setdrive( thisDrive ) ;
+ setdrive( currentDrive );
if (err == -1)
{
}
-void wxGenericDirCtrl::OnSize(wxSizeEvent &event)
+void wxGenericDirCtrl::OnSize(wxSizeEvent& WXUNUSED(event))
{
DoResize();
}
m_dirCtrl = NULL;
}
-void wxDirFilterListCtrl::OnSelFilter(wxCommandEvent& event)
+void wxDirFilterListCtrl::OnSelFilter(wxCommandEvent& WXUNUSED(event))
{
int sel = GetSelection();
Centre( wxBOTH );
}
-void wxGenericDirDialog::OnCloseWindow(wxCloseEvent& event)
+void wxGenericDirDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
EndModal(wxID_CANCEL);
}
-void wxGenericDirDialog::OnOK(wxCommandEvent& event)
+void wxGenericDirDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{
m_path = m_input->GetValue();
// Does the path exist? (User may have typed anything in m_input)
// This is used to redraw all grid lines e.g. when the grid line colour
// has been changed
//
-void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED_GTK(reg) )
+void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) )
{
if ( !m_gridLinesEnabled ||
!m_numRows ||
m_timer.Stop();
}
-void wxSplashScreen::OnNotify(wxTimerEvent& event)
+void wxSplashScreen::OnNotify(wxTimerEvent& WXUNUSED(event))
{
Close(TRUE);
}
-void wxSplashScreen::OnCloseWindow(wxCloseEvent& event)
+void wxSplashScreen::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
m_timer.Stop();
this->Destroy();
m_bitmap = bitmap;
}
-void wxSplashScreenWindow::OnPaint(wxPaintEvent& event)
+void wxSplashScreenWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);
if (m_bitmap.Ok())
dc.DrawBitmap(m_bitmap, 0, 0);
}
-static void wxDrawSplashBitmap(wxDC& dc, const wxBitmap& bitmap, int x, int y)
+static void wxDrawSplashBitmap(wxDC& dc, const wxBitmap& bitmap, int WXUNUSED(x), int WXUNUSED(y))
{
wxMemoryDC dcMem;
#ifndef __WXGTK__
bool hiColour = (wxDisplayDepth() >= 16) ;
-
+
if (bitmap.GetPalette() && !hiColour)
{
dc.SetPalette(* bitmap.GetPalette());
GetParent()->Close(TRUE);
}
-void wxSplashScreenWindow::OnChar(wxKeyEvent& event)
+void wxSplashScreenWindow::OnChar(wxKeyEvent& WXUNUSED(event))
{
GetParent()->Close(TRUE);
}
}
}
-void wxTipWindow::OnMouseClick(wxMouseEvent& event)
+void wxTipWindow::OnMouseClick(wxMouseEvent& WXUNUSED(event))
{
Close();
}
Close();
}
-void wxTipWindow::OnKillFocus(wxFocusEvent& event)
+void wxTipWindow::OnKillFocus(wxFocusEvent& WXUNUSED(event))
{
// Under Windows at least, we will get this immediately
// because when the view window is focussed, the
2*(TEXT_MARGIN_Y + 1) + parent->m_textLines.GetCount()*parent->m_heightLine);
}
-void wxTipWindowView::OnPaint(wxPaintEvent& event)
+void wxTipWindowView::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxTipWindow* parent = (wxTipWindow*) GetParent();
if (!parent)
}
}
-void wxTipWindowView::OnMouseClick(wxMouseEvent& event)
+void wxTipWindowView::OnMouseClick(wxMouseEvent& WXUNUSED(event))
{
GetParent()->Close();
}
-void wxTipWindowView::OnKillFocus(wxFocusEvent& event)
+void wxTipWindowView::OnKillFocus(wxFocusEvent& WXUNUSED(event))
{
// Workaround the kill focus event happening just after creation in wxGTK
if (wxGetLocalTime() > m_creationTime + 1)
GetParent()->Close();
}
+
{
(*m_accept) = TRUE;
(*m_res) = GetValue();
-
+
if (!wxPendingDelete.Member(this))
wxPendingDelete.Append(this);
if ((*m_accept) && ((*m_res) != m_startValue))
m_owner->OnRenameAccept();
-
+
return;
}
if (event.m_keyCode == WXK_ESCAPE)
{
(*m_accept) = FALSE;
(*m_res) = "";
-
+
if (!wxPendingDelete.Member(this))
wxPendingDelete.Append(this);
-
+
return;
}
event.Skip();
if (myPos.x + sx > parentSize.x) sx = parentSize.x - myPos.x;
if (mySize.x > sx) sx = mySize.x;
SetSize(sx, -1);
-
+
event.Skip();
}
m_imageListNormal =
m_imageListState = (wxImageList *) NULL;
- m_ownsImageListNormal =
+ m_ownsImageListNormal =
m_ownsImageListState = FALSE;
m_dragCount = 0;
// get the bounding rectangle of the item (or of its label only)
bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
wxRect& rect,
- bool textOnly) const
+ bool WXUNUSED(textOnly)) const
{
wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid item in wxGenericTreeCtrl::GetBoundingRect") );
#if wxUSE_BUSYINFO
wxBusyInfo* busy = NULL;
wxString info;
- if (show_wait_msg)
+ if (show_wait_msg)
{
info.Printf(_("Adding book %s"), book.c_str());
busy = new wxBusyInfo(info);
#if wxUSE_BUSYINFO
if (show_wait_msg)
delete busy;
-#endif
+#endif
return retval;
}
return ;
}
- if (m_Config == NULL)
+ if (m_Config == NULL)
{
m_Config = wxConfigBase::Get(FALSE);
if (m_Config != NULL)
return TRUE;
}
-
- return FALSE;
-#else
- return FALSE;
#endif
+ return FALSE;
}
void wxHtmlHelpController::SetFrameParameters(const wxString& title,
// moreover, if no contents, index or searchpage is needed, m_Splitter and
// m_NavigPan will be NULL too (with m_HtmlWin directly connected to the frame)
-bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& title,
+bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& WXUNUSED(title),
int style)
{
wxImageList *ContentsImageList = new wxImageList(16, 16);
));
}
- void OnUpdate(wxCommandEvent& event)
+ void OnUpdate(wxCommandEvent& WXUNUSED(event))
{
UpdateTestWin();
}
{
wxBusyCursor bcur;
const wxChar *cstr = sr.c_str();
- wxChar mybuff[512], *ptr;
+ wxChar mybuff[512];
+ wxChar *ptr;
bool first = TRUE;
m_IndexList->Clear();
SetBackgroundColour(wxColour(0xFF, 0xFF, 0xFF));
m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString;
m_Parser->SetDC(dc);
- if (m_Cell)
+ if (m_Cell)
{
delete m_Cell;
m_Cell = NULL;
wxFSFile *f;
bool rt_val;
bool needs_refresh = FALSE;
-
+
SetCursor(*wxHOURGLASS_CURSOR);
wxYield(); Refresh(FALSE);
rt_val = ScrollToAnchor(anch);
m_tmpCanDrawLocks++;
}
- else if (location.Find(wxT('#')) != wxNOT_FOUND && location.BeforeFirst(wxT('#')) == m_OpenedPage)
+ else if (location.Find(wxT('#')) != wxNOT_FOUND && location.BeforeFirst(wxT('#')) == m_OpenedPage)
{
wxString anch = location.AfterFirst(wxT('#'));
m_tmpCanDrawLocks--;
rt_val = ScrollToAnchor(anch);
m_tmpCanDrawLocks++;
}
- else if (location.Find(wxT('#')) != wxNOT_FOUND &&
- (m_FS->GetPath() + location.BeforeFirst(wxT('#'))) == m_OpenedPage)
+ else if (location.Find(wxT('#')) != wxNOT_FOUND &&
+ (m_FS->GetPath() + location.BeforeFirst(wxT('#'))) == m_OpenedPage)
{
wxString anch = location.AfterFirst(wxT('#'));
m_tmpCanDrawLocks--;
m_tmpCanDrawLocks++;
}
- else
+ else
{
needs_refresh = TRUE;
// load&display it:
- if (m_RelatedStatusBar != -1)
+ if (m_RelatedStatusBar != -1)
{
m_RelatedFrame->SetStatusText(_("Connecting..."), m_RelatedStatusBar);
Refresh(FALSE);
}
f = m_FS->OpenFile(location);
-
- if (f == NULL)
+
+ if (f == NULL)
{
wxString err;
return FALSE;
}
- else
+ else
{
wxNode *node;
wxString src = wxEmptyString;
- if (m_RelatedStatusBar != -1)
+ if (m_RelatedStatusBar != -1)
{
wxString msg = _("Loading : ") + location;
m_RelatedFrame->SetStatusText(msg, m_RelatedStatusBar);
}
node = node->GetNext();
}
- if (src == wxEmptyString)
+ if (src == wxEmptyString)
{
if (m_DefaultFilter == NULL) m_DefaultFilter = GetDefaultFilter();
src = m_DefaultFilter->ReadFile(*f);
m_FS->ChangePathTo(f->GetLocation());
rt_val = SetPage(src);
m_OpenedPage = f->GetLocation();
- if (f->GetAnchor() != wxEmptyString)
+ if (f->GetAnchor() != wxEmptyString)
{
wxYield();
ScrollToAnchor(f->GetAnchor());
OnSetTitle(wxFileNameFromPath(m_OpenedPage));
SetCursor(*wxSTANDARD_CURSOR);
- if (needs_refresh)
+ if (needs_refresh)
{
wxYield();
m_tmpCanDrawLocks--;
wxLogWarning(_("HTML anchor %s does not exist."), anchor.c_str());
return FALSE;
}
- else
+ else
{
int y;
void wxHtmlWindow::OnSetTitle(const wxString& title)
{
- if (m_RelatedFrame)
+ if (m_RelatedFrame)
{
wxString tit;
tit.Printf(m_TitleFormat, title.c_str());
if (!m_Cell) return;
- if (m_Style & wxHW_SCROLLBAR_NEVER)
+ if (m_Style & wxHW_SCROLLBAR_NEVER)
{
SetScrollbars(wxHTML_SCROLL_STEP, 1, m_Cell->GetWidth() / wxHTML_SCROLL_STEP, 0); // always off
GetClientSize(&ClientWidth, &ClientHeight);
else {
GetClientSize(&ClientWidth, &ClientHeight);
m_Cell->Layout(ClientWidth);
- if (ClientHeight < m_Cell->GetHeight() + GetCharHeight())
+ if (ClientHeight < m_Cell->GetHeight() + GetCharHeight())
{
SetScrollbars(
wxHTML_SCROLL_STEP, wxHTML_SCROLL_STEP,
int p_fontsizes[7];
wxString p_fff, p_ffn;
- if (path != wxEmptyString)
+ if (path != wxEmptyString)
{
oldpath = cfg->GetPath();
cfg->SetPath(path);
m_Borders = cfg->Read("wxHtmlWindow/Borders", m_Borders);
p_fff = cfg->Read("wxHtmlWindow/FontFaceFixed", m_Parser->m_FontFaceFixed);
p_ffn = cfg->Read("wxHtmlWindow/FontFaceNormal", m_Parser->m_FontFaceNormal);
- for (int i = 0; i < 7; i++)
+ for (int i = 0; i < 7; i++)
{
tmp.Printf(wxT("wxHtmlWindow/FontsSize%i"), i);
p_fontsizes[i] = cfg->Read(tmp, m_Parser->m_FontsSizes[i]);
wxString oldpath;
wxString tmp;
- if (path != wxEmptyString)
+ if (path != wxEmptyString)
{
oldpath = cfg->GetPath();
cfg->SetPath(path);
cfg->Write("wxHtmlWindow/Borders", (long) m_Borders);
cfg->Write("wxHtmlWindow/FontFaceFixed", m_Parser->m_FontFaceFixed);
cfg->Write("wxHtmlWindow/FontFaceNormal", m_Parser->m_FontFaceNormal);
- for (int i = 0; i < 7; i++)
+ for (int i = 0; i < 7; i++)
{
tmp.Printf(wxT("wxHtmlWindow/FontsSize%i"), i);
cfg->Write(tmp, (long) m_Parser->m_FontsSizes[i]);
int v_y, v_h;
if (m_tmpCanDrawLocks > 0) return;
-
+
dc.SetMapMode(wxMM_TEXT);
#if 0
-/* VS - I don't think this is neccessary any longer
+/* VS - I don't think this is neccessary any longer
MSC_VER 1200 means MSVC 6.0 and it works fine */
#if defined(_MSC_VER) && (_MSC_VER == 1200)
::SetMapMode((HDC)dc.GetHDC(), MM_TEXT);
dc.SetBackgroundMode(wxTRANSPARENT);
ViewStart(&x, &y);
- while (upd)
+ while (upd)
{
v_y = upd.GetY();
v_h = upd.GetH();
{
m_tmpMouseMoved = TRUE;
- if (event.ButtonDown())
+ if (event.ButtonDown())
{
int sx, sy;
wxPoint pos;
-void wxHtmlWindow::OnIdle(wxIdleEvent& event)
+void wxHtmlWindow::OnIdle(wxIdleEvent& WXUNUSED(event))
{
- if (s_cur_hand == NULL)
+ if (s_cur_hand == NULL)
{
s_cur_hand = new wxCursor(wxCURSOR_HAND);
s_cur_arrow = new wxCursor(wxCURSOR_ARROW);
}
- if (m_tmpMouseMoved && (m_Cell != NULL))
+ if (m_tmpMouseMoved && (m_Cell != NULL))
{
int sx, sy;
int x, y;
ScreenToClient(&x, &y);
lnk = m_Cell->GetLink(sx + x, sy + y);
- if (lnk != m_tmpLastLink)
+ if (lnk != m_tmpLastLink)
{
- if (lnk == NULL)
+ if (lnk == NULL)
{
SetCursor(*s_cur_arrow);
if (m_RelatedStatusBar != -1) m_RelatedFrame->SetStatusText(wxEmptyString, m_RelatedStatusBar);
}
- else
+ else
{
SetCursor(*s_cur_hand);
- if (m_RelatedStatusBar != -1)
+ if (m_RelatedStatusBar != -1)
m_RelatedFrame->SetStatusText(lnk->GetHref(), m_RelatedStatusBar);
}
m_tmpLastLink = lnk;
int oldsize = m_WParser->GetFontSize();
wxString oldface = m_WParser->GetFontFace();
- if (tag.HasParam(wxT("COLOR")))
+ if (tag.HasParam(wxT("COLOR")))
{
- unsigned long tmp = 0;
+ unsigned long tmp = 0;
wxColour clr;
- if (tag.ScanParam(wxT("COLOR"), wxT("#%lX"), &tmp) == 1)
+ if (tag.ScanParam(wxT("COLOR"), wxT("#%lX"), &tmp) == 1)
{
- clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
+ clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16),
+ (unsigned char)((tmp & 0x00FF00) >> 8),
+ (unsigned char)(tmp & 0x0000FF));
m_WParser->SetActualColor(clr);
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr));
}
}
- if (tag.HasParam(wxT("SIZE")))
+ if (tag.HasParam(wxT("SIZE")))
{
long tmp = 0;
wxChar c = tag.GetParam(wxT("SIZE"))[(unsigned int) 0];
- if (tag.ScanParam(wxT("SIZE"), wxT("%li"), &tmp) == 1)
+ if (tag.ScanParam(wxT("SIZE"), wxT("%li"), &tmp) == 1)
{
if (c == '+' || c == '-')
m_WParser->SetFontSize(oldsize+tmp);
m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
}
}
-
- if (tag.HasParam(wxT("FACE")))
+
+ if (tag.HasParam(wxT("FACE")))
{
- if (m_Faces.GetCount() == 0)
+ if (m_Faces.GetCount() == 0)
{
wxFontEnumerator enu;
enu.EnumerateFacenames();
}
wxStringTokenizer tk(tag.GetParam(wxT("FACE")), ",");
int index;
-
- while (tk.HasMoreTokens())
+
+ while (tk.HasMoreTokens())
{
- if ((index = m_Faces.Index(tk.GetNextToken())) != wxNOT_FOUND)
+ if ((index = m_Faces.Index(tk.GetNextToken())) != wxNOT_FOUND)
{
m_WParser->SetFontFace(m_Faces[index]);
m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
ParseInner(tag);
- if (oldface != m_WParser->GetFontFace())
+ if (oldface != m_WParser->GetFontFace())
{
m_WParser->SetFontFace(oldface);
m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
- }
- if (oldsize != m_WParser->GetFontSize())
+ }
+ if (oldsize != m_WParser->GetFontSize())
{
m_WParser->SetFontSize(oldsize);
m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
- }
- if (oldclr != m_WParser->GetActualColor())
+ }
+ if (oldclr != m_WParser->GetActualColor())
{
m_WParser->SetActualColor(oldclr);
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr));
m_WParser->SetFontSize(6);
else if (tag.GetName() == wxT("H3"))
m_WParser->SetFontSize(5);
- else if (tag.GetName() == wxT("H4"))
+ else if (tag.GetName() == wxT("H4"))
{
m_WParser->SetFontSize(5);
m_WParser->SetFontItalic(TRUE);
}
else if (tag.GetName() == wxT("H5"))
m_WParser->SetFontSize(4);
- else if (tag.GetName() == wxT("H6"))
+ else if (tag.GetName() == wxT("H6"))
{
m_WParser->SetFontSize(4);
m_WParser->SetFontItalic(TRUE);
}
c = m_WParser->GetContainer();
- if (c->GetFirstCell())
+ if (c->GetFirstCell())
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
TAG_HANDLER_PROC(tag)
{
- if (m_WParser->GetContainer()->GetFirstCell() != NULL)
+ if (m_WParser->GetContainer()->GetFirstCell() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
{
int al = m_WParser->GetContainer()->GetAlignHor();
wxHtmlContainerCell *c;
-
+
m_WParser->CloseContainer();
c = m_WParser->OpenContainer();
c->SetAlignHor(al);
wxHtmlContainerCell *c = m_WParser->GetContainer();
m_WParser->SetAlign(wxHTML_ALIGN_CENTER);
- if (c->GetFirstCell() != NULL)
+ if (c->GetFirstCell() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
else
c->SetAlignHor(wxHTML_ALIGN_CENTER);
- if (tag.HasEnding())
+ if (tag.HasEnding())
{
ParseInner(tag);
m_WParser->SetAlign(old);
- if (c->GetFirstCell() != NULL)
+ if (c->GetFirstCell() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
{
int old = m_WParser->GetAlign();
wxHtmlContainerCell *c = m_WParser->GetContainer();
- if (c->GetFirstCell() != NULL)
+ if (c->GetFirstCell() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
c->SetAlign(tag);
m_WParser->SetAlign(c->GetAlignHor());
}
- else
+ else
{
c->SetAlign(tag);
m_WParser->SetAlign(c->GetAlignHor());
ParseInner(tag);
m_WParser->SetAlign(old);
- if (c->GetFirstCell() != NULL)
+ if (c->GetFirstCell() != NULL)
{
m_WParser->CloseContainer();
m_WParser->OpenContainer();
TAG_HANDLER_PROC(tag)
{
- if (m_WParser->GetWindow())
+ if (m_WParser->GetWindow())
{
wxHtmlWindow *wfr = (wxHtmlWindow*)(m_WParser->GetWindow());
- if (wfr)
+ if (wfr)
{
wxString title = "";
wxString *src = m_WParser->GetSource();
unsigned long tmp;
wxColour clr;
- if (tag.HasParam(wxT("TEXT")))
+ if (tag.HasParam(wxT("TEXT")))
{
- if (tag.ScanParam(wxT("TEXT"), wxT("#%lX"), &tmp) == 1)
+ if (tag.ScanParam(wxT("TEXT"), wxT("#%lX"), &tmp) == 1)
{
- clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
+ clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16),
+ (unsigned char)((tmp & 0x00FF00) >> 8),
+ (unsigned char)(tmp & 0x0000FF));
m_WParser->SetActualColor(clr);
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr));
}
}
- if (tag.HasParam(wxT("LINK")))
+ if (tag.HasParam(wxT("LINK")))
{
- if (tag.ScanParam(wxT("LINK"), wxT("#%lX"), &tmp) == 1)
+ if (tag.ScanParam(wxT("LINK"), wxT("#%lX"), &tmp) == 1)
{
- clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
+ clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16),
+ (unsigned char)((tmp & 0x00FF00) >> 8),
+ (unsigned char)(tmp & 0x0000FF));
m_WParser->SetLinkColor(clr);
}
}
- if (tag.HasParam(wxT("BGCOLOR")))
+ if (tag.HasParam(wxT("BGCOLOR")))
{
- if (tag.ScanParam(wxT("BGCOLOR"), wxT("#%lX"), &tmp) == 1)
+ if (tag.ScanParam(wxT("BGCOLOR"), wxT("#%lX"), &tmp) == 1)
{
- clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
+ clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16),
+ (unsigned char)((tmp & 0x00FF00) >> 8),
+ (unsigned char)(tmp & 0x0000FF));
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr, wxHTML_CLR_BACKGROUND));
if (m_WParser->GetWindow() != NULL)
m_WParser->GetWindow()->SetBackgroundColour(clr);
TAG_HANDLER_PROC(tag)
{
wxHtmlContainerCell *c;
-
+
m_WParser->CloseContainer();
c = m_WParser->OpenContainer();
-
+
if (c->GetAlignHor() == wxHTML_ALIGN_RIGHT)
c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_RIGHT);
else
c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
-
+
c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
m_WParser->OpenContainer();
ParseInner(tag);
// normally result in message boxes popping up &c
wxLog::Suspend();
-#ifdef __WXDEBUG__
+#ifdef __WXDEBUG__
if (gs_inYield)
wxFAIL_MSG( wxT("wxYield called recursively" ) );
#endif
-
+
gs_inYield = TRUE;
// we don't want to process WM_QUIT from here - it should be processed in
{
if (gs_inYield)
return FALSE;
-
+
return wxYield();
}
return TRUE;
#else
wxFAIL_MSG(_T("set wxUSE_ON_FATAL_EXCEPTION to 1 to sue this function"));
-
+
+ (void)doit;
return FALSE;
#endif
}
wxT("BUTTON"),
wxT(""),
msStyle,
- 0, 0, 0, 0,
+ 0, 0, 0, 0,
GetWinHwnd(parent),
(HMENU)m_windowId,
wxGetInstance(),
wxDC dst;
dst.SetHDC((WXHDC) hDC, FALSE);
dst.DrawBitmap(*bitmap, x1, y1, TRUE);
-
+
// draw focus / disabled state, if auto-drawing
if ( (state & ODS_DISABLED) && autoDraw )
{
if ( sel )
OffsetRect( &rect, 1, 1 );
*/
+ (void)sel;
DrawFocusRect( (HDC) dc, &rect );
}
// event/message handlers
// ----------------------------------------------------------------------------
-bool wxButton::MSWCommand(WXUINT param, WXWORD id)
+bool wxButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
bool processed = FALSE;
switch ( param )
// wxBitmapCheckBox
// ----------------------------------------------------------------------------
-bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label,
+bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *WXUNUSED(label),
const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator,
return TRUE;
}
-void wxBitmapCheckBox::SetLabel(const wxBitmap& bitmap)
+void wxBitmapCheckBox::SetLabel(const wxBitmap& WXUNUSED(bitmap))
{
wxFAIL_MSG(wxT("not implemented"));
}
#endif // Watcom/!Watcom
}
-void wxChoice::SetString(int n, const wxString& s)
+void wxChoice::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s))
{
wxFAIL_MSG(wxT("not implemented"));
// ----------------------------------------------------------------------------
void wxChoice::DoSetSize(int x, int y,
- int width, int height,
+ int width, int WXUNUSED(height),
int sizeFlags)
{
// Ignore height parameter because height doesn't mean 'initially
return TRUE;
}
-WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
+WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam))
{
#if wxUSE_CTL3D
if ( m_useCtl3D )
wxBitmap *bitmap = (wxBitmap *)data;
HBITMAP hBitmap = (HBITMAP)bitmap->GetHBITMAP();
// NULL palette means to use the system one
- HANDLE hDIB = wxBitmapToDIB(hBitmap, (HPALETTE)NULL);
+ HANDLE hDIB = wxBitmapToDIB(hBitmap, (HPALETTE)NULL);
handle = SetClipboardData(CF_DIB, hDIB);
#endif // wxUSE_IMAGE_LOADING_IN_MSW
break;
wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat)
{
- return ::EnumClipboardFormats(dataFormat);
+ return (wxDataFormat::NativeFormat)::EnumClipboardFormats(dataFormat);
}
int wxRegisterClipboardFormat(wxChar *formatName)
#if wxUSE_METAFILE
case wxDF_METAFILE:
{
- wxMetafileDataObject* metaFileDataObject =
+ wxMetafileDataObject* metaFileDataObject =
(wxMetafileDataObject*) data;
wxMetafile metaFile = metaFileDataObject->GetMetafile();
return wxSetClipboardData(wxDF_METAFILE, &metaFile,
// build the list of supported formats
size_t nFormats = data.GetFormatCount(wxDataObject::Set);
- wxDataFormat format, *formats;
+ wxDataFormat format;
+ wxDataFormat *formats;
if ( nFormats == 1 )
{
// the most common case
UINT CALLBACK wxColourDialogHookProc(HWND hwnd,
UINT uiMsg,
- WPARAM wParam,
+ WPARAM WXUNUSED(wParam),
LPARAM lParam)
{
if ( uiMsg == WM_INITDIALOG )
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
}
-WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
+WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam))
{
#if wxUSE_CTL3D
if ( m_useCtl3D )
{
case WM_CHAR:
return HandleChar(wParam, lParam, TRUE /* isASCII */);
-
+
case WM_KEYDOWN:
return HandleKeyDown(wParam, lParam);
SendMessage(hWnd, WM_PASTE, 0, 0L);
}
-void wxComboBox::SetEditable(bool editable)
+void wxComboBox::SetEditable(bool WXUNUSED(editable))
{
// Can't implement in MSW?
// HWND hWnd = GetHwnd();
toChar = -1;
}
- if (
+ if (
#ifdef __WIN32__
SendMessage(hWnd, CB_SETEDITSEL, (WPARAM)0, (LPARAM)MAKELONG(fromChar, toChar))
#else // Win16
::SetMapMode(hdc, mode);
}
-WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
+WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam))
{
#if wxUSE_CTL3D
if ( m_useCtl3D )
HANDLE ReadIcon( wxChar *szFileName, int *W, int *H)
{ ICONFILEHEADER iconFileHead; // ICON file header structure
ICONFILERES iconFileRes; // ICON file resource
- WORD cbHead,
+ UINT cbHead,
cbRes,
cbBits; // Used for reading in file
int hFile; // File handle
//* bitmaps. So, no need to convert the AND bitmask. *
//* 7) Since a DIB is stored upside down, flip the monochrome AND bits*
//* by scanlines. *
-//* 8) Use the XOR and AND bits and create an icon with CreateIcon. *
+//* 8) Use the XOR and AND bits and create an icon with CreateIcon. *
//*****************************************************************************
HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst)
szFlip[(k - 1) - j] = *(DWORD FAR *)lpANDbits;
// 8) Use the XOR and AND bits and create an icon with CreateIcon.
- hIcon = CreateIcon( hInst, bmpXor.bmWidth, bmpXor.bmHeight, bmpXor.bmPlanes,
- bmpXor.bmBitsPixel, (const BYTE *)szFlip, (const BYTE *)lpXorDDB);
+ hIcon = CreateIcon( hInst, bmpXor.bmWidth, bmpXor.bmHeight, (BYTE)bmpXor.bmPlanes,
+ (BYTE)bmpXor.bmBitsPixel, (const BYTE *)szFlip, (const BYTE *)lpXorDDB);
// Clean up before exiting.
DeleteObject( hbmXor);
HANDLE ReadCur( wxChar *szFileName, LPPOINT lpptHotSpot, int *W, int *H)
{ CURFILEHEADER curFileHead; // CURSOR file header structure
CURFILERES curFileRes; // CURSOR file resource
- WORD cbHead,
+ UINT cbHead,
cbRes,
cbBits; // Used for reading in file
LPBITMAPINFO lpDIB; // Pointer to DIB memory
NumColors = DIBNumColors((LPSTR )lpbi);
if(lpbi->biSize == sizeof( BITMAPCOREHEADER)) // OS/2 style DIBs
- return NumColors * sizeof( RGBTRIPLE);
+ return (WORD)(NumColors * sizeof( RGBTRIPLE));
else
- return NumColors * sizeof( RGBQUAD);
+ return (WORD)(NumColors * sizeof( RGBQUAD));
}
//*****************************************************************************
// is in biClrUsed, whereas in the BITMAPCORE - style headers, it
// is dependent on the bits per pixel ( = 2 raised to the power of
// bits/pixel).
-
+
if(lpbi->biSize != sizeof( BITMAPCOREHEADER))
{
if(lpbi->biClrUsed != 0)
/*
* This doesn't work: just gives us a grey square. Ideas, anyone?
*/
-
+
HICON MakeIconFromBitmap(HINSTANCE hInst, HBITMAP hBitmap)
{
HDC hDCColor, hDCMono;
SetROP2(GetHdc(), rop);
}
-bool wxDC::StartDoc(const wxString& message)
+bool wxDC::StartDoc(const wxString& WXUNUSED(message))
{
// We might be previewing, so return TRUE to let it continue.
return TRUE;
wxCoord width, wxCoord height,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
- int rop, bool useMask)
+ int WXUNUSED(rop), bool useMask)
{
bool success = TRUE;
HBRUSH brush = ::CreateSolidBrush(::GetPixel(dc_src, x, y));
rect.left = xdest + x;
rect.right = rect.left + 1;
- rect.top = ydest + y;
+ rect.top = ydest + y;
rect.bottom = rect.top + 1;
::FillRect(GetHdc(), &rect, brush);
::DeleteObject(brush);
// ----------------------------------------------------------------------------
// Standard buttons
-void wxDialog::OnOK(wxCommandEvent& event)
+void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{
if ( Validate() && TransferDataFromWindow() )
{
}
}
-void wxDialog::OnApply(wxCommandEvent& event)
+void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
{
if ( Validate() )
TransferDataFromWindow();
// TODO probably need to disable the Apply button until things change again
}
-void wxDialog::OnCancel(wxCommandEvent& event)
+void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{
EndModal(wxID_CANCEL);
}
-void wxDialog::OnCloseWindow(wxCloseEvent& event)
+void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
// We'll send a Cancel message by default, which may close the dialog.
// Check for looping if the Cancel event handler calls Close().
return TRUE;
}
-void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event)
+void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
{
#if wxUSE_CTL3D
Ctl3dColorChange();
NumColors = DibNumColors(lpbi);
if (lpbi->biSize == sizeof(BITMAPCOREHEADER))
- return NumColors * sizeof(RGBTRIPLE);
+ return (WORD)(NumColors * sizeof(RGBTRIPLE));
else
- return NumColors * sizeof(RGBQUAD);
+ return (WORD)(NumColors * sizeof(RGBQUAD));
}
/****************************************************************************
}
/* offset to the bits from start of DIB header */
- offBits = (WORD)lpbi->biSize + nNumColors * sizeof(RGBQUAD);
+ offBits = (WORD)(lpbi->biSize + nNumColors * sizeof(RGBQUAD));
if (bf.bfOffBits != 0L)
{
bi.biSize = sizeof(BITMAPINFOHEADER);
bi.biWidth = (DWORD)bc.bcWidth;
bi.biHeight = (DWORD)bc.bcHeight;
- bi.biPlanes = (UINT)bc.bcPlanes;
- bi.biBitCount = (UINT)bc.bcBitCount;
+ bi.biPlanes = (WORD)bc.bcPlanes;
+ bi.biBitCount = (WORD)bc.bcBitCount;
bi.biCompression = BI_RGB;
bi.biSizeImage = 0;
bi.biXPelsPerMeter = 0;
#define RLE_EOF 1
#define RLE_JMP 2
-static void xlatRle8(BYTE FAR *pb, DWORD dwSize, BYTE FAR *xlat)
+static void xlatRle8(BYTE FAR *pb, DWORD WXUNUSED(dwSize), BYTE FAR *xlat)
{
BYTE cnt;
BYTE b;
}
}
-static void xlatRle4(BYTE FAR *pb, DWORD dwSize, BYTE FAR *xlat)
+static void xlatRle4(BYTE FAR *WXUNUSED(pb), DWORD WXUNUSED(dwSize), BYTE FAR *WXUNUSED(xlat))
{
}
HPALETTE hPalette;
const RGBQUAD FAR* rgb = Info->bmiColors;
- WORD nColors = Info->bmiHeader.biClrUsed;
+ WORD nColors = (WORD)Info->bmiHeader.biClrUsed;
if (nColors) {
LOGPALETTE* logPal = (LOGPALETTE*)
new BYTE[sizeof(LOGPALETTE) + (nColors-1)*sizeof(PALETTEENTRY)];
const wxString& description)
{
ScreenHDC hdcRef;
-
- RECT rect, *pRect;
+ RECT rect;
+ RECT *pRect;
if ( width && height )
{
rect.top =
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
- long style, const wxPoint& pos)
+ long style, const wxPoint& WXUNUSED(pos))
{
m_message = message;
m_dialogStyle = style;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
- lf.lfItalic = l;
+ lf.lfItalic = (BYTE)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
- lf.lfUnderline = l;
+ lf.lfUnderline = (BYTE)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
- lf.lfStrikeOut = l;
+ lf.lfStrikeOut = (BYTE)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
- lf.lfCharSet = l;
+ lf.lfCharSet = (BYTE)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
- lf.lfOutPrecision = l;
+ lf.lfOutPrecision = (BYTE)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
- lf.lfClipPrecision = l;
+ lf.lfClipPrecision = (BYTE)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
- lf.lfQuality = l;
+ lf.lfQuality = (BYTE)l;
token = tokenizer.GetNextToken();
if ( !token.ToLong(&l) )
return FALSE;
- lf.lfPitchAndFamily = l;
+ lf.lfPitchAndFamily = (BYTE)l;
token = tokenizer.GetNextToken();
if(!token)
return TRUE;
}
-bool wxFont::FreeResource(bool force)
+bool wxFont::FreeResource(bool WXUNUSED(force))
{
if ( GetResourceHandle() )
{
return TRUE;
}
-void wxGauge95::SetShadowWidth(int w)
+void wxGauge95::SetShadowWidth(int WXUNUSED(w))
{
}
-void wxGauge95::SetBezelFace(int w)
+void wxGauge95::SetBezelFace(int WXUNUSED(w))
{
}
bool wxICOFileHandler::LoadIcon(wxIcon *icon,
const wxString& name,
- long flags,
+ long WXUNUSED(flags),
int desiredWidth, int desiredHeight)
{
#if wxUSE_RESOURCE_LOADING_IN_MSW
bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
const wxString& name,
- long flags,
+ long WXUNUSED(flags),
int desiredWidth, int desiredHeight)
{
HICON hicon;
#ifndef __GSOCKET_STANDALONE__
+# include "wx/defs.h"
# include "wx/setup.h"
#endif
socket->m_cbacks[i] = NULL;
}
socket->m_detected = 0;
- socket->m_local = NULL;
- socket->m_peer = NULL;
+ socket->m_local = NULL;
+ socket->m_peer = NULL;
socket->m_error = GSOCK_NOERROR;
- socket->m_server = FALSE;
+ socket->m_server = FALSE;
socket->m_stream = TRUE;
socket->m_non_blocking = FALSE;
socket->m_timeout.tv_sec = 10 * 60; /* 10 minutes */
* Sets up this socket as a server. The local address must have been
* set with GSocket_SetLocal() before GSocket_SetServer() is called.
* Returns GSOCK_NOERROR on success, one of the following otherwise:
- *
+ *
* Error codes:
* GSOCK_INVSOCK - the socket is in use.
* GSOCK_INVADDR - the local address has not been set.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_SetServer(GSocket *sck)
{
* GSOCK_TIMEDOUT - timeout, no incoming connections.
* GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking.
* GSOCK_MEMERR - couldn't allocate memory.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocket *GSocket_WaitConnection(GSocket *sck)
{
* GSOCK_TIMEDOUT - timeout, the connection failed.
* GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only)
* GSOCK_MEMERR - couldn't allocate memory.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
{
* Error codes:
* GSOCK_INVSOCK - the socket is in use.
* GSOCK_INVADDR - the local address has not been set.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_SetNonOriented(GSocket *sck)
{
return result;
-#else
+#else
assert(socket != NULL);
return flags & socket->m_detected;
* operation, there is still data available, the callback function will
* be called again.
* GSOCK_OUTPUT:
- * The socket is available for writing. That is, the next write call
+ * The socket is available for writing. That is, the next write call
* won't block. This event is generated only once, when the connection is
* first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should
#else /* !wxUSE_SOCKETS */
-/*
+/*
* Translation unit shouldn't be empty, so include this typedef to make the
* compiler (VC++ 6.0, for example) happy
*/
#endif
#ifndef __GSOCKET_STANDALONE__
+#include "wx/defs.h"
#include "wx/setup.h"
#endif
#else /* !wxUSE_SOCKETS */
-/*
+/*
* Translation unit shouldn't be empty, so include this typedef to make the
* compiler (VC++ 6.0, for example) happy
*/
SetMarginWidth(0);
}
-wxOwnerDrawn *wxListBox::CreateItem(size_t n)
+wxOwnerDrawn *wxListBox::CreateItem(size_t WXUNUSED(n))
{
return new wxListBoxItem();
}
delete m_textCtrl;
m_textCtrl = NULL;
}
-
+
if (m_ownsImageListNormal) delete m_imageListNormal;
if (m_ownsImageListSmall) delete m_imageListSmall;
if (m_ownsImageListState) delete m_imageListState;
}
// Sets the item image
-bool wxListCtrl::SetItemImage(long item, int image, int selImage)
+bool wxListCtrl::SetItemImage(long item, int image, int WXUNUSED(selImage))
{
wxListItem info;
}
// End label editing, optionally cancelling the edit
-bool wxListCtrl::EndEditLabel(bool cancel)
+bool wxListCtrl::EndEditLabel(bool WXUNUSED(cancel))
{
wxFAIL;
m_attr = NULL;
}
-static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& lvItem, HWND getFullInfo)
+static void wxConvertFromMSWListItem(const wxListCtrl *WXUNUSED(ctrl), wxListItem& info, LV_ITEM& lvItem, HWND getFullInfo)
{
info.m_data = lvItem.lParam;
info.m_mask = 0;
wxEntryCleanup();
break;
}
+#else
+ (void)hModule;
+ (void)fdwReason;
#endif // !WXMAKINGDLL
-
+ (void)lpReserved;
return TRUE;
}
// now make other extensions have the same filetype
-
+
for (iExtCount=1; iExtCount < ftInfo.GetExtensionsCount(); iExtCount++ )
{
ext = ftInfo.GetExtensions()[iExtCount];
// SetCommand(), SetDefaultIcon() &c will use it later)
wxRegKey keyFT(wxRegKey::HKCR, filetype);
ok = keyFT.Create();
-
- wxFileType *ft = NULL;
+
+ wxFileType *ft = NULL;
ft = CreateFileType(filetype, extWithDot);
if (ft)
bool wxFileTypeImpl::SetCommand(const wxString& cmd,
const wxString& verb,
- bool overwriteprompt)
+ bool WXUNUSED(overwriteprompt))
{
wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), FALSE,
_T("SetCommand() needs an extension and a verb") );
{
public:
wxIEnumFORMATETC(const wxDataFormat* formats, ULONG nCount);
-
- // to suppress the gcc warning about "class has virtual functions but non
- // virtual dtor"
-#ifdef __GNUG__
- virtual
-#endif
- ~wxIEnumFORMATETC() { delete [] m_formats; }
+ virtual ~wxIEnumFORMATETC() { delete [] m_formats; }
DECLARE_IUNKNOWN_METHODS;
{
public:
wxIDataObject(wxDataObject *pDataObject);
-
- // to suppress the gcc warning about "class has virtual functions but non
- // virtual dtor"
-#ifdef __GNUG__
- virtual
-#endif
- ~wxIDataObject();
+ virtual ~wxIDataObject();
// normally, wxDataObject controls our lifetime (i.e. we're deleted when it
// is), but in some cases, the situation is inversed, that is we delete it
void wxDataFormat::SetId(const wxChar *format)
{
- m_format = ::RegisterClipboardFormat(format);
+ m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format);
if ( !m_format )
{
wxLogError(_("Couldn't register clipboard format '%s'."), format);
STDMETHODIMP wxIEnumFORMATETC::Next(ULONG celt,
FORMATETC *rgelt,
- ULONG *pceltFetched)
+ ULONG *WXUNUSED(pceltFetched))
{
wxLogTrace(wxTRACE_OleCalls, wxT("wxIEnumFORMATETC::Next"));
return S_OK;
}
-STDMETHODIMP wxIDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatetcIn,
+STDMETHODIMP wxIDataObject::GetCanonicalFormatEtc(FORMATETC *WXUNUSED(pFormatetcIn),
FORMATETC *pFormatetcOut)
{
wxLogTrace(wxTRACE_OleCalls, wxT("wxIDataObject::GetCanonicalFormatEtc"));
: wxDataObject::Set;
size_t nFormatCount = m_pDataObject->GetFormatCount(dir);
- wxDataFormat format, *formats;
+ wxDataFormat format;
+ wxDataFormat *formats;
formats = nFormatCount == 1 ? &format : new wxDataFormat[nFormatCount];
m_pDataObject->GetAllFormats(formats, dir);
// advise sink functions (not implemented)
// ----------------------------------------------------------------------------
-STDMETHODIMP wxIDataObject::DAdvise(FORMATETC *pformatetc,
- DWORD advf,
- IAdviseSink *pAdvSink,
- DWORD *pdwConnection)
+STDMETHODIMP wxIDataObject::DAdvise(FORMATETC *WXUNUSED(pformatetc),
+ DWORD WXUNUSED(advf),
+ IAdviseSink *WXUNUSED(pAdvSink),
+ DWORD *WXUNUSED(pdwConnection))
{
return OLE_E_ADVISENOTSUPPORTED;
}
-STDMETHODIMP wxIDataObject::DUnadvise(DWORD dwConnection)
+STDMETHODIMP wxIDataObject::DUnadvise(DWORD WXUNUSED(dwConnection))
{
return OLE_E_ADVISENOTSUPPORTED;
}
-STDMETHODIMP wxIDataObject::EnumDAdvise(IEnumSTATDATA **ppenumAdvise)
+STDMETHODIMP wxIDataObject::EnumDAdvise(IEnumSTATDATA **WXUNUSED(ppenumAdvise))
{
return OLE_E_ADVISENOTSUPPORTED;
}
return wxConvertBitmapToDIB((LPBITMAPINFO)buf, GetBitmap()) != 0;
}
-bool wxBitmapDataObject::SetData(size_t len, const void *buf)
+bool wxBitmapDataObject::SetData(size_t WXUNUSED(len), const void *buf)
{
wxBitmap bitmap(wxConvertDIBToBitmap((const LPBITMAPINFO)buf));
// calculate the number of bits per pixel and the number of items in
// bmiColors array (whose meaning depends on the bitmap format)
WORD biBits = bm.bmPlanes * bm.bmBitsPixel;
- WORD biColors = wxGetNumOfBitmapColors(biBits);
+ WORD biColors = (WORD)wxGetNumOfBitmapColors(biBits);
BITMAPINFO bi2;
{
public:
wxIDropTarget(wxDropTarget *p);
- // suppress gcc warning
-#ifdef __GNUG__
- virtual
-#endif
- ~wxIDropTarget();
+ virtual ~wxIDropTarget();
// accessors for wxDropTarget
void SetHwnd(HWND hwnd) { m_hwnd = hwnd; }
// get the list of supported formats
size_t nFormats = m_dataObject->GetFormatCount(wxDataObject::Set);
- wxDataFormat format, *formats;
+ wxDataFormat format;
+ wxDataFormat *formats;
formats = nFormats == 1 ? &format : new wxDataFormat[nFormats];
m_dataObject->GetAllFormats(formats, wxDataObject::Set);
// Name: msw/ownerdrw.cpp
// Purpose: implementation of wxOwnerDrawn class
// Author: Vadim Zeitlin
-// Modified by:
+// Modified by:
// Created: 13.11.97
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// ctor
// ----
-wxOwnerDrawn::wxOwnerDrawn(const wxString& str,
- bool bCheckable, bool bMenuItem)
+wxOwnerDrawn::wxOwnerDrawn(const wxString& str,
+ bool bCheckable, bool WXUNUSED(bMenuItem))
: m_strName(str)
{
m_bCheckable = bCheckable;
// Ray Gilbert's changes - Corrects the problem of a BMP
// being placed next to text in a menu item, and the BMP does
- // not match the size expected by the system. This will
+ // not match the size expected by the system. This will
// resize the space so the BMP will fit. Without this, BMPs
// must be no larger or smaller than 16x16.
if (m_bmpChecked.Ok())
wxSystemSettings::GetSystemMetric(wxSYS_EDGE_Y);
if (*pheight < adjustedHeight)
*pheight = adjustedHeight;
-
+
// Does BMP encroach on default check menu position?
size_t adjustedWidth = m_bmpChecked.GetWidth() +
(wxSystemSettings::GetSystemMetric(wxSYS_EDGE_X) * 2);
if (ms_nDefaultMarginWidth < adjustedWidth)
*pwidth += adjustedWidth - ms_nDefaultMarginWidth;
-
+
// Do we need to widen margin to fit BMP?
if ((size_t)GetMarginWidth() < adjustedWidth)
SetMarginWidth(adjustedWidth);
}
-
+
m_nHeight = *pheight; // remember height for use in OnDrawItem
return TRUE;
colBack = m_colBack.Ok() ? ToRGB(m_colBack) : GetSysColor(COLOR_WINDOW);
colText = m_colText.Ok() ? ToRGB(m_colText) : GetSysColor(COLOR_WINDOWTEXT);
}
-
+
#ifdef O_DRAW_NATIVE_API
#define hdc (HDC)dc.GetHDC()
COLORREF colOldText = ::SetTextColor(hdc, colText),
// select the font and draw the text
// ---------------------------------
- // determine where to draw and leave space for a check-mark.
+ // determine where to draw and leave space for a check-mark.
int x = rc.x + GetMarginWidth();
- // using native API because it reckognizes '&'
+ // using native API because it reckognizes '&'
#ifdef O_DRAW_NATIVE_API
int nPrevMode = SetBkMode(hdc, TRANSPARENT);
HBRUSH hbr = CreateSolidBrush(colBack),
}
HFONT hPrevFont = (HFONT) ::SelectObject(hdc, hfont);
- DrawState(hdc, NULL, NULL,
- (LPARAM)(const wxChar *)m_strName, m_strName.Length(),
+ DrawState(hdc, NULL, NULL,
+ (LPARAM)(const wxChar *)m_strName, m_strName.Length(),
x, rc.y, rc.GetWidth(), rc.GetHeight(),
DST_PREFIXTEXT | ( st & wxODDisabled ? DSS_DISABLED : 0) );
if ( st & wxODChecked ) {
// using native APIs for performance and simplicity
#ifdef O_DRAW_NATIVE_API
- // what goes on: DrawFrameControl creates a b/w mask,
+ // what goes on: DrawFrameControl creates a b/w mask,
// then we copy it to screen to have right colors
// first create a monochrome bitmap in a memory DC
}
// finally copy it to screen DC and clean up
- BitBlt(hdc, rc.x, rc.y, GetMarginWidth(), m_nHeight,
+ BitBlt(hdc, rc.x, rc.y, GetMarginWidth(), m_nHeight,
hdcMem, 0, 0, SRCCOPY);
DeleteDC(hdcMem);
// heightDiff = -2;
//MT: blit with mask enabled.
- dc.Blit(rc.x + (GetMarginWidth() - nBmpWidth) / 2,
- rc.y + heightDiff / 2,
- nBmpWidth, nBmpHeight,
+ dc.Blit(rc.x + (GetMarginWidth() - nBmpWidth) / 2,
+ rc.y + heightDiff / 2,
+ nBmpWidth, nBmpHeight,
&dcMem, 0, 0, wxCOPY, TRUE);
if ( st & wxODSelected ) {
#ifdef O_DRAW_NATIVE_API
- RECT rectBmp = { rc.GetLeft(), rc.GetTop(),
- rc.GetLeft() + GetMarginWidth(),
+ RECT rectBmp = { rc.GetLeft(), rc.GetTop(),
+ rc.GetLeft() + GetMarginWidth(),
rc.GetTop() + m_nHeight };
SetBkColor(hdc, colBack);
DrawEdge(hdc, &rectBmp, EDGE_RAISED, BF_SOFT | BF_RECT);
// FreeResource(TRUE);
}
-bool wxPalette::FreeResource(bool force)
+bool wxPalette::FreeResource(bool WXUNUSED(force))
{
if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette)
{
#ifdef __WXWINE__
return (FALSE);
-
+
#else
m_refData = new wxPaletteRefData;
M_PALETTEDATA->m_hPalette = (WXHPALETTE) CreatePalette((LPLOGPALETTE)npPal);
LocalFree((HANDLE)npPal);
return TRUE;
-
+
#endif
}
return (WXHANDLE)M_PENDATA->m_hPen;
}
-bool wxPen::FreeResource(bool force)
+bool wxPen::FreeResource(bool WXUNUSED(force))
{
if (M_PENDATA && (M_PENDATA->m_hPen != 0))
{
wxWindowsPrinter::~wxWindowsPrinter()
{
- // avoids mingw warning about statement with no effect (FreeProcInstance
- // doesn't do anything under Win32)
-#ifndef __GNUWIN32__
+ // avoids warning about statement with no effect (FreeProcInstance
+ // doesn't do anything under Win32)
+#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(__NT__) && !defined(__GNUWIN32__)
FreeProcInstance((FARPROC) m_lpAbortProc);
#endif
}
{
dc = dialog.GetPrintDC();
m_printDialogData = dialog.GetPrintDialogData();
- if (dc == NULL)
+ if (dc == NULL)
sm_lastError = wxPRINTER_ERROR;
else
sm_lastError = wxPRINTER_NO_ERROR;
SetWindowText((HWND)m_radioButtons[item], label.c_str());
}
-void wxRadioBox::SetLabel(int item, wxBitmap *bitmap)
+void wxRadioBox::SetLabel(int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap))
{
/*
m_radioWidth[item] = bitmap->GetWidth() + FB_MARGIN;
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
}
-WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
+WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam))
{
#if wxUSE_CTL3D
if ( m_useCtl3D )
IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
// IMPLEMENT_DYNAMIC_CLASS(wxBitmapRadioButton, wxRadioButton)
-bool wxRadioButton::MSWCommand(WXUINT param, WXWORD id)
+bool wxRadioButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
if (param == BN_CLICKED)
{
ProcessCommand (event);
}
-WXHBRUSH wxRadioButton::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
+WXHBRUSH wxRadioButton::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam))
{
#if wxUSE_CTL3D
if ( m_useCtl3D )
return bOk;
}
-size_t wxRegConfig::GetNumberOfEntries(bool bRecursive) const
+size_t wxRegConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const
{
size_t nEntries = 0;
return nEntries;
}
-size_t wxRegConfig::GetNumberOfGroups(bool bRecursive) const
+size_t wxRegConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const
{
size_t nGroups = 0;
// ----------------------------------------------------------------------------
// deleting
// ----------------------------------------------------------------------------
-bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso)
+bool wxRegConfig::DeleteEntry(const wxString& value, bool WXUNUSED(bGroupIfEmptyAlso))
{
wxConfigPathChanger path(this, value);
#if wxUSE_VALIDATORS
SetValidator(validator);
#endif // wxUSE_VALIDATORS
-
+
SetBackgroundColour(parent->GetBackgroundColour()) ;
SetForegroundColour(parent->GetForegroundColour()) ;
m_windowStyle = style;
If the scroll bar has a page size greater than one, the maximum scrolling position
is less than the maximum range value. You can use the following formula to calculate
the maximum scrolling position:
-
-MaxScrollPos = MaxRangeValue - (PageSize - 1)
+
+MaxScrollPos = MaxRangeValue - (PageSize - 1)
*/
#if WXWIN_COMPATIBILITY
}
#endif
-WXHBRUSH wxScrollBar::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
+WXHBRUSH wxScrollBar::OnCtlColor(WXHDC WXUNUSED(pDC), WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), WXLPARAM WXUNUSED(lParam))
{
return 0;
}
(LPARAM) MAKELONG((short)maxVal, (short)minVal));
}
-bool wxSpinButton::MSWOnScroll(int orientation, WXWORD wParam,
+bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
WXWORD pos, WXHWND control)
{
wxCHECK_MSG( control, FALSE, wxT("scrolling what?") )
return GetEventHandler()->ProcessEvent(event);
}
-bool wxSpinButton::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
+bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *result)
{
#ifndef __GNUWIN32__
#if defined(__BORLANDC__) || defined(__WATCOMC__)
#endif
}
-bool wxSpinButton::MSWCommand(WXUINT cmd, WXWORD id)
+bool wxSpinButton::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD WXUNUSED(id))
{
// No command messages
return FALSE;
SetFieldsWidth();
}
-void wxStatusBar95::SetStatusWidths(int n, const int widths[])
+void wxStatusBar95::SetStatusWidths(int WXUNUSED(n), const int widths[])
{
wxASSERT_MSG( n == m_nFields, _T("field number mismatch") );
// message handlers
// ----------------------------------------------------------------------------
-bool wxToolBar::MSWCommand(WXUINT cmd, WXWORD id)
+bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
{
wxToolBarToolBase *tool = FindById((int)id);
if ( !tool )
bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl),
WXLPARAM lParam,
- WXLPARAM *result)
+ WXLPARAM *WXUNUSED(result))
{
// First check if this applies to us
NMHDR *hdr = (NMHDR *)lParam;
(WPARAM)tool->GetId(), (LPARAM)MAKELONG(toggle, 0));
}
-void wxToolBar::DoSetToggle(wxToolBarToolBase *tool, bool toggle)
+void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle))
{
// VZ: AFAIK, the button has to be created either with TBSTYLE_CHECK or
// without, so we really need to delete the button and recreate it here
#endif // wxUSE_TOOLBAR && Win95
+
wxString str;
wxChar *buf = str.GetWriteBuf(len);
- *(WORD *)buf = len;
+ *(WORD *)buf = (WORD)len;
len = (size_t)::SendMessage(GetHwnd(), EM_GETLINE, lineNo, (LPARAM)buf);
buf[len] = 0;
return TRUE;
}
-WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
+WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam))
{
#if wxUSE_CTL3D
if ( m_useCtl3D )
DoTraverse(root, recursively);
}
- virtual bool OnVisit(const wxTreeItemId& item)
+ virtual bool OnVisit(const wxTreeItemId& WXUNUSED(item))
{
m_count++;
// delete user data to prevent memory leaks
DeleteAllItems();
-
+
if (m_ownsImageListNormal) delete m_imageListNormal;
if (m_ownsImageListState) delete m_imageListState;
}
}
// End label editing, optionally cancelling the edit
-void wxTreeCtrl::EndEditLabel(const wxTreeItemId& item, bool discardChanges)
+void wxTreeCtrl::EndEditLabel(const wxTreeItemId& WXUNUSED(item), bool discardChanges)
{
TreeView_EndEditLabelNow(GetHwnd(), discardChanges);
case TVN_GETDISPINFO:
// NB: so far the user can't set the image himself anyhow, so do it
// anyway - but this may change later
- if ( /* !processed && */ 1 )
+// if ( /* !processed && */ 1 )
{
wxTreeItemId item = event.m_item;
TV_DISPINFO *info = (TV_DISPINFO *)lParam;
: wxTreeItemIcon_Selected
);
}
- }
+ }
break;
//default:
return strDir.c_str();
}
-wxChar *wxGetUserHome(const wxString& user)
+wxChar *wxGetUserHome(const wxString& WXUNUSED(user))
{
// VZ: the old code here never worked for user != "" anyhow! Moreover, it
// returned sometimes a malloc()'d pointer, sometimes a pointer to a
// process management
// ----------------------------------------------------------------------------
-int wxKill(long pid, int sig)
+int wxKill(long WXUNUSED(pid), int WXUNUSED(sig))
{
// TODO use SendMessage(WM_QUIT) and TerminateProcess() if needed
WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd)
{
#ifndef __WIN32__
- return GetWindowWord((HWND)hWnd, GWW_ID);
+ return (WXWORD)GetWindowWord((HWND)hWnd, GWW_ID);
#else // Win32
- return GetWindowLong((HWND)hWnd, GWL_ID);
+ return (WXWORD)GetWindowLong((HWND)hWnd, GWL_ID);
#endif // Win16/32
}
#if wxUSE_STREAMS
// the first elements are reading ends, the second are the writing ones
HANDLE hpipeStdin[2],
- hpipeStdinWrite = INVALID_HANDLE_VALUE,
hpipeStdout[2],
hpipeStderr[2];
+ HANDLE hpipeStdinWrite = INVALID_HANDLE_VALUE;
// open the pipes to which child process IO will be redirected if needed
if ( handler && handler->IsRedirected() )
// Find an item given the MS Windows id
wxWindow *wxWindow::FindItem(long id) const
{
- wxControl *item = wxDynamicCast(this, wxControl);
+ wxControl *item = wxDynamicThisCast(this, wxControl);
if ( item )
{
// i it we or one of our "internal" children?
SetBackgroundColour(GetParent()->GetBackgroundColour());
}
-void wxWindow::OnIdle(wxIdleEvent& event)
+void wxWindow::OnIdle(wxIdleEvent& WXUNUSED(event))
{
// Check if we need to send a LEAVE event
if ( m_mouseInWindow )
state |= MK_MBUTTON;
if ( GetKeyState( VK_RBUTTON ) )
state |= MK_RBUTTON;
-
+
wxMouseEvent event(wxEVT_LEAVE_WINDOW);
InitMouseEvent(event, pt.x, pt.y, state);
}
// Set this window to be the child of 'parent'.
-bool wxWindow::Reparent(wxWindow *parent)
+bool wxWindow::Reparent(wxWindowBase *parent)
{
if ( !wxWindowBase::Reparent(parent) )
return FALSE;
}
else
{
- wxPanel *panel = wxDynamicCast(this, wxPanel);
+ wxPanel *panel = wxDynamicThisCast(this, wxPanel);
wxButton *btn = NULL;
if ( panel )
{
// Dialog window proc
LONG APIENTRY _EXPORT
-wxDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+wxDlgProc(HWND WXUNUSED(hWnd), UINT message, WPARAM WXUNUSED(wParam), LPARAM WXUNUSED(lParam))
{
if ( message == WM_INITDIALOG )
{
bool wxWindow::MSWCreate(int id,
wxWindow *parent,
const wxChar *wclass,
- wxWindow *wx_win,
+ wxWindow *WXUNUSED(wx_win),
const wxChar *title,
int x,
int y,
// window creation/destruction
// ---------------------------------------------------------------------------
-bool wxWindow::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
+bool wxWindow::HandleCreate(WXLPCREATESTRUCT WXUNUSED(cs), bool *mayCreate)
{
// TODO: should generate this event from WM_NCCREATE
wxWindowCreateEvent event(this);
// miscellaneous
// ---------------------------------------------------------------------------
-bool wxWindow::HandleShow(bool show, int status)
+bool wxWindow::HandleShow(bool show, int WXUNUSED(status))
{
wxShowEvent event(GetId(), show);
event.m_eventObject = this;
return rc;
}
-bool wxWindow::HandleSetCursor(WXHWND hWnd,
+bool wxWindow::HandleSetCursor(WXHWND WXUNUSED(hWnd),
short nHitTest,
int WXUNUSED(mouseMsg))
{
}
// Define for each class of dialog and control
-WXHBRUSH wxWindow::OnCtlColor(WXHDC hDC,
- WXHWND hWnd,
- WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam)
+WXHBRUSH wxWindow::OnCtlColor(WXHDC WXUNUSED(hDC),
+ WXHWND WXUNUSED(hWnd),
+ WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam))
{
return (WXHBRUSH)0;
}
return FALSE;
}
-bool wxWindow::HandleSysCommand(WXWPARAM wParam, WXLPARAM lParam)
+bool wxWindow::HandleSysCommand(WXWPARAM wParam, WXLPARAM WXUNUSED(lParam))
{
// 4 bits are reserved
switch ( wParam & 0xFFFFFFF0 )
// isASCII is TRUE only when we're called from WM_CHAR handler and not from
// WM_KEYDOWN one
-bool wxWindow::HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII)
+bool wxWindow::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII)
{
bool ctrlDown = FALSE;
return FALSE;
}
-bool wxWindow::HandleKeyDown(WXWORD wParam, WXLPARAM lParam)
+bool wxWindow::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam)
{
int id = wxCharCodeMSWToWX(wParam);
return FALSE;
}
-bool wxWindow::HandleKeyUp(WXWORD wParam, WXLPARAM lParam)
+bool wxWindow::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
{
int id = wxCharCodeMSWToWX(wParam);
else
{
UnhookWindowsHookEx(wxTheKeyboardHook);
- // avoids mingw warning about statement with no effect (FreeProcInstance
- // doesn't do anything under Win32)
-#ifndef __GNUC__
+ // avoids warning about statement with no effect (FreeProcInstance
+ // doesn't do anything under Win32)
+#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(__NT__) && !defined(__GNUWIN32__)
FreeProcInstance(wxTheKeyboardHookProc);
#endif
}
// Find the wxWindow at the current mouse position, returning the mouse
// position.
-wxWindow* wxFindWindowAtPointer(wxPoint& pt)
+wxWindow* wxFindWindowAtPointer(wxPoint& WXUNUSED(pt))
{
return wxFindWindowAtPoint(wxGetMousePosition());
}
bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap,
const wxString& name,
- long flags,
- int desiredWidth, int desiredHeight)
+ long WXUNUSED(flags),
+ int WXUNUSED(desiredWidth),
+ int WXUNUSED(desiredHeight))
{
#if wxUSE_XPM_IN_MSW
XImage *ximage = NULL;
bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap,
const wxString& name,
- int type,
- const wxPalette *palette)
+ int WXUNUSED(type),
+ const wxPalette *WXUNUSED(palette))
{
#if wxUSE_XPM_IN_MSW
XImage ximage;
bool wxXPMDataHandler::Create(wxBitmap *bitmap,
void *data,
- long flags,
- int width,
- int height,
- int depth)
+ long WXUNUSED(flags),
+ int WXUNUSED(width),
+ int WXUNUSED(height),
+ int WXUNUSED(depth))
{
#if wxUSE_XPM_IN_MSW
XImage *ximage = NULL;
long closeness;
} CloseColor;
-#ifdef __OS2__
-/* Visual Age cannot deal with old, non-ansi, code */
+#ifndef FOR_MSW
static int closeness_cmp(Const void* a, Const void* b)
-#else
-static int
-closeness_cmp(a, b)
- Const void *a, *b;
-#endif
{
CloseColor *x = (CloseColor *) a, *y = (CloseColor *) b;
/* cast to int as qsort requires */
return (int) (x->closeness - y->closeness);
}
+#endif
/* default AllocColor function:
\*****************************************************************************/
#ifndef CXPMPROG
-/* Official version number */
-static char *RCS_Version = "$XpmVersion: 3.4k $";
-
-/* Internal version number */
-static char *RCS_Id = "$Id$";
-
#include "XpmI.h"
#endif
#include <ctype.h>