Solved

Updating Data in Controls in a Dialog Box

Posted on 1998-08-03
3
235 Views
Last Modified: 2013-11-19
I have to display some data in different controls such a List Box, List Control, Edit Box in a Dialog. However only partial data is shown i.e when 3 items are to be shown in a List box, only the last one is shown.

However when I click in the two empty spaces in the list box, the data is shown. Any idea how to solve the problem

0
Comment
Question by:kapoorv
3 Comments
 
LVL 1

Expert Comment

by:guruprasad031298
ID: 1320173
Can you post the code here ....
0
 

Author Comment

by:kapoorv
ID: 1320174

void CTermDialog::OnShowTerm()
{
      // TODO: Add your control notification handler code here

      UpdateData(TRUE);

      vConcat = get_terms((LPCTSTR)m_TermName,(LPCTSTR)m_Language);
      
      // Get the number of Terms with the same name  i.e. having Concat Links.
      if(vConcat.size() == 0)
      {            
            MessageBox("TERM NAME Does Not Exist in Database","TERM NAME ERROR",MB_ICONERROR);
            return;
      }
      else
      if(vConcat.size() == 1)
      {
            for(iConcat = vConcat.begin();iConcat != vConcat.end();++iConcat)
                   Show((*iConcat)->m_term_code);
      }
      else
            MessageBox("TERMS GREATER THAN 1");
}

void CTermDialog::Show(const char* sTermCode)
{
      CTerm      newTerm(sTermCode);
            
      m_Active = newTerm.get_active_ind();            // Get the Active Statue of the Term.
      m_Approval = newTerm.get_approved_ind();      // Get the Approval Indicator of the Term.
      m_Status = newTerm.get_status_ind();            // Get the Statue of the Term.
      
      vNote = newTerm.get_notes();       // Get the Notes associated with the Term.
      int x = 0;
      
      if(vNote.size() > 0)
      {      
            for(iNote = vNote.begin();iNote != vNote.end();++iNote)
            {
                  pNoteType[x] = (*iNote)->m_type;
                  //pNotesText[x]      = (*iNote)->m_text;
                  m_TestNoteType[x]      = (*iNote)->m_type;
                  m_TestNoteText[x]      = (*iNote)->m_text;
                  x++;
            }
      }

      x = 0;
      BOOL bFlag = TRUE;
      m_Notes = m_TestNoteText[0];
      SetDlgItemText(IDC_NOTES,m_Notes);

      while(bFlag)
      {

            switch(*pNoteType[0])
            {
                  case 'S':
                  {
                              m_ScopeNoteButton.SetState(1);
                              bFlag = FALSE;
                              break;
                  }
                  case 'T':
                  {
                              m_MaintainanceNoteButton.SetState(1);
                              bFlag = FALSE;
                              break;
                  }
                  case 'Q':
                        {
                              m_QueryNoteButton.SetState(1);
                              bFlag = FALSE;
                              break;
                        }
                  case 'O':
                        {
                              bFlag = FALSE;
                              break;      
                        }
                  default:
                              return;
            }
      }
            
      // Get the Classes with which the Term is associated.
      m_ClassCtrl.ResetContent(); // Deleting all the Enteries in the Class List Box
      vRmpClass = newTerm.get_classes();
      
      for(iRmpClass = vRmpClass.begin();iRmpClass != vRmpClass.end();++iRmpClass)
      {
            m_ClassDesc = (*iRmpClass)->m_code;
            m_ClassCtrl.AddString(m_ClassDesc);
      }
      
      // Get the Variants of the Term in the Language selected.
/*      iNoOfGridRows = m_VariantGrid->GetNumberRows();
      if(iNoOfGridRows > 1) // Deleting the Rows of the Previous Term
      {
            long i;
            for(i= iNoOfGridRows;i>0;i--)
                  m_VariantGrid->DeleteRow(i);
      }
      
      iNoOfGridRows = iNoOfVariants = 0;
      
      //      vVariant = newTerm.get_variants((LPCTSTR)m_Language);
      vVariant = newTerm.get_variants("NULL");
      for(iVariant = vVariant.begin();iVariant != vVariant.end();++iVariant)
      {
            iNoOfGridRows = m_VariantGrid->GetNumberRows();
            if(iNoOfVariants >= 1) // Adding Rows to the Grid depending on the number
                                             // of Variants for a Term.
                  m_VariantGrid->AppendRow();
            
            sVariantName            = (*iVariant)->m_name;
            sVariantType            = (*iVariant)->m_type;
            sVariantLanguage      = (*iVariant)->m_lang_code;
            
            m_VariantGrid->QuickSetText(0,iNoOfVariants,sVariantType);
            m_VariantGrid->QuickSetText(1,iNoOfVariants,sVariantName);
            m_VariantGrid->QuickSetText(2,iNoOfVariants,sVariantLanguage);
            
            iNoOfVariants++;
      }*/


      vCategory = newTerm.get_categories();       // Get the Category(s) to which the term belongs
      
      CString sCategoryType,sCategoryName;
      m_Category.DeleteAllItems();
      iNoOfVariants = 0;

      for(iCategory = vCategory.begin(); iCategory != vCategory.end();++iCategory)
      {
            sCategoryType = (*iCategory)->m_type;
            sCategoryDesc = (*iCategory)->m_desc;
            sCategoryName = (*iCategory)->m_code;
                              
            m_Category.InsertItem(iNoOfVariants,(LPCTSTR)sCategoryType); // Add the Category Type
            m_Category.SetItemText(iNoOfVariants,1,(LPCTSTR)sCategoryDesc); // Add the Category Type
            m_Category.SetItemText(iNoOfVariants,2,(LPCTSTR)sCategoryName); // Add the Category Name

            iNoOfVariants++;
      }

      m_CreateName = newTerm.get_created_by();
      m_CreateDate = newTerm.get_create_time();
      m_ModifyName = newTerm.get_updated_by();
      m_ModifyDate = newTerm.get_update_time();

      UpdateData(FALSE);
      
}
0
 
LVL 1

Accepted Solution

by:
kumarana earned 50 total points
ID: 1320175
Get the pointers to all your controls and call
InvalidateRect(TRUE) for all of your controls . This might work.
Do this after UpdateData( FALSE );
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ADO Memory leak with DELPHI 2007 37 155
xyBalance chalenge 58 88
ORA-01403: no data found 43 83
Window placement 17 65
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now