]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed wxCheckBox on wxGTK (SetLabel called before widget creation),
authorJulian Smart <julian@anthemion.co.uk>
Mon, 7 Sep 1998 21:53:34 +0000 (21:53 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 7 Sep 1998 21:53:34 +0000 (21:53 +0000)
wxListBox::GetSelection returning -1 now doesn't assert; wxProp improvements
for wxGTK; parser.y includes <io.h> under VC++ to eliminate 'read' warning

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@709 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/msw/issues.txt
docs/msw/todo.txt
src/common/dosyacc.c
src/common/parser.y
src/gtk/checkbox.cpp
src/gtk/listbox.cpp
src/gtk1/checkbox.cpp
src/gtk1/listbox.cpp
utils/dialoged/src/reseditr.cpp
utils/wxprop/src/proplist.cpp

index 080459bb80b9aebbf79a9baf005ec45c39f08342..d8df16c5833c955d08f73b2db7a25edf57848e06 100644 (file)
@@ -32,40 +32,6 @@ wxDebugStreamBuf it might help, but I don't know how to do that -
 I've redefined 'new' throughout as WXDEBUG_NEW (which is itself
 defined as the 3-argument operator).
 
 I've redefined 'new' throughout as WXDEBUG_NEW (which is itself
 defined as the 3-argument operator).
 
-Config/registry classes
------------------------
-
-Problems with Karsten's/Vadim's existing AppConfig classes:
-
-- use char* a lot instead of wxString
-- rather hard to understand
-- will need fairly substantial rewrite
-- no native .ini functions (?) for guaranteed Windows
-  compatibility
-- new wxWin docs required
-
-Good things:
-
-- exists!
-- FileConfig independent of OS
-- specifying a base class that will meet nearly all needs for
-  derived classes
-- enumerator
-
-Other features we should probably have:
-
-- ability to specify vendor name/app name in constructor
-- under Windows, ability to read/write all areas of registry
-  as an option
-
-Options:
-
-- rewrite AppConfig
-- start from own CRegistry class
-- take elements from both
-- do the Windows stuff, let someone else write/adapt the
-  non-Windows classes
-
 Owner-draw menus
 ----------------
 
 Owner-draw menus
 ----------------
 
index 326531ddc856156782848b499fa59ba730c4b576..29f8a891904ec219c662b4572c72d0af9332c9c0 100644 (file)
@@ -33,9 +33,10 @@ Update manual.
     wxTaskBarIcon       DONE
     wxMsgCatalog etc.
     wxLog
     wxTaskBarIcon       DONE
     wxMsgCatalog etc.
     wxLog
-    wxConfig, wxRegKey
+    wxConfig            DONE
+    wxRegKey
     wxTabCtrl           DONE
     wxTabCtrl           DONE
-    wxNotebook
+    wxNotebook          DONE (some more explanation required)
     wxWave              DONE
     wxJoystick          DONE
     wxStatusBar95 and wxFrame status bar functions
     wxWave              DONE
     wxJoystick          DONE
     wxStatusBar95 and wxFrame status bar functions
@@ -44,8 +45,8 @@ Update manual.
     wxHelpController classes DONE (except for Unix ones)
     wxString            PARTLY DONE
     Drag and drop (change API if required, e.g. const).
     wxHelpController classes DONE (except for Unix ones)
     wxString            PARTLY DONE
     Drag and drop (change API if required, e.g. const).
-    wxCheckListBox
-    wxAcceleratorTable
+    wxCheckListBox      DONE
+    wxAcceleratorTable  DONE
     wxBaseArray, other arrays
     (wxOwnerDrawn)
     Document the include file for each class
     wxBaseArray, other arrays
     (wxOwnerDrawn)
     Document the include file for each class
@@ -63,8 +64,6 @@ objects.
 
 More wxSystemSettings (see comment in settings.cpp).
 
 
 More wxSystemSettings (see comment in settings.cpp).
 
-wxSocket integration.
-
 Convert remaining utilities e.g. (GLCanvas; wxGraphLayout) and samples
 
 Check TODO entries.
 Convert remaining utilities e.g. (GLCanvas; wxGraphLayout) and samples
 
 Check TODO entries.
@@ -79,7 +78,7 @@ for all controls, at least in WXWIN_COMPATIBLE mode, but
 retain (Set)Callback for all compilations. This is following a
 panicky response to losing callbacks.
 
 retain (Set)Callback for all compilations. This is following a
 panicky response to losing callbacks.
 
