]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/deprecated/proplist.cpp
Aliases for [G|S]etCaretLineBack
[wxWidgets.git] / contrib / src / deprecated / proplist.cpp
index e962342691c978a6e85d2a0e580d091201ef179e..29c17d30f25b2e344e14d2874f401ed49ccf393f 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        proplist.cpp
+// Name:        contrib/src/deprecated/proplist.cpp
 // Purpose:     Property list classes
 // Author:      Julian Smart
 // Modified by:
 // Purpose:     Property list classes
 // Author:      Julian Smart
 // Modified by:
 // headers
 // ----------------------------------------------------------------------------
 
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
-    #pragma implementation "proplist.h"
-#endif
-
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
@@ -223,7 +219,7 @@ wxString wxPropertyListView::MakeNameValueString(wxString name, wxString value)
   wxString theString(name);
 
   int nameWidth = 25;
   wxString theString(name);
 
   int nameWidth = 25;
-  int padWith = nameWidth - theString.Length();
+  int padWith = nameWidth - theString.length();
   if (padWith < 0)
     padWith = 0;
 
   if (padWith < 0)
     padWith = 0;
 
@@ -465,7 +461,7 @@ bool wxPropertyListView::CreateControls()
     }
 
     m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, wxEmptyString,
     }
 
     m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, wxEmptyString,
-       wxDefaultPosition, wxSize(wxDefaultCoord, smallButtonSize.y), wxPROCESS_ENTER);
+       wxDefaultPosition, wxSize(wxDefaultCoord, smallButtonSize.y), wxTE_PROCESS_ENTER);
     m_valueText->Disable();
     topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder );
 
     m_valueText->Disable();
     topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder );
 
@@ -1341,21 +1337,27 @@ void wxFilenameListValidator::OnEdit(wxProperty *property, wxPropertyListView *v
   if (!view->GetValueText())
     return;
 
   if (!view->GetValueText())
     return;
 
-  wxString s = wxFileSelector(
-     m_filenameMessage.GetData(),
-     wxPathOnly(property->GetValue().StringValue()),
-     wxFileNameFromPath(property->GetValue().StringValue()),
-     NULL,
-     m_filenameWildCard.GetData(),
-     0,
-     parentWindow);
-  if ( !s.empty() )
-  {
-    property->GetValue() = s;
-    view->DisplayProperty(property);
-    view->UpdatePropertyDisplayInList(property);
-    view->OnPropertyChanged(property);
-  }
+#if wxUSE_FILEDLG
+    wxString s = wxFileSelector(
+        m_filenameMessage.GetData(),
+        wxPathOnly(property->GetValue().StringValue()),
+        wxFileNameFromPath(property->GetValue().StringValue()),
+        NULL,
+        m_filenameWildCard.GetData(),
+        0,
+        parentWindow);
+    if ( !s.empty() )
+    {
+        property->GetValue() = s;
+        view->DisplayProperty(property);
+        view->UpdatePropertyDisplayInList(property);
+        view->OnPropertyChanged(property);
+    }
+#else
+    wxUnusedVar(property);
+    wxUnusedVar(view);
+    wxUnusedVar(parentWindow);
+#endif
 }
 
 ///
 }
 
 ///
@@ -1435,14 +1437,14 @@ void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *vie
     return;
 
   wxChar *s = property->GetValue().StringValue();
     return;
 
   wxChar *s = property->GetValue().StringValue();
-  int r = 0;
-  int g = 0;
-  int b = 0;
+  unsigned char r = 0;
+  unsigned char g = 0;
+  unsigned char b = 0;
   if (s)
   {
   if (s)
   {
-    r = wxHexToDec(s);
-    g = wxHexToDec(s+2);
-    b = wxHexToDec(s+4);
+    r = (unsigned char)wxHexToDec(s);
+    g = (unsigned char)wxHexToDec(s+2);
+    b = (unsigned char)wxHexToDec(s+4);
   }
 
   wxColour col(r,g,b);
   }
 
   wxColour col(r,g,b);
@@ -1453,7 +1455,9 @@ void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *vie
 
   for (int i = 0; i < 16; i++)
   {
 
   for (int i = 0; i < 16; i++)
   {
-    wxColour colour(i*16, i*16, i*16);
+    wxColour colour((unsigned char)(i*16),
+                    (unsigned char)(i*16),
+                    (unsigned char)(i*16));
     data.SetCustomColour(i, colour);
   }
 
     data.SetCustomColour(i, colour);
   }
 
