ToolBarFrame::ToolBarFrame( HWND hwnd,int owner, const TSTR &name)
{
	mhInstance = NULL;
	Init();
	mToolBarWindow = hwnd;
	mParentWindow = GetParent(hwnd);
	mName = name;
	mOwner = owner;

	Rect r;
	GetClientRect(mToolBarWindow,&r);
	
	WINDOWPLACEMENT p;
	p.length = sizeof(WINDOWPLACEMENT);

	GetWindowPlacement(mToolBarWindow,&p);
//	GetWindowRect(mToolBarWindow,&r);
	mX = p.rcNormalPosition.left;
	mY = p.rcNormalPosition.top;
	mW = p.rcNormalPosition.right-p.rcNormalPosition.left;
	mH = p.rcNormalPosition.bottom- p.rcNormalPosition.top;

	mLocation = kFloat;
	mPopup = FALSE;

	mToolBar = GetICustToolbar(mToolBarWindow);
	mToolBar->SetBottomBorder(FALSE);
	mToolBar->SetTopBorder(FALSE);

	//set the type of tool bar
	mToolBar->SetNumRows(1);
	mToolBar->SetImage(mImages);
	ShowWindow(mToolBarWindow,SW_SHOW);
}
void  ToolBarFrame::Create(HWND toolbarHWND)
{
	//create our window if need be


	if (toolbarHWND)
	{
		mToolBarWindow = toolbarHWND;
	}
	else
	{
	if (mPopup)
	{

		mPopUpWindow = CreateWindow(_M("ToolBarFrameWindow"),mName.data(),WS_POPUP|WS_BORDER | WS_VISIBLE, mX, mY, mW, mH, mParentWindow,NULL,mhInstance,NULL);
		mDummyWindow = CreateWindow(_M("ToolBarFrameWindow"),_M("DummyWindow"),WS_CHILD | WS_BORDER | WS_VISIBLE, mX, mY, mW, mH, mParentWindow,NULL,mhInstance,NULL);
			GetCOREInterface()->RegisterDlgWnd ( mPopUpWindow );
	}

	//set up toolbar	
	if (mPopup)
		mToolBarWindow = CreateWindow(CUSTTOOLBARWINDOWCLASS,NULL,WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 0, 0, mW, mH,mPopUpWindow,NULL,mhInstance,NULL);
	else
			mToolBarWindow = CreateWindow(CUSTTOOLBARWINDOWCLASS,NULL,WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS , 0, 0, mW, mH,mParentWindow,NULL,mhInstance,NULL);

		
	}


	mToolBar = GetICustToolbar(mToolBarWindow);
	mToolBar->SetBottomBorder(FALSE);
	mToolBar->SetTopBorder(FALSE);

	//set the type of tool bar
	mToolBar->SetNumRows(1);
	mToolBar->SetImage(mImages);
	ShowWindow(mToolBarWindow,SW_SHOW);


}
Esempio n. 3
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();
}