Ejemplo n.º 1
0
void SideBarUI::TearDown()
{
	mMod->mPackTempPadding = mMod->GetUIManager()->GetSpinFValue(ID_PACK_PADDINGSPINNER);
	if (mMod->GetUIManager()->IsChecked(ID_PACK_RESCALE))
		mMod->mPackTempRescale = TRUE;
	else
		mMod->mPackTempRescale = FALSE;
	if (mMod->GetUIManager()->IsChecked(ID_PACK_ROTATE))
		mMod->mPackTempRotate = TRUE;
	else
		mMod->mPackTempRotate = FALSE;

	if (mMod->GetUIManager()->IsChecked(ID_PEEL_DETACH))
		mMod->mbPeelDetach = true;
	else
		mMod->mbPeelDetach = false;

	GetCOREInterface()->UnRegisterDlgWnd ( mRollupHwnd );
	IRollupWindow *irollup = GetIRollup(mRollupHwnd);

	for (int i = 0; i < 7; i++)
	{
		//load defaults
		HWND hwnd = irollup->GetPanelDlg(i);
		mMod->GetUIManager()->Free(hwnd);
	}

	ReleaseIRollup(irollup);
}
void plResponderProc::ICreateCmdRollups()
{
    // Get the index of the current command
    HWND hCmds = GetDlgItem(fhDlg, IDC_CMD_LIST);
    int cmdIdx = ListBox_GetCurSel(hCmds);

    if (cmdIdx != LB_ERR && cmdIdx != fCmdIdx)
    {
        fCmdIdx = cmdIdx;
        fIgnoreNextDrop = true;

        // Save the current scroll position and reset it at the end, so the panels
        // won't always jerk back up to the top
        IRollupWindow *rollup = GetCOREInterface()->GetCommandPanelRollup();
        int scrollPos = rollup->GetScrollPos();

        // Destroy the last command's rollups
        IRemoveCmdRollups();

        // Create the rollup for the current command
        IParamBlock2 *pb = (IParamBlock2*)fStatePB->GetReferenceTarget(kStateCmdParams, 0, fCmdIdx);
        fCmdMap = ICreateMap(pb);

        ResponderWait::InitDlg(fStatePB, fCmdIdx, GetDlgItem(fhDlg, IDC_CMD_LIST));
        pb = (IParamBlock2*)fStatePB->GetReferenceTarget(kStateCmdWait, 0, fCmdIdx);
        fWaitMap = ICreateMap(pb);

        rollup->SetScrollPos(scrollPos);
    }
}
Ejemplo n.º 3
0
StraussShaderDlg::~StraussShaderDlg()
{
   HDC hdc = GetDC(hRollup);
   GetGPort()->RestorePalette(hdc, hOldPal);
   ReleaseDC(hRollup, hdc);

   if( pShader ) pShader->SetParamDlg(NULL,0);

   for (long i=0; i < NMBUTS; i++ ){
      ReleaseICustButton( texMBut[i] );
      texMBut[i] = NULL; 
   }

   for (long i=0; i<STRAUSS_NCOLBOX; i++)
      if (cs[i]) ReleaseIColorSwatch(cs[i]); // mjm - 5.10.99
   
   ReleaseISpinner(glSpin);
   ReleaseISpinner(mtSpin);
   ReleaseISpinner(trSpin);

   DLSetWindowLongPtr(hRollup, NULL);
   DLSetWindowLongPtr(hwHilite, NULL);

   if(pShader){
      IRollupWindow* pRollup = pMtlPar->GetMtlEditorRollup();
      pShader->SetPanelOpen(pRollup->IsPanelOpen(pRollup->GetPanelIndex(hRollup)));
   }

   hwHilite = hRollup = NULL;
}
Ejemplo n.º 4
0
HWND SideBarUI::GetRollupHWND(int rollupIndex)
{


	IRollupWindow *irollup = GetIRollup(mRollupHwnd);
	HWND hWnd =  irollup->GetPanelDlg(rollupIndex);
	ReleaseIRollup(irollup);
	return hWnd;
		

}
Ejemplo n.º 5
0
    BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
    {
        switch (msg)
        {
        case WM_INITDIALOG:
            {
                IParamBlock2 *pb = map->GetParamBlock();

                // Enable the min and max controls (that are only valid with stop points)
                // if at least one of the targets has a stop point
                plAnimComponent *comp = (plAnimComponent*)pb->GetOwner();
                int num = comp->NumTargets();
                bool stopPoints = false;
                for (int i = 0; i < num; i++)
                {
                    if (DoesHaveStopPoints(comp->GetTarget(i)))
                    {
                        stopPoints = true;
                        break;
                    }
                }
                EnableStopPoints(map, stopPoints);

                // If we're doing an ease, set the ease rollup to open
                if (pb->GetInt(kAnimEaseInType) != plAnimEaseTypes::kNoEase ||
                    pb->GetInt(kAnimEaseOutType) != plAnimEaseTypes::kNoEase)
                    PostMessage(hWnd, WM_ROLLOUT_OPEN, 0, 0);
            }
            return TRUE;

        // Max doesn't know about the rollup until after WM_CREATE, so we get
        // around it by posting a message
        case WM_ROLLOUT_OPEN:
            {
                IRollupWindow *rollup = GetCOREInterface()->GetCommandPanelRollup();
                int idx = rollup->GetPanelIndex(hWnd);
                rollup->SetPanelOpen(idx, TRUE);
            }
            return TRUE;
        }
        return FALSE;
    }
