Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Formatted contact information page so header is displayed better.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 24 Feb 2016 11:42:53 +0000 (11:42 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 24 Feb 2016 11:42:53 +0000 (11:42 +0000)
source/common/getcontactinfo.cpp

index b783d8b..c9e2256 100644 (file)
@@ -38,6 +38,8 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
 
        // Show message to user that the contact information is loading.
 
+       HTMLObj->SetBorders(0);
+               
        wxString PageData;
        
        wxFileSystem::AddHandler(new wxMemoryFSHandler);
@@ -122,20 +124,23 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
        PageData.append(wxT("<head>"));
        PageData.append(wxT("<title>Contact Information</title>"));     
        PageData.append(wxT("</head>"));
+       
+       // Process the CSS section.
+       
        PageData.append(wxT("<body>"));
 
        // Process the data in the vCard object.
        
        // Name (Display As)
        
-       PageData.append(wxT("<table>"));
+       PageData.append(wxT("<table style=\"background: #cccccc; width: 100%\">"));
        PageData.append(wxT("<tr>"));
-       PageData.append(wxT("<td>"));
+       PageData.append(wxT("<td style=\"width:100%\">"));
        PageData.append(wxT("<h2>"));
        PageData.append(vCardObj->Get(wxT("FN")));
        PageData.append(wxT("</h2>"));
        PageData.append(wxT("</td>"));
-       PageData.append(wxT("<td>"));
+       PageData.append(wxT("<td style=\"width: 200px;\">"));
        
        // Define common variables for ADR.
        
@@ -417,12 +422,13 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
        ContactData = vCardObj->GetByPartial(wxT("PHOTO"));
        
        bool AddBreak = FALSE;
+       wxString TypePageData;
        
        if (ContactData.PropCount > 1){
        
-               PageData.append(wxT("<img src=\"memory:cipto.png\" alt=\""));
-               PageData.append(_("This contact has multiple photos."));
-               PageData.append(wxT("\">"));
+               TypePageData.append(wxT("<img src=\"memory:cipto.png\" alt=\""));
+               TypePageData.append(_("This contact has multiple photos."));
+               TypePageData.append(wxT("\">"));
                AddBreak = TRUE;
        
        }
@@ -431,9 +437,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
        
        if (ContactData.PropCount > 1){
        
-               PageData.append(wxT("<img src=\"memory:cilog.png\" alt=\""));
-               PageData.append(_("This contact has multiple logos."));
-               PageData.append(wxT("\">"));
+               TypePageData.append(wxT("<img src=\"memory:cilog.png\" alt=\""));
+               TypePageData.append(_("This contact has multiple logos."));
+               TypePageData.append(wxT("\">"));
                AddBreak = TRUE;
        
        }
@@ -442,9 +448,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
        
        if (ContactData.PropCount >= 1){
        
-               PageData.append(wxT("<img src=\"memory:cisnd.png\" alt=\""));
-               PageData.append(_("This contact has audio information."));
-               PageData.append(wxT("\">"));
+               TypePageData.append(wxT("<img src=\"memory:cisnd.png\" alt=\""));
+               TypePageData.append(_("This contact has audio information."));
+               TypePageData.append(wxT("\">"));
                AddBreak = TRUE;
        
        }
@@ -453,9 +459,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
 
        if (ContactData.PropCount >= 1){
        
-               PageData.append(wxT("<img src=\"memory:cikey.png\" alt=\""));
-               PageData.append(_("This contact has crytographic keys."));
-               PageData.append(wxT("\">"));
+               TypePageData.append(wxT("<img src=\"memory:cikey.png\" alt=\""));
+               TypePageData.append(_("This contact has crytographic keys."));
+               TypePageData.append(wxT("\">"));
                AddBreak = TRUE;
        
        }
@@ -464,9 +470,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
        
        if (ContactData.PropCount >= 1){
        
-               PageData.append(wxT("<img src=\"memory:civen.png\" alt=\""));
-               PageData.append(_("This contact has vendor-specific information."));
-               PageData.append(wxT("\">"));
+               TypePageData.append(wxT("<img src=\"memory:civen.png\" alt=\""));
+               TypePageData.append(_("This contact has vendor-specific information."));
+               TypePageData.append(wxT("\">"));
                AddBreak = TRUE;
        
        }
@@ -475,13 +481,21 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
        
        if (ContactData.PropCount >= 1){
        
-               PageData.append(wxT("<img src=\"memory:ciext.png\" alt=\""));
-               PageData.append(_("This contact has extended information."));
-               PageData.append(wxT("\">"));
+               TypePageData.append(wxT("<img src=\"memory:ciext.png\" alt=\""));
+               TypePageData.append(_("This contact has extended information."));
+               TypePageData.append(wxT("\">"));
                AddBreak = TRUE;
 
        }
        
+       if (!TypePageData.IsEmpty()){
+               
+               PageData.append("<table style=\"{background: #dddddd; width:100%}\"><tr><td>");
+               PageData.append(TypePageData);
+               PageData.append("</tr></td></table>");
+               
+       }
+       
        if (AddBreak == TRUE){
        
                PageData.append(wxT("<br><br>"));
@@ -526,6 +540,8 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
                
        }
        
+       PageData.append("<table CELLPADDING=4 style=\"{width: 100%;}\"><tr><td>");
+       
        if (DataDisplay == TRUE){
        
                DataLines.Trim();
@@ -1618,6 +1634,8 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
 
        // Display the HTML document on the screen.
 
+       PageData.append("</td></tr></table>");
+       
        PageData.append(wxT("</body>"));
        PageData.append(wxT("</html>"));
 
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy