]> git.saurik.com Git - wxWidgets.git/blob - user/wxLayout/wxlwindow.cpp
8902e04eff69b9a5d8272c7aed41cfc2104d166a
[wxWidgets.git] / user / wxLayout / wxlwindow.cpp
1 /*-*- c++ -*-********************************************************
2 * wxLwindow.h : a scrolled Window for displaying/entering rich text*
3 * *
4 * (C) 1998, 1999 by Karsten Ballüder (Ballueder@usa.net) *
5 * *
6 * $Id$
7 *******************************************************************/
8
9 #ifdef __GNUG__
10 # pragma implementation "wxlwindow.h"
11 #endif
12
13 #include "wx/wxprec.h"
14 #ifdef __BORLANDC__
15 # pragma hdrstop
16 #endif
17
18
19 #include "Mpch.h"
20 #ifdef M_BASEDIR
21 # ifndef USE_PCH
22 # include "Mcommon.h"
23 # include "gui/wxMenuDefs.h"
24 # include "gui/wxMApp.h"
25 # endif // USE_PCH
26 # include "gui/wxlwindow.h"
27 # include "gui/wxlparser.h"
28 #else
29 # ifdef __WXMSW__
30 # include <windows.h>
31 # undef FindWindow
32 # undef GetCharWidth
33 # undef StartDoc
34 # endif
35
36 # include "wxlwindow.h"
37 # include "wxlparser.h"
38 #endif
39
40 #include <wx/clipbrd.h>
41 #include <wx/textctrl.h>
42 #include <wx/dataobj.h>
43
44 #include <ctype.h>
45
46 #ifdef WXLAYOUT_DEBUG
47 # define WXLO_DEBUG(x) wxLogDebug x
48 #else
49 # define WXLO_DEBUG(x)
50 #endif
51
52 /// offsets to put a nice frame around text
53 #define WXLO_XOFFSET 4
54 #define WXLO_YOFFSET 4
55
56 /// offset to the right and bottom for when to redraw scrollbars
57 #define WXLO_ROFFSET 20
58 #define WXLO_BOFFSET 20
59
60 BEGIN_EVENT_TABLE(wxLayoutWindow,wxScrolledWindow)
61 EVT_PAINT (wxLayoutWindow::OnPaint)
62 EVT_CHAR (wxLayoutWindow::OnChar)
63 EVT_KEY_UP (wxLayoutWindow::OnKeyUp)
64 EVT_LEFT_DOWN(wxLayoutWindow::OnLeftMouseClick)
65 EVT_RIGHT_DOWN(wxLayoutWindow::OnRightMouseClick)
66 EVT_LEFT_DCLICK(wxLayoutWindow::OnMouseDblClick)
67 EVT_MOTION (wxLayoutWindow::OnMouseMove)
68 EVT_MENU_RANGE(WXLOWIN_MENU_FIRST, WXLOWIN_MENU_LAST, wxLayoutWindow::OnMenu)
69 EVT_SET_FOCUS(wxLayoutWindow::OnSetFocus)
70 EVT_KILL_FOCUS(wxLayoutWindow::OnKillFocus)
71 END_EVENT_TABLE()
72
73 wxLayoutWindow::wxLayoutWindow(wxWindow *parent)
74 : wxScrolledWindow(parent, -1, wxDefaultPosition, wxDefaultSize,
75 wxHSCROLL | wxVSCROLL | wxBORDER)
76
77 {
78 m_Editable = false;
79 m_doSendEvents = false;
80 m_ViewStartX = 0; m_ViewStartY = 0;
81 m_DoPopupMenu = true;
82 m_PopupMenu = MakeFormatMenu();
83 m_memDC = new wxMemoryDC;
84 m_bitmap = new wxBitmap(4,4);
85 m_bitmapSize = wxPoint(4,4);
86 m_llist = new wxLayoutList();
87 m_BGbitmap = NULL;
88 m_ScrollToCursor = false;
89 SetWrapMargin(0);
90 wxPoint max = m_llist->GetSize();
91 SetScrollbars(10, 20 /*lineHeight*/, max.x/10+1, max.y/20+1);
92 EnableScrolling(true,true);
93 m_maxx = max.x; m_maxy = max.y;
94 m_Selecting = false;
95 SetCursor(wxCURSOR_IBEAM);
96 SetDirty();
97 }
98
99 wxLayoutWindow::~wxLayoutWindow()
100 {
101 delete m_memDC; // deletes bitmap automatically (?)
102 delete m_bitmap;
103 delete m_llist;
104 delete m_PopupMenu;
105 SetBackgroundBitmap(NULL);
106 }
107
108 #ifdef __WXMSW__
109 long
110 wxLayoutWindow::MSWGetDlgCode()
111 {
112 // if we don't return this, we won't get OnChar() events for TABs and ENTER
113 return DLGC_WANTCHARS | DLGC_WANTARROWS | DLGC_WANTMESSAGE;
114 }
115 #endif //MSW
116
117 void
118 wxLayoutWindow::OnMouse(int eventId, wxMouseEvent& event)
119 {
120 wxPaintDC dc( this );
121 PrepareDC( dc );
122 SetFocus();
123
124
125 wxPoint findPos;
126 findPos.x = dc.DeviceToLogicalX(event.GetX());
127 findPos.y = dc.DeviceToLogicalY(event.GetY());
128
129 findPos.x -= WXLO_XOFFSET;
130 findPos.y -= WXLO_YOFFSET;
131
132 if(findPos.x < 0) findPos.x = 0;
133 if(findPos.y < 0) findPos.y = 0;
134
135 m_ClickPosition = wxPoint(event.GetX(), event.GetY());
136
137 wxPoint cursorPos;
138 bool found;
139 wxLayoutObject *obj = m_llist->FindObjectScreen(dc, findPos,
140 &cursorPos, &found);
141
142 //has the mouse only been moved?
143 if(eventId == WXLOWIN_MENU_MOUSEMOVE)
144 {
145 // found is only true if we are really over an object, not just
146 // behind it
147 if(found && obj && obj->GetUserData() != NULL)
148 {
149 if(!m_HandCursor)
150 SetCursor(wxCURSOR_HAND);
151 m_HandCursor = TRUE;
152 }
153 else
154 {
155 if(m_HandCursor)
156 SetCursor(wxCURSOR_IBEAM);
157 m_HandCursor = FALSE;
158 }
159 return;
160 }
161
162 // always move cursor to mouse click:
163 if(obj && eventId == WXLOWIN_MENU_LCLICK)
164 {
165 m_llist->MoveCursorTo(cursorPos);
166 ScrollToCursor();
167 Refresh();
168 }
169 if(!m_doSendEvents) // nothing to do
170 return;
171
172 // only do the menu if activated, editable and not on a clickable object
173 if(eventId == WXLOWIN_MENU_RCLICK
174 && IsEditable()
175 && (! obj || (obj && obj->GetUserData() == NULL))
176 )
177 {
178 PopupMenu(m_PopupMenu, m_ClickPosition.x, m_ClickPosition.y);
179 return;
180 }
181 // find the object at this position
182 if(obj)
183 {
184 wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, eventId);
185 commandEvent.SetEventObject( this );
186 commandEvent.SetClientData((char *)obj);
187 GetEventHandler()->ProcessEvent(commandEvent);
188 }
189 }
190
191 /*
192 * Some simple keyboard handling.
193 */
194 void
195 wxLayoutWindow::OnChar(wxKeyEvent& event)
196 {
197 #ifdef WXLAYOUT_DEBUG
198 if(event.KeyCode() == WXK_F1)
199 {
200 m_llist->Debug();
201 return;
202 }
203 #endif
204
205 long keyCode = event.KeyCode();
206 if(m_Selecting && ! event.ShiftDown())
207 {
208 m_llist->EndSelection();
209 m_Selecting = false;
210 }
211 else
212 if(! m_Selecting && event.ShiftDown())
213 {
214 switch(keyCode)
215 {
216 case WXK_UP:
217 case WXK_DOWN:
218 case WXK_RIGHT:
219 case WXK_LEFT:
220 case WXK_PRIOR:
221 case WXK_NEXT:
222 case WXK_HOME:
223 case WXK_END:
224 m_Selecting = true;
225 m_llist->StartSelection();
226 break;
227 default:
228 ;
229 }
230 }
231
232 /* These two nested switches work like this:
233 The first one processes all non-editing keycodes, to move the
234 cursor, etc. It's default will process all keycodes causing
235 modifications to the buffer, but only if editing is allowed.
236 */
237 switch(keyCode)
238 {
239 case WXK_RIGHT:
240 m_llist->MoveCursorHorizontally(1);
241 break;
242 case WXK_LEFT:
243 m_llist->MoveCursorHorizontally(-1);
244 break;
245 case WXK_UP:
246 m_llist->MoveCursorVertically(-1);
247 break;
248 case WXK_DOWN:
249 m_llist->MoveCursorVertically(1);
250 break;
251 case WXK_PRIOR:
252 m_llist->MoveCursorVertically(-20);
253 break;
254 case WXK_NEXT:
255 m_llist->MoveCursorVertically(20);
256 break;
257 case WXK_HOME:
258 m_llist->MoveCursorToBeginOfLine();
259 break;
260 case WXK_END:
261 m_llist->MoveCursorToEndOfLine();
262 break;
263 default:
264 if(keyCode == 'c' && event.ControlDown())
265 Copy();
266 break;
267 if( IsEditable() )
268 {
269 /* First, handle control keys */
270 if(event.ControlDown() && ! event.AltDown())
271 {
272 switch(keyCode)
273 {
274 case WXK_DELETE :
275 case 'd':
276 m_llist->Delete(1);
277 break;
278 case 'y':
279 m_llist->DeleteLines(1);
280 break;
281 case 'h': // like backspace
282 if(m_llist->MoveCursorHorizontally(-1)) m_llist->Delete(1);
283 break;
284 case 'u':
285 m_llist->DeleteToBeginOfLine();
286 break;
287 case 'k':
288 m_llist->DeleteToEndOfLine();
289 break;
290 case 'v':
291 Paste();
292 break;
293 #ifdef WXLAYOUT_DEBUG
294 case WXK_F1:
295 m_llist->SetFont(-1,-1,-1,-1,true); // underlined
296 break;
297 #endif
298 default:
299 ;
300 }
301 }
302 // ALT only:
303 else if( event.AltDown() && ! event.ControlDown() )
304 {
305 switch(keyCode)
306 {
307 case WXK_DELETE:
308 case 'd':
309 m_llist->DeleteWord();
310 break;
311 default:
312 ;
313 }
314 }
315 // no control keys:
316 else if ( ! event.AltDown() && ! event.ControlDown())
317 {
318 switch(keyCode)
319 {
320 case WXK_INSERT:
321 if(event.ShiftDown())
322 Paste();
323 break;
324 case WXK_DELETE :
325 m_llist->Delete(1);
326 break;
327 case WXK_BACK: // backspace
328 if(m_llist->MoveCursorHorizontally(-1)) m_llist->Delete(1);
329 break;
330 case WXK_RETURN:
331 if(m_WrapMargin > 0)
332 m_llist->WrapLine(m_WrapMargin);
333 m_llist->LineBreak();
334 break;
335 default:
336 if((!(event.ControlDown() || event.AltDown() || event.MetaDown()))
337 && (keyCode < 256 && keyCode >= 32)
338 )
339 {
340 wxString tmp;
341 tmp += keyCode;
342 if(m_WrapMargin > 0 && isspace(keyCode))
343 m_llist->WrapLine(m_WrapMargin);
344 m_llist->Insert(tmp);
345 }
346 break;
347 }
348 }
349 SetDirty();
350 SetModified();
351 }// if(IsEditable())
352 }// first switch()
353 ScrollToCursor();
354 wxRect r = *m_llist->GetUpdateRect();
355 Refresh( FALSE, &r);
356 }
357
358 void
359 wxLayoutWindow::OnKeyUp(wxKeyEvent& event)
360 {
361 if(event.KeyCode() == WXK_SHIFT && m_llist->IsSelecting())
362 m_llist->EndSelection();
363 event.Skip();
364 }
365
366
367 void
368 wxLayoutWindow::ScrollToCursor(void)
369 {
370 wxClientDC dc( this );
371 PrepareDC( dc );
372
373 int x0,y0,x1,y1, dx, dy;
374
375 // Calculate where the top of the visible area is:
376 ViewStart(&x0,&y0);
377 GetScrollPixelsPerUnit(&dx, &dy);
378 x0 *= dx; y0 *= dy;
379
380 // Get the size of the visible window:
381 GetClientSize(&x1,&y1);
382 wxASSERT(x1 > 0);
383 wxASSERT(y1 > 0);
384 // As we have the values anyway, use them to avoid unnecessary
385 // scrollbar updates.
386 if(x1 > m_maxx) m_maxx = x1;
387 if(y1 > m_maxy) m_maxy = y1;
388 /* Make sure that the scrollbars are at a position so that the
389 cursor is visible if we are editing. */
390 /** Scroll so that cursor is visible! */
391 WXLO_DEBUG(("m_ScrollToCursor = %d", (int) m_ScrollToCursor));
392 wxPoint cc = m_llist->GetCursorScreenPos(*m_memDC);
393 if(cc.x < x0 || cc.y < y0
394 || cc.x >= x0+(9*x1)/10 || cc.y >= y0+(9*y1/10)) // (9*x)/10 == 90%
395 {
396 int nx, ny;
397 nx = cc.x - x1/2; if(nx < 0) nx = 0;
398 ny = cc.y - y1/2; if(ny < 0) ny = 0;
399 Scroll(nx/dx,ny/dy); // new view start
400 x0 = nx; y0 = ny;
401 m_ScrollToCursor = false; // avoid recursion
402 }
403 }
404
405 void
406 wxLayoutWindow::OnPaint( wxPaintEvent &WXUNUSED(event)) // or: OnDraw(wxDC& dc)
407 {
408 wxRect region = GetUpdateRegion().GetBox();
409 InternalPaint(& region);
410 }
411
412 void
413 wxLayoutWindow::DoPaint(const wxRect *updateRect)
414 {
415 #ifdef __WXGTK__
416 InternalPaint(updateRect);
417 #else
418 Refresh(FALSE, updateRect); // Causes bad flicker under wxGTK!!!
419 #endif
420 }
421
422 void
423 wxLayoutWindow::InternalPaint(const wxRect *updateRect)
424 {
425 wxPaintDC dc( this );
426 PrepareDC( dc );
427
428 int x0,y0,x1,y1, dx, dy;
429
430 // Calculate where the top of the visible area is:
431 ViewStart(&x0,&y0);
432 GetScrollPixelsPerUnit(&dx, &dy);
433 x0 *= dx; y0 *= dy;
434
435 // Get the size of the visible window:
436 GetClientSize(&x1,&y1);
437 wxASSERT(x1 > 0);
438 wxASSERT(y1 > 0);
439 // As we have the values anyway, use them to avoid unnecessary
440 // scrollbar updates.
441 if(x1 > m_maxx) m_maxx = x1;
442 if(y1 > m_maxy) m_maxy = y1;
443
444 WXLO_DEBUG(("Update rect: %ld,%ld / %ld,%ld",
445 updateRect->x, updateRect->y,
446 updateRect->x+updateRect->width,
447 updateRect->y+updateRect->height));
448
449 if(IsDirty())
450 ResizeScrollbars();
451
452 /* Check whether the window has grown, if so, we need to reallocate
453 the bitmap to be larger. */
454 if(x1 > m_bitmapSize.x || y1 > m_bitmapSize.y)
455 {
456 wxASSERT(m_bitmapSize.x > 0);
457 wxASSERT(m_bitmapSize.y > 0);
458
459 m_memDC->SelectObject(wxNullBitmap);
460 delete m_bitmap;
461 m_bitmapSize = wxPoint(x1,y1);
462 m_bitmap = new wxBitmap(x1,y1);
463 m_memDC->SelectObject(*m_bitmap);
464 }
465
466 m_memDC->SetDeviceOrigin(0,0);
467 m_memDC->SetBrush(wxBrush(m_llist->GetDefaults()->GetBGColour(),wxSOLID));
468 m_memDC->SetPen(wxPen(m_llist->GetDefaults()->GetBGColour(),
469 0,wxTRANSPARENT));
470 m_memDC->SetLogicalFunction(wxCOPY);
471
472 /* Either fill the background with the background bitmap, or clear
473 it. */
474 if(m_BGbitmap)
475 {
476 CoordType
477 y, x,
478 w = m_BGbitmap->GetWidth(),
479 h = m_BGbitmap->GetHeight();
480 for(y = 0; y < y1; y+=h)
481 for(x = 0; x < x1; x+=w)
482 m_memDC->DrawBitmap(*m_BGbitmap, x, y);
483 m_memDC->SetBackgroundMode(wxTRANSPARENT);
484 }
485 else
486 {
487 // clear the background: (must not be done if we use the update rectangle!)
488 m_memDC->SetBackgroundMode(wxSOLID);
489 m_memDC->DrawRectangle(0,0,x1, y1);
490 }
491
492
493 /* This is the important bit: we tell the list to draw itself: */
494 WXLO_DEBUG(("Update rect: %ld,%ld / %ld,%ld",
495 updateRect->x, updateRect->y,
496 updateRect->x+updateRect->width,
497 updateRect->y+updateRect->height));
498
499 // Device origins on the memDC are suspect, we translate manually
500 // with the translate parameter of Draw().
501 wxPoint offset(-x0+WXLO_XOFFSET,-y0+WXLO_YOFFSET);
502 m_llist->Draw(*m_memDC,offset, y0, y0+y1);
503
504 // We start calculating a new update rect before drawing the
505 // cursor, so that the cursor coordinates get included in the next
506 // update rectangle (although they are drawn on the memDC, this is
507 // needed to erase it):
508 m_llist->InvalidateUpdateRect();
509 m_llist->DrawCursor(*m_memDC,
510 m_HaveFocus && IsEditable(), // draw a thick
511 // cursor for editable windows with focus
512 offset);
513
514 // Now copy everything to the screen:
515 #if 0
516 // This somehow doesn't work, but even the following bit with the
517 // whole rect at once is still a bit broken I think.
518 wxRegionIterator ri ( GetUpdateRegion() );
519 if(ri)
520 while(ri)
521 {
522 WXLO_DEBUG(("UpdateRegion: %ld,%ld, %ld,%ld",
523 ri.GetX(),ri.GetY(),ri.GetW(),ri.GetH()));
524 dc.Blit(x0+ri.GetX(),y0+ri.GetY(),ri.GetW(),ri.GetH(),
525 m_memDC,ri.GetX(),ri.GetY(),wxCOPY,FALSE);
526 ri++;
527 }
528 else
529 #endif
530 {
531 // FIXME: Trying to copy only the changed parts, but it does not seem
532 // to work:
533 // x0 = updateRect->x; y0 = updateRect->y;
534 // if(updateRect->height < y1)
535 // y1 = updateRect->height;
536 // y1 += WXLO_YOFFSET; //FIXME might not be needed
537 dc.Blit(x0,y0,x1,y1,m_memDC,0,0,wxCOPY,FALSE);
538 }
539
540 ResetDirty();
541 m_ScrollToCursor = false;
542 }
543
544 // change the range and position of scrollbars
545 void
546 wxLayoutWindow::ResizeScrollbars(bool exact)
547 {
548 wxPoint max = m_llist->GetSize();
549
550 if(max.x > m_maxx || max.y > m_maxy
551 || max.x > m_maxx-WXLO_ROFFSET || max.y > m_maxy-WXLO_BOFFSET
552 || exact)
553 {
554 if(! exact)
555 {
556 // add an extra bit to the sizes to avoid future updates
557 max.x = max.x+WXLO_ROFFSET;
558 max.y = max.y+WXLO_BOFFSET;
559 }
560 ViewStart(&m_ViewStartX, &m_ViewStartY);
561 SetScrollbars(10, 20, max.x/10+1,max.y/20+1,m_ViewStartX,m_ViewStartY,true);
562 m_maxx = max.x; m_maxy = max.y;
563 }
564 }
565
566 void
567 wxLayoutWindow::Paste(void)
568 {
569 wxString text;
570 // Read some text
571 if (wxTheClipboard->Open())
572 {
573 wxTextDataObject data;
574 if (wxTheClipboard->IsSupported( data.GetFormat() ))
575 {
576 wxTheClipboard->GetData(&data);
577 text += data.GetText();
578 }
579 wxTheClipboard->Close();
580 }
581 #if 0
582 /* My attempt to get the primary selection, but it does not
583 work. :-( */
584 if(text.Length() == 0)
585 {
586 wxTextCtrl tmp_tctrl(this,-1);
587 tmp_tctrl.Paste();
588 text += tmp_tctrl.GetValue();
589 }
590 #endif
591 wxLayoutImportText( m_llist, text);
592 }
593
594 bool
595 wxLayoutWindow::Copy(void)
596 {
597 wxLayoutList *llist = m_llist->GetSelection();
598 if(! llist)
599 return FALSE;
600
601 wxString text;
602 wxLayoutExportObject *export;
603 wxLayoutExportStatus status(llist);
604 while((export = wxLayoutExport( &status, WXLO_EXPORT_AS_TEXT)) != NULL)
605 {
606 if(export->type == WXLO_EXPORT_TEXT)
607 text << *(export->content.text);
608 delete export;
609 }
610 delete llist;
611
612 // Read some text
613 if (wxTheClipboard->Open())
614 {
615 wxTextDataObject *data = new wxTextDataObject( text );
616 bool rc = wxTheClipboard->SetData( data );
617 wxTheClipboard->Close();
618 return rc;
619 }
620 return FALSE;
621 }
622
623 wxMenu *
624 wxLayoutWindow::MakeFormatMenu()
625 {
626 wxMenu *m = new wxMenu(_("Layout Menu"));
627
628 m->Append(WXLOWIN_MENU_LARGER ,_("&Larger"),_("Switch to larger font."), false);
629 m->Append(WXLOWIN_MENU_SMALLER ,_("&Smaller"),_("Switch to smaller font."), false);
630 m->AppendSeparator();
631 m->Append(WXLOWIN_MENU_UNDERLINE_ON, _("&Underline on"),_("Activate underline mode."), false);
632 m->Append(WXLOWIN_MENU_UNDERLINE_OFF,_("&Underline off"),_("Deactivate underline mode."), false);
633 m->Append(WXLOWIN_MENU_BOLD_ON ,_("&Bold on"),_("Activate bold mode."), false);
634 m->Append(WXLOWIN_MENU_BOLD_OFF ,_("&Bold off"),_("Deactivate bold mode."), false);
635 m->Append(WXLOWIN_MENU_ITALICS_ON ,_("&Italics on"),_("Activate italics mode."), false);
636 m->Append(WXLOWIN_MENU_ITALICS_OFF ,_("&Italics off"),_("Deactivate italics mode."), false);
637 m->AppendSeparator();
638 m->Append(WXLOWIN_MENU_ROMAN ,_("&Roman"),_("Switch to roman font."), false);
639 m->Append(WXLOWIN_MENU_TYPEWRITER,_("&Typewriter"),_("Switch to typewriter font."), false);
640 m->Append(WXLOWIN_MENU_SANSSERIF ,_("&Sans Serif"),_("Switch to sans serif font."), false);
641 return m;
642 }
643
644 void wxLayoutWindow::OnMenu(wxCommandEvent& event)
645 {
646 switch (event.GetId())
647 {
648 case WXLOWIN_MENU_LARGER:
649 m_llist->SetFontLarger(); break;
650 case WXLOWIN_MENU_SMALLER:
651 m_llist->SetFontSmaller(); break;
652 case WXLOWIN_MENU_UNDERLINE_ON:
653 m_llist->SetFontUnderline(true); break;
654 case WXLOWIN_MENU_UNDERLINE_OFF:
655 m_llist->SetFontUnderline(false); break;
656 case WXLOWIN_MENU_BOLD_ON:
657 m_llist->SetFontWeight(wxBOLD); break;
658 case WXLOWIN_MENU_BOLD_OFF:
659 m_llist->SetFontWeight(wxNORMAL); break;
660 case WXLOWIN_MENU_ITALICS_ON:
661 m_llist->SetFontStyle(wxITALIC); break;
662 case WXLOWIN_MENU_ITALICS_OFF:
663 m_llist->SetFontStyle(wxNORMAL); break;
664 case WXLOWIN_MENU_ROMAN:
665 m_llist->SetFontFamily(wxROMAN); break;
666 case WXLOWIN_MENU_TYPEWRITER:
667 m_llist->SetFontFamily(wxFIXED); break;
668 case WXLOWIN_MENU_SANSSERIF:
669 m_llist->SetFontFamily(wxSWISS); break;
670 }
671 }
672
673 void
674 wxLayoutWindow::OnSetFocus(wxFocusEvent &ev)
675 {
676 m_HaveFocus = true;
677 //FIXME DoPaint(); // to repaint the cursor
678 }
679
680 void
681 wxLayoutWindow::OnKillFocus(wxFocusEvent &ev)
682 {
683 m_HaveFocus = false;
684 //FIXME DoPaint(); // to repaint the cursor
685 }