Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "topic_display_dialog.h"
00036 #include "topic_display.h"
00037
00038
00039 #include <wx/msgdlg.h>
00040
00041 namespace rxtools
00042 {
00043
00044 TopicDisplayDialog::TopicDisplayDialog(wxWindow* parent, bool multiselect, const std::string& message_type)
00045 : GenTopicDisplayDialog(parent)
00046 {
00047 topic_display_panel_ = new TopicDisplay(tree_panel_, message_type, false, tree_panel_->GetSize());
00048 topic_display_panel_->setMultiselectAllowed(multiselect);
00049
00050 topic_display_panel_->Connect(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( TopicDisplayDialog::onTreeItemActivated ), NULL, this );
00051 }
00052
00053 TopicDisplayDialog::~TopicDisplayDialog()
00054 {
00055 }
00056
00057 void TopicDisplayDialog::onOK(wxCommandEvent& event)
00058 {
00059 V_string selection;
00060 topic_display_panel_->getSelectedTopics(selection);
00061 if (!selection.empty())
00062 {
00063 EndModal(wxID_OK);
00064 }
00065 else
00066 {
00067 wxMessageBox(wxT("Please select a topic!"), wxT("No topic selected"), wxOK | wxCENTRE | wxICON_ERROR, this);
00068 }
00069 }
00070
00071 void TopicDisplayDialog::onCancel(wxCommandEvent& event)
00072 {
00073 EndModal(wxID_CANCEL);
00074 }
00075
00076 void TopicDisplayDialog::getSelection(V_string& selection)
00077 {
00078 topic_display_panel_->getSelectedTopics(selection);
00079 }
00080
00081 void TopicDisplayDialog::onTreeItemActivated(wxTreeEvent& event)
00082 {
00083 V_string selection;
00084 topic_display_panel_->getSelectedTopics(selection);
00085 if (!selection.empty())
00086 {
00087 EndModal(wxID_OK);
00088 }
00089 }
00090
00091 }