ramsay
asked on
Dialog box inside scrolling view
Dear Experts,
This is about placing a dialog box inside a scrolling view but in a specific way.
At the moment i have a normal scrolling view and a dialogue box
-------------------------- ----- ==========
| | / /
-------------------------- ----- / /
| |^| / /
| | | ==========
| | |
| | |
| | |
| | |
| | |
| |v|
-------------------------- -----
i want to place the dialog box modlessly (currently is modal) into the view yet still
maintain scrolling ability. so that it looks like this:
-------------------------- -----
| |
--------------------====== =====
| |^|/ /
| | |/ /
| | |/ /
| | |/ /
| | |/ /
| | |/ /
| | |/ /
| |v|/ /
--------------------====== =====
Hopefully the whole thing will be able to be resized and maintain its look. the new button still only clears the viewing area.
Is this possible and if so may i have a very detailed explination.
Thanks in advance me.
This is about placing a dialog box inside a scrolling view but in a specific way.
At the moment i have a normal scrolling view and a dialogue box
--------------------------
| | / /
--------------------------
| |^| / /
| | | ==========
| | |
| | |
| | |
| | |
| | |
| |v|
--------------------------
i want to place the dialog box modlessly (currently is modal) into the view yet still
maintain scrolling ability. so that it looks like this:
--------------------------
| |
--------------------======
| |^|/ /
| | |/ /
| | |/ /
| | |/ /
| | |/ /
| | |/ /
| | |/ /
| |v|/ /
--------------------======
Hopefully the whole thing will be able to be resized and maintain its look. the new button still only clears the viewing area.
Is this possible and if so may i have a very detailed explination.
Thanks in advance me.
ASKER
damn thing.. EVER HEARD OF COURIER!
try and decipher the diagrams as best u can
try and decipher the diagrams as best u can
Have you considered using CDialogBar? Since you want to dock the dialog inside of the view, you pretty much have to go that direction anyway. Once the dialog bar is docked, then the scroll bars will work per normal.
Really take a close look at Stingray's Objective Toolkit. I know it's a decent chunk of money, but the advantages that you will get are astronomical. Your dialog bars will have the look and feel of the coolbars, plus you'll get quite a few enhancements throughout the MFC environment.
Phillip
Really take a close look at Stingray's Objective Toolkit. I know it's a decent chunk of money, but the advantages that you will get are astronomical. Your dialog bars will have the look and feel of the coolbars, plus you'll get quite a few enhancements throughout the MFC environment.
Phillip
p.s. Your diagrams are fine. All we have to do is cut and paste into notepad and we can see what you want.
Phillip
Phillip
ASKER
Ok i placed a member variable in the visual test view so that when i double click on the screen it should create the window.
However when i try it nothing happens unless i resize the window.
Even after I resize it ant the box is displayed the box's initialisation is not carried out.
I used the code:
void CSCVisTestView::OnLButtonD blClk(UINT nFlags, CPoint point)
{
m_bar.Create(GetParent(),I DD_TREE,CB RS_LEFT,NU LL);
CScrollView::OnLButtonDblC lk(nFlags, point);
}
I am not sure what it means by nID. (that is the parameter i placed NULL in)
THe dialog box i am using is IDD_TREE.
it has two controls in it
IDC_TREE - Tree Control
and
IDC_CHECK1 - check box
I have assigned them variables in the Class wisard
m_tree
m_check1 respectivly.
The first problem is how do i display the box without resising the window? The second is how
do i manipulate the controls within the box? The third is why does it not carry out its initialisation?
Thankx again Mr Ramsay
However when i try it nothing happens unless i resize the window.
Even after I resize it ant the box is displayed the box's initialisation is not carried out.
I used the code:
void CSCVisTestView::OnLButtonD
{
m_bar.Create(GetParent(),I
CScrollView::OnLButtonDblC
}
I am not sure what it means by nID. (that is the parameter i placed NULL in)
THe dialog box i am using is IDD_TREE.
it has two controls in it
IDC_TREE - Tree Control
and
IDC_CHECK1 - check box
I have assigned them variables in the Class wisard
m_tree
m_check1 respectivly.
The first problem is how do i display the box without resising the window? The second is how
do i manipulate the controls within the box? The third is why does it not carry out its initialisation?
Thankx again Mr Ramsay
Ramsay,
> The first problem is how do i display the box without resising the window?
The frame should always be the parent of the dialog box, not the view. You should ALWAYS have the dialog bar created in the frame, then you can hide the dialog when you want to. Once tied to the frame, then the resizing will automatically take place.
The nID number is a little tricky. The best thing to do is create yourself an entry in the resource.h file and add a variable somewhere between E800 and E900. The first few E800-E804 are taken by the CPrintPreviewBar and such, as well as a few from E820-E826. Add it something like
#define AFX_IDD_TREE E806
Then in your view menu option, you can turn off and on the bar as required. You'll really will want to find a sample program if you're new to dialog bars. They have a few 'personality' traits that you'll want to get used to.
> The second is how do i manipulate the controls within the box?
> The third is why does it not carry out its initialisation?
You might want to look out at www.codeguru.com and look for an article that adds DDX and OnInitDialog support to the CDialogBar. It is invaluable!
I'll be out of town until Friday, I wish you good luck and godspeed with your project.
Phillip
> The first problem is how do i display the box without resising the window?
The frame should always be the parent of the dialog box, not the view. You should ALWAYS have the dialog bar created in the frame, then you can hide the dialog when you want to. Once tied to the frame, then the resizing will automatically take place.
The nID number is a little tricky. The best thing to do is create yourself an entry in the resource.h file and add a variable somewhere between E800 and E900. The first few E800-E804 are taken by the CPrintPreviewBar and such, as well as a few from E820-E826. Add it something like
#define AFX_IDD_TREE E806
Then in your view menu option, you can turn off and on the bar as required. You'll really will want to find a sample program if you're new to dialog bars. They have a few 'personality' traits that you'll want to get used to.
> The second is how do i manipulate the controls within the box?
> The third is why does it not carry out its initialisation?
You might want to look out at www.codeguru.com and look for an article that adds DDX and OnInitDialog support to the CDialogBar. It is invaluable!
I'll be out of town until Friday, I wish you good luck and godspeed with your project.
Phillip
ASKER
Ok I got this very effective piece of code from codeguru.com that allows a dockable cdialogbar
but I cannot for the life of me get the dialog to communicate with the view.
The code I used is below:
///THE VIEW
void CSCVisTestView::OnViewTest 1() {
CTestDialog* dlg;
dlg->test2();
}
This calls
//THE DIALOG
void CTestDialog::test2()
{
CSCVisTestView* pView;
pView->ViewTest2();
}
Which calls
//THE VIEW AGAIN
void CSCVisTestView::OnViewTest 2() {
CSCVisTestDoc* pDoc = GetDocument();
}
The code i got from codeguru is in the page a docking_window/devstudio_l ike_CContr olbar_2 it comes with a downloadable
project file so you can see exactly what i mean.
The communication screws up because I try to call getdocument() from within the viewtest()
Is there any way around this?
but I cannot for the life of me get the dialog to communicate with the view.
The code I used is below:
///THE VIEW
void CSCVisTestView::OnViewTest
CTestDialog* dlg;
dlg->test2();
}
This calls
//THE DIALOG
void CTestDialog::test2()
{
CSCVisTestView* pView;
pView->ViewTest2();
}
Which calls
//THE VIEW AGAIN
void CSCVisTestView::OnViewTest
CSCVisTestDoc* pDoc = GetDocument();
}
The code i got from codeguru is in the page a docking_window/devstudio_l
project file so you can see exactly what i mean.
The communication screws up because I try to call getdocument() from within the viewtest()
Is there any way around this?
ASKER
I need an answer pretty soon
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
got it working!
thanx for your time!
thanx for your time!
ASKER
ignore below (experiment)
| | | |
\ \ \ \
\.......\.......\.......\