+ if (m_bIsMLE)
+ ::WinSendMsg(GetHwnd(), MLM_SETBACKCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
+ return TRUE;
+} // end of wxTextCtrl::SetBackgroundColour
+
+bool wxTextCtrl::SetForegroundColour(
+ const wxColour& rColour
+)
+{
+ if (m_bIsMLE)
+ ::WinSendMsg(GetHwnd(), MLM_SETTEXTCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
+ return TRUE;
+} // end of wxTextCtrl::SetForegroundColour
+
+bool wxTextCtrl::SetStyle(
+ long lStart
+, long lEnd
+, const wxTextAttr& rStyle
+)
+{
+ HWND hWnd = GetHwnd();
+
+ if (lStart > lEnd)
+ {
+ long lTmp = lStart;
+
+ lStart = lEnd;
+ lEnd = lTmp;
+ }
+
+ //
+ // We can only change the format of the selection, so select the range we
+ // want and restore the old selection later
+ //
+ long lStartOld;
+ long lEndOld;
+
+ GetSelection( &lStartOld
+ ,&lEndOld
+ );
+
+ //
+ // But do we really have to change the selection?
+ //
+ bool bChangeSel = lStart != lStartOld ||
+ lEnd != lEndOld;
+
+ if (bChangeSel)
+ {
+ if (m_bIsMLE)
+ ::WinSendMsg(hWnd, MLM_SETSEL, MPFROM2SHORT((USHORT)lStart, (USHORT)lEnd), 0);
+ else
+ ::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lStart, (USHORT)lEnd), 0);
+ }
+
+ //
+ // TODO:: finish this part
+ //
+ return TRUE;
+} // end of wxTextCtrl::SetStyle