Example #1
0
long CalcOptions::onInitDialog()
{
	::CopyMemory(&normalFmt, &_normalFmt, sizeof(CHARFORMAT));
	::CopyMemory(&resultFmt, &_resultFmt, sizeof(CHARFORMAT));
	::CopyMemory(&errorFmt, &_errorFmt, sizeof(CHARFORMAT));

	// fill angle mode combo box
	::SendDlgItemMessage(_hDlg, IDC_ANGLE_MODE, CB_ADDSTRING, 0, (LPARAM)"Degrees");
	::SendDlgItemMessage(_hDlg, IDC_ANGLE_MODE, CB_ADDSTRING, 0, (LPARAM)"Radians");
	::SendDlgItemMessage(_hDlg, IDC_ANGLE_MODE, CB_ADDSTRING, 0, (LPARAM)"Gradians");

	// fill mem view format combo box
	::SendDlgItemMessage(_hDlg, IDC_MEMVIEW_FORMAT, CB_ADDSTRING, 0, (LPARAM)"Decimal");
	::SendDlgItemMessage(_hDlg, IDC_MEMVIEW_FORMAT, CB_ADDSTRING, 0, (LPARAM)"Hex");
	::SendDlgItemMessage(_hDlg, IDC_MEMVIEW_FORMAT, CB_ADDSTRING, 0, (LPARAM)"Octal");
	::SendDlgItemMessage(_hDlg, IDC_MEMVIEW_FORMAT, CB_ADDSTRING, 0, (LPARAM)"Binary");

	if(getAlwaysOnTop()) ::CheckDlgButton(_hDlg, IDC_ALWAYS_ON_TOP, BST_CHECKED);
	if(getMemVisible()) ::CheckDlgButton(_hDlg, IDC_MEM_VISIBLE, BST_CHECKED);
	if(getCopyResult()) ::CheckDlgButton(_hDlg, IDC_COPY_RESULT, BST_CHECKED);
	::SendDlgItemMessage(_hDlg, IDC_ANGLE_MODE, CB_SETCURSEL, (WPARAM)getAngleMode(), 0L);
	::SendDlgItemMessage(_hDlg, IDC_MEMVIEW_FORMAT, CB_SETCURSEL, (WPARAM)getMemViewFmt(), 0L);
	if(getOutputDec()) ::CheckDlgButton(_hDlg, IDC_OUTPUT_DEC, BST_CHECKED);
	if(getOutputHex()) ::CheckDlgButton(_hDlg, IDC_OUTPUT_HEX, BST_CHECKED);
	if(getOutputOct()) ::CheckDlgButton(_hDlg, IDC_OUTPUT_OCT, BST_CHECKED);
	if(getOutputBin()) ::CheckDlgButton(_hDlg, IDC_OUTPUT_BIN, BST_CHECKED);

	::SetDlgItemInt(_hDlg, IDC_NUM_DIGITS, getNumDigits(), TRUE);
	return TRUE;
}
Example #2
0
int Cconfigurator::saveConfigAs(QByteArray path, QByteArray filename)
{
  unsigned int i;

  // try QSettings
  QSettings conf(path + filename, QSettings::IniFormat);

  conf.beginGroup("General");
  conf.setValue("mapFile", getBaseFile());
  conf.setValue("windowRect", renderer_window->geometry() );
  conf.setValue("alwaysOnTop", getAlwaysOnTop() );
  conf.setValue("startupMode", getStartupMode() );
  conf.endGroup();

  conf.beginGroup("Networking");
  conf.setValue("localPort", getLocalPort() );
  conf.setValue("remoteHost", getRemoteHost() );
  conf.setValue("remotePort", getRemotePort() );
  conf.endGroup();

  conf.beginGroup("OpenGL");
  conf.setValue("texturesVisibility", getTextureVisibility() );
  conf.setValue("detailsVisibility", getDetailsVisibility() );
  conf.setValue("visibleLayers", getVisibleLayers() );
  conf.setValue("showNotes", getShowNotesRenderer() );
  conf.setValue("showRegions", getShowRegionsInfo() );
  conf.setValue("displayRegions", getDisplayRegionsRenderer() );
  conf.setValue("multisampling", getMultisampling() );
  conf.setValue("selectOnAnyLayer", getSelectOAnyLayer());
  conf.setValue("angleX", (double) angleX );
  conf.setValue("angleY", (double) angleY );
  conf.setValue("angleZ", (double) angleZ );
  conf.setValue("userX", (double) userX );
  conf.setValue("userY", (double) userY );
  conf.setValue("userZ", (double) userZ );
  conf.setValue("noteColor", getNoteColor() );
  conf.setValue("drawPrespam", getDrawPrespam());

  conf.endGroup();

  conf.beginGroup("Engine");
  conf.setValue("checkExits", getExitsCheck() );
  conf.setValue("checkTerrain", getTerrainCheck() );
  conf.setValue("briefmode", getBriefMode() );
  conf.setValue("autoMerge", getAutomerge() );
  conf.setValue("angryLinker", getAngrylinker() );
  conf.setValue("dualLinker", getDuallinker() );
  conf.setValue("autoRefresh", getAutorefresh() );
  conf.setValue("roomNameQuote", getNameQuote() );
  conf.setValue("descQuote", getDescQuote() );
  conf.setValue("mactionUsesPrespam", getMactionUsesPrespam());
  conf.setValue("prespamTTL", getPrespamTTL());
  conf.endGroup();

  conf.beginGroup("Patterns");
  conf.setValue("exitsPattern", getExitsPattern());
  conf.setValue("spellsEffectPattern", spells_pattern);
  conf.setValue( "scorePattern", getScorePattern() );
  conf.setValue( "scorePatternShort", getShortScorePattern() );
  conf.endGroup();



  conf.beginGroup("GroupManager");
  conf.setValue("remoteHost", getGroupManagerHost() );
  conf.setValue("remotePort", getGroupManagerRemotePort() );
  conf.setValue("localServerPort", getGroupManagerLocalPort() );
  conf.setValue("charName", getGroupManagerCharName() );
  conf.setValue("charColor", getGroupManagerColor().name() );
  conf.setValue("showSelf", getGroupManagerShowSelf() );
  conf.setValue("notifyArm", getGroupManagerNotifyArmour() );
  conf.setValue("notifySanc", getGroupManagerNotifySanc() );
  conf.setValue("notifyBash", getGroupManagerNotifyBash() );
  conf.setValue("showGroupManager", getGroupManagerShowManager() );

  conf.setValue("windowRect", renderer_window->getGroupManagerRect() );

  conf.endGroup();


  conf.beginWriteArray("Spells");
  for (unsigned int i = 0; i < spells.size(); ++i) {
	  conf.setArrayIndex(i);
	  conf.setValue("addon", spells[i].addon);
	  conf.setValue("name", spells[i].name);
	  conf.setValue("upMessage", spells[i].up_mes);
	  conf.setValue("refreshMessage", spells[i].refresh_mes);
	  conf.setValue("downMessage", spells[i].down_mes);
  }
  conf.endArray();



  conf.beginGroup("Movement tracking");
  conf.beginWriteArray("Cancel Patterns");
  for (int i = 0; i < moveCancelPatterns.size(); ++i) {
	  conf.setArrayIndex(i);
	  conf.setValue("pattern", moveCancelPatterns.at(i));
  }
  conf.endArray();
  conf.beginWriteArray("Force Patterns");
  for (int i = 0; i < moveForcePatterns.size(); ++i) {
	  conf.setArrayIndex(i);
	  conf.setValue("pattern", moveForcePatterns.at(i));
  }
  conf.endArray();
  conf.endGroup();


  conf.beginWriteArray("Debug Settings");
  i = 0;
  while (debug_data[i].name) {
	  conf.setArrayIndex(i);
	  conf.setValue("name", debug_data[i].name);
	  conf.setValue("state", debug_data[i].state);

      i++;
  }
  conf.endArray();

  configFile = filename;
  configPath = path;

  setConfigModified(false);
  return true;
}