Example #1
0
		INT_PTR DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
		{
			switch (msg) 
			{
				case WM_INITDIALOG:

					meshObj = (MeshObject*)map->GetParamBlock()->GetOwner();
					//node = meshObj->GetNode();

					if (meshObj!=NULL)
					{
						//QString name = QFileInfo(meshObj->animaPath).fileName();
						
						hwndLbl = GetDlgItem(hWnd, IDC_FILE_NAME);
						if(hwndLbl!=NULL)
						{
							hwndLblFileName = hwndLbl;
							UpdateFileNameInfo();
							//LPARAM a = (LPARAM)name.toAscii().data();
							//SendMessage(hwndLbl, WM_SETTEXT, 0, (LPARAM) a);
						}
				
						QString sceneDesc=meshObj->GetSceneDesc();
						hwndLbl = GetDlgItem(hWnd, IDC_STATIC_SCENE_INFO);
						if (hwndLbl!=NULL)
						{
							hwndLblInfo = hwndLbl;
							UpdateLabelInfo();
							//LPARAM a1 = (LPARAM)sceneDesc.toAscii().data();
							////SendMessage(hwndLblInfo, WM_SETTEXT, 0, (LPARAM) a1);
							//char bb[10];
							//strcpy(bb,"jkjhjh\0");
							//SendMessage(hwndLblInfo, WM_SETTEXT, 0, (LPARAM) bb);
						}
					}

					//  load the shader dropdown
					////hwndCombo = GetDlgItem(hWnd, IDC_COMBO_PRESET);
					////SendMessage(hwndCombo, CB_RESETCONTENT, 0L, 0L);

					////meshObj = (MeshObject*)map->GetParamBlock()->GetOwner();

					////index = 0;
					////Anima::ModelExporter::GetModelExporterRenderTypeList(Anima::ModelExporterType::MAX,0,render_list);
					////i=0;
					////foreach(Anima::ModelExporterRenderType type , render_list)
					////{
					////	QString &dsc = Anima::ModelExporter::GetRenderTypeDesc(type);
					////	LPARAM a = (LPARAM)dsc.toAscii().data();
					//////	int n = SendMessage(hwndCombo, CB_ADDSTRING, 0L, a );
					////	int n = ComboBox_InsertString(hwndCombo,-1,a);

					////	SendMessage(hwndCombo, CB_SETITEMDATA, n, i);
					////	if (type == meshObj->current_render_type)
					////		index = i;
					////	i++;
					////}

					//// //EnableWindow(GetDlgItem(hWnd, IDC_MTLID_NAMES_COMBO), false);

					////	//p=10;
					//// //SendMessage(hwndCombo, CB_SETMINVISIBLE, (WPARAM)p, 0);
					//// SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM)index, 0);

					return TRUE;

				case WM_COMMAND:
					 switch (LOWORD(wParam))
					 {
						case IDC_BUTTON_FILE_BROWSE:
						case IDC_BUTTON_RELOAD:
						case IDC_BUTTON_REBUILD:
							HANDLE_MSG(hWnd,WM_COMMAND,OnDlgCommand);
							break;
						case IDC_COMBO_PRESET:
							switch( HIWORD(wParam) )
							{
								 HANDLE_MSG(hWnd,WM_COMMAND,OnDlgCommand);

								//case WM_COMMAND:

								//	// push
								//	wndCombo = GetDlgItem(hWnd, IDC_COMBO_PRESET);

								//	break;

								case CBN_DROPDOWN:
									{
									return TRUE;
									}

								case CBN_SELCHANGE: { // select a new item from the combo box

			//					/*	int sel = (int)SendMessage((HWND)lParam, CB_GETITEMDATA, SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
			//						if(sel>=0)
			//						{
			//							meshObj = (MeshObject*)map->GetParamBlock()->GetOwner();

			//							pRollup = meshObj->ip->GetCommandPanelRollup();

			//							Anima::ModelExporter::GetModelExporterRenderTypeList(Anima::ModelExporterType::MAX,0,render_list);
			//
			//							meshObj->current_render_type =render_list[sel];

			//							show = meshObj->current_render_type == Anima::ModelExporterRenderType_DEFAULT;
			//							if (show)
			//							{
			//								for(int i=0;i<pRollup->GetNumPanels();i++)
			//								{
			//									if (defaultWindList.contains(pRollup->GetPanelDlg(i)))
			//									{
			//										pRollup->Show(i);
			//									}
			//								}
			//							}
			//							else
			//							{
			//								for(int i=0;i<pRollup->GetNumPanels();i++)
			//								{
			//									if (defaultWindList.contains(pRollup->GetPanelDlg(i)))
			//									{
			//										pRollup->Hide(i);
			//									}
			//								}
			//							}

			//							pRollup->UpdateLayout ();
			//							meshObj->RebuildMaterial();
			//						}
			//						*/
									return TRUE;
								}
							}
					 }
			}
			return FALSE;
		}