Exemplo n.º 1
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (Inherited::OnCreate(lpCreateStruct) == -1)
        return -1;

    // create status bar
    if (!m_StatusBar.Create(this) || !m_StatusBar.SetIndicators(Indicators, sizeof(Indicators)/sizeof(UINT)))
    {
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create
    }

    // enable docking after status bar is created
    EnableDocking(CBRS_ALIGN_ANY);

    // create standard tool bar
    if (!m_ToolBar.Create(this))
        return -1;

    // strip unneccssary redraw bits (Prosise, VC DEVCON Orlando, p170 in session notes)
    DWORD Style = ::GetClassLong(m_hWnd, GCL_STYLE);
    ::SetClassLong(m_hWnd, GCL_STYLE, Style & ~(CS_HREDRAW | CS_VREDRAW));

	// restore window placement - main window
	CWindowPlacement MainWindowPlacement;
	MainWindowPlacement.Restore(_T("Main Window"), this);

	// restore toolbar placement
	LoadBarState(_T("ToolBarSettings"));

    return 0;
}
int CTransferDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	CCreateContext context;
	context.m_pCurrentFrame = this;
	context.m_pCurrentDoc = NULL;
	context.m_pNewViewClass = RUNTIME_CLASS(CTransferWnd);
	context.m_pNewDocTemplate = NULL;
	m_pwndTransfer = (CTransferWnd*)CreateView(&context);
	m_pwndTransfer->ModifyStyle(WS_BORDER, 0);
	m_pwndTransfer->ModifyStyleEx(WS_EX_CLIENTEDGE, WS_EX_STATICEDGE);

	m_pwndToolbar->Create(this, IDD_DOWNLOAD_TOOLBARS, 
						 WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_SIZE_FIXED | CBRS_SIZE_DYNAMIC | CBRS_GRIPPER, 
						 IDBAR_DOWNLOAD_TOOLBAR);
	ASSERT( m_pwndToolbar->GetStyle() & WS_CLIPSIBLINGS );
	ASSERT( m_pwndToolbar->GetStyle() & WS_CLIPCHILDREN );
	m_pwndToolbar->SetWindowText(GetResString(IDS_DOWNLOADCOMMANDS));
	m_pwndToolbar->EnableDocking(CBRS_ALIGN_ANY);

	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(m_pwndToolbar, AFX_IDW_DOCKBAR_LEFT, (LPRECT)NULL);

	m_pwndTransfer->SendMessage(WM_INITIALUPDATE);

	LoadBarState(DOWNLOAD_TOOLBAR_PROFILE);
	DockToolbarWnd(); // Too much bug reports about vanished search parameters window. Force to dock.
	ShowToolbar(thePrefs.IsDownloadToolbarEnabled());
	m_pwndToolbar->SetCommandTargetWnd(GetDownloadList());
	Localize();

	return 0;
}
Exemplo n.º 3
0
void CGuiFrameWnd::LoadBars()
{
	
	if (VerifyBarState(sProfile))
	{
		LoadBarState(sProfile);
	}
}
Exemplo n.º 4
0
void CGuiMDIFrame::LoadBars()
{
	if (VerifyBarState(sProfile))
	{
		LoadBarState(sProfile);
		LoadPosBar(sProfile);
	}
}
Exemplo n.º 5
0
BOOL CMainFrame::ShowWindowEx(int nCmdShow)
{
	ASSERT_VALID(this);

	// Restore control bar postion.
	LoadBarState(_T("Control Bar State"));

	// Restore frame window size and position.
	m_wndPosition.LoadWindowPos(this);
	nCmdShow = m_wndPosition.showCmd;

	return ShowWindow(nCmdShow);
}
Exemplo n.º 6
0
void CMainFrame::RestorePosition()
{
	// Loading state of control bars
	CWinApp* pApp = AfxGetApp();
    const char* pProfSave= pApp->m_pszProfileName;
	pApp->m_pszProfileName = szGLOBAL_PROFILE;
	LoadBarState("View");
	pApp->m_pszProfileName = pProfSave;
    UINT  nSize;
    LPBYTE pData;
    if ( ::GetPrivateProfileBinary ("View", "WindowPlacement", &pData, &nSize, szGLOBAL_PROFILE) ) {
		WINDOWPLACEMENT wp;
		memcpy(&wp, pData , nSize);
		delete pData;
		SetWindowPlacement(&wp);
	}
}
Exemplo n.º 7
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_StatusBar.Create(this) || 
	!m_StatusBar.SetIndicators(indicators, _countof(indicators)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}
	EnableDocking(CBRS_ALIGN_ANY);
	m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);	// custom dock frame
	if (!CreateToolbars()) {
		TRACE0("Failed to create tool bar\n");
		return -1;      // fail to create
	}
	ShowButton(m_TransportBar, ID_TRANSPORT_PAUSE, FALSE);	// avoids gap after bar
	if (!CreateDialogBars()) {
		TRACE0("Failed to create dialog bar\n");
		return -1;      // fail to create
	}
	if (!CreateSizingBars()) {
		TRACE0("Failed to create sizing control bar\n");
		return -1;      // fail to create
	}
	if (VerifyBarState(REG_SETTINGS)) {
		for (int iBar = 0; iBar < SIZING_BARS; iBar++) {
			CSizingControlBarG	*pBar = STATIC_DOWNCAST(CSizingControlBarG, 
				GetBarAtOffset(m_SizingBarInfo[iBar].Offset));
			pBar->LoadState(REG_SETTINGS);
		}
		LoadBarState(REG_SETTINGS);
	}
	SetTimer(TIMER_ID, 1000 / TIMER_FREQUENCY, NULL);	// start timer
	DragAcceptFiles();
	SetCursorWavePos(_T(""));
	ApplyOptions(COptionsInfo::m_Defaults);
	if (m_Options.m_CheckForUpdates)	// if automatically checking for updates
		AfxBeginThread(CheckForUpdatesThreadFunc, this);	// launch thread to check
	AfxBeginThread(IteratePluginsThread, this);

	return 0;
}
Exemplo n.º 8
0
int COutlookFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CProjectFrame::OnCreate(lpCreateStruct) == -1)
        return -1;

    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_TOP);

    RecalcLayout();       // essential

    CRect rect;
    m_wndToolBar.GetWindowRect(&rect);
    rect.OffsetRect(1, 0);
    DockControlBar(&m_wndOutlookToolBar, AFX_IDW_DOCKBAR_TOP, &rect);


    if (!m_wndControlBar.Create(_T("Control Bar"), this, 10)) {
        TRACE0("Failed to create control bar\n");
        return false;
    }

    m_wndControlBar.SetBarStyle(m_wndControlBar.GetBarStyle()
                                | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

    m_wndControlBar.SetSCBStyle(m_wndControlBar.GetSCBStyle()
                                | SCBS_SHOWEDGES | SCBS_SIZECHILD);

    m_wndControlBar.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT);
    DockControlBar(&m_wndControlBar, AFX_IDW_DOCKBAR_LEFT);

    CString sProfile(_T("BarState"));
    if (VerifyBarState(sProfile))
        {
            m_wndControlBar.LoadState(sProfile);
            LoadBarState(sProfile);
        }


    return 0;
}
Exemplo n.º 9
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndMDIClient.SubclassWindow (m_hWndMDIClient)) 
	{
              TRACE ("Failed to subclass MDI client window\n");
              return (-1);
    }            

	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	InitDockingWindows();

	LoadBarState(_T("Build"));

	return 0;
}
Exemplo n.º 10
0
int CSearchDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	CCreateContext context;
	context.m_pCurrentFrame = this;
	context.m_pCurrentDoc = NULL;
	context.m_pNewViewClass = RUNTIME_CLASS(CSearchResultsWnd);
	context.m_pNewDocTemplate = NULL;
	m_pwndResults = (CSearchResultsWnd*)CreateView(&context);
	m_pwndParams->m_searchdlg = m_pwndResults;
	m_pwndResults->ModifyStyle(WS_BORDER, 0);
	m_pwndResults->ModifyStyleEx(WS_EX_CLIENTEDGE, WS_EX_STATICEDGE);

	m_pwndParams->Create(this, IDD_SEARCH_PARAMS, 
						 WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_SIZE_FIXED | CBRS_SIZE_DYNAMIC | CBRS_GRIPPER, 
						 IDBAR_SEARCH_PARAMS);
	ASSERT( m_pwndParams->GetStyle() & WS_CLIPSIBLINGS );
	ASSERT( m_pwndParams->GetStyle() & WS_CLIPCHILDREN );
	m_pwndParams->SetWindowText(GetResString(IDS_SEARCHPARAMS));
	m_pwndParams->EnableDocking(CBRS_ALIGN_ANY);

	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(m_pwndParams, AFX_IDW_DOCKBAR_TOP, (LPRECT)NULL);

	m_pwndResults->m_pwndParams = m_pwndParams;
	m_pwndResults->SendMessage(WM_INITIALUPDATE);

	LoadBarState(SEARCH_PARAMS_PROFILE);
	DockParametersWnd(); // Too much bug reports about vanished search parameters window. Force to dock.
	ShowControlBar(m_pwndParams, TRUE, TRUE);
	Localize();

	return 0;
}
Exemplo n.º 11
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect	myRect=CRect(
						g_config.GetIni().GetValue( _W( "RipperFrame"), _W( "FrameWndLeft"), 0 ),
						g_config.GetIni().GetValue( _W( "RipperFrame"), _W( "FrameWndTop"), 0 ),
						g_config.GetIni().GetValue( _W( "RipperFrame"), _W( "FrameWndRight"), 580 ),
						g_config.GetIni().GetValue( _W( "RipperFrame"), _W( "FrameWndBottom"), 390 )
					);

	// Move the window
	if ( myRect.Width() < 100 || myRect.Height() < 100 )
	{
		myRect=CRect( 0, 0, 640, 400 );
	}

	MoveWindow(myRect);


	// Create status bar
	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	CRect rcClient;
	GetClientRect(rcClient);

	m_wndStatusBar.SetPaneInfo(1,ID_SEPARATOR,SBPS_NORMAL,320);
	m_wndStatusBar.SetPaneInfo(0,ID_SEPARATOR,SBPS_STRETCH,100);

	// Docking is OK
	EnableDocking(CBRS_ALIGN_ANY);

	// Create main toolbar
	if (!m_wndToolBar.Create(this,WS_CHILD|WS_VISIBLE|CBRS_TOP,AFX_IDW_TOOLBAR) || !m_wndToolBar.LoadToolBar(IDW_RECBAR) )
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

