home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2001 December / pcwk12201b.iso / Reklamy / CAD-Projekt / MegaCAD-4_5 / CC / TEXT.C_ / TEXT.C
C/C++ Source or Header  |  1995-03-21  |  1KB  |  48 lines

  1. /**********************************************************************/
  2. #include "std.h"
  3. #include "megatyp.h"
  4. #include "megacad.h"
  5. /**********************************************************************/
  6. int DrwTxt(
  7.             void *para)
  8. {
  9.     t_text  *txtdata;
  10.  
  11.     txtdata = para;
  12.     DrawInv(E_TXTLIN,txtdata,LMODE(0,PIX_XOR,0,0),E_TXTLIN);
  13.     return(0);
  14. }
  15. /**********************************************************************/
  16. short main(
  17.         char *filename,
  18.         char *args )
  19. {
  20.     t_text  txtdata;
  21.     char    str[255];
  22.  
  23.     // set function text
  24.     SetFuncText("insert text");
  25.  
  26.     // insert text
  27.     if(StringInput("insert text",str,255))
  28.     {
  29.         // initialize the pointer for the text
  30.         txtdata.str = str;
  31.         // get the predefined textdata from MegaCAD
  32.         GetTextVal(E_TXTLIN,TRUE,&txtdata);
  33.         // set funktion text abd mouse help
  34.         SetFuncText("set text");
  35.         MouseHelp("set point","return",HLP_INV(0,0,0));
  36.         // get the insert point for the text
  37.         // the text moves now with the mouse
  38.         if(GetPntInv(&txtdata.tx,0,DrwTxt,&txtdata))
  39.         {
  40.             // save element
  41.             CreateEntity(E_TXTLIN,NULL,&txtdata);
  42.             // ... and insert into the UNDO / REDO list
  43.             savecount();
  44.         }
  45.     }
  46. }
  47. /**********************************************************************/
  48.