wxWidgets实现文件拖放

jie.lee posted @ 2010年10月10日 00:15 in 笔记 with tags wxWidgets , 5531 阅读

《使用wxwidgets进行跨平台的c++开发》第11章有介绍,参考例程在samples/dnd。其实很简单,只需几步:

#include <wx/dnd.h>
class DnDialogFile : public wxFileDropTarget
{
public:
    DnDialogFile(YourDialog *pOwner) { m_pOwner = pOwner; }

    virtual bool OnDropFiles(wxCoord x, wxCoord y,
                             const wxArrayString& filenames);
private:
    //对话框类,成员TextCtrlPath保存文件路径
    YourDialog *m_pOwner;

};

bool DnDialogFile::OnDropFiles(wxCoord, wxCoord, const wxArrayString& filenames)
{
    //设置文本框内容
    m_pOwner->TextCtrlPath->SetValue(filenames[0]);
    return true;
}

在对话框初始化时调用this->SetDropTarget(new DnDialogFile(this))。

Sikkim 2nd Class Te 说:
2023年8月01日 18:27

SCERT Sikkim Follows NCERT Curriculum These Textbooks are Updated as per the Syllabus Prescribed by SCERT Sikkim. Students of 2nd Class Should follow Prescribed Textbooks while Preparing for Exam.Our Sikkim 2nd Class Textbook 2024 Team Refer to the Respective Subject Textbook while Preparing the Final Important questions. Students Best Practice Study Materiel about Textbooks are the Fact that they are so Comprehensible that it does not require the aid of a Subject Literate.SCERT Sikkim once Publishes the Sikkim Elementary School Textbooks 2024 Other Study materials on the official web site, we will update the Information on this page.

SCERT Sikkim 5th Cl 说:
2023年8月01日 18:35

SCERT Sikkim Follows NCERT Curriculum These Textbooks are Updated as per the Syllabus Prescribed by SCERT Sikkim. Students of 5th Class Should follow Prescribed Textbooks while Preparing for Exam.Our SCERT Sikkim 5th Class Book 2024 Team Refer to the Respective Subject Textbook while Preparing the Final Important questions. Students Best Practice Study Materiel about Textbooks are the Fact that they are so Comprehensible that it does not require the aid of a Subject Literate.SCERT Sikkim once Publishes the Sikkim Elementary School Textbooks 2024 Other Study materials on the official web site, we will update the Information on this page.

jnanabhumiap.in 说:
2024年1月07日 01:45

JNANABHUMI AP provides a CBSE syllabus for all classes for the academic year 2024 has been designed as per the guidelines of the CBSE Board. The syllabus offers a conceptual background and lays the groundwork for the Class 10 Board exams. jnanabhumiap.in By visiting the page, students will find the downloadable pdf of the reduced CBSE 10th Syllabus along with the deleted portion of the syllabus for each subject. So, students are advised to prepare for the exam, as per the syllabus mentioned here.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter