00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "xrb_filedialog.hpp"
00012
00013 #include "xrb_label.hpp"
00014 #include "xrb_layout.hpp"
00015 #include "xrb_lineedit.hpp"
00016 #include "xrb_widgetbackground.hpp"
00017
00018 namespace Xrb
00019 {
00020
00021 FileDialog::FileDialog (
00022 std::string const &title_text,
00023 FilePanel::Operation const file_operation,
00024 ContainerWidget *const parent,
00025 std::string const &name)
00026 :
00027 Dialog(DT_OK_CANCEL, parent, name),
00028 m_sender_submit_path(this),
00029 m_sender_submit_path_v(this),
00030 m_internal_receiver_path_submitted(&FileDialog::InternalPathSubmitted, this)
00031 {
00032 m_file_panel =
00033 new FilePanel(
00034 title_text,
00035 file_operation,
00036 DialogLayout());
00037
00038 SignalHandler::Connect1(
00039 m_file_panel->SenderSubmitPath(),
00040 &m_internal_receiver_path_submitted);
00041 }
00042
00043 void FileDialog::OKButtonActivated ()
00044 {
00045 Dialog::OKButtonActivated();
00046 m_sender_submit_path.Signal(Path());
00047 m_sender_submit_path_v.Signal(Path());
00048 }
00049
00050 void FileDialog::InternalPathSubmitted (std::string const &path)
00051 {
00052 ASSERT1(path == Path());
00053 OKButtonActivated();
00054 }
00055
00056 }