DAS  3.1.6 - 18/09/2017
Functions | Variables
DFileMan.c File Reference

Danbo File Manager (DFM). DFM is used in old versions of the software. Now (after ver. 2.6.4) the MGUIFileManager is adopted. More...

#include <windows.h>
#include <conio.h>
#include <direct.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <fcntl.h>
#include <io.h>
#include <sys/stat.h>
#include "mgui.h"
#include "bil.h"
#include "dcldef.h"
#include "DAS_Spatram.h"
+ Include dependency graph for DFileMan.c:

Go to the source code of this file.

Functions

void ChDriveCB (MOBJECT rb, MVALUE s, void *ad)
 
void D_FInpFDCB (MOBJECT edit, char *buff, void *a)
 
void D_FMDoneCB (MOBJECT shell, void *od, void *ad)
 
void DFileType (int i)
 
void DFMCloseCB (void)
 
void DFMSelListCB (MOBJECT p, LIST_ACT *la, void *v)
 
MOBJECT MDCreateFM_Shell (int mod, int fmt)
 
void ShowFileDrive (char *idir, char *ext)
 
void txtfileEditCB (MOBJECT edit, char *text, char *ed)
 
int WhoSys (void)
 

Variables

bil BIL
 
char * DDRIVE
 
char DFMT [8]
 
char * DFNAME
 
MOBJECT DRV [26]
 
MOBJECT FList
 
int FMDONE
 
MTFont fmfont = HELV_SMALL
 
int FMINIT
 
MOBJECT lbl
 
char * OLDPATH
 
MOBJECT Row1
 
MOBJECT Row2
 
int SELDRV
 
MOBJECT tb1
 
MOBJECT txtfile
 
MOBJECT txtpath
 

Detailed Description

Danbo File Manager (DFM). DFM is used in old versions of the software. Now (after ver. 2.6.4) the MGUIFileManager is adopted.

Author
Daniele Bortoli

Definition in file DFileMan.c.

Function Documentation

§ ChDriveCB()

void ChDriveCB ( MOBJECT  rb,
MVALUE  s,
void *  ad 
)

Definition at line 126 of file DFileMan.c.

References DDRIVE, DFMT, MObjectGetText(), MObjectSetText(), SELDRV, ShowFileDrive(), txtfile, and txtpath.

Referenced by MDCreateFM_Shell().

127 {
128  int w = (int) ad;
129  char buf[64];
130 
131  if(s)
132  {
133  SELDRV = w;
134  _chdrive(w);
135  MObjectGetText(rb, buf);
136 
137  DDRIVE = buf; // = C:
138 
140 
141  sprintf(buf, "%s\\", buf); // = C:\
142  MObjectSetText(txtpath, buf);
143 
144  sprintf(buf, "%s", DFMT);
145  MObjectSetText(txtfile, buf);
146 
147 
148  }
149 
150 }
char * MObjectGetText(MOBJECT obj, char *text)
char DFMT[8]
Definition: DFileMan.c:30
void MObjectSetText(MOBJECT obj, const char *text)
void ShowFileDrive(char *idir, char *ext)
Definition: DFileMan.c:62
int SELDRV
Definition: DFileMan.c:33
char * DDRIVE
Definition: DFileMan.c:29
MOBJECT txtpath
Definition: DFileMan.c:43
MOBJECT txtfile
Definition: DFileMan.c:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_FInpFDCB()

void D_FInpFDCB ( MOBJECT  edit,
char *  buff,
void *  a 
)

Definition at line 382 of file DFileMan.c.

References DFMT, DFNAME, MObjectSetText(), ShowFileDrive(), and txtfile.

Referenced by MDCreateFM_Shell().

