]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/choicdgg.cpp
Simplified BC++ makefiles; C++Builder 1.0 compilation seems to work;
[wxWidgets.git] / src / generic / choicdgg.cpp
index ee1280ca39b6ee2cd910298fd361140d490807e5..e9f54e59f934f67a91e6f78bc965ebaa6ab76605 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choicesg.cpp
+// Name:        choicdgg.cpp
 // Purpose:     Choice dialogs
 // Author:      Julian Smart
 // Modified by:
 
 #include "wx/generic/choicdgg.h"
 
-extern void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer);
+// Split message, using constraints to position controls
+static void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer)
+{
+  char *copyMessage = copystring(message);
+  size_t i = 0;
+  size_t len = strlen(copyMessage);
+  char *currentMessage = copyMessage;
+
+//  wxWindow *lastWindow = parent;
+
+  while (i < len) {
+    while ((i < len) && (copyMessage[i] != '\n')) i++;
+    if (i < len) copyMessage[i] = 0;
+    wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
+
+/*
+    wxLayoutConstraints *c = new wxLayoutConstraints;
+    c->left.SameAs             (parent, wxLeft, 10);
+    c->top.SameAs              (lastWindow, wxBottom, 5);
+    c->right.AsIs                      ();
+    c->height.AsIs                     ();
+
+    mess->SetConstraints(c);
+*/
+    sizer->AddSizerChild(mess);
+
+    messageList->Append(mess);
+
+    currentMessage = copyMessage + i + 1;
+  }
+  delete[] copyMessage;
+}
 
 wxString wxGetSingleChoice( const wxString& message, const wxString& caption, int n, 
                             const wxString *choices, wxWindow *parent,
@@ -307,7 +338,7 @@ void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event))
        {
                m_selection = listBox->GetSelection();
                m_stringSelection = listBox->GetStringSelection();
-               m_clientData = listBox->GetClientData(m_selection);
+               m_clientData = (char*)listBox->GetClientData(m_selection);
        }
 
        EndModal(wxID_OK);
@@ -320,7 +351,7 @@ void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
        {
                m_selection = listBox->GetSelection();
                m_stringSelection = listBox->GetStringSelection();
-               m_clientData = listBox->GetClientData(m_selection);
+               m_clientData = (char*)listBox->GetClientData(m_selection);
        }
 
        EndModal(wxID_OK);