[wx-dev] #9576: wxWindow::Centre() doesn't centre on the parent as expected

wxTrac noreply at wxsite.net
Fri Jun 13 18:37:38 PDT 2008


Ticket URL: <http://trac.wxwidgets.org/ticket/9576>

#9576: wxWindow::Centre() doesn't centre on the parent as expected
--------------------------+-------------------------------------------------
 Reporter:  wojdyr        |       Owner:         
     Type:  defect        |      Status:  new    
 Priority:  normal        |   Milestone:         
Component:  GUI-all       |     Version:  2.9-svn
 Keywords:  wxWindowBase  |   Blockedby:         
    Patch:  0             |    Blocking:         
--------------------------+-------------------------------------------------
 Centre() should center the window on the parent, but it moves the center
 of the control to the top left corner of the parent.

 This can be seen e.g. in controls sample.
 {{{
 --- controls.cpp        (revision 54187)
 +++ controls.cpp        (working copy)
 @@ -737,6 +737,7 @@
      m_listbox = new wxListBox( panel, ID_LISTBOX,
                                 wxPoint(10,10), wxSize(120,70),
                                 5, choices, wxLB_MULTIPLE |wxLB_ALWAYS_SB
 );
 +    m_listbox->Centre();
      m_listboxSorted = new wxListBox( panel, ID_LISTBOX_SORTED,
                                       wxPoint(10,90), wxSize(120,70),
                                       5, choices, wxLB_SORT );
 }}}


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9576>


More information about the wx-dev mailing list