Ejemplo n.º 1
0
void   InitDialogs()
{
	InitOverviewDialog();
	InitArcChangeDialog();
	InitTransChangeDialog();
	InitEditLayerDialog();
	InitViewLayerDialog();
	InitMDGrammarDialog();
	InitCommentDialog();
	InitWarningDialog();
	InitAboutDialog();
	InitPlaceChangeDialog();
	InitMarkChangeDialog();
	InitRateChangeDialog();
	InitColorChangeDialog();
	InitShowDialog();
	InitResChangeDialog();
	InitPrintChangeDialog();
	InitSolveDialog();
	InitConsoleDialog();
	InitOptionsDialog();
	InitSimulationDialog();
	InitSwnRGOptionsDialog();
	InitSwnSimOptionsDialog();
	InitSwnUnfoldOptionsDialog();
}
Ejemplo n.º 2
0
void OptionsDialog::OnResetButton()
{
    _settings->InitSettings();
    InitOptionsDialog();
    _settings->NotifyAll();

    OnSettingsChanged();
}
Ejemplo n.º 3
0
LRESULT CALLBACK OptionsDialogProc(HWND hWndDialog, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
	case WM_INITDIALOG:
		InitOptionsDialog(hWndDialog);
		BringWindowToTop(hWndDialog);
		break;

	case WM_COMMAND:
		switch(LOWORD(wParam))
		{
		case IDC_COMBO_BROWSERCHOICE:
			if(HIWORD(wParam) == CBN_SELCHANGE)
			{
				HWND browserCombo = GetDlgItem(hWndDialog, IDC_COMBO_BROWSERCHOICE);
				Browser::SetCurrent(ComboBox_GetCurSel(browserCombo));
				if(Browser::GetCurrent().IsCustom())
				{
					Browser::ChooseCustomBrowserExecutable(hWndDialog);
				}
				UpdateOptionsDialogText(hWndDialog);
			}
			break;

		case IDC_COMBO_SEARCHENGINE:
			if(HIWORD(wParam) == CBN_SELCHANGE)
			{
				HWND searchCombo = GetDlgItem(hWndDialog, IDC_COMBO_SEARCHENGINE);
				SearchEngine::SetCurrent(ComboBox_GetCurSel(searchCombo));
				UpdateOptionsDialogText(hWndDialog);
			}
			break;

		case IDCANCEL:
			LoadOptionsFromRegistry();
			EndDialog(hWndDialog, NULL);
			break;

		case IDOK:
			SaveOptionsToRegistry(hWndDialog);
			EndDialog(hWndDialog, NULL);
			break;
		}
		break;

	case WM_CLOSE:
		EndDialog(hWndDialog, NULL);
		break;

	default:
		return FALSE;
	}
	return TRUE;
}
Ejemplo n.º 4
0
OptionsDialog::OptionsDialog(IControls *control, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::OptionsDialog)
{
    ui->setupUi(this);

    _control = control;
    _settings = control->GetSettings();

    InitOptionsDialog();

    connect(ui->buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(OnApplyButton()));
    connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked()), this, SLOT(OnResetButton()));

    // TODO
    ui->_chkDescOfLoc->setEnabled(false);
}
LRESULT CALLBACK OptionDialogScreen(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_INITDIALOG:
		{
			InitOptionsDialog(hDlg, TAB_SCREEN);

			isStaticBar = FALSE;
			cur_cs = NULL;
			cs_enable(hDlg, FALSE);

			memcpy(&ms, &configuracion->mainScreenConfig->cs, sizeof(ConfigurationScreen));
			memcpy(&bb, &configuracion->bottomBarConfig->cs,  sizeof(ConfigurationScreen));
			memcpy(&tb, &configuracion->topBarConfig->cs,     sizeof(ConfigurationScreen));

			SendMessage(GetDlgItem(hDlg, IDC_COMBO_CS), CB_ADDSTRING, 0, (LPARAM)L"Mainscreen");
			SendMessage(GetDlgItem(hDlg, IDC_COMBO_CS), CB_ADDSTRING, 0, (LPARAM)L"Bottombar");
			SendMessage(GetDlgItem(hDlg, IDC_COMBO_CS), CB_ADDSTRING, 0, (LPARAM)L"Topbar");

			SendMessage(GetDlgItem(hDlg, IDC_COMBO_CS), CB_SETCURSEL, 0, 0);
			cur_cs = &ms;
			cs_load(hDlg, cur_cs);
		}
		return TRUE;
	case WM_COMMAND:
		{
			switch (LOWORD(wParam))
			{
			case IDC_COMBO_CS:
				if (HIWORD(wParam) == CBN_SELCHANGE) {
					cs_save(hDlg, cur_cs);
					ShowWindow(GetDlgItem(hDlg, IDC_CHECK_CS_SHRINKTOFIT), SW_HIDE);
					isStaticBar = FALSE;
					TCHAR str[MAX_PATH];
					GetDlgItemText(hDlg, IDC_COMBO_CS, str, MAX_PATH);
					if (lstrcmpi(str, L"Mainscreen") == 0) {
						cur_cs = &ms;
						cs_load(hDlg, cur_cs);
					} else if (lstrcmpi(str, L"Bottombar") == 0) {
						cur_cs = &bb;
						cs_load(hDlg, cur_cs);
						ShowWindow(GetDlgItem(hDlg, IDC_CHECK_CS_SHRINKTOFIT), SW_SHOW);
						isStaticBar = TRUE;
					} else if (lstrcmpi(str, L"Topbar") == 0) {
						cur_cs = &tb;
						cs_load(hDlg, cur_cs);
						ShowWindow(GetDlgItem(hDlg, IDC_CHECK_CS_SHRINKTOFIT), SW_SHOW);
						isStaticBar = TRUE;
					} else {
						cs_enable(hDlg, FALSE);
					}
				}
				break;
			case IDC_EDIT_CS_ICONS_PER_ROW:
				if (HIWORD(wParam) == EN_SETFOCUS) {
					static BOOL displayed_tip = FALSE;
					if (!displayed_tip) {
						displayed_tip = TRUE;
						MessageBox(hDlg, L"It is recommended to leave this 0. In that case:\nicons_per_row = screen_width / (icon_width + minimum_horizontal_space).", L"Tip", MB_OK);
					}
				}
				break;
			case IDC_BUTTON_CS_TEXT:
				wcscpy(cfs.facename, cur_cs->textFacename);
				cfs.color = cur_cs->textColor;
				cfs.height = cur_cs->textHeightXML;
				cfs.weight = cur_cs->textWeight;
				cfs.shadow = cur_cs->textShadow;
				cfs.roundrect = cur_cs->textRoundRect;
				DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOGFONT), hDlg, (DLGPROC)ChooseFontProc);
				if (bChooseFontOK) {
					wcscpy(cur_cs->textFacename, cfs.facename);
					cur_cs->textColor = cfs.color;
					cur_cs->textHeightXML = cfs.height;
					cur_cs->textWeight = cfs.weight;
					cur_cs->textShadow = cfs.shadow;
					cur_cs->textRoundRect = cfs.roundrect;
				}
				break;
			case IDC_BUTTON_CS_BACK:
				DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOGBACK), hDlg, (DLGPROC)ScreenBackSettingsProc);
				break;
			}
		}
		break;
	}

	return DefOptionWindowProc(hDlg, TAB_SCREEN, uMsg, wParam, lParam);
}
LRESULT CALLBACK OptionDialogTransparency(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_INITDIALOG:
		{
			InitOptionsDialog(hDlg, TAB_TRANSPARENCY);

			SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND),   BM_SETCHECK, configuracion->alphaBlend == 1? BST_CHECKED : BST_UNCHECKED, 0);
			SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND2),  BM_SETCHECK, configuracion->alphaBlend == 2? BST_CHECKED : BST_UNCHECKED, 0);
			SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHAONBLACK), BM_SETCHECK, configuracion->alphaOnBlack   ? BST_CHECKED : BST_UNCHECKED, 0);
			SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_BMP),          BM_SETCHECK, configuracion->transparentBMP ? BST_CHECKED : BST_UNCHECKED, 0);
			SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_MASK),         BM_SETCHECK, configuracion->useMask        ? BST_CHECKED : BST_UNCHECKED, 0);
			
			SetDlgItemInt(hDlg, IDC_EDIT_TRANS_THRESHOLD, configuracion->alphaThreshold, TRUE);

			InitializeTextQualityDropList(GetDlgItem(hDlg, IDC_COMBO_TEXT_QUALITY),  configuracion->textQuality);
			InitializeTextQualityDropList(GetDlgItem(hDlg, IDC_COMBO_TEXT_QUALITY2), configuracion->textQualityInIcons);

			if (configuracion->alphaBlend) {
				EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHAONBLACK), FALSE);
				EnableWindow(GetDlgItem(hDlg, IDC_EDIT_TRANS_THRESHOLD),     FALSE);
				EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_BMP),          FALSE);
				EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_MASK),         FALSE);
				EnableWindow(GetDlgItem(hDlg, IDC_COMBO_TEXT_QUALITY),       FALSE);
				EnableWindow(GetDlgItem(hDlg, IDC_COMBO_TEXT_QUALITY2),      FALSE);
				if (configuracion->alphaBlend == 1) {
					EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND2), FALSE);
				}else if (configuracion->alphaBlend == 2) {
					EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND), FALSE);
				}
			}
		}
		return TRUE;
	case WM_COMMAND:
		switch (LOWORD(wParam))
		{
		BOOL checked;
		case IDC_CHECK_TRANS_ALPHABLEND:
			checked = SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND), BM_GETCHECK, 0, 0) == BST_CHECKED;
			if (checked && !nativelySupportsAlphaBlend()) {
				if (MessageBox(hDlg, L"Your device does not natively support AlphaBlend. Do you want to enable it? Scrolling will be slow!", L"Warning", MB_YESNO) == IDNO) {
					SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND), BM_SETCHECK, BST_UNCHECKED, 0);
					break;
				}
			}
			EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHAONBLACK), !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_EDIT_TRANS_THRESHOLD),     !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_BMP),          !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_MASK),         !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_COMBO_TEXT_QUALITY),       !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_COMBO_TEXT_QUALITY2),      !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND2),  !checked);
			SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND2), BM_SETCHECK, BST_UNCHECKED, 0);
			break;
		case IDC_CHECK_TRANS_ALPHABLEND2:
			checked = SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND2), BM_GETCHECK, 0, 0) == BST_CHECKED;
			EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHAONBLACK), !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_EDIT_TRANS_THRESHOLD),     !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_BMP),          !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_MASK),         !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_COMBO_TEXT_QUALITY),       !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_COMBO_TEXT_QUALITY2),      !checked);
			EnableWindow(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND),   !checked);
			SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_ALPHABLEND), BM_SETCHECK, BST_UNCHECKED, 0);
			break;
		case IDC_CHECK_TRANS_MASK:
			checked = SendMessage(GetDlgItem(hDlg, IDC_CHECK_TRANS_MASK), BM_GETCHECK, 0, 0) == BST_CHECKED;
			if (checked) {
				MessageBox(hDlg, L"This might help the scrolling performance on some devices. If you do not see any improvements disable it since it requires a bit more memory.", L"Tip", MB_OK);
			}
			break;
		}
		break;
	}

	return DefOptionWindowProc(hDlg, TAB_TRANSPARENCY, uMsg, wParam, lParam);
}