The R Project SVN R

Rev

Rev 37809 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37809 Rev 37814
Line 352... Line 352...
352
 
352
 
353
	d->hit = value;
353
	d->hit = value;
354
	hide(w);
354
	hide(w);
355
}
355
}
356
 
356
 
357
#ifndef OLD
-
 
358
 
-
 
359
static void browse_button(control c)
357
static void browse_button(control c)
360
{
358
{
361
    window w = parentwindow(c);
359
    window w = parentwindow(c);
362
    dialog_data *d = data(w);
360
    dialog_data *d = data(w);
363
    char strbuf[MAX_PATH];
361
    char strbuf[MAX_PATH];
364
    strcpy(strbuf, gettext(d->text));
362
    strcpy(strbuf, gettext(d->text));
365
    selectfolder(strbuf);
363
    selectfolder(strbuf, G_("Choose a folder"));
366
    if(strlen(strbuf)) settext(d->text, strbuf);
364
    if(strlen(strbuf)) settext(d->text, strbuf);
367
}
365
}
368
#else
-
 
369
static void browse_button(control c)
-
 
370
{
-
 
371
    window w = parentwindow(c);
-
 
372
    dialog_data *d = data(w);
-
 
373
 
-
 
374
    OPENFILENAME ofn;
-
 
375
    char strbuf[_MAX_PATH] = "anything", *p;
-
 
376
 
-
 
377
    ofn.lStructSize     = sizeof(OPENFILENAME);
-
 
378
    ofn.hwndOwner       = 0;
-
 
379
    ofn.hInstance       = 0;
-
 
380
    ofn.lpstrFilter     = "All files (*.*)\0*.*\0\0";
-
 
381
    ofn.lpstrCustomFilter = NULL;
-
 
382
    ofn.nMaxCustFilter  = 0;
-
 
383
    ofn.nFilterIndex    = 0;
-
 
384
    ofn.lpstrFile       = strbuf;
-
 
385
    ofn.nMaxFile        = _MAX_PATH;
-
 
386
    ofn.lpstrFileTitle  = NULL;
-
 
387
    ofn.nMaxFileTitle   = _MAX_FNAME + _MAX_EXT;
-
 
388
    ofn.lpstrInitialDir = gettext(d->text);
-
 
389
    ofn.lpstrTitle      = G_("Select working directory");
-
 
390
    ofn.Flags           = OFN_HIDEREADONLY;
-
 
391
    ofn.nFileOffset     = 0;
-
 
392
    ofn.nFileExtension  = 0;
-
 
393
    ofn.lpstrDefExt     = "";
-
 
394
    ofn.lCustData       = 0L;
-
 
395
    ofn.lpfnHook        = NULL;
-
 
396
    ofn.lpTemplateName  = NULL;
-
 
397
 
-
 
398
    if(GetSaveFileName(&ofn) && strlen(strbuf)) {
-
 
399
	 p = strrchr(strbuf,'\\'); if(p) *p ='\0';
-
 
400
	 settext(d->text, strbuf);
-
 
401
    }
-
 
402
}
-
 
403
#endif
-
 
404
 
366
 
405
static void hit_key(window w, int key)
367
static void hit_key(window w, int key)
406
{
368
{
407
	button btn;
369
	button btn;
408
	char *name = NULL;
370
	char *name = NULL;