|
|
I use max interface and I was looking for somethine exactly like this
the problem is we can not use it in our commercial applications because all the rights has Autodesk. If someone finds a hole in the law so that we can use it, please share
|
|
|
|
|
In the CDlgContainer::OnCreate, I tried to replace m_inner with a sheet. But I failed in the docking toolbar. If I add a sheet, the program will break at the line of "if (_AfxGetDlgCtrlID(pBar->m_hWnd) == nID)".
int CDlgContainer::OnCreate(LPCREATESTRUCT lpCreateStruct) <br />
{<br />
if (CWnd::OnCreate(lpCreateStruct) == -1)<br />
return -1;<br />
<br />
CObjectPropertyMainSheet* mainsheet=new CObjectPropertyMainSheet(OBJECT_PROPERTIES_MAIN_SHEET_TITLE);<br />
mainsheet->Create(this);<br />
<br />
<br />
return 0;<br />
}<br />
<br />
====<br />
<br />
CControlBar* CFrameWnd::GetControlBar(UINT nID)<br />
{<br />
if (nID == 0)<br />
return NULL;<br />
POSITION pos = m_listControlBars.GetHeadPosition();<br />
while (pos != NULL)<br />
{<br />
CControlBar* pBar = (CControlBar*)m_listControlBars.GetNext(pos);<br />
ASSERT(pBar != NULL);<br />
if (_AfxGetDlgCtrlID(pBar->m_hWnd) == nID)
{<br />
ASSERT_KINDOF(CControlBar, pBar);<br />
return pBar;<br />
}<br />
}<br />
return NULL;<br />
}
|
|
|
|
|
I moved this project to MDI.
But I have no idea how to react to the button clicks. I created a new class for IDD_DIALOG2
and added functions to some buttons, but when I click to the button there is no reaction.
In case of the original SDI project, I selected the existing CInnerDlg class for IDD_DIALOG2
but in case of my MDI project, the wizard doasn't show this class.
My question, how to get reaction of any button, when IDD_DIALOG2 is connected to a new class?
|
|
|
|
|
I would say you have done perfect job.
To be true, what I did not like is the default mouse pointer is arraow, it must be atlest something like resizing cursor etc (just a minor thingy). And second thing is flikering when resizing parent window, you might have developed and tested under 95/98 family windows, but if you go test it on XP (NT family window), it flikers some.
Everything works perfect for me, and is great idea what you shared. If someone comes and says it is not good, I cant understand what s/he might have in mind lol , it is great source and to every programmer who wishes to learn more, this is very good source, although some polishing / finishing is required.
stay well...
easy GUI building http://www.radcpp.com
|
|
|
|
|
HI I've got a problem with my code.
I tried your app in VC++, and it worked fine .
So I decided to implement it into myApp.
The problme I have, is that the InnerDlg is not inside the Container.
Do you have any idea, where it may come from?
In a few wors, my code is doing the following:
InitDlgbar () -> but invisible
At the moment the user want to make it visible it does:
1) Create Container() -> works fine, is created inside the Dlgbar
2) Create InnerDlg() -> is created but always on top of all Apps.
I am asking myself if the following causes any problems:
// SET INITIAL POSITION OF THE DIALOG
SetWindowPos(&(MyMainFrm->m_myDlgBar.m_myContainer), 3,
posY,
rcWnd.Width(),
rcWnd.Height(), SWP_SHOWWINDOW|SWP_NOSIZE);
if I use the following code instead:
// SET INITIAL POSITION OF THE DIALOG
SetWindowPos(&(MyMainFrm->m_myDlgBar), 3,
posY,
rcWnd.Width(),
rcWnd.Height(), SWP_SHOWWINDOW|SWP_NOSIZE);
There is no difference!
I would reallz appreceate your comments on it.
Thanks a lot
|
|
|
|
|
Mr. John,
firstly, thanks for your great job ,
BTW, can you help me figure out this problem , a dialogbar problem.
i just posted it on the message board, i copy them here ,thank you in advance
============================================================
hi, all
a problem trouble me for a long time.
and i have been looking for the answer for a long time.
but i still can't solve it,i hope somebody can give me a
little suggestion. thanks in advance.
my dev platform: MFC 7 & Windows Server 2003
my question:
i want to subclass my checkbox on a dialogbar, and load my bitmap
to the checkbox's face.
all of my checkbox were set to push like style here
owner-draw mode was set to true .
in headfile MyDialogBar.h
====================================================
CBitmapButton m_btnCheck;<br />
BOOL InitButtons();
====================================================
in cppfile MyDialogBar.cpp
====================================================
BOOL CMyDialogBar::InitButtons()<br />
{<br />
<pre>m_btnCheck.SubclassDlgItem(IDC_TOOLBTN_SELECT, this); <br />
m_btnCheck.LoadBitmaps(IDB_BITMAP_ICON_SELECT);</pre><br />
}
====================================================
in headfile MainFrm.h
====================================================
CMyDialogBar m_myDlgbar;
====================================================
in cppfile MainFrm.cpp
====================================================
int CMainFrm::OnCreate(...)<br />
{<br />
<pre> if(!m_myDlgbar.Create(...))<br />
{<br />
TRACE0("sorry >_< ");<br />
return -1;<br />
}; <br />
m_myDlgbar.InitButtons();</pre><br />
}
====================================================
Notes:
IDB_BITMAP_ICON_SELECT is a ID of bitmap resource file created by resource editor , i want this bitmap loaded on the checkbox button.
IDC_TOOLBTN_SELECT is the ID of the CheckBox
the checkbox can works fine, but i just cannot put my bitmap on it. why??
i used to subclass my checkbox and load a bitmap on its face for many times
in common dialog application , there is no problems. why i use it in dialogbar, it doesn't work, and no error occured , the checkbox button works
fine.
i found something seems to be useful on MS KB, i rewrite my code , and it still does not work,
http://support.microsoft.com/kb/185672
anybody here met this problems before?
can you get me out of this swamp ? can anybody post some related sample code or links here ? thank you very much
any suggestion should be appreciated!
sincerely,
nickong
Today is a gift, that's why we call it present
|
|
|
|
|
How to make a Dockable "TabPan" with this DialogBar just like 3DS MAX ?Thank you!
|
|
|
|
|
|
I've enjoyed this article but there is something that is not addressed in this or the other articles that show a similar technique. If I place buttons on my scrollable dialog, how can I map messages resulting from those buttons back to main frame? Imagine I wanted to add a "close" button that should cause the app to close.
If I place the "inner" dialog directly in the CDialogBar object (done within CMainFrame::OnCreate) like so:
m_cDlgBarExt.Create(this, IDD_DIALOG2, WS_CHILD | WS_VISIBLE | CBRS_RIGHT, IDD_DIALOG2);
...the messages work fine, but of course my dialog is cut off and there is no way to scroll it. IDD_DIALOG2 is the dialog that should be too large and requires scrolling. But when I place IDD_DIALOG2 within a new CWnd derived container (as described in this article) I can get beautiful scrolling, but the messages are lost somewhere. Does anyone have any ideas on how to overcome this, or perhaps where I can look for more information? I've been pulling my hair out for about 12 hours now
|
|
|
|
|
While this may be trivial I figured out a way to get actions back to the main frame, document and view. I'm not sure if this is the best way though so if there's something better I'd still like to hear about it.
What I did was add methods to the frame and document classes to let me get pointer to the instatiated objects. Then I can just call public methods on them instead of trying to send them messages. I've updated the program listed in this article with this ability and also added some code to better handle the resizing of the main frame. The scrollable dialog will only scroll if it's larger than the CWnd derived container it's sitting in. Otherwise it will be locked at the top of the window (which seemed most intuitive).
You can grab this updated app here.
Please post any thoughts or problems here so everyone can benefit.
|
|
|
|
|
Locked out by Server to get updated sample you offered.
William
Fortes in fide et opere!
|
|
|
|
|
youre demo program does not work correctly. If you do not resize it, can't scroll the controls at the bottom of the dialog box into view so that they can be used. Some of the controls remain hidden.
|
|
|
|
|
Wow, this is cool, I need to implement this in a program I'm doing. One problem is when I enter a number in the edit boxes in the dialog and press enter, the dialog dissappears and doesn't come back. Even if I check 'want return' in the dialog editor for this edit box it still does this. Any ideas?
Next, how do you map the messages? This seems to be set up in a non-standard way. If I go to classwizard and to message maps and add a control or variable for one of the dialog buttons, the program crashes when I run it.
Also the hand should appear whenever the mouse is over the dialog but not on a control. Right now you have to click it to appear so it's not as intuitive. I want to make the outer dialog with the cancel have four buttons up top, which when pressed each show a different dialog to appear (just like max). Any ideas how to do this?
Thanks
|
|
|
|
|
Thanks. Last time when i study in university as CS, i learn 3ds max by myself and very like the UI of it. So many year already, i fail to find the method and create the dialog box which likes the 3d studio max dialog.well, u indirectly help me alot by post this, very happy when found this. Very thanks. It really help me a lot. Hope to make a e-friend with u, U can call me Tung, tcw2020@hotmail.com.
Well, i success create the dialog, but got problem to coding it. For example, when button at dialog IDD_DIALOG2 been click, i wanna to display AfxMessageBox ("button 2 been click"); but don't know where should i put this lines of coding inside the classes, because i can't find any class has related with dialog IDD_DIALOG2.Should i create new class?
Hoping could get ur replay as soon as posible.Thanks again.
|
|
|
|
|
You are very welcome any help from me will be provited (if i know the answer.. )
well here we go....
go to
CInnerDlg Header file.. (InnerDlg.h)
and add this function
afx_msg void OnButtonClick();
to the class declaration
the new declaration should look like this...
// Generated message map functions
//{{AFX_MSG(CInnerDlg)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
virtual BOOL OnInitDialog();
// ---------------------------------
/// the new function !
afx_msg void OnButtonClick();
//----------------------------------
//}}AFX_MSG
save.... exit !!!!
Goto InnerDlg.cpp
go to the mesage map definition...
and add
ON_BN_CLICKED(IDC_BUTTON2,OnButtonClick)
it should look like this...
BEGIN_MESSAGE_MAP(CInnerDlg, CDialog)
//{{AFX_MSG_MAP(CInnerDlg)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
//-----------------------------
/// THIS IS THE NEW LINE OF CODE !
ON_BN_CLICKED(IDC_BUTTON2,OnButtonClick)
//-----------------------------
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
go to the end of the InnerDlg.cpp file and add
// the new Function !!!!!!
void CInnerDlg::OnButtonClick()
{
AfxMessageBox ("fddfdf");
}
if you click on the first Button if the dragging dialog you will se a messagebox "fddfdf"..
THATS IT!!!!
|
|
|
|
|
Thanks for help
|
|
|
|
|
I downloaded the executable and ran it. I clicked almost everywhere in the Slidable DialogBar, but it didn't slide. Is there any trick or am I so stupid?
|
|
|
|
|
Click and drag anywhere that there is no control ...
|
|
|
|
|
|
hi
how dock Dialogbar to mdi
|
|
|
|
|
very easy just follow as the author say. modify on Class CMainFrame in the funtion OnCreate(....)
Declare the variable type CDialogBarExt as a public
|
|
|
|
|
Hello,
I cannot seem to get any usability out of this code.
Could someone tell me what I need to do to get input from the controls on the CInnerDlg class (the cancel button)
Also, why is the cancel button disabled. With a quick glance I don't see anything that is disabling it.
Basically, I would like to be able to have a user click the "Cancel" button then display a messagebox. Just to get some basic I/O from the thing.
~Aaron
|
|
|
|
|
Sorry about that....
go to InnerDlg.h
Change
enum { IDD = IDD_DIALOG1 };
to
enum { IDD = IDD_DIALOG2 };
this will wnable you to use the IDD_DIALOG2 template
as you would normaly use a dialog template
after the change you can also assign a function to
the (CANCEL) button to any class that can see it ..ie
CTMMView
i hope this helps....
|
|
|
|
|
I have been searching for about 7 hours total for a way to get a CDialogBar to actually work, and this stopped my searching. I was able to create a CDialogBar myself and attach it to the right side of the screen, but once I did that, the dialog had no classwizard support, buttons were greyed out, and everything else that normally worked on dialogs didn't work in my dialog bar.
So I came across this project, and I was literally overjoyed. Not only does it create a viewable dialog on the side of the screen, but the dialog it shows (inner dialog) is totally independent from the CDialogBar. This makes it have all the functionality of normal dialog window because, well...it is a dialog. I am willing to live with the UI--in fact, I like it. I give props to you, the creator, for making this. It is invaluable to me, because I would have never been able to create it on my own.
There is one thing, though. What I would like to see is the viewing rectangle grow in height as the window size gets taller.
I am not subscribed to the code project so my name is Tim, and my email is goober@techemail.com. Please email me if there is a way to make the viewing rectangle grow.
|
|
|
|
|