uVirt |= AF_VIRTUALKEY;
}
- bool bIsVirtual;
- USHORT uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode()
- ,&bIsVirtual
- );
+ bool bIsVirtual;
+ USHORT uKey = (USHORT)wxCharCodeWXToOS2( vaEntries[i].GetKeyCode(),
+ &bIsVirtual);
if (bIsVirtual)
uVirt = AF_CHAR | AF_VIRTUALKEY;
- USHORT uCmd = vaEntries[i].GetCommand();
+ USHORT uCmd = (USHORT)vaEntries[i].GetCommand();
pArr->aaccel[i].fs = uVirt;
pArr->aaccel[i].key = uKey;
pArr->aaccel[i].cmd = uCmd;
}
- pArr->codepage = ::WinQueryCp(wxTheApp->m_hMq);
+ pArr->codepage = (USHORT)::WinQueryCp(wxTheApp->m_hMq);
pArr->cAccel = (USHORT)n;
M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain
,pArr
//
// If we have accelerators the top window is the frame
//
- wxFrame* pFrame = (wxFrame*)wxTheApp->GetTopWindow();
+ wxFrame* pFrame = (wxFrame*)wxTheApp->GetTopWindow();
::WinSetAccelTable( vHabmain
,M_ACCELDATA->m_hAccel
// function for translating labels
// ---------------------------------------------------------------------------
-wxString wxPMTextToLabel(
- const wxString& rsTitle
-)
+wxString wxPMTextToLabel( const wxString& rsTitle )
{
- wxString sTitle;
- const wxChar* zPc;
+ wxString sTitle;
+ const wxChar* zPc;
- if (rsTitle.IsEmpty())
+ if (rsTitle.empty())
return(sTitle);
for (zPc = rsTitle.c_str(); *zPc != wxT('\0'); zPc++)
}
return(sTitle);
} // end of wxPMTextToLabel
-
#endif //
-#ifndef __EMX__
+#if defined(__WATCOMC__)
+
+#include <tcpustd.h>
+
+#elif !defined(__EMX__)
#define select(a,b,c,d,e) bsdselect(a,b,c,d,e)
extern "C" int _System bsdselect(int,
if (gbInOnIdle)
return;
- gbInOnIdle = TRUE;
-
+ gbInOnIdle = true;
+
wxAppBase::OnIdle(rEvent);
#if wxUSE_DC_CACHEING
return vHabmain;
}
-void wxSetInstance(
- HAB vHab
-)
+void wxSetInstance( HAB vHab )
{
vHabmain = vHab;
}
-
{
for (nCols = 0; nCols < nBytesPerLine; nCols++)
{
- unsigned char ucVal = *pzSrc++;
- unsigned char ucReversed = 0;
- int nBits;
+ unsigned char ucVal = *pzSrc++;
+ unsigned char ucReversed = 0;
+ int nBits;
for (nBits = 0; nBits < 8; nBits++)
{
ucReversed <<= 1;
- ucReversed |= (ucVal & 0x01);
+ ucReversed = (unsigned char)(ucReversed | (ucVal & 0x01));
ucVal >>= 1;
}
*pzDst++ = ucReversed;
vHeader.cx = (USHORT)nWidth;
vHeader.cy = (USHORT)nHeight;
vHeader.cPlanes = 1L;
- vHeader.cBitCount = nDepth;
+ vHeader.cBitCount = (USHORT)nDepth;
vHeader.usReserved = 0;
memset(&vInfo, '\0', 16);
vInfo.cx = (USHORT)nWidth;
vInfo.cy = (USHORT)nHeight;
vInfo.cPlanes = 1L;
- vInfo.cBitCount = nDepth;
+ vInfo.cBitCount = (USHORT)nDepth;
HBITMAP hBmp = ::GpiCreateBitmap(hPs, &vHeader, CBM_INIT, (PBYTE)pzData, &vInfo);
vHeader.cx = nW;
vHeader.cy = nH;
vHeader.cPlanes = 1;
- vHeader.cBitCount = lBitCount;
+ vHeader.cBitCount = (USHORT)lBitCount;
hBmp = ::GpiCreateBitmap( hPSScreen
,&vHeader
GetBitmapData()->m_pBitmapMask = pMask;
} // end of wxBitmap::SetMask
-wxBitmap wxBitmap::GetBitmapForDC(
- wxDC& rDc
-) const
+wxBitmap wxBitmap::GetBitmapForDC(wxDC& WXUNUSED(rDc)) const
{
return(*this);
} // end of wxBitmap::GetBitmapForDC
// wxBitmapHandler
// ----------------------------------------------------------------------------
-bool wxBitmapHandler::Create(
- wxGDIImage* pImage
-, void* pData
-, long lFlags
-, int nWidth
-, int nHeight
-, int nDepth
-)
+bool wxBitmapHandler::Create( wxGDIImage* pImage,
+ void* pData,
+ long WXUNUSED(lFlags),
+ int nWidth,
+ int nHeight,
+ int nDepth)
{
- wxBitmap* pBitmap = wxDynamicCast( pImage
- ,wxBitmap
- );
+ wxBitmap* pBitmap = wxDynamicCast( pImage
+ ,wxBitmap
+ );
return(pBitmap ? Create( pBitmap
,pData
return hBmpInvMask;
} // end of WxWinGdi_InvertMask
-
#define BUTTON_HEIGHT_FACTOR (EDIT_CONTROL_FACTOR * 1.1)
-bool wxBitmapButton::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxBitmap& rBitmap
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxValidator& rValidator
-, const wxString& rsName
-)
+bool wxBitmapButton::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxBitmap& rBitmap,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxValidator& rValidator,
+ const wxString& rsName )
{
m_bmpNormal = rBitmap;
SetName(rsName);
,nWidth
,nHeight
);
- return TRUE;
+ return true;
} // end of wxBitmapButton::Create
-bool wxBitmapButton::OS2OnDraw(
- WXDRAWITEMSTRUCT* pItem
-)
+bool wxBitmapButton::OS2OnDraw( WXDRAWITEMSTRUCT* pItem)
{
PUSERBUTTON pUser = (PUSERBUTTON)pItem;
bool bAutoDraw = (GetWindowStyleFlag() & wxBU_AUTODRAW) != 0;
//
// Draw the bitmap
//
- vDc.DrawBitmap( *pBitmap
- ,nX1
- ,nY1
- ,TRUE
- );
+ vDc.DrawBitmap( *pBitmap, nX1, nY1, true );
//
// Draw focus / disabled state, if auto-drawing
{
DrawButtonFocus(vDc);
}
- return TRUE;
+ return true;
} // end of wxBitmapButton::OS2OnDraw
-void wxBitmapButton::DrawFace (
- wxClientDC& rDC
-, bool bSel
-)
+void wxBitmapButton::DrawFace (wxClientDC& rDC, bool bSel)
{
//
// Set up drawing colors
//
- wxPen vHiLitePen(wxColour(255, 255, 255), 2, wxSOLID); // White
- wxPen vDarkShadowPen(wxColour(85, 85, 85), 2, wxSOLID);
- wxColour vFaceColor(wxColour(204, 204, 204)); // Light Grey
+ wxPen vHiLitePen(*wxWHITE, 2, wxSOLID); // White
+ wxColour gray85(85, 85, 85);
+ wxPen vDarkShadowPen(gray85, 2, wxSOLID);
+ wxColour vFaceColor(204, 204, 204); // Light Grey
//
// Draw the main button face
wxClientDC& rDC
)
{
- wxPen vBlackPen(wxColour(0, 0, 0), 2, wxSOLID);
+ wxPen vBlackPen(*wxBLACK, 2, wxSOLID);
//
// Draw a thick black line around the outside of the button
);
} // end of wxBitmapButton::DrawButtonFocus
-void wxBitmapButton::DrawButtonDisable(
- wxClientDC& rDC
-, wxBitmap& rBmp
-)
+void wxBitmapButton::DrawButtonDisable( wxClientDC& rDC,
+ wxBitmap& rBmp )
{
- wxPen vGreyPen(wxColour(128, 128, 128), 2, wxSOLID);
+ wxPen vGreyPen(wxT("GREY"), 2, wxSOLID);
//
// Draw a thick black line around the outside of the button
}
#endif // ndef for wxUSE_BMPBUTTON
-
bool wxBrush::RealizeResource()
{
- BOOL bOk;
- ERRORID vError;
- wxString sError;
+ bool bOk;
+ ERRORID vError;
+ wxString sError;
if (M_BRUSHDATA && M_BRUSHDATA->m_hBrush == 0L)
{
if (M_BRUSHDATA->m_nStyle==wxTRANSPARENT)
{
- return TRUE;
+ return true;
}
COLORREF vPmColour = 0L;
M_BRUSHDATA->m_vBundle.usMixMode = FM_OVERPAINT;
M_BRUSHDATA->m_vBundle.usBackMixMode = BM_OVERPAINT;
- bOk = ::GpiSetAttrs( M_BRUSHDATA->m_hBrush
- ,PRIM_AREA
- ,ABB_COLOR | ABB_BACK_COLOR | ABB_MIX_MODE | ABB_BACK_MIX_MODE |
- ABB_SET | ABB_SYMBOL
- ,ABB_REF_POINT
- ,&M_BRUSHDATA->m_vBundle
- );
+ bOk = (bool)::GpiSetAttrs( M_BRUSHDATA->m_hBrush
+ ,PRIM_AREA
+ ,ABB_COLOR | ABB_BACK_COLOR | ABB_MIX_MODE | ABB_BACK_MIX_MODE |
+ ABB_SET | ABB_SYMBOL
+ ,ABB_REF_POINT
+ ,&M_BRUSHDATA->m_vBundle
+ );
if (!bOk)
{
vError = ::WinGetLastError(vHabmain);
return (WXHANDLE)M_BRUSHDATA->m_hBrush;
} // end of wxBrush::GetResourceHandle
-bool wxBrush::FreeResource(
- bool WXUNUSED(bForce)
-)
+bool wxBrush::FreeResource( bool WXUNUSED(bForce) )
{
if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0))
{
M_BRUSHDATA->m_hBrush = 0;
- return TRUE;
+ return true;
}
else return FALSE;
} // end of wxBrush::FreeResource
M_BRUSHDATA->m_hBrush = hPS;
RealizeResource();
} // end of WxWinGdi_CPen::SetPS
-
// Button
-bool wxButton::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxString& rsLbl
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxValidator& rValidator
-, const wxString& rsName
-)
+bool wxButton::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxString& rsLbl,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxValidator& rValidator,
+ const wxString& rsName)
{
wxString rsLabel(rsLbl);
if (rsLabel.empty() && wxIsStockID(vId))
,rSize.y
);
delete pButtonFont;
- return TRUE;
+ return true;
} // end of wxButton::Create
wxButton::~wxButton()
//
wxWindow* pWinOldDefault = pParent->SetDefaultItem(this);
- SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton)
- ,FALSE
- );
- SetDefaultStyle( this
- ,TRUE
- );
+ SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), false);
+ SetDefaultStyle( this, true );
} // end of wxButton::SetDefault
void wxButton::SetTmpDefault()
wxWindow* pWinOldDefault = pParent->GetDefaultItem();
pParent->SetTmpDefaultItem(this);
- SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton)
- ,FALSE
- );
- SetDefaultStyle( this
- ,TRUE
- );
+ SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), false);
+ SetDefaultStyle( this, true );
} // end of wxButton::SetTmpDefault
void wxButton::UnsetTmpDefault()
wxWindow* pWinOldDefault = pParent->GetDefaultItem();
- SetDefaultStyle( this
- ,FALSE
- );
- SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton)
- ,TRUE
- );
+ SetDefaultStyle( this, false );
+ SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), true );
} // end of wxButton::UnsetTmpDefault
void wxButton::SetDefaultStyle(
// event/message handlers
// ----------------------------------------------------------------------------
-bool wxButton::OS2Command(
- WXUINT uParam
-, WXWORD wId
-)
+bool wxButton::OS2Command(WXUINT uParam, WXWORD WXUNUSED(wId))
{
- bool bProcessed = FALSE;
+ bool bProcessed = false;
switch (uParam)
{
bProcessed = SendClickEvent();
break;
}
+
return bProcessed;
} // end of wxButton::OS2Command
-WXHBRUSH wxButton::OnCtlColor(
- WXHDC pDC
-, WXHWND pWnd
-, WXUINT nCtlColor
-, WXUINT uMessage
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+WXHBRUSH wxButton::OnCtlColor( WXHDC WXUNUSED(pDC),
+ WXHWND WXUNUSED(pWnd),
+ WXUINT WXUNUSED(nCtlColor),
+ WXUINT WXUNUSED(uMessage),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam) )
{
- wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()
- ,wxSOLID
- );
+ wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()
+ ,wxSOLID
+ );
return (WXHBRUSH)pBackgroundBrush->GetResourceHandle();
} // end of wxButton::OnCtlColor
return dwStyle;
} // end of wxButton::OS2GetStyle
-MRESULT wxButton::WindowProc(
- WXUINT uMsg
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+MRESULT wxButton::WindowProc( WXUINT uMsg,
+ WXWPARAM wParam,
+ WXLPARAM lParam )
{
//
// When we receive focus, we want to temporary become the default button in
,lParam
));
} // end of wxWindowProc
-
// wxCheckBox
// ----------------------------------------------------------------------------
-bool wxCheckBox::OS2Command(
- WXUINT WXUNUSED(uParam)
-, WXWORD WXUNUSED(wId)
-)
+bool wxCheckBox::OS2Command( WXUINT WXUNUSED(uParam),
+ WXWORD WXUNUSED(wId) )
{
- wxCommandEvent rEvent( wxEVT_COMMAND_CHECKBOX_CLICKED
- ,m_windowId
- );
+ wxCommandEvent rEvent( wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId );
rEvent.SetInt(GetValue());
rEvent.SetEventObject(this);
ProcessCommand(rEvent);
- return TRUE;
+ return true;
} // end of wxCheckBox::OS2Command
bool wxCheckBox::Create(
nCheckSize = vDc.GetCharHeight();
}
- int nWidthCheckbox;
- int nHeightCheckbox;
- wxString sStr = wxGetWindowText(GetHWND());
+ int nWidthCheckbox;
+ int nHeightCheckbox;
+ wxString sStr = wxGetWindowText(GetHWND());
- if (!sStr.IsEmpty())
+ if (!sStr.empty())
{
GetTextExtent( sStr
,&nWidthCheckbox
// wxBitmapCheckBox
// ----------------------------------------------------------------------------
-bool wxBitmapCheckBox::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxBitmap* pLabel
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxValidator& rValidator
-, const wxString& rsName
-)
+bool wxBitmapCheckBox::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxBitmap* WXUNUSED(pLabel),
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxValidator& rValidator,
+ const wxString& rsName)
{
SetName(rsName);
#if wxUSE_VALIDATORS
);
::WinShowWindow(hButton, TRUE);
- return TRUE;
+ return true;
} // end of wxBitmapCheckBox::Create
-void wxBitmapCheckBox::SetLabel(
- const wxBitmap& rBitmap
-)
+void wxBitmapCheckBox::SetLabel( const wxBitmap& WXUNUSED(rBitmap) )
{
wxFAIL_MSG(wxT("not implemented"));
} // end of wxBitmapCheckBox::SetLabel
-
// wxOS2 specific helpers
// ----------------------------------------------------------------------------
-void wxChoice::DoSetSize(
- int nX
-, int nY
-, int nWidth
-, int nHeight
-, int nSizeFlags
-)
+void wxChoice::DoSetSize(int nX,
+ int nY,
+ int nWidth,
+ int WXUNUSED(nHeight),
+ int nSizeFlags)
{
//
// Ignore height parameter because height doesn't mean 'initially
wxControl::DoSetSize( nX
,nY
,nWidth
- ,-1
+ ,wxDefaultCoord
,nSizeFlags
);
} // end of wxChoice::DoSetSize
bool wxOpenClipboard()
{
- wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, wxT("clipboard already opened.") );
+ wxCHECK_MSG( !gs_wxClipboardIsOpen, true, wxT("clipboard already opened.") );
// TODO:
/*
wxWindow *win = wxTheApp->GetTopWindow();
return FALSE;
}
*/
- return TRUE;
+ return true;
}
bool wxEmptyClipboard()
return FALSE;
}
*/
- return TRUE;
+ return true;
}
bool wxIsClipboardOpened()
return gs_wxClipboardIsOpen;
}
-bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
+bool wxIsClipboardFormatAvailable(wxDataFormat WXUNUSED(dataFormat))
{
// TODO: return ::IsClipboardFormatAvailable(dataFormat) != 0;
- return FALSE;
+ return false;
}
#if 0
return FALSE;
}
*/
- return TRUE;
+ return true;
}
#endif // wxUSE_DRAG_AND_DROP
#endif
return FALSE;
}
*/
- return TRUE;
+ return true;
}
void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
wxBM->SetWidth(bm.bmWidth);
wxBM->SetHeight(bm.bmHeight);
wxBM->SetDepth(bm.bmPlanes);
- wxBM->SetOk(TRUE);
+ wxBM->SetOk(true);
retval = wxBM;
break;
}
if ( data )
return AddData(data);
else
- return TRUE;
+ return true;
*/
- return TRUE;
+ return true;
}
bool wxClipboard::AddData( wxDataObject *data )
{
textDataObject.SetText(s);
delete[] s;
- return TRUE;
+ return true;
}
else
return FALSE;
{
bitmapDataObject.SetBitmap(* bitmap);
delete bitmap;
- return TRUE;
+ return true;
}
else
return FALSE;
{
metaFileDataObject.SetMetafile(*metaFile);
delete metaFile;
- return TRUE;
+ return true;
}
else
return FALSE;
((wxPrivateDataObject &)data).SetData(buf, len);
free(buf);
- return TRUE;
+ return true;
}
}
#endif
}
-#else
- #error "Please turn wxUSE_CLIPBOARD on to compile this file."
#endif // wxUSE_CLIPBOARD
-
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#include "wx/combobox.h"
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
- #include "wx/setup.h"
+ #include "wx/defs.h"
#include "wx/settings.h"
#endif
return lLineLength;
} // end of wxComboBox::GetLastPosition
-void wxComboBox::Replace(
- long lFrom
-, long lTo
-, const wxString& rsValue
-)
+void wxComboBox::Replace( long lFrom,
+ long lTo,
+ const wxString& rsValue )
{
#if wxUSE_CLIPBOARD
HWND hWnd = GetHwnd();
// Paste into edit control
//
::WinSendMsg(hWnd, EM_PASTE, (MPARAM)0, (MPARAM)0L);
+#else
+ wxUnusedVar(lFrom);
+ wxUnusedVar(lTo);
+ wxUnusedVar(rsValue);
#endif
} // end of wxComboBox::Replace
-void wxComboBox::Remove(
- long lFrom
-, long lTo
-)
+void wxComboBox::Remove( long lFrom, long lTo)
{
#if wxUSE_CLIPBOARD
HWND hWnd = GetHwnd();
::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), 0);
::WinSendMsg(hWnd, EM_CUT, (MPARAM)0, (MPARAM)0);
+#else
+ wxUnusedVar(lFrom);
+ wxUnusedVar(lTo);
#endif
} // end of wxComboBox::Remove
return(HandleSetFocus((WXHWND)(HWND)wParam));
else
return(HandleKillFocus((WXHWND)(HWND)wParam));
- break;
}
return false;
} // end of WinGuiBase_CComboBox::ProcessEditMsg
#endif
// wxUSE_COMBOBOX
-
wxControl::~wxControl()
{
- m_isBeingDeleted = TRUE;
+ m_isBeingDeleted = true;
}
bool wxControl::OS2CreateControl(
);
} // end of wxControl::OS2CreateControl
-bool wxControl::OS2CreateControl(
- const wxChar* zClassname
-, WXDWORD dwStyle
-, const wxPoint& rPos
-, const wxSize& rSize
-, const wxString& rsLabel
-, WXDWORD dwExstyle
-)
+bool wxControl::OS2CreateControl( const wxChar* zClassname,
+ WXDWORD dwStyle,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ const wxString& rsLabel,
+ WXDWORD dwExstyle )
{
//
// Doesn't do anything at all under OS/2
if (dwExstyle == (WXDWORD)-1)
{
dwExstyle = 0;
- (void) OS2GetStyle(GetWindowStyle(), &dwExstyle);
+ (void) OS2GetStyle(GetWindowStyle(), &dwExstyle);
}
//
// All controls should have these styles (wxWidgets creates all controls
,rSize.x
,rSize.y
);
- return TRUE;
+ return true;
} // end of wxControl::OS2CreateControl
wxSize wxControl::DoGetBestSize() const
return GetEventHandler()->ProcessEvent(event);
}
-WXHBRUSH wxControl::OnCtlColor(
- WXHDC hWxDC
-, WXHWND hWnd
-, WXUINT uCtlColor
-, WXUINT uMessage
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+WXHBRUSH wxControl::OnCtlColor(WXHDC hWxDC,
+ WXHWND WXUNUSED(hWnd),
+ WXUINT WXUNUSED(uCtlColor),
+ WXUINT WXUNUSED(uMessage),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam))
{
- HPS hPS = (HPS)hWxDC; // pass in a PS handle in OS/2
- wxColour vColFore = GetForegroundColour();
- wxColour vColBack = GetBackgroundColour();
+ HPS hPS = (HPS)hWxDC; // pass in a PS handle in OS/2
+ wxColour vColFore = GetForegroundColour();
+ wxColour vColBack = GetBackgroundColour();
if (GetParent()->GetTransparentBackground())
::GpiSetBackMix(hPS, BM_LEAVEALONE);
::GpiSetBackColor(hPS, vColBack.GetPixel());
::GpiSetColor(hPS, vColFore.GetPixel());
- wxBrush* pBrush = wxTheBrushList->FindOrCreateBrush( vColBack
- ,wxSOLID
- );
+ wxBrush* pBrush = wxTheBrushList->FindOrCreateBrush( vColBack
+ ,wxSOLID
+ );
return (WXHBRUSH)pBrush->GetResourceHandle();
} // end of wxControl::OnCtlColor
if (nBottom < pRect->yBottom)
pRect->yBottom = nBottom;
} // end of wxFindMaxSize
-
-
} // end of wxCursor::wxCursor
-wxCursor::wxCursor(
- const wxString& rsCursorFile
-, long lFlags
-, int nHotSpotX
-, int nHotSpotY
-)
+wxCursor::wxCursor( const wxString& WXUNUSED(rsCursorFile),
+ long lFlags,
+ int WXUNUSED(nHotSpotX),
+ int WXUNUSED(nHotSpotY) )
{
- wxCursorRefData* pRefData = new wxCursorRefData;
+ wxCursorRefData* pRefData = new wxCursorRefData;
pRefData = new wxCursorRefData;
m_refData = pRefData;
(*g_globalCursor) = cursor;
}
}
-
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
-#include "wx/intl.h"
+ #include "wx/defs.h"
+ #include "wx/intl.h"
+ #include "wx/log.h"
#endif
-#include "wx/defs.h"
-#include "wx/log.h"
+#if wxUSE_DATAOBJ
+
#include "wx/dataobj.h"
#include "wx/mstream.h"
#include "wx/image.h"
DRAGITEM m_vDragItem;
}; // end of CLASS CIDataObject
-bool CIDataObject::GetData (
- const wxDataFormat& rFormat
-, char* pzBuffer
-, ULONG ulLen
-)
+bool CIDataObject::GetData ( const wxDataFormat& rFormat,
+ char* pzBuffer,
+ ULONG ulLen )
{
QueryGetData(rFormat);
if (rFormat.GetType() == wxDF_INVALID)
,pzBuffer
,ulSize
);
- return TRUE;
+ return true;
} // end of CIDataObject::GetData
void CIDataObject::GetDataHere(
// wxFileDataObject
// ----------------------------------------------------------------------------
-bool wxFileDataObject::GetDataHere(
- void* pBuf
-) const
+bool wxFileDataObject::GetDataHere( void* pBuf ) const
{
wxString sFilenames;
}
memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1);
- return TRUE;
+ return true;
}
size_t wxFileDataObject::GetDataSize() const
return nRes + 1;
}
-bool wxFileDataObject::SetData(
- size_t WXUNUSED(nSize)
-, const void* pBuf
-)
+bool wxFileDataObject::SetData( size_t WXUNUSED(nSize),
+ const void* pBuf )
{
/* TODO */
- wxString sFile((const wxChar *)pBuf); /* char, not wxChar */
+ wxString sFile((const wxChar *)pBuf); /* char, not wxChar */
AddFile(sFile);
- return TRUE;
+ return true;
}
void wxFileDataObject::AddFile(
Clear();
}
-void wxBitmapDataObject::SetBitmap(
- const wxBitmap& rBitmap
-)
+void wxBitmapDataObject::SetBitmap( const wxBitmap& rBitmap )
{
ClearAll();
wxBitmapDataObjectBase::SetBitmap(rBitmap);
DoConvertToPng();
}
-bool wxBitmapDataObject::GetDataHere(
- void* pBuf
-) const
+bool wxBitmapDataObject::GetDataHere( void* pBuf ) const
{
if (!m_pngSize)
{
return FALSE;
}
memcpy(pBuf, m_pngData, m_pngSize);
- return TRUE;
+ return true;
}
bool wxBitmapDataObject::SetData(
#endif
}
+#endif // wxUSE_DATAOBJ
vBmpHdr.cx = nWidth;
vBmpHdr.cy = nHeight;
vBmpHdr.cPlanes = 1;
- vBmpHdr.cBitCount = nDepth;
+ vBmpHdr.cBitCount = (USHORT)nDepth;
pEntry->m_hBitmap = (WXHBITMAP) ::GpiCreateBitmap( hPS
,&vBmpHdr
vBmpHdr.cx = nWidth;
vBmpHdr.cy = nHeight;
vBmpHdr.cPlanes = 1;
- vBmpHdr.cBitCount = nDepth;
+ vBmpHdr.cBitCount = (USHORT)nDepth;
WXHBITMAP hBitmap = (WXHBITMAP) ::GpiCreateBitmap( hPS
,&vBmpHdr
vPtlArc[0].y = vYm;
vPtlArc[1].x = vX2;
vPtlArc[1].y = vY2;
+#ifndef __WATCOMC__
+ // FIXME: incomplete headers ???
::GpiPointArc(m_hPS, vPtlArc); // Draws the arc
+#endif
CalcBoundingBox( (wxCoord)(vXc - dRadius)
,(wxCoord)(vYc - dRadius)
);
, bool bUseMask
)
{
+#if wxUSE_PRINTING_ARCHITECTURE
if (!IsKindOf(CLASSINFO(wxPrinterDC)))
+#endif
{
HBITMAP hBitmap = (HBITMAP)rBmp.GetHBITMAP();
HBITMAP hBitmapOld = NULLHANDLE;
// set GDI objects
// ---------------------------------------------------------------------------
-void wxDC::DoSelectPalette(
- bool bRealize
-)
+void wxDC::DoSelectPalette( bool WXUNUSED(bRealize) )
{
//
// Set the old object temporarily, in case the assignment deletes an object
::GpiSetMix((HPS)hDC, lCRop);
} // end of wxDC::SetRop
-bool wxDC::StartDoc(
- const wxString& rsMessage
-)
+bool wxDC::StartDoc( const wxString& WXUNUSED(rsMessage) )
{
// We might be previewing, so return true to let it continue.
return true;
// bit blit
// ---------------------------------------------------------------------------
-bool wxDC::DoBlit(
- wxCoord vXdest
-, wxCoord vYdest
-, wxCoord vWidth
-, wxCoord vHeight
-, wxDC* pSource
-, wxCoord vXsrc
-, wxCoord vYsrc
-, int nRop
-, bool bUseMask
-, wxCoord vXsrcMask
-, wxCoord vYsrcMask
-)
+bool wxDC::DoBlit( wxCoord vXdest,
+ wxCoord vYdest,
+ wxCoord vWidth,
+ wxCoord vHeight,
+ wxDC* pSource,
+ wxCoord vXsrc,
+ wxCoord vYsrc,
+ int nRop,
+ bool bUseMask,
+ wxCoord WXUNUSED(vXsrcMask),
+ wxCoord WXUNUSED(vYsrcMask) )
{
wxMask* pMask = NULL;
CHARBUNDLE vCbnd;
vBmpHdr.cBitCount = 24;
#if wxUSE_DC_CACHEING
- if (true)
{
//
// create a temp buffer bitmap and DCs to access it and the mask
hPSMask = pDCCacheEntry1->m_hPS;
hDCBuffer = (HDC)pDCCacheEntry2->m_hPS;
hBufBitmap = (HBITMAP)pBitmapCacheEntry->m_hBitmap;
+ wxUnusedVar(hDCMask);
}
- else
-#endif
+#else
{
hDCMask = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDOP, NULLHANDLE);
hDCBuffer = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDOP, NULLHANDLE);
hPSBuffer = ::GpiCreatePS(vHabmain, hDCBuffer, &vSize, PU_PELS | GPIT_MICRO | GPIA_ASSOC);
hBufBitmap = ::GpiCreateBitmap(GetHPS(), &vBmpHdr, 0L, NULL, NULL);
}
+#endif
POINTL aPoint1[4] = { {0, 0}
,{vWidth, vHeight}
}
}; // end of wxDC::DoGetSize(
-void wxDC::DoGetSizeMM(
- int* pnWidth
-, int* pnHeight
-) const
+void wxDC::DoGetSizeMM( int* pnWidth,
+ int* pnHeight ) const
{
LONG lArray[CAPS_VERTICAL_RESOLUTION];
,lArray
))
{
- int nWidth;
- int nHeight;
- int nHorzRes;
- int nVertRes;
+ if(pnWidth)
+ {
+ int nWidth = lArray[CAPS_WIDTH];
+ int nHorzRes = lArray[CAPS_HORIZONTAL_RESOLUTION]; // returns pel/meter
+ *pnWidth = (nHorzRes/1000) * nWidth;
+ }
- nWidth = lArray[CAPS_WIDTH];
- nHeight = lArray[CAPS_HEIGHT];
- nHorzRes = lArray[CAPS_HORIZONTAL_RESOLUTION]; // returns pel/meter
- nVertRes = lArray[CAPS_VERTICAL_RESOLUTION]; // returns pel/meter
- nWidth = (nHorzRes/1000) * nWidth;
- nHeight = (nVertRes/1000) * nHeight;
+ if(pnHeight)
+ {
+ int nHeight = lArray[CAPS_HEIGHT];
+ int nVertRes = lArray[CAPS_VERTICAL_RESOLUTION]; // returns pel/meter
+ *pnHeight = (nVertRes/1000) * nHeight;
+ }
}
}; // end of wxDC::DoGetSizeMM
nWidth = (int)((nHorzRes/39.3) * nPelWidth);
nHeight = (int)((nVertRes/39.3) * nPelHeight);
}
- return (wxSize(nWidth,nHeight));
+ wxSize ppisize(nWidth, nHeight);
+ return ppisize;
} // end of wxDC::GetPPI
void wxDC::SetLogicalScale(
m_logicalScaleX = dX;
m_logicalScaleY = dY;
}; // end of wxDC::SetLogicalScale
-
-
-
memset(&m_vRclPaint, 0, sizeof(m_vRclPaint));
} // end of wxMemoryDC::Init
-bool wxMemoryDC::CreateCompatible(
- wxDC* pDC
-)
+bool wxMemoryDC::CreateCompatible( wxDC* WXUNUSED(pDC) )
{
- HDC hDC;
- HPS hPS;
- DEVOPENSTRUC vDOP = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
- SIZEL vSize = {0, 0};
+ HDC hDC;
+ HPS hPS;
+ DEVOPENSTRUC vDOP = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
+ SIZEL vSize = {0, 0};
//
// Create a memory device context
{
m_hPS = hPS;
m_hDC = hDC;
- m_ok = TRUE;
- m_bOwnsDC = TRUE;
+ m_ok = true;
+ m_bOwnsDC = true;
//
// Set the wxWidgets color table
//
//
// As we created the DC, we must delete it in the dtor
//
- m_bOwnsDC = TRUE;
+ m_bOwnsDC = true;
m_ok = m_hDC != 0;
return m_ok;
} // end of wxMemoryDC::CreateCompatible
*pWidth = m_vSelectedBitmap.GetWidth();
*pHeight = m_vSelectedBitmap.GetHeight();
} // end of wxMemoryDC::DoGetSize
-
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
} // end of wxDialog::Init
-bool wxDialog::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxString& rsTitle
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxString& rsName
-)
+bool wxDialog::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxString& rsTitle,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxString& rsName )
{
Init();
SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);
,lStyle
,rsName
))
- return FALSE;
+ return false;
+
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
//
//
if (!rsTitle.IsNull())
SetTitle(rsTitle);
- return TRUE;
+ return true;
} // end of wxDialog::Create
// deprecated ctor
wxDialog::~wxDialog()
{
- m_isBeingDeleted = TRUE;
+ m_isBeingDeleted = true;
// this will also reenable all the other windows for a modal dialog
Show(false);
} // end of wxDialog::Show
//
-// Replacement for Show(TRUE) for modal dialogs - returns return code
+// Replacement for Show(true) for modal dialogs - returns return code
//
int wxDialog::ShowModal()
{
// wxWin event handlers
// ----------------------------------------------------------------------------
-void wxDialog::OnApply(
- wxCommandEvent& rEvent
-)
+void wxDialog::OnApply( wxCommandEvent& WXUNUSED(rEvent) )
{
if (Validate())
TransferDataFromWindow();
} // end of wxDialog::OnApply
// Standard buttons
-void wxDialog::OnOK(
- wxCommandEvent& rEvent
-)
+void wxDialog::OnOK( wxCommandEvent& WXUNUSED(rEvent) )
{
if ( Validate() && TransferDataFromWindow() )
{
}
} // end of wxDialog::OnOK
-void wxDialog::OnCancel(
- wxCommandEvent& rEvent
-)
+void wxDialog::OnCancel( wxCommandEvent& WXUNUSED(rEvent) )
{
EndDialog(wxID_CANCEL);
} // end of wxDialog::OnCancel
-void wxDialog::OnCloseWindow(
- wxCloseEvent& rEvent
-)
+void wxDialog::OnCloseWindow( wxCloseEvent& WXUNUSED(rEvent) )
{
//
// We'll send a Cancel message by default, which may close the dialog.
closing.Append(this);
- wxCommandEvent vCancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+ wxCommandEvent vCancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
vCancelEvent.SetEventObject( this );
GetEventHandler()->ProcessEvent(vCancelEvent); // This may close the dialog
closing.DeleteObject(this);
} // end of wxDialog::OnCloseWindow
-void wxDialog::OnSysColourChanged(
- wxSysColourChangedEvent& rEvent
-)
+void wxDialog::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(rEvent) )
{
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
Refresh();
);
return rc;
} // end of wxDialog::OS2WindowProc
-
#pragma implementation "dnd.h"
#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#if wxUSE_DRAG_AND_DROP
+
#include "wx/window.h"
#include "wx/app.h"
#include "wx/gdicmn.h"
#define INCL_DOS
#include <os2.h>
-#if wxUSE_DRAG_AND_DROP
-
// ----------------------------------------------------------------------------
// global
// ----------------------------------------------------------------------------
#pragma hdrstop
#endif
+#if wxUSE_FILEDLG
+
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/msgdlg.h"
#ifndef MAXEXT
# define MAXEXT 5
#endif
+
IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
// ----------------------------------------------------------------------------
}
if (nCount == 0)
sDir += m_fileName;
- if (sDir.IsEmpty())
+ if (sDir.empty())
sDir = wxT("*.*");
wxStrcpy((wxChar*)vFileDlg.szFullFile, sDir);
sFilterBuffer = sDir;
,&m_fileName
,&sExt
);
- if (zFileNameBuffer[nIdx] == wxT('.') || sExt.IsEmpty())
+ if (zFileNameBuffer[nIdx] == wxT('.') || sExt.empty())
{
zFileNameBuffer[nIdx] = wxT('\0');
return wxID_CANCEL;
} // end of wxFileDialog::ShowModal
+#endif // wxUSE_FILEDLG
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
// ============================================================================
// declarations
// ============================================================================
// headers
// ----------------------------------------------------------------------------
- #include <malloc.h>
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
#ifndef WX_PRECOMP
#include <stdio.h>
#include "wx/setup.h"
#include "wx/tokenzr.h"
+#include <malloc.h>
+
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
// ----------------------------------------------------------------------------
,WXHANDLE hPS = 0
);
//
- // If TRUE, the pointer to the actual font is temporary and SHOULD NOT BE
+ // If true, the pointer to the actual font is temporary and SHOULD NOT BE
// DELETED by destructor
//
bool m_bTemporary;
m_hFont = hFont;
m_nFontId = (int)hFont;
- m_bNativeFontInfoOk = TRUE;
+ m_bNativeFontInfoOk = true;
m_vNativeFontInfo = rInfo;
if (hPS == NULLHANDLE)
{
m_hPS = ::WinGetPS(HWND_DESKTOP);
- m_bInternalPS = TRUE;
+ m_bInternalPS = true;
}
else
m_hPS = (HPS)hPS;
Free();
}
-bool wxFontRefData::Alloc(
- wxFont* pFont
-)
+bool wxFontRefData::Alloc( wxFont* pFont )
{
wxString sFaceName;
long flId = m_hFont;
,sFaceName
,pFont
);
- m_bNativeFontInfoOk = TRUE;
+ m_bNativeFontInfoOk = true;
}
else
{
// Select the font into the Presentation space
//
::GpiSetCharSet(m_hPS, flId); // sets font for presentation space
- return TRUE;
+ return true;
} // end of wxFontRefData::Alloc
void wxFontRefData::Free()
}
} // end of wxNativeFontInfo::SetFamily
-void wxNativeFontInfo::SetEncoding(
- wxFontEncoding eEncoding
-)
+void wxNativeFontInfo::SetEncoding( wxFontEncoding eEncoding )
{
wxNativeEncodingInfo vInfo;
vInfo.charset = 850;
}
}
- fa.usCodePage = vInfo.charset;
+ fa.usCodePage = (USHORT)vInfo.charset;
} // end of wxNativeFontInfo::SetFaceName
-bool wxNativeFontInfo::FromString(
- const wxString& rsStr
-)
+bool wxNativeFontInfo::FromString( const wxString& rsStr )
{
long lVal;
if(!sToken)
return FALSE;
wxStrcpy((wxChar*)fa.szFacename, sToken.c_str());
- return TRUE;
+ return true;
} // end of wxNativeFontInfo::FromString
wxString wxNativeFontInfo::ToString() const
{
} // end of wxFont::Init
-bool wxFont::Create(
- const wxNativeFontInfo& rInfo
-, WXHFONT hFont
-)
+bool wxFont::Create( const wxNativeFontInfo& rInfo,
+ WXHFONT hFont )
{
UnRef();
m_refData = new wxFontRefData( rInfo
,hFont
);
RealizeResource();
- return TRUE;
+ return true;
} // end of wxFont::Create
wxFont::wxFont(
// Constructor for a font. Note that the real construction is done
// in wxDC::SetFont, when information is available about scaling etc.
// ----------------------------------------------------------------------------
-bool wxFont::Create(
- int nPointSize
-, int nFamily
-, int nStyle
-, int nWeight
-, bool bUnderlined
-, const wxString& rsFaceName
-, wxFontEncoding vEncoding
-)
+bool wxFont::Create( int nPointSize,
+ int nFamily,
+ int nStyle,
+ int nWeight,
+ bool bUnderlined,
+ const wxString& rsFaceName,
+ wxFontEncoding vEncoding )
{
UnRef();
,vEncoding
);
RealizeResource();
- return TRUE;
+ return true;
} // end of wxFont::Create
wxFont::~wxFont()
{
if ( GetResourceHandle() )
{
- return TRUE;
+ return true;
}
return M_FONTDATA->Alloc(this);
} // end of wxFont::RealizeResource
-bool wxFont::FreeResource(
- bool bForce
-)
+bool wxFont::FreeResource( bool WXUNUSED(bForce) )
{
if (GetResourceHandle())
{
M_FONTDATA->Free();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
} // end of wxFont::FreeResource
WXHANDLE wxFont::GetResourceHandle()
RealizeResource();
} // end of wxFont::SetPS
-
// if not empty, enum only the fonts with this facename
wxString m_facename;
- // if TRUE, enum only fixed fonts
+ // if true, enum only fixed fonts
bool m_fixedOnly;
};
m_charset = info.charset;
m_facename = info.facename;
- return TRUE;
+ return true;
}
#define wxFONTENUMPROC FONTENUMPROC
if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH )
{
// not a fixed pitch font
- return TRUE;
+ return true;
}
}
// check that we have the right encoding
if ( lf->lfCharSet != m_charset )
{
- return TRUE;
+ return true;
}
}
return m_fontEnum->OnFacename(lf->lfFaceName);
*/
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
}
// else: no such fonts, unknown encoding
- return TRUE;
+ return true;
}
-bool wxFontEnumerator::EnumerateEncodings(const wxString& family)
+bool wxFontEnumerator::EnumerateEncodings(const wxString& WXUNUSED(family))
{
wxFAIL_MSG(wxT("TODO"));
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
-#define DEBUG_PRINTF(NAME) { static int raz=0; \
- printf( #NAME " %i\n",raz); fflush(stdout); \
- raz++; \
- }
// ============================================================================
// declarations
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#define DEBUG_PRINTF(NAME) \
+ { \
+ static int raz=0; \
+ printf( #NAME " %i\n",raz); fflush(stdout); \
+ raz++; \
+ }
+
#ifndef WX_PRECOMP
#include "wx/app.h"
#include "wx/string.h"
// convert to/from the string representation: format is
// encodingid;facename[;charset]
-bool wxNativeEncodingInfo::FromString(
- const wxString& rsStr
-)
+bool wxNativeEncodingInfo::FromString( const wxString& rsStr )
{
wxStringTokenizer vTokenizer(rsStr, _T(";"));
wxString sEncid = vTokenizer.GetNextToken();
return FALSE;
}
}
- return TRUE;
+ return true;
} // end of wxNativeEncodingInfo::FromString
wxString wxNativeEncodingInfo::ToString() const
// helper functions
// ----------------------------------------------------------------------------
-bool wxGetNativeFontEncoding(
- wxFontEncoding vEncoding
-, wxNativeEncodingInfo* pInfo
-)
+bool wxGetNativeFontEncoding( wxFontEncoding vEncoding,
+ wxNativeEncodingInfo* pInfo )
{
wxCHECK_MSG(pInfo, FALSE, _T("bad pointer in wxGetNativeFontEncoding") );
if (vEncoding == wxFONTENCODING_DEFAULT)
pInfo->charset = 850;
break;
}
- return TRUE;
+ return true;
} // end of wxGetNativeFontEncoding
wxFontEncoding wxGetFontEncFromCharSet(
return eFontEncoding;
} // end of wxGetNativeFontEncoding
-bool wxTestFontEncoding(
- const wxNativeEncodingInfo& rInfo
-)
+bool wxTestFontEncoding( const wxNativeEncodingInfo& rInfo )
{
- FATTRS vLogFont;
- HPS hPS;
+ FATTRS vLogFont;
+ HPS hPS;
hPS = ::WinGetPS(HWND_DESKTOP);
memset(&vLogFont, '\0', sizeof(FATTRS)); // all default values
vLogFont.usRecordLength = sizeof(FATTRS);
- vLogFont.usCodePage = rInfo.charset;
+ vLogFont.usCodePage = (USHORT)rInfo.charset;
vLogFont.lMaxBaselineExt = 0L; // Outline fonts should use 0
vLogFont.lAveCharWidth = 0L; // Outline fonts should use 0
vLogFont.fsFontUse = FATTR_FONTUSE_OUTLINE | // only outline fonts allowed
return FALSE;
}
::WinReleasePS(hPS);
- return TRUE;
+ return true;
} // end of wxTestFontEncoding
// ----------------------------------------------------------------------------
} // end of wxConvertVectorPointSize
-void wxFillLogFont(
- LOGFONT* pFattrs // OS2 GPI FATTRS
-, PFACENAMEDESC pFaceName
-, HPS* phPS
-, bool* pbInternalPS
-, long* pflId
-, wxString& sFaceName
-, wxFont* pFont
-)
+void wxFillLogFont( LOGFONT* pFattrs, // OS2 GPI FATTRS
+ PFACENAMEDESC pFaceName,
+ HPS* phPS,
+ bool* pbInternalPS,
+ long* pflId,
+ wxString& sFaceName,
+ wxFont* pFont )
{
- LONG lNumFonts = 0L; // For system font count
- ERRORID vError; // For logging API errors
- LONG lTemp = 0L;
- bool bInternalPS = FALSE; // if we have to create one
- PFONTMETRICS pFM = NULL;
+ LONG lNumFonts = 0L; // For system font count
+ ERRORID vError; // For logging API errors
+ LONG lTemp = 0L;
+ bool bInternalPS = false; // if we have to create one
+ PFONTMETRICS pFM = NULL;
//
// Initial house cleaning to free data buffers and ensure we have a
if (!*phPS)
{
*phPS = ::WinGetPS(HWND_DESKTOP);
- bInternalPS = TRUE;
+ bInternalPS = true;
}
//
}
return rc;
}
-
#if wxUSE_STATUSBAR
#if wxUSE_NATIVE_STATUSBAR
- bool wxFrame::m_bUseNativeStatusBar = TRUE;
+ bool wxFrame::m_bUseNativeStatusBar = true;
#else
bool wxFrame::m_bUseNativeStatusBar = FALSE;
#endif
} // end of wxFrame::Init
-bool wxFrame::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxString& rsTitle
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxString& rsName
-)
+bool wxFrame::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxString& rsTitle,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxString& rsName )
{
if (!wxTopLevelWindow::Create( pParent
,vId
,lStyle
,rsName
))
- return FALSE;
- return TRUE;
+ return false;
+ return true;
} // end of wxFrame::Create
wxFrame::~wxFrame()
{
- m_isBeingDeleted = TRUE;
+ m_isBeingDeleted = true;
DeleteAllBars();
} // end of wxFrame::~wxFrame
wxWindow::OnSysColourChanged(rEvent);
} // end of wxFrame::OnSysColourChanged
-// Pass TRUE to show full screen, FALSE to restore.
-bool wxFrame::ShowFullScreen(
- bool bShow
-, long lStyle
-)
+// Pass true to show full screen, false to restore.
+bool wxFrame::ShowFullScreen( bool bShow, long lStyle )
{
if (bShow)
{
if (IsFullScreen())
return FALSE;
- m_bFsIsShowing = TRUE;
+ m_bFsIsShowing = true;
m_lFsStyle = lStyle;
#if wxUSE_TOOLBAR
//
// Decide which window style flags to turn off
//
- LONG lNewStyle = m_lFsOldWindowStyle;
- LONG lOffFlags = 0;
+ LONG lNewStyle = m_lFsOldWindowStyle;
+ LONG lOffFlags = 0;
if (lStyle & wxFULLSCREEN_NOBORDER)
lOffFlags |= FCF_BORDER;
//
nHeight = vRect.yTop - vRect.yBottom;
- SetSize( nWidth
- ,nHeight
- );
+ SetSize( nWidth, nHeight);
//
// Now flush the window style cache and actually go full-screen
,SWP_SIZE | SWP_SHOW
);
- wxSizeEvent vEvent( wxSize( nWidth
- ,nHeight
- )
- ,GetId()
- );
+ wxSize sz( nWidth, nHeight );
+ wxSizeEvent vEvent( sz, GetId() );
GetEventHandler()->ProcessEvent(vEvent);
- return TRUE;
+ return true;
}
else
{
if (!IsFullScreen())
- return FALSE;
+ return false;
- m_bFsIsShowing = FALSE;
+ m_bFsIsShowing = false;
#if wxUSE_TOOLBAR
wxToolBar* pTheToolBar = GetToolBar();
if (pTheToolBar && (m_lFsStyle & wxFULLSCREEN_NOTOOLBAR))
{
pTheToolBar->SetSize(-1, m_nFsToolBarHeight);
- pTheToolBar->Show(TRUE);
+ pTheToolBar->Show(true);
}
#endif //wxUSE_TOOLBAR
// Windows behaviour where child frames float independently of the parent one
// on the desktop, but are iconized/restored with it
//
-void wxFrame::IconizeChildFrames(
- bool bIconize
-)
+void wxFrame::IconizeChildFrames( bool WXUNUSED(bIconize) )
{
// FIXME: Generic MDI does not use Frames for the Childs, so this does _not_
// work. Possibly, the right thing is simply to eliminate this
// ---------------------------------------------------------------------------
bool wxFrame::HandlePaint()
{
- RECTL vRect;
+ RECTL vRect;
if (::WinQueryUpdateRect(GetHWND(), &vRect))
{
::WinQueryWindowRect(GetHwnd(), &vRect3);
+#ifndef __WATCOMC__
+// FIXME: incomplete headers ???
+
static const int nIconWidth = 32;
static const int nIconHeight = 32;
int nIconX = (int)((vRect3.xRight - nIconWidth)/2);
int nIconY = (int)((vRect3.yBottom + nIconHeight)/2);
::WinDrawPointer(hPs, nIconX, nIconY, hIcon, DP_NORMAL);
+#endif
}
::WinEndPaint(hPs);
- return TRUE;
}
else
{
,&vRect
,GetBackgroundColour().GetPixel()
);
- ::WinEndPaint(hPS);
+ ::WinEndPaint(hPS);
}
}
- return TRUE;
}
}
- else
- {
- // nothing to paint - processed
- return TRUE;
- }
- return FALSE;
+
+ return true;
} // end of wxFrame::HandlePaint
bool wxFrame::HandleSize(
//
IconizeChildFrames(TRUE);
(void)SendIconizeEvent();
- m_bIconized = TRUE;
+ m_bIconized = true;
break;
}
return bProcessed;
} // end of wxFrame::HandleSize
-bool wxFrame::HandleCommand(
- WXWORD nId
-, WXWORD nCmd
-, WXHWND hControl
-)
+bool wxFrame::HandleCommand( WXWORD nId,
+ WXWORD nCmd,
+ WXHWND hControl )
{
if (hControl)
{
wxWindow* pWin = wxFindWinFromHandle(hControl);
if (pWin)
- return pWin->OS2Command( nCmd
- ,nId
- );
+ return pWin->OS2Command( nCmd, nId );
}
//
wxCurrentPopupMenu = NULL;
- return pPopupMenu->OS2Command( nCmd
- ,nId
- );
- return TRUE;
+ return pPopupMenu->OS2Command( nCmd, nId );
}
#endif
if (ProcessCommand(nId))
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
} // end of wxFrame::HandleCommand
bool wxFrame::HandleMenuSelect(
return (MRESULT)mRc;
} // wxFrame::OS2WindowProc
-void wxFrame::SetClient(WXHWND c_Hwnd)
+void wxFrame::SetClient(WXHWND WXUNUSED(c_Hwnd))
{
// Duh...nothing to do under OS/2
}
);
}
}
-
,int nDesiredHeight = -1
) = 0;
private:
- inline virtual bool Load( wxGDIImage* pImage
- ,int nId
- ,long lFlags
- ,int nDesiredWidth
- ,int nDesiredHeight
- )
+ inline virtual bool Load( wxGDIImage* WXUNUSED(pImage),
+ int WXUNUSED(nId),
+ long WXUNUSED(lFlags),
+ int WXUNUSED(nDesiredWidth),
+ int WXUNUSED(nDesiredHeight) )
{
- return FALSE;
+ return false;
}
};
// wxGDIImage functions forwarded to wxGDIImageRefData
// ----------------------------------------------------------------------------
-bool wxGDIImage::FreeResource(
- bool WXUNUSED(bForce)
-)
+bool wxGDIImage::FreeResource( bool WXUNUSED(bForce) )
{
if ( !IsNull() )
{
GetGDIImageData()->m_hHandle = 0;
}
- return(TRUE);
+ return true;
}
WXHANDLE wxGDIImage::GetResourceHandle()
// wxGDIImage handler stuff
// ----------------------------------------------------------------------------
-void wxGDIImage::AddHandler(
- wxGDIImageHandler* pHandler
-)
+void wxGDIImage::AddHandler( wxGDIImageHandler* pHandler )
{
ms_handlers.Append(pHandler);
}
-void wxGDIImage::InsertHandler(
- wxGDIImageHandler* pHandler
-)
+void wxGDIImage::InsertHandler( wxGDIImageHandler* pHandler )
{
ms_handlers.Insert(pHandler);
}
-bool wxGDIImage::RemoveHandler(
- const wxString& rName
-)
+bool wxGDIImage::RemoveHandler( const wxString& rName )
{
wxGDIImageHandler* pHandler = FindHandler(rName);
if (pHandler)
{
ms_handlers.DeleteObject(pHandler);
- return(TRUE);
+ return true;
}
else
- return(FALSE);
+ return false;
}
wxGDIImageHandler* wxGDIImage::FindHandler(
// wxBitmap handlers
// ----------------------------------------------------------------------------
-bool wxBMPResourceHandler::LoadFile(
- wxBitmap* pBitmap
-, int nId
-, long lFlags
-, int nDesiredWidth
-, int nDesiredHeight
-)
+bool wxBMPResourceHandler::LoadFile( wxBitmap* pBitmap,
+ int nId,
+ long WXUNUSED(lFlags),
+ int WXUNUSED(nDesiredWidth),
+ int WXUNUSED(nDesiredHeight) )
{
SIZEL vSize = {0, 0};
DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
return(pBitmap->Ok());
} // end of wxBMPResourceHandler::LoadFile
-bool wxBMPFileHandler::LoadFile(
- wxBitmap* pBitmap
-, const wxString& rName
-, HPS hPs
-, long WXUNUSED(lFlags)
-, int WXUNUSED(nDesiredWidth)
-, int WXUNUSED(nDesiredHeight)
-)
+bool wxBMPFileHandler::LoadFile( wxBitmap* pBitmap,
+ const wxString& WXUNUSED(rName),
+ HPS WXUNUSED(hPs),
+ long WXUNUSED(lFlags),
+ int WXUNUSED(nDesiredWidth),
+ int WXUNUSED(nDesiredHeight) )
{
#if wxUSE_IMAGE_LOADING_IN_OS2
- wxPalette* pPalette = NULL;
+ wxPalette* pPalette = NULL;
- bool bSuccess = FALSE; /* wxLoadIntoBitmap( WXSTRINGCAST rName
- ,pBitmap
- ,&pPalette
- ) != 0; */
+ bool bSuccess = false; /* wxLoadIntoBitmap( WXSTRINGCAST rName
+ ,pBitmap
+ ,&pPalette
+ ) != 0; */
if (bSuccess && pPalette)
{
pBitmap->SetPalette(*pPalette);
return(bSuccess);
#else
- return(FALSE);
+ wxUnusedVar(pBitmap);
+ return false;
#endif
}
-bool wxBMPFileHandler::SaveFile(
- wxBitmap* pBitmap
-, const wxString& rName
-, int WXUNUSED(nType)
-, const wxPalette* pPal
-)
+bool wxBMPFileHandler::SaveFile( wxBitmap* pBitmap,
+ const wxString& WXUNUSED(rName),
+ int WXUNUSED(nType),
+ const wxPalette* pPal )
{
#if wxUSE_IMAGE_LOADING_IN_OS2
- wxPalette* pActualPalette = (wxPalette *)pPal;
+ wxPalette* pActualPalette = (wxPalette *)pPal;
if (!pActualPalette)
pActualPalette = pBitmap->GetPalette();
,pBitmap
,pActualPalette
) != 0); */
- return(FALSE);
+ return false;
#else
- return(FALSE);
+ wxUnusedVar(pBitmap);
+ wxUnusedVar(pPal);
+ return false;
#endif
}
// wxIcon handlers
// ----------------------------------------------------------------------------
-bool wxICOFileHandler::LoadIcon(
- wxIcon* pIcon
-, const wxString& rName
-, HPS hPs
-, long lFlags
-, int nDesiredWidth
-, int nDesiredHeight
-)
+bool wxICOFileHandler::LoadIcon( wxIcon* pIcon,
+ const wxString& WXUNUSED(rName),
+ HPS WXUNUSED(hPs),
+ long WXUNUSED(lFlags),
+ int WXUNUSED(nDesiredWidth),
+ int WXUNUSED(nDesiredHeight) )
{
#if wxUSE_RESOURCE_LOADING_IN_OS2
pIcon->UnRef();
- // actual size
- wxSize vSize;
-
- return(FALSE);
+ return false;
#else
- return(FALSE);
+ wxUnusedVar(pIcon);
+ return false;
#endif
}
-bool wxICOResourceHandler::LoadIcon(
- wxIcon* pIcon
-, const wxString& rName
-, HPS hPs
-, long lFlags
-, int WXUNUSED(nDesiredWidth)
-, int WXUNUSED(nDesiredHeight)
-)
+bool wxICOResourceHandler::LoadIcon( wxIcon* pIcon,
+ const wxString& rName,
+ HPS WXUNUSED(hPs),
+ long WXUNUSED(lFlags),
+ int WXUNUSED(nDesiredWidth),
+ int WXUNUSED(nDesiredHeight) )
{
HPOINTER hIcon;
pIcon->SetSize(32, 32); // all OS/2 icons are 32 x 32
-
pIcon->SetHICON((WXHICON)hIcon);
return pIcon->Ok();
} // end of wxICOResourceHandler::LoadIcon
-
* CVSID: $Id$
* ------------------------------------------------------------------------- */
-#include "wx/setup.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/defs.h"
#if wxUSE_SOCKETS
int c;
switch (event)
{
- case GSOCK_LOST: /* fall-through */
- case GSOCK_INPUT: c = 0; break;
- case GSOCK_OUTPUT: c = 1; break;
- case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break;
- default: return;
+ case GSOCK_LOST: /* fall-through */
+ case GSOCK_INPUT: c = 0; break;
+ case GSOCK_OUTPUT: c = 1; break;
+ case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break;
+ default: return;
}
if (m_id[c] != -1)
wxTheApp->RemoveSocketHandler(m_id[c]);
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
#ifndef WX_PRECOMP
#include "wx/defs.h"
#endif
{
m_helpFile = filename;
// TODO any other inits
- return TRUE;
+ return true;
}
bool wxWinHelpController::LoadFile(const wxString& file)
{
m_helpFile = file;
// TODO
- return TRUE;
+ return true;
}
bool wxWinHelpController::DisplayContents()
{
- if (m_helpFile == wxT("")) return FALSE;
+ if (m_helpFile == wxT(""))
+ return false;
wxString str = m_helpFile;
size_t len = str.Length();
if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
- str += wxT(".hlp");
+ str += wxT(".hlp");
if (wxTheApp->GetTopWindow())
{
- // TODO : display the help
- return TRUE;
+ // TODO : display the help
+ return true;
}
- return FALSE;
+ return FALSE;
}
-bool wxWinHelpController::DisplaySection(int section)
+bool wxWinHelpController::DisplaySection(int WXUNUSED(section))
{
// Use context number
- if (m_helpFile == wxT("")) return FALSE;
+ if (m_helpFile == wxT(""))
+ return false;
wxString str = m_helpFile;
size_t len = str.Length();
str += wxT(".hlp");
if (wxTheApp->GetTopWindow())
- {
- // TODO ::
- // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section);
- return TRUE;
- }
- return FALSE;
+ {
+ // TODO ::
+ // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section);
+ return true;
+ }
+
+ return false;
}
-bool wxWinHelpController::DisplayBlock(long block)
+bool wxWinHelpController::DisplayBlock(long WXUNUSED(block))
{
// Use context number -- a very rough equivalent to block id!
- if (m_helpFile == wxT("")) return FALSE;
+ if (m_helpFile == wxT(""))
+ return false;
wxString str = m_helpFile;
size_t len = str.Length();
str += wxT(".hlp");
if (wxTheApp->GetTopWindow())
- {
- // TODO:
- // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)block);
- return TRUE;
- }
- return FALSE;
+ {
+ // TODO:
+ // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)block);
+ return true;
+ }
+ return false;
}
-bool wxWinHelpController::KeywordSearch(const wxString& k,
+bool wxWinHelpController::KeywordSearch(const wxString& WXUNUSED(k),
wxHelpSearchMode WXUNUSED(mode))
{
if (m_helpFile == wxEmptyString) return FALSE;
{
// TODO:
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k);
- return TRUE;
+ return true;
}
return FALSE;
}
// Can't close the help window explicitly in WinHelp
bool wxWinHelpController::Quit()
{
- if (wxTheApp->GetTopWindow())
- {
- // TODO:
- // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), 0, HELP_QUIT, 0L);
- return TRUE;
- }
- else
- return FALSE;
+ if (wxTheApp->GetTopWindow())
+ {
+ // TODO:
+ // WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), 0, HELP_QUIT, 0L);
+ return true;
+ }
+
+ return false;
}
void wxWinHelpController::OnQuit()
{
}
#endif // wxUSE_HELP
-
CopyFromBitmap(vBmp);
if (GetHICON())
{
- m_bIsXpm = TRUE;
+ m_bIsXpm = true;
m_vXpmSrc = vBmp;
}
} // end of wxIcon::CreateIconFromXpm
-void wxIcon::CopyFromBitmap(
- const wxBitmap& rBmp
-)
+void wxIcon::CopyFromBitmap( const wxBitmap& rBmp )
{
wxMask* pMask = rBmp.GetMask();
HBITMAP hBmp = NULLHANDLE;
vIconInfo.hbmPointer = hBmpMask;
- HICON hIcon = ::WinCreatePointerIndirect( HWND_DESKTOP
- ,&vIconInfo
- );
+#ifndef __WATCOMC__
+// FIXME: incomplete headers ???
+
+ HICON hIcon = ::WinCreatePointerIndirect( HWND_DESKTOP, &vIconInfo);
if (!hIcon)
{
,rBmp.GetHeight()
);
}
+#endif
if (!rBmp.GetMask())
{
else
return(FALSE);
}
-
localFilename, globalFilename, style)
{
m_strLocalFilename = localFilename;
- if (m_strLocalFilename.IsEmpty())
+ if (m_strLocalFilename.empty())
{
m_strLocalFilename = GetAppName() + wxT(".ini");
}
void wxIniConfig::SetPath(const wxString& strPath)
{
- wxArrayString aParts;
+ wxArrayString aParts;
- if ( strPath.IsEmpty() ) {
- // nothing
- }
- else if ( strPath[(size_t) 0] == wxCONFIG_PATH_SEPARATOR ) {
- // absolute path
- wxSplitPath(aParts, strPath);
- }
- else {
- // relative path, combine with current one
- wxString strFullPath = GetPath();
- strFullPath << wxCONFIG_PATH_SEPARATOR << strPath;
- wxSplitPath(aParts, strFullPath);
- }
+ if ( strPath.empty() )
+ {
+ // nothing
+ }
+ else if ( strPath[(size_t) 0] == wxCONFIG_PATH_SEPARATOR )
+ {
+ // absolute path
+ wxSplitPath(aParts, strPath);
+ }
+ else
+ {
+ // relative path, combine with current one
+ wxString strFullPath = GetPath();
+ strFullPath << wxCONFIG_PATH_SEPARATOR << strPath;
+ wxSplitPath(aParts, strFullPath);
+ }
- size_t nPartsCount = aParts.Count();
- m_strPath.Empty();
- if ( nPartsCount == 0 ) {
- // go to the root
- m_strGroup = (wxChar*)PATH_SEP_REPLACE;
- }
- else {
- // translate
- m_strGroup = aParts[(size_t) 0];
- for ( size_t nPart = 1; nPart < nPartsCount; nPart++ ) {
- if ( nPart > 1 )
- m_strPath << PATH_SEP_REPLACE;
- m_strPath << aParts[nPart];
+ size_t nPartsCount = aParts.Count();
+ m_strPath.Empty();
+ if ( nPartsCount == 0 )
+ {
+ // go to the root
+ m_strGroup = (wxChar*)PATH_SEP_REPLACE;
+ }
+ else
+ {
+ // translate
+ m_strGroup = aParts[(size_t) 0];
+ for ( size_t nPart = 1; nPart < nPartsCount; nPart++ )
+ {
+ if ( nPart > 1 )
+ m_strPath << PATH_SEP_REPLACE;
+ m_strPath << aParts[nPart];
+ }
}
- }
- // other functions assume that all this is true, i.e. there are no trailing
- // underscores at the end except if the group is the root one
- wxASSERT( (m_strPath.IsEmpty() || m_strPath.Last() != PATH_SEP_REPLACE) &&
- (m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) ||
- m_strGroup.Last() != PATH_SEP_REPLACE) );
+ // other functions assume that all this is true, i.e. there are no trailing
+ // underscores at the end except if the group is the root one
+ wxASSERT( (m_strPath.empty() || m_strPath.Last() != PATH_SEP_REPLACE) &&
+ (m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) ||
+ m_strGroup.Last() != PATH_SEP_REPLACE) );
}
const wxString& wxIniConfig::GetPath() const
{
- static wxString s_str;
+ static wxString s_str;
- // always return abs path
- s_str = wxCONFIG_PATH_SEPARATOR;
+ // always return abs path
+ s_str = wxCONFIG_PATH_SEPARATOR;
- if ( m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) ) {
- // we're at the root level, nothing to do
- }
- else {
- s_str << m_strGroup;
- if ( !m_strPath.IsEmpty() )
- s_str << wxCONFIG_PATH_SEPARATOR;
- for ( const wxChar *p = m_strPath; *p != '\0'; p++ ) {
- s_str << (*p == PATH_SEP_REPLACE ? wxCONFIG_PATH_SEPARATOR : *p);
+ if ( m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) )
+ {
+ // we're at the root level, nothing to do
+ }
+ else
+ {
+ s_str << m_strGroup;
+ if ( !m_strPath.empty() )
+ s_str << wxCONFIG_PATH_SEPARATOR;
+ for ( const wxChar *p = m_strPath; *p != '\0'; p++ )
+ {
+ s_str << (*p == PATH_SEP_REPLACE ? wxCONFIG_PATH_SEPARATOR : *p);
+ }
}
- }
- return s_str;
+ return s_str;
}
wxString wxIniConfig::GetPrivateKeyName(const wxString& szKey) const
{
- wxString strKey;
+ wxString strKey;
- if ( !m_strPath.IsEmpty() )
- strKey << m_strPath << PATH_SEP_REPLACE;
+ if ( !m_strPath.empty() )
+ strKey << m_strPath << PATH_SEP_REPLACE;
- strKey << szKey;
+ strKey << szKey;
- return strKey;
+ return strKey;
}
wxString wxIniConfig::GetKeyName(const wxString& szKey) const
{
- wxString strKey;
+ wxString strKey;
- if (m_strGroup != wxString((wxChar)PATH_SEP_REPLACE))
- strKey << m_strGroup << PATH_SEP_REPLACE;
- if ( !m_strPath.IsEmpty() )
- strKey << m_strPath << PATH_SEP_REPLACE;
+ if (m_strGroup != wxString((wxChar)PATH_SEP_REPLACE))
+ strKey << m_strGroup << PATH_SEP_REPLACE;
+ if ( !m_strPath.empty() )
+ strKey << m_strPath << PATH_SEP_REPLACE;
- strKey << szKey;
+ strKey << szKey;
- return strKey;
+ return strKey;
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// not implemented
-bool wxIniConfig::GetFirstGroup(wxString& str, long& lIndex) const
+bool wxIniConfig::GetFirstGroup(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
{
- wxFAIL_MSG(wxT("not implemeted"));
+ wxFAIL_MSG(wxT("not implemeted"));
- return FALSE;
+ return false;
}
-bool wxIniConfig::GetNextGroup (wxString& str, long& lIndex) const
+bool wxIniConfig::GetNextGroup(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
{
- wxFAIL_MSG(wxT("not implemeted"));
+ wxFAIL_MSG(wxT("not implemeted"));
- return FALSE;
+ return false;
}
-bool wxIniConfig::GetFirstEntry(wxString& str, long& lIndex) const
+bool wxIniConfig::GetFirstEntry(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
{
- wxFAIL_MSG(wxT("not implemeted"));
+ wxFAIL_MSG(wxT("not implemeted"));
- return FALSE;
+ return false;
}
-bool wxIniConfig::GetNextEntry (wxString& str, long& lIndex) const
+bool wxIniConfig::GetNextEntry(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
{
- wxFAIL_MSG(wxT("not implemeted"));
+ wxFAIL_MSG(wxT("not implemeted"));
- return FALSE;
+ return false;
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// not implemented
-size_t wxIniConfig::GetNumberOfEntries(bool bRecursive) const
+size_t wxIniConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const
{
- wxFAIL_MSG(wxT("not implemeted"));
+ wxFAIL_MSG(wxT("not implemeted"));
- return (size_t)-1;
+ return (size_t)-1;
}
-size_t wxIniConfig::GetNumberOfGroups(bool bRecursive) const
+size_t wxIniConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const
{
- wxFAIL_MSG(wxT("not implemeted"));
+ wxFAIL_MSG(wxT("not implemeted"));
- return (size_t)-1;
+ return (size_t)-1;
}
-bool wxIniConfig::HasGroup(const wxString& strName) const
+bool wxIniConfig::HasGroup(const wxString& WXUNUSED(strName)) const
{
- wxFAIL_MSG(wxT("not implemeted"));
+ wxFAIL_MSG(wxT("not implemeted"));
- return FALSE;
+ return false;
}
-bool wxIniConfig::HasEntry(const wxString& strName) const
+bool wxIniConfig::HasEntry(const wxString& WXUNUSED(strName)) const
{
- wxFAIL_MSG(wxT("not implemeted"));
+ wxFAIL_MSG(wxT("not implemeted"));
- return FALSE;
+ return false;
}
// is current group empty?
bool wxIniConfig::IsEmpty() const
{
- char szBuf[1024];
+ char szBuf[1024];
// GetPrivateProfileString(m_strGroup, NULL, "",
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
- if ( !::IsEmpty(szBuf) )
- return FALSE;
+ if ( !::IsEmpty(szBuf) )
+ return false;
// GetProfileString(m_strGroup, NULL, "", szBuf, WXSIZEOF(szBuf));
// if ( !::IsEmpty(szBuf) )
- return FALSE;
+// return false;
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
bool wxIniConfig::Read(const wxString& szKey, wxString *pstr) const
{
- wxConfigPathChanger path(this, szKey);
- wxString strKey = GetPrivateKeyName(path.Name());
+ wxConfigPathChanger path(this, szKey);
+ wxString strKey = GetPrivateKeyName(path.Name());
- wxChar szBuf[1024]; // @@ should dynamically allocate memory...
+ wxChar szBuf[1024]; // @@ should dynamically allocate memory...
- // first look in the private INI file
+ // first look in the private INI file
- // NB: the lpDefault param to GetPrivateProfileString can't be NULL
+ // NB: the lpDefault param to GetPrivateProfileString can't be NULL
// GetPrivateProfileString(m_strGroup, strKey, "",
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
- if ( ::IsEmpty((PSZ)szBuf) ) {
- // now look in win.ini
- wxString strKey = GetKeyName(path.Name());
-// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
- }
+ if ( ::IsEmpty((PSZ)szBuf) )
+ {
+ // now look in win.ini
+ wxString strKey = GetKeyName(path.Name());
+ // GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
+ }
+
+ if ( ::IsEmpty((PSZ)szBuf) )
+ {
+ return false;
+ }
- if ( ::IsEmpty((PSZ)szBuf) ) {
- return FALSE;
- }
- else {
*pstr = szBuf ;
- return TRUE;
- }
+ return true;
}
bool wxIniConfig::Read(const wxString& szKey, wxString *pstr,
return TRUE;
}
-bool wxIniConfig::Write(const wxString& szKey, const wxString& szValue)
+bool wxIniConfig::Write(const wxString& szKey, const wxString& WXUNUSED(szValue))
{
- wxConfigPathChanger path(this, szKey);
- wxString strKey = GetPrivateKeyName(path.Name());
+ wxConfigPathChanger path(this, szKey);
+ wxString strKey = GetPrivateKeyName(path.Name());
- bool bOk = FALSE; // = WritePrivateProfileString(m_strGroup, strKey,
+ bool bOk = false; // = WritePrivateProfileString(m_strGroup, strKey,
// szValue, m_strLocalFilename) != 0;
- if ( !bOk )
- wxLogLastError(wxT("WritePrivateProfileString"));
+ if ( !bOk )
+ wxLogLastError(wxT("WritePrivateProfileString"));
- return bOk;
+ return bOk;
}
bool wxIniConfig::Write(const wxString& szKey, long lValue)
return TRUE;
}
-bool wxIniConfig::RenameEntry(const wxString& oldName, const wxString& newName)
+bool wxIniConfig::RenameEntry(const wxString& WXUNUSED(oldName), const wxString& WXUNUSED(newName))
{
// Not implemented
- return FALSE;
+ return false;
}
-bool wxIniConfig::RenameGroup(const wxString& oldName, const wxString& newName)
+bool wxIniConfig::RenameGroup(const wxString& WXUNUSED(oldName), const wxString& WXUNUSED(newName))
{
// Not implemented
- return FALSE;
+ return false;
}
#endif //wxUSE_CONFIG
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+//
+// For compilers that support precompilation, includes "wx.h".
+//
+#include "wx/wxprec.h"
+
#include "wx/defs.h"
#if wxUSE_JOYSTICK
return 0;
}
-void wxJoystick::SetMovementThreshold(int threshold)
+void wxJoystick::SetMovementThreshold(int WXUNUSED(threshold))
{
// TODO
}
bool wxJoystick::IsOk() const
{
// TODO
- return FALSE;
+ return false;
}
int wxJoystick::GetNumberJoysticks() const
bool wxJoystick::HasRudder() const
{
// TODO
- return FALSE;
+ return false;
}
bool wxJoystick::HasZ() const
{
// TODO
- return FALSE;
+ return false;
}
bool wxJoystick::HasU() const
{
// TODO
- return FALSE;
+ return false;
}
bool wxJoystick::HasV() const
{
// TODO
- return FALSE;
+ return false;
}
bool wxJoystick::HasPOV() const
{
// TODO
- return FALSE;
+ return false;
}
bool wxJoystick::HasPOV4Dir() const
{
// TODO
- return FALSE;
+ return false;
}
bool wxJoystick::HasPOVCTS() const
{
// TODO
- return FALSE;
+ return false;
}
// Operations
////////////////////////////////////////////////////////////////////////////
-bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
+bool wxJoystick::SetCapture(wxWindow* WXUNUSED(win), int WXUNUSED(pollingFreq))
{
// TODO
- return FALSE;
+ return false;
}
bool wxJoystick::ReleaseCapture()
{
// TODO
- return FALSE;
+ return false;
}
#endif // wxUSE_JOYSTICK
-
SetMarginWidth(0);
} // end of wxListBoxItem::wxListBoxItem
-wxOwnerDrawn* wxListBox::CreateItem(
- size_t n
-)
+wxOwnerDrawn* wxListBox::CreateItem( size_t WXUNUSED(n) )
{
return new wxListBoxItem();
} // end of wxListBox::CreateItem
return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
} // end of wxListBox::HasMultipleSelection
-int wxListBox::GetSelections(
- wxArrayInt& raSelections
-) const
+int wxListBox::GetSelections( wxArrayInt& raSelections ) const
{
int nCount = 0;
LONG lItem;
}
return nCount;
}
- return 0;
}
else // single-selection listbox
{
wxCHECK(pData, false );
- wxDC vDc;
- wxRect vRect( wxPoint( pDrawStruct->rclItem.xLeft
- ,pDrawStruct->rclItem.yTop
- )
- ,wxPoint( pDrawStruct->rclItem.xRight
- ,pDrawStruct->rclItem.yBottom
- )
- );
+ wxDC vDc;
+ wxPoint pt1( pDrawStruct->rclItem.xLeft, pDrawStruct->rclItem.yTop );
+ wxPoint pt2( pDrawStruct->rclItem.xRight, pDrawStruct->rclItem.yBottom );
+ wxRect vRect( pt1, pt2 );
vDc.SetHPS(pDrawStruct->hps);
#endif // ndef for wxUSE_OWNER_DRAWN
#endif // ndef for wxUSE_LISTBOX
-
//
// If we have a title, insert it in the beginning of the menu
//
- if (!m_title.IsEmpty())
+ if (!m_title.empty())
{
Append( idMenuTitle
,m_title
void wxMenu::Break()
{
// this will take effect during the next call to Append()
- m_bDoBreak = TRUE;
+ m_bDoBreak = true;
} // end of wxMenu::Break
void wxMenu::Attach(
}
else if (!pItem->IsSeparator())
{
- //
+ //
// Recurse upwards: we should only modify m_accels of the top level
// menus, not of the submenus as wxMenuBar doesn't look at them
// (alternative and arguable cleaner solution would be to recurse
//
// Append a new item or submenu to the menu
//
-bool wxMenu::DoInsertOrAppend(
- wxMenuItem* pItem
-, size_t nPos
-)
+bool wxMenu::DoInsertOrAppend( wxMenuItem* pItem,
+ size_t nPos )
{
- wxMenu* pSubmenu = pItem->GetSubMenu();
- MENUITEM& rItem = (pSubmenu != NULL)?pSubmenu->m_vMenuData:
- pItem->m_vMenuData;
+ wxMenu* pSubmenu = pItem->GetSubMenu();
+ MENUITEM& rItem = (pSubmenu != NULL)?pSubmenu->m_vMenuData:
+ pItem->m_vMenuData;
- ERRORID vError;
- wxString sError;
+ ERRORID vError;
+ wxString sError;
#if wxUSE_ACCEL
UpdateAccel(pItem);
}
else
{
- rItem.id = pItem->GetId();
+ rItem.id = (USHORT)pItem->GetId();
}
BYTE* pData=NULL;
}
else
{
- rItem.iPosition = nPos;
+ rItem.iPosition = (SHORT)nPos;
}
APIRET rc;
);
}
#endif
+
if (rc == (APIRET)MIT_MEMERROR || rc == (APIRET)MIT_ERROR)
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
wxLogError(wxT("Error inserting or appending a menuitem. Error: %s\n"), sError.c_str());
wxLogLastError(wxT("Insert or AppendMenu"));
- return FALSE;
+ return false;
}
- else
+
+ //
+ // If we're already attached to the menubar, we must update it
+ //
+ if (IsAttached() && GetMenuBar()->IsAttached())
{
- //
- // If we're already attached to the menubar, we must update it
- //
- if (IsAttached() && GetMenuBar()->IsAttached())
- {
- GetMenuBar()->Refresh();
- }
- return TRUE;
+ GetMenuBar()->Refresh();
}
- return FALSE;
+
+ return true;
} // end of wxMenu::DoInsertOrAppend
void wxMenu::EndRadioGroup()
m_nStartRadioGroup = -1;
} // end of wxMenu::EndRadioGroup
-wxMenuItem* wxMenu::DoAppend(
- wxMenuItem* pItem
-)
+wxMenuItem* wxMenu::DoAppend( wxMenuItem* pItem )
{
wxCHECK_MSG( pItem, NULL, _T("NULL item in wxMenu::DoAppend") );
- bool bCheck = FALSE;
+ bool bCheck = false;
if (pItem->GetKind() == wxITEM_RADIO)
{
//
// Ensure that we have a checked item in the radio group
//
- bCheck = TRUE;
+ bCheck = true;
}
else // extend the current radio group
{
//
// Check the item initially
//
- pItem->Check(TRUE);
+ pItem->Check(true);
}
return pItem;
} // end of wxMenu::DoAppend
// set wxMenu title
// ---------------------------------------------------------------------------
-void wxMenu::SetTitle(
- const wxString& rLabel
-)
+void wxMenu::SetTitle( const wxString& rLabel )
{
- bool bHasNoTitle = m_title.IsEmpty();
- HWND hMenu = GetHmenu();
+ bool bHasNoTitle = m_title.empty();
+ HWND hMenu = GetHmenu();
m_title = rLabel;
if (bHasNoTitle)
{
- if (!rLabel.IsEmpty())
+ if (!rLabel.empty())
{
if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
{
}
else
{
- if (rLabel.IsEmpty() )
+ if (rLabel.empty() )
{
::WinSendMsg( GetHmenu()
,MM_REMOVEITEM
}
else
{
- size_t nCount = GetMenuCount(), i;
- wxMenuList::iterator it;
+ size_t nCount = GetMenuCount(), i;
+ wxMenuList::iterator it;
for (i = 0, it = m_menus.begin(); i < nCount; i++, it++)
{
- APIRET rc;
- ERRORID vError;
- wxString sError;
- HWND hSubMenu;
+ APIRET rc;
+ ERRORID vError;
+ wxString sError;
+ HWND hSubMenu;
//
// Set the parent and owner of the submenues to be the menubar, not the desktop
return NULLHANDLE;
}
- (*it)->m_vMenuData.iPosition = i;
+ (*it)->m_vMenuData.iPosition = (SHORT)i;
rc = (APIRET)::WinSendMsg(m_hMenu, MM_INSERTITEM, (MPARAM)&(*it)->m_vMenuData, (MPARAM)m_titles[i].c_str());
if (rc == (APIRET)MIT_MEMERROR || rc == (APIRET)MIT_ERROR)
return pMenuOld;
} // end of wxMenuBar::Replace
-bool wxMenuBar::Insert(
- size_t nPos
-, wxMenu* pMenu
-, const wxString& rTitle
-)
+bool wxMenuBar::Insert( size_t nPos,
+ wxMenu* pMenu,
+ const wxString& rTitle )
{
- wxString sTitle = wxPMTextToLabel(rTitle);
+ wxString sTitle = wxPMTextToLabel(rTitle);
- if (!wxMenuBarBase::Insert( nPos
- ,pMenu
- ,sTitle
- ))
- return FALSE;
+ if (!wxMenuBarBase::Insert( nPos, pMenu, sTitle ))
+ return false;
- m_titles.Insert( sTitle
- ,nPos
- );
+ m_titles.Insert( sTitle, nPos );
if (IsAttached())
{
- pMenu->m_vMenuData.iPosition = nPos;
+ pMenu->m_vMenuData.iPosition = (SHORT)nPos;
::WinSendMsg( (HWND)m_hMenu
,MM_INSERTITEM
,(MPARAM)&pMenu->m_vMenuData
#endif // wxUSE_ACCEL
Refresh();
}
- return TRUE;
+
+ return true;
} // end of wxMenuBar::Insert
bool wxMenuBar::Append(
}
return pItem;
} // end of wxMenuBar::FindItem
-
// --------------
bool wxMenuItem::IsChecked() const
{
- USHORT uFlag = SHORT1FROMMR(::WinSendMsg( GetHMenuOf(m_parentMenu)
- ,MM_QUERYITEMATTR
- ,MPFROM2SHORT(GetId(), TRUE)
- ,MPFROMSHORT(MIA_CHECKED)
- ));
+ USHORT uFlag = SHORT1FROMMR(::WinSendMsg( GetHMenuOf(m_parentMenu)
+ ,MM_QUERYITEMATTR
+ ,MPFROM2SHORT(GetId(), TRUE)
+ ,MPFROMSHORT(MIA_CHECKED)
+ ));
- return (uFlag & MIA_CHECKED);
+ return (uFlag & MIA_CHECKED) == MIA_CHECKED ;
} // end of wxMenuItem::IsChecked
wxString wxMenuItemBase::GetLabelFromText(
//
void wxMenuItem::SetAsRadioGroupStart()
{
- m_bIsRadioGroupStart = TRUE;
+ m_bIsRadioGroupStart = true;
} // end of wxMenuItem::SetAsRadioGroupStart
void wxMenuItem::SetRadioGroupStart(
wxMenuItemBase::Check(bCheck);
} // end of wxMenuItem::Check
-void wxMenuItem::SetText(
- const wxString& rText
-)
+void wxMenuItem::SetText( const wxString& rText )
{
//
// Don't do anything if label didn't change
m_parentMenu->UpdateAccel(this);
#endif // wxUSE_ACCEL
- USHORT uId = GetRealId();
- MENUITEM vItem;
- USHORT uFlagsOld;
+ USHORT uId = (USHORT)GetRealId();
+ MENUITEM vItem;
+ USHORT uFlagsOld;
if (!::WinSendMsg( hMenu
,MM_QUERYITEM
,pSubMenu
);
} // end of wxMenuItemBase::New
-
bool wxMetafile::SetClipboard(int width, int height)
{
+#if !wxUSE_CLIPBOARD
+ wxUnusedVar(width);
+ wxUnusedVar(height);
+ return false;
+#else
if (!m_refData)
- return FALSE;
+ return false;
bool alreadyOpen=wxClipboardOpen();
if (!alreadyOpen)
bool success = wxSetClipboardData(wxDF_METAFILE, this, width,height);
if (!alreadyOpen) wxCloseClipboard();
return (bool) success;
+#endif
}
bool wxMetafile::Play(wxDC *dc)
dc->EndDrawing();
- return TRUE;
+ return true;
}
void wxMetafile::SetHMETAFILE(WXHANDLE mf)
// New constructor that takes origin and extent. If you use this, don't
// give origin/extent arguments to wxMakeMetafilePlaceable.
-wxMetafileDC::wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg)
+wxMetafileDC::wxMetafileDC( const wxString& file,
+ int WXUNUSED(xext),
+ int WXUNUSED(yext),
+ int WXUNUSED(xorg),
+ int WXUNUSED(yorg) )
{
- m_minX = 10000;
- m_minY = 10000;
- m_maxX = -10000;
- m_maxY = -10000;
- if (file != wxT("") && wxFileExists(file)) wxRemoveFile(file);
+ m_minX = 10000;
+ m_minY = 10000;
+ m_maxX = -10000;
+ m_maxY = -10000;
+ if (file != wxT("") && wxFileExists(file))
+ wxRemoveFile(file);
+
// m_hDC = (WXHDC) CreateMetaFile(file);
- m_ok = TRUE;
+ m_ok = true;
// ::SetWindowOrgEx((HDC) m_hDC,xorg,yorg, NULL);
// ::SetWindowExtEx((HDC) m_hDC,xext,yext, NULL);
- // Actual Windows mapping mode, for future reference.
- m_windowsMappingMode = wxMM_ANISOTROPIC;
+ // Actual Windows mapping mode, for future reference.
+ m_windowsMappingMode = wxMM_ANISOTROPIC;
- SetMapMode(wxMM_TEXT); // NOTE: does not set HDC mapmode (this is correct)
+ SetMapMode(wxMM_TEXT); // NOTE: does not set HDC mapmode (this is correct)
}
wxMetafileDC::~wxMetafileDC(void)
m_hDC = 0;
}
-void wxMetafileDC::GetTextExtent(const wxString& string, long *x, long *y,
- long *descent, long *externalLeading, wxFont *theFont, bool use16bit) const
+void wxMetafileDC::GetTextExtent(const wxString& WXUNUSED(string),
+ long *WXUNUSED(x),
+ long *WXUNUSED(y),
+ long *WXUNUSED(descent),
+ long *WXUNUSED(externalLeading),
+ wxFont *theFont,
+ bool WXUNUSED(use16bit) ) const
{
- wxFont *fontToUse = theFont;
- if (!fontToUse)
- fontToUse = (wxFont*) &m_font;
+ wxFont *fontToUse = theFont;
+ if (!fontToUse)
+ fontToUse = (wxFont*) &m_font;
- // TODO:
+ // TODO:
/*
- HDC dc = GetDC(NULL);
-
- SIZE sizeRect;
- TEXTMETRIC tm;
- GetTextExtentPoint(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
- GetTextMetrics(dc, &tm);
-
- ReleaseDC(NULL, dc);
-
- if ( x )
- *x = sizeRect.cx;
- if ( y )
- *y = sizeRect.cy;
- if ( descent )
- *descent = tm.tmDescent;
- if ( externalLeading )
- *externalLeading = tm.tmExternalLeading;
+ HDC dc = GetDC(NULL);
+
+ SIZE sizeRect;
+ TEXTMETRIC tm;
+ GetTextExtentPoint(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
+ GetTextMetrics(dc, &tm);
+
+ ReleaseDC(NULL, dc);
+
+ if ( x )
+ *x = sizeRect.cx;
+ if ( y )
+ *y = sizeRect.cy;
+ if ( descent )
+ *descent = tm.tmDescent;
+ if ( externalLeading )
+ *externalLeading = tm.tmExternalLeading;
*/
}
};
struct mfPLACEABLEHEADER {
- DWORD key;
- short hmf;
- RECT32 bbox;
- WORD inch;
- DWORD reserved;
- WORD checksum;
+ DWORD key;
+ short hmf;
+ RECT32 bbox;
+ WORD inch;
+ DWORD reserved;
+ WORD checksum;
};
#else
struct mfPLACEABLEHEADER {
- DWORD key;
- HANDLE hmf;
- RECT bbox;
- WORD inch;
- DWORD reserved;
- WORD checksum;
+ DWORD key;
+ HANDLE hmf;
+ RECT bbox;
+ WORD inch;
+ DWORD reserved;
+ WORD checksum;
};
#endif
return wxMakeMetafilePlaceable(filename, 0, 0, 0, 0, scale, FALSE);
}
-bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale, bool useOriginAndExtent)
+bool wxMakeMetafilePlaceable(const wxString& WXUNUSED(filename),
+ int WXUNUSED(x1),
+ int WXUNUSED(y1),
+ int WXUNUSED(x2),
+ int WXUNUSED(y2),
+ float WXUNUSED(scale),
+ bool WXUNUSED(useOriginAndExtent))
{
// TODO: the OS/2 PM/MM way to do this
/*
- // I'm not sure if this is the correct way of suggesting a scale
- // to the client application, but it's the only way I can find.
- int unitsPerInch = (int)(576/scale);
-
- mfPLACEABLEHEADER header;
- header.key = 0x9AC6CDD7L;
- header.hmf = 0;
- header.bbox.xLeft = (int)(x1);
- header.bbox.yTop = (int)(y1);
- header.bbox.xRight = (int)(x2);
- header.bbox.yBottom = (int)(y2);
- header.inch = unitsPerInch;
- header.reserved = 0;
-
- // Calculate checksum
- WORD *p;
- mfPLACEABLEHEADER *pMFHead = &header;
- for (p =(WORD *)pMFHead,pMFHead -> checksum = 0;
- p < (WORD *)&pMFHead ->checksum; ++p)
- pMFHead ->checksum ^= *p;
-
- FILE *fd = fopen(filename.fn_str(), "rb");
- if (!fd) return FALSE;
-
- wxChar tempFileBuf[256];
- wxGetTempFileName(wxT("mf"), tempFileBuf);
- FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb");
- if (!fHandle)
- return FALSE;
- fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);
-
- // Calculate origin and extent
- int originX = x1;
- int originY = y1;
- int extentX = x2 - x1;
- int extentY = (y2 - y1);
-
- // Read metafile header and write
- METAHEADER metaHeader;
- fread((void *)&metaHeader, sizeof(unsigned char), sizeof(metaHeader), fd);
-
- if (useOriginAndExtent)
- metaHeader.mtSize += 15;
- else
- metaHeader.mtSize += 5;
+ // I'm not sure if this is the correct way of suggesting a scale
+ // to the client application, but it's the only way I can find.
+ int unitsPerInch = (int)(576/scale);
+
+ mfPLACEABLEHEADER header;
+ header.key = 0x9AC6CDD7L;
+ header.hmf = 0;
+ header.bbox.xLeft = (int)(x1);
+ header.bbox.yTop = (int)(y1);
+ header.bbox.xRight = (int)(x2);
+ header.bbox.yBottom = (int)(y2);
+ header.inch = unitsPerInch;
+ header.reserved = 0;
+
+ // Calculate checksum
+ WORD *p;
+ mfPLACEABLEHEADER *pMFHead = &header;
+ for (p =(WORD *)pMFHead,pMFHead -> checksum = 0; p < (WORD *)&pMFHead ->checksum; ++p)
+ pMFHead ->checksum ^= *p;
+
+ FILE *fd = fopen(filename.fn_str(), "rb");
+ if (!fd)
+ return FALSE;
- fwrite((void *)&metaHeader, sizeof(unsigned char), sizeof(metaHeader), fHandle);
+ wxChar tempFileBuf[256];
+ wxGetTempFileName(wxT("mf"), tempFileBuf);
+ FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb");
+ if (!fHandle)
+ return FALSE;
+ fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);
- // Write SetMapMode, SetWindowOrigin and SetWindowExt records
- char modeBuffer[8];
- char originBuffer[10];
- char extentBuffer[10];
- METARECORD *modeRecord = (METARECORD *)&modeBuffer;
+ // Calculate origin and extent
+ int originX = x1;
+ int originY = y1;
+ int extentX = x2 - x1;
+ int extentY = (y2 - y1);
- METARECORD *originRecord = (METARECORD *)&originBuffer;
- METARECORD *extentRecord = (METARECORD *)&extentBuffer;
+ // Read metafile header and write
+ METAHEADER metaHeader;
+ fread((void *)&metaHeader, sizeof(unsigned char), sizeof(metaHeader), fd);
- modeRecord->rdSize = 4;
- modeRecord->rdFunction = META_SETMAPMODE;
- modeRecord->rdParm[0] = MM_ANISOTROPIC;
+ if (useOriginAndExtent)
+ metaHeader.mtSize += 15;
+ else
+ metaHeader.mtSize += 5;
- originRecord->rdSize = 5;
- originRecord->rdFunction = META_SETWINDOWORG;
- originRecord->rdParm[0] = originY;
- originRecord->rdParm[1] = originX;
+ fwrite((void *)&metaHeader, sizeof(unsigned char), sizeof(metaHeader), fHandle);
- extentRecord->rdSize = 5;
- extentRecord->rdFunction = META_SETWINDOWEXT;
- extentRecord->rdParm[0] = extentY;
- extentRecord->rdParm[1] = extentX;
+ // Write SetMapMode, SetWindowOrigin and SetWindowExt records
+ char modeBuffer[8];
+ char originBuffer[10];
+ char extentBuffer[10];
+ METARECORD *modeRecord = (METARECORD *)&modeBuffer;
- fwrite((void *)modeBuffer, sizeof(char), 8, fHandle);
+ METARECORD *originRecord = (METARECORD *)&originBuffer;
+ METARECORD *extentRecord = (METARECORD *)&extentBuffer;
- if (useOriginAndExtent)
- {
- fwrite((void *)originBuffer, sizeof(char), 10, fHandle);
- fwrite((void *)extentBuffer, sizeof(char), 10, fHandle);
- }
+ modeRecord->rdSize = 4;
+ modeRecord->rdFunction = META_SETMAPMODE;
+ modeRecord->rdParm[0] = MM_ANISOTROPIC;
- int ch = -2;
- while (ch != EOF)
- {
- ch = getc(fd);
- if (ch != EOF)
+ originRecord->rdSize = 5;
+ originRecord->rdFunction = META_SETWINDOWORG;
+ originRecord->rdParm[0] = originY;
+ originRecord->rdParm[1] = originX;
+
+ extentRecord->rdSize = 5;
+ extentRecord->rdFunction = META_SETWINDOWEXT;
+ extentRecord->rdParm[0] = extentY;
+ extentRecord->rdParm[1] = extentX;
+
+ fwrite((void *)modeBuffer, sizeof(char), 8, fHandle);
+
+ if (useOriginAndExtent)
{
- putc(ch, fHandle);
+ fwrite((void *)originBuffer, sizeof(char), 10, fHandle);
+ fwrite((void *)extentBuffer, sizeof(char), 10, fHandle);
}
- }
- fclose(fHandle);
- fclose(fd);
- wxRemoveFile(filename);
- wxCopyFile(tempFileBuf, filename);
- wxRemoveFile(tempFileBuf);
+
+ int ch = -2;
+ while (ch != EOF)
+ {
+ ch = getc(fd);
+ if (ch != EOF)
+ {
+ putc(ch, fHandle);
+ }
+ }
+ fclose(fHandle);
+ fclose(fd);
+ wxRemoveFile(filename);
+ wxCopyFile(tempFileBuf, filename);
+ wxRemoveFile(tempFileBuf);
*/
- return TRUE;
+ return true;
}
#endif // wxUSE_METAFILE
-
// Licence: wxWindows licence (part of wxExtra library)
/////////////////////////////////////////////////////////////////////////////
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
#define INCL_DOS
#define INCL_GPI
#define INCL_WIN
// location, uses it, so it isn't likely to change
static const wxChar *MIME_DATABASE_KEY = wxT("MIME\\Database\\Content Type\\");
-wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
+wxString wxFileTypeImpl::GetCommand(const wxChar *WXUNUSED(verb)) const
{
// TODO: OS/2 doesn't have a registry but uses Prf
/*
// NB: we don't make any attempt to verify that the string is valid,
// i.e. doesn't contain %2, or second %1 or .... But we do make
// sure that we return a string with _exactly_ one '%s'!
- bool foundFilename = FALSE;
+ bool foundFilename = false;
size_t len = command.Len();
for ( size_t n = 0; (n < len) && !foundFilename; n++ ) {
if ( command[n] == wxT('%') &&
// replace it with '%s'
command[n + 1] = wxT('s');
- foundFilename = TRUE;
+ foundFilename = true;
}
}
*openCmd = wxFileType::ExpandCommand(cmd, params);
- return !openCmd->IsEmpty();
+ return !openCmd->empty();
}
bool
*printCmd = wxFileType::ExpandCommand(cmd, params);
- return !printCmd->IsEmpty();
+ return !printCmd->empty();
}
// TODO this function is half implemented
if ( m_info ) {
extensions = m_info->GetExtensions();
- return TRUE;
+ return true;
}
- else if ( m_ext.IsEmpty() ) {
+ else if ( m_ext.empty() ) {
// the only way to get the list of extensions from the file type is to
// scan through all extensions in the registry - too slow...
- return FALSE;
+ return false;
}
else {
extensions.Empty();
extensions.Add(m_ext);
// it's a lie too, we don't return _all_ extensions...
- return TRUE;
+ return true;
}
}
// we already have it
*mimeType = m_info->GetMimeType();
- return TRUE;
+ return true;
}
// suppress possible error messages
/*
wxRegKey key(wxRegKey::HKCR, wxT(".") + m_ext);
if ( key.Open() && key.QueryValue(wxT("Content Type"), *mimeType) ) {
- return TRUE;
+ return true;
}
else {
- return FALSE;
+ return false;
}
*/
- return FALSE;
+ return false;
}
bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
{
mimeTypes.Clear();
mimeTypes.Add(s);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
-bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
+bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(iconLoc)) const
{
if ( m_info ) {
// we don't have icons in the fallback resources
- return FALSE;
+ return false;
}
wxString strIconKey;
// index may be omitted, in which case BeforeLast(',') is empty and
// AfterLast(',') is the whole string
- if ( strFullPath.IsEmpty() ) {
+ if ( strFullPath.empty() ) {
strFullPath = strIndex;
strIndex = wxT("0");
}
iconLoc->SetIndex(wxAtoi(strIndex));
}
- return TRUE;
+ return true;
}
}
// no such file type or no value or incorrect icon entry
*/
- return FALSE;
+ return false;
}
bool wxFileTypeImpl::GetDescription(wxString *desc) const
// we already have it
*desc = m_info->GetDescription();
- return TRUE;
+ return true;
}
// suppress possible error messages
if ( key.Open() ) {
// it's the default value of the key
if ( key.QueryValue(wxT(""), *desc) ) {
- return TRUE;
+ return true;
}
}
*/
- return FALSE;
+ return false;
}
// extension -> file type
// suppress possible error messages
wxLogNull nolog;
- bool knownExtension = FALSE;
+ bool knownExtension = false;
wxString strFileType;
// TODO:
// this extension doesn't have a filetype, but it's known to the
// system and may be has some other useful keys (open command or
// content-type), so still return a file type object for it
- knownExtension = TRUE;
+ knownExtension = true;
}
}
*/
return NULL;
}
-size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
+size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& WXUNUSED(mimetypes))
{
// enumerate all keys under MIME_DATABASE_KEY
// TODO:
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
-wxMessageDialog::wxMessageDialog(
- wxWindow* pParent
-, const wxString& rsMessage
-, const wxString& rsCaption
-, long lStyle
-, const wxPoint& pPos
-)
+wxMessageDialog::wxMessageDialog( wxWindow* WXUNUSED(pParent),
+ const wxString& rsMessage,
+ const wxString& rsCaption,
+ long lStyle,
+ const wxPoint& WXUNUSED(pPos) )
{
m_sCaption = rsCaption;
m_sMessage = rsMessage;
}
return nAns;
} // end of wxMessageDialog::ShowModal
-
// ----------------------------------------------------------------------------
// check that the page index is valid
-#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount()))
+#define IS_VALID_PAGE(nPage) ( \
+ /* size_t is _always_ >= 0 */ \
+ /* ((nPage) >= 0) && */ \
+ ((nPage) < GetPageCount()) \
+ )
// hide the ugly cast
#define m_hWnd (HWND)GetHWND()
//
// Create() function
//
-bool wxNotebook::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxString& rsName
-)
+bool wxNotebook::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxString& rsName )
{
//
// Base init
,wxDefaultValidator
,rsName
))
- return FALSE;
+ return false;
//
// Notebook, so explicitly specify 0 as last parameter
,rSize
,lStyle | wxTAB_TRAVERSAL
))
- return FALSE;
+ return false;
SetBackgroundColour(wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
- return TRUE;
+ return true;
} // end of wxNotebook::Create
WXDWORD wxNotebook::OS2GetStyle (
);
} // end of wxNotebook::GetRowCount
-int wxNotebook::SetSelection(
- size_t nPage
-)
+int wxNotebook::SetSelection( size_t nPage )
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
return nPage;
} // end of wxNotebook::SetSelection
-bool wxNotebook::SetPageText(
- size_t nPage
-, const wxString& rsStrText
-)
+bool wxNotebook::SetPageText( size_t nPage,
+ const wxString& rsStrText )
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
return (bool)::WinSendMsg( m_hWnd
);
} // end of wxNotebook::SetPageText
-wxString wxNotebook::GetPageText (
- size_t nPage
-) const
+wxString wxNotebook::GetPageText ( size_t nPage ) const
{
BOOKTEXT vBookText;
wxChar zBuf[256];
return sStr;
} // end of wxNotebook::GetPageText
-int wxNotebook::GetPageImage (
- size_t nPage
-) const
+int wxNotebook::GetPageImage ( size_t nPage ) const
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
wxImageList* pImageList
)
{
- //
+ //
// Does not really do anything yet, but at least we need to
// update the base class.
- //
+ //
wxNotebookBase::SetImageList(pImageList);
} // end of wxNotebook::SetImageList
//
// Remove one page from the notebook, without deleting
//
-wxNotebookPage* wxNotebook::DoRemovePage (
- size_t nPage
-)
+wxNotebookPage* wxNotebook::DoRemovePage ( size_t nPage )
{
- wxNotebookPage* pPageRemoved = wxNotebookBase::DoRemovePage(nPage);
+ wxNotebookPage* pPageRemoved = wxNotebookBase::DoRemovePage(nPage);
if (!pPageRemoved)
return NULL;
,(MPARAM)BKA_ALL
);
m_nSelection = -1;
- return TRUE;
+
+ return true;
} // end of wxNotebook::DeleteAllPages
//
//
// Same as AddPage() but does it at given position
//
-bool wxNotebook::InsertPage (
- size_t nPage
-, wxNotebookPage* pPage
-, const wxString& rsStrText
-, bool bSelect
-, int nImageId
-)
+bool wxNotebook::InsertPage ( size_t nPage,
+ wxNotebookPage* pPage,
+ const wxString& rsStrText,
+ bool bSelect,
+ int nImageId )
{
ULONG ulApiPage;
// Now set TAB dimenstions
//
- wxWindowDC vDC(this);
- wxCoord nTextX;
- wxCoord nTextY;
+ wxWindowDC vDC(this);
+ wxCoord nTextX;
+ wxCoord nTextY;
vDC.GetTextExtent(rsStrText, &nTextX, &nTextY);
nTextY *= 2;
//
// Now set any TAB text
//
- if (!rsStrText.IsEmpty())
+ if (!rsStrText.empty())
{
if (!SetPageText( nPage
,rsStrText
// ----------------------------------------------------------------------------
// wxNotebook Windows message handlers
// ----------------------------------------------------------------------------
-bool wxNotebook::OS2OnScroll (
- int nOrientation
-, WXWORD wSBCode
-, WXWORD wPos
-, WXHWND wControl
-)
+bool wxNotebook::OS2OnScroll ( int nOrientation,
+ WXWORD wSBCode,
+ WXWORD wPos,
+ WXHWND wControl )
{
//
// Don't generate EVT_SCROLLWIN events for the WM_SCROLLs coming from the
} // end of wxNotebook::OS2OnScroll
#endif // wxUSE_NOTEBOOK
-
// ctor
// ----
//
-wxOwnerDrawn::wxOwnerDrawn(
- const wxString& rsStr
-, bool bCheckable
-, bool bMenuItem
-)
+wxOwnerDrawn::wxOwnerDrawn( const wxString& rsStr,
+ bool bCheckable,
+ bool WXUNUSED(bMenuItem) )
: m_strName(rsStr)
{
m_bCheckable = bCheckable;
// -------
//
-bool wxOwnerDrawn::OnMeasureItem(
- size_t* pWidth
-, size_t* pHeight
-)
+bool wxOwnerDrawn::OnMeasureItem( size_t* pWidth,
+ size_t* pHeight )
{
- wxMemoryDC vDC;
+ wxMemoryDC vDC;
-
- wxString sStr = wxStripMenuCodes(m_strName);
+ wxString sStr = wxStripMenuCodes(m_strName);
//
// If we have a valid accel string, then pad out
,(long *)pWidth
,(long *)pHeight
);
- if (!m_strAccel.IsEmpty())
+ if (!m_strAccel.empty())
{
//
// Measure the accelerator string, and add its width to
if (*pHeight < m_nMinHeight)
*pHeight = m_nMinHeight;
m_nHeight = *pHeight; // remember height for use in OnDrawItem
- return TRUE;
+ return true;
} // end of wxOwnerDrawn::OnMeasureItem
// draw the item
-bool wxOwnerDrawn::OnDrawItem(
- wxDC& rDC
-, const wxRect& rRect
-, wxODAction eAction
-, wxODStatus eStatus
-)
+bool wxOwnerDrawn::OnDrawItem( wxDC& rDC,
+ const wxRect& rRect,
+ wxODAction eAction,
+ wxODStatus eStatus )
{
//
// We do nothing on focus change
//
if (eAction == wxODFocusChanged )
- return TRUE;
+ return true;
//
// Select the font and draw the text
//
// Display main text and accel text separately to align better
//
- wxString sTgt = wxT("\t");
- wxString sFullString = m_strName; // need to save the original text
- wxString sAccel;
- int nIndex;
- size_t nWidth;
- size_t nCharWidth;
- size_t nHeight;
- bool bFoundMnemonic = FALSE;
- bool bFoundAccel = FALSE;
+ wxString sTgt = wxT("\t");
+ wxString sFullString = m_strName; // need to save the original text
+ wxString sAccel;
+ int nIndex;
+ size_t nWidth;
+ size_t nCharWidth;
+ size_t nHeight;
+ bool bFoundMnemonic = false;
+ bool bFoundAccel = false;
//
// Deal with the tab, extracting the Accel text
nIndex = sFullString.Find(sTgt.c_str());
if (nIndex != -1)
{
- bFoundAccel = TRUE;
+ bFoundAccel = true;
sAccel = sFullString.Mid(nIndex + 1);
sFullString.Remove(nIndex);
}
nIndex = sFullString.Find(sTgt.c_str());
if (nIndex != -1)
{
- wxString sTmp = sFullString;
+ wxString sTmp = sFullString;
- bFoundMnemonic = TRUE;
+ bFoundMnemonic = true;
sTmp.Remove(nIndex);
rDC.GetTextExtent( sTmp
,(long *)&nWidth
,(long *)&nCharWidth
,(long *)&nHeight
);
- sFullString.Replace(sTgt.c_str(), wxEmptyString, TRUE);
+ sFullString.Replace(sTgt.c_str(), wxEmptyString, true);
}
//
//
// For uncheckable item we use only the 'checked' bitmap
//
- wxBitmap vBmp(GetBitmap(IsCheckable() ? ((eStatus & wxODChecked) != 0) : TRUE));
+ wxBitmap vBmp(GetBitmap(IsCheckable() ? ((eStatus & wxODChecked) != 0) : TRUE));
if (vBmp.Ok())
{
,0
,0
,wxCOPY
- ,TRUE
+ ,true
);
if (eStatus & wxODSelected)
vBmp.SetSelectedInto(NULL);
}
}
- return TRUE;
+ return true;
} // end of wxOwnerDrawn::OnDrawItem
#endif //wxUSE_OWNER_DRAWN
// Created: ??/??/98
// RCS-ID: $Id$
// Copyright: (c) AUTHOR
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
{
} // end of wxPalette::~wxPalette
-bool wxPalette::FreeResource(
- bool bForce
-)
+bool wxPalette::FreeResource( bool WXUNUSED(bForce) )
{
if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette)
{
::GpiSelectPalette(M_PALETTEDATA->m_hPS, NULLHANDLE);
::GpiDeletePalette((HPAL)M_PALETTEDATA->m_hPalette);
}
- return TRUE;
+ return true;
} // end of wxPalette::FreeResource
-bool wxPalette::Create(
- int n
-, const unsigned char* pRed
-, const unsigned char* pGreen
-, const unsigned char* pBlue
-)
+bool wxPalette::Create( int n,
+ const unsigned char* pRed,
+ const unsigned char* pGreen,
+ const unsigned char* pBlue )
{
PULONG pualTable;
m_refData = new wxPaletteRefData;
pualTable = new ULONG[n];
if (!pualTable)
- return(FALSE);
+ return false;
for (int i = 0; i < n; i ++)
{
,pualTable
);
delete [] pualTable;
- return TRUE;
+ return true;
} // end of wxPalette::Create
int wxPalette::GetPixel(
//
// Now loop through and find the matching entry
//
- ULONG i;
+ ULONG i;
for (i = 0; i < ulNumEntries; i++)
{
if (pualTable[i] == ulRGB)
{
- bFound = TRUE;
+ bFound = true;
break;
}
}
::GpiSelectPalette(M_PALETTEDATA->m_hPS, M_PALETTEDATA->m_hPalette);
M_PALETTEDATA->m_hPS = hPS;
} // end of wxPalette::SetHPALETTE
-
}
if (M_PENDATA->m_nStyle == wxTRANSPARENT)
{
- return TRUE;
+ return true;
}
- COLORREF vPmColour = 0L;
- USHORT uLineType = wx2os2PenStyle(M_PENDATA->m_nStyle);
+ COLORREF vPmColour = 0L;
+ USHORT uLineType = (USHORT)wx2os2PenStyle(M_PENDATA->m_nStyle);
vPmColour = M_PENDATA->m_vColour.GetPixel();
sError = wxPMErrorToStr(vError);
wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
}
- return bOk;
+
+ return (bool)bOk;
}
- return FALSE;
+ return false;
} // end of wxPen::RealizeResource
WXHANDLE wxPen::GetResourceHandle()
return (WXHANDLE)M_PENDATA->m_hPen;
} // end of wxPen::GetResourceHandle
-bool wxPen::FreeResource(
- bool bForce
-)
+bool wxPen::FreeResource( bool WXUNUSED(bForce) )
{
if (M_PENDATA && (M_PENDATA->m_hPen != 0))
{
M_PENDATA->m_hPen = 0;
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
} // end of wxPen::FreeResource
bool wxPen::IsFree() const
RealizeResource();
} // end of wxPen::SetStipple
-void wxPen::SetDashes(
- int nNbDashes
-, const wxDash* pDash
-)
+void wxPen::SetDashes( int WXUNUSED(nNbDashes),
+ const wxDash* WXUNUSED(pDash) )
{
//
// Does nothing under OS/2
}
return nPMStyle;
} // end of wx2os2PenStyle
-
-
// implementation
// ============================================================================
-bool wxPopupWindow::Create(
- wxWindow* pParent
-, int nFlags
-)
+bool wxPopupWindow::Create( wxWindow* pParent,
+ int nFlags )
{
return wxPopupWindowBase::Create(pParent) &&
wxWindow::Create( pParent
);
} // end of wxPopupWindow::Create
-void wxPopupWindow::DoGetPosition(
- int* pnX
-, int* pnY
-) const
+void wxPopupWindow::DoGetPosition( int* pnX,
+ int* pnY ) const
{
//
// The position of a "top level" window such as this should be in
return (WXHWND)HWND_DESKTOP;
} // end of wxPopupWindow::OS2GetParent
-WXDWORD wxPopupWindow::OS2GetStyle(
- long lFlags
-, WXDWORD* dwExstyle
-) const
+WXDWORD wxPopupWindow::OS2GetStyle( long lFlags,
+ WXDWORD* dwExstyle ) const
{
- WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
- ,dwExstyle
- );
+ WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
+ ,dwExstyle
+ );
return dwStyle;
} // end of wxPopupWindow::OS2GetStyle
-
-
delete[] m_pnRadioHeight;
} // end of wxRadioBox::~wxRadioBox
-void wxRadioBox::AdjustButtons(
- int nX
-, int nY
-, int nWidth
-, int nHeight
-, int nSizeFlags
-)
+void wxRadioBox::AdjustButtons( int nX,
+ int nY,
+ int nWidth,
+ int nHeight,
+ int WXUNUSED(nSizeFlags) )
{
- wxSize vMaxSize;
- int nXOffset = nX;
- int nYOffset = nY + nHeight;
- int nCx1;
- int nCy1;
- int nStartX;
- int nStartY;
- int nMaxWidth;
- int nMaxHeight;
- wxFont vFont = GetFont();
+ wxSize vMaxSize;
+ int nXOffset = nX;
+ int nYOffset = nY + nHeight;
+ int nCx1;
+ int nCy1;
+ int nStartX;
+ int nStartY;
+ int nMaxWidth;
+ int nMaxHeight;
+ wxFont vFont = GetFont();
wxGetCharSize( m_hWnd
,&nCx1
if (nHeightMax < nHeight )
nHeightMax = nHeight;
}
- return(wxSize( nWidthMax
- ,nHeightMax
- )
- );
+ wxSize maxsize( nWidthMax, nHeightMax);
+ return maxsize;
} // end of wxRadioBox::GetMaxButtonSize
int wxRadioBox::GetNumHor() const
}
} // end of wxRadioBox::GetNumVer
-void wxRadioBox::GetPosition(
- int* pnX
-, int* pnY
-) const
+void wxRadioBox::GetPosition( int* pnX,
+ int* WXUNUSED(pnY) ) const
{
wxWindowOS2* pParent = GetParent();
RECT vRect = { -1, -1, -1, -1 };
return sResult;
} // end of wxRadioBox::GetStringSelection
-wxSize wxRadioBox::GetTotalButtonSize(
- const wxSize& rSizeBtn
-) const
+wxSize wxRadioBox::GetTotalButtonSize( const wxSize& rSizeBtn ) const
{
- int nCx1;
- int nCy1;
- int nExtraHeight;
- int nHeight;
- int nWidth;
- int nWidthLabel;
- wxFont vFont = GetFont();
-
- wxGetCharSize( m_hWnd
- ,&nCx1
- ,&nCy1
- ,&vFont
- );
+ int nCx1;
+ int nCy1;
+ int nExtraHeight;
+ int nHeight;
+ int nWidth;
+ int nWidthLabel;
+ wxFont vFont = GetFont();
+
+ wxGetCharSize( m_hWnd, &nCx1, &nCy1, &vFont );
nExtraHeight = nCy1;
nHeight = GetNumVer() * rSizeBtn.y + (2 * nCy1);
if (nWidthLabel > nWidth)
nWidth = nWidthLabel;
- return(wxSize( nWidth
- ,nHeight
- )
- );
+ wxSize total( nWidth, nHeight );
+ return total;
} // end of wxRadioBox::GetTotalButtonSize
-WXHBRUSH wxRadioBox::OnCtlColor(
- WXHDC hwinDC
-, WXHWND hWnd
-, WXUINT uCtlColor
-, WXUINT uMessage
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+WXHBRUSH wxRadioBox::OnCtlColor( WXHDC hwinDC,
+ WXHWND WXUNUSED(hWnd),
+ WXUINT WXUNUSED(uCtlColor),
+ WXUINT WXUNUSED(uMessage),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam) )
{
- HPS hPS = (HPS)hwinDC; // pass in a PS handle in OS/2
+ HPS hPS = (HPS)hwinDC; // pass in a PS handle in OS/2
if (GetParent()->GetTransparentBackground())
::GpiSetBackMix(hPS, BM_LEAVEALONE);
else
::GpiSetBackMix(hPS, BM_OVERPAINT);
- wxColour vColBack = GetBackgroundColour();
+ wxColour vColBack = GetBackgroundColour();
::GpiSetBackColor(hPS, vColBack.GetPixel());
::GpiSetColor(hPS, vColBack.GetPixel());
-
- wxBrush* pBrush = wxTheBrushList->FindOrCreateBrush( vColBack
- ,wxSOLID
- );
+ wxBrush* pBrush = wxTheBrushList->FindOrCreateBrush( vColBack, wxSOLID );
return ((WXHBRUSH)pBrush->GetResourceHandle());
} // end of wxRadioBox::OnCtlColor
-bool wxRadioBox::OS2Command(
- WXUINT uCmd
-, WXWORD wId
-)
+bool wxRadioBox::OS2Command( WXUINT uCmd,
+ WXWORD wId)
{
- int nSelectedButton = -1;
+ int nSelectedButton = -1;
if (uCmd == BN_CLICKED)
{
)
);
} // end of wxRadioBoxWndProc
-
return((::WinSendMsg((HWND) GetHWND(), BM_QUERYCHECK, (MPARAM)0L, (MPARAM)0L) != 0));
} // end of wxRadioButton::GetValue
-bool wxRadioButton::OS2Command(
- WXUINT wParam
-, WXWORD wId
-)
+bool wxRadioButton::OS2Command( WXUINT wParam, WXWORD WXUNUSED(wId) )
{
if (wParam != BN_CLICKED)
- return FALSE;
+ return false;
if (m_bFocusJustSet)
{
//
// See above: we want to ignore this event
//
- m_bFocusJustSet = FALSE;
+ m_bFocusJustSet = false;
}
else
{
- bool bIsChecked = GetValue();
+ bool bIsChecked = GetValue();
if (HasFlag(wxRB_SINGLE))
{
if (!bIsChecked )
SetValue(TRUE);
}
- wxCommandEvent rEvent( wxEVT_COMMAND_RADIOBUTTON_SELECTED
- ,m_windowId
- );
-
+ wxCommandEvent rEvent( wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
rEvent.SetEventObject(this);
ProcessCommand(rEvent);
}
- return TRUE;
+ return true;
} // end of wxRadioButton::OS2Command
void wxRadioButton::SetFocus()
//
// to avoid this, we drop the pseudo BN_CLICKED events generated when the
// button gains focus
- m_bFocusJustSet = TRUE;
+ m_bFocusJustSet = true;
wxControl::SetFocus();
}
,(MPARAM)0
,MPFROM2SHORT(0,1)
);
- ::WinShowWindow( hScrollBar
- ,TRUE
- );
+ ::WinShowWindow( hScrollBar, TRUE );
SetFont(*wxSMALL_FONT);
m_hWnd = hScrollBar;
{
}
-bool wxScrollBar::OS2OnScroll (
- int nOrientation
-, WXWORD wParam
-, WXWORD wPos
-, WXHWND hControl
-)
+bool wxScrollBar::OS2OnScroll ( int WXUNUSED(nOrientation),
+ WXWORD wParam,
+ WXWORD wPos,
+ WXHWND WXUNUSED(hControl) )
{
- int nPosition;
- int nMaxPos;
- int nTrackPos = wPos;
- int nMinPos;
- int nScrollInc;
- wxEventType vScrollEvent = wxEVT_NULL;
+ int nPosition;
+ int nMaxPos;
+ int nTrackPos = wPos;
+ int nMinPos;
+ int nScrollInc;
+ wxEventType vScrollEvent = wxEVT_NULL;
- MRESULT vRange;
+ MRESULT vRange;
//
// When we're dragging the scrollbar we can't use pos parameter because it
// Don't process the event if there is no displacement,
// unless this is a thumb release or end scroll event.
//
- return FALSE;
+ return false;
}
wxScrollEvent vEvent( vScrollEvent
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxScrollBar::OS2OnScroll
-void wxScrollBar::SetThumbPosition (
- int nViewStart
-)
+void wxScrollBar::SetThumbPosition ( int nViewStart )
{
SBCDATA vInfo;
memset(&vInfo, '\0', sizeof(SBCDATA));
vInfo.cb = sizeof(SBCDATA);
- vInfo.posThumb = nViewStart;
+ vInfo.posThumb = (SHORT)nViewStart;
::WinSendMsg((HWND)GetHwnd(), WM_SETWINDOWPARAMS, (MPARAM)&vInfo, (MPARAM)NULL);
::WinSendMsg((HWND)GetHwnd(), SBM_SETPOS, (MPARAM)nViewStart, (MPARAM)NULL);
return((int)(MRESULT)::WinSendMsg((HWND)GetHwnd(), SBM_QUERYPOS, (MPARAM)NULL, (MPARAM)NULL));
} // end of wxScrollBar::GetThumbPosition
-void wxScrollBar::SetScrollbar (
- int nPosition
-, int nThumbSize
-, int nRange
-, int nPageSize
-, bool bRefresh
-)
+void wxScrollBar::SetScrollbar ( int nPosition,
+ int nThumbSize,
+ int nRange,
+ int nPageSize,
+ bool WXUNUSED(bRefresh) )
{
SBCDATA vInfo;
//
nRange1 += (m_nPageSize - 1);
}
vInfo.cb = sizeof(SBCDATA);
- vInfo.cVisible = m_nPageSize;
+ vInfo.cVisible = (SHORT)m_nPageSize;
vInfo.posFirst = 0;
- vInfo.posLast = nRange1;
- vInfo.posThumb = nPosition;
+ vInfo.posLast = (SHORT)nRange1;
+ vInfo.posThumb = (SHORT)nPosition;
::WinSendMsg((HWND)GetHwnd(), WM_SETWINDOWPARAMS, (MPARAM)&vInfo, (MPARAM)NULL);
} // end of wxScrollBar::SetScrollbar
-WXHBRUSH wxScrollBar::OnCtlColor (
- WXHDC hDC
-, WXHWND hWnd
-, WXUINT uCtlColor
-, WXUINT uMessage
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+WXHBRUSH wxScrollBar::OnCtlColor ( WXHDC WXUNUSED(hDC),
+ WXHWND WXUNUSED(hWnd),
+ WXUINT WXUNUSED(uCtlColor),
+ WXUINT WXUNUSED(uMessage),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam) )
{
//
// Does nothing under OS/2
return 0;
} // end of wxScrollBar::OnCtlColor
-void wxScrollBar::Command (
- wxCommandEvent& rEvent
-)
+void wxScrollBar::Command ( wxCommandEvent& rEvent )
{
SetThumbPosition(rEvent.GetInt());
ProcessCommand(rEvent);
} // end of wxScrollBar::Command
-
case wxSYS_COLOUR_LISTBOX:
case wxSYS_COLOUR_CAPTIONTEXT:
return(*wxWHITE);
- break;
case wxSYS_COLOUR_WINDOWTEXT:
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
}
// Get a system metric, e.g. scrollbar size
-int wxSystemSettingsNative::GetMetric(
- wxSystemMetric index
-, wxWindow* WXUNUSED(win)
-)
+int wxSystemSettingsNative::GetMetric( wxSystemMetric index,
+ wxWindow* WXUNUSED(win) )
{
switch ( index)
{
// TODO case wxSYS_ICONSPACING_Y:
// TODO case wxSYS_WINDOWMIN_X:
// TODO case wxSYS_WINDOWMIN_Y:
-
+
case wxSYS_SCREEN_X:
return ::WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN);
case wxSYS_SCREEN_Y:
return ::WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN);
-
+
// TODO case wxSYS_FRAMESIZE_X:
// TODO case wxSYS_FRAMESIZE_Y:
// TODO case wxSYS_SMALLICON_X:
// TODO case wxSYS_PENWINDOWS_PRESENT:
// TODO case wxSYS_SHOW_SOUNDS:
// TODO case wxSYS_SWAP_BUTTONS:
-
- default:
- return -1; // unsupported metric
}
- return 0;
+ return -1; // unsupported metric
}
-bool wxSystemSettingsNative::HasFeature(
- wxSystemFeature index
-)
+bool wxSystemSettingsNative::HasFeature( wxSystemFeature index )
{
switch (index)
{
case wxSYS_CAN_ICONIZE_FRAME:
- return TRUE;
+ return true;
case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
- return FALSE;
-
- default:
- return FALSE;
+ return false;
}
- return FALSE;
+
+ return false;
}
::WinDestroyWindow((HWND)m_hStaticValue);
} // end of wxSlider::~wxSlider
-void wxSlider::AdjustSubControls(
- int nX
-, int nY
-, int nWidth
-, int nHeight
-, int nSizeFlags
-)
+void wxSlider::AdjustSubControls( int nX,
+ int nY,
+ int nWidth,
+ int nHeight,
+ int WXUNUSED(nSizeFlags) )
{
int nXOffset = nX;
int nYOffset = nY;
lMsStyle |= SLS_RIBBONSTRIP;
m_nPageSize = ((nMaxValue - nMinValue)/10);
- vSlData.usScale1Increments = m_nPageSize;
- vSlData.usScale2Increments = m_nPageSize;
-
- HWND hScrollBar = ::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
- ,WC_SLIDER // Window class
- ,(PSZ)wxBuffer // Initial Text
- ,(ULONG)lMsStyle // Style flags
- ,0L, 0L, 0L, 0L // Origin -- 0 size
- ,(HWND)GetHwndOf(pParent) // owner window handle (same as parent
- ,HWND_BOTTOM // initial z position
- ,(HMENU)m_windowId // Window identifier
- ,&vSlData // Slider control data
- ,NULL // no Presentation parameters
- );
+ vSlData.usScale1Increments = (USHORT)m_nPageSize;
+ vSlData.usScale2Increments = (USHORT)m_nPageSize;
+
+ HWND hScrollBar = ::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
+ ,WC_SLIDER // Window class
+ ,(PSZ)wxBuffer // Initial Text
+ ,(ULONG)lMsStyle // Style flags
+ ,0L, 0L, 0L, 0L // Origin -- 0 size
+ ,(HWND)GetHwndOf(pParent) // owner window handle (same as parent
+ ,HWND_BOTTOM // initial z position
+ ,(HMENU)m_windowId // Window identifier
+ ,&vSlData // Slider control data
+ ,NULL // no Presentation parameters
+ );
m_nRangeMax = nMaxValue;
m_nRangeMin = nMinValue;
);
} // end of wxSlider::OnCtlColor
-bool wxSlider::OS2OnScroll(
- int WXUNUSED(nOrientation)
-, WXWORD wParam
-, WXWORD wPos
-, WXHWND hControl
-)
+bool wxSlider::OS2OnScroll( int WXUNUSED(nOrientation),
+ WXWORD wParam,
+ WXWORD WXUNUSED(wPos),
+ WXHWND WXUNUSED(hControl) )
{
- wxEventType eScrollEvent = wxEVT_NULL;
+ wxEventType eScrollEvent = wxEVT_NULL;
switch (wParam)
{
return false;
}
- int nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
- ,SLM_QUERYSLIDERINFO
- ,MPFROM2SHORT( SMA_SHAFTDIMENSIONS
- ,SMA_RANGEVALUE
- )
- ,(MPARAM)0
- )
- );
+ int nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
+ , SLM_QUERYSLIDERINFO
+ , MPFROM2SHORT( SMA_SHAFTDIMENSIONS, SMA_RANGEVALUE )
+ , (MPARAM)0
+ )
+ );
m_dPixelToRange = (double)(nPixelRange - m_nThumbLength)/(double)(m_nRangeMax - m_nRangeMin);
- int nNewPos = 0;
- int nPixelPos = SHORT1FROMMR(::WinSendMsg( GetHwnd()
- ,SLM_QUERYSLIDERINFO
- ,MPFROM2SHORT( SMA_SLIDERARMPOSITION
- ,SMA_RANGEVALUE
- )
- ,(MPARAM)0
- )
- );
+ int nNewPos = 0;
+ int nPixelPos = SHORT1FROMMR(::WinSendMsg( GetHwnd()
+ , SLM_QUERYSLIDERINFO
+ , MPFROM2SHORT( SMA_SLIDERARMPOSITION, SMA_RANGEVALUE )
+ , (MPARAM)0
+ )
+ );
+
nNewPos = (int)(nPixelPos/m_dPixelToRange);
if (nNewPos > (m_nRangeMax - m_nRangeMin)/2)
nNewPos++;
}
SetValue(nNewPos);
- wxScrollEvent vEvent( eScrollEvent
- ,m_windowId
- );
+ wxScrollEvent vEvent( eScrollEvent, m_windowId );
vEvent.SetPosition(nNewPos);
vEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(vEvent);
- wxCommandEvent vCevent( wxEVT_COMMAND_SLIDER_UPDATED
- ,GetId()
- );
+ wxCommandEvent vCevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() );
vCevent.SetInt(nNewPos);
vCevent.SetEventObject(this);
return (GetEventHandler()->ProcessEvent(vCevent));
} // end of wxSlider::OS2OnScroll
-void wxSlider::SetLineSize(
- int nLineSize
-)
+void wxSlider::SetLineSize( int nLineSize )
{
m_nLineSize = nLineSize;
} // end of wxSlider::SetLineSize
-void wxSlider::SetPageSize(
- int nPageSize
-)
+void wxSlider::SetPageSize( int nPageSize )
{
m_nPageSize = nPageSize;
} // end of wxSlider::SetPageSize
} // end of wxSlider::SetTick
// For trackbars only
-void wxSlider::SetTickFreq(
- int n
-, int nPos
-)
+void wxSlider::SetTickFreq( int n, int WXUNUSED(nPos) )
{
- SLDCDATA vSlData;
- WNDPARAMS vWndParams;
- int nPixelPos;
- int i;
+ SLDCDATA vSlData;
+ WNDPARAMS vWndParams;
+ int nPixelPos;
+ int i;
vSlData.cbSize = sizeof(SLDCDATA);
if (m_windowStyle & wxSL_AUTOTICKS)
vSlData.usScale1Spacing = 0;
vSlData.usScale2Spacing = 0;
}
- vSlData.usScale1Increments = (m_nRangeMax - m_nRangeMin)/n;
- vSlData.usScale2Increments = (m_nRangeMax - m_nRangeMin)/n;
+ vSlData.usScale1Increments = (USHORT)((m_nRangeMax - m_nRangeMin)/n);
+ vSlData.usScale2Increments = (USHORT)((m_nRangeMax - m_nRangeMin)/n);
vWndParams.fsStatus = WPM_CTLDATA;
vWndParams.cchText = 0L;
return TRUE;
}
-bool wxSound::DoPlay(unsigned flags) const
+bool wxSound::DoPlay(unsigned WXUNUSED(flags)) const
{
- if (!IsOk())
- return FALSE;
+ if (!IsOk())
+ return false;
+
// TODO:
/*
- return ( ::PlaySound((LPCTSTR)m_waveData, NULL, SND_MEMORY |
- SND_NODEFAULT | (async ? SND_ASYNC : SND_SYNC) | (looped ? (SND_LOOP | SND_ASYNC) : 0)) != 0 );
+ return ( ::PlaySound((LPCTSTR)m_waveData, NULL, SND_MEMORY |
+ SND_NODEFAULT | (async ? SND_ASYNC : SND_SYNC) | (looped ? (SND_LOOP | SND_ASYNC) : 0)) != 0 );
*/
- return FALSE;
+ return false;
}
bool wxSound::Free()
{
- if (m_waveData)
- {
+ if (m_waveData)
+ {
// HGLOBAL waveData = ::GlobalHandle(m_waveData);
// TODO:
return TRUE;
}
*/
- }
- return FALSE;
+ }
+ return false;
}
-
// 24x20 which is the size of the buttons and the borders.
// Also we have no horizontal spin buttons.
//
- return (wxSize(24,20));
+ wxSize best(24,20);
+ return best;
} // end of wxSpinButton::DoGetBestSize
// ----------------------------------------------------------------------------
return ((int)lVal);
} // end of wxSpinButton::GetValue
-bool wxSpinButton::OS2OnScroll(
- int nOrientation
-, WXWORD wParam
-, WXWORD wPos
-, WXHWND hControl
-)
+bool wxSpinButton::OS2OnScroll( int WXUNUSED(nOrientation),
+ WXWORD WXUNUSED(wParam),
+ WXWORD wPos,
+ WXHWND hControl )
{
- wxCHECK_MSG(hControl, FALSE, wxT("scrolling what?") )
+ wxCHECK_MSG(hControl, false, wxT("scrolling what?") )
- wxSpinEvent vEvent( wxEVT_SCROLL_THUMBTRACK
- ,m_windowId
- );
- int nVal = (int)wPos; // cast is important for negative values!
+ wxSpinEvent vEvent( wxEVT_SCROLL_THUMBTRACK, m_windowId );
+ int nVal = (int)wPos; // cast is important for negative values!
vEvent.SetPosition(nVal);
vEvent.SetEventObject(this);
return(GetEventHandler()->ProcessEvent(vEvent));
} // end of wxSpinButton::OS2OnScroll
-bool wxSpinButton::OS2Command(
- WXUINT uCmd
-, WXWORD wId
-)
+bool wxSpinButton::OS2Command( WXUINT WXUNUSED(uCmd),
+ WXWORD WXUNUSED(wId) )
{
- return FALSE;
+ return false;
} // end of wxSpinButton::OS2Command
void wxSpinButton::SetRange(
// construction
// ----------------------------------------------------------------------------
-bool wxSpinCtrl::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxString& rsValue
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, int nMin
-, int nMax
-, int nInitial
-, const wxString& rsName
-)
+bool wxSpinCtrl::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxString& WXUNUSED(rsValue),
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ int nMin,
+ int nMax,
+ int nInitial,
+ const wxString& rsName )
{
SWP vSwp;
rEvent.Skip();
} // end of wxSpinCtrl::OnSetFocus
-bool wxSpinCtrl::ProcessTextCommand(
- WXWORD wCmd
-, WXWORD wId
-)
+bool wxSpinCtrl::ProcessTextCommand( WXWORD wCmd,
+ WXWORD WXUNUSED(wId) )
{
switch (wCmd)
{
case SPBN_CHANGE:
{
- wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED
- ,GetId()
- );
+ wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED, GetId() );
vEvent.SetEventObject(this);
- wxString sVal = wxGetWindowText(m_hWndBuddy);
+ wxString sVal = wxGetWindowText(m_hWndBuddy);
vEvent.SetString(sVal);
vEvent.SetInt(GetValue());
case SPBN_SETFOCUS:
case SPBN_KILLFOCUS:
{
- wxFocusEvent vEvent( wCmd == EN_KILLFOCUS ? wxEVT_KILL_FOCUS : wxEVT_SET_FOCUS
- ,m_windowId
- );
+ wxFocusEvent vEvent( wCmd == EN_KILLFOCUS ? wxEVT_KILL_FOCUS : wxEVT_SET_FOCUS
+ ,m_windowId
+ );
vEvent.SetEventObject(this);
return(GetEventHandler()->ProcessEvent(vEvent));
// wxStaticBitmap
// ---------------------------------------------------------------------------
-bool wxStaticBitmap::Create(
- wxWindow* pParent
-, wxWindowID nId
-, const wxGDIImage& rBitmap
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxString& rName
-)
+bool wxStaticBitmap::Create( wxWindow* pParent,
+ wxWindowID nId,
+ const wxGDIImage& rBitmap,
+ const wxPoint& rPos,
+ const wxSize& WXUNUSED(rSize),
+ long lStyle,
+ const wxString& rName )
{
ERRORID vError;
wxString sError;
{
vError = ::WinGetLastError(wxGetInstance());
sError = wxPMErrorToStr(vError);
- return FALSE;
+ return false;
}
wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static bitmap") );
m_pImage = ConvertImage(rBitmap);
SubclassWin(m_hWnd);
SetSize(nX, nY, m_pImage->GetWidth(), m_pImage->GetHeight());
- return(TRUE);
+ return true;
} // end of wxStaticBitmap::Create
bool wxStaticBitmap::ImageIsOk() const
UnsubclassWin();
}
-bool wxTabCtrl::OS2OnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
+bool wxTabCtrl::OS2OnNotify(int idCtrl,
+ WXLPARAM WXUNUSED(lParam),
+ WXLPARAM *WXUNUSED(result) )
{
wxTabEvent event(wxEVT_NULL, m_windowId);
wxEventType eventType = wxEVT_NULL;
bool wxTabCtrl::DeleteAllItems()
{
// TODO
- return FALSE;
+ return false;
}
// Delete an item
-bool wxTabCtrl::DeleteItem(int item)
+bool wxTabCtrl::DeleteItem(int WXUNUSED(item))
{
// TODO
- return FALSE;
+ return false;
}
// Get the selection
}
// Get the rect corresponding to the tab
-bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const
+bool wxTabCtrl::GetItemRect(int WXUNUSED(item),
+ wxRect& WXUNUSED(wxrect)) const
{
// TODO
- return FALSE;
+ return false;
}
// Get the number of rows
}
// Get the item text
-wxString wxTabCtrl::GetItemText(int item) const
+wxString wxTabCtrl::GetItemText(int WXUNUSED(item)) const
{
// TODO
- return wxString(wxEmptyString);
+ return wxEmptyString;
}
// Get the item image
-int wxTabCtrl::GetItemImage(int item) const
+int wxTabCtrl::GetItemImage(int WXUNUSED(item)) const
{
// TODO
return 0;
}
// Get the item data
-void* wxTabCtrl::GetItemData(int item) const
+void* wxTabCtrl::GetItemData(int WXUNUSED(item)) const
{
// TODO
return NULL;
}
// Hit test
-int wxTabCtrl::HitTest(const wxPoint& pt, long& flags)
+int wxTabCtrl::HitTest(const wxPoint& WXUNUSED(pt), long& WXUNUSED(flags))
{
// TODO
return 0;
}
// Insert an item
-bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data)
+bool wxTabCtrl::InsertItem(int WXUNUSED(item),
+ const wxString& WXUNUSED(text),
+ int WXUNUSED(imageId),
+ void* WXUNUSED(data))
{
// TODO
- return FALSE;
+ return false;
}
// Set the selection
-int wxTabCtrl::SetSelection(int item)
+int wxTabCtrl::SetSelection(int WXUNUSED(item))
{
// TODO
return 0;
}
// Set the image list
-void wxTabCtrl::SetImageList(wxImageList* imageList)
+void wxTabCtrl::SetImageList(wxImageList* WXUNUSED(imageList))
{
// TODO
}
// Set the text for an item
-bool wxTabCtrl::SetItemText(int item, const wxString& text)
+bool wxTabCtrl::SetItemText(int WXUNUSED(item), const wxString& WXUNUSED(text))
{
// TODO
- return FALSE;
+ return false;
}
// Set the image for an item
-bool wxTabCtrl::SetItemImage(int item, int image)
+bool wxTabCtrl::SetItemImage(int WXUNUSED(item), int WXUNUSED(image))
{
// TODO
- return FALSE;
+ return false;
}
// Set the data for an item
-bool wxTabCtrl::SetItemData(int item, void* data)
+bool wxTabCtrl::SetItemData(int WXUNUSED(item), void* WXUNUSED(data))
{
// TODO
- return FALSE;
+ return false;
}
// Set the size for a fixed-width tab control
-void wxTabCtrl::SetItemSize(const wxSize& size)
+void wxTabCtrl::SetItemSize(const wxSize& WXUNUSED(size))
{
// TODO
}
// Set the padding between tabs
-void wxTabCtrl::SetPadding(const wxSize& padding)
+void wxTabCtrl::SetPadding(const wxSize& WXUNUSED(padding))
{
// TODO
}
// Tab event
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
-wxTabEvent::wxTabEvent(wxEventType commandType, int id):
- wxCommandEvent(commandType, id)
+wxTabEvent::wxTabEvent(wxEventType commandType, int id)
+ :wxCommandEvent(commandType, id)
{
}
-
-
#include "wx/log.h"
#endif
+#include "wx/app.h"
+
#if wxUSE_CLIPBOARD
- #include "wx/app.h"
#include "wx/clipbrd.h"
#endif
// Editing
// ----------------------------------------------------------------------------
-void wxTextCtrl::Replace(
- long lFrom
-, long lTo
-, const wxString& rsValue
-)
+void wxTextCtrl::Replace( long lFrom,
+ long lTo,
+ const wxString& rsValue )
{
#if wxUSE_CLIPBOARD
- HWND hWnd = GetHwnd();
+ HWND hWnd = GetHwnd();
//
// Set selection and remove it
else
::WinSendMsg(hWnd, EM_PASTE, (MPARAM)0, (MPARAM)0);
#else
+ wxUnusedVar(lFrom);
+ wxUnusedVar(lTo);
+ wxUnusedVar(rsValue);
wxFAIL_MSG("wxTextCtrl::Replace not implemented if wxUSE_CLIPBOARD is 0.");
#endif
} // end of wxTextCtrl::Replace
return true;
} // end of wxTextCtrl::PositionToXY
-void wxTextCtrl::ShowPosition(
- long lPos
-)
+void wxTextCtrl::ShowPosition( long WXUNUSED(lPos) )
{
- HWND hWnd = GetHwnd();
- long lCurrentLineLineNo = 0L;
+ HWND hWnd = GetHwnd();
+ long lCurrentLineLineNo = 0L;
// To scroll to a position, we pass the number of lines and characters
// to scroll *by*. This means that we need to:
}
} // end of wxTextCtrl::ShowPosition
-int wxTextCtrl::GetLineLength(
- long lLineNo
-) const
+int wxTextCtrl::GetLineLength( long WXUNUSED(lLineNo) ) const
{
- long lLen = 0L;
+ long lLen = 0L;
if (m_bIsMLE)
+ {
lLen = (long)::WinSendMsg(GetHwnd(), MLM_QUERYLINELENGTH, 0, 0);
+ }
else
{
- WNDPARAMS vParams;
+ WNDPARAMS vParams;
vParams.fsStatus = WPM_CCHTEXT;
if (::WinSendMsg( GetHwnd()
}
} // end of wxTextCtrl::OnDropFiles
-WXHBRUSH wxTextCtrl::OnCtlColor(
- WXHDC hWxDC
-, WXHWND hWnd
-, WXUINT uCtlColor
-, WXUINT uMessage
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+WXHBRUSH wxTextCtrl::OnCtlColor( WXHDC hWxDC,
+ WXHWND WXUNUSED(hWnd),
+ WXUINT WXUNUSED(uCtlColor),
+ WXUINT WXUNUSED(uMessage),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam) )
{
- HPS hPS = (HPS)hWxDC;
- wxColour vColBack = GetBackgroundColour();
- wxColour vColFore = GetForegroundColour();
- wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()
- ,wxSOLID
- );
+ HPS hPS = (HPS)hWxDC;
+ wxColour vColBack = GetBackgroundColour();
+ wxColour vColFore = GetForegroundColour();
+ wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( vColBack, wxSOLID );
if (m_bUseCtl3D)
{
// standard handlers for standard edit menu events
// ----------------------------------------------------------------------------
-void wxTextCtrl::OnCut(
- wxCommandEvent& rEvent
-)
+void wxTextCtrl::OnCut( wxCommandEvent& WXUNUSED(rEvent) )
{
Cut();
} // end of wxTextCtrl::OnCut
-void wxTextCtrl::OnCopy(
- wxCommandEvent& rEvent
-)
+void wxTextCtrl::OnCopy( wxCommandEvent& WXUNUSED(rEvent) )
{
Copy();
} // end of wxTextCtrl::OnCopy
-void wxTextCtrl::OnPaste(
- wxCommandEvent& rEvent
-)
+void wxTextCtrl::OnPaste( wxCommandEvent& WXUNUSED(rEvent) )
{
Paste();
} // end of wxTextCtrl::OnPaste
-void wxTextCtrl::OnUndo(
- wxCommandEvent& rEvent
-)
+void wxTextCtrl::OnUndo( wxCommandEvent& WXUNUSED(rEvent) )
{
Undo();
} // end of wxTextCtrl::OnUndo
-void wxTextCtrl::OnRedo(
- wxCommandEvent& rEvent
-)
+void wxTextCtrl::OnRedo( wxCommandEvent& WXUNUSED(rEvent) )
{
Redo();
} // end of wxTextCtrl::OnRedo
-void wxTextCtrl::OnDelete(
- wxCommandEvent& rEvent
-)
+void wxTextCtrl::OnDelete( wxCommandEvent& WXUNUSED(rEvent) )
{
- long lFrom;
- long lTo;
+ long lFrom, lTo;
+
+ GetSelection( &lFrom, &lTo );
- GetSelection( &lFrom
- ,&lTo
- );
if (lFrom != -1 && lTo != -1)
- Remove( lFrom
- ,lTo
- );
+ Remove( lFrom, lTo );
} // end of wxTextCtrl::OnDelete
-void wxTextCtrl::OnSelectAll(
- wxCommandEvent& rEvent
-)
+void wxTextCtrl::OnSelectAll( wxCommandEvent& WXUNUSED(rEvent) )
{
SetSelection(-1, -1);
} // end of wxTextCtrl::OnSelectAll
-void wxTextCtrl::OnUpdateCut(
- wxUpdateUIEvent& rEvent
-)
+void wxTextCtrl::OnUpdateCut( wxUpdateUIEvent& rEvent )
{
rEvent.Enable(CanCut());
} // end of wxTextCtrl::OnUpdateCut
-void wxTextCtrl::OnUpdateCopy(
- wxUpdateUIEvent& rEvent
-)
+void wxTextCtrl::OnUpdateCopy( wxUpdateUIEvent& rEvent )
{
rEvent.Enable(CanCopy());
} // end of wxTextCtrl::OnUpdateCopy
-void wxTextCtrl::OnUpdatePaste(
- wxUpdateUIEvent& rEvent
-)
+void wxTextCtrl::OnUpdatePaste( wxUpdateUIEvent& rEvent )
{
rEvent.Enable(CanPaste());
} // end of wxTextCtrl::OnUpdatePaste
-void wxTextCtrl::OnUpdateUndo(
- wxUpdateUIEvent& rEvent
-)
+void wxTextCtrl::OnUpdateUndo( wxUpdateUIEvent& rEvent )
{
rEvent.Enable(CanUndo());
} // end of wxTextCtrl::OnUpdateUndo
-void wxTextCtrl::OnUpdateRedo(
- wxUpdateUIEvent& rEvent
-)
+void wxTextCtrl::OnUpdateRedo( wxUpdateUIEvent& rEvent )
{
rEvent.Enable(CanRedo());
} // end of wxTextCtrl::OnUpdateRedo
-void wxTextCtrl::OnUpdateDelete(
- wxUpdateUIEvent& rEvent
-)
+void wxTextCtrl::OnUpdateDelete( wxUpdateUIEvent& rEvent )
{
- long lFrom;
- long lTo;
+ long lFrom, lTo;
- GetSelection( &lFrom
- ,&lTo
- );
+ GetSelection( &lFrom, &lTo );
rEvent.Enable( lFrom != -1L && lTo != -1L && lFrom != lTo && IsEditable()) ;
} // end of wxTextCtrl::OnUpdateDelete
-void wxTextCtrl::OnUpdateSelectAll(
- wxUpdateUIEvent& rEvent
-)
+void wxTextCtrl::OnUpdateSelectAll( wxUpdateUIEvent& rEvent )
{
rEvent.Enable(GetLastPosition() > 0);
} // end of wxTextCtrl::OnUpdateSelectAll
-bool wxTextCtrl::SetBackgroundColour(
- const wxColour& rColour
-)
+bool wxTextCtrl::SetBackgroundColour( const wxColour& rColour )
{
if (m_bIsMLE)
::WinSendMsg(GetHwnd(), MLM_SETBACKCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
return true;
} // end of wxTextCtrl::SetBackgroundColour
-bool wxTextCtrl::SetForegroundColour(
- const wxColour& rColour
-)
+bool wxTextCtrl::SetForegroundColour( const wxColour& rColour )
{
if (m_bIsMLE)
::WinSendMsg(GetHwnd(), MLM_SETTEXTCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
return true;
} // end of wxTextCtrl::SetForegroundColour
-bool wxTextCtrl::SetStyle(
- long lStart
-, long lEnd
-, const wxTextAttr& rStyle
-)
+bool wxTextCtrl::SetStyle( long lStart,
+ long lEnd,
+ const wxTextAttr& WXUNUSED(rStyle) )
{
- HWND hWnd = GetHwnd();
+ HWND hWnd = GetHwnd();
if (lStart > lEnd)
{
- long lTmp = lStart;
+ long lTmp = lStart;
lStart = lEnd;
lEnd = lTmp;
// We can only change the format of the selection, so select the range we
// want and restore the old selection later
//
- long lStartOld;
- long lEndOld;
+ long lStartOld, lEndOld;
- GetSelection( &lStartOld
- ,&lEndOld
- );
+ GetSelection( &lStartOld, &lEndOld );
//
// But do we really have to change the selection?
//
- bool bChangeSel = lStart != lStartOld ||
- lEnd != lEndOld;
+ bool bChangeSel = lStart != lStartOld ||
+ lEnd != lEndOld;
if (bChangeSel)
{
//
return true;
} // end of wxTextCtrl::SetStyle
-
// OS2 substitute for Tls pointer the current parent thread object
wxThread* m_pThread; // pointer to the wxWidgets thread object
-// if it's FALSE, some secondary thread is holding the GUI lock
-static bool gs_bGuiOwnedByMainThread = TRUE;
+// if it's false, some secondary thread is holding the GUI lock
+static bool gs_bGuiOwnedByMainThread = true;
// critical section which controls access to all GUI functions: any secondary
// thread (i.e. except the main one) must enter this crit section before doing
static size_t gs_nWaitingForGui = 0;
// are we waiting for a thread termination?
-static bool gs_bWaitingForThread = FALSE;
+static bool gs_bWaitingForThread = false;
// ============================================================================
// OS/2 implementation of thread and related classes
// (Calls to DosRequestMutexSem and DosReleaseMutexSem can be nested, but
// the request count for a semaphore cannot exceed 65535. If an attempt is
// made to exceed this number, ERROR_TOO_MANY_SEM_REQUESTS is returned.)
-wxMutexInternal::wxMutexInternal(
- wxMutexType WXUNUSED(eMutexType)
-)
+wxMutexInternal::wxMutexInternal(wxMutexType WXUNUSED(eMutexType))
{
- APIRET ulrc;
-
- ulrc = ::DosCreateMutexSem(NULL, &m_vMutex, 0L, FALSE);
+ APIRET ulrc = ::DosCreateMutexSem(NULL, &m_vMutex, 0L, FALSE);
if (ulrc != 0)
{
wxLogSysError(_("Can not create mutex."));
if ( pThread->m_internal->GetState() == STATE_EXITED )
{
dwRet = (DWORD)-1;
- bWasCancelled = TRUE;
+ bWasCancelled = true;
}
else // do run thread
{
}
}
-bool wxThreadInternal::Create(
- wxThread* pThread
-, unsigned int uStackSize
-)
+bool wxThreadInternal::Create( wxThread* pThread,
+ unsigned int uStackSize)
{
- int tid;
+ int tid;
if (!uStackSize)
- uStackSize = 131072;
+ uStackSize = 131072;
+
pThread->m_critsect.Enter();
tid = _beginthread(wxThreadInternal::OS2ThreadStart,
NULL, uStackSize, pThread);
{
wxLogSysError(_("Can't create thread"));
- return FALSE;
+ return false;
}
m_hThread = tid;
if (m_nPriority != WXTHREAD_DEFAULT_PRIORITY)
SetPriority(m_nPriority);
}
- return(TRUE);
+ return true;
}
bool wxThreadInternal::Suspend()
{
- ULONG ulrc = ::DosSuspendThread(m_hThread);
+ ULONG ulrc = ::DosSuspendThread(m_hThread);
if (ulrc != 0)
{
wxLogSysError(_("Can not suspend thread %lu"), m_hThread);
- return FALSE;
+ return false;
}
m_eState = STATE_PAUSED;
- return TRUE;
+
+ return true;
}
bool wxThreadInternal::Resume()
{
- ULONG ulrc = ::DosResumeThread(m_hThread);
+ ULONG ulrc = ::DosResumeThread(m_hThread);
if (ulrc != 0)
{
wxLogSysError(_("Can not resume thread %lu"), m_hThread);
- return FALSE;
+ return false;
}
// don't change the state from STATE_EXITED because it's special and means
m_eState = STATE_RUNNING;
}
- return TRUE;
+ return true;
}
// static functions
bool wxThread::IsMain()
{
- PTIB ptib;
- PPIB ppib;
+ PTIB ptib;
+ PPIB ppib;
::DosGetInfoBlocks(&ptib, &ppib);
if (ptib->tib_ptib2->tib2_ultid == s_ulIdMainThread)
- return TRUE;
- return FALSE;
+ return true;
+
+ return false;
}
#ifdef Yield
// we might need to resume the thread, but we might also not need to cancel
// it if it doesn't run yet
- bool shouldResume = FALSE,
- shouldCancel = TRUE,
- isRunning = FALSE;
+ bool shouldResume = false,
+ shouldCancel = true,
+ isRunning = false;
// check if the thread already started to run
{
Resume(); // it knows about STATE_EXITED special case
- shouldCancel = FALSE;
- isRunning = TRUE;
+ shouldCancel = false;
+ isRunning = true;
- // shouldResume is correctly set to FALSE here
+ // shouldResume is correctly set to false here
}
else
{
if ( shouldResume )
Resume();
- TID hThread = m_internal->GetHandle();
+ TID hThread = m_internal->GetHandle();
if ( isRunning || IsRunning())
{
if (IsMain())
{
// set flag for wxIsWaitingForThread()
- gs_bWaitingForThread = TRUE;
+ gs_bWaitingForThread = true;
}
// ask the thread to terminate
if ( IsMain() )
{
- gs_bWaitingForThread = FALSE;
+ gs_bWaitingForThread = false;
}
}
return wxTHREAD_NO_ERROR;
}
-void wxThread::Exit(
- ExitCode pStatus
-)
+void wxThread::Exit(ExitCode WXUNUSED(pStatus))
{
delete this;
_endthread();
gs_pCritsectGui = new wxCriticalSection();
gs_pCritsectGui->Enter();
- PTIB ptib;
- PPIB ppib;
+ PTIB ptib;
+ PPIB ppib;
::DosGetInfoBlocks(&ptib, &ppib);
s_ulIdMainThread = ptib->tib_ptib2->tib2_ultid;
- return TRUE;
+ return true;
}
void wxThreadModule::OnExit()
if ( wxThread::IsMain() )
{
- gs_bGuiOwnedByMainThread = FALSE;
+ gs_bGuiOwnedByMainThread = false;
}
else
{
{
gs_pCritsectGui->Enter();
- gs_bGuiOwnedByMainThread = TRUE;
+ gs_bGuiOwnedByMainThread = true;
}
//else: already have it, nothing to do
}
{
wxToolBarTool* pTool = (wxToolBarTool *)node->GetData();
- if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsEmpty())
+ if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty())
{
//
// Set the height according to the font and the border size
DrawTool(vDc, pTool);
if (pTool->IsSeparator())
{
- wxPen vDarkGreyPen( wxColour(85, 85, 85)
- ,1
- ,wxSOLID
- );
- int nX;
- int nY;
- int nHeight = 0;
- int nWidth = 0;
+ wxColour gray85(85, 85, 85);
+ wxPen vDarkGreyPen( gray85, 1, wxSOLID );
+ int nX;
+ int nY;
+ int nHeight = 0;
+ int nWidth = 0;
vDc.SetPen(vDarkGreyPen);
if (HasFlag(wxTB_TEXT))
);
m_nCurrentTool = pTool->GetId();
OnMouseEnter(m_nCurrentTool);
- if (!pTool->GetShortHelp().IsEmpty())
+ if (!pTool->GetShortHelp().empty())
{
if (m_pToolTip)
delete m_pToolTip;
, wxToolBarToolBase* pToolBase
)
{
- wxToolBarTool* pTool = (wxToolBarTool *)pToolBase;
- wxPen vDarkGreyPen( wxColour( 85,85,85 )
- ,1
- ,wxSOLID
- );
- wxPen vWhitePen( wxT("WHITE")
- ,1
- ,wxSOLID
- );
- wxPen vBlackPen( wxT("BLACK")
- ,1
- ,wxSOLID
- );
- wxBitmap vBitmap = pTool->GetNormalBitmap();
- bool bUseMask = FALSE;
- wxMask* pMask = NULL;
+ wxToolBarTool* pTool = (wxToolBarTool *)pToolBase;
+ wxColour gray85( 85,85,85 );
+ wxPen vDarkGreyPen( gray85, 1, wxSOLID );
+ wxBitmap vBitmap = pTool->GetNormalBitmap();
+ bool bUseMask = FALSE;
+ wxMask* pMask = NULL;
PrepareDC(rDc);
LowerTool(pTool, FALSE);
if (!pTool->IsEnabled())
{
- wxColour vColor(wxT("GREY"));
+ wxColour vColor(wxT("GREY"));
rDc.SetTextForeground(vColor);
if (!pTool->GetDisabledBitmap().Ok())
}
else
{
- wxColour vColor(wxT("BLACK"));
-
- rDc.SetTextForeground(vColor);
+ rDc.SetTextForeground(*wxBLACK);
rDc.DrawBitmap( vBitmap
,pTool->m_vX
,pTool->m_vY
}
else
{
- wxColour vColor(wxT("GREY"));
+ wxColour vColor(wxT("GREY"));
LowerTool(pTool);
rDc.SetTextForeground(vColor);
// private helpers
// ----------------------------------------------------------------------------
-void wxToolBar::LowerTool (
- wxToolBarToolBase* pToolBase
-, bool bLower
-)
+void wxToolBar::LowerTool ( wxToolBarToolBase* pToolBase,
+ bool bLower )
{
wxToolBarTool* pTool = (wxToolBarTool*)pToolBase;
- wxCoord vX;
- wxCoord vY;
- wxCoord vWidth;
- wxCoord vHeight;
- wxPen vDarkGreyPen( wxColour(85, 85, 85)
- ,1
- ,wxSOLID
- );
- wxPen vWhitePen( wxT("WHITE")
- ,1
- ,wxSOLID
- );
- wxPen vClearPen( GetBackgroundColour()
- ,1
- ,wxSOLID
- );
- wxClientDC vDC(this);
+ wxCoord vX;
+ wxCoord vY;
+ wxCoord vWidth;
+ wxCoord vHeight;
+ wxColour gray85( 85,85,85 );
+ wxPen vDarkGreyPen( gray85, 1, wxSOLID );
+ wxPen vClearPen( GetBackgroundColour(), 1, wxSOLID );
+ wxClientDC vDC(this);
if (!pTool)
return;
if (!HasFlag(wxTB_FLAT))
return;
- if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsEmpty())
+ if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty())
{
if (pTool->GetWidth() > m_vTextX)
{
}
if (bLower)
{
- vDC.SetPen(vWhitePen);
+ vDC.SetPen(*wxWHITE_PEN);
vDC.DrawLine(vX + vWidth, vY + vHeight, vX, vY + vHeight);
vDC.DrawLine(vX + vWidth, vY, vX + vWidth, vY + vHeight);
vDC.SetPen(vDarkGreyPen);
}
} // end of WinGuiBase_CToolBarTool::LowerTool
-void wxToolBar::RaiseTool (
- wxToolBarToolBase* pToolBase
-, bool bRaise
-)
+void wxToolBar::RaiseTool ( wxToolBarToolBase* pToolBase,
+ bool bRaise )
{
- wxToolBarTool* pTool = (wxToolBarTool*)pToolBase;
- wxCoord vX;
- wxCoord vY;
- wxCoord vWidth;
- wxCoord vHeight;
- wxPen vDarkGreyPen( wxColour(85, 85, 85)
- ,1
- ,wxSOLID
- );
- wxPen vWhitePen( wxT("WHITE")
- ,1
- ,wxSOLID
- );
- wxPen vClearPen( GetBackgroundColour()
- ,1
- ,wxSOLID
- );
- wxClientDC vDC(this);
+ wxToolBarTool* pTool = (wxToolBarTool*)pToolBase;
+ wxCoord vX;
+ wxCoord vY;
+ wxCoord vWidth;
+ wxCoord vHeight;
+ wxColour gray85( 85,85,85 );
+ wxPen vDarkGreyPen( gray85, 1, wxSOLID );
+ wxPen vClearPen( GetBackgroundColour(), 1, wxSOLID );
+ wxClientDC vDC(this);
if (!pTool)
return;
if (!HasFlag(wxTB_FLAT))
return;
- if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsEmpty())
+ if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty())
{
if (pTool->GetWidth() > m_vTextX)
{
vDC.SetPen(vDarkGreyPen);
vDC.DrawLine(vX + vWidth, vY + vHeight, vX, vY + vHeight);
vDC.DrawLine(vX + vWidth, vY, vX + vWidth, vY + vHeight);
- vDC.SetPen(vWhitePen);
+ vDC.SetPen(*wxWHITE_PEN);
vDC.DrawLine(vX, vY, vX + vWidth, vY);
vDC.DrawLine(vX, vY + vHeight, vX, vY);
}
return (WXHWND)hWndParent;
} // end of wxTopLevelWindowOS2::OS2GetParent
-bool wxTopLevelWindowOS2::CreateDialog(
- ULONG ulDlgTemplate
-, const wxString& rsTitle
-, const wxPoint& rPos
-, const wxSize& rSize
-)
+
+bool wxTopLevelWindowOS2::CreateDialog( ULONG ulDlgTemplate,
+ const wxString& WXUNUSED(rsTitle),
+ const wxPoint& rPos,
+ const wxSize& rSize )
{
wxWindow* pParent = GetParent();
wxActivateEvent vEvent(wxEVT_ACTIVATE, TRUE, m_windowId);
::WinQueryWindowPos(m_hFrame, &vSwp);
- m_bIconized = vSwp.fl & SWP_MINIMIZE;
+ m_bIconized = ( vSwp.fl & SWP_MINIMIZE ) == SWP_MINIMIZE ;
::WinQueryWindowPos(m_hWnd, &m_vSwpClient);
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)~0, 0);
::WinQueryWindowPos(m_hWnd, &vSwp);
HWND hWndParent = GetHwndOf(GetParent());
::WinQueryWindowPos(hWndParent, &vSwp);
- m_bIconized = vSwp.fl & SWP_MINIMIZE;
+ m_bIconized = (vSwp.fl & SWP_MINIMIZE)==SWP_MINIMIZE;
::WinEnableWindow(hWndParent, TRUE);
}
}
bool wxTopLevelWindowOS2::IsMaximized() const
{
-
::WinQueryWindowPos(m_hFrame, (PSWP)&m_vSwp);
- return (m_vSwp.fl & SWP_MAXIMIZE);
+ return (m_vSwp.fl & SWP_MAXIMIZE) == SWP_MAXIMIZE;
} // end of wxTopLevelWindowOS2::IsMaximized
void wxTopLevelWindowOS2::Iconize(
// wxTopLevelWindowOS2 fullscreen
// ----------------------------------------------------------------------------
-bool wxTopLevelWindowOS2::ShowFullScreen(
- bool bShow
-, long lStyle
-)
+bool wxTopLevelWindowOS2::ShowFullScreen( bool bShow,
+ long lStyle )
{
if (bShow)
{
if (IsFullScreen())
- return FALSE;
+ return false;
- m_bFsIsShowing = TRUE;
+ m_bFsIsShowing = true;
m_lFsStyle = lStyle;
//
//
// Decide which window lStyle flags to turn off
//
- LONG lNewStyle = m_lFsOldWindowStyle;
- LONG lOffFlags = 0;
+ LONG lNewStyle = m_lFsOldWindowStyle;
+ LONG lOffFlags = 0;
if (lStyle & wxFULLSCREEN_NOBORDER)
lOffFlags |= FCF_BORDER;
//
// Resize to the size of the desktop
//
- int nWidth;
- int nHeight;
- RECTL vRect = wxGetWindowRect(HWND_DESKTOP);
+ int nWidth;
+ int nHeight;
+ RECTL vRect = wxGetWindowRect(HWND_DESKTOP);
nWidth = vRect.xRight - vRect.xLeft;
nHeight = vRect.yTop - vRect.yBottom;
- SetSize( nWidth
- ,nHeight
- );
+ SetSize( nWidth, nHeight );
//
// Now flush the window style cache and actually go full-screen
,SWP_SIZE | SWP_MOVE
);
- wxSizeEvent vEvent( wxSize( nWidth
- ,nHeight
- )
- ,GetId()
- );
-
+ wxSize full( nWidth, nHeight );
+ wxSizeEvent vEvent( full, GetId() );
GetEventHandler()->ProcessEvent(vEvent);
- return TRUE;
+ return true;
}
else
{
if (!IsFullScreen())
- return FALSE;
+ return false;
- m_bFsIsShowing = FALSE;
+ m_bFsIsShowing = false;
Maximize(m_bFsIsMaximized);
::WinSetWindowULong( (HWND)GetHWND()
,QWL_STYLE
,m_vFsOldSize.height
,SWP_SIZE | SWP_MOVE
);
- return TRUE;
+ return true;
}
} // end of wxTopLevelWindowOS2::ShowFullScreen
#define PURE_32
-#ifndef __EMX__
-#include <upm.h>
-#include <netcons.h>
-#include <netbios.h>
+#if defined(__WATCOMC__)
+extern "C"
+{
+ #include <upm.h>
+}
+#elif !defined(__EMX__)
+ #include <upm.h>
+ #include <netcons.h>
+ #include <netbios.h>
#endif
static const wxChar WX_SECTION[] = _T("wxWidgets");
static const wxChar eHOSTNAME[] = _T("HostName");
-static const wxChar eUSERID[] = _T("UserId");
-static const wxChar eUSERNAME[] = _T("UserName");
// For the following functions we SHOULD fill in support
// for Windows-NT (which I don't know) as I assume it begin
}
// Get user ID e.g. jacs
-bool wxGetUserId(
- wxChar* zBuf
-, int nType
-)
+bool wxGetUserId(wxChar* zBuf, int nType)
{
-#if defined(__VISAGECPP__)
- long lrc;
+#if defined(__VISAGECPP__) || defined(__WATCOMC__)
// UPM procs return 0 on success
- lrc = U32ELOCU((unsigned char*)zBuf, (unsigned long *)&nType);
+ long lrc = U32ELOCU((PUCHAR)zBuf, (PULONG)&nType);
if (lrc == 0) return true;
#endif
return false;
}
-bool wxGetUserName(
- wxChar* zBuf
-, int nMaxSize
-)
+bool wxGetUserName( wxChar* zBuf, int nMaxSize )
{
#ifdef USE_NET_API
- wxGetUserId( zBuf
- ,nMaxSize
- );
+ wxGetUserId( zBuf, nMaxSize );
#else
wxStrncpy(zBuf, _T("Unknown User"), nMaxSize);
#endif
return true;
}
-int wxKill(
- long lPid
-, wxSignal eSig
-, wxKillError* peError
-, int flags
-)
+int wxKill(long lPid,
+ wxSignal WXUNUSED(eSig),
+ wxKillError* WXUNUSED(peError),
+ int WXUNUSED(flags))
{
return((int)::DosKillProcess(0, (PID)lPid));
}
}
// Shutdown or reboot the PC
-bool wxShutdown(wxShutdownFlags wFlags)
+bool wxShutdown(wxShutdownFlags WXUNUSED(wFlags))
{
// TODO
return false;
return putenv(buf) == 0;
#else // no way to set an env var
+ wxUnusedVar(variable);
+ wxUnusedVar(value);
return false;
#endif
}
}
-void wxAppTraits::InitializeGui(unsigned long &ulHab)
+void wxAppTraits::InitializeGui(unsigned long &WXUNUSED(ulHab))
{
}
-void wxAppTraits::TerminateGui(unsigned long ulHab)
+void wxAppTraits::TerminateGui(unsigned long WXUNUSED(ulHab))
{
}
wxStrcpy(wxBuffer, zHome);
wxUnix2DosFilename(wxBuffer);
#if wxUSE_UNICODE
- wxWCharBuffer retBuffer (wxBuffer);
+ wxWCharBuffer retBuffer (wxBuffer);
delete[] wxBuffer;
return retBuffer;
-#else
+#else
wxStrcpy(zHome, wxBuffer);
delete[] wxBuffer;
return zHome;
return (wxChar*)wxEmptyString; // No home known!
}
-wxString WXDLLEXPORT wxPMErrorToStr(
- ERRORID vError
-)
+wxString WXDLLEXPORT wxPMErrorToStr(ERRORID vError)
{
wxString sError;
// to be used by all X11 based ports.
struct wxEndProcessData;
-void wxHandleProcessTermination(wxEndProcessData *proc_data)
+void wxHandleProcessTermination(wxEndProcessData *WXUNUSED(proc_data))
{
// For now, just do nothing. To be filled in as needed.
}
#define PURE_32
#ifndef __EMX__
-#include <upm.h>
-#include <netcons.h>
-#include <netbios.h>
+ #include <upm.h>
+ #ifndef __WATCOMC__
+ #include <netcons.h>
+ #include <netbios.h>
+ #endif
#endif
#include <ctype.h>
DosExit(EXIT_PROCESS, 0);
}
- HWND hWnd; // window to send wxWM_PROC_TERMINATED to [not used]
- RESULTCODES vResultCodes;
- wxProcess* pHandler;
- ULONG ulExitCode; // the exit code of the process
- bool bState; // set to FALSE when the process finishes
+ HWND hWnd; // window to send wxWM_PROC_TERMINATED to [not used]
+ RESULTCODES vResultCodes;
+ wxProcess* pHandler;
+ ULONG ulExitCode; // the exit code of the process
+ bool bState; // set to false when the process finishes
};
-static ULONG wxExecuteThread(
- wxExecuteData* pData
-)
+static ULONG wxExecuteThread(wxExecuteData* pData)
{
- ULONG ulRc;
- PID vPidChild;
+ ULONG ulRc;
+ PID vPidChild;
// cout << "Executing thread: " << endl;
// window procedure of a hidden window which is created just to receive
// the notification message when a process exits
-MRESULT APIENTRY wxExecuteWindowCbk(
- HWND hWnd
-, ULONG ulMessage
-, MPARAM wParam
-, MPARAM lParam
-)
+MRESULT APIENTRY wxExecuteWindowCbk( HWND hWnd,
+ ULONG ulMessage,
+ MPARAM WXUNUSED(wParam),
+ MPARAM lParam)
{
if (ulMessage == wxWM_PROC_TERMINATED)
{
return 0;
}
-long wxExecute(
- const wxString& rCommand
-, int flags
-, wxProcess* pHandler
-)
+long wxExecute( const wxString& rCommand,
+ int flags,
+ wxProcess* pHandler)
{
- if (rCommand.IsEmpty())
+ if (rCommand.empty())
{
// cout << "empty command in wxExecute." << endl;
return 0;
);
}
-bool wxGetFullHostName(
- wxChar* zBuf
-, int nMaxSize
-)
+bool wxGetFullHostName( wxChar* zBuf,
+ int nMaxSize)
{
#if wxUSE_NET_API
char zServer[256];
strncpy(zBuf, zComputer, nMaxSize);
zBuf[nMaxSize] = _T('\0');
#else
+ wxUnusedVar(nMaxSize);
strcpy((char*)zBuf, "noname");
#endif
- return *zBuf ? TRUE : FALSE;
- return TRUE;
+ return *zBuf ? true : false;
}
-
::WinSendMsg(m_hWndScrollBarVert, SBM_SETPOS, (MPARAM)nPos, (MPARAM)NULL);
} // end of wxWindowOS2::SetScrollPos
-void wxWindowOS2::SetScrollbar(
- int nOrient
-, int nPos
-, int nThumbVisible
-, int nRange
-, bool WXUNUSED(bRefresh)
-)
+void wxWindowOS2::SetScrollbar( int nOrient,
+ int nPos,
+ int nThumbVisible,
+ int nRange,
+ bool WXUNUSED(bRefresh) )
{
HWND hWnd = GetHwnd();
int nOldRange = nRange - nThumbVisible;
vInfo.cb = sizeof(SBCDATA);
vInfo.posFirst = 0;
vInfo.posLast = (SHORT)nRange1;
- vInfo.posThumb = nPos;
+ vInfo.posThumb = (SHORT)nPos;
if (nOrient == wxHORIZONTAL )
{
}
} // end of wxWindowOS2::SetWindowStyleFlag
-WXDWORD wxWindowOS2::OS2GetStyle(
- long lFlags
-, WXDWORD* pdwExstyle
-) const
+WXDWORD wxWindowOS2::OS2GetStyle( long lFlags,
+ WXDWORD* WXUNUSED(pdwExstyle) ) const
{
WXDWORD dwStyle = 0L;
);
} // end of wxWindowOS2::DoSetSize
-void wxWindowOS2::DoSetClientSize(
- int nWidth
-, int nHeight
-)
+void wxWindowOS2::DoSetClientSize( int nWidth,
+ int nHeight )
{
- POINTL vPoint;
- int nActualWidth;
- int nActualHeight;
- wxWindow* pParent = (wxWindow*)GetParent();
- HWND hParentWnd = (HWND)0;
+ POINTL vPoint;
+ int nActualWidth;
+ int nActualHeight;
+ wxWindow* pParent = (wxWindow*)GetParent();
+ HWND hParentWnd = (HWND)0;
if (pParent)
hParentWnd = (HWND)pParent->GetHWND();
if (IsKindOf(CLASSINFO(wxFrame)))
{
- wxFrame* pFrame = wxDynamicCast(this, wxFrame);
- HWND hFrame = pFrame->GetFrame();
- RECTL vRect;
- RECTL vRect2;
- RECTL vRect3;
+ wxFrame* pFrame = wxDynamicCast(this, wxFrame);
+ HWND hFrame = pFrame->GetFrame();
+ RECTL vRect;
+ RECTL vRect2;
+ RECTL vRect3;
::WinQueryWindowRect(GetHwnd(), &vRect2);
::WinQueryWindowRect(hFrame, &vRect);
}
else
{
- int nX;
- int nY;
+ int nX;
+ int nY;
GetPosition(&nX, &nY);
nActualWidth = nWidth;
vPoint.x = nX;
vPoint.y = nY;
}
- DoMoveWindow( vPoint.x
- ,vPoint.y
- ,nActualWidth
- ,nActualHeight
- );
-
- wxSizeEvent vEvent( wxSize( nWidth
- ,nHeight
- )
- ,m_windowId
- );
+ DoMoveWindow( vPoint.x, vPoint.y, nActualWidth, nActualHeight );
+ wxSize size( nWidth, nHeight );
+ wxSizeEvent vEvent( size, m_windowId );
vEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::DoSetClientSize
return(vFontMetrics.lAveCharWidth);
} // end of wxWindowOS2::GetCharWidth
-void wxWindowOS2::GetTextExtent(
- const wxString& rString
-, int* pX
-, int* pY
-, int* pDescent
-, int* pExternalLeading
-, const wxFont* pTheFont
-) const
+void wxWindowOS2::GetTextExtent( const wxString& rString,
+ int* pX,
+ int* pY,
+ int* pDescent,
+ int* pExternalLeading,
+ const wxFont* WXUNUSED(pTheFont) ) const
{
- POINTL avPoint[TXTBOX_COUNT];
- POINTL vPtMin;
- POINTL vPtMax;
- int i;
- int l;
- FONTMETRICS vFM; // metrics structure
- BOOL bRc = FALSE;
- char* pStr;
- HPS hPS;
-
+ POINTL avPoint[TXTBOX_COUNT];
+ POINTL vPtMin;
+ POINTL vPtMax;
+ int i;
+ int l;
+ FONTMETRICS vFM; // metrics structure
+ BOOL bRc = FALSE;
+ char* pStr;
+ HPS hPS;
hPS = ::WinGetPS(GetHwnd());
#endif //wxUSE_ACCEL
} // end of wxWindowOS2::OS2TranslateMessage
-bool wxWindowOS2::OS2ShouldPreProcessMessage(
- WXMSG* pMsg
-)
+bool wxWindowOS2::OS2ShouldPreProcessMessage( WXMSG* WXUNUSED(pMsg) )
{
// preprocess all messages by default
- return TRUE;
+ return true;
} // end of wxWindowOS2::OS2ShouldPreProcessMessage
// ---------------------------------------------------------------------------
}
return 0;
}
- break;
+ // break;
case BKN_PAGESELECTEDPENDING:
{
wxRadioBox* pRadioBox = wxDynamicCast(pWin, wxRadioBox);
pRadioBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
- ,(WXUINT)SHORT1FROMMP(wParam)
+ ,(WXWORD)SHORT1FROMMP(wParam)
);
}
if (pWin->IsKindOf(CLASSINFO(wxRadioButton)))
wxRadioButton* pRadioButton = wxDynamicCast(pWin, wxRadioButton);
pRadioButton->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
- ,(WXUINT)SHORT1FROMMP(wParam)
+ ,(WXWORD)SHORT1FROMMP(wParam)
);
}
if (pWin->IsKindOf(CLASSINFO(wxCheckBox)))
wxCheckBox* pCheckBox = wxDynamicCast(pWin, wxCheckBox);
pCheckBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
- ,(WXUINT)SHORT1FROMMP(wParam)
+ ,(WXWORD)SHORT1FROMMP(wParam)
);
}
if (pWin->IsKindOf(CLASSINFO(wxListBox)))
wxListBox* pListBox = wxDynamicCast(pWin, wxListBox);
pListBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
- ,(WXUINT)SHORT1FROMMP(wParam)
+ ,(WXWORD)SHORT1FROMMP(wParam)
);
if (pListBox->GetWindowStyle() & wxLB_OWNERDRAW)
Refresh();
wxComboBox* pComboBox = wxDynamicCast(pWin, wxComboBox);
pComboBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
- ,(WXUINT)SHORT1FROMMP(wParam)
+ ,(WXWORD)SHORT1FROMMP(wParam)
);
}
return 0;
}
- break;
+ // break;
case LN_ENTER: /* dups as CBN_EFCHANGE */
{
wxListBox* pListBox = wxDynamicCast(pWin, wxListBox);
pListBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
- ,(WXUINT)SHORT1FROMMP(wParam)
+ ,(WXWORD)SHORT1FROMMP(wParam)
);
if (pListBox->GetWindowStyle() & wxLB_OWNERDRAW)
Refresh();
wxComboBox* pComboBox = wxDynamicCast(pWin, wxComboBox);
pComboBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
- ,(WXUINT)SHORT1FROMMP(wParam)
+ ,(WXWORD)SHORT1FROMMP(wParam)
);
}
return 0;
}
- break;
+ // break;
case SPBN_UPARROW:
case SPBN_DOWNARROW:
case SPBN_CHANGE:
{
- char zVal[10];
- long lVal;
+ char zVal[10];
+ long lVal;
::WinSendMsg( HWNDFROMMP(lParam)
,SPBM_QUERYVALUE
- ,&zVal
+ ,&zVal[0]
,MPFROM2SHORT( (USHORT)10
,(USHORT)SPBQ_UPDATEIFVALID
)
);
lVal = atol(zVal);
bProcessed = OS2OnScroll( wxVERTICAL
- ,(int)SHORT2FROMMP(wParam)
- ,(int)lVal
+ ,(WXWORD)SHORT2FROMMP(wParam)
+ ,(WXWORD)lVal
,HWNDFROMMP(lParam)
);
}
case SLN_SLIDERTRACK:
{
- HWND hWnd = ::WinWindowFromID(GetHWND(), SHORT1FROMMP(wParam));
- wxWindowOS2* pChild = wxFindWinFromHandle(hWnd);
+ HWND hWnd = ::WinWindowFromID(GetHWND(), SHORT1FROMMP(wParam));
+ wxWindowOS2* pChild = wxFindWinFromHandle(hWnd);
if (!pChild)
{
}
if (pChild->IsKindOf(CLASSINFO(wxSlider)))
bProcessed = OS2OnScroll( wxVERTICAL
- ,(int)SHORT2FROMMP(wParam)
- ,(int)LONGFROMMP(lParam)
+ ,(WXWORD)SHORT2FROMMP(wParam)
+ ,(WXWORD)LONGFROMMP(lParam)
,hWnd
);
}
return m_parent ? m_parent->GetHWND() : NULL;
}
-bool wxWindowOS2::OS2Create(
- PSZ zClass
-, const wxChar* zTitle
-, WXDWORD dwStyle
-, const wxPoint& rPos
-, const wxSize& rSize
-, void* pCtlData
-, WXDWORD dwExStyle
-, bool bIsChild
-)
+bool wxWindowOS2::OS2Create( PSZ zClass,
+ const wxChar* zTitle,
+ WXDWORD dwStyle,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ void* pCtlData,
+ WXDWORD WXUNUSED(dwExStyle),
+ bool bIsChild )
{
- ERRORID vError;
- wxString sError;
- int nX = 0L;
- int nY = 0L;
- int nWidth = 0L;
- int nHeight = 0L;
- long lControlId = 0L;
- wxWindowCreationHook vHook(this);
- wxString sClassName((wxChar*)zClass);
+ ERRORID vError;
+ wxString sError;
+ int nX = 0L;
+ int nY = 0L;
+ int nWidth = 0L;
+ int nHeight = 0L;
+ long lControlId = 0L;
+ wxWindowCreationHook vHook(this);
+ wxString sClassName((wxChar*)zClass);
OS2GetCreateWindowCoords( rPos
,rSize
m_backgroundColour.Set(wxString(wxT("GREY")));
- LONG lColor = (LONG)m_backgroundColour.GetPixel();
+ LONG lColor = (LONG)m_backgroundColour.GetPixel();
if (!::WinSetPresParam( m_hWnd
,PP_BACKGROUNDCOLOR
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::HandleMaximize
-bool wxWindowOS2::HandleMove(
- int nX
-, int nY
-)
+bool wxWindowOS2::HandleMove( int nX, int nY )
{
- wxMoveEvent vEvent(wxPoint(nX, nY), m_windowId);
+ wxPoint pt(nX, nY);
+ wxMoveEvent vEvent(pt, m_windowId);
vEvent.SetEventObject(this);
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::HandleMove
-bool wxWindowOS2::HandleSize(
- int nWidth
-, int nHeight
-, WXUINT WXUNUSED(nFlag)
-)
+bool wxWindowOS2::HandleSize( int nWidth,
+ int nHeight,
+ WXUINT WXUNUSED(nFlag) )
{
- wxSizeEvent vEvent(wxSize(nWidth, nHeight), m_windowId);
+ wxSize sz(nWidth, nHeight);
+ wxSizeEvent vEvent(sz, m_windowId);
vEvent.SetEventObject(this);
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::HandleSize
-bool wxWindowOS2::HandleGetMinMaxInfo(
- PSWP pSwp
-)
+bool wxWindowOS2::HandleGetMinMaxInfo( PSWP pSwp )
{
POINTL vPoint;
switch(pSwp->fl)
{
case SWP_MAXIMIZE:
+#ifndef __WATCOMC__
+// FIXME: incomplete headers ???
::WinGetMaxPosition(GetHwnd(), pSwp);
m_maxWidth = pSwp->cx;
m_maxHeight = pSwp->cy;
+#endif
break;
case SWP_MINIMIZE:
+#ifndef __WATCOMC__
+// FIXME: incomplete headers ???
::WinGetMinPosition(GetHwnd(), pSwp, &vPoint);
m_minWidth = pSwp->cx;
m_minHeight = pSwp->cy;
+#else
+ wxUnusedVar(vPoint);
+#endif
break;
default:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
} // end of wxWindowOS2::HandleGetMinMaxInfo
// ---------------------------------------------------------------------------
} // end of wxWindowOS2::CreateKeyEvent
//
-// isASCII is TRUE only when we're called from WM_CHAR handler and not from
+// isASCII is true only when we're called from WM_CHAR handler and not from
// WM_KEYDOWN one
//
-bool wxWindowOS2::HandleChar(
- WXWPARAM wParam
-, WXLPARAM lParam
-, bool isASCII
-)
+bool wxWindowOS2::HandleChar( WXWPARAM WXUNUSED(wParam),
+ WXLPARAM lParam,
+ bool isASCII )
{
- bool bCtrlDown = FALSE;
- int vId;
+ bool bCtrlDown = FALSE;
+ int vId;
if (m_bLastKeydownProcessed)
{
// EVT_KEY_DOWN handler is meant, by design, to prevent EVT_CHARs
// from happening, so just bail out at this point.
//
- m_bLastKeydownProcessed = FALSE;
- return TRUE;
+ m_bLastKeydownProcessed = false;
+ return true;
}
if (isASCII)
{
//
// If 1 -> 26, translate to either special keycode or just set
// ctrlDown. IOW, Ctrl-C should result in keycode == 3 and
- // ControlDown() == TRUE.
+ // ControlDown() == true.
//
vId = SHORT1FROMMP(lParam);
if ((vId > 0) && (vId < 27))
{
vId = wxCharCodeOS2ToWX((int)SHORT2FROMMP(lParam));
if (vId == 0)
- return FALSE;
+ return false;
}
- wxKeyEvent vEvent(CreateKeyEvent( wxEVT_CHAR
- ,vId
- ,lParam
- ));
+ wxKeyEvent vEvent(CreateKeyEvent( wxEVT_CHAR, vId, lParam ));
if (bCtrlDown)
{
- vEvent.m_controlDown = TRUE;
+ vEvent.m_controlDown = true;
}
+
return (GetEventHandler()->ProcessEvent(vEvent));
}
// as that will be the eventual size of the panel after the frame resizes
// it!
//
-int wxWindowOS2::GetOS2ParentHeight(
- wxWindowOS2* pParent
-)
+int wxWindowOS2::GetOS2ParentHeight( wxWindowOS2* pParent )
{
//
// Case 1
// and it's height must be different. Otherwise the standard
// applies.
//
- else
- {
- return(pParent->GetClientSize().y);
- }
- return(0L);
+ // else
+ // {
+
+ return(pParent->GetClientSize().y);
+
+ // }
} // end of wxWindowOS2::GetOS2ParentHeight
//
} // end of wxGetActiveWindow
#ifdef __WXDEBUG__
-const char* wxGetMessageName(
- int nMessage)
+const char* wxGetMessageName( int nMessage )
{
switch (nMessage)
{
case WM_USER+1000+60: return "TB_SETMAXTEXTROWS";
case WM_USER+1000+61: return "TB_GETTEXTROWS";
case WM_USER+1000+41: return "TB_GETBITMAPFLAGS";
-
- default:
- static char s_szBuf[128];
- sprintf(s_szBuf, "<unknown message = %d>", nMessage);
- return s_szBuf;
}
- return NULL;
+
+ static char s_szBuf[128];
+ sprintf(s_szBuf, "<unknown message = %d>", nMessage);
+ return s_szBuf;
+
} // end of wxGetMessageName
#endif // __WXDEBUG__
return wxPoint(vPt.x, vPt.y);
}
-wxWindowOS2* FindWindowForMouseEvent(
- wxWindow* pWin
-, short* pnX
-, short* pnY
-)
+wxWindowOS2* FindWindowForMouseEvent( wxWindow* pWin,
+ short* WXUNUSED(pnX),
+ short* WXUNUSED(pnY) )
{
HWND hWnd = GetHwndOf(pWin);
HWND hWndUnderMouse;
}
return pWin;
} // end of FindWindowForMouseEvent
-