Esempio n. 1
0
void CLoadSavePropPage::OnBnClickedButtonSave()
{
    const int MAX_BUFFER_SIZE = 1024;

    CFileDialog FileDialog(FALSE);
    CString strBuffer;

    FileDialog.GetOFN().lpstrFile = strBuffer.GetBuffer(MAX_BUFFER_SIZE);
    FileDialog.GetOFN().nMaxFile = MAX_BUFFER_SIZE;
    FileDialog.GetOFN().lpstrDefExt = TEXT(".txt");
    FileDialog.GetOFN().lpstrFilter = TEXT("Text Files(*.txt)\0*.txt\0All Files(*.*)\0*.*\0\0");

    INT_PTR nRet = FileDialog.DoModal();
    strBuffer.ReleaseBuffer();

    if (nRet == IDOK)
    {
        CString strFileName = FileDialog.GetPathName();
        
        CString strText;
        m_TextEdit.GetWindowText(strText);

        CStrList StrList;
        StrList.SetText(strText);

        StrList.SaveToFile(strFileName, false);
    }
}
Esempio n. 2
0
void CCommaTextPropPage::OnBnClickedButtonGetCommatext()
{
    CStrList StrList;
    CString strEditText, strCommaText;

    m_Edit1.GetWindowText(strEditText);
    StrList.SetText(strEditText);
    strCommaText = StrList.GetCommaText();
    
    m_CommaTextEdit.SetWindowText(strCommaText);
}
Esempio n. 3
0
void CSortPropPage::OnBnClickedButtonSort()
{
    CString strText;
    m_TextEdit.GetWindowText(strText);

    CStrList StrList;
    StrList.SetText(strText);

    StrList.SetSorted(true);

    m_TextEdit.SetWindowText(StrList.GetText());
}
Esempio n. 4
0
void CIndexOfPropPage::OnBnClickedButtonIndexofname()
{
    CString strText;
    m_TextEdit.GetWindowText(strText);
    CString strParam;
    m_IndexOfNameParamEdit.GetWindowText(strParam);

    CStrList StrList;
    StrList.SetText(strText);

    int nIndex = StrList.IndexOfName(strParam);
    m_IndexOfNameResultEdit.SetWindowText(IntToStr(nIndex));
}