]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/utils/wxrcedit/propframe.cpp
added .chm support for Unix (Markus Sinner)
[wxWidgets.git] / contrib / utils / wxrcedit / propframe.cpp
index 2909664c2294fe28f921fc9420e36af2208c217e..1e160c67e7c1900fda0007747d49f5dbf17bf1d5 100644 (file)
@@ -18,7 +18,7 @@
 #endif
 
 #include "wx/wx.h"
 #endif
 
 #include "wx/wx.h"
-#include "wx/xrc/xml.h"
+#include "wx/xml/xml.h"
 #include "wx/config.h"
 #include "splittree.h"
 #include "xmlhelpr.h"
 #include "wx/config.h"
 #include "splittree.h"
 #include "xmlhelpr.h"
@@ -38,7 +38,18 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
         PropsTree(wxWindow* parent, wxWindowID id, const wxPoint& pt = wxDefaultPosition,
             const wxSize& sz = wxDefaultSize, long style = wxTR_HAS_BUTTONS)
             : wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style),
         PropsTree(wxWindow* parent, wxWindowID id, const wxPoint& pt = wxDefaultPosition,
             const wxSize& sz = wxDefaultSize, long style = wxTR_HAS_BUTTONS)
             : wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style),
-              m_EditCtrl(NULL) {}
+              m_EditCtrl(NULL) 
+               {
+#if 0
+            // VS: Don't do it, it is *extremely* ugly.
+            //     FIXME: find a better solution.
+
+                       //make text larger so controls will fit properly
+                       wxFont font = GetFont();
+                       font.SetPointSize(font.GetPointSize()*1.5);
+                       SetFont(font);
+#endif
+        }
 
            void OnPaint(wxPaintEvent& event)
         {
 
            void OnPaint(wxPaintEvent& event)
         {
@@ -50,8 +61,8 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
             dc.SetDeviceOrigin(0, 0);
 
                wxPen pen(wxColour(_T("BLACK")), 1, wxSOLID);
             dc.SetDeviceOrigin(0, 0);
 
                wxPen pen(wxColour(_T("BLACK")), 1, wxSOLID);
-               dc.SetPen(pen);
-            
+               dc.SetPen(pen);          
+
                dc.SetBrush(* wxTRANSPARENT_BRUSH);
 
             wxSize clientSize = GetClientSize();
                dc.SetBrush(* wxTRANSPARENT_BRUSH);
 
             wxSize clientSize = GetClientSize();
@@ -63,6 +74,7 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
                        if (h.IsOk() && GetBoundingRect(h, itemRect))
                        {
                                cy = itemRect.GetTop();
                        if (h.IsOk() && GetBoundingRect(h, itemRect))
                        {
                                cy = itemRect.GetTop();
+
                                dc.DrawLine(0, cy, clientSize.x, cy);
                                lastH = h;
                        }
                                dc.DrawLine(0, cy, clientSize.x, cy);
                                lastH = h;
                        }
@@ -73,7 +85,7 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
                        dc.DrawLine(0, cy, clientSize.x, cy);
                }
         }
                        dc.DrawLine(0, cy, clientSize.x, cy);
                }
         }
-        
+
         void OnSelChange(wxTreeEvent& event)
         {
             if (m_EditCtrl != NULL)
         void OnSelChange(wxTreeEvent& event)
         {
             if (m_EditCtrl != NULL)
@@ -88,6 +100,7 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
             {
                 wxRect bounding;
                 GetBoundingRect(item, bounding);
             {
                 wxRect bounding;
                 GetBoundingRect(item, bounding);
+
                 bounding.SetX(0);
                 bounding.SetWidth(GetCompanionWindow()->GetSize().x); 
                 dt->EditCtrl->BeginEdit(bounding, item);
                 bounding.SetX(0);
                 bounding.SetWidth(GetCompanionWindow()->GetSize().x); 
                 dt->EditCtrl->BeginEdit(bounding, item);
@@ -168,7 +181,6 @@ class PropsValueWindow: public wxTreeCompanionWindow
             wxTreeItemId item = GetTreeCtrl()->HitTest(wxPoint(1, event.GetY()), flags);
             if (item.IsOk())
             {
             wxTreeItemId item = GetTreeCtrl()->HitTest(wxPoint(1, event.GetY()), flags);
             if (item.IsOk())
             {
-                GetTreeCtrl()->ScrollTo(item);
                 GetTreeCtrl()->SelectItem(item);
             }
         }
                 GetTreeCtrl()->SelectItem(item);
             }
         }
@@ -246,7 +258,7 @@ PropertiesFrame::PropertiesFrame()
     m_EditCtrls.Put(_T("integer"), new PropEditCtrlInt(this));
     m_EditCtrls.Put(_T("not_implemented"), new PropEditCtrlNull(this));
     m_EditCtrls.Put(_T("text"), new PropEditCtrlTxt(this));
     m_EditCtrls.Put(_T("integer"), new PropEditCtrlInt(this));
     m_EditCtrls.Put(_T("not_implemented"), new PropEditCtrlNull(this));
     m_EditCtrls.Put(_T("text"), new PropEditCtrlTxt(this));
-    m_EditCtrls.Put(_T("xmlid"), new PropEditCtrlXMLID(this));
+    m_EditCtrls.Put(_T("xmlid"), new PropEditCtrlXRCID(this));
     m_EditCtrls.Put(_T("font"), new PropEditCtrlFont(this));
     m_EditCtrls.Put(_T("choice"), new PropEditCtrlChoice(this));
     m_EditCtrls.Put(_T("file"), new PropEditCtrlFile(this));
     m_EditCtrls.Put(_T("font"), new PropEditCtrlFont(this));
     m_EditCtrls.Put(_T("choice"), new PropEditCtrlChoice(this));
     m_EditCtrls.Put(_T("file"), new PropEditCtrlFile(this));
@@ -277,7 +289,7 @@ void PropertiesFrame::ShowProps(wxXmlNode *node)
    m_Node = node;
    
    ClearProps();
    m_Node = node;
    
    ClearProps();
-   AddSingleProp(PropertyInfo(_T("xmlid"), _T("XMLID"), wxEmptyString));
+   AddSingleProp(PropertyInfo(_T("xmlid"), _T("XRCID"), wxEmptyString));
    AddProps(NodeHandler::Find(node)->GetPropsList(node));
    
    m_tree->Expand(m_tree->GetRootItem());
    AddProps(NodeHandler::Find(node)->GetPropsList(node));
    
    m_tree->Expand(m_tree->GetRootItem());