예제 #1
0
파일: mdi.cpp 프로젝트: DumaGit/winsparkle
void wxMDIParentFrame::AddMDIChild(wxMDIChildFrame * WXUNUSED(child))
{
    switch ( GetChildFramesCount() )
    {
        case 1:
            // first MDI child was just added, we need to insert the window
            // menu now if we have it
            AddWindowMenu();

            // and disable the items which can't be used until we have more
            // than one child
            UpdateWindowMenu(false);
            break;

        case 2:
            // second MDI child was added, enable the menu items which were
            // disabled because they didn't make sense for a single window
            UpdateWindowMenu(true);
            break;
    }
}
예제 #2
0
void MDLViewer::OnShowAll()
{
	int c = IFacePoserToolWindow::GetToolCount();
	for ( int i = 0; i < c; i++ )
	{
		IFacePoserToolWindow *tool = IFacePoserToolWindow::GetTool( i );
		mxWindow *w = tool->GetMxWindow();

		w->setVisible( true );
	}

	UpdateWindowMenu();
}
예제 #3
0
파일: mdi.cpp 프로젝트: DumaGit/winsparkle
void wxMDIParentFrame::RemoveMDIChild(wxMDIChildFrame * WXUNUSED(child))
{
    switch ( GetChildFramesCount() )
    {
        case 1:
            // last MDI child is being removed, remove the now unnecessary
            // window menu too
            RemoveWindowMenu();

            // there is no need to call UpdateWindowMenu(true) here so this is
            // not quite symmetric to AddMDIChild() above
            break;

        case 2:
            // only one MDI child is going to remain, disable the menu commands
            // which don't make sense for a single child window
            UpdateWindowMenu(false);
            break;
    }
}
예제 #4
0
void EditorBase::InitMenu()
{
    mFileMenu = menuBar()->addMenu(tr("&File"));
    mFileMenu->addAction(mNewAct);
    mFileMenu->addAction(mOpenAct);
    mFileMenu->addAction(mSaveAct);
    mFileMenu->addAction(mSaveAsAct);
    mFileMenu->addSeparator();
    mFileMenu->addAction(mExitAct);

    mEditMenu = menuBar()->addMenu(tr("&Edit"));
    mEditMenu->addAction(mCutAct);
    mEditMenu->addAction(mCopyAct);
    mEditMenu->addAction(mPasteAct);

    mWindowMenu = menuBar()->addMenu(tr("&Window"));
    connect(mWindowMenu, SIGNAL(aboutToShow()), this, SLOT(UpdateWindowMenu()));

    menuBar()->addSeparator();

    mHelpMenu = menuBar()->addMenu(tr("&Help"));
    mHelpMenu->addAction(mAboutAct);
    mHelpMenu->addAction(mAboutQtAct);
}
예제 #5
0
void CCoolMenuBarCtrl::ShowMenu()
{
	if ( m_pHot == NULL || ! IsMenu( m_hMenu ) ) return;

	CMenu* pMenu = CMenu::FromHandle( m_hMenu )->GetSubMenu( m_pHot->m_nID - 1 );

	if ( pMenu == NULL )
	{
		m_pHot = m_pDown = NULL;
		Invalidate();
		return;
	}

	UINT nFirstID = pMenu->GetMenuItemID( 0 );

	if ( nFirstID == ID_WINDOW_CASCADE )
	{
		UpdateWindowMenu( pMenu );
	}
	
	m_pDown = m_pHot;
	Invalidate();
	
	KillTimer( 1 );
	
	TPMPARAMS tpm;
	CRect rc;
	
	GetItemRect( m_pDown, &rc );
	ClientToScreen( &rc );
	rc.DeflateRect( 1, 2 );
	
	tpm.cbSize = sizeof(tpm);
	tpm.rcExclude = rc;
	
	m_pMenuBar = this;
	m_hMsgHook = SetWindowsHookEx( WH_MSGFILTER, MenuFilter, NULL, GetCurrentThreadId() );
	
	CoolMenu.RegisterEdge( rc.left, rc.bottom, rc.Width() );
	
	UINT nCmd = TrackPopupMenuEx( pMenu->GetSafeHmenu(),
		TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL|TPM_RETURNCMD,
		rc.left, rc.bottom, GetSafeHwnd(), &tpm );
	
	UnhookWindowsHookEx( m_hMsgHook );
	
	m_hMsgHook = NULL;
	m_pMenuBar = NULL;
	
	m_pDown = NULL;
	OnTimer( 1 );
	
	if ( m_pHot != NULL )
	{
		SetTimer( 1, 100, NULL );
		m_bTimer = TRUE;
	}
	
	Invalidate();
	UpdateWindow();
	
	if ( nCmd ) GetOwner()->PostMessage( WM_COMMAND, nCmd );
}
예제 #6
0
MDLViewer::MDLViewer ()
: mxWindow (0, 0, 0, 0, 0, g_appTitle, mxWindow::Normal)
{
	int i;

	g_MDLViewer = this;

	FacePoser_MakeToolWindow( this, false );

	workspace = new CMDLViewerWorkspace( this, 0, 0, 500, 500, "" );
	windowtab = new CMDLViewerWindowTab( this, 0, 500, 500, 20, IDC_WINDOW_TAB );
	modeltab = new CMDLViewerModelTab( this, 500, 500, 100, 20, IDC_MODEL_TAB );
	gridsettings = new CMDLViewerGridSettings( this, 0, 500, 500, 20 );
	modeltab->SetRightJustify( true );

	g_pStatusWindow = new mxStatusWindow( workspace, 0, 0, 1024, 150, "" );
	g_pStatusWindow->setVisible( true );

	InitViewerSettings( "faceposer" );
	g_viewerSettings.speechapiindex = SPEECH_API_LIPSINC;
	g_viewerSettings.flHeadTurn = 0.0f;
	g_viewerSettings.m_iEditAttachment = -1;

	LoadPosition();
	// ShowWindow( (HWND)getHandle(), SW_SHOWMAXIMIZED );

	g_pStatusWindow->setBounds(  0, h2() - 150, w2(), 150 );

	Con_Printf( "MDLViewer started\n" );

	Con_Printf( "CSoundEmitterSystemBase::Init()\n" );
	soundemitter->BaseInit();

	Con_Printf( "Creating menu bar\n" );

	// create menu stuff
	mb = new mxMenuBar (this);
	menuFile = new mxMenu ();
	menuOptions = new mxMenu ();
	menuWindow = new mxMenu ();
	menuHelp = new mxMenu ();
	menuEdit = new mxMenu ();
	menuExpressions = new mxMenu();
	menuChoreography = new mxMenu();

	mb->addMenu ("File", menuFile);
	mb->addMenu( "Edit", menuEdit );
	mb->addMenu ("Options", menuOptions);
	mb->addMenu ( "Expression", menuExpressions );
	mb->addMenu ( "Choreography", menuChoreography );
	mb->addMenu ("Window", menuWindow);
	mb->addMenu ("Help", menuHelp);

	mxMenu *menuRecentModels = new mxMenu ();
	menuRecentModels->add ("(empty)", IDC_FILE_RECENTMODELS1);
	menuRecentModels->add ("(empty)", IDC_FILE_RECENTMODELS2);
	menuRecentModels->add ("(empty)", IDC_FILE_RECENTMODELS3);
	menuRecentModels->add ("(empty)", IDC_FILE_RECENTMODELS4);

	menuFile->add ("Load Model...", IDC_FILE_LOADMODEL);
	menuFile->add( "Refresh\tF5", IDC_FILE_REFRESH );

	menuFile->addSeparator();

	menuFile->add ("Load Background Texture...", IDC_FILE_LOADBACKGROUNDTEX);
	menuFile->add ("Load Ground Texture...", IDC_FILE_LOADGROUNDTEX);
	menuFile->addSeparator ();
	menuFile->add ("Unload Ground Texture", IDC_FILE_UNLOADGROUNDTEX);
	menuFile->addSeparator ();
	menuFile->addMenu ("Recent Models", menuRecentModels);
	menuFile->addSeparator ();
	menuFile->add ("Exit", IDC_FILE_EXIT);

	menuFile->setEnabled(IDC_FILE_LOADBACKGROUNDTEX, false);
	menuFile->setEnabled(IDC_FILE_LOADGROUNDTEX, false);
	menuFile->setEnabled(IDC_FILE_UNLOADGROUNDTEX, false);

	menuEdit->add( "&Undo\tCtrl+Z", IDC_EDIT_UNDO );
	//menuFile->setEnabled( IDC_EDIT_UNDO, false );
	menuEdit->add( "&Redo\tCtrl+Y", IDC_EDIT_REDO );
	//menuFile->setEnabled( IDC_EDIT_REDO, false );

	menuEdit->addSeparator();

	menuEdit->add( "&Copy\tCtrl+C", IDC_EDIT_COPY );
	menuEdit->add( "&Paste\tCtrl+V", IDC_EDIT_PASTE );

	menuOptions->add ("Background Color...", IDC_OPTIONS_COLORBACKGROUND);
	menuOptions->add ("Ground Color...", IDC_OPTIONS_COLORGROUND);
	menuOptions->add ("Light Color...", IDC_OPTIONS_COLORLIGHT);
	menuOptions->addSeparator ();
	menuOptions->add ("Center View", IDC_OPTIONS_CENTERVIEW);
	menuOptions->add ("Center on Face", IDC_OPTIONS_CENTERONFACE );
#ifdef WIN32
	menuOptions->addSeparator ();
	menuOptions->add ("Make Screenshot...", IDC_OPTIONS_MAKESCREENSHOT);
	//menuOptions->add ("Dump Model Info", IDC_OPTIONS_DUMP);
#endif

	menuExpressions->add( "New...", IDC_EXPRESSIONS_NEW );
	menuExpressions->addSeparator ();
	menuExpressions->add( "Load...", IDC_EXPRESSIONS_LOAD );
	menuExpressions->add( "Save", IDC_EXPRESSIONS_SAVE );
	menuExpressions->addSeparator ();
	menuExpressions->add( "Export to VFE", IDC_EXPRESSIONS_EXPORT );
	menuExpressions->addSeparator ();
	menuExpressions->add( "Close class", IDC_EXPRESSIONS_CLOSE );
	menuExpressions->add( "Close all classes", IDC_EXPRESSIONS_CLOSEALL );
	menuExpressions->addSeparator();
	menuExpressions->add( "Recreate all bitmaps", IDC_EXPRESSIONS_REDOBITMAPS );

	menuChoreography->add( "New...", IDC_CHOREOSCENE_NEW );
	menuChoreography->addSeparator();
	menuChoreography->add( "Load...", IDC_CHOREOSCENE_LOAD );
	menuChoreography->add( "Save", IDC_CHOREOSCENE_SAVE );
	menuChoreography->add( "Save As...", IDC_CHOREOSCENE_SAVEAS );
	menuChoreography->addSeparator();
	menuChoreography->add( "Close", IDC_CHOREOSCENE_CLOSE );
	menuChoreography->addSeparator();
	menuChoreography->add( "Add Actor...", IDC_CHOREOSCENE_ADDACTOR );

#ifdef WIN32
	menuHelp->add ("Goto Homepage...", IDC_HELP_GOTOHOMEPAGE);
	menuHelp->addSeparator ();
#endif
	menuHelp->add ("About...", IDC_HELP_ABOUT);

	// create the Material System window
	Con_Printf( "Creating 3D View\n" );
	g_pMatSysWindow = new MatSysWindow (workspace, 0, 0, 0, 0, "", mxWindow::Normal);

	Con_Printf( "Creating control panel\n" );
	g_pControlPanel = new ControlPanel (workspace);

	Con_Printf( "Creating phoneme editor\n" );
	g_pPhonemeEditor = new PhonemeEditor( workspace );

	Con_Printf( "Creating expression tool\n" );
	g_pExpressionTool = new ExpressionTool( workspace );

	Con_Printf( "Creating gesture tool\n" );
	g_pGestureTool = new GestureTool( workspace );

	Con_Printf( "Creating ramp tool\n" );
	g_pRampTool = new RampTool( workspace );

	Con_Printf( "Creating scene ramp tool\n" );
	g_pSceneRampTool = new SceneRampTool( workspace );

	Con_Printf( "Creating expression tray\n" );
	g_pExpressionTrayTool = new mxExpressionTray( workspace, IDC_EXPRESSIONTRAY );

	Con_Printf( "Creating flex slider window\n" );
	g_pFlexPanel = new FlexPanel( workspace );

	Con_Printf( "Creating choreography view\n" );
	g_pChoreoView = new CChoreoView( workspace, 200, 200, 400, 300, 0 );
	// Choreo scene file drives main window title name
	g_pChoreoView->SetUseForMainWindowTitle( true );

	Con_Printf( "IFacePoserToolWindow::Init\n" );

	IFacePoserToolWindow::Init();

	Con_Printf( "windowtab->Init\n" );
	
	windowtab->Init();

	Con_Printf( "loadRecentFiles\n" );

	loadRecentFiles ();
	initRecentFiles ();

	Con_Printf( "LoadWindowPositions\n" );

	LoadWindowPositions();

	Con_Printf( "RestoreThumbnailSize\n" );

	g_pExpressionTrayTool->RestoreThumbnailSize();

	Con_Printf( "Add Tool Windows\n" );

	int c = IFacePoserToolWindow::GetToolCount();
	for ( i = 0; i < c ; i++ )
	{
		IFacePoserToolWindow *tool = IFacePoserToolWindow::GetTool( i );
		menuWindow->add( tool->GetToolName(), IDC_WINDOW_FIRSTTOOL + i );
	}

	menuWindow->addSeparator();
	menuWindow->add( "Cascade", IDC_WINDOW_CASCADE );
	menuWindow->addSeparator();
	menuWindow->add( "Tile", IDC_WINDOW_TILE );
	menuWindow->add( "Tile Horizontally", IDC_WINDOW_TILE_HORIZ );
	menuWindow->add( "Tile Vertically", IDC_WINDOW_TILE_VERT );
	menuWindow->addSeparator();
	menuWindow->add( "Hide All", IDC_WINDOW_HIDEALL );
	menuWindow->add( "Show All", IDC_WINDOW_SHOWALL );

	Con_Printf( "UpdateWindowMenu\n" );

	UpdateWindowMenu();

	m_nCurrentFrame = 0;

	Con_Printf( "gridsettings->Init()\n" );

	gridsettings->Init();

	Con_Printf( "Model viewer created\n" );
}