|
Hi,
Would it be possible to precise the licence for this article?
This is increasingly necessary if source code is to used in another product (commercial or not)!
Regards
Frederic
|
|
|
|
|
Click the left view's treeitem,right view refreshed,
why?
what message have sent?
|
|
|
|
|
In the source file LeftView.cpp you will find a declaration as follows
ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding)
ON_NOTIFY_REFLECT(TVN_SELCHANGING, OnSelchanging)
and at the bottom of the same file you find these functions
void CLeftView::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
{
}
void CLeftView::OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult)
{
}
these function are called by the framework when you either click on + sign of click on the label of the tree node
|
|
|
|
|
Thanks a lot!
I already know the OnSelchanging function,and I often used UpdateAllViews to refresh other splitter views. But in this project, "pDoc->m_ExplorerView->AddToListView(&fd); " do the same work;
|
|
|
|
|
Hello, iam a beginner in VC 6.0, i'm have already build a project like yours, my question is how can i split the right view with the purpose to have 2 rows there.
Im have already hadded code to the CMainFrame:
<br />
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT ,<br />
CCreateContext* pContext)<br />
{<br />
CRect pRect;<br />
GetClientRect(&pRect);<br />
<br />
if (!m_wndSplitter.CreateStatic(this, 1, 2))<br />
return FALSE;<br />
<br />
if ( !m_viewportSplitter.CreateStatic( &m_wndSplitter, 2, 1,WS_CHILD |<br />
WS_VISIBLE, m_wndSplitter.IdFromRowCol( 0, 1) ) )<br />
{<br />
<br />
MessageBox( "Error setting up splitter frames!", "Init Error!",<br />
MB_OK | MB_ICONERROR );<br />
return FALSE;<br />
}<br />
<br />
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(100, 100), pContext) ||<br />
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CAllInOneViewerView), CSize(pRect.Width(),pRect.Height()), pContext)||<br />
!m_wndSplitter.CreateView(2, 1, RUNTIME_CLASS(CAllInOneViewerView), CSize(pRect.Width(),pRect.Height()/3), pContext))<br />
{<br />
m_wndSplitter.DestroyWindow();<br />
return FALSE;<br />
}<br />
return TRUE;<br />
<br />
<br />
The code i haded is in bold+Italic, i supose that is the rigth code to add but it doesn't work
can you please help me please!
Tanks for all your help
Best Regards H.Marques
|
|
|
|
|
try the following
// create splitter window
if (!m_wndSplitterMain.CreateStatic(this, 1, 2))
return FALSE;
if (!m_wndSplitterMain.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(100, 100), pContext))
{
m_wndSplitterMain.DestroyWindow();
return FALSE;
}
if (!m_wndSplitterChild.CreateStatic(
&m_wndSplitterMain, // our parent window is the first splitter
2, 1, // the new splitter is 2 rows, 1 column
WS_CHILD | WS_VISIBLE | WS_BORDER, // style, WS_BORDER is needed
m_wndSplitterMain.IdFromRowCol(0, 1)
// new splitter is in the first row, 2nd column of first splitter
))
{
m_wndSplitterMain.DestroyWindow();
return FALSE;
}
if (!m_wndSplitterChild.CreateView(0, 0,
RUNTIME_CLASS(CDataListView), CSize(100, 100), pContext))
{
m_wndSplitterMain.DestroyWindow();
m_wndSplitterChild.DestroyWindow();
return FALSE;
}
if (!m_wndSplitterChild.CreateView(1, 0,
RUNTIME_CLASS(CAllDataView), CSize(100, 100), pContext))
{
m_wndSplitterMain.DestroyWindow();
m_wndSplitterChild.DestroyWindow();
return FALSE;
}
|
|
|
|
|
I am a newbie to VC++...and am still in the learning process...
I have made a Windows Explorer like application using MFC...and also an image viewer in MFC itself...now if i click on any image icon in the explorer i made it shud open the viewer so that the image is displayed in it....is it possible..
this cannot be done by changing in my OS's Folder options as it wud effect only my system...and i hav to change the options of other if i giv this to them....
Can u help me plzzzz....I wud be very gratefull...
Thank u...
|
|
|
|
|
you can use the following function to do so
ShellExecute(NULL, "open", "C:\\Windows\\Notepad.exe",
NULL, NULL, SW_SHOWNORMAL);
OR
ShellExecute(NULL, "open", "C:\\Windows\\Notepad.exe",
"C:\\FRUNLOG.txt", NULL, SW_SHOWNORMAL);
OR
ShellExecute(NULL, "open", "C:\\Windows\\Notepad.exe",
"C:\\FRUNLOG.txt", "C:\\Windows", SW_SHOWNORMAL);
refer to the function
void CDrivesListControl::Dblclk(NMHDR* pNMHDR, LRESULT* pResult)
int the file DrivesListControl.cpp
|
|
|
|
|
Good one..
My problem is
I want the same left and right panes...The data items in the tree control should be read from three input files say for ex a.txt,b.txt and c.txt.
b contains all the child items of all the items in a
similarly c contains all the child items to the items in b.
finally the tree has all the level 1 elements from file a. level 2 items from file b and level 3 from file c.
Sridevi
|
|
|
|
|
if the data in files a.txt , b.txt & c.txt is not confidential , kindly post these files to me i will see what can be done
|
|
|
|
|
Hi,
Trying to expand this control to allow multi selection on the tree side and have encountered problems. Any help you can give would be appreciated. The problem is a stack over flow. In the base tree class no problems with multi select. So in the on update section of the list control i put a call to a function scan directories. This function loops through the tree control and locates the selected nodes, when found, it determins the directory and adds all items in that directory to a list control. It then moves on to the next selected directory.
in the tree views on sel changed function i call update all views.
I assume that on update in the list view is being called more often than i expected and the system is trying to make more coppies of the list control before the first is finished. (hence the stack overflow) I know that without the code it is not easy to debug code. I am looking for help to see if i am doing something fundamentally wrong (ie. STUPID) . If you would like to see code please e-mail direct and i can send.
Gargoyle
|
|
|
|
|
I am currently working on an explorer type interface for a larger project
which has multiple views of a single document. In the Explorer type window group when you have the input focus set on the the list view part as needed by the toolbar display as list etc. options. The highlight vanishes in the tree view is there a way to keep the highlights in both views at the same
time?
The only way I can think of is, if there is not a built in for the controls, in the controls onSelChanging to set the back and forground colours of the
selected item of the tree control to the highlight colour (while also reverting back to the standard colours for the previously selected item.
This seems like an awful lot of work that I would hate to attempt if its not nessacary. If it is I can try it but I probablely have questions.
Microsofts documentation is in a style I do not get on with and most book do not go into anywhere neer enough detail.
I have been a programmer in C and C++ for 10 years but this is my first venture in to the arcane relm of visual C++.
Great code By the way and thanks for any help in advance.
|
|
|
|
|
What if you use the TVS_SHOWSELALWAYS
This will keep the selection in the tree even when it doesn't have the keyboard focus.
This is what I would do if it were me:
BOOL CLeftView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= TVS_LINESATROOT|TVS_HASLINES|TVS_HASBUTTONS|TVS_SHOWSELALWAYS;
return CTreeView::PreCreateWindow(cs);
}
|
|
|
|
|