home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fgtrmrct.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
11KB
|
361 lines
VERSION 4.00
Begin VB.Form FormGetTrimRect
BorderStyle = 3 'Fixed Dialog
Caption = "Get Trim Rectangle"
ClientHeight = 5784
ClientLeft = 2892
ClientTop = 2040
ClientWidth = 6144
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 7.8
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 6108
Left = 2844
LinkMode = 1 'Source
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5784
ScaleWidth = 6144
ShowInTaskbar = 0 'False
Top = 1764
Width = 6240
Begin VB.TextBox TrimRectDataText
BackColor = &H00C0FFFF&
BeginProperty Font
name = "IBM3270"
charset = 0
weight = 400
size = 9.6
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 2652
Left = 240
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 17
TabStop = 0 'False
Top = 2400
Width = 5676
End
Begin VB.Frame Frame1
Caption = "Trim Rectangle Data"
Height = 3012
Left = 120
TabIndex = 18
Top = 2160
Width = 5892
End
Begin VB.ComboBox SessionIdList
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
ItemData = "FGTRMRCT.frx":0000
Left = 1200
List = "FGTRMRCT.frx":0052
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 2
Top = 360
Width = 492
End
Begin VB.CommandButton ExitDlg
Cancel = -1 'True
Caption = "E&xit"
Height = 372
Left = 4320
TabIndex = 16
Top = 5280
Width = 852
End
Begin VB.CommandButton Execute
Caption = "&Execute"
Default = -1 'True
Height = 372
Left = 960
TabIndex = 15
Top = 5280
Width = 876
End
Begin VB.Frame TrimFrame
Caption = "Trim Rect Setting"
ForeColor = &H80000008&
Height = 1212
Left = 2040
TabIndex = 4
Top = 720
Width = 3852
Begin VB.TextBox TrimLRColumnText
BackColor = &H00FFFFC0&
ForeColor = &H00404040&
Height = 288
Left = 3072
TabIndex = 14
Text = "80"
Top = 840
Width = 420
End
Begin VB.TextBox TrimLRRowText
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
Left = 3072
TabIndex = 12
Text = "24"
Top = 480
Width = 420
End
Begin VB.TextBox TrimTLColumnText
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
Left = 1152
TabIndex = 9
Text = "1"
Top = 840
Width = 420
End
Begin VB.TextBox TrimTLRowText
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
Left = 1152
TabIndex = 7
Text = "1"
Top = 480
Width = 420
End
Begin VB.Label TrimLabel6
Caption = "Column"
ForeColor = &H80000008&
Height = 252
Left = 2208
TabIndex = 13
Top = 840
Width = 780
End
Begin VB.Label TrimLabel5
Caption = "Row"
ForeColor = &H80000008&
Height = 252
Left = 2208
TabIndex = 11
Top = 480
Width = 780
End
Begin VB.Label TrimLabel4
Caption = "&Lower right corner"
ForeColor = &H80000008&
Height = 252
Left = 2112
TabIndex = 10
Top = 240
Width = 1644
End
Begin VB.Label TrimLabel3
Caption = "Column"
ForeColor = &H80000008&
Height = 252
Left = 288
TabIndex = 8
Top = 840
Width = 780
End
Begin VB.Label TrimLabel2
Caption = "Row"
ForeColor = &H80000008&
Height = 252
Left = 288
TabIndex = 6
Top = 480
Width = 780
End
Begin VB.Label TrimLabel1
Caption = "&Top left corner"
ForeColor = &H80000008&
Height = 252
Left = 192
TabIndex = 5
Top = 240
Width = 1452
End
End
Begin VB.CheckBox TrimCheck
Caption = "&SpecifyTrim Rectangle"
ForeColor = &H80000008&
Height = 252
Left = 2040
TabIndex = 3
Top = 360
Width = 3372
End
Begin VB.Frame Frame2
Caption = "Input Parameters"
Height = 1932
Left = 120
TabIndex = 0
Top = 120
Width = 5892
Begin VB.Label Label1
Caption = "Session &Id"
Height = 252
Left = 120
TabIndex = 1
Top = 240
Width = 972
End
End
End
Attribute VB_Name = "FormGetTrimRect"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub ChangTrimRectGroup(Status As Integer)
TrimFrame.Enabled = Status
TrimLabel1.Enabled = Status
TrimLabel2.Enabled = Status
TrimLabel3.Enabled = Status
TrimLabel4.Enabled = Status
TrimLabel5.Enabled = Status
TrimLabel6.Enabled = Status
TrimTLRowText.Enabled = Status
TrimTLColumnText.Enabled = Status
TrimLRRowText.Enabled = Status
TrimLRColumnText.Enabled = Status
End Sub
Private Sub Execute_Click()
On Error GoTo ErrHandler
FunctionComp = True
OldMousePointer = MousePointer
MousePointer = 11 ' Hour Glass Mouse Pointer
DisplayType$ = GetDisplayType$(SessionIdList.Text)
If DisplayType$ = "NONE" Then
MousePointer = OldMousePointer
MsgBox MSG_INVALID_PSID + SessionIdList.Text, 48, MSG_SAMPLE_PROG
Exit Sub
End If
If TrimCheck.Value = 0 Then
If GetTrimRectangleCoords(SessionIdList.Text, TLCol, TLRow, BRCol, BRRow) = "Closed" Then
MousePointer = OldMousePointer
MsgBox "Either" & Chr$(13) & Chr$(10) & Chr$(9) & "1) specify Trim Rectangle on this form" & Chr$(13) & Chr$(10) & "or" & Chr$(9) & " 2) select Trim Rectangle on session."
Exit Sub
End If
End If
temp$ = LTrim$(RTrim$(SessionIdList.Text))
If Len(temp$) > 0 Then
Topic$ = "Session" + temp$
Else
MousePointer = OldMousePointer
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
Exit Sub
End If
If TrimCheck.Value = CHECKED Then
Item$ = GetTrimItem()
If Len(Item$) = 0 Then
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
MousePointer = OldMousePointer
Exit Sub
End If
Else
Item$ = "TRIMRECT"
End If
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
TrimRectDataText.LinkTimeout = -1
TrimRectDataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
TrimRectDataText.LinkMode = COLD
TrimRectDataText.LinkItem = Item$
TrimRectDataText.LinkRequest
TrimRectDataText.LinkMode = NONE
MousePointer = OldMousePointer
If FunctionComp = True Then
MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
EndStatus$ = MSG_OK
Else
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
TempLogData$ = Time$ + ":Get Trim Rectangle : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_TOPIC + """" + Topic$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_ITEM + """" + Item$ + """" + Chr$(13) + Chr$(10)
LogData$(LogEnd) = TempLogData$
UpdateLogPointer
Loged = True
Exit Sub
ErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub ExitDlg_Click()
Hide
End Sub
Private Function GetTrimItem() As String
Dim TopLeftRow As String
Dim TopLeftColumn As String
Dim LowRightRow As String
Dim LowRightColumn As String
TopLeftRow = RTrim$(LTrim$(TrimTLRowText.Text))
TopLeftColumn = RTrim$(LTrim$(TrimTLColumnText.Text))
LowRightRow = RTrim$(LTrim$(TrimLRRowText.Text))
LowRightColumn = RTrim$(LTrim$(TrimLRColumnText.Text))
If (Len(TopLeftRow) > 0) And (Len(TopLeftColumn) > 0) And (Len(LowRightRow) > 0) And (Len(LowRightColumn) > 0) Then
GetTrimItem = "TRIMRECT(" + TopLeftRow + "," + TopLeftColumn + "," + LowRightRow + "," + LowRightColumn + ")"
Else
GetTrimItem = ""
End If
End Function
Private Sub Form_Load()
SessionIdList.ListIndex = 0
End Sub
Private Sub TrimCheck_Click()
If TrimCheck.Value = CHECKED Then
ChangTrimRectGroup (True)
Else
ChangTrimRectGroup (False)
End If
End Sub
Private Sub UpdateLogPointer()
LogEnd = LogEnd + 1
If LogEnd = MAXLOGNUM + 1 Then
LogEnd = 0
End If
If LogTop = LogEnd Then
LogTop = LogTop + 1
If LogTop = MAXLOGNUM + 1 Then
LogTop = 0
End If
End If
End Sub