00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #if !defined(_XRB_FILEPANEL_HPP_)
00012 #define _XRB_FILEPANEL_HPP_
00013
00014 #include "xrb.hpp"
00015
00016 #include "xrb_containerwidget.hpp"
00017
00018 namespace Xrb
00019 {
00020
00021 class Label;
00022 class LineEdit;
00023
00024 class FilePanel : public ContainerWidget
00025 {
00026 public:
00027
00028 enum Operation
00029 {
00030 OP_OPEN = 0,
00031 OP_SAVE
00032 };
00033
00034 FilePanel (
00035 std::string const &title_text,
00036 Operation file_operation,
00037 ContainerWidget *parent,
00038 std::string const &name = "FilePanel");
00039 virtual ~FilePanel () { }
00040
00041 inline Operation FileOperation () const { return m_file_operation; }
00042 std::string const &Path () const;
00043
00044 inline SignalSender1<std::string const &> const *SenderSubmitPath () { return &m_sender_submit_path; }
00045 inline SignalSender1<std::string> const *SenderSubmitPathV () { return &m_sender_submit_path_v; }
00046
00047 protected:
00048
00049 virtual void UpdateRenderBackground ();
00050
00051 private:
00052
00053 void InternalPathSetByEnterKey (std::string const &path);
00054
00055 enum
00056 {
00057 LONGEST_FILESYSTEM_PATH_NAME = 512
00058 };
00059
00060
00061
00062
00063
00064 Label *m_title_label;
00065
00066 Operation m_file_operation;
00067
00068 LineEdit *m_path_edit;
00069
00070 SignalSender1<std::string const &> m_sender_submit_path;
00071 SignalSender1<std::string> m_sender_submit_path_v;
00072
00073 SignalReceiver1<std::string const &> m_internal_receiver_path_set_by_enter_key;
00074 };
00075
00076 }
00077
00078 #endif // !defined(_XRB_FILEPANEL_HPP_)