From: Nicolas Boichat Date: Thu, 13 May 2004 20:55:52 +0000 (+0000) Subject: - wxbRestorePanel : Width adjustments between the tree view window and the file view... X-Git-Tag: Release-1.34.3~40 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=83a50ae6f43cd7fed0215dd0d525e8f5d814b3c1;p=bacula%2Fbacula - wxbRestorePanel : Width adjustments between the tree view window and the file view window are now possible. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1364 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/wx-console/CHANGELOG b/bacula/src/wx-console/CHANGELOG index 290441b710..f40860f599 100644 --- a/bacula/src/wx-console/CHANGELOG +++ b/bacula/src/wx-console/CHANGELOG @@ -1,3 +1,7 @@ +13-05-2004 : + - wxbRestorePanel : Width adjustments between the tree view window + and the file view window are now possible. + 10-05-2004 : - wxbTableParser : wxHashMap replaced by wxArray diff --git a/bacula/src/wx-console/TODO b/bacula/src/wx-console/TODO index 64e1ce56ee..d065bb19bb 100644 --- a/bacula/src/wx-console/TODO +++ b/bacula/src/wx-console/TODO @@ -13,6 +13,8 @@ Mac OS X : "You must first get a unique identifier for your application, Mac OS X : Ask kern for the status of this distribution (who is the package releaser ?) +wxbRestorePanel : List's columns not resized correctly in the first directory. + [postponed to July:] wxbConfigFileEditor : create a more precise editor, with something like @@ -45,10 +47,6 @@ wxbRestorePanel : There needs to be some way of marking/unmarking a range of with ctl-click. The GTX console uses a button to mark/unmark the selected entries. -wxbRestorePanel : Is there any way to add a width adjustment handle between - the tree view window and the file view window so that the - width of the tree view can be changed? - wxbRestorePanel : Use ".default job=RestoreFiles" to get defaults parameters when changing a restore parameter fails. @@ -61,7 +59,7 @@ GTK : Improve look wxblistctrl/wxbtreectrl : Find why events are not forwarded correctly to parent' parent, and correct bad actual implementation. - (remove wxbTreeListPanel) + (remove wxbSplitterWindow) general : find out why I had to modify string.cpp and string.h + In include/wx/string.h, replace line 195 by diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index 77cb8e68fa..2684abb0f0 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -216,9 +216,9 @@ BEGIN_EVENT_TABLE(wxbRestorePanel, wxPanel) EVT_BUTTON(ConfigCancel, wxbRestorePanel::OnConfigCancel) END_EVENT_TABLE() -BEGIN_EVENT_TABLE(wxbTreeListPanel, wxPanel) - EVT_TREE_MARKED_EVENT(wxID_ANY, wxbTreeListPanel::OnTreeMarked) - EVT_LIST_MARKED_EVENT(wxID_ANY, wxbTreeListPanel::OnListMarked) +BEGIN_EVENT_TABLE(wxbSplitterWindow, wxSplitterWindow) + EVT_TREE_MARKED_EVENT(wxID_ANY, wxbSplitterWindow::OnTreeMarked) + EVT_LIST_MARKED_EVENT(wxID_ANY, wxbSplitterWindow::OnListMarked) END_EVENT_TABLE() /* @@ -255,17 +255,18 @@ wxbRestorePanel::wxbRestorePanel(wxWindow* parent): wxbPanel(parent) { mainSizer->Add(firstSizer, 1, wxEXPAND, 10); - treelistPanel = new wxbTreeListPanel(this); + //treelistPanel = new wxbTreeListPanel(this); - wxFlexGridSizer* treelistSizer = new wxFlexGridSizer(1, 2, 10, 10); + //wxFlexGridSizer* treelistSizer = new wxFlexGridSizer(1, 2, 10, 10); + treelistPanel = new wxbSplitterWindow(this); tree = new wxbTreeCtrl(treelistPanel, TreeCtrl, wxDefaultPosition, wxSize(200,50)); - treelistSizer->Add(tree, 1, wxEXPAND, 10); - + //treelistSizer->Add(tree, 1, wxEXPAND, 10); + tree->SetImageList(imagelist); list = new wxbListCtrl(treelistPanel, ListCtrl, wxDefaultPosition, wxSize(200,50)); - treelistSizer->Add(list, 1, wxEXPAND, 10); + //treelistSizer->Add(list, 1, wxEXPAND, 10); list->SetImageList(imagelist, wxIMAGE_LIST_SMALL); @@ -299,12 +300,14 @@ wxbRestorePanel::wxbRestorePanel(wxWindow* parent): wxbPanel(parent) { info.SetAlign(wxLIST_FORMAT_RIGHT); list->InsertColumn(6, info); - treelistSizer->AddGrowableCol(1); - treelistSizer->AddGrowableRow(0); + treelistPanel->SplitVertically(tree, list, 200); - treelistPanel->SetSizer(treelistSizer); - treelistSizer->SetSizeHints(treelistPanel); + //treelistSizer->AddGrowableCol(1); + //treelistSizer->AddGrowableRow(0); + //treelistPanel->SetSizer(treelistSizer); + //treelistSizer->SetSizeHints(treelistPanel); + treelistPanel->Show(false); wxbConfig* config = new wxbConfig(); @@ -1093,7 +1096,7 @@ void wxbRestorePanel::CmdList(wxTreeItemId item) { } UpdateTreeItem(item, (tree->GetSelection() == item)); - if (list->GetItemCount() > 1) { + if (list->GetItemCount() >= 1) { int firstwidth = list->GetSize().GetWidth(); for (int i = 2; i < 7; i++) { list->SetColumnWidth(i, wxLIST_AUTOSIZE); @@ -1104,7 +1107,7 @@ void wxbRestorePanel::CmdList(wxTreeItemId item) { firstwidth -= 18; list->SetColumnWidth(1, wxLIST_AUTOSIZE); if (list->GetColumnWidth(1) < firstwidth) { - list->SetColumnWidth(1, firstwidth-20); + list->SetColumnWidth(1, firstwidth-25); } } } @@ -1969,14 +1972,14 @@ void wxbRestorePanel::OnConfigCancel(wxCommandEvent& WXUNUSED(event)) { /* TODO : correct that bad implementation of tree marked event forwarding */ -wxbTreeListPanel::wxbTreeListPanel(wxbRestorePanel* parent): wxPanel(parent, -1) { +wxbSplitterWindow::wxbSplitterWindow(wxbRestorePanel* parent): wxSplitterWindow(parent, -1) { this->parent = parent; } -void wxbTreeListPanel::OnTreeMarked(wxbTreeMarkedEvent& event) { +void wxbSplitterWindow::OnTreeMarked(wxbTreeMarkedEvent& event) { parent->OnTreeMarked(event); } -void wxbTreeListPanel::OnListMarked(wxbListMarkedEvent& event) { +void wxbSplitterWindow::OnListMarked(wxbListMarkedEvent& event) { parent->OnListMarked(event); } diff --git a/bacula/src/wx-console/wxbrestorepanel.h b/bacula/src/wx-console/wxbrestorepanel.h index 45121595cb..5105c868d0 100644 --- a/bacula/src/wx-console/wxbrestorepanel.h +++ b/bacula/src/wx-console/wxbrestorepanel.h @@ -39,6 +39,7 @@ #include #include #include +#include #include "wxbutils.h" @@ -46,7 +47,7 @@ #include "wxbtreectrl.h" #include "wxblistctrl.h" -class wxbTreeListPanel; +class wxbSplitterWindow; /* * wxbPanel for restoring files @@ -177,7 +178,7 @@ class wxbRestorePanel : public wxbPanel /* Components */ wxBoxSizer *centerSizer; /* Center sizer */ - wxbTreeListPanel *treelistPanel; /* Panel which contains tree and list */ + wxbSplitterWindow *treelistPanel; /* Panel which contains tree and list */ wxbConfigPanel *configPanel; /* Panel which contains initial restore options */ wxbConfigPanel *restorePanel; /* Panel which contains final restore options */ @@ -205,14 +206,14 @@ class wxbRestorePanel : public wxbPanel wxTextCtrl* cfgWhen; wxTextCtrl* cfgPriority;*/ - friend class wxbTreeListPanel; + friend class wxbSplitterWindow; DECLARE_EVENT_TABLE(); }; -class wxbTreeListPanel: public wxPanel { +class wxbSplitterWindow: public wxSplitterWindow { public: - wxbTreeListPanel(wxbRestorePanel* parent); + wxbSplitterWindow(wxbRestorePanel* parent); private: void OnTreeMarked(wxbTreeMarkedEvent& event); void OnListMarked(wxbListMarkedEvent& event);