示例#1
0
int CloneMouse(long x, long y, UINT btn)
{
	int nDest = vClone.GetItemFromPos(x,y);
	if(nDest<0) return FALSE;
//        vClone.SelectItem(nDest);
	
	//if(CTreeViewToKClone(nDest)==-1){ //ファイル名
	//	for(int i=0; i<vClone.GetItemNum(); i++)
	//	{
	//		if(i==0) continue;
	//		KClone* p = GetKClone(i+1);
	//		if(!p) continue;
	//		
	//		if(last_selection == nDest && vstate != last_state){
	//			vClone.SetCheck(i+1, vstate);
	//			p->clone_data.visible = !vstate;
	//		}
	//	}
	//}else
	{
		if(CTreeViewToKClone(nDest)<0) return 0;
		int vstate = vClone.IsChecked(nDest);
		KClone* p = GetKClone(nDest);
		if(!p) return FALSE;
		p->clone_data.visible = !vstate;
		if(last_selection == nDest && vstate != last_state) vClone.SelectItem(last_selection);
		//win.CSetWindowText(hMainWnd, "pos : %d , checked : %d last_selection:%d %d %d", CTreeViewToKClone(nDest), vstate, last_selection, last_state, p->clone_data.visible);
		last_selection = nDest;
		last_state = vstate;
	}
	Render();
	return FALSE;
}
示例#2
0
void SaveItemState()
{
	long scene = GetSelectedScene();
	if(scene<0) return;
	long scene_object = GetSelectedSceneObject();
	if(scene_object<0) return;
	
	KModelEdit* m = demo.scene[scene].sceneobj[scene_object].model;
	long allocnum = 0;
	KClone* kcl = NULL;
	if(m){
		allocnum =	m->GetCloneAllocNum();
		kcl =		m->GetCloneAllocPtr();
	}
	if(kcl==NULL) return;

	//for(int i=0; i<vClone.GetItemNum(); i++)
	for(int i=0; i<allocnum; i++)
	{
		//if(i==0) continue;
		//if(CTreeViewToKClone(i+1)<before_allocnum){
		//	//if(kcl==prev_kcl)
		//	//	kcl[CTreeViewToKClone(i+1)].clone_data.tree_collapse = (vClone.IsExpand(i+1)) ? 0:1;
		//	//else
		//	//	kcl[CTreeViewToKClone(i+1)].clone_data.tree_collapse = 0;
		//	kcl[CTreeViewToKClone(i+1)].clone_data.tree_collapse = (vClone.IsExpand(i+1)) ? 0:1;
		//}
		kcl[i].clone_data.tree_collapse = !vClone.IsExpand(2+i/*GetCTreeViewId(&kcl[i])*/);
	}
	//prev_kcl = kcl;
}
示例#3
0
void FreeCloneWindow(){
	vClone.DeleteAllItem();
	//before_allocnum = -1;
	//prev_kcl = NULL;
	last_selection = 0;
	last_state		= 0;
}
示例#4
0
BOOL CMainFram::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
	// TODO: Add your specialized code here and/or call the base class
	iniToolbar();
	iniDialogbar();
	//m_wndSplitter.Create(this,2,2,CSize(10, 10),pContext);
	m_wndSplitter.CreateStatic(this,1,2);
	m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CTreeView),CSize(200,0),pContext);
	m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CListView),CSize(0,0),pContext);
	CTreeView* treeView =NULL;//= (CTreeView*)m_wndSplitter.GetPane(0,0);
	CTreeCtrl treeCtrl = treeView->GetTreeCtrl();
	m_decTreeCtrl = new TreeCtrlDec(&treeCtrl);
	m_decTreeCtrl->appendItem(_T("L1I1"),NULL);
	m_decTreeCtrl->appendItem(_T("L1I2"),NULL);
	return CFrameWnd::OnCreateClient(lpcs, pContext);
}
示例#5
0
void ApplyItemState()
{
	long scene = GetSelectedScene();
	if(scene<0) return;
	long scene_object = GetSelectedSceneObject();
	if(scene_object<0) return;

	KModelEdit* m = demo.scene[scene].sceneobj[scene_object].model;
	long allocnum = 0;
	KClone*	kcl = NULL;
	if(m){
		allocnum =	m->GetCloneAllocNum();
		kcl	=		m->GetCloneAllocPtr();
	}
	if(kcl==NULL) return;

	for(int i=0; i<allocnum; i++)
	{
		//if(allocnum==before_allocnum){
		vClone.ExpandItem(2+i/*GetCTreeViewId(&kcl[i])*/, !kcl[i].clone_data.tree_collapse);
		//vClone.ExpandItem(KCloneToCTreeView(i), !kcl[i].clone_data.tree_collapse);
		//}else{
		//	vClone.ExpandItem(KCloneToCTreeView(i), TRUE);
		//}
	}
}
示例#6
0
//現在選択されている項目に該当するKCloneのインデックスを返す
int CloneGetSelectedItem()
{
	int id = vClone.GetSelectedItem();
	if( id != -1 )
		return CTreeViewToKClone(id);
	else
		return -1;
}
示例#7
0
CTreeCtrl *GetTreeCtrl(PyObject *self, bool bNeedValidHwnd = true)
{
	extern CTreeView *GetTreeViewPtr(PyObject *self);
	CTreeCtrl *rc;

	if (ui_base_class::is_uiobject(self, &PyCTreeView::type)) {
		CTreeView *pView = GetTreeViewPtr(self);
		if (pView)
			rc = &(pView->GetTreeCtrl());
		else
			rc = NULL;
	} else
		rc = (CTreeCtrl *)PyCWnd::GetPythonGenericWnd(self, &PyCTreeCtrl::type);
	if (rc && bNeedValidHwnd && !::IsWindow(rc->m_hWnd))
		RETURN_ERR((char *)szErrTreeRequiresWindow);
	return rc;
}
示例#8
0
void VerifyOnExit()
{
	if(MessageBox(hMainWnd, "Exit?", "Exit", MB_YESNO|MB_ICONQUESTION|MB_SYSTEMMODAL)==IDYES){
		SetParent(vClone.GetHolderWnd(), NULL);
		SetParent(vSceneList.GetHolderWnd(), NULL);
		SetParent(vObjectList.GetHolderWnd(), NULL);
		SetParent(vSceneObjectList.GetHolderWnd(), NULL);

		PostQuitMessage(0);
	}
}
示例#9
0
//指定されたKCloneインデックスに該当する項目を選択状態にする
void CloneSelectClone(int clone_index)
{
	int item = KCloneToCTreeView(clone_index);
	vClone.SelectItem(item);
	SetFocus(hMainWnd);
}
示例#10
0
void AddCloneTree(HWND hTreeView, int nOrderInKClone, char* str)
{
	vClone.AddItem(str, (nOrderInKClone>0) ? KCloneToCTreeView(nOrderInKClone) : nOrderInKClone);
}
示例#11
0
//更新処理
void RefreshCloneTree(KModelEdit* mdl, const char* szModelName, int select)
{
	//static int old_sceneobject = GetSelectedSceneObject();
	//int current_sceneobject = GetSelectedSceneObject();
	//if(old_sceneobject!=current_sceneobject){
	//	old_sceneobject = current_sceneobject
	//}else{
		SaveItemState();
	//}
	//以前のデータをクリア
	ClearCloneTree(vClone.GetTreeWnd());

	//ファイル名表示部分
	if(szModelName!=NULL)
	{
		char* szTitle = (char*)GlobalAlloc(GPTR, sizeof(char) * (lstrlen(szModelName)+1));
			lstrcpy(szTitle, szModelName);
			PathStripPath(szTitle);
			vClone.AddItem(szTitle, 0);
		GlobalFree(szTitle);
	}else vClone.AddItem("(null)", 0);
	
	KClone** node_ptr=(KClone**)GlobalAlloc(GPTR,256*sizeof(KClone*));
	KClone*	kpt=mdl->GetTree();
	if(kpt == NULL)	return;
	int* node_id=(int*)GlobalAlloc(GPTR,256*sizeof(int));

	int node=0;
	long child_end=0;

	node_id[node] = 1;
    node_ptr[node]=NULL;
	//NULL->child

	node++;
	node_id[node] = vClone.AddItem(kpt->clone_data.clone_name, node_id[node-1]);
	node_ptr[node] = kpt;
	
	while(node!=-1)
	{
		if((child_end!=1)&&(kpt->child!=NULL)){
			node++;
			kpt	= kpt->child;
			node_ptr[node]=kpt;
			child_end=0;
			//--copy--------------------
			node_id[node] = vClone.AddItem(kpt->clone_data.clone_name, node_id[node-1]);
			//--------------------------
		}else if(kpt->sibling!=NULL){
			kpt	= kpt->sibling;
			node_ptr[node]=kpt;
			child_end=0;
			//--copy--------------------
			node_id[node] = vClone.AddItem(kpt->clone_data.clone_name, node_id[node-1]);
			//--------------------------
		}else{
			node--;
			kpt	= node_ptr[node];
			if(kpt==NULL) kpt = mdl->GetTree()->sibling;
			if(kpt==NULL) break;
			child_end=1;
		}
	}
	GlobalFree(node_ptr);
	GlobalFree(node_id);

	long scene = GetSelectedScene();
	if(scene<0) return;
	long scene_object = GetSelectedSceneObject();
	if(scene_object<0) return;

	KModelEdit* m = demo.scene[scene].sceneobj[scene_object].model;
	long allocnum = 0;
	KClone*	kcl = NULL;
	if(m){
		allocnum =	m->GetCloneAllocNum();
		kcl	=		m->GetCloneAllocPtr();
	}
	if(kcl==NULL) return;
	for(int i=0; i<allocnum; i++){
		vClone.SetCheck(2+i, !(kcl[i].clone_data.visible));
	}
		//for(int i=0; i<vClone.GetItemNum(); i++)
		//{
		//	//if(i==0) continue;
		//	KClone* p = GetKClone(i+1);
		//	if(!p){
		//		continue;
		//	}
		//	vClone.SetCheck(i+1, !(p->clone_data.visible));
		//}
//	}
	ApplyItemState();

	if(select>=0){
		vClone.SelectItem(select+1);
	}
}
示例#12
0
void ClearCloneTree(HWND hTreeView)
{
	vClone.DeleteAllItem();
}
示例#13
0
LRESULT CALLBACK HWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
		//case WM_ACTIVE:
		//break;
		case WM_KEYDOWN:
		case WM_KEYUP:
			CallWindowProc((WNDPROC)GetWindowLong(hGLWnd, GWL_WNDPROC), hGLWnd, msg, wParam, lParam);
			return TRUE;//オリジナルのメッセージ処理を行わないとLayouterWindow.cppが機能しない
		case WM_COMMAND:
		{
			switch(LOWORD(wParam))
			{
				case ID_FILE_NEW_LAYOUT:
				{
					//long nUndoBuffer = GetUndoBufferNum();
					//if(dwLastSaveTime){
					//	if(MBQ("This document has been modified. Save?")){
					//		CallWindowProc((WNDPROC)GetWindowLong(hWnd, GWL_WNDPROC), hWnd, WM_COMMAND, ID_FILE_SAVE_OW, 0);
					//	}
					//}
					FreeAll();
					RefreshAllView();
					break;
				}
				case ID_FILE_OPEN_LAYOUT:
				{
					char* szFile = (char*)GlobalAlloc(GPTR, sizeof(char) * 1024);
						if(GetOpenFileNameSingle(hGLWnd, "kdf", szFile, FALSE))
						{
							lstrcpy(g_szFileName, szFile);
							FreeAll();
							demo.Load(szFile);
							RefreshAllView();
						}
					GlobalFree(szFile);
					break;
				}
				case ID_FILE_SAVE_OW:
				{
					if(g_szFileName[0] == '\0')
					{
						char* szFile = (char*)GlobalAlloc(GPTR, sizeof(char) * 1024);
							if(GetSaveFileNameSingle(hGLWnd, "kdf", szFile, FALSE))
							{
								lstrcpy(g_szFileName, szFile);
							}else return TRUE;
						GlobalFree(szFile);
					}
					
					demo.Save(g_szFileName);
					RefreshAllView();
					break;
				}
				case ID_FILE_SAVE_AS:
				{
					char* szFile = (char*)GlobalAlloc(GPTR, sizeof(char) * 1024);
						if(GetSaveFileNameSingle(hGLWnd, "kdf", szFile, FALSE))
						{
							lstrcpy(g_szFileName, szFile);
							demo.Save(szFile);
							RefreshAllView();
						}
					GlobalFree(szFile);
					break;
				}
				case ID_FILE_EXPORT:
				{
					char* szFile = (char*)GlobalAlloc(GPTR, sizeof(char) * 1024);
						if(GetSaveFileNameSingle(hGLWnd, "kdb", szFile, FALSE))
						{
							//lstrcpy(g_szFileName, szFile);
							demo.BinarySave(szFile);
							MessageBox(hWnd, "Export done", "", MB_ICONINFORMATION|MB_OK|MB_TOPMOST);
							RefreshAllView();
						}
					GlobalFree(szFile);
					break;
				}
				case ID_FILE_EXIT:
				{
					VerifyOnExit();	
					break;
				}
				case ID_EDIT_UNDO:
				{
					Undo();	
					break;
				}
				case ID_EDIT_REDO:
				{
					Redo();	
					break;
				}
				case ID_MODE_LAYOUTER:
				{
					StopPlaying();

					nCurrentMode = LAYOUTER;
					HMENU hMenu = GetMenu(hWnd);
					HMENU hSub = GetSubMenu(hMenu, 2);
					CheckMenuItem(hSub, 1, MF_BYPOSITION|MF_UNCHECKED);
					CheckMenuItem(hSub, 0, MF_BYPOSITION|MF_CHECKED);

				
					//vSound.Hide();
					//vSynth.Hide();
					ShowWindow(vSound.GetHolderWnd(), FALSE);
					//ShowWindow(vTime.GetHolderWnd(), FALSE);
					ShowWindow(vSynth.GetHolderWnd(), FALSE);

					//ShowWindow(vScene.GetHolderWnd(), TRUE);
					ShowWindow(vClone.GetHolderWnd(), TRUE);
					ShowWindow(vObjectList.GetHolderWnd(), TRUE);
					ShowWindow(vSceneObjectList.GetHolderWnd(), TRUE);

					RefreshWindows();
					break;
				}
				case ID_MODE_TIMELINER:
				{
					StopPlaying();

					nCurrentMode = TIMELINER;
					HMENU hMenu = GetMenu(hWnd);
					HMENU hSub = GetSubMenu(hMenu, 2);
					CheckMenuItem(hSub, 0, MF_BYPOSITION|MF_UNCHECKED);
					CheckMenuItem(hSub, 1, MF_BYPOSITION|MF_CHECKED);

					//ShowWindow(vScene.GetHolderWnd(), FALSE;
					ShowWindow(vClone.GetHolderWnd(), FALSE);
					//ShowWindow(vSceneObjectList.GetHolderWnd(), FALSE);
					ShowWindow(vObjectList.GetHolderWnd(), FALSE);

					//vSound.Show();
					//vSynth.Show();
					ShowWindow(vSound.GetHolderWnd(), TRUE);
					//ShowWindow(vTime.GetHolderWnd(), TRUE);
					ShowWindow(vSynth.GetHolderWnd(), TRUE);

					RefreshWindows();
					break;
				}
				case ID_FRAME_000:
				case ID_FRAME_025:
				case ID_FRAME_050:
				case ID_FRAME_075:
				case ID_FRAME_100:
				{
					float mul = (LOWORD(wParam) - ID_FRAME_000) * 0.25f;
					UpdateFrameTransparency(mul);
					break;
				}
			}
			return FALSE;
		}
		case WM_DESTROY:
		case WM_CLOSE:
		{
			VerifyOnExit();
			return FALSE;
		}
		case WM_SIZE:
		{
			RefreshWindows();
			return FALSE;
		}
	}
	return TRUE;
}
示例#14
0
void Initialize(int width, int height)
{
	RECT rect;
	rect.right = width;
	rect.bottom = height;
	
	/* for Layouter*/
	float ratio[6][2] = { {0.2f, 0.5f}, {0.6f, 0.4f}, {0.2f, 0.5f},
						  {0.2f, 0.5f}, {0.6f, 0.6f}, {0.2f, 0.5f}};
	vSceneList.CreateListView(0, 0, rect.right*ratio[0][0], rect.bottom*ratio[0][1], "SceneList", hMainWnd);
	DWORD dwStyle = LVS_EX_GRIDLINES;
	ListView_SetExtendedListViewStyle(vSceneList.GetListWnd(), dwStyle);
	vSceneList.SetCallbackFunctions(SceneListNameEdit, SceneListPopup, SceneListCommand, SceneListKey, SceneListMouse, SceneListSelectedItemNotify);
	vSceneList.SetHookProcedure(SceneListHookProc);
	vSceneList.AddColumn("Scene", LVSCW_AUTOSIZE, 0);


	wingl.CCreateWindow(rect.right*ratio[0][0], 0, rect.right*ratio[1][0], rect.bottom*ratio[1][1], "OpenGL");
	wingl.CSetCallbackFunctions(LayouterKeyEvent, LayouterMouseEvent, OnDraw);//, OnIdle);
	SetParent(wingl.CGethWnd(), hMainWnd);

	vSceneObjectList.CreateListView(rect.right*ratio[0][0] + rect.right*ratio[1][0], 0, rect.right*ratio[2][0], rect.bottom*ratio[2][1], "SceneObjectList", hMainWnd);
	dwStyle = LVS_EX_GRIDLINES;
	//dwStyle = LVS_EX_CHECKBOXES | LVS_EX_GRIDLINES;
	ListView_SetExtendedListViewStyle(vSceneObjectList.GetListWnd(), dwStyle);
	vSceneObjectList.SetCallbackFunctions(SceneObjectListNameEdit, SceneObjectListPopup, SceneObjectListCommand, SceneObjectListKey, SceneObjectListMouse, SceneObjectListSelectedItemNotify);
	vSceneObjectList.SetHookProcedure(SceneObjectListHookProc);
	vSceneObjectList.AddColumn("camera_trans", LVSCW_AUTOSIZE, 2);
	vSceneObjectList.AddColumn("interpolate", LVSCW_AUTOSIZE, 1);
	vSceneObjectList.AddColumn("Scene Object", LVSCW_AUTOSIZE, 0);


	vObjectList.CreateListView(0, rect.bottom*ratio[3][1], rect.right*ratio[3][0], rect.bottom*ratio[3][1], "ObjectList", hMainWnd);
	dwStyle = LVS_EX_GRIDLINES;
	ListView_SetExtendedListViewStyle(vObjectList.GetListWnd(), dwStyle);
	vObjectList.SetCallbackFunctions(ObjectListNameEdit, ObjectListPopup, ObjectListCommand, ObjectListKey, ObjectListMouse, ObjectListSelectedItemNotify);
	vObjectList.SetHookProcedure(ObjectListHookProc);
	vObjectList.AddColumn("Object", LVSCW_AUTOSIZE, 0);

	vTimeline.Create(hMainWnd, rect.right*ratio[3][0], rect.bottom*ratio[4][1], rect.right*ratio[4][0], rect.bottom*ratio[4][1], "Timeline");
	vTimeline.SetWndProcCallback(TimelineProc);


	vClone.CreateTreeView(rect.right*ratio[3][0]+rect.right*ratio[4][0], rect.bottom*ratio[5][1], rect.right*ratio[5][0], rect.bottom*ratio[5][1], "Clone", hMainWnd);
	vClone.SetCallbackFunctions(CloneNameEdit, NULL, NULL, CloneKey, CloneMouse, CloneSelectedItemNotify); 
	vClone.SetHookProcedure(CloneHookProc);

	LONG oldStyle = GetWindowLong(vClone.GetTreeWnd(), GWL_STYLE);
	oldStyle |= TVS_CHECKBOXES;
	SetWindowLong(vClone.GetTreeWnd(), GWL_STYLE, oldStyle);


	SceneObjectListOldWndProc = (WNDPROC)SetWindowLong(vSceneObjectList.GetListWnd(), GWL_WNDPROC, (LONG)SceneObjectListWndHookProc);
	ObjectListOldWndProc = (WNDPROC)SetWindowLong(vObjectList.GetListWnd(), GWL_WNDPROC, (LONG)ObjectListWndHookProc);
	SceneListOldWndProc = (WNDPROC)SetWindowLong(vSceneList.GetListWnd(), GWL_WNDPROC, (LONG)SceneListWndHookProc);
	CloneOldWndProc = (WNDPROC)SetWindowLong(vClone.GetTreeWnd(), GWL_WNDPROC, (LONG)CloneWndHookProc);

	/* for Timeliner*/
	vSound.CreateSoundWindow(rect.right*ratio[3][0]+rect.right*ratio[4][0], rect.bottom*ratio[5][1], rect.right*ratio[5][0], rect.bottom*ratio[5][1], "Sound", hMainWnd);
	SetParent(vSound.GetHolderWnd(), hMainWnd);

	vSynth.CreateSynthWindow(rect.right*ratio[0][0] + rect.right*ratio[1][0], 0, rect.right*ratio[2][0], rect.bottom*ratio[2][1], "Synth", hMainWnd);
	SetParent(vSynth.GetHolderWnd(), hMainWnd);
	//ksd.SetNotifyCallback(vSynth.KSynthLoadNotify);

	RefreshWindows();

	//const float lratio [2] = { 19.0f, 50.0f };
	//const float rratio[2] = { 19.0f, 50.0f };
	//const float cratio = { 100.0f - lratio[0] - rratio[0] };
	//float w[3], h[3];


	////左
	//w[0] = width /100.0*lratio[0];
	//h[0] = height/100.0*lratio[1];
	//vSceneList.CreateListView(0, 0, w[0], h[0], "SceneList", hMainWnd);
	//DWORD dwStyle = LVS_EX_CHECKBOXES | LVS_EX_GRIDLINES;
	//ListView_SetExtendedListViewStyle(vSceneList.GetListWnd(), dwStyle);
	//vSceneList.SetCallbackFunctions(SceneListNameEdit, NULL, SceneListCommand, SceneListKey, SceneListMouse, SceneListSelectedItemNotify);
	//vSceneList.SetHookProcedure(SceneListHookProc);
	//vSceneList.AddColumn("Scene", w[0], 0);
	//ChangeWindowStyle(vSceneList.GetHolderWnd(), WS_POPUP|WS_VISIBLE);

	//vObjectList.CreateListView(0, h[0], w[0], h[0], "ObjectList", hMainWnd);
	//dwStyle = LVS_EX_CHECKBOXES | LVS_EX_GRIDLINES;
	//ListView_SetExtendedListViewStyle(vObjectList.GetListWnd(), dwStyle);
	//vObjectList.SetCallbackFunctions(ObjectListNameEdit, ObjectListPopup, ObjectListCommand, ObjectListKey, ObjectListMouse, ObjectListSelectedItemNotify);
	//vObjectList.SetHookProcedure(ObjectListHookProc);
	//vObjectList.AddColumn("Object", w[0], 0);
	//ChangeWindowStyle(vObjectList.GetHolderWnd(), WS_POPUP|WS_VISIBLE);

	////真ん中
	//w[1] = width /100.0 * 60.0;
	//h[1] = height/100.0 * 60.0;
	//wingl.CCreateWindow(w[0]+(width/100.0*1.0f), 0, w[1], h[1], "OpenGL");
	//wingl.CSetCallbackFunctions(LayouterKeyEvent, LayouterMouseEvent, OnDraw);
	//SetParent(wingl.CGethWnd(), hMainWnd);
	//ChangeWindowStyle(wingl.CGethWnd(), WS_POPUP|WS_VISIBLE);

	//vTimeline.Create(hMainWnd, w[0]+(width/100.0*1.0f), h[1]+(height/100.0f*5.0f), w[1], height/100.0*35.0f-50, "Timeline");
	//vTimeline.SetWndProcCallback(TimelineProc);

	////右
	//w[2] = width/100.0*rratio[0];
	//h[2] = height/100.0*rratio[1];
	//vSceneObjectList.CreateListView(w[0]+(width/100.0*cratio), 0, w[2], h[2], "SceneObjectList", hMainWnd);
	//dwStyle = LVS_EX_CHECKBOXES | LVS_EX_GRIDLINES;
	//ListView_SetExtendedListViewStyle(vSceneObjectList.GetListWnd(), dwStyle);
	//vSceneObjectList.SetCallbackFunctions(SceneObjectListNameEdit, NULL, SceneObjectListCommand, SceneObjectListKey, SceneObjectListMouse, SceneObjectListSelectedItemNotify);
	//vSceneObjectList.SetHookProcedure(SceneObjectListHookProc);
	//vSceneObjectList.AddColumn("Scene Object", w[2], 0);
	//ChangeWindowStyle(vSceneObjectList.GetHolderWnd(), WS_POPUP|WS_VISIBLE);

	//vClone.CreateTreeView(w[0]+(width/100.0*cratio), h[2], w[2], h[2], "Clone", hMainWnd);
	//vClone.SetCallbackFunctions(CloneNameEdit, NULL, NULL, CloneKey, CloneMouse, CloneSelectedItemNotify); 
	//vClone.SetHookProcedure(CloneHookProc);
	//LONG oldStyle = GetWindowLong(vClone.GetTreeWnd(), GWL_STYLE);
	//oldStyle |= TVS_CHECKBOXES;
	//SetWindowLong(vClone.GetTreeWnd(), GWL_STYLE, oldStyle);
	//ChangeWindowStyle(vClone.GetHolderWnd(), WS_POPUP|WS_VISIBLE);


	//HMENU hMenu = GetMenu(hMainWnd);
	//HMENU hSub  = GetSubMenu(hMenu, 1);
	//EnableMenuItem(hSub, 0, MF_BYPOSITION|MF_GRAYED);
	//EnableMenuItem(hSub, 1, MF_BYPOSITION|MF_GRAYED);
}
示例#15
0
void RefreshWindows()
{
	if(nCurrentMode==LAYOUTER){
		HWND hWndList[6] = { vSceneList.GetHolderWnd(), wingl.CGethWnd(), vSceneObjectList.GetHolderWnd(),
							vObjectList.GetHolderWnd() ,   vTimeline.GetHWnd(), vClone.GetHolderWnd()};
		//float real_ratio[6][4] = { {0.0f, 0.0f, 0.1f, 0.5f}, {0.1f, 0.0f, 0.7f, 0.7125f}, {0.8f, 0.0f, 0.2f, 0.5f},
		//					       {0.0f, 0.5f, 0.1f, 0.5f}, {0.2f, 0.8f, 0.5f, 0.15f}, {0.8f, 0.5f, 0.2f, 0.5f}};
		float real_ratio[6][4] = {  {0.0f, 0.8f, 0.15f, 1-0.8f},
									{0.0f, 0.0f, 0.78125f, 0.8f},
									{0.78125f, 0.2f, 1.0f-0.78125f, 0.3f},
								    {0.78125f,0.0f, 1.0f-0.78125f, 0.2f},
									{0.15f, 0.8f, 0.78125f-0.15f, 0.2f},
									{0.78125f, 0.5f, 1.0f-0.78125f, 0.5f}
								 };

		RECT rect;
		GetClientRect(hMainWnd, &rect);
		
		//上段
		//SetWindowPos(hWndList[0], 0, 0, 0, rect.right*ratio[0][0], rect.bottom*ratio[0][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[0], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[0], 0, rect.right*real_ratio[0][0], rect.bottom*real_ratio[0][1], rect.right*real_ratio[0][2], rect.bottom*real_ratio[0][3], SWP_NOZORDER);

		//SetWindowPos(hWndList[1], 0, rect.right*ratio[0][0], 0, rect.right*ratio[1][0], rect.right*ratio[1][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[1], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[1], 0, rect.right*real_ratio[1][0], rect.bottom*real_ratio[1][1], rect.right*real_ratio[1][2], rect.bottom*real_ratio[1][3], SWP_NOZORDER);

		//SetWindowPos(hWndList[2], 0, rect.right*ratio[0][0]+rect.right*ratio[1][0], 0, rect.right*ratio[2][0], rect.right*ratio[2][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[2], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[2], 0, rect.right*real_ratio[2][0], rect.bottom*real_ratio[2][1], rect.right*real_ratio[2][2], rect.bottom*real_ratio[2][3], SWP_NOZORDER);
		//RECT t;
		//GetClientRect(hWndList[2], &t);
		//SetWindowPos(vObjectList.GetListWnd() , 0, 0, 0, t.right, t.bottom, SWP_NOZORDER|SWP_NOMOVE);

		//下段
		//SetWindowPos(hWndList[3], 0, 0, rect.bottom*ratio[3][1], rect.right*ratio[3][0], rect.bottom*ratio[3][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[3], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[3], 0, rect.right*real_ratio[3][0], rect.bottom*real_ratio[3][1], rect.right*real_ratio[3][2], rect.bottom*real_ratio[3][3], SWP_NOZORDER);

		//SetWindowPos(hWndList[4], 0, rect.right*ratio[3][0], rect.bottom*ratio[4][1], rect.right*ratio[4][0], rect.bottom*ratio[4][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[4], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[4], 0, rect.right*real_ratio[4][0], rect.bottom*real_ratio[4][1], rect.right*real_ratio[4][2], rect.bottom*real_ratio[4][3], SWP_NOZORDER);

		//SetWindowPos(hWndList[5], 0, rect.right*ratio[3][0]+rect.right*ratio[4][0], rect.bottom*ratio[5][1], rect.right*ratio[5][0], rect.bottom*ratio[5][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[5], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[5], 0, rect.right*real_ratio[5][0], rect.bottom*real_ratio[5][1], rect.right*real_ratio[5][2], rect.bottom*real_ratio[5][3], SWP_NOZORDER);
	}else{
		HWND hWndList[6] = { vSceneList.GetHolderWnd(), wingl.CGethWnd(), vSceneObjectList.GetHolderWnd(),
							vSynth.GetHolderWnd() ,   vTimeline.GetHWnd(), vSound.GetHolderWnd()};

		//x,y, width, height
		float real_ratio[6][4] = {	{0.0f, 0.8f, 0.15f, 1-0.8f},
									{0.0f, 0.0f, 0.78125f, 0.8f},
									{0.78125f, 0.40f, 1.0f-0.78125f, 0.30f},//SceneObjectList
									//{0.78125f, 0.40f, 1.0f-0.78125f, 0.40f},//Time
									{0.78125f, 0.0f, 1.0f-0.78125f, 0.40f},//Synth
									{0.15f, 0.8f, 0.78125f-0.15f, 0.2f},
									{0.78125f, real_ratio[2][3] + real_ratio[3][3], 1.0f-0.78125f, 1.00f - real_ratio[5][1]}//Sound
								 };

		RECT rect;
		GetClientRect(hMainWnd, &rect);

		//上段
		//SetWindowPos(hWndList[0], 0, 0, 0, rect.right*ratio[0][0], rect.bottom*ratio[0][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[0], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[0], 0, rect.right*real_ratio[0][0], rect.bottom*real_ratio[0][1], rect.right*real_ratio[0][2], rect.bottom*real_ratio[0][3], SWP_NOZORDER);

		//SetWindowPos(hWndList[1], 0, rect.right*ratio[0][0], 0, rect.right*ratio[1][0], rect.right*ratio[1][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[1], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[1], 0, rect.right*real_ratio[1][0], rect.bottom*real_ratio[1][1], rect.right*real_ratio[1][2], rect.bottom*real_ratio[1][3], SWP_NOZORDER);

		//SetWindowPos(hWndList[2], 0, rect.right*ratio[0][0]+rect.right*ratio[1][0], 0, rect.right*ratio[2][0], rect.right*ratio[2][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[2], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[2], 0, rect.right*real_ratio[2][0], rect.bottom*real_ratio[2][1], rect.right*real_ratio[2][2], rect.bottom*real_ratio[2][3], SWP_NOZORDER);
		//RECT t;
		//GetClientRect(hWndList[2], &t);
		//SetWindowPos(vObjectList.GetListWnd() , 0, 0, 0, t.right, t.bottom, SWP_NOZORDER|SWP_NOMOVE);

		//下段
		//SetWindowPos(hWndList[3], 0, 0, rect.bottom*ratio[3][1], rect.right*ratio[3][0], rect.bottom*ratio[3][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[3], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[3], 0, rect.right*real_ratio[3][0], rect.bottom*real_ratio[3][1], rect.right*real_ratio[3][2], rect.bottom*real_ratio[3][3], SWP_NOZORDER);

		//SetWindowPos(hWndList[4], 0, rect.right*ratio[3][0], rect.bottom*ratio[4][1], rect.right*ratio[4][0], rect.bottom*ratio[4][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[4], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[4], 0, rect.right*real_ratio[4][0], rect.bottom*real_ratio[4][1], rect.right*real_ratio[4][2], rect.bottom*real_ratio[4][3], SWP_NOZORDER);

		//SetWindowPos(hWndList[5], 0, rect.right*ratio[3][0]+rect.right*ratio[4][0], rect.bottom*ratio[5][1], rect.right*ratio[5][0], rect.bottom*ratio[5][1], SWP_NOZORDER);
		ChangeWindowStyle(hWndList[5], WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWndList[5], 0, rect.right*real_ratio[5][0], rect.bottom*real_ratio[5][1], rect.right*real_ratio[5][2], rect.bottom*real_ratio[5][3], SWP_NOZORDER);
	}
}