Esempio n. 1
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

	CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

	CreateSimpleStatusBar();

	m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL, WS_EX_CLIENTEDGE);
	m_view.SetScrollSize(1,1);
	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	return 0;
}
Esempio n. 2
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    // create command bar window
    HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
    // attach menu
    m_CmdBar.AttachMenu(GetMenu());
    // load command bar images
    m_CmdBar.LoadImages(IDR_MAINFRAME);
    // remove old menu
    SetMenu(NULL);

    HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

    CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
    AddSimpleReBarBand(hWndCmdBar);
    AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

    CreateSimpleStatusBar();

    UIAddToolBar(hWndToolBar);
    UISetCheck(ID_VIEW_TOOLBAR, 1);
    UISetCheck(ID_VIEW_STATUS_BAR, 1);

    // register object for message filtering and idle updates
    CMessageLoop* pLoop = _Module.GetMessageLoop();
    ATLASSERT(pLoop != NULL);
    pLoop->AddMessageFilter(this);
    pLoop->AddIdleHandler(this);

    // Create the splitter windows.
    const DWORD dwSplitStyle = CHILD_WND_STYLE;

    m_wndVerSplit1.Create (*this, rcDefault, NULL, dwSplitStyle);
    m_wndVerSplit1.m_bFullDrag = false;
    m_wndVerSplit1.m_cxyMin = 200;
    m_wndVerSplit1.SetSplitterPos(200);

    m_wndVerSplit2.Create(m_wndVerSplit1, rcDefault, NULL, dwSplitStyle);
    m_wndVerSplit2.m_bFullDrag = false;
    m_wndVerSplit2.m_cxyMin = 200;
    m_wndVerSplit2.SetSplitterPos(200);

    // Create splitter view
    const DWORD dwViewStyle = CHILD_WND_STYLE;
    const DWORD dwViewStyleEx = WS_EX_CLIENTEDGE;
    m_wndLeftView.Create(m_wndVerSplit1, rcDefault, NULL, dwViewStyle, dwViewStyleEx);
    m_wndMiddleView.Create(m_wndVerSplit2, rcDefault, NULL, dwViewStyle, dwViewStyleEx);
    m_wndRightView.Create(m_wndVerSplit2, rcDefault, NULL, dwViewStyle, dwViewStyleEx);

    m_wndVerSplit1.SetSplitterPanes(m_wndLeftView, m_wndVerSplit2);
    m_wndVerSplit2.SetSplitterPanes(m_wndMiddleView, m_wndRightView);
    m_hWndClient = m_wndVerSplit1;

    // Set the splitter as the client area window, and resize the splitter 
    // to match the frame size.
    UpdateLayout();

    return 0;
}
Esempio n. 3
0
LRESULT CMiniPieFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CAppInfo info;

	// Full screen mode delayed restoration 
	bool bFull = false;
	info.Restore(bFull, L"Full");
	if (bFull)
		PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);

	CreateSimpleCEMenuBar();
#ifdef WIN32_PLATFORM_WFSP // SmartPhone
	AtlActivateBackKey(m_hWndCECommandBar);
#endif 
	UIAddToolBar(m_hWndCECommandBar);
	SetCommandButton(ID_APP_EXIT);

	// StatusBar state restoration 
	bool bVisible = true;
	info.Restore(bVisible, L"Status");
	DWORD dwStyle = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_TOP;
	if (bVisible)
		dwStyle |= WS_VISIBLE;

	// StatusBar creation 
	CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, dwStyle);
	UIAddStatusBar(m_hWndStatusBar);
	UISetCheck(ID_VIEW_STATUS_BAR, bVisible);

	// Browser view creation
	m_hWndClient = m_browser.Create(m_hWnd, NULL, _T("Microsoft.PIEDocView"),
                     WS_CHILD | WS_VISIBLE | WS_BORDER, 0, ID_BROWSER);

    ATLVERIFY(SUCCEEDED(m_browser.QueryControl(&m_spIWebBrowser2)));
    ATLVERIFY(SUCCEEDED(AtlAdviseSinkMap(this, true)));

	// Navigation menu initialization
	UIEnable(IDM_BACK, FALSE);
	UIEnable(IDM_FORWARD, FALSE);
	UIEnable(IDM_STOP, FALSE);
	UIEnable(IDM_REFRESH, FALSE);

