]> git.sur5r.net Git - bacula/bacula/commitdiff
- wxbRestorePanel : Width adjustments between the tree view window and the file view...
authorNicolas Boichat <nicolas@boichat.ch>
Thu, 13 May 2004 20:55:52 +0000 (20:55 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Thu, 13 May 2004 20:55:52 +0000 (20:55 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1364 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/wx-console/CHANGELOG
bacula/src/wx-console/TODO
bacula/src/wx-console/wxbrestorepanel.cpp
bacula/src/wx-console/wxbrestorepanel.h

index 290441b71083c868f96d71c9c975bac403c088c1..f40860f599a4dde0f4b8b428a66b179071ebf715 100644 (file)
@@ -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
 
index 64e1ce56ee609c363d5ec371db9bb0a715b9f446..d065bb19bb11027f154af3d8b3f3fb748b78acfb 100644 (file)
@@ -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
index 77cb8e68fab54d72412a3b351ead7e07442d8c2f..2684abb0f0d6fa108cb68aa97671f5c768b3db4a 100644 (file)
@@ -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);
 }
index 45121595cbd3b570ec1d13c9c5cd1ae22f7ab34c..5105c868d03201c574c973191aa3a33fce0d3c47 100644 (file)
@@ -39,6 +39,7 @@
 #include <wx/treectrl.h>
 #include <wx/gauge.h>
 #include <wx/stattext.h>
+#include <wx/splitter.h>
 
 #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);