Пример #1
0
SFTPTreeViewBase::~SFTPTreeViewBase()
{
    this->Disconnect(ID_OPEN_ACCOUNT_MANAGER, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(SFTPTreeViewBase::OnOpenAccountManager), NULL, this);
    this->Disconnect(ID_SFTP_CONNECT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(SFTPTreeViewBase::OnConnection), NULL, this);
    this->Disconnect(ID_ADD_BOOKMARK, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(SFTPTreeViewBase::OnAddBookmark), NULL, this);
    this->Disconnect(ID_ADD_BOOKMARK, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnAddBookmarkUI), NULL, this);
    this->Disconnect(ID_SSH_OPEN_TERMINAL, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(SFTPTreeViewBase::OnOpenTerminal), NULL, this);
    this->Disconnect(ID_SSH_OPEN_TERMINAL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnOpenTerminalUI), NULL, this);
    m_choiceAccount->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(SFTPTreeViewBase::OnChoiceAccount), NULL, this);
    m_choiceAccount->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnChoiceAccountUI), NULL, this);
    m_staticText49->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnGotoLocationUI), NULL, this);
    m_textCtrlQuickJump->Disconnect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(SFTPTreeViewBase::OnGotoLocation), NULL, this);
    m_textCtrlQuickJump->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnGotoLocationUI), NULL, this);
    m_treeListCtrl->Disconnect(wxEVT_TREELIST_ITEM_EXPANDING, wxTreeListEventHandler(SFTPTreeViewBase::OnItemExpanding), NULL, this);
    m_treeListCtrl->Disconnect(wxEVT_TREELIST_ITEM_ACTIVATED, wxTreeListEventHandler(SFTPTreeViewBase::OnItemActivated), NULL, this);
    m_treeListCtrl->Disconnect(wxEVT_TREELIST_ITEM_CONTEXT_MENU, wxTreeListEventHandler(SFTPTreeViewBase::OnContextMenu), NULL, this);
    m_treeListCtrl->Disconnect(wxEVT_TREELIST_SELECTION_CHANGED, wxTreeListEventHandler(SFTPTreeViewBase::OnSelectionChanged), NULL, this);
    
    std::map<int, wxMenu*>::iterator menuIter = m_dropdownMenus.begin();
    for( ; menuIter != m_dropdownMenus.end(); ++menuIter ) {
        wxDELETE( menuIter->second );
    }
    m_dropdownMenus.clear();

    this->Disconnect(wxID_ANY, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(SFTPTreeViewBase::ShowAuiToolMenu), NULL, this);
}
Пример #2
0
GuiFrame::~GuiFrame()
{
    this->Disconnect(kID_PLAY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(GuiFrame::OnToolPlayTrigered), NULL, this);
    this->Disconnect(kID_REFRESH, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(GuiFrame::OnToolRefreshTrigered), NULL, this);
    game_folder_page_->Disconnect(wxEVT_TREELIST_SELECTION_CHANGED, wxTreeListEventHandler(GuiFrame::OnGameFolderSelectionChanged), NULL, this);
    game_list_page_->Disconnect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(GuiFrame::OnGameListSelectionChanged), NULL, this);
    game_list_page_->Disconnect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(GuiFrame::OnGameListItemActivated), NULL, this);
    game_list_page_->Disconnect(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEventHandler(GuiFrame::OnGameListItemContextMenu), NULL, this);
    game_exinfo_notebook_->Disconnect(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, wxToolbookEventHandler(GuiFrame::OnExinfoPageChanged), NULL, this);
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    
    auimgr_->UnInit();
    delete auimgr_;

}
Пример #3
0
GuiFrame::GuiFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxFrame(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC9A20InitBitmapResources();
        bBitmapLoaded = true;
    }
    
    m_menuBar46 = new wxMenuBar(0);
    this->SetMenuBar(m_menuBar46);
    
    auimgr_ = new wxAuiManager;
    auimgr_->SetManagedWindow( this );
    auimgr_->SetFlags( wxAUI_MGR_LIVE_RESIZE|wxAUI_MGR_TRANSPARENT_HINT|wxAUI_MGR_TRANSPARENT_DRAG|wxAUI_MGR_ALLOW_ACTIVE_PANE|wxAUI_MGR_ALLOW_FLOATING);
    auimgr_->GetArtProvider()->SetMetric( wxAUI_DOCKART_PANE_BORDER_SIZE, 0);
    auimgr_->GetArtProvider()->SetMetric(wxAUI_DOCKART_GRADIENT_TYPE, wxAUI_GRADIENT_NONE);
    
    standard_toolbar_ = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxAUI_TB_PLAIN_BACKGROUND|wxAUI_TB_DEFAULT_STYLE|wxAUI_TB_VERTICAL);
    standard_toolbar_->SetToolBitmapSize(wxSize(32,32));
    
    auimgr_->AddPane(standard_toolbar_, wxAuiPaneInfo().Direction(wxAUI_DOCK_LEFT).Layer(0).Row(0).Position(0).MinSize(64,-1).Fixed().CaptionVisible(false).MaximizeButton(false).CloseButton(false).MinimizeButton(false).PinButton(false));
    
    standard_toolbar_->AddTool(kID_PLAY, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("tool_play")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL);
    
    standard_toolbar_->AddTool(kID_REFRESH, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("tool_refresh")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL);
    
    standard_toolbar_->AddTool(rrrr, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("tool_play (copy)")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL);
    standard_toolbar_->Realize();
    
    game_folder_panel_ = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    
    auimgr_->AddPane(game_folder_panel_, wxAuiPaneInfo().Direction(wxAUI_DOCK_LEFT).Layer(0).Row(1).Position(0).BestSize(100,100).MinSize(100,100).MaxSize(100,100).CaptionVisible(false).MaximizeButton(false).CloseButton(false).MinimizeButton(false).PinButton(false));
    
    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxVERTICAL);
    game_folder_panel_->SetSizer(boxSizer12);
    
    game_folder_page_ = new wxTreeListCtrl(game_folder_panel_, kID_FOLDER_PAGE, wxDefaultPosition, wxSize(-1,-1), wxTL_DEFAULT_STYLE);
    
    boxSizer12->Add(game_folder_page_, 1, wxEXPAND, 5);
    
    game_list_panel_ = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    
    auimgr_->AddPane(game_list_panel_, wxAuiPaneInfo().Direction(wxAUI_DOCK_CENTER).Layer(0).Row(0).Position(0).BestSize(100,100).MinSize(100,100).MaxSize(100,100).CaptionVisible(false).MaximizeButton(false).CloseButton(false).MinimizeButton(false).PinButton(false));
    
    wxBoxSizer* boxSizer14 = new wxBoxSizer(wxVERTICAL);
    game_list_panel_->SetSizer(boxSizer14);
    
    game_list_page_ = new wxDataViewCtrl(game_list_panel_, kID_LIST_PAGE, wxDefaultPosition, wxSize(-1,-1), wxDV_ROW_LINES|wxDV_SINGLE);
    
    game_list_page_Model = new TreeListModel;
    game_list_page_Model->SetColCount( 0 );
    game_list_page_->AssociateModel(game_list_page_Model.get() );
    
    boxSizer14->Add(game_list_page_, 1, wxEXPAND, 5);
    
    infobar_ = new wxInfoBar(game_list_panel_, wxID_ANY);
    infobar_->SetSize(wxSize(-1,-1));
    
    boxSizer14->Add(infobar_, 0, wxEXPAND, 5);
    
    game_exinfo_panel_ = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    
    auimgr_->AddPane(game_exinfo_panel_, wxAuiPaneInfo().Direction(wxAUI_DOCK_RIGHT).Layer(0).Row(0).Position(0).BestSize(100,100).MinSize(100,100).MaxSize(100,100).CaptionVisible(false).MaximizeButton(false).CloseButton(false).MinimizeButton(false).PinButton(false));
    auimgr_->Update();
    
    wxBoxSizer* boxSizer112 = new wxBoxSizer(wxVERTICAL);
    game_exinfo_panel_->SetSizer(boxSizer112);
    
    image_toolbar_ = new wxToolBar(game_exinfo_panel_, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTB_FLAT);
    image_toolbar_->SetToolBitmapSize(wxSize(16,16));
    
    boxSizer112->Add(image_toolbar_, 0, 0, 5);
    
    image_toolbar_->AddTool(kID_IMAGE_BUTTON00, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_CHECK, _("marquee"), wxT(""), NULL);
    
    image_toolbar_->AddTool(kID_IMAGE_BUTTON01, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_CHECK, _("snapshot"), wxT(""), NULL);
    
    image_toolbar_->AddTool(kID_IMAGE_BUTTON02, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_CHECK, _("flyer"), wxT(""), NULL);
    
    image_toolbar_->AddTool(kID_IMAGE_BUTTON03, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_CHECK, _("cabinet"), wxT(""), NULL);
    
    image_toolbar_->AddTool(kID_IMAGE_BUTTON04, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_CHECK, _("control panel"), wxT(""), NULL);
    
    image_toolbar_->AddTool(kID_IMAGE_BUTTON05, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_CHECK, _("PCB"), wxT(""), NULL);
    
    image_toolbar_->AddTool(kID_IMAGE_BUTTONLAST, _("Tool Label"), wxXmlResource::Get()->LoadBitmap(wxT("placeholder16")), wxNullBitmap, wxITEM_CHECK, _("other"), wxT(""), NULL);
    image_toolbar_->Realize();
    
    game_exinfo_notebook_ = new wxToolbook(game_exinfo_panel_, kID_EXINFO_NOTEBOOK, wxDefaultPosition, wxSize(-1,-1), wxTBK_HORZ_LAYOUT|wxTBK_BUTTONBAR|wxBK_RIGHT|wxBK_DEFAULT);
    game_exinfo_notebook_->SetName(wxT("game_exinfo_notebook_"));
    wxImageList* game_exinfo_notebook__il = new wxImageList(32, 32);
    game_exinfo_notebook_->AssignImageList(game_exinfo_notebook__il);
    
    boxSizer112->Add(game_exinfo_notebook_, 1, wxEXPAND, 5);
    
    information_panel_ = new wxPanel(game_exinfo_notebook_, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    int information_panel_ImgIndex;
    information_panel_ImgIndex = game_exinfo_notebook__il->Add(wxXmlResource::Get()->LoadBitmap(wxT("page_command")));
    game_exinfo_notebook_->AddPage(information_panel_, wxT(""), false, information_panel_ImgIndex);
    
    wxBoxSizer* boxSizer248 = new wxBoxSizer(wxVERTICAL);
    information_panel_->SetSizer(boxSizer248);
    
    #if wxUSE_WEBVIEW
    information_page_ = wxWebView::New(information_panel_, wxID_ANY, _("about:blank"), wxDefaultPosition, wxSize(-1,-1), wxWebViewBackendDefault, 0);
    
    boxSizer248->Add(information_page_, 1, wxEXPAND, 5);
    #endif // wxUSE_WEBVIEW
    
    history_panel_ = new wxPanel(game_exinfo_notebook_, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    int history_panel_ImgIndex;
    history_panel_ImgIndex = game_exinfo_notebook__il->Add(wxXmlResource::Get()->LoadBitmap(wxT("page_history")));
    game_exinfo_notebook_->AddPage(history_panel_, wxT(""), false, history_panel_ImgIndex);
    
    wxBoxSizer* boxSizer36 = new wxBoxSizer(wxVERTICAL);
    history_panel_->SetSizer(boxSizer36);
    
    #if wxUSE_WEBVIEW
    history_page_ = wxWebView::New(history_panel_, wxID_ANY, _("about:blank"), wxDefaultPosition, wxSize(-1,-1), wxWebViewBackendDefault, 0);
    
    boxSizer36->Add(history_page_, 1, wxEXPAND, 5);
    #endif // wxUSE_WEBVIEW
    
    mameinfo_panel_ = new wxPanel(game_exinfo_notebook_, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    int mameinfo_panel_ImgIndex;
    mameinfo_panel_ImgIndex = game_exinfo_notebook__il->Add(wxXmlResource::Get()->LoadBitmap(wxT("page_command")));
    game_exinfo_notebook_->AddPage(mameinfo_panel_, wxT(""), false, mameinfo_panel_ImgIndex);
    
    wxBoxSizer* boxSizer7621 = new wxBoxSizer(wxVERTICAL);
    mameinfo_panel_->SetSizer(boxSizer7621);
    
    #if wxUSE_WEBVIEW
    mameinfo_page_ = wxWebView::New(mameinfo_panel_, wxID_ANY, _("about:blank"), wxDefaultPosition, wxSize(-1,-1), wxWebViewBackendDefault, 0);
    
    boxSizer7621->Add(mameinfo_page_, 1, wxEXPAND, 5);
    #endif // wxUSE_WEBVIEW
    
    driverinfo_panel_ = new wxPanel(game_exinfo_notebook_, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    int driverinfo_panel_ImgIndex;
    driverinfo_panel_ImgIndex = game_exinfo_notebook__il->Add(wxXmlResource::Get()->LoadBitmap(wxT("page_command")));
    game_exinfo_notebook_->AddPage(driverinfo_panel_, wxT(""), false, driverinfo_panel_ImgIndex);
    
    wxBoxSizer* boxSizer765 = new wxBoxSizer(wxVERTICAL);
    driverinfo_panel_->SetSizer(boxSizer765);
    
    #if wxUSE_WEBVIEW
    driverinfo_page_ = wxWebView::New(driverinfo_panel_, wxID_ANY, _("about:blank"), wxDefaultPosition, wxSize(-1,-1), wxWebViewBackendDefault, 0);
    
    boxSizer765->Add(driverinfo_page_, 1, wxEXPAND, 5);
    #endif // wxUSE_WEBVIEW
    
    command_panel_ = new wxPanel(game_exinfo_notebook_, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    int command_panel_ImgIndex;
    command_panel_ImgIndex = game_exinfo_notebook__il->Add(wxXmlResource::Get()->LoadBitmap(wxT("page_command")));
    game_exinfo_notebook_->AddPage(command_panel_, wxT(""), false, command_panel_ImgIndex);
    
    wxBoxSizer* boxSizer7625 = new wxBoxSizer(wxVERTICAL);
    command_panel_->SetSizer(boxSizer7625);
    
    #if wxUSE_WEBVIEW
    command_page_ = wxWebView::New(command_panel_, wxID_ANY, _("about:blank"), wxDefaultPosition, wxSize(-1,-1), wxWebViewBackendDefault, 0);
    
    boxSizer7625->Add(command_page_, 1, wxEXPAND, 5);
    #endif // wxUSE_WEBVIEW
    
    story_panel_ = new wxPanel(game_exinfo_notebook_, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    int story_panel_ImgIndex;
    story_panel_ImgIndex = game_exinfo_notebook__il->Add(wxXmlResource::Get()->LoadBitmap(wxT("page_command")));
    game_exinfo_notebook_->AddPage(story_panel_, wxT(""), false, story_panel_ImgIndex);
    
    wxBoxSizer* boxSizer762 = new wxBoxSizer(wxVERTICAL);
    story_panel_->SetSizer(boxSizer762);
    
    #if wxUSE_WEBVIEW
    story_page_ = wxWebView::New(story_panel_, wxID_ANY, _("about:blank"), wxDefaultPosition, wxSize(-1,-1), wxWebViewBackendDefault, 0);
    
    boxSizer762->Add(story_page_, 1, wxEXPAND, 5);
    #endif // wxUSE_WEBVIEW
    
    other_panel_ = new wxPanel(game_exinfo_notebook_, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    int other_panel_ImgIndex;
    other_panel_ImgIndex = game_exinfo_notebook__il->Add(wxXmlResource::Get()->LoadBitmap(wxT("page_command")));
    game_exinfo_notebook_->AddPage(other_panel_, wxT(""), false, other_panel_ImgIndex);
    
    wxBoxSizer* boxSizer76 = new wxBoxSizer(wxVERTICAL);
    other_panel_->SetSizer(boxSizer76);
    
    #if wxUSE_WEBVIEW
    other_page_ = wxWebView::New(other_panel_, wxID_ANY, _("about:blank"), wxDefaultPosition, wxSize(-1,-1), wxWebViewBackendDefault, 0);
    
    boxSizer76->Add(other_page_, 1, wxEXPAND, 5);
    #endif // wxUSE_WEBVIEW
    
    status_bar_ = new wxStatusBar(this, wxID_ANY, wxSTB_DEFAULT_STYLE);
    status_bar_->SetFieldsCount(2);
    this->SetStatusBar(status_bar_);
    
    
    #if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(game_exinfo_notebook_)){
        wxPersistenceManager::Get().RegisterAndRestore(game_exinfo_notebook_);
    } else {
        wxPersistenceManager::Get().Restore(game_exinfo_notebook_);
    }
    #endif
    
    SetName(wxT("GuiFrame"));
    SetSizeHints(500,300);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    CentreOnParent(wxBOTH);
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    this->Connect(kID_PLAY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(GuiFrame::OnToolPlayTrigered), NULL, this);
    this->Connect(kID_REFRESH, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(GuiFrame::OnToolRefreshTrigered), NULL, this);
    game_folder_page_->Connect(wxEVT_TREELIST_SELECTION_CHANGED, wxTreeListEventHandler(GuiFrame::OnGameFolderSelectionChanged), NULL, this);
    game_list_page_->Connect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(GuiFrame::OnGameListSelectionChanged), NULL, this);
    game_list_page_->Connect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(GuiFrame::OnGameListItemActivated), NULL, this);
    game_list_page_->Connect(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEventHandler(GuiFrame::OnGameListItemContextMenu), NULL, this);
    game_exinfo_notebook_->Connect(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, wxToolbookEventHandler(GuiFrame::OnExinfoPageChanged), NULL, this);
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    #if wxUSE_WEBVIEW
    
    #endif // wxUSE_WEBVIEW
    
}
Пример #4
0
SFTPTreeViewBase::SFTPTreeViewBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC32BEInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* boxSizer16 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer16);
    
    m_auibar = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxAUI_TB_PLAIN_BACKGROUND|wxAUI_TB_DEFAULT_STYLE);
    m_auibar->SetToolBitmapSize(wxSize(16,16));
    
    boxSizer16->Add(m_auibar, 0, wxEXPAND, 5);
    
    m_auibar->AddTool(ID_OPEN_ACCOUNT_MANAGER, _("Open account manager..."), wxXmlResource::Get()->LoadBitmap(wxT("ssh-16")), wxNullBitmap, wxITEM_NORMAL, _("Open account manager..."), _("Open account manager..."), NULL);
    
    m_auibar->AddTool(ID_SFTP_CONNECT, _("Connect"), wxXmlResource::Get()->LoadBitmap(wxT("connect")), wxNullBitmap, wxITEM_NORMAL, _("Establish connection to the selected account"), _("Establish connection to the selected account"), NULL);
    
    m_auibar->AddTool(ID_SFTP_DISCONNECT, _("Disconnect"), wxXmlResource::Get()->LoadBitmap(wxT("disconnect")), wxNullBitmap, wxITEM_NORMAL, _("Close the current connection"), _("Close the current connection"), NULL);
    
    m_auibar->AddTool(ID_ADD_BOOKMARK, _("Add Bookmark"), wxXmlResource::Get()->LoadBitmap(wxT("bookmark")), wxNullBitmap, wxITEM_NORMAL, _("Add Bookmark"), _("Add Bookmark"), NULL);
    wxAuiToolBarItem* m_toolbarItemAddBookmark = m_auibar->FindToolByIndex(m_auibar->GetToolCount()-1);
    if (m_toolbarItemAddBookmark) {
        m_toolbarItemAddBookmark->SetHasDropDown(true);
    }
    m_auibar->Realize();
    
    wxArrayString m_choiceAccountArr;
    m_choiceAccount = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), m_choiceAccountArr, 0);
    
    boxSizer16->Add(m_choiceAccount, 0, wxALL|wxEXPAND, 2);
    
    wxFlexGridSizer* flexGridSizer43 = new wxFlexGridSizer(0, 2, 0, 0);
    flexGridSizer43->SetFlexibleDirection( wxBOTH );
    flexGridSizer43->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    flexGridSizer43->AddGrowableCol(1);
    
    boxSizer16->Add(flexGridSizer43, 0, wxEXPAND, 5);
    
    m_staticText49 = new wxStaticText(this, wxID_ANY, _("Go to:"), wxDefaultPosition, wxSize(-1,-1), 0);
    
    flexGridSizer43->Add(m_staticText49, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textCtrlQuickJump = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), wxTE_PROCESS_ENTER);
    
    flexGridSizer43->Add(m_textCtrlQuickJump, 0, wxALL|wxEXPAND, 5);
    
    m_treeListCtrl = new wxTreeListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(200,200), wxTL_DEFAULT_STYLE|wxTL_MULTIPLE);
    
    boxSizer16->Add(m_treeListCtrl, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 2);
    
    m_treeListCtrl->AppendColumn(_("Name"), 400, wxALIGN_LEFT, wxCOL_RESIZABLE|wxCOL_SORTABLE);
    m_treeListCtrl->AppendColumn(_("Type"), 100, wxALIGN_LEFT, wxCOL_RESIZABLE);
    m_treeListCtrl->AppendColumn(_("Size"), 100, wxALIGN_LEFT, wxCOL_RESIZABLE);
    
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    Centre(wxBOTH);
    // Connect events
    this->Connect(ID_OPEN_ACCOUNT_MANAGER, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(SFTPTreeViewBase::OnOpenAccountManager), NULL, this);
    this->Connect(ID_SFTP_CONNECT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(SFTPTreeViewBase::OnConnect), NULL, this);
    this->Connect(ID_SFTP_CONNECT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnConnectUI), NULL, this);
    this->Connect(ID_SFTP_DISCONNECT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(SFTPTreeViewBase::OnDisconnect), NULL, this);
    this->Connect(ID_SFTP_DISCONNECT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnDisconnectUI), NULL, this);
    this->Connect(ID_ADD_BOOKMARK, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(SFTPTreeViewBase::OnAddBookmark), NULL, this);
    this->Connect(ID_ADD_BOOKMARK, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnAddBookmarkUI), NULL, this);
    m_staticText49->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnGotoLocationUI), NULL, this);
    m_textCtrlQuickJump->Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(SFTPTreeViewBase::OnGotoLocation), NULL, this);
    m_textCtrlQuickJump->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnGotoLocationUI), NULL, this);
    m_treeListCtrl->Connect(wxEVT_TREELIST_ITEM_EXPANDING, wxTreeListEventHandler(SFTPTreeViewBase::OnItemExpanding), NULL, this);
    m_treeListCtrl->Connect(wxEVT_TREELIST_ITEM_ACTIVATED, wxTreeListEventHandler(SFTPTreeViewBase::OnItemActivated), NULL, this);
    m_treeListCtrl->Connect(wxEVT_TREELIST_ITEM_CONTEXT_MENU, wxTreeListEventHandler(SFTPTreeViewBase::OnContextMenu), NULL, this);
    
    this->Connect(wxID_ANY, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(SFTPTreeViewBase::ShowAuiToolMenu), NULL, this);
}
Пример #5
0
SFTPTreeViewBase::SFTPTreeViewBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC32BEInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* boxSizer16 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer16);
    
    m_auibar = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxAUI_TB_PLAIN_BACKGROUND|wxAUI_TB_DEFAULT_STYLE);
    m_auibar->SetToolBitmapSize(wxSize(16,16));
    
    boxSizer16->Add(m_auibar, 0, wxEXPAND, 5);
    
    m_auibar->AddTool(ID_OPEN_ACCOUNT_MANAGER, _("Open account manager..."), wxXmlResource::Get()->LoadBitmap(wxT("ssh-16")), wxNullBitmap, wxITEM_NORMAL, _("Open account manager..."), _("Open account manager..."), NULL);
    
    m_auibar->AddTool(ID_SFTP_CONNECT, _("Disconnected. Click to connect"), wxXmlResource::Get()->LoadBitmap(wxT("disconnect")), wxNullBitmap, wxITEM_NORMAL, _("Disconnected. Click to connect"), _("Disconnected. Click to connect"), NULL);
    
    m_auibar->AddTool(ID_ADD_BOOKMARK, _("Add Bookmark"), wxXmlResource::Get()->LoadBitmap(wxT("bookmark")), wxNullBitmap, wxITEM_NORMAL, _("Add Bookmark"), _("Select a folder from the tree view and add it as a bookmark"), NULL);
    wxAuiToolBarItem* m_toolbarItemAddBookmark = m_auibar->FindToolByIndex(m_auibar->GetToolCount()-1);
    if (m_toolbarItemAddBookmark) {
        m_toolbarItemAddBookmark->SetHasDropDown(true);
    }
    
    m_auibar->AddTool(ID_SSH_OPEN_TERMINAL, _("Open Terminal"), wxXmlResource::Get()->LoadBitmap(wxT("terminal")), wxNullBitmap, wxITEM_NORMAL, _("Open Terminal"), _("Open Terminal"), NULL);
    wxAuiToolBarItem* m_toolbarItemTerminal = m_auibar->FindToolByIndex(m_auibar->GetToolCount()-1);
    if (m_toolbarItemTerminal) {
        m_toolbarItemTerminal->SetHasDropDown(true);
        m_menu96 = new wxMenu;
        m_menuItemCustomize = new wxMenuItem(m_menu96, ID_SFTP_CUSTOMIZE, _("SFTP Settings..."), _("SFTP Settings..."), wxITEM_NORMAL);
        m_menu96->Append(m_menuItemCustomize);
        
        m_dropdownMenus.insert(std::make_pair( m_toolbarItemTerminal->GetId(), m_menu96) );
    }
    m_auibar->Realize();
    
    wxArrayString m_choiceAccountArr;
    m_choiceAccount = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), m_choiceAccountArr, 0);
    
    boxSizer16->Add(m_choiceAccount, 0, wxALL|wxEXPAND, 2);
    
    wxFlexGridSizer* flexGridSizer43 = new wxFlexGridSizer(0, 2, 0, 0);
    flexGridSizer43->SetFlexibleDirection( wxBOTH );
    flexGridSizer43->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    flexGridSizer43->AddGrowableCol(1);
    
    boxSizer16->Add(flexGridSizer43, 0, wxEXPAND, 5);
    
    m_staticText49 = new wxStaticText(this, wxID_ANY, _("Go to:"), wxDefaultPosition, wxSize(-1,-1), 0);
    
    flexGridSizer43->Add(m_staticText49, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textCtrlQuickJump = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), wxTE_PROCESS_ENTER);
    m_textCtrlQuickJump->SetToolTip(_("Type a path and hit ENTER"));
    #if wxVERSION_NUMBER >= 3000
    m_textCtrlQuickJump->SetHint(wxT(""));
    #endif
    
    flexGridSizer43->Add(m_textCtrlQuickJump, 0, wxALL|wxEXPAND, 5);
    
    m_treeListCtrl = new wxTreeListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(200,200), wxTL_DEFAULT_STYLE|wxTL_MULTIPLE);
    
    boxSizer16->Add(m_treeListCtrl, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 2);
    
    m_treeListCtrl->AppendColumn(_("Name"), 400, wxALIGN_LEFT, wxCOL_RESIZABLE|wxCOL_SORTABLE);
    m_treeListCtrl->AppendColumn(_("Type"), 100, wxALIGN_LEFT, wxCOL_RESIZABLE);
    m_treeListCtrl->AppendColumn(_("Size"), 50, wxALIGN_LEFT, wxCOL_RESIZABLE);
    
    SetName(wxT("SFTPTreeViewBase"));
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    CentreOnParent(wxBOTH);
    // Connect events
    this->Connect(ID_OPEN_ACCOUNT_MANAGER, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(SFTPTreeViewBase::OnOpenAccountManager), NULL, this);
    this->Connect(ID_SFTP_CONNECT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(SFTPTreeViewBase::OnConnection), NULL, this);
    this->Connect(ID_ADD_BOOKMARK, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(SFTPTreeViewBase::OnAddBookmark), NULL, this);
    this->Connect(ID_ADD_BOOKMARK, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnAddBookmarkUI), NULL, this);
    this->Connect(ID_SSH_OPEN_TERMINAL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnOpenTerminalUI), NULL, this);
    this->Connect(ID_SSH_OPEN_TERMINAL, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(SFTPTreeViewBase::OnOpenTerminal), NULL, this);
    this->Connect(m_menuItemCustomize->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SFTPTreeViewBase::OnSftpSettings), NULL, this);
    m_choiceAccount->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(SFTPTreeViewBase::OnChoiceAccount), NULL, this);
    m_choiceAccount->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnChoiceAccountUI), NULL, this);
    m_staticText49->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnGotoLocationUI), NULL, this);
    m_textCtrlQuickJump->Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(SFTPTreeViewBase::OnGotoLocation), NULL, this);
    m_textCtrlQuickJump->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(SFTPTreeViewBase::OnGotoLocationUI), NULL, this);
    m_treeListCtrl->Connect(wxEVT_TREELIST_ITEM_EXPANDING, wxTreeListEventHandler(SFTPTreeViewBase::OnItemExpanding), NULL, this);
    m_treeListCtrl->Connect(wxEVT_TREELIST_ITEM_ACTIVATED, wxTreeListEventHandler(SFTPTreeViewBase::OnItemActivated), NULL, this);
    m_treeListCtrl->Connect(wxEVT_TREELIST_ITEM_CONTEXT_MENU, wxTreeListEventHandler(SFTPTreeViewBase::OnContextMenu), NULL, this);
    m_treeListCtrl->Connect(wxEVT_TREELIST_SELECTION_CHANGED, wxTreeListEventHandler(SFTPTreeViewBase::OnSelectionChanged), NULL, this);
    
    this->Connect(wxID_ANY, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(SFTPTreeViewBase::ShowAuiToolMenu), NULL, this);
}