home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / felixcad / fcaddata.z / FLX_MAIN.LSP < prev    next >
Lisp/Scheme  |  1997-06-11  |  24KB  |  821 lines

  1. ;;; FLX_MAIN.LSP
  2. ;;; ================================================================
  3. ;;; (C)opyright FELIX Computer Aided Technologies GmbH 1995-97
  4. ;;; ================================================================
  5. ;;; Created: Jan 20, 1996 vp
  6. ;;; Changed: Sep 27, 1996 vp
  7. ;;;          Jun 10, 1997 vp: (getfiled ... 16) for 3.0
  8. ;;; ================================================================
  9. ;;; This file is called by FE_STUP.LSP
  10. ;;; Global variable FLX$DIRECTORY for application search path 
  11. ;;; is set in f#_stup.lsp
  12. ;;; ================================================================
  13.  
  14.  
  15. (if (not FLX$DIRECTORY)
  16.     (progn
  17.         (ALERT 
  18.             "Fatal Error: System's UTILS Directory not found !"
  19.         )
  20.         (exit)
  21.     )
  22. )
  23.  
  24.  
  25. ;;; ****************************************************************
  26. ;;; ****************************************************************
  27. ;;; Lisp defined COMMANDS
  28. ;;; ****************************************************************
  29. ;;; ****************************************************************
  30.  
  31. ;;; SETUP: Drawing Setup: Units, Precision
  32.  
  33. (defun C:SETUP()
  34.     (setfunhelp "C:SETUP" "SETUP")
  35.     (FLX_LOADLISP "FLX_SETUP" "_setp")
  36.     (princ)
  37. )
  38.  
  39. ;;; ================================================================
  40. ;;; FILE MENU
  41. ;;; ================================================================
  42.  
  43. ;;; FILEMAN: File Manager
  44.  
  45. (defun C:FILEMAN( / drawing_dir lib_fn)
  46.     (setfunhelp "C:FILEMAN" "Parts Library")
  47.     (defun *error*(msg) (FLX_FUNC_EXIT)(princ))
  48.     (setq drawing_dir (cdr (assoc "FCADDWG" (getenv))))
  49.     (if (setq lib_fn (findfile (strcat drawing_dir "\\drawing.plb")))
  50.        (princ) ;;; 
  51.        (setq lib_fn (getfiled "File Manager" "" "plb" 0))
  52.     )
  53.     (if lib_fn (progn
  54.       (setvar "CMDECHO" 0)
  55.       (command ".PARTLIB" lib_fn)
  56.       (setvar "CMDECHO" 1)
  57.     ))
  58.     (FLX_FUNC_EXIT)
  59.     (princ)
  60. )
  61.  
  62. (defun C:DMANAGER()
  63.     (setfunhelp "C:DMANAGER" "Parts Library")
  64.     (C:FILEMAN)
  65.     (princ)
  66. )
  67.    
  68. ;;; ----------------------------------------------------------------
  69. ;;; PALMAN: Palette Manager
  70. ;;;    The Palette Manager does not use file names, but 
  71. ;;;    verbal descriptions to load a palette
  72.  
  73. (defun C:PALMAN() 
  74.     (setfunhelp "C:PALMAN" "PALMAN")
  75.     (FLX_LOADLISP "FLX_PALMAN" "_pal")
  76.     (princ)
  77. )
  78.  
  79. ;;; ----------------------------------------------------------------
  80. ;;; Application Manager: Commands DLGEDIT, BMPEDIT etc.
  81.  
  82. (if (setq tmp (findfile (strcat FLX$DIRECTORY "flx_appm.lsp")))
  83.     (LOAD tmp)
  84. )
  85. (setq tmp nil)
  86.  
  87. ;;; ----------------------------------------------------------------
  88. ;;; LISTFILE: Display Text File in Dialog Box
  89.  
  90. (setfunhelp "C:LISTFILE" "Resource Manager")
  91.  
  92. (defun C:LISTFILE()
  93.     (if (not FLX_LISTFILE)
  94.       (load (strcat FLX$DIRECTORY "flx_lstf.lsp"))
  95.     )
  96.     (FLX_LISTFILE nil "lsp,dlg,mcr,mnu,mnp,cmd,lin,pat,*") 
  97.     (princ)
  98. )
  99.  
  100. ;;; ================================================================
  101. ;;; EDIT MENU
  102. ;;; ================================================================
  103.  
  104. ;;; COPYPROP: Copy properties from one entity to others
  105.  
  106. (defun C:COPYPROP()
  107.     (setfunhelp "C:COPYPROP" "COPYPROP")
  108.     (FLX_LOADLISP "FLX_COPYPROP" "_pcop")
  109.     (princ)
  110. )
  111.  
  112. ;;; PROPLAYER: Modify Layer Property of selected entities
  113.  
  114. (defun C:PROPLAYER()
  115.     (setfunhelp "C:PROPLAYER" "PROPLAYER")
  116.     (FLX_LOADLISP "FLX_PROPLAYER" "_play")
  117.     (princ)
  118. )
  119.  
  120. ;;; XPLODE: Filtered Explode Dialog Box
  121.  
  122. (defun C:XPLODE()
  123.     (setfunhelp "C:XPLODE" "Explode")
  124.     (FLX_LOADLISP "FLX_XPLODE" "_xpld")
  125.     (princ)
  126. )
  127.  
  128. ;;; Inquiry Commands
  129.  
  130. ;;; EINFO: Object Information Dialog 
  131.  
  132. (delcmd "EINFO") ;;; Redefined !
  133.  
  134. (defun C:EINFO()
  135.     (setfunhelp "C:EINFO" "EINFO")
  136.     (FLX_LOADLISP "FLX_EINFO" "_einf")
  137.     (princ)
  138. )
  139.  
  140. ;;; TABLES:  Drawing Table Information Dialog
  141.  
  142. (defun C:TABLES()
  143.     (setfunhelp "C:TABLES" "TABLES")
  144.     (FLX_LOADLISP "FLX_TABLES" "_tabl")
  145.     (princ)
  146. )
  147.  
  148. ;;; TABSERVICE: Table Service Dialog (added: Sept 1, 1996)
  149.  
  150. (defun C:TABSERVICE()
  151. ;;; (setfunhelp "C:TABLES" "TABLES")  ;;; ###
  152.     (FLX_LOADLISP "FLX_TABSERVICE" "_tabm")
  153.     (princ)
  154. )
  155.  
  156. ;;; ================================================================
  157. ;;; MENU DRAW 
  158. ;;; ================================================================
  159.  
  160. ;;; TRAPEZOID: Draw 2D-cone
  161.  
  162. (setfunhelp "C:TRAPEZOID" "Cone2D")
  163.  
  164. (defun C:TRAPEZOID()                 
  165.    (if (findfile "cone2d.lsp")
  166.       (progn 
  167.         (setq C:TRAPEZOID nil)
  168.         (load "cone2d.lsp")
  169.         (C:TRAPEZOID)
  170.       )
  171.       (ALERT
  172.         "File CONE2D.LSP not found in application directory!"
  173.         "Alert"
  174.         "EXCLAMATION"
  175.       )
  176.    )
  177.    (princ)
  178. )
  179.  
  180. ;;; ================================================================
  181. ;;; MENU MODIFY
  182. ;;; ================================================================
  183.  
  184. ;;; REJOIN: Rejoin broken lines or arcs. Xloaded - see below
  185.  
  186. (setfunhelp "C:REJOIN" "REJOIN")
  187.  
  188. (if C:REJOIN (xunload "rejoin.dll")) ;;; !!!
  189. (if (setq tmp (findfile (strcat FLX$DIRECTORY "rejoin.dll")))
  190.     (XLOAD tmp)
  191. )
  192. (setq tmp nil)
  193.  
  194. ;;; ================================================================
  195. ;;; MENU DETAIL
  196. ;;; ================================================================
  197.  
  198. ;;; RTEXT: Reference Text
  199.  
  200. (defun C:RTEXT()
  201.     (setfunhelp "C:RTEXT" "RTEXT")
  202.     (FLX_LOADLISP "FLX_RTEXT" "_rtxt")
  203.     (princ) 
  204. )
  205.  
  206. ;;; TCORRECT: Text Utility - Global or single line text modification
  207.  
  208. (defun C:TCORRECT()
  209.     (setfunhelp "C:TCORRECT" "TCORRECT")
  210.     (FLX_LOADLISP "FLX_TCORRECT" "_tcor")
  211.     (princ)
  212. )
  213.  
  214. ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  215. ;;; DIM:     Dimensioning Options Dialog Box  
  216. ;;; DIMDRAW: Create Dimension Dialog Box
  217. ;;; DIMEDIT: Edit Dimension Dialog Box 
  218.  
  219. (defun C:DIM()
  220.     (setfunhelp "C:DIM" "Dimensioning Summary")
  221.     (FLX_FUNC_INIT)
  222.     (if (not FLX_DIMDIALOG) (load (strcat FLX$DIRECTORY "flx_dim.lsp")) ) 
  223.     (FLX_DIMDIALOG "flx_dlg" "DIM")
  224.     (FLX_FUNC_EXIT)
  225.     (princ)
  226. )
  227.  
  228. (defun C:DIMDRAW()
  229.     (setfunhelp "C:DIMDRAW" "Dimensioning Summary")
  230.     (FLX_FUNC_INIT)
  231.     (if (not FLX_DIMDIALOG) (load (strcat FLX$DIRECTORY "flx_dim.lsp")) ) 
  232.     (FLX_DIMDIALOG "flx_dlg" "DimDraw")
  233.     (FLX_FUNC_EXIT)
  234.     (princ)
  235. )
  236.  
  237. (defun C:DIMEDIT()
  238.     (setfunhelp "C:DIMEDIT" "Dimensioning Summary")
  239.     (FLX_FUNC_INIT)
  240.     (if (not FLX_DIMDIALOG) (load (strcat FLX$DIRECTORY "flx_dim.lsp")) ) 
  241.     (FLX_DIMDIALOG "flx_dlg" "DimEdit")
  242.     (FLX_FUNC_EXIT)
  243.     (princ)
  244. )
  245.  
  246. ;;; DIMREST
  247.  
  248. (delcmd "DIMREST")   ;;; There is the DIMTYPE dialog...
  249.  
  250. ;;; DIMREST redefined:
  251.  
  252. (defun C:DIMREST()   
  253.     (setfunhelp "C:DIMREST" "Dimensioning Summary")
  254.     (FLX_LOADLISP "FLX_DIMREST" "_dim")
  255.     (princ)
  256. )
  257.  
  258. ;;; ----------------------------------------------------------------
  259.  
  260. (defun C:SPLINE()
  261. ;;; (setfunhelp "C:SPLINE" "SPLINE") ;;; ###
  262.     (FLX_LOADLISP "FLX_SPLINE" "_spln")
  263.     (princ)
  264. )
  265.  
  266. (defun C:PCURVE()
  267. ;;; (setfunhelp "C:PCURVE" "PCURVE") ;;; ###
  268.     (FLX_LOADLISP "FLX_PCURVE" "_spln")
  269.     (princ)
  270. )
  271.  
  272. ;;; ================================================================
  273. ;;; MENU PART
  274. ;;; ================================================================
  275.  
  276. ;;; LIBRARY: Call current part library
  277.  
  278. (defun C:LIBRARY( / fn) 
  279.     (setfunhelp "C:LIBRARY" "PARTLIB")
  280.     (defun *ERROR*(msg) (setvar "CMDECHO" 1)(setq *ERROR* nil)(princ))
  281.     (setvar "CMDECHO" 0)
  282.     (if FLX$CURRLIB 
  283.       (if (findfile FLX$CURRLIB)
  284.         (princ FLX$CURRLIB)
  285.         (setq FLX$CURRLIB nil) 
  286.       )
  287.     )
  288.     (if FLX$CURRLIB
  289.       (command ".PARTLIB" FLX$CURRLIB)
  290.       (progn
  291.          (C:SETLIB)
  292.          (if FLX$CURRLIB (command ".PARTLIB" FLX$CURRLIB))
  293.       )
  294.     )
  295.     (setvar "CMDECHO" 1)(setq *ERROR* nil)
  296.     (princ)
  297. )
  298.  
  299. ;;; SETLIB: Set current library for LIBRARY command
  300.  
  301. (defun C:SETLIB ( / title prevlib fn)
  302.     (setfunhelp "C:SETLIB" "PARTLIB")
  303.     (setq title "Set Current Part Library / Symbol Library")
  304.     (defun *ERROR*(msg) (setvar "CMDECHO" 1)(setq *ERROR* nil)(princ))
  305.     (setvar "CMDECHO" 0)
  306.     (setq prevlib FLX$CURRLIB)
  307.     (if (setq fn (GETFILED title (if FLX$CURRLIB FLX$CURRLIB "") "plb" 0))
  308.       (progn
  309.         (if (findfile fn)
  310.           (progn
  311.             (setq FLX$CURRLIB fn)
  312.             (princ FLX$CURRLIB)
  313.             (terpri)
  314.           )
  315.           (setq FLX$CURRLIB prevlib) ;;; else
  316.         )
  317.       )
  318.       (setq FLX$CURRLIB prevlib) ;;; else
  319.     )
  320.     (setvar "CMDECHO" 1)(setq *ERROR* nil)
  321.     (princ)
  322. )
  323.  
  324. ;;; INSERTQ: Insert Quick
  325.  
  326. (defun C:INSERTQ() 
  327.     (setfunhelp "C:INSERTQ" "QINSERT")
  328.     (FLX_FUNC_INIT)
  329.     (setvar "CMDECHO" 0)
  330.     (command ".QINSERT" "?" "_F" "1" "1" "_R" "CMDECHO-ON" "0")
  331.     (FLX_FUNC_EXIT)
  332.     (princ)
  333.  
  334. ;;; MERGE Part (File Dialog) ... 
  335.  
  336. (defun C:MERGE( / fn flag)
  337.     (setfunhelp "C:MERGE" "QINSERT")
  338.     (FLX_FUNC_INIT)
  339.     (setq flag 16) ;;; ###VP 01.05.97: 0 --> 16
  340.     (if (setq fn (GETFILED "Insert External Part File" "" "flx" flag)) 
  341.          (progn
  342.            ;;; (flxnames) (getactvp)
  343.            (setvar "CMDECHO" 0)
  344.            (command ".QINSERT" fn "_F" "1" "1" "_R" "CMDECHO-ON"  "0") 
  345.          )
  346.     )
  347.     (FLX_FUNC_EXIT)
  348.     (princ)
  349. )
  350.  
  351. ;;; ----------------------------------------------------------------
  352. ;;; ATTRIBUTE EDITING: Move, Rotate, Change value of an Attribute
  353.  
  354.  
  355. (defun C:ATTVALUE()
  356.     (setfunhelp "C:ATTVALUE" "Attribute Modification")
  357.     (FLX_LOADLISP "FLX_ATTQEDIT" "_atte")
  358.     (princ)
  359. )
  360. (defun C:ATTMOVE()
  361.     (setfunhelp "C:ATTMOVE" "Attribute Modification")
  362.     (FLX_LOADLISP "FLX_ATTMOVE" "_atte")
  363.     (princ)
  364. )
  365. (defun C:ATTROT()
  366.     (setfunhelp "C:ATTROT" "Attribute Modification")
  367.     (FLX_LOADLISP "FLX_ATTROT" "_atte")
  368.     (princ)
  369. )
  370.  
  371. ;;; ----------------------------------------------------------------
  372. ;;; ATTEXP: Export Attribute Information
  373.  
  374. (defun C:ATTEXP()
  375.     (setfunhelp "C:ATTEXP" "ATTEXP")
  376.     (FLX_LOADLISP "FLX_ATTEXP" "_aexp")
  377.     (princ)
  378. )
  379.  
  380. ;;; ================================================================
  381. ;;; MENU OPTIONS
  382. ;;; ================================================================
  383.  
  384. ;;; QLAYER: Quick Layer Modification
  385.  
  386. (defun C:QLAYER ()
  387.     (setfunhelp "C:QLAYER " "QLAYER ")
  388.     (FLX_LOADLISP "FLX_QLAYER" "_qlay")
  389.     (princ)
  390. )
  391.  
  392. ;;; ================================================================
  393. ;;; MENU VIEW
  394. ;;; ================================================================
  395.  
  396. ;;; DEFUN: Zoom to the drawings page size defined by
  397. ;;; the local system variables LIMMIN and LIMMAX
  398. ;;; No funhelp required
  399.  
  400.  
  401. (defun C:ZOOMPAGE() (ZOOMPAGE)(princ))  
  402.  
  403. (defun ZOOMPAGE()
  404.     (defun *error* (msg) (setq *error* nil) (setvar "CMDECHO" 1)(princ))
  405.     (setvar "CMDECHO" 0)
  406.     (command ".ZOOMWIN"  (getvar "LIMMIN") (getvar "LIMMAX") )
  407.     (setvar "CMDECHO" 1)
  408.     (setq *error* nil) 
  409.     (princ)
  410. )
  411.  
  412. ;;; ================================================================
  413. ;;; MENU HELP
  414. ;;; ================================================================
  415.  
  416. ;;; TUTOR
  417.  
  418. ;;; Test, if aphelp.lsp is already loaded. Otherwise load it...
  419.  
  420. (defun FLX_TUTOR_INIT( /  p_tmp temp )
  421.   (if (not APEXERCISES)(progn 
  422.     (if (setq p_tmp (findfile "aphelp.lsp")) 
  423.       (setq APT_APPATH (strcat (substr p_tmp 1 (- (strlen p_tmp) 10))))
  424.       (if (setq p_tmp (findfile 
  425.             (strcat 
  426.               (substr (setq temp (cdr (assoc "FCADCMD" (getenv)))) 1 (- (strlen temp) 8))
  427.               "TUTOR\\aphelp.lsp"
  428.             )     ;;; ### 8 = FCAD_BIN
  429.           ))
  430.         (setq APT_APPATH (strcat (substr p_tmp 1 (- (strlen p_tmp) 10))))
  431.       ) 
  432.     )
  433.     (if (not p_tmp) 
  434.        (ALERT
  435.            (if (= (getvar "LANGUAGE") 1)
  436.                "\nDatei 'aphelp.lsp' nicht gefunden!"
  437.                "\nFile 'aphelp.lsp' not found!"
  438.            ) 
  439.            "Tutor"
  440.            "STOP"
  441.        )
  442.        (load p_tmp)
  443.     )
  444.   ))
  445. )
  446.  
  447. ;;; Display Palette for Tutorial
  448.  
  449. (defun C:TUTOR() 
  450.     (FLX_TUTOR_INIT)(APTUTORIAL) 
  451.     (princ)
  452. )
  453.  
  454. ;;; Display Palette for Exercises
  455.  
  456. (defun C:EXERCISE() 
  457.     (FLX_TUTOR_INIT)(APEXERCISES)
  458.     (princ)
  459. )
  460.  
  461.  
  462.  
  463. ;;; *************************************************************************
  464. ;;; ***************************************************************
  465. ;;; GLOBAL FUNCTIONS           ************************************
  466. ;;; ***************************************************************
  467. ;;; *************************************************************************
  468.  
  469. ;;; *************************************************************************
  470. ;;; FUNCTION LIBRARY: INIT and EXIT functions & Error Handling
  471. ;;; *************************************************************************
  472.  
  473. ;;; ### DEFUN FLX_FUNC_INIT / FLX_FUNC_EXIT:
  474. ;;; ### Note: Use only with tested functions !
  475.  
  476. (defun FLX_FUNC_INIT()
  477.    (if (< (getvar "ACTDB") 0)
  478.       (progn 
  479.           (defun *error*(msg)
  480.              (setq *error* nil)  ;;; CMDECHO ?
  481.              (princ)
  482.           )
  483.           (EXIT)                    ;;; Warning: Program terminated by EXIT
  484.           (setq *error* nil)
  485.       )
  486.       (progn                        ;;; User break etc.
  487.           (defun *error*(msg) 
  488.              (setvar "CMDECHO" 1)   ;;;### !!!
  489.              (setvar "FILEDIA" 1)   ;;;### !!!
  490.              (setvar "ATTDIA" 1)    ;;;### !!!
  491.              (setq *error* nil)
  492.              (princ)
  493.           )
  494.       )     
  495.    ) 
  496.    (princ)
  497. )
  498.  
  499. ;;; ------------------------------------------------------------------------
  500.  
  501. (defun FLX_FUNC_EXIT() 
  502.    (setvar "CMDECHO" 1)
  503.    (setvar "FILEDIA" 1)
  504.    (setvar "ATTDIA" 1)   
  505.    (setq *error* nil)
  506.    (princ)
  507. )
  508.  
  509. ;;; ===============================================================
  510. ;;; PALETTE FUNCTIONS
  511.  
  512. ;;; The function PALMEMBER tests, if the filename fn is member of
  513. ;;; the currently opened palettes:
  514.  
  515. (defun PALMEMBER(fn / fn pal_list n pal pos mem_list)
  516.     (setq pal_list '() n 1)
  517.     (repeat 10
  518.        (setq pal (strcase (getvar (strcat "PALETTE" (itoa n)))))
  519.        (setq pal_list (cons pal pal_list))
  520.        (setq n (1+ n))
  521.     )
  522.     (setq pal_list (reverse pal_list))
  523.     (if  (setq mem_list (member (strcase fn) pal_list))
  524.           (setq pos (1+ (- 10 (length mem_list))))
  525.           (setq pos nil)
  526.     )
  527. )
  528.  
  529. (defun PALNEXTPOS( / pos) (setq pos (PALMEMBER "")) )
  530.  
  531. (defun PALNEXT(fn / fn fn2 pos cmdecho)
  532.     (setq cmdecho (getvar "CMDECHO"))
  533.     (if (setq fn2 (findfile fn)) 
  534.        (if (setq pos (PALMEMBER fn2))
  535.          (ALERT 
  536.             (if (= (getvar "LANGUAGE") 1) ;;; German
  537.                (strcat "Palette " fn2 "\nbereits an Position " (itoa pos) " geladen.") 
  538.                (strcat "Palette " fn2 "\nalready loaded at position " (itoa pos) ".") 
  539.             )
  540.             (if (= (getvar "LANGUAGE") 1) "Achtung" "Alert")
  541.             "EXCLAMATION"
  542.           )
  543.           (progn
  544.              (if (setq pos (PALNEXTPOS))
  545.                (setq pos (strcat "P" (itoa pos)))
  546.                (setq pos "P10")
  547.              )
  548.              (setvar "CMDECHO" 0)
  549.              (command ".PALOPEN" pos "Auto" fn2)
  550.           )
  551.         )
  552.         (ALERT 
  553.              (if (= (getvar "LANGUAGE") 1)
  554.                  (strcat "Palette " (strcase fn) " nicht gefunden!")
  555.                  (strcat "Palette " (strcase fn) " not found!")
  556.              )
  557.              (if (= (getvar "LANGUAGE") 1) "Achtung" "Alert")
  558.              "EXCLAMATION"
  559.           )
  560.     )
  561.     (setvar "CMDECHO" cmdecho)
  562.     (princ)
  563. )
  564.  
  565. ;;; ### DEFUN QPALNEXT (Temp Function, obsolete because of PALOPEN revision):
  566. ;;; ### Command for Menus, Macros: Set next free palette to specified 
  567. ;;; ### MNP file name
  568.  
  569. (defun C:QPALNEXT( / fn fn2 pos)
  570.     (setq fn (getstring (if (= (getvar "LANGUAGE") 1) "Dateiname: " "Filename: ")))
  571.     (if fn (PALNEXT fn))
  572.     (princ)
  573. )
  574.  
  575. ;;; ===============================================================
  576. ;;; DEFUN: CALL_WINEXE 
  577. ;;; ---------------------------------------------------------------
  578. ;;; Call a Windows Executable Program
  579. ;;;   (CALL_WINEXE <program_name>)
  580. ;;; Directory Search Path:
  581. ;;; - Current Directory
  582. ;;; - Windows Directory (win.com)
  583. ;;; - Windows System Directory
  584. ;;; - Directory of FCAD.EXE        
  585. ;;; - Directories as set by PATH environment variable
  586. ;;; - Mapped Network directories
  587. ;;; ---------------------------------------------------------------
  588.  
  589. (defun CALL_WINEXE(prog / prog flx_dll)
  590.    (setq flx_dll "fl_stup.dll")                
  591.    (if (findfile (strcat FLX$DIRECTORY flx_dll))
  592.       (progn
  593.          (if (not CALL_EXE)
  594.              (xload (strcat FLX$DIRECTORY flx_dll))
  595.          )
  596.          (CALL_EXE prog)
  597.          (xunload flx_dll)      
  598.       ) 
  599.       (ALERT
  600.           (if (= (getvar "LANGUAGE") 1) 
  601.               (strcat 
  602.                  "Datei "  flx_dll " nicht gefunden!"
  603.                  "\nKann Programm " (strcase prog)  " nicht ausfⁿhren!"
  604.               )
  605.               (strcat
  606.                  "File "  flx_dll " not found!"
  607.                  "\nUnable to execute program " (strcase prog)  "!"
  608.               )
  609.           )
  610.           (if (= (getvar "LANGUAGE") 1) "Achtung" "Alert")
  611.           "EXCLAMATION"
  612.       )
  613.    )
  614.    (princ)
  615. )
  616.  
  617. ;;; ===============================================================
  618.  
  619. ;;; Hourglass Cursor
  620. ;;; (HOURGLASS  <1|0> ) ; Argument: 1=On / 0=OFF 
  621.  
  622. (defun HOURGLASS (x / x)
  623.     (if (not sanduhr_on) 
  624.       (xload (strcat FLX$DIRECTORY "fl_stup.dll"))  
  625.     )
  626.     (if sanduhr_on  (if (= x 1)(sanduhr_on) (sanduhr_off)) )
  627.     (xunload "fl_stup.dll")  
  628.     (princ)
  629. )
  630.  
  631. ;;; ===============================================================
  632.  
  633. ;;; CLIPCOPY 
  634. ;;;      ... copies any string from the supplied list to the clipboard
  635. ;;; 
  636. ;;; (CLIPCOPY <string-list> )
  637.  
  638.  
  639. (defun CLIPCOPY(copylst / copylst)
  640.     (if copylst  (progn 
  641.       (if (not COPYCLIP)
  642.           (xload (strcat FLX$DIRECTORY "fl_stup.dll"))  
  643.       )
  644.       (COPYCLIP copylst)
  645.       (xunload "fl_stup")
  646.     ))
  647.     (princ)
  648. )
  649.  
  650. ;;; COPYCLIPBOARD
  651.  
  652. (defun COPYCLIPBOARD ( / lines flag1 copylst REQUEST_INIT el dlg_fname dlg_id)
  653.     (defun REQUEST_INIT()
  654.       (if FLX$WIN95 (foreach n '("IDCANCEL" "Selection" "All" "Static1")
  655.            (Dlg_TileSetFont n 2)
  656.       ))
  657.       ;;; 2=All 1=Selection 0=NOTHING
  658.       (Dlg_TileAction "IDCANCEL"  "(setq flag1 0)(Dlg_DialogDone)")
  659.       (Dlg_TileAction "Selection" "(setq flag1 1)(Dlg_DialogDone)")
  660.       (Dlg_TileAction "All"       "(setq flag1 2)(Dlg_DialogDone)")
  661.     )
  662.     (setq flag1 2 copylst '())    
  663.     (setq lines (Dlg_TileGet "ListBox1"))
  664.     (setq lines (strcat lines "\n"))
  665.     (setq lines (read (strcat "(" lines ")" )))
  666.     (if lines 
  667.       (if (FLX_DLGDSP "flx_dlg" "Request" "(princ)" "(REQUEST_INIT)") (princ)(exit))
  668.     )
  669.     (cond 
  670.      ((= flag1 1)
  671.       (foreach el lines (setq copylst (append copylst (list (nth el lst)))))
  672.      )
  673.      ((= flag1 2)
  674.       (setq copylst lst)
  675.      )
  676.     )
  677.     (if copylst (progn 
  678.       (if (not COPYCLIP)
  679.           (xload (strcat FLX$DIRECTORY "fl_stup.dll")) 
  680.       )
  681.       (COPYCLIP copylst)    
  682.       (xunload "fl_stup")
  683.     ))
  684. )
  685.  
  686. ;;; ===============================================================
  687. ;;; Lisp / FDT Loading Functions
  688.  
  689. ;;; FLX_LOADLISP <function_name> <lisp_filename>
  690.  
  691. (defun FLX_LOADLISP(func_name lisp_file / tmp func_name lisp_file)
  692.   (if (eval (read func_name))
  693.      (eval (read (strcat "(" func_name ")")))
  694.      (progn
  695.         (if (setq tmp (findfile (strcat FLX$DIRECTORY "flx" lisp_file ".lsp") ) )   
  696.            (progn 
  697.               (princ (strcat 
  698.                     (if (= (getvar "LANGUAGE") 1) "Lade " "Loading ")
  699.                     tmp "..."
  700.               ))      
  701.               (load tmp)
  702.               (princ " OK.")
  703.               (terpri)
  704.               (eval (read (strcat "(" func_name ")")))
  705.            ) 
  706.            (ALERT
  707.                (strcat 
  708.                     (if (= (getvar "LANGUAGE") 1) "Datei flx" "File flx")
  709.                     lisp_file 
  710.                     (if (= (getvar "LANGUAGE") 1) ".lsp nicht gefunden!" ".lsp not found!") 
  711.                  )
  712.                 (if (= (getvar "LANGUAGE") 1) "Achtung" "Alert")
  713.                 "EXCLAMATION"
  714.           )
  715.         )
  716.      )
  717.   )
  718.   (princ)
  719. )
  720.  
  721.  
  722. ;;; FLX_XLOAD <function> <DLL_filename> 
  723.  
  724. (defun FLX_XLOAD(s1 s2 / s1 s2)
  725.     (if (/= (type (eval (read s1))) 'EXSUBR)
  726.       (if (= (xload s2 T) T) 
  727.         (progn  (xunload s2) (xload s2))
  728.       )
  729.     )
  730. )
  731.  
  732. ;;; ===============================================================
  733. ;;; General Dialog Functions
  734.  
  735. ;;; Dlg_ListAction 
  736.  
  737. (defun Dlg_ListAction (box_id box_list / box_id box_list)
  738.     (Dlg_ListStart box_id)
  739.     (mapcar 'Dlg_ListAdd box_list)
  740.     (Dlg_ListEnd)
  741. )
  742.  
  743. ;;; Display Dialog 
  744. ;;; Note:  * from certain FCAD directory: FLX$DIRECTORY  *
  745.  
  746. (defun FLX_DLGDSP (dlg_file dlg_name callbk_new callbk_start /
  747.                          dlg_id dlg_fname lang lang1 lang2
  748.                          dlg_file1 dlg_file2 return)
  749.   
  750.     (if (= (setq lang (getvar "LANGUAGE")) 2)
  751.        (setq lang1 "" lang2 (itoa lang))
  752.        (setq lang1 (itoa lang) lang2 "")
  753.     )
  754.     (setq dlg_file1 (strcat dlg_file lang1 ".dlg"))
  755.     (setq dlg_fname (findfile (strcat FLX$DIRECTORY dlg_file1)))    
  756.     (if (not dlg_fname) (progn
  757.       (setq dlg_file2 (strcat dlg_file lang2 ".dlg"))
  758.       (setq dlg_fname (findfile (strcat FLX$DIRECTORY dlg_file2)))
  759.     ))
  760.     (if dlg_fname 
  761.       (progn
  762.         (setq dlg_id (Dlg_DialogLoad dlg_fname))
  763.         (Dlg_DialogNew dlg_name dlg_id)  ;;; ### callbk_new
  764.         (Dlg_DialogStart callbk_start)
  765.         (Dlg_DialogUnload dlg_id)
  766.         (setq return T)
  767.       )
  768.       (progn 
  769.         (ALERT 
  770.            (if (= (getvar "LANGUAGE") 1)
  771.                (strcat "Dialog Datei nicht gefunden: " dlg_file1) 
  772.                (strcat "Dialog file not found: " dlg_file1) 
  773.            )
  774.            (if (= (getvar "LANGUAGE") 1) "Achtung" "Alert")
  775.                "EXCLAMATION"
  776.         )
  777.         (setq return nil)
  778.       )
  779.     )
  780. )
  781.  
  782. ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  783.  
  784. (defun FLX_DefaultAction ()
  785.     (setq value $value data $data key $key reason $reason var_x $x var_y $y) 
  786.     (if FLX$TESTDIALOG     
  787.      (progn
  788.         (terpri)
  789.         (princ "\n$key:       ")(princ $key)
  790.         (princ " --- Type: ")   (princ (type $key))
  791.         (princ "\n$value:     ")(princ $value)
  792.         (princ " --- Type: ")   (princ (type $value))
  793.         (princ "\n   $reason: ")(princ $reason)
  794.         (princ " --- Type: ")   (princ (type $reason))
  795.         (princ "\n   $x:      ")(princ $x)
  796.         (princ " --- Type: ")   (princ (type $x))
  797.         (princ "\n   $y:      ")(princ $y)
  798.         (princ " --- Type: ")   (princ (type $y))
  799.         (princ "\n   $data:   ")(princ $data)
  800.         (princ " --- Type: ")   (princ (type $data))
  801.      )
  802.      (princ)
  803.     )
  804.     (princ)
  805. )
  806.  
  807. ;;; *************************************************************************
  808. ;;; Load additional lisp file(s)...
  809. ;;; *************************************************************************
  810.  
  811. (if (not FLX_AF)
  812.    (if (setq tmp (findfile (strcat FLX$DIRECTORY "flx_test.lsp"))) (load tmp))
  813. )
  814. (setq tmp nil)
  815.  
  816. ;;; *************************************************************************
  817.  
  818. (princ)
  819.  
  820.