Ejemplo n.º 6
0
BOOL plAutoUIBase::DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
    if (msg == WM_INITDIALOG)
    {
        fhDlg = hDlg;
        ICreateControls();

        PostMessage(fhDlg, WM_SIZE_PANEL, 0, 0);
    }

    uint32_t count = fParams.size();
    for (uint32_t i = 0; i < count; i++)
    {
        if (fParams[i]->IsMyMessage(msg, wParam, lParam, fPBlock))
        {
            if (fParams[i]->GetParamType() == plAutoUIParam::kTypeDropDownList && HIWORD(wParam) == CBN_SELENDOK)
            {
                plDropDownListParam* ddl = (plDropDownListParam*)fParams[i];
                ParamID id = ddl->GetID();
                std::string str = ddl->GetString(fPBlock);
                int yOffset = 10;

                // We now have the id and current state of the drop-down list that changed
                // so now we need to update the visible state of the controls
                for (uint32_t idx = 0; idx < fParams.size(); idx++)
                {
                    plAutoUIParam* par = fParams[idx];

                    if (par->CheckVisibility(id, str))
                    {
                        par->Show(yOffset);
                        yOffset += par->GetHeight() + 5;
                    }
                    else
                    {
                        par->Hide();
                    }
                }

                IRollupWindow *rollup = GetCOREInterface()->GetCommandPanelRollup();
                int index = rollup->GetPanelIndex(fhDlg);
                
                if (index >= 0)
                    rollup->SetPageDlgHeight(index, yOffset);
                
                InvalidateRect(fhDlg, NULL, TRUE);
            }
            return TRUE;
        }
    }

    // During init but after everything else we want to update the visibility
    if (msg == WM_SIZE_PANEL)
    {
        // Ok, this sucks but I don't know of a better way at this point
        // We need to intialize the visible state of the controls, and the only way to do this
        // is by looping through and finding all of the drop-down lists
        for (uint32_t i = 0; i < fParams.size(); i++)
        {
            if (fParams[i]->GetParamType() == plAutoUIParam::kTypeDropDownList)
            {
                plDropDownListParam* ddl = (plDropDownListParam*)fParams[i];
                ParamID id = ddl->GetID();
                std::string str = "";
                const char* cstr = ddl->GetString(fPBlock);
                int yOffset = 10;

                if (cstr)
                    str = cstr;

                // We now have the id and current state of the drop-down list that changed
                // so now we need to update the visible state of the controls
                for (uint32_t idx = 0; idx < fParams.size(); idx++)
                {
                    if (fParams[idx]->CheckVisibility(id, str))
                    {
                        fParams[idx]->Show(yOffset);
                        yOffset += fParams[idx]->GetHeight() + 5;
                    }
                    else
                    {
                        fParams[idx]->Hide();
                    }
                }

                IRollupWindow *rollup = GetCOREInterface()->GetCommandPanelRollup();
                int index = rollup->GetPanelIndex(fhDlg);
                
                if (index >= 0)
                    rollup->SetPageDlgHeight(index, yOffset);

                InvalidateRect(fhDlg, NULL, TRUE);
            }
        }

        return TRUE;
    }
    
    return FALSE;
}
Ejemplo n.º 7
0
void SideBarUI::Setup(HINSTANCE hInstance, HWND rollupHWND, const MCHAR *iniFile)
{
	//setup rollup
	mRollupHwnd = rollupHWND;

	GetCOREInterface()->RegisterDlgWnd ( mRollupHwnd );

	IRollupWindow *irollup = GetIRollup(rollupHWND);
	if(NULL == irollup)
	{
		return;
	}

	irollup->AppendRollup(hInstance,MAKEINTRESOURCE(IDD_SIDEBAR_ROLLUP1),SideBar1RollupDialogProc, GetString(IDS_QUICKTRANSFORM),(LPARAM)mMod );
	irollup->AppendRollup(hInstance,MAKEINTRESOURCE(IDD_SIDEBAR_ROLLUP2),SideBar1RollupDialogProc, GetString(IDS_RESHAPEELEMENTS),(LPARAM)mMod );
	irollup->AppendRollup(hInstance,MAKEINTRESOURCE(IDD_SIDEBAR_ROLLUP3),SideBar1RollupDialogProc, GetString(IDS_STITCH),(LPARAM)mMod );
	irollup->AppendRollup(hInstance,MAKEINTRESOURCE(IDD_SIDEBAR_ROLLUP4),SideBar1RollupDialogProc, GetString(IDS_EXPLODE),(LPARAM)mMod );
	irollup->AppendRollup(hInstance,MAKEINTRESOURCE(IDD_SIDEBAR_ROLLUP5),SideBar1RollupDialogProc, GetString(IDS_PEEL),(LPARAM)mMod );
	irollup->AppendRollup(hInstance,MAKEINTRESOURCE(IDD_SIDEBAR_ROLLUP6),SideBar1RollupDialogProc, GetString(IDS_ARRANGEELEMENTS),(LPARAM)mMod );
	irollup->AppendRollup(hInstance,MAKEINTRESOURCE(IDD_SIDEBAR_ROLLUP7),SideBar1RollupDialogProc, GetString(IDS_ELEMENTPROPERTIES),(LPARAM)mMod );


	for (int i = 0; i < 7; i++)
		irollup->Show(i);

	UnwrapCustomUI* pUIManager = mMod->GetUIManager();
	if(NULL == pUIManager)
	{
		return;
	}

	bool bResult = pUIManager->GetIniFileCache().InitCacheFromIniFile(TSTR(iniFile));

	//quick transform
	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,100,irollup->GetPanelDlg(0),GetDlgItem(irollup->GetPanelDlg(0),IDC_S1_1_TOOLBAR)) > 0)
		LoadInActions(100);
	else
		SetDefaults(100,irollup->GetPanelDlg(0));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,101,irollup->GetPanelDlg(0),GetDlgItem(irollup->GetPanelDlg(0),IDC_S1_2_TOOLBAR)) > 0)
		LoadInActions(101);
	else
		SetDefaults(101,irollup->GetPanelDlg(0));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,102,irollup->GetPanelDlg(0),GetDlgItem(irollup->GetPanelDlg(0),IDC_S1_3_TOOLBAR)) > 0)
		LoadInActions(102);
	else
		SetDefaults(102,irollup->GetPanelDlg(0));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,103,irollup->GetPanelDlg(0),GetDlgItem(irollup->GetPanelDlg(0),IDC_S1_4_TOOLBAR)) > 0)
		LoadInActions(103);
	else
		SetDefaults(103,irollup->GetPanelDlg(0));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,104,irollup->GetPanelDlg(0),GetDlgItem(irollup->GetPanelDlg(0),IDC_S1_5_TOOLBAR)) > 0)
		LoadInActions(104);
	else
		SetDefaults(104,irollup->GetPanelDlg(0));


	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,110,irollup->GetPanelDlg(1),GetDlgItem(irollup->GetPanelDlg(1),IDC_S2_1_TOOLBAR)) > 0)
		LoadInActions(110);
	else
		SetDefaults(110,irollup->GetPanelDlg(1));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,120,irollup->GetPanelDlg(2),GetDlgItem(irollup->GetPanelDlg(2),IDC_S3_1_TOOLBAR)) > 0)
		LoadInActions(120);
	else
		SetDefaults(120,irollup->GetPanelDlg(2));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,130,irollup->GetPanelDlg(3),GetDlgItem(irollup->GetPanelDlg(3),IDC_S4_1_TOOLBAR)) > 0)
		LoadInActions(130);
	else
		SetDefaults(130,irollup->GetPanelDlg(3));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,131,irollup->GetPanelDlg(3),GetDlgItem(irollup->GetPanelDlg(3),IDC_S4_2_TOOLBAR)) > 0)
		LoadInActions(131);
	else
		SetDefaults(131,irollup->GetPanelDlg(3));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,132,irollup->GetPanelDlg(3),GetDlgItem(irollup->GetPanelDlg(3),IDC_S4_3_TOOLBAR)) > 0)
		LoadInActions(132);
	else
		SetDefaults(132,irollup->GetPanelDlg(3));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,140,irollup->GetPanelDlg(4),GetDlgItem(irollup->GetPanelDlg(4),IDC_S5_1_TOOLBAR)) > 0)
		LoadInActions(140);
	else
		SetDefaults(140,irollup->GetPanelDlg(4));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,141,irollup->GetPanelDlg(4),GetDlgItem(irollup->GetPanelDlg(4),IDC_S5_2_TOOLBAR)) > 0)
		LoadInActions(141);
	else
		SetDefaults(141,irollup->GetPanelDlg(4));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,142,irollup->GetPanelDlg(4),GetDlgItem(irollup->GetPanelDlg(4),IDC_S5_0_TOOLBAR)) > 0)
		LoadInActions(142);
	else
		SetDefaults(142,irollup->GetPanelDlg(4));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,150,irollup->GetPanelDlg(5),GetDlgItem(irollup->GetPanelDlg(5),IDC_S6_1_TOOLBAR)) > 0)
		LoadInActions(150);
	else
		SetDefaults(150,irollup->GetPanelDlg(5));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,151,irollup->GetPanelDlg(5),GetDlgItem(irollup->GetPanelDlg(5),IDC_S6_2_TOOLBAR)) > 0)
		LoadInActions(151);
	else
		SetDefaults(151,irollup->GetPanelDlg(5));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,152,irollup->GetPanelDlg(5),GetDlgItem(irollup->GetPanelDlg(5),IDC_S6_3_TOOLBAR)) > 0)
		LoadInActions(152);
	else
		SetDefaults(152,irollup->GetPanelDlg(5));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,153,irollup->GetPanelDlg(5),GetDlgItem(irollup->GetPanelDlg(5),IDC_S6_4_TOOLBAR)) > 0)
		LoadInActions(153);
	else
		SetDefaults(153,irollup->GetPanelDlg(5));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,154,irollup->GetPanelDlg(5),GetDlgItem(irollup->GetPanelDlg(5),IDC_S6_5_TOOLBAR)) > 0)
		LoadInActions(154);
	else
		SetDefaults(154,irollup->GetPanelDlg(5));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,155,irollup->GetPanelDlg(5),GetDlgItem(irollup->GetPanelDlg(5),IDC_S6_6_TOOLBAR)) > 0)
		LoadInActions(155);
	else
		SetDefaults(155,irollup->GetPanelDlg(5));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,156,irollup->GetPanelDlg(5),GetDlgItem(irollup->GetPanelDlg(5),IDC_S6_7_TOOLBAR)) > 0)
		LoadInActions(156);
	else
		SetDefaults(156,irollup->GetPanelDlg(5));


	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,160,irollup->GetPanelDlg(6),GetDlgItem(irollup->GetPanelDlg(6),IDC_S7_1_TOOLBAR)) > 0)
		LoadInActions(160);
	else
		SetDefaults(160,irollup->GetPanelDlg(6));

	if (bResult && pUIManager->LoadSingleFromIniFile(iniFile,161,irollup->GetPanelDlg(6),GetDlgItem(irollup->GetPanelDlg(6),IDC_S7_2_TOOLBAR)) > 0)
		LoadInActions(161);
	else
		SetDefaults(161,irollup->GetPanelDlg(6));
		

	ReleaseIRollup(irollup);

	//add the toolbars
}