Module Cursor.pkg

     1//*************************************************************************
     2//*
     3//*  Copyright (c) 1997 Data Access Corporation, Miami Florida,
     4//*  All rights reserved.
     5//*  DataFlex is a registered trademark of Data Access Corporation.
     6//*
     7//*************************************************************************
     8//*
     9//*  Module Name:
    10//*      CURSOR.PKG
    11//*
    12//*  Creator:
    13//*      MIKE-Z
    14//*
    15//*  Purpose:
    16//*
    17// 07/23/96 JJT - New Class names
    18//*************************************************************************
    19
    20Use Windows.pkg
    21Use WinUser.pkg
    22
    23// Standard Cursor IDs
    24#REPLACE IDC_ARROW          32512
    25#REPLACE IDC_IBEAM          32513
    26#REPLACE IDC_WAIT           32514
    27#REPLACE IDC_CROSS          32515
    28#REPLACE IDC_UPARROW        32516
    29#REPLACE IDC_SIZE           32640  // obsolete use IDC_SIZEALL
    30#REPLACE IDC_ICON           32641  // obsolete use IDC_ARROW
    31#REPLACE IDC_SIZENWSE       32642
    32#REPLACE IDC_SIZENESW       32643
    33#REPLACE IDC_SIZEWE         32644
    34#REPLACE IDC_SIZENS         32645
    35
    36// not in Windows 3.1
    37#replace IDC_SIZEALL         32646
    38#replace IDC_NO              32648
    39#replace IDC_APPSTARTING     32650
    40
    41#replace IDC_HAND            32649
    42#replace IDC_HELP            32651
    43
    44
    45
    46{ HelpTopic=CursorShape }
    47Class CursorShape is a DFBaseToolPanel //BasicPanel
    48
    49    Procedure Construct_Object
    50        Property Integer ClassCursorHandle 0
    51        Set Visible_State to False
    52        Set Size to 1 1
    53    End_Procedure
    54
    55    { MethodType=Property }
    56    Procedure Set Cursor Integer CursorType
    57        Integer CursorID retval hWnd
    58        Get Window_Handle To hWnd
    59        If (CursorType = 0) Begin
    60            Send Release_Mouse_Capture
    61            Move (SetClassLong(hWnd, GCL_HCURSOR, ClassCursorHandle(self))) to retval
    62            Set ClassCursorHandle to 0
    63            Send Page_Object False
    64        End
    65        Else Begin
    66            Send Page_Object True
    67            Get Window_Handle To hWnd
    68            If (ClassCursorHandle(self) = 0) ;
    69                Set ClassCursorHandle to (GetClassLong(hWnd, GCL_HCURSOR))
    70            Move (LoadCursor(0,CursorType)) to CursorID
    71            Move (SetClassLong(hWnd, GCL_HCURSOR, CursorID )) to retval
    72            Move (SetCursor(CursorID)) to retval
    73            Send Set_Mouse_Capture
    74        End
    75    End_Procedure
    76
    77    { MethodType=event Visibility=Private }
    78    Procedure Mouse_Up
    79        Integer retval
    80        Send Set_Mouse_Capture
    81        Move (SetCursor(GetClassLong(Window_Handle(self), GCL_HCURSOR))) to retval
    82    End_Procedure
    83
    84    Procedure Cursor_Wait
    85        set cursor to IDC_WAIT
    86    End_Procedure  // Cursor_Wait
    87
    88    Procedure Cursor_Ready
    89        set cursor to 0
    90    End_Procedure // Cursor_Ready
    91
    92
    93End_Class
    94