how to combine to dialog boxes and a formview in a single application ..
-
i'm having two dialog boxes and a formview..now i want t combine all these in a single view..that is the resultant application should contain the formview and one dialog bix at side of form view and another at the down so that if we want we can close those dialog boxes as in vc++ editor(msdev).., i thought to try with plug ins..,as for plug ins are concerned i'm not getting any clear material to know about it..shall i try with plug ins..,if so how...or any other method... Please help me by ur suggestions..thanx n advance.. P.S:All the dialogboxes nd formview are seperate programs...
-
i'm having two dialog boxes and a formview..now i want t combine all these in a single view..that is the resultant application should contain the formview and one dialog bix at side of form view and another at the down so that if we want we can close those dialog boxes as in vc++ editor(msdev).., i thought to try with plug ins..,as for plug ins are concerned i'm not getting any clear material to know about it..shall i try with plug ins..,if so how...or any other method... Please help me by ur suggestions..thanx n advance.. P.S:All the dialogboxes nd formview are seperate programs...
Hi, why don't you try with a splitter window and 2 CFormViews? Or a DialogBox in NonModal message that you change the size and position in its OnInitDialog () with SetWindowPos () without caption and frame if you want (you can change this in resource editor or using WS_ styles and flags.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
-
Hi, why don't you try with a splitter window and 2 CFormViews? Or a DialogBox in NonModal message that you change the size and position in its OnInitDialog () with SetWindowPos () without caption and frame if you want (you can change this in resource editor or using WS_ styles and flags.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
hi nelek, actually i've designed one dialog box with treeview,another with tab view,and formview is an editor as vc++ editor.. more or less i've to create vc++ lookalike editor...so if we want to close treeview we have to close it,so the other dialog box nd formview... in splitter window v can't close seperate windows!!(isn't it?)
-
hi nelek, actually i've designed one dialog box with treeview,another with tab view,and formview is an editor as vc++ editor.. more or less i've to create vc++ lookalike editor...so if we want to close treeview we have to close it,so the other dialog box nd formview... in splitter window v can't close seperate windows!!(isn't it?)
Hi mirraa, actually you can close all the opened windows/dialogs in one touch. For example, in my app (MDI in VC++ 6) I have one CScrollView as MainView and up to 48 CFormViews for each element I want to introduce its parameters. When I close one SecondaryView I close it, and when I close the MainView I close ALL the others. I do this with:
BOOL CMyDoc::CanCloseFrame(CFrameWnd* pFrame)
{ int nError = 0;
//With this I separate between added Views from MainView and close it when match
CView* pFrmView = pFrame->GetActiveView ();
if (pFrmView->IsKindOf (RUNTIME_CLASS (CFormView)))
return TRUE;
//If I’m trying to close the main, I close all the others before
POSITION pos = GetFirstViewPosition ();
while (pos)
{ CView* pView = GetNextView (pos);
if (pView->IsKindOf (RUNTIME_CLASS (CFormView)))
{ CFrameWnd* pTempFrame = pView->GetParentFrame ();
if (pTempFrame)
pTempFrame->DestroyWindow ();
}
}return CDocument::CanCloseFrame(pFrame);
}
The only difference with the DialogBoxes is that you don't have this list for opened Views in Document. But you can also made it by yourself. Just create a CWnd* dlgArray [MAX] or hWnd dlgArray [MAX] and, in every DialogBox, take a pointer (or a handle, whatever you like more) to the opened DialogBox in the OnInitDialog. Afterwards you can close them as well with a call to DestroyWindow, CloseDialog or other functions like those.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
-
Hi mirraa, actually you can close all the opened windows/dialogs in one touch. For example, in my app (MDI in VC++ 6) I have one CScrollView as MainView and up to 48 CFormViews for each element I want to introduce its parameters. When I close one SecondaryView I close it, and when I close the MainView I close ALL the others. I do this with:
BOOL CMyDoc::CanCloseFrame(CFrameWnd* pFrame)
{ int nError = 0;
//With this I separate between added Views from MainView and close it when match
CView* pFrmView = pFrame->GetActiveView ();
if (pFrmView->IsKindOf (RUNTIME_CLASS (CFormView)))
return TRUE;
//If I’m trying to close the main, I close all the others before
POSITION pos = GetFirstViewPosition ();
while (pos)
{ CView* pView = GetNextView (pos);
if (pView->IsKindOf (RUNTIME_CLASS (CFormView)))
{ CFrameWnd* pTempFrame = pView->GetParentFrame ();
if (pTempFrame)
pTempFrame->DestroyWindow ();
}
}return CDocument::CanCloseFrame(pFrame);
}
The only difference with the DialogBoxes is that you don't have this list for opened Views in Document. But you can also made it by yourself. Just create a CWnd* dlgArray [MAX] or hWnd dlgArray [MAX] and, in every DialogBox, take a pointer (or a handle, whatever you like more) to the opened DialogBox in the OnInitDialog. Afterwards you can close them as well with a call to DestroyWindow, CloseDialog or other functions like those.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
actually i couldn't understand ur logic..i need all the dialogbox and formview in a single appln as vc++ editor ,so that i can close them with mouse..my project is exactly like a vc++ editor...shall i use plug ins?if so how...?how 'll i combine three programs in a single program..since my dialog with tree view s a sep pgm,my tabview dialog is a seperate pgm nd form view is a sep pgm...please suggest me ...thanx n advance...
-
actually i couldn't understand ur logic..i need all the dialogbox and formview in a single appln as vc++ editor ,so that i can close them with mouse..my project is exactly like a vc++ editor...shall i use plug ins?if so how...?how 'll i combine three programs in a single program..since my dialog with tree view s a sep pgm,my tabview dialog is a seperate pgm nd form view is a sep pgm...please suggest me ...thanx n advance...
Then I would make it with a SDI application not with dialogs, and make a splitter window to add two views more. At left, one CTreeView derived to the "explorer", then a CSrollBar derived to work with and the third... it depends on what you want to make. The problem of using more views, is that you can not change to a new doc if you dont close all views, at least in my project. Because of that I'm using that function to close the "added" views first when I close the main view.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?