]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/stc/ScintillaWX.cpp
added test for env var expansion
[wxWidgets.git] / contrib / src / stc / ScintillaWX.cpp
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.
8 //
9 // Author: Robin Dunn
10 //
11 // Created: 13-Jan-2000
12 // RCS-ID: $Id$
13 // Copyright: (c) 2000 by Total Control Software
14 // Licence: wxWindows license
15 /////////////////////////////////////////////////////////////////////////////
16
17
18 #include "ScintillaWX.h"
19 #include "wx/stc/stc.h"
20 #include "PlatWX.h"
21
22 //----------------------------------------------------------------------
23 // Helper classes
24
25 class wxSTCTimer : public wxTimer {
26 public:
27 wxSTCTimer(ScintillaWX* swx) {
28 this->swx = swx;
29 }
30
31 void Notify() {
32 swx->DoTick();
33 }
34
35 private:
36 ScintillaWX* swx;
37 };
38
39
40 #if wxUSE_DRAG_AND_DROP
41 bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
42 return swx->DoDropText(x, y, data);
43 }
44
45 wxDragResult wxSTCDropTarget::OnEnter(wxCoord x, wxCoord y, wxDragResult def) {
46 return swx->DoDragEnter(x, y, def);
47 }
48
49 wxDragResult wxSTCDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def) {
50 return swx->DoDragOver(x, y, def);
51 }
52
53 void wxSTCDropTarget::OnLeave() {
54 swx->DoDragLeave();
55 }
56 #endif
57
58
59 #ifdef __WXGTK__
60 #undef wxSTC_USE_POPUP
61 #define wxSTC_USE_POPUP 0
62 #endif
63
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
68 #else
69 #define wxSTCCallTipBase wxWindow
70 #define param2 -1 // wxWindows 2nd param is ID
71 #endif
72
73 class wxSTCCallTip : public wxSTCCallTipBase {
74 public:
75 wxSTCCallTip(wxWindow* parent, CallTip* ct)
76 : wxSTCCallTipBase(parent, param2)
77 {
78 m_ct = ct;
79 }
80
81 ~wxSTCCallTip() {
82 if (HasCapture()) ReleaseMouse();
83 }
84
85 void OnPaint(wxPaintEvent& evt) {
86 wxPaintDC dc(this);
87 Surface* surfaceWindow = Surface::Allocate();
88 surfaceWindow->Init(&dc);
89 m_ct->PaintCT(surfaceWindow);
90 delete surfaceWindow;
91 }
92
93 void OnFocus(wxFocusEvent& event) {
94 GetParent()->SetFocus();
95 event.Skip();
96 }
97
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) {
102 if (x != -1)
103 GetParent()->ClientToScreen(&x, NULL);
104 if (y != -1)
105 GetParent()->ClientToScreen(NULL, &y);
106 wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags);
107 }
108
109 virtual bool Show( bool show = TRUE ) {
110 bool retval = wxSTCCallTipBase::Show(show);
111 if (show)
112 CaptureMouse();
113 else
114 if (HasCapture()) ReleaseMouse();
115 return retval;
116 }
117
118 void OnLeftDown(wxMouseEvent& ) {
119 Show(FALSE);
120 }
121 #endif
122
123 private:
124 CallTip* m_ct;
125 DECLARE_EVENT_TABLE()
126 };
127
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)
133 #endif
134 END_EVENT_TABLE()
135
136
137 //----------------------------------------------------------------------
138 // Constructor/Destructor
139
140
141 ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) {
142 capturedMouse = false;
143 wMain = win;
144 stc = win;
145 wheelRotation = 0;
146 Initialise();
147 }
148
149
150 ScintillaWX::~ScintillaWX() {
151 SetTicking(false);
152 }
153
154 //----------------------------------------------------------------------
155 // base class virtuals
156
157
158 void ScintillaWX::Initialise() {
159 //ScintillaBase::Initialise();
160 #if wxUSE_DRAG_AND_DROP
161 dropTarget = new wxSTCDropTarget;
162 dropTarget->SetScintilla(this);
163 stc->SetDropTarget(dropTarget);
164 #endif
165 }
166
167
168 void ScintillaWX::Finalise() {
169 ScintillaBase::Finalise();
170 }
171
172
173 void ScintillaWX::StartDrag() {
174 #if wxUSE_DRAG_AND_DROP
175 wxString dragText = stc2wx(drag.s, drag.len);
176
177 // Send an event to allow the drag text to be changed
178 wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
179 evt.SetEventObject(stc);
180 evt.SetDragText(dragText);
181 evt.SetDragAllowMove(TRUE);
182 evt.SetPosition(wxMin(stc->GetSelectionStart(),
183 stc->GetSelectionEnd()));
184 stc->GetEventHandler()->ProcessEvent(evt);
185 dragText = evt.GetDragText();
186
187 if (dragText.Length()) {
188 wxDropSource source(stc);
189 wxTextDataObject data(dragText);
190 wxDragResult result;
191
192 source.SetData(data);
193 dropWentOutside = TRUE;
194 result = source.DoDragDrop(evt.GetDragAllowMove());
195 if (result == wxDragMove && dropWentOutside)
196 ClearSelection();
197 inDragDrop = FALSE;
198 SetDragPosition(invalidPosition);
199 }
200 #endif
201 }
202
203
204 void ScintillaWX::SetTicking(bool on) {
205 wxSTCTimer* steTimer;
206 if (timer.ticking != on) {
207 timer.ticking = on;
208 if (timer.ticking) {
209 steTimer = new wxSTCTimer(this);
210 steTimer->Start(timer.tickSize);
211 timer.tickerID = steTimer;
212 } else {
213 steTimer = (wxSTCTimer*)timer.tickerID;
214 steTimer->Stop();
215 delete steTimer;
216 timer.tickerID = 0;
217 }
218 }
219 timer.ticksToWait = caret.period;
220 }
221
222
223 void ScintillaWX::SetMouseCapture(bool on) {
224 if (on && !capturedMouse)
225 stc->CaptureMouse();
226 else if (!on && capturedMouse)
227 stc->ReleaseMouse();
228 capturedMouse = on;
229 }
230
231
232 bool ScintillaWX::HaveMouseCapture() {
233 return capturedMouse;
234 }
235
236
237 void ScintillaWX::ScrollText(int linesToMove) {
238 int dy = vs.lineHeight * (linesToMove);
239 stc->ScrollWindow(0, dy);
240 stc->Update();
241 }
242
243 void ScintillaWX::SetVerticalScrollPos() {
244 if (stc->m_vScrollBar == NULL) { // Use built-in scrollbar
245 stc->SetScrollPos(wxVERTICAL, topLine);
246 }
247 else { // otherwise use the one that's been given to us
248 stc->m_vScrollBar->SetThumbPosition(topLine);
249 }
250 }
251
252 void ScintillaWX::SetHorizontalScrollPos() {
253 if (stc->m_hScrollBar == NULL) { // Use built-in scrollbar
254 stc->SetScrollPos(wxHORIZONTAL, xOffset);
255 }
256 else { // otherwise use the one that's been given to us
257 stc->m_hScrollBar->SetThumbPosition(xOffset);
258 }
259 }
260
261 const int H_SCROLL_STEP = 20;
262
263 bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
264 bool modified = false;
265
266 // Check the vertical scrollbar
267 if (stc->m_vScrollBar == NULL) { // Use built-in scrollbar
268 int sbMax = stc->GetScrollRange(wxVERTICAL);
269 int sbThumb = stc->GetScrollThumb(wxVERTICAL);
270 int sbPos = stc->GetScrollPos(wxVERTICAL);
271 if (sbMax != nMax || sbThumb != nPage) {
272 stc->SetScrollbar(wxVERTICAL, sbPos, nPage, nMax+1);
273 modified = true;
274 }
275 }
276 else { // otherwise use the one that's been given to us
277 int sbMax = stc->m_vScrollBar->GetRange();
278 int sbPage = stc->m_vScrollBar->GetPageSize();
279 int sbPos = stc->m_vScrollBar->GetThumbPosition();
280 if (sbMax != nMax || sbPage != nPage) {
281 stc->m_vScrollBar->SetScrollbar(sbPos, nPage, nMax+1, nPage);
282 modified = true;
283 }
284 }
285
286
287 // Check the horizontal scrollbar
288 PRectangle rcText = GetTextRectangle();
289 int horizEnd = scrollWidth;
290 if (horizEnd < 0)
291 horizEnd = 0;
292 if (!horizontalScrollBarVisible || (wrapState != eWrapNone))
293 horizEnd = 0;
294 int pageWidth = rcText.Width();
295
296 if (stc->m_hScrollBar == NULL) { // Use built-in scrollbar
297 int sbMax = stc->GetScrollRange(wxHORIZONTAL);
298 int sbThumb = stc->GetScrollThumb(wxHORIZONTAL);
299 int sbPos = stc->GetScrollPos(wxHORIZONTAL);
300 if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) {
301 stc->SetScrollbar(wxHORIZONTAL, 0, pageWidth, horizEnd);
302 modified = true;
303 if (scrollWidth < pageWidth) {
304 HorizontalScrollTo(0);
305 }
306 }
307 }
308 else { // otherwise use the one that's been given to us
309 int sbMax = stc->m_hScrollBar->GetRange();
310 int sbThumb = stc->m_hScrollBar->GetPageSize();
311 int sbPos = stc->m_hScrollBar->GetThumbPosition();
312 if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) {
313 stc->m_hScrollBar->SetScrollbar(0, pageWidth, horizEnd, pageWidth);
314 modified = true;
315 if (scrollWidth < pageWidth) {
316 HorizontalScrollTo(0);
317 }
318 }
319 }
320
321 return modified;
322 }
323
324
325 void ScintillaWX::NotifyChange() {
326 stc->NotifyChange();
327 }
328
329
330 void ScintillaWX::NotifyParent(SCNotification scn) {
331 stc->NotifyParent(&scn);
332 }
333
334
335
336 void ScintillaWX::Copy() {
337 if (currentPos != anchor) {
338 SelectionText st;
339 CopySelectionRange(&st);
340 if (wxTheClipboard->Open()) {
341 wxTheClipboard->UsePrimarySelection();
342 wxString text = stc2wx(st.s, st.len);
343 wxTheClipboard->SetData(new wxTextDataObject(text));
344 wxTheClipboard->Close();
345 }
346 }
347 }
348
349
350 void ScintillaWX::Paste() {
351 pdoc->BeginUndoAction();
352 ClearSelection();
353
354 wxTextDataObject data;
355 bool gotData = FALSE;
356
357 if (wxTheClipboard->Open()) {
358 wxTheClipboard->UsePrimarySelection();
359 gotData = wxTheClipboard->GetData(data);
360 wxTheClipboard->Close();
361 }
362 if (gotData) {
363 wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(data.GetText());
364 int len = strlen(buf);
365 pdoc->InsertString(currentPos, buf, len);
366 SetEmptySelection(currentPos + len);
367 }
368
369 pdoc->EndUndoAction();
370 NotifyChange();
371 Redraw();
372 }
373
374
375 bool ScintillaWX::CanPaste() {
376 bool canPaste = FALSE;
377 bool didOpen;
378
379 if ( (didOpen = !wxTheClipboard->IsOpened()) )
380 wxTheClipboard->Open();
381
382 if (wxTheClipboard->IsOpened()) {
383 wxTheClipboard->UsePrimarySelection();
384 canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
385 if (didOpen)
386 wxTheClipboard->Close();
387 }
388 return canPaste;
389 }
390
391 void ScintillaWX::CreateCallTipWindow(PRectangle) {
392 ct.wCallTip = new wxSTCCallTip(stc, &ct);
393 ct.wDraw = ct.wCallTip;
394 }
395
396
397 void ScintillaWX::AddToPopUp(const char *label, int cmd, bool enabled) {
398 if (!label[0])
399 ((wxMenu*)popup.GetID())->AppendSeparator();
400 else
401 ((wxMenu*)popup.GetID())->Append(cmd, stc2wx(label));
402
403 if (!enabled)
404 ((wxMenu*)popup.GetID())->Enable(cmd, enabled);
405 }
406
407
408 void ScintillaWX::ClaimSelection() {
409
410 }
411
412
413 long ScintillaWX::DefWndProc(unsigned int /*iMessage*/, unsigned long /*wParam*/, long /*lParam*/) {
414 return 0;
415 }
416
417 long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) {
418 // switch (iMessage) {
419 // case EM_CANPASTE:
420 // return CanPaste();
421 // default:
422 return ScintillaBase::WndProc(iMessage, wParam, lParam);
423 // }
424 // return 0;
425 }
426
427
428
429 //----------------------------------------------------------------------
430 // Event delegates
431
432 void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
433
434 paintState = painting;
435 Surface* surfaceWindow = Surface::Allocate();
436 surfaceWindow->Init(dc);
437 PRectangle rcPaint = PRectangleFromwxRect(rect);
438 dc->BeginDrawing();
439 Paint(surfaceWindow, rcPaint);
440 dc->EndDrawing();
441 delete surfaceWindow;
442 if (paintState == paintAbandoned) {
443 // Painting area was insufficient to cover new styling or brace highlight positions
444 FullPaint();
445 }
446 paintState = notPainting;
447 #ifdef __WXGTK__
448 // On wxGTK the editor window paints can overwrite the listbox...
449 if (ac.Active())
450 ((wxWindow*)ac.lb.GetID())->Refresh(TRUE);
451 #endif
452 }
453
454
455 void ScintillaWX::DoHScroll(int type, int pos) {
456 int xPos = xOffset;
457 PRectangle rcText = GetTextRectangle();
458 int pageWidth = rcText.Width() * 2 / 3;
459 if (type == wxEVT_SCROLLWIN_LINEUP || type == wxEVT_SCROLL_LINEUP)
460 xPos -= H_SCROLL_STEP;
461 else if (type == wxEVT_SCROLLWIN_LINEDOWN || type == wxEVT_SCROLL_LINEDOWN)
462 xPos += H_SCROLL_STEP;
463 else if (type == wxEVT_SCROLLWIN_PAGEUP || type == wxEVT_SCROLL_PAGEUP)
464 xPos -= pageWidth;
465 else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN) {
466 xPos += pageWidth;
467 if (xPos > scrollWidth - rcText.Width()) {
468 xPos = scrollWidth - rcText.Width();
469 }
470 }
471 else if (type == wxEVT_SCROLLWIN_TOP || type == wxEVT_SCROLL_TOP)
472 xPos = 0;
473 else if (type == wxEVT_SCROLLWIN_BOTTOM || type == wxEVT_SCROLL_BOTTOM)
474 xPos = scrollWidth;
475 else if (type == wxEVT_SCROLLWIN_THUMBTRACK || type == wxEVT_SCROLL_THUMBTRACK)
476 xPos = pos;
477
478 HorizontalScrollTo(xPos);
479 }
480
481 void ScintillaWX::DoVScroll(int type, int pos) {
482 int topLineNew = topLine;
483 if (type == wxEVT_SCROLLWIN_LINEUP || type == wxEVT_SCROLL_LINEUP)
484 topLineNew -= 1;
485 else if (type == wxEVT_SCROLLWIN_LINEDOWN || type == wxEVT_SCROLL_LINEDOWN)
486 topLineNew += 1;
487 else if (type == wxEVT_SCROLLWIN_PAGEUP || type == wxEVT_SCROLL_PAGEUP)
488 topLineNew -= LinesToScroll();
489 else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN)
490 topLineNew += LinesToScroll();
491 else if (type == wxEVT_SCROLLWIN_TOP || type == wxEVT_SCROLL_TOP)
492 topLineNew = 0;
493 else if (type == wxEVT_SCROLLWIN_BOTTOM || type == wxEVT_SCROLL_BOTTOM)
494 topLineNew = MaxScrollPos();
495 else if (type == wxEVT_SCROLLWIN_THUMBTRACK || type == wxEVT_SCROLL_THUMBTRACK)
496 topLineNew = pos;
497
498 ScrollTo(topLineNew);
499 }
500
501 void ScintillaWX::DoMouseWheel(int rotation, int delta,
502 int linesPerAction, int ctrlDown,
503 bool isPageScroll ) {
504 int topLineNew = topLine;
505 int lines;
506
507 if (ctrlDown) { // Zoom the fonts if Ctrl key down
508 if (rotation < 0) {
509 KeyCommand(SCI_ZOOMIN);
510 }
511 else {
512 KeyCommand(SCI_ZOOMOUT);
513 }
514 }
515 else { // otherwise just scroll the window
516 wheelRotation += rotation;
517 lines = wheelRotation / delta;
518 wheelRotation -= lines * delta;
519 if (lines != 0) {
520 if (isPageScroll)
521 lines = lines * LinesOnScreen(); // lines is either +1 or -1
522 else
523 lines *= linesPerAction;
524 topLineNew -= lines;
525 ScrollTo(topLineNew);
526 }
527 }
528 }
529
530
531 void ScintillaWX::DoSize(int width, int height) {
532 // PRectangle rcClient(0,0,width,height);
533 // SetScrollBarsTo(rcClient);
534 // DropGraphics();
535 ChangeSize();
536 }
537
538 void ScintillaWX::DoLoseFocus(){
539 SetFocusState(false);
540 }
541
542 void ScintillaWX::DoGainFocus(){
543 SetFocusState(true);
544 }
545
546 void ScintillaWX::DoSysColourChange() {
547 InvalidateStyleData();
548 }
549
550 void ScintillaWX::DoButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
551 ButtonDown(pt, curTime, shift, ctrl, alt);
552 }
553
554 void ScintillaWX::DoButtonUp(Point pt, unsigned int curTime, bool ctrl) {
555 ButtonUp(pt, curTime, ctrl);
556 }
557
558 void ScintillaWX::DoButtonMove(Point pt) {
559 ButtonMove(pt);
560 }
561
562
563 void ScintillaWX::DoAddChar(int key) {
564 AddChar(key);
565 }
566
567 int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed) {
568 #if defined(__WXGTK__) || defined(__WXMAC__)
569 // Ctrl chars (A-Z) end up with the wrong keycode on wxGTK...
570 if (ctrl && key >= 1 && key <= 26)
571 key += 'A' - 1;
572 #endif
573
574 switch (key) {
575 case WXK_DOWN: key = SCK_DOWN; break;
576 case WXK_UP: key = SCK_UP; break;
577 case WXK_LEFT: key = SCK_LEFT; break;
578 case WXK_RIGHT: key = SCK_RIGHT; break;
579 case WXK_HOME: key = SCK_HOME; break;
580 case WXK_END: key = SCK_END; break;
581 case WXK_PRIOR: key = SCK_PRIOR; break;
582 case WXK_NEXT: key = SCK_NEXT; break;
583 case WXK_DELETE: key = SCK_DELETE; break;
584 case WXK_INSERT: key = SCK_INSERT; break;
585 case WXK_ESCAPE: key = SCK_ESCAPE; break;
586 case WXK_BACK: key = SCK_BACK; break;
587 case WXK_TAB: key = SCK_TAB; break;
588 case WXK_RETURN: key = SCK_RETURN; break;
589 case WXK_ADD: // fall through
590 case WXK_NUMPAD_ADD: key = SCK_ADD; break;
591 case WXK_SUBTRACT: // fall through
592 case WXK_NUMPAD_SUBTRACT: key = SCK_SUBTRACT; break;
593 case WXK_DIVIDE: // fall through
594 case WXK_NUMPAD_DIVIDE: key = SCK_DIVIDE; break;
595 case WXK_CONTROL: key = 0; break;
596 case WXK_ALT: key = 0; break;
597 case WXK_SHIFT: key = 0; break;
598 case WXK_MENU: key = 0; break;
599 }
600
601 int rv = KeyDown(key, shift, ctrl, alt, consumed);
602
603 if (key)
604 return rv;
605 else
606 return 1;
607 }
608
609
610 void ScintillaWX::DoCommand(int ID) {
611 Command(ID);
612 }
613
614
615 void ScintillaWX::DoContextMenu(Point pt) {
616 if (displayPopupMenu)
617 ContextMenu(pt);
618 }
619
620 void ScintillaWX::DoOnListBox() {
621 AutoCompleteCompleted();
622 }
623
624 //----------------------------------------------------------------------
625
626 #if wxUSE_DRAG_AND_DROP
627 bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
628 SetDragPosition(invalidPosition);
629
630 // Send an event to allow the drag details to be changed
631 wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
632 evt.SetEventObject(stc);
633 evt.SetDragResult(dragResult);
634 evt.SetX(x);
635 evt.SetY(y);
636 evt.SetPosition(PositionFromLocation(Point(x,y)));
637 evt.SetDragText(data);
638 stc->GetEventHandler()->ProcessEvent(evt);
639
640 dragResult = evt.GetDragResult();
641 if (dragResult == wxDragMove || dragResult == wxDragCopy) {
642 DropAt(evt.GetPosition(),
643 wx2stc(evt.GetDragText()),
644 dragResult == wxDragMove,
645 FALSE); // TODO: rectangular?
646 return TRUE;
647 }
648 return FALSE;
649 }
650
651
652 wxDragResult ScintillaWX::DoDragEnter(wxCoord x, wxCoord y, wxDragResult def) {
653 dragResult = def;
654 return dragResult;
655 }
656
657
658 wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
659 SetDragPosition(PositionFromLocation(Point(x, y)));
660
661 // Send an event to allow the drag result to be changed
662 wxStyledTextEvent evt(wxEVT_STC_DRAG_OVER, stc->GetId());
663 evt.SetEventObject(stc);
664 evt.SetDragResult(def);
665 evt.SetX(x);
666 evt.SetY(y);
667 evt.SetPosition(PositionFromLocation(Point(x,y)));
668 stc->GetEventHandler()->ProcessEvent(evt);
669
670 dragResult = evt.GetDragResult();
671 return dragResult;
672 }
673
674
675 void ScintillaWX::DoDragLeave() {
676 SetDragPosition(invalidPosition);
677 }
678 #endif
679 //----------------------------------------------------------------------
680
681 // Redraw all of text area. This paint will not be abandoned.
682 void ScintillaWX::FullPaint() {
683 paintState = painting;
684 rcPaint = GetTextRectangle();
685 paintingAllText = true;
686 wxClientDC dc(stc);
687 Surface* surfaceWindow = Surface::Allocate();
688 surfaceWindow->Init(&dc);
689 Paint(surfaceWindow, rcPaint);
690 delete surfaceWindow;
691
692 // stc->Refresh(FALSE);
693
694 paintState = notPainting;
695 }
696
697
698 void ScintillaWX::DoScrollToLine(int line) {
699 ScrollTo(line);
700 }
701
702
703 void ScintillaWX::DoScrollToColumn(int column) {
704 HorizontalScrollTo(column * vs.spaceWidth);
705 }
706
707
708
709 //----------------------------------------------------------------------
710 //----------------------------------------------------------------------