1 ////////////////////////////////////////////////////////////////////////////
2 // Name: ScintillaWX.cxx
3 // Purpose: A wxWindows implementation of Scintilla. A class derived
4 // from ScintillaBase that uses the "wx platform" defined in
5 // PlatformWX.cxx This class is one end of a bridge between
6 // the wx world and the Scintilla world. It needs a peer
7 // object of type wxStyledTextCtrl to function.
11 // Created: 13-Jan-2000
13 // Copyright: (c) 2000 by Total Control Software
14 // Licence: wxWindows license
15 /////////////////////////////////////////////////////////////////////////////
18 #include "ScintillaWX.h"
19 #include "wx/stc/stc.h"
22 //----------------------------------------------------------------------
25 class wxSTCTimer
: public wxTimer
{
27 wxSTCTimer(ScintillaWX
* swx
) {
40 #if wxUSE_DRAG_AND_DROP
41 bool wxSTCDropTarget::OnDropText(wxCoord x
, wxCoord y
, const wxString
& data
) {
42 return swx
->DoDropText(x
, y
, data
);
45 wxDragResult
wxSTCDropTarget::OnEnter(wxCoord x
, wxCoord y
, wxDragResult def
) {
46 return swx
->DoDragEnter(x
, y
, def
);
49 wxDragResult
wxSTCDropTarget::OnDragOver(wxCoord x
, wxCoord y
, wxDragResult def
) {
50 return swx
->DoDragOver(x
, y
, def
);
53 void wxSTCDropTarget::OnLeave() {
60 #undef wxSTC_USE_POPUP
61 #define wxSTC_USE_POPUP 0
64 #if wxUSE_POPUPWIN && wxSTC_USE_POPUP
65 #include <wx/popupwin.h>
66 #define wxSTCCallTipBase wxPopupWindow
67 #define param2 wxBORDER_NONE // popup's 2nd param is flags
69 #define wxSTCCallTipBase wxWindow
70 #define param2 -1 // wxWindows 2nd param is ID
73 class wxSTCCallTip
: public wxSTCCallTipBase
{
75 wxSTCCallTip(wxWindow
* parent
, CallTip
* ct
)
76 : wxSTCCallTipBase(parent
, param2
)
82 if (HasCapture()) ReleaseMouse();
85 void OnPaint(wxPaintEvent
& evt
) {
87 Surface
* surfaceWindow
= Surface::Allocate();
88 surfaceWindow
->Init(&dc
);
89 m_ct
->PaintCT(surfaceWindow
);
93 void OnFocus(wxFocusEvent
& event
) {
94 GetParent()->SetFocus();
98 #if wxUSE_POPUPWIN && wxSTC_USE_POPUP
99 virtual void DoSetSize(int x
, int y
,
100 int width
, int height
,
101 int sizeFlags
= wxSIZE_AUTO
) {
103 GetParent()->ClientToScreen(&x
, NULL
);
105 GetParent()->ClientToScreen(NULL
, &y
);
106 wxSTCCallTipBase::DoSetSize(x
, y
, width
, height
, sizeFlags
);
109 virtual bool Show( bool show
= TRUE
) {
110 bool retval
= wxSTCCallTipBase::Show(show
);
114 if (HasCapture()) ReleaseMouse();
118 void OnLeftDown(wxMouseEvent
& ) {
125 DECLARE_EVENT_TABLE()
128 BEGIN_EVENT_TABLE(wxSTCCallTip
, wxSTCCallTipBase
)
129 EVT_PAINT(wxSTCCallTip::OnPaint
)
130 EVT_SET_FOCUS(wxSTCCallTip::OnFocus
)
131 #if wxUSE_POPUPWIN && wxSTC_USE_POPUP
132 EVT_LEFT_DOWN(wxSTCCallTip::OnLeftDown
)
137 //----------------------------------------------------------------------
138 // Constructor/Destructor
141 ScintillaWX::ScintillaWX(wxStyledTextCtrl
* win
) {
149 ScintillaWX::~ScintillaWX() {
153 //----------------------------------------------------------------------
154 // base class virtuals
157 void ScintillaWX::Initialise() {
158 //ScintillaBase::Initialise();
159 #if wxUSE_DRAG_AND_DROP
160 dropTarget
= new wxSTCDropTarget
;
161 dropTarget
->SetScintilla(this);
162 stc
->SetDropTarget(dropTarget
);
167 void ScintillaWX::Finalise() {
168 ScintillaBase::Finalise();
172 void ScintillaWX::StartDrag() {
173 #if wxUSE_DRAG_AND_DROP
174 wxString dragText
= stc2wx(drag
.s
, drag
.len
);
176 // Send an event to allow the drag text to be changed
177 wxStyledTextEvent
evt(wxEVT_STC_START_DRAG
, stc
->GetId());
178 evt
.SetEventObject(stc
);
179 evt
.SetDragText(dragText
);
180 evt
.SetDragAllowMove(TRUE
);
181 evt
.SetPosition(wxMin(stc
->GetSelectionStart(),
182 stc
->GetSelectionEnd()));
183 stc
->GetEventHandler()->ProcessEvent(evt
);
184 dragText
= evt
.GetDragText();
186 if (dragText
.Length()) {
187 wxDropSource
source(stc
);
188 wxTextDataObject
data(dragText
);
191 source
.SetData(data
);
192 dropWentOutside
= TRUE
;
193 result
= source
.DoDragDrop(evt
.GetDragAllowMove());
194 if (result
== wxDragMove
&& dropWentOutside
)
197 SetDragPosition(invalidPosition
);
203 void ScintillaWX::SetTicking(bool on
) {
204 wxSTCTimer
* steTimer
;
205 if (timer
.ticking
!= on
) {
208 steTimer
= new wxSTCTimer(this);
209 steTimer
->Start(timer
.tickSize
);
210 timer
.tickerID
= steTimer
;
212 steTimer
= (wxSTCTimer
*)timer
.tickerID
;
218 timer
.ticksToWait
= caret
.period
;
222 void ScintillaWX::SetMouseCapture(bool on
) {
223 if (on
&& !stc
->HasCapture())
225 else if (!on
&& stc
->HasCapture())
230 bool ScintillaWX::HaveMouseCapture() {
231 return stc
->HasCapture();
235 void ScintillaWX::ScrollText(int linesToMove
) {
236 int dy
= vs
.lineHeight
* (linesToMove
);
237 stc
->ScrollWindow(0, dy
);
241 void ScintillaWX::SetVerticalScrollPos() {
242 if (stc
->m_vScrollBar
== NULL
) { // Use built-in scrollbar
243 stc
->SetScrollPos(wxVERTICAL
, topLine
);
245 else { // otherwise use the one that's been given to us
246 stc
->m_vScrollBar
->SetThumbPosition(topLine
);
250 void ScintillaWX::SetHorizontalScrollPos() {
251 if (stc
->m_hScrollBar
== NULL
) { // Use built-in scrollbar
252 stc
->SetScrollPos(wxHORIZONTAL
, xOffset
);
254 else { // otherwise use the one that's been given to us
255 stc
->m_hScrollBar
->SetThumbPosition(xOffset
);
259 const int H_SCROLL_STEP
= 20;
261 bool ScintillaWX::ModifyScrollBars(int nMax
, int nPage
) {
262 bool modified
= false;
264 // Check the vertical scrollbar
265 if (stc
->m_vScrollBar
== NULL
) { // Use built-in scrollbar
266 int sbMax
= stc
->GetScrollRange(wxVERTICAL
);
267 int sbThumb
= stc
->GetScrollThumb(wxVERTICAL
);
268 int sbPos
= stc
->GetScrollPos(wxVERTICAL
);
269 if (sbMax
!= nMax
|| sbThumb
!= nPage
) {
270 stc
->SetScrollbar(wxVERTICAL
, sbPos
, nPage
, nMax
+1);
274 else { // otherwise use the one that's been given to us
275 int sbMax
= stc
->m_vScrollBar
->GetRange();
276 int sbPage
= stc
->m_vScrollBar
->GetPageSize();
277 int sbPos
= stc
->m_vScrollBar
->GetThumbPosition();
278 if (sbMax
!= nMax
|| sbPage
!= nPage
) {
279 stc
->m_vScrollBar
->SetScrollbar(sbPos
, nPage
, nMax
+1, nPage
);
285 // Check the horizontal scrollbar
286 PRectangle rcText
= GetTextRectangle();
287 int horizEnd
= scrollWidth
;
290 if (!horizontalScrollBarVisible
|| (wrapState
!= eWrapNone
))
292 int pageWidth
= rcText
.Width();
294 if (stc
->m_hScrollBar
== NULL
) { // Use built-in scrollbar
295 int sbMax
= stc
->GetScrollRange(wxHORIZONTAL
);
296 int sbThumb
= stc
->GetScrollThumb(wxHORIZONTAL
);
297 int sbPos
= stc
->GetScrollPos(wxHORIZONTAL
);
298 if ((sbMax
!= horizEnd
) || (sbThumb
!= pageWidth
) || (sbPos
!= 0)) {
299 stc
->SetScrollbar(wxHORIZONTAL
, 0, pageWidth
, horizEnd
);
301 if (scrollWidth
< pageWidth
) {
302 HorizontalScrollTo(0);
306 else { // otherwise use the one that's been given to us
307 int sbMax
= stc
->m_hScrollBar
->GetRange();
308 int sbThumb
= stc
->m_hScrollBar
->GetPageSize();
309 int sbPos
= stc
->m_hScrollBar
->GetThumbPosition();
310 if ((sbMax
!= horizEnd
) || (sbThumb
!= pageWidth
) || (sbPos
!= 0)) {
311 stc
->m_hScrollBar
->SetScrollbar(0, pageWidth
, horizEnd
, pageWidth
);
313 if (scrollWidth
< pageWidth
) {
314 HorizontalScrollTo(0);
323 void ScintillaWX::NotifyChange() {
328 void ScintillaWX::NotifyParent(SCNotification scn
) {
329 stc
->NotifyParent(&scn
);
334 void ScintillaWX::Copy() {
335 if (currentPos
!= anchor
) {
337 CopySelectionRange(&st
);
338 if (wxTheClipboard
->Open()) {
339 wxTheClipboard
->UsePrimarySelection(FALSE
);
340 wxString text
= stc2wx(st
.s
, st
.len
);
341 wxTheClipboard
->SetData(new wxTextDataObject(text
));
342 wxTheClipboard
->Close();
348 void ScintillaWX::Paste() {
349 pdoc
->BeginUndoAction();
352 wxTextDataObject data
;
353 bool gotData
= FALSE
;
355 if (wxTheClipboard
->Open()) {
356 wxTheClipboard
->UsePrimarySelection(FALSE
);
357 gotData
= wxTheClipboard
->GetData(data
);
358 wxTheClipboard
->Close();
361 wxWX2MBbuf buf
= (wxWX2MBbuf
)wx2stc(data
.GetText());
362 int len
= strlen(buf
);
363 pdoc
->InsertString(currentPos
, buf
, len
);
364 SetEmptySelection(currentPos
+ len
);
367 pdoc
->EndUndoAction();
373 bool ScintillaWX::CanPaste() {
374 bool canPaste
= FALSE
;
377 if ( (didOpen
= !wxTheClipboard
->IsOpened()) )
378 wxTheClipboard
->Open();
380 if (wxTheClipboard
->IsOpened()) {
381 wxTheClipboard
->UsePrimarySelection(FALSE
);
382 canPaste
= wxTheClipboard
->IsSupported(wxUSE_UNICODE
? wxDF_UNICODETEXT
: wxDF_TEXT
);
384 wxTheClipboard
->Close();
389 void ScintillaWX::CreateCallTipWindow(PRectangle
) {
390 ct
.wCallTip
= new wxSTCCallTip(stc
, &ct
);
391 ct
.wDraw
= ct
.wCallTip
;
395 void ScintillaWX::AddToPopUp(const char *label
, int cmd
, bool enabled
) {
397 ((wxMenu
*)popup
.GetID())->AppendSeparator();
399 ((wxMenu
*)popup
.GetID())->Append(cmd
, stc2wx(label
));
402 ((wxMenu
*)popup
.GetID())->Enable(cmd
, enabled
);
406 // This is called by the Editor base class whenever something is selected
407 void ScintillaWX::ClaimSelection() {
409 // Put the selected text in the PRIMARY selection
410 if (currentPos
!= anchor
) {
412 CopySelectionRange(&st
);
413 if (wxTheClipboard
->Open()) {
414 wxTheClipboard
->UsePrimarySelection(TRUE
);
415 wxString text
= stc2wx(st
.s
, st
.len
);
416 wxTheClipboard
->SetData(new wxTextDataObject(text
));
417 wxTheClipboard
->UsePrimarySelection(FALSE
);
418 wxTheClipboard
->Close();
425 long ScintillaWX::DefWndProc(unsigned int /*iMessage*/, unsigned long /*wParam*/, long /*lParam*/) {
429 long ScintillaWX::WndProc(unsigned int iMessage
, unsigned long wParam
, long lParam
) {
431 case SCI_CALLTIPSHOW
: {
432 // NOTE: This is copied here from scintilla/src/ScintillaBase.cxx
433 // because of the little tweak that needs done below. When updating
434 // new versions double check that this is still needed, and that any
435 // new code there is copied here too.
436 AutoCompleteCancel();
437 if (!ct
.wCallTip
.Created()) {
438 Point pt
= LocationFromPosition(wParam
);
439 pt
.y
+= vs
.lineHeight
;
440 PRectangle rc
= ct
.CallTipStart(currentPos
, pt
,
441 reinterpret_cast<char *>(lParam
),
442 vs
.styles
[STYLE_DEFAULT
].fontName
,
443 vs
.styles
[STYLE_DEFAULT
].sizeZoomed
,
445 // If the call-tip window would be out of the client
446 // space, adjust so it displays above the text.
447 PRectangle rcClient
= GetClientRectangle();
448 if (rc
.bottom
> rcClient
.bottom
) {
450 int offset
= int(vs
.lineHeight
* 1.25) + rc
.Height();
452 int offset
= vs
.lineHeight
+ rc
.Height();
457 // Now display the window.
458 CreateCallTipWindow(rc
);
459 ct
.wCallTip
.SetPositionRelative(rc
, wMain
);
466 return ScintillaBase::WndProc(iMessage
, wParam
, lParam
);
473 //----------------------------------------------------------------------
476 void ScintillaWX::DoPaint(wxDC
* dc
, wxRect rect
) {
478 paintState
= painting
;
479 Surface
* surfaceWindow
= Surface::Allocate();
480 surfaceWindow
->Init(dc
);
481 PRectangle rcPaint
= PRectangleFromwxRect(rect
);
483 Paint(surfaceWindow
, rcPaint
);
485 delete surfaceWindow
;
486 if (paintState
== paintAbandoned
) {
487 // Painting area was insufficient to cover new styling or brace highlight positions
490 paintState
= notPainting
;
492 // On wxGTK the editor window paints can overwrite the listbox...
494 ((wxWindow
*)ac
.lb
.GetID())->Refresh(TRUE
);
499 void ScintillaWX::DoHScroll(int type
, int pos
) {
501 PRectangle rcText
= GetTextRectangle();
502 int pageWidth
= rcText
.Width() * 2 / 3;
503 if (type
== wxEVT_SCROLLWIN_LINEUP
|| type
== wxEVT_SCROLL_LINEUP
)
504 xPos
-= H_SCROLL_STEP
;
505 else if (type
== wxEVT_SCROLLWIN_LINEDOWN
|| type
== wxEVT_SCROLL_LINEDOWN
)
506 xPos
+= H_SCROLL_STEP
;
507 else if (type
== wxEVT_SCROLLWIN_PAGEUP
|| type
== wxEVT_SCROLL_PAGEUP
)
509 else if (type
== wxEVT_SCROLLWIN_PAGEDOWN
|| type
== wxEVT_SCROLL_PAGEDOWN
) {
511 if (xPos
> scrollWidth
- rcText
.Width()) {
512 xPos
= scrollWidth
- rcText
.Width();
515 else if (type
== wxEVT_SCROLLWIN_TOP
|| type
== wxEVT_SCROLL_TOP
)
517 else if (type
== wxEVT_SCROLLWIN_BOTTOM
|| type
== wxEVT_SCROLL_BOTTOM
)
519 else if (type
== wxEVT_SCROLLWIN_THUMBTRACK
|| type
== wxEVT_SCROLL_THUMBTRACK
)
522 HorizontalScrollTo(xPos
);
525 void ScintillaWX::DoVScroll(int type
, int pos
) {
526 int topLineNew
= topLine
;
527 if (type
== wxEVT_SCROLLWIN_LINEUP
|| type
== wxEVT_SCROLL_LINEUP
)
529 else if (type
== wxEVT_SCROLLWIN_LINEDOWN
|| type
== wxEVT_SCROLL_LINEDOWN
)
531 else if (type
== wxEVT_SCROLLWIN_PAGEUP
|| type
== wxEVT_SCROLL_PAGEUP
)
532 topLineNew
-= LinesToScroll();
533 else if (type
== wxEVT_SCROLLWIN_PAGEDOWN
|| type
== wxEVT_SCROLL_PAGEDOWN
)
534 topLineNew
+= LinesToScroll();
535 else if (type
== wxEVT_SCROLLWIN_TOP
|| type
== wxEVT_SCROLL_TOP
)
537 else if (type
== wxEVT_SCROLLWIN_BOTTOM
|| type
== wxEVT_SCROLL_BOTTOM
)
538 topLineNew
= MaxScrollPos();
539 else if (type
== wxEVT_SCROLLWIN_THUMBTRACK
|| type
== wxEVT_SCROLL_THUMBTRACK
)
542 ScrollTo(topLineNew
);
545 void ScintillaWX::DoMouseWheel(int rotation
, int delta
,
546 int linesPerAction
, int ctrlDown
,
547 bool isPageScroll
) {
548 int topLineNew
= topLine
;
551 if (ctrlDown
) { // Zoom the fonts if Ctrl key down
553 KeyCommand(SCI_ZOOMIN
);
556 KeyCommand(SCI_ZOOMOUT
);
559 else { // otherwise just scroll the window
562 wheelRotation
+= rotation
;
563 lines
= wheelRotation
/ delta
;
564 wheelRotation
-= lines
* delta
;
567 lines
= lines
* LinesOnScreen(); // lines is either +1 or -1
569 lines
*= linesPerAction
;
571 ScrollTo(topLineNew
);
577 void ScintillaWX::DoSize(int width
, int height
) {
578 // PRectangle rcClient(0,0,width,height);
579 // SetScrollBarsTo(rcClient);
584 void ScintillaWX::DoLoseFocus(){
585 SetFocusState(false);
588 void ScintillaWX::DoGainFocus(){
592 void ScintillaWX::DoSysColourChange() {
593 InvalidateStyleData();
596 void ScintillaWX::DoLeftButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
) {
597 ButtonDown(pt
, curTime
, shift
, ctrl
, alt
);
600 void ScintillaWX::DoLeftButtonUp(Point pt
, unsigned int curTime
, bool ctrl
) {
601 ButtonUp(pt
, curTime
, ctrl
);
604 void ScintillaWX::DoLeftButtonMove(Point pt
) {
608 void ScintillaWX::DoMiddleButtonUp(Point pt
) {
610 // Set the current position to the mouse click point and
611 // then paste in the PRIMARY selection, if any. wxGTK only.
612 int newPos
= PositionFromLocation(pt
);
613 MovePositionTo(newPos
, 0, 1);
615 pdoc
->BeginUndoAction();
616 wxTextDataObject data
;
617 bool gotData
= FALSE
;
618 if (wxTheClipboard
->Open()) {
619 wxTheClipboard
->UsePrimarySelection(TRUE
);
620 gotData
= wxTheClipboard
->GetData(data
);
621 wxTheClipboard
->UsePrimarySelection(FALSE
);
622 wxTheClipboard
->Close();
625 wxWX2MBbuf buf
= (wxWX2MBbuf
)wx2stc(data
.GetText());
626 int len
= strlen(buf
);
627 pdoc
->InsertString(currentPos
, buf
, len
);
628 SetEmptySelection(currentPos
+ len
);
630 pdoc
->EndUndoAction();
634 ShowCaretAtCurrentPosition();
635 EnsureCaretVisible();
640 void ScintillaWX::DoAddChar(int key
) {
645 wxWX2MBbuf buf
= (wxWX2MBbuf
)wx2stc(wszChars
);
646 AddCharUTF((char*)buf
.data(), strlen(buf
));
653 int ScintillaWX::DoKeyDown(int key
, bool shift
, bool ctrl
, bool alt
, bool* consumed
) {
654 #if defined(__WXGTK__) || defined(__WXMAC__)
655 // Ctrl chars (A-Z) end up with the wrong keycode on wxGTK...
656 if (ctrl
&& key
>= 1 && key
<= 26)
661 case WXK_DOWN
: key
= SCK_DOWN
; break;
662 case WXK_UP
: key
= SCK_UP
; break;
663 case WXK_LEFT
: key
= SCK_LEFT
; break;
664 case WXK_RIGHT
: key
= SCK_RIGHT
; break;
665 case WXK_HOME
: key
= SCK_HOME
; break;
666 case WXK_END
: key
= SCK_END
; break;
667 case WXK_PRIOR
: key
= SCK_PRIOR
; break;
668 case WXK_NEXT
: key
= SCK_NEXT
; break;
669 case WXK_DELETE
: key
= SCK_DELETE
; break;
670 case WXK_INSERT
: key
= SCK_INSERT
; break;
671 case WXK_ESCAPE
: key
= SCK_ESCAPE
; break;
672 case WXK_BACK
: key
= SCK_BACK
; break;
673 case WXK_TAB
: key
= SCK_TAB
; break;
674 case WXK_RETURN
: key
= SCK_RETURN
; break;
675 case WXK_ADD
: // fall through
676 case WXK_NUMPAD_ADD
: key
= SCK_ADD
; break;
677 case WXK_SUBTRACT
: // fall through
678 case WXK_NUMPAD_SUBTRACT
: key
= SCK_SUBTRACT
; break;
679 case WXK_DIVIDE
: // fall through
680 case WXK_NUMPAD_DIVIDE
: key
= SCK_DIVIDE
; break;
681 case WXK_CONTROL
: key
= 0; break;
682 case WXK_ALT
: key
= 0; break;
683 case WXK_SHIFT
: key
= 0; break;
684 case WXK_MENU
: key
= 0; break;
687 int rv
= KeyDown(key
, shift
, ctrl
, alt
, consumed
);
696 void ScintillaWX::DoCommand(int ID
) {
701 void ScintillaWX::DoContextMenu(Point pt
) {
702 if (displayPopupMenu
)
706 void ScintillaWX::DoOnListBox() {
707 AutoCompleteCompleted();
710 //----------------------------------------------------------------------
712 #if wxUSE_DRAG_AND_DROP
713 bool ScintillaWX::DoDropText(long x
, long y
, const wxString
& data
) {
714 SetDragPosition(invalidPosition
);
716 // Send an event to allow the drag details to be changed
717 wxStyledTextEvent
evt(wxEVT_STC_DO_DROP
, stc
->GetId());
718 evt
.SetEventObject(stc
);
719 evt
.SetDragResult(dragResult
);
722 evt
.SetPosition(PositionFromLocation(Point(x
,y
)));
723 evt
.SetDragText(data
);
724 stc
->GetEventHandler()->ProcessEvent(evt
);
726 dragResult
= evt
.GetDragResult();
727 if (dragResult
== wxDragMove
|| dragResult
== wxDragCopy
) {
728 DropAt(evt
.GetPosition(),
729 wx2stc(evt
.GetDragText()),
730 dragResult
== wxDragMove
,
731 FALSE
); // TODO: rectangular?
738 wxDragResult
ScintillaWX::DoDragEnter(wxCoord x
, wxCoord y
, wxDragResult def
) {
744 wxDragResult
ScintillaWX::DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
) {
745 SetDragPosition(PositionFromLocation(Point(x
, y
)));
747 // Send an event to allow the drag result to be changed
748 wxStyledTextEvent
evt(wxEVT_STC_DRAG_OVER
, stc
->GetId());
749 evt
.SetEventObject(stc
);
750 evt
.SetDragResult(def
);
753 evt
.SetPosition(PositionFromLocation(Point(x
,y
)));
754 stc
->GetEventHandler()->ProcessEvent(evt
);
756 dragResult
= evt
.GetDragResult();
761 void ScintillaWX::DoDragLeave() {
762 SetDragPosition(invalidPosition
);
765 //----------------------------------------------------------------------
767 // Redraw all of text area. This paint will not be abandoned.
768 void ScintillaWX::FullPaint() {
769 paintState
= painting
;
770 rcPaint
= GetTextRectangle();
771 paintingAllText
= true;
773 Surface
* surfaceWindow
= Surface::Allocate();
774 surfaceWindow
->Init(&dc
);
775 Paint(surfaceWindow
, rcPaint
);
776 delete surfaceWindow
;
778 // stc->Refresh(FALSE);
780 paintState
= notPainting
;
784 void ScintillaWX::DoScrollToLine(int line
) {
789 void ScintillaWX::DoScrollToColumn(int column
) {
790 HorizontalScrollTo(column
* vs
.spaceWidth
);
795 //----------------------------------------------------------------------
796 //----------------------------------------------------------------------