gCAD3D 2.40
gui_gtk2/gtk_dlg_files.c File Reference

File-open/save. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_umem.h"
#include <gtk/gtk.h>
#include "../gui/gui_types.h"
#include "../ut/ut_cast.h"
#include "../gui_gtk2/gtk_base.h"
#include "../gui_gtk2/gtk_entry.h"
#include "../gui_gtk2/gtk_dlg_files.h"

Functions

int GUI_file_cb_dirsym1 (void *parent, void *data)
 
int GUI_file_cb_dirsym2 (void *parent, void **data)
 
int GUI_file_cb_filt (void *parent, void *event, void *data)
 
GtkWidget * GUI_file_get ()
 
int GUI_file_open__ (char *filNam, int fSiz, char *dirNam, int dSiz, char *filterO, void *dirLst, char *title, char *filterI)
 
int GUI_file_save__ (char *filNam, int fSiz, char *dirNam, int dSiz, void *dirLst, char *title, char *filter)
 

Variables

static GtkWidget * UI_FileWin =NULL
 
int UI_fontsizX
 
int UI_fontsizY
 
GtkWidget * UI_MainWin
 
static void * UI_File_p1
 

Detailed Description

File-open/save.

=====================================================
List_functions_start:
GUI_file_open__ open file, waiting.
GUI_file_save__ save file, waiting.
GUI_file_cb_dirsym1 INTERNAL
List_functions_end:
=====================================================
needs gtk_entry

Function Documentation

int GUI_file_cb_dirsym1 ( void *  parent,
void *  data 
)

INTERNAL button DIR-SYM pressed; display content of userfile (symbol,directory) data filename with "symbol directory"-lines

int GUI_file_cb_dirsym2 ( void *  parent,
void **  data 
)
* INTERNAL
* user selection in directory-list;
* display content of selected dir. in fileChooser ..
*
int GUI_file_cb_filt ( void *  parent,
void *  event,
void *  data 
)

INTERNAL set filtertext for OPEN-Dialog

GtkWidget* GUI_file_get ( )
int GUI_file_open__ ( char *  filNam,
int  fSiz,
char *  dirNam,
int  dSiz,
char *  filterO,
void *  dirLst,
char *  title,
char *  filterI 
)
* GUI_File_open open file, waiting.
* Input:
* fSiz max size of filNam in bytes
* dSiz max size of dirNam in bytes
* dirNam directory or "." (active directory)
* dirLst NULL or filename with "symbol directory"-lines (Button DIR-SYM)
* filterI NULL or filtertext; eg "*.c";
* Output:
* filNam
* dirNam
* filterO modified filtertext or NULL
* retCode 0=OK, -1=Cancel, -2=fSiz/dSiz too small
*
* Example:
* char s1[204], s2[204]; int irc;
* strcpy(s2, ".");
* irc = GUI_file_open__ (s1, 200, s2, 200, NULL, NULL, "open", "*.c");
* if(irc) return irc;
* printf(" open |%s|%s|\n",s1,s2);
*
* TODO: case-insensitivity of filter ..
*
int GUI_file_save__ ( char *  filNam,
int  fSiz,
char *  dirNam,
int  dSiz,
void *  dirLst,
char *  title,
char *  filter 
)
* GUI_File_save save file
* Input:
* filNam file to save
* fSiz size of filNam in chars
* dirNam directory or "." (active directory)
* dSiz size of dirNam in chars
* dirLst NULL or filename with "symbol directory"-lines (Button DIR-SYM)
* filter NULL or filtertext; eg "*.c"
* Output:
* filNam
* dirNam
* retCode 0=OK, -1=Cancel, -2=fSiz/dSiz too small, -3=file does not exist
*
* TODO: case-insensitivity of filter ..
*

Variable Documentation

GtkWidget* UI_FileWin =NULL
static
int UI_fontsizX
int UI_fontsizY
GtkWidget* UI_MainWin
void* UI_File_p1
static