]> git.saurik.com Git - wxWidgets.git/blob - user/wxLayout/wxlwindow.cpp
f95b20eb45a791ca96280836374e9010a23595b8
[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 if(!IsEditable()) // do nothing
233 {
234 switch(keyCode)
235 {
236 case WXK_UP:
237 m_llist->MoveCursorVertically(-1);
238 break;
239 case WXK_DOWN:
240 m_llist->MoveCursorVertically(1);
241 break;
242 case WXK_PRIOR:
243 m_llist->MoveCursorVertically(-20);
244 break;
245 case WXK_NEXT:
246 m_llist->MoveCursorVertically(20);
247 break;
248 default:
249 ;
250 }
251 return;
252 }
253
254 /* First, handle control keys */
255 if(event.ControlDown() && ! event.AltDown())
256 {
257 switch(keyCode)
258 {
259 case WXK_DELETE :
260 case 'd':
261 m_llist->Delete(1);
262 break;
263 case 'y':
264 m_llist->DeleteLines(1);
265 break;
266 case 'h': // like backspace
267 if(m_llist->MoveCursorHorizontally(-1)) m_llist->Delete(1);
268 break;
269 case 'u':
270 m_llist->DeleteToBeginOfLine();
271 break;
272 case 'k':
273 m_llist->DeleteToEndOfLine();
274 break;
275 case 'v':
276 Paste();
277 break;
278 #ifdef WXLAYOUT_DEBUG
279 case WXK_F1:
280 m_llist->SetFont(-1,-1,-1,-1,true); // underlined
281 break;
282 #endif
283 default:
284 ;
285 }
286 }
287 // ALT only:
288 else if( event.AltDown() && ! event.ControlDown() )
289 {
290 switch(keyCode)
291 {
292 case WXK_DELETE:
293 case 'd':
294 m_llist->DeleteWord();
295 break;
296 default:
297 ;
298 }
299 }
300 // no control keys:
301 else if ( ! event.AltDown() && ! event.ControlDown())
302 {
303 switch(keyCode)
304 {
305 case WXK_RIGHT:
306 m_llist->MoveCursorHorizontally(1);
307 break;
308 case WXK_LEFT:
309 m_llist->MoveCursorHorizontally(-1);
310 break;
311 case WXK_UP:
312 m_llist->MoveCursorVertically(-1);
313 break;
314 case WXK_DOWN:
315 m_llist->MoveCursorVertically(1);
316 break;
317 case WXK_PRIOR:
318 m_llist->MoveCursorVertically(-20);
319 break;
320 case WXK_NEXT:
321 m_llist->MoveCursorVertically(20);
322 break;
323 case WXK_HOME:
324 m_llist->MoveCursorToBeginOfLine();
325 break;
326 case WXK_END:
327 m_llist->MoveCursorToEndOfLine();
328 break;
329 case WXK_INSERT:
330 if(event.ShiftDown())
331 Paste();
332 break;
333 case WXK_DELETE :
334 m_llist->Delete(1);
335 break;
336 case WXK_BACK: // backspace
337 if(m_llist->MoveCursorHorizontally(-1)) m_llist->Delete(1);
338 break;
339 case WXK_RETURN:
340 if(m_WrapMargin > 0)
341 m_llist->WrapLine(m_WrapMargin);
342 m_llist->LineBreak();
343 break;
344 default:
345 if((!(event.ControlDown() || event.AltDown() || event.MetaDown()))
346 && (keyCode < 256 && keyCode >= 32)
347 )
348 {
349 wxString tmp;
350 tmp += keyCode;
351 if(m_WrapMargin > 0 && isspace(keyCode))
352 m_llist->WrapLine(m_WrapMargin);
353 m_llist->Insert(tmp);
354 }
355 break;
356 }
357 }
358 SetDirty();
359 SetModified();
360 ScrollToCursor();
361 wxRect r = *m_llist->GetUpdateRect();
362 Refresh( FALSE, &r);
363 }
364
365 void
366 wxLayoutWindow::OnKeyUp(wxKeyEvent& event)
367 {
368 if(event.KeyCode() == WXK_SHIFT && m_llist->IsSelecting())
369 m_llist->EndSelection();
370 event.Skip();
371 }
372
373
374 void
375 wxLayoutWindow::ScrollToCursor(void)
376 {
377 wxClientDC dc( this );
378 PrepareDC( dc );
379
380 int x0,y0,x1,y1, dx, dy;
381
382 // Calculate where the top of the visible area is:
383 ViewStart(&x0,&y0);
384 GetScrollPixelsPerUnit(&dx, &dy);
385 x0 *= dx; y0 *= dy;
386
387 // Get the size of the visible window:
388 GetClientSize(&x1,&y1);
389 wxASSERT(x1 > 0);
390 wxASSERT(y1 > 0);
391 // As we have the values anyway, use them to avoid unnecessary
392 // scrollbar updates.
393 if(x1 > m_maxx) m_maxx = x1;
394 if(y1 > m_maxy) m_maxy = y1;
395 /* Make sure that the scrollbars are at a position so that the
396 cursor is visible if we are editing. */
397 /** Scroll so that cursor is visible! */
398 WXLO_DEBUG(("m_ScrollToCursor = %d", (int) m_ScrollToCursor));
399 wxPoint cc = m_llist->GetCursorScreenPos(*m_memDC);
400 if(cc.x < x0 || cc.y < y0
401 || cc.x >= x0+(9*x1)/10 || cc.y >= y0+(9*y1/10)) // (9*x)/10 == 90%
402 {
403 int nx, ny;
404 nx = cc.x - x1/2; if(nx < 0) nx = 0;
405 ny = cc.y - y1/2; if(ny < 0) ny = 0;
406 Scroll(nx/dx,ny/dy); // new view start
407 x0 = nx; y0 = ny;
408 m_ScrollToCursor = false; // avoid recursion
409 }
410 }
411
412 void
413 wxLayoutWindow::OnPaint( wxPaintEvent &WXUNUSED(event)) // or: OnDraw(wxDC& dc)
414 {
415 wxRect region = GetUpdateRegion().GetBox();
416 InternalPaint(& region);
417 }
418
419 void
420 wxLayoutWindow::DoPaint(const wxRect *updateRect)
421 {
422 #ifdef __WXGTK__
423 InternalPaint(updateRect);
424 #else
425 Refresh(FALSE, updateRect); // Causes bad flicker under wxGTK!!!
426 #endif
427 }
428
429 void
430 wxLayoutWindow::InternalPaint(const wxRect *updateRect)
431 {
432 wxPaintDC dc( this );
433 PrepareDC( dc );
434
435 int x0,y0,x1,y1, dx, dy;
436
437 // Calculate where the top of the visible area is:
438 ViewStart(&x0,&y0);
439 GetScrollPixelsPerUnit(&dx, &dy);
440 x0 *= dx; y0 *= dy;
441
442 // Get the size of the visible window:
443 GetClientSize(&x1,&y1);
444 wxASSERT(x1 > 0);
445 wxASSERT(y1 > 0);
446 // As we have the values anyway, use them to avoid unnecessary
447 // scrollbar updates.
448 if(x1 > m_maxx) m_maxx = x1;
449 if(y1 > m_maxy) m_maxy = y1;
450
451 WXLO_DEBUG(("Update rect: %ld,%ld / %ld,%ld",
452 updateRect->x, updateRect->y,
453 updateRect->x+updateRect->width,
454 updateRect->y+updateRect->height));
455
456 if(IsDirty())
457 ResizeScrollbars();
458
459 /* Check whether the window has grown, if so, we need to reallocate
460 the bitmap to be larger. */
461 if(x1 > m_bitmapSize.x || y1 > m_bitmapSize.y)
462 {
463 wxASSERT(m_bitmapSize.x > 0);
464 wxASSERT(m_bitmapSize.y > 0);
465
466 m_memDC->SelectObject(wxNullBitmap);
467 delete m_bitmap;
468 m_bitmapSize = wxPoint(x1,y1);
469 m_bitmap = new wxBitmap(x1,y1);
470 m_memDC->SelectObject(*m_bitmap);
471 }
472
473 m_memDC->SetDeviceOrigin(0,0);
474 m_memDC->SetBrush(wxBrush(m_llist->GetDefaults()->GetBGColour(),wxSOLID));
475 m_memDC->SetPen(wxPen(m_llist->GetDefaults()->GetBGColour(),
476 0,wxTRANSPARENT));
477 m_memDC->SetLogicalFunction(wxCOPY);
478
479 /* Either fill the background with the background bitmap, or clear
480 it. */
481 if(m_BGbitmap)
482 {
483 CoordType
484 y, x,
485 w = m_BGbitmap->GetWidth(),
486 h = m_BGbitmap->GetHeight();
487 for(y = 0; y < y1; y+=h)
488 for(x = 0; x < x1; x+=w)
489 m_memDC->DrawBitmap(*m_BGbitmap, x, y);
490 m_memDC->SetBackgroundMode(wxTRANSPARENT);
491 }
492 else
493 {
494 // clear the background: (must not be done if we use the update rectangle!)
495 m_memDC->SetBackgroundMode(wxSOLID);
496 m_memDC->DrawRectangle(0,0,x1, y1);
497 }
498
499
500 /* This is the important bit: we tell the list to draw itself: */
501 WXLO_DEBUG(("Update rect: %ld,%ld / %ld,%ld",
502 updateRect->x, updateRect->y,
503 updateRect->x+updateRect->width,
504 updateRect->y+updateRect->height));
505
506 // Device origins on the memDC are suspect, we translate manually
507 // with the translate parameter of Draw().
508 wxPoint offset(-x0+WXLO_XOFFSET,-y0+WXLO_YOFFSET);
509 m_llist->Draw(*m_memDC,offset, y0, y0+y1);
510
511 // We start calculating a new update rect before drawing the
512 // cursor, so that the cursor coordinates get included in the next
513 // update rectangle (although they are drawn on the memDC, this is
514 // needed to erase it):
515 m_llist->InvalidateUpdateRect();
516 if(IsEditable()) //we draw the cursor
517 m_llist->DrawCursor(*m_memDC,m_HaveFocus,offset);
518
519 // Now copy everything to the screen:
520 #if 0
521 // This somehow doesn't work, but even the following bit with the
522 // whole rect at once is still a bit broken I think.
523 wxRegionIterator ri ( GetUpdateRegion() );
524 if(ri)
525 while(ri)
526 {
527 WXLO_DEBUG(("UpdateRegion: %ld,%ld, %ld,%ld",
528 ri.GetX(),ri.GetY(),ri.GetW(),ri.GetH()));
529 dc.Blit(x0+ri.GetX(),y0+ri.GetY(),ri.GetW(),ri.GetH(),
530 m_memDC,ri.GetX(),ri.GetY(),wxCOPY,FALSE);
531 ri++;
532 }
533 else
534 #endif
535 {
536 // FIXME: Trying to copy only the changed parts, but it does not seem
537 // to work:
538 // x0 = updateRect->x; y0 = updateRect->y;
539 // if(updateRect->height < y1)
540 // y1 = updateRect->height;
541 // y1 += WXLO_YOFFSET; //FIXME might not be needed
542 dc.Blit(x0,y0,x1,y1,m_memDC,0,0,wxCOPY,FALSE);
543 }
544
545 ResetDirty();
546 m_ScrollToCursor = false;
547 }
548
549 // change the range and position of scrollbars
550 void
551 wxLayoutWindow::ResizeScrollbars(bool exact)
552 {
553 wxPoint max = m_llist->GetSize();
554
555 if(max.x > m_maxx || max.y > m_maxy
556 || max.x > m_maxx-WXLO_ROFFSET || max.y > m_maxy-WXLO_BOFFSET
557 || exact)
558 {
559 if(! exact)
560 {
561 // add an extra bit to the sizes to avoid future updates
562 max.x = max.x+WXLO_ROFFSET;
563 max.y = max.y+WXLO_BOFFSET;
564 }
565 ViewStart(&m_ViewStartX, &m_ViewStartY);
566 SetScrollbars(10, 20, max.x/10+1,max.y/20+1,m_ViewStartX,m_ViewStartY,true);
567 m_maxx = max.x; m_maxy = max.y;
568 }
569 }
570
571 void
572 wxLayoutWindow::Paste(void)
573 {
574 wxString text;
575 // Read some text
576 if (wxTheClipboard->Open())
577 {
578 wxTextDataObject data;
579 if (wxTheClipboard->IsSupported( data.GetFormat() ))
580 {
581 wxTheClipboard->GetData(&data);
582 text += data.GetText();
583 }
584 wxTheClipboard->Close();
585 }
586 #if 0
587 /* My attempt to get the primary selection, but it does not
588 work. :-( */
589 if(text.Length() == 0)
590 {
591 wxTextCtrl tmp_tctrl(this,-1);
592 tmp_tctrl.Paste();
593 text += tmp_tctrl.GetValue();
594 }
595 #endif
596 wxLayoutImportText( m_llist, text);
597 }
598
599 bool
600 wxLayoutWindow::Copy(void)
601 {
602 wxLayoutList *llist = m_llist->GetSelection();
603 if(! llist)
604 return FALSE;
605
606 wxString text;
607 wxLayoutExportObject *export;
608 wxLayoutExportStatus status(llist);
609 while((export = wxLayoutExport( &status, WXLO_EXPORT_AS_TEXT)) != NULL)
610 {
611 if(export->type == WXLO_EXPORT_TEXT)
612 text << *(export->content.text);
613 delete export;
614 }
615 delete llist;
616
617 // Read some text
618 if (wxTheClipboard->Open())
619 {
620 wxTextDataObject *data = new wxTextDataObject( text );
621 bool rc = wxTheClipboard->SetData( data );
622 wxTheClipboard->Close();
623 return rc;
624 }
625 return FALSE;
626 }
627
628 wxMenu *
629 wxLayoutWindow::MakeFormatMenu()
630 {
631 wxMenu *m = new wxMenu(_("Layout Menu"));
632
633 m->Append(WXLOWIN_MENU_LARGER ,_("&Larger"),_("Switch to larger font."), false);
634 m->Append(WXLOWIN_MENU_SMALLER ,_("&Smaller"),_("Switch to smaller font."), false);
635 m->AppendSeparator();
636 m->Append(WXLOWIN_MENU_UNDERLINE_ON, _("&Underline on"),_("Activate underline mode."), false);
637 m->Append(WXLOWIN_MENU_UNDERLINE_OFF,_("&Underline off"),_("Deactivate underline mode."), false);
638 m->Append(WXLOWIN_MENU_BOLD_ON ,_("&Bold on"),_("Activate bold mode."), false);
639 m->Append(WXLOWIN_MENU_BOLD_OFF ,_("&Bold off"),_("Deactivate bold mode."), false);
640 m->Append(WXLOWIN_MENU_ITALICS_ON ,_("&Italics on"),_("Activate italics mode."), false);
641 m->Append(WXLOWIN_MENU_ITALICS_OFF ,_("&Italics off"),_("Deactivate italics mode."), false);
642 m->AppendSeparator();
643 m->Append(WXLOWIN_MENU_ROMAN ,_("&Roman"),_("Switch to roman font."), false);
644 m->Append(WXLOWIN_MENU_TYPEWRITER,_("&Typewriter"),_("Switch to typewriter font."), false);
645 m->Append(WXLOWIN_MENU_SANSSERIF ,_("&Sans Serif"),_("Switch to sans serif font."), false);
646 return m;
647 }
648
649 void wxLayoutWindow::OnMenu(wxCommandEvent& event)
650 {
651 switch (event.GetId())
652 {
653 case WXLOWIN_MENU_LARGER:
654 m_llist->SetFontLarger(); break;
655 case WXLOWIN_MENU_SMALLER:
656 m_llist->SetFontSmaller(); break;
657 case WXLOWIN_MENU_UNDERLINE_ON:
658 m_llist->SetFontUnderline(true); break;
659 case WXLOWIN_MENU_UNDERLINE_OFF:
660 m_llist->SetFontUnderline(false); break;
661 case WXLOWIN_MENU_BOLD_ON:
662 m_llist->SetFontWeight(wxBOLD); break;
663 case WXLOWIN_MENU_BOLD_OFF:
664 m_llist->SetFontWeight(wxNORMAL); break;
665 case WXLOWIN_MENU_ITALICS_ON:
666 m_llist->SetFontStyle(wxITALIC); break;
667 case WXLOWIN_MENU_ITALICS_OFF:
668 m_llist->SetFontStyle(wxNORMAL); break;
669 case WXLOWIN_MENU_ROMAN:
670 m_llist->SetFontFamily(wxROMAN); break;
671 case WXLOWIN_MENU_TYPEWRITER:
672 m_llist->SetFontFamily(wxFIXED); break;
673 case WXLOWIN_MENU_SANSSERIF:
674 m_llist->SetFontFamily(wxSWISS); break;
675 }
676 }
677
678 void
679 wxLayoutWindow::OnSetFocus(wxFocusEvent &ev)
680 {
681 m_HaveFocus = true;
682 //FIXME DoPaint(); // to repaint the cursor
683 }
684
685 void
686 wxLayoutWindow::OnKillFocus(wxFocusEvent &ev)
687 {
688 m_HaveFocus = false;
689 //FIXME DoPaint(); // to repaint the cursor
690 }