383 {
384  int w = (int) a, er;
385  char str[255];
386 
387  switch(w)
388  {
389  // Path
390  case 0: er = _chdir(buff);
391  if(er == 0)
392  {
393  strcpy(DFNAME, buff);
394  if(str[strlen(DFNAME) - 1] != 0x5C)
395  strcat(DFNAME, "/");
397  }
398  break;
399  // File
400  case 1: strcpy(DFNAME, buff);
402  break;
403  }
404 }
char DFMT[8]
Definition: DFileMan.c:30
void MObjectSetText(MOBJECT obj, const char *text)
char * DFNAME
Definition: DFileMan.c:32
void ShowFileDrive(char *idir, char *ext)
Definition: DFileMan.c:62
MOBJECT txtfile
Definition: DFileMan.c:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ D_FMDoneCB()

void D_FMDoneCB ( MOBJECT  shell,
void *  od,
void *  ad 
)

Definition at line 274 of file DFileMan.c.

References d_fileman::DBFILENAME, bil::DFILEM, DFMCloseCB(), MObjectGetText(), txtfile, txtpath, and d_fileman::WORKDIRECTORY.

Referenced by MDCreateFM_Shell().

275 {
276  int w = (int) ad;
277  char buff[256];
278  char str[256];
279  switch(w)
280  {
281  case 0:
282  MObjectGetText(txtpath, buff);
283  sprintf(BIL.DFILEM.WORKDIRECTORY, "%s",buff);
284  MObjectGetText(txtfile, str);
285  strcat(buff, str);
286  sprintf(BIL.DFILEM.DBFILENAME, "%s", buff);
287 
288  DFMCloseCB();
289  break;
290  case 1:
291  BIL.DFILEM.DBFILENAME[0] = 0;
292  DFMCloseCB();
293  break;
294  case 2:
295  MObjectGetText(txtpath, buff);
296  MObjectGetText(txtfile, str);
297  strcat(buff, str);
298  sprintf(BIL.DFILEM.DBFILENAME, "%s", buff);
299  DFMCloseCB();
300  break;
301 
302  }
303 }
char * MObjectGetText(MOBJECT obj, char *text)
d_fileman DFILEM
Definition: bildef.h:257
char DBFILENAME[_MAX_PATH]
Definition: bildef.h:204
void DFMCloseCB(void)
Definition: DFileMan.c:267
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
MOBJECT txtpath
Definition: DFileMan.c:43
MOBJECT txtfile
Definition: DFileMan.c:44
bil BIL
Definition: DFileMan.c:27
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ DFileType()

void DFileType ( int  i)

Definition at line 152 of file DFileMan.c.

References DFMT, FALL, FBIF, FCOL, FDAT, FELE, FFID, FMAP, FMOD, and FRIS.

Referenced by MDCreateFM_Shell().

153 {
154 
155 
156  switch((int) i)
157  {
158  case FDAT: strcpy(DFMT,"*.DAT"); break;
159  case FMAP: strcpy(DFMT,"*.MAP"); break;
160  case FELE: strcpy(DFMT,"*.ELE"); break;
161  case FALL: strcpy(DFMT,"*.*"); break;
162  case FRIS: strcpy(DFMT,"*.RIS"); break;
163  case FFID: strcpy(DFMT,"*.FIN"); break;
164  case FCOL: strcpy(DFMT,"*.COL"); break;
165  case FMOD: strcpy(DFMT,"*.MOD"); break;
166  case FBIF: strcpy(DFMT,"*.BIF"); break;
167 
168  }
169 
170 
171 
172 
173 }
#define FMAP
Definition: bildef.h:222
#define FFID
Definition: bildef.h:226
#define FMOD
Definition: bildef.h:228
#define FCOL
Definition: bildef.h:227
char DFMT[8]
Definition: DFileMan.c:30
#define FDAT
Definition: bildef.h:221
#define FRIS
Definition: bildef.h:225
#define FALL
Definition: bildef.h:224
#define FELE
Definition: bildef.h:223
#define FBIF
Definition: bildef.h:229
+ Here is the caller graph for this function:

§ DFMCloseCB()

void DFMCloseCB ( void  )

