Exemplo n.º 1
0
	Rename::Rename(wxWindow* parent, const std::string& name):
		wxDialog{ parent, wxID_ANY, Win::GetStringWx(SIDRename), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE },
		m_name( name ),
		m_validator{ new wxTextValidator(wxFILTER_EXCLUDE_CHAR_LIST) }
	{
		auto topSizer = new wxBoxSizer(wxVERTICAL);

		auto upperSizer = new wxBoxSizer(wxHORIZONTAL);
		upperSizer->Add(new wxStaticText(this, wxID_ANY, Win::GetStringWx(SIDRenameNewFilename)), wxSizerFlags(0));

		m_validator->SetCharExcludes(wxString::FromUTF8(Sys::Info::InvalidFilenameCharacters().c_str()));
		m_filename = new wxTextCtrl(this, wxID_ANY, L"", wxDefaultPosition, { 400, wxDefaultCoord }, wxTE_PROCESS_ENTER, *m_validator);
		upperSizer->Add(m_filename, wxSizerFlags(1).Border(wxLEFT, 20));

		auto lowerSizer = new wxBoxSizer(wxHORIZONTAL);
		auto okButton = new wxButton(this, wxID_OK, Win::GetStringWx(SIDDialogOK));
		okButton->Bind(wxEVT_BUTTON, [&](wxCommandEvent& evt) { OnOk();  });
		auto cancelButton = new wxButton(this, wxID_CANCEL, Win::GetStringWx(SIDDialogCancel));
		cancelButton->Bind(wxEVT_BUTTON, [&](wxCommandEvent& evt) { OnCancel(); });

		lowerSizer->Add(okButton, wxSizerFlags(0));
		lowerSizer->Add(cancelButton, wxSizerFlags(0).Border(wxLEFT, 20));

		topSizer->Add(upperSizer, wxSizerFlags(0).Border(wxALL, 10));
		topSizer->Add(lowerSizer, wxSizerFlags(0).Border(wxALL, 10).Right());


		SetSizerAndFit(topSizer);

		m_filename->SetValue(wxString::FromUTF8(m_name.c_str()));
		m_filename->Bind(wxEVT_TEXT_ENTER, [=](wxCommandEvent& evt) { OnOk(); });
	}
