+/////////////////////////////////////////////////////////////////////////////
// Name: windows.cpp
// Purpose: wxWindow
// Author: David Webster
//
// Default command handler
//
-bool wxWindowOS2::OS2Command(
- WXUINT WXUNUSED(uParam)
-, WXWORD WXUNUSED(uId)
-)
+bool wxWindowOS2::OS2Command( WXUINT WXUNUSED(uParam),
+ WXWORD WXUNUSED(uId) )
{
- return(FALSE);
+ return false;
}
// ----------------------------------------------------------------------------
//
// PM specific
//
- m_bWinCaptured = FALSE;
+ m_bWinCaptured = false;
m_fnOldWndProc = NULL;
- m_bUseCtl3D = FALSE;
- m_bMouseInWindow = FALSE;
- m_bLastKeydownProcessed = FALSE;
+ m_bUseCtl3D = false;
+ m_bMouseInWindow = false;
+ m_bLastKeydownProcessed = false;
m_pChildrenDisabled = NULL;
//
m_nXThumbSize = 0;
m_nYThumbSize = 0;
- m_bBackgroundTransparent = FALSE;
+ m_bBackgroundTransparent = false;
//
// As all windows are created with WS_VISIBLE style...
//
- m_isShown = TRUE;
+ m_isShown = true;
#if wxUSE_MOUSEEVENT_HACK
m_lLastMouseX =
//
wxWindowOS2::~wxWindowOS2()
{
- m_isBeingDeleted = TRUE;
+ m_isBeingDeleted = true;
for (wxWindow* pWin = GetParent(); pWin; pWin = pWin->GetParent())
{
} // end of wxWindowOS2::~wxWindowOS2
// real construction (Init() must have been called before!)
-bool wxWindowOS2::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxString& rName
-)
+bool wxWindowOS2::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxString& rName )
{
- HWND hParent = NULLHANDLE;
- ULONG ulCreateFlags = 0;
- WXDWORD dwExStyle = 0;
+ HWND hParent = NULLHANDLE;
+ ULONG ulCreateFlags = 0;
+ WXDWORD dwExStyle = 0;
- wxCHECK_MSG(pParent, FALSE, wxT("can't create wxWindow without parent"));
+ wxCHECK_MSG(pParent, false, wxT("can't create wxWindow without parent"));
#if wxUSE_STATBOX
//
,wxDefaultValidator
,rName
))
- return(FALSE);
+ return false;
if (pParent)
{
if (lStyle & wxPOPUP_WINDOW)
{
ulCreateFlags &= ~WS_VISIBLE;
- m_isShown = FALSE;
+ m_isShown = false;
}
else
{
,rSize
,NULL // Control Data
,dwExStyle
- ,TRUE // Child
+ ,true // Child
));
} // end of wxWindowOS2::Create
return NULL;
} // wxWindowBase::DoFindFocus
-bool wxWindowOS2::Enable(
- bool bEnable
-)
+bool wxWindowOS2::Enable( bool bEnable )
{
if (!wxWindowBase::Enable(bEnable))
- return(FALSE);
+ return false;
HWND hWnd = GetHwnd();
// out later) of everything which would be really ugly
//
if (IsTopLevel())
- return TRUE;
+ return true;
wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
delete m_pChildrenDisabled;
m_pChildrenDisabled = NULL;
}
- return TRUE;
+ return true;
} // end of wxWindowOS2::Enable
-bool wxWindowOS2::Show(
- bool bShow
-)
+bool wxWindowOS2::Show( bool bShow )
{
if (!wxWindowBase::Show(bShow))
- return(FALSE);
+ return false;
HWND hWnd = GetHwnd();
{
::WinSetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE | SWP_ZORDER);
}
- return TRUE;
+ return true;
} // end of wxWindowOS2::Show
void wxWindowOS2::Raise()
::WinSetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER | SWP_DEACTIVATE);
} // end of wxWindowOS2::Lower
-void wxWindowOS2::SetTitle(
- const wxString& rTitle
-)
+void wxWindowOS2::SetTitle( const wxString& rTitle )
{
::WinSetWindowText(GetHwnd(), (PSZ)rTitle.c_str());
} // end of wxWindowOS2::SetTitle
void wxWindowOS2::DoCaptureMouse()
{
- HWND hWnd = GetHwnd();
+ HWND hWnd = GetHwnd();
if (hWnd && !m_bWinCaptured)
{
::WinSetCapture(HWND_DESKTOP, hWnd);
- m_bWinCaptured = TRUE;
+ m_bWinCaptured = true;
}
} // end of wxWindowOS2::GetTitle
if (m_bWinCaptured)
{
::WinSetCapture(HWND_DESKTOP, NULLHANDLE);
- m_bWinCaptured = FALSE;
+ m_bWinCaptured = false;
}
} // end of wxWindowOS2::ReleaseMouse
return hwnd ? wxFindWinFromHandle((WXHWND)hwnd) : (wxWindow *)NULL;
} // end of wxWindowBase::GetCapture
-bool wxWindowOS2::SetFont(
- const wxFont& rFont
-)
+bool wxWindowOS2::SetFont( const wxFont& rFont )
{
if (!wxWindowBase::SetFont(rFont))
{
// nothing to do
- return(FALSE);
+ return false;
}
- HWND hWnd = GetHwnd();
+ HWND hWnd = GetHwnd();
- wxOS2SetFont( hWnd
- ,rFont
- );
- return(TRUE);
+ wxOS2SetFont( hWnd, rFont );
+ return true;
} // end of wxWindowOS2::SetFont
-bool wxWindowOS2::SetCursor(
- const wxCursor& rCursor
-) // check if base implementation is OK
+// check if base implementation is OK
+bool wxWindowOS2::SetCursor( const wxCursor& rCursor)
{
if ( !wxWindowBase::SetCursor(rCursor))
{
// no change
- return FALSE;
+ return false;
}
if ( m_cursor.Ok() ) {
::WinSetPointer(HWND_DESKTOP, (HPOINTER)m_cursor.GetHCURSOR());
}
}
- return TRUE;
+ return true;
} // end of wxWindowOS2::SetCursor
void wxWindowOS2::WarpPointer(
}
} // end of wxWindowOS2::SetScrollbar
-void wxWindowOS2::ScrollWindow(
- int nDx
-, int nDy
-, const wxRect* pRect
-)
+
+void wxWindowOS2::ScrollWindow( int nDx,
+ int nDy,
+ const wxRect* pRect )
{
- RECTL vRect;
+ RECTL vRect;
::WinQueryWindowRect(GetHwnd(), &vRect);
- int height = vRect.yTop;
+ int height = vRect.yTop;
if (pRect)
{
vRect.xLeft = pRect->x;
//
// Generate a LEAVE event
//
- m_bMouseInWindow = FALSE;
+ m_bMouseInWindow = false;
//
// Unfortunately the mouse button and keyboard state may have changed
//
// Set this window to be the child of 'parent'.
//
-bool wxWindowOS2::Reparent(
- wxWindow* pParent
-)
+bool wxWindowOS2::Reparent( wxWindow* pParent)
{
if (!wxWindowBase::Reparent(pParent))
- return FALSE;
+ return false;
- HWND hWndChild = GetHwnd();
- HWND hWndParent = GetParent() ? GetWinHwnd(GetParent()) : (HWND)0;
+ HWND hWndChild = GetHwnd();
+ HWND hWndParent = GetParent() ? GetWinHwnd(GetParent()) : (HWND)0;
::WinSetParent(hWndChild, hWndParent, TRUE);
- return TRUE;
+ return true;
} // end of wxWindowOS2::Reparent
void wxWindowOS2::Update()
Refresh();
} // end of wxWindowOS2::Thaw
-void wxWindowOS2::Refresh(
- bool bEraseBack
-, const wxRect* pRect
-)
+void wxWindowOS2::Refresh( bool bEraseBack,
+ const wxRect* pRect )
{
- HWND hWnd = GetHwnd();
+ HWND hWnd = GetHwnd();
if (hWnd)
{
if (pRect)
{
- RECTL vOs2Rect;
- int height;
+ RECTL vOs2Rect;
+ int height;
::WinQueryWindowRect(GetHwnd(), &vOs2Rect);
height = vOs2Rect.yTop;
// the width/height to best suit our contents, otherwise we reuse the current
// width/height
//
-void wxWindowOS2::DoSetSize(
- int nX
-, int nY
-, int nWidth
-, int nHeight
-, int nSizeFlags
-)
+void wxWindowOS2::DoSetSize( int nX,
+ int nY,
+ int nWidth,
+ int nHeight,
+ int nSizeFlags )
{
//
// Get the current size and position...
//
- int nCurrentX;
- int nCurrentY;
- int nCurrentWidth;
- int nCurrentHeight;
- wxSize vSize(-1, -1);
+ int nCurrentX;
+ int nCurrentY;
+ int nCurrentWidth;
+ int nCurrentHeight;
+ wxSize vSize = wxDefaultSize;
GetPosition(&nCurrentX, &nCurrentY);
GetSize(&nCurrentWidth, &nCurrentHeight);
return;
}
- if (nX == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+ if (nX == wxDefaultCoord && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
nX = nCurrentX;
- if (nY == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+ if (nY == wxDefaultCoord && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
nY = nCurrentY;
AdjustForParentClientOrigin(nX, nY, nSizeFlags);
- if (nWidth == -1)
+ if (nWidth == wxDefaultCoord)
{
if (nSizeFlags & wxSIZE_AUTO_WIDTH)
{
}
}
- if (nHeight == -1)
+ if (nHeight == wxDefaultCoord)
{
if (nSizeFlags & wxSIZE_AUTO_HEIGHT)
{
- if (vSize.x == -1)
+ if (vSize.x == wxDefaultCoord)
{
vSize = DoGetBestSize();
}
}
}
- DoMoveWindow( nX
- ,nY
- ,nWidth
- ,nHeight
- );
+ DoMoveWindow( nX, nY, nWidth, nHeight );
} // end of wxWindowOS2::DoSetSize
void wxWindowOS2::DoSetClientSize( int nWidth,
{
//
// Get the mouse position
- POINTL vPt;
+ POINTL vPt;
::WinQueryPointerPos(HWND_DESKTOP, &vPt);
// Find the window which currently has the cursor and go up the window
// chain until we find this window - or exhaust it
//
- HWND hWnd = ::WinWindowFromPoint(HWND_DESKTOP, &vPt, TRUE);
+ HWND hWnd = ::WinWindowFromPoint(HWND_DESKTOP, &vPt, TRUE);
while (hWnd && (hWnd != GetHwnd()))
hWnd = ::WinQueryWindow(hWnd, QW_PARENT);
// ---------------------------------------------------------------------------
//
#if wxUSE_MENUS_NATIVE
-bool wxWindowOS2::DoPopupMenu(
- wxMenu* pMenu
-, int nX
-, int nY
-)
+bool wxWindowOS2::DoPopupMenu( wxMenu* pMenu,
+ int nX,
+ int nY )
{
- HWND hWndOwner = GetHwnd();
- HWND hWndParent = GetHwnd();
- HWND hMenu = GetHmenuOf(pMenu);
- bool bIsWaiting = TRUE;
- int nHeight;
+ HWND hWndOwner = GetHwnd();
+ HWND hWndParent = GetHwnd();
+ HWND hMenu = GetHmenuOf(pMenu);
+ bool bIsWaiting = true;
+ int nHeight;
// Protect against recursion
if (wxCurrentPopupMenu)
::WinGetMsg(vHabmain,&vMsg, (HWND)0, 0, 0);
if (vMsg.msg == WM_COMMAND)
- bIsWaiting = FALSE;
+ bIsWaiting = false;
::WinDispatchMsg(vHabmain, (PQMSG)&vMsg);
}
wxCurrentPopupMenu = NULL;
pMenu->SetInvokingWindow(NULL);
- return TRUE;
+ return true;
} // end of wxWindowOS2::DoPopupMenu
#endif // wxUSE_MENUS_NATIVE
// pre/post message processing
// ===========================================================================
-MRESULT wxWindowOS2::OS2DefWindowProc(
- WXUINT uMsg
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+MRESULT wxWindowOS2::OS2DefWindowProc( WXUINT uMsg,
+ WXWPARAM wParam,
+ WXLPARAM lParam )
{
if (m_fnOldWndProc)
return (MRESULT)m_fnOldWndProc(GetHWND(), uMsg, (MPARAM)wParam, (MPARAM)lParam);
return ::WinDefWindowProc(GetHWND(), uMsg, (MPARAM)wParam, (MPARAM)lParam);
} // end of wxWindowOS2::OS2DefWindowProc
-bool wxWindowOS2::OS2ProcessMessage(
- WXMSG* pMsg
-)
+bool wxWindowOS2::OS2ProcessMessage( WXMSG* pMsg )
{
// wxUniversal implements tab traversal itself
#ifndef __WXUNIVERSAL__
//
// Intercept dialog navigation keys
//
- bool bProcess = TRUE;
- USHORT uKeyFlags = SHORT1FROMMP(pQMsg->mp1);
+ bool bProcess = true;
+ USHORT uKeyFlags = SHORT1FROMMP(pQMsg->mp1);
if (uKeyFlags & KC_KEYUP)
- bProcess = FALSE;
+ bProcess = false;
if (uKeyFlags & KC_ALT)
- bProcess = FALSE;
+ bProcess = false;
if (!(uKeyFlags & KC_VIRTUALKEY))
- bProcess = FALSE;
+ bProcess = false;
if (bProcess)
{
ulDlgCode = (ULONG)::WinSendMsg(pQMsg->hwnd, WM_QUERYDLGCODE, pQMsg, 0);
}
- bool bForward = TRUE;
- bool bWindowChange = FALSE;
+ bool bForward = true;
+ bool bWindowChange = false;
switch (SHORT2FROMMP(pQMsg->mp2))
{
//
if (!bShiftDown)
{
- bProcess = FALSE;
+ bProcess = false;
}
else
{
{
case DLGC_ENTRYFIELD:
case DLGC_MLE:
- bProcess = TRUE;
+ bProcess = true;
break;
default:
- bProcess = FALSE;
+ bProcess = false;
}
//
case VK_UP:
case VK_LEFT:
if (bCtrlDown)
- bProcess = FALSE;
+ bProcess = false;
else
- bForward = FALSE;
+ bForward = false;
break;
case VK_DOWN:
case VK_RIGHT:
if (bCtrlDown)
- bProcess = FALSE;
+ bProcess = false;
break;
case VK_ENTER:
//
// ctrl-enter is not processed
//
- return FALSE;
+ return false;
}
else if (ulDlgCode & DLGC_BUTTON)
{
//
// buttons want process Enter themselevs
//
- bProcess = FALSE;
+ bProcess = false;
}
else
{
// If we do have a default button, do press it
//
pBtn->OS2Command(BN_CLICKED, 0 /* unused */);
- return TRUE;
+ return true;
}
else if (!IsTopLevel())
{
// if not a top level window, let parent
// handle it
//
- return FALSE;
+ return false;
}
// else: but if it does not it makes sense to make
// it work like a TAB - and that's what we do.
break;
default:
- bProcess = FALSE;
+ bProcess = false;
}
if (bProcess)
//
pBtn->SetDefault();
}
- return TRUE;
+ return true;
}
}
}
// Let Dialogs process
//
if (::WinSendMsg(pQMsg->hwnd, WM_QUERYDLGCODE, pQMsg, 0));
- return TRUE;
+ return true;
}
#else
pMsg = pMsg; // just shut up the compiler
#endif // __WXUNIVERSAL__
- return FALSE;
+ return false;
} // end of wxWindowOS2::OS2ProcessMessage
-bool wxWindowOS2::OS2TranslateMessage(
- WXMSG* pMsg
-)
+bool wxWindowOS2::OS2TranslateMessage( WXMSG* pMsg )
{
#if wxUSE_ACCEL && !defined(__WXUNIVERSAL__)
- return m_acceleratorTable.Translate(m_hWnd, pMsg);
+ return m_acceleratorTable.Translate(m_hWnd, pMsg);
#else
- pMsg = pMsg;
- return FALSE;
+ pMsg = pMsg;
+ return false;
#endif //wxUSE_ACCEL
} // end of wxWindowOS2::OS2TranslateMessage
// We will add (or delete) messages we need to handle at this default
// level as we go
//
-MRESULT wxWindowOS2::OS2WindowProc(
- WXUINT uMsg
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+MRESULT wxWindowOS2::OS2WindowProc( WXUINT uMsg,
+ WXWPARAM wParam,
+ WXLPARAM lParam )
{
//
// Did we process the uMsg?
//
- bool bProcessed = FALSE;
- MRESULT mResult;
+ bool bProcessed = false;
+ MRESULT mResult;
//
// For most messages we should return 0 when we do process the message
case WM_DESTROY:
HandleDestroy();
- bProcessed = TRUE;
+ bProcessed = true;
break;
case WM_MOVE:
bProcessed = HandleActivate( wState
,(WXHWND)hWnd
);
- bProcessed = FALSE;
+ bProcessed = false;
}
break;
// Don't let the DefWindowProc() destroy our window - we'll do it
// ourselves in ~wxWindow
//
- bProcessed = TRUE;
+ bProcessed = true;
mResult = (MRESULT)TRUE;
break;
if ( m_lDlgCode )
{
mResult = (MRESULT)m_lDlgCode;
- bProcessed = TRUE;
+ bProcessed = true;
}
}
//
}
else // keydown event
{
- m_bLastKeydownProcessed = FALSE;
+ m_bLastKeydownProcessed = false;
//
// If this has been processed by an event handler,
// return 0 now (we've handled it). DON't RETURN
case VK_CAPSLOCK:
case VK_NUMLOCK:
case VK_SCRLLOCK:
- bProcessed = TRUE;
+ bProcessed = true;
break;
// Avoid duplicate messages to OnChar for these ASCII keys: they
case VK_ENTER:
case VK_BACKSPACE:
case VK_TAB:
- // But set processed to FALSE, not TRUE to still pass them to
+ // But set processed to false, not true to still pass them to
// the control's default window proc - otherwise built-in
// keyboard handling won't work
- bProcessed = FALSE;
+ bProcessed = false;
break;
default:
// a key in an EVT_KEY_DOWN handler is meant, by
// design, to prevent EVT_CHARs from happening
//
- m_bLastKeydownProcessed = FALSE;
- bProcessed = TRUE;
+ m_bLastKeydownProcessed = false;
+ bProcessed = true;
}
else // do generate a CHAR event
{
- bProcessed = HandleChar(wParam, lParam, TRUE);
+ bProcessed = HandleChar(wParam, lParam, true);
break;
}
}
if (!pWin)
{
- bProcessed = FALSE;
+ bProcessed = false;
break;
}
if (pWin->IsKindOf(CLASSINFO(wxBitmapButton)))
);
if (!pWin)
{
- bProcessed = FALSE;
+ bProcessed = false;
break;
}
if (pWin->IsKindOf(CLASSINFO(wxNotebook)))
vEvent.SetEventObject(pWin);
pNotebook->OnSelChange(vEvent);
- bProcessed = TRUE;
+ bProcessed = true;
}
else
- bProcessed = FALSE;
+ bProcessed = false;
}
else
- bProcessed = FALSE;
+ bProcessed = false;
}
break;
if (!pWin)
{
- bProcessed = FALSE;
+ bProcessed = false;
break;
}
//
if (!pWin)
{
- bProcessed = FALSE;
+ bProcessed = false;
break;
}
//
if (!pChild)
{
- bProcessed = FALSE;
+ bProcessed = false;
break;
}
if (pChild->IsKindOf(CLASSINFO(wxSlider)))
}
} // end of wxAssociateWinWithHandle
-void wxRemoveHandleAssociation(
- wxWindowOS2* pWin
-)
+void wxRemoveHandleAssociation( wxWindowOS2* pWin )
{
wxWinHandleHash->Delete((long)pWin->GetHWND());
} // end of wxRemoveHandleAssociation
{
}
-bool wxWindowOS2::OS2GetCreateWindowCoords(
- const wxPoint& rPos
-, const wxSize& rSize
-, int& rnX
-, int& rnY
-, int& rnWidth
-, int& rnHeight
-) const
+bool wxWindowOS2::OS2GetCreateWindowCoords( const wxPoint& rPos,
+ const wxSize& rSize,
+ int& rnX,
+ int& rnY,
+ int& rnWidth,
+ int& rnHeight ) const
{
- bool bNonDefault = FALSE;
- static const int DEFAULT_Y = 200;
- static const int DEFAULT_H = 250;
+ bool bNonDefault = false;
+ static const int DEFAULT_Y = 200;
+ static const int DEFAULT_H = 250;
- if (rPos.x == -1)
+ if (rPos.x == wxDefaultCoord)
{
rnX = rnY = CW_USEDEFAULT;
}
else
{
rnX = rPos.x;
- rnY = rPos.y == -1 ? DEFAULT_Y : rPos.y;
- bNonDefault = TRUE;
+ rnY = rPos.y == wxDefaultCoord ? DEFAULT_Y : rPos.y;
+ bNonDefault = true;
}
- if (rSize.x == -1)
+ if (rSize.x == wxDefaultCoord)
{
rnWidth = rnHeight = CW_USEDEFAULT;
}
else
{
rnWidth = rSize.x;
- rnHeight = rSize.y == -1 ? DEFAULT_H : rSize.y;
- bNonDefault = TRUE;
+ rnHeight = rSize.y == wxDefaultCoord ? DEFAULT_H : rSize.y;
+ bNonDefault = true;
}
return bNonDefault;
} // end of wxWindowOS2::OS2GetCreateWindowCoords
{
vError = ::WinGetLastError(wxGetInstance());
sError = wxPMErrorToStr(vError);
- return FALSE;
+ return false;
}
SubclassWin(m_hWnd);
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
- return FALSE;
+ return false;
}
SetSize( nX
,nY
,nWidth
,nHeight
);
- return TRUE;
+ return true;
} // end of WinGuiBase_Window::OS2Create
// ===========================================================================
// window creation/destruction
// ---------------------------------------------------------------------------
-bool wxWindowOS2::HandleCreate(
- WXLPCREATESTRUCT WXUNUSED(vCs)
-, bool* pbMayCreate
-)
+bool wxWindowOS2::HandleCreate( WXLPCREATESTRUCT WXUNUSED(vCs),
+ bool* pbMayCreate )
{
wxWindowCreateEvent vEvent((wxWindow*)this);
(void)GetEventHandler()->ProcessEvent(vEvent);
- *pbMayCreate = TRUE;
- return TRUE;
+ *pbMayCreate = true;
+ return true;
} // end of wxWindowOS2::HandleCreate
bool wxWindowOS2::HandleDestroy()
//
// WM_DESTROY handled
//
- return TRUE;
+ return true;
} // end of wxWindowOS2::HandleDestroy
// ---------------------------------------------------------------------------
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::HandleActivate
-bool wxWindowOS2::HandleSetFocus(
- WXHWND WXUNUSED(hWnd)
-)
+bool wxWindowOS2::HandleSetFocus( WXHWND WXUNUSED(hWnd) )
{
//
// Notify the parent keeping track of focus for the kbd navigation
// after the control gets to process it from EN_FOCUS handler
if ( wxDynamicCastThis(wxTextCtrl) )
{
- return FALSE;
+ return false;
}
#endif // wxUSE_TEXTCTRL
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::HandleSetFocus
-bool wxWindowOS2::HandleKillFocus(
- WXHWND hWnd
-)
+bool wxWindowOS2::HandleKillFocus( WXHWND hWnd )
{
#if wxUSE_CARET
//
if (pCtrl)
{
- return FALSE;
+ return false;
}
#endif
//
if ( m_isBeingDeleted )
{
- return FALSE;
+ return false;
}
wxFocusEvent vEvent( wxEVT_KILL_FOCUS
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::HandleShow
-bool wxWindowOS2::HandleInitDialog(
- WXHWND WXUNUSED(hWndFocus)
-)
+bool wxWindowOS2::HandleInitDialog( WXHWND WXUNUSED(hWndFocus) )
{
wxInitDialogEvent vEvent(GetId());
bool wxWindowOS2::HandleEndDrag(WXWPARAM WXUNUSED(wParam))
{
// TODO: We'll handle drag and drop later
- return FALSE;
+ return false;
}
-bool wxWindowOS2::HandleSetCursor(
- USHORT WXUNUSED(vId)
-, WXHWND hPointer
-)
+bool wxWindowOS2::HandleSetCursor( USHORT WXUNUSED(vId),
+ WXHWND hPointer )
{
//
// Under OS/2 PM this allows the pointer to be changed
// as it passes over a control
//
::WinSetPointer(HWND_DESKTOP, (HPOINTER)hPointer);
- return TRUE;
+ return true;
} // end of wxWindowOS2::HandleSetCursor
// ---------------------------------------------------------------------------
// owner drawn stuff
// ---------------------------------------------------------------------------
-bool wxWindowOS2::OS2OnDrawItem(
- int vId
-, WXDRAWITEMSTRUCT* pItemStruct
-)
+bool wxWindowOS2::OS2OnDrawItem( int vId,
+ WXDRAWITEMSTRUCT* pItemStruct )
{
#if wxUSE_OWNER_DRAWN
wxDC vDc;
,pMeasureStruct->rclItem.xRight - pMeasureStruct->rclItem.xLeft
,pMeasureStruct->rclItem.yTop - pMeasureStruct->rclItem.yBottom
);
- vDc.SetHDC( hDC
- ,FALSE
- );
- vDc.SetHPS(pMeasureStruct->hps);
+ vDc.SetHDC( hDC, false );
+ vDc.SetHPS( pMeasureStruct->hps );
//
// Load the wxWidgets Pallete and set to RGB mode
//
wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE );
-
- int eAction = 0;
- int eStatus = 0;
+ int eAction = 0;
+ int eStatus = 0;
if (pMeasureStruct->fsAttribute == pMeasureStruct->fsAttributeOld)
{
// For now we don't care about anything else
// just ignore the entire message!
//
- return TRUE;
+ return true;
}
}
//
vId = vId;
pItemStruct = pItemStruct;
#endif
- return FALSE;
+ return false;
} // end of wxWindowOS2::OS2OnDrawItem
-long wxWindowOS2::OS2OnMeasureItem(
- int lId
-, WXMEASUREITEMSTRUCT* pItemStruct
-)
+long wxWindowOS2::OS2OnMeasureItem( int lId,
+ WXMEASUREITEMSTRUCT* pItemStruct )
{
#if wxUSE_OWNER_DRAWN
//
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::HandleSysColorChange
-bool wxWindowOS2::HandleCtlColor(
- WXHBRUSH* WXUNUSED(phBrush)
-)
+bool wxWindowOS2::HandleCtlColor( WXHBRUSH* WXUNUSED(phBrush) )
{
//
// Not much provided with message. So not sure I can do anything with it
//
- return TRUE;
+ return true;
} // end of wxWindowOS2::HandleCtlColor
if (::WinQueryUpdateRegion(GetHwnd(), hRgn) == RGN_ERROR)
{
wxLogLastError(wxT("CreateRectRgn"));
- return FALSE;
+ return false;
}
// Get all the rectangles from the region, convert the individual
}
}
::WinEndPaint(hPS);
- bProcessed = TRUE;
+ bProcessed = true;
}
else if (!bProcessed &&
IsKindOf(CLASSINFO(wxPanel))
//
// Panel with children, usually fills a frame client so no borders.
//
- HPS hPS;
- RECTL vRect;
+ HPS hPS;
+ RECTL vRect;
hPS = ::WinBeginPaint( GetHwnd()
,NULLHANDLE
::WinFillRect(hPS, &vRect, GetBackgroundColour().GetPixel());
}
::WinEndPaint(hPS);
- bProcessed = TRUE;
+ bProcessed = true;
}
return bProcessed;
} // end of wxWindowOS2::HandlePaint
-bool wxWindowOS2::HandleEraseBkgnd(
- WXHDC hDC
-)
+bool wxWindowOS2::HandleEraseBkgnd( WXHDC hDC )
{
- SWP vSwp;
- bool rc;
+ SWP vSwp;
+ bool rc;
::WinQueryWindowPos(GetHwnd(), &vSwp);
if (vSwp.fl & SWP_MINIMIZE)
- return TRUE;
+ return true;
- wxDC vDC;
+ wxDC vDC;
vDC.m_hPS = (HPS)hDC; // this is really a PS
vDC.SetWindow((wxWindow*)this);
vDC.BeginDrawing();
- wxEraseEvent vEvent(m_windowId, &vDC);
+ wxEraseEvent vEvent(m_windowId, &vDC);
vEvent.SetEventObject(this);
vDC.EndDrawing();
vDC.m_hPS = NULLHANDLE;
- return TRUE;
+ return true;
} // end of wxWindowOS2::HandleEraseBkgnd
void wxWindowOS2::OnEraseBackground(
switch(pSwp->fl)
{
case SWP_MAXIMIZE:
-#ifndef __WATCOMC__
-// FIXME: incomplete headers ???
+#if !(defined(__WATCOMC__) && __WATCOMC__ < 1240 )
+// Open Watcom 1.3 had incomplete headers
+// that's reported and should be fixed for OW 1.4
::WinGetMaxPosition(GetHwnd(), pSwp);
m_maxWidth = pSwp->cx;
m_maxHeight = pSwp->cy;
break;
case SWP_MINIMIZE:
-#ifndef __WATCOMC__
-// FIXME: incomplete headers ???
+#if !(defined(__WATCOMC__) && __WATCOMC__ < 1240 )
+// Open Watcom 1.3 had incomplete headers
+// that's reported and should be fixed for OW 1.4
::WinGetMinPosition(GetHwnd(), pSwp, &vPoint);
m_minWidth = pSwp->cx;
m_minHeight = pSwp->cy;
// ---------------------------------------------------------------------------
// command messages
// ---------------------------------------------------------------------------
-bool wxWindowOS2::HandleCommand(
- WXWORD wId
-, WXWORD wCmd
-, WXHWND hControl
-)
+bool wxWindowOS2::HandleCommand( WXWORD wId,
+ WXWORD wCmd,
+ WXHWND hControl )
{
#if wxUSE_MENUS_NATIVE
if (wxCurrentPopupMenu)
if (pWin)
return pWin->OS2Command(wCmd, wId);
- return FALSE;
+ return false;
} // end of wxWindowOS2::HandleCommand
-bool wxWindowOS2::HandleSysCommand(
- WXWPARAM wParam
-, WXLPARAM WXUNUSED(lParam)
-)
+bool wxWindowOS2::HandleSysCommand( WXWPARAM wParam,
+ WXLPARAM WXUNUSED(lParam) )
{
//
// 4 bits are reserved
case SC_MINIMIZE:
return HandleMinimize();
}
- return FALSE;
+ return false;
} // end of wxWindowOS2::HandleSysCommand
// ---------------------------------------------------------------------------
#endif // wxUSE_MOUSEEVENT_HACK
} // end of wxWindowOS2::InitMouseEvent
-bool wxWindowOS2::HandleMouseEvent(
- WXUINT uMsg
-, int nX
-, int nY
-, WXUINT uFlags
-)
+bool wxWindowOS2::HandleMouseEvent( WXUINT uMsg,
+ int nX,
+ int nY,
+ WXUINT uFlags )
{
- bool bProcessed = FALSE;
+ bool bProcessed = false;
//
// The mouse events take consecutive IDs from WM_MOUSEFIRST to
// Bounds check
if ((uMsg >= WM_MOUSEMOVE) && (uMsg <= WM_BUTTON3DBLCLK))
{
- wxMouseEvent vEvent(eventsMouse[uMsg - WM_MOUSEMOVE]);
+ wxMouseEvent vEvent(eventsMouse[uMsg - WM_MOUSEMOVE]);
InitMouseEvent( vEvent
,nX
bProcessed = GetEventHandler()->ProcessEvent(vEvent);
if (!bProcessed)
{
- HPOINTER hCursor = (HPOINTER)GetCursor().GetHCURSOR();
+ HPOINTER hCursor = (HPOINTER)GetCursor().GetHCURSOR();
if (hCursor != NULLHANDLE)
{
::WinSetPointer(HWND_DESKTOP, hCursor);
- bProcessed = TRUE;
+ bProcessed = true;
}
}
}
return bProcessed;
} // end of wxWindowOS2::HandleMouseEvent
-bool wxWindowOS2::HandleMouseMove(
- int nX
-, int nY
-, WXUINT uFlags
-)
+bool wxWindowOS2::HandleMouseMove( int nX,
+ int nY,
+ WXUINT uFlags )
{
if (!m_bMouseInWindow)
{
//
// Generate an ENTER event
//
- m_bMouseInWindow = TRUE;
+ m_bMouseInWindow = true;
- wxMouseEvent vEvent(wxEVT_ENTER_WINDOW);
+ wxMouseEvent vEvent(wxEVT_ENTER_WINDOW);
InitMouseEvent( vEvent
,nX
WXLPARAM lParam,
bool isASCII )
{
- bool bCtrlDown = FALSE;
+ bool bCtrlDown = false;
int vId;
if (m_bLastKeydownProcessed)
break;
default:
- bCtrlDown = TRUE;
+ bCtrlDown = true;
break;
}
}
return (GetEventHandler()->ProcessEvent(vEvent));
}
-bool wxWindowOS2::HandleKeyDown(
- WXWPARAM wParam
-, WXLPARAM lParam
-)
+bool wxWindowOS2::HandleKeyDown( WXWPARAM wParam,
+ WXLPARAM lParam )
{
- int nId = wxCharCodeOS2ToWX((int)SHORT2FROMMP(lParam));
+ int nId = wxCharCodeOS2ToWX((int)SHORT2FROMMP(lParam));
if (!nId)
{
if (nId != -1)
{
- wxKeyEvent vEvent(CreateKeyEvent( wxEVT_KEY_DOWN
- ,nId
- ,(MPARAM)lParam
- ,(MPARAM)wParam
- ));
+ wxKeyEvent vEvent(CreateKeyEvent( wxEVT_KEY_DOWN
+ ,nId
+ ,(MPARAM)lParam
+ ,(MPARAM)wParam
+ ));
if (GetEventHandler()->ProcessEvent(vEvent))
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
} // end of wxWindowOS2::HandleKeyDown
-bool wxWindowOS2::HandleKeyUp(
- WXWPARAM wParam
-, WXLPARAM lParam
-)
+bool wxWindowOS2::HandleKeyUp( WXWPARAM wParam,
+ WXLPARAM lParam )
{
- int nId = wxCharCodeOS2ToWX((int)SHORT2FROMMP(lParam));
+ int nId = wxCharCodeOS2ToWX((int)SHORT2FROMMP(lParam));
if (!nId)
{
if (nId != -1)
{
- wxKeyEvent vEvent(CreateKeyEvent( wxEVT_KEY_UP
- ,nId
- ,(MPARAM)lParam
- ,(MPARAM)wParam
- ));
+ wxKeyEvent vEvent(CreateKeyEvent( wxEVT_KEY_UP
+ ,nId
+ ,(MPARAM)lParam
+ ,(MPARAM)wParam
+ ));
if (GetEventHandler()->ProcessEvent(vEvent))
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
} // end of wxWindowOS2::HandleKeyUp
// ---------------------------------------------------------------------------
// scrolling
// ---------------------------------------------------------------------------
-bool wxWindowOS2::OS2OnScroll(
- int nOrientation
-, WXWORD wParam
-, WXWORD wPos
-, WXHWND hControl
-)
+bool wxWindowOS2::OS2OnScroll( int nOrientation,
+ WXWORD wParam,
+ WXWORD wPos,
+ WXHWND hControl )
{
if (hControl)
{
break;
default:
- return FALSE;
+ return false;
}
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::OS2OnScroll
return nId;
} // end of wxCharCodeOS2ToWX
-int wxCharCodeWXToOS2(
- int nId
-, bool* bIsVirtual
-)
+int wxCharCodeWXToOS2( int nId,
+ bool* bIsVirtual)
{
- int nKeySym = 0;
+ int nKeySym = 0;
- *bIsVirtual = TRUE;
+ *bIsVirtual = true;
switch (nId)
{
case WXK_CLEAR: nKeySym = VK_CLEAR; break;
case WXK_SCROLL: nKeySym = VK_SCRLLOCK; break;
default:
{
- *bIsVirtual = FALSE;
+ *bIsVirtual = false;
nKeySym = nId;
break;
}
short* WXUNUSED(pnX),
short* WXUNUSED(pnY) )
{
- HWND hWnd = GetHwndOf(pWin);
- HWND hWndUnderMouse;
- POINTL vPoint;
- BOOL rcEnabled = FALSE;
- BOOL rcVisible = FALSE;
+ HWND hWnd = GetHwndOf(pWin);
+ HWND hWndUnderMouse;
+ POINTL vPoint;
+ BOOL rcEnabled = FALSE;
+ BOOL rcVisible = FALSE;
::WinQueryPointerPos(HWND_DESKTOP, &vPoint);
hWndUnderMouse = ::WinWindowFromPoint(HWND_DESKTOP, &vPoint, TRUE);