// Returns the character byte at the position
int wxStyledTextCtrl::GetCharAt(int pos) {
- return SendMsg(2007, pos, 0);
+ return (unsigned char)SendMsg(2007, pos, 0);
}
// Returns the position of the caret
// Returns the style byte at the position
int wxStyledTextCtrl::GetStyleAt(int pos) {
- return SendMsg(2010, pos, 0);
+ return (unsigned char)SendMsg(2010, pos, 0);
}
// Redoes the next action on the undo history
// Find some text in the document.
int wxStyledTextCtrl::FindText(int minPos, int maxPos,
- const wxString& text,
- bool caseSensitive, bool wholeWord) {
+ const wxString& text,
+ int flags) {
TextToFind ft;
- int flags = 0;
-
- flags |= caseSensitive ? SCFIND_MATCHCASE : 0;
- flags |= wholeWord ? SCFIND_WHOLEWORD : 0;
ft.chrg.cpMin = minPos;
ft.chrg.cpMax = maxPos;
- ft.lpstrText = (char*)(const char*)wx2stc(text);
+ wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
+ ft.lpstrText = (char*)(const char*)buf;
return SendMsg(2150, flags, (long)&ft);
}
// Extend life of document.
void wxStyledTextCtrl::AddRefDocument(void* docPointer) {
- SendMsg(2376, (long)docPointer);
+ SendMsg(2376, 0, (long)docPointer);
}
// Release a reference to the document, deleting document if it fades to black.
void wxStyledTextCtrl::ReleaseDocument(void* docPointer) {
- SendMsg(2377, (long)docPointer);
+ SendMsg(2377, 0, (long)docPointer);
}
// Get which document modification events are sent to the container.
void wxStyledTextCtrl::OnSize(wxSizeEvent& evt) {
wxSize sz = GetClientSize();
m_swx->DoSize(sz.x, sz.y);
- Refresh(FALSE);
}
void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent& evt) {
+ SetFocus();
wxPoint pt = evt.GetPosition();
m_swx->DoButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(),
evt.ShiftDown(), evt.ControlDown(), evt.AltDown());
m_swx->DoMouseWheel(evt.GetWheelRotation(),
evt.GetWheelDelta(),
evt.GetLinesPerAction(),
- evt.ControlDown());
+ evt.ControlDown(),
+ evt.IsPageScroll());
}
bool alt = evt.AltDown();
bool skip = ((ctrl || alt) && ! (ctrl && alt));
- printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
- key, m_lastKeyDownConsumed, ctrl, alt, skip);
+// printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
+// key, m_lastKeyDownConsumed, ctrl, alt, skip);
if (key <= WXK_START && /*key >= 32 &&*/ !m_lastKeyDownConsumed && !skip) {
m_swx->DoAddChar(key);
int processed = m_swx->DoKeyDown(key, shift, ctrl, alt, &m_lastKeyDownConsumed);
- printf("KeyDn key:%d shift:%d ctrl:%d alt:%d processed:%d consumed:%d\n",
- key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
+// printf("KeyDn key:%d shift:%d ctrl:%d alt:%d processed:%d consumed:%d\n",
+// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
if (!processed && !m_lastKeyDownConsumed)
evt.Skip();
m_x = 0;
m_y = 0;
m_dragAllowMove = FALSE;
+#if wxUSE_DRAG_AND_DROP
m_dragResult = wxDragNone;
+#endif
}
bool wxStyledTextEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; }
m_dragText = event.m_dragText;
m_dragAllowMove =event.m_dragAllowMove;
+#if wxUSE_DRAG_AND_DROP
m_dragResult = event.m_dragResult;
+#endif
}
//----------------------------------------------------------------------