home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / various / msg / module1.bas next >
Encoding:
BASIC Source File  |  1995-02-26  |  2.0 KB  |  84 lines

  1. Option Explicit
  2.  
  3. Type RECT
  4.     left As Integer
  5.     Top As Integer
  6.     right As Integer
  7.     Bottom As Integer
  8. End Type
  9.  
  10. Declare Sub GetWindowRect Lib "User" (ByVal hwnd%, lpRect As RECT)
  11. Declare Function GetKeyState% Lib "User" (ByVal nVirtKey%)
  12. Declare Sub GetKeyBoardState Lib "User" (ByVal lpKeyState$)
  13. Declare Sub SetKeyboardState Lib "User" (ByVal lpKeyState$)
  14. Declare Sub SetCursorPos Lib "User" (ByVal x%, ByVal y%)
  15. Declare Function GetTextExtent& Lib "GDI" (ByVal hdc%, ByVal lpstring$, ByVal length%)
  16.  
  17. Function Getinput$ (Text As String, Validation As String, InValue As String)
  18.     Dim MStore As Integer
  19.     
  20.     MStore = Screen.MousePointer
  21.     Screen.MousePointer = 0
  22.  
  23.     MsgWin.message.Caption = Text
  24.     MsgWin.Text1.Tag = Validation
  25.     MsgWin.Text1.Text = InValue
  26.     MsgWin.Text1.Visible = True
  27.     MsgWin.Text1.SelLength = Len(InValue)
  28.  
  29.     MsgWin.Show 1
  30.     Getinput = MsgWin.Text1.Text
  31.     Unload MsgWin
  32.  
  33.  
  34. End Function
  35.  
  36. Sub message (Text As String)
  37.     MsgWin.message.Caption = Text
  38.     MsgWin.Show 1
  39.     Unload MsgWin
  40. End Sub
  41.  
  42. Function Prompt (Text As String, MsgType As Integer) As Integer
  43.     Dim MStore As Integer
  44.     
  45.  
  46.     Load MsgWin
  47.     MStore = Screen.MousePointer
  48.     Screen.MousePointer = 0
  49.  
  50.     MsgWin.message.Caption = Text
  51.     If MsgType = 1 Then
  52.     MsgWin.Button1.Caption = "&Yes"
  53.     MsgWin.Button2.Caption = "&No"
  54.     MsgWin.Button1.Visible = True
  55.     End If
  56.  
  57.     If MsgType = 2 Then
  58.     MsgWin.Button1.Caption = "&Order"
  59.     MsgWin.Button2.Caption = "&Allocate"
  60.     MsgWin.Button1.Visible = True
  61.     End If
  62.  
  63.     If MsgType = 3 Then
  64.     MsgWin.Button1.Caption = "&OK"
  65.     MsgWin.Button2.Caption = ""
  66.     MsgWin.Button1.Visible = True
  67.     End If
  68.  
  69.     If MsgType = 4 Then
  70.     MsgWin.Button1.Caption = "&No"
  71.     MsgWin.Button2.Caption = "&Yes"
  72.     MsgWin.Button1.Visible = True
  73.     End If
  74.     
  75.     MsgWin.Show 1
  76.     Prompt = Val(MsgWin.Answer.Text)
  77.     Unload MsgWin
  78.     Set MsgWin = Nothing
  79.  
  80.     Screen.MousePointer = MStore
  81.  
  82. End Function
  83.  
  84.