//	m_wndToolBar.GetToolBarCtrl().AddBitmap(7,IDB_RECBAR256);
// ===========================================================
#ifdef OLDICONS
	if (::GetDeviceCaps(GetDC()->m_hDC,BITSPIXEL)>8) 
	{
		m_bmToolbarHi.LoadMappedBitmap(IDB_RECBAR256);
		m_wndToolBar.SetBitmap( (HBITMAP)m_bmToolbarHi );
	}
#else
// ===========================================================

	if ( UseFlatLookToolBar() )
	{
		CImageList	imageList;
		CBitmap		bitmap;

//		ModifyStyle(0, TBSTYLE_FLAT);

		// Set up hot bar image lists.
		// Create and set the normal toolbar image list.
		bitmap.LoadMappedBitmap( IDB_RECBAR256 );
		imageList.Create(32, 32, ILC_COLORDDB|ILC_MASK, 13, 1);
		imageList.Add(&bitmap, RGB(255,0,255));
		m_wndToolBar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
		imageList.Detach();
		bitmap.Detach();

		// Create and set the hot toolbar image list.
//		bitmap.LoadBitmap( IDB_CDPLAYTOOLBAR_H );
//		imageList.Create(16, 16, ILC_COLORDDB|ILC_MASK, 13, 1);
//		imageList.Add(&bitmap, RGB(255,0,255));
//		SendMessage(TB_SETHOTIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
//		imageList.Detach();
//		bitmap.Detach();


		// Create and set the disabled toolbar image list.
		bitmap.LoadMappedBitmap( IDB_RECBAR256D );
		imageList.Create( 32, 32, ILC_COLORDDB|ILC_MASK, 13, 1);
		imageList.Add(&bitmap, RGB(255,0,255));
		m_wndToolBar.SendMessage( TB_SETDISABLEDIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
		imageList.Detach();
		bitmap.Detach();

		// END HIGH RES BUTTONS
	}

#endif

	// Set toolbar style
	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC );

	// Allow docking everywhere
	m_wndToolBar.EnableDocking( CBRS_ALIGN_ANY );

	// Dock the contol bar at the right side of the frame window
	DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_RIGHT);


	// Create the play tool bar
	if (!m_wndPlayBar.Create(this,WS_CHILD|WS_VISIBLE|CBRS_TOP, ID_CDSELECTIONBAR_ID ) )
	{
		TRACE0("Failed to create play toolbar\n");
		return -1;      // fail to create
	}

	// Set the style of the toolbar
	m_wndPlayBar.SetBarStyle(m_wndPlayBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	// Allow docking everywhere
	m_wndPlayBar.EnableDocking(CBRS_ALIGN_ANY);

	// Dock the control at the top of the frame window
	DockControlBar(&m_wndPlayBar,AFX_IDW_DOCKBAR_TOP);


	// Create the utility tool bar
	if ( !m_wndUtilBar.Create( this, WS_CHILD | WS_VISIBLE | CBRS_TOP, ID_UTILOOLBAR ) )
	{
		TRACE0("Failed to create play toolbar\n");
		return -1;      // fail to create
	}

	// Set the style of the toolbar
	m_wndUtilBar.SetBarStyle(m_wndUtilBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	// Allow docking everywhere
	m_wndUtilBar.EnableDocking(CBRS_ALIGN_ANY);

	// Dock the control at the top of the frame window
	DockControlBar(&m_wndUtilBar,AFX_IDW_DOCKBAR_TOP);

	// Load the state of the Status Bar
	LoadBarState( _T( "MainFrmBarSettings" ) );

	SetLanguageMenu( );

//	ShowControlBar(	&m_wndPlayBar,
//					g_config.GetIni().GetValue( _T( "PlayToolBar" ), _T( "Show" ), 1 ),
//					FALSE );
//	ShowControlBar(	&m_wndToolBar,
//					g_config.GetIni().GetValue( _T( "RecordToolBar" ), _T( "Show" ), 1 ),
//					FALSE );

	return 0;
}
Exemplo n.º 12
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);

