Added BOUNDING BOX selection of multiple widgets on the dialogs by left clicking and dragging the mouse while holding down the left mouse button to draw a rectangle around the widgets to be selected

Added code to the popup menus to identify which widget/dialog was right clicked
Double clicking an item in the TREE pane will bring up the EDIT PROPERTIES dialog for the widget/dialog that was double clicked.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker 2000-12-21 00:31:01 +00:00
parent c0e6654255
commit e89ba6b3ca

View File

@ -39,6 +39,7 @@
BEGIN_EVENT_TABLE(wxResourceEditorProjectTree, wxTreeCtrl)
EVT_LEFT_DCLICK(wxResourceEditorProjectTree::LeftDClick)
//EVT_LEFT_DOWN(wxResourceEditorProjectTree::LeftClick)
EVT_TREE_SEL_CHANGED(IDC_TREECTRL, wxResourceEditorProjectTree::OnSelChanged)
END_EVENT_TABLE()
@ -48,6 +49,56 @@ wxTreeCtrl(parent, id, pos, size, style)
{
}
/*
void wxResourceEditorProjectTree::LeftClick(wxMouseEvent &event)
{
long sel = GetSelection();
if (sel == -1)
return;
if (GetItemData(sel) == 0)
{
event.Skip();
return;
}
wxItemResource* res = ((wxResourceTreeData *)GetItemData(sel))->GetResource();
wxString resType(res->GetType());
wxResourceEditorFrame *frame = (wxResourceEditorFrame *)wxWindow::GetParent();
wxResourceManager *manager = frame->manager;
long selParent = wxTreeCtrl::GetParent(sel);
if (resType != "wxDialog" && resType != "wxDialogBox" && resType != "wxPanel")
{
wxWindow *win = manager->FindWindowForResource(res);
// Check to see if the item selected in on the current dialog being
// displayed. If not, then we will have to find the items parent dialog
if (!win)
{
// The item is on a dialog other than the one currently being
// shown/worked on, so find the parent dialog, switch to use
// its resource manager, and then find the window in the dialog
wxItemResource* resParent = ((wxResourceTreeData *)GetItemData(selParent))->GetResource();
wxResourceManager::GetCurrentResourceManager()->Edit(resParent);
win = manager->FindWindowForResource(res);
}
/ *
if (win)
manager->GetCurrentResourceManager()->EditWindow(win);
* /
}
// else
// manager->EditSelectedResource();
event.Skip();
} // wxResourceEditorProjectTree::LeftClick()
*/
void wxResourceEditorProjectTree::LeftDClick(wxMouseEvent& WXUNUSED(event))
{
long sel = GetSelection();
@ -64,11 +115,38 @@ void wxResourceEditorProjectTree::LeftDClick(wxMouseEvent& WXUNUSED(event))
wxResourceEditorFrame *frame = (wxResourceEditorFrame *)wxWindow::GetParent();
wxResourceManager *manager = frame->manager;
long selParent = wxTreeCtrl::GetParent(sel);
wxWindow *win = NULL;
if (resType != "wxDialog" && resType != "wxDialogBox" && resType != "wxPanel")
manager->GetCurrentResourceManager()->EditWindow(manager->FindWindowForResource(res));
{
win = manager->FindWindowForResource(res);
// Check to see if the item selected in on the current dialog being
// displayed. If not, then we will have to find the items parent dialog
if (!win)
{
// The item is on a dialog other than the one currently being
// shown/worked on, so find the parent dialog, switch to use
// its resource manager, and then find the window in the dialog
wxItemResource* resParent = ((wxResourceTreeData *)GetItemData(selParent))->GetResource();
wxResourceManager::GetCurrentResourceManager()->Edit(resParent);
win = manager->FindWindowForResource(res);
}
if (win)
manager->GetCurrentResourceManager()->EditWindow(win);
}
else
manager->EditSelectedResource();
}
{
// manager->EditSelectedResource();
win = manager->FindWindowForResource(res);
wxResourceManager::GetCurrentResourceManager()->EditWindow(win);
}
} // wxResourceEditorProjectTree::LeftDClick()
void wxResourceEditorProjectTree::OnSelChanged(wxTreeEvent& WXUNUSED(event))
{
@ -84,9 +162,33 @@ void wxResourceEditorProjectTree::OnSelChanged(wxTreeEvent& WXUNUSED(event))
wxItemResource* res = ((wxResourceTreeData *)GetItemData(sel))->GetResource();
wxString resType(res->GetType());
if (resType != "wxDialog" && resType != "wxDialogBox" && resType != "wxPanel")
return;
wxResourceManager::GetCurrentResourceManager()->Edit(res);
}
wxResourceEditorFrame *frame = (wxResourceEditorFrame *)wxWindow::GetParent();
wxResourceManager *manager = frame->manager;
long selParent = wxTreeCtrl::GetParent(sel);
if (resType != "wxDialog" && resType != "wxDialogBox" && resType != "wxPanel")
{
wxWindow *win = manager->FindWindowForResource(res);
// Check to see if the item selected in on the current dialog being
// displayed. If not, then we will have to find the items parent dialog
if (!win)
{
// The item is on a dialog other than the one currently being
// shown/worked on, so find the parent dialog, switch to use
// its resource manager, and then find the window in the dialog
wxItemResource* resParent = ((wxResourceTreeData *)GetItemData(selParent))->GetResource();
wxResourceManager::GetCurrentResourceManager()->Edit(resParent);
win = manager->FindWindowForResource(res);
}
// if (win)
// manager->GetCurrentResourceManager()->EditWindow(win);
}
else
wxResourceManager::GetCurrentResourceManager()->Edit(res);
} // wxResourceEditorProjectTree::OnSelChanged()