home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 February / Chip_2001-02_cd1.bin / sharewar / vecad / examples / delphi / editor / DwgProc.pas next >
Encoding:
Pascal/Delphi Source File  |  2000-09-18  |  1.5 KB  |  79 lines

  1. unit DwgProc;
  2.  
  3. interface
  4. uses
  5.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  6.   OleCtnrs, StdCtrls, ExtCtrls, ComCtrls, Menus, Printers;
  7.  
  8. function MyDwgProc (hDwg,Msg,Prm1,Prm2:Integer; Prm3,Prm4:Double; Prm5:Pointer):Integer; stdcall;
  9.  
  10. implementation
  11.  
  12. uses
  13.   VecApi, Funcs, Strings;
  14.  
  15. //-------------------------------------------------------------------
  16. // Drawing's procedure
  17. //-------------------------------------------------------------------
  18. function MyDwgProc (hDwg,Msg,Prm1,Prm2:Integer; Prm3,Prm4:Double; Prm5:Pointer):Integer;
  19. begin
  20.   Result := 0;
  21.   case Msg of
  22.     VM_GETSTRING:
  23.     begin
  24.       Result := LoadString( Prm1 );
  25.     end;
  26.  
  27.     VM_OBJACTIVE:
  28.     begin
  29.       if (Prm1=VL_OBJ_PAGE) then
  30.       begin
  31.         UpdateMainTitle();
  32.       end
  33.     end;
  34.  
  35.     VM_DWGLOADED:
  36.     begin
  37.       UpdateMainTitle();
  38.     end;
  39.  
  40.     VM_DWGSAVED:
  41.     begin
  42.       UpdateMainTitle();
  43.     end;
  44.  
  45.     VM_DWGSELECT:
  46.     begin
  47.       UpdateMainTitle();
  48.     end;
  49. {
  50.     case VM_DWGLOADING:
  51.     case VM_DWGSAVING:
  52.       _stprintf( szStr, _T("Loading: %d%%"), Prm1 );
  53.       vlStatBarSetText( VL_SB_COORD, szStr );
  54.       break;
  55. }
  56.  
  57.     VM_EXECUTE:
  58.     begin
  59.       if ((Prm2<>0) and ((Prm1=VC_FILE_NEW) or (Prm1=VC_FILE_OPEN))) then
  60.       begin
  61.         case Prm1 of
  62.           VC_FILE_NEW:
  63.           begin
  64.             FileNew();
  65.           end;
  66.           VC_FILE_OPEN:
  67.           begin
  68.             FileOpen();
  69.           end;
  70.         end;
  71.       end
  72.     end;
  73.   end;
  74. end;
  75.  
  76.  
  77.  
  78. end.
  79.