Click here to Skip to main content
15,888,287 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
will it possible to create emebedded dialog on listview?
For reference of my question you can see below link
"https://www.codeproject.com/Articles/4408/Creating-embedded-dialogs-in-MFC?msg=5381464#xx5381464xx">

but in above link its implemented the embedded dialog on dialog itself
but in my requirement i have to implement the <embedded dialog on listview.
when i ma following same approach(as per link) for listview then its not embedded and its showing popup dialog but my requirement is embedded.
could you please help here

What I have tried:

i have tried with
CListCtrl &ctlRightView = GetListCtrl();

VERIFY(filters.Create(IDD_DIALOG_FILTERS, this));
CString text;
filters.GetWindowText(text);//filters is object for new dialog
ctlRightView.InsertItem(TCIF_TEXT, 0,text, 0, 0, 0, 0)
filters.ShowWindow(TRUE);
Posted
Updated 5-Apr-17 1:15am
v2
Comments
Jochen Arndt 5-Apr-17 7:57am    
Do you want to implement some filter elements?
If so, it can be done above the list by using a subclassed header control containing the filter controls.
But that is not trivial and is far too complex for "Quick answers".
Member 13089825 5-Apr-17 8:30am    
Do you want to implement some filter elements?
No just i want insert one dialog(its not any filter,here my dialog name is filter thats why maybe u got confused,sorry).

Jochen Arndt 5-Apr-17 8:41am    
You should describe what you want to implement, where (what should be overlapped) and on what kind of user intercation should be handled (when to be shown and when removed). A dialog is a window with frame, title bar, a client area containing controls and a control to close the window. When "embedding" something you usually don't want the frame and title bar.

The referenced lik does not explain because it is for a dialog and not for a listview.

It would be for example possible to embed a control into a cell (or row if not in report mode). But it gets more complicated if multiple cells should be covered or the list is scrolled.
Member 13089825 5-Apr-17 8:59am    
i have one mainframe(derived from CFrameWnd)and this class i have devided into two parts one is leftview(derived from CTreeView)and another is rightview(derived from CListView)

the below methos i have devided two parts
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic(this, 1, 2))
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(100, 100), pContext) ||
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CJIMSRightView), CSize(100, 100), pContext))
{
//|| !m_wndSplitter.CreateView(0, 2, RUNTIME_CLASS(CFilters), CSize(100, 100), pContext)
m_wndSplitter.DestroyWindow();
return FALSE;
}
}

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
m_wndSplitter.SetColumnInfo(0, 175, 20);
m_wndSplitter.SetRowInfo(0, 175, 20);
}

when i clicked some text on leftside window then i have to insert one dialog on right side view(and it should be embedded and not popup)
could you please provide your mail id so that i can share some screenshots
Jochen Arndt 5-Apr-17 9:11am    
So you want to replace the complete listview by another window?

Then I have no ready solution but an idea:
On view creation, create the dialog in hidden state using a member variable. When selecting an item in the tree view, initialise the dialog controls, hide the list, and show the dialog. When finished, do it vice versa: Update the list, hide the dialog, and show the list.

Note that it might be necessary to track / react on view window size changings (handle WM_SIZE to apply changings also to the hidden view or ensure that the hidden view is resized to the actual size when making it visible).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900