#ifdef WIN32_PLATFORM_PSPC 
	// PPC Address bar state restoration
    VARIANT_BOOL vb = ATL_VARIANT_TRUE;
	info.Restore(vb, L"Address");
	m_spIWebBrowser2->put_AddressBar(vb);
	UISetCheck(ID_VIEW_ADDRESSBAR, vb == ATL_VARIANT_TRUE);
#endif 

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	return 0;
}
Esempio n. 4
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// Check if Common Controls 6.0 are used. If yes, use 32-bit (alpha) images
	// for the toolbar and command bar. If not, use the old, 4-bit images.
	UINT uResID = IDR_MAINFRAME_OLD;
	DWORD dwMajor = 0;
	DWORD dwMinor = 0;
	HRESULT hRet = AtlGetCommCtrlVersion(&dwMajor, &dwMinor);
	if(SUCCEEDED(hRet) && dwMajor >= 6)
		uResID = IDR_MAINFRAME;

	// Set values to be displayed in the view window
	m_view.m_dwCommCtrlMajor = dwMajor;
	m_view.m_dwCommCtrlMinor = dwMinor;
	m_view.m_bAlpha = (uResID == IDR_MAINFRAME);

	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(uResID);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, uResID, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

	CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);
	CreateSimpleStatusBar();

	_createVerticalSplitter();
	_createCanvas();
	_createHoricalSplitter();
	_createTreeView();
	_createAnimationBox();

	UpdateLayout();

	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_RENDER_BAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIEnable(ID_EDIT_PASTE, FALSE);

	_canvas = NULL;
	//
	return 0;
}
Esempio n. 5
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    hThread = 0;
    // create command bar window
    HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
    // attach menu
    m_CmdBar.AttachMenu(GetMenu());
    // load command bar images
    m_CmdBar.LoadImages(IDR_MAINFRAME);
    // remove old menu
    SetMenu(NULL);

    HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(),
                                          MAKEINTRESOURCE(IDR_MAINFRAME),
                                          IMAGE_ICON,
                                          ::GetSystemMetrics(SM_CXSMICON),
                                          ::GetSystemMetrics(SM_CYSMICON),
                                          LR_DEFAULTCOLOR);

    InstallIcon(_T("Tooltip text"), hIconSmall, IDR_TRAYPOPUP);
    SetDefaultItem(ID_SHOW);


    HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

    CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
    AddSimpleReBarBand(hWndCmdBar);
    AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

    CreateSimpleStatusBar();

    WTL::CRect r(0, 0, 800, 600);

    m_hWndClient = m_view.Create(m_hWnd, r, NULL,
                                 WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
                                 LBS_NOINTEGRALHEIGHT | LBS_NOTIFY | LBS_WANTKEYBOARDINPUT, WS_EX_CLIENTEDGE);

    m_view.SetFont(AtlGetDefaultGuiFont());

    UIAddToolBar(hWndToolBar);
    UISetCheck(ID_VIEW_TOOLBAR, 1);
    UISetCheck(ID_VIEW_STATUS_BAR, 1);

    // register object for message filtering and idle updates
    CMessageLoop* pLoop = _Module.GetMessageLoop();
    ATLASSERT(pLoop != NULL);
    pLoop->AddMessageFilter(this);
    pLoop->AddIdleHandler(this);

    return 0;
}
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CNCaptureApplication::Instance()->m_pMainFrame = this;

	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

	CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

	CreateSimpleStatusBar();

	m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);
	m_view.Initialize();
	
