]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/utils/wxrcedit/propframe.cpp
wxX11:
[wxWidgets.git] / contrib / utils / wxrcedit / propframe.cpp
index 6c8af96feed417f62da9ad39354383d1c131dc1b..35022bd1267579179f2f528f4e10d76ea0a9e461 100644 (file)
@@ -18,7 +18,7 @@
 #endif
 
 #include "wx/wx.h"
 #endif
 
 #include "wx/wx.h"
-#include "wx/xml/xml.h"
+#include "wx/xrc/xml.h"
 #include "wx/config.h"
 #include "splittree.h"
 #include "xmlhelpr.h"
 #include "wx/config.h"
 #include "splittree.h"
 #include "xmlhelpr.h"
@@ -27,6 +27,7 @@
 #include "propedit.h"
 #include "pe_basic.h"
 #include "pe_adv.h"
 #include "propedit.h"
 #include "pe_basic.h"
 #include "pe_adv.h"
+#include "editor.h"
 
 // ------------- support classes --------
 
 
 // ------------- support classes --------
 
@@ -104,6 +105,19 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
                 m_EditCtrl = NULL;
             }
         }
                 m_EditCtrl = NULL;
             }
         }
+
+        void OnScroll(wxScrollWinEvent& event)
+        {
+            event.Skip();
+            if (event.GetOrientation() == wxHORIZONTAL) return;
+            if (!m_EditCtrl) return;
+            
+            wxTreeItemId id = GetSelection();
+            wxRect bounding;
+            GetBoundingRect(id, bounding);
+            
+            m_EditCtrl->Move(-1, bounding.y);
+        }
         
         PropEditCtrl *m_EditCtrl;
         
         
         PropEditCtrl *m_EditCtrl;
         
@@ -113,6 +127,7 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
 BEGIN_EVENT_TABLE(PropsTree, wxRemotelyScrolledTreeCtrl)
        EVT_PAINT(PropsTree::OnPaint)
     EVT_TREE_SEL_CHANGED(-1, PropsTree::OnSelChange)
 BEGIN_EVENT_TABLE(PropsTree, wxRemotelyScrolledTreeCtrl)
        EVT_PAINT(PropsTree::OnPaint)
     EVT_TREE_SEL_CHANGED(-1, PropsTree::OnSelChange)
+    EVT_SCROLLWIN(PropsTree::OnScroll)
 END_EVENT_TABLE()
 
 
 END_EVENT_TABLE()
 
 
@@ -157,7 +172,7 @@ class PropsValueWindow: public wxTreeCompanionWindow
                 GetTreeCtrl()->SelectItem(item);
             }
         }
                 GetTreeCtrl()->SelectItem(item);
             }
         }
-        
+
         DECLARE_EVENT_TABLE()
 };
 
         DECLARE_EVENT_TABLE()
 };
 
@@ -184,7 +199,13 @@ PropertiesFrame *PropertiesFrame::Get()
 }
 
 PropertiesFrame::PropertiesFrame()
 }
 
 PropertiesFrame::PropertiesFrame()
-    : wxFrame(NULL, -1, _("Properties"))
+    : wxFrame(EditorFrame::Get(), -1, _("Properties"),
+              wxDefaultPosition, wxDefaultSize,
+              wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR 
+#ifdef __WXMSW__
+              | wxFRAME_TOOL_WINDOW
+#endif
+              )
 {
     ms_Instance = this;
     m_Node = NULL;
 {
     ms_Instance = this;
     m_Node = NULL;
@@ -225,9 +246,11 @@ 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("font"), new PropEditCtrlFont(this));
     m_EditCtrls.Put(_T("choice"), new PropEditCtrlChoice(this));
+    m_EditCtrls.Put(_T("file"), new PropEditCtrlFile(this));
+    m_EditCtrls.Put(_T("imagefile"), new PropEditCtrlImageFile(this));
     m_EditCtrls.Put(_T(""), new PropEditCtrlNull(this));
             
     ClearProps();
     m_EditCtrls.Put(_T(""), new PropEditCtrlNull(this));
             
     ClearProps();
@@ -254,7 +277,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());