Definition at line 267 of file DFileMan.c.

References FMDONE, and FMINIT.

Referenced by D_FMDoneCB().

268 {
269 
270  FMDONE = 1;
271  FMINIT = 1;
272 }
int FMDONE
Definition: DFileMan.c:35
int FMINIT
Definition: DFileMan.c:34
+ Here is the caller graph for this function:

§ DFMSelListCB()

void DFMSelListCB ( MOBJECT  p,
LIST_ACT la,
void *  v 
)

Definition at line 175 of file DFileMan.c.

References DDRIVE, DFMT, DFNAME, LIST_ACT::item, MObjectGetText(), MObjectSetText(), ShowFileDrive(), txtfile, and txtpath.

Referenced by MDCreateFM_Shell().

176 {
177  char str[256];
178  char buf[256],buf1[256];
179  int flgbs = 0, i,STRLEN;
180 // char *path;
181  static int reent;
182  if(reent != 0 && reent != 1) reent = 0;
183  if(reent == 1) return;
184  reent = 1;
185  strcpy(str, la->item);
186 
187  if(str[0] == '[')
188  {
189  if(str[1] != '.')
190  {
191 
192  la->item[strlen(la->item) - 1] = 0;
193 
194 // MObjectGetText(DRV[SELDRV], buf);
195 
196  MObjectGetText(txtpath, buf);
197 
198  DDRIVE = buf;
199  strcpy(buf, DDRIVE);
200 
201  strcat(buf, &la->item[1]);
202  _chdir(buf);
203  strcpy(buf1,buf);
204  strcat(buf1,"\\");
205  }
206  if(str[1] == '.')
207  {
208  i=2;
209  flgbs = 0;
210  MObjectGetText(txtpath, buf);
211  STRLEN = strlen(buf);
212  do {
213  if(buf[STRLEN - i] != 0x5C)
214  {
215  buf[STRLEN - i] = 0;
216  i++;
217  }
218  else
219  {
220  flgbs = 1;
221  buf[STRLEN - i] = 0;
222 
223  }
224  }while (flgbs == 0);
225 
226 
227  _chdir(buf);
228  strcpy(buf1,buf);
229  strcat(buf1,"\\");
230 
231  }
232 // MObjectGetText(txtfile, DFMT);
233 
234  ShowFileDrive(buf, DFMT);
235 
236 
237 // if(buf[strlen(buf) - 1] != 0x5C)
238 // strcat(buf, "\\");
239 
240 
241 // MObjectSetText(txtpath, "");
242 // ShowFileDrive(buf, DFMT);
243 // MObjectSetText(txtpath, buf);
244 
245 /*
246 #ifdef _WIN32
247  if(buf[strlen(buf) - 1] != 0x5C)
248  strcat(buf, "\\");
249 #else
250  if(buf[strlen(buf) - 1] != 0x2F)
251  strcat(buf, "/");
252 #endif
253 */
254  MObjectSetText(txtpath, buf1);
255 
256 
257  }
258  else
259  {
260  strcpy(DFNAME, la->item);
262  }
263  reent = 0;
264 
265 }
char * MObjectGetText(MOBJECT obj, char *text)
char * item
Definition: Mguidefs.h:1181
char DFMT[8]
Definition: DFileMan.c:30
void MObjectSetText(MOBJECT obj, const char *text)
char * DFNAME
Definition: DFileMan.c:32
void ShowFileDrive(char *idir, char *ext)
Definition: DFileMan.c:62
char * DDRIVE
Definition: DFileMan.c:29
MOBJECT txtpath
Definition: DFileMan.c:43
MOBJECT txtfile
Definition: DFileMan.c:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateFM_Shell()

MOBJECT MDCreateFM_Shell ( int  mod,
int  fmt 
)

Definition at line 407 of file DFileMan.c.