@@ -1573,17 +1577,17 @@ void wxListOfStringsListValidator::OnEdit( wxProperty *property,
 
 class wxPropertyStringListEditorDialog: public wxDialog
 {
 
 class wxPropertyStringListEditorDialog: public wxDialog
 {
-  public:
+public:
     wxPropertyStringListEditorDialog(wxWindow *parent, const wxString& title,
         const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
           long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("stringEditorDialogBox")):
                wxDialog(parent, wxID_ANY, title, pos, size, windowStyle, name)
     {
     wxPropertyStringListEditorDialog(wxWindow *parent, const wxString& title,
         const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
           long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("stringEditorDialogBox")):
                wxDialog(parent, wxID_ANY, title, pos, size, windowStyle, name)
     {
-      m_stringList = NULL;
-      m_stringText = NULL;
-      m_listBox = NULL;
-      sm_dialogCancelled = false;
-      m_currentSelection = -1;
+        m_stringList = NULL;
+        m_stringText = NULL;
+        m_listBox = NULL;
+        sm_dialogCancelled = false;
+        m_currentSelection = -1;
     }
     ~wxPropertyStringListEditorDialog(void) {}
     void OnCloseWindow(wxCloseEvent& event);
     }
     ~wxPropertyStringListEditorDialog(void) {}
     void OnCloseWindow(wxCloseEvent& event);
@@ -1656,7 +1660,7 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
 
   dialog->m_stringText = new wxPropertyStringListEditorText(dialog,
        wxID_PROP_SL_TEXT, wxEmptyString, wxPoint(5, 240),
 
   dialog->m_stringText = new wxPropertyStringListEditorText(dialog,
        wxID_PROP_SL_TEXT, wxEmptyString, wxPoint(5, 240),
-       wxSize(300, wxDefaultCoord), wxPROCESS_ENTER);
+       wxSize(300, wxDefaultCoord), wxTE_PROCESS_ENTER);
   dialog->m_stringText->Disable();
 
   wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
   dialog->m_stringText->Disable();
 
   wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
@@ -1710,30 +1714,30 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
 
 void wxPropertyStringListEditorDialog::OnStrings(wxCommandEvent& WXUNUSED(event))
 {
 
 void wxPropertyStringListEditorDialog::OnStrings(wxCommandEvent& WXUNUSED(event))
 {
-  int sel = m_listBox->GetSelection();
-  if (sel != wxNOT_FOUND)
-  {
-    m_currentSelection = sel;
+    int sel = m_listBox->GetSelection();
+    if (sel != wxNOT_FOUND)
+    {
+        m_currentSelection = sel;
 
 
-    ShowCurrentSelection();
-  }
+        ShowCurrentSelection();
+    }
 }
 
 void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event))
 {
 }
 
 void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event))
 {
-  int sel = m_listBox->GetSelection();
-  if (sel == wxNOT_FOUND)
-    return;
+    int sel = m_listBox->GetSelection();
+    if (sel == wxNOT_FOUND)
+        return;
 
 
-  wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(sel);
-  if (!node)
-    return;
+    wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(sel);
+    if (!node)
+        return;
 
 
-  m_listBox->Delete(sel);
-  delete[] (wxChar *)node->GetData();
-  delete node;
-  m_currentSelection = -1;
-  m_stringText->SetValue(wxEmptyString);
+    m_listBox->Delete(sel);
+    delete[] (wxChar *)node->GetData();
+    delete node;
+    m_currentSelection = -1;
+    m_stringText->SetValue(wxEmptyString);
 }
 
 void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
 }
 
 void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
@@ -1751,34 +1755,34 @@ void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
 
 void wxPropertyStringListEditorDialog::OnOK(wxCommandEvent& WXUNUSED(event))
 {
 
 void wxPropertyStringListEditorDialog::OnOK(wxCommandEvent& WXUNUSED(event))
 {
-  SaveCurrentSelection();
-  EndModal(wxID_OK);
-  // Close(true);
-  this->Destroy();
+    SaveCurrentSelection();
+    EndModal(wxID_OK);
+//  Close(true);
+    this->Destroy();
 }
 
 void wxPropertyStringListEditorDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
 {
 }
 
 void wxPropertyStringListEditorDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
 {
-  sm_dialogCancelled = true;
-  EndModal(wxID_CANCEL);
+    sm_dialogCancelled = true;
+    EndModal(wxID_CANCEL);
 //  Close(true);
 //  Close(true);
-  this->Destroy();
+    this->Destroy();
 }
 
 void wxPropertyStringListEditorDialog::OnText(wxCommandEvent& event)
 {
 }
 
 void wxPropertyStringListEditorDialog::OnText(wxCommandEvent& event)
 {
-  if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER)
-  {
-    SaveCurrentSelection();
-  }
+    if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER)
+    {
+        SaveCurrentSelection();
+    }
 }
 
 void
 wxPropertyStringListEditorDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
 {
 }
 
 void
 wxPropertyStringListEditorDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
 {
-  SaveCurrentSelection();
+    SaveCurrentSelection();
 
 
-  Destroy();
+    Destroy();
 }
 
 void wxPropertyStringListEditorDialog::SaveCurrentSelection()
 }
 
 void wxPropertyStringListEditorDialog::SaveCurrentSelection()