home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / packages / win32ada / data.z / wxform_util.ads < prev    next >
Encoding:
Text File  |  1996-03-21  |  5.2 KB  |  148 lines

  1. -- $Source: /home/harp/1/proto/monoBANK/winnt/wxform_util.ads,v $ 
  2. -- $Revision: 1.5 $ $Date: 96/03/21 12:15:49 $ $Author: stm $ 
  3.  
  4.  
  5. with Win32;       use Win32;
  6. with Win32.WinDef;  use Win32.WinDef;
  7. with Win32.WinUser;
  8. with Win32.WinGdi;
  9.  
  10. with Interfaces.C.Strings;
  11. with Ada.Unchecked_Conversion;
  12.  
  13.  
  14. package Wxform_Util is
  15.  
  16.   -- /* dialog id's for the Transform dialog */
  17.   IDD_EM11     : constant :=   101;
  18.   IDD_EM12     : constant :=   102;
  19.   IDD_EDX      : constant :=   103;
  20.   IDD_EM21     : constant :=   104;
  21.   IDD_EM22     : constant :=   105;
  22.   IDD_EDY      : constant :=   106;
  23.   IDD_13       : constant :=   107;
  24.   IDD_23       : constant :=   108;
  25.   IDD_33       : constant :=   109;
  26.   IDD_SETXFORM : constant :=   110;
  27.   IDD_IDENTITY : constant :=   111;
  28.  
  29.   -- /* dialog id's for the Mouse dialog */
  30.   IDD_SCREENX : constant :=    201;
  31.   IDD_SCREENY : constant :=    202;
  32.   IDD_DEVICEX : constant :=    203;
  33.   IDD_DEVICEY : constant :=    204;
  34.   IDD_WORLDX  : constant :=    205;
  35.   IDD_WORLDY  : constant :=    206;
  36.  
  37.  
  38.   -- /* special messages for doTrackobject(). */
  39.   TROB_NEW      : constant :=    WinUser.WM_USER+1;
  40.   TROB_DELETE   : constant :=    WinUser.WM_USER+2;
  41.   TROB_PAINT    : constant :=    WinUser.WM_USER+3;
  42.   TROB_HITTEST  : constant :=    WinUser.WM_USER+5;
  43.   TROB_CENTER   : constant :=    WinUser.WM_USER+6;
  44.   TROB_SETXFORM : constant :=    WinUser.WM_USER+7;
  45.  
  46.   -- /* special user message for two of the dialogs */
  47.   WM_PUTUPFLOATS : constant := WinUser.WM_USER+1;
  48.  
  49.   -- /* Different "Track modes." */
  50.   TMNONE   : constant := 16#0000#;
  51.   TMMOVE   : constant := 16#0001#;
  52.   TMSIZEX  : constant := 16#0002#;
  53.   TMSIZEY  : constant := 16#0004#;
  54.   TMSIZEXY : constant := 16#0006#;
  55.   TMSHEARX : constant := 16#0010#;
  56.   TMSHEARY : constant := 16#0020#;
  57.   TMROTATE : constant := 16#0008#;
  58.  
  59.   -- /* misc. defines for drawing and formating */
  60.   TICKSPACE : constant := 20;
  61.   MAXCHARS  : constant := 32;
  62.   INC       : constant := 5;
  63.   GRIDCOLOR : constant := 16#01000006#;  --(COLORREF) 
  64.  
  65.   function New_LPCSTR (S: String) return Win32.LPCSTR;
  66.  
  67.   FORMATFLOAT : LPCSTR := New_LPCSTR("%1.2f");
  68.   FORMATD     : LPCSTR := New_LPCSTR("%d");
  69.  
  70.   -- /* Record for the track object.  c.f. ptoRect */
  71.   type TrackObject;
  72.   type TrackObject_Ptr is access all TrackObject;
  73.   type TrackObject is record
  74.     rect      : aliased WinDef.RECT;
  75.     xfmChange : aliased WinGdi.XFORM;  -- World coordinate transform
  76.     xfmDown   : aliased WinGdi.XFORM;  -- transform when mouse down occurs 
  77.     hdc_value : aliased HDC;
  78.     Mode      : aliased UINT;    -- TMROTATE, TMSIZEXY, TMMOVE, ...
  79.     Next      : aliased TrackObject_Ptr;
  80.   end record;
  81.  
  82.   -- /* Global variables. */
  83.   showTransform, showMouse, showHelp : BOOL;
  84.   hwndTransform, hwndMouse, hwndHelp : HWND;
  85.  
  86.   ptoRect  : TrackObject;
  87.   hInst    : HINSTANCE;
  88.   hwndMain : HWND;
  89.  
  90.   hPenGrid : HPEN;
  91.  
  92.   -- /* function prototypes. */
  93.   procedure doTrackObject (msg    : UINT;
  94.                            hwnd   : HWND;
  95.                            lParam : LONG);
  96.  
  97.   procedure MouseMove (msg      : UINT;
  98.                        hwnd     : HWND;
  99.                        location : POINT);
  100.  
  101.   procedure CenterOrigin (hWnd    : WinDef.HWND;
  102.                           the_hDc : HDC);
  103.  
  104.   function MainWndProc (hwnd    : HWND;
  105.                         message : UINT;
  106.                         wParam  : WPARAM;
  107.                         lParam  : LPARAM) return LRESULT;
  108.   pragma Convention (Stdcall, MainWndProc);
  109.  
  110.   function TransformDlgProc (hwnd    : HWND;
  111.                              message : UINT;
  112.                              wParam  : WPARAM;
  113.                              lParam  : LPARAM) return BOOL;
  114.   pragma Convention (Stdcall, TransformDlgProc); 
  115.  
  116.   function MouseDlgProc (hwnd    : HWND;
  117.                          message : UINT;
  118.                          wParam  : WPARAM;
  119.                          lParam  : LPARAM) return BOOL;
  120.   pragma Convention (Stdcall, MouseDlgProc);
  121.  
  122.   function Null_Dlgproc (hwnd    : HWND;
  123.                          message : UINT;
  124.                          wParam  : WPARAM;
  125.                          lParam  : LPARAM) return BOOL;
  126.   pragma Convention (Stdcall, Null_Dlgproc);
  127.                                                    
  128. -------------------------------------------------------------------------------
  129. --
  130. -- THIS FILE AND ANY ASSOCIATED DOCUMENTATION IS PROVIDED WITHOUT CHARGE
  131. -- "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
  132. -- BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
  133. -- FITNESS FOR A PARTICULAR PURPOSE.  The user assumes the entire risk as to
  134. -- the accuracy and the use of this file.  This file may be used, copied,
  135. -- modified and distributed only by licensees of Microsoft Corporation's
  136. -- WIN32 Software Development Kit in accordance with the terms of the 
  137. -- licensee's End-User License Agreement for Microsoft Software for the
  138. -- WIN32 Development Kit.
  139. --
  140. -- Copyright (c) Intermetrics, Inc. 1995
  141. -- Portions (c) 1985-1994 Microsoft Corporation with permission.
  142. -- Microsoft is a registered trademark and Windows and Windows NT are
  143. -- trademarks of Microsoft Corporation.
  144. --
  145. -------------------------------------------------------------------------------
  146.  
  147. end Wxform_Util;
  148.