projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not emit a wxEVT_COMMAND_TEXT_UPDATED when the tab key is lifted (otherwise each...
[wxWidgets.git]
/
src
/
os2
/
textctrl.cpp
diff --git
a/src/os2/textctrl.cpp
b/src/os2/textctrl.cpp
index 0f801323ef68f160055151ee297fa7865de26428..be45467059a00b41b823ed7a70da71c3e598dbd6 100644
(file)
--- a/
src/os2/textctrl.cpp
+++ b/
src/os2/textctrl.cpp
@@
-101,9
+101,6
@@
bool wxTextCtrl::Create(
, const wxString& rsName
)
{
, const wxString& rsName
)
{
- HWND hParent;
- int nTempy;
-
//
// Base initialization
//
//
// Base initialization
//
@@
-115,7
+112,7
@@
bool wxTextCtrl::Create(
,rValidator
,rsName
))
,rValidator
,rsName
))
- return
FALSE
;
+ return
false
;
wxPoint vPos = rPos; // The OS/2 position
SWP vSwp;
wxPoint vPos = rPos; // The OS/2 position
SWP vSwp;
@@
-126,7
+123,7
@@
bool wxTextCtrl::Create(
}
m_windowStyle = lStyle;
}
m_windowStyle = lStyle;
- m_bIsMLE =
FALSE
;
+ m_bIsMLE =
false
;
long lSstyle = WS_VISIBLE | WS_TABSTOP;
long lSstyle = WS_VISIBLE | WS_TABSTOP;
@@
-136,7
+133,7
@@
bool wxTextCtrl::Create(
if ( m_windowStyle & wxTE_MULTILINE )
{
lSstyle |= MLS_BORDER | MLS_WORDWRAP;
if ( m_windowStyle & wxTE_MULTILINE )
{
lSstyle |= MLS_BORDER | MLS_WORDWRAP;
- m_bIsMLE =
TRUE
;
+ m_bIsMLE =
true
;
if ((m_windowStyle & wxTE_NO_VSCROLL) == 0)
lSstyle |= MLS_VSCROLL;
if ((m_windowStyle & wxTE_NO_VSCROLL) == 0)
lSstyle |= MLS_VSCROLL;
@@
-194,7
+191,7
@@
bool wxTextCtrl::Create(
if (m_hWnd == 0)
{
if (m_hWnd == 0)
{
- return
FALSE
;
+ return
false
;
}
SubclassWin(GetHWND());
}
SubclassWin(GetHWND());
@@
-208,7
+205,7
@@
bool wxTextCtrl::Create(
,wxNORMAL
);
SetFont(*pTextFont);
,wxNORMAL
);
SetFont(*pTextFont);
- if (!rsValue.
IsE
mpty())
+ if (!rsValue.
e
mpty())
{
SetValue(rsValue);
}
{
SetValue(rsValue);
}
@@
-226,7
+223,7
@@
bool wxTextCtrl::Create(
,rSize.y
);
delete pTextFont;
,rSize.y
);
delete pTextFont;
- return
TRUE
;
+ return
true
;
} // end of wxTextCtrl::Create
//
} // end of wxTextCtrl::Create
//
@@
-459,10
+456,10
@@
bool wxTextCtrl::CanCut() const
bool wxTextCtrl::CanPaste() const
{
bool wxTextCtrl::CanPaste() const
{
- bool bIsTextAvailable =
FALSE
;
+ bool bIsTextAvailable =
false
;
if (!IsEditable())
if (!IsEditable())
- return
FALSE
;
+ return
false
;
//
// Check for straight text on clipboard
//
// Check for straight text on clipboard
@@
-505,7
+502,7
@@
void wxTextCtrl::SetInsertionPoint(
void wxTextCtrl::SetInsertionPointEnd()
{
void wxTextCtrl::SetInsertionPointEnd()
{
-
long
lPos = GetLastPosition();
+
wxTextPos
lPos = GetLastPosition();
//
// We must not do anything if the caret is already there because calling
//
// We must not do anything if the caret is already there because calling
@@
-533,7
+530,7
@@
long wxTextCtrl::GetInsertionPoint() const
return (dwPos & 0xFFFF);
} // end of wxTextCtrl::GetInsertionPoint
return (dwPos & 0xFFFF);
} // end of wxTextCtrl::GetInsertionPoint
-
long
wxTextCtrl::GetLastPosition() const
+
wxTextPos
wxTextCtrl::GetLastPosition() const
{
HWND hWnd = GetHwnd();
long lCharIndex;
{
HWND hWnd = GetHwnd();
long lCharIndex;
@@
-607,8
+604,6
@@
void wxTextCtrl::Replace(
{
#if wxUSE_CLIPBOARD
HWND hWnd = GetHwnd();
{
#if wxUSE_CLIPBOARD
HWND hWnd = GetHwnd();
- long lFromChar = lFrom;
- long lToChar = lTo;
//
// Set selection and remove it
//
// Set selection and remove it
@@
-645,8
+640,6
@@
void wxTextCtrl::Remove(
)
{
HWND hWnd = GetHwnd();
)
{
HWND hWnd = GetHwnd();
- long lFromChar = lFrom;
- long lToChar = lTo;
if (m_bIsMLE)
{
if (m_bIsMLE)
{
@@
-670,7
+663,7
@@
void wxTextCtrl::SetSelection(
long lToChar = lTo;
//
long lToChar = lTo;
//
- // If from and to are both -1, it means (in wxWi
ndow
s) that all text should
+ // If from and to are both -1, it means (in wxWi
dget
s) that all text should
// be selected. Translate into Windows convention
//
if ((lFrom == -1L) && (lTo == -1L))
// be selected. Translate into Windows convention
//
if ((lFrom == -1L) && (lTo == -1L))
@@
-694,9
+687,9
@@
bool wxTextCtrl::LoadFile(
// Update the size limit if needed
//
AdjustSpaceLimit();
// Update the size limit if needed
//
AdjustSpaceLimit();
- return
TRUE
;
+ return
true
;
}
}
- return
FALSE
;
+ return
false
;
} // end of wxTextCtrl::LoadFile
bool wxTextCtrl::IsModified() const
} // end of wxTextCtrl::LoadFile
bool wxTextCtrl::IsModified() const
@@
-749,7
+742,6
@@
long wxTextCtrl::XYToPosition(
, long lY
) const
{
, long lY
) const
{
- HWND hWnd = GetHwnd();
long lCharIndex = 0L;
long lLen;
long lCharIndex = 0L;
long lLen;
@@
-781,7
+773,7
@@
bool wxTextCtrl::PositionToXY(
if (nLineNo == -1)
{
// no such line
if (nLineNo == -1)
{
// no such line
- return
FALSE
;
+ return
false
;
}
//
}
//
@@
-813,7
+805,7
@@
bool wxTextCtrl::PositionToXY(
if (lCharIndex == -1)
{
if (lCharIndex == -1)
{
- return
FALSE
;
+ return
false
;
}
//
}
//
@@
-824,7
+816,7
@@
bool wxTextCtrl::PositionToXY(
if (plY)
*plY = nLineNo;
if (plY)
*plY = nLineNo;
- return
TRUE
;
+ return
true
;
} // end of wxTextCtrl::PositionToXY
void wxTextCtrl::ShowPosition(
} // end of wxTextCtrl::PositionToXY
void wxTextCtrl::ShowPosition(
@@
-964,7
+956,7
@@
bool wxTextCtrl::CanUndo() const
if (m_bIsMLE)
bOk = (::WinSendMsg(GetHwnd(), MLM_QUERYUNDO, 0, 0) != 0);
else
if (m_bIsMLE)
bOk = (::WinSendMsg(GetHwnd(), MLM_QUERYUNDO, 0, 0) != 0);
else
- bOk =
FALSE
; // can't undo regular edit fields in PM
+ bOk =
false
; // can't undo regular edit fields in PM
return bOk;
} // end of wxTextCtrl::CanUndo
return bOk;
} // end of wxTextCtrl::CanUndo
@@
-975,7
+967,7
@@
bool wxTextCtrl::CanRedo() const
if (m_bIsMLE)
bOk = (::WinSendMsg(GetHwnd(), MLM_QUERYUNDO, 0, 0) != 0);
else
if (m_bIsMLE)
bOk = (::WinSendMsg(GetHwnd(), MLM_QUERYUNDO, 0, 0) != 0);
else
- bOk =
FALSE
; // can't undo regular edit fields in PM
+ bOk =
false
; // can't undo regular edit fields in PM
return bOk;
} // end of wxTextCtrl::CanRedo
return bOk;
} // end of wxTextCtrl::CanRedo
@@
-1012,7
+1004,6
@@
WXHBRUSH wxTextCtrl::OnCtlColor(
)
{
HPS hPS = (HPS)hWxDC;
)
{
HPS hPS = (HPS)hWxDC;
- wxBrush* pBrush = NULL;
wxColour vColBack = GetBackgroundColour();
wxColour vColFore = GetForegroundColour();
wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()
wxColour vColBack = GetBackgroundColour();
wxColour vColFore = GetForegroundColour();
wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()
@@
-1047,7
+1038,7
@@
void wxTextCtrl::OnChar(
wxKeyEvent& rEvent
)
{
wxKeyEvent& rEvent
)
{
- switch (rEvent.KeyCode())
+ switch (rEvent.
Get
KeyCode())
{
case WXK_RETURN:
if ( !(m_windowStyle & wxTE_MULTILINE) )
{
case WXK_RETURN:
if ( !(m_windowStyle & wxTE_MULTILINE) )
@@
-1074,7
+1065,7
@@
void wxTextCtrl::OnChar(
wxNavigationKeyEvent vEventNav;
vEventNav.SetDirection(!rEvent.ShiftDown());
wxNavigationKeyEvent vEventNav;
vEventNav.SetDirection(!rEvent.ShiftDown());
- vEventNav.SetWindowChange(
FALSE
);
+ vEventNav.SetWindowChange(
false
);
vEventNav.SetEventObject(this);
if ( GetEventHandler()->ProcessEvent(vEventNav) )
vEventNav.SetEventObject(this);
if ( GetEventHandler()->ProcessEvent(vEventNav) )
@@
-1112,7
+1103,6
@@
bool wxTextCtrl::OS2Command(
);
InitCommandEvent(vEvent);
);
InitCommandEvent(vEvent);
- vEvent.SetString((char*)GetValue().c_str());
ProcessCommand(vEvent);
}
break;
ProcessCommand(vEvent);
}
break;
@@
-1127,15
+1117,15
@@
bool wxTextCtrl::OS2Command(
case EN_SCROLL:
case EN_INSERTMODETOGGLE:
case EN_MEMERROR:
case EN_SCROLL:
case EN_INSERTMODETOGGLE:
case EN_MEMERROR:
- return
FALSE
;
+ return
false
;
default:
default:
- return
FALSE
;
+ return
false
;
}
//
// Processed
//
}
//
// Processed
//
- return
TRUE
;
+ return
true
;
} // end of wxTextCtrl::OS2Command
void wxTextCtrl::AdjustSpaceLimit()
} // end of wxTextCtrl::OS2Command
void wxTextCtrl::AdjustSpaceLimit()
@@
-1158,7
+1148,7
@@
void wxTextCtrl::AdjustSpaceLimit()
WNDPARAMS vParams;
vParams.fsStatus = WPM_CBCTLDATA;
WNDPARAMS vParams;
vParams.fsStatus = WPM_CBCTLDATA;
- vParams.pCtlData = &Efd;
+
vParams.pCtlData = &Efd;
vParams.cbCtlData = sizeof(ENTRYFDATA);
if (::WinSendMsg( GetHwnd()
vParams.cbCtlData = sizeof(ENTRYFDATA);
if (::WinSendMsg( GetHwnd()
@@
-1202,7
+1192,7
@@
wxSize wxTextCtrl::DoGetBestSize() const
wxGetCharSize(GetHWND(), &nCx, &nCy, (wxFont*)&GetFont());
int wText = DEFAULT_ITEM_WIDTH;
wxGetCharSize(GetHWND(), &nCx, &nCy, (wxFont*)&GetFont());
int wText = DEFAULT_ITEM_WIDTH;
- int hText = (EDIT_HEIGHT_FROM_CHAR_HEIGHT(nCy) * .8);
+ int hText = (
int)(
EDIT_HEIGHT_FROM_CHAR_HEIGHT(nCy) * .8);
if (m_windowStyle & wxTE_MULTILINE)
{
if (m_windowStyle & wxTE_MULTILINE)
{
@@
-1335,7
+1325,7
@@
bool wxTextCtrl::SetBackgroundColour(
{
if (m_bIsMLE)
::WinSendMsg(GetHwnd(), MLM_SETBACKCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
{
if (m_bIsMLE)
::WinSendMsg(GetHwnd(), MLM_SETBACKCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
- return
TRUE
;
+ return
true
;
} // end of wxTextCtrl::SetBackgroundColour
bool wxTextCtrl::SetForegroundColour(
} // end of wxTextCtrl::SetBackgroundColour
bool wxTextCtrl::SetForegroundColour(
@@
-1344,7
+1334,7
@@
bool wxTextCtrl::SetForegroundColour(
{
if (m_bIsMLE)
::WinSendMsg(GetHwnd(), MLM_SETTEXTCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
{
if (m_bIsMLE)
::WinSendMsg(GetHwnd(), MLM_SETTEXTCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
- return
TRUE
;
+ return
true
;
} // end of wxTextCtrl::SetForegroundColour
bool wxTextCtrl::SetStyle(
} // end of wxTextCtrl::SetForegroundColour
bool wxTextCtrl::SetStyle(
@@
-1391,6
+1381,6
@@
bool wxTextCtrl::SetStyle(
//
// TODO:: finish this part
//
//
// TODO:: finish this part
//
- return
TRUE
;
+ return
true
;
} // end of wxTextCtrl::SetStyle
} // end of wxTextCtrl::SetStyle