-Merge dib.cpp, dibutils.cpp.
+Merge dib.cpp, dibutils.cpp (see also some DIB code in bitmap.cpp).
 
 Add a wxTabCtrl sample.
 
 
 Add a wxTabCtrl sample.
 
@@ -151,7 +150,9 @@ substituting static text for obsolete labels).
 
 Improve and expand wxSizer classes.
 
 
 Improve and expand wxSizer classes.
 
-Write more validators.
+Write more validators. Also, how do they work if loading the
+dialog from a .wxr? Could call SetValidator from within
+InitDialog for all controls, then call TransferDataToWindow.
 
 Classes for file/OS utility functions.
 
 
 Classes for file/OS utility functions.
 
index e2bdecb862a8342ac8cf94c15698b78a84c79683..bbb0d6ee2376197bb8de61a35e6592d81822a3a7 100644 (file)
@@ -4,6 +4,9 @@ static char yysccsid[] = "@(#)yaccpar     1.7 (Berkeley) 09/09/90";
 #define YYBYACC 1
 #line 2 "parser.y"
 #include "string.h"
 #define YYBYACC 1
 #line 2 "parser.y"
 #include "string.h"
+#ifdef _MSC_VER
+#include <io.h>
+#endif
 #include "wx/expr.h"
 
 #ifndef __EXTERN_C__
 #include "wx/expr.h"
 
 #ifndef __EXTERN_C__
index 336ee0f964eb265e49ae8cd0fbd307ff2636d3be..7600083ee7e17679adabf6d27ac2133c5b77008c 100644 (file)
@@ -1,5 +1,9 @@
  %{
 #include <string.h>
  %{
 #include <string.h>
+#ifdef _MSC_VER
+#include <io.h>
+#endif
+
 #include "wx/expr.h"
 
 #ifndef __EXTERN_C__
 #include "wx/expr.h"
 
 #ifndef __EXTERN_C__
index e50abc4759332a21f54c892fa52ceb7ab622120f..3883d1d7e27e6433eaf04323070b3d1e74158d4c 100644 (file)
@@ -56,7 +56,7 @@ bool wxCheckBox::Create(  wxWindow *parent, wxWindowID id, const wxString &label
 
   SetValidator( validator );
 
 
   SetValidator( validator );
 
-  SetLabel( label );
+  wxControl::SetLabel( label );
 
   m_widget = gtk_check_button_new_with_label( m_label );
  
 
   m_widget = gtk_check_button_new_with_label( m_label );
  
index fa5a38a225c8c6dfeb86e32faa1d8d832cde5e21..1e2e80ebc82b0cb25de040be918505bb0b88541a 100644 (file)
@@ -234,7 +234,9 @@ int wxListBox::GetSelection(void) const
       child = child->next;
     }
   }
       child = child->next;
     }
   }
-  wxFAIL_MSG("wrong listbox index");
+  // No, I think it's reasonable to return -1 to indicate
+  // there is no selection. -- JACS
+//  wxFAIL_MSG("wrong listbox index");
   return -1;
 }
 
   return -1;
 }
 
index e50abc4759332a21f54c892fa52ceb7ab622120f..3883d1d7e27e6433eaf04323070b3d1e74158d4c 100644 (file)
@@ -56,7 +56,7 @@ bool wxCheckBox::Create(  wxWindow *parent, wxWindowID id, const wxString &label
 
   SetValidator( validator );
 
 
   SetValidator( validator );
 
-  SetLabel( label );
+  wxControl::SetLabel( label );
 
   m_widget = gtk_check_button_new_with_label( m_label );
  
 
   m_widget = gtk_check_button_new_with_label( m_label );
  
index fa5a38a225c8c6dfeb86e32faa1d8d832cde5e21..1e2e80ebc82b0cb25de040be918505bb0b88541a 100644 (file)
@@ -234,7 +234,9 @@ int wxListBox::GetSelection(void) const
       child = child->next;
     }
   }
       child = child->next;
     }
   }
-  wxFAIL_MSG("wrong listbox index");
+  // No, I think it's reasonable to return -1 to indicate
+  // there is no selection. -- JACS
+//  wxFAIL_MSG("wrong listbox index");
   return -1;
 }
 
   return -1;
 }
 
