/* This file is part of "scramble", a filter plugin for Adobe Photoshop Copyright (C) 2006-2010 Toby Thain, toby@telegraphics.com.au This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Win32 user interface routines for cross-platform plugin */ #include "world.h" #include "PIAbout.h" #include #include "scramble.h" #include "ui.h" #include "version.h" INT_PTR CALLBACK dlgproc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam); extern HANDLE hDllInstance; void DoAbout(AboutRecordPtr pb){ PlatformData *p = (PlatformData*)pb->platformData; MessageBox((HWND)p->hwnd, "Scramble, version " VERSION_STR "\n\ Copyright 2006-2010 Toby Thain .\n\ Latest version available from http://www.telegraphics.com.au/sw/\n\ Please contact the author with any bug reports, suggestions or comments.", "About Scramble", MB_APPLMODAL|MB_ICONINFORMATION|MB_OK); } INT_PTR CALLBACK dlgproc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam){ int item, cmd; static struct params *pdata; // keep "data" pointer around switch(wMsg){ case WM_INITDIALOG: centre_window(hDlg); // an equivalent function can be found in PS6 SDK, WinUtilities.cpp tile_dialog_init(hDlg, pdata = (struct params*)lParam); break; case WM_COMMAND: item = LOWORD(wParam); cmd = HIWORD(wParam); if(cmd == BN_CLICKED && !tile_dialog_item(hDlg, pdata, item)) EndDialog(hDlg, item); break; default: return false; } return true; } Boolean tile_dialog(FilterRecordPtr pb, struct params *data){ PlatformData *p = (PlatformData*)pb->platformData; return DialogBoxParam(hDllInstance, MAKEINTRESOURCE(ID_TILEDLG), (HWND)p->hwnd, dlgproc, (LPARAM)data) == IDOK; }