//#ifdef _SCB_REPLACE_MINIFRAME
    m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);
//#endif

	if (!m_localsBar.Create(_T("Local Variables"), this, CSize(200, 100),
			TRUE, AFX_IDW_CONTROLBAR_FIRST + 32))
	{ 
		TRACE0("Failed to create mybar\n");
		return -1;      // fail to create
	}

	m_localsBar.SetBarStyle(m_localsBar.GetBarStyle() |
			CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	m_localsBar.EnableDocking(CBRS_ALIGN_ANY);

	if (!m_watchBar.Create(_T("Watch Variables"), this, CSize(200, 100),
			TRUE, AFX_IDW_CONTROLBAR_FIRST + 33))
	{ 
		TRACE0("Failed to create mybar\n");
		return -1;      // fail to create
	}

	m_watchBar.SetBarStyle(m_watchBar.GetBarStyle() |
			CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	m_watchBar.EnableDocking(CBRS_ALIGN_ANY);

	EnableDocking(CBRS_ALIGN_ANY);              // <---- needed only once for the frame

	// Create the window list bar.
	if (!m_windowListBar.Create(_T("Window List"), this, CSize(200, 100),
			TRUE, AFX_IDW_CONTROLBAR_FIRST + 34))
	{ 
		TRACE0("Failed to create mybar\n");
		return -1;      // fail to create
	}
	
	m_windowListBar.SetBarStyle(m_windowListBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_windowListBar.EnableDocking(CBRS_ALIGN_ANY);

	// Create the call stack bar.
	if (!m_callStackBar.Create(_T("Call Stack"), this, CSize(200, 100),
			TRUE, AFX_IDW_CONTROLBAR_FIRST + 35))
	{ 
		TRACE0("Failed to create mybar\n");
		return -1;      // fail to create
	}
	
	m_callStackBar.SetBarStyle(m_callStackBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_callStackBar.EnableDocking(CBRS_ALIGN_ANY);

	// Create the Output bar
	if (!m_outputBar.Create(_T("Output"), this, CSize(600, 60),
			TRUE, AFX_IDW_CONTROLBAR_FIRST + 36))
	{ 
		TRACE0("Failed to create Output bar\n");
		return -1;      // fail to create
	}

	m_outputBar.SetBarStyle(m_outputBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC );
	m_outputBar.EnableDocking(CBRS_ALIGN_ANY);   // <---- needed only once for the frame

	// Create the Command bar
	if (!m_commandBar.Create(_T("Command"), this, CSize(400, 60),
			TRUE, AFX_IDW_CONTROLBAR_FIRST + 37))
	{ 
		TRACE0("Failed to create Command bar\n");
		return -1;      // fail to create
	}

	m_commandBar.SetBarStyle(m_commandBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC );
	m_commandBar.EnableDocking(CBRS_ALIGN_ANY);   // <---- needed only once for the frame

	// Dock the window list and locals bar.
	DockControlBar(&m_windowListBar, AFX_IDW_DOCKBAR_LEFT);
	DockControlBar(&m_localsBar, AFX_IDW_DOCKBAR_RIGHT);
	RecalcLayout();
	
	// Dock the call stack.
	CRect rBar;
	m_windowListBar.GetWindowRect(rBar);
	rBar.OffsetRect(0, 1);

	DockControlBar(&m_callStackBar, AFX_IDW_DOCKBAR_LEFT, rBar);
	
	// Dock the watch bar.
	m_localsBar.GetWindowRect(rBar);
	rBar.OffsetRect(0, 1);

	DockControlBar(&m_watchBar, AFX_IDW_DOCKBAR_RIGHT, rBar);

	DockControlBar(&m_wndToolBar);

	DockControlBar(&m_outputBar, AFX_IDW_DOCKBAR_BOTTOM );

	DockControlBarNextTo( &m_commandBar, &m_outputBar );

	//	ShowControlBar(&m_windowListBar, FALSE, FALSE);

	CString sProfile = _T("Windows\\BarState");
	if (VerifyBarState(sProfile))
	{
		CSizingControlBar::GlobalLoadState(this, sProfile);
		LoadBarState(sProfile);
	}
	
	return 0;
}
Exemplo n.º 13
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	int z;
	CRect rect;

	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndToolBar.Create(this) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	// Create the combo box
	z = m_wndToolBar.CommandToIndex(ID_NEW_SHIP_TYPE);
	Assert(z != -1);
	m_wndToolBar.SetButtonInfo(z, ID_NEW_SHIP_TYPE, TBBS_SEPARATOR, 230);

	// Design guide advises 12 pixel gap between combos and buttons
//	m_wndToolBar.SetButtonInfo(1, ID_SEPARATOR, TBBS_SEPARATOR, 12);
	m_wndToolBar.GetItemRect(z, &rect);
	rect.top = 3;
	rect.bottom = rect.top + 550;
	if (!m_new_ship_type_combo_box.Create(CBS_DROPDOWNLIST | WS_VISIBLE | WS_VSCROLL | CBS_HASSTRINGS | LBS_OWNERDRAWFIXED,
		rect, &m_wndToolBar, ID_NEW_SHIP_TYPE))
	{
		TRACE0("Failed to create new ship type combo-box\n");
		return FALSE;
	}

/*	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}
*/

/*	if (!m_wndStatusBar.Create(this,
		WS_CHILD | WS_VISIBLE | CBRS_BOTTOM, ID_MY_STATUS_BAR) ||
		!m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT)))*/

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;

	} else {
		m_wndStatusBar.SetPaneInfo(0, 0, SBPS_STRETCH, 0);
		m_wndStatusBar.SetPaneInfo(1, 0, SBPS_NORMAL, 80);
		m_wndStatusBar.SetPaneInfo(2, 0, SBPS_NORMAL, 180);
//		m_wndStatusBar.SetPaneInfo(3, 0, SBPS_NORMAL, 100);
		m_wndStatusBar.SetPaneInfo(4, 0, SBPS_NORMAL, 130);
	}

	// TODO: Remove this if you don't want tool tips or a resizeable toolbar
	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	Fred_main_wnd = this;
	Ship_editor_dialog.Create();
	Wing_editor_dialog.Create();
	Waypoint_editor_dialog.Create();
	init_tools();
	LoadBarState("Tools state");
	return 0;
}
Exemplo n.º 14
0
int CPlayerFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	CImageList	imageList;
	CBitmap		bitmap;

	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	

	CRect	myRect=CRect(
					g_config.GetIni().GetValue( _W( "PlayerFrame" ), _W( "FrameWndLeft" ), 100 ),
					g_config.GetIni().GetValue( _W( "PlayerFrame" ), _W( "FrameWndTop" ), 100 ),
					g_config.GetIni().GetValue( _W( "PlayerFrame" ), _W( "FrameWndRight"), 350 ),
					g_config.GetIni().GetValue( _W( "PlayerFrame" ), _W( "FrameWndBottom"), 250 )
					);

	// Move the window
	if ( myRect.Width() <100 || myRect.Height() < 100 )
	{
		myRect=CRect( 0, 0, 350, 250 );
	}

	MoveWindow( myRect );

	// Create status bar
	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	m_wndStatusBar.SetPaneInfo( 1, ID_SEPARATOR,SBPS_NORMAL, 150 );
	m_wndStatusBar.SetPaneInfo( 0, ID_SEPARATOR,SBPS_STRETCH, 100 );

	// Create main toolbar
	if (!m_wndToolBar.Create( this, WS_CHILD | WS_VISIBLE | CBRS_TOP, AFX_IDW_TOOLBAR) || !m_wndToolBar.LoadToolBar( IDW_PLAYFILEBAR ) )
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if ( UseFlatLookToolBar() )
	{
		m_wndToolBar.ModifyStyle( 0, TBSTYLE_FLAT );

		// Set up hot bar image lists.
		// Create and set the normal toolbar image list.
		if ( bitmap.LoadBitmap( IDB_FILEPLAYTOOLBAR_C ) )
		{
			if ( imageList.Create( 16, 16, ILC_COLORDDB|ILC_MASK, 13, 1 ) )
			{

				if ( -1 != imageList.Add( &bitmap, RGB(255,0,255) ) )
				{
					m_wndToolBar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
				}
				imageList.Detach();
			}
			bitmap.Detach();
		}

		// Create and set the hot toolbar image list.
		if ( bitmap.LoadBitmap( IDB_FILEPLAYTOOLBAR_H ) )
		{
			if ( imageList.Create(16, 16, ILC_COLORDDB|ILC_MASK, 13, 1) )
			{
				if ( -1 != imageList.Add(&bitmap, RGB(255,0,255)) )
				{
					m_wndToolBar.SendMessage(TB_SETHOTIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
				}
				imageList.Detach();
			}
			bitmap.Detach();
		}


		// Create and set the disabled toolbar image list.
		if ( bitmap.LoadBitmap( IDB_FILEPLAYTOOLBAR_D ) )
		{
			if ( imageList.Create(16, 16, ILC_COLORDDB|ILC_MASK, 13, 1) )
			{
				if ( -1 != imageList.Add(&bitmap, RGB(255,0,255)) )
				{
					m_wndToolBar.SendMessage(TB_SETDISABLEDIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
				}
				imageList.Detach();
			}
			bitmap.Detach();
		}
	}

	// Docking is OK
	EnableDocking(CBRS_ALIGN_ANY);

	// Set the style of the toolbar
	m_wndToolBar.SetBarStyle( m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC );

	// Allow docking everywhere
	m_wndToolBar.EnableDocking( CBRS_ALIGN_ANY );

	// Dock the contol bar at the right side of the frame window
	DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_TOP);

	LoadBarState( _T( "PlayerFrmBarSettings" ) );

	SetLanguageMenu( );

	return 0;
}
Exemplo n.º 15
0
// This windows is created
//
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	// Call the base class
	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	// Create the general toolbar
	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP	| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||	!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Impossible de créer la toolbar générale\n");
		return -1;      // échec de la création
	}

	// Create the 2D view toolbar
	if (!m_wndToolBarView.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP	| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0,0,0,0), AFX_IDW_TOOLBAR+2) || !m_wndToolBarView.LoadToolBar(IDR_TOOLBARVIEW))
	{
		TRACE0("Impossible de créer la toolbar des vues\n");
		return -1;      // échec de la création
	}

	// Create the 3D view toolbar
	if (!m_wndToolBar3DView.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP	| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0,0,0,0), AFX_IDW_TOOLBAR+4) || !m_wndToolBar3DView.LoadToolBar(IDR_TOOLBAR3DVIEW))
	{
		TRACE0("Impossible de créer la toolbar des vues 3D\n");
		return -1;      // échec de la création
	}

	// Create the object toolbar
	if (!m_wndToolBarObject.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP	| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0,0,0,0), AFX_IDW_TOOLBAR+3) || !m_wndToolBarObject.LoadToolBar(IDR_TOOLBAROBJECT))
	{
		TRACE0("Impossible de créer la toolbar des objets\n");
		return -1;      // échec de la création
	}

	// Create the game toolbar
	if (!m_wndToolBarGame.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP	| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0,0,0,0), AFX_IDW_TOOLBAR+5) || !m_wndToolBarGame.LoadToolBar(IDR_TOOLBARGAME))
	{
		TRACE0("Impossible de créer la toolbar de jeu\n");
		return -1;      // échec de la création
	}

	// Create the status bar
	if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Impossible de créer la barre d'état\n");
		return -1;      // échec de la création
	}

	// Set pane info size for current tile
	m_wndStatusBar.SetPaneInfo( 1, -1, SBPS_NORMAL, 300 );

	// Dock the general toolbar
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	// Change color and dock general toolbar
	m_BmpGeneralBar.LoadBitmap( IDB_GENERALTOOLBAR );
	unsigned char* pBits = (unsigned char*) malloc( 32*192*4 );
	m_BmpGeneralBar.GetBitmapBits( 32*192*4, pBits );
	DWORD ColorFace = ::GetSysColor(COLOR_BTNFACE);
	for( int i=0; i<32*192; i++ )
	{
		if( pBits[i*4]==255 && pBits[i*4+1]==0 && pBits[i*4+2]==255 )
		{
			pBits[i*4] = GetBValue(ColorFace);
			pBits[i*4+1] = GetGValue(ColorFace);
			pBits[i*4+2] = GetRValue(ColorFace);
		}
	}
	m_BmpGeneralBar.SetBitmapBits( 32*192*4, pBits );
	free( pBits );
	m_wndToolBar.SetBitmap( (HBITMAP) m_BmpGeneralBar.GetSafeHandle() );
	m_wndToolBar.SetSizes( CSize(39,38), CSize(32,32) );
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	CString Str;
	Str.LoadString( IDS_GENERALTOOLBARTITLE );
	m_wndToolBar.SetWindowText( Str );
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	// Change color and dock 2D view toolbar
	m_BmpViewBar.LoadBitmap( IDB_VIEWTOOLBAR );
	pBits = (unsigned char*) malloc( 32*224*4 );
	m_BmpViewBar.GetBitmapBits( 32*224*4, pBits );
	for( int i=0; i<32*224; i++ )
	{
		if( pBits[i*4]==255 && pBits[i*4+1]==0 && pBits[i*4+2]==255 )
		{
			pBits[i*4] = GetBValue(ColorFace);
			pBits[i*4+1] = GetGValue(ColorFace);
			pBits[i*4+2] = GetRValue(ColorFace);
		}
	}
	m_BmpViewBar.SetBitmapBits( 32*224*4, pBits );
	free( pBits );
	m_wndToolBarView.SetBitmap( (HBITMAP) m_BmpViewBar.GetSafeHandle() );
	m_wndToolBarView.SetSizes( CSize(39,38), CSize(32,32) );
	m_wndToolBarView.EnableDocking(CBRS_ALIGN_ANY);
	Str.LoadString( IDS_VIEW2DTOOLBARTITLE );
	m_wndToolBarView.SetWindowText( Str );
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBarView);

	// Change color and dock 3D view toolbar
	m_Bmp3DViewBar.LoadBitmap( IDB_3DVIEWTOOLBAR );
	pBits = (unsigned char*) malloc( 384*32*4 );
	m_Bmp3DViewBar.GetBitmapBits( 384*32*4, pBits );
	for( int i=0; i<384*32; i++ )
	{
		if( pBits[i*4]==255 && pBits[i*4+1]==0 && pBits[i*4+2]==255 )
		{
			pBits[i*4] = GetBValue(ColorFace);
			pBits[i*4+1] = GetGValue(ColorFace);
			pBits[i*4+2] = GetRValue(ColorFace);
		}
	}
	m_Bmp3DViewBar.SetBitmapBits( 384*32*4, pBits );
	free( pBits );
	m_wndToolBar3DView.SetBitmap( (HBITMAP) m_Bmp3DViewBar.GetSafeHandle() );
	m_wndToolBar3DView.SetSizes( CSize(39,38), CSize(32,32) );
	m_wndToolBar3DView.EnableDocking(CBRS_ALIGN_ANY);
	Str.LoadString( IDS_VIEW3DTOOLBARTITLE );
	m_wndToolBar3DView.SetWindowText( Str );
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar3DView);

	// Change color and dock object toolbar
	m_BmpObjectBar.LoadBitmap( IDB_OBJECTTOOLBAR );
	pBits = (unsigned char*) malloc( 32*128*4 );
	m_BmpObjectBar.GetBitmapBits( 32*128*4, pBits );
	for( int i=0; i<32*128; i++ )
	{
		if( pBits[i*4]==255 && pBits[i*4+1]==0 && pBits[i*4+2]==255 )
		{
			pBits[i*4] = GetBValue(ColorFace);
			pBits[i*4+1] = GetGValue(ColorFace);
			pBits[i*4+2] = GetRValue(ColorFace);
		}
	}
	m_BmpObjectBar.SetBitmapBits( 32*128*4, pBits );
	free( pBits );
	m_wndToolBarObject.SetBitmap( (HBITMAP) m_BmpObjectBar.GetSafeHandle() );
	m_wndToolBarObject.SetSizes( CSize(39,38), CSize(32,32) );
	m_wndToolBarObject.EnableDocking(CBRS_ALIGN_ANY);
	Str.LoadString( IDS_OBJECTTOOLBARTITLE );
	m_wndToolBarObject.SetWindowText( Str );
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBarObject);

	// Change color and dock game toolbar
	m_BmpGameBar.LoadBitmap( IDB_GAMETOOLBAR );
	pBits = (unsigned char*) malloc( 32*416*4 );
	m_BmpGameBar.GetBitmapBits( 32*416*4, pBits );
	for( int i=0; i<32*416; i++ )
	{
		if( pBits[i*4]==255 && pBits[i*4+1]==0 && pBits[i*4+2]==255 )
		{
			pBits[i*4] = GetBValue(ColorFace);
			pBits[i*4+1] = GetGValue(ColorFace);
			pBits[i*4+2] = GetRValue(ColorFace);
		}
	}
	m_BmpGameBar.SetBitmapBits( 32*416*4, pBits );
	free( pBits );
	m_wndToolBarGame.SetBitmap( (HBITMAP) m_BmpGameBar.GetSafeHandle() );
	m_wndToolBarGame.SetSizes( CSize(39,38), CSize(32,32) );
	m_wndToolBarGame.EnableDocking(CBRS_ALIGN_ANY);
	Str.LoadString( IDS_GAMETOOLBARTITLE );
	m_wndToolBarGame.SetWindowText( Str );
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBarGame);

	// The Object Bar
	CString StrResource;
	StrResource.LoadString( IDS_OBJECTWINDOW );
    if (!m_wndObjectBar.Create( StrResource, this, CSize(200, 200), TRUE, 125))
    {
	    TRACE0("Impossible de créer la barre d'objet\n");
        return -1;      // fail to create
    }

	// Dock the object bar
    m_wndObjectBar.SetBarStyle(m_wndObjectBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
    m_wndObjectBar.EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar( &m_wndObjectBar, AFX_IDW_DOCKBAR_LEFT );

	// The Info Bar
	StrResource.LoadString( IDS_INFOWINDOW );
    if (!m_wndInfoBar.Create( StrResource, this, CSize(160, 80), TRUE, 126))
    {
	    TRACE0("Failed to create info list bar\n");
        return -1;      // fail to create
    }

    m_wndInfoBar.SetBarStyle(m_wndInfoBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
    m_wndInfoBar.EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar( &m_wndInfoBar, AFX_IDW_DOCKBAR_BOTTOM );

	// The Game chat bar
	StrResource.LoadString( IDS_GAMECHATWINDOW );
    if (!m_wndGameChatBar.Create( StrResource, this, CSize(260, 180), TRUE, 127))
    {
	    TRACE0("Failed to create game chat bar\n");
        return -1;      // fail to create
    }

    m_wndGameChatBar.SetBarStyle(m_wndGameChatBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
    m_wndGameChatBar.EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar( &m_wndGameChatBar, AFX_IDW_DOCKBAR_BOTTOM );

	// The Game player bar
	StrResource.LoadString( IDS_GAMEPLAYERWINDOW );
    if (!m_wndGamePlayerBar.Create( StrResource, this, CSize(200, 200), TRUE, 128))
    {
	    TRACE0("Failed to create game player bar\n");
        return -1;      // fail to create
    }

    m_wndGamePlayerBar.SetBarStyle(m_wndGamePlayerBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
    m_wndGamePlayerBar.EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar( &m_wndGamePlayerBar, AFX_IDW_DOCKBAR_LEFT );

	// The Game action bar
	StrResource.LoadString( IDS_GAMEACTIONWINDOW );
    if (!m_wndGameActionBar.Create( StrResource, this, CSize(200, 200), TRUE, 129))
    {
	    TRACE0("Failed to create game action bar\n");
        return -1;      // fail to create
    }

    m_wndGameActionBar.SetBarStyle(m_wndGameActionBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
    m_wndGameActionBar.EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar( &m_wndGameActionBar, AFX_IDW_DOCKBAR_BOTTOM );

	// Load the position of the window
	int PosX = theApp.GetProfileInt( _T("MainWindow"), _T("PosX"), 0);
	int PosY = theApp.GetProfileInt( _T("MainWindow"), _T("PosY"), 0);
	int Width = theApp.GetProfileInt( _T("MainWindow"), _T("Width"), 700);
	int Height = theApp.GetProfileInt( _T("MainWindow"), _T("Height"), 500);
	SetWindowPos( NULL, PosX, PosY, Width, Height, SWP_NOZORDER );
	int ShowState = theApp.GetProfileInt( _T("MainWindow"),_T("State"), SW_SHOWNORMAL );
	ShowWindow( ShowState );

	// Load the favorite position
	LoadBarState(_T("BarState"));
	m_wndObjectBar.LoadState(_T("DockBarState"));
	m_wndInfoBar.LoadState(_T("DockBarState"));
	m_wndGameChatBar.LoadState(_T("DockBarState"));
	m_wndGamePlayerBar.LoadState(_T("DockBarState"));
	m_wndGameActionBar.LoadState(_T("DockBarState"));

	// Now hide all the unusefull windows
	ShowControlBar( &m_wndGameChatBar, FALSE, FALSE );
	ShowControlBar( &m_wndGamePlayerBar, FALSE, FALSE );
	ShowControlBar( &m_wndGameActionBar, FALSE, FALSE );
	ShowControlBar( &m_wndToolBarGame, FALSE, FALSE );

	RecalcLayout();

	CRect Rect;
	m_wndObjectBar.GetWindowRect( &Rect );
	if( m_wndObjectBar.IsFloating() )
	{
		Rect.right = Rect.left+m_wndObjectBar.m_szFloat.cx;
		Rect.bottom = Rect.top+m_wndObjectBar.m_szFloat.cy;
		m_wndObjectBar.GetParentFrame()->SetWindowPos( NULL, 0, 0, m_wndObjectBar.m_szFloat.cx, m_wndObjectBar.m_szFloat.cy, SWP_NOZORDER|SWP_NOMOVE);
		m_wndObjectBar.RedrawWindow();
	}
	m_wndObjectBar.PostMessage( WM_SIZE, SIZE_RESTORED, MAKELPARAM(Rect.Width(),Rect.Height()) );
	m_wndObjectBar.m_ObjectFV.Init();

	m_wndInfoBar.GetWindowRect( &Rect );
	if( m_wndInfoBar.IsFloating() )
	{
		Rect.right = Rect.left+m_wndInfoBar.m_szFloat.cx;
		Rect.bottom = Rect.top+m_wndInfoBar.m_szFloat.cy;
		m_wndInfoBar.GetParentFrame()->SetWindowPos( NULL, 0, 0, m_wndInfoBar.m_szFloat.cx, m_wndInfoBar.m_szFloat.cy, SWP_NOZORDER|SWP_NOMOVE);
		m_wndInfoBar.RedrawWindow();
	}
	m_wndInfoBar.PostMessage( WM_SIZE, SIZE_RESTORED, MAKELPARAM(Rect.Width(),Rect.Height()) );

	m_wndGameChatBar.GetWindowRect( &Rect );
	m_wndGameChatBar.PostMessage( WM_SIZE, SIZE_RESTORED, MAKELPARAM(Rect.Width(),Rect.Height()) );

	m_wndGamePlayerBar.GetWindowRect( &Rect );
	m_wndGamePlayerBar.PostMessage( WM_SIZE, SIZE_RESTORED, MAKELPARAM(Rect.Width(),Rect.Height()) );

	m_wndGameActionBar.GetWindowRect( &Rect );
	m_wndGameActionBar.PostMessage( WM_SIZE, SIZE_RESTORED, MAKELPARAM(Rect.Width(),Rect.Height()) );

	return 0;
}
Exemplo n.º 16
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	const int nDropHeight = 100;

  // set same styles for use with all toolbars
  DWORD dwToolBarStyles = WS_CHILD | WS_VISIBLE | CBRS_SIZE_DYNAMIC |
			CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_GRIPPER;
  CRect rectDummy(0,0,0,0);

	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
  if( (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_MAIN)) ||
		  (!m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) )
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create main tool bar
	}

	if( (!m_wndStatusBar.Create(this, WS_CHILD|WS_VISIBLE|CBRS_BOTTOM, IDW_STATUS_BAR)) ||
  		!m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT)) )
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

  if( (!m_AnimToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_ANIMATION)) ||
		  (!m_AnimToolBar.LoadToolBar(IDR_ANIMCONTROL)) )
	{
		TRACE0("Failed to create animation toolbar\n");
		return -1;      // fail to create animation tool bar
	}
	
  if( (!m_TextureToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_TEXTURE)) ||
		  (!m_TextureToolBar.LoadToolBar(IDR_TEXTURECONTROL)) )
	{
		TRACE0("Failed to create texture toolbar\n");
		return -1;      // fail to create texture tool bar
	}

  if( (!m_FXToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_FX)) ||
		  (!m_FXToolBar.LoadToolBar(IDR_FX_CONTROL)) )
	{
		TRACE0("Failed to create FX toolbar\n");
		return -1;      // fail to create fx tool bar
	}

  if( (!m_StainsToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_STAINS)) ||
		  (!m_StainsToolBar.LoadToolBar(IDR_STAINSCONTROL)) )
	{
		TRACE0("Failed to create stains toolbar\n");
		return -1;      // fail to create stains tool bar
	}

  if( (!m_ScriptToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_SCRIPT)) ||
		  (!m_ScriptToolBar.LoadToolBar(IDR_SCRIPTCONTROL)) )
	{
		TRACE0("Failed to create script toolbar\n");
		return -1;      // fail to create script tool bar
	}

  if( (!m_MipAndLightToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_MIP_AND_LIGHT)) ||
		  (!m_MipAndLightToolBar.LoadToolBar(IDR_MIPANDLIGHT)) )
	{
		TRACE0("Failed to create mip and light toolbar\n");
		return -1;      // fail to create mip and light tool bar
	}

  if( (!m_RenderControlBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_RENDER)) ||
		  (!m_RenderControlBar.LoadToolBar(IDR_RENDERCONTROL)) )
	{
		TRACE0("Failed to create render control toolbar\n");
		return -1;      // fail to create render control tool bar
	}
  static UINT aidRenderControlBar[15] =
  {
    ID_REND_BBOX_FRAME,
    ID_REND_BBOX_ALL,
    ID_REND_WIRE_ONOFF,
    ID_REND_HIDDEN_LINES,
    ID_REND_FLOOR,
    ID_REND_NO_TEXTURE,
    ID_REND_WHITE_TEXTURE,
    ID_REND_SURFACE_COLORS,
    ID_REND_ON_COLORS,
    ID_REND_OFF_COLORS,
    ID_REND_USE_TEXTURE,
    ID_SHADOW_WORSE,
    ID_SHADOW_BETTER,
    ID_TOGGLE_MEASURE_VTX,
    ID_VIEW_AXIS,
  };
  m_RenderControlBar.SetButtons( aidRenderControlBar, 15);

  if( (!m_RotateToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_ROTATION)) ||
		  (!m_RotateToolBar.LoadToolBar(IDR_ROTATE)) )
	{
		TRACE0("Failed to create rotate surface control toolbar\n");
		return -1;      // fail to create rotate control tool bar
	}
  
  if( (!m_MappingToolBar.CreateEx(this, TBSTYLE_FLAT, dwToolBarStyles, rectDummy, IDW_TOOLBAR_MAPPING)) ||
		  (!m_MappingToolBar.LoadToolBar(IDR_MAPPING)) )
	{
		TRACE0("Failed to create mapping control toolbar\n");
		return -1;      // fail to create mapping control tool bar
	}
  
  // Set z-speed edit ctrl
  m_AnimToolBar.SetButtonInfo(0, ID_Z_SPEED, TBBS_SEPARATOR, 40);
  CRect rectEditSpeed;
	m_AnimToolBar.GetItemRect(0, &rectEditSpeed);
  rectEditSpeed.top = 2;
  rectEditSpeed.right -= 2;
  rectEditSpeed.bottom = rectEditSpeed.top + 18;
  if (!m_ctrlZSpeed.Create( WS_VISIBLE|WS_BORDER,
    rectEditSpeed, &m_AnimToolBar, ID_Z_SPEED) )
	{
		TRACE0("Failed to create model speed edit control\n");
		return FALSE;
	}
  m_ctrlZSpeed.SetWindowText("0");
  
  // Set z-loop edit ctrl
  m_AnimToolBar.SetButtonInfo(1, ID_Z_LOOP_TIMES, TBBS_SEPARATOR, 25);
  CRect rectEditLoop;
	m_AnimToolBar.GetItemRect(1, &rectEditLoop);
  rectEditLoop.top = 2;
  rectEditLoop.bottom = rectEditLoop.top + 18;
  if (!m_ctrlZLoop.Create( WS_VISIBLE|WS_BORDER,
    rectEditLoop, &m_AnimToolBar, ID_Z_LOOP_TIMES) )
	{
		TRACE0("Failed to create model loop edit control\n");
		return FALSE;
	}
  m_ctrlZLoop.SetWindowText("4");

  m_AnimToolBar.SetButtonInfo(6, ID_ANIM_CHOOSE, TBBS_SEPARATOR, 150);
  m_TextureToolBar.SetButtonInfo(2, ID_TEXTURE_CHOOSE, TBBS_SEPARATOR, 150);
  m_StainsToolBar.SetButtonInfo(3, ID_STAINS_CHOOSE, TBBS_SEPARATOR, 150);

  CRect rect;
	m_AnimToolBar.GetItemRect(6, &rect);
	rect.top = 2;
	rect.bottom = rect.top + nDropHeight;
  if (!m_AnimComboBox.Create(
			CBS_DROPDOWNLIST|WS_VISIBLE|WS_TABSTOP|WS_VSCROLL,
			rect, &m_AnimToolBar, ID_ANIM_CHOOSE))
	{
		TRACE0("Failed to create animation combo-box\n");
		return FALSE;
	}
	
  m_TextureToolBar.GetItemRect(2, &rect);
	rect.top = 2;
	rect.bottom = rect.top + nDropHeight;
  if (!m_SkinComboBox.Create(
			CBS_DROPDOWNLIST|WS_VISIBLE|WS_TABSTOP|WS_VSCROLL,
			rect, &m_TextureToolBar, ID_TEXTURE_CHOOSE))
	{
		TRACE0("Failed to create texture combo-box\n");
		return FALSE;
	}

  m_StainsToolBar.GetItemRect(3, &rect);
	rect.top = 2;
	rect.bottom = rect.top + nDropHeight;
  if (!m_StainsComboBox.Create(
			CBS_DROPDOWNLIST|WS_VISIBLE|WS_TABSTOP|WS_VSCROLL,
			rect, &m_StainsToolBar, ID_STAINS_CHOOSE))
	{
		TRACE0("Failed to create stains combo-box\n");
		return FALSE;
	}

  m_AnimComboBox.AddString( "None available");
  m_AnimComboBox.SetCurSel( 0);
	
  m_SkinComboBox.AddString( "None available");
  m_SkinComboBox.SetCurSel( 0);
	
  m_StainsComboBox.AddString( "None available");
  m_StainsComboBox.SetCurSel( 0);
	
  //  Create a font for the comboboxes
	LOGFONT logFont;
	memset(&logFont, 0, sizeof(logFont));

	if (!::GetSystemMetrics(SM_DBCSENABLED))
	{
		logFont.lfHeight = -11;
		logFont.lfWeight = FW_REGULAR;
		logFont.lfPitchAndFamily = FF_ROMAN;
    logFont.lfOrientation = 10;
    logFont.lfQuality = PROOF_QUALITY;
    logFont.lfItalic = TRUE;
		
    CString strDefaultFont;
		strDefaultFont.LoadString(IDS_DEFAULT_ARIAL);
		lstrcpy(logFont.lfFaceName, strDefaultFont);
    
    if( !m_Font.CreateFontIndirect(&logFont))
			TRACE0("Could Not create font for combo\n");
		else
    {
      m_ctrlZSpeed.SetFont(&m_Font);
      m_ctrlZLoop.SetFont(&m_Font);
      m_AnimComboBox.SetFont(&m_Font);
      m_SkinComboBox.SetFont(&m_Font);
      m_StainsComboBox.SetFont(&m_Font);
    }
	}
	else
	{
    m_Font.Attach(::GetStockObject(SYSTEM_FONT));
    m_ctrlZSpeed.SetFont(&m_Font);
    m_ctrlZLoop.SetFont(&m_Font);
    m_AnimComboBox.SetFont(&m_Font);
    m_SkinComboBox.SetFont(&m_Font);
    m_StainsComboBox.SetFont(&m_Font);
	}

  // create pane for closest surface
  UINT nID;
  UINT nStyle;
  int cxWidth;
  m_wndStatusBar.GetPaneInfo( CLOSEST_SURFACE_PANE, nID, nStyle, cxWidth);
  cxWidth = 160;
  m_wndStatusBar.SetPaneInfo( CLOSEST_SURFACE_PANE, nID, nStyle, cxWidth);

	EnableDocking(CBRS_ALIGN_ANY);

	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);

  m_AnimToolBar.SetBarStyle(m_AnimToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_AnimToolBar.EnableDocking(CBRS_ALIGN_ANY);

  m_TextureToolBar.SetBarStyle(m_TextureToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_TextureToolBar.EnableDocking(CBRS_ALIGN_ANY);

  m_FXToolBar.SetBarStyle(m_FXToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_FXToolBar.EnableDocking(CBRS_ALIGN_ANY);

  m_StainsToolBar.SetBarStyle(m_StainsToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_StainsToolBar.EnableDocking(CBRS_ALIGN_ANY);

  m_ScriptToolBar.SetBarStyle(m_ScriptToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_ScriptToolBar.EnableDocking(CBRS_ALIGN_ANY);

  m_MipAndLightToolBar.SetBarStyle(m_MipAndLightToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_MipAndLightToolBar.EnableDocking(CBRS_ALIGN_ANY);
  
  m_RenderControlBar.SetBarStyle(m_RenderControlBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_RenderControlBar.EnableDocking(CBRS_ALIGN_ANY);
  
  m_RotateToolBar.SetBarStyle(m_RotateToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_RotateToolBar.EnableDocking(CBRS_ALIGN_ANY);
  
  m_MappingToolBar.SetBarStyle(m_MappingToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_MappingToolBar.EnableDocking(CBRS_ALIGN_ANY);
  
	RecalcLayout();
	DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_TOP);
	DockControlBarRelativeTo(&m_AnimToolBar, &m_wndToolBar, 1, 0);
	DockControlBarRelativeTo(&m_TextureToolBar,&m_FXToolBar, 1, 0);
	DockControlBarRelativeTo(&m_FXToolBar,&m_AnimToolBar, 1, 0);

  DockControlBarRelativeTo(&m_ScriptToolBar,&m_wndToolBar, 0, 15);
	DockControlBarRelativeTo(&m_MipAndLightToolBar,&m_ScriptToolBar, 1, 0);
  DockControlBarRelativeTo(&m_RotateToolBar, &m_MipAndLightToolBar, 1, 0);
  DockControlBarRelativeTo(&m_MappingToolBar, &m_RotateToolBar, 1, 0);
	DockControlBarRelativeTo(&m_StainsToolBar,&m_MappingToolBar, 1, 0);
	
  DockControlBar(&m_RenderControlBar, AFX_IDW_DOCKBAR_LEFT);
  DockControlBarRelativeTo(&m_MappingToolBar, &m_RenderControlBar, 0, 1);

	LoadBarState(_T("General"));
  return 0;
}
Exemplo n.º 17
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndToolBar.Create(this) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if( !CreateStyleBar() )
	{
		TRACE0("Failed to create brush toolbar\n");
		return -1;      // fail to create
	}

	if( !CreateGroupBar() )
	{
		TRACE0("Failed to create group toolbar\n");
		return -1;      // fail to create
	}

	//	CHANGE!	04/03/97	John Moore
	if( !CreateTabBar() )
	{
		TRACE0("Failed to create tab bar\n");
		return -1;
	}
	//	End of CHANGE

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	UINT pane_id;
	UINT pane_style;
	int pane_width;

	m_wndStatusBar.GetPaneInfo( ID_SLOCK_PANE,		pane_id, pane_style, pane_width );
	m_wndStatusBar.SetPaneInfo( ID_SLOCK_PANE,		pane_id, pane_style, 40);
	m_wndStatusBar.GetPaneInfo( ID_SELINFO_PANE,	pane_id, pane_style, pane_width );
	m_wndStatusBar.SetPaneInfo( ID_SELINFO_PANE,	pane_id, pane_style, 200);

	m_wndStatusBar.GetPaneInfo( ID_WORLDPOS_PANE,	pane_id, pane_style, pane_width );
	m_wndStatusBar.SetPaneInfo( ID_WORLDPOS_PANE,	pane_id, pane_style, 100);
	
	m_wndStatusBar.GetPaneInfo( ID_CURSORINFO_PANE, pane_id, pane_style, pane_width );
	m_wndStatusBar.SetPaneInfo( ID_CURSORINFO_PANE, pane_id, pane_style, 100);
	

	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	m_wndBrushToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	m_wndGroupBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	m_wndToolBar.SetWindowText( "General" ) ;
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndBrushToolBar.SetWindowText( "Mode" ) ;
	m_wndBrushToolBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndGroupBar.SetWindowText( "Group" ) ;
	m_wndGroupBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndTabBar.SetWindowText( "Command Panel" ) ;
	m_wndTabBar.EnableDocking( CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT );

	EnableDocking(CBRS_ALIGN_ANY);

	DockControlBar(&m_wndTabBar, AFX_IDW_DOCKBAR_RIGHT);
	DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_TOP );
	DockControlBarLeftOf(&m_wndBrushToolBar, &m_wndToolBar );
	DockControlBarLeftOf(&m_wndGroupBar, &m_wndBrushToolBar );

	m_CB_FUSION_BRUSH_FORMAT = RegisterClipboardFormat( "FUSIONBRUSHDATA" );
	m_CB_FUSION_ENTITY_FORMAT = RegisterClipboardFormat( "FUSIONENTITYDATA" );
	LoadBarState( "DESKTOP" ) ;	

	return 0;
}
Exemplo n.º 18
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{

    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
    
	if (!m_wndToolBar.CreateEx
		(this,
		TBSTYLE_FLAT,
		WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY
		| CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}


    UINT Style, ID;
    int Size;
    m_wndStatusBar.GetPaneInfo(0 , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(0 , ID, Style, 30);

    m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO1 , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO1, ID, Style, 150);
    m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO1, SBT_OWNERDRAW );

    m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO2 , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO2, ID, Style, 150);
    m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO2, SBT_OWNERDRAW );

    m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO3 , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO3, ID, Style, 150);
    m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO3, SBT_OWNERDRAW );

    m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO4 , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO4, ID, Style, 150);
    m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO4, SBT_OWNERDRAW );

    m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO5 , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO5, ID, Style, 150);
    m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO5, SBT_OWNERDRAW );
    

    m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_CONNECTED , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_CONNECTED , ID, Style, 14);
    m_wndStatusBar.GetStatusBarCtrl ().SetText(0, NUM_INDICATOR_CONNECTED, SBT_OWNERDRAW );


    m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_LOGGED , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_LOGGED , ID, Style, 14);
    m_wndStatusBar.GetStatusBarCtrl ().SetText(0, NUM_INDICATOR_LOGGED, SBT_OWNERDRAW );


    m_wndStatusBar.GetPaneInfo(NUM_PATH_WRITING , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_PATH_WRITING , ID, Style, 14);
    m_wndStatusBar.GetStatusBarCtrl ().SetText(0, NUM_PATH_WRITING, SBT_OWNERDRAW );


    m_wndStatusBar.GetPaneInfo(NUM_TICKER , ID, Style, Size);
    m_wndStatusBar.SetPaneInfo(NUM_TICKER , ID, Style, 20);

    // TODO: Remove this if you don't want tool tips or a resizeable toolbar
	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

    m_editBar.Create(this , CBRS_BOTTOM  , 100 );
	
