Revision: 7389
          http://mahogany.svn.sourceforge.net/mahogany/?rev=7389&view=rev
Author:   vadz
Date:     2007-11-20 07:56:33 -0800 (Tue, 20 Nov 2007)

Log Message:
-----------
compilation fixes for wx svn trunk: replace usage of Next/PrevControlId() with 
GetPrev/NextSibling()

Modified Paths:
--------------
    trunk/M/src/gui/wxDialogLayout.cpp
    trunk/M/src/gui/wxOptionsDlg.cpp

Modified: trunk/M/src/gui/wxDialogLayout.cpp
===================================================================
--- trunk/M/src/gui/wxDialogLayout.cpp  2007-11-20 15:55:21 UTC (rev 7388)
+++ trunk/M/src/gui/wxDialogLayout.cpp  2007-11-20 15:56:33 UTC (rev 7389)
@@ -240,13 +240,18 @@
    c->height.AsIs();
    control->SetConstraints(c);
 
-   // we have to make sure that the control is follows the label id as the code
+   pLabel->MoveBeforeInTabOrder(control);
+
+   // we don't use ids to find controls with wx 2.9+
+#if !wxCHECK_VERSION(2, 9, 0)
+   // we have to make sure that the control id follows the label id as the code
    // elsewhere relies on this
    int idLabel = pLabel->GetId();
    ASSERT_MSG( control->GetId() == wxWindow::PrevControlId(idLabel),
                _T("control should have been created right before") );
    pLabel->SetId(control->GetId());
    control->SetId(idLabel);
+#endif // wx < 2.9
 
    return pLabel;
 }
@@ -444,9 +449,13 @@
 static
 void EnableWindowLabel(wxWindow *parent, wxWindow *control, bool bEnable)
 {
+#if wxCHECK_VERSION(2, 9, 0)
+   wxWindow *win = control->GetPrevSibling();
+#else // wx 2.8
    // NB: we assume that the control ids are consecutive
    long id = wxWindow::PrevControlId(control->GetId());
    wxWindow *win = parent->FindWindow(id);
+#endif // wx 2.9/2.8
 
    if ( win == NULL ) {
       wxFAIL_MSG(_T("can't find label for the text entry zone"));
@@ -470,9 +479,13 @@
 
 void EnableTextWithButton(wxWindow *parent, wxTextCtrl *control, bool bEnable)
 {
+#if wxCHECK_VERSION(2, 9, 0)
+   wxWindow *win = control->GetNextSibling();
+#else // wx 2.8
    // NB: we assume that the control ids are consecutive
    long id = wxWindow::NextControlId(control->GetId());
    wxWindow *win = parent->FindWindow(id);
+#endif // wx 2.9/2.8
 
    if ( win == NULL ) {
       wxFAIL_MSG(_T("can't find browse button for the text entry zone"));
@@ -1057,8 +1070,12 @@
 
 wxStaticText *wxEnhancedPanel::GetLabelForControl(wxControl *control)
 {
+#if wxCHECK_VERSION(2, 9, 0)
+   wxWindow *win = control->GetPrevSibling();
+#else // wx 2.8
    long id = wxWindow::PrevControlId(control->GetId());
    wxWindow *win = FindWindow(id);
+#endif // wx 2.9/2.8
 
    return wxDynamicCast(win, wxStaticText);
 }

Modified: trunk/M/src/gui/wxOptionsDlg.cpp
===================================================================
--- trunk/M/src/gui/wxOptionsDlg.cpp    2007-11-20 15:55:21 UTC (rev 7388)
+++ trunk/M/src/gui/wxOptionsDlg.cpp    2007-11-20 15:56:33 UTC (rev 7389)
@@ -2625,7 +2625,11 @@
    wxControl *control = wxStaticCast(event.GetEventObject(), wxControl);
    CHECK_RET( control, _T("text event from nowhere?") );
 
+#if wxCHECK_VERSION(2, 9, 0)
+   wxWindow *win = control->GetNextSibling();
+#else
    wxWindow *win = FindWindow(NextControlId(control->GetId()));
+#endif
    wxColorBrowseButton *btn = wxDynamicCast(win, wxColorBrowseButton);
    if ( btn )
    {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to