示例#1
0
BOOL AboutDialog::onInitDialog()
{
  // Update product version string.
  StringStorage versionString(_T("unknown"));
  try {
    StringStorage binaryPath;
    Environment::getCurrentModulePath(&binaryPath);
    VersionInfo productInfo(binaryPath.getString());
    versionString.setString(productInfo.getProductVersionString());
  } catch (SystemException &ex) {
    MessageBox(m_ctrlThis.getWindow(),
               ex.getMessage(),
               StringTable::getString(IDS_MBC_TVNVIEWER),
               MB_OK | MB_ICONEXCLAMATION);
  }

  // Format product version and build time for displaying on the dialog.
  StringStorage versionText;
  versionText.format(StringTable::getString(IDS_PRODUCT_VERSION_FORMAT),
                     versionString.getString(),
                     BuildTime::DATE);

  // Show version info on the dialog.
  Control versionLabel;
  versionLabel.setWindow(GetDlgItem(m_ctrlThis.getWindow(), IDC_STATIC_VERSION));
  versionLabel.setText(versionText.getString());

  // Show licensing info and/or special build info.
  Control licensingLabel;
  licensingLabel.setWindow(GetDlgItem(m_ctrlThis.getWindow(), IDC_STATIC_LICENSING));
  licensingLabel.setText(StringTable::getString(IDS_LICENSING_INFO));

  return FALSE;
}
示例#2
0
BOOL AboutDialog::onInitDialog()
{

  Control versionLabel;

  versionLabel.setWindow(GetDlgItem(m_ctrlThis.getWindow(), IDC_STATIC_VERSION));

  StringStorage binaryPath;
  StringStorage versionText;
  StringStorage versionString(_T("unknown"));

  Environment::getCurrentModulePath(&binaryPath);

  try {
    VersionInfo productInfo(binaryPath.getString());
    versionString.setString(productInfo.getProductVersionString());
  } catch (SystemException &ex) {
    MessageBox(m_ctrlThis.getWindow(),
      ex.getMessage(),
      StringTable::getString(IDS_MBC_TVNCONTROL),
      MB_OK | MB_ICONEXCLAMATION);
  }

  versionText.format(StringTable::getString(IDS_PRODUCT_VERSION_FORMAT),
    versionString.getString(),
    BuildTime::DATE);

  versionLabel.setText(versionText.getString());

  return FALSE;
}
示例#3
0
文件: ssX.c 项目: q3k/ski
void prodInfoCallback(CALLBACK_ARGS)
{
    static Widget dialog = NULL;

    if (!dialog) {
	XmString xms;
	Arg arg;

	xms = XmStringCreateLtoR(productInfo(), XmFONTLIST_DEFAULT_TAG);
	XtSetArg(arg, XmNmessageString, xms);
	dialog = XmCreateInformationDialog(cmd, "prodInfo", &arg, 1);
	XmStringFree(xms);
	XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON));
	XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
    }
    XtManageChild(dialog);
}