Subversion Repositories filter_foundry

Rev

Rev 489 | Rev 493 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 489 Rev 492
Line 141... Line 141...
141
        case IDOK:
141
        case IDOK:
142
#endif
142
#endif
143
                // Do a few checks first
143
                // Do a few checks first
144
                GetDlgItemTextA(dp, CATEGORYITEM, s, MAXFIELD);
144
                GetDlgItemTextA(dp, CATEGORYITEM, s, MAXFIELD);
145
                if (strlen(s) == 0) {
145
                if (strlen(s) == 0) {
146
                        simplealert((TCHAR*)TEXT("Category must not be empty!"));
146
                        simplealert_id(MSG_CATEGORY_EMPTY_ERR_ID);
147
                        return true; // don't continue (i.e. don't call EndDialog). Let the user correct the input
147
                        return true; // don't continue (i.e. don't call EndDialog). Let the user correct the input
148
                }
148
                }
149
                GetDlgItemTextA(dp, TITLEITEM, s, MAXFIELD);
149
                GetDlgItemTextA(dp, TITLEITEM, s, MAXFIELD);
150
                if (strlen(s) == 0) {
150
                if (strlen(s) == 0) {
151
                        simplealert((TCHAR*)TEXT("Title must not be empty!"));
151
                        simplealert_id(MSG_TITLE_EMPTY_ERR_ID);
152
                        return true; // don't continue (i.e. don't call EndDialog). Let the user correct the input
152
                        return true; // don't continue (i.e. don't call EndDialog). Let the user correct the input
153
                }
153
                }
154
 
154
 
155
                // The PiPL and PARM structure does only define single byte charsets
155
                // The PiPL and PARM structure does only define single byte charsets
156
                #ifdef UNICODE
156
                #ifdef UNICODE
Line 184... Line 184...
184
                        }
184
                        }
185
                }
185
                }
186
 
186
 
187
                #ifdef UNICODE
187
                #ifdef UNICODE
188
                if (unicode) {
188
                if (unicode) {
-
 
189
                        // TODO: In this message, we recommend that the user chooses character of his own charset.
-
 
190
                        // BUT: The user should actually only choose A-Z, otherwise stuff might be displayed wrong on foreign computers?!
189
                        simplewarning((TCHAR*)TEXT("The internal structures of Photoshop and Filter Factory are not compatible with Unicode characters. It is highly recommended that you only use characters of your current charset. Unicode characters will be converted into question mark symbols."));
191
                        simplewarning_id(MSG_UNICODE_DATA_WARNING_ID);
190
                }
192
                }
191
                else
193
                else
192
                #endif
194
                #endif
193
                if (extCharset) {
195
                if (extCharset) {
194
                        simplewarning((TCHAR*)TEXT("You were using characters of an extended charset. The characters might look correct on your machine, but on a machine in a different country the characters might look wrong. Please consider using the ASCII character set only (i.e. Latin characters without accent marks)."));
196
                        simplewarning_id(MSG_EXTCHARSET_DATA_WARNING_ID);
195
                }
197
                }
196
 
198
 
197
                // Now begin
199
                // Now begin
198
                memset(&gdata->parm,0,sizeof(PARM_T));
200
                memset(&gdata->parm,0,sizeof(PARM_T));
199
                GetDlgItemTextA(dp,CATEGORYITEM,gdata->parm.szCategory,MAXFIELD-4/*ProtectFlag*/);
201
                GetDlgItemTextA(dp,CATEGORYITEM,gdata->parm.szCategory,MAXFIELD-4/*ProtectFlag*/);
Line 218... Line 220...
218
                }
220
                }
219
                // Expressions
221
                // Expressions
