wxOS2 with Open Watcom: correct PCH usage, missing headers, warning fixes, source cleaning and other Watcom adjustements.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -136,19 +136,18 @@ wxAcceleratorTable::wxAcceleratorTable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool bIsVirtual;
|
bool bIsVirtual;
|
||||||
USHORT uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode()
|
USHORT uKey = (USHORT)wxCharCodeWXToOS2( vaEntries[i].GetKeyCode(),
|
||||||
,&bIsVirtual
|
&bIsVirtual);
|
||||||
);
|
|
||||||
if (bIsVirtual)
|
if (bIsVirtual)
|
||||||
uVirt = AF_CHAR | AF_VIRTUALKEY;
|
uVirt = AF_CHAR | AF_VIRTUALKEY;
|
||||||
|
|
||||||
USHORT uCmd = vaEntries[i].GetCommand();
|
USHORT uCmd = (USHORT)vaEntries[i].GetCommand();
|
||||||
|
|
||||||
pArr->aaccel[i].fs = uVirt;
|
pArr->aaccel[i].fs = uVirt;
|
||||||
pArr->aaccel[i].key = uKey;
|
pArr->aaccel[i].key = uKey;
|
||||||
pArr->aaccel[i].cmd = uCmd;
|
pArr->aaccel[i].cmd = uCmd;
|
||||||
}
|
}
|
||||||
pArr->codepage = ::WinQueryCp(wxTheApp->m_hMq);
|
pArr->codepage = (USHORT)::WinQueryCp(wxTheApp->m_hMq);
|
||||||
pArr->cAccel = (USHORT)n;
|
pArr->cAccel = (USHORT)n;
|
||||||
M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain
|
M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain
|
||||||
,pArr
|
,pArr
|
||||||
@@ -210,14 +209,12 @@ bool wxAcceleratorTable::Translate(
|
|||||||
// function for translating labels
|
// function for translating labels
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
wxString wxPMTextToLabel(
|
wxString wxPMTextToLabel( const wxString& rsTitle )
|
||||||
const wxString& rsTitle
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxString sTitle;
|
wxString sTitle;
|
||||||
const wxChar* zPc;
|
const wxChar* zPc;
|
||||||
|
|
||||||
if (rsTitle.IsEmpty())
|
if (rsTitle.empty())
|
||||||
return(sTitle);
|
return(sTitle);
|
||||||
|
|
||||||
for (zPc = rsTitle.c_str(); *zPc != wxT('\0'); zPc++)
|
for (zPc = rsTitle.c_str(); *zPc != wxT('\0'); zPc++)
|
||||||
@@ -247,4 +244,3 @@ wxString wxPMTextToLabel(
|
|||||||
}
|
}
|
||||||
return(sTitle);
|
return(sTitle);
|
||||||
} // end of wxPMTextToLabel
|
} // end of wxPMTextToLabel
|
||||||
|
|
||||||
|
@@ -56,7 +56,11 @@
|
|||||||
|
|
||||||
#endif //
|
#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)
|
#define select(a,b,c,d,e) bsdselect(a,b,c,d,e)
|
||||||
extern "C" int _System bsdselect(int,
|
extern "C" int _System bsdselect(int,
|
||||||
@@ -488,7 +492,7 @@ void wxApp::OnIdle(
|
|||||||
if (gbInOnIdle)
|
if (gbInOnIdle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gbInOnIdle = TRUE;
|
gbInOnIdle = true;
|
||||||
|
|
||||||
wxAppBase::OnIdle(rEvent);
|
wxAppBase::OnIdle(rEvent);
|
||||||
|
|
||||||
@@ -661,10 +665,7 @@ HAB wxGetInstance()
|
|||||||
return vHabmain;
|
return vHabmain;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSetInstance(
|
void wxSetInstance( HAB vHab )
|
||||||
HAB vHab
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
vHabmain = vHab;
|
vHabmain = vHab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -218,7 +218,7 @@ wxBitmap::wxBitmap(
|
|||||||
for (nBits = 0; nBits < 8; nBits++)
|
for (nBits = 0; nBits < 8; nBits++)
|
||||||
{
|
{
|
||||||
ucReversed <<= 1;
|
ucReversed <<= 1;
|
||||||
ucReversed |= (ucVal & 0x01);
|
ucReversed = (unsigned char)(ucReversed | (ucVal & 0x01));
|
||||||
ucVal >>= 1;
|
ucVal >>= 1;
|
||||||
}
|
}
|
||||||
*pzDst++ = ucReversed;
|
*pzDst++ = ucReversed;
|
||||||
@@ -242,7 +242,7 @@ wxBitmap::wxBitmap(
|
|||||||
vHeader.cx = (USHORT)nWidth;
|
vHeader.cx = (USHORT)nWidth;
|
||||||
vHeader.cy = (USHORT)nHeight;
|
vHeader.cy = (USHORT)nHeight;
|
||||||
vHeader.cPlanes = 1L;
|
vHeader.cPlanes = 1L;
|
||||||
vHeader.cBitCount = nDepth;
|
vHeader.cBitCount = (USHORT)nDepth;
|
||||||
vHeader.usReserved = 0;
|
vHeader.usReserved = 0;
|
||||||
|
|
||||||
memset(&vInfo, '\0', 16);
|
memset(&vInfo, '\0', 16);
|
||||||
@@ -250,7 +250,7 @@ wxBitmap::wxBitmap(
|
|||||||
vInfo.cx = (USHORT)nWidth;
|
vInfo.cx = (USHORT)nWidth;
|
||||||
vInfo.cy = (USHORT)nHeight;
|
vInfo.cy = (USHORT)nHeight;
|
||||||
vInfo.cPlanes = 1L;
|
vInfo.cPlanes = 1L;
|
||||||
vInfo.cBitCount = nDepth;
|
vInfo.cBitCount = (USHORT)nDepth;
|
||||||
|
|
||||||
HBITMAP hBmp = ::GpiCreateBitmap(hPs, &vHeader, CBM_INIT, (PBYTE)pzData, &vInfo);
|
HBITMAP hBmp = ::GpiCreateBitmap(hPs, &vHeader, CBM_INIT, (PBYTE)pzData, &vInfo);
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ bool wxBitmap::Create(
|
|||||||
vHeader.cx = nW;
|
vHeader.cx = nW;
|
||||||
vHeader.cy = nH;
|
vHeader.cy = nH;
|
||||||
vHeader.cPlanes = 1;
|
vHeader.cPlanes = 1;
|
||||||
vHeader.cBitCount = lBitCount;
|
vHeader.cBitCount = (USHORT)lBitCount;
|
||||||
|
|
||||||
hBmp = ::GpiCreateBitmap( hPSScreen
|
hBmp = ::GpiCreateBitmap( hPSScreen
|
||||||
,&vHeader
|
,&vHeader
|
||||||
@@ -1181,9 +1181,7 @@ void wxBitmap::SetMask(
|
|||||||
GetBitmapData()->m_pBitmapMask = pMask;
|
GetBitmapData()->m_pBitmapMask = pMask;
|
||||||
} // end of wxBitmap::SetMask
|
} // end of wxBitmap::SetMask
|
||||||
|
|
||||||
wxBitmap wxBitmap::GetBitmapForDC(
|
wxBitmap wxBitmap::GetBitmapForDC(wxDC& WXUNUSED(rDc)) const
|
||||||
wxDC& rDc
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
return(*this);
|
return(*this);
|
||||||
} // end of wxBitmap::GetBitmapForDC
|
} // end of wxBitmap::GetBitmapForDC
|
||||||
@@ -1429,14 +1427,12 @@ bool wxMask::Create(
|
|||||||
// wxBitmapHandler
|
// wxBitmapHandler
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxBitmapHandler::Create(
|
bool wxBitmapHandler::Create( wxGDIImage* pImage,
|
||||||
wxGDIImage* pImage
|
void* pData,
|
||||||
, void* pData
|
long WXUNUSED(lFlags),
|
||||||
, long lFlags
|
int nWidth,
|
||||||
, int nWidth
|
int nHeight,
|
||||||
, int nHeight
|
int nDepth)
|
||||||
, int nDepth
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxBitmap* pBitmap = wxDynamicCast( pImage
|
wxBitmap* pBitmap = wxDynamicCast( pImage
|
||||||
,wxBitmap
|
,wxBitmap
|
||||||
@@ -1589,4 +1585,3 @@ HBITMAP wxInvertMask(
|
|||||||
|
|
||||||
return hBmpInvMask;
|
return hBmpInvMask;
|
||||||
} // end of WxWinGdi_InvertMask
|
} // end of WxWinGdi_InvertMask
|
||||||
|
|
||||||
|
@@ -25,16 +25,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
|
|||||||
|
|
||||||
#define BUTTON_HEIGHT_FACTOR (EDIT_CONTROL_FACTOR * 1.1)
|
#define BUTTON_HEIGHT_FACTOR (EDIT_CONTROL_FACTOR * 1.1)
|
||||||
|
|
||||||
bool wxBitmapButton::Create(
|
bool wxBitmapButton::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
wxWindowID vId,
|
||||||
, wxWindowID vId
|
const wxBitmap& rBitmap,
|
||||||
, const wxBitmap& rBitmap
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
long lStyle,
|
||||||
, long lStyle
|
const wxValidator& rValidator,
|
||||||
, const wxValidator& rValidator
|
const wxString& rsName )
|
||||||
, const wxString& rsName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
m_bmpNormal = rBitmap;
|
m_bmpNormal = rBitmap;
|
||||||
SetName(rsName);
|
SetName(rsName);
|
||||||
@@ -97,12 +95,10 @@ bool wxBitmapButton::Create(
|
|||||||
,nWidth
|
,nWidth
|
||||||
,nHeight
|
,nHeight
|
||||||
);
|
);
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxBitmapButton::Create
|
} // end of wxBitmapButton::Create
|
||||||
|
|
||||||
bool wxBitmapButton::OS2OnDraw(
|
bool wxBitmapButton::OS2OnDraw( WXDRAWITEMSTRUCT* pItem)
|
||||||
WXDRAWITEMSTRUCT* pItem
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
PUSERBUTTON pUser = (PUSERBUTTON)pItem;
|
PUSERBUTTON pUser = (PUSERBUTTON)pItem;
|
||||||
bool bAutoDraw = (GetWindowStyleFlag() & wxBU_AUTODRAW) != 0;
|
bool bAutoDraw = (GetWindowStyleFlag() & wxBU_AUTODRAW) != 0;
|
||||||
@@ -159,11 +155,7 @@ bool wxBitmapButton::OS2OnDraw(
|
|||||||
//
|
//
|
||||||
// Draw the bitmap
|
// Draw the bitmap
|
||||||
//
|
//
|
||||||
vDc.DrawBitmap( *pBitmap
|
vDc.DrawBitmap( *pBitmap, nX1, nY1, true );
|
||||||
,nX1
|
|
||||||
,nY1
|
|
||||||
,TRUE
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw focus / disabled state, if auto-drawing
|
// Draw focus / disabled state, if auto-drawing
|
||||||
@@ -178,20 +170,18 @@ bool wxBitmapButton::OS2OnDraw(
|
|||||||
{
|
{
|
||||||
DrawButtonFocus(vDc);
|
DrawButtonFocus(vDc);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxBitmapButton::OS2OnDraw
|
} // end of wxBitmapButton::OS2OnDraw
|
||||||
|
|
||||||
void wxBitmapButton::DrawFace (
|
void wxBitmapButton::DrawFace (wxClientDC& rDC, bool bSel)
|
||||||
wxClientDC& rDC
|
|
||||||
, bool bSel
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Set up drawing colors
|
// Set up drawing colors
|
||||||
//
|
//
|
||||||
wxPen vHiLitePen(wxColour(255, 255, 255), 2, wxSOLID); // White
|
wxPen vHiLitePen(*wxWHITE, 2, wxSOLID); // White
|
||||||
wxPen vDarkShadowPen(wxColour(85, 85, 85), 2, wxSOLID);
|
wxColour gray85(85, 85, 85);
|
||||||
wxColour vFaceColor(wxColour(204, 204, 204)); // Light Grey
|
wxPen vDarkShadowPen(gray85, 2, wxSOLID);
|
||||||
|
wxColour vFaceColor(204, 204, 204); // Light Grey
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw the main button face
|
// Draw the main button face
|
||||||
@@ -231,7 +221,7 @@ void wxBitmapButton::DrawButtonFocus (
|
|||||||
wxClientDC& rDC
|
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
|
// Draw a thick black line around the outside of the button
|
||||||
@@ -259,12 +249,10 @@ void wxBitmapButton::DrawButtonFocus (
|
|||||||
);
|
);
|
||||||
} // end of wxBitmapButton::DrawButtonFocus
|
} // end of wxBitmapButton::DrawButtonFocus
|
||||||
|
|
||||||
void wxBitmapButton::DrawButtonDisable(
|
void wxBitmapButton::DrawButtonDisable( wxClientDC& rDC,
|
||||||
wxClientDC& rDC
|
wxBitmap& rBmp )
|
||||||
, 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
|
// Draw a thick black line around the outside of the button
|
||||||
@@ -299,4 +287,3 @@ void wxBitmapButton::SetDefault()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // ndef for wxUSE_BMPBUTTON
|
#endif // ndef for wxUSE_BMPBUTTON
|
||||||
|
|
||||||
|
@@ -102,7 +102,7 @@ wxBrush::wxBrush(
|
|||||||
|
|
||||||
bool wxBrush::RealizeResource()
|
bool wxBrush::RealizeResource()
|
||||||
{
|
{
|
||||||
BOOL bOk;
|
bool bOk;
|
||||||
ERRORID vError;
|
ERRORID vError;
|
||||||
wxString sError;
|
wxString sError;
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ bool wxBrush::RealizeResource()
|
|||||||
|
|
||||||
if (M_BRUSHDATA->m_nStyle==wxTRANSPARENT)
|
if (M_BRUSHDATA->m_nStyle==wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
COLORREF vPmColour = 0L;
|
COLORREF vPmColour = 0L;
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ bool wxBrush::RealizeResource()
|
|||||||
M_BRUSHDATA->m_vBundle.usMixMode = FM_OVERPAINT;
|
M_BRUSHDATA->m_vBundle.usMixMode = FM_OVERPAINT;
|
||||||
M_BRUSHDATA->m_vBundle.usBackMixMode = BM_OVERPAINT;
|
M_BRUSHDATA->m_vBundle.usBackMixMode = BM_OVERPAINT;
|
||||||
|
|
||||||
bOk = ::GpiSetAttrs( M_BRUSHDATA->m_hBrush
|
bOk = (bool)::GpiSetAttrs( M_BRUSHDATA->m_hBrush
|
||||||
,PRIM_AREA
|
,PRIM_AREA
|
||||||
,ABB_COLOR | ABB_BACK_COLOR | ABB_MIX_MODE | ABB_BACK_MIX_MODE |
|
,ABB_COLOR | ABB_BACK_COLOR | ABB_MIX_MODE | ABB_BACK_MIX_MODE |
|
||||||
ABB_SET | ABB_SYMBOL
|
ABB_SET | ABB_SYMBOL
|
||||||
@@ -234,14 +234,12 @@ WXHANDLE wxBrush::GetResourceHandle()
|
|||||||
return (WXHANDLE)M_BRUSHDATA->m_hBrush;
|
return (WXHANDLE)M_BRUSHDATA->m_hBrush;
|
||||||
} // end of wxBrush::GetResourceHandle
|
} // end of wxBrush::GetResourceHandle
|
||||||
|
|
||||||
bool wxBrush::FreeResource(
|
bool wxBrush::FreeResource( bool WXUNUSED(bForce) )
|
||||||
bool WXUNUSED(bForce)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0))
|
if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0))
|
||||||
{
|
{
|
||||||
M_BRUSHDATA->m_hBrush = 0;
|
M_BRUSHDATA->m_hBrush = 0;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else return FALSE;
|
else return FALSE;
|
||||||
} // end of wxBrush::FreeResource
|
} // end of wxBrush::FreeResource
|
||||||
@@ -319,4 +317,3 @@ void wxBrush::SetPS(
|
|||||||
M_BRUSHDATA->m_hBrush = hPS;
|
M_BRUSHDATA->m_hBrush = hPS;
|
||||||
RealizeResource();
|
RealizeResource();
|
||||||
} // end of WxWinGdi_CPen::SetPS
|
} // end of WxWinGdi_CPen::SetPS
|
||||||
|
|
||||||
|
@@ -41,16 +41,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
|
|||||||
|
|
||||||
// Button
|
// Button
|
||||||
|
|
||||||
bool wxButton::Create(
|
bool wxButton::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
wxWindowID vId,
|
||||||
, wxWindowID vId
|
const wxString& rsLbl,
|
||||||
, const wxString& rsLbl
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
long lStyle,
|
||||||
, long lStyle
|
const wxValidator& rValidator,
|
||||||
, const wxValidator& rValidator
|
const wxString& rsName)
|
||||||
, const wxString& rsName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxString rsLabel(rsLbl);
|
wxString rsLabel(rsLbl);
|
||||||
if (rsLabel.empty() && wxIsStockID(vId))
|
if (rsLabel.empty() && wxIsStockID(vId))
|
||||||
@@ -112,7 +110,7 @@ bool wxButton::Create(
|
|||||||
,rSize.y
|
,rSize.y
|
||||||
);
|
);
|
||||||
delete pButtonFont;
|
delete pButtonFont;
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxButton::Create
|
} // end of wxButton::Create
|
||||||
|
|
||||||
wxButton::~wxButton()
|
wxButton::~wxButton()
|
||||||
@@ -242,12 +240,8 @@ void wxButton::SetDefault()
|
|||||||
//
|
//
|
||||||
wxWindow* pWinOldDefault = pParent->SetDefaultItem(this);
|
wxWindow* pWinOldDefault = pParent->SetDefaultItem(this);
|
||||||
|
|
||||||
SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton)
|
SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), false);
|
||||||
,FALSE
|
SetDefaultStyle( this, true );
|
||||||
);
|
|
||||||
SetDefaultStyle( this
|
|
||||||
,TRUE
|
|
||||||
);
|
|
||||||
} // end of wxButton::SetDefault
|
} // end of wxButton::SetDefault
|
||||||
|
|
||||||
void wxButton::SetTmpDefault()
|
void wxButton::SetTmpDefault()
|
||||||
@@ -259,12 +253,8 @@ void wxButton::SetTmpDefault()
|
|||||||
wxWindow* pWinOldDefault = pParent->GetDefaultItem();
|
wxWindow* pWinOldDefault = pParent->GetDefaultItem();
|
||||||
|
|
||||||
pParent->SetTmpDefaultItem(this);
|
pParent->SetTmpDefaultItem(this);
|
||||||
SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton)
|
SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), false);
|
||||||
,FALSE
|
SetDefaultStyle( this, true );
|
||||||
);
|
|
||||||
SetDefaultStyle( this
|
|
||||||
,TRUE
|
|
||||||
);
|
|
||||||
} // end of wxButton::SetTmpDefault
|
} // end of wxButton::SetTmpDefault
|
||||||
|
|
||||||
void wxButton::UnsetTmpDefault()
|
void wxButton::UnsetTmpDefault()
|
||||||
@@ -277,12 +267,8 @@ void wxButton::UnsetTmpDefault()
|
|||||||
|
|
||||||
wxWindow* pWinOldDefault = pParent->GetDefaultItem();
|
wxWindow* pWinOldDefault = pParent->GetDefaultItem();
|
||||||
|
|
||||||
SetDefaultStyle( this
|
SetDefaultStyle( this, false );
|
||||||
,FALSE
|
SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), true );
|
||||||
);
|
|
||||||
SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton)
|
|
||||||
,TRUE
|
|
||||||
);
|
|
||||||
} // end of wxButton::UnsetTmpDefault
|
} // end of wxButton::UnsetTmpDefault
|
||||||
|
|
||||||
void wxButton::SetDefaultStyle(
|
void wxButton::SetDefaultStyle(
|
||||||
@@ -339,12 +325,9 @@ void wxButton::SetDefaultStyle(
|
|||||||
// event/message handlers
|
// event/message handlers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxButton::OS2Command(
|
bool wxButton::OS2Command(WXUINT uParam, WXWORD WXUNUSED(wId))
|
||||||
WXUINT uParam
|
|
||||||
, WXWORD wId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
bool bProcessed = FALSE;
|
bool bProcessed = false;
|
||||||
|
|
||||||
switch (uParam)
|
switch (uParam)
|
||||||
{
|
{
|
||||||
@@ -353,17 +336,16 @@ bool wxButton::OS2Command(
|
|||||||
bProcessed = SendClickEvent();
|
bProcessed = SendClickEvent();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bProcessed;
|
return bProcessed;
|
||||||
} // end of wxButton::OS2Command
|
} // end of wxButton::OS2Command
|
||||||
|
|
||||||
WXHBRUSH wxButton::OnCtlColor(
|
WXHBRUSH wxButton::OnCtlColor( WXHDC WXUNUSED(pDC),
|
||||||
WXHDC pDC
|
WXHWND WXUNUSED(pWnd),
|
||||||
, WXHWND pWnd
|
WXUINT WXUNUSED(nCtlColor),
|
||||||
, WXUINT nCtlColor
|
WXUINT WXUNUSED(uMessage),
|
||||||
, WXUINT uMessage
|
WXWPARAM WXUNUSED(wParam),
|
||||||
, WXWPARAM wParam
|
WXLPARAM WXUNUSED(lParam) )
|
||||||
, WXLPARAM lParam
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()
|
wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()
|
||||||
,wxSOLID
|
,wxSOLID
|
||||||
@@ -408,11 +390,9 @@ WXDWORD wxButton::OS2GetStyle(
|
|||||||
return dwStyle;
|
return dwStyle;
|
||||||
} // end of wxButton::OS2GetStyle
|
} // end of wxButton::OS2GetStyle
|
||||||
|
|
||||||
MRESULT wxButton::WindowProc(
|
MRESULT wxButton::WindowProc( WXUINT uMsg,
|
||||||
WXUINT uMsg
|
WXWPARAM wParam,
|
||||||
, WXWPARAM wParam
|
WXLPARAM lParam )
|
||||||
, WXLPARAM lParam
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// When we receive focus, we want to temporary become the default button in
|
// When we receive focus, we want to temporary become the default button in
|
||||||
@@ -455,4 +435,3 @@ MRESULT wxButton::WindowProc(
|
|||||||
,lParam
|
,lParam
|
||||||
));
|
));
|
||||||
} // end of wxWindowProc
|
} // end of wxWindowProc
|
||||||
|
|
||||||
|
@@ -41,18 +41,14 @@ extern void wxAssociateWinWithHandle( HWND hWnd
|
|||||||
// wxCheckBox
|
// wxCheckBox
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxCheckBox::OS2Command(
|
bool wxCheckBox::OS2Command( WXUINT WXUNUSED(uParam),
|
||||||
WXUINT WXUNUSED(uParam)
|
WXWORD WXUNUSED(wId) )
|
||||||
, WXWORD WXUNUSED(wId)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxCommandEvent rEvent( wxEVT_COMMAND_CHECKBOX_CLICKED
|
wxCommandEvent rEvent( wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId );
|
||||||
,m_windowId
|
|
||||||
);
|
|
||||||
rEvent.SetInt(GetValue());
|
rEvent.SetInt(GetValue());
|
||||||
rEvent.SetEventObject(this);
|
rEvent.SetEventObject(this);
|
||||||
ProcessCommand(rEvent);
|
ProcessCommand(rEvent);
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxCheckBox::OS2Command
|
} // end of wxCheckBox::OS2Command
|
||||||
|
|
||||||
bool wxCheckBox::Create(
|
bool wxCheckBox::Create(
|
||||||
@@ -132,7 +128,7 @@ wxSize wxCheckBox::DoGetBestSize() const
|
|||||||
int nHeightCheckbox;
|
int nHeightCheckbox;
|
||||||
wxString sStr = wxGetWindowText(GetHWND());
|
wxString sStr = wxGetWindowText(GetHWND());
|
||||||
|
|
||||||
if (!sStr.IsEmpty())
|
if (!sStr.empty())
|
||||||
{
|
{
|
||||||
GetTextExtent( sStr
|
GetTextExtent( sStr
|
||||||
,&nWidthCheckbox
|
,&nWidthCheckbox
|
||||||
@@ -182,16 +178,14 @@ void wxCheckBox::Command (
|
|||||||
// wxBitmapCheckBox
|
// wxBitmapCheckBox
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxBitmapCheckBox::Create(
|
bool wxBitmapCheckBox::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
wxWindowID vId,
|
||||||
, wxWindowID vId
|
const wxBitmap* WXUNUSED(pLabel),
|
||||||
, const wxBitmap* pLabel
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
long lStyle,
|
||||||
, long lStyle
|
const wxValidator& rValidator,
|
||||||
, const wxValidator& rValidator
|
const wxString& rsName)
|
||||||
, const wxString& rsName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SetName(rsName);
|
SetName(rsName);
|
||||||
#if wxUSE_VALIDATORS
|
#if wxUSE_VALIDATORS
|
||||||
@@ -234,13 +228,10 @@ bool wxBitmapCheckBox::Create(
|
|||||||
);
|
);
|
||||||
|
|
||||||
::WinShowWindow(hButton, TRUE);
|
::WinShowWindow(hButton, TRUE);
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxBitmapCheckBox::Create
|
} // end of wxBitmapCheckBox::Create
|
||||||
|
|
||||||
void wxBitmapCheckBox::SetLabel(
|
void wxBitmapCheckBox::SetLabel( const wxBitmap& WXUNUSED(rBitmap) )
|
||||||
const wxBitmap& rBitmap
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxFAIL_MSG(wxT("not implemented"));
|
wxFAIL_MSG(wxT("not implemented"));
|
||||||
} // end of wxBitmapCheckBox::SetLabel
|
} // end of wxBitmapCheckBox::SetLabel
|
||||||
|
|
||||||
|
@@ -327,13 +327,11 @@ wxClientData* wxChoice::DoGetItemClientObject(
|
|||||||
// wxOS2 specific helpers
|
// wxOS2 specific helpers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxChoice::DoSetSize(
|
void wxChoice::DoSetSize(int nX,
|
||||||
int nX
|
int nY,
|
||||||
, int nY
|
int nWidth,
|
||||||
, int nWidth
|
int WXUNUSED(nHeight),
|
||||||
, int nHeight
|
int nSizeFlags)
|
||||||
, int nSizeFlags
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Ignore height parameter because height doesn't mean 'initially
|
// Ignore height parameter because height doesn't mean 'initially
|
||||||
@@ -345,7 +343,7 @@ void wxChoice::DoSetSize(
|
|||||||
wxControl::DoSetSize( nX
|
wxControl::DoSetSize( nX
|
||||||
,nY
|
,nY
|
||||||
,nWidth
|
,nWidth
|
||||||
,-1
|
,wxDefaultCoord
|
||||||
,nSizeFlags
|
,nSizeFlags
|
||||||
);
|
);
|
||||||
} // end of wxChoice::DoSetSize
|
} // end of wxChoice::DoSetSize
|
||||||
|
@@ -59,7 +59,7 @@ static bool gs_wxClipboardIsOpen = FALSE;
|
|||||||
|
|
||||||
bool wxOpenClipboard()
|
bool wxOpenClipboard()
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, wxT("clipboard already opened.") );
|
wxCHECK_MSG( !gs_wxClipboardIsOpen, true, wxT("clipboard already opened.") );
|
||||||
// TODO:
|
// TODO:
|
||||||
/*
|
/*
|
||||||
wxWindow *win = wxTheApp->GetTopWindow();
|
wxWindow *win = wxTheApp->GetTopWindow();
|
||||||
@@ -96,7 +96,7 @@ bool wxCloseClipboard()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxEmptyClipboard()
|
bool wxEmptyClipboard()
|
||||||
@@ -110,7 +110,7 @@ bool wxEmptyClipboard()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxIsClipboardOpened()
|
bool wxIsClipboardOpened()
|
||||||
@@ -118,10 +118,10 @@ bool wxIsClipboardOpened()
|
|||||||
return gs_wxClipboardIsOpen;
|
return gs_wxClipboardIsOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
|
bool wxIsClipboardFormatAvailable(wxDataFormat WXUNUSED(dataFormat))
|
||||||
{
|
{
|
||||||
// TODO: return ::IsClipboardFormatAvailable(dataFormat) != 0;
|
// TODO: return ::IsClipboardFormatAvailable(dataFormat) != 0;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -155,7 +155,7 @@ static bool wxSetClipboardData(wxDataObject *data)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_DRAG_AND_DROP
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
#endif
|
#endif
|
||||||
@@ -278,7 +278,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
|
void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
|
||||||
@@ -329,7 +329,7 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
|
|||||||
wxBM->SetWidth(bm.bmWidth);
|
wxBM->SetWidth(bm.bmWidth);
|
||||||
wxBM->SetHeight(bm.bmHeight);
|
wxBM->SetHeight(bm.bmHeight);
|
||||||
wxBM->SetDepth(bm.bmPlanes);
|
wxBM->SetDepth(bm.bmPlanes);
|
||||||
wxBM->SetOk(TRUE);
|
wxBM->SetOk(true);
|
||||||
retval = wxBM;
|
retval = wxBM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -471,9 +471,9 @@ bool wxClipboard::SetData( wxDataObject *data )
|
|||||||
if ( data )
|
if ( data )
|
||||||
return AddData(data);
|
return AddData(data);
|
||||||
else
|
else
|
||||||
return TRUE;
|
return true;
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxClipboard::AddData( wxDataObject *data )
|
bool wxClipboard::AddData( wxDataObject *data )
|
||||||
@@ -556,7 +556,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
{
|
{
|
||||||
textDataObject.SetText(s);
|
textDataObject.SetText(s);
|
||||||
delete[] s;
|
delete[] s;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -571,7 +571,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
{
|
{
|
||||||
bitmapDataObject.SetBitmap(* bitmap);
|
bitmapDataObject.SetBitmap(* bitmap);
|
||||||
delete bitmap;
|
delete bitmap;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -585,7 +585,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
{
|
{
|
||||||
metaFileDataObject.SetMetafile(*metaFile);
|
metaFileDataObject.SetMetafile(*metaFile);
|
||||||
delete metaFile;
|
delete metaFile;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -601,7 +601,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
((wxPrivateDataObject &)data).SetData(buf, len);
|
((wxPrivateDataObject &)data).SetData(buf, len);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,7 +615,4 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
#error "Please turn wxUSE_CLIPBOARD on to compile this file."
|
|
||||||
#endif // wxUSE_CLIPBOARD
|
#endif // wxUSE_CLIPBOARD
|
||||||
|
|
||||||
|
@@ -9,13 +9,11 @@
|
|||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "wx/combobox.h"
|
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/setup.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -279,11 +277,9 @@ wxTextPos wxComboBox::GetLastPosition() const
|
|||||||
return lLineLength;
|
return lLineLength;
|
||||||
} // end of wxComboBox::GetLastPosition
|
} // end of wxComboBox::GetLastPosition
|
||||||
|
|
||||||
void wxComboBox::Replace(
|
void wxComboBox::Replace( long lFrom,
|
||||||
long lFrom
|
long lTo,
|
||||||
, long lTo
|
const wxString& rsValue )
|
||||||
, const wxString& rsValue
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if wxUSE_CLIPBOARD
|
#if wxUSE_CLIPBOARD
|
||||||
HWND hWnd = GetHwnd();
|
HWND hWnd = GetHwnd();
|
||||||
@@ -307,19 +303,23 @@ void wxComboBox::Replace(
|
|||||||
// Paste into edit control
|
// Paste into edit control
|
||||||
//
|
//
|
||||||
::WinSendMsg(hWnd, EM_PASTE, (MPARAM)0, (MPARAM)0L);
|
::WinSendMsg(hWnd, EM_PASTE, (MPARAM)0, (MPARAM)0L);
|
||||||
|
#else
|
||||||
|
wxUnusedVar(lFrom);
|
||||||
|
wxUnusedVar(lTo);
|
||||||
|
wxUnusedVar(rsValue);
|
||||||
#endif
|
#endif
|
||||||
} // end of wxComboBox::Replace
|
} // end of wxComboBox::Replace
|
||||||
|
|
||||||
void wxComboBox::Remove(
|
void wxComboBox::Remove( long lFrom, long lTo)
|
||||||
long lFrom
|
|
||||||
, long lTo
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if wxUSE_CLIPBOARD
|
#if wxUSE_CLIPBOARD
|
||||||
HWND hWnd = GetHwnd();
|
HWND hWnd = GetHwnd();
|
||||||
|
|
||||||
::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), 0);
|
::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), 0);
|
||||||
::WinSendMsg(hWnd, EM_CUT, (MPARAM)0, (MPARAM)0);
|
::WinSendMsg(hWnd, EM_CUT, (MPARAM)0, (MPARAM)0);
|
||||||
|
#else
|
||||||
|
wxUnusedVar(lFrom);
|
||||||
|
wxUnusedVar(lTo);
|
||||||
#endif
|
#endif
|
||||||
} // end of wxComboBox::Remove
|
} // end of wxComboBox::Remove
|
||||||
|
|
||||||
@@ -401,7 +401,6 @@ bool wxComboBox::ProcessEditMsg(
|
|||||||
return(HandleSetFocus((WXHWND)(HWND)wParam));
|
return(HandleSetFocus((WXHWND)(HWND)wParam));
|
||||||
else
|
else
|
||||||
return(HandleKillFocus((WXHWND)(HWND)wParam));
|
return(HandleKillFocus((WXHWND)(HWND)wParam));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} // end of WinGuiBase_CComboBox::ProcessEditMsg
|
} // end of WinGuiBase_CComboBox::ProcessEditMsg
|
||||||
@@ -442,4 +441,3 @@ MRESULT EXPENTRY wxComboEditWndProc(
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_COMBOBOX
|
// wxUSE_COMBOBOX
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ bool wxControl::Create(
|
|||||||
|
|
||||||
wxControl::~wxControl()
|
wxControl::~wxControl()
|
||||||
{
|
{
|
||||||
m_isBeingDeleted = TRUE;
|
m_isBeingDeleted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxControl::OS2CreateControl(
|
bool wxControl::OS2CreateControl(
|
||||||
@@ -90,14 +90,12 @@ bool wxControl::OS2CreateControl(
|
|||||||
);
|
);
|
||||||
} // end of wxControl::OS2CreateControl
|
} // end of wxControl::OS2CreateControl
|
||||||
|
|
||||||
bool wxControl::OS2CreateControl(
|
bool wxControl::OS2CreateControl( const wxChar* zClassname,
|
||||||
const wxChar* zClassname
|
WXDWORD dwStyle,
|
||||||
, WXDWORD dwStyle
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
const wxString& rsLabel,
|
||||||
, const wxString& rsLabel
|
WXDWORD dwExstyle )
|
||||||
, WXDWORD dwExstyle
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Doesn't do anything at all under OS/2
|
// Doesn't do anything at all under OS/2
|
||||||
@@ -178,7 +176,7 @@ bool wxControl::OS2CreateControl(
|
|||||||
,rSize.x
|
,rSize.x
|
||||||
,rSize.y
|
,rSize.y
|
||||||
);
|
);
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxControl::OS2CreateControl
|
} // end of wxControl::OS2CreateControl
|
||||||
|
|
||||||
wxSize wxControl::DoGetBestSize() const
|
wxSize wxControl::DoGetBestSize() const
|
||||||
@@ -191,14 +189,12 @@ bool wxControl::ProcessCommand(wxCommandEvent& event)
|
|||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
WXHBRUSH wxControl::OnCtlColor(
|
WXHBRUSH wxControl::OnCtlColor(WXHDC hWxDC,
|
||||||
WXHDC hWxDC
|
WXHWND WXUNUSED(hWnd),
|
||||||
, WXHWND hWnd
|
WXUINT WXUNUSED(uCtlColor),
|
||||||
, WXUINT uCtlColor
|
WXUINT WXUNUSED(uMessage),
|
||||||
, WXUINT uMessage
|
WXWPARAM WXUNUSED(wParam),
|
||||||
, WXWPARAM wParam
|
WXLPARAM WXUNUSED(lParam))
|
||||||
, WXLPARAM lParam
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
HPS hPS = (HPS)hWxDC; // pass in a PS handle in OS/2
|
HPS hPS = (HPS)hWxDC; // pass in a PS handle in OS/2
|
||||||
wxColour vColFore = GetForegroundColour();
|
wxColour vColFore = GetForegroundColour();
|
||||||
@@ -292,5 +288,3 @@ void wxFindMaxSize(
|
|||||||
if (nBottom < pRect->yBottom)
|
if (nBottom < pRect->yBottom)
|
||||||
pRect->yBottom = nBottom;
|
pRect->yBottom = nBottom;
|
||||||
} // end of wxFindMaxSize
|
} // end of wxFindMaxSize
|
||||||
|
|
||||||
|
|
||||||
|
@@ -97,12 +97,10 @@ wxCursor::wxCursor(
|
|||||||
|
|
||||||
} // end of wxCursor::wxCursor
|
} // end of wxCursor::wxCursor
|
||||||
|
|
||||||
wxCursor::wxCursor(
|
wxCursor::wxCursor( const wxString& WXUNUSED(rsCursorFile),
|
||||||
const wxString& rsCursorFile
|
long lFlags,
|
||||||
, long lFlags
|
int WXUNUSED(nHotSpotX),
|
||||||
, int nHotSpotX
|
int WXUNUSED(nHotSpotY) )
|
||||||
, int nHotSpotY
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxCursorRefData* pRefData = new wxCursorRefData;
|
wxCursorRefData* pRefData = new wxCursorRefData;
|
||||||
|
|
||||||
@@ -324,4 +322,3 @@ void wxSetCursor(const wxCursor& cursor)
|
|||||||
(*g_globalCursor) = cursor;
|
(*g_globalCursor) = cursor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,11 +25,13 @@
|
|||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/intl.h"
|
|
||||||
#endif
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
|
#include "wx/intl.h"
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_DATAOBJ
|
||||||
|
|
||||||
#include "wx/dataobj.h"
|
#include "wx/dataobj.h"
|
||||||
#include "wx/mstream.h"
|
#include "wx/mstream.h"
|
||||||
#include "wx/image.h"
|
#include "wx/image.h"
|
||||||
@@ -94,11 +96,9 @@ private:
|
|||||||
DRAGITEM m_vDragItem;
|
DRAGITEM m_vDragItem;
|
||||||
}; // end of CLASS CIDataObject
|
}; // end of CLASS CIDataObject
|
||||||
|
|
||||||
bool CIDataObject::GetData (
|
bool CIDataObject::GetData ( const wxDataFormat& rFormat,
|
||||||
const wxDataFormat& rFormat
|
char* pzBuffer,
|
||||||
, char* pzBuffer
|
ULONG ulLen )
|
||||||
, ULONG ulLen
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
QueryGetData(rFormat);
|
QueryGetData(rFormat);
|
||||||
if (rFormat.GetType() == wxDF_INVALID)
|
if (rFormat.GetType() == wxDF_INVALID)
|
||||||
@@ -132,7 +132,7 @@ bool CIDataObject::GetData (
|
|||||||
,pzBuffer
|
,pzBuffer
|
||||||
,ulSize
|
,ulSize
|
||||||
);
|
);
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of CIDataObject::GetData
|
} // end of CIDataObject::GetData
|
||||||
|
|
||||||
void CIDataObject::GetDataHere(
|
void CIDataObject::GetDataHere(
|
||||||
@@ -225,9 +225,7 @@ wxDataObject::~wxDataObject ()
|
|||||||
// wxFileDataObject
|
// wxFileDataObject
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxFileDataObject::GetDataHere(
|
bool wxFileDataObject::GetDataHere( void* pBuf ) const
|
||||||
void* pBuf
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
wxString sFilenames;
|
wxString sFilenames;
|
||||||
|
|
||||||
@@ -238,7 +236,7 @@ bool wxFileDataObject::GetDataHere(
|
|||||||
}
|
}
|
||||||
|
|
||||||
memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1);
|
memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxFileDataObject::GetDataSize() const
|
size_t wxFileDataObject::GetDataSize() const
|
||||||
@@ -254,10 +252,8 @@ size_t wxFileDataObject::GetDataSize() const
|
|||||||
return nRes + 1;
|
return nRes + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFileDataObject::SetData(
|
bool wxFileDataObject::SetData( size_t WXUNUSED(nSize),
|
||||||
size_t WXUNUSED(nSize)
|
const void* pBuf )
|
||||||
, const void* pBuf
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
/* TODO */
|
/* TODO */
|
||||||
|
|
||||||
@@ -265,7 +261,7 @@ bool wxFileDataObject::SetData(
|
|||||||
|
|
||||||
AddFile(sFile);
|
AddFile(sFile);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFileDataObject::AddFile(
|
void wxFileDataObject::AddFile(
|
||||||
@@ -299,18 +295,14 @@ wxBitmapDataObject::~wxBitmapDataObject()
|
|||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxBitmapDataObject::SetBitmap(
|
void wxBitmapDataObject::SetBitmap( const wxBitmap& rBitmap )
|
||||||
const wxBitmap& rBitmap
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ClearAll();
|
ClearAll();
|
||||||
wxBitmapDataObjectBase::SetBitmap(rBitmap);
|
wxBitmapDataObjectBase::SetBitmap(rBitmap);
|
||||||
DoConvertToPng();
|
DoConvertToPng();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxBitmapDataObject::GetDataHere(
|
bool wxBitmapDataObject::GetDataHere( void* pBuf ) const
|
||||||
void* pBuf
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
if (!m_pngSize)
|
if (!m_pngSize)
|
||||||
{
|
{
|
||||||
@@ -318,7 +310,7 @@ bool wxBitmapDataObject::GetDataHere(
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
memcpy(pBuf, m_pngData, m_pngSize);
|
memcpy(pBuf, m_pngData, m_pngSize);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxBitmapDataObject::SetData(
|
bool wxBitmapDataObject::SetData(
|
||||||
@@ -369,3 +361,4 @@ void wxBitmapDataObject::DoConvertToPng()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_DATAOBJ
|
||||||
|
@@ -221,7 +221,7 @@ wxDCCacheEntry* wxDC::FindBitmapInCache(
|
|||||||
vBmpHdr.cx = nWidth;
|
vBmpHdr.cx = nWidth;
|
||||||
vBmpHdr.cy = nHeight;
|
vBmpHdr.cy = nHeight;
|
||||||
vBmpHdr.cPlanes = 1;
|
vBmpHdr.cPlanes = 1;
|
||||||
vBmpHdr.cBitCount = nDepth;
|
vBmpHdr.cBitCount = (USHORT)nDepth;
|
||||||
|
|
||||||
pEntry->m_hBitmap = (WXHBITMAP) ::GpiCreateBitmap( hPS
|
pEntry->m_hBitmap = (WXHBITMAP) ::GpiCreateBitmap( hPS
|
||||||
,&vBmpHdr
|
,&vBmpHdr
|
||||||
@@ -244,7 +244,7 @@ wxDCCacheEntry* wxDC::FindBitmapInCache(
|
|||||||
vBmpHdr.cx = nWidth;
|
vBmpHdr.cx = nWidth;
|
||||||
vBmpHdr.cy = nHeight;
|
vBmpHdr.cy = nHeight;
|
||||||
vBmpHdr.cPlanes = 1;
|
vBmpHdr.cPlanes = 1;
|
||||||
vBmpHdr.cBitCount = nDepth;
|
vBmpHdr.cBitCount = (USHORT)nDepth;
|
||||||
|
|
||||||
WXHBITMAP hBitmap = (WXHBITMAP) ::GpiCreateBitmap( hPS
|
WXHBITMAP hBitmap = (WXHBITMAP) ::GpiCreateBitmap( hPS
|
||||||
,&vBmpHdr
|
,&vBmpHdr
|
||||||
@@ -774,7 +774,10 @@ void wxDC::DoDrawArc(
|
|||||||
vPtlArc[0].y = vYm;
|
vPtlArc[0].y = vYm;
|
||||||
vPtlArc[1].x = vX2;
|
vPtlArc[1].x = vX2;
|
||||||
vPtlArc[1].y = vY2;
|
vPtlArc[1].y = vY2;
|
||||||
|
#ifndef __WATCOMC__
|
||||||
|
// FIXME: incomplete headers ???
|
||||||
::GpiPointArc(m_hPS, vPtlArc); // Draws the arc
|
::GpiPointArc(m_hPS, vPtlArc); // Draws the arc
|
||||||
|
#endif
|
||||||
CalcBoundingBox( (wxCoord)(vXc - dRadius)
|
CalcBoundingBox( (wxCoord)(vXc - dRadius)
|
||||||
,(wxCoord)(vYc - dRadius)
|
,(wxCoord)(vYc - dRadius)
|
||||||
);
|
);
|
||||||
@@ -1291,7 +1294,9 @@ void wxDC::DoDrawBitmap(
|
|||||||
, bool bUseMask
|
, bool bUseMask
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
if (!IsKindOf(CLASSINFO(wxPrinterDC)))
|
if (!IsKindOf(CLASSINFO(wxPrinterDC)))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
HBITMAP hBitmap = (HBITMAP)rBmp.GetHBITMAP();
|
HBITMAP hBitmap = (HBITMAP)rBmp.GetHBITMAP();
|
||||||
HBITMAP hBitmapOld = NULLHANDLE;
|
HBITMAP hBitmapOld = NULLHANDLE;
|
||||||
@@ -1871,9 +1876,7 @@ void wxDC::DoDrawRotatedText(
|
|||||||
// set GDI objects
|
// set GDI objects
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDC::DoSelectPalette(
|
void wxDC::DoSelectPalette( bool WXUNUSED(bRealize) )
|
||||||
bool bRealize
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Set the old object temporarily, in case the assignment deletes an object
|
// Set the old object temporarily, in case the assignment deletes an object
|
||||||
@@ -2166,9 +2169,7 @@ void wxDC::SetRop(
|
|||||||
::GpiSetMix((HPS)hDC, lCRop);
|
::GpiSetMix((HPS)hDC, lCRop);
|
||||||
} // end of wxDC::SetRop
|
} // end of wxDC::SetRop
|
||||||
|
|
||||||
bool wxDC::StartDoc(
|
bool wxDC::StartDoc( const wxString& WXUNUSED(rsMessage) )
|
||||||
const wxString& rsMessage
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// We might be previewing, so return true to let it continue.
|
// We might be previewing, so return true to let it continue.
|
||||||
return true;
|
return true;
|
||||||
@@ -2488,19 +2489,17 @@ wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
|||||||
// bit blit
|
// bit blit
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxDC::DoBlit(
|
bool wxDC::DoBlit( wxCoord vXdest,
|
||||||
wxCoord vXdest
|
wxCoord vYdest,
|
||||||
, wxCoord vYdest
|
wxCoord vWidth,
|
||||||
, wxCoord vWidth
|
wxCoord vHeight,
|
||||||
, wxCoord vHeight
|
wxDC* pSource,
|
||||||
, wxDC* pSource
|
wxCoord vXsrc,
|
||||||
, wxCoord vXsrc
|
wxCoord vYsrc,
|
||||||
, wxCoord vYsrc
|
int nRop,
|
||||||
, int nRop
|
bool bUseMask,
|
||||||
, bool bUseMask
|
wxCoord WXUNUSED(vXsrcMask),
|
||||||
, wxCoord vXsrcMask
|
wxCoord WXUNUSED(vYsrcMask) )
|
||||||
, wxCoord vYsrcMask
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxMask* pMask = NULL;
|
wxMask* pMask = NULL;
|
||||||
CHARBUNDLE vCbnd;
|
CHARBUNDLE vCbnd;
|
||||||
@@ -2594,7 +2593,6 @@ bool wxDC::DoBlit(
|
|||||||
vBmpHdr.cBitCount = 24;
|
vBmpHdr.cBitCount = 24;
|
||||||
|
|
||||||
#if wxUSE_DC_CACHEING
|
#if wxUSE_DC_CACHEING
|
||||||
if (true)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// create a temp buffer bitmap and DCs to access it and the mask
|
// create a temp buffer bitmap and DCs to access it and the mask
|
||||||
@@ -2613,9 +2611,9 @@ bool wxDC::DoBlit(
|
|||||||
hPSMask = pDCCacheEntry1->m_hPS;
|
hPSMask = pDCCacheEntry1->m_hPS;
|
||||||
hDCBuffer = (HDC)pDCCacheEntry2->m_hPS;
|
hDCBuffer = (HDC)pDCCacheEntry2->m_hPS;
|
||||||
hBufBitmap = (HBITMAP)pBitmapCacheEntry->m_hBitmap;
|
hBufBitmap = (HBITMAP)pBitmapCacheEntry->m_hBitmap;
|
||||||
|
wxUnusedVar(hDCMask);
|
||||||
}
|
}
|
||||||
else
|
#else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
hDCMask = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDOP, NULLHANDLE);
|
hDCMask = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDOP, NULLHANDLE);
|
||||||
hDCBuffer = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDOP, NULLHANDLE);
|
hDCBuffer = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDOP, NULLHANDLE);
|
||||||
@@ -2623,6 +2621,7 @@ bool wxDC::DoBlit(
|
|||||||
hPSBuffer = ::GpiCreatePS(vHabmain, hDCBuffer, &vSize, PU_PELS | GPIT_MICRO | GPIA_ASSOC);
|
hPSBuffer = ::GpiCreatePS(vHabmain, hDCBuffer, &vSize, PU_PELS | GPIT_MICRO | GPIA_ASSOC);
|
||||||
hBufBitmap = ::GpiCreateBitmap(GetHPS(), &vBmpHdr, 0L, NULL, NULL);
|
hBufBitmap = ::GpiCreateBitmap(GetHPS(), &vBmpHdr, 0L, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
POINTL aPoint1[4] = { {0, 0}
|
POINTL aPoint1[4] = { {0, 0}
|
||||||
,{vWidth, vHeight}
|
,{vWidth, vHeight}
|
||||||
@@ -2800,10 +2799,8 @@ void wxDC::DoGetSize(
|
|||||||
}
|
}
|
||||||
}; // end of wxDC::DoGetSize(
|
}; // end of wxDC::DoGetSize(
|
||||||
|
|
||||||
void wxDC::DoGetSizeMM(
|
void wxDC::DoGetSizeMM( int* pnWidth,
|
||||||
int* pnWidth
|
int* pnHeight ) const
|
||||||
, int* pnHeight
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
LONG lArray[CAPS_VERTICAL_RESOLUTION];
|
LONG lArray[CAPS_VERTICAL_RESOLUTION];
|
||||||
|
|
||||||
@@ -2813,17 +2810,19 @@ void wxDC::DoGetSizeMM(
|
|||||||
,lArray
|
,lArray
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
int nWidth;
|
if(pnWidth)
|
||||||
int nHeight;
|
{
|
||||||
int nHorzRes;
|
int nWidth = lArray[CAPS_WIDTH];
|
||||||
int nVertRes;
|
int nHorzRes = lArray[CAPS_HORIZONTAL_RESOLUTION]; // returns pel/meter
|
||||||
|
*pnWidth = (nHorzRes/1000) * nWidth;
|
||||||
|
}
|
||||||
|
|
||||||
nWidth = lArray[CAPS_WIDTH];
|
if(pnHeight)
|
||||||
nHeight = lArray[CAPS_HEIGHT];
|
{
|
||||||
nHorzRes = lArray[CAPS_HORIZONTAL_RESOLUTION]; // returns pel/meter
|
int nHeight = lArray[CAPS_HEIGHT];
|
||||||
nVertRes = lArray[CAPS_VERTICAL_RESOLUTION]; // returns pel/meter
|
int nVertRes = lArray[CAPS_VERTICAL_RESOLUTION]; // returns pel/meter
|
||||||
nWidth = (nHorzRes/1000) * nWidth;
|
*pnHeight = (nVertRes/1000) * nHeight;
|
||||||
nHeight = (nVertRes/1000) * nHeight;
|
}
|
||||||
}
|
}
|
||||||
}; // end of wxDC::DoGetSizeMM
|
}; // end of wxDC::DoGetSizeMM
|
||||||
|
|
||||||
@@ -2851,7 +2850,8 @@ wxSize wxDC::GetPPI() const
|
|||||||
nWidth = (int)((nHorzRes/39.3) * nPelWidth);
|
nWidth = (int)((nHorzRes/39.3) * nPelWidth);
|
||||||
nHeight = (int)((nVertRes/39.3) * nPelHeight);
|
nHeight = (int)((nVertRes/39.3) * nPelHeight);
|
||||||
}
|
}
|
||||||
return (wxSize(nWidth,nHeight));
|
wxSize ppisize(nWidth, nHeight);
|
||||||
|
return ppisize;
|
||||||
} // end of wxDC::GetPPI
|
} // end of wxDC::GetPPI
|
||||||
|
|
||||||
void wxDC::SetLogicalScale(
|
void wxDC::SetLogicalScale(
|
||||||
@@ -2862,6 +2862,3 @@ void wxDC::SetLogicalScale(
|
|||||||
m_logicalScaleX = dX;
|
m_logicalScaleX = dX;
|
||||||
m_logicalScaleY = dY;
|
m_logicalScaleY = dY;
|
||||||
}; // end of wxDC::SetLogicalScale
|
}; // end of wxDC::SetLogicalScale
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -58,9 +58,7 @@ void wxMemoryDC::Init()
|
|||||||
memset(&m_vRclPaint, 0, sizeof(m_vRclPaint));
|
memset(&m_vRclPaint, 0, sizeof(m_vRclPaint));
|
||||||
} // end of wxMemoryDC::Init
|
} // end of wxMemoryDC::Init
|
||||||
|
|
||||||
bool wxMemoryDC::CreateCompatible(
|
bool wxMemoryDC::CreateCompatible( wxDC* WXUNUSED(pDC) )
|
||||||
wxDC* pDC
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
HPS hPS;
|
HPS hPS;
|
||||||
@@ -78,8 +76,8 @@ bool wxMemoryDC::CreateCompatible(
|
|||||||
{
|
{
|
||||||
m_hPS = hPS;
|
m_hPS = hPS;
|
||||||
m_hDC = hDC;
|
m_hDC = hDC;
|
||||||
m_ok = TRUE;
|
m_ok = true;
|
||||||
m_bOwnsDC = TRUE;
|
m_bOwnsDC = true;
|
||||||
//
|
//
|
||||||
// Set the wxWidgets color table
|
// Set the wxWidgets color table
|
||||||
//
|
//
|
||||||
@@ -117,7 +115,7 @@ bool wxMemoryDC::CreateCompatible(
|
|||||||
//
|
//
|
||||||
// As we created the DC, we must delete it in the dtor
|
// As we created the DC, we must delete it in the dtor
|
||||||
//
|
//
|
||||||
m_bOwnsDC = TRUE;
|
m_bOwnsDC = true;
|
||||||
m_ok = m_hDC != 0;
|
m_ok = m_hDC != 0;
|
||||||
return m_ok;
|
return m_ok;
|
||||||
} // end of wxMemoryDC::CreateCompatible
|
} // end of wxMemoryDC::CreateCompatible
|
||||||
@@ -202,4 +200,3 @@ void wxMemoryDC::DoGetSize(
|
|||||||
*pWidth = m_vSelectedBitmap.GetWidth();
|
*pWidth = m_vSelectedBitmap.GetWidth();
|
||||||
*pHeight = m_vSelectedBitmap.GetHeight();
|
*pHeight = m_vSelectedBitmap.GetHeight();
|
||||||
} // end of wxMemoryDC::DoGetSize
|
} // end of wxMemoryDC::DoGetSize
|
||||||
|
|
||||||
|
@@ -89,15 +89,13 @@ void wxDialog::Init()
|
|||||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||||
} // end of wxDialog::Init
|
} // end of wxDialog::Init
|
||||||
|
|
||||||
bool wxDialog::Create(
|
bool wxDialog::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
wxWindowID vId,
|
||||||
, wxWindowID vId
|
const wxString& rsTitle,
|
||||||
, const wxString& rsTitle
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
long lStyle,
|
||||||
, long lStyle
|
const wxString& rsName )
|
||||||
, const wxString& rsName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);
|
SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);
|
||||||
@@ -120,7 +118,8 @@ bool wxDialog::Create(
|
|||||||
,lStyle
|
,lStyle
|
||||||
,rsName
|
,rsName
|
||||||
))
|
))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -128,7 +127,7 @@ bool wxDialog::Create(
|
|||||||
//
|
//
|
||||||
if (!rsTitle.IsNull())
|
if (!rsTitle.IsNull())
|
||||||
SetTitle(rsTitle);
|
SetTitle(rsTitle);
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxDialog::Create
|
} // end of wxDialog::Create
|
||||||
|
|
||||||
// deprecated ctor
|
// deprecated ctor
|
||||||
@@ -156,7 +155,7 @@ void wxDialog::SetModal(
|
|||||||
|
|
||||||
wxDialog::~wxDialog()
|
wxDialog::~wxDialog()
|
||||||
{
|
{
|
||||||
m_isBeingDeleted = TRUE;
|
m_isBeingDeleted = true;
|
||||||
|
|
||||||
// this will also reenable all the other windows for a modal dialog
|
// this will also reenable all the other windows for a modal dialog
|
||||||
Show(false);
|
Show(false);
|
||||||
@@ -280,7 +279,7 @@ bool wxDialog::Show(
|
|||||||
} // end of wxDialog::Show
|
} // 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()
|
int wxDialog::ShowModal()
|
||||||
{
|
{
|
||||||
@@ -372,18 +371,14 @@ void wxDialog::EndDialog(int rc)
|
|||||||
// wxWin event handlers
|
// wxWin event handlers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDialog::OnApply(
|
void wxDialog::OnApply( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (Validate())
|
if (Validate())
|
||||||
TransferDataFromWindow();
|
TransferDataFromWindow();
|
||||||
} // end of wxDialog::OnApply
|
} // end of wxDialog::OnApply
|
||||||
|
|
||||||
// Standard buttons
|
// Standard buttons
|
||||||
void wxDialog::OnOK(
|
void wxDialog::OnOK( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if ( Validate() && TransferDataFromWindow() )
|
if ( Validate() && TransferDataFromWindow() )
|
||||||
{
|
{
|
||||||
@@ -391,16 +386,12 @@ void wxDialog::OnOK(
|
|||||||
}
|
}
|
||||||
} // end of wxDialog::OnOK
|
} // end of wxDialog::OnOK
|
||||||
|
|
||||||
void wxDialog::OnCancel(
|
void wxDialog::OnCancel( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
EndDialog(wxID_CANCEL);
|
EndDialog(wxID_CANCEL);
|
||||||
} // end of wxDialog::OnCancel
|
} // end of wxDialog::OnCancel
|
||||||
|
|
||||||
void wxDialog::OnCloseWindow(
|
void wxDialog::OnCloseWindow( wxCloseEvent& WXUNUSED(rEvent) )
|
||||||
wxCloseEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// We'll send a Cancel message by default, which may close the dialog.
|
// We'll send a Cancel message by default, which may close the dialog.
|
||||||
@@ -435,9 +426,7 @@ void wxDialog::OnCloseWindow(
|
|||||||
closing.DeleteObject(this);
|
closing.DeleteObject(this);
|
||||||
} // end of wxDialog::OnCloseWindow
|
} // end of wxDialog::OnCloseWindow
|
||||||
|
|
||||||
void wxDialog::OnSysColourChanged(
|
void wxDialog::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(rEvent) )
|
||||||
wxSysColourChangedEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||||
Refresh();
|
Refresh();
|
||||||
@@ -470,4 +459,3 @@ MRESULT wxDialog::OS2WindowProc(
|
|||||||
);
|
);
|
||||||
return rc;
|
return rc;
|
||||||
} // end of wxDialog::OS2WindowProc
|
} // end of wxDialog::OS2WindowProc
|
||||||
|
|
||||||
|
@@ -13,6 +13,11 @@
|
|||||||
#pragma implementation "dnd.h"
|
#pragma implementation "dnd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
@@ -22,8 +27,6 @@
|
|||||||
#define INCL_DOS
|
#define INCL_DOS
|
||||||
#include <os2.h>
|
#include <os2.h>
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// global
|
// global
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
#include "wx/msgdlg.h"
|
#include "wx/msgdlg.h"
|
||||||
@@ -55,6 +57,7 @@
|
|||||||
#ifndef MAXEXT
|
#ifndef MAXEXT
|
||||||
# define MAXEXT 5
|
# define MAXEXT 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
|
IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -207,7 +210,7 @@ int wxFileDialog::ShowModal()
|
|||||||
}
|
}
|
||||||
if (nCount == 0)
|
if (nCount == 0)
|
||||||
sDir += m_fileName;
|
sDir += m_fileName;
|
||||||
if (sDir.IsEmpty())
|
if (sDir.empty())
|
||||||
sDir = wxT("*.*");
|
sDir = wxT("*.*");
|
||||||
wxStrcpy((wxChar*)vFileDlg.szFullFile, sDir);
|
wxStrcpy((wxChar*)vFileDlg.szFullFile, sDir);
|
||||||
sFilterBuffer = sDir;
|
sFilterBuffer = sDir;
|
||||||
@@ -253,7 +256,7 @@ int wxFileDialog::ShowModal()
|
|||||||
,&m_fileName
|
,&m_fileName
|
||||||
,&sExt
|
,&sExt
|
||||||
);
|
);
|
||||||
if (zFileNameBuffer[nIdx] == wxT('.') || sExt.IsEmpty())
|
if (zFileNameBuffer[nIdx] == wxT('.') || sExt.empty())
|
||||||
{
|
{
|
||||||
zFileNameBuffer[nIdx] = wxT('\0');
|
zFileNameBuffer[nIdx] = wxT('\0');
|
||||||
|
|
||||||
@@ -321,3 +324,4 @@ int wxFileDialog::ShowModal()
|
|||||||
return wxID_CANCEL;
|
return wxID_CANCEL;
|
||||||
} // end of wxFileDialog::ShowModal
|
} // end of wxFileDialog::ShowModal
|
||||||
|
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
|
@@ -9,6 +9,9 @@
|
|||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// declarations
|
// declarations
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -17,10 +20,6 @@
|
|||||||
// headers
|
// headers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <malloc.h>
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
|
||||||
#include "wx/wxprec.h"
|
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "wx/setup.h"
|
#include "wx/setup.h"
|
||||||
@@ -39,6 +38,8 @@
|
|||||||
|
|
||||||
#include "wx/tokenzr.h"
|
#include "wx/tokenzr.h"
|
||||||
|
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -260,7 +261,7 @@ protected:
|
|||||||
,WXHANDLE hPS = 0
|
,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
|
// DELETED by destructor
|
||||||
//
|
//
|
||||||
bool m_bTemporary;
|
bool m_bTemporary;
|
||||||
@@ -347,13 +348,13 @@ void wxFontRefData::Init(
|
|||||||
m_hFont = hFont;
|
m_hFont = hFont;
|
||||||
m_nFontId = (int)hFont;
|
m_nFontId = (int)hFont;
|
||||||
|
|
||||||
m_bNativeFontInfoOk = TRUE;
|
m_bNativeFontInfoOk = true;
|
||||||
m_vNativeFontInfo = rInfo;
|
m_vNativeFontInfo = rInfo;
|
||||||
|
|
||||||
if (hPS == NULLHANDLE)
|
if (hPS == NULLHANDLE)
|
||||||
{
|
{
|
||||||
m_hPS = ::WinGetPS(HWND_DESKTOP);
|
m_hPS = ::WinGetPS(HWND_DESKTOP);
|
||||||
m_bInternalPS = TRUE;
|
m_bInternalPS = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_hPS = (HPS)hPS;
|
m_hPS = (HPS)hPS;
|
||||||
@@ -369,9 +370,7 @@ wxFontRefData::~wxFontRefData()
|
|||||||
Free();
|
Free();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFontRefData::Alloc(
|
bool wxFontRefData::Alloc( wxFont* pFont )
|
||||||
wxFont* pFont
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxString sFaceName;
|
wxString sFaceName;
|
||||||
long flId = m_hFont;
|
long flId = m_hFont;
|
||||||
@@ -389,7 +388,7 @@ bool wxFontRefData::Alloc(
|
|||||||
,sFaceName
|
,sFaceName
|
||||||
,pFont
|
,pFont
|
||||||
);
|
);
|
||||||
m_bNativeFontInfoOk = TRUE;
|
m_bNativeFontInfoOk = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -514,7 +513,7 @@ bool wxFontRefData::Alloc(
|
|||||||
// Select the font into the Presentation space
|
// Select the font into the Presentation space
|
||||||
//
|
//
|
||||||
::GpiSetCharSet(m_hPS, flId); // sets font for presentation space
|
::GpiSetCharSet(m_hPS, flId); // sets font for presentation space
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxFontRefData::Alloc
|
} // end of wxFontRefData::Alloc
|
||||||
|
|
||||||
void wxFontRefData::Free()
|
void wxFontRefData::Free()
|
||||||
@@ -741,9 +740,7 @@ void wxNativeFontInfo::SetFamily(
|
|||||||
}
|
}
|
||||||
} // end of wxNativeFontInfo::SetFamily
|
} // end of wxNativeFontInfo::SetFamily
|
||||||
|
|
||||||
void wxNativeFontInfo::SetEncoding(
|
void wxNativeFontInfo::SetEncoding( wxFontEncoding eEncoding )
|
||||||
wxFontEncoding eEncoding
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxNativeEncodingInfo vInfo;
|
wxNativeEncodingInfo vInfo;
|
||||||
|
|
||||||
@@ -771,12 +768,10 @@ void wxNativeFontInfo::SetEncoding(
|
|||||||
vInfo.charset = 850;
|
vInfo.charset = 850;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fa.usCodePage = vInfo.charset;
|
fa.usCodePage = (USHORT)vInfo.charset;
|
||||||
} // end of wxNativeFontInfo::SetFaceName
|
} // end of wxNativeFontInfo::SetFaceName
|
||||||
|
|
||||||
bool wxNativeFontInfo::FromString(
|
bool wxNativeFontInfo::FromString( const wxString& rsStr )
|
||||||
const wxString& rsStr
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
long lVal;
|
long lVal;
|
||||||
|
|
||||||
@@ -839,7 +834,7 @@ bool wxNativeFontInfo::FromString(
|
|||||||
if(!sToken)
|
if(!sToken)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
wxStrcpy((wxChar*)fa.szFacename, sToken.c_str());
|
wxStrcpy((wxChar*)fa.szFacename, sToken.c_str());
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxNativeFontInfo::FromString
|
} // end of wxNativeFontInfo::FromString
|
||||||
|
|
||||||
wxString wxNativeFontInfo::ToString() const
|
wxString wxNativeFontInfo::ToString() const
|
||||||
@@ -870,17 +865,15 @@ void wxFont::Init()
|
|||||||
{
|
{
|
||||||
} // end of wxFont::Init
|
} // end of wxFont::Init
|
||||||
|
|
||||||
bool wxFont::Create(
|
bool wxFont::Create( const wxNativeFontInfo& rInfo,
|
||||||
const wxNativeFontInfo& rInfo
|
WXHFONT hFont )
|
||||||
, WXHFONT hFont
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UnRef();
|
UnRef();
|
||||||
m_refData = new wxFontRefData( rInfo
|
m_refData = new wxFontRefData( rInfo
|
||||||
,hFont
|
,hFont
|
||||||
);
|
);
|
||||||
RealizeResource();
|
RealizeResource();
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxFont::Create
|
} // end of wxFont::Create
|
||||||
|
|
||||||
wxFont::wxFont(
|
wxFont::wxFont(
|
||||||
@@ -897,15 +890,13 @@ wxFont::wxFont(
|
|||||||
// Constructor for a font. Note that the real construction is done
|
// Constructor for a font. Note that the real construction is done
|
||||||
// in wxDC::SetFont, when information is available about scaling etc.
|
// in wxDC::SetFont, when information is available about scaling etc.
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool wxFont::Create(
|
bool wxFont::Create( int nPointSize,
|
||||||
int nPointSize
|
int nFamily,
|
||||||
, int nFamily
|
int nStyle,
|
||||||
, int nStyle
|
int nWeight,
|
||||||
, int nWeight
|
bool bUnderlined,
|
||||||
, bool bUnderlined
|
const wxString& rsFaceName,
|
||||||
, const wxString& rsFaceName
|
wxFontEncoding vEncoding )
|
||||||
, wxFontEncoding vEncoding
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UnRef();
|
UnRef();
|
||||||
|
|
||||||
@@ -926,7 +917,7 @@ bool wxFont::Create(
|
|||||||
,vEncoding
|
,vEncoding
|
||||||
);
|
);
|
||||||
RealizeResource();
|
RealizeResource();
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxFont::Create
|
} // end of wxFont::Create
|
||||||
|
|
||||||
wxFont::~wxFont()
|
wxFont::~wxFont()
|
||||||
@@ -944,21 +935,19 @@ bool wxFont::RealizeResource()
|
|||||||
{
|
{
|
||||||
if ( GetResourceHandle() )
|
if ( GetResourceHandle() )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return M_FONTDATA->Alloc(this);
|
return M_FONTDATA->Alloc(this);
|
||||||
} // end of wxFont::RealizeResource
|
} // end of wxFont::RealizeResource
|
||||||
|
|
||||||
bool wxFont::FreeResource(
|
bool wxFont::FreeResource( bool WXUNUSED(bForce) )
|
||||||
bool bForce
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (GetResourceHandle())
|
if (GetResourceHandle())
|
||||||
{
|
{
|
||||||
M_FONTDATA->Free();
|
M_FONTDATA->Free();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
} // end of wxFont::FreeResource
|
} // end of wxFont::FreeResource
|
||||||
|
|
||||||
WXHANDLE wxFont::GetResourceHandle()
|
WXHANDLE wxFont::GetResourceHandle()
|
||||||
@@ -1167,4 +1156,3 @@ void wxFont::SetPS(
|
|||||||
|
|
||||||
RealizeResource();
|
RealizeResource();
|
||||||
} // end of wxFont::SetPS
|
} // end of wxFont::SetPS
|
||||||
|
|
||||||
|
@@ -66,7 +66,7 @@ private:
|
|||||||
// if not empty, enum only the fonts with this facename
|
// if not empty, enum only the fonts with this facename
|
||||||
wxString m_facename;
|
wxString m_facename;
|
||||||
|
|
||||||
// if TRUE, enum only fixed fonts
|
// if true, enum only fixed fonts
|
||||||
bool m_fixedOnly;
|
bool m_fixedOnly;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
|
|||||||
m_charset = info.charset;
|
m_charset = info.charset;
|
||||||
m_facename = info.facename;
|
m_facename = info.facename;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define wxFONTENUMPROC FONTENUMPROC
|
#define wxFONTENUMPROC FONTENUMPROC
|
||||||
@@ -153,7 +153,7 @@ bool wxFontEnumeratorHelper::OnFont(/*const LPLOGFONT lf,
|
|||||||
if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH )
|
if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH )
|
||||||
{
|
{
|
||||||
// not a fixed pitch font
|
// not a fixed pitch font
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,13 +162,13 @@ bool wxFontEnumeratorHelper::OnFont(/*const LPLOGFONT lf,
|
|||||||
// check that we have the right encoding
|
// check that we have the right encoding
|
||||||
if ( lf->lfCharSet != m_charset )
|
if ( lf->lfCharSet != m_charset )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_fontEnum->OnFacename(lf->lfFaceName);
|
return m_fontEnum->OnFacename(lf->lfFaceName);
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -187,14 +187,14 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
|
|||||||
}
|
}
|
||||||
// else: no such fonts, unknown encoding
|
// 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"));
|
wxFAIL_MSG(wxT("TODO"));
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -8,10 +8,6 @@
|
|||||||
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
#define DEBUG_PRINTF(NAME) { static int raz=0; \
|
|
||||||
printf( #NAME " %i\n",raz); fflush(stdout); \
|
|
||||||
raz++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// declarations
|
// declarations
|
||||||
@@ -28,6 +24,13 @@
|
|||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#define DEBUG_PRINTF(NAME) \
|
||||||
|
{ \
|
||||||
|
static int raz=0; \
|
||||||
|
printf( #NAME " %i\n",raz); fflush(stdout); \
|
||||||
|
raz++; \
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
@@ -54,9 +57,7 @@
|
|||||||
// convert to/from the string representation: format is
|
// convert to/from the string representation: format is
|
||||||
// encodingid;facename[;charset]
|
// encodingid;facename[;charset]
|
||||||
|
|
||||||
bool wxNativeEncodingInfo::FromString(
|
bool wxNativeEncodingInfo::FromString( const wxString& rsStr )
|
||||||
const wxString& rsStr
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxStringTokenizer vTokenizer(rsStr, _T(";"));
|
wxStringTokenizer vTokenizer(rsStr, _T(";"));
|
||||||
wxString sEncid = vTokenizer.GetNextToken();
|
wxString sEncid = vTokenizer.GetNextToken();
|
||||||
@@ -83,7 +84,7 @@ bool wxNativeEncodingInfo::FromString(
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxNativeEncodingInfo::FromString
|
} // end of wxNativeEncodingInfo::FromString
|
||||||
|
|
||||||
wxString wxNativeEncodingInfo::ToString() const
|
wxString wxNativeEncodingInfo::ToString() const
|
||||||
@@ -103,10 +104,8 @@ wxString wxNativeEncodingInfo::ToString() const
|
|||||||
// helper functions
|
// helper functions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxGetNativeFontEncoding(
|
bool wxGetNativeFontEncoding( wxFontEncoding vEncoding,
|
||||||
wxFontEncoding vEncoding
|
wxNativeEncodingInfo* pInfo )
|
||||||
, wxNativeEncodingInfo* pInfo
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxCHECK_MSG(pInfo, FALSE, _T("bad pointer in wxGetNativeFontEncoding") );
|
wxCHECK_MSG(pInfo, FALSE, _T("bad pointer in wxGetNativeFontEncoding") );
|
||||||
if (vEncoding == wxFONTENCODING_DEFAULT)
|
if (vEncoding == wxFONTENCODING_DEFAULT)
|
||||||
@@ -168,7 +167,7 @@ bool wxGetNativeFontEncoding(
|
|||||||
pInfo->charset = 850;
|
pInfo->charset = 850;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxGetNativeFontEncoding
|
} // end of wxGetNativeFontEncoding
|
||||||
|
|
||||||
wxFontEncoding wxGetFontEncFromCharSet(
|
wxFontEncoding wxGetFontEncFromCharSet(
|
||||||
@@ -223,9 +222,7 @@ wxFontEncoding wxGetFontEncFromCharSet(
|
|||||||
return eFontEncoding;
|
return eFontEncoding;
|
||||||
} // end of wxGetNativeFontEncoding
|
} // end of wxGetNativeFontEncoding
|
||||||
|
|
||||||
bool wxTestFontEncoding(
|
bool wxTestFontEncoding( const wxNativeEncodingInfo& rInfo )
|
||||||
const wxNativeEncodingInfo& rInfo
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
FATTRS vLogFont;
|
FATTRS vLogFont;
|
||||||
HPS hPS;
|
HPS hPS;
|
||||||
@@ -234,7 +231,7 @@ bool wxTestFontEncoding(
|
|||||||
|
|
||||||
memset(&vLogFont, '\0', sizeof(FATTRS)); // all default values
|
memset(&vLogFont, '\0', sizeof(FATTRS)); // all default values
|
||||||
vLogFont.usRecordLength = sizeof(FATTRS);
|
vLogFont.usRecordLength = sizeof(FATTRS);
|
||||||
vLogFont.usCodePage = rInfo.charset;
|
vLogFont.usCodePage = (USHORT)rInfo.charset;
|
||||||
vLogFont.lMaxBaselineExt = 0L; // Outline fonts should use 0
|
vLogFont.lMaxBaselineExt = 0L; // Outline fonts should use 0
|
||||||
vLogFont.lAveCharWidth = 0L; // Outline fonts should use 0
|
vLogFont.lAveCharWidth = 0L; // Outline fonts should use 0
|
||||||
vLogFont.fsFontUse = FATTR_FONTUSE_OUTLINE | // only outline fonts allowed
|
vLogFont.fsFontUse = FATTR_FONTUSE_OUTLINE | // only outline fonts allowed
|
||||||
@@ -252,7 +249,7 @@ bool wxTestFontEncoding(
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
::WinReleasePS(hPS);
|
::WinReleasePS(hPS);
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxTestFontEncoding
|
} // end of wxTestFontEncoding
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -297,20 +294,18 @@ void wxConvertVectorFontSize(
|
|||||||
|
|
||||||
} // end of wxConvertVectorPointSize
|
} // end of wxConvertVectorPointSize
|
||||||
|
|
||||||
void wxFillLogFont(
|
void wxFillLogFont( LOGFONT* pFattrs, // OS2 GPI FATTRS
|
||||||
LOGFONT* pFattrs // OS2 GPI FATTRS
|
PFACENAMEDESC pFaceName,
|
||||||
, PFACENAMEDESC pFaceName
|
HPS* phPS,
|
||||||
, HPS* phPS
|
bool* pbInternalPS,
|
||||||
, bool* pbInternalPS
|
long* pflId,
|
||||||
, long* pflId
|
wxString& sFaceName,
|
||||||
, wxString& sFaceName
|
wxFont* pFont )
|
||||||
, wxFont* pFont
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
LONG lNumFonts = 0L; // For system font count
|
LONG lNumFonts = 0L; // For system font count
|
||||||
ERRORID vError; // For logging API errors
|
ERRORID vError; // For logging API errors
|
||||||
LONG lTemp = 0L;
|
LONG lTemp = 0L;
|
||||||
bool bInternalPS = FALSE; // if we have to create one
|
bool bInternalPS = false; // if we have to create one
|
||||||
PFONTMETRICS pFM = NULL;
|
PFONTMETRICS pFM = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -320,7 +315,7 @@ void wxFillLogFont(
|
|||||||
if (!*phPS)
|
if (!*phPS)
|
||||||
{
|
{
|
||||||
*phPS = ::WinGetPS(HWND_DESKTOP);
|
*phPS = ::WinGetPS(HWND_DESKTOP);
|
||||||
bInternalPS = TRUE;
|
bInternalPS = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -712,4 +707,3 @@ int wxGpiStrcmp(
|
|||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
|
|||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
|
|
||||||
#if wxUSE_NATIVE_STATUSBAR
|
#if wxUSE_NATIVE_STATUSBAR
|
||||||
bool wxFrame::m_bUseNativeStatusBar = TRUE;
|
bool wxFrame::m_bUseNativeStatusBar = true;
|
||||||
#else
|
#else
|
||||||
bool wxFrame::m_bUseNativeStatusBar = FALSE;
|
bool wxFrame::m_bUseNativeStatusBar = FALSE;
|
||||||
#endif
|
#endif
|
||||||
@@ -122,15 +122,13 @@ void wxFrame::Init()
|
|||||||
|
|
||||||
} // end of wxFrame::Init
|
} // end of wxFrame::Init
|
||||||
|
|
||||||
bool wxFrame::Create(
|
bool wxFrame::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
wxWindowID vId,
|
||||||
, wxWindowID vId
|
const wxString& rsTitle,
|
||||||
, const wxString& rsTitle
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
long lStyle,
|
||||||
, long lStyle
|
const wxString& rsName )
|
||||||
, const wxString& rsName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (!wxTopLevelWindow::Create( pParent
|
if (!wxTopLevelWindow::Create( pParent
|
||||||
,vId
|
,vId
|
||||||
@@ -140,13 +138,13 @@ bool wxFrame::Create(
|
|||||||
,lStyle
|
,lStyle
|
||||||
,rsName
|
,rsName
|
||||||
))
|
))
|
||||||
return FALSE;
|
return false;
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxFrame::Create
|
} // end of wxFrame::Create
|
||||||
|
|
||||||
wxFrame::~wxFrame()
|
wxFrame::~wxFrame()
|
||||||
{
|
{
|
||||||
m_isBeingDeleted = TRUE;
|
m_isBeingDeleted = true;
|
||||||
DeleteAllBars();
|
DeleteAllBars();
|
||||||
} // end of wxFrame::~wxFrame
|
} // end of wxFrame::~wxFrame
|
||||||
|
|
||||||
@@ -476,18 +474,15 @@ void wxFrame::OnSysColourChanged(
|
|||||||
wxWindow::OnSysColourChanged(rEvent);
|
wxWindow::OnSysColourChanged(rEvent);
|
||||||
} // end of wxFrame::OnSysColourChanged
|
} // end of wxFrame::OnSysColourChanged
|
||||||
|
|
||||||
// Pass TRUE to show full screen, FALSE to restore.
|
// Pass true to show full screen, false to restore.
|
||||||
bool wxFrame::ShowFullScreen(
|
bool wxFrame::ShowFullScreen( bool bShow, long lStyle )
|
||||||
bool bShow
|
|
||||||
, long lStyle
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (bShow)
|
if (bShow)
|
||||||
{
|
{
|
||||||
if (IsFullScreen())
|
if (IsFullScreen())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
m_bFsIsShowing = TRUE;
|
m_bFsIsShowing = true;
|
||||||
m_lFsStyle = lStyle;
|
m_lFsStyle = lStyle;
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
@@ -589,9 +584,7 @@ bool wxFrame::ShowFullScreen(
|
|||||||
//
|
//
|
||||||
nHeight = vRect.yTop - vRect.yBottom;
|
nHeight = vRect.yTop - vRect.yBottom;
|
||||||
|
|
||||||
SetSize( nWidth
|
SetSize( nWidth, nHeight);
|
||||||
,nHeight
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now flush the window style cache and actually go full-screen
|
// Now flush the window style cache and actually go full-screen
|
||||||
@@ -605,21 +598,18 @@ bool wxFrame::ShowFullScreen(
|
|||||||
,SWP_SIZE | SWP_SHOW
|
,SWP_SIZE | SWP_SHOW
|
||||||
);
|
);
|
||||||
|
|
||||||
wxSizeEvent vEvent( wxSize( nWidth
|
wxSize sz( nWidth, nHeight );
|
||||||
,nHeight
|
wxSizeEvent vEvent( sz, GetId() );
|
||||||
)
|
|
||||||
,GetId()
|
|
||||||
);
|
|
||||||
|
|
||||||
GetEventHandler()->ProcessEvent(vEvent);
|
GetEventHandler()->ProcessEvent(vEvent);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!IsFullScreen())
|
if (!IsFullScreen())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
m_bFsIsShowing = FALSE;
|
m_bFsIsShowing = false;
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
wxToolBar* pTheToolBar = GetToolBar();
|
wxToolBar* pTheToolBar = GetToolBar();
|
||||||
@@ -630,7 +620,7 @@ bool wxFrame::ShowFullScreen(
|
|||||||
if (pTheToolBar && (m_lFsStyle & wxFULLSCREEN_NOTOOLBAR))
|
if (pTheToolBar && (m_lFsStyle & wxFULLSCREEN_NOTOOLBAR))
|
||||||
{
|
{
|
||||||
pTheToolBar->SetSize(-1, m_nFsToolBarHeight);
|
pTheToolBar->SetSize(-1, m_nFsToolBarHeight);
|
||||||
pTheToolBar->Show(TRUE);
|
pTheToolBar->Show(true);
|
||||||
}
|
}
|
||||||
#endif //wxUSE_TOOLBAR
|
#endif //wxUSE_TOOLBAR
|
||||||
|
|
||||||
@@ -775,9 +765,7 @@ void wxFrame::PositionToolBar()
|
|||||||
// Windows behaviour where child frames float independently of the parent one
|
// Windows behaviour where child frames float independently of the parent one
|
||||||
// on the desktop, but are iconized/restored with it
|
// on the desktop, but are iconized/restored with it
|
||||||
//
|
//
|
||||||
void wxFrame::IconizeChildFrames(
|
void wxFrame::IconizeChildFrames( bool WXUNUSED(bIconize) )
|
||||||
bool bIconize
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// FIXME: Generic MDI does not use Frames for the Childs, so this does _not_
|
// FIXME: Generic MDI does not use Frames for the Childs, so this does _not_
|
||||||
// work. Possibly, the right thing is simply to eliminate this
|
// work. Possibly, the right thing is simply to eliminate this
|
||||||
@@ -889,15 +877,18 @@ bool wxFrame::HandlePaint()
|
|||||||
|
|
||||||
::WinQueryWindowRect(GetHwnd(), &vRect3);
|
::WinQueryWindowRect(GetHwnd(), &vRect3);
|
||||||
|
|
||||||
|
#ifndef __WATCOMC__
|
||||||
|
// FIXME: incomplete headers ???
|
||||||
|
|
||||||
static const int nIconWidth = 32;
|
static const int nIconWidth = 32;
|
||||||
static const int nIconHeight = 32;
|
static const int nIconHeight = 32;
|
||||||
int nIconX = (int)((vRect3.xRight - nIconWidth)/2);
|
int nIconX = (int)((vRect3.xRight - nIconWidth)/2);
|
||||||
int nIconY = (int)((vRect3.yBottom + nIconHeight)/2);
|
int nIconY = (int)((vRect3.yBottom + nIconHeight)/2);
|
||||||
|
|
||||||
::WinDrawPointer(hPs, nIconX, nIconY, hIcon, DP_NORMAL);
|
::WinDrawPointer(hPs, nIconX, nIconY, hIcon, DP_NORMAL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
::WinEndPaint(hPs);
|
::WinEndPaint(hPs);
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -934,15 +925,10 @@ bool wxFrame::HandlePaint()
|
|||||||
::WinEndPaint(hPS);
|
::WinEndPaint(hPS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return true;
|
||||||
// nothing to paint - processed
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
} // end of wxFrame::HandlePaint
|
} // end of wxFrame::HandlePaint
|
||||||
|
|
||||||
bool wxFrame::HandleSize(
|
bool wxFrame::HandleSize(
|
||||||
@@ -983,7 +969,7 @@ bool wxFrame::HandleSize(
|
|||||||
//
|
//
|
||||||
IconizeChildFrames(TRUE);
|
IconizeChildFrames(TRUE);
|
||||||
(void)SendIconizeEvent();
|
(void)SendIconizeEvent();
|
||||||
m_bIconized = TRUE;
|
m_bIconized = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1019,11 +1005,9 @@ bool wxFrame::HandleSize(
|
|||||||
return bProcessed;
|
return bProcessed;
|
||||||
} // end of wxFrame::HandleSize
|
} // end of wxFrame::HandleSize
|
||||||
|
|
||||||
bool wxFrame::HandleCommand(
|
bool wxFrame::HandleCommand( WXWORD nId,
|
||||||
WXWORD nId
|
WXWORD nCmd,
|
||||||
, WXWORD nCmd
|
WXHWND hControl )
|
||||||
, WXHWND hControl
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (hControl)
|
if (hControl)
|
||||||
{
|
{
|
||||||
@@ -1033,9 +1017,7 @@ bool wxFrame::HandleCommand(
|
|||||||
wxWindow* pWin = wxFindWinFromHandle(hControl);
|
wxWindow* pWin = wxFindWinFromHandle(hControl);
|
||||||
|
|
||||||
if (pWin)
|
if (pWin)
|
||||||
return pWin->OS2Command( nCmd
|
return pWin->OS2Command( nCmd, nId );
|
||||||
,nId
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1050,19 +1032,16 @@ bool wxFrame::HandleCommand(
|
|||||||
|
|
||||||
wxCurrentPopupMenu = NULL;
|
wxCurrentPopupMenu = NULL;
|
||||||
|
|
||||||
return pPopupMenu->OS2Command( nCmd
|
return pPopupMenu->OS2Command( nCmd, nId );
|
||||||
,nId
|
|
||||||
);
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ProcessCommand(nId))
|
if (ProcessCommand(nId))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
} // end of wxFrame::HandleCommand
|
} // end of wxFrame::HandleCommand
|
||||||
|
|
||||||
bool wxFrame::HandleMenuSelect(
|
bool wxFrame::HandleMenuSelect(
|
||||||
@@ -1343,7 +1322,7 @@ MRESULT wxFrame::OS2WindowProc(
|
|||||||
return (MRESULT)mRc;
|
return (MRESULT)mRc;
|
||||||
} // wxFrame::OS2WindowProc
|
} // wxFrame::OS2WindowProc
|
||||||
|
|
||||||
void wxFrame::SetClient(WXHWND c_Hwnd)
|
void wxFrame::SetClient(WXHWND WXUNUSED(c_Hwnd))
|
||||||
{
|
{
|
||||||
// Duh...nothing to do under OS/2
|
// Duh...nothing to do under OS/2
|
||||||
}
|
}
|
||||||
@@ -1420,4 +1399,3 @@ void wxFrame::SendSizeEvent()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -163,14 +163,13 @@ protected:
|
|||||||
,int nDesiredHeight = -1
|
,int nDesiredHeight = -1
|
||||||
) = 0;
|
) = 0;
|
||||||
private:
|
private:
|
||||||
inline virtual bool Load( wxGDIImage* pImage
|
inline virtual bool Load( wxGDIImage* WXUNUSED(pImage),
|
||||||
,int nId
|
int WXUNUSED(nId),
|
||||||
,long lFlags
|
long WXUNUSED(lFlags),
|
||||||
,int nDesiredWidth
|
int WXUNUSED(nDesiredWidth),
|
||||||
,int nDesiredHeight
|
int WXUNUSED(nDesiredHeight) )
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -237,9 +236,7 @@ wxGDIImageHandlerList wxGDIImage::ms_handlers;
|
|||||||
// wxGDIImage functions forwarded to wxGDIImageRefData
|
// wxGDIImage functions forwarded to wxGDIImageRefData
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxGDIImage::FreeResource(
|
bool wxGDIImage::FreeResource( bool WXUNUSED(bForce) )
|
||||||
bool WXUNUSED(bForce)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if ( !IsNull() )
|
if ( !IsNull() )
|
||||||
{
|
{
|
||||||
@@ -247,7 +244,7 @@ bool wxGDIImage::FreeResource(
|
|||||||
GetGDIImageData()->m_hHandle = 0;
|
GetGDIImageData()->m_hHandle = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
WXHANDLE wxGDIImage::GetResourceHandle()
|
WXHANDLE wxGDIImage::GetResourceHandle()
|
||||||
@@ -259,33 +256,27 @@ WXHANDLE wxGDIImage::GetResourceHandle()
|
|||||||
// wxGDIImage handler stuff
|
// wxGDIImage handler stuff
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxGDIImage::AddHandler(
|
void wxGDIImage::AddHandler( wxGDIImageHandler* pHandler )
|
||||||
wxGDIImageHandler* pHandler
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ms_handlers.Append(pHandler);
|
ms_handlers.Append(pHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGDIImage::InsertHandler(
|
void wxGDIImage::InsertHandler( wxGDIImageHandler* pHandler )
|
||||||
wxGDIImageHandler* pHandler
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ms_handlers.Insert(pHandler);
|
ms_handlers.Insert(pHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxGDIImage::RemoveHandler(
|
bool wxGDIImage::RemoveHandler( const wxString& rName )
|
||||||
const wxString& rName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxGDIImageHandler* pHandler = FindHandler(rName);
|
wxGDIImageHandler* pHandler = FindHandler(rName);
|
||||||
|
|
||||||
if (pHandler)
|
if (pHandler)
|
||||||
{
|
{
|
||||||
ms_handlers.DeleteObject(pHandler);
|
ms_handlers.DeleteObject(pHandler);
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(FALSE);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGDIImageHandler* wxGDIImage::FindHandler(
|
wxGDIImageHandler* wxGDIImage::FindHandler(
|
||||||
@@ -369,13 +360,11 @@ void wxGDIImage::InitStandardHandlers()
|
|||||||
// wxBitmap handlers
|
// wxBitmap handlers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxBMPResourceHandler::LoadFile(
|
bool wxBMPResourceHandler::LoadFile( wxBitmap* pBitmap,
|
||||||
wxBitmap* pBitmap
|
int nId,
|
||||||
, int nId
|
long WXUNUSED(lFlags),
|
||||||
, long lFlags
|
int WXUNUSED(nDesiredWidth),
|
||||||
, int nDesiredWidth
|
int WXUNUSED(nDesiredHeight) )
|
||||||
, int nDesiredHeight
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SIZEL vSize = {0, 0};
|
SIZEL vSize = {0, 0};
|
||||||
DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
|
DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
|
||||||
@@ -405,19 +394,17 @@ bool wxBMPResourceHandler::LoadFile(
|
|||||||
return(pBitmap->Ok());
|
return(pBitmap->Ok());
|
||||||
} // end of wxBMPResourceHandler::LoadFile
|
} // end of wxBMPResourceHandler::LoadFile
|
||||||
|
|
||||||
bool wxBMPFileHandler::LoadFile(
|
bool wxBMPFileHandler::LoadFile( wxBitmap* pBitmap,
|
||||||
wxBitmap* pBitmap
|
const wxString& WXUNUSED(rName),
|
||||||
, const wxString& rName
|
HPS WXUNUSED(hPs),
|
||||||
, HPS hPs
|
long WXUNUSED(lFlags),
|
||||||
, long WXUNUSED(lFlags)
|
int WXUNUSED(nDesiredWidth),
|
||||||
, int WXUNUSED(nDesiredWidth)
|
int WXUNUSED(nDesiredHeight) )
|
||||||
, int WXUNUSED(nDesiredHeight)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if wxUSE_IMAGE_LOADING_IN_OS2
|
#if wxUSE_IMAGE_LOADING_IN_OS2
|
||||||
wxPalette* pPalette = NULL;
|
wxPalette* pPalette = NULL;
|
||||||
|
|
||||||
bool bSuccess = FALSE; /* wxLoadIntoBitmap( WXSTRINGCAST rName
|
bool bSuccess = false; /* wxLoadIntoBitmap( WXSTRINGCAST rName
|
||||||
,pBitmap
|
,pBitmap
|
||||||
,&pPalette
|
,&pPalette
|
||||||
) != 0; */
|
) != 0; */
|
||||||
@@ -431,16 +418,15 @@ bool wxBMPFileHandler::LoadFile(
|
|||||||
|
|
||||||
return(bSuccess);
|
return(bSuccess);
|
||||||
#else
|
#else
|
||||||
return(FALSE);
|
wxUnusedVar(pBitmap);
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxBMPFileHandler::SaveFile(
|
bool wxBMPFileHandler::SaveFile( wxBitmap* pBitmap,
|
||||||
wxBitmap* pBitmap
|
const wxString& WXUNUSED(rName),
|
||||||
, const wxString& rName
|
int WXUNUSED(nType),
|
||||||
, int WXUNUSED(nType)
|
const wxPalette* pPal )
|
||||||
, const wxPalette* pPal
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if wxUSE_IMAGE_LOADING_IN_OS2
|
#if wxUSE_IMAGE_LOADING_IN_OS2
|
||||||
wxPalette* pActualPalette = (wxPalette *)pPal;
|
wxPalette* pActualPalette = (wxPalette *)pPal;
|
||||||
@@ -451,9 +437,11 @@ bool wxBMPFileHandler::SaveFile(
|
|||||||
,pBitmap
|
,pBitmap
|
||||||
,pActualPalette
|
,pActualPalette
|
||||||
) != 0); */
|
) != 0); */
|
||||||
return(FALSE);
|
return false;
|
||||||
#else
|
#else
|
||||||
return(FALSE);
|
wxUnusedVar(pBitmap);
|
||||||
|
wxUnusedVar(pPal);
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,35 +449,29 @@ bool wxBMPFileHandler::SaveFile(
|
|||||||
// wxIcon handlers
|
// wxIcon handlers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxICOFileHandler::LoadIcon(
|
bool wxICOFileHandler::LoadIcon( wxIcon* pIcon,
|
||||||
wxIcon* pIcon
|
const wxString& WXUNUSED(rName),
|
||||||
, const wxString& rName
|
HPS WXUNUSED(hPs),
|
||||||
, HPS hPs
|
long WXUNUSED(lFlags),
|
||||||
, long lFlags
|
int WXUNUSED(nDesiredWidth),
|
||||||
, int nDesiredWidth
|
int WXUNUSED(nDesiredHeight) )
|
||||||
, int nDesiredHeight
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if wxUSE_RESOURCE_LOADING_IN_OS2
|
#if wxUSE_RESOURCE_LOADING_IN_OS2
|
||||||
pIcon->UnRef();
|
pIcon->UnRef();
|
||||||
|
|
||||||
// actual size
|
return false;
|
||||||
wxSize vSize;
|
|
||||||
|
|
||||||
return(FALSE);
|
|
||||||
#else
|
#else
|
||||||
return(FALSE);
|
wxUnusedVar(pIcon);
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxICOResourceHandler::LoadIcon(
|
bool wxICOResourceHandler::LoadIcon( wxIcon* pIcon,
|
||||||
wxIcon* pIcon
|
const wxString& rName,
|
||||||
, const wxString& rName
|
HPS WXUNUSED(hPs),
|
||||||
, HPS hPs
|
long WXUNUSED(lFlags),
|
||||||
, long lFlags
|
int WXUNUSED(nDesiredWidth),
|
||||||
, int WXUNUSED(nDesiredWidth)
|
int WXUNUSED(nDesiredHeight) )
|
||||||
, int WXUNUSED(nDesiredHeight)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
HPOINTER hIcon;
|
HPOINTER hIcon;
|
||||||
|
|
||||||
@@ -499,9 +481,7 @@ bool wxICOResourceHandler::LoadIcon(
|
|||||||
|
|
||||||
pIcon->SetSize(32, 32); // all OS/2 icons are 32 x 32
|
pIcon->SetSize(32, 32); // all OS/2 icons are 32 x 32
|
||||||
|
|
||||||
|
|
||||||
pIcon->SetHICON((WXHICON)hIcon);
|
pIcon->SetHICON((WXHICON)hIcon);
|
||||||
|
|
||||||
return pIcon->Ok();
|
return pIcon->Ok();
|
||||||
} // end of wxICOResourceHandler::LoadIcon
|
} // end of wxICOResourceHandler::LoadIcon
|
||||||
|
|
||||||
|
@@ -6,7 +6,10 @@
|
|||||||
* CVSID: $Id$
|
* 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
|
#if wxUSE_SOCKETS
|
||||||
|
|
||||||
|
@@ -9,6 +9,9 @@
|
|||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -43,19 +46,20 @@ bool wxWinHelpController::Initialize(const wxString& filename)
|
|||||||
{
|
{
|
||||||
m_helpFile = filename;
|
m_helpFile = filename;
|
||||||
// TODO any other inits
|
// TODO any other inits
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::LoadFile(const wxString& file)
|
bool wxWinHelpController::LoadFile(const wxString& file)
|
||||||
{
|
{
|
||||||
m_helpFile = file;
|
m_helpFile = file;
|
||||||
// TODO
|
// TODO
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::DisplayContents()
|
bool wxWinHelpController::DisplayContents()
|
||||||
{
|
{
|
||||||
if (m_helpFile == wxT("")) return FALSE;
|
if (m_helpFile == wxT(""))
|
||||||
|
return false;
|
||||||
|
|
||||||
wxString str = m_helpFile;
|
wxString str = m_helpFile;
|
||||||
size_t len = str.Length();
|
size_t len = str.Length();
|
||||||
@@ -65,15 +69,16 @@ bool wxWinHelpController::DisplayContents()
|
|||||||
if (wxTheApp->GetTopWindow())
|
if (wxTheApp->GetTopWindow())
|
||||||
{
|
{
|
||||||
// TODO : display the help
|
// TODO : display the help
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::DisplaySection(int section)
|
bool wxWinHelpController::DisplaySection(int WXUNUSED(section))
|
||||||
{
|
{
|
||||||
// Use context number
|
// Use context number
|
||||||
if (m_helpFile == wxT("")) return FALSE;
|
if (m_helpFile == wxT(""))
|
||||||
|
return false;
|
||||||
|
|
||||||
wxString str = m_helpFile;
|
wxString str = m_helpFile;
|
||||||
size_t len = str.Length();
|
size_t len = str.Length();
|
||||||
@@ -84,15 +89,17 @@ bool wxWinHelpController::DisplaySection(int section)
|
|||||||
{
|
{
|
||||||
// TODO ::
|
// TODO ::
|
||||||
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section);
|
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::DisplayBlock(long block)
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxWinHelpController::DisplayBlock(long WXUNUSED(block))
|
||||||
{
|
{
|
||||||
// Use context number -- a very rough equivalent to block id!
|
// 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;
|
wxString str = m_helpFile;
|
||||||
size_t len = str.Length();
|
size_t len = str.Length();
|
||||||
@@ -103,12 +110,12 @@ bool wxWinHelpController::DisplayBlock(long block)
|
|||||||
{
|
{
|
||||||
// TODO:
|
// TODO:
|
||||||
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)block);
|
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)block);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::KeywordSearch(const wxString& k,
|
bool wxWinHelpController::KeywordSearch(const wxString& WXUNUSED(k),
|
||||||
wxHelpSearchMode WXUNUSED(mode))
|
wxHelpSearchMode WXUNUSED(mode))
|
||||||
{
|
{
|
||||||
if (m_helpFile == wxEmptyString) return FALSE;
|
if (m_helpFile == wxEmptyString) return FALSE;
|
||||||
@@ -122,7 +129,7 @@ bool wxWinHelpController::KeywordSearch(const wxString& k,
|
|||||||
{
|
{
|
||||||
// TODO:
|
// TODO:
|
||||||
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k);
|
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -134,14 +141,13 @@ bool wxWinHelpController::Quit()
|
|||||||
{
|
{
|
||||||
// TODO:
|
// TODO:
|
||||||
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), 0, HELP_QUIT, 0L);
|
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), 0, HELP_QUIT, 0L);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWinHelpController::OnQuit()
|
void wxWinHelpController::OnQuit()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif // wxUSE_HELP
|
#endif // wxUSE_HELP
|
||||||
|
|
||||||
|
@@ -100,14 +100,12 @@ void wxIcon::CreateIconFromXpm(
|
|||||||
CopyFromBitmap(vBmp);
|
CopyFromBitmap(vBmp);
|
||||||
if (GetHICON())
|
if (GetHICON())
|
||||||
{
|
{
|
||||||
m_bIsXpm = TRUE;
|
m_bIsXpm = true;
|
||||||
m_vXpmSrc = vBmp;
|
m_vXpmSrc = vBmp;
|
||||||
}
|
}
|
||||||
} // end of wxIcon::CreateIconFromXpm
|
} // end of wxIcon::CreateIconFromXpm
|
||||||
|
|
||||||
void wxIcon::CopyFromBitmap(
|
void wxIcon::CopyFromBitmap( const wxBitmap& rBmp )
|
||||||
const wxBitmap& rBmp
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxMask* pMask = rBmp.GetMask();
|
wxMask* pMask = rBmp.GetMask();
|
||||||
HBITMAP hBmp = NULLHANDLE;
|
HBITMAP hBmp = NULLHANDLE;
|
||||||
@@ -236,9 +234,10 @@ void wxIcon::CopyFromBitmap(
|
|||||||
|
|
||||||
vIconInfo.hbmPointer = hBmpMask;
|
vIconInfo.hbmPointer = hBmpMask;
|
||||||
|
|
||||||
HICON hIcon = ::WinCreatePointerIndirect( HWND_DESKTOP
|
#ifndef __WATCOMC__
|
||||||
,&vIconInfo
|
// FIXME: incomplete headers ???
|
||||||
);
|
|
||||||
|
HICON hIcon = ::WinCreatePointerIndirect( HWND_DESKTOP, &vIconInfo);
|
||||||
|
|
||||||
if (!hIcon)
|
if (!hIcon)
|
||||||
{
|
{
|
||||||
@@ -253,6 +252,7 @@ void wxIcon::CopyFromBitmap(
|
|||||||
,rBmp.GetHeight()
|
,rBmp.GetHeight()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!rBmp.GetMask())
|
if (!rBmp.GetMask())
|
||||||
{
|
{
|
||||||
@@ -293,4 +293,3 @@ bool wxIcon::LoadFile(
|
|||||||
else
|
else
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@ wxIniConfig::wxIniConfig(const wxString& strAppName,
|
|||||||
localFilename, globalFilename, style)
|
localFilename, globalFilename, style)
|
||||||
{
|
{
|
||||||
m_strLocalFilename = localFilename;
|
m_strLocalFilename = localFilename;
|
||||||
if (m_strLocalFilename.IsEmpty())
|
if (m_strLocalFilename.empty())
|
||||||
{
|
{
|
||||||
m_strLocalFilename = GetAppName() + wxT(".ini");
|
m_strLocalFilename = GetAppName() + wxT(".ini");
|
||||||
}
|
}
|
||||||
@@ -87,14 +87,17 @@ void wxIniConfig::SetPath(const wxString& strPath)
|
|||||||
{
|
{
|
||||||
wxArrayString aParts;
|
wxArrayString aParts;
|
||||||
|
|
||||||
if ( strPath.IsEmpty() ) {
|
if ( strPath.empty() )
|
||||||
|
{
|
||||||
// nothing
|
// nothing
|
||||||
}
|
}
|
||||||
else if ( strPath[(size_t) 0] == wxCONFIG_PATH_SEPARATOR ) {
|
else if ( strPath[(size_t) 0] == wxCONFIG_PATH_SEPARATOR )
|
||||||
|
{
|
||||||
// absolute path
|
// absolute path
|
||||||
wxSplitPath(aParts, strPath);
|
wxSplitPath(aParts, strPath);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
// relative path, combine with current one
|
// relative path, combine with current one
|
||||||
wxString strFullPath = GetPath();
|
wxString strFullPath = GetPath();
|
||||||
strFullPath << wxCONFIG_PATH_SEPARATOR << strPath;
|
strFullPath << wxCONFIG_PATH_SEPARATOR << strPath;
|
||||||
@@ -103,14 +106,17 @@ void wxIniConfig::SetPath(const wxString& strPath)
|
|||||||
|
|
||||||
size_t nPartsCount = aParts.Count();
|
size_t nPartsCount = aParts.Count();
|
||||||
m_strPath.Empty();
|
m_strPath.Empty();
|
||||||
if ( nPartsCount == 0 ) {
|
if ( nPartsCount == 0 )
|
||||||
|
{
|
||||||
// go to the root
|
// go to the root
|
||||||
m_strGroup = (wxChar*)PATH_SEP_REPLACE;
|
m_strGroup = (wxChar*)PATH_SEP_REPLACE;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
// translate
|
// translate
|
||||||
m_strGroup = aParts[(size_t) 0];
|
m_strGroup = aParts[(size_t) 0];
|
||||||
for ( size_t nPart = 1; nPart < nPartsCount; nPart++ ) {
|
for ( size_t nPart = 1; nPart < nPartsCount; nPart++ )
|
||||||
|
{
|
||||||
if ( nPart > 1 )
|
if ( nPart > 1 )
|
||||||
m_strPath << PATH_SEP_REPLACE;
|
m_strPath << PATH_SEP_REPLACE;
|
||||||
m_strPath << aParts[nPart];
|
m_strPath << aParts[nPart];
|
||||||
@@ -119,7 +125,7 @@ void wxIniConfig::SetPath(const wxString& strPath)
|
|||||||
|
|
||||||
// other functions assume that all this is true, i.e. there are no trailing
|
// 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
|
// underscores at the end except if the group is the root one
|
||||||
wxASSERT( (m_strPath.IsEmpty() || m_strPath.Last() != PATH_SEP_REPLACE) &&
|
wxASSERT( (m_strPath.empty() || m_strPath.Last() != PATH_SEP_REPLACE) &&
|
||||||
(m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) ||
|
(m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) ||
|
||||||
m_strGroup.Last() != PATH_SEP_REPLACE) );
|
m_strGroup.Last() != PATH_SEP_REPLACE) );
|
||||||
}
|
}
|
||||||
@@ -131,14 +137,17 @@ const wxString& wxIniConfig::GetPath() const
|
|||||||
// always return abs path
|
// always return abs path
|
||||||
s_str = wxCONFIG_PATH_SEPARATOR;
|
s_str = wxCONFIG_PATH_SEPARATOR;
|
||||||
|
|
||||||
if ( m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) ) {
|
if ( m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) )
|
||||||
|
{
|
||||||
// we're at the root level, nothing to do
|
// we're at the root level, nothing to do
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
s_str << m_strGroup;
|
s_str << m_strGroup;
|
||||||
if ( !m_strPath.IsEmpty() )
|
if ( !m_strPath.empty() )
|
||||||
s_str << wxCONFIG_PATH_SEPARATOR;
|
s_str << wxCONFIG_PATH_SEPARATOR;
|
||||||
for ( const wxChar *p = m_strPath; *p != '\0'; p++ ) {
|
for ( const wxChar *p = m_strPath; *p != '\0'; p++ )
|
||||||
|
{
|
||||||
s_str << (*p == PATH_SEP_REPLACE ? wxCONFIG_PATH_SEPARATOR : *p);
|
s_str << (*p == PATH_SEP_REPLACE ? wxCONFIG_PATH_SEPARATOR : *p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +159,7 @@ wxString wxIniConfig::GetPrivateKeyName(const wxString& szKey) const
|
|||||||
{
|
{
|
||||||
wxString strKey;
|
wxString strKey;
|
||||||
|
|
||||||
if ( !m_strPath.IsEmpty() )
|
if ( !m_strPath.empty() )
|
||||||
strKey << m_strPath << PATH_SEP_REPLACE;
|
strKey << m_strPath << PATH_SEP_REPLACE;
|
||||||
|
|
||||||
strKey << szKey;
|
strKey << szKey;
|
||||||
@@ -164,7 +173,7 @@ wxString wxIniConfig::GetKeyName(const wxString& szKey) const
|
|||||||
|
|
||||||
if (m_strGroup != wxString((wxChar)PATH_SEP_REPLACE))
|
if (m_strGroup != wxString((wxChar)PATH_SEP_REPLACE))
|
||||||
strKey << m_strGroup << PATH_SEP_REPLACE;
|
strKey << m_strGroup << PATH_SEP_REPLACE;
|
||||||
if ( !m_strPath.IsEmpty() )
|
if ( !m_strPath.empty() )
|
||||||
strKey << m_strPath << PATH_SEP_REPLACE;
|
strKey << m_strPath << PATH_SEP_REPLACE;
|
||||||
|
|
||||||
strKey << szKey;
|
strKey << szKey;
|
||||||
@@ -177,32 +186,32 @@ wxString wxIniConfig::GetKeyName(const wxString& szKey) const
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// not implemented
|
// 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -210,32 +219,32 @@ bool wxIniConfig::GetNextEntry (wxString& str, long& lIndex) const
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// not implemented
|
// 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?
|
// is current group empty?
|
||||||
@@ -246,13 +255,13 @@ bool wxIniConfig::IsEmpty() const
|
|||||||
// GetPrivateProfileString(m_strGroup, NULL, "",
|
// GetPrivateProfileString(m_strGroup, NULL, "",
|
||||||
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
|
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
|
||||||
if ( !::IsEmpty(szBuf) )
|
if ( !::IsEmpty(szBuf) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// GetProfileString(m_strGroup, NULL, "", szBuf, WXSIZEOF(szBuf));
|
// GetProfileString(m_strGroup, NULL, "", szBuf, WXSIZEOF(szBuf));
|
||||||
// if ( !::IsEmpty(szBuf) )
|
// if ( !::IsEmpty(szBuf) )
|
||||||
return FALSE;
|
// return false;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -271,19 +280,20 @@ bool wxIniConfig::Read(const wxString& szKey, wxString *pstr) const
|
|||||||
// NB: the lpDefault param to GetPrivateProfileString can't be NULL
|
// NB: the lpDefault param to GetPrivateProfileString can't be NULL
|
||||||
// GetPrivateProfileString(m_strGroup, strKey, "",
|
// GetPrivateProfileString(m_strGroup, strKey, "",
|
||||||
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
|
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
|
||||||
if ( ::IsEmpty((PSZ)szBuf) ) {
|
if ( ::IsEmpty((PSZ)szBuf) )
|
||||||
|
{
|
||||||
// now look in win.ini
|
// now look in win.ini
|
||||||
wxString strKey = GetKeyName(path.Name());
|
wxString strKey = GetKeyName(path.Name());
|
||||||
// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
|
// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ::IsEmpty((PSZ)szBuf) ) {
|
if ( ::IsEmpty((PSZ)szBuf) )
|
||||||
return FALSE;
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
*pstr = szBuf ;
|
*pstr = szBuf ;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxIniConfig::Read(const wxString& szKey, wxString *pstr,
|
bool wxIniConfig::Read(const wxString& szKey, wxString *pstr,
|
||||||
@@ -346,12 +356,12 @@ bool wxIniConfig::Read(const wxString& szKey, long *pl) const
|
|||||||
return TRUE;
|
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);
|
wxConfigPathChanger path(this, szKey);
|
||||||
wxString strKey = GetPrivateKeyName(path.Name());
|
wxString strKey = GetPrivateKeyName(path.Name());
|
||||||
|
|
||||||
bool bOk = FALSE; // = WritePrivateProfileString(m_strGroup, strKey,
|
bool bOk = false; // = WritePrivateProfileString(m_strGroup, strKey,
|
||||||
// szValue, m_strLocalFilename) != 0;
|
// szValue, m_strLocalFilename) != 0;
|
||||||
|
|
||||||
if ( !bOk )
|
if ( !bOk )
|
||||||
@@ -452,16 +462,16 @@ bool wxIniConfig::DeleteAll()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxIniConfig::RenameEntry(const wxString& oldName, const wxString& newName)
|
bool wxIniConfig::RenameEntry(const wxString& WXUNUSED(oldName), const wxString& WXUNUSED(newName))
|
||||||
{
|
{
|
||||||
// Not implemented
|
// 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
|
// Not implemented
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //wxUSE_CONFIG
|
#endif //wxUSE_CONFIG
|
||||||
|
@@ -9,6 +9,11 @@
|
|||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
//
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
|
|
||||||
#if wxUSE_JOYSTICK
|
#if wxUSE_JOYSTICK
|
||||||
@@ -82,7 +87,7 @@ int wxJoystick::GetMovementThreshold() const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxJoystick::SetMovementThreshold(int threshold)
|
void wxJoystick::SetMovementThreshold(int WXUNUSED(threshold))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
@@ -93,7 +98,7 @@ void wxJoystick::SetMovementThreshold(int threshold)
|
|||||||
bool wxJoystick::IsOk() const
|
bool wxJoystick::IsOk() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetNumberJoysticks() const
|
int wxJoystick::GetNumberJoysticks() const
|
||||||
@@ -231,58 +236,57 @@ int wxJoystick::GetVMax() const
|
|||||||
bool wxJoystick::HasRudder() const
|
bool wxJoystick::HasRudder() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasZ() const
|
bool wxJoystick::HasZ() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasU() const
|
bool wxJoystick::HasU() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasV() const
|
bool wxJoystick::HasV() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasPOV() const
|
bool wxJoystick::HasPOV() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasPOV4Dir() const
|
bool wxJoystick::HasPOV4Dir() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasPOVCTS() const
|
bool wxJoystick::HasPOVCTS() const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
|
bool wxJoystick::SetCapture(wxWindow* WXUNUSED(win), int WXUNUSED(pollingFreq))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::ReleaseCapture()
|
bool wxJoystick::ReleaseCapture()
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_JOYSTICK
|
#endif // wxUSE_JOYSTICK
|
||||||
|
|
||||||
|
@@ -65,9 +65,7 @@ wxListBoxItem::wxListBoxItem(
|
|||||||
SetMarginWidth(0);
|
SetMarginWidth(0);
|
||||||
} // end of wxListBoxItem::wxListBoxItem
|
} // end of wxListBoxItem::wxListBoxItem
|
||||||
|
|
||||||
wxOwnerDrawn* wxListBox::CreateItem(
|
wxOwnerDrawn* wxListBox::CreateItem( size_t WXUNUSED(n) )
|
||||||
size_t n
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return new wxListBoxItem();
|
return new wxListBoxItem();
|
||||||
} // end of wxListBox::CreateItem
|
} // end of wxListBox::CreateItem
|
||||||
@@ -508,9 +506,7 @@ bool wxListBox::HasMultipleSelection() const
|
|||||||
return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
|
return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
|
||||||
} // end of wxListBox::HasMultipleSelection
|
} // end of wxListBox::HasMultipleSelection
|
||||||
|
|
||||||
int wxListBox::GetSelections(
|
int wxListBox::GetSelections( wxArrayInt& raSelections ) const
|
||||||
wxArrayInt& raSelections
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
int nCount = 0;
|
int nCount = 0;
|
||||||
LONG lItem;
|
LONG lItem;
|
||||||
@@ -557,7 +553,6 @@ int wxListBox::GetSelections(
|
|||||||
}
|
}
|
||||||
return nCount;
|
return nCount;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
else // single-selection listbox
|
else // single-selection listbox
|
||||||
{
|
{
|
||||||
@@ -893,13 +888,9 @@ bool wxListBox::OS2OnDraw (
|
|||||||
wxCHECK(pData, false );
|
wxCHECK(pData, false );
|
||||||
|
|
||||||
wxDC vDc;
|
wxDC vDc;
|
||||||
wxRect vRect( wxPoint( pDrawStruct->rclItem.xLeft
|
wxPoint pt1( pDrawStruct->rclItem.xLeft, pDrawStruct->rclItem.yTop );
|
||||||
,pDrawStruct->rclItem.yTop
|
wxPoint pt2( pDrawStruct->rclItem.xRight, pDrawStruct->rclItem.yBottom );
|
||||||
)
|
wxRect vRect( pt1, pt2 );
|
||||||
,wxPoint( pDrawStruct->rclItem.xRight
|
|
||||||
,pDrawStruct->rclItem.yBottom
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
vDc.SetHPS(pDrawStruct->hps);
|
vDc.SetHPS(pDrawStruct->hps);
|
||||||
|
|
||||||
@@ -976,4 +967,3 @@ bool wxListBox::OS2OnDraw (
|
|||||||
#endif // ndef for wxUSE_OWNER_DRAWN
|
#endif // ndef for wxUSE_OWNER_DRAWN
|
||||||
|
|
||||||
#endif // ndef for wxUSE_LISTBOX
|
#endif // ndef for wxUSE_LISTBOX
|
||||||
|
|
||||||
|
@@ -107,7 +107,7 @@ void wxMenu::Init()
|
|||||||
//
|
//
|
||||||
// If we have a title, insert it in the beginning of the menu
|
// If we have a title, insert it in the beginning of the menu
|
||||||
//
|
//
|
||||||
if (!m_title.IsEmpty())
|
if (!m_title.empty())
|
||||||
{
|
{
|
||||||
Append( idMenuTitle
|
Append( idMenuTitle
|
||||||
,m_title
|
,m_title
|
||||||
@@ -146,7 +146,7 @@ wxMenu::~wxMenu()
|
|||||||
void wxMenu::Break()
|
void wxMenu::Break()
|
||||||
{
|
{
|
||||||
// this will take effect during the next call to Append()
|
// this will take effect during the next call to Append()
|
||||||
m_bDoBreak = TRUE;
|
m_bDoBreak = true;
|
||||||
} // end of wxMenu::Break
|
} // end of wxMenu::Break
|
||||||
|
|
||||||
void wxMenu::Attach(
|
void wxMenu::Attach(
|
||||||
@@ -248,10 +248,8 @@ void wxMenu::UpdateAccel(
|
|||||||
//
|
//
|
||||||
// Append a new item or submenu to the menu
|
// Append a new item or submenu to the menu
|
||||||
//
|
//
|
||||||
bool wxMenu::DoInsertOrAppend(
|
bool wxMenu::DoInsertOrAppend( wxMenuItem* pItem,
|
||||||
wxMenuItem* pItem
|
size_t nPos )
|
||||||
, size_t nPos
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxMenu* pSubmenu = pItem->GetSubMenu();
|
wxMenu* pSubmenu = pItem->GetSubMenu();
|
||||||
MENUITEM& rItem = (pSubmenu != NULL)?pSubmenu->m_vMenuData:
|
MENUITEM& rItem = (pSubmenu != NULL)?pSubmenu->m_vMenuData:
|
||||||
@@ -289,7 +287,7 @@ bool wxMenu::DoInsertOrAppend(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rItem.id = pItem->GetId();
|
rItem.id = (USHORT)pItem->GetId();
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE* pData=NULL;
|
BYTE* pData=NULL;
|
||||||
@@ -337,7 +335,7 @@ bool wxMenu::DoInsertOrAppend(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rItem.iPosition = nPos;
|
rItem.iPosition = (SHORT)nPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
APIRET rc;
|
APIRET rc;
|
||||||
@@ -361,16 +359,16 @@ bool wxMenu::DoInsertOrAppend(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rc == (APIRET)MIT_MEMERROR || rc == (APIRET)MIT_ERROR)
|
if (rc == (APIRET)MIT_MEMERROR || rc == (APIRET)MIT_ERROR)
|
||||||
{
|
{
|
||||||
vError = ::WinGetLastError(vHabmain);
|
vError = ::WinGetLastError(vHabmain);
|
||||||
sError = wxPMErrorToStr(vError);
|
sError = wxPMErrorToStr(vError);
|
||||||
wxLogError(wxT("Error inserting or appending a menuitem. Error: %s\n"), sError.c_str());
|
wxLogError(wxT("Error inserting or appending a menuitem. Error: %s\n"), sError.c_str());
|
||||||
wxLogLastError(wxT("Insert or AppendMenu"));
|
wxLogLastError(wxT("Insert or AppendMenu"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
//
|
//
|
||||||
// If we're already attached to the menubar, we must update it
|
// If we're already attached to the menubar, we must update it
|
||||||
//
|
//
|
||||||
@@ -378,9 +376,8 @@ bool wxMenu::DoInsertOrAppend(
|
|||||||
{
|
{
|
||||||
GetMenuBar()->Refresh();
|
GetMenuBar()->Refresh();
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
}
|
return true;
|
||||||
return FALSE;
|
|
||||||
} // end of wxMenu::DoInsertOrAppend
|
} // end of wxMenu::DoInsertOrAppend
|
||||||
|
|
||||||
void wxMenu::EndRadioGroup()
|
void wxMenu::EndRadioGroup()
|
||||||
@@ -391,13 +388,11 @@ void wxMenu::EndRadioGroup()
|
|||||||
m_nStartRadioGroup = -1;
|
m_nStartRadioGroup = -1;
|
||||||
} // end of wxMenu::EndRadioGroup
|
} // end of wxMenu::EndRadioGroup
|
||||||
|
|
||||||
wxMenuItem* wxMenu::DoAppend(
|
wxMenuItem* wxMenu::DoAppend( wxMenuItem* pItem )
|
||||||
wxMenuItem* pItem
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( pItem, NULL, _T("NULL item in wxMenu::DoAppend") );
|
wxCHECK_MSG( pItem, NULL, _T("NULL item in wxMenu::DoAppend") );
|
||||||
|
|
||||||
bool bCheck = FALSE;
|
bool bCheck = false;
|
||||||
|
|
||||||
if (pItem->GetKind() == wxITEM_RADIO)
|
if (pItem->GetKind() == wxITEM_RADIO)
|
||||||
{
|
{
|
||||||
@@ -419,7 +414,7 @@ wxMenuItem* wxMenu::DoAppend(
|
|||||||
//
|
//
|
||||||
// Ensure that we have a checked item in the radio group
|
// Ensure that we have a checked item in the radio group
|
||||||
//
|
//
|
||||||
bCheck = TRUE;
|
bCheck = true;
|
||||||
}
|
}
|
||||||
else // extend the current radio group
|
else // extend the current radio group
|
||||||
{
|
{
|
||||||
@@ -454,7 +449,7 @@ wxMenuItem* wxMenu::DoAppend(
|
|||||||
//
|
//
|
||||||
// Check the item initially
|
// Check the item initially
|
||||||
//
|
//
|
||||||
pItem->Check(TRUE);
|
pItem->Check(true);
|
||||||
}
|
}
|
||||||
return pItem;
|
return pItem;
|
||||||
} // end of wxMenu::DoAppend
|
} // end of wxMenu::DoAppend
|
||||||
@@ -560,17 +555,15 @@ size_t wxMenu::CopyAccels(
|
|||||||
// set wxMenu title
|
// set wxMenu title
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxMenu::SetTitle(
|
void wxMenu::SetTitle( const wxString& rLabel )
|
||||||
const wxString& rLabel
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
bool bHasNoTitle = m_title.IsEmpty();
|
bool bHasNoTitle = m_title.empty();
|
||||||
HWND hMenu = GetHmenu();
|
HWND hMenu = GetHmenu();
|
||||||
|
|
||||||
m_title = rLabel;
|
m_title = rLabel;
|
||||||
if (bHasNoTitle)
|
if (bHasNoTitle)
|
||||||
{
|
{
|
||||||
if (!rLabel.IsEmpty())
|
if (!rLabel.empty())
|
||||||
{
|
{
|
||||||
if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
|
if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
|
||||||
{
|
{
|
||||||
@@ -580,7 +573,7 @@ void wxMenu::SetTitle(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (rLabel.IsEmpty() )
|
if (rLabel.empty() )
|
||||||
{
|
{
|
||||||
::WinSendMsg( GetHmenu()
|
::WinSendMsg( GetHmenu()
|
||||||
,MM_REMOVEITEM
|
,MM_REMOVEITEM
|
||||||
@@ -814,7 +807,7 @@ WXHMENU wxMenuBar::Create()
|
|||||||
return NULLHANDLE;
|
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());
|
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)
|
if (rc == (APIRET)MIT_MEMERROR || rc == (APIRET)MIT_ERROR)
|
||||||
@@ -953,27 +946,20 @@ wxMenu* wxMenuBar::Replace(
|
|||||||
return pMenuOld;
|
return pMenuOld;
|
||||||
} // end of wxMenuBar::Replace
|
} // end of wxMenuBar::Replace
|
||||||
|
|
||||||
bool wxMenuBar::Insert(
|
bool wxMenuBar::Insert( size_t nPos,
|
||||||
size_t nPos
|
wxMenu* pMenu,
|
||||||
, wxMenu* pMenu
|
const wxString& rTitle )
|
||||||
, const wxString& rTitle
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxString sTitle = wxPMTextToLabel(rTitle);
|
wxString sTitle = wxPMTextToLabel(rTitle);
|
||||||
|
|
||||||
if (!wxMenuBarBase::Insert( nPos
|
if (!wxMenuBarBase::Insert( nPos, pMenu, sTitle ))
|
||||||
,pMenu
|
return false;
|
||||||
,sTitle
|
|
||||||
))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
m_titles.Insert( sTitle
|
m_titles.Insert( sTitle, nPos );
|
||||||
,nPos
|
|
||||||
);
|
|
||||||
|
|
||||||
if (IsAttached())
|
if (IsAttached())
|
||||||
{
|
{
|
||||||
pMenu->m_vMenuData.iPosition = nPos;
|
pMenu->m_vMenuData.iPosition = (SHORT)nPos;
|
||||||
::WinSendMsg( (HWND)m_hMenu
|
::WinSendMsg( (HWND)m_hMenu
|
||||||
,MM_INSERTITEM
|
,MM_INSERTITEM
|
||||||
,(MPARAM)&pMenu->m_vMenuData
|
,(MPARAM)&pMenu->m_vMenuData
|
||||||
@@ -988,7 +974,8 @@ bool wxMenuBar::Insert(
|
|||||||
#endif // wxUSE_ACCEL
|
#endif // wxUSE_ACCEL
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
|
return true;
|
||||||
} // end of wxMenuBar::Insert
|
} // end of wxMenuBar::Insert
|
||||||
|
|
||||||
bool wxMenuBar::Append(
|
bool wxMenuBar::Append(
|
||||||
@@ -1194,4 +1181,3 @@ wxMenuItem* wxMenuBar::FindItem(
|
|||||||
}
|
}
|
||||||
return pItem;
|
return pItem;
|
||||||
} // end of wxMenuBar::FindItem
|
} // end of wxMenuBar::FindItem
|
||||||
|
|
||||||
|
@@ -181,7 +181,7 @@ bool wxMenuItem::IsChecked() const
|
|||||||
,MPFROMSHORT(MIA_CHECKED)
|
,MPFROMSHORT(MIA_CHECKED)
|
||||||
));
|
));
|
||||||
|
|
||||||
return (uFlag & MIA_CHECKED);
|
return (uFlag & MIA_CHECKED) == MIA_CHECKED ;
|
||||||
} // end of wxMenuItem::IsChecked
|
} // end of wxMenuItem::IsChecked
|
||||||
|
|
||||||
wxString wxMenuItemBase::GetLabelFromText(
|
wxString wxMenuItemBase::GetLabelFromText(
|
||||||
@@ -211,7 +211,7 @@ wxString wxMenuItemBase::GetLabelFromText(
|
|||||||
//
|
//
|
||||||
void wxMenuItem::SetAsRadioGroupStart()
|
void wxMenuItem::SetAsRadioGroupStart()
|
||||||
{
|
{
|
||||||
m_bIsRadioGroupStart = TRUE;
|
m_bIsRadioGroupStart = true;
|
||||||
} // end of wxMenuItem::SetAsRadioGroupStart
|
} // end of wxMenuItem::SetAsRadioGroupStart
|
||||||
|
|
||||||
void wxMenuItem::SetRadioGroupStart(
|
void wxMenuItem::SetRadioGroupStart(
|
||||||
@@ -367,9 +367,7 @@ void wxMenuItem::Check(
|
|||||||
wxMenuItemBase::Check(bCheck);
|
wxMenuItemBase::Check(bCheck);
|
||||||
} // end of wxMenuItem::Check
|
} // end of wxMenuItem::Check
|
||||||
|
|
||||||
void wxMenuItem::SetText(
|
void wxMenuItem::SetText( const wxString& rText )
|
||||||
const wxString& rText
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Don't do anything if label didn't change
|
// Don't do anything if label didn't change
|
||||||
@@ -393,7 +391,7 @@ void wxMenuItem::SetText(
|
|||||||
m_parentMenu->UpdateAccel(this);
|
m_parentMenu->UpdateAccel(this);
|
||||||
#endif // wxUSE_ACCEL
|
#endif // wxUSE_ACCEL
|
||||||
|
|
||||||
USHORT uId = GetRealId();
|
USHORT uId = (USHORT)GetRealId();
|
||||||
MENUITEM vItem;
|
MENUITEM vItem;
|
||||||
USHORT uFlagsOld;
|
USHORT uFlagsOld;
|
||||||
|
|
||||||
@@ -483,4 +481,3 @@ wxMenuItem* wxMenuItemBase::New(
|
|||||||
,pSubMenu
|
,pSubMenu
|
||||||
);
|
);
|
||||||
} // end of wxMenuItemBase::New
|
} // end of wxMenuItemBase::New
|
||||||
|
|
||||||
|
@@ -72,8 +72,13 @@ wxMetafile::~wxMetafile(void)
|
|||||||
|
|
||||||
bool wxMetafile::SetClipboard(int width, int height)
|
bool wxMetafile::SetClipboard(int width, int height)
|
||||||
{
|
{
|
||||||
|
#if !wxUSE_CLIPBOARD
|
||||||
|
wxUnusedVar(width);
|
||||||
|
wxUnusedVar(height);
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
if (!m_refData)
|
if (!m_refData)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
bool alreadyOpen=wxClipboardOpen();
|
bool alreadyOpen=wxClipboardOpen();
|
||||||
if (!alreadyOpen)
|
if (!alreadyOpen)
|
||||||
@@ -84,6 +89,7 @@ bool wxMetafile::SetClipboard(int width, int height)
|
|||||||
bool success = wxSetClipboardData(wxDF_METAFILE, this, width,height);
|
bool success = wxSetClipboardData(wxDF_METAFILE, this, width,height);
|
||||||
if (!alreadyOpen) wxCloseClipboard();
|
if (!alreadyOpen) wxCloseClipboard();
|
||||||
return (bool) success;
|
return (bool) success;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxMetafile::Play(wxDC *dc)
|
bool wxMetafile::Play(wxDC *dc)
|
||||||
@@ -98,7 +104,7 @@ bool wxMetafile::Play(wxDC *dc)
|
|||||||
|
|
||||||
dc->EndDrawing();
|
dc->EndDrawing();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMetafile::SetHMETAFILE(WXHANDLE mf)
|
void wxMetafile::SetHMETAFILE(WXHANDLE mf)
|
||||||
@@ -154,16 +160,22 @@ wxMetafileDC::wxMetafileDC(const wxString& file)
|
|||||||
|
|
||||||
// New constructor that takes origin and extent. If you use this, don't
|
// New constructor that takes origin and extent. If you use this, don't
|
||||||
// give origin/extent arguments to wxMakeMetafilePlaceable.
|
// 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_minX = 10000;
|
||||||
m_minY = 10000;
|
m_minY = 10000;
|
||||||
m_maxX = -10000;
|
m_maxX = -10000;
|
||||||
m_maxY = -10000;
|
m_maxY = -10000;
|
||||||
if (file != wxT("") && wxFileExists(file)) wxRemoveFile(file);
|
if (file != wxT("") && wxFileExists(file))
|
||||||
|
wxRemoveFile(file);
|
||||||
|
|
||||||
// m_hDC = (WXHDC) CreateMetaFile(file);
|
// m_hDC = (WXHDC) CreateMetaFile(file);
|
||||||
|
|
||||||
m_ok = TRUE;
|
m_ok = true;
|
||||||
|
|
||||||
// ::SetWindowOrgEx((HDC) m_hDC,xorg,yorg, NULL);
|
// ::SetWindowOrgEx((HDC) m_hDC,xorg,yorg, NULL);
|
||||||
// ::SetWindowExtEx((HDC) m_hDC,xext,yext, NULL);
|
// ::SetWindowExtEx((HDC) m_hDC,xext,yext, NULL);
|
||||||
@@ -179,8 +191,13 @@ wxMetafileDC::~wxMetafileDC(void)
|
|||||||
m_hDC = 0;
|
m_hDC = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMetafileDC::GetTextExtent(const wxString& string, long *x, long *y,
|
void wxMetafileDC::GetTextExtent(const wxString& WXUNUSED(string),
|
||||||
long *descent, long *externalLeading, wxFont *theFont, bool use16bit) const
|
long *WXUNUSED(x),
|
||||||
|
long *WXUNUSED(y),
|
||||||
|
long *WXUNUSED(descent),
|
||||||
|
long *WXUNUSED(externalLeading),
|
||||||
|
wxFont *theFont,
|
||||||
|
bool WXUNUSED(use16bit) ) const
|
||||||
{
|
{
|
||||||
wxFont *fontToUse = theFont;
|
wxFont *fontToUse = theFont;
|
||||||
if (!fontToUse)
|
if (!fontToUse)
|
||||||
@@ -313,7 +330,13 @@ bool wxMakeMetafilePlaceable(const wxString& filename, float scale)
|
|||||||
return wxMakeMetafilePlaceable(filename, 0, 0, 0, 0, scale, FALSE);
|
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
|
// TODO: the OS/2 PM/MM way to do this
|
||||||
/*
|
/*
|
||||||
@@ -334,12 +357,12 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i
|
|||||||
// Calculate checksum
|
// Calculate checksum
|
||||||
WORD *p;
|
WORD *p;
|
||||||
mfPLACEABLEHEADER *pMFHead = &header;
|
mfPLACEABLEHEADER *pMFHead = &header;
|
||||||
for (p =(WORD *)pMFHead,pMFHead -> checksum = 0;
|
for (p =(WORD *)pMFHead,pMFHead -> checksum = 0; p < (WORD *)&pMFHead ->checksum; ++p)
|
||||||
p < (WORD *)&pMFHead ->checksum; ++p)
|
|
||||||
pMFHead ->checksum ^= *p;
|
pMFHead ->checksum ^= *p;
|
||||||
|
|
||||||
FILE *fd = fopen(filename.fn_str(), "rb");
|
FILE *fd = fopen(filename.fn_str(), "rb");
|
||||||
if (!fd) return FALSE;
|
if (!fd)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
wxChar tempFileBuf[256];
|
wxChar tempFileBuf[256];
|
||||||
wxGetTempFileName(wxT("mf"), tempFileBuf);
|
wxGetTempFileName(wxT("mf"), tempFileBuf);
|
||||||
@@ -411,8 +434,7 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i
|
|||||||
wxCopyFile(tempFileBuf, filename);
|
wxCopyFile(tempFileBuf, filename);
|
||||||
wxRemoveFile(tempFileBuf);
|
wxRemoveFile(tempFileBuf);
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_METAFILE
|
#endif // wxUSE_METAFILE
|
||||||
|
|
||||||
|
@@ -9,6 +9,9 @@
|
|||||||
// Licence: wxWindows licence (part of wxExtra library)
|
// Licence: wxWindows licence (part of wxExtra library)
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#define INCL_DOS
|
#define INCL_DOS
|
||||||
#define INCL_GPI
|
#define INCL_GPI
|
||||||
#define INCL_WIN
|
#define INCL_WIN
|
||||||
@@ -62,7 +65,7 @@ class WXDLLEXPORT wxIcon;
|
|||||||
// location, uses it, so it isn't likely to change
|
// location, uses it, so it isn't likely to change
|
||||||
static const wxChar *MIME_DATABASE_KEY = wxT("MIME\\Database\\Content Type\\");
|
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
|
// TODO: OS/2 doesn't have a registry but uses Prf
|
||||||
/*
|
/*
|
||||||
@@ -94,7 +97,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
|
|||||||
// NB: we don't make any attempt to verify that the string is valid,
|
// 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
|
// i.e. doesn't contain %2, or second %1 or .... But we do make
|
||||||
// sure that we return a string with _exactly_ one '%s'!
|
// sure that we return a string with _exactly_ one '%s'!
|
||||||
bool foundFilename = FALSE;
|
bool foundFilename = false;
|
||||||
size_t len = command.Len();
|
size_t len = command.Len();
|
||||||
for ( size_t n = 0; (n < len) && !foundFilename; n++ ) {
|
for ( size_t n = 0; (n < len) && !foundFilename; n++ ) {
|
||||||
if ( command[n] == wxT('%') &&
|
if ( command[n] == wxT('%') &&
|
||||||
@@ -104,7 +107,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
|
|||||||
// replace it with '%s'
|
// replace it with '%s'
|
||||||
command[n + 1] = wxT('s');
|
command[n + 1] = wxT('s');
|
||||||
|
|
||||||
foundFilename = TRUE;
|
foundFilename = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +168,7 @@ wxFileTypeImpl::GetOpenCommand(wxString *openCmd,
|
|||||||
|
|
||||||
*openCmd = wxFileType::ExpandCommand(cmd, params);
|
*openCmd = wxFileType::ExpandCommand(cmd, params);
|
||||||
|
|
||||||
return !openCmd->IsEmpty();
|
return !openCmd->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -183,7 +186,7 @@ wxFileTypeImpl::GetPrintCommand(wxString *printCmd,
|
|||||||
|
|
||||||
*printCmd = wxFileType::ExpandCommand(cmd, params);
|
*printCmd = wxFileType::ExpandCommand(cmd, params);
|
||||||
|
|
||||||
return !printCmd->IsEmpty();
|
return !printCmd->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO this function is half implemented
|
// TODO this function is half implemented
|
||||||
@@ -192,19 +195,19 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
|
|||||||
if ( m_info ) {
|
if ( m_info ) {
|
||||||
extensions = m_info->GetExtensions();
|
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
|
// the only way to get the list of extensions from the file type is to
|
||||||
// scan through all extensions in the registry - too slow...
|
// scan through all extensions in the registry - too slow...
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
extensions.Empty();
|
extensions.Empty();
|
||||||
extensions.Add(m_ext);
|
extensions.Add(m_ext);
|
||||||
|
|
||||||
// it's a lie too, we don't return _all_ extensions...
|
// it's a lie too, we don't return _all_ extensions...
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +217,7 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
|
|||||||
// we already have it
|
// we already have it
|
||||||
*mimeType = m_info->GetMimeType();
|
*mimeType = m_info->GetMimeType();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// suppress possible error messages
|
// suppress possible error messages
|
||||||
@@ -223,13 +226,13 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
|
|||||||
/*
|
/*
|
||||||
wxRegKey key(wxRegKey::HKCR, wxT(".") + m_ext);
|
wxRegKey key(wxRegKey::HKCR, wxT(".") + m_ext);
|
||||||
if ( key.Open() && key.QueryValue(wxT("Content Type"), *mimeType) ) {
|
if ( key.Open() && key.QueryValue(wxT("Content Type"), *mimeType) ) {
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
|
bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
|
||||||
@@ -240,17 +243,17 @@ bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
|
|||||||
{
|
{
|
||||||
mimeTypes.Clear();
|
mimeTypes.Clear();
|
||||||
mimeTypes.Add(s);
|
mimeTypes.Add(s);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
|
bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(iconLoc)) const
|
||||||
{
|
{
|
||||||
if ( m_info ) {
|
if ( m_info ) {
|
||||||
// we don't have icons in the fallback resources
|
// we don't have icons in the fallback resources
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString strIconKey;
|
wxString strIconKey;
|
||||||
@@ -274,7 +277,7 @@ bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
|
|||||||
|
|
||||||
// index may be omitted, in which case BeforeLast(',') is empty and
|
// index may be omitted, in which case BeforeLast(',') is empty and
|
||||||
// AfterLast(',') is the whole string
|
// AfterLast(',') is the whole string
|
||||||
if ( strFullPath.IsEmpty() ) {
|
if ( strFullPath.empty() ) {
|
||||||
strFullPath = strIndex;
|
strFullPath = strIndex;
|
||||||
strIndex = wxT("0");
|
strIndex = wxT("0");
|
||||||
}
|
}
|
||||||
@@ -286,13 +289,13 @@ bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
|
|||||||
iconLoc->SetIndex(wxAtoi(strIndex));
|
iconLoc->SetIndex(wxAtoi(strIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// no such file type or no value or incorrect icon entry
|
// no such file type or no value or incorrect icon entry
|
||||||
*/
|
*/
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFileTypeImpl::GetDescription(wxString *desc) const
|
bool wxFileTypeImpl::GetDescription(wxString *desc) const
|
||||||
@@ -301,7 +304,7 @@ bool wxFileTypeImpl::GetDescription(wxString *desc) const
|
|||||||
// we already have it
|
// we already have it
|
||||||
*desc = m_info->GetDescription();
|
*desc = m_info->GetDescription();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// suppress possible error messages
|
// suppress possible error messages
|
||||||
@@ -313,11 +316,11 @@ bool wxFileTypeImpl::GetDescription(wxString *desc) const
|
|||||||
if ( key.Open() ) {
|
if ( key.Open() ) {
|
||||||
// it's the default value of the key
|
// it's the default value of the key
|
||||||
if ( key.QueryValue(wxT(""), *desc) ) {
|
if ( key.QueryValue(wxT(""), *desc) ) {
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// extension -> file type
|
// extension -> file type
|
||||||
@@ -334,7 +337,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
|
|||||||
// suppress possible error messages
|
// suppress possible error messages
|
||||||
wxLogNull nolog;
|
wxLogNull nolog;
|
||||||
|
|
||||||
bool knownExtension = FALSE;
|
bool knownExtension = false;
|
||||||
|
|
||||||
wxString strFileType;
|
wxString strFileType;
|
||||||
// TODO:
|
// TODO:
|
||||||
@@ -353,7 +356,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
|
|||||||
// this extension doesn't have a filetype, but it's known to the
|
// 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
|
// system and may be has some other useful keys (open command or
|
||||||
// content-type), so still return a file type object for it
|
// content-type), so still return a file type object for it
|
||||||
knownExtension = TRUE;
|
knownExtension = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@@ -422,7 +425,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
|
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& WXUNUSED(mimetypes))
|
||||||
{
|
{
|
||||||
// enumerate all keys under MIME_DATABASE_KEY
|
// enumerate all keys under MIME_DATABASE_KEY
|
||||||
// TODO:
|
// TODO:
|
||||||
|
@@ -36,13 +36,11 @@
|
|||||||
|
|
||||||
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
|
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
|
||||||
|
|
||||||
wxMessageDialog::wxMessageDialog(
|
wxMessageDialog::wxMessageDialog( wxWindow* WXUNUSED(pParent),
|
||||||
wxWindow* pParent
|
const wxString& rsMessage,
|
||||||
, const wxString& rsMessage
|
const wxString& rsCaption,
|
||||||
, const wxString& rsCaption
|
long lStyle,
|
||||||
, long lStyle
|
const wxPoint& WXUNUSED(pPos) )
|
||||||
, const wxPoint& pPos
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
m_sCaption = rsCaption;
|
m_sCaption = rsCaption;
|
||||||
m_sMessage = rsMessage;
|
m_sMessage = rsMessage;
|
||||||
@@ -138,4 +136,3 @@ int wxMessageDialog::ShowModal()
|
|||||||
}
|
}
|
||||||
return nAns;
|
return nAns;
|
||||||
} // end of wxMessageDialog::ShowModal
|
} // end of wxMessageDialog::ShowModal
|
||||||
|
|
||||||
|
@@ -35,7 +35,11 @@
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// check that the page index is valid
|
// 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
|
// hide the ugly cast
|
||||||
#define m_hWnd (HWND)GetHWND()
|
#define m_hWnd (HWND)GetHWND()
|
||||||
@@ -112,14 +116,12 @@ wxNotebook::wxNotebook(
|
|||||||
//
|
//
|
||||||
// Create() function
|
// Create() function
|
||||||
//
|
//
|
||||||
bool wxNotebook::Create(
|
bool wxNotebook::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
wxWindowID vId,
|
||||||
, wxWindowID vId
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
long lStyle,
|
||||||
, long lStyle
|
const wxString& rsName )
|
||||||
, const wxString& rsName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Base init
|
// Base init
|
||||||
@@ -132,7 +134,7 @@ bool wxNotebook::Create(
|
|||||||
,wxDefaultValidator
|
,wxDefaultValidator
|
||||||
,rsName
|
,rsName
|
||||||
))
|
))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Notebook, so explicitly specify 0 as last parameter
|
// Notebook, so explicitly specify 0 as last parameter
|
||||||
@@ -143,10 +145,10 @@ bool wxNotebook::Create(
|
|||||||
,rSize
|
,rSize
|
||||||
,lStyle | wxTAB_TRAVERSAL
|
,lStyle | wxTAB_TRAVERSAL
|
||||||
))
|
))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
SetBackgroundColour(wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
|
SetBackgroundColour(wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxNotebook::Create
|
} // end of wxNotebook::Create
|
||||||
|
|
||||||
WXDWORD wxNotebook::OS2GetStyle (
|
WXDWORD wxNotebook::OS2GetStyle (
|
||||||
@@ -205,9 +207,7 @@ int wxNotebook::GetRowCount() const
|
|||||||
);
|
);
|
||||||
} // end of wxNotebook::GetRowCount
|
} // end of wxNotebook::GetRowCount
|
||||||
|
|
||||||
int wxNotebook::SetSelection(
|
int wxNotebook::SetSelection( size_t nPage )
|
||||||
size_t nPage
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
|
||||||
|
|
||||||
@@ -240,10 +240,8 @@ int wxNotebook::SetSelection(
|
|||||||
return nPage;
|
return nPage;
|
||||||
} // end of wxNotebook::SetSelection
|
} // end of wxNotebook::SetSelection
|
||||||
|
|
||||||
bool wxNotebook::SetPageText(
|
bool wxNotebook::SetPageText( size_t nPage,
|
||||||
size_t nPage
|
const wxString& rsStrText )
|
||||||
, const wxString& rsStrText
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
|
||||||
return (bool)::WinSendMsg( m_hWnd
|
return (bool)::WinSendMsg( m_hWnd
|
||||||
@@ -253,9 +251,7 @@ bool wxNotebook::SetPageText(
|
|||||||
);
|
);
|
||||||
} // end of wxNotebook::SetPageText
|
} // end of wxNotebook::SetPageText
|
||||||
|
|
||||||
wxString wxNotebook::GetPageText (
|
wxString wxNotebook::GetPageText ( size_t nPage ) const
|
||||||
size_t nPage
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
BOOKTEXT vBookText;
|
BOOKTEXT vBookText;
|
||||||
wxChar zBuf[256];
|
wxChar zBuf[256];
|
||||||
@@ -302,9 +298,7 @@ wxString wxNotebook::GetPageText (
|
|||||||
return sStr;
|
return sStr;
|
||||||
} // end of wxNotebook::GetPageText
|
} // end of wxNotebook::GetPageText
|
||||||
|
|
||||||
int wxNotebook::GetPageImage (
|
int wxNotebook::GetPageImage ( size_t nPage ) const
|
||||||
size_t nPage
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
|
||||||
|
|
||||||
@@ -378,9 +372,7 @@ void wxNotebook::SetTabSize (
|
|||||||
//
|
//
|
||||||
// Remove one page from the notebook, without deleting
|
// Remove one page from the notebook, without deleting
|
||||||
//
|
//
|
||||||
wxNotebookPage* wxNotebook::DoRemovePage (
|
wxNotebookPage* wxNotebook::DoRemovePage ( size_t nPage )
|
||||||
size_t nPage
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxNotebookPage* pPageRemoved = wxNotebookBase::DoRemovePage(nPage);
|
wxNotebookPage* pPageRemoved = wxNotebookBase::DoRemovePage(nPage);
|
||||||
|
|
||||||
@@ -463,7 +455,8 @@ bool wxNotebook::DeleteAllPages()
|
|||||||
,(MPARAM)BKA_ALL
|
,(MPARAM)BKA_ALL
|
||||||
);
|
);
|
||||||
m_nSelection = -1;
|
m_nSelection = -1;
|
||||||
return TRUE;
|
|
||||||
|
return true;
|
||||||
} // end of wxNotebook::DeleteAllPages
|
} // end of wxNotebook::DeleteAllPages
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -487,13 +480,11 @@ bool wxNotebook::AddPage (
|
|||||||
//
|
//
|
||||||
// Same as AddPage() but does it at given position
|
// Same as AddPage() but does it at given position
|
||||||
//
|
//
|
||||||
bool wxNotebook::InsertPage (
|
bool wxNotebook::InsertPage ( size_t nPage,
|
||||||
size_t nPage
|
wxNotebookPage* pPage,
|
||||||
, wxNotebookPage* pPage
|
const wxString& rsStrText,
|
||||||
, const wxString& rsStrText
|
bool bSelect,
|
||||||
, bool bSelect
|
int nImageId )
|
||||||
, int nImageId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ULONG ulApiPage;
|
ULONG ulApiPage;
|
||||||
|
|
||||||
@@ -604,7 +595,7 @@ bool wxNotebook::InsertPage (
|
|||||||
//
|
//
|
||||||
// Now set any TAB text
|
// Now set any TAB text
|
||||||
//
|
//
|
||||||
if (!rsStrText.IsEmpty())
|
if (!rsStrText.empty())
|
||||||
{
|
{
|
||||||
if (!SetPageText( nPage
|
if (!SetPageText( nPage
|
||||||
,rsStrText
|
,rsStrText
|
||||||
@@ -845,12 +836,10 @@ bool wxNotebook::DoPhase (
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxNotebook Windows message handlers
|
// wxNotebook Windows message handlers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool wxNotebook::OS2OnScroll (
|
bool wxNotebook::OS2OnScroll ( int nOrientation,
|
||||||
int nOrientation
|
WXWORD wSBCode,
|
||||||
, WXWORD wSBCode
|
WXWORD wPos,
|
||||||
, WXWORD wPos
|
WXHWND wControl )
|
||||||
, WXHWND wControl
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Don't generate EVT_SCROLLWIN events for the WM_SCROLLs coming from the
|
// Don't generate EVT_SCROLLWIN events for the WM_SCROLLs coming from the
|
||||||
@@ -866,4 +855,3 @@ bool wxNotebook::OS2OnScroll (
|
|||||||
} // end of wxNotebook::OS2OnScroll
|
} // end of wxNotebook::OS2OnScroll
|
||||||
|
|
||||||
#endif // wxUSE_NOTEBOOK
|
#endif // wxUSE_NOTEBOOK
|
||||||
|
|
||||||
|
@@ -41,11 +41,9 @@
|
|||||||
// ctor
|
// ctor
|
||||||
// ----
|
// ----
|
||||||
//
|
//
|
||||||
wxOwnerDrawn::wxOwnerDrawn(
|
wxOwnerDrawn::wxOwnerDrawn( const wxString& rsStr,
|
||||||
const wxString& rsStr
|
bool bCheckable,
|
||||||
, bool bCheckable
|
bool WXUNUSED(bMenuItem) )
|
||||||
, bool bMenuItem
|
|
||||||
)
|
|
||||||
: m_strName(rsStr)
|
: m_strName(rsStr)
|
||||||
{
|
{
|
||||||
m_bCheckable = bCheckable;
|
m_bCheckable = bCheckable;
|
||||||
@@ -67,14 +65,11 @@ size_t wxOwnerDrawn::ms_nLastMarginWidth = ms_nDefaultMarginWidth;
|
|||||||
// -------
|
// -------
|
||||||
//
|
//
|
||||||
|
|
||||||
bool wxOwnerDrawn::OnMeasureItem(
|
bool wxOwnerDrawn::OnMeasureItem( size_t* pWidth,
|
||||||
size_t* pWidth
|
size_t* pHeight )
|
||||||
, size_t* pHeight
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxMemoryDC vDC;
|
wxMemoryDC vDC;
|
||||||
|
|
||||||
|
|
||||||
wxString sStr = wxStripMenuCodes(m_strName);
|
wxString sStr = wxStripMenuCodes(m_strName);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -91,7 +86,7 @@ bool wxOwnerDrawn::OnMeasureItem(
|
|||||||
,(long *)pWidth
|
,(long *)pWidth
|
||||||
,(long *)pHeight
|
,(long *)pHeight
|
||||||
);
|
);
|
||||||
if (!m_strAccel.IsEmpty())
|
if (!m_strAccel.empty())
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Measure the accelerator string, and add its width to
|
// Measure the accelerator string, and add its width to
|
||||||
@@ -168,22 +163,20 @@ bool wxOwnerDrawn::OnMeasureItem(
|
|||||||
if (*pHeight < m_nMinHeight)
|
if (*pHeight < m_nMinHeight)
|
||||||
*pHeight = m_nMinHeight;
|
*pHeight = m_nMinHeight;
|
||||||
m_nHeight = *pHeight; // remember height for use in OnDrawItem
|
m_nHeight = *pHeight; // remember height for use in OnDrawItem
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxOwnerDrawn::OnMeasureItem
|
} // end of wxOwnerDrawn::OnMeasureItem
|
||||||
|
|
||||||
// draw the item
|
// draw the item
|
||||||
bool wxOwnerDrawn::OnDrawItem(
|
bool wxOwnerDrawn::OnDrawItem( wxDC& rDC,
|
||||||
wxDC& rDC
|
const wxRect& rRect,
|
||||||
, const wxRect& rRect
|
wxODAction eAction,
|
||||||
, wxODAction eAction
|
wxODStatus eStatus )
|
||||||
, wxODStatus eStatus
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// We do nothing on focus change
|
// We do nothing on focus change
|
||||||
//
|
//
|
||||||
if (eAction == wxODFocusChanged )
|
if (eAction == wxODFocusChanged )
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Select the font and draw the text
|
// Select the font and draw the text
|
||||||
@@ -309,8 +302,8 @@ bool wxOwnerDrawn::OnDrawItem(
|
|||||||
size_t nWidth;
|
size_t nWidth;
|
||||||
size_t nCharWidth;
|
size_t nCharWidth;
|
||||||
size_t nHeight;
|
size_t nHeight;
|
||||||
bool bFoundMnemonic = FALSE;
|
bool bFoundMnemonic = false;
|
||||||
bool bFoundAccel = FALSE;
|
bool bFoundAccel = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Deal with the tab, extracting the Accel text
|
// Deal with the tab, extracting the Accel text
|
||||||
@@ -318,7 +311,7 @@ bool wxOwnerDrawn::OnDrawItem(
|
|||||||
nIndex = sFullString.Find(sTgt.c_str());
|
nIndex = sFullString.Find(sTgt.c_str());
|
||||||
if (nIndex != -1)
|
if (nIndex != -1)
|
||||||
{
|
{
|
||||||
bFoundAccel = TRUE;
|
bFoundAccel = true;
|
||||||
sAccel = sFullString.Mid(nIndex + 1);
|
sAccel = sFullString.Mid(nIndex + 1);
|
||||||
sFullString.Remove(nIndex);
|
sFullString.Remove(nIndex);
|
||||||
}
|
}
|
||||||
@@ -332,7 +325,7 @@ bool wxOwnerDrawn::OnDrawItem(
|
|||||||
{
|
{
|
||||||
wxString sTmp = sFullString;
|
wxString sTmp = sFullString;
|
||||||
|
|
||||||
bFoundMnemonic = TRUE;
|
bFoundMnemonic = true;
|
||||||
sTmp.Remove(nIndex);
|
sTmp.Remove(nIndex);
|
||||||
rDC.GetTextExtent( sTmp
|
rDC.GetTextExtent( sTmp
|
||||||
,(long *)&nWidth
|
,(long *)&nWidth
|
||||||
@@ -343,7 +336,7 @@ bool wxOwnerDrawn::OnDrawItem(
|
|||||||
,(long *)&nCharWidth
|
,(long *)&nCharWidth
|
||||||
,(long *)&nHeight
|
,(long *)&nHeight
|
||||||
);
|
);
|
||||||
sFullString.Replace(sTgt.c_str(), wxEmptyString, TRUE);
|
sFullString.Replace(sTgt.c_str(), wxEmptyString, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -461,7 +454,7 @@ bool wxOwnerDrawn::OnDrawItem(
|
|||||||
,0
|
,0
|
||||||
,0
|
,0
|
||||||
,wxCOPY
|
,wxCOPY
|
||||||
,TRUE
|
,true
|
||||||
);
|
);
|
||||||
|
|
||||||
if (eStatus & wxODSelected)
|
if (eStatus & wxODSelected)
|
||||||
@@ -489,7 +482,7 @@ bool wxOwnerDrawn::OnDrawItem(
|
|||||||
vBmp.SetSelectedInto(NULL);
|
vBmp.SetSelectedInto(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxOwnerDrawn::OnDrawItem
|
} // end of wxOwnerDrawn::OnDrawItem
|
||||||
|
|
||||||
#endif //wxUSE_OWNER_DRAWN
|
#endif //wxUSE_OWNER_DRAWN
|
||||||
|
@@ -68,24 +68,20 @@ wxPalette::~wxPalette()
|
|||||||
{
|
{
|
||||||
} // end of wxPalette::~wxPalette
|
} // end of wxPalette::~wxPalette
|
||||||
|
|
||||||
bool wxPalette::FreeResource(
|
bool wxPalette::FreeResource( bool WXUNUSED(bForce) )
|
||||||
bool bForce
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette)
|
if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette)
|
||||||
{
|
{
|
||||||
::GpiSelectPalette(M_PALETTEDATA->m_hPS, NULLHANDLE);
|
::GpiSelectPalette(M_PALETTEDATA->m_hPS, NULLHANDLE);
|
||||||
::GpiDeletePalette((HPAL)M_PALETTEDATA->m_hPalette);
|
::GpiDeletePalette((HPAL)M_PALETTEDATA->m_hPalette);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxPalette::FreeResource
|
} // end of wxPalette::FreeResource
|
||||||
|
|
||||||
bool wxPalette::Create(
|
bool wxPalette::Create( int n,
|
||||||
int n
|
const unsigned char* pRed,
|
||||||
, const unsigned char* pRed
|
const unsigned char* pGreen,
|
||||||
, const unsigned char* pGreen
|
const unsigned char* pBlue )
|
||||||
, const unsigned char* pBlue
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
PULONG pualTable;
|
PULONG pualTable;
|
||||||
|
|
||||||
@@ -94,7 +90,7 @@ bool wxPalette::Create(
|
|||||||
m_refData = new wxPaletteRefData;
|
m_refData = new wxPaletteRefData;
|
||||||
pualTable = new ULONG[n];
|
pualTable = new ULONG[n];
|
||||||
if (!pualTable)
|
if (!pualTable)
|
||||||
return(FALSE);
|
return false;
|
||||||
|
|
||||||
for (int i = 0; i < n; i ++)
|
for (int i = 0; i < n; i ++)
|
||||||
{
|
{
|
||||||
@@ -107,7 +103,7 @@ bool wxPalette::Create(
|
|||||||
,pualTable
|
,pualTable
|
||||||
);
|
);
|
||||||
delete [] pualTable;
|
delete [] pualTable;
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxPalette::Create
|
} // end of wxPalette::Create
|
||||||
|
|
||||||
int wxPalette::GetPixel(
|
int wxPalette::GetPixel(
|
||||||
@@ -158,7 +154,7 @@ int wxPalette::GetPixel(
|
|||||||
{
|
{
|
||||||
if (pualTable[i] == ulRGB)
|
if (pualTable[i] == ulRGB)
|
||||||
{
|
{
|
||||||
bFound = TRUE;
|
bFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -234,4 +230,3 @@ void wxPalette::SetPS(
|
|||||||
::GpiSelectPalette(M_PALETTEDATA->m_hPS, M_PALETTEDATA->m_hPalette);
|
::GpiSelectPalette(M_PALETTEDATA->m_hPS, M_PALETTEDATA->m_hPalette);
|
||||||
M_PALETTEDATA->m_hPS = hPS;
|
M_PALETTEDATA->m_hPS = hPS;
|
||||||
} // end of wxPalette::SetHPALETTE
|
} // end of wxPalette::SetHPALETTE
|
||||||
|
|
||||||
|
@@ -156,11 +156,11 @@ bool wxPen::RealizeResource()
|
|||||||
}
|
}
|
||||||
if (M_PENDATA->m_nStyle == wxTRANSPARENT)
|
if (M_PENDATA->m_nStyle == wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
COLORREF vPmColour = 0L;
|
COLORREF vPmColour = 0L;
|
||||||
USHORT uLineType = wx2os2PenStyle(M_PENDATA->m_nStyle);
|
USHORT uLineType = (USHORT)wx2os2PenStyle(M_PENDATA->m_nStyle);
|
||||||
|
|
||||||
vPmColour = M_PENDATA->m_vColour.GetPixel();
|
vPmColour = M_PENDATA->m_vColour.GetPixel();
|
||||||
|
|
||||||
@@ -302,9 +302,10 @@ bool wxPen::RealizeResource()
|
|||||||
sError = wxPMErrorToStr(vError);
|
sError = wxPMErrorToStr(vError);
|
||||||
wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
|
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
|
} // end of wxPen::RealizeResource
|
||||||
|
|
||||||
WXHANDLE wxPen::GetResourceHandle()
|
WXHANDLE wxPen::GetResourceHandle()
|
||||||
@@ -315,16 +316,14 @@ WXHANDLE wxPen::GetResourceHandle()
|
|||||||
return (WXHANDLE)M_PENDATA->m_hPen;
|
return (WXHANDLE)M_PENDATA->m_hPen;
|
||||||
} // end of wxPen::GetResourceHandle
|
} // end of wxPen::GetResourceHandle
|
||||||
|
|
||||||
bool wxPen::FreeResource(
|
bool wxPen::FreeResource( bool WXUNUSED(bForce) )
|
||||||
bool bForce
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (M_PENDATA && (M_PENDATA->m_hPen != 0))
|
if (M_PENDATA && (M_PENDATA->m_hPen != 0))
|
||||||
{
|
{
|
||||||
M_PENDATA->m_hPen = 0;
|
M_PENDATA->m_hPen = 0;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else return FALSE;
|
else return false;
|
||||||
} // end of wxPen::FreeResource
|
} // end of wxPen::FreeResource
|
||||||
|
|
||||||
bool wxPen::IsFree() const
|
bool wxPen::IsFree() const
|
||||||
@@ -406,10 +405,8 @@ void wxPen::SetStipple(
|
|||||||
RealizeResource();
|
RealizeResource();
|
||||||
} // end of wxPen::SetStipple
|
} // end of wxPen::SetStipple
|
||||||
|
|
||||||
void wxPen::SetDashes(
|
void wxPen::SetDashes( int WXUNUSED(nNbDashes),
|
||||||
int nNbDashes
|
const wxDash* WXUNUSED(pDash) )
|
||||||
, const wxDash* pDash
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Does nothing under OS/2
|
// Does nothing under OS/2
|
||||||
@@ -473,5 +470,3 @@ int wx2os2PenStyle(
|
|||||||
}
|
}
|
||||||
return nPMStyle;
|
return nPMStyle;
|
||||||
} // end of wx2os2PenStyle
|
} // end of wx2os2PenStyle
|
||||||
|
|
||||||
|
|
||||||
|
@@ -34,10 +34,8 @@
|
|||||||
// implementation
|
// implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
bool wxPopupWindow::Create(
|
bool wxPopupWindow::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
int nFlags )
|
||||||
, int nFlags
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return wxPopupWindowBase::Create(pParent) &&
|
return wxPopupWindowBase::Create(pParent) &&
|
||||||
wxWindow::Create( pParent
|
wxWindow::Create( pParent
|
||||||
@@ -48,10 +46,8 @@ bool wxPopupWindow::Create(
|
|||||||
);
|
);
|
||||||
} // end of wxPopupWindow::Create
|
} // end of wxPopupWindow::Create
|
||||||
|
|
||||||
void wxPopupWindow::DoGetPosition(
|
void wxPopupWindow::DoGetPosition( int* pnX,
|
||||||
int* pnX
|
int* pnY ) const
|
||||||
, int* pnY
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// The position of a "top level" window such as this should be in
|
// The position of a "top level" window such as this should be in
|
||||||
@@ -70,10 +66,8 @@ WXHWND wxPopupWindow::OS2GetParent() const
|
|||||||
return (WXHWND)HWND_DESKTOP;
|
return (WXHWND)HWND_DESKTOP;
|
||||||
} // end of wxPopupWindow::OS2GetParent
|
} // end of wxPopupWindow::OS2GetParent
|
||||||
|
|
||||||
WXDWORD wxPopupWindow::OS2GetStyle(
|
WXDWORD wxPopupWindow::OS2GetStyle( long lFlags,
|
||||||
long lFlags
|
WXDWORD* dwExstyle ) const
|
||||||
, WXDWORD* dwExstyle
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
|
WXDWORD dwStyle = wxWindow::OS2GetStyle( lFlags & wxBORDER_MASK
|
||||||
,dwExstyle
|
,dwExstyle
|
||||||
@@ -81,5 +75,3 @@ WXDWORD wxPopupWindow::OS2GetStyle(
|
|||||||
|
|
||||||
return dwStyle;
|
return dwStyle;
|
||||||
} // end of wxPopupWindow::OS2GetStyle
|
} // end of wxPopupWindow::OS2GetStyle
|
||||||
|
|
||||||
|
|
||||||
|
@@ -90,13 +90,11 @@ wxRadioBox::~wxRadioBox()
|
|||||||
delete[] m_pnRadioHeight;
|
delete[] m_pnRadioHeight;
|
||||||
} // end of wxRadioBox::~wxRadioBox
|
} // end of wxRadioBox::~wxRadioBox
|
||||||
|
|
||||||
void wxRadioBox::AdjustButtons(
|
void wxRadioBox::AdjustButtons( int nX,
|
||||||
int nX
|
int nY,
|
||||||
, int nY
|
int nWidth,
|
||||||
, int nWidth
|
int nHeight,
|
||||||
, int nHeight
|
int WXUNUSED(nSizeFlags) )
|
||||||
, int nSizeFlags
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxSize vMaxSize;
|
wxSize vMaxSize;
|
||||||
int nXOffset = nX;
|
int nXOffset = nX;
|
||||||
@@ -754,10 +752,8 @@ wxSize wxRadioBox::GetMaxButtonSize() const
|
|||||||
if (nHeightMax < nHeight )
|
if (nHeightMax < nHeight )
|
||||||
nHeightMax = nHeight;
|
nHeightMax = nHeight;
|
||||||
}
|
}
|
||||||
return(wxSize( nWidthMax
|
wxSize maxsize( nWidthMax, nHeightMax);
|
||||||
,nHeightMax
|
return maxsize;
|
||||||
)
|
|
||||||
);
|
|
||||||
} // end of wxRadioBox::GetMaxButtonSize
|
} // end of wxRadioBox::GetMaxButtonSize
|
||||||
|
|
||||||
int wxRadioBox::GetNumHor() const
|
int wxRadioBox::GetNumHor() const
|
||||||
@@ -784,10 +780,8 @@ int wxRadioBox::GetNumVer() const
|
|||||||
}
|
}
|
||||||
} // end of wxRadioBox::GetNumVer
|
} // end of wxRadioBox::GetNumVer
|
||||||
|
|
||||||
void wxRadioBox::GetPosition(
|
void wxRadioBox::GetPosition( int* pnX,
|
||||||
int* pnX
|
int* WXUNUSED(pnY) ) const
|
||||||
, int* pnY
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
wxWindowOS2* pParent = GetParent();
|
wxWindowOS2* pParent = GetParent();
|
||||||
RECT vRect = { -1, -1, -1, -1 };
|
RECT vRect = { -1, -1, -1, -1 };
|
||||||
@@ -892,9 +886,7 @@ wxString wxRadioBox::GetStringSelection() const
|
|||||||
return sResult;
|
return sResult;
|
||||||
} // end of wxRadioBox::GetStringSelection
|
} // end of wxRadioBox::GetStringSelection
|
||||||
|
|
||||||
wxSize wxRadioBox::GetTotalButtonSize(
|
wxSize wxRadioBox::GetTotalButtonSize( const wxSize& rSizeBtn ) const
|
||||||
const wxSize& rSizeBtn
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
int nCx1;
|
int nCx1;
|
||||||
int nCy1;
|
int nCy1;
|
||||||
@@ -904,11 +896,7 @@ wxSize wxRadioBox::GetTotalButtonSize(
|
|||||||
int nWidthLabel;
|
int nWidthLabel;
|
||||||
wxFont vFont = GetFont();
|
wxFont vFont = GetFont();
|
||||||
|
|
||||||
wxGetCharSize( m_hWnd
|
wxGetCharSize( m_hWnd, &nCx1, &nCy1, &vFont );
|
||||||
,&nCx1
|
|
||||||
,&nCy1
|
|
||||||
,&vFont
|
|
||||||
);
|
|
||||||
nExtraHeight = nCy1;
|
nExtraHeight = nCy1;
|
||||||
|
|
||||||
nHeight = GetNumVer() * rSizeBtn.y + (2 * nCy1);
|
nHeight = GetNumVer() * rSizeBtn.y + (2 * nCy1);
|
||||||
@@ -925,20 +913,16 @@ wxSize wxRadioBox::GetTotalButtonSize(
|
|||||||
if (nWidthLabel > nWidth)
|
if (nWidthLabel > nWidth)
|
||||||
nWidth = nWidthLabel;
|
nWidth = nWidthLabel;
|
||||||
|
|
||||||
return(wxSize( nWidth
|
wxSize total( nWidth, nHeight );
|
||||||
,nHeight
|
return total;
|
||||||
)
|
|
||||||
);
|
|
||||||
} // end of wxRadioBox::GetTotalButtonSize
|
} // end of wxRadioBox::GetTotalButtonSize
|
||||||
|
|
||||||
WXHBRUSH wxRadioBox::OnCtlColor(
|
WXHBRUSH wxRadioBox::OnCtlColor( WXHDC hwinDC,
|
||||||
WXHDC hwinDC
|
WXHWND WXUNUSED(hWnd),
|
||||||
, WXHWND hWnd
|
WXUINT WXUNUSED(uCtlColor),
|
||||||
, WXUINT uCtlColor
|
WXUINT WXUNUSED(uMessage),
|
||||||
, WXUINT uMessage
|
WXWPARAM WXUNUSED(wParam),
|
||||||
, WXWPARAM wParam
|
WXLPARAM WXUNUSED(lParam) )
|
||||||
, WXLPARAM 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
|
||||||
|
|
||||||
@@ -952,17 +936,12 @@ WXHBRUSH wxRadioBox::OnCtlColor(
|
|||||||
::GpiSetBackColor(hPS, vColBack.GetPixel());
|
::GpiSetBackColor(hPS, vColBack.GetPixel());
|
||||||
::GpiSetColor(hPS, vColBack.GetPixel());
|
::GpiSetColor(hPS, vColBack.GetPixel());
|
||||||
|
|
||||||
|
wxBrush* pBrush = wxTheBrushList->FindOrCreateBrush( vColBack, wxSOLID );
|
||||||
wxBrush* pBrush = wxTheBrushList->FindOrCreateBrush( vColBack
|
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
return ((WXHBRUSH)pBrush->GetResourceHandle());
|
return ((WXHBRUSH)pBrush->GetResourceHandle());
|
||||||
} // end of wxRadioBox::OnCtlColor
|
} // end of wxRadioBox::OnCtlColor
|
||||||
|
|
||||||
bool wxRadioBox::OS2Command(
|
bool wxRadioBox::OS2Command( WXUINT uCmd,
|
||||||
WXUINT uCmd
|
WXWORD wId)
|
||||||
, WXWORD wId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int nSelectedButton = -1;
|
int nSelectedButton = -1;
|
||||||
|
|
||||||
@@ -1235,4 +1214,3 @@ MRESULT EXPENTRY wxRadioBoxWndProc(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} // end of wxRadioBoxWndProc
|
} // end of wxRadioBoxWndProc
|
||||||
|
|
||||||
|
@@ -153,20 +153,17 @@ bool wxRadioButton::GetValue() const
|
|||||||
return((::WinSendMsg((HWND) GetHWND(), BM_QUERYCHECK, (MPARAM)0L, (MPARAM)0L) != 0));
|
return((::WinSendMsg((HWND) GetHWND(), BM_QUERYCHECK, (MPARAM)0L, (MPARAM)0L) != 0));
|
||||||
} // end of wxRadioButton::GetValue
|
} // end of wxRadioButton::GetValue
|
||||||
|
|
||||||
bool wxRadioButton::OS2Command(
|
bool wxRadioButton::OS2Command( WXUINT wParam, WXWORD WXUNUSED(wId) )
|
||||||
WXUINT wParam
|
|
||||||
, WXWORD wId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (wParam != BN_CLICKED)
|
if (wParam != BN_CLICKED)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (m_bFocusJustSet)
|
if (m_bFocusJustSet)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// See above: we want to ignore this event
|
// See above: we want to ignore this event
|
||||||
//
|
//
|
||||||
m_bFocusJustSet = FALSE;
|
m_bFocusJustSet = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -182,14 +179,11 @@ bool wxRadioButton::OS2Command(
|
|||||||
if (!bIsChecked )
|
if (!bIsChecked )
|
||||||
SetValue(TRUE);
|
SetValue(TRUE);
|
||||||
}
|
}
|
||||||
wxCommandEvent rEvent( wxEVT_COMMAND_RADIOBUTTON_SELECTED
|
wxCommandEvent rEvent( wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
|
||||||
,m_windowId
|
|
||||||
);
|
|
||||||
|
|
||||||
rEvent.SetEventObject(this);
|
rEvent.SetEventObject(this);
|
||||||
ProcessCommand(rEvent);
|
ProcessCommand(rEvent);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxRadioButton::OS2Command
|
} // end of wxRadioButton::OS2Command
|
||||||
|
|
||||||
void wxRadioButton::SetFocus()
|
void wxRadioButton::SetFocus()
|
||||||
@@ -203,7 +197,7 @@ void wxRadioButton::SetFocus()
|
|||||||
//
|
//
|
||||||
// to avoid this, we drop the pseudo BN_CLICKED events generated when the
|
// to avoid this, we drop the pseudo BN_CLICKED events generated when the
|
||||||
// button gains focus
|
// button gains focus
|
||||||
m_bFocusJustSet = TRUE;
|
m_bFocusJustSet = true;
|
||||||
|
|
||||||
wxControl::SetFocus();
|
wxControl::SetFocus();
|
||||||
}
|
}
|
||||||
|
@@ -97,9 +97,7 @@ bool wxScrollBar::Create (
|
|||||||
,(MPARAM)0
|
,(MPARAM)0
|
||||||
,MPFROM2SHORT(0,1)
|
,MPFROM2SHORT(0,1)
|
||||||
);
|
);
|
||||||
::WinShowWindow( hScrollBar
|
::WinShowWindow( hScrollBar, TRUE );
|
||||||
,TRUE
|
|
||||||
);
|
|
||||||
SetFont(*wxSMALL_FONT);
|
SetFont(*wxSMALL_FONT);
|
||||||
|
|
||||||
m_hWnd = hScrollBar;
|
m_hWnd = hScrollBar;
|
||||||
@@ -120,12 +118,10 @@ wxScrollBar::~wxScrollBar()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxScrollBar::OS2OnScroll (
|
bool wxScrollBar::OS2OnScroll ( int WXUNUSED(nOrientation),
|
||||||
int nOrientation
|
WXWORD wParam,
|
||||||
, WXWORD wParam
|
WXWORD wPos,
|
||||||
, WXWORD wPos
|
WXHWND WXUNUSED(hControl) )
|
||||||
, WXHWND hControl
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int nPosition;
|
int nPosition;
|
||||||
int nMaxPos;
|
int nMaxPos;
|
||||||
@@ -219,7 +215,7 @@ bool wxScrollBar::OS2OnScroll (
|
|||||||
// Don't process the event if there is no displacement,
|
// Don't process the event if there is no displacement,
|
||||||
// unless this is a thumb release or end scroll event.
|
// unless this is a thumb release or end scroll event.
|
||||||
//
|
//
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxScrollEvent vEvent( vScrollEvent
|
wxScrollEvent vEvent( vScrollEvent
|
||||||
@@ -232,15 +228,13 @@ bool wxScrollBar::OS2OnScroll (
|
|||||||
return GetEventHandler()->ProcessEvent(vEvent);
|
return GetEventHandler()->ProcessEvent(vEvent);
|
||||||
} // end of wxScrollBar::OS2OnScroll
|
} // end of wxScrollBar::OS2OnScroll
|
||||||
|
|
||||||
void wxScrollBar::SetThumbPosition (
|
void wxScrollBar::SetThumbPosition ( int nViewStart )
|
||||||
int nViewStart
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SBCDATA vInfo;
|
SBCDATA vInfo;
|
||||||
|
|
||||||
memset(&vInfo, '\0', sizeof(SBCDATA));
|
memset(&vInfo, '\0', sizeof(SBCDATA));
|
||||||
vInfo.cb = 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(), WM_SETWINDOWPARAMS, (MPARAM)&vInfo, (MPARAM)NULL);
|
||||||
::WinSendMsg((HWND)GetHwnd(), SBM_SETPOS, (MPARAM)nViewStart, (MPARAM)NULL);
|
::WinSendMsg((HWND)GetHwnd(), SBM_SETPOS, (MPARAM)nViewStart, (MPARAM)NULL);
|
||||||
@@ -251,13 +245,11 @@ int wxScrollBar::GetThumbPosition() const
|
|||||||
return((int)(MRESULT)::WinSendMsg((HWND)GetHwnd(), SBM_QUERYPOS, (MPARAM)NULL, (MPARAM)NULL));
|
return((int)(MRESULT)::WinSendMsg((HWND)GetHwnd(), SBM_QUERYPOS, (MPARAM)NULL, (MPARAM)NULL));
|
||||||
} // end of wxScrollBar::GetThumbPosition
|
} // end of wxScrollBar::GetThumbPosition
|
||||||
|
|
||||||
void wxScrollBar::SetScrollbar (
|
void wxScrollBar::SetScrollbar ( int nPosition,
|
||||||
int nPosition
|
int nThumbSize,
|
||||||
, int nThumbSize
|
int nRange,
|
||||||
, int nRange
|
int nPageSize,
|
||||||
, int nPageSize
|
bool WXUNUSED(bRefresh) )
|
||||||
, bool bRefresh
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SBCDATA vInfo;
|
SBCDATA vInfo;
|
||||||
//
|
//
|
||||||
@@ -280,22 +272,20 @@ void wxScrollBar::SetScrollbar (
|
|||||||
nRange1 += (m_nPageSize - 1);
|
nRange1 += (m_nPageSize - 1);
|
||||||
}
|
}
|
||||||
vInfo.cb = sizeof(SBCDATA);
|
vInfo.cb = sizeof(SBCDATA);
|
||||||
vInfo.cVisible = m_nPageSize;
|
vInfo.cVisible = (SHORT)m_nPageSize;
|
||||||
vInfo.posFirst = 0;
|
vInfo.posFirst = 0;
|
||||||
vInfo.posLast = nRange1;
|
vInfo.posLast = (SHORT)nRange1;
|
||||||
vInfo.posThumb = nPosition;
|
vInfo.posThumb = (SHORT)nPosition;
|
||||||
|
|
||||||
::WinSendMsg((HWND)GetHwnd(), WM_SETWINDOWPARAMS, (MPARAM)&vInfo, (MPARAM)NULL);
|
::WinSendMsg((HWND)GetHwnd(), WM_SETWINDOWPARAMS, (MPARAM)&vInfo, (MPARAM)NULL);
|
||||||
} // end of wxScrollBar::SetScrollbar
|
} // end of wxScrollBar::SetScrollbar
|
||||||
|
|
||||||
WXHBRUSH wxScrollBar::OnCtlColor (
|
WXHBRUSH wxScrollBar::OnCtlColor ( WXHDC WXUNUSED(hDC),
|
||||||
WXHDC hDC
|
WXHWND WXUNUSED(hWnd),
|
||||||
, WXHWND hWnd
|
WXUINT WXUNUSED(uCtlColor),
|
||||||
, WXUINT uCtlColor
|
WXUINT WXUNUSED(uMessage),
|
||||||
, WXUINT uMessage
|
WXWPARAM WXUNUSED(wParam),
|
||||||
, WXWPARAM wParam
|
WXLPARAM WXUNUSED(lParam) )
|
||||||
, WXLPARAM lParam
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Does nothing under OS/2
|
// Does nothing under OS/2
|
||||||
@@ -303,11 +293,8 @@ WXHBRUSH wxScrollBar::OnCtlColor (
|
|||||||
return 0;
|
return 0;
|
||||||
} // end of wxScrollBar::OnCtlColor
|
} // end of wxScrollBar::OnCtlColor
|
||||||
|
|
||||||
void wxScrollBar::Command (
|
void wxScrollBar::Command ( wxCommandEvent& rEvent )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SetThumbPosition(rEvent.GetInt());
|
SetThumbPosition(rEvent.GetInt());
|
||||||
ProcessCommand(rEvent);
|
ProcessCommand(rEvent);
|
||||||
} // end of wxScrollBar::Command
|
} // end of wxScrollBar::Command
|
||||||
|
|
||||||
|
@@ -166,7 +166,6 @@ wxColour wxSystemSettingsNative::GetColour(
|
|||||||
case wxSYS_COLOUR_LISTBOX:
|
case wxSYS_COLOUR_LISTBOX:
|
||||||
case wxSYS_COLOUR_CAPTIONTEXT:
|
case wxSYS_COLOUR_CAPTIONTEXT:
|
||||||
return(*wxWHITE);
|
return(*wxWHITE);
|
||||||
break;
|
|
||||||
|
|
||||||
case wxSYS_COLOUR_WINDOWTEXT:
|
case wxSYS_COLOUR_WINDOWTEXT:
|
||||||
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
|
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
|
||||||
@@ -249,10 +248,8 @@ wxFont wxSystemSettingsNative::GetFont(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get a system metric, e.g. scrollbar size
|
// Get a system metric, e.g. scrollbar size
|
||||||
int wxSystemSettingsNative::GetMetric(
|
int wxSystemSettingsNative::GetMetric( wxSystemMetric index,
|
||||||
wxSystemMetric index
|
wxWindow* WXUNUSED(win) )
|
||||||
, wxWindow* WXUNUSED(win)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
switch ( index)
|
switch ( index)
|
||||||
{
|
{
|
||||||
@@ -297,27 +294,20 @@ int wxSystemSettingsNative::GetMetric(
|
|||||||
// TODO case wxSYS_PENWINDOWS_PRESENT:
|
// TODO case wxSYS_PENWINDOWS_PRESENT:
|
||||||
// TODO case wxSYS_SHOW_SOUNDS:
|
// TODO case wxSYS_SHOW_SOUNDS:
|
||||||
// TODO case wxSYS_SWAP_BUTTONS:
|
// TODO case wxSYS_SWAP_BUTTONS:
|
||||||
|
}
|
||||||
default:
|
|
||||||
return -1; // unsupported metric
|
return -1; // unsupported metric
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxSystemSettingsNative::HasFeature(
|
bool wxSystemSettingsNative::HasFeature( wxSystemFeature index )
|
||||||
wxSystemFeature index
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
switch (index)
|
switch (index)
|
||||||
{
|
{
|
||||||
case wxSYS_CAN_ICONIZE_FRAME:
|
case wxSYS_CAN_ICONIZE_FRAME:
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
|
case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
|
||||||
return FALSE;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
return false;
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
@@ -52,13 +52,11 @@ wxSlider::~wxSlider()
|
|||||||
::WinDestroyWindow((HWND)m_hStaticValue);
|
::WinDestroyWindow((HWND)m_hStaticValue);
|
||||||
} // end of wxSlider::~wxSlider
|
} // end of wxSlider::~wxSlider
|
||||||
|
|
||||||
void wxSlider::AdjustSubControls(
|
void wxSlider::AdjustSubControls( int nX,
|
||||||
int nX
|
int nY,
|
||||||
, int nY
|
int nWidth,
|
||||||
, int nWidth
|
int nHeight,
|
||||||
, int nHeight
|
int WXUNUSED(nSizeFlags) )
|
||||||
, int nSizeFlags
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int nXOffset = nX;
|
int nXOffset = nX;
|
||||||
int nYOffset = nY;
|
int nYOffset = nY;
|
||||||
@@ -312,8 +310,8 @@ bool wxSlider::Create(
|
|||||||
lMsStyle |= SLS_RIBBONSTRIP;
|
lMsStyle |= SLS_RIBBONSTRIP;
|
||||||
|
|
||||||
m_nPageSize = ((nMaxValue - nMinValue)/10);
|
m_nPageSize = ((nMaxValue - nMinValue)/10);
|
||||||
vSlData.usScale1Increments = m_nPageSize;
|
vSlData.usScale1Increments = (USHORT)m_nPageSize;
|
||||||
vSlData.usScale2Increments = m_nPageSize;
|
vSlData.usScale2Increments = (USHORT)m_nPageSize;
|
||||||
|
|
||||||
HWND hScrollBar = ::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
|
HWND hScrollBar = ::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
|
||||||
,WC_SLIDER // Window class
|
,WC_SLIDER // Window class
|
||||||
@@ -922,12 +920,10 @@ WXHBRUSH wxSlider::OnCtlColor(
|
|||||||
);
|
);
|
||||||
} // end of wxSlider::OnCtlColor
|
} // end of wxSlider::OnCtlColor
|
||||||
|
|
||||||
bool wxSlider::OS2OnScroll(
|
bool wxSlider::OS2OnScroll( int WXUNUSED(nOrientation),
|
||||||
int WXUNUSED(nOrientation)
|
WXWORD wParam,
|
||||||
, WXWORD wParam
|
WXWORD WXUNUSED(wPos),
|
||||||
, WXWORD wPos
|
WXHWND WXUNUSED(hControl) )
|
||||||
, WXHWND hControl
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxEventType eScrollEvent = wxEVT_NULL;
|
wxEventType eScrollEvent = wxEVT_NULL;
|
||||||
|
|
||||||
@@ -950,9 +946,7 @@ bool wxSlider::OS2OnScroll(
|
|||||||
|
|
||||||
int nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
|
int nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
|
||||||
, SLM_QUERYSLIDERINFO
|
, SLM_QUERYSLIDERINFO
|
||||||
,MPFROM2SHORT( SMA_SHAFTDIMENSIONS
|
, MPFROM2SHORT( SMA_SHAFTDIMENSIONS, SMA_RANGEVALUE )
|
||||||
,SMA_RANGEVALUE
|
|
||||||
)
|
|
||||||
, (MPARAM)0
|
, (MPARAM)0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -960,12 +954,11 @@ bool wxSlider::OS2OnScroll(
|
|||||||
int nNewPos = 0;
|
int nNewPos = 0;
|
||||||
int nPixelPos = SHORT1FROMMR(::WinSendMsg( GetHwnd()
|
int nPixelPos = SHORT1FROMMR(::WinSendMsg( GetHwnd()
|
||||||
, SLM_QUERYSLIDERINFO
|
, SLM_QUERYSLIDERINFO
|
||||||
,MPFROM2SHORT( SMA_SLIDERARMPOSITION
|
, MPFROM2SHORT( SMA_SLIDERARMPOSITION, SMA_RANGEVALUE )
|
||||||
,SMA_RANGEVALUE
|
|
||||||
)
|
|
||||||
, (MPARAM)0
|
, (MPARAM)0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
nNewPos = (int)(nPixelPos/m_dPixelToRange);
|
nNewPos = (int)(nPixelPos/m_dPixelToRange);
|
||||||
if (nNewPos > (m_nRangeMax - m_nRangeMin)/2)
|
if (nNewPos > (m_nRangeMax - m_nRangeMin)/2)
|
||||||
nNewPos++;
|
nNewPos++;
|
||||||
@@ -978,34 +971,26 @@ bool wxSlider::OS2OnScroll(
|
|||||||
}
|
}
|
||||||
SetValue(nNewPos);
|
SetValue(nNewPos);
|
||||||
|
|
||||||
wxScrollEvent vEvent( eScrollEvent
|
wxScrollEvent vEvent( eScrollEvent, m_windowId );
|
||||||
,m_windowId
|
|
||||||
);
|
|
||||||
|
|
||||||
vEvent.SetPosition(nNewPos);
|
vEvent.SetPosition(nNewPos);
|
||||||
vEvent.SetEventObject(this);
|
vEvent.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(vEvent);
|
GetEventHandler()->ProcessEvent(vEvent);
|
||||||
|
|
||||||
wxCommandEvent vCevent( wxEVT_COMMAND_SLIDER_UPDATED
|
wxCommandEvent vCevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() );
|
||||||
,GetId()
|
|
||||||
);
|
|
||||||
|
|
||||||
vCevent.SetInt(nNewPos);
|
vCevent.SetInt(nNewPos);
|
||||||
vCevent.SetEventObject(this);
|
vCevent.SetEventObject(this);
|
||||||
return (GetEventHandler()->ProcessEvent(vCevent));
|
return (GetEventHandler()->ProcessEvent(vCevent));
|
||||||
} // end of wxSlider::OS2OnScroll
|
} // end of wxSlider::OS2OnScroll
|
||||||
|
|
||||||
void wxSlider::SetLineSize(
|
void wxSlider::SetLineSize( int nLineSize )
|
||||||
int nLineSize
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
m_nLineSize = nLineSize;
|
m_nLineSize = nLineSize;
|
||||||
} // end of wxSlider::SetLineSize
|
} // end of wxSlider::SetLineSize
|
||||||
|
|
||||||
|
|
||||||
void wxSlider::SetPageSize(
|
void wxSlider::SetPageSize( int nPageSize )
|
||||||
int nPageSize
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
m_nPageSize = nPageSize;
|
m_nPageSize = nPageSize;
|
||||||
} // end of wxSlider::SetPageSize
|
} // end of wxSlider::SetPageSize
|
||||||
@@ -1094,10 +1079,7 @@ void wxSlider::SetTick(
|
|||||||
} // end of wxSlider::SetTick
|
} // end of wxSlider::SetTick
|
||||||
|
|
||||||
// For trackbars only
|
// For trackbars only
|
||||||
void wxSlider::SetTickFreq(
|
void wxSlider::SetTickFreq( int n, int WXUNUSED(nPos) )
|
||||||
int n
|
|
||||||
, int nPos
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SLDCDATA vSlData;
|
SLDCDATA vSlData;
|
||||||
WNDPARAMS vWndParams;
|
WNDPARAMS vWndParams;
|
||||||
@@ -1110,8 +1092,8 @@ void wxSlider::SetTickFreq(
|
|||||||
vSlData.usScale1Spacing = 0;
|
vSlData.usScale1Spacing = 0;
|
||||||
vSlData.usScale2Spacing = 0;
|
vSlData.usScale2Spacing = 0;
|
||||||
}
|
}
|
||||||
vSlData.usScale1Increments = (m_nRangeMax - m_nRangeMin)/n;
|
vSlData.usScale1Increments = (USHORT)((m_nRangeMax - m_nRangeMin)/n);
|
||||||
vSlData.usScale2Increments = (m_nRangeMax - m_nRangeMin)/n;
|
vSlData.usScale2Increments = (USHORT)((m_nRangeMax - m_nRangeMin)/n);
|
||||||
|
|
||||||
vWndParams.fsStatus = WPM_CTLDATA;
|
vWndParams.fsStatus = WPM_CTLDATA;
|
||||||
vWndParams.cchText = 0L;
|
vWndParams.cchText = 0L;
|
||||||
|
@@ -121,16 +121,17 @@ bool wxSound::Create(int size, const wxByte* data)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSound::DoPlay(unsigned flags) const
|
bool wxSound::DoPlay(unsigned WXUNUSED(flags)) const
|
||||||
{
|
{
|
||||||
if (!IsOk())
|
if (!IsOk())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
/*
|
/*
|
||||||
return ( ::PlaySound((LPCTSTR)m_waveData, NULL, SND_MEMORY |
|
return ( ::PlaySound((LPCTSTR)m_waveData, NULL, SND_MEMORY |
|
||||||
SND_NODEFAULT | (async ? SND_ASYNC : SND_SYNC) | (looped ? (SND_LOOP | SND_ASYNC) : 0)) != 0 );
|
SND_NODEFAULT | (async ? SND_ASYNC : SND_SYNC) | (looped ? (SND_LOOP | SND_ASYNC) : 0)) != 0 );
|
||||||
*/
|
*/
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSound::Free()
|
bool wxSound::Free()
|
||||||
@@ -157,6 +158,5 @@ bool wxSound::Free()
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -167,7 +167,8 @@ wxSize wxSpinButton::DoGetBestSize() const
|
|||||||
// 24x20 which is the size of the buttons and the borders.
|
// 24x20 which is the size of the buttons and the borders.
|
||||||
// Also we have no horizontal spin buttons.
|
// Also we have no horizontal spin buttons.
|
||||||
//
|
//
|
||||||
return (wxSize(24,20));
|
wxSize best(24,20);
|
||||||
|
return best;
|
||||||
} // end of wxSpinButton::DoGetBestSize
|
} // end of wxSpinButton::DoGetBestSize
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -190,18 +191,14 @@ int wxSpinButton::GetValue() const
|
|||||||
return ((int)lVal);
|
return ((int)lVal);
|
||||||
} // end of wxSpinButton::GetValue
|
} // end of wxSpinButton::GetValue
|
||||||
|
|
||||||
bool wxSpinButton::OS2OnScroll(
|
bool wxSpinButton::OS2OnScroll( int WXUNUSED(nOrientation),
|
||||||
int nOrientation
|
WXWORD WXUNUSED(wParam),
|
||||||
, WXWORD wParam
|
WXWORD wPos,
|
||||||
, WXWORD wPos
|
WXHWND hControl )
|
||||||
, WXHWND hControl
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxCHECK_MSG(hControl, FALSE, wxT("scrolling what?") )
|
wxCHECK_MSG(hControl, false, wxT("scrolling what?") )
|
||||||
|
|
||||||
wxSpinEvent vEvent( wxEVT_SCROLL_THUMBTRACK
|
wxSpinEvent vEvent( wxEVT_SCROLL_THUMBTRACK, m_windowId );
|
||||||
,m_windowId
|
|
||||||
);
|
|
||||||
int nVal = (int)wPos; // cast is important for negative values!
|
int nVal = (int)wPos; // cast is important for negative values!
|
||||||
|
|
||||||
vEvent.SetPosition(nVal);
|
vEvent.SetPosition(nVal);
|
||||||
@@ -209,12 +206,10 @@ bool wxSpinButton::OS2OnScroll(
|
|||||||
return(GetEventHandler()->ProcessEvent(vEvent));
|
return(GetEventHandler()->ProcessEvent(vEvent));
|
||||||
} // end of wxSpinButton::OS2OnScroll
|
} // end of wxSpinButton::OS2OnScroll
|
||||||
|
|
||||||
bool wxSpinButton::OS2Command(
|
bool wxSpinButton::OS2Command( WXUINT WXUNUSED(uCmd),
|
||||||
WXUINT uCmd
|
WXWORD WXUNUSED(wId) )
|
||||||
, WXWORD wId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
} // end of wxSpinButton::OS2Command
|
} // end of wxSpinButton::OS2Command
|
||||||
|
|
||||||
void wxSpinButton::SetRange(
|
void wxSpinButton::SetRange(
|
||||||
|
@@ -117,18 +117,16 @@ wxSpinCtrl::~wxSpinCtrl()
|
|||||||
// construction
|
// construction
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxSpinCtrl::Create(
|
bool wxSpinCtrl::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
wxWindowID vId,
|
||||||
, wxWindowID vId
|
const wxString& WXUNUSED(rsValue),
|
||||||
, const wxString& rsValue
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
long lStyle,
|
||||||
, long lStyle
|
int nMin,
|
||||||
, int nMin
|
int nMax,
|
||||||
, int nMax
|
int nInitial,
|
||||||
, int nInitial
|
const wxString& rsName )
|
||||||
, const wxString& rsName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SWP vSwp;
|
SWP vSwp;
|
||||||
|
|
||||||
@@ -418,18 +416,14 @@ void wxSpinCtrl::OnSetFocus (
|
|||||||
rEvent.Skip();
|
rEvent.Skip();
|
||||||
} // end of wxSpinCtrl::OnSetFocus
|
} // end of wxSpinCtrl::OnSetFocus
|
||||||
|
|
||||||
bool wxSpinCtrl::ProcessTextCommand(
|
bool wxSpinCtrl::ProcessTextCommand( WXWORD wCmd,
|
||||||
WXWORD wCmd
|
WXWORD WXUNUSED(wId) )
|
||||||
, WXWORD wId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
switch (wCmd)
|
switch (wCmd)
|
||||||
{
|
{
|
||||||
case SPBN_CHANGE:
|
case SPBN_CHANGE:
|
||||||
{
|
{
|
||||||
wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED
|
wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED, GetId() );
|
||||||
,GetId()
|
|
||||||
);
|
|
||||||
vEvent.SetEventObject(this);
|
vEvent.SetEventObject(this);
|
||||||
|
|
||||||
wxString sVal = wxGetWindowText(m_hWndBuddy);
|
wxString sVal = wxGetWindowText(m_hWndBuddy);
|
||||||
|
@@ -69,15 +69,13 @@ static wxGDIImage* ConvertImage(
|
|||||||
// wxStaticBitmap
|
// wxStaticBitmap
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxStaticBitmap::Create(
|
bool wxStaticBitmap::Create( wxWindow* pParent,
|
||||||
wxWindow* pParent
|
wxWindowID nId,
|
||||||
, wxWindowID nId
|
const wxGDIImage& rBitmap,
|
||||||
, const wxGDIImage& rBitmap
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& WXUNUSED(rSize),
|
||||||
, const wxSize& rSize
|
long lStyle,
|
||||||
, long lStyle
|
const wxString& rName )
|
||||||
, const wxString& rName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ERRORID vError;
|
ERRORID vError;
|
||||||
wxString sError;
|
wxString sError;
|
||||||
@@ -123,7 +121,7 @@ bool wxStaticBitmap::Create(
|
|||||||
{
|
{
|
||||||
vError = ::WinGetLastError(wxGetInstance());
|
vError = ::WinGetLastError(wxGetInstance());
|
||||||
sError = wxPMErrorToStr(vError);
|
sError = wxPMErrorToStr(vError);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static bitmap") );
|
wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static bitmap") );
|
||||||
m_pImage = ConvertImage(rBitmap);
|
m_pImage = ConvertImage(rBitmap);
|
||||||
@@ -133,7 +131,7 @@ bool wxStaticBitmap::Create(
|
|||||||
SubclassWin(m_hWnd);
|
SubclassWin(m_hWnd);
|
||||||
SetSize(nX, nY, m_pImage->GetWidth(), m_pImage->GetHeight());
|
SetSize(nX, nY, m_pImage->GetWidth(), m_pImage->GetHeight());
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
} // end of wxStaticBitmap::Create
|
} // end of wxStaticBitmap::Create
|
||||||
|
|
||||||
bool wxStaticBitmap::ImageIsOk() const
|
bool wxStaticBitmap::ImageIsOk() const
|
||||||
|
@@ -87,7 +87,9 @@ wxTabCtrl::~wxTabCtrl()
|
|||||||
UnsubclassWin();
|
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);
|
wxTabEvent event(wxEVT_NULL, m_windowId);
|
||||||
wxEventType eventType = wxEVT_NULL;
|
wxEventType eventType = wxEVT_NULL;
|
||||||
@@ -142,14 +144,14 @@ void wxTabCtrl::OnSysColourChanged(wxSysColourChangedEvent& event)
|
|||||||
bool wxTabCtrl::DeleteAllItems()
|
bool wxTabCtrl::DeleteAllItems()
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete an item
|
// Delete an item
|
||||||
bool wxTabCtrl::DeleteItem(int item)
|
bool wxTabCtrl::DeleteItem(int WXUNUSED(item))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the selection
|
// Get the selection
|
||||||
@@ -180,10 +182,11 @@ int wxTabCtrl::GetItemCount() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the rect corresponding to the tab
|
// 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
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the number of rows
|
// Get the number of rows
|
||||||
@@ -194,82 +197,85 @@ int wxTabCtrl::GetRowCount() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the item text
|
// Get the item text
|
||||||
wxString wxTabCtrl::GetItemText(int item) const
|
wxString wxTabCtrl::GetItemText(int WXUNUSED(item)) const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return wxString(wxEmptyString);
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the item image
|
// Get the item image
|
||||||
int wxTabCtrl::GetItemImage(int item) const
|
int wxTabCtrl::GetItemImage(int WXUNUSED(item)) const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the item data
|
// Get the item data
|
||||||
void* wxTabCtrl::GetItemData(int item) const
|
void* wxTabCtrl::GetItemData(int WXUNUSED(item)) const
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hit test
|
// Hit test
|
||||||
int wxTabCtrl::HitTest(const wxPoint& pt, long& flags)
|
int wxTabCtrl::HitTest(const wxPoint& WXUNUSED(pt), long& WXUNUSED(flags))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert an item
|
// 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
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the selection
|
// Set the selection
|
||||||
int wxTabCtrl::SetSelection(int item)
|
int wxTabCtrl::SetSelection(int WXUNUSED(item))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the image list
|
// Set the image list
|
||||||
void wxTabCtrl::SetImageList(wxImageList* imageList)
|
void wxTabCtrl::SetImageList(wxImageList* WXUNUSED(imageList))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the text for an item
|
// 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
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the image for an item
|
// Set the image for an item
|
||||||
bool wxTabCtrl::SetItemImage(int item, int image)
|
bool wxTabCtrl::SetItemImage(int WXUNUSED(item), int WXUNUSED(image))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the data for an item
|
// Set the data for an item
|
||||||
bool wxTabCtrl::SetItemData(int item, void* data)
|
bool wxTabCtrl::SetItemData(int WXUNUSED(item), void* WXUNUSED(data))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the size for a fixed-width tab control
|
// Set the size for a fixed-width tab control
|
||||||
void wxTabCtrl::SetItemSize(const wxSize& size)
|
void wxTabCtrl::SetItemSize(const wxSize& WXUNUSED(size))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the padding between tabs
|
// Set the padding between tabs
|
||||||
void wxTabCtrl::SetPadding(const wxSize& padding)
|
void wxTabCtrl::SetPadding(const wxSize& WXUNUSED(padding))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
@@ -344,9 +350,7 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height)
|
|||||||
// Tab event
|
// Tab event
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
|
||||||
|
|
||||||
wxTabEvent::wxTabEvent(wxEventType commandType, int id):
|
wxTabEvent::wxTabEvent(wxEventType commandType, int id)
|
||||||
wxCommandEvent(commandType, id)
|
:wxCommandEvent(commandType, id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -25,8 +25,9 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_CLIPBOARD
|
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
|
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
#include "wx/clipbrd.h"
|
#include "wx/clipbrd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -596,11 +597,9 @@ bool wxTextCtrl::IsEditable() const
|
|||||||
// Editing
|
// Editing
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxTextCtrl::Replace(
|
void wxTextCtrl::Replace( long lFrom,
|
||||||
long lFrom
|
long lTo,
|
||||||
, long lTo
|
const wxString& rsValue )
|
||||||
, const wxString& rsValue
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if wxUSE_CLIPBOARD
|
#if wxUSE_CLIPBOARD
|
||||||
HWND hWnd = GetHwnd();
|
HWND hWnd = GetHwnd();
|
||||||
@@ -630,6 +629,9 @@ void wxTextCtrl::Replace(
|
|||||||
else
|
else
|
||||||
::WinSendMsg(hWnd, EM_PASTE, (MPARAM)0, (MPARAM)0);
|
::WinSendMsg(hWnd, EM_PASTE, (MPARAM)0, (MPARAM)0);
|
||||||
#else
|
#else
|
||||||
|
wxUnusedVar(lFrom);
|
||||||
|
wxUnusedVar(lTo);
|
||||||
|
wxUnusedVar(rsValue);
|
||||||
wxFAIL_MSG("wxTextCtrl::Replace not implemented if wxUSE_CLIPBOARD is 0.");
|
wxFAIL_MSG("wxTextCtrl::Replace not implemented if wxUSE_CLIPBOARD is 0.");
|
||||||
#endif
|
#endif
|
||||||
} // end of wxTextCtrl::Replace
|
} // end of wxTextCtrl::Replace
|
||||||
@@ -819,9 +821,7 @@ bool wxTextCtrl::PositionToXY(
|
|||||||
return true;
|
return true;
|
||||||
} // end of wxTextCtrl::PositionToXY
|
} // end of wxTextCtrl::PositionToXY
|
||||||
|
|
||||||
void wxTextCtrl::ShowPosition(
|
void wxTextCtrl::ShowPosition( long WXUNUSED(lPos) )
|
||||||
long lPos
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
HWND hWnd = GetHwnd();
|
HWND hWnd = GetHwnd();
|
||||||
long lCurrentLineLineNo = 0L;
|
long lCurrentLineLineNo = 0L;
|
||||||
@@ -851,14 +851,14 @@ void wxTextCtrl::ShowPosition(
|
|||||||
}
|
}
|
||||||
} // end of wxTextCtrl::ShowPosition
|
} // end of wxTextCtrl::ShowPosition
|
||||||
|
|
||||||
int wxTextCtrl::GetLineLength(
|
int wxTextCtrl::GetLineLength( long WXUNUSED(lLineNo) ) const
|
||||||
long lLineNo
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
long lLen = 0L;
|
long lLen = 0L;
|
||||||
|
|
||||||
if (m_bIsMLE)
|
if (m_bIsMLE)
|
||||||
|
{
|
||||||
lLen = (long)::WinSendMsg(GetHwnd(), MLM_QUERYLINELENGTH, 0, 0);
|
lLen = (long)::WinSendMsg(GetHwnd(), MLM_QUERYLINELENGTH, 0, 0);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WNDPARAMS vParams;
|
WNDPARAMS vParams;
|
||||||
@@ -994,21 +994,17 @@ void wxTextCtrl::OnDropFiles(
|
|||||||
}
|
}
|
||||||
} // end of wxTextCtrl::OnDropFiles
|
} // end of wxTextCtrl::OnDropFiles
|
||||||
|
|
||||||
WXHBRUSH wxTextCtrl::OnCtlColor(
|
WXHBRUSH wxTextCtrl::OnCtlColor( WXHDC hWxDC,
|
||||||
WXHDC hWxDC
|
WXHWND WXUNUSED(hWnd),
|
||||||
, WXHWND hWnd
|
WXUINT WXUNUSED(uCtlColor),
|
||||||
, WXUINT uCtlColor
|
WXUINT WXUNUSED(uMessage),
|
||||||
, WXUINT uMessage
|
WXWPARAM WXUNUSED(wParam),
|
||||||
, WXWPARAM wParam
|
WXLPARAM WXUNUSED(lParam) )
|
||||||
, WXLPARAM lParam
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
HPS hPS = (HPS)hWxDC;
|
HPS hPS = (HPS)hWxDC;
|
||||||
wxColour vColBack = GetBackgroundColour();
|
wxColour vColBack = GetBackgroundColour();
|
||||||
wxColour vColFore = GetForegroundColour();
|
wxColour vColFore = GetForegroundColour();
|
||||||
wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()
|
wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( vColBack, wxSOLID );
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
|
|
||||||
if (m_bUseCtl3D)
|
if (m_bUseCtl3D)
|
||||||
{
|
{
|
||||||
@@ -1207,142 +1203,101 @@ wxSize wxTextCtrl::DoGetBestSize() const
|
|||||||
// standard handlers for standard edit menu events
|
// standard handlers for standard edit menu events
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxTextCtrl::OnCut(
|
void wxTextCtrl::OnCut( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Cut();
|
Cut();
|
||||||
} // end of wxTextCtrl::OnCut
|
} // end of wxTextCtrl::OnCut
|
||||||
|
|
||||||
void wxTextCtrl::OnCopy(
|
void wxTextCtrl::OnCopy( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Copy();
|
Copy();
|
||||||
} // end of wxTextCtrl::OnCopy
|
} // end of wxTextCtrl::OnCopy
|
||||||
|
|
||||||
void wxTextCtrl::OnPaste(
|
void wxTextCtrl::OnPaste( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Paste();
|
Paste();
|
||||||
} // end of wxTextCtrl::OnPaste
|
} // end of wxTextCtrl::OnPaste
|
||||||
|
|
||||||
void wxTextCtrl::OnUndo(
|
void wxTextCtrl::OnUndo( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Undo();
|
Undo();
|
||||||
} // end of wxTextCtrl::OnUndo
|
} // end of wxTextCtrl::OnUndo
|
||||||
|
|
||||||
void wxTextCtrl::OnRedo(
|
void wxTextCtrl::OnRedo( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Redo();
|
Redo();
|
||||||
} // end of wxTextCtrl::OnRedo
|
} // end of wxTextCtrl::OnRedo
|
||||||
|
|
||||||
void wxTextCtrl::OnDelete(
|
void wxTextCtrl::OnDelete( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
long lFrom;
|
long lFrom, lTo;
|
||||||
long lTo;
|
|
||||||
|
GetSelection( &lFrom, &lTo );
|
||||||
|
|
||||||
GetSelection( &lFrom
|
|
||||||
,&lTo
|
|
||||||
);
|
|
||||||
if (lFrom != -1 && lTo != -1)
|
if (lFrom != -1 && lTo != -1)
|
||||||
Remove( lFrom
|
Remove( lFrom, lTo );
|
||||||
,lTo
|
|
||||||
);
|
|
||||||
} // end of wxTextCtrl::OnDelete
|
} // end of wxTextCtrl::OnDelete
|
||||||
|
|
||||||
void wxTextCtrl::OnSelectAll(
|
void wxTextCtrl::OnSelectAll( wxCommandEvent& WXUNUSED(rEvent) )
|
||||||
wxCommandEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SetSelection(-1, -1);
|
SetSelection(-1, -1);
|
||||||
} // end of wxTextCtrl::OnSelectAll
|
} // end of wxTextCtrl::OnSelectAll
|
||||||
|
|
||||||
void wxTextCtrl::OnUpdateCut(
|
void wxTextCtrl::OnUpdateCut( wxUpdateUIEvent& rEvent )
|
||||||
wxUpdateUIEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
rEvent.Enable(CanCut());
|
rEvent.Enable(CanCut());
|
||||||
} // end of wxTextCtrl::OnUpdateCut
|
} // end of wxTextCtrl::OnUpdateCut
|
||||||
|
|
||||||
void wxTextCtrl::OnUpdateCopy(
|
void wxTextCtrl::OnUpdateCopy( wxUpdateUIEvent& rEvent )
|
||||||
wxUpdateUIEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
rEvent.Enable(CanCopy());
|
rEvent.Enable(CanCopy());
|
||||||
} // end of wxTextCtrl::OnUpdateCopy
|
} // end of wxTextCtrl::OnUpdateCopy
|
||||||
|
|
||||||
void wxTextCtrl::OnUpdatePaste(
|
void wxTextCtrl::OnUpdatePaste( wxUpdateUIEvent& rEvent )
|
||||||
wxUpdateUIEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
rEvent.Enable(CanPaste());
|
rEvent.Enable(CanPaste());
|
||||||
} // end of wxTextCtrl::OnUpdatePaste
|
} // end of wxTextCtrl::OnUpdatePaste
|
||||||
|
|
||||||
void wxTextCtrl::OnUpdateUndo(
|
void wxTextCtrl::OnUpdateUndo( wxUpdateUIEvent& rEvent )
|
||||||
wxUpdateUIEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
rEvent.Enable(CanUndo());
|
rEvent.Enable(CanUndo());
|
||||||
} // end of wxTextCtrl::OnUpdateUndo
|
} // end of wxTextCtrl::OnUpdateUndo
|
||||||
|
|
||||||
void wxTextCtrl::OnUpdateRedo(
|
void wxTextCtrl::OnUpdateRedo( wxUpdateUIEvent& rEvent )
|
||||||
wxUpdateUIEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
rEvent.Enable(CanRedo());
|
rEvent.Enable(CanRedo());
|
||||||
} // end of wxTextCtrl::OnUpdateRedo
|
} // end of wxTextCtrl::OnUpdateRedo
|
||||||
|
|
||||||
void wxTextCtrl::OnUpdateDelete(
|
void wxTextCtrl::OnUpdateDelete( wxUpdateUIEvent& rEvent )
|
||||||
wxUpdateUIEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
long lFrom;
|
long lFrom, lTo;
|
||||||
long lTo;
|
|
||||||
|
|
||||||
GetSelection( &lFrom
|
GetSelection( &lFrom, &lTo );
|
||||||
,&lTo
|
|
||||||
);
|
|
||||||
rEvent.Enable( lFrom != -1L && lTo != -1L && lFrom != lTo && IsEditable()) ;
|
rEvent.Enable( lFrom != -1L && lTo != -1L && lFrom != lTo && IsEditable()) ;
|
||||||
} // end of wxTextCtrl::OnUpdateDelete
|
} // end of wxTextCtrl::OnUpdateDelete
|
||||||
|
|
||||||
void wxTextCtrl::OnUpdateSelectAll(
|
void wxTextCtrl::OnUpdateSelectAll( wxUpdateUIEvent& rEvent )
|
||||||
wxUpdateUIEvent& rEvent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
rEvent.Enable(GetLastPosition() > 0);
|
rEvent.Enable(GetLastPosition() > 0);
|
||||||
} // end of wxTextCtrl::OnUpdateSelectAll
|
} // end of wxTextCtrl::OnUpdateSelectAll
|
||||||
|
|
||||||
bool wxTextCtrl::SetBackgroundColour(
|
bool wxTextCtrl::SetBackgroundColour( const wxColour& rColour )
|
||||||
const wxColour& rColour
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (m_bIsMLE)
|
if (m_bIsMLE)
|
||||||
::WinSendMsg(GetHwnd(), MLM_SETBACKCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
|
::WinSendMsg(GetHwnd(), MLM_SETBACKCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
|
||||||
return true;
|
return true;
|
||||||
} // end of wxTextCtrl::SetBackgroundColour
|
} // end of wxTextCtrl::SetBackgroundColour
|
||||||
|
|
||||||
bool wxTextCtrl::SetForegroundColour(
|
bool wxTextCtrl::SetForegroundColour( const wxColour& rColour )
|
||||||
const wxColour& rColour
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (m_bIsMLE)
|
if (m_bIsMLE)
|
||||||
::WinSendMsg(GetHwnd(), MLM_SETTEXTCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
|
::WinSendMsg(GetHwnd(), MLM_SETTEXTCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
|
||||||
return true;
|
return true;
|
||||||
} // end of wxTextCtrl::SetForegroundColour
|
} // end of wxTextCtrl::SetForegroundColour
|
||||||
|
|
||||||
bool wxTextCtrl::SetStyle(
|
bool wxTextCtrl::SetStyle( long lStart,
|
||||||
long lStart
|
long lEnd,
|
||||||
, long lEnd
|
const wxTextAttr& WXUNUSED(rStyle) )
|
||||||
, const wxTextAttr& rStyle
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
HWND hWnd = GetHwnd();
|
HWND hWnd = GetHwnd();
|
||||||
|
|
||||||
@@ -1358,12 +1313,9 @@ bool wxTextCtrl::SetStyle(
|
|||||||
// We can only change the format of the selection, so select the range we
|
// We can only change the format of the selection, so select the range we
|
||||||
// want and restore the old selection later
|
// want and restore the old selection later
|
||||||
//
|
//
|
||||||
long lStartOld;
|
long lStartOld, lEndOld;
|
||||||
long lEndOld;
|
|
||||||
|
|
||||||
GetSelection( &lStartOld
|
GetSelection( &lStartOld, &lEndOld );
|
||||||
,&lEndOld
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// But do we really have to change the selection?
|
// But do we really have to change the selection?
|
||||||
@@ -1384,4 +1336,3 @@ bool wxTextCtrl::SetStyle(
|
|||||||
//
|
//
|
||||||
return true;
|
return true;
|
||||||
} // end of wxTextCtrl::SetStyle
|
} // end of wxTextCtrl::SetStyle
|
||||||
|
|
||||||
|
@@ -64,8 +64,8 @@ wxMutex* p_wxMainMutex;
|
|||||||
// OS2 substitute for Tls pointer the current parent thread object
|
// OS2 substitute for Tls pointer the current parent thread object
|
||||||
wxThread* m_pThread; // pointer to the wxWidgets thread object
|
wxThread* m_pThread; // pointer to the wxWidgets thread object
|
||||||
|
|
||||||
// if it's FALSE, some secondary thread is holding the GUI lock
|
// if it's false, some secondary thread is holding the GUI lock
|
||||||
static bool gs_bGuiOwnedByMainThread = TRUE;
|
static bool gs_bGuiOwnedByMainThread = true;
|
||||||
|
|
||||||
// critical section which controls access to all GUI functions: any secondary
|
// 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
|
// thread (i.e. except the main one) must enter this crit section before doing
|
||||||
@@ -79,7 +79,7 @@ static wxCriticalSection *gs_pCritsectWaitingForGui = NULL;
|
|||||||
static size_t gs_nWaitingForGui = 0;
|
static size_t gs_nWaitingForGui = 0;
|
||||||
|
|
||||||
// are we waiting for a thread termination?
|
// 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
|
// OS/2 implementation of thread and related classes
|
||||||
@@ -109,13 +109,9 @@ private:
|
|||||||
// (Calls to DosRequestMutexSem and DosReleaseMutexSem can be nested, but
|
// (Calls to DosRequestMutexSem and DosReleaseMutexSem can be nested, but
|
||||||
// the request count for a semaphore cannot exceed 65535. If an attempt is
|
// 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.)
|
// made to exceed this number, ERROR_TOO_MANY_SEM_REQUESTS is returned.)
|
||||||
wxMutexInternal::wxMutexInternal(
|
wxMutexInternal::wxMutexInternal(wxMutexType WXUNUSED(eMutexType))
|
||||||
wxMutexType WXUNUSED(eMutexType)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
APIRET ulrc;
|
APIRET ulrc = ::DosCreateMutexSem(NULL, &m_vMutex, 0L, FALSE);
|
||||||
|
|
||||||
ulrc = ::DosCreateMutexSem(NULL, &m_vMutex, 0L, FALSE);
|
|
||||||
if (ulrc != 0)
|
if (ulrc != 0)
|
||||||
{
|
{
|
||||||
wxLogSysError(_("Can not create mutex."));
|
wxLogSysError(_("Can not create mutex."));
|
||||||
@@ -406,7 +402,7 @@ void wxThreadInternal::OS2ThreadStart(
|
|||||||
if ( pThread->m_internal->GetState() == STATE_EXITED )
|
if ( pThread->m_internal->GetState() == STATE_EXITED )
|
||||||
{
|
{
|
||||||
dwRet = (DWORD)-1;
|
dwRet = (DWORD)-1;
|
||||||
bWasCancelled = TRUE;
|
bWasCancelled = true;
|
||||||
}
|
}
|
||||||
else // do run thread
|
else // do run thread
|
||||||
{
|
{
|
||||||
@@ -474,15 +470,14 @@ void wxThreadInternal::SetPriority(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThreadInternal::Create(
|
bool wxThreadInternal::Create( wxThread* pThread,
|
||||||
wxThread* pThread
|
unsigned int uStackSize)
|
||||||
, unsigned int uStackSize
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int tid;
|
int tid;
|
||||||
|
|
||||||
if (!uStackSize)
|
if (!uStackSize)
|
||||||
uStackSize = 131072;
|
uStackSize = 131072;
|
||||||
|
|
||||||
pThread->m_critsect.Enter();
|
pThread->m_critsect.Enter();
|
||||||
tid = _beginthread(wxThreadInternal::OS2ThreadStart,
|
tid = _beginthread(wxThreadInternal::OS2ThreadStart,
|
||||||
NULL, uStackSize, pThread);
|
NULL, uStackSize, pThread);
|
||||||
@@ -490,7 +485,7 @@ bool wxThreadInternal::Create(
|
|||||||
{
|
{
|
||||||
wxLogSysError(_("Can't create thread"));
|
wxLogSysError(_("Can't create thread"));
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
m_hThread = tid;
|
m_hThread = tid;
|
||||||
if (m_nPriority != WXTHREAD_DEFAULT_PRIORITY)
|
if (m_nPriority != WXTHREAD_DEFAULT_PRIORITY)
|
||||||
@@ -498,7 +493,7 @@ bool wxThreadInternal::Create(
|
|||||||
SetPriority(m_nPriority);
|
SetPriority(m_nPriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThreadInternal::Suspend()
|
bool wxThreadInternal::Suspend()
|
||||||
@@ -508,10 +503,11 @@ bool wxThreadInternal::Suspend()
|
|||||||
if (ulrc != 0)
|
if (ulrc != 0)
|
||||||
{
|
{
|
||||||
wxLogSysError(_("Can not suspend thread %lu"), m_hThread);
|
wxLogSysError(_("Can not suspend thread %lu"), m_hThread);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
m_eState = STATE_PAUSED;
|
m_eState = STATE_PAUSED;
|
||||||
return TRUE;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThreadInternal::Resume()
|
bool wxThreadInternal::Resume()
|
||||||
@@ -521,7 +517,7 @@ bool wxThreadInternal::Resume()
|
|||||||
if (ulrc != 0)
|
if (ulrc != 0)
|
||||||
{
|
{
|
||||||
wxLogSysError(_("Can not resume thread %lu"), m_hThread);
|
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
|
// don't change the state from STATE_EXITED because it's special and means
|
||||||
@@ -532,7 +528,7 @@ bool wxThreadInternal::Resume()
|
|||||||
m_eState = STATE_RUNNING;
|
m_eState = STATE_RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static functions
|
// static functions
|
||||||
@@ -552,8 +548,9 @@ bool wxThread::IsMain()
|
|||||||
::DosGetInfoBlocks(&ptib, &ppib);
|
::DosGetInfoBlocks(&ptib, &ppib);
|
||||||
|
|
||||||
if (ptib->tib_ptib2->tib2_ultid == s_ulIdMainThread)
|
if (ptib->tib_ptib2->tib2_ultid == s_ulIdMainThread)
|
||||||
return TRUE;
|
return true;
|
||||||
return FALSE;
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Yield
|
#ifdef Yield
|
||||||
@@ -694,9 +691,9 @@ wxThreadError wxThread::Delete(ExitCode *pRc)
|
|||||||
|
|
||||||
// we might need to resume the thread, but we might also not need to cancel
|
// we might need to resume the thread, but we might also not need to cancel
|
||||||
// it if it doesn't run yet
|
// it if it doesn't run yet
|
||||||
bool shouldResume = FALSE,
|
bool shouldResume = false,
|
||||||
shouldCancel = TRUE,
|
shouldCancel = true,
|
||||||
isRunning = FALSE;
|
isRunning = false;
|
||||||
|
|
||||||
// check if the thread already started to run
|
// check if the thread already started to run
|
||||||
{
|
{
|
||||||
@@ -711,10 +708,10 @@ wxThreadError wxThread::Delete(ExitCode *pRc)
|
|||||||
|
|
||||||
Resume(); // it knows about STATE_EXITED special case
|
Resume(); // it knows about STATE_EXITED special case
|
||||||
|
|
||||||
shouldCancel = FALSE;
|
shouldCancel = false;
|
||||||
isRunning = TRUE;
|
isRunning = true;
|
||||||
|
|
||||||
// shouldResume is correctly set to FALSE here
|
// shouldResume is correctly set to false here
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -733,7 +730,7 @@ wxThreadError wxThread::Delete(ExitCode *pRc)
|
|||||||
if (IsMain())
|
if (IsMain())
|
||||||
{
|
{
|
||||||
// set flag for wxIsWaitingForThread()
|
// set flag for wxIsWaitingForThread()
|
||||||
gs_bWaitingForThread = TRUE;
|
gs_bWaitingForThread = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ask the thread to terminate
|
// ask the thread to terminate
|
||||||
@@ -811,7 +808,7 @@ wxThreadError wxThread::Delete(ExitCode *pRc)
|
|||||||
|
|
||||||
if ( IsMain() )
|
if ( IsMain() )
|
||||||
{
|
{
|
||||||
gs_bWaitingForThread = FALSE;
|
gs_bWaitingForThread = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -858,9 +855,7 @@ wxThreadError wxThread::Kill()
|
|||||||
return wxTHREAD_NO_ERROR;
|
return wxTHREAD_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::Exit(
|
void wxThread::Exit(ExitCode WXUNUSED(pStatus))
|
||||||
ExitCode pStatus
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
delete this;
|
delete this;
|
||||||
_endthread();
|
_endthread();
|
||||||
@@ -948,7 +943,7 @@ bool wxThreadModule::OnInit()
|
|||||||
::DosGetInfoBlocks(&ptib, &ppib);
|
::DosGetInfoBlocks(&ptib, &ppib);
|
||||||
|
|
||||||
s_ulIdMainThread = ptib->tib_ptib2->tib2_ultid;
|
s_ulIdMainThread = ptib->tib_ptib2->tib2_ultid;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThreadModule::OnExit()
|
void wxThreadModule::OnExit()
|
||||||
@@ -1011,7 +1006,7 @@ void WXDLLEXPORT wxMutexGuiLeave()
|
|||||||
|
|
||||||
if ( wxThread::IsMain() )
|
if ( wxThread::IsMain() )
|
||||||
{
|
{
|
||||||
gs_bGuiOwnedByMainThread = FALSE;
|
gs_bGuiOwnedByMainThread = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1042,7 +1037,7 @@ void WXDLLEXPORT wxMutexGuiLeaveOrEnter()
|
|||||||
{
|
{
|
||||||
gs_pCritsectGui->Enter();
|
gs_pCritsectGui->Enter();
|
||||||
|
|
||||||
gs_bGuiOwnedByMainThread = TRUE;
|
gs_bGuiOwnedByMainThread = true;
|
||||||
}
|
}
|
||||||
//else: already have it, nothing to do
|
//else: already have it, nothing to do
|
||||||
}
|
}
|
||||||
|
@@ -451,7 +451,7 @@ bool wxToolBar::Realize()
|
|||||||
{
|
{
|
||||||
wxToolBarTool* pTool = (wxToolBarTool *)node->GetData();
|
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
|
// Set the height according to the font and the border size
|
||||||
@@ -613,10 +613,8 @@ void wxToolBar::OnPaint (
|
|||||||
DrawTool(vDc, pTool);
|
DrawTool(vDc, pTool);
|
||||||
if (pTool->IsSeparator())
|
if (pTool->IsSeparator())
|
||||||
{
|
{
|
||||||
wxPen vDarkGreyPen( wxColour(85, 85, 85)
|
wxColour gray85(85, 85, 85);
|
||||||
,1
|
wxPen vDarkGreyPen( gray85, 1, wxSOLID );
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
int nX;
|
int nX;
|
||||||
int nY;
|
int nY;
|
||||||
int nHeight = 0;
|
int nHeight = 0;
|
||||||
@@ -752,7 +750,7 @@ void wxToolBar::OnMouseEvent(
|
|||||||
);
|
);
|
||||||
m_nCurrentTool = pTool->GetId();
|
m_nCurrentTool = pTool->GetId();
|
||||||
OnMouseEnter(m_nCurrentTool);
|
OnMouseEnter(m_nCurrentTool);
|
||||||
if (!pTool->GetShortHelp().IsEmpty())
|
if (!pTool->GetShortHelp().empty())
|
||||||
{
|
{
|
||||||
if (m_pToolTip)
|
if (m_pToolTip)
|
||||||
delete m_pToolTip;
|
delete m_pToolTip;
|
||||||
@@ -829,18 +827,8 @@ void wxToolBar::DrawTool(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
wxToolBarTool* pTool = (wxToolBarTool *)pToolBase;
|
wxToolBarTool* pTool = (wxToolBarTool *)pToolBase;
|
||||||
wxPen vDarkGreyPen( wxColour( 85,85,85 )
|
wxColour gray85( 85,85,85 );
|
||||||
,1
|
wxPen vDarkGreyPen( gray85, 1, wxSOLID );
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
wxPen vWhitePen( wxT("WHITE")
|
|
||||||
,1
|
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
wxPen vBlackPen( wxT("BLACK")
|
|
||||||
,1
|
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
wxBitmap vBitmap = pTool->GetNormalBitmap();
|
wxBitmap vBitmap = pTool->GetNormalBitmap();
|
||||||
bool bUseMask = FALSE;
|
bool bUseMask = FALSE;
|
||||||
wxMask* pMask = NULL;
|
wxMask* pMask = NULL;
|
||||||
@@ -873,9 +861,7 @@ void wxToolBar::DrawTool(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxColour vColor(wxT("BLACK"));
|
rDc.SetTextForeground(*wxBLACK);
|
||||||
|
|
||||||
rDc.SetTextForeground(vColor);
|
|
||||||
rDc.DrawBitmap( vBitmap
|
rDc.DrawBitmap( vBitmap
|
||||||
,pTool->m_vX
|
,pTool->m_vX
|
||||||
,pTool->m_vY
|
,pTool->m_vY
|
||||||
@@ -1058,28 +1044,17 @@ void wxToolBar::SpringUpButton(
|
|||||||
// private helpers
|
// private helpers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxToolBar::LowerTool (
|
void wxToolBar::LowerTool ( wxToolBarToolBase* pToolBase,
|
||||||
wxToolBarToolBase* pToolBase
|
bool bLower )
|
||||||
, bool bLower
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxToolBarTool* pTool = (wxToolBarTool*)pToolBase;
|
wxToolBarTool* pTool = (wxToolBarTool*)pToolBase;
|
||||||
wxCoord vX;
|
wxCoord vX;
|
||||||
wxCoord vY;
|
wxCoord vY;
|
||||||
wxCoord vWidth;
|
wxCoord vWidth;
|
||||||
wxCoord vHeight;
|
wxCoord vHeight;
|
||||||
wxPen vDarkGreyPen( wxColour(85, 85, 85)
|
wxColour gray85( 85,85,85 );
|
||||||
,1
|
wxPen vDarkGreyPen( gray85, 1, wxSOLID );
|
||||||
,wxSOLID
|
wxPen vClearPen( GetBackgroundColour(), 1, wxSOLID );
|
||||||
);
|
|
||||||
wxPen vWhitePen( wxT("WHITE")
|
|
||||||
,1
|
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
wxPen vClearPen( GetBackgroundColour()
|
|
||||||
,1
|
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
wxClientDC vDC(this);
|
wxClientDC vDC(this);
|
||||||
|
|
||||||
if (!pTool)
|
if (!pTool)
|
||||||
@@ -1094,7 +1069,7 @@ void wxToolBar::LowerTool (
|
|||||||
if (!HasFlag(wxTB_FLAT))
|
if (!HasFlag(wxTB_FLAT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsEmpty())
|
if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty())
|
||||||
{
|
{
|
||||||
if (pTool->GetWidth() > m_vTextX)
|
if (pTool->GetWidth() > m_vTextX)
|
||||||
{
|
{
|
||||||
@@ -1118,7 +1093,7 @@ void wxToolBar::LowerTool (
|
|||||||
}
|
}
|
||||||
if (bLower)
|
if (bLower)
|
||||||
{
|
{
|
||||||
vDC.SetPen(vWhitePen);
|
vDC.SetPen(*wxWHITE_PEN);
|
||||||
vDC.DrawLine(vX + vWidth, vY + vHeight, vX, vY + vHeight);
|
vDC.DrawLine(vX + vWidth, vY + vHeight, vX, vY + vHeight);
|
||||||
vDC.DrawLine(vX + vWidth, vY, vX + vWidth, vY + vHeight);
|
vDC.DrawLine(vX + vWidth, vY, vX + vWidth, vY + vHeight);
|
||||||
vDC.SetPen(vDarkGreyPen);
|
vDC.SetPen(vDarkGreyPen);
|
||||||
@@ -1135,28 +1110,17 @@ void wxToolBar::LowerTool (
|
|||||||
}
|
}
|
||||||
} // end of WinGuiBase_CToolBarTool::LowerTool
|
} // end of WinGuiBase_CToolBarTool::LowerTool
|
||||||
|
|
||||||
void wxToolBar::RaiseTool (
|
void wxToolBar::RaiseTool ( wxToolBarToolBase* pToolBase,
|
||||||
wxToolBarToolBase* pToolBase
|
bool bRaise )
|
||||||
, bool bRaise
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxToolBarTool* pTool = (wxToolBarTool*)pToolBase;
|
wxToolBarTool* pTool = (wxToolBarTool*)pToolBase;
|
||||||
wxCoord vX;
|
wxCoord vX;
|
||||||
wxCoord vY;
|
wxCoord vY;
|
||||||
wxCoord vWidth;
|
wxCoord vWidth;
|
||||||
wxCoord vHeight;
|
wxCoord vHeight;
|
||||||
wxPen vDarkGreyPen( wxColour(85, 85, 85)
|
wxColour gray85( 85,85,85 );
|
||||||
,1
|
wxPen vDarkGreyPen( gray85, 1, wxSOLID );
|
||||||
,wxSOLID
|
wxPen vClearPen( GetBackgroundColour(), 1, wxSOLID );
|
||||||
);
|
|
||||||
wxPen vWhitePen( wxT("WHITE")
|
|
||||||
,1
|
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
wxPen vClearPen( GetBackgroundColour()
|
|
||||||
,1
|
|
||||||
,wxSOLID
|
|
||||||
);
|
|
||||||
wxClientDC vDC(this);
|
wxClientDC vDC(this);
|
||||||
|
|
||||||
if (!pTool)
|
if (!pTool)
|
||||||
@@ -1174,7 +1138,7 @@ void wxToolBar::RaiseTool (
|
|||||||
if (!HasFlag(wxTB_FLAT))
|
if (!HasFlag(wxTB_FLAT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().IsEmpty())
|
if (HasFlag(wxTB_TEXT) && !pTool->GetLabel().empty())
|
||||||
{
|
{
|
||||||
if (pTool->GetWidth() > m_vTextX)
|
if (pTool->GetWidth() > m_vTextX)
|
||||||
{
|
{
|
||||||
@@ -1201,7 +1165,7 @@ void wxToolBar::RaiseTool (
|
|||||||
vDC.SetPen(vDarkGreyPen);
|
vDC.SetPen(vDarkGreyPen);
|
||||||
vDC.DrawLine(vX + vWidth, vY + vHeight, vX, vY + vHeight);
|
vDC.DrawLine(vX + vWidth, vY + vHeight, vX, vY + vHeight);
|
||||||
vDC.DrawLine(vX + vWidth, vY, vX + vWidth, 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, vX + vWidth, vY);
|
||||||
vDC.DrawLine(vX, vY + vHeight, vX, vY);
|
vDC.DrawLine(vX, vY + vHeight, vX, vY);
|
||||||
}
|
}
|
||||||
|
@@ -307,12 +307,11 @@ WXHWND wxTopLevelWindowOS2::OS2GetParent() const
|
|||||||
return (WXHWND)hWndParent;
|
return (WXHWND)hWndParent;
|
||||||
} // end of wxTopLevelWindowOS2::OS2GetParent
|
} // end of wxTopLevelWindowOS2::OS2GetParent
|
||||||
|
|
||||||
bool wxTopLevelWindowOS2::CreateDialog(
|
|
||||||
ULONG ulDlgTemplate
|
bool wxTopLevelWindowOS2::CreateDialog( ULONG ulDlgTemplate,
|
||||||
, const wxString& rsTitle
|
const wxString& WXUNUSED(rsTitle),
|
||||||
, const wxPoint& rPos
|
const wxPoint& rPos,
|
||||||
, const wxSize& rSize
|
const wxSize& rSize )
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxWindow* pParent = GetParent();
|
wxWindow* pParent = GetParent();
|
||||||
|
|
||||||
@@ -756,7 +755,7 @@ bool wxTopLevelWindowOS2::Show(
|
|||||||
wxActivateEvent vEvent(wxEVT_ACTIVATE, TRUE, m_windowId);
|
wxActivateEvent vEvent(wxEVT_ACTIVATE, TRUE, m_windowId);
|
||||||
|
|
||||||
::WinQueryWindowPos(m_hFrame, &vSwp);
|
::WinQueryWindowPos(m_hFrame, &vSwp);
|
||||||
m_bIconized = vSwp.fl & SWP_MINIMIZE;
|
m_bIconized = ( vSwp.fl & SWP_MINIMIZE ) == SWP_MINIMIZE ;
|
||||||
::WinQueryWindowPos(m_hWnd, &m_vSwpClient);
|
::WinQueryWindowPos(m_hWnd, &m_vSwpClient);
|
||||||
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)~0, 0);
|
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)~0, 0);
|
||||||
::WinQueryWindowPos(m_hWnd, &vSwp);
|
::WinQueryWindowPos(m_hWnd, &vSwp);
|
||||||
@@ -779,7 +778,7 @@ bool wxTopLevelWindowOS2::Show(
|
|||||||
HWND hWndParent = GetHwndOf(GetParent());
|
HWND hWndParent = GetHwndOf(GetParent());
|
||||||
|
|
||||||
::WinQueryWindowPos(hWndParent, &vSwp);
|
::WinQueryWindowPos(hWndParent, &vSwp);
|
||||||
m_bIconized = vSwp.fl & SWP_MINIMIZE;
|
m_bIconized = (vSwp.fl & SWP_MINIMIZE)==SWP_MINIMIZE;
|
||||||
::WinEnableWindow(hWndParent, TRUE);
|
::WinEnableWindow(hWndParent, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -813,9 +812,8 @@ void wxTopLevelWindowOS2::Maximize(
|
|||||||
|
|
||||||
bool wxTopLevelWindowOS2::IsMaximized() const
|
bool wxTopLevelWindowOS2::IsMaximized() const
|
||||||
{
|
{
|
||||||
|
|
||||||
::WinQueryWindowPos(m_hFrame, (PSWP)&m_vSwp);
|
::WinQueryWindowPos(m_hFrame, (PSWP)&m_vSwp);
|
||||||
return (m_vSwp.fl & SWP_MAXIMIZE);
|
return (m_vSwp.fl & SWP_MAXIMIZE) == SWP_MAXIMIZE;
|
||||||
} // end of wxTopLevelWindowOS2::IsMaximized
|
} // end of wxTopLevelWindowOS2::IsMaximized
|
||||||
|
|
||||||
void wxTopLevelWindowOS2::Iconize(
|
void wxTopLevelWindowOS2::Iconize(
|
||||||
@@ -860,17 +858,15 @@ void wxTopLevelWindowOS2::SendSizeEvent()
|
|||||||
// wxTopLevelWindowOS2 fullscreen
|
// wxTopLevelWindowOS2 fullscreen
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxTopLevelWindowOS2::ShowFullScreen(
|
bool wxTopLevelWindowOS2::ShowFullScreen( bool bShow,
|
||||||
bool bShow
|
long lStyle )
|
||||||
, long lStyle
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (bShow)
|
if (bShow)
|
||||||
{
|
{
|
||||||
if (IsFullScreen())
|
if (IsFullScreen())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
m_bFsIsShowing = TRUE;
|
m_bFsIsShowing = true;
|
||||||
m_lFsStyle = lStyle;
|
m_lFsStyle = lStyle;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -921,9 +917,7 @@ bool wxTopLevelWindowOS2::ShowFullScreen(
|
|||||||
nWidth = vRect.xRight - vRect.xLeft;
|
nWidth = vRect.xRight - vRect.xLeft;
|
||||||
nHeight = vRect.yTop - vRect.yBottom;
|
nHeight = vRect.yTop - vRect.yBottom;
|
||||||
|
|
||||||
SetSize( nWidth
|
SetSize( nWidth, nHeight );
|
||||||
,nHeight
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now flush the window style cache and actually go full-screen
|
// Now flush the window style cache and actually go full-screen
|
||||||
@@ -937,21 +931,17 @@ bool wxTopLevelWindowOS2::ShowFullScreen(
|
|||||||
,SWP_SIZE | SWP_MOVE
|
,SWP_SIZE | SWP_MOVE
|
||||||
);
|
);
|
||||||
|
|
||||||
wxSizeEvent vEvent( wxSize( nWidth
|
wxSize full( nWidth, nHeight );
|
||||||
,nHeight
|
wxSizeEvent vEvent( full, GetId() );
|
||||||
)
|
|
||||||
,GetId()
|
|
||||||
);
|
|
||||||
|
|
||||||
GetEventHandler()->ProcessEvent(vEvent);
|
GetEventHandler()->ProcessEvent(vEvent);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!IsFullScreen())
|
if (!IsFullScreen())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
m_bFsIsShowing = FALSE;
|
m_bFsIsShowing = false;
|
||||||
Maximize(m_bFsIsMaximized);
|
Maximize(m_bFsIsMaximized);
|
||||||
::WinSetWindowULong( (HWND)GetHWND()
|
::WinSetWindowULong( (HWND)GetHWND()
|
||||||
,QWL_STYLE
|
,QWL_STYLE
|
||||||
@@ -965,7 +955,7 @@ bool wxTopLevelWindowOS2::ShowFullScreen(
|
|||||||
,m_vFsOldSize.height
|
,m_vFsOldSize.height
|
||||||
,SWP_SIZE | SWP_MOVE
|
,SWP_SIZE | SWP_MOVE
|
||||||
);
|
);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
} // end of wxTopLevelWindowOS2::ShowFullScreen
|
} // end of wxTopLevelWindowOS2::ShowFullScreen
|
||||||
|
|
||||||
|
@@ -39,7 +39,12 @@
|
|||||||
|
|
||||||
#define PURE_32
|
#define PURE_32
|
||||||
|
|
||||||
#ifndef __EMX__
|
#if defined(__WATCOMC__)
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#include <upm.h>
|
||||||
|
}
|
||||||
|
#elif !defined(__EMX__)
|
||||||
#include <upm.h>
|
#include <upm.h>
|
||||||
#include <netcons.h>
|
#include <netcons.h>
|
||||||
#include <netbios.h>
|
#include <netbios.h>
|
||||||
@@ -47,8 +52,6 @@
|
|||||||
|
|
||||||
static const wxChar WX_SECTION[] = _T("wxWidgets");
|
static const wxChar WX_SECTION[] = _T("wxWidgets");
|
||||||
static const wxChar eHOSTNAME[] = _T("HostName");
|
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 the following functions we SHOULD fill in support
|
||||||
// for Windows-NT (which I don't know) as I assume it begin
|
// for Windows-NT (which I don't know) as I assume it begin
|
||||||
@@ -99,41 +102,30 @@ bool wxGetHostName(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get user ID e.g. jacs
|
// Get user ID e.g. jacs
|
||||||
bool wxGetUserId(
|
bool wxGetUserId(wxChar* zBuf, int nType)
|
||||||
wxChar* zBuf
|
|
||||||
, int nType
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if defined(__VISAGECPP__)
|
#if defined(__VISAGECPP__) || defined(__WATCOMC__)
|
||||||
long lrc;
|
|
||||||
// UPM procs return 0 on success
|
// 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;
|
if (lrc == 0) return true;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxGetUserName(
|
bool wxGetUserName( wxChar* zBuf, int nMaxSize )
|
||||||
wxChar* zBuf
|
|
||||||
, int nMaxSize
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#ifdef USE_NET_API
|
#ifdef USE_NET_API
|
||||||
wxGetUserId( zBuf
|
wxGetUserId( zBuf, nMaxSize );
|
||||||
,nMaxSize
|
|
||||||
);
|
|
||||||
#else
|
#else
|
||||||
wxStrncpy(zBuf, _T("Unknown User"), nMaxSize);
|
wxStrncpy(zBuf, _T("Unknown User"), nMaxSize);
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxKill(
|
int wxKill(long lPid,
|
||||||
long lPid
|
wxSignal WXUNUSED(eSig),
|
||||||
, wxSignal eSig
|
wxKillError* WXUNUSED(peError),
|
||||||
, wxKillError* peError
|
int WXUNUSED(flags))
|
||||||
, int flags
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return((int)::DosKillProcess(0, (PID)lPid));
|
return((int)::DosKillProcess(0, (PID)lPid));
|
||||||
}
|
}
|
||||||
@@ -198,7 +190,7 @@ bool wxShell(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown or reboot the PC
|
// Shutdown or reboot the PC
|
||||||
bool wxShutdown(wxShutdownFlags wFlags)
|
bool wxShutdown(wxShutdownFlags WXUNUSED(wFlags))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return false;
|
return false;
|
||||||
@@ -275,6 +267,8 @@ bool wxSetEnv(const wxString& variable, const wxChar *value)
|
|||||||
|
|
||||||
return putenv(buf) == 0;
|
return putenv(buf) == 0;
|
||||||
#else // no way to set an env var
|
#else // no way to set an env var
|
||||||
|
wxUnusedVar(variable);
|
||||||
|
wxUnusedVar(value);
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -369,11 +363,11 @@ void wxBell()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,9 +476,7 @@ wxChar* wxGetUserHome ( const wxString &rUser )
|
|||||||
return (wxChar*)wxEmptyString; // No home known!
|
return (wxChar*)wxEmptyString; // No home known!
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString WXDLLEXPORT wxPMErrorToStr(
|
wxString WXDLLEXPORT wxPMErrorToStr(ERRORID vError)
|
||||||
ERRORID vError
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxString sError;
|
wxString sError;
|
||||||
|
|
||||||
@@ -544,7 +536,7 @@ wxString WXDLLEXPORT wxPMErrorToStr(
|
|||||||
// to be used by all X11 based ports.
|
// to be used by all X11 based ports.
|
||||||
struct wxEndProcessData;
|
struct wxEndProcessData;
|
||||||
|
|
||||||
void wxHandleProcessTermination(wxEndProcessData *proc_data)
|
void wxHandleProcessTermination(wxEndProcessData *WXUNUSED(proc_data))
|
||||||
{
|
{
|
||||||
// For now, just do nothing. To be filled in as needed.
|
// For now, just do nothing. To be filled in as needed.
|
||||||
}
|
}
|
||||||
|
@@ -28,9 +28,11 @@
|
|||||||
#define PURE_32
|
#define PURE_32
|
||||||
#ifndef __EMX__
|
#ifndef __EMX__
|
||||||
#include <upm.h>
|
#include <upm.h>
|
||||||
|
#ifndef __WATCOMC__
|
||||||
#include <netcons.h>
|
#include <netcons.h>
|
||||||
#include <netbios.h>
|
#include <netbios.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#ifdef __EMX__
|
#ifdef __EMX__
|
||||||
@@ -68,12 +70,10 @@ public:
|
|||||||
RESULTCODES vResultCodes;
|
RESULTCODES vResultCodes;
|
||||||
wxProcess* pHandler;
|
wxProcess* pHandler;
|
||||||
ULONG ulExitCode; // the exit code of the process
|
ULONG ulExitCode; // the exit code of the process
|
||||||
bool bState; // set to FALSE when the process finishes
|
bool bState; // set to false when the process finishes
|
||||||
};
|
};
|
||||||
|
|
||||||
static ULONG wxExecuteThread(
|
static ULONG wxExecuteThread(wxExecuteData* pData)
|
||||||
wxExecuteData* pData
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ULONG ulRc;
|
ULONG ulRc;
|
||||||
PID vPidChild;
|
PID vPidChild;
|
||||||
@@ -96,12 +96,10 @@ static ULONG wxExecuteThread(
|
|||||||
|
|
||||||
// window procedure of a hidden window which is created just to receive
|
// window procedure of a hidden window which is created just to receive
|
||||||
// the notification message when a process exits
|
// the notification message when a process exits
|
||||||
MRESULT APIENTRY wxExecuteWindowCbk(
|
MRESULT APIENTRY wxExecuteWindowCbk( HWND hWnd,
|
||||||
HWND hWnd
|
ULONG ulMessage,
|
||||||
, ULONG ulMessage
|
MPARAM WXUNUSED(wParam),
|
||||||
, MPARAM wParam
|
MPARAM lParam)
|
||||||
, MPARAM lParam
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (ulMessage == wxWM_PROC_TERMINATED)
|
if (ulMessage == wxWM_PROC_TERMINATED)
|
||||||
{
|
{
|
||||||
@@ -130,13 +128,11 @@ MRESULT APIENTRY wxExecuteWindowCbk(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxExecute(
|
long wxExecute( const wxString& rCommand,
|
||||||
const wxString& rCommand
|
int flags,
|
||||||
, int flags
|
wxProcess* pHandler)
|
||||||
, wxProcess* pHandler
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (rCommand.IsEmpty())
|
if (rCommand.empty())
|
||||||
{
|
{
|
||||||
// cout << "empty command in wxExecute." << endl;
|
// cout << "empty command in wxExecute." << endl;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -243,10 +239,8 @@ long wxExecute(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxGetFullHostName(
|
bool wxGetFullHostName( wxChar* zBuf,
|
||||||
wxChar* zBuf
|
int nMaxSize)
|
||||||
, int nMaxSize
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if wxUSE_NET_API
|
#if wxUSE_NET_API
|
||||||
char zServer[256];
|
char zServer[256];
|
||||||
@@ -266,9 +260,8 @@ bool wxGetFullHostName(
|
|||||||
strncpy(zBuf, zComputer, nMaxSize);
|
strncpy(zBuf, zComputer, nMaxSize);
|
||||||
zBuf[nMaxSize] = _T('\0');
|
zBuf[nMaxSize] = _T('\0');
|
||||||
#else
|
#else
|
||||||
|
wxUnusedVar(nMaxSize);
|
||||||
strcpy((char*)zBuf, "noname");
|
strcpy((char*)zBuf, "noname");
|
||||||
#endif
|
#endif
|
||||||
return *zBuf ? TRUE : FALSE;
|
return *zBuf ? true : false;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -731,13 +731,11 @@ void wxWindowOS2::SetScrollPos(
|
|||||||
::WinSendMsg(m_hWndScrollBarVert, SBM_SETPOS, (MPARAM)nPos, (MPARAM)NULL);
|
::WinSendMsg(m_hWndScrollBarVert, SBM_SETPOS, (MPARAM)nPos, (MPARAM)NULL);
|
||||||
} // end of wxWindowOS2::SetScrollPos
|
} // end of wxWindowOS2::SetScrollPos
|
||||||
|
|
||||||
void wxWindowOS2::SetScrollbar(
|
void wxWindowOS2::SetScrollbar( int nOrient,
|
||||||
int nOrient
|
int nPos,
|
||||||
, int nPos
|
int nThumbVisible,
|
||||||
, int nThumbVisible
|
int nRange,
|
||||||
, int nRange
|
bool WXUNUSED(bRefresh) )
|
||||||
, bool WXUNUSED(bRefresh)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
HWND hWnd = GetHwnd();
|
HWND hWnd = GetHwnd();
|
||||||
int nOldRange = nRange - nThumbVisible;
|
int nOldRange = nRange - nThumbVisible;
|
||||||
@@ -779,7 +777,7 @@ void wxWindowOS2::SetScrollbar(
|
|||||||
vInfo.cb = sizeof(SBCDATA);
|
vInfo.cb = sizeof(SBCDATA);
|
||||||
vInfo.posFirst = 0;
|
vInfo.posFirst = 0;
|
||||||
vInfo.posLast = (SHORT)nRange1;
|
vInfo.posLast = (SHORT)nRange1;
|
||||||
vInfo.posThumb = nPos;
|
vInfo.posThumb = (SHORT)nPos;
|
||||||
|
|
||||||
if (nOrient == wxHORIZONTAL )
|
if (nOrient == wxHORIZONTAL )
|
||||||
{
|
{
|
||||||
@@ -1068,10 +1066,8 @@ void wxWindowOS2::SetWindowStyleFlag(
|
|||||||
}
|
}
|
||||||
} // end of wxWindowOS2::SetWindowStyleFlag
|
} // end of wxWindowOS2::SetWindowStyleFlag
|
||||||
|
|
||||||
WXDWORD wxWindowOS2::OS2GetStyle(
|
WXDWORD wxWindowOS2::OS2GetStyle( long lFlags,
|
||||||
long lFlags
|
WXDWORD* WXUNUSED(pdwExstyle) ) const
|
||||||
, WXDWORD* pdwExstyle
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
WXDWORD dwStyle = 0L;
|
WXDWORD dwStyle = 0L;
|
||||||
|
|
||||||
@@ -1733,10 +1729,8 @@ void wxWindowOS2::DoSetSize(
|
|||||||
);
|
);
|
||||||
} // end of wxWindowOS2::DoSetSize
|
} // end of wxWindowOS2::DoSetSize
|
||||||
|
|
||||||
void wxWindowOS2::DoSetClientSize(
|
void wxWindowOS2::DoSetClientSize( int nWidth,
|
||||||
int nWidth
|
int nHeight )
|
||||||
, int nHeight
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
POINTL vPoint;
|
POINTL vPoint;
|
||||||
int nActualWidth;
|
int nActualWidth;
|
||||||
@@ -1781,18 +1775,10 @@ void wxWindowOS2::DoSetClientSize(
|
|||||||
vPoint.x = nX;
|
vPoint.x = nX;
|
||||||
vPoint.y = nY;
|
vPoint.y = nY;
|
||||||
}
|
}
|
||||||
DoMoveWindow( vPoint.x
|
DoMoveWindow( vPoint.x, vPoint.y, nActualWidth, nActualHeight );
|
||||||
,vPoint.y
|
|
||||||
,nActualWidth
|
|
||||||
,nActualHeight
|
|
||||||
);
|
|
||||||
|
|
||||||
wxSizeEvent vEvent( wxSize( nWidth
|
|
||||||
,nHeight
|
|
||||||
)
|
|
||||||
,m_windowId
|
|
||||||
);
|
|
||||||
|
|
||||||
|
wxSize size( nWidth, nHeight );
|
||||||
|
wxSizeEvent vEvent( size, m_windowId );
|
||||||
vEvent.SetEventObject(this);
|
vEvent.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(vEvent);
|
GetEventHandler()->ProcessEvent(vEvent);
|
||||||
} // end of wxWindowOS2::DoSetClientSize
|
} // end of wxWindowOS2::DoSetClientSize
|
||||||
@@ -1833,14 +1819,12 @@ int wxWindowOS2::GetCharWidth() const
|
|||||||
return(vFontMetrics.lAveCharWidth);
|
return(vFontMetrics.lAveCharWidth);
|
||||||
} // end of wxWindowOS2::GetCharWidth
|
} // end of wxWindowOS2::GetCharWidth
|
||||||
|
|
||||||
void wxWindowOS2::GetTextExtent(
|
void wxWindowOS2::GetTextExtent( const wxString& rString,
|
||||||
const wxString& rString
|
int* pX,
|
||||||
, int* pX
|
int* pY,
|
||||||
, int* pY
|
int* pDescent,
|
||||||
, int* pDescent
|
int* pExternalLeading,
|
||||||
, int* pExternalLeading
|
const wxFont* WXUNUSED(pTheFont) ) const
|
||||||
, const wxFont* pTheFont
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
POINTL avPoint[TXTBOX_COUNT];
|
POINTL avPoint[TXTBOX_COUNT];
|
||||||
POINTL vPtMin;
|
POINTL vPtMin;
|
||||||
@@ -1852,7 +1836,6 @@ void wxWindowOS2::GetTextExtent(
|
|||||||
char* pStr;
|
char* pStr;
|
||||||
HPS hPS;
|
HPS hPS;
|
||||||
|
|
||||||
|
|
||||||
hPS = ::WinGetPS(GetHwnd());
|
hPS = ::WinGetPS(GetHwnd());
|
||||||
|
|
||||||
l = rString.Length();
|
l = rString.Length();
|
||||||
@@ -2225,12 +2208,10 @@ bool wxWindowOS2::OS2TranslateMessage(
|
|||||||
#endif //wxUSE_ACCEL
|
#endif //wxUSE_ACCEL
|
||||||
} // end of wxWindowOS2::OS2TranslateMessage
|
} // end of wxWindowOS2::OS2TranslateMessage
|
||||||
|
|
||||||
bool wxWindowOS2::OS2ShouldPreProcessMessage(
|
bool wxWindowOS2::OS2ShouldPreProcessMessage( WXMSG* WXUNUSED(pMsg) )
|
||||||
WXMSG* pMsg
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// preprocess all messages by default
|
// preprocess all messages by default
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxWindowOS2::OS2ShouldPreProcessMessage
|
} // end of wxWindowOS2::OS2ShouldPreProcessMessage
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -2735,7 +2716,7 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
case BKN_PAGESELECTEDPENDING:
|
case BKN_PAGESELECTEDPENDING:
|
||||||
{
|
{
|
||||||
@@ -2790,7 +2771,7 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
wxRadioBox* pRadioBox = wxDynamicCast(pWin, wxRadioBox);
|
wxRadioBox* pRadioBox = wxDynamicCast(pWin, wxRadioBox);
|
||||||
|
|
||||||
pRadioBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
pRadioBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
||||||
,(WXUINT)SHORT1FROMMP(wParam)
|
,(WXWORD)SHORT1FROMMP(wParam)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (pWin->IsKindOf(CLASSINFO(wxRadioButton)))
|
if (pWin->IsKindOf(CLASSINFO(wxRadioButton)))
|
||||||
@@ -2798,7 +2779,7 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
wxRadioButton* pRadioButton = wxDynamicCast(pWin, wxRadioButton);
|
wxRadioButton* pRadioButton = wxDynamicCast(pWin, wxRadioButton);
|
||||||
|
|
||||||
pRadioButton->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
pRadioButton->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
||||||
,(WXUINT)SHORT1FROMMP(wParam)
|
,(WXWORD)SHORT1FROMMP(wParam)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (pWin->IsKindOf(CLASSINFO(wxCheckBox)))
|
if (pWin->IsKindOf(CLASSINFO(wxCheckBox)))
|
||||||
@@ -2806,7 +2787,7 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
wxCheckBox* pCheckBox = wxDynamicCast(pWin, wxCheckBox);
|
wxCheckBox* pCheckBox = wxDynamicCast(pWin, wxCheckBox);
|
||||||
|
|
||||||
pCheckBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
pCheckBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
||||||
,(WXUINT)SHORT1FROMMP(wParam)
|
,(WXWORD)SHORT1FROMMP(wParam)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (pWin->IsKindOf(CLASSINFO(wxListBox)))
|
if (pWin->IsKindOf(CLASSINFO(wxListBox)))
|
||||||
@@ -2814,7 +2795,7 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
wxListBox* pListBox = wxDynamicCast(pWin, wxListBox);
|
wxListBox* pListBox = wxDynamicCast(pWin, wxListBox);
|
||||||
|
|
||||||
pListBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
pListBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
||||||
,(WXUINT)SHORT1FROMMP(wParam)
|
,(WXWORD)SHORT1FROMMP(wParam)
|
||||||
);
|
);
|
||||||
if (pListBox->GetWindowStyle() & wxLB_OWNERDRAW)
|
if (pListBox->GetWindowStyle() & wxLB_OWNERDRAW)
|
||||||
Refresh();
|
Refresh();
|
||||||
@@ -2824,12 +2805,12 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
wxComboBox* pComboBox = wxDynamicCast(pWin, wxComboBox);
|
wxComboBox* pComboBox = wxDynamicCast(pWin, wxComboBox);
|
||||||
|
|
||||||
pComboBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
pComboBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
||||||
,(WXUINT)SHORT1FROMMP(wParam)
|
,(WXWORD)SHORT1FROMMP(wParam)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
case LN_ENTER: /* dups as CBN_EFCHANGE */
|
case LN_ENTER: /* dups as CBN_EFCHANGE */
|
||||||
{
|
{
|
||||||
@@ -2850,7 +2831,7 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
wxListBox* pListBox = wxDynamicCast(pWin, wxListBox);
|
wxListBox* pListBox = wxDynamicCast(pWin, wxListBox);
|
||||||
|
|
||||||
pListBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
pListBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
||||||
,(WXUINT)SHORT1FROMMP(wParam)
|
,(WXWORD)SHORT1FROMMP(wParam)
|
||||||
);
|
);
|
||||||
if (pListBox->GetWindowStyle() & wxLB_OWNERDRAW)
|
if (pListBox->GetWindowStyle() & wxLB_OWNERDRAW)
|
||||||
Refresh();
|
Refresh();
|
||||||
@@ -2861,12 +2842,12 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
wxComboBox* pComboBox = wxDynamicCast(pWin, wxComboBox);
|
wxComboBox* pComboBox = wxDynamicCast(pWin, wxComboBox);
|
||||||
|
|
||||||
pComboBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
pComboBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
|
||||||
,(WXUINT)SHORT1FROMMP(wParam)
|
,(WXWORD)SHORT1FROMMP(wParam)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
case SPBN_UPARROW:
|
case SPBN_UPARROW:
|
||||||
case SPBN_DOWNARROW:
|
case SPBN_DOWNARROW:
|
||||||
@@ -2877,15 +2858,15 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
|
|
||||||
::WinSendMsg( HWNDFROMMP(lParam)
|
::WinSendMsg( HWNDFROMMP(lParam)
|
||||||
,SPBM_QUERYVALUE
|
,SPBM_QUERYVALUE
|
||||||
,&zVal
|
,&zVal[0]
|
||||||
,MPFROM2SHORT( (USHORT)10
|
,MPFROM2SHORT( (USHORT)10
|
||||||
,(USHORT)SPBQ_UPDATEIFVALID
|
,(USHORT)SPBQ_UPDATEIFVALID
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
lVal = atol(zVal);
|
lVal = atol(zVal);
|
||||||
bProcessed = OS2OnScroll( wxVERTICAL
|
bProcessed = OS2OnScroll( wxVERTICAL
|
||||||
,(int)SHORT2FROMMP(wParam)
|
,(WXWORD)SHORT2FROMMP(wParam)
|
||||||
,(int)lVal
|
,(WXWORD)lVal
|
||||||
,HWNDFROMMP(lParam)
|
,HWNDFROMMP(lParam)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -2903,8 +2884,8 @@ MRESULT wxWindowOS2::OS2WindowProc(
|
|||||||
}
|
}
|
||||||
if (pChild->IsKindOf(CLASSINFO(wxSlider)))
|
if (pChild->IsKindOf(CLASSINFO(wxSlider)))
|
||||||
bProcessed = OS2OnScroll( wxVERTICAL
|
bProcessed = OS2OnScroll( wxVERTICAL
|
||||||
,(int)SHORT2FROMMP(wParam)
|
,(WXWORD)SHORT2FROMMP(wParam)
|
||||||
,(int)LONGFROMMP(lParam)
|
,(WXWORD)LONGFROMMP(lParam)
|
||||||
,hWnd
|
,hWnd
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -3111,16 +3092,14 @@ WXHWND wxWindowOS2::OS2GetParent() const
|
|||||||
return m_parent ? m_parent->GetHWND() : NULL;
|
return m_parent ? m_parent->GetHWND() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowOS2::OS2Create(
|
bool wxWindowOS2::OS2Create( PSZ zClass,
|
||||||
PSZ zClass
|
const wxChar* zTitle,
|
||||||
, const wxChar* zTitle
|
WXDWORD dwStyle,
|
||||||
, WXDWORD dwStyle
|
const wxPoint& rPos,
|
||||||
, const wxPoint& rPos
|
const wxSize& rSize,
|
||||||
, const wxSize& rSize
|
void* pCtlData,
|
||||||
, void* pCtlData
|
WXDWORD WXUNUSED(dwExStyle),
|
||||||
, WXDWORD dwExStyle
|
bool bIsChild )
|
||||||
, bool bIsChild
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ERRORID vError;
|
ERRORID vError;
|
||||||
wxString sError;
|
wxString sError;
|
||||||
@@ -3938,53 +3917,56 @@ bool wxWindowOS2::HandleMaximize()
|
|||||||
return GetEventHandler()->ProcessEvent(vEvent);
|
return GetEventHandler()->ProcessEvent(vEvent);
|
||||||
} // end of wxWindowOS2::HandleMaximize
|
} // end of wxWindowOS2::HandleMaximize
|
||||||
|
|
||||||
bool wxWindowOS2::HandleMove(
|
bool wxWindowOS2::HandleMove( int nX, int nY )
|
||||||
int nX
|
|
||||||
, int nY
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxMoveEvent vEvent(wxPoint(nX, nY), m_windowId);
|
wxPoint pt(nX, nY);
|
||||||
|
wxMoveEvent vEvent(pt, m_windowId);
|
||||||
|
|
||||||
vEvent.SetEventObject(this);
|
vEvent.SetEventObject(this);
|
||||||
return GetEventHandler()->ProcessEvent(vEvent);
|
return GetEventHandler()->ProcessEvent(vEvent);
|
||||||
} // end of wxWindowOS2::HandleMove
|
} // end of wxWindowOS2::HandleMove
|
||||||
|
|
||||||
bool wxWindowOS2::HandleSize(
|
bool wxWindowOS2::HandleSize( int nWidth,
|
||||||
int nWidth
|
int nHeight,
|
||||||
, int nHeight
|
WXUINT WXUNUSED(nFlag) )
|
||||||
, WXUINT WXUNUSED(nFlag)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxSizeEvent vEvent(wxSize(nWidth, nHeight), m_windowId);
|
wxSize sz(nWidth, nHeight);
|
||||||
|
wxSizeEvent vEvent(sz, m_windowId);
|
||||||
|
|
||||||
vEvent.SetEventObject(this);
|
vEvent.SetEventObject(this);
|
||||||
return GetEventHandler()->ProcessEvent(vEvent);
|
return GetEventHandler()->ProcessEvent(vEvent);
|
||||||
} // end of wxWindowOS2::HandleSize
|
} // end of wxWindowOS2::HandleSize
|
||||||
|
|
||||||
bool wxWindowOS2::HandleGetMinMaxInfo(
|
bool wxWindowOS2::HandleGetMinMaxInfo( PSWP pSwp )
|
||||||
PSWP pSwp
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
POINTL vPoint;
|
POINTL vPoint;
|
||||||
|
|
||||||
switch(pSwp->fl)
|
switch(pSwp->fl)
|
||||||
{
|
{
|
||||||
case SWP_MAXIMIZE:
|
case SWP_MAXIMIZE:
|
||||||
|
#ifndef __WATCOMC__
|
||||||
|
// FIXME: incomplete headers ???
|
||||||
::WinGetMaxPosition(GetHwnd(), pSwp);
|
::WinGetMaxPosition(GetHwnd(), pSwp);
|
||||||
m_maxWidth = pSwp->cx;
|
m_maxWidth = pSwp->cx;
|
||||||
m_maxHeight = pSwp->cy;
|
m_maxHeight = pSwp->cy;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWP_MINIMIZE:
|
case SWP_MINIMIZE:
|
||||||
|
#ifndef __WATCOMC__
|
||||||
|
// FIXME: incomplete headers ???
|
||||||
::WinGetMinPosition(GetHwnd(), pSwp, &vPoint);
|
::WinGetMinPosition(GetHwnd(), pSwp, &vPoint);
|
||||||
m_minWidth = pSwp->cx;
|
m_minWidth = pSwp->cx;
|
||||||
m_minHeight = pSwp->cy;
|
m_minHeight = pSwp->cy;
|
||||||
|
#else
|
||||||
|
wxUnusedVar(vPoint);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
} // end of wxWindowOS2::HandleGetMinMaxInfo
|
} // end of wxWindowOS2::HandleGetMinMaxInfo
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -4208,14 +4190,12 @@ wxKeyEvent wxWindowOS2::CreateKeyEvent(
|
|||||||
} // end of wxWindowOS2::CreateKeyEvent
|
} // 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
|
// WM_KEYDOWN one
|
||||||
//
|
//
|
||||||
bool wxWindowOS2::HandleChar(
|
bool wxWindowOS2::HandleChar( WXWPARAM WXUNUSED(wParam),
|
||||||
WXWPARAM wParam
|
WXLPARAM lParam,
|
||||||
, WXLPARAM lParam
|
bool isASCII )
|
||||||
, bool isASCII
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
bool bCtrlDown = FALSE;
|
bool bCtrlDown = FALSE;
|
||||||
int vId;
|
int vId;
|
||||||
@@ -4227,15 +4207,15 @@ bool wxWindowOS2::HandleChar(
|
|||||||
// EVT_KEY_DOWN handler is meant, by design, to prevent EVT_CHARs
|
// EVT_KEY_DOWN handler is meant, by design, to prevent EVT_CHARs
|
||||||
// from happening, so just bail out at this point.
|
// from happening, so just bail out at this point.
|
||||||
//
|
//
|
||||||
m_bLastKeydownProcessed = FALSE;
|
m_bLastKeydownProcessed = false;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
if (isASCII)
|
if (isASCII)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// If 1 -> 26, translate to either special keycode or just set
|
// If 1 -> 26, translate to either special keycode or just set
|
||||||
// ctrlDown. IOW, Ctrl-C should result in keycode == 3 and
|
// ctrlDown. IOW, Ctrl-C should result in keycode == 3 and
|
||||||
// ControlDown() == TRUE.
|
// ControlDown() == true.
|
||||||
//
|
//
|
||||||
vId = SHORT1FROMMP(lParam);
|
vId = SHORT1FROMMP(lParam);
|
||||||
if ((vId > 0) && (vId < 27))
|
if ((vId > 0) && (vId < 27))
|
||||||
@@ -4264,18 +4244,16 @@ bool wxWindowOS2::HandleChar(
|
|||||||
{
|
{
|
||||||
vId = wxCharCodeOS2ToWX((int)SHORT2FROMMP(lParam));
|
vId = wxCharCodeOS2ToWX((int)SHORT2FROMMP(lParam));
|
||||||
if (vId == 0)
|
if (vId == 0)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxKeyEvent vEvent(CreateKeyEvent( wxEVT_CHAR
|
wxKeyEvent vEvent(CreateKeyEvent( wxEVT_CHAR, vId, lParam ));
|
||||||
,vId
|
|
||||||
,lParam
|
|
||||||
));
|
|
||||||
|
|
||||||
if (bCtrlDown)
|
if (bCtrlDown)
|
||||||
{
|
{
|
||||||
vEvent.m_controlDown = TRUE;
|
vEvent.m_controlDown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (GetEventHandler()->ProcessEvent(vEvent));
|
return (GetEventHandler()->ProcessEvent(vEvent));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4514,9 +4492,7 @@ void wxWindowOS2::MoveChildren(
|
|||||||
// as that will be the eventual size of the panel after the frame resizes
|
// as that will be the eventual size of the panel after the frame resizes
|
||||||
// it!
|
// it!
|
||||||
//
|
//
|
||||||
int wxWindowOS2::GetOS2ParentHeight(
|
int wxWindowOS2::GetOS2ParentHeight( wxWindowOS2* pParent )
|
||||||
wxWindowOS2* pParent
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Case 1
|
// Case 1
|
||||||
@@ -4558,11 +4534,12 @@ int wxWindowOS2::GetOS2ParentHeight(
|
|||||||
// and it's height must be different. Otherwise the standard
|
// and it's height must be different. Otherwise the standard
|
||||||
// applies.
|
// applies.
|
||||||
//
|
//
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
|
|
||||||
return(pParent->GetClientSize().y);
|
return(pParent->GetClientSize().y);
|
||||||
}
|
|
||||||
return(0L);
|
// }
|
||||||
} // end of wxWindowOS2::GetOS2ParentHeight
|
} // end of wxWindowOS2::GetOS2ParentHeight
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -4767,8 +4744,7 @@ wxWindow* wxGetActiveWindow()
|
|||||||
} // end of wxGetActiveWindow
|
} // end of wxGetActiveWindow
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
const char* wxGetMessageName(
|
const char* wxGetMessageName( int nMessage )
|
||||||
int nMessage)
|
|
||||||
{
|
{
|
||||||
switch (nMessage)
|
switch (nMessage)
|
||||||
{
|
{
|
||||||
@@ -5221,13 +5197,12 @@ const char* wxGetMessageName(
|
|||||||
case WM_USER+1000+60: return "TB_SETMAXTEXTROWS";
|
case WM_USER+1000+60: return "TB_SETMAXTEXTROWS";
|
||||||
case WM_USER+1000+61: return "TB_GETTEXTROWS";
|
case WM_USER+1000+61: return "TB_GETTEXTROWS";
|
||||||
case WM_USER+1000+41: return "TB_GETBITMAPFLAGS";
|
case WM_USER+1000+41: return "TB_GETBITMAPFLAGS";
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
static char s_szBuf[128];
|
static char s_szBuf[128];
|
||||||
sprintf(s_szBuf, "<unknown message = %d>", nMessage);
|
sprintf(s_szBuf, "<unknown message = %d>", nMessage);
|
||||||
return s_szBuf;
|
return s_szBuf;
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
} // end of wxGetMessageName
|
} // end of wxGetMessageName
|
||||||
|
|
||||||
#endif // __WXDEBUG__
|
#endif // __WXDEBUG__
|
||||||
@@ -5306,11 +5281,9 @@ wxPoint wxGetMousePosition()
|
|||||||
return wxPoint(vPt.x, vPt.y);
|
return wxPoint(vPt.x, vPt.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowOS2* FindWindowForMouseEvent(
|
wxWindowOS2* FindWindowForMouseEvent( wxWindow* pWin,
|
||||||
wxWindow* pWin
|
short* WXUNUSED(pnX),
|
||||||
, short* pnX
|
short* WXUNUSED(pnY) )
|
||||||
, short* pnY
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
HWND hWnd = GetHwndOf(pWin);
|
HWND hWnd = GetHwndOf(pWin);
|
||||||
HWND hWndUnderMouse;
|
HWND hWndUnderMouse;
|
||||||
@@ -5408,4 +5381,3 @@ wxWindowOS2* FindWindowForMouseEvent(
|
|||||||
}
|
}
|
||||||
return pWin;
|
return pWin;
|
||||||
} // end of FindWindowForMouseEvent
|
} // end of FindWindowForMouseEvent
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user