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);
}
HWND SideBarUI::GetRollupHWND(int rollupIndex)
{


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

}
Esempio n. 3
0
void ModifierPanelUI::TearDown()
{
	
	IRollupWindow *irollup = GetIRollup(mRollupHwnd);

	mMod->GetUIManager()->Free(mMod->hSelParams);
	mMod->GetUIManager()->Free(mMod->hEditUVParams);
	mMod->GetUIManager()->Free(mMod->hPeelParams);
	mMod->GetUIManager()->Free(mMod->hMapParams);
	mMod->GetUIManager()->Free(mMod->hWrapParams);

	ReleaseIRollup(irollup);
}
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
}
Esempio n. 5
0
void ModifierPanelUI::Setup(HINSTANCE hInstance, HWND rollupHWND, const MCHAR *iniFile)
{
	//setup rollup
	mRollupHwnd = rollupHWND;

	

	IRollupWindow *irollup = GetIRollup(rollupHWND);
		
	if (mMod->GetUIManager()->LoadSingle(iniFile,200,mMod->hSelParams,GetDlgItem(mMod->hSelParams,IDC_SELPARAM1_TOOLBAR)) == 0)
		SetDefaults(200,mMod->hSelParams);
	else
		LoadInActions(200);

	if (mMod->GetUIManager()->LoadSingle(iniFile,201,mMod->hSelParams,GetDlgItem(mMod->hSelParams,IDC_SELPARAM2_TOOLBAR)) == 0)
		SetDefaults(201,mMod->hSelParams);
	else
		LoadInActions(201);

	if (mMod->GetUIManager()->LoadSingle(iniFile,202,mMod->hSelParams,GetDlgItem(mMod->hSelParams,IDC_SELPARAM3_TOOLBAR)) == 0)
		SetDefaults(202,mMod->hSelParams);
	else
		LoadInActions(202);

	if (mMod->GetUIManager()->LoadSingle(iniFile,203,mMod->hSelParams,GetDlgItem(mMod->hSelParams,IDC_SELPARAM4_TOOLBAR)) == 0)
		SetDefaults(203,mMod->hSelParams);
	else
		LoadInActions(203);


	if (mMod->GetUIManager()->LoadSingle(iniFile,210,mMod->hEditUVParams,GetDlgItem(mMod->hEditUVParams,IDC_EDITPARAM1_TOOLBAR)) == 0)
		SetDefaults(210,mMod->hEditUVParams);
	else
		LoadInActions(210);

	if (mMod->GetUIManager()->LoadSingle(iniFile,211,mMod->hEditUVParams,GetDlgItem(mMod->hEditUVParams,IDC_EDITPARAM2_TOOLBAR)) == 0)
		SetDefaults(211,mMod->hEditUVParams);
	else
		LoadInActions(211);

	if (mMod->GetUIManager()->LoadSingle(iniFile,212,mMod->hEditUVParams,GetDlgItem(mMod->hEditUVParams,IDC_EDITPARAM3_TOOLBAR)) == 0)
		SetDefaults(212,mMod->hEditUVParams);
	else
		LoadInActions(212);

	if (mMod->GetUIManager()->LoadSingle(iniFile,230,mMod->hPeelParams,GetDlgItem(mMod->hPeelParams,IDC_PEELPARAM1_TOOLBAR)) == 0)
		SetDefaults(230,mMod->hPeelParams);
	else
		LoadInActions(230);

	if (mMod->GetUIManager()->LoadSingle(iniFile,231,mMod->hPeelParams,GetDlgItem(mMod->hPeelParams,IDC_PEELPARAM2_TOOLBAR)) == 0)
		SetDefaults(231,mMod->hPeelParams);
	else
		LoadInActions(231);

	if (mMod->GetUIManager()->LoadSingle(iniFile,240,mMod->hMapParams,GetDlgItem(mMod->hMapParams,IDC_MAPPARAM1_TOOLBAR)) == 0)
		SetDefaults(240,mMod->hMapParams);
	else
		LoadInActions(240);

	if (mMod->GetUIManager()->LoadSingle(iniFile,241,mMod->hMapParams,GetDlgItem(mMod->hMapParams,IDC_MAPPARAM2_TOOLBAR)) == 0)
		SetDefaults(241,mMod->hMapParams);
	else
		LoadInActions(241);

	if (mMod->GetUIManager()->LoadSingle(iniFile,242,mMod->hMapParams,GetDlgItem(mMod->hMapParams,IDC_MAPPARAM3_TOOLBAR)) == 0)
		SetDefaults(242,mMod->hMapParams);
	else
		LoadInActions(242);

	if (mMod->GetUIManager()->LoadSingle(iniFile,250,mMod->hWrapParams,GetDlgItem(mMod->hWrapParams,IDC_WRAPPARAM1_TOOLBAR)) == 0)
		SetDefaults(250,mMod->hWrapParams);
	else
		LoadInActions(250);

	ReleaseIRollup(irollup);

	mMod->GetUIManager()->UpdateCheckButtons();

	//add the toolbars
}