#ifdef FTL_DEBUG
	HRESULT hr = E_FAIL;
	CWindowDC dcScreen(NULL);
	m_bitmap.CreateCompatibleBitmap(dcScreen, 100, 100);
	CCapImageObj* pImageObj = new CCapImageObj(TEXT("G:\\TestImage.PNG"), NULL);
	COM_VERIFY(pImageObj->Load(TEXT("G:\\TestImage.PNG")));
	if (SUCCEEDED(hr))
	{
		CNCaptureApplication::Instance()->GetDocument()->SetCurCaptureImage(pImageObj);
	}
#endif

	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	
	return 0;
}
Esempio n. 7
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

	CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

	CString szAddress;
	szAddress.LoadString(IDS_ADDRESS);
	m_URL.Create(m_hWnd,CRect(0,0,0,18),NULL,WS_CHILD|WS_VISIBLE,WS_EX_STATICEDGE);
	AddSimpleReBarBand(m_URL,szAddress.GetBuffer(0),TRUE);
	m_URL.SetFont(AtlGetDefaultGuiFont());
	SHAutoComplete(m_URL,SHACF_URLALL);

	CreateSimpleStatusBar();
	m_StatusBar.SubclassWindow(m_hWndStatusBar);
	int nPanes[]={ID_DEFAULT_PANE,IDR_LOCK,IDR_PROGRESS};
	m_StatusBar.SetPanes(nPanes,sizeof(nPanes)/sizeof(int),false);
	m_StatusBar.SetPaneWidth(IDR_LOCK,30);
	m_StatusBar.SetPaneWidth(IDR_PROGRESS,50);
	
	//TODO: Replace with a URL of your choice
	m_hWndClient = m_view.Create(m_hWnd, rcDefault, _T("about:blank"), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL, WS_EX_CLIENTEDGE);

	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	m_view.GoHome();

	return 0;
}
LRESULT MainFrameBase::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
   CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);

   SetupCmdbar();
   //SetupToolbar();

   CreateSimpleStatusBar();
   UISetCheck(ID_VIEW_STATUS_BAR, 1);

   SetupMDIClient();

   // register object for message filtering and idle updates
   CMessageLoop* pLoop = _Module.GetMessageLoop();
   ATLASSERT(pLoop != NULL);
   pLoop->AddMessageFilter(this);
   pLoop->AddIdleHandler(this);

   // floating stuff
   InitializeDockingFrame();

   UpdateLayout();

   return 0;
}
Esempio n. 9
0
void CMainFrame::OnOptions( UINT /*uNotifyCode*/, int nID, CWindow /*wndCtl*/ )
{
	bool *pbOption = NULL;

	switch ( nID )
	{
	case ID_OPTIONS_KEEPEXISTING  : pbOption = &m_bKeepExisting;  break;
	case ID_OPTIONS_AUTODETECT    : pbOption = &m_bAutoDetect;    break;
	case ID_OPTIONS_FORCEPROTOCOL : pbOption = &m_bForceProtocol; break;
	case ID_OPTIONS_FILLGAPS      : pbOption = &m_bFillGaps;      break;
	case ID_OPTIONS_AUTOSETUP     : pbOption = &m_bAutoSetup;     break;
	case ID_OPTIONS_FORCEALL      : pbOption = &m_bForceAll;      break;
	case ID_OPTIONS_DISACTIVATE   : pbOption = &m_bDisactivate;   break;
	case ID_OPTIONS_SETSENSORTYPE : pbOption = &m_bSetSensorType; break;
	case ID_OPTIONS_SHORTREADS    : pbOption = &m_bShortReads;    break;
	case ID_OPTIONS_SYNCHRONIZE   : pbOption = &m_bSynchronize;   break;
	case ID_OPTIONS_SYNCH_INTERNAL: pbOption = &m_bSynchInternal; break;
	case ID_OPTIONS_SYNCH_PERIODIC: pbOption = &m_bSynchPeriodic; break;
	case ID_DAC_RECORD            : pbOption = &m_bRecord;        break;
	default : ATLASSERT( false ); break;
	}
	if ( NULL != pbOption )
	{
		*pbOption ^= true;
		UISetCheck( nID, *pbOption );
	}
}
void CMainFrame::OnViewStatusBar(UINT uNotifyCode, int nID, CWindow wndCtl)
{
	BOOL bVisible = !::IsWindowVisible(m_hWndStatusBar);
	::ShowWindow(m_hWndStatusBar, bVisible ? SW_SHOWNOACTIVATE : SW_HIDE);
	UISetCheck(ID_VIEW_STATUS_BAR, bVisible);
	UpdateLayout();
}
Esempio n. 11
0
LRESULT CMainFrame::OnToolsRepeat(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/)
{
	bool bRepeat = UIGetState(wID) &  UPDUI_CHECKED;
	UISetCheck(wID, !bRepeat);
	m_view._bRepeat = bRepeat;
	return 0;
}
Esempio n. 12
0
LRESULT CMainFrame::OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	BOOL bVisible = !::IsWindowVisible(m_hWndStatusBar);
	::ShowWindow(m_hWndStatusBar, bVisible ? SW_SHOWNOACTIVATE : SW_HIDE);
	UISetCheck(ID_VIEW_STATUS_BAR, bVisible);
	UpdateLayout();
	return 0;
}
Esempio n. 13
0
LRESULT CMiniPieFrame::OnViewAddressBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
    VARIANT_BOOL vb;
	m_spIWebBrowser2->get_AddressBar(&vb);
	m_spIWebBrowser2->put_AddressBar(vb == ATL_VARIANT_TRUE ? ATL_VARIANT_FALSE : ATL_VARIANT_TRUE);
	UISetCheck(ID_VIEW_ADDRESSBAR, vb == ATL_VARIANT_FALSE);
	return 0;
}
Esempio n. 14
0
void CMainFrame::OnOptionsUnitType( UINT /*uNotifyCode*/, int nID, CWindow /*wndCtl*/ )
{
	if ( nID == m_idUnitType ) return;

	UISetCheck( m_idUnitType, false );

	switch ( nID )
	{
	case ID_OPTIONS_UNITTYPE_NONE : m_nUnitType = TTLAPI_UT_DEFAULT;  m_nScale = 0.004; break;
	case ID_OPTIONS_UNITTYPE_SENV : m_nUnitType = TTLAPI_UT_SENSVOLT; m_nScale = 0.004; break;
	case ID_OPTIONS_UNITTYPE_ENCV : m_nUnitType = TTLAPI_UT_ENCVOLT;  m_nScale = 1.7;   break;
	case ID_OPTIONS_UNITTYPE_ENCC : m_nUnitType = TTLAPI_UT_COUNT;    m_nScale = 8192;  break;
	default : ATLASSERT( false ); break;
	}

	UISetCheck( m_idUnitType = nID, true );
}
Esempio n. 15
0
LRESULT CMainFrame::OnViewTreePane(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	bool bShow = (m_splitter.GetSinglePaneMode() != SPLIT_PANE_NONE);
	m_splitter.SetSinglePaneMode(bShow ? SPLIT_PANE_NONE : SPLIT_PANE_RIGHT);
	UISetCheck(ID_VIEW_TREEPANE, bShow);

	return 0;
}
Esempio n. 16
0
LRESULT CMainFrame::OnShowVectors(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	bool show = !m_simcontrol.GetShowVectors();
	m_simcontrol.SetShowVectors(show);
	UISetCheck(ID_VIEW_SHOWBALLVECTORS, show);
	UpdateLayout();
	return 0;
}
void MainFrameBase::SetupToolbar()
{
   HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

   AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

   UIAddToolBar(hWndToolBar);
   UISetCheck(ID_VIEW_TOOLBAR, 1);
}
Esempio n. 18
0
File: MainFrm.cpp Progetto: som/FED
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

	CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

	CreateSimpleStatusBar();
	m_hWndClient = m_splitter.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);

	m_pane.SetPaneContainerExtendedStyle(PANECNT_NOBORDER);
	m_pane.Create(m_splitter, _T("Tree"), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
	m_treeview.Create(m_pane, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | TVS_SHOWSELALWAYS, WS_EX_CLIENTEDGE);
	m_pane.SetClient(m_treeview);

	m_view.Create(m_splitter, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);

	m_splitter.SetSplitterPanes(m_pane, m_view);
	UpdateLayout();
	m_splitter.SetSplitterPos(300);

	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);
	UISetCheck(ID_VIEW_TREEPANE, 1);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	return 0;
}
void CMainFrame::OnViewToolBar(UINT uNotifyCode, int nID, CWindow wndCtl)
{
	static BOOL bVisible = TRUE;	// initially visible
	bVisible = !bVisible;
	CReBarCtrl rebar = m_hWndToolBar;
	int nBandIndex = rebar.IdToIndex(ATL_IDW_BAND_FIRST + 1);	// toolbar is 2nd added band
	rebar.ShowBand(nBandIndex, bVisible);
	UISetCheck(ID_VIEW_TOOLBAR, bVisible);
	UpdateLayout();
}
Esempio n. 20
0
LRESULT CMainFrame::OnViewShowLinks(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
{
	bool showLinks = m_view.GetShowLinks();
	showLinks = !showLinks;
	m_view.SetShowLinks(showLinks);
	UISetCheck(ID_VIEW_LINKS, showLinks);
	UpdateLayout();
	bHandled = TRUE;
	return 0;
}
Esempio n. 21
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

	CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);
	
	CreateSimpleStatusBar();

	CReBarCtrl bar = m_hWndToolBar;
	int nBandIndex = bar.IdToIndex(ATL_IDW_BAND_FIRST + 1);	// toolbar is 2nd added band
	bar.ShowBand(nBandIndex, FALSE);
	::ShowWindow(m_hWndStatusBar, SW_HIDE);
	UpdateLayout();

	m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);

	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 0);
	UISetCheck(ID_VIEW_STATUS_BAR, 0);
	UISetCheck(ID_VIEW_SHOWBALLVECTORS, m_simcontrol.GetShowVectors());

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	m_simcontrol.SetView(&m_view);
	m_simcontrol.Init();
	SetTimer(TIMER_FRAME, 10);
	return 0;
}
Esempio n. 22
0
LRESULT CMainFrame::OnTreePaneClose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
{
	if(hWndCtl == m_pane.m_hWnd)
	{
		m_splitter.SetSinglePaneMode(SPLIT_PANE_RIGHT);
		UISetCheck(ID_VIEW_TREEPANE, 0);
	}

	return 0;
}
Esempio n. 23
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_pView = new CDispView();
	m_pParameterDialog = new CParameterDialog();
	m_pParameterDialog->Create(m_hWnd, rcDefault);
	CRect rec;
	GetWindowRect(rec);
	m_pParameterDialog->CenterWindow(m_hWnd);
	m_pParameterDialog->m_onParameterChangeDelegate.bind(this, &CMainFrame::onParameterChange);
	
	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);
	
	CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

	CreateSimpleStatusBar();

	m_hWndClient = m_pView->Create(m_hWnd);

	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	::DragAcceptFiles(m_hWnd, TRUE);
	return 0;
}
Esempio n. 24
0
LRESULT CMainFrame::OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	static BOOL bVisible = TRUE;	// initially visible
	bVisible = !bVisible;
	CReBarCtrl rebar = m_hWndToolBar;
	int nBandIndex = rebar.IdToIndex(ATL_IDW_BAND_FIRST + 1);	// toolbar is 2nd added band
	rebar.ShowBand(nBandIndex, bVisible);
	UISetCheck(ID_VIEW_TOOLBAR, bVisible);
	UpdateLayout();
	return 0;
}
Esempio n. 25
0
LRESULT MainFrame::OnViewOutput(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
   // in single pane mode?
   bool bOutputPaneVisible = m_splitter.GetSinglePaneMode() == SPLIT_PANE_LEFT;

   m_splitter.SetSinglePaneMode(bOutputPaneVisible ? SPLIT_PANE_NONE : SPLIT_PANE_LEFT);

   UISetCheck(ID_VIEW_OUTPUT, bOutputPaneVisible);

   return 0;
}
Esempio n. 26
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CreateSimpleToolBar();

	CreateSimpleStatusBar();

	m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);

	UIAddToolBar(m_hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	return 0;
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    g_pMainFrame = this;

	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// attach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

	CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

	//CreateSimpleStatusBar();
    int anPanes[] = { ID_DEFAULT_PANE, ID_PANE_TILE_GRID };//, IDPANE_STATUS, IDPANE_CAPS_INDICATOR };

    m_hWndStatusBar = m_wndStatusBar.Create ( *this );
    UIAddStatusBar ( m_hWndStatusBar );
    m_wndStatusBar.SetPanes(anPanes, _countof(anPanes), false);

	CreateMDIClient();
	m_CmdBar.SetMDIClient(m_hWndMDIClient);

	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	return 0;
}
Esempio n. 28
0
LRESULT CMainFrame::OnSpeed(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{

	if(lastSpeedId==wID)
		return 0;
	UISetCheck(lastSpeedId, 0);
	UISetCheck(wID, 1);
	lastSpeedId=wID;
	double speed=1.0;
	switch(wID)
	{
	case ID_SPEED_50:  speed=2.0; break;
	case ID_SPEED_100: speed=1.0;    break;           
	case ID_SPEED_150:  speed=0.75;    break;                  
	case ID_SPEED_200: speed=.5;    break;                            
	case ID_SPEED_400: speed=.25; break;
	}
	m_view._dOverride = speed;

	return 0;
}
Esempio n. 29
0
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CreateSimpleToolBar();

	CreateSimpleStatusBar();

	m_hWndClient = m_view.Create(m_hWnd);

	UIAddToolBar(m_hWndToolBar);
	UISetCheck(ID_VIEW_TOOLBAR, 1);
	UISetCheck(ID_VIEW_STATUS_BAR, 1);
	UISetCheck(ID_TOOLS_REPEAT, 1);
	UISetCheck(ID_SPEED_100, 1);
	lastSpeedId=ID_SPEED_100;


	
	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	// Init MRU list
	CMenuHandle mainMenu = GetMenu();
	CMenuHandle fileMenu = mainMenu.GetSubMenu(0);
	CMenuHandle mruMenu = fileMenu.GetSubMenu(9);
	m_mru.SetMenuHandle ( mruMenu );
	m_mru.UpdateMenu();
	m_mru.ReadFromRegistry(APP_SETTINGS_KEY);
	m_mru.SetMaxEntries(4);



	UIEnable ( ID_TOOLS_START, true );
    UIEnable ( ID_TOOLS_STOP, false );

	return 0;
}
Esempio n. 30
0
LRESULT CMainFrame::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	CRect rect;

	AtlAxWinInit();
	
	// create command bar window
	HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
	// atach menu
	m_CmdBar.AttachMenu(GetMenu());
	// load command bar images
	m_CmdBar.LoadImages(IDR_MAINFRAME);
	// remove old menu
	SetMenu(NULL);

	HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);

	CreateSimpleReBar(ATL_SIMPLE_REBAR_STYLE);
	AddSimpleReBarBand(hWndCmdBar);
	AddSimpleReBarBand(hWndToolBar, NULL, TRUE);

	CreateSimpleStatusBar();
	m_sbar.SubclassWindow(m_hWndStatusBar);
	
	m_sbar.SetPanes(arrParts, sizeof(arrParts) / sizeof(int), false);

	GetClientRect(&rect);
	m_hWndClient = m_wndScriptEidor.Create(m_hWnd, rect, _T(""), 
		WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);

	m_spScriptEditor.CoCreateInstance(CLSID_CxScriptEditor);

	CComPtr<IAxWinHostWindow> spContainer;
	m_wndScriptEidor.QueryHost(&spContainer);
	// Attach the browser control to the container
	spContainer->AttachControl(m_spScriptEditor, m_wndScriptEidor);

	DispEventAdvise(m_spScriptEditor);

	UIAddToolBar(hWndToolBar);
	UISetCheck(ID_VIEW_SYMBOL, 1);

	return 0;
}