1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of various window classes
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/menuitem.h>
19 #include <wx/tooltip.h>
22 //----------------------------------------------------------------------
25 %include my_typemaps.i
27 // Import some definitions of other classes, etc.
33 %pragma(python) code = "import wx"
36 //----------------------------------------------------------------------
39 // Put some wx default wxChar* values into wxStrings.
40 DECLARE_DEF_STRING(PanelNameStr);
41 static const wxString wxPyEmptyString(wxT(""));
44 //---------------------------------------------------------------------------
46 class wxEvtHandler : public wxObject {
50 bool ProcessEvent(wxEvent& event);
51 void AddPendingEvent(wxEvent& event);
52 //bool SearchEventTable(wxEventTable& table, wxEvent& event);
54 bool GetEvtHandlerEnabled();
55 void SetEvtHandlerEnabled(bool enabled);
57 wxEvtHandler* GetNextHandler();
58 wxEvtHandler* GetPreviousHandler();
59 void SetNextHandler(wxEvtHandler* handler);
60 void SetPreviousHandler(wxEvtHandler* handler);
64 void Connect( int id, int lastId, int eventType, PyObject* func) {
65 if (PyCallable_Check(func)) {
66 self->Connect(id, lastId, eventType,
67 (wxObjectEventFunction) &wxPyCallback::EventThunker,
68 new wxPyCallback(func));
70 else if (func == Py_None) {
71 self->Disconnect(id, lastId, eventType,
72 (wxObjectEventFunction)
73 &wxPyCallback::EventThunker);
76 PyErr_SetString(PyExc_TypeError, "Expected callable object or None.");
80 bool Disconnect(int id, int lastId = -1,
81 wxEventType eventType = wxEVT_NULL) {
82 return self->Disconnect(id, lastId, eventType,
83 (wxObjectEventFunction)
84 &wxPyCallback::EventThunker);
89 void _setOORInfo(PyObject* _self) {
90 self->SetClientObject(new wxPyClientData(_self));
96 //----------------------------------------------------------------------
98 class wxValidator : public wxEvtHandler {
103 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
105 wxValidator* Clone();
106 wxWindow* GetWindow();
107 void SetWindow(wxWindow* window);
109 static bool IsSilent();
110 static void SetBellOnError(int doIt = TRUE);
115 //----------------------------------------------------------------------
117 class wxPyValidator : public wxValidator {
118 DECLARE_DYNAMIC_CLASS(wxPyValidator);
126 wxObject* Clone() const {
127 wxPyValidator* ptr = NULL;
128 wxPyValidator* self = (wxPyValidator*)this;
130 wxPyBeginBlockThreads();
131 if (self->m_myInst.findCallback("Clone")) {
133 ro = self->m_myInst.callCallbackObj(Py_BuildValue("()"));
135 SWIG_GetPtrObj(ro, (void **)&ptr, "_wxPyValidator_p");
139 wxPyEndBlockThreads();
141 // This is very dangerous!!! But is the only way I could find
142 // to squash a memory leak. Currently it is okay, but if the
143 // validator architecture in wxWindows ever changes, problems
150 DEC_PYCALLBACK_BOOL_WXWIN(Validate);
151 DEC_PYCALLBACK_BOOL_(TransferToWindow);
152 DEC_PYCALLBACK_BOOL_(TransferFromWindow);
157 IMP_PYCALLBACK_BOOL_WXWIN(wxPyValidator, wxValidator, Validate);
158 IMP_PYCALLBACK_BOOL_(wxPyValidator, wxValidator, TransferToWindow);
159 IMP_PYCALLBACK_BOOL_(wxPyValidator, wxValidator, TransferFromWindow);
161 IMPLEMENT_DYNAMIC_CLASS(wxPyValidator, wxValidator);
165 class wxPyValidator : public wxValidator {
169 void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=TRUE);
170 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyValidator, 1)"
172 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
175 //----------------------------------------------------------------------
177 %apply int * INOUT { int* x, int* y };
179 class wxWindow : public wxEvtHandler {
181 wxWindow(wxWindow* parent, const wxWindowID id,
182 const wxPoint& pos = wxDefaultPosition,
183 const wxSize& size = wxDefaultSize,
185 const wxString& name = wxPyPanelNameStr);
186 %name(wxPreWindow)wxWindow();
188 bool Create(wxWindow* parent, const wxWindowID id,
189 const wxPoint& pos = wxDefaultPosition,
190 const wxSize& size = wxDefaultSize,
192 const wxString& name = wxPyPanelNameStr);
194 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
195 %pragma(python) addtomethod = "wxPreWindow:val._setOORInfo(val)"
199 void Center(int direction = wxBOTH);
200 void Centre(int direction = wxBOTH);
201 void CentreOnParent(int direction = wxBOTH );
202 void CenterOnParent(int direction = wxBOTH );
203 void CentreOnScreen(int direction = wxBOTH );
204 void CenterOnScreen(int direction = wxBOTH );
208 // (uses apply'ed INOUT typemap, see above)
209 %name(ClientToScreenXY)void ClientToScreen(int* x, int* y);
210 wxPoint ClientToScreen(const wxPoint& pt);
212 bool Close(int force = FALSE);
214 void DestroyChildren();
215 bool IsBeingDeleted();
217 void DragAcceptFiles(bool accept);
219 void Enable(bool enable);
220 //bool FakePopupMenu(wxMenu* menu, int x, int y);
221 %name(FindWindowById) wxWindow* FindWindow(long id);
222 %name(FindWindowByName) wxWindow* FindWindow(const wxString& name);
224 wxColour GetBackgroundColour();
225 wxBorder GetBorder() const;
227 //wxList& GetChildren();
229 PyObject* GetChildren() {
230 wxWindowList& list = self->GetChildren();
231 return wxPy_ConvertList(&list, "wxWindow");
237 %name(GetClientSizeTuple) void GetClientSize(int *OUTPUT, int *OUTPUT);
238 wxSize GetClientSize();
240 // get the origin of the client area of the window relative to the
241 // window top left corner (the client area may be shifted because of
242 // the borders, scrollbars, other decorations...)
243 wxPoint GetClientAreaOrigin() const;
245 // get the client rectangle in window (i.e. client) coordinates
246 wxRect GetClientRect() const;
248 wxLayoutConstraints * GetConstraints();
249 wxEvtHandler* GetEventHandler();
252 wxColour GetForegroundColour();
253 wxWindow * GetGrandParent();
256 return wxPyGetWinHandle(self); //(long)self->GetHandle();
261 void SetLabel(const wxString& label);
263 wxWindow * GetParent();
264 %name(GetPositionTuple) void GetPosition(int *OUTPUT, int *OUTPUT);
265 wxPoint GetPosition();
267 int GetScrollThumb(int orientation);
268 int GetScrollPos(int orientation);
269 int GetScrollRange(int orientation);
270 %name(GetSizeTuple) void GetSize(int *OUTPUT, int *OUTPUT);
272 void GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT);
273 %name(GetFullTextExtent)void GetTextExtent(const wxString& string,
274 int *OUTPUT, int *OUTPUT, int *OUTPUT, int* OUTPUT,
275 const wxFont* font = NULL); //, bool use16 = FALSE)
277 wxRegion GetUpdateRegion();
278 long GetWindowStyleFlag();
279 void SetWindowStyleFlag(long style);
280 void SetWindowStyle(long style);
281 bool HasScrollbar(int orient) const;
283 wxHitTest HitTest(const wxPoint& pt);
286 bool IsExposed( int x, int y, int w=0, int h=0 );
287 %name(IsExposedPoint) bool IsExposed( const wxPoint& pt );
288 %name(IsExposedRect) bool IsExposed( const wxRect& rect );
293 bool LoadFromResource(wxWindow* parent, const wxString& resourceName, const wxResourceTable* resourceTable = NULL);
295 void MakeModal(bool flag=TRUE);
296 %name(MoveXY)void Move(int x, int y, int flags = wxSIZE_USE_EXISTING);
297 void Move(const wxPoint& point, int flags = wxSIZE_USE_EXISTING);
299 wxEvtHandler* PopEventHandler(bool deleteHandler = FALSE);
300 void PushEventHandler(wxEvtHandler* handler);
302 // find the given handler in the event handler chain and remove (but
303 // not delete) it from the event handler chain, return TRUE if it was
304 // found and FALSE otherwise (this also results in an assert failure so
305 // this function should only be called when the handler is supposed to
307 bool RemoveEventHandler(wxEvtHandler *handler);
309 %name(PopupMenuXY)bool PopupMenu(wxMenu *menu, int x, int y);
310 bool PopupMenu(wxMenu *menu, const wxPoint& pos);
313 void Refresh(bool eraseBackground = TRUE, const wxRect* rect = NULL);
314 void RefreshRect(const wxRect& rect);
317 void RemoveChild(wxWindow* child);
318 bool Reparent( wxWindow* newParent );
320 // (uses apply'ed INOUT typemap, see above)
321 %name(ScreenToClientXY)void ScreenToClient(int *x, int *y);
322 wxPoint ScreenToClient(const wxPoint& pt);
324 void ScrollWindow(int dx, int dy, const wxRect* rect = NULL);
325 void SetAutoLayout(bool autoLayout);
326 bool GetAutoLayout();
327 void SetBackgroundColour(const wxColour& colour);
328 void SetConstraints(wxLayoutConstraints *constraints);
329 void UnsetConstraints(wxLayoutConstraints *constraints);
332 void SetFont(const wxFont& font);
333 void SetForegroundColour(const wxColour& colour);
335 void SetName(const wxString& name);
336 void SetScrollbar(int orientation, int position, int thumbSize, int range, int refresh = TRUE);
337 void SetScrollPos(int orientation, int pos, bool refresh = TRUE);
339 %name(SetDimensions) void SetSize(int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO);
341 void SetSize(const wxSize& size) {
345 void SetPosition(const wxPoint& pos, int flags = wxSIZE_USE_EXISTING) {
346 self->Move(pos, flags);
349 void SetRect(const wxRect& rect, int sizeFlags=wxSIZE_AUTO) {
350 self->SetSize(rect, sizeFlags);
354 void SetSizeHints(int minW=-1, int minH=-1, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1);
355 %name(SetClientSizeWH)void SetClientSize(int width, int height);
356 void SetClientSize(const wxSize& size);
357 //void SetPalette(wxPalette* palette);
358 void SetCursor(const wxCursor& cursor);
359 void SetEventHandler(wxEvtHandler* handler);
360 void SetExtraStyle(long exStyle);
361 void SetTitle(const wxString& title);
362 bool Show(bool show=TRUE);
363 bool TransferDataFromWindow();
364 bool TransferDataToWindow();
365 void UpdateWindowUI();
367 void WarpPointer(int x, int y);
369 %name(ConvertDialogPointToPixels) wxPoint ConvertDialogToPixels(const wxPoint& pt);
370 %name(ConvertDialogSizeToPixels) wxSize ConvertDialogToPixels(const wxSize& sz);
372 %name(DLG_PNT) wxPoint ConvertDialogToPixels(const wxPoint& pt);
373 %name(DLG_SZE) wxSize ConvertDialogToPixels(const wxSize& sz);
375 %name(ConvertPixelPointToDialog) wxPoint ConvertPixelsToDialog(const wxPoint& pt);
376 %name(ConvertPixelSizeToDialog) wxSize ConvertPixelsToDialog(const wxSize& sz);
378 %name(SetToolTipString)void SetToolTip(const wxString &tip);
379 void SetToolTip(wxToolTip *tooltip);
380 wxToolTip* GetToolTip();
382 void SetSizer(wxSizer* sizer, bool deleteOld=TRUE);
385 // Track if this window is a member of a sizer
386 void SetContainingSizer(wxSizer* sizer);
387 wxSizer *GetContainingSizer() const;
389 wxValidator* GetValidator();
390 void SetValidator(const wxValidator& validator);
393 void SetDropTarget(wxDropTarget* target);
394 wxDropTarget* GetDropTarget();
395 %pragma(python) addtomethod = "SetDropTarget:_args[0].thisown = 0"
398 wxSize GetBestSize();
401 void SetCaret(wxCaret *caret);
403 %pragma(python) addtoclass = "# replaces broken shadow method
404 def GetCaret(self, *_args, **_kwargs):
405 from misc2 import wxCaretPtr
406 val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
407 if val: val = wxCaretPtr(val)
415 wxString GetHelpText();
416 void SetHelpText(const wxString& helpText);
417 void SetHelpTextForId(const wxString& text);
419 bool ScrollLines(int lines);
420 bool ScrollPages(int pages);
426 static wxWindow* FindFocus();
427 static int NewControlId();
428 static int NextControlId(int id);
429 static int PrevControlId(int id);
431 void SetAcceleratorTable(const wxAcceleratorTable& accel);
432 wxAcceleratorTable *GetAcceleratorTable();
435 // A way to do the native draw first... Too bad it isn't in wxGTK too.
436 void OnPaint(wxPaintEvent& event);
439 wxWindow* GetDefaultItem();
440 wxWindow* SetDefaultItem(wxWindow *btn);
446 %pragma(python) code = "
447 def wxDLG_PNT(win, point_or_x, y=None):
449 return win.ConvertDialogPointToPixels(point_or_x)
451 return win.ConvertDialogPointToPixels(wxPoint(point_or_x, y))
453 def wxDLG_SZE(win, size_width, height=None):
455 return win.ConvertDialogSizeToPixels(size_width)
457 return win.ConvertDialogSizeToPixels(wxSize(size_width, height))
463 wxWindow* wxWindow_FromHWND(unsigned long hWnd) {
464 wxWindow* win = new wxWindow;
466 win->SubclassWin(hWnd);
473 //---------------------------------------------------------------------------
475 class wxPanel : public wxWindow {
477 wxPanel(wxWindow* parent,
479 const wxPoint& pos = wxDefaultPosition,
480 const wxSize& size = wxDefaultSize,
481 long style = wxTAB_TRAVERSAL,
482 const wxString& name = wxPyPanelNameStr);
483 %name(wxPrePanel)wxPanel();
485 bool Create(wxWindow* parent,
487 const wxPoint& pos = wxDefaultPosition,
488 const wxSize& size = wxDefaultSize,
489 long style = wxTAB_TRAVERSAL,
490 const wxString& name = wxPyPanelNameStr);
492 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
493 %pragma(python) addtomethod = "wxPrePanel:val._setOORInfo(val)"
499 //---------------------------------------------------------------------------
502 // TODO: Add wrappers for the wxScrollHelper class, make wxScrolledWindow
503 // derive from it and wxPanel.
506 class wxScrolledWindow : public wxPanel {
508 wxScrolledWindow(wxWindow* parent,
509 const wxWindowID id = -1,
510 const wxPoint& pos = wxDefaultPosition,
511 const wxSize& size = wxDefaultSize,
512 long style = wxHSCROLL | wxVSCROLL,
513 const wxString& name = wxPyPanelNameStr);
514 %name(wxPreScrolledWindow)wxScrolledWindow();
516 bool Create(wxWindow* parent,
517 const wxWindowID id = -1,
518 const wxPoint& pos = wxDefaultPosition,
519 const wxSize& size = wxDefaultSize,
520 long style = wxHSCROLL | wxVSCROLL,
521 const wxString& name = wxPyPanelNameStr);
523 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
524 %pragma(python) addtomethod = "wxPreScrolledWindow:val._setOORInfo(val)"
526 void EnableScrolling(bool xScrolling, bool yScrolling);
527 int GetScrollPageSize(int orient);
528 void GetScrollPixelsPerUnit(int* OUTPUT, int* OUTPUT);
529 wxWindow* GetTargetWindow();
530 void GetVirtualSize(int* OUTPUT, int* OUTPUT);
532 void PrepareDC(wxDC& dc);
533 void Scroll(int x, int y);
534 void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
535 int noUnitsX, int noUnitsY,
536 int xPos = 0, int yPos = 0, int noRefresh=FALSE);
537 void SetScrollPageSize(int orient, int pageSize);
538 void SetTargetWindow(wxWindow* window);
539 void GetViewStart(int* OUTPUT, int* OUTPUT);
540 %pragma(python) addtoclass = "ViewStart = GetViewStart"
542 %name(CalcScrolledPosition1)wxPoint CalcScrolledPosition(const wxPoint& pt);
543 %name(CalcScrolledPosition2)void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
545 %name(CalcUnscrolledPosition1)wxPoint CalcUnscrolledPosition(const wxPoint& pt);
546 %name(CalcUnscrolledPosition2)void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
548 %pragma(python) addtoclass = "
549 def CalcScrolledPosition(self, *args):
551 return apply(self.CalcScrolledPosition1, args)
553 return apply(self.CalcScrolledPosition2, args)
555 raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed'
557 def CalcUnscrolledPosition(self, *args):
559 return apply(self.CalcUnscrolledPosition1, args)
561 return apply(self.CalcUnscrolledPosition2, args)
563 raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed'
566 void SetScale(double xs, double ys);
570 void AdjustScrollbars();
575 //----------------------------------------------------------------------
578 class wxMenu : public wxEvtHandler {
580 wxMenu(const wxString& title = wxPyEmptyString, long style = 0);
582 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
584 void Append(int id, const wxString& item,
585 const wxString& helpString = wxPyEmptyString,
586 wxItemKind kind = wxItem_Normal);
587 %name(AppendMenu)void Append(int id, const wxString& item, wxMenu *subMenu,
588 const wxString& helpString = wxPyEmptyString);
589 %name(AppendItem)void Append(const wxMenuItem* item);
590 void AppendCheckItem(int id,
591 const wxString& text,
592 const wxString& help = wxPyEmptyString);
593 void AppendRadioItem(int id,
594 const wxString& text,
595 const wxString& help = wxPyEmptyString);
596 void AppendSeparator();
599 void Insert(size_t pos,
601 const wxString& text,
602 const wxString& help = wxPyEmptyString,
603 wxItemKind kind = wxItem_Normal);
604 void InsertSeparator(size_t pos);
605 void InsertCheckItem(size_t pos,
607 const wxString& text,
608 const wxString& help = wxPyEmptyString);
609 void InsertRadioItem(size_t pos,
611 const wxString& text,
612 const wxString& help = wxPyEmptyString);
613 %name(InsertMenu)void Insert(size_t pos,
615 const wxString& text,
617 const wxString& help = wxPyEmptyString);
618 %name(InsertItem)bool Insert(size_t pos, wxMenuItem *item);
622 const wxString& text,
623 const wxString& help = wxPyEmptyString,
624 wxItemKind kind = wxItem_Normal);
625 void PrependSeparator();
626 void PrependCheckItem(int id,
627 const wxString& text,
628 const wxString& help = wxPyEmptyString);
629 void PrependRadioItem(int id,
630 const wxString& text,
631 const wxString& help = wxPyEmptyString);
632 %name(PrependMenu)void Prepend(int id,
633 const wxString& text,
635 const wxString& help = wxPyEmptyString);
636 %name(PrependItem)void Prepend(wxMenuItem *item);
640 void Check(int id, bool flag);
641 bool IsChecked(int id);
642 void Enable(int id, bool enable);
643 bool IsEnabled(int id);
645 int FindItem(const wxString& itemString);
646 %name(FindItemById)wxMenuItem* FindItem(int id/*, wxMenu **menu = NULL*/);
649 void SetTitle(const wxString& title);
651 wxString GetLabel(int id);
652 void SetLabel(int id, const wxString& label);
654 wxString GetHelpString(int id);
655 void SetHelpString(int id, const wxString& helpString);
656 void UpdateUI(wxEvtHandler* source = NULL);
659 %name(DeleteItem)bool Delete(wxMenuItem *item);
660 wxMenuItem *Remove(int id);
661 %name(RemoveItem) wxMenuItem *Remove(wxMenuItem *item);
667 void Destroy() { delete self; }
669 %name(DestroyId)bool Destroy(int id);
670 %name(DestroyItem)bool Destroy(wxMenuItem *item);
672 size_t GetMenuItemCount();
673 //wxMenuItemList& GetMenuItems();
675 PyObject* GetMenuItems() {
676 wxMenuItemList& list = self->GetMenuItems();
677 return wxPy_ConvertList(&list, "wxMenuItem");
681 void SetEventHandler(wxEvtHandler *handler);
682 wxEvtHandler *GetEventHandler();
684 void SetInvokingWindow(wxWindow *win);
685 wxWindow *GetInvokingWindow();
691 void SetParent(wxMenu *parent);
696 //----------------------------------------------------------------------
698 class wxMenuBar : public wxWindow {
700 wxMenuBar(long style = 0);
702 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
704 bool Append(wxMenu *menu, const wxString& title);
705 bool Insert(size_t pos, wxMenu *menu, const wxString& title);
706 size_t GetMenuCount();
707 wxMenu *GetMenu(size_t pos);
708 wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
709 wxMenu *Remove(size_t pos);
710 void EnableTop(size_t pos, bool enable);
711 void SetLabelTop(size_t pos, const wxString& label);
712 wxString GetLabelTop(size_t pos);
713 int FindMenu(const wxString& title);
714 int FindMenuItem(const wxString& menuString, const wxString& itemString);
715 %name(FindItemById)wxMenuItem* FindItem(int id/*, wxMenu **menu = NULL*/);
716 void Enable(int id, bool enable);
717 void Check(int id, bool check);
718 bool IsChecked(int id);
719 bool IsEnabled(int id);
721 void SetLabel(int id, const wxString &label);
722 wxString GetLabel(int id);
724 void SetHelpString(int id, const wxString& helpString);
725 wxString GetHelpString(int id);
730 //----------------------------------------------------------------------
732 class wxMenuItem : public wxObject {
734 wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR,
735 const wxString& text = wxPyEmptyString,
736 const wxString& help = wxPyEmptyString,
737 wxItemKind kind = wxItem_Normal,
738 wxMenu* subMenu = NULL);
745 void SetText(const wxString& str);
747 const wxString& GetText();
748 wxItemKind GetKind();
749 void SetCheckable(bool checkable);
752 void SetSubMenu(wxMenu *menu);
753 wxMenu *GetSubMenu();
754 void Enable(bool enable = TRUE);
756 void Check(bool check = TRUE);
759 void SetHelp(const wxString& str);
760 const wxString& GetHelp();
761 wxAcceleratorEntry *GetAccel();
762 void SetAccel(wxAcceleratorEntry *accel);
764 static wxString GetLabelFromText(const wxString& text);
765 // static wxAcceleratorEntry *GetAccelFromString(const wxString& label);
767 // wxOwnerDrawn methods
769 void SetFont(const wxFont& font);
771 void SetTextColour(const wxColour& colText);
772 wxColour GetTextColour();
773 void SetBackgroundColour(const wxColour& colBack);
774 wxColour GetBackgroundColour();
775 void SetBitmaps(const wxBitmap& bmpChecked,
776 const wxBitmap& bmpUnchecked = wxNullBitmap);
777 void SetBitmap(const wxBitmap& bmpChecked);
778 wxBitmap GetBitmap(bool bChecked = TRUE);
779 void SetMarginWidth(int nWidth);
780 int GetMarginWidth();
781 static int GetDefaultMarginWidth();
782 //void SetName(const wxString& strName);
783 //const wxString& GetName();
784 //void SetCheckable(bool checkable);
785 //bool IsCheckable();
787 void ResetOwnerDrawn();
791 //---------------------------------------------------------------------------