Example #1
0
LRESULT nsf_window::onCommand(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
  switch (LOWORD(wParam))
  {
    case ID_MODEL_VIEW:
    case ID_GOOL_VIEW:
    {
      unsigned long params[2];
      params[0] = (unsigned long)&mainList->selectedEntry;
      params[1] = (unsigned long)mainList->selItemIndex;
      
      SendMessageRoot(MSG_SELECT_ITEM, 0, (LPARAM)params);
    }
    break;
    
    case ID_MODEL_EXPORT_AS_MD3:
    case ID_MODEL_EXPORT_AS_COLLADA:
    {
      char filename[MAX_PATH] = "";
      if ((LOWORD(wParam) == ID_MODEL_EXPORT_AS_MD3) && (mainList->selectedEntry.type == 1))
        FileOpenBox("MD3 Files (*.md3)\0*.md3\0All Files (*.*)\0*.*\0", filename, true);
      else if ((LOWORD(wParam) == ID_MODEL_EXPORT_AS_COLLADA) && (mainList->selectedEntry.type == 3))
        FileOpenBox("DAE Files (*.dae)\0*.dae\0All Files (*.*)\0*.*\0", filename, true);
      
      if (filename[0] != 0)
      {
        unsigned long params[2];
        params[0] = (unsigned long)&mainList->selectedEntry;
        params[1] = (unsigned long)&filename;
         
        SendMessageRoot(MSG_EXPORT_ITEM, 0, (LPARAM)params);        
      }
    }
    break;
  }


  return NULL;
}
Example #2
0
DWORD DialogCoreFileBox ( DWORD pDestStr, int iFileType )
{
	// Get filename for open
	char m_pWorkString[256];
	switch ( iFileType )
	{
		case 1 : FileOpenBox ( m_pWorkString );	break;
		case 2 : FileSaveBox ( m_pWorkString );	break;
	}

	// Create and return string
	LPSTR pReturnString;
	if(pDestStr) g_pCreateDeleteStringFunction((DWORD*)&pDestStr, 0);
	DWORD dwSize=strlen(m_pWorkString);
	g_pCreateDeleteStringFunction((DWORD*)&pReturnString, dwSize+1);
	strcpy(pReturnString, m_pWorkString);

	// Return new string
	return (DWORD)pReturnString;
}
Example #3
0
LRESULT main_window::onCommand(UINT uMsg, WPARAM wParam, LPARAM lParam)
{  
  unsigned long params[2] = { 0, 0 };

  switch(LOWORD(wParam))
  {
    case ID_FILE_EXIT:
      ExitProcess(0);
    break; 
    case ID_FILE_OPEN:
    {
      char fileName[MAX_PATH] = "";
      FileOpenBox("NSD Files (*.nsd)\0*.nsd\0All Files (*.*)\0*.*\0", fileName, false);
      params[0] = (unsigned long)fileName;
      SendMessageRoot(MSG_LOAD_NSD, (WPARAM)0, (LPARAM)params);
    }
    break;
  }
  
  switch(LOWORD(wParam))
  {
    case ID_GOOL_STEP:
    {
      //SendMessage(objhWnd, WM_ACTIVATE, 0, 0);
      //resumeGoolSystem();
    }
    break;
    case ID_VIEW_OCTREE:
    {
      if (menu_flags[0] = (!menu_flags[0]))
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_OCTREE, MF_CHECKED);
      else
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_OCTREE, MF_UNCHECKED);
      
      SendMessageRoot(CPM_VISUAL_ZONE_TOGGLE_OCTREES, (WPARAM)0, (LPARAM)params);
    }
    break;
    
    case ID_VIEW_CAMERA_MODELMODE:
    {
      menu_flags[4] = true;
      
      CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_MODELMODE, MF_CHECKED);
  
      if (menu_flags[5] == true)
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_FLIGHTMODE, MF_UNCHECKED);
       if (menu_flags[7] == true)
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_CRASHMODE, MF_UNCHECKED);
        
      menu_flags[5] = false;
      menu_flags[6] = false;
      menu_flags[7] = false;
    
      params[0] = 0;
      SendMessageRoot(CPM_CAMERA_SELECT, (WPARAM)0, (LPARAM)params);
    }
    break;
    case ID_VIEW_CAMERA_FLIGHTMODE:
    {
      menu_flags[5] = true;
      
      CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_FLIGHTMODE, MF_CHECKED);
  
      if (menu_flags[4] == true)
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_MODELMODE, MF_UNCHECKED);
      if (menu_flags[7] == true)
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_CRASHMODE, MF_UNCHECKED);
        
      menu_flags[4] = false;
      menu_flags[6] = false;
      menu_flags[7] = false;
    
      params[0] = 1;
      SendMessageRoot(CPM_CAMERA_SELECT, (WPARAM)0, (LPARAM)params);
    }
    break;
    case ID_VIEW_CAMERA_CRASHMODE:
    {
      menu_flags[7] = true;
      
      CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_CRASHMODE, MF_CHECKED);
  
      if (menu_flags[4] == true)
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_MODELMODE, MF_UNCHECKED);
      if (menu_flags[5] == true)
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_FLIGHTMODE, MF_UNCHECKED);

      menu_flags[4] = false;
      menu_flags[5] = false;
      menu_flags[6] = false;
    
      params[0] = 2;
      SendMessageRoot(CPM_CAMERA_SELECT, (WPARAM)0, (LPARAM)params);
    }
    break;
    
    case ID_VIEW_CAMPTH:
    {
      if (menu_flags[1] = (!menu_flags[1]))
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMPTH, MF_CHECKED);
      else
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMPTH, MF_UNCHECKED);
    
      SendMessageRoot(CPM_VISUAL_SECTION_TOGGLE, (WPARAM)0, (LPARAM)params);
    }
    break;
    case ID_VIEW_WIREFRAME:
    {
      if (menu_flags[2] = (!menu_flags[2]))
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_WIREFRAME, MF_CHECKED);
      else
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_WIREFRAME, MF_UNCHECKED);
      
      SendMessageRoot(CPM_VISUAL_WIREFRAME_TOGGLE, (WPARAM)0, (LPARAM)params);
    }
    break;
    case ID_GOOL_CONTROL:
    {
      if (menu_flags[3] = (!menu_flags[3]))
      {
        CheckMenuItem(GetMenu(hFrame), ID_GOOL_CONTROL, MF_CHECKED);

        menu_flags[7] = true;
      
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_CRASHMODE, MF_CHECKED);
    
        if (menu_flags[4] == true)
          CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_MODELMODE, MF_UNCHECKED);
        if (menu_flags[5] == true)
          CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_FLIGHTMODE, MF_UNCHECKED);

        menu_flags[4] = false;
        menu_flags[5] = false;
        menu_flags[6] = false;
      
        params[0] = 2;
        SendMessageRoot(CPM_CAMERA_SELECT, (WPARAM)0, (LPARAM)params);
      }
      else
      {
        CheckMenuItem(GetMenu(hFrame), ID_GOOL_CONTROL, MF_UNCHECKED);
        
        menu_flags[5] = true;
      
        CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_FLIGHTMODE, MF_CHECKED);
    
        if (menu_flags[4] == true)
          CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_MODELMODE, MF_UNCHECKED);
        if (menu_flags[7] == true)
          CheckMenuItem(GetMenu(hFrame), ID_VIEW_CAMERA_CRASHMODE, MF_UNCHECKED);
          
        menu_flags[4] = false;
        menu_flags[6] = false;
        menu_flags[7] = false;
      
        params[0] = 1;
        SendMessageRoot(CPM_CAMERA_SELECT, (WPARAM)0, (LPARAM)params); 
      }
    
      SendMessageRoot(CSM_CONTROL_TOGGLE_ACTIVE, (WPARAM)0, (LPARAM)params);
    }   
    break;    
  } 
}