Exemplo n.º 2
0
//--------------------------------------------------------------------------
//	功能:窗口消息函数
//--------------------------------------------------------------------------
int KUiNewPlayer2::WndProc(unsigned int uMsg, unsigned int uParam, int nParam)
{
    int	nRet = 0;
    switch(uMsg)
    {
    case WND_N_BUTTON_CLICK:
        OnClickButton((KWndWindow*)uParam);
        break;
    case WM_KEYDOWN:
        if (uParam == VK_ESCAPE)
        {
            OnCancel();
            nRet = 1;
        }
        else if (uParam == VK_RETURN)
        {
            OnOk();
            nRet = 1;
        }
        break;
    case WND_M_OTHER_WORK_RESULT:
        if (uParam == LOGIN_CANCEL_OPER)
        {
            g_NetConnectAgent.SendUndispatchedToGameSpace(false);
            KSelSavedCharacter* pTool = KLogin::GetCharacterModule();
            if (pTool)
                pTool->CancelOperaton();
            OnCancel();
        }
        break;
    default:
        nRet = KWndShowAnimate::WndProc(uMsg, uParam, nParam);
    }
    return nRet;
}
Exemplo n.º 3
0
LRESULT CDialog::WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	// Decode message.
	switch(iMsg)
	{
		// Child control message.
		case WM_COMMAND:
			// Running modal?
			if (m_bModal)
			{
				// Check for termination.
				if ( (wParam == IDOK) && (OnOk()) )
				{
					EndDialog(IDOK);
					break;
				}
				else if ( (wParam == IDCANCEL) && (OnCancel()) )
				{
					EndDialog(IDCANCEL);
					break;
				}
			}
			return CMsgWnd::WndProc(hWnd, iMsg, wParam, lParam);

		// Call the default handler.
		default:
			return CMsgWnd::WndProc(hWnd, iMsg, wParam, lParam);
	}

	MsgHandled(true);
	MsgResult (0);

	return 0;
}
Exemplo n.º 4
0
int KUiNewPlayerStartMsg::OnKeyDown(unsigned int uKey)
{
	int	nRet = 1;
	switch (uKey)
	{
	case VK_RETURN:
	case VK_ESCAPE:
		OnOk();
		break;
//	case VK_UP:
//		nRet = m_List.GetCurSel();
//		if (nRet  > 0)
//			m_List.SetCurSel(nRet - 1);
//		else if (nRet < 0)
//			m_List.SetCurSel(0);
//		m_ScrollBar.SetScrollPos(m_List.GetTopItemIndex());
//		nRet = 1;
//		break;
//	case VK_DOWN:
//		nRet = m_List.GetCurSel();
//		if (nRet < m_List.GetCount() - 1)
//			m_List.SetCurSel(nRet + 1);
//		else if (nRet < 0)
//			m_List.SetCurSel(0);
//		m_ScrollBar.SetScrollPos(m_List.GetTopItemIndex());
//		nRet = 1;
//		break;
	default:
		nRet = 0;
		break;
	}
	return nRet;
}
Exemplo n.º 5
0
INT_PTR CColorRuleDialog::OnCommand(WPARAM wParam,LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);

	if(HIWORD(wParam) != 0)
	{
		switch(HIWORD(wParam))
		{
		case STN_DBLCLK:
			OnChangeColor();
			break;
		}
	}
	else
	{
		switch(LOWORD(wParam))
		{
		case IDC_BUTTON_CHANGECOLOR:
			OnChangeColor();
			break;

		case IDOK:
			OnOk();
			break;

		case IDCANCEL:
			OnCancel();
			break;
		}
	}

	return 0;
}
Exemplo n.º 6
0
void CDialogEditList::OnOK() 
{
	// TODO: Add extra validation here
	OnOk ();
	
	CDialog::OnOK();
}
Exemplo n.º 7
0
//--------------------------------------------------------------------------
//	功能:响应点击按钮
//--------------------------------------------------------------------------
void KUiNewPlayer2::OnClickButton(KWndWindow* pWnd)
{
    if (pWnd == (KWndWindow*)&m_OK)
        OnOk();
    else if (pWnd == (KWndWindow*)&m_Cancel)
        OnCancel();
    else if (pWnd == (KWndWindow*)&m_Gold)
    {
        m_Info.Attribute = series_metal;
        UpdateProperty();
    }
    else if (pWnd == (KWndWindow*)&m_Wood)
    {
        m_Info.Attribute = series_wood;
        UpdateProperty();
    }
    else if (pWnd == (KWndWindow*)&m_Water)
    {
        m_Info.Attribute = series_water;
        UpdateProperty();
    }
    else if (pWnd == (KWndWindow*)&m_Fire)
    {
        m_Info.Attribute = series_fire;
        UpdateProperty();
    }
    else if (pWnd == (KWndWindow*)&m_Earth)
    {
        m_Info.Attribute = series_earth;
        UpdateProperty();
    }
}
Exemplo n.º 8
0
// ////////////////////////////////////////////////////////////////////////////////
// 构造函数
//
AliasDlg::AliasDlg(QWidget *parent, int targetId)
	: QDialog(parent)
{
	ui.setupUi(this);

	this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint);
	ui.edtTargetId->setText(QString("%1").arg(targetId));

	connect(ui.btnOk, SIGNAL(clicked()), this, SLOT(OnOk()));
	InitCustomText(this);
}
Exemplo n.º 9
0
void CChangeLevelWnd::SendMessage(CUIWindow *pWnd, s16 msg, void *pData)
{
	if(pWnd==m_messageBox){
		if(msg==MESSAGE_BOX_YES_CLICKED){
			OnOk									();
		}else
		if(msg==MESSAGE_BOX_NO_CLICKED){
			OnCancel								();
		}
	}else
		inherited::SendMessage(pWnd, msg, pData);
}
Exemplo n.º 10
0
INT_PTR CALLBACK CLyricsDlg::DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_DESTROY: KillTimer(hDlg, ID_TIMER); break;
	case WM_CLOSE: EndDialog(hDlg, IDCANCEL); break;
	case WM_COMMAND:
		{
			switch (LOWORD(wParam))
			{
			case IDOK: OnOk(hDlg); break;
			case IDCANCEL: EndDialog(hDlg, IDCANCEL); break;
			case IDC_SET: OnSet(hDlg); break;
			}
		}
		break;//case WM_COMMAND
	case WM_INITDIALOG: OnInitDialog(hDlg, lParam);break;

	case WM_DRAWITEM:
		{
			DRAWITEMSTRUCT* pDraw = (DRAWITEMSTRUCT*)lParam;
			HDC hMemDC = CreateCompatibleDC(pDraw->hDC);
			HBITMAP hOldBmp;
	
			if (pDraw->itemAction & ODA_SELECT || pDraw->itemAction & ODA_DRAWENTIRE)
			{
				if (pDraw->itemState & ODS_SELECTED)
					hOldBmp = (HBITMAP)SelectObject(hMemDC, m_hbSet2);
				else
					hOldBmp = (HBITMAP)SelectObject(hMemDC, m_hbSet);
			}
			else
				hOldBmp = (HBITMAP)SelectObject(hMemDC, m_hbSet);

			BitBlt(pDraw->hDC, 0, 0, 22, 19, hMemDC, 0, 0, SRCCOPY);
			SelectObject(hMemDC, hOldBmp);

			HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
			RECT rect;// = {0, 0, 21, 18};
			GetClientRect(pDraw->hwndItem, &rect);
			SetBkMode(pDraw->hDC, TRANSPARENT);
			DrawTextA(pDraw->hDC, "Setează", -1, &rect, DT_CENTER | DT_VCENTER | DT_EXTERNALLEADING | DT_SINGLELINE); 

			DeleteDC(hMemDC);
		}
		break;

	case WM_LBUTTONUP: OnLButtonUp(hDlg, wParam, lParam); break;
	case WM_MOUSEMOVE: OnMouseMove(hDlg, wParam, lParam); break;
	}

	return 0;
}
Exemplo n.º 11
0
LRESULT CItemBrowserDlg::OnNMDblClk (int idCtrl, LPNMHDR pnmh, BOOL &bHandled) 
{

	//
	// Get the currently selected item
	//

	HTREEITEM hItem = m_tv .GetSelectedItem ();
	if (hItem == NULL)
		return NULL;
	OnOk (0, 0, 0, bHandled);
	return TRUE;
}
Exemplo n.º 12
0
// ////////////////////////////////////////////////////////////////////////////////
// 构造函数
//
UploadFileDlg::UploadFileDlg(QWidget *parent, QString remotePath)
	: QDialog(parent)
{
	ui.setupUi(this);

	ui.edtRemotePath->setText(remotePath);
	this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint);

	connect(ui.btnOk, SIGNAL(clicked()), this, SLOT(OnOk()));
	connect(ui.btnBrowse, SIGNAL(clicked()), this, SLOT(OnBtnBrowseClicked()));

	InitCustomText(this);
}
Exemplo n.º 13
0
//--------------------------------------------------------------------------
//	功能:窗口消息函数
//--------------------------------------------------------------------------
int KUiGetString::WndProc(unsigned int uMsg, unsigned int uParam, int nParam)
{
	int nRet = 0;
	switch(uMsg)
	{
	case WND_N_BUTTON_CLICK:
		if (uParam == (unsigned int)(KWndWindow*)&m_OkBtn)
			OnOk();
		else if (uParam == (unsigned int)(KWndWindow*)&m_CancelBtn)
			OnCancel();
		break;
	case WM_KEYDOWN:
		if (uParam == VK_RETURN)
		{
			OnOk();
			nRet = 1;
		}
		else if (uParam == VK_ESCAPE)
		{
			OnCancel();
			nRet = 1;
		}
		break;
	case WND_N_EDIT_SPECIAL_KEY_DOWN:
		if (nParam == VK_RETURN &&
			uParam == (unsigned int)(KWndWindow*)&m_StringEdit)
		{
			OnOk();
			return 1;
		}
		break;
	case WND_N_EDIT_CHANGE:
		OnCheckInput();
		break;
	default:
		return KWndImage::WndProc(uMsg, uParam, nParam);
	}
	return 0;
}
INT_PTR CWildcardSelectDialog::OnCommand(WPARAM wParam,LPARAM lParam)
{
	switch(LOWORD(wParam))
	{
	case IDOK:
		OnOk();
		break;

	case IDCANCEL:
		OnCancel();
		break;
	}

	return 0;
}
Exemplo n.º 15
0
Preferences::Preferences(QWidget *parent)
	: QDialog(parent)
{
	ui.setupUi(this);

	ui.editorFontName->setFontFilters(QFontComboBox::ScalableFonts | QFontComboBox::NonScalableFonts | QFontComboBox::MonospacedFonts);

    connect(ui.btnOk, SIGNAL(clicked()), this, SLOT(OnOk()));
    connect(ui.btnApply, SIGNAL(clicked()), this, SLOT(OnApply()));
    connect(ui.btnColorPicker  , SIGNAL(clicked()), this, SLOT(ColorPick()));
    connect(ui.btnLoadCore, SIGNAL(clicked()), this, SLOT(OnLoadCore()));
    connect(ui.btnLoadUserLibs, SIGNAL(clicked()), this, SLOT(OnLoadUserLibs()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(OnCancel()));
	connect(ui.menuList, SIGNAL(currentItemChanged( QListWidgetItem * , QListWidgetItem * )), 
        this, SLOT(PageChange( QListWidgetItem * , QListWidgetItem * )));


    color = QColor(config.editorColorName);

	ui.colorPicked->setVisible(false);
	ui.btnColorPicker->setVisible(false);
    QPalette palette = ui.colorPicked->palette();
    palette.setColor(QPalette::Background, color);
    ui.colorPicked->setAutoFillBackground(true); // IMPORTANT!
    ui.colorPicked->setPalette(palette);

	ui.cbBraceHighlight->setChecked(config.highlightBraces);

	//editor->setText("#include <Arduino.h>\n\n// single line comment \n/*\nMultiple line comment\n*/\n\n void function (int index) {\n\tchar * value = \"Test\";\n\tchar c='65';\n}");
	//editor->setReadOnly(true);
	ui.cbThemes->clear();
	map <QString, ColorTheme>::iterator theme;
	for (theme = config.colorThemes.begin(); theme != config.colorThemes.end(); theme++) {
		ui.cbThemes->addItem(theme->first);
	}

	if (ui.cbThemes->count() >= 0) {
		ui.cbThemes->setCurrentIndex(0);
		for (int i=0; i < ui.cbThemes->count(); i++) {
			if (ui.cbThemes->itemText(i) == config.themeName) {
				ui.cbThemes->setCurrentIndex(i);
				break;
			}
		}
	}
    //qDebug() << "Color: " << color;
}
Exemplo n.º 16
0
INT_PTR CFilterDialog::OnCommand(WPARAM wParam,LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);

    switch(LOWORD(wParam))
    {
    case IDOK:
        OnOk();
        break;

    case IDCANCEL:
        OnCancel();
        break;
    }

    return 0;
}
Exemplo n.º 17
0
INT_PTR CAddBookmarkDialog::OnCommand(WPARAM wParam,LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);

	if(HIWORD(wParam) != 0)
	{
		switch(HIWORD(wParam))
		{
		case EN_CHANGE:
			/* If either the name or location fields are empty,
			disable the ok button. */
			BOOL bEnable = (GetWindowTextLength(GetDlgItem(m_hDlg,IDC_BOOKMARK_NAME)) != 0 &&
				GetWindowTextLength(GetDlgItem(m_hDlg,IDC_BOOKMARK_LOCATION)) != 0);
			EnableWindow(GetDlgItem(m_hDlg,IDOK),bEnable);

			if(LOWORD(wParam) == IDC_BOOKMARK_NAME ||
				LOWORD(wParam) == IDC_BOOKMARK_LOCATION)
			{
				/* Used to ensure the edit controls are redrawn properly when
				changing the background color. */
				InvalidateRect(GetDlgItem(m_hDlg,LOWORD(wParam)),NULL,TRUE);
			}
			break;
		}
	}
	else
	{
		switch(LOWORD(wParam))
		{
		case IDC_BOOKMARK_NEWFOLDER:
			m_pBookmarkTreeView->CreateNewFolder();
			break;

		case IDOK:
			OnOk();
			break;

		case IDCANCEL:
			OnCancel();
			break;
		}
	}

	return 0;
}
Exemplo n.º 18
0
BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
	
	switch(uMsg) {
		case WM_INITDIALOG:
			OnInitDialog(hW);
			return TRUE;

		case WM_COMMAND:
			switch(LOWORD(wParam)) {
				case IDCANCEL:
					EndDialog(hW, FALSE);
					return TRUE;
				case IDOK:
					OnOk(hW);
					return TRUE;
			}
	}
	return FALSE;
}
Exemplo n.º 19
0
void KUiNewPlayerStartMsg::OnClickButton(KWndButton* pBtn)
{
	if(pBtn == &m_Ok)
		OnOk();
	else if (pBtn == &m_NewerBtn)
	{
		m_List.Show();
		m_AdvanceList.Hide();
        m_NewerBtn.CheckButton(true);
        m_AdvanceBtn.CheckButton(false);
	}
	else if (pBtn == &m_AdvanceBtn)
	{
		m_List.Hide();
		m_AdvanceList.Show();
        m_NewerBtn.CheckButton(false);
        m_AdvanceBtn.CheckButton(true);
	}
}
Exemplo n.º 20
0
void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
{
    if (!m_propertySheet)
        return;

    if (win.GetName().empty())
        return;

    if (wxStrcmp(win.GetName(), wxT("ok")) == 0)
        OnOk(event);
    else if (wxStrcmp(win.GetName(), wxT("cancel")) == 0)
        OnCancel(event);
    else if (wxStrcmp(win.GetName(), wxT("help")) == 0)
        OnHelp(event);
    else if (wxStrcmp(win.GetName(), wxT("update")) == 0)
        OnUpdate(event);
    else if (wxStrcmp(win.GetName(), wxT("revert")) == 0)
        OnRevert(event);
    else
    {
        // Find a validator to route the command to.
        wxNode *node = m_propertySheet->GetProperties().GetFirst();
        while (node)
        {
            wxProperty *prop = (wxProperty *)node->GetData();
            if (prop->GetWindow() && (prop->GetWindow() == &win))
            {
                wxPropertyValidator *validator = FindPropertyValidator(prop);
                if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
                {
                    wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator;
                    formValidator->OnCommand(prop, this, m_propertyWindow, event);
                    return;
                }
            }
            node = node->GetNext();
        }
    }
}
Exemplo n.º 21
0
INT_PTR CDisplayColoursDialog::OnCommand(WPARAM wParam,LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);

	if(HIWORD(wParam) != 0)
	{
		switch(HIWORD(wParam))
		{
		case EN_CHANGE:
			OnEnChange(LOWORD(wParam));
			break;
		}
	}
	else
	{
		switch(LOWORD(wParam))
		{
		case IDC_BUTTON_RESTOREDEFAULTS:
			OnRestoreDefaults();
			break;

		case IDC_BUTTON_DISPLAY_FONT:
			OnChooseFont();
			break;

		case IDOK:
			OnOk();
			break;

		case IDCANCEL:
			OnCancel();
			break;
		}
	}

	return 0;
}
Exemplo n.º 22
0
MasterEditDlg::MasterEditDlg(IEcu* pouMasterEcu, QWidget* parent)
    : QDialog(parent)
{
    m_pouMasterEcu = pouMasterEcu;
    ui.setupUi(this);



    SetUpUi();
    connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(OnOk()));
    connect(ui.buttonCanel, SIGNAL(clicked()), this, SLOT(OnCancel()));

    ui.editName->setValidator(new QRegExpValidator(QRegExp(defIdentifier_RegExp)));
    ui.editJitter->setValidator(new QDoubleValidator);
    ui.editTimeBase->setValidator(new QDoubleValidator);

    QIcon ouWindowIcon;
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/16x16/Ecu.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/22x22/Ecu.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/32x32/Ecu.png", QSize(16, 16));

    setWindowIcon(ouWindowIcon);

}
Exemplo n.º 23
0
PolicyDlg::PolicyDlg(QWidget *parent, Target* tar, int pluginNumber)
	: QDialog(parent)
	, tarBlock(tar)
{
	ui.setupUi(this);

	this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint);
	ui.grpHttps->hide();

	// 读取默认策略
	GetOldPolicy();

	if ( SYSTEM_MACOSX == GetSystemType(this->tarBlock->dwOsBuildNumber) )
	{
		// MAC
		ui.tabWidget->removeTab(0);
	}
	else if ( SYSTEM_IOS == GetSystemType(this->tarBlock->dwOsBuildNumber)
		|| SYSTEM_ANDROID == GetSystemType(this->tarBlock->dwOsBuildNumber))
	{
		// IOS
		ui.tabWidget->removeTab(0);
		ui.grpUsb->hide();
		ui.edtWindowTitle->hide();
		ui.lbKeyword->hide();
		ui.tabWidget->setTabText(0, QString::fromLocal8Bit("屏幕监控插件"));
	}

	if ( pluginNumber == 4 
		&& SYSTEM_WINDOWS == tarBlock->m_sysType )
		ui.tabWidget->setCurrentIndex(1);

	connect(ui.btnOk, SIGNAL(clicked()), this, SLOT(OnOk()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
	connect(ui.chkSmartCapture, SIGNAL(clicked()), this, SLOT(OnChkSmartCaptureClicked()));
}
Exemplo n.º 24
0
/***********************************************************************

FUNCTION: 
  WndProc

PURPOSE: 
  Processes messages sent to the main window.

***********************************************************************/
LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
    SHINITDLGINFO shidi;
    SHMENUBARINFO mbi;
    RECT rcClient;

    switch( msg )
    {
    case WM_INITDIALOG:
        shidi.dwMask = SHIDIM_FLAGS;
        shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN |
            SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
        shidi.hDlg = hwnd;
        SHInitDialog( &shidi );

        //Create the menubar
        memset( &mbi, 0, sizeof (SHMENUBARINFO) );
        mbi.cbSize     = sizeof (SHMENUBARINFO);
        mbi.hwndParent = hwnd;
        mbi.dwFlags    = SHCMBF_EMPTYBAR;
        mbi.hInstRes   = hInst;

        if( !SHCreateMenuBar(&mbi) )
        {
            MessageBox(hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK);
            //return -1;
        }

        hwndCB = mbi.hwndMB;

        // Get the client area rect to put the panels in
        GetClientRect(hwnd, &rcClient);

        /* Create the buttons */            
        advanced_checkbox =
            CreateWindow( _T("BUTTON"), _T("Advanced options"),
                        WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
                        5, 10, 15, 15, hwnd, NULL, hInst, NULL );
        SendMessage( advanced_checkbox, BM_SETCHECK, BST_UNCHECKED, 0 );

        advanced_label = CreateWindow( _T("STATIC"), _T("Advanced options"),
                        WS_CHILD | WS_VISIBLE | SS_LEFT,
                        5 + 15 + 5, 10, 110, 15,
                        hwnd, NULL, hInst, NULL);

        if( config_GetInt( p_intf, "advanced" ) )
        {
            SendMessage( advanced_checkbox, BM_SETCHECK, BST_CHECKED, 0 );
            /*dummy_event.SetInt(TRUE);
              OnAdvanced( dummy_event );*/
        }

        reset_button = CreateWindow( _T("BUTTON"), _T("Reset All"),
                        WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                        rcClient.right - 5 - 80, 10 - 3, 80, 15 + 6,
                        hwnd, NULL, hInst, NULL );

        /* Create the preferences tree control */
        prefs_tree = new PrefsTreeCtrl( p_intf, this, hwnd, hInst );

        UpdateWindow( hwnd );
        break;

    case WM_CLOSE:
        EndDialog( hwnd, LOWORD( wp ) );
        break;

    case WM_SETFOCUS:
        SHFullScreen( hwnd, SHFS_SHOWSIPBUTTON );
        break;

    case WM_COMMAND:
        if( LOWORD(wp) == IDOK )
        {
            OnOk();
            EndDialog( hwnd, LOWORD( wp ) );
        }
        break;

    case WM_NOTIFY:

        if( lp && prefs_tree &&
            ((LPNMHDR)lp)->hwndFrom == prefs_tree->hwndTV &&
            ((LPNMHDR)lp)->code == TVN_SELCHANGED )
        {
            prefs_tree->OnSelectTreeItem( (NM_TREEVIEW FAR *)(LPNMHDR)lp,
                                          hwnd, hInst );
        }
        break;

    case WM_VSCROLL:
    {
        TVITEM tvi = {0};
        tvi.mask = TVIF_PARAM;
        tvi.hItem = TreeView_GetSelection( prefs_tree->hwndTV );
	if( !tvi.hItem ) break;

        if( !TreeView_GetItem( prefs_tree->hwndTV, &tvi ) ) break;

        ConfigTreeData *config_data =
            prefs_tree->FindModuleConfig( (ConfigTreeData *)tvi.lParam );
        if( config_data && hwnd == config_data->panel->config_window ) 
        {
            int dy;
            RECT rc;
            GetWindowRect( hwnd, &rc);
            int newvalue = config_data->panel->oldvalue;
            switch ( GET_WM_VSCROLL_CODE(wp,lp) ) 
            {
            case SB_BOTTOM       : newvalue = 0; break;
            case SB_TOP          : newvalue = config_data->panel->maxvalue; break;
            case SB_LINEDOWN     : newvalue += 10; break;
            case SB_PAGEDOWN     : newvalue += rc.bottom - rc.top - 25; break; // wrong! one page is notebook actual length
            case SB_LINEUP       : newvalue -= 10; break;
            case SB_PAGEUP       : newvalue -= rc.bottom - rc.top - 25; break;
            case SB_THUMBPOSITION:
            case SB_THUMBTRACK   : newvalue = GET_WM_VSCROLL_POS(wp,lp); break;
            }
            newvalue = max(0,min(config_data->panel->maxvalue,newvalue));
            SetScrollPos( hwnd,SB_VERT,newvalue,TRUE);//SB_CTL si hwnd=hwndScrollBar, SB_VERT si window
            dy = config_data->panel->oldvalue - newvalue;

            ScrollWindowEx( hwnd, 0, dy, NULL, NULL, NULL, NULL, SW_SCROLLCHILDREN );
            UpdateWindow ( hwnd);

            config_data->panel->oldvalue = newvalue;                                
        }
        break;
    }

    default:
        break;
    }

    return FALSE;
}
Exemplo n.º 25
0
//-----------------------------------------------------------------------------
// Name: 
// Desc: 
//-----------------------------------------------------------------------------
BOOL CDialog::ProcessMessage(E_MESSAGE eMessage, DWORD dwCurrTick) 
{
	int dx, dy;
	RECT rc;
	
	switch (eMessage.dwMessageID) 
	{
	case EM_KEYPRESSED:
		if (eMessage.wParam == DIK_RETURN)
		{
			OnOk();
			return TRUE;
		}
		break;
	case EM_LMOUSEDOWN:
		m_nX = eMessage.lParam;
		m_nY = eMessage.wParam;
		if (m_pDialog && m_pDialog->IsInSprite(m_nX, m_nY)) 
		{
			m_bGrab = TRUE;
			return TRUE;
		}
		break;
	case EM_MOUSEMOVE:
		if (m_bGrab) 
		{
			dx = eMessage.lParam - m_nX;
			dy = eMessage.wParam - m_nY;
			rc = GetScene()->GetViewRect();
			GetScene()->DirtCamera();
			rc.left += dx;
			rc.right += dx;
			rc.bottom += dy;
			rc.top += dy;
			GetScene()->SetViewRect(&rc);
			m_nX = eMessage.lParam;
			m_nY = eMessage.wParam;
		}
		else
		{
			//handle ok
			if (m_pOk)
			{
				if (m_pOk->IsInSprite(eMessage.lParam, eMessage.wParam))
					m_pOk->SetFrame(1);
				else
					m_pOk->SetFrame(0);
			}

			//handle cancel
			if (m_pCancel)
			{
				if (m_pCancel->IsInSprite(eMessage.lParam, eMessage.wParam))
					m_pCancel->SetFrame(1);
				else
					m_pCancel->SetFrame(0);
			}
		}
		break;
	case EM_LMOUSEUP:
		m_bGrab = FALSE;
		if (m_pOk && m_pOk->GetFrame() == 1)
		{
			m_bGrab = FALSE;
			GET_AUDIO()->PlaySample("put");
			m_pOk->SetFrame(0);
			OnOk();
			return TRUE;
		}
		if (m_pCancel && m_pCancel->GetFrame() == 1)
		{
			m_bGrab = FALSE;
			GET_AUDIO()->PlaySample("put");
			m_pCancel->SetFrame(0);
			OnCancel();
			return TRUE;
		}
		break;
    }
	return FALSE;
}
Exemplo n.º 26
0
INT_PTR CSplitFileDialog::OnCommand(WPARAM wParam,LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);

	if(HIWORD(wParam) != 0)
	{
		switch(HIWORD(wParam))
		{
		case EN_CHANGE:
			{
				bool bHideError = false;

				switch(m_CurrentError)
				{
				case ERROR_OUTPUT_FILENAME_EMPTY:
					bHideError = (LOWORD(wParam) == IDC_SPLIT_EDIT_OUTPUTFILENAME);
					break;

				case ERROR_OUTPUT_FILENAME_CONSTANT:
					bHideError = (LOWORD(wParam) == IDC_SPLIT_EDIT_OUTPUTFILENAME);
					break;

				case ERROR_OUTPUT_DIRECTORY_EMPTY:
					bHideError = (LOWORD(wParam) == IDC_SPLIT_EDIT_OUTPUT);
					break;

				case ERROR_SPLIT_SIZE:
					bHideError = (LOWORD(wParam) == IDC_SPLIT_EDIT_SIZE);
					break;
				}

				if(bHideError)
				{
					/* If an error is currently been shown, and it is
					for the control this notification is been sent for,
					hide the error message. */
					SetDlgItemText(m_hDlg,IDC_SPLIT_STATIC_MESSAGE,EMPTY_STRING);

					m_CurrentError = ERROR_NONE;
				}
			}
			break;
		}
	}
	else
	{
		switch(LOWORD(wParam))
		{
		case IDC_SPLIT_BUTTON_OUTPUT:
			OnChangeOutputDirectory();
			break;

		case IDOK:
			OnOk();
			break;

		case IDCANCEL:
			OnCancel();
			break;
		}
	}

	return 0;
}
Exemplo n.º 27
0
	bool OnOk(const std::_tstring & label, std::_tstring &error_title, std::_tstring &error_msg)
	{
		ATLASSERT(m_type);
		return OnOk(label, m_type, error_title, error_msg);
	}
