Example #1
0
void OptionsModsState::lstModsHover(Action *)
{
	size_t selectedRow = _lstMods->getSelectedRow();
	if ((unsigned int)-1 != selectedRow)
	{
		_txtTooltip->setText(makeTooltip(Options::getModInfos().at(_mods[selectedRow].first)));

	}
}
Example #2
0
void OptionsModsState::cbxMasterHover(Action *)
{
	_txtTooltip->setText(makeTooltip(*_masters[_cbxMasters->getHoveredListIdx()]));
}
BOOL CALLBACK progressControll(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam){
	switch(Message){
	case WM_INITDIALOG:
		{
		int nrGens =*((int*)lParam);
		//printf("thevalue %d\n",nrGens); //works
		stopButton= GetDlgItem(hwnd,ID_STOP);
		progress = GetDlgItem(hwnd,IDC_PROGRESSBAR);
		okButton = GetDlgItem(hwnd,IDOK);
		progressText = GetDlgItem(hwnd,IDC_STATIC_PROGRESS);
		maxText = GetDlgItem(hwnd,IDC_STATIC_MAX);
		meanText = GetDlgItem(hwnd,IDC_STATIC_MEAN);
		minText = GetDlgItem(hwnd,IDC_STATIC_MIN);
		medianText = GetDlgItem(hwnd,IDC_STATIC_MEDIAN);
		killedText = GetDlgItem(hwnd,IDC_STATIC_KILLED);
		deviationText = GetDlgItem(hwnd,IDC_STATIC_DEVIATION);
		SendMessage(progress, PBM_SETRANGE, 0, MAKELPARAM(0, nrGens));

		//tooltips
		HWND hwnd_tip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, 
		  WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, 
		  CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
		  NULL, NULL, GetModuleHandle(NULL), NULL
		);
		SetWindowPos(hwnd_tip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);


		makeTooltip(hwnd,hwnd_tip,maxText,L"Stops the simulation as soone as the current genereation is done.\nThe result will not be deleted");

		makeTooltip(hwnd,hwnd_tip,maxText,L"Highest fitness value reached");
		makeTooltip(hwnd,hwnd_tip,GetDlgItem(hwnd,IDC_STATIC_MAX2),L"Highest fitness value reached");
		makeTooltip(hwnd,hwnd_tip,minText,L"Lowest fitness value reached");
		makeTooltip(hwnd,hwnd_tip,GetDlgItem(hwnd,IDC_STATIC_MIN2),L"Mean of the normalised values (0-100)");		
		makeTooltip(hwnd,hwnd_tip,meanText,L"Mean of the normalised values (0-100)");
		makeTooltip(hwnd,hwnd_tip,GetDlgItem(hwnd,IDC_STATIC_MEAN2),L"Lowest fitness value reached");		
		makeTooltip(hwnd,hwnd_tip,deviationText,L"Deviation of the normalised values (0-100)");
		makeTooltip(hwnd,hwnd_tip,GetDlgItem(hwnd,IDC_STATIC_DEVIATION2),L"Deviation of the normalised values (0-100)");		
		makeTooltip(hwnd,hwnd_tip,medianText,L"Median of the normalised values (0-100)");
		makeTooltip(hwnd,hwnd_tip,GetDlgItem(hwnd,IDC_STATIC_MEDIAN2),L"Median of the normalised values (0-100)");		
		makeTooltip(hwnd,hwnd_tip,killedText,L"Percentage killed during current Generation");
		makeTooltip(hwnd,hwnd_tip,GetDlgItem(hwnd,IDC_STATIC_KILLED2),L"Percentage killed during current Generation");	
		break;
		}
	case WM_COMMAND:{
		switch(LOWORD(wParam))
		{
		case IDOK:
			{
				EndDialog(hwnd,0);
				break;
			}
		case ID_STOP:
			stopSim=true;
			EnableWindow(GetDlgItem(hwnd,ID_STOP),FALSE);
			break;
		
		}
		break;
		}
	case WM_CLOSE:{
#ifdef _DEBUG
		printf("hell no :)");
#endif
		break;}
	default:
		return FALSE;
	}
	return TRUE;
}