VERSION 5.00 Begin VB.Form Form3 Caption = "GraphicsForm" ClientHeight = 7800 ClientLeft = 165 ClientTop = 450 ClientWidth = 11475 Icon = "Form3VER.frx":0000 LinkTopic = "Form3" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 7800 ScaleWidth = 11475 StartUpPosition = 3 'Windows ‚ÌŠù’è’l Begin VB.CommandButton NumOutputBtn Caption = "NumOutput(&N)" Height = 495 Left = 9360 TabIndex = 11 Top = 1320 Width = 2055 End Begin VB.TextBox CalcStepTxt Alignment = 1 '‰E‘µ‚¦ BeginProperty Font Name = "‚l‚r ‚oƒSƒVƒbƒN" Size = 20.25 Charset = 128 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 7680 TabIndex = 9 Text = "1000" Top = 1320 Width = 1575 End Begin VB.TextBox Text1 Height = 495 Left = 5160 TabIndex = 18 Text = "Text1" Top = 3720 Visible = 0 'False Width = 1215 End Begin VB.CommandButton CallAnalysisBtn Caption = "Call Analisys(&A)" Height = 495 Left = 8880 TabIndex = 7 Top = 120 Width = 1215 End Begin VB.ComboBox LineCLCmb Height = 300 Left = 10200 TabIndex = 13 Text = "Line Color" Top = 840 Width = 1215 End Begin VB.CheckBox Dot1000Chk Caption = "Dot1000(&T)" Height = 495 Left = 7680 TabIndex = 8 Top = 720 Width = 1215 End Begin VB.CheckBox YdotEXChk Caption = "YdotEX(&Y)" Height = 495 Left = 8880 TabIndex = 10 Top = 720 Value = 1 'Áª¯¸ Width = 1215 End Begin VB.CommandButton PictureClearBtn Caption = "PicClear(&L)" Height = 495 Left = 7680 TabIndex = 6 Top = 120 Width = 1215 End Begin VB.CommandButton ExitBtn Caption = "Exit(&X)" Height = 495 Left = 10200 TabIndex = 12 Top = 120 Width = 1215 End Begin VB.CommandButton expressionbtn Caption = "Express(&E)" Height = 495 Left = 9000 TabIndex = 5 Top = 7200 Width = 2415 End Begin VB.CommandButton calcbtn Caption = "UnderCalc(&C)" Height = 495 Left = 9000 TabIndex = 2 Top = 5880 Width = 2415 End Begin VB.TextBox maxytxt Alignment = 1 '‰E‘µ‚¦ BeginProperty Font Name = "‚l‚r ‚oƒSƒVƒbƒN" Size = 20.25 Charset = 128 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 9720 TabIndex = 4 Text = "1" Top = 6600 Width = 1695 End Begin VB.TextBox minytxt Alignment = 1 '‰E‘µ‚¦ BeginProperty Font Name = "‚l‚r ‚oƒSƒVƒbƒN" Size = 20.25 Charset = 128 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 7680 TabIndex = 3 Text = "-1" Top = 6600 Width = 1815 End Begin VB.TextBox maxxtxt Alignment = 1 '‰E‘µ‚¦ BeginProperty Font Name = "‚l‚r ‚oƒSƒVƒbƒN" Size = 20.25 Charset = 128 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 9720 TabIndex = 1 Text = "1" Top = 5280 Width = 1695 End Begin VB.TextBox minxtxt Alignment = 1 '‰E‘µ‚¦ BeginProperty Font Name = "‚l‚r ‚oƒSƒVƒbƒN" Size = 20.25 Charset = 128 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 7680 TabIndex = 0 Text = "-1" Top = 5280 Width = 1935 End Begin VB.TextBox calcouttxt BeginProperty Font Name = "‚l‚r ‚oƒSƒVƒbƒN" Size = 20.25 Charset = 128 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 3255 Left = 7680 MultiLine = -1 'True ScrollBars = 3 '—¼•û TabIndex = 14 Text = "Form3VER.frx":030A Top = 1920 Width = 3735 End Begin VB.PictureBox GraPic BackColor = &H00404040& ForeColor = &H00FFFFC0& Height = 7680 Left = 0 ScaleHeight = 7620 ScaleWidth = 7620 TabIndex = 15 Top = 0 Width = 7680 End Begin VB.Label Label4 BackColor = &H00C0C0FF& Caption = "Y Express Width" Height = 495 Left = 7680 TabIndex = 17 Top = 7200 Width = 1215 End Begin VB.Label Label3 BackColor = &H00C0FFC0& Caption = "X CalcWidth" ForeColor = &H00000000& Height = 495 Left = 7680 TabIndex = 16 Top = 5880 Width = 1215 End End Attribute VB_Name = "Form3" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Rem ===================================================================== Rem Equation Analizer 'Graphics Form' Logical Form. Rem Rem ===================================================================== Option Explicit Dim fso As Object Dim cw As CNFGworkbag Dim justbeforewidth As Double Dim justbeforeheight As Double Dim alpha As Double Dim beta As Double Dim Xalpha As Single Dim Xbeta As Single Dim Yalpha As Single Dim Ybeta As Single Dim StepRate As Double Dim y(10000) As Double Dim indexSUM As Integer Public Sub form_load() Set fso = CreateObject("Scripting.FileSystemObject") Call CNFGMNGer(0) Call indexsuminit With LineCLCmb Rem .AddItem "" .AddItem "white" .AddItem "blue" .AddItem "green" .AddItem "red " .AddItem "yellow" .AddItem "purple" .AddItem "water" End With Rem call pictureclearbtn_click End Sub Public Sub dot1000chk_click() Call indexsuminit End Sub Public Sub indexsuminit() With CalcStepTxt If Dot1000Chk.Value = 1 Then .Visible = True indexSUM = Val(.Text) Else .Visible = False indexSUM = 100 End If End With End Sub Public Sub calcsteptxt_change() Dim tmpval As Double With CalcStepTxt tmpval = Val(CalcStepTxt.Text) If tmpval <= 0 Or 10000 < tmpval Then CalcStepTxt.Text = 1000 indexSUM = 1000 Else indexSUM = tmpval End If End With End Sub Public Sub lineclcmb_click() Dim colorstr As String With LineCLCmb Select Case .ListIndex Case 1 colorstr = "&Hff8888" Case 2 colorstr = "&H88ff88" Case 3 colorstr = "&H0000ff" Case 4 colorstr = "&H88cccc" Case 5 colorstr = "&Hcc88cc" Case 6 colorstr = "&Hcccc88" Case 0 colorstr = "&Hffffff" End Select GraPic.ForeColor = Val(colorstr) End With End Sub Public Sub callanalysisbtn_click() Load Form1 Form1.SetFocus End Sub Public Sub exitbtn_click() Form3.Visible = False Call CNFGMNGer(1) Rem Unload Me End Sub Public Sub sub05() End Sub Public Sub form_resize() Dim ratewidth As Double Dim rateheight As Double With Form3 If justbeforewidth = 0 Then justbeforewidth = .Width If justbeforeheight = 0 Then justbeforeheight = .Height ratewidth = .Width / justbeforewidth rateheight = .Height / justbeforeheight Rem call resizecontrol(control, ratewidth,rateheight) Call ResizeControl(NumOutputBtn, ratewidth, rateheight) Call ResizeControl(ExitBtn, ratewidth, rateheight) Call ResizeControl(PictureClearBtn, ratewidth, rateheight) Call ResizeControl(calcbtn, ratewidth, rateheight) Call ResizeControl(expressionbtn, ratewidth, rateheight) Call ResizeControl(CallAnalysisBtn, ratewidth, rateheight) Call ResizeControl(GraPic, ratewidth, rateheight) Call ResizeControl(Label3, ratewidth, rateheight) Call ResizeControl(Label4, ratewidth, rateheight) Call ResizeControl(calcouttxt, ratewidth, rateheight) Call ResizeControl(CalcStepTxt, ratewidth, rateheight) Call ResizeControl(maxxtxt, ratewidth, rateheight) Call ResizeControl(minxtxt, ratewidth, rateheight) Rem ----- Call ResizeControl(maxytxt, ratewidth, rateheight) Call ResizeControl(minytxt, ratewidth, rateheight) Call ResizeControl(Dot1000Chk, ratewidth, rateheight) Call ResizeControl(YdotEXChk, ratewidth, rateheight) Rem --ComboBox----- Call comboResizeControl(LineCLCmb, ratewidth, rateheight) Rem Call resizecontrol(Control, ratewidth, rateheight) justbeforewidth = .Width justbeforeheight = .Height End With End Sub Public Sub ResizeControl(CONT As Control, rw As Double, rh As Double) With CONT .Top = Int(.Top * rh + 0.5) .Left = Int(.Left * rw + 0.5) .Width = Int(.Width * rw + 0.5) .Height = Int(.Height * rh + 0.5) End With End Sub Public Sub comboResizeControl(CONT As Control, rw As Double, rh As Double) With CONT .Top = Int(.Top * rh + 0.5) .Left = Int(.Left * rw + 0.5) .Width = Int(.Width * rw + 0.5) Rem.Height = Int(.Height * rh + 0.5) End With End Sub Public Sub numoutputbtn_click() Dim fso As Object Dim WriteTextStream As Object Dim pictureXstep As Double Dim doublepsetY As Double Dim tmpresult As String Dim psetX As Integer Dim psetY As Integer Dim index As Integer Dim maxY As Double Dim minY As Double maxY = Val(maxytxt.Text) minY = Val(minytxt.Text) If minY > maxY Then MsgBox ("Yalpha and Ybeta sequences reverce."), vbExclamation Else Set fso = CreateObject("scripting.filesystemobject") Set WriteTextStream = fso.CreateTextFile("CALCOUT.TXT") WriteTextStream.Write (Str(Now) + vbCrLf + Form1.XinputTxt.Text + vbCrLf) With calcouttxt If indexSUM <= 1000 Then .Text = "" Else .Text = "Only OutPutTextFile." + vbCrLf + "Over 1000 Calc Step." + vbCrLf End If For index = 0 To indexSUM doublepsetY = GraPic.Height * (maxY - y(index)) / (maxY - minY) If doublepsetY < -32000 Then doublepsetY = -32000 If 32000 < doublepsetY Then doublepsetY = 32000 psetY = Int(doublepsetY + 0.5) If YdotEXChk.Value = 1 Then tmpresult = Str(psetY) + vbCrLf Else tmpresult = Str(alpha + StepRate * index) + "," + Str(y(index)) + vbCrLf End If Rem ----- If indexSUM <= 1000 Then With calcouttxt .Text = .Text + tmpresult End With End If WriteTextStream.Write (tmpresult) Next index End With WriteTextStream.Close End If End Sub Public Sub pictureclearbtn_click() GraPic.Cls Call inputXYmodjule End Sub Public Sub inputXYmodjule() Dim xdot0 As Integer Dim ydot0 As Integer Xalpha = Val(minxtxt.Text) Xbeta = Val(maxxtxt.Text) Yalpha = Val(minytxt.Text) Ybeta = Val(maxytxt.Text) With GraPic If Xalpha < 0 And 0 < Xbeta Then xdot0 = -(Xalpha * .Width) / (Xbeta - Xalpha) GraPic.Line (xdot0, 0)-(xdot0, .Height), &HFFFFFF End If If Yalpha < 0 And 0 < Ybeta Then ydot0 = (Ybeta * .Height) / (Ybeta - Yalpha) GraPic.Line (0, ydot0)-(.Width, ydot0), &HFFFFFF End If End With End Sub Public Sub grapic_mousedown(button As Integer, shift As Integer, x As Single, y As Single) Dim xMSGreal As Single Dim yMSGreal As Single Call inputXYmodjule With GraPic xMSGreal = Xalpha + (x / GraPic.Width) * (Xbeta - Xalpha) yMSGreal = Ybeta - (y / GraPic.Height) * (Ybeta - Yalpha) MsgBox ("X: " + Str(xMSGreal) + vbCrLf + "Y: " + Str(yMSGreal)) End With End Sub Public Sub calcbtn_click() Dim index As Integer Dim x As Double Dim tmpY As Double Form1.NoMSGChk.Value = 1 alpha = Val(minxtxt.Text) beta = Val(maxxtxt.Text) If alpha > beta Then MsgBox ("Xalpha and Xbeta sequences is reverce."), vbExclamation Else StepRate = (beta - alpha) / indexSUM For index = 0 To indexSUM x = alpha + index * StepRate y(index) = Form1.FuncComplex(x) Next index End If End Sub Public Sub expressionbtn_click() Dim pictureXstep As Double Dim doublepsetY As Double Dim tmpresult As String Dim psetX As Integer Dim psetY As Integer Dim index As Integer Dim maxY As Double Dim minY As Double maxY = Val(maxytxt.Text) minY = Val(minytxt.Text) If minY > maxY Then MsgBox ("Yalpha and Ybeta sequences is reverce."), vbExclamation Else With GraPic pictureXstep = .Width / indexSUM For index = 0 To indexSUM psetX = index * pictureXstep Rem ----- doublepsetY = .Height * (maxY - y(index)) / (maxY - minY) If doublepsetY < 0 Or .Width < doublepsetY Then Rem do nothing..... Else psetY = Int(doublepsetY) GraPic.Circle (psetX, psetY), 3 End If Next index End With End If Call inputXYmodjule minxtxt.SetFocus End Sub Public Sub CNFGMNGer(RWint As Integer) Rem Dim cw As CNFGworkbag Dim CNFGtextname As String CNFGtextname = "cnfgtemp.txt" With cw .RWint = RWint Rem ------ If .RWint < 0 Or 1 < .RWint Then MsgBox ("Error"), 48 Else Rem -- Read CNFG logic.------ If .RWint = 0 Then If fso.FileExists(CNFGtextname) = False Then fso.CreateTextFile (CNFGtextname) End If Set .ReadTextStream = fso.OpenTextFile(CNFGtextname) With .ReadTextStream Do While .AtEndOfStream = False cw.CNFGstr = .ReadLine Call listcnfg Loop .Close End With End If Rem -- Write CNFG logic.------ If .RWint = 1 Then Set .WriteTextStream = fso.CreateTextFile(CNFGtextname) Call listcnfg .WriteTextStream.Close End If End If End With End Sub Public Sub bbbbb() End Sub Public Sub listcnfg() '(cw As CNFGworkbag) With cw NCi .FormKindon = True Set .CONT = Form3: REForWRI NCi .FColorUnableKindON = True Set .CONT = calcbtn: REForWRI Set .CONT = PictureClearBtn: REForWRI Set .CONT = ExitBtn: REForWRI Set .CONT = expressionbtn: REForWRI Set .CONT = NumOutputBtn: REForWRI Set .CONT = CallAnalysisBtn: REForWRI NCi .OnlyExpressionKindOn = True Set .CONT = GraPic: REForWRI Set .CONT = Label3: REForWRI Set .CONT = Label4: REForWRI NCi .TextKindon = True Set .CONT = calcouttxt: REForWRI Set .CONT = CalcStepTxt: REForWRI Set .CONT = maxxtxt: REForWRI Set .CONT = minxtxt: REForWRI Rem ----- Set .CONT = maxytxt: REForWRI Set .CONT = minytxt: REForWRI NCi .ValueKindon = True Set .CONT = Dot1000Chk: REForWRI Set .CONT = YdotEXChk: REForWRI NCi .ComboBOXKindON = True Rem --ComboBox----- Set .CONT = LineCLCmb: REForWRI Rem set .cont=Control:reforwri End With End Sub Public Sub NCi() 'NormalControl Initializeing With cw .FormKindon = False .OnlyExpressionKindOn = False .ValueKindon = False .TextKindon = False .ListIndexKindON = False .ComboBOXKindON = False End With End Sub Public Sub REForWRI() '(cw As CNFGworkbag) Dim eqstrloc As Integer Dim strlen As Integer Dim i As Integer Dim j As Integer Dim tailstr As String Dim numstr As String Dim outnumCH As String Dim outnumSTRING As String Dim valtmp As Double With cw If .RWint < 0 Or 1 < .RWint Then MsgBox ("Error"), 48 Else If .RWint = 0 Then eqstrloc = InStr(.CNFGstr, "=") strlen = Len(.CNFGstr) tailstr = Mid(.CNFGstr, eqstrloc + 1, strlen - eqstrloc) Rem ------ If 0 < InStr(.CNFGstr, .CONT.Name) Then If 0 < InStr(.CNFGstr, "Text") Then .CONT.Text = tailstr Else If 0 < InStr(tailstr, "True") Then .CONT.Value = True Else If 0 < InStr(tailstr, "False") Then .CONT.Value = False Else Rem --Num Value EXtract------ outnumSTRING = "" For i = 1 To Len(tailstr) outnumCH = Mid(tailstr, i, 1) If outnumCH = "." Or outnumCH = "-" Then outnumSTRING = outnumSTRING + outnumCH End If For j = 0 To 9 Step 1 If outnumCH = chr(48 + j) Then outnumSTRING = outnumSTRING + outnumCH End If Next j Next i Rem ------ Rem If 0 < InStr(.cnfgstr, "ValueForecolorBackcolorWidthHeightTopLeft ") Then .CONT.valueforecolorbackcolorwidthheighttoplessssssft valtmp = Val(outnumSTRING) If 0 < InStr(.CNFGstr, .CONT.Name) Then If 0 < InStr(.CNFGstr, "Value") Then .CONT.Value = valtmp If 0 < InStr(.CNFGstr, "ForeColor") Then .CONT.ForeColor = valtmp If 0 < InStr(.CNFGstr, "BackColor") Then .CONT.BackColor = valtmp If .ListIndexKindON = True Then If 0 < InStr(.CNFGstr, "ListIndex") Then .CONT.ListIndex = valtmp End If If 0 < InStr(.CNFGstr, "Width") Then .CONT.Width = valtmp If .ComboBOXKindON = False Then If 0 < InStr(.CNFGstr, "Height") Then .CONT.Height = valtmp End If If 0 < InStr(.CNFGstr, "Top") Then .CONT.Top = valtmp If 0 < InStr(.CNFGstr, "Left") Then .CONT.Left = valtmp End If End If End If End If End If End If Rem ------ If .RWint = 1 Then .WriteTextStream.Write (.CONT.Name + "--------------------------" + vbCrLf) If .FormKindon = False Or .OnlyExpressionKindOn = False Then Rem .WriteTextStream.write (.CONT.Name + ".=" + Str(.CONT.) + vbCrLf) If .ValueKindon = True Then Rem MsgBox (.CONT.Name) .WriteTextStream.Write (.CONT.Name + ".Value=" + Str(.CONT.Value) + vbCrLf) End If If .TextKindon = True Then .WriteTextStream.Write (.CONT.Name + ".Text=" + .CONT.Text + vbCrLf) End If If .ListIndexKindON = True Then .WriteTextStream.Write (.CONT.Name + ".ListIndex=" + Str(.CONT.ListIndex) + vbCrLf) End If If .FColorUnableKindON = False Then .WriteTextStream.Write (.CONT.Name + ".ForeColor=" + Str(.CONT.ForeColor) + vbCrLf) End If .WriteTextStream.Write (.CONT.Name + ".BackColor=" + Str(.CONT.BackColor) + vbCrLf) End If If .FormKindon = False Then Rem --Location----- .WriteTextStream.Write (.CONT.Name + ".Top=" + Str(.CONT.Top) + vbCrLf) .WriteTextStream.Write (.CONT.Name + ".Left=" + Str(.CONT.Left) + vbCrLf) End If Rem --Bigth.----- .WriteTextStream.Write (.CONT.Name + ".Width=" + Str(.CONT.Width) + vbCrLf) If .ComboBOXKindON = False Then .WriteTextStream.Write (.CONT.Name + ".Height=" + Str(.CONT.Height) + vbCrLf) End If End If End If End With End Sub Rem ===================================================================== Rem Files END. Rem Rem =====================================================================