//vls-begin// multiple output
//    CString t;
//    t.LoadString(IDS_OUTPUT);
//    LPCSTR strTitle = t;
//
//	if (!m_coolBar.Create(this, strTitle, CSize(200, 100), ID_VIEW_OUTPUTWINDOW,  WS_CHILD | WS_VISIBLE | CBRS_TOP) )
//	{
//		TRACE0("Failed to create output window\n");
//		return -1;      // fail to create
//	}
//
//    m_coolBar.SetBarStyle(m_coolBar.GetBarStyle()|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC);
//	m_coolBar.EnableDocking(CBRS_ALIGN_ANY);
//	DockControlBar(&m_coolBar);
//	LoadBarState("JMC");
//    m_coolBar.Load();
    CString t;
    t.LoadString(IDS_OUTPUT);
    
    for (int i = 0; i < MAX_OUTPUT; i++) {
        CString str;
        str.Format(t, i);
        LPCSTR strTitle = str;

        m_coolBar[i].m_wndCode = i;
        m_coolBar[i].m_wndAnsi.m_wndCode = i;
        if (!m_coolBar[i].Create(this, strTitle, CSize(200, 100), outputwindows[i],  WS_CHILD | WS_VISIBLE | CBRS_TOP) )
        {
            TRACE0("Failed to create output window\n");
            return -1;      // fail to create
        }
        m_coolBar[i].SetBarStyle(m_coolBar[i].GetBarStyle()|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC);
        m_coolBar[i].Load();
        DockControlBar(&m_coolBar[i]);
		m_coolBar[i].m_pDockContext->ToggleDocking();
		CControlBar* pBar = GetControlBar(outputwindows[i]);
		wposes[i][0] = m_coolBar[i].m_mX;
		wposes[i][1] = m_coolBar[i].m_mY;
		if(pBar->IsFloating())
		{
			FloatControlBar(pBar,CPoint(m_coolBar[i].m_mX,m_coolBar[i].m_mY),0);
		}

    }
    LoadBarState("JMC");
    InitOutputNameFunc(GetOutputName);
	
//vls-end//
    
    SetTimer(1, 1000, NULL);

    // Load history here 
    CFile histFile;
    if ( histFile.Open("history.dat", CFile::modeRead ) ) {
        CArchive ar(&histFile, CArchive::load );
        m_editBar.GetHistory().Serialize (ar);
        m_editBar.m_nCurrItem = m_editBar.GetHistory().GetCount();
    }

	char trayTitle[BUFFER_SIZE] = "";
	
	CSmcDoc* pDoc = (CSmcDoc*)GetActiveDocument();
	if ( pDoc ) {
		CString text;
		text.Format(IDS_JABA_TITLE, pDoc->m_strProfileName);
		strcpy(trayTitle, text);
	}

	sysTray = CTray(IDR_MAINFRAME, trayTitle);

//	GetDlgItem(ID_VIEW_MUDEMULATOR)->SetWindowText("Emulation");
    return 0;
}