index 0b9de9be09596cc6017168bc5793b26bfe8b8270..9c98a3553fec69bc93ac309acb8d261c0f84e1b7 100644 (file)
@@ -150,10 +150,13 @@ bool wxResourceManager::Initialize()
   strcat(buf, "\\dialoged.ini");
   m_optionsResourceFilename = buf;
 #elif defined(__WXGTK__)
   strcat(buf, "\\dialoged.ini");
   m_optionsResourceFilename = buf;
 #elif defined(__WXGTK__)
-  char buf[500];
-  wxGetHomeDir(buf);
-  strcat(buf, "/.dialogedrc");
+  /*
+  wxString buf;
+  wxGetHomeDir(&buf);
+  buf += "/.dialogedrc";
   m_optionsResourceFilename = buf;
   m_optionsResourceFilename = buf;
+  */
+  m_optionsResourceFilename = ".dialoged.rc";
 #else
 #error "Unsupported platform."
 #endif
 #else
 #error "Unsupported platform."
 #endif
index e086dd23779046da0bfb0f821b6785ca5700526b..0f6248f12d45926d5bf17bc620de7a1673ff8519 100644 (file)
@@ -182,8 +182,11 @@ bool wxPropertyListView::UpdatePropertyDisplayInList(wxProperty *property)
 //  UpdatePropertyList(FALSE);
 //#endif
 
 //  UpdatePropertyList(FALSE);
 //#endif
 
+  // TODO: why is this necessary?
+#ifdef __WXMSW__
   if (currentlySelected > -1)
     propertyScrollingList->SetSelection(currentlySelected);
   if (currentlySelected > -1)
     propertyScrollingList->SetSelection(currentlySelected);
+#endif
 
   return TRUE;
 }
 
   return TRUE;
 }
@@ -952,7 +955,7 @@ bool wxPropertyListValidator::OnDisplayValue(wxProperty *property, wxPropertyLis
 //  view->GetValueText()->Show(TRUE);
   wxString str(property->GetValue().GetStringRepresentation());
 
 //  view->GetValueText()->Show(TRUE);
   wxString str(property->GetValue().GetStringRepresentation());
 
-  view->GetValueText()->SetValue(str.GetData());
+  view->GetValueText()->SetValue(str);
   return TRUE;
 }
 
   return TRUE;
 }
 
@@ -1159,8 +1162,12 @@ bool wxBoolListValidator::OnDisplayValue(wxProperty *property, wxPropertyListVie
     return FALSE;
   wxString str(property->GetValue().GetStringRepresentation());
 
     return FALSE;
   wxString str(property->GetValue().GetStringRepresentation());
 
-  view->GetValueText()->SetValue(str.GetData());
-  view->GetValueList()->SetStringSelection(str.GetData());
+  view->GetValueText()->SetValue(str);
+
+  if (view->GetValueList()->IsShown())
+  {
+    view->GetValueList()->SetStringSelection(str);
+  }
   return TRUE;
 }
 
   return TRUE;
 }
 
@@ -1274,10 +1281,10 @@ bool wxStringListValidator::OnDisplayValue(wxProperty *property, wxPropertyListV
   if (!view->GetValueText())
     return FALSE;
   wxString str(property->GetValue().GetStringRepresentation());
   if (!view->GetValueText())
     return FALSE;
   wxString str(property->GetValue().GetStringRepresentation());
-  view->GetValueText()->SetValue(str.GetData());
-  if (strings && view->GetValueList() && view->GetValueList()->Number() > 0)
+  view->GetValueText()->SetValue(str);
+  if (strings && view->GetValueList() && view->GetValueList()->IsShown() && view->GetValueList()->Number() > 0)
   {
   {
-    view->GetValueList()->SetStringSelection(str.GetData());
+    view->GetValueList()->SetStringSelection(str);
   }
   return TRUE;
 }
   }
   return TRUE;
 }
@@ -1611,7 +1618,7 @@ bool wxListOfStringsListValidator::OnDisplayValue(wxProperty *property, wxProper
   if (!view->GetValueText())
     return FALSE;
   wxString str(property->GetValue().GetStringRepresentation());
   if (!view->GetValueText())
     return FALSE;
   wxString str(property->GetValue().GetStringRepresentation());
-  view->GetValueText()->SetValue(str.GetData());
+  view->GetValueText()->SetValue(str);
   return TRUE;
 }
 
   return TRUE;
 }