]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/window.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "window.h"
17 #include "wx/window.h"
21 #include "wx/layout.h"
23 #include "wx/dialog.h"
24 #include "wx/msgdlg.h"
25 #include "wx/dcclient.h"
28 #include "wx/notebook.h"
29 #include "wx/statusbr.h"
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 extern wxList wxPendingDelete
;
37 extern wxList wxTopLevelWindows
;
39 //-----------------------------------------------------------------------------
40 // wxWindow implementation
41 //-----------------------------------------------------------------------------
43 IMPLEMENT_DYNAMIC_CLASS(wxWindow
,wxEvtHandler
)
45 BEGIN_EVENT_TABLE(wxWindow
, wxEvtHandler
)
46 EVT_SIZE(wxWindow::OnSize
)
47 EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged
)
48 EVT_INIT_DIALOG(wxWindow::OnInitDialog
)
49 EVT_IDLE(wxWindow::OnIdle
)
55 m_children
.DeleteContents( FALSE
);
61 m_eventHandler
= this;
62 m_windowValidator
= NULL
;
64 m_cursor
= new wxCursor( wxCURSOR_ARROW
);
65 m_font
= *wxSWISS_FONT
;
67 m_windowName
= "noname";
69 m_constraintsInvolvedIn
= NULL
;
76 wxWindow::wxWindow( wxWindow
*parent
, wxWindowID id
,
77 const wxPoint
&pos
, const wxSize
&size
,
78 long style
, const wxString
&name
)
80 Create( parent
, id
, pos
, size
, style
, name
);
83 bool wxWindow::Create( wxWindow
*parent
, wxWindowID id
,
84 const wxPoint
&pos
, const wxSize
&size
,
85 long style
, const wxString
&name
)
90 wxWindow::~wxWindow(void)
96 DeleteRelatedConstraints();
99 // This removes any dangling pointers to this window
100 // in other windows' constraintsInvolvedIn lists.
101 UnsetConstraints(m_constraints
);
102 delete m_constraints
;
103 m_constraints
= NULL
;
107 delete m_windowSizer
;
108 m_windowSizer
= NULL
;
110 // If this is a child of a sizer, remove self from parent
112 m_sizerParent
->RemoveChild((wxWindow
*)this);
114 // Just in case the window has been Closed, but
115 // we're then deleting immediately: don't leave
116 // dangling pointers.
117 wxPendingDelete
.DeleteObject(this);
119 // Just in case we've loaded a top-level window via
120 // wxWindow::LoadNativeDialog but we weren't a dialog
122 wxTopLevelWindows
.DeleteObject(this);
126 bool wxWindow::Close( bool force
)
128 wxCloseEvent
event(wxEVT_CLOSE_WINDOW
, m_windowId
);
129 event
.SetEventObject(this);
130 event
.SetForce(force
);
132 return GetEventHandler()->ProcessEvent(event
);
135 bool wxWindow::Destroy(void)
142 bool wxWindow::DestroyChildren(void)
147 while ((node
= GetChildren()->First()) != (wxNode
*)NULL
)
150 if ((child
= (wxWindow
*)node
->Data()) != (wxWindow
*)NULL
)
153 if (GetChildren()->Member(child
)) delete node
;
160 void wxWindow::PrepareDC( wxDC
&WXUNUSED(dc
) )
162 // are we to set fonts here ?
165 void wxWindow::SetSize( int x
, int y
, int width
, int height
, int sizeFlags
)
173 if ((sizeFlags
& wxSIZE_USE_EXISTING
) == wxSIZE_USE_EXISTING
)
175 if (newX
== -1) newX
= m_x
;
176 if (newY
== -1) newY
= m_y
;
177 if (newW
== -1) newW
= m_width
;
178 if (newH
== -1) newH
= m_height
;
181 if ((sizeFlags
& wxSIZE_AUTO_WIDTH
) == wxSIZE_AUTO_WIDTH
)
183 if (newW
== -1) newW
= 80;
186 if ((sizeFlags
& wxSIZE_AUTO_HEIGHT
) == wxSIZE_AUTO_HEIGHT
)
188 if (newH
== -1) newH
= 26;
191 if ((m_x
!= newX
) || (m_y
!= newY
) || (!m_sizeSet
))
197 if ((m_width
!= newW
) || (m_height
!= newH
) || (!m_sizeSet
))
204 wxSizeEvent
event( wxSize(m_width
,m_height
), GetId() );
205 event
.SetEventObject( this );
206 ProcessEvent( event
);
209 void wxWindow::SetSize( int width
, int height
)
211 SetSize( -1, -1, width
, height
, wxSIZE_USE_EXISTING
);
214 void wxWindow::Move( int x
, int y
)
216 SetSize( x
, y
, -1, -1, wxSIZE_USE_EXISTING
);
219 void wxWindow::GetSize( int *width
, int *height
) const
221 if (width
) (*width
) = m_width
;
222 if (height
) (*height
) = m_height
;
225 void wxWindow::SetClientSize( int width
, int height
)
229 void wxWindow::GetClientSize( int *width
, int *height
) const
233 void wxWindow::GetPosition( int *x
, int *y
) const
239 void wxWindow::ClientToScreen( int *x
, int *y
)
243 void wxWindow::ScreenToClient( int *x
, int *y
)
247 void wxWindow::Centre( int direction
)
251 void wxWindow::Fit(void)
255 wxNode
*node
= GetChildren()->First();
258 wxWindow
*win
= (wxWindow
*)node
->Data();
260 win
->GetPosition(&wx
, &wy
);
261 win
->GetSize(&ww
, &wh
);
262 if ( wx
+ ww
> maxX
)
264 if ( wy
+ wh
> maxY
)
269 SetClientSize(maxX
+ 5, maxY
+ 10);
272 void wxWindow::OnSize( wxSizeEvent
&WXUNUSED(event
) )
274 //if (GetAutoLayout()) Layout();
277 bool wxWindow::Show( bool show
)
282 void wxWindow::Enable( bool enable
)
284 m_isEnabled
= enable
;
287 void wxWindow::MakeModal( bool modal
)
291 void wxWindow::SetFocus(void)
295 bool wxWindow::OnClose(void)
300 void wxWindow::AddChild( wxWindow
*child
)
304 wxList
*wxWindow::GetChildren(void)
306 return (&m_children
);
309 void wxWindow::RemoveChild( wxWindow
*child
)
312 GetChildren()->DeleteObject( child
);
313 child
->m_parent
= NULL
;
316 void wxWindow::SetReturnCode( int retCode
)
321 int wxWindow::GetReturnCode(void)
326 wxWindow
*wxWindow::GetParent(void)
331 wxEvtHandler
*wxWindow::GetEventHandler(void)
333 return m_eventHandler
;
336 void wxWindow::SetEventhandler( wxEvtHandler
*handler
)
338 m_eventHandler
= handler
;
341 wxValidator
*wxWindow::GetValidator(void)
343 return m_windowValidator
;
346 void wxWindow::SetValidator( wxValidator
*validator
)
348 m_windowValidator
= validator
;
351 bool wxWindow::IsBeingDeleted(void)
356 void wxWindow::SetId( wxWindowID id
)
361 wxWindowID
wxWindow::GetId(void)
366 void wxWindow::SetCursor( const wxCursor
&cursor
)
368 if (*m_cursor
== cursor
) return;
369 (*m_cursor
) = cursor
;
372 void wxWindow::Refresh( bool eraseBackground
, const wxRect
*rect
)
376 bool wxWindow::IsExposed( long x
, long y
)
378 return (m_updateRegion
.Contains( x
, y
) != wxOutRegion
);
381 bool wxWindow::IsExposed( long x
, long y
, long width
, long height
)
383 return (m_updateRegion
.Contains( x
, y
, width
, height
) != wxOutRegion
);
386 void wxWindow::Clear(void)
390 wxColour
wxWindow::GetBackgroundColour(void) const
392 return m_backgroundColour
;
395 void wxWindow::SetBackgroundColour( const wxColour
&colour
)
397 m_backgroundColour
= colour
;
400 bool wxWindow::Validate(void)
402 wxNode
*node
= GetChildren()->First();
405 wxWindow
*child
= (wxWindow
*)node
->Data();
406 if (child
->GetValidator() && /* child->GetValidator()->Ok() && */ !child
->GetValidator()->Validate(this))
413 bool wxWindow::TransferDataToWindow(void)
415 wxNode
*node
= GetChildren()->First();
418 wxWindow
*child
= (wxWindow
*)node
->Data();
419 if (child
->GetValidator() && /* child->GetValidator()->Ok() && */
420 !child
->GetValidator()->TransferToWindow() )
422 wxMessageBox( "Application Error", "Could not transfer data to window", wxOK
|wxICON_EXCLAMATION
);
430 bool wxWindow::TransferDataFromWindow(void)
432 wxNode
*node
= GetChildren()->First();
435 wxWindow
*child
= (wxWindow
*)node
->Data();
436 if ( child
->GetValidator() && /* child->GetValidator()->Ok() && */ !child
->GetValidator()->TransferFromWindow() )
443 void wxWindow::OnInitDialog( wxInitDialogEvent
&WXUNUSED(event
) )
445 TransferDataToWindow();
448 void wxWindow::InitDialog(void)
450 wxInitDialogEvent
event(GetId());
451 event
.SetEventObject( this );
452 GetEventHandler()->ProcessEvent(event
);
455 void wxWindow::SetDropTarget( wxDropTarget
*dropTarget
)
459 m_pDropTarget
->UnregisterWidget( dnd_widget
);
460 delete m_pDropTarget
;
462 m_pDropTarget
= dropTarget
;
468 wxDropTarget
*wxWindow::GetDropTarget() const
470 return m_pDropTarget
;
473 void wxWindow::SetFont( const wxFont
&font
)
481 wxFont
*wxWindow::GetFont(void)
486 void wxWindow::SetWindowStyleFlag( long flag
)
488 m_windowStyle
= flag
;
491 long wxWindow::GetWindowStyleFlag(void) const
493 return m_windowStyle
;
496 void wxWindow::CaptureMouse(void)
500 void wxWindow::ReleaseMouse(void)
504 void wxWindow::SetTitle( const wxString
&WXUNUSED(title
) )
508 wxString
wxWindow::GetTitle(void) const
510 return (wxString
&)m_windowName
;
513 wxString
wxWindow::GetLabel(void) const
518 void wxWindow::SetName( const wxString
&name
)
523 wxString
wxWindow::GetName(void) const
525 return (wxString
&)m_windowName
;
528 bool wxWindow::IsShown(void) const
533 bool wxWindow::IsRetained(void)
538 wxWindow
*wxWindow::FindWindow( long id
)
540 if (id
== m_windowId
) return this;
541 wxNode
*node
= m_children
.First();
544 wxWindow
*child
= (wxWindow
*)node
->Data();
545 wxWindow
*res
= child
->FindWindow( id
);
552 wxWindow
*wxWindow::FindWindow( const wxString
& name
)
554 if (name
== m_windowName
) return this;
555 wxNode
*node
= m_children
.First();
558 wxWindow
*child
= (wxWindow
*)node
->Data();
559 wxWindow
*res
= child
->FindWindow( name
);
566 void wxWindow::SetScrollbar( int orient
, int pos
, int thumbVisible
,
567 int range
, bool WXUNUSED(refresh
) )
571 void wxWindow::SetScrollPos( int orient
, int pos
, bool WXUNUSED(refresh
) )
575 int wxWindow::GetScrollThumb( int orient
) const
579 int wxWindow::GetScrollPos( int orient
) const
583 int wxWindow::GetScrollRange( int orient
) const
587 void wxWindow::ScrollWindow( int dx
, int dy
, const wxRect
* WXUNUSED(rect
) )
591 //-------------------------------------------------------------------------------------
593 //-------------------------------------------------------------------------------------
595 wxLayoutConstraints
*wxWindow::GetConstraints(void) const
597 return m_constraints
;
600 void wxWindow::SetConstraints( wxLayoutConstraints
*constraints
)
604 UnsetConstraints(m_constraints
);
605 delete m_constraints
;
607 m_constraints
= constraints
;
610 // Make sure other windows know they're part of a 'meaningful relationship'
611 if (m_constraints
->left
.GetOtherWindow() && (m_constraints
->left
.GetOtherWindow() != this))
612 m_constraints
->left
.GetOtherWindow()->AddConstraintReference((wxWindow
*)this);
613 if (m_constraints
->top
.GetOtherWindow() && (m_constraints
->top
.GetOtherWindow() != this))
614 m_constraints
->top
.GetOtherWindow()->AddConstraintReference((wxWindow
*)this);
615 if (m_constraints
->right
.GetOtherWindow() && (m_constraints
->right
.GetOtherWindow() != this))
616 m_constraints
->right
.GetOtherWindow()->AddConstraintReference((wxWindow
*)this);
617 if (m_constraints
->bottom
.GetOtherWindow() && (m_constraints
->bottom
.GetOtherWindow() != this))
618 m_constraints
->bottom
.GetOtherWindow()->AddConstraintReference((wxWindow
*)this);
619 if (m_constraints
->width
.GetOtherWindow() && (m_constraints
->width
.GetOtherWindow() != this))
620 m_constraints
->width
.GetOtherWindow()->AddConstraintReference((wxWindow
*)this);
621 if (m_constraints
->height
.GetOtherWindow() && (m_constraints
->height
.GetOtherWindow() != this))
622 m_constraints
->height
.GetOtherWindow()->AddConstraintReference((wxWindow
*)this);
623 if (m_constraints
->centreX
.GetOtherWindow() && (m_constraints
->centreX
.GetOtherWindow() != this))
624 m_constraints
->centreX
.GetOtherWindow()->AddConstraintReference((wxWindow
*)this);
625 if (m_constraints
->centreY
.GetOtherWindow() && (m_constraints
->centreY
.GetOtherWindow() != this))
626 m_constraints
->centreY
.GetOtherWindow()->AddConstraintReference((wxWindow
*)this);
632 void wxWindow::SetAutoLayout( bool autoLayout
)
634 m_autoLayout
= autoLayout
;
637 bool wxWindow::GetAutoLayout(void) const
642 wxSizer
*wxWindow::GetSizer(void) const
644 return m_windowSizer
;
647 void wxWindow::SetSizerParent( wxWindow
*win
)
652 wxWindow
*wxWindow::GetSizerParent(void) const
654 return m_sizerParent
;
657 // This removes any dangling pointers to this window
658 // in other windows' constraintsInvolvedIn lists.
659 void wxWindow::UnsetConstraints(wxLayoutConstraints
*c
)
663 if (c
->left
.GetOtherWindow() && (c
->top
.GetOtherWindow() != this))
664 c
->left
.GetOtherWindow()->RemoveConstraintReference((wxWindow
*)this);
665 if (c
->top
.GetOtherWindow() && (c
->top
.GetOtherWindow() != this))
666 c
->top
.GetOtherWindow()->RemoveConstraintReference((wxWindow
*)this);
667 if (c
->right
.GetOtherWindow() && (c
->right
.GetOtherWindow() != this))
668 c
->right
.GetOtherWindow()->RemoveConstraintReference((wxWindow
*)this);
669 if (c
->bottom
.GetOtherWindow() && (c
->bottom
.GetOtherWindow() != this))
670 c
->bottom
.GetOtherWindow()->RemoveConstraintReference((wxWindow
*)this);
671 if (c
->width
.GetOtherWindow() && (c
->width
.GetOtherWindow() != this))
672 c
->width
.GetOtherWindow()->RemoveConstraintReference((wxWindow
*)this);
673 if (c
->height
.GetOtherWindow() && (c
->height
.GetOtherWindow() != this))
674 c
->height
.GetOtherWindow()->RemoveConstraintReference((wxWindow
*)this);
675 if (c
->centreX
.GetOtherWindow() && (c
->centreX
.GetOtherWindow() != this))
676 c
->centreX
.GetOtherWindow()->RemoveConstraintReference((wxWindow
*)this);
677 if (c
->centreY
.GetOtherWindow() && (c
->centreY
.GetOtherWindow() != this))
678 c
->centreY
.GetOtherWindow()->RemoveConstraintReference((wxWindow
*)this);
682 // Back-pointer to other windows we're involved with, so if we delete
683 // this window, we must delete any constraints we're involved with.
684 void wxWindow::AddConstraintReference(wxWindow
*otherWin
)
686 if (!m_constraintsInvolvedIn
)
687 m_constraintsInvolvedIn
= new wxList
;
688 if (!m_constraintsInvolvedIn
->Member(otherWin
))
689 m_constraintsInvolvedIn
->Append(otherWin
);
692 // REMOVE back-pointer to other windows we're involved with.
693 void wxWindow::RemoveConstraintReference(wxWindow
*otherWin
)
695 if (m_constraintsInvolvedIn
)
696 m_constraintsInvolvedIn
->DeleteObject(otherWin
);
699 // Reset any constraints that mention this window
700 void wxWindow::DeleteRelatedConstraints(void)
702 if (m_constraintsInvolvedIn
)
704 wxNode
*node
= m_constraintsInvolvedIn
->First();
707 wxWindow
*win
= (wxWindow
*)node
->Data();
708 wxNode
*next
= node
->Next();
709 wxLayoutConstraints
*constr
= win
->GetConstraints();
711 // Reset any constraints involving this window
714 constr
->left
.ResetIfWin((wxWindow
*)this);
715 constr
->top
.ResetIfWin((wxWindow
*)this);
716 constr
->right
.ResetIfWin((wxWindow
*)this);
717 constr
->bottom
.ResetIfWin((wxWindow
*)this);
718 constr
->width
.ResetIfWin((wxWindow
*)this);
719 constr
->height
.ResetIfWin((wxWindow
*)this);
720 constr
->centreX
.ResetIfWin((wxWindow
*)this);
721 constr
->centreY
.ResetIfWin((wxWindow
*)this);
726 delete m_constraintsInvolvedIn
;
727 m_constraintsInvolvedIn
= NULL
;
731 void wxWindow::SetSizer(wxSizer
*sizer
)
733 m_windowSizer
= sizer
;
735 sizer
->SetSizerParent((wxWindow
*)this);
742 bool wxWindow::Layout(void)
744 if (GetConstraints())
747 GetClientSize(&w
, &h
);
748 GetConstraints()->width
.SetValue(w
);
749 GetConstraints()->height
.SetValue(h
);
752 // If top level (one sizer), evaluate the sizer's constraints.
756 GetSizer()->ResetConstraints(); // Mark all constraints as unevaluated
757 GetSizer()->LayoutPhase1(&noChanges
);
758 GetSizer()->LayoutPhase2(&noChanges
);
759 GetSizer()->SetConstraintSizes(); // Recursively set the real window sizes
764 // Otherwise, evaluate child constraints
765 ResetConstraints(); // Mark all constraints as unevaluated
766 DoPhase(1); // Just one phase need if no sizers involved
768 SetConstraintSizes(); // Recursively set the real window sizes
774 // Do a phase of evaluating constraints:
775 // the default behaviour. wxSizers may do a similar
776 // thing, but also impose their own 'constraints'
777 // and order the evaluation differently.
778 bool wxWindow::LayoutPhase1(int *noChanges
)
780 wxLayoutConstraints
*constr
= GetConstraints();
783 return constr
->SatisfyConstraints((wxWindow
*)this, noChanges
);
789 bool wxWindow::LayoutPhase2(int *noChanges
)
799 // Do a phase of evaluating child constraints
800 bool wxWindow::DoPhase(int phase
)
802 int noIterations
= 0;
803 int maxIterations
= 500;
807 while ((noChanges
> 0) && (noIterations
< maxIterations
))
811 wxNode
*node
= GetChildren()->First();
814 wxWindow
*child
= (wxWindow
*)node
->Data();
815 if (!child
->IsKindOf(CLASSINFO(wxFrame
)) && !child
->IsKindOf(CLASSINFO(wxDialog
)))
817 wxLayoutConstraints
*constr
= child
->GetConstraints();
820 if (succeeded
.Member(child
))
825 int tempNoChanges
= 0;
826 bool success
= ( (phase
== 1) ? child
->LayoutPhase1(&tempNoChanges
) : child
->LayoutPhase2(&tempNoChanges
) ) ;
827 noChanges
+= tempNoChanges
;
830 succeeded
.Append(child
);
842 void wxWindow::ResetConstraints(void)
844 wxLayoutConstraints
*constr
= GetConstraints();
847 constr
->left
.SetDone(FALSE
);
848 constr
->top
.SetDone(FALSE
);
849 constr
->right
.SetDone(FALSE
);
850 constr
->bottom
.SetDone(FALSE
);
851 constr
->width
.SetDone(FALSE
);
852 constr
->height
.SetDone(FALSE
);
853 constr
->centreX
.SetDone(FALSE
);
854 constr
->centreY
.SetDone(FALSE
);
856 wxNode
*node
= GetChildren()->First();
859 wxWindow
*win
= (wxWindow
*)node
->Data();
860 if (!win
->IsKindOf(CLASSINFO(wxFrame
)) && !win
->IsKindOf(CLASSINFO(wxDialog
)))
861 win
->ResetConstraints();
866 // Need to distinguish between setting the 'fake' size for
867 // windows and sizers, and setting the real values.
868 void wxWindow::SetConstraintSizes(bool recurse
)
870 wxLayoutConstraints
*constr
= GetConstraints();
871 if (constr
&& constr
->left
.GetDone() && constr
->right
.GetDone() &&
872 constr
->width
.GetDone() && constr
->height
.GetDone())
874 int x
= constr
->left
.GetValue();
875 int y
= constr
->top
.GetValue();
876 int w
= constr
->width
.GetValue();
877 int h
= constr
->height
.GetValue();
879 // If we don't want to resize this window, just move it...
880 if ((constr
->width
.GetRelationship() != wxAsIs
) ||
881 (constr
->height
.GetRelationship() != wxAsIs
))
883 // Calls Layout() recursively. AAAGH. How can we stop that.
884 // Simply take Layout() out of non-top level OnSizes.
885 SizerSetSize(x
, y
, w
, h
);
894 char *windowClass
= this->GetClassInfo()->GetClassName();
901 wxDebugMsg("Constraint(s) not satisfied for window of type %s, name %s:\n", (const char *)windowClass
, (const char *)winName
);
902 if (!constr
->left
.GetDone())
903 wxDebugMsg(" unsatisfied 'left' constraint.\n");
904 if (!constr
->right
.GetDone())
905 wxDebugMsg(" unsatisfied 'right' constraint.\n");
906 if (!constr
->width
.GetDone())
907 wxDebugMsg(" unsatisfied 'width' constraint.\n");
908 if (!constr
->height
.GetDone())
909 wxDebugMsg(" unsatisfied 'height' constraint.\n");
910 wxDebugMsg("Please check constraints: try adding AsIs() constraints.\n");
915 wxNode
*node
= GetChildren()->First();
918 wxWindow
*win
= (wxWindow
*)node
->Data();
919 if (!win
->IsKindOf(CLASSINFO(wxFrame
)) && !win
->IsKindOf(CLASSINFO(wxDialog
)))
920 win
->SetConstraintSizes();
926 // This assumes that all sizers are 'on' the same
927 // window, i.e. the parent of this window.
928 void wxWindow::TransformSizerToActual(int *x
, int *y
) const
930 if (!m_sizerParent
|| m_sizerParent
->IsKindOf(CLASSINFO(wxDialog
)) ||
931 m_sizerParent
->IsKindOf(CLASSINFO(wxFrame
)) )
935 m_sizerParent
->GetPosition(&xp
, &yp
);
936 m_sizerParent
->TransformSizerToActual(&xp
, &yp
);
941 void wxWindow::SizerSetSize(int x
, int y
, int w
, int h
)
945 TransformSizerToActual(&xx
, &yy
);
946 SetSize(xx
, yy
, w
, h
);
949 void wxWindow::SizerMove(int x
, int y
)
953 TransformSizerToActual(&xx
, &yy
);
957 // Only set the size/position of the constraint (if any)
958 void wxWindow::SetSizeConstraint(int x
, int y
, int w
, int h
)
960 wxLayoutConstraints
*constr
= GetConstraints();
965 constr
->left
.SetValue(x
);
966 constr
->left
.SetDone(TRUE
);
970 constr
->top
.SetValue(y
);
971 constr
->top
.SetDone(TRUE
);
975 constr
->width
.SetValue(w
);
976 constr
->width
.SetDone(TRUE
);
980 constr
->height
.SetValue(h
);
981 constr
->height
.SetDone(TRUE
);
986 void wxWindow::MoveConstraint(int x
, int y
)
988 wxLayoutConstraints
*constr
= GetConstraints();
993 constr
->left
.SetValue(x
);
994 constr
->left
.SetDone(TRUE
);
998 constr
->top
.SetValue(y
);
999 constr
->top
.SetDone(TRUE
);
1004 void wxWindow::GetSizeConstraint(int *w
, int *h
) const
1006 wxLayoutConstraints
*constr
= GetConstraints();
1009 *w
= constr
->width
.GetValue();
1010 *h
= constr
->height
.GetValue();
1016 void wxWindow::GetClientSizeConstraint(int *w
, int *h
) const
1018 wxLayoutConstraints
*constr
= GetConstraints();
1021 *w
= constr
->width
.GetValue();
1022 *h
= constr
->height
.GetValue();
1025 GetClientSize(w
, h
);
1028 void wxWindow::GetPositionConstraint(int *x
, int *y
) const
1030 wxLayoutConstraints
*constr
= GetConstraints();
1033 *x
= constr
->left
.GetValue();
1034 *y
= constr
->top
.GetValue();
1040 bool wxWindow::AcceptsFocus() const
1042 return IsEnabled() && IsShown();
1045 void wxWindow::OnIdle(wxIdleEvent
& WXUNUSED(event
) )