Jump to content
  • Advertisement
Sign in to follow this  
Aviscowboy1

Toolbar Combo Box and MDI Child windows

This topic is 4477 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been working on an MDI for my "Game Editor" in C++ win 32 language. This will be a 2d interface game editor that will basically fuel my server and game clients. I have all the code I need to build the game editor but here is the problem. I am working on the parent window and creating the tool bar(This I am hard coding with NO MFC). Here is the problem. I cannot get my child windows to do any thing except show my script compiler. I want to allow my child windows to do different things in this MDI. and lastly the most important thing how do I create a "comboBox" (hard coded remember :D) onto the tool bar... this will serve as a drop down menu for my Tile Classes (Land -> Land tiles, NPC -> character tiles) and for my map editor this will be a better way to get my dungeon layers.:D If anyone can tell me how to get my TBstyleS to show the combo box I would appreciate it :D Aviscowboy [Edited by - Aviscowboy1 on March 15, 2006 4:00:49 PM]

Share this post


Link to post
Share on other sites
Advertisement
ON the mdi child window creation do I have to keep the classes the same on my
MDICREATESTRUCT, LRESULT CALLBACK MDIChildWndProc, and on the window class to create something different for the other child windows?

also does anyone have anything at all on the Combo box for the toolbar?

Share this post


Link to post
Share on other sites
Quote:
Original post by Aviscowboy1
ON the mdi child window creation do I have to keep the classes the same on my
MDICREATESTRUCT, LRESULT CALLBACK MDIChildWndProc, and on the window class to create something different for the other child windows?


No, they can be different.


LRESULT CALLBACK MDIFrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case(WM_COMMAND) : {
int id = LOWORD(wParam);
int event = HIWORD(wParam);
if(id == IDC_EXIT) SendMessage(hWnd, WM_CLOSE, 0, 0);
// Window #1
if(id == IDC_NEW1) {
MDICREATESTRUCT mcs;
mcs.szTitle = "Script Editor";
mcs.szClass = "SCRIPTEDITOR";
mcs.hOwner = basead;
mcs.x = mcs.cx = CW_USEDEFAULT;
mcs.y = mcs.cy = CW_USEDEFAULT;
mcs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW;
SendMessage(hMDIClient, WM_MDICREATE, 0, (LONG)(LPMDICREATESTRUCT)&mcs);
}
// Window #2
if(id == IDC_NEW2) {
MDICREATESTRUCT mcs;
mcs.szTitle = "OpenGL View";
mcs.szClass = "OPENGLVIEW";
mcs.hOwner = basead;
mcs.x = mcs.cx = CW_USEDEFAULT;
mcs.y = mcs.cy = CW_USEDEFAULT;
mcs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW;
SendMessage(hMDIClient, WM_MDICREATE, 0, (LONG)(LPMDICREATESTRUCT)&mcs);
}
// etc.
return DefFrameProc(hWnd, hMDIClient, message, wParam, lParam);
}



Quote:
also does anyone have anything at all on the Combo box for the toolbar?


as for the combo box, as I recall correctly since child windows can't be displayed outside the client of the parent, and you are programming your own toolbar and combobox, you might want to look into windowless controls. never used them or programmed them myself (except for ones that stay inside the client area like buttons and stuff), but there is a section about them in MSDN under COM Development.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!