Major changes to Dialog Editor (still at alpha level)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
92
utils/dialoged/src/edtree.cpp
Normal file
92
utils/dialoged/src/edtree.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: edtree.cpp
|
||||
// Purpose: Resource editor project management tree
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "edtree.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
|
||||
#include "wx/checkbox.h"
|
||||
#include "wx/button.h"
|
||||
#include "wx/choice.h"
|
||||
#include "wx/listbox.h"
|
||||
#include "wx/radiobox.h"
|
||||
#include "wx/statbox.h"
|
||||
#include "wx/gauge.h"
|
||||
#include "wx/slider.h"
|
||||
#include "wx/textctrl.h"
|
||||
#endif
|
||||
|
||||
#include "edtree.h"
|
||||
#include "reseditr.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(wxResourceEditorProjectTree, wxTreeCtrl)
|
||||
EVT_LEFT_DCLICK(wxResourceEditorProjectTree::LeftDClick)
|
||||
EVT_TREE_SEL_CHANGED(IDC_TREECTRL, wxResourceEditorProjectTree::OnSelChanged)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxResourceEditorProjectTree::wxResourceEditorProjectTree(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
long style):
|
||||
wxTreeCtrl(parent, id, pos, size, style)
|
||||
{
|
||||
}
|
||||
|
||||
void wxResourceEditorProjectTree::LeftDClick(wxMouseEvent& event)
|
||||
{
|
||||
#if 0
|
||||
long sel = GetSelection();
|
||||
if (sel == -1)
|
||||
return;
|
||||
|
||||
if (GetItemData(sel) == 0)
|
||||
return;
|
||||
|
||||
wxItemResource* res = (wxItemResource*) GetItemData(sel);
|
||||
wxString resType(res->GetType());
|
||||
if (resType != "wxDialog" && resType != "wxDialogBox" && resType != "wxPanel")
|
||||
return;
|
||||
|
||||
wxResourceEditorFrame *frame = (wxResourceEditorFrame *)wxWindow::GetParent();
|
||||
wxResourceManager *manager = frame->manager;
|
||||
|
||||
manager->EditSelectedResource();
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxResourceEditorProjectTree::OnSelChanged(wxTreeEvent& event)
|
||||
{
|
||||
long sel = GetSelection();
|
||||
if (sel == -1)
|
||||
return;
|
||||
|
||||
if (GetItemData(sel) == 0)
|
||||
return;
|
||||
|
||||
if (m_invalid)
|
||||
return;
|
||||
|
||||
wxItemResource* res = (wxItemResource*) GetItemData(sel);
|
||||
wxString resType(res->GetType());
|
||||
if (resType != "wxDialog" && resType != "wxDialogBox" && resType != "wxPanel")
|
||||
return;
|
||||
|
||||
wxResourceManager::GetCurrentResourceManager()->Edit(res);
|
||||
}
|
||||
|
Reference in New Issue
Block a user