void ToolBarFrame::Free()
{

	
	if (mImages) ImageList_Destroy(mImages);	
	mImages = NULL;
	if (mToolBar)
		ReleaseICustToolbar(mToolBar);
	mToolBar = NULL;

	if (mToolBarWindow)
		DestroyWindow(mToolBarWindow);
	if (mDummyWindow)
		DestroyWindow(mDummyWindow);
	if (mPopUpWindow)
	{
		GetCOREInterface()->UnRegisterDlgWnd ( mPopUpWindow );
		DestroyWindow(mPopUpWindow);
	}

	mParentWindow = NULL;
	mToolBarWindow = NULL;
	mPopUpWindow = NULL;
	mDummyWindow = NULL;

}
Example #2
0
void EditPatchMod::RefreshSelType() 
{
	if (!hSelectPanel)
		return;
	if (hOpsPanel)
	{
		// Set up or remove the surface properties rollup if needed
		if (hSurfPanel)
		{
			rsSurf = IsRollupPanelOpen(hSurfPanel);
			ip->DeleteRollupPage(hSurfPanel);
			hSurfPanel = NULL;
		}
		if (hTilePanel)
		{
			rsTile = IsRollupPanelOpen(hTilePanel);
			ip->DeleteRollupPage(hTilePanel);
			hTilePanel = NULL;
		}
		if (hEdgePanel)
		{
			rsEdge = IsRollupPanelOpen(hEdgePanel);
			ip->DeleteRollupPage(hEdgePanel);
			hEdgePanel = NULL;
		}
		/* watje 3 - 18 - 99
		if (selLevel == EP_OBJECT)
		{
		hSurfPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_SURF_OBJ),
		PatchObjSurfDlgProc, GetString(IDS_TH_SURFACEPROPERTIES), (LPARAM) this, rsSurf ? 0 : APPENDROLL_CLOSED);
		}
		else
		*/
		if (selLevel == EP_PATCH)
		{
			hSurfPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_SURF),
				PatchSurfDlgProc, GetString(IDS_TH_SURFACEPROPERTIES), (LPARAM) this, rsSurf ? 0 : APPENDROLL_CLOSED);
		}
		if (selLevel == EP_TILE)
		{
			hTilePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_TILE),
				PatchTileDlgProc, "Tile Properties", (LPARAM) this, rsTile ? 0 : APPENDROLL_CLOSED);
		}
		if (selLevel == EP_EDGE)
		{
			hEdgePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_EDGE),
				PatchEdgeDlgProc, "Edge Properties", (LPARAM) this, rsEdge ? 0 : APPENDROLL_CLOSED);
		}
		SetSurfDlgEnables();
		SetTileDlgEnables();
		SetEdgeDlgEnables();
	}
	
	ICustToolbar *iToolbar = GetICustToolbar(GetDlgItem(hSelectPanel, IDC_SELTYPE));
	ICustButton *but;
	for (int i = 1; i < 5; i++)
	{
		but = iToolbar->GetICustButton(butIDs[i]);
		but->SetCheck(GetSubobjectLevel() == i);
		ReleaseICustButton(but);
	}
	ReleaseICustToolbar(iToolbar);
	SetSelDlgEnables();
	SetOpsDlgEnables();
	UpdateSelectDisplay();
	PatchSelChanged();
}