コード例 #1
0
void CFindTextureDlg::OnBtnApply() {
	UpdateData( TRUE );
	CRect rct;
	GetWindowRect( rct );
	SaveRegistryInfo( "Radiant::TextureFindWindow", &rct, sizeof( rct ) );
	FindReplaceTextures( m_strFind, m_strReplace, ( m_bSelectedOnly != FALSE ), ( m_bForce != FALSE ) );
}
コード例 #2
0
ファイル: FindTextureDlg.cpp プロジェクト: Izhido/qrevpak
void CFindTextureDlg::OnOK() 
{
  UpdateData(TRUE);
  CRect rct;
  GetWindowRect(rct);
  SaveRegistryInfo("Radiant::TextureFindWindow", &rct, sizeof(rct));
  FindReplaceTextures(m_strFind, m_strReplace, m_bSelectedOnly, m_bForce);
	CDialog::OnOK();
}
コード例 #3
0
static void OnOK( GtkWidget *widget, gpointer data ){
	g_dlgFind.UpdateData( TRUE );
	FindReplaceTextures( g_dlgFind.m_strFind, g_dlgFind.m_strReplace,
						 g_dlgFind.m_bSelectedOnly, g_dlgFind.m_bForce, FALSE );
	g_dlgFind.HideDlg();
}
コード例 #4
0
static void OnFind( GtkWidget *widget, gpointer data ){
	g_dlgFind.UpdateData( TRUE );
	FindReplaceTextures( g_dlgFind.m_strFind, g_dlgFind.m_strReplace,
						 g_dlgFind.m_bSelectedOnly, FALSE, TRUE );
}
コード例 #5
0
BOOL CALLBACK FindTextureDlgProc (
    HWND hwndDlg,	// handle to dialog box
    UINT uMsg,	// message
    WPARAM wParam,	// first message parameter
    LPARAM lParam 	// second message parameter
   )
{
	char findstr[256];
	char replacestr[256];

	qboolean bSelected, bForce;

	texdef_t *pt;
	pt = &g_qeglobals.d_texturewin.texdef;

	switch (uMsg)
    {
	case WM_INITDIALOG:
		// 
		g_ftexwin = hwndDlg;
		SendMessage (g_ftexwin, WM_SETREDRAW, 0, 0);

		strcpy (findstr, pt->name);
		strcpy (replacestr, pt->name);

		SetWindowText(GetDlgItem(g_ftexwin, IDC_EDIT_FIND), findstr);
		SetWindowText(GetDlgItem(g_ftexwin, IDC_EDIT_REPLACE), replacestr);

		bSelected = SendMessage(GetDlgItem(g_ftexwin, IDC_CHECK_SELECTED), BM_GETCHECK, 0, 0);
		bForce = SendMessage(GetDlgItem(g_ftexwin, IDC_CHECK_FORCE), BM_GETCHECK, 0, 0);
		return FALSE;

	case WM_COMMAND: 
		switch (LOWORD(wParam)) 
		{ 
			case IDOK:
				GetWindowText (GetDlgItem(g_ftexwin, IDC_EDIT_FIND), findstr, 255);
				strncpy (pt->name, findstr, sizeof(pt->name)-1);
				if (pt->name[0] <= ' ')
				{
					strcpy (pt->name, "none");
				}

				GetWindowText (GetDlgItem(g_ftexwin, IDC_EDIT_REPLACE), replacestr, 255);
				strncpy (pt->name, replacestr, sizeof(pt->name)-1);
				if (pt->name[0] <= ' ')
				{
					strcpy (pt->name, "none");
				}

				bSelected = SendMessage(GetDlgItem(g_ftexwin, IDC_CHECK_SELECTED), BM_GETCHECK, 0, 0);
				bForce = SendMessage(GetDlgItem(g_ftexwin, IDC_CHECK_FORCE), BM_GETCHECK, 0, 0);

				FindReplaceTextures (findstr, replacestr, bSelected, bForce);

				EndDialog(hwndDlg, 1);
				return TRUE;

			case IDCANCEL:
				EndDialog(hwndDlg, 0);
				return TRUE;
		}	
	}
	return FALSE;
}