void pawsTabWindow::SetTab(const csString & name)
{
    pawsWidget * tab = FindWidget(name);
    if(!tab)
    	return;
    if(!dynamic_cast<pawsButton*>(tab))
    	SetTab(tab->GetID() - 100);
    else
        SetTab(tab->GetID());
}
示例#2
0
/*
================
DialogAF::OnInitDialog
================
*/
BOOL DialogAF::OnInitDialog()  {
	CDialog::OnInitDialog();
	com_editors |= EDITOR_AF;
	// initialize list with articulated figure files
	InitAFList();
	// initialize tabs
	wndTabs = ( CTabCtrl * ) GetDlgItem( IDC_DIALOG_AF_TAB_MODE );
	AddTabItem( AFTAB_VIEW, "View" );
	AddTabItem( AFTAB_PROPERTIES, "Properties" );
	AddTabItem( AFTAB_BODIES, "Bodies" );
	AddTabItem( AFTAB_CONSTRAINTS, "Constraints" );
	SetTab( AFTAB_VIEW );
	// create child dialog windows
	viewDlg = new DialogAFView( this );
	propertiesDlg = new DialogAFProperties( this );
	bodyDlg = new DialogAFBody( this );
	constraintDlg = new DialogAFConstraint( this );
	// the body dialog may force the constraint dialog to reload the file
	bodyDlg->constraintDlg = constraintDlg;
	// the properties dialog may force the body or constraint dialog to reload the file
	propertiesDlg->bodyDlg = bodyDlg;
	propertiesDlg->constraintDlg = constraintDlg;
	// set active child dialog
	wndTabDisplay = viewDlg;
	SetTabChildPos();
	EnableToolTips( TRUE );
	GetDlgItem( IDC_BUTTON_AF_DELETE )->EnableWindow( false );
	GetDlgItem( IDC_BUTTON_AF_SAVE )->EnableWindow( false );
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
示例#3
0
void tcOptionsView::Init() 
{
	wxString s;

    //LoadBackgroundImage("options_bk.jpg");

	mpiButtonOn = LoadTexture("options_bon.bmp");

	mpiButtonOff = LoadTexture("options_boff.bmp");

	wxASSERT(mpiButtonOn.get() != 0);
	wxASSERT(mpiButtonOn->IsLoaded());
	if ((mpiButtonOn.get() != 0) && mpiButtonOn->IsLoaded())
	{
        mnButtonWidth = mpiButtonOn->Width();
		mnButtonHeight = mpiButtonOn->Height();
	}
	else
	{
		fprintf(stderr, "tcOptionsView::Init - error loading button images\n");
	}

    AddTab("Game");
    AddTab("Sound");
    AddTab("Graphics");
    AddTab("Units");
    AddTab("Multiplayer");
    AddTab("Lighting");
    AddTab("Water");
    AddTab("Other3D");

    SetTab("Game");
}
void CGraphicWindowChildFrame::moveForward()
{
	ASSERT_RETURN( forwardTabCount() > 0 );
	int newTab = m_forwardTabList[forwardTabCount()];
	m_forwardTabList.remove(forwardTabCount());
	SetTab( newTab );
}
// Sets the specifed tab index's tab title RML.
void ElementTabSet::SetTab(int tab_index, const Rocket::Core::String& rml)
{
	Core::Element* element = Core::Factory::InstanceElement(NULL, "*", "tab", Rocket::Core::XMLAttributes());
	Core::Factory::InstanceElementText(element, rml);
	SetTab(tab_index, element);
	element->RemoveReference();
}
示例#6
0
void Pdb::EditWatch()
{
	String s = watches.GetKey();
	if(EditPDBExpression("Edit watch", s)) {
		SetTab(2);
		watches.Set(0, s);
		Data();
	}
}
示例#7
0
void Pdb::AddWatch()
{
	String s;
	if(EditPDBExpression("Add watch", s)) {
		SetTab(3);
		watches.Add(s);
		Data();
	}
}
void CGraphicWindowChildFrame::moveBack()
{
	ASSERT_RETURN( backTabCount() > 1 );
	int currentTab = m_backTabList[backTabCount()];
	m_backTabList.remove(backTabCount());
	int previousTab =  m_backTabList[backTabCount()];
	m_backTabList.remove(backTabCount());
	SetTab( previousTab );
	m_forwardTabList.add( currentTab );
}
示例#9
0
void TabDisplay::SetTab(std::string tabName)
{
	for (int i=0;i<TabChildren.size();i++)
	{
		if (TabChildren.at(i)->TabName.compare(tabName) == 0)
		{
			SetTab(i);
			return;
		}
	}
}
示例#10
0
void TabDisplay::TabButtonPressed(void * sender, EventArgs args)
{
	Button * button = (Button*)sender;
	std::string name = button->Name;
	if (currentTab >= 0)
	{
		TabChildren.at(currentTab)->TabButton->SetFillColor(UI_BUTTON_COLOR);
	}
	SetTab(name);	
	button->SetFillColor(UI_BUTTON_ALT_STATE_COLOR);
}
示例#11
0
void BuyoutManager::BuyoutFromTabName(std::vector<std::string> tabs) {
    for (auto tab : tabs) {
        std::string clean_tab = tab;
        std::string tab_hash = "stash:" + tab;
        if (ExistsTab(tab))
            continue;
        //Lowercase, remove spaces
        std::transform(tab.begin(), tab.end(), tab.begin(), ::tolower);
        tab = Util::StringReplace(tab, " ", "");
        Buyout bo;
        bo.type = BUYOUT_TYPE_NONE;
        bo.value = 0;
        bo.currency = CURRENCY_NONE;
        if (clean_tab == "no price")
            bo.type = BUYOUT_TYPE_NO_PRICE;
        std::string srt = Util::StringReplace(tab, "~price", "");

        if (tab != srt)
            bo.type = BUYOUT_TYPE_FIXED;
            tab = srt;
        for (unsigned int i=0; i<CurrencyMultiTag.size();i++) {
            std::vector<std::string> tags = Util::StringSplit(CurrencyMultiTag[i],',');
            for (auto curr : tags) {
                if (curr.empty())
                    continue;
                std::string srt = Util::StringReplace(tab, curr, "");
                if (tab != srt) {
                    bool ok;
                    bo.value = QString(srt.c_str()).toDouble(&ok);
                    if(!ok)
                        continue;
                    if (bo.type == BUYOUT_TYPE_NONE)
                        bo.type = BUYOUT_TYPE_BUYOUT;
                    bo.currency = static_cast<Currency>(i);
                    break;
                }
            }
        }
        if (bo.type != BUYOUT_TYPE_NONE) {
            SetTab(tab_hash, bo);
            qDebug() << clean_tab.c_str() << bo.value << CurrencyAsString[bo.currency].c_str() << BuyoutTypeAsTag[bo.type].c_str();
        }

    }
}
LRESULT CGraphicWindowChildFrame::OnTabChange(WPARAM wParam, LPARAM /*lParam*/)
{
	// add this tab move to the back list
	int newTab = (int)wParam;
	int prevTab = -1;
	if( backTabCount() > 0 ) {
		prevTab = m_backTabList[backTabCount()];
	}
	if( prevTab != newTab )
		m_backTabList.add( newTab );

	switch( wParam ) {
		case 0:  // Model Window Selected
			ASSERT_RETURN_ITEM( m_pGraphicWindow, FALSE );
			m_pGraphicWindow->ShowWindow( SW_SHOW );
			m_pMemberWindow->ShowWindow( SW_HIDE );
			m_pMultiMemberWindow->ShowWindow( SW_HIDE );
			m_pReportWindow->ShowWindow( SW_HIDE );
			m_pGridWindow->ShowWindow( SW_HIDE );
			windowFilter().windowType = MODEL_WINDOW;
			VAHelpPane.updateActiveWindow( windowFilter().windowType );
			m_pGraphicWindow->SetAServiceCase();
			SetIcon( theApp.LoadIcon( MAKEINTRESOURCE( IDI_MODEL )), TRUE );
			break;
		case 1:  // Results Window Selected
			ASSERT_RETURN_ITEM( m_pGraphicWindow, FALSE );
			m_pGraphicWindow->ShowWindow( SW_SHOW );
			m_pMemberWindow->ShowWindow( SW_HIDE );
			m_pMultiMemberWindow->ShowWindow( SW_HIDE );
			m_pReportWindow->ShowWindow( SW_HIDE );
			m_pGridWindow->ShowWindow( SW_HIDE );
			windowFilter().windowType = POST_WINDOW;
			VAHelpPane.updateActiveWindow( windowFilter().windowType );
			SetIcon( theApp.LoadIcon( MAKEINTRESOURCE( IDI_RESULT )), TRUE );
			if( theProject.useBackgroundEngine() == false ) {
				if( !AnalyzeIfNoResults() ) {
					; // assume analysis engine has displayed a message on failure...
				}
			}
			m_pGraphicWindow->SetAResultCase( false );
			break;
		case 2:  // Design Window Selected
			ASSERT_RETURN_ITEM( m_pGraphicWindow, FALSE );
			m_pGraphicWindow->ShowWindow( SW_SHOW );
			m_pMemberWindow->ShowWindow( SW_HIDE );
			m_pMultiMemberWindow->ShowWindow( SW_HIDE );
			m_pReportWindow->ShowWindow( SW_HIDE );
			m_pGridWindow->ShowWindow( SW_HIDE );
			// TeK Add 4/26/2007: Only if we have something to design!
			if( theModel.nodes() < 2 ) {
				AfxMessageBox( "Please create a model, then you may work on design!", MB_ICONINFORMATION );
				windowFilter().windowType = MODEL_WINDOW;
				SetTab( 0 );
			}
			else if( theController.designSoftwareIsPresent() ) {
				// for speed improvement, lets stop the feaBacgroundProcessor, first see if it is working
				if( theEngine.FEABackgroundProcessorHasWorkToDo() ) {
						VAHelpPane.showTempTip( "The model has not been set up for analysis."
							" Analyze the project first!", true );
				}
				else {
					theEngine.stopSetupFEABackgroundProcessor();
					SetupAutoDesignGroups();
					theController.doAllUnityChecks();
					theEngine.startSetupFEABackgroundProcessor();
					windowFilter().windowType = DESIGN_WINDOW;
					VAHelpPane.updateActiveWindow( windowFilter().windowType );
					if( !theController.designCasesHaveValidResults() ) {
						VAHelpPane.showTempTip( "There are no 'design' load combinations with results."
							" Check design settings in Load Case Manager, or Analyze!", true );
					}
				}
				Invalidate();
				SetIcon( theApp.LoadIcon( MAKEINTRESOURCE( IDI_DESIGN )), TRUE );
			}
			else {
				AfxMessageBox( "You have not purchased the optional design features, please visit www.iesweb.com or call 1-800-707-0816.", 
					MB_ICONINFORMATION | MB_OK );
				SetTab(0);
				return LRESULT(0);
			}
			break;
		case 3:  // reportView or gridView
			SetReportView();
			break;
		case 4:  // memberView (or multi)
			{
			if( m_pGraphicWindow ) m_pGraphicWindow->ShowWindow( SW_HIDE );
			m_pMemberWindow->ShowWindow( SW_HIDE );
			m_pMultiMemberWindow->ShowWindow( SW_HIDE );
			m_pReportWindow->ShowWindow( SW_HIDE );
			m_pGridWindow->ShowWindow( SW_HIDE );

			// we've got to decide whether or not we show the single member view
			// or the multi member view
			// lets see if we've got a selected chain
			if( m_pGraphicWindow ) {
				m_pGraphicWindow->SetAResultCase( false );
				CLoadCase* aLoadCase = m_pGraphicWindow->windowFilter().loadCase();
				const CResultCase* aResultCase = m_pGraphicWindow->windowFilter().resultCase();
				 // see if we have a chain
				 int count = theModel.elements( MEMBER_ELEMENT, OnlySelected );
				 bool forceSingleMemberPlot = false;
				 CCombineMembers cm(true);
				 bool haveAChain = (OK_TO_COMBINE == cm.CanCombine()); //areSelectedMembersAChain( true );
				 if( count > 1 && haveAChain ) {
					 // make sure we don't have too many members
					int graphPoints = 0;
					//const TPointerArray<const CMember>& chain = theMemberChain();
					const CMemberArray& chain = cm.GetChain();
					if( aResultCase != NULL ) {
						for( int i = 1; i <= count; i++ ) {
							const CMember* pM = chain[i];
							const CResult* pMFR = aResultCase->result( *pM );
							if( pMFR )
								graphPoints += ((CResult*)pMFR)->locations();
						}
					}
					if( graphPoints >= MAX_GRAPH_DATA_COUNT || count+1 >= MAX_X_ANNOTATION_COUNT ) {
						MessageBox( "You have selected too many members. Please select fewer members for your multi-member plot.", "VisualAnalysis",
							MB_OK | MB_ICONEXCLAMATION );
						forceSingleMemberPlot = true;
					 }
					else {  // we can set up the multi member view
						m_pMultiMemberWindow->memberChain().flush();
						for( int i = 1; i <= chain.getItemsInContainer(); i++ )
							m_pMultiMemberWindow->memberChain().add( chain[i] );
						m_pMultiMemberWindow->windowFilter().windowType = MULTIMEMBER_GRAPHIC_WINDOW;
						SetupMemberPlotFilter( m_pMultiMemberWindow->windowFilter(), aLoadCase, aResultCase, NULL );
						m_tabWnd.GetTabCtrl()->ChangeTabClient( 4, m_pMultiMemberWindow );
					}
				 }

				 if( forceSingleMemberPlot || haveAChain == false || count <= 1 )  {  // create a single member view 
						CMember* pM = (CMember*)theModel.element( MEMBER_ELEMENT, 1, (count > 0) );
						m_pMemberWindow->windowFilter().windowType = MEMBER_GRAPHIC_WINDOW;
						SetupMemberPlotFilter( m_pMemberWindow->windowFilter(), aLoadCase, aResultCase, pM );
						m_tabWnd.GetTabCtrl()->ChangeTabClient( 4, m_pMemberWindow );
				 }
		   }  // m_pGraphicWindow
		   else {  // this should not happen
			   ASSERT( FALSE );
				m_pMemberWindow->ShowWindow( SW_HIDE );
				m_pMultiMemberWindow->ShowWindow( SW_HIDE );
				m_pReportWindow->ShowWindow( SW_HIDE );
			}
			}
			break;
		default:
			ASSERT( FALSE );
			break;
	}
	CWnd* theClient = AfxGetMainWnd();
	if( theClient ) {
		theClient->SendMessage( VIEW_MANAGER_CHANGE_MESSAGE, 0, 0 );
	}
	if( wParam == 3 ) {
		m_tabWnd.GetTabCtrl()->SetFocus();
	}

	// TeK Add 10/13/2009: Prevent the entire tab row from disappearing!
	//        UpdateWindows didn't work?, try ShowWindow!
	// RDV Note 10/1/09 - Add this to hopefully clear up the tab visibility issues reported
	//m_tabWnd.UpdateWindow();
//#pragma message( TEK "Tab windows still disappear, sometimes, for some customers..." )
	m_tabWnd.ShowWindow( SW_SHOW );

	return FALSE;
}