References _MAX_PATH, CENTER_ALIGN, ChDriveCB(), D_FInpFDCB(), D_FMDoneCB(), palette::DB_BG, palette::DB_BG_Albl, palette::DB_FG_Plbl, palette::DB_UnSel, bil::DFILEM, DFileType(), DFMSelListCB(), DFMT, DPAL, DRV, False, FList, FMDONE, fmfont, FMINIT, lbl, LEFT_ALIGN, MCreateClippedEdit(), MCreateColForm(), MCreateLabel(), MCreatePButton(), MCreateRButton(), MCreateRowForm(), MCreateShell(), MCreateSList(), MCreateTableForm(), MEditSetActCallback(), MFormSetSpacing(), MLabelSetAlignment(), MLoopWhileFlag(), MObjectAlign(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetResize(), MObjectSetText(), MObjectSetUnsensitive(), MPButtonSetCallback(), MRButtonActivate(), MRButtonSetCallback(), MShellDestroy(), MShellRealizeXY(), MShellUnrealize(), MSListSetSelectionCallback(), MSListSetSortCallback(), MTableFormSetColAlign(), MTableFormSetRowAlign(), Row1, Row2, SELDRV, SF_MODAL, ShowFileDrive(), tb1, TOP_ALIGN, True, txtfile, txtpath, WhoSys(), and d_fileman::WORKDIRECTORY.

Referenced by DT_CorrFileEvora(), DT_CorrHeader(), DT_FluxIndex(), DT_LinkSpectra(), MenuFileOLP_CB(), and SetAsIo().

408 {
409  MOBJECT _colform000;
410  MOBJECT _colform001;
411 // MOBJECT _label000;
412  MOBJECT tb2;
413  MOBJECT FM_Shell;
414  MOBJECT pb;
415  char buf[256];
416  int drive, curdrive = 0, sysop;
417  char curdir[_MAX_PATH];
418 
419  DFileType(fmt);
420 
421  _getcwd( BIL.DFILEM.WORKDIRECTORY, _MAX_PATH );
422  curdrive = _getdrive();
423 
424  sysop = WhoSys();
425 
426 
427 
428  FM_Shell = MCreateShell("File Manager", SF_MODAL);//0); //SF_NO_RESIZE|SF_NO_MAXIMIZE|SF_NO_MINIMIZE);
429  MObjectSetBackgroundRGB(FM_Shell, DPAL.DB_BG[0], DPAL.DB_BG[1], DPAL.DB_BG[2]);
430 
431  _colform000 = MCreateColForm(FM_Shell);
432  MObjectAlign(_colform000, LEFT_ALIGN, TOP_ALIGN);
433  MObjectSetResize(_colform000, True, True);
434 
435  Row1 = MCreateRowForm(_colform000);
437  //MObjectSetBackgroundRGB(Row1, 149, 145, 153);
440 
441 
442 
443 /*
444  Row1 = MCreateRowForm(_colform000);
445  MObjectAlign(Row1, LEFT_ALIGN, TOP_ALIGN);
446  MObjectSetBackgroundRGB(Row1, 149, 145, 153);
447  MObjectSetResize(Row1, True, True);
448  MObjectSetCompositeWidth(Row1, 80);
449 
450  tb2 = MCreateTableForm(Row1, 2);
451  MFormSetSpacing(tb2, 1);
452  MTableFormSetColAlign(tb2, 0, LEFT_ALIGN);
453  MTableFormSetRowAlign(tb2, 1, TOP_ALIGN);
454  MObjectAlign(tb2, LEFT_ALIGN, TOP_ALIGN);
455  MObjectSetForegroundRGB(tb2, 149, 145, 153);
456  MObjectSetBackgroundRGB(tb2, 149, 145, 153);
457  MObjectSetResize(tb2, True, False);
458 */
459 
460  tb2 = MCreateTableForm(Row1, 2);
462  MObjectSetResize(tb2, True, True);
463 
464 
465 
466  for(drive = 1; drive <= 26; drive++)
467  {
468  sprintf( buf, "%c:", drive + 'A' - 1 );
469  DRV[drive] = MCreateRButton(tb2, buf, fmfont);
471 // MObjectSetCompositeWidth(DRV[drive], 150);
472  MRButtonSetCallback(DRV[drive], (OBJ_VALUE_CB) ChDriveCB, (void *) drive);
473  //controlla quali dischi sono presenti
474  if(_chdrive(drive))
475  MObjectSetUnsensitive(DRV[drive]);
476  }
477 
478  Row2 = MCreateRowForm(_colform000);
480  MObjectSetBackgroundRGB(Row2, 149, 145, 153);
482 
483 
484  FList = MCreateSList(Row2, fmfont, 255, 14, 37);
485 // MSListSetSortCallback(FList, strcmp);
486  MSListSetSortCallback(FList, stricmp);
491 // MSBLSetHead(FList, "Name " "Date " "Size");
492 
493 
494 /*
495  FList = MCreateSList(Row2, FIXED_SMALL, 256, 14, 37);
496  MObjectAlign(FList, LEFT_ALIGN, TOP_ALIGN);
497  MObjectSetForegroundRGB(FList, 255, 255, 255);
498  MObjectSetBackgroundRGB(FList, 0, 0, 0);
499  MObjectSetResize(FList, True, True);
500 */
501  _colform001 = MCreateColForm(FM_Shell);
502  MFormSetSpacing(_colform001, 1);
503  MObjectAlign(_colform001, LEFT_ALIGN, TOP_ALIGN);
504  MObjectSetResize(_colform001, True, False);
505 
506  tb1 = MCreateTableForm(_colform001, 3);
507  MFormSetSpacing(tb1, 1);
512 // MObjectSetForegroundRGB(tb1, 149, 145, 153);
515 
516  lbl = MCreateLabel(tb1, "Path:", fmfont);
519 // MObjectSetShadow(lbl, WS_SHADOW_IN, 2, 0);
521 
522  txtpath = MCreateClippedEdit(tb1, "", 255, 32, fmfont);
525  MEditSetActCallback(txtpath, D_FInpFDCB, (void *) 0);
528 
529  if(mod) // Open
530  {
531  pb = MCreatePButton(tb1, "Open", fmfont);
532  MPButtonSetCallback(pb, D_FMDoneCB, (void *) 0);
533  MObjectSetResize(pb, True, True);
535  }
536  else //Save as
537  {
538  pb = MCreatePButton(tb1, "Save As", fmfont);
539  MPButtonSetCallback(pb, D_FMDoneCB, (void *) 2);
540  MObjectSetResize(pb, True, True);
542 
543  }
544  lbl = MCreateLabel(tb1, "File:", fmfont);
549 
550  txtfile = MCreateClippedEdit(tb1, "", 255, 32, fmfont);
555  MEditSetActCallback(txtfile, D_FInpFDCB, (void *) 1);
556 
557 
558 
559  pb = MCreatePButton(tb1, "Cancel", fmfont);
560  MPButtonSetCallback(pb, D_FMDoneCB, (void *) 1);
562  MObjectSetResize(pb, True, True);
563 
564 
565 
566  MShellRealizeXY(FM_Shell, 0,0);
567 
568 
569  /* Restore original drive.*/
570  _chdrive( curdrive );
571  SELDRV = curdrive ;
572  if (sysop)
574  else
576 
577 // sprintf(curdir,"%s%s",BIL.DFILEM.WORKDIRECTORY,"\\");
578  sprintf(curdir,"%s",BIL.DFILEM.WORKDIRECTORY);
579 
580  ShowFileDrive(curdir, DFMT);
581 
582  strcat(curdir,"\\");
583  MObjectSetText(txtpath, curdir);
584 
585 
586 // MEditSetActCallback(txtfile, txtfileEditCB, curdir);
587 
588 
590 
591 
592  FMINIT = 0;
593  MLoopWhileFlag(&FMINIT, 0);
594 
595  if(FMDONE)
596  {
597  FMINIT = 0;
598  MShellUnrealize(FM_Shell);
599  MShellDestroy(FM_Shell);
600 
601  }
602 
603 
604 
605  return FM_Shell;
606 
607 }
int FMDONE
Definition: DFileMan.c:35
void ChDriveCB(MOBJECT rb, MVALUE s, void *ad)
Definition: DFileMan.c:126
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
void DFMSelListCB(MOBJECT p, LIST_ACT *la, void *v)
Definition: DFileMan.c:175
MOBJECT lbl
Definition: DFileMan.c:42
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
void MObjectSetUnsensitive(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
MOBJECT FList
Definition: DFileMan.c:40
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
#define False
Definition: Mguidefs.h:236
void MObjectAlign(MOBJECT obj, int h_align, int v_align)
MTFont fmfont
Definition: DFileMan.c:46
void MTableFormSetColAlign(MOBJECT form, int col, int al)
MOBJECT MCreateClippedEdit(MOBJECT parent, const char *text, int len, int clip_len, MTFont font)
char DFMT[8]
Definition: DFileMan.c:30
void MShellUnrealize(MOBJECT obj)
void MObjectSetText(MOBJECT obj, const char *text)
palette DPAL
Definition: 2DPlot.c:27
void MShellDestroy(MOBJECT obj)
MOBJECT MCreateTableForm(MOBJECT parent, int n_cols)
int FMINIT
Definition: DFileMan.c:34
MOBJECT Row1
Definition: DFileMan.c:37
void MRButtonSetCallback(MOBJECT button, OBJ_VALUE_CB cb, void *data)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
d_fileman DFILEM
Definition: bildef.h:257
MOBJECT DRV[26]
Definition: DFileMan.c:38
void ShowFileDrive(char *idir, char *ext)
Definition: DFileMan.c:62
#define CENTER_ALIGN
Definition: Mguidefs.h:917
int WhoSys(void)
Definition: DFileMan.c:306
MOBJECT Row2
Definition: DFileMan.c:39
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
MOBJECT MCreateSList(MOBJECT parent, MTFont font, int row_len, int nrow, int ncol)
#define SF_MODAL
Definition: Mguidefs.h:1019
void(* LIST_SEL_CB)(MOBJECT list, LIST_SEL *la, void *ad)
Definition: Mguidefs.h:1466
void MRButtonActivate(MOBJECT o)
MOBJECT MCreateColForm(MOBJECT parent)
int SELDRV
Definition: DFileMan.c:33
void MShellRealizeXY(MOBJECT obj, int x, int y)
void MSListSetSelectionCallback(MOBJECT obj, LIST_SEL_CB cb, void *data)
#define _MAX_PATH
Definition: Dildef.h:202
MOBJECT MCreateShell(const char *title, int flags)
short DB_BG[3]
Default Background Color.
MOBJECT MCreateRButton(MOBJECT parent, const char *text, MTFont font)
void MSListSetSortCallback(MOBJECT obj, STRCMP_CB cb)
void DFileType(int i)
Definition: DFileMan.c:152
void MTableFormSetRowAlign(MOBJECT form, int row, int al)
void(* OBJ_VALUE_CB)(MOBJECT obj, MVALUE value, void *ad)
Definition: Mguidefs.h:1458
void MLabelSetAlignment(MOBJECT p, int align)
MOBJECT tb1
Definition: DFileMan.c:41
void MFormSetSpacing(MOBJECT p, int offset)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
char WORKDIRECTORY[_MAX_PATH]
Definition: bildef.h:202
void D_FInpFDCB(MOBJECT edit, char *buff, void *a)
Definition: DFileMan.c:382
MOBJECT txtpath
Definition: DFileMan.c:43
short DB_UnSel[3]
Unselected Buttons Colors.
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
#define LEFT_ALIGN
Definition: Mguidefs.h:915
void D_FMDoneCB(MOBJECT shell, void *od, void *ad)
Definition: DFileMan.c:274
MOBJECT txtfile
Definition: DFileMan.c:44
void MLoopWhileFlag(int *pflag, int value)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
#define TOP_ALIGN
Definition: Mguidefs.h:918
bil BIL
Definition: DFileMan.c:27
+ Here is the caller graph for this function:

§ ShowFileDrive()

void ShowFileDrive ( char *  idir,
char *  ext 
)

Definition at line 62 of file DFileMan.c.

References _MAX_PATH, FList, MSListAddItem(), and MSListClear().

Referenced by ChDriveCB(), D_FInpFDCB(), DFMSelListCB(), MDCreateFM_Shell(), and txtfileEditCB().

63 {
64 
65  struct _finddata_t ffblk;
66  char str[_MAX_PATH];
67  int i, done, handle;
68 
70  //sprintf(str, "%s\\*.*", idir);
71  //sprintf(str, "%s\*.*", idir);
72  sprintf(str, "%s\\%s", idir, "*.*");
74 
75  handle = _findfirst(str, &ffblk);
76  i = 0;
77  // All
78  done = 0;
79  do
80  {
81 
82  done = _findnext(handle, &ffblk);
83  if(done == 0 && (ffblk.attrib & _A_SUBDIR) == _A_SUBDIR)
84  {
85  sprintf(str, "[%s]", ffblk.name);
86 
87  MSListAddItem(FList, str, (void *) i);
88  }
89  i++;
90  }while(done == 0);
91 
92 // sprintf(str, "%s\\*%s", idir, ext);
93 sprintf(str, "%s\\%s", idir, ext);
94  handle = _findfirst(str, &ffblk);
95  // Ext
96  done = 0;
97  if(strcmp(ext,"*.*") == 0)
98  {
99  do
100  {
101  done = _findnext(handle, &ffblk);
102  strcpy(str, _strupr(ffblk.name));
103 // if(strncmp(&str[strlen(str) - 4], ext, 4) == 0)
104  MSListAddItem(FList, str, (void *) i);
105  ffblk.name[0] = 0;
106  i++;
107  }while(done == 0);
108 
109  }
110  else
111  {
112  do
113  {
114  done = _findnext(handle, &ffblk);
115  strcpy(str, _strupr(ffblk.name));
116  if(strncmp(&str[strlen(str) - 4], &ext[strlen(ext) - 4], 4) == 0)
117  MSListAddItem(FList, str, (void *) i);
118  ffblk.name[0] = 0;
119  i++;
120  }while(done == 0);
121  }
122 
123 }
MOBJECT FList
Definition: DFileMan.c:40
void MSListClear(MOBJECT p)
#define _MAX_PATH
Definition: Dildef.h:202
int MSListAddItem(MOBJECT p, const char *item, void *data)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ txtfileEditCB()

void txtfileEditCB ( MOBJECT  edit,
char *  text,
char *  ed 
)

Definition at line 346 of file DFileMan.c.

References DFMT, MObjectGetText(), MObjectSetText(), ShowFileDrive(), txtfile, and txtpath.

347 {
348 
349  char buf1[255];
350  int i,flgbs,STRLEN;
351 
352 
353  sprintf(DFMT,"%s",text);
354 
355  flgbs = 0;
356  MObjectGetText(txtpath, buf1);
357  STRLEN = strlen(buf1);
358  i=1;
359  do
360  {
361  if(buf1[STRLEN - i] != 0x5C)
362  {
363  buf1[STRLEN - i] = 0;
364  i++;
365  }
366  else
367  {
368  flgbs = 1;
369  buf1[STRLEN - i] = 0;
370  }
371  }while (flgbs == 0);
372 
373 
374 
375 
376  ShowFileDrive(buf1, DFMT);
378 }
char * MObjectGetText(MOBJECT obj, char *text)
char DFMT[8]
Definition: DFileMan.c:30
void MObjectSetText(MOBJECT obj, const char *text)
void ShowFileDrive(char *idir, char *ext)
Definition: DFileMan.c:62
MOBJECT txtpath
Definition: DFileMan.c:43
MOBJECT txtfile
Definition: DFileMan.c:44
+ Here is the call graph for this function:

§ WhoSys()

int WhoSys ( void  )

Definition at line 306 of file DFileMan.c.

References BOOL, and WIN_NT.

Referenced by DB_InitCamera(), and MDCreateFM_Shell().

307 {
308 #ifdef _WIN32
309  int so;
310  OSVERSIONINFOEX osvi;
311  BOOL bOsVersionInfoEx;
312 
313  ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
314  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
315 
316  if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
317  {
318  // If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO.
319  osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
320  if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
321  return 0;
322  }
323 
324  switch (osvi.dwPlatformId)
325  {
326  // NT, 2000
327  case VER_PLATFORM_WIN32_NT:
328  so = WIN_NT;
329  break;
330  // 95, 98, Me
331  case VER_PLATFORM_WIN32_WINDOWS:
332  so = 0;
333  break;
334  // Win 32
335  case VER_PLATFORM_WIN32s:
336  so = 0;
337  break;
338  }
339  return so;
340 #else
341  return 0;
342 #endif
343 }
#define BOOL
Definition: DSCUD.H:100
#define WIN_NT
Define NT/XP/2000 and LINUX operating system (Realtime not possible).
Definition: dcldef.h:422
+ Here is the caller graph for this function:

Variable Documentation

§ BIL

bil BIL

Definition at line 27 of file DFileMan.c.

§ DDRIVE

char* DDRIVE

Definition at line 29 of file DFileMan.c.

Referenced by ChDriveCB(), and DFMSelListCB().

§ DFMT

char DFMT[8]

§ DFNAME

char* DFNAME

Definition at line 32 of file DFileMan.c.

Referenced by D_FInpFDCB(), and DFMSelListCB().

§ DRV

MOBJECT DRV[26]

Definition at line 38 of file DFileMan.c.

Referenced by MDCreateFM_Shell().

§ FList

MOBJECT FList

Definition at line 40 of file DFileMan.c.

Referenced by MDCreateFM_Shell(), and ShowFileDrive().

§ FMDONE

int FMDONE

Definition at line 35 of file DFileMan.c.

Referenced by DFMCloseCB(), and MDCreateFM_Shell().

§ fmfont

fmfont = HELV_SMALL

Definition at line 46 of file DFileMan.c.

Referenced by MDCreateFM_Shell().

§ FMINIT

int FMINIT

Definition at line 34 of file DFileMan.c.

Referenced by DFMCloseCB(), and MDCreateFM_Shell().

§ lbl

MOBJECT lbl

§ OLDPATH

char* OLDPATH

Definition at line 31 of file DFileMan.c.

§ Row1

MOBJECT Row1

Definition at line 37 of file DFileMan.c.

Referenced by MDCreateFM_Shell().

§ Row2

MOBJECT Row2

Definition at line 39 of file DFileMan.c.

Referenced by MDCreateFM_Shell().

§ SELDRV

int SELDRV

Definition at line 33 of file DFileMan.c.

Referenced by ChDriveCB(), and MDCreateFM_Shell().

§ tb1

MOBJECT tb1

Definition at line 41 of file DFileMan.c.

Referenced by CONFP_AMS(), CONFP_opt_page5(), DOAS_Plot(), MDCreateFM_Shell(), and MDCreateSh_SimPos().

§ txtfile

MOBJECT txtfile

§ txtpath

MOBJECT txtpath

Definition at line 43 of file DFileMan.c.

Referenced by ChDriveCB(), D_FMDoneCB(), DFMSelListCB(), MDCreateFM_Shell(), and txtfileEditCB().

______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:55 for DAS - Rel. 3.1.6 - 18/09/2017.