Home > Software engineering >  The check box click event response problem?
The check box click event response problem?

Time:09-27

 
STD: : regex reg1 (" (doc) (. *) ");//it
STD: : regex reg2 (" (PPT) (. *) ");
STD: : regex reg3 (" (XLS) (. *) ");


Void CremarksecretDlg: : OnBnClickedCheck1 ()//it is a function of not return content
{
//TODO: add the control notification handler code
Int nstatus=(((CButton *) GetDlgItem (IDC_CHECK1)) - & gt; GetCheck ());
If (nstatus=1)
{
//if (match1 (" doc * ", "docx")==1 & amp; & Match1 (" doc * ", "doc")==1)
SuffixStr1=reg1;//| | suffixStr=_T (" docx ");
}
The else
{
SuffixStr1=_T (" - ");
}
}


Void CremarksecretDlg: : OnBnClickedCheck2 ()
{
//TODO: add the control notification handler code
Int nstatus=(((CButton *) GetDlgItem (IDC_CHECK2)) - & gt; GetCheck ());
If (nstatus=1)
{
SuffixStr2=_T (" PDF ");//if the symbol is==, this is the judgment rather than assignment, so is wrong,
}
The else
{
SuffixStr2=_T (" - ");
}
}


Void CremarksecretDlg: : OnBnClickedCheck3 ()
{
//TODO: add the control notification handler code
Int nstatus=(((CButton *) GetDlgItem (IDC_CHECK3)) - & gt; GetCheck ());
If (nstatus=1)
{
SuffixStr3=reg2;//| | suffixStr=_T (" PPTX ");
}
The else
{
SuffixStr3=_T (" - ");
}
}

Most of the code above is a regular expression that is used to specify the file type, the following three functions are check box click event response function,
The question now is, after I click the checkbox some click more than once, choose the file type, but later don't want to choose, but the display selected suffix
File types have appeared in the file list once the selected file type, such as the figure shown on the PPT file I finally didn't choose the file type but also show the actual in the file list, could you tell me how my program should be written to avoid this situation, thank you for your advice,

CodePudding user response:

Learn about the MVC

CodePudding user response:

I asked the question is too simple?

CodePudding user response:

This is the data problems,
1, you don't update in place, it is can't to the appropriate data updates to the list of each assignment list in the past,
2, the data you have mixed filename,
3, remember to keep the original list information update after deletion, avoid residual, or do you want to ensure that all are covered updates,

CodePudding user response:

I answer this question is usually an evangelist, granted to fishing and not awarded to the fish,

CodePudding user response:

Zhao4zhong1 teacher, if I do as you say, that the time is long, this is far hydrolyze not close thirsty, I actually is the essence of the problem considering the practical application is likely to click the check box, so the state of the check box in the end may be selected or not selected, but the situation is just click on the checkbox, its status is selected, then even if the state into not checked, but depending on the type of file suffix list will appear in the list of documents that type of file, the question now is how my code should be written, or what function method is used to avoid the above problems I said, please directly,

CodePudding user response:

Logic, and also is not very difficult, to step out, suggest to add a button, search,
Point button after check the checkbox, based on the input, the search results

CodePudding user response:

Can someone tell me, whether I now use the check box click event response function to realize this function, or with any other function to achieve this function?
  • Related