예제 #1
0
MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) {
	ui.setupUi(this);

	// UI設定
	QActionGroup* groupMode = new QActionGroup(this);
	ui.actionModeSketch->setCheckable(true);
	ui.actionMode3DView->setCheckable(true);
	ui.actionModeSketch->setActionGroup(groupMode);
	ui.actionMode3DView->setActionGroup(groupMode);
	ui.actionModeSketch->setChecked(true);

	QActionGroup* groupPenColor = new QActionGroup(this);
	ui.actionPenColorBranch->setCheckable(true);
	ui.actionPenColorLeaf->setCheckable(true);
	ui.actionPenColorBranch->setActionGroup(groupPenColor);
	ui.actionPenColorLeaf->setActionGroup(groupPenColor);
	ui.actionPenColorBranch->setChecked(true);

	QActionGroup* groupPenWidth = new QActionGroup(this);
	ui.actionPenWidth20->setCheckable(true);
	ui.actionPenWidth10->setCheckable(true);
	ui.actionPenWidth5->setCheckable(true);
	ui.actionPenWidth20->setActionGroup(groupPenWidth);
	ui.actionPenWidth10->setActionGroup(groupPenWidth);
	ui.actionPenWidth5->setActionGroup(groupPenWidth);
	ui.actionPenWidth20->setChecked(true);

	// メニューハンドラ
	connect(ui.actionNewSketch, SIGNAL(triggered()), this, SLOT(onNewSketch()));
	connect(ui.actionLoadSketch, SIGNAL(triggered()), this, SLOT(onLoadSketch()));
	connect(ui.actionSaveSketch, SIGNAL(triggered()), this, SLOT(onSaveSketch()));
	connect(ui.actionSaveImage, SIGNAL(triggered()), this, SLOT(onSaveImage()));
	connect(ui.actionLoadCamera, SIGNAL(triggered()), this, SLOT(onLoadCamera()));
	connect(ui.actionSaveCamera, SIGNAL(triggered()), this, SLOT(onSaveCamera()));
	connect(ui.actionResetCamera, SIGNAL(triggered()), this, SLOT(onResetCamera()));
	connect(ui.actionExit, SIGNAL(triggered()), this, SLOT(close()));
	connect(ui.actionRandomGeneration, SIGNAL(triggered()), this, SLOT(onRandomGeneration()));
	connect(ui.actionGreedyInverse, SIGNAL(triggered()), this, SLOT(onGreedyInverse()));
	connect(ui.actionModeSketch, SIGNAL(triggered()), this, SLOT(onModeUpdate()));
	connect(ui.actionMode3DView, SIGNAL(triggered()), this, SLOT(onModeUpdate()));
	connect(ui.actionPenColorBranch, SIGNAL(triggered()), this, SLOT(onPenColorUpdate()));
	connect(ui.actionPenColorLeaf, SIGNAL(triggered()), this, SLOT(onPenColorUpdate()));
	connect(ui.actionPenWidth20, SIGNAL(triggered()), this, SLOT(onPenWidthUpdate()));
	connect(ui.actionPenWidth10, SIGNAL(triggered()), this, SLOT(onPenWidthUpdate()));
	connect(ui.actionPenWidth5, SIGNAL(triggered()), this, SLOT(onPenWidthUpdate()));
	connect(ui.actionOptions, SIGNAL(triggered()), this, SLOT(onOptions()));

	glWidget = new GLWidget3D(this);
	setCentralWidget(glWidget);
}
예제 #2
0
static void onCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify)
{
  LoggerWin * logger = (LoggerWin *)GetWindowLong(hWnd, DWL_USER);
  switch (id)
  {
    case IDC_CHECK_MUTE:
      if(logger)
        logger->bMutedAll = (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_MUTE));
      break;
    case IDC_BUTTON_OPTIONS:
      onOptions(hWnd, logger);
      break;
    case IDC_BUTTON_CLEAR:
      if(logger)
        logger->onClear();
      break;
    default:
      break;
  }
}
예제 #3
0
// This is exported function which allows to access Settings GUI from other applications
void WINAPI SPY_Setup()
{
  LoggerWin logger;
  ProfileWin profile;

  profile.getBool(NPSPY_REG_KEY_ONTOP, &logger.bOnTop);
  profile.getBool(NPSPY_REG_KEY_LOGTOWINDOW, &logger.bToWindow);
  profile.getBool(NPSPY_REG_KEY_LOGTOCONSOLE, &logger.bToConsole);
  profile.getBool(NPSPY_REG_KEY_LOGTOFILE, &logger.bToFile);
  profile.getBool(NPSPY_REG_KEY_SPALID, &logger.bSPALID);
  profile.getString(NPSPY_REG_KEY_LOGFILENAME, logger.szFile, strlen(logger.szFile));

  for(int i = 1; i < TOTAL_NUMBER_OF_API_CALLS; i++)
  {
    BOOL selected = TRUE;
    if(profile.getBool(ActionName[i], &selected))
      logger.bMutedCalls[i] = !selected;
  }

  onOptions(NULL, &logger);
}
예제 #4
0
BOOL LoginDialog::onCommand(UINT controlID, UINT notificationID)
{
  switch (controlID) {
  case IDC_CSERVER:
    switch (notificationID) {
    case CBN_DROPDOWN:
      updateHistory();
      break;

    // select item in ComboBox with list of history
    case CBN_SELENDOK:
      {
        int selectedItemIndex = m_server.getSelectedItemIndex();
        if (selectedItemIndex < 0) {
          return FALSE;
        }
        StringStorage server;
        m_server.getItemText(selectedItemIndex, &server);
        ConnectionConfigSM ccsm(RegistryPaths::VIEWER_PATH,
                                server.getString());
        m_connectionConfig.loadFromStorage(&ccsm);
        break;
      }
    }

    enableConnect();
    break;

  // click "Connect"
  case IDOK:
    onConnect();
    kill(0);
    break;

  // cancel connection
  case IDCANCEL:
    kill(0);
    break;

  case IDC_BCONFIGURATION:
    onConfiguration();
    break;

  case IDC_BOPTIONS:
    return onOptions();

  case IDC_LISTENING:
    onListening();
    kill(0);
    break;

  case IDC_ORDER_SUPPORT_BUTTON:
    onOrder();
    break;

  case IDC_BABOUT:
    onAbout();
    break;

  default:
    _ASSERT(true);
    return FALSE;
  }
  return TRUE;
}