home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************/
- #include "std.h"
- #include "megatyp.h"
- #include "megacad.h"
- /**********************************************************************/
- int DrwTxt(
- void *para)
- {
- t_text *txtdata;
-
- txtdata = para;
- DrawInv(E_TXTLIN,txtdata,LMODE(0,PIX_XOR,0,0),E_TXTLIN);
- return(0);
- }
- /**********************************************************************/
- short main(
- char *filename,
- char *args )
- {
- t_text txtdata;
- char str[255];
-
- // set function text
- SetFuncText("insert text");
-
- // insert text
- if(StringInput("insert text",str,255))
- {
- // initialize the pointer for the text
- txtdata.str = str;
- // get the predefined textdata from MegaCAD
- GetTextVal(E_TXTLIN,TRUE,&txtdata);
- // set funktion text abd mouse help
- SetFuncText("set text");
- MouseHelp("set point","return",HLP_INV(0,0,0));
- // get the insert point for the text
- // the text moves now with the mouse
- if(GetPntInv(&txtdata.tx,0,DrwTxt,&txtdata))
- {
- // save element
- CreateEntity(E_TXTLIN,NULL,&txtdata);
- // ... and insert into the UNDO / REDO list
- savecount();
- }
- }
- }
- /**********************************************************************/
-