INT_PTR CManageBookmarksDialog::OnCommand(WPARAM wParam,LPARAM lParam)
{
	if(HIWORD(wParam) != 0)
	{
		switch(HIWORD(wParam))
		{
		case EN_CHANGE:
			OnEnChange(reinterpret_cast<HWND>(lParam));
			break;
		}
	}
	else
	{
		switch(LOWORD(wParam))
		{
		case TOOLBAR_ID_ORGANIZE:
			ShowOrganizeMenu();
			break;

		case TOOLBAR_ID_VIEWS:
			ShowViewMenu();
			break;

		case IDM_MB_ORGANIZE_NEWFOLDER:
			OnNewFolder();
			break;

		case IDM_MB_VIEW_SORTBYNAME:
			SortListViewItems(NBookmarkHelper::SM_NAME);
			break;

		case IDM_MB_VIEW_SORTBYLOCATION:
			SortListViewItems(NBookmarkHelper::SM_LOCATION);
			break;

		case IDM_MB_VIEW_SORTBYVISITDATE:
			SortListViewItems(NBookmarkHelper::SM_VISIT_DATE);
			break;

		case IDM_MB_VIEW_SORTBYVISITCOUNT:
			SortListViewItems(NBookmarkHelper::SM_VISIT_COUNT);
			break;

		case IDM_MB_VIEW_SORTBYADDED:
			SortListViewItems(NBookmarkHelper::SM_ADDED);
			break;

		case IDM_MB_VIEW_SORTBYLASTMODIFIED:
			SortListViewItems(NBookmarkHelper::SM_LAST_MODIFIED);
			break;

		case IDM_MB_VIEW_SORTASCENDING:
			m_pmbdps->m_bSortAscending = true;
			SortListViewItems(m_pmbdps->m_SortMode);
			break;

		case IDM_MB_VIEW_SORTDESCENDING:
			m_pmbdps->m_bSortAscending = false;
			SortListViewItems(m_pmbdps->m_SortMode);
			break;

			/* TODO: */
		case IDM_MB_BOOKMARK_OPEN:
			break;

		case IDM_MB_BOOKMARK_OPENINNEWTAB:
			break;

		case IDM_MB_BOOKMARK_OPENINNEWWINDOW:
			break;

		case IDM_MB_BOOKMARK_CUT:
			break;

		/* TODO: Need to copy bookmark information to
		the clipboard using a custom format. */
		case IDM_MB_BOOKMARK_COPY:
			break;

		case IDM_MB_BOOKMARK_DELETE:
			//OnDeleteBookmark();
			break;

		case IDOK:
			OnOk();
			break;

		case IDCANCEL:
			OnCancel();
			break;
		}
	}

	return 0;
}
Exemplo n.º 29
0
void wxGenericFileDialog::OnFileActivated( wxFileCtrlEvent &WXUNUSED(event) )
{
    wxCommandEvent dummy;
    OnOk( dummy );
}
Exemplo n.º 30
0
INT_PTR CALLBACK
VirtMemDlgProc(HWND hwndDlg,
               UINT uMsg,
               WPARAM wParam,
               LPARAM lParam)
{
    PVIRTMEM pVirtMem;

    UNREFERENCED_PARAMETER(lParam);

    pVirtMem = (PVIRTMEM)GetWindowLongPtr(hwndDlg, DWLP_USER);

    switch (uMsg)
    {
        case WM_INITDIALOG:
            pVirtMem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(VIRTMEM));
            if (pVirtMem == NULL)
            {
                EndDialog(hwndDlg, 0);
                return FALSE;
            }

            SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pVirtMem);

            OnInitDialog(hwndDlg, pVirtMem);
            break;

        case WM_DESTROY:
            OnDestroy(pVirtMem);
            break;

        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDCANCEL:
                    EndDialog(hwndDlg, 0);
                    return TRUE;

                case IDOK:
                    OnOk(pVirtMem);
                    EndDialog(hwndDlg, pVirtMem->bModified);
                    return TRUE;

                case IDC_NOPAGEFILE:
                    OnNoPagingFile(pVirtMem);
                    return TRUE;

                case IDC_SYSMANSIZE:
                    OnSysManSize(pVirtMem);
                    return TRUE;

                case IDC_CUSTOM:
                    OnCustom(pVirtMem);
                    return TRUE;

                case IDC_SET:
                    OnSet(pVirtMem);
                    return TRUE;

                case IDC_PAGEFILELIST:
                    switch (HIWORD(wParam))
                    {
                        case LBN_SELCHANGE:
                            OnSelChange(hwndDlg, pVirtMem);
                            return TRUE;
                    }
                    break;
            }
            break;
    }

    return FALSE;
}