예제 #1
0
//==================================================================
RibRendToy::RibRendToy( const char *pExePath ) :
	mpDispDriverFBuff(NULL),
	mLastUsedWd(0),
	mLastUsedHe(0),
	mMainMenuID(-1)
{
	DASSERT( mspThis == NULL );

	mspThis = this;

	mFileToRender[0] = 0;

	strcpy_s( mExePath, pExePath );

	sprintf( mExeResPath, "%s/Resources", mExePath );

    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
    glutInitWindowSize( 640, 480 );

    glutCreateWindow( APPNAME " v" APPVERSION );

    glutDisplayFunc( sDisplayFunc );
    glutReshapeFunc( sReshapeFunc );
	glutMouseFunc( sMouseFunc );
	glutPassiveMotionFunc( sPassiveMotion );
    glutIdleFunc( sIdleFunc );

	RebuildMenu();
}
예제 #2
0
파일: mru.cpp 프로젝트: ellysh/notecase
void MRU::Clear()
{
	m_lstFiles.clear();

	Save();
	RebuildMenu();
}
예제 #3
0
static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) 
{
	BOOL ret;
	if (msg != WM_INITDIALOG)
		ret = SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);

	switch (msg) {
	case WM_INITDIALOG:
		if (hExtraIcon != NULL) {
			ShowWindow(GetDlgItem(hwndDlg, IDC_SHOW_ADV_ICON), SW_HIDE);
			ShowWindow(GetDlgItem(hwndDlg, IDC_ADV_ICON), SW_HIDE);
		}
		else {
			// Init combo
			int total = EXTRA_ICON_COUNT, first = 0;

			SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM) _T("1"));
			SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM) _T("2"));

			if (total > 0) {
				TCHAR tmp[10];
				for (int i = first; i <= total; i++)
					SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM) _itot(i - first + 3, tmp, 10));
			}
		}

		ret = SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
		OptionsEnableDisableCtrls(hwndDlg);
		break;

	case WM_NOTIFY:
		{
			LPNMHDR lpnmhdr = (LPNMHDR)lParam;
			if (lpnmhdr->idFrom == 0 && lpnmhdr->code == PSN_APPLY) {
				RebuildMenu();
				StartTimer();
			}

		}
		break;

	case WM_COMMAND:
		switch (LOWORD(wParam)) {
		case IDC_ENABLE_SEND:
			if (HIWORD(wParam) == BN_CLICKED)
				OptionsEnableDisableCtrls(hwndDlg);

			break;
		}
		break;
	}

	return ret;
}
예제 #4
0
//==================================================================
void RibRendToy::MenuFunc( int id )
{
	switch ( id )
	{
	case MENUID_DBG_PICK_BUCKET:
		mHiderParams.mDbgShowBuckets = !mHiderParams.mDbgShowBuckets;
		RenderFile( true );
		RebuildMenu();
		glutPostRedisplay();
		return;

	case MENUID_DBG_COLOR_CODE_GRIDS:
		mHiderParams.mDbgColorCodedGrids = !mHiderParams.mDbgColorCodedGrids;
		RenderFile( true );
		RebuildMenu();
		glutPostRedisplay();
		return;

	case MENUID_DBG_RASTERIZE_VERTS:
		mHiderParams.mDbgRasterizeVerts = !mHiderParams.mDbgRasterizeVerts;
		RenderFile( true );
		RebuildMenu();
		glutPostRedisplay();
		return;
	}

	if ( id >= MENUID_FILES )
	{
		strcpy_s( mFileToRender, mExePath );
		strcat_s( mFileToRender, "/" );
		strcat_s( mFileToRender, mTestRibFilesPaths[id - MENUID_FILES].c_str() );
		strcat_s( mFileToRender, "/" );
		strcat_s( mFileToRender, mTestRibFiles[id - MENUID_FILES].c_str() );

		printf( "Render File: %s\n", mFileToRender );
	}
}
예제 #5
0
파일: mru.cpp 프로젝트: ellysh/notecase
void MRU::Change(const char *szFilename, bool bAdd)
{
	int nIdx = FindEntry(szFilename);
	//remove item from list
	if(nIdx >= 0)
		m_lstFiles.erase(m_lstFiles.begin()+nIdx);

	//add it again? (this way latest item goes to the top of the menu)
	if(bAdd){
		//keep the list maximal size
		if(m_lstFiles.size() > (unsigned int)MRU_LIST_SIZE)
			m_lstFiles.erase(m_lstFiles.begin()+m_lstFiles.size()-1);	//delete last entry

		m_lstFiles.insert(m_lstFiles.begin(), szFilename);
	}

	RebuildMenu();
}
예제 #6
0
void VDebugProfiling::OnHandleCallback(IVisCallbackDataObject_cl* pData)
{
  if (pData->m_pSender == &Vision::Callbacks.OnUpdateSceneBegin)
  {
#if defined(_VISION_WIN32)
    if (GetParent()->GetInputMap()->GetTrigger(PREV_PROFILING_PAGE))
    {
      int iIndex = m_iCurrentProfilingPage - 1;
      if (iIndex < -1)
        iIndex = Vision::Profiling.GetNumOfGroups() - 1;

      OnActionTriggered(iIndex);
    }
    else if (GetParent()->GetInputMap()->GetTrigger(NEXT_PROFILING_PAGE))
    {
      int iIndex = m_iCurrentProfilingPage + 1;
      if (iIndex >= (int)Vision::Profiling.GetNumOfGroups())
        iIndex = -1;

      OnActionTriggered(iIndex);
    }
    else if (GetParent()->GetInputMap()->GetTrigger(RESET_MAX_VALUES))
    {
      OnActionTriggered(s_iResetMaxValuesAction);
    }
#endif
  }
  else if (pData->m_pSender == &Vision::Callbacks.OnAfterSceneLoaded)
  {
    RebuildMenu();
  }
  else
  {    
    OnActionTriggered(GetCallbackIndex(pData));
  }
}
예제 #7
0
/**
 * This function is called by Miranda just after loading all system modules.
 *
 * @param	wParam	- not used
 * @param	lParam	- not used
 *
 * @return	always 0
 **/