220
                for (i = 0; i < 4; ++i) {
222
                for (i = 0; i < 4; ++i) {
221
                        if (strlen(expr[i]) >= sizeof(gdata->parm.szFormula[i])) {
223
                        if (strlen(expr[i]) >= sizeof(gdata->parm.szFormula[i])) {
222
                                if (i == 0) {
224
                                if (i == 0) {
223
                                        simplealert((TCHAR*)TEXT("Attention! The formula for channel R was too long (longer than 1023 characters) and was truncated."));
225
                                        simplealert_id(MSG_FORMULA_R_1023_TRUNCATED_ID);
224
                                }
226
                                }
225
                                else if (i == 1) {
227
                                else if (i == 1) {
226
                                        simplealert((TCHAR*)TEXT("Attention! The formula for channel G was too long (longer than 1023 characters) and was truncated."));
228
                                        simplealert_id(MSG_FORMULA_G_1023_TRUNCATED_ID);
227
                                }
229
                                }
228
                                else if (i == 2) {
230
                                else if (i == 2) {
229
                                        simplealert((TCHAR*)TEXT("Attention! The formula for channel B was too long (longer than 1023 characters) and was truncated."));
231
                                        simplealert_id(MSG_FORMULA_B_1023_TRUNCATED_ID);
230
                                }
232
                                }
231
                                else if (i == 3) {
233
                                else if (i == 3) {
232
                                        simplealert((TCHAR*)TEXT("Attention! The formula for channel A was too long (longer than 1023 characters) and was truncated."));
234
                                        simplealert_id(MSG_FORMULA_A_1023_TRUNCATED_ID);
233
                                }
235
                                }
234
                                expr[i][sizeof(gdata->parm.szFormula[i]) - 1] = '\0';
236
                                expr[i][sizeof(gdata->parm.szFormula[i]) - 1] = '\0';
235
                        }
237
                        }
236
                        strcpy(gdata->parm.szFormula[i], expr[i]);
238
                        strcpy(gdata->parm.szFormula[i], expr[i]);
237
                }
239
                }
Line 253... Line 255...
253
                #ifdef MACMACHO
255
                #ifdef MACMACHO
254
                strcat(fname, ".plugin");
256
                strcat(fname, ".plugin");
255
                #endif
257
                #endif
256
                if (putfile(
258
                if (putfile(
257
                        #ifdef MAC_ENV
259
                        #ifdef MAC_ENV
258
                        (StringPtr)_strdup("\pMake standalone filter"), // "\p" means "Pascal string"
260
                        (StringPtr)_strdup("\pMake standalone filter"), // "\p" means "Pascal string" // TODO: TRANSLATE
259
                        (StringPtr)myc2pstr(_strdup(fname)),
261
                        (StringPtr)myc2pstr(_strdup(fname)),
260
                        PS_FILTER_FILETYPE, kPhotoshopSignature, & reply, & sfr,
262
                        PS_FILTER_FILETYPE, kPhotoshopSignature, & reply, & sfr,
261
                        "8bf", "Filter plugin file (.8bf)\0*.8bf\0\0", 1
263
                        "8bf", "Filter plugin file (.8bf)\0*.8bf\0\0", 1 // TODO: TRANSLATE
262
                        #else
264
                        #else
263
                        TEXT("Make standalone filter"),
265
                        TEXT("Make standalone filter"), // TODO: TRANSLATE
264
                        fname,
266
                        fname,
265
                        PS_FILTER_FILETYPE, kPhotoshopSignature, & reply, & sfr,
267
                        PS_FILTER_FILETYPE, kPhotoshopSignature, & reply, & sfr,
266
                        TEXT("8bf"),
268
                        TEXT("8bf"),
267
                        TEXT("Filter plugin file (.8bf)\0*.8bf\0\0"), 1
269
                        TEXT("Filter plugin file (.8bf)\0*.8bf\0\0"), 1 // TODO: TRANSLATE
268
                        , (HWND)dp
270
                        , (HWND)dp
269
                        #endif
271
                        #endif
270
                )) {
272
                )) {
271
                        make_standalone(&sfr);
273
                        make_standalone(&sfr);
272
                }
274
                }