[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1440
Date       : Thu Jul 13 19:18:13 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/dlgmgr.cpp
   M /Trunk/XaraLX/wxXtra/treebook.cpp

Options dialog improvements


Diff:
Index: Trunk/XaraLX/wxXtra/treebook.cpp
===================================================================
--- Trunk/XaraLX/wxXtra/treebook.cpp	(revision 1439)
+++ Trunk/XaraLX/wxXtra/treebook.cpp	(revision 1440)
@@ -28,6 +28,31 @@
 #include <wx/imaglist.h>
 #include <wx/settings.h>
 
+// This overrides the dumb implementation in wx2.6
+class wxCamTreeCtrl : public wxTreeCtrl
+{
+public:
+    wxCamTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
+               const wxPoint& pos = wxDefaultPosition,
+               const wxSize& size = wxDefaultSize,
+               long style = wxTR_DEFAULT_STYLE,
+               const wxValidator &validator = wxDefaultValidator,
+               const wxString& name = wxTreeCtrlNameStr) :
+				wxTreeCtrl(parent, id, pos, size, style, validator, name), m_fixedBestSize(160,80) {}
+
+	virtual wxSize DoGetBestSize() const
+	{
+    	return m_fixedBestSize;
+	}
+
+	virtual void SetFixedBestSize(wxSize s)
+	{
+		m_fixedBestSize=s;
+	}
+
+	wxSize m_fixedBestSize;
+};
+
 // ----------------------------------------------------------------------------
 // various wxWidgets macros
 // ----------------------------------------------------------------------------
@@ -100,7 +125,7 @@
                             style, wxDefaultValidator, name) )
         return false;
 
-    m_bookctrl = new wxTreeCtrl
+    m_bookctrl = new wxCamTreeCtrl
                  (
                     this,
                     wxID_TREEBOOKTREEVIEW,
@@ -803,8 +828,6 @@
 
     wxSize cbestsize = m_bookctrl->GetBestSize();
 
-    cbestsize.SetWidth(200); // ***BODGE FOR OPTIONS DIALOG***
-
     wxSize sizeClient = GetClientSize(),
                  sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(),
                  sizeCtrl =  cbestsize + sizeBorder;
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1439)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1440)
@@ -275,7 +275,12 @@
 #endif
 #if wxUSE_TREEBOOK || wxXTRA_TREEBOOK
 			case TABTYPE_TREE:
-				return new wxTreebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style );
+				{
+					wxTreebook * t = new wxTreebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style );
+					if (t)
+						t->GetTreeCtrl()->SetIndent(0);
+					return t;
+				}
 				break;
 #else
 			// Default to a ListBook if there is no treebook availables


Xara