static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam) 
{
#ifdef _DEBUG
	#define new DEBUG_NEW;
	int tmpFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
	tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
	_CrtSetDbgFlag(tmpFlag);
//	_CrtSetBreakAlloc(4852);
#endif
	INT_PTR ptr;

	UnhookEvent(ghModulesLoadedHook);

	myGlobals.HaveCListExtraIcons		= ServiceExists(MS_CLIST_EXTRA_SET_ICON);
	myGlobals.ExtraIconsServiceExist	= ServiceExists(MS_EXTRAICON_REGISTER);
	myGlobals.PopUpActionsExist			= ServiceExists(MS_POPUP_REGISTERACTIONS);
	myGlobals.MsgAddIconExist			= ServiceExists(MS_MSG_ADDICON);

	// init meta contacts
	ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
	myGlobals.szMetaProto = (ptr != CALLSERVICE_NOTFOUND) ? (LPCSTR)ptr : NULL;

	// options
	OptionsLoadModule();
	// create services to receive string lists of languages and timezones
	SvcConstantsLoadModule();
	// load module to remind user about birthday and a anniversary
	SvcReminderOnModulesLoaded();
	// load extended intagration services
	SvcEMailOnModulesLoaded();
	SvcHomepageLoadModule();
	SvcPhoneLoadModule();
	SvcGenderLoadModule();
	SvcFlagsOnModulesLoaded();

#ifdef _DEBUG // new feature, not in release jet
	NServices::NAvatar::OnModulesLoaded();
#endif
	
	// build contact's menuitems
	RebuildMenu();
	ghPrebuildStatusMenu = HookEvent( ME_CLIST_PREBUILDSTATUSMENU, (MIRANDAHOOK)RebuildAccount);

	// finally register for updater
	if (ServiceExists(MS_UPDATE_REGISTER)) 
	{
		Update update = {0};
		CHAR szVersion[16];
		update.cbSize			= sizeof(Update);
		update.szComponentName	= pluginInfo.shortName;
		update.pbVersion		= (BYTE *)CreateVersionString(pluginInfo.version, szVersion);
		update.cpbVersion		= (INT)strlen((LPSTR)update.pbVersion);

		update.szUpdateURL		= UPDATER_AUTOREGISTER;
		
		update.szBetaVersionURL		= "http://userinfoex.googlecode.com/svn/trunk/changelog.txt";
		// bytes occuring in VersionURL before the version, used to locate the version information within the URL data
		// e.g. change '[0.8.1.0 (in work)]' to 'UserinfoEx: 0.8.1.0' for beta versions bump
		update.pbBetaVersionPrefix	= (BYTE *)"UserinfoEx: ";
		update.cpbBetaVersionPrefix	= (INT)strlen((LPSTR)update.pbBetaVersionPrefix);

#ifdef _WIN64
 #ifdef _UNICODE
		update.szBetaUpdateURL		= "http://userinfoex.googlecode.com/files/uinfoex64.zip";
 #endif
#else
 #ifdef _UNICODE
		update.szBetaUpdateURL		= "http://userinfoex.googlecode.com/files/uinfoexW.zip";
 #else
		update.szBetaUpdateURL		= "http://userinfoex.googlecode.com/files/uinfoex.zip";
 #endif
#endif

		// url for displaying changelog for beta versions
		update.szBetaChangelogURL	 = "http://userinfoex.googlecode.com/svn/trunk/changelog.txt";

		CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
	}
	// install known modules strings to database
	DB::Setting::WriteAString(NULL, "KnownModules", MODULELONGNAME, USERINFO","MODNAME","MOD_MBIRTHDAY","MODNAMEFLAGS);

	return 0;
}