home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Muscles_Dr2211729192011.psc / frmEditor.frm < prev   
Text File  |  2011-09-19  |  18KB  |  656 lines

  1. VERSION 5.00
  2. Begin VB.Form frmEditor 
  3.    Caption         =   "Doll Editor"
  4.    ClientHeight    =   8190
  5.    ClientLeft      =   60
  6.    ClientTop       =   450
  7.    ClientWidth     =   11100
  8.    Icon            =   "frmEditor.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   546
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   740
  13.    StartUpPosition =   1  'CenterOwner
  14.    Begin VB.CommandButton cmdUNDO1 
  15.       Caption         =   "Undo"
  16.       Height          =   615
  17.       Left            =   9360
  18.       TabIndex        =   34
  19.       Top             =   1680
  20.       Width           =   735
  21.    End
  22.    Begin VB.Timer Timer1 
  23.       Enabled         =   0   'False
  24.       Interval        =   10
  25.       Left            =   10440
  26.       Top             =   2040
  27.    End
  28.    Begin VB.CheckBox RunTest 
  29.       Caption         =   "TEST"
  30.       BeginProperty Font 
  31.          Name            =   "MS Sans Serif"
  32.          Size            =   8.25
  33.          Charset         =   0
  34.          Weight          =   700
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       Height          =   615
  40.       Left            =   9360
  41.       Style           =   1  'Graphical
  42.       TabIndex        =   32
  43.       Top             =   840
  44.       Width           =   975
  45.    End
  46.    Begin VB.HScrollBar LoadScale 
  47.       Height          =   255
  48.       Left            =   7560
  49.       Max             =   200
  50.       Min             =   35
  51.       TabIndex        =   28
  52.       Top             =   7440
  53.       Value           =   100
  54.       Width           =   3375
  55.    End
  56.    Begin VB.FileListBox File1 
  57.       Height          =   1845
  58.       Left            =   7560
  59.       TabIndex        =   27
  60.       Top             =   5520
  61.       Width           =   3375
  62.    End
  63.    Begin VB.CheckBox chShowNum 
  64.       Caption         =   "Show Numbers"
  65.       Height          =   495
  66.       Left            =   9360
  67.       TabIndex        =   26
  68.       Top             =   2280
  69.       Width           =   975
  70.    End
  71.    Begin VB.Frame fLink 
  72.       Caption         =   "Link Options"
  73.       Height          =   2535
  74.       Left            =   7560
  75.       TabIndex        =   6
  76.       Top             =   2880
  77.       Width           =   3375
  78.       Begin VB.PictureBox PicThick 
  79.          Appearance      =   0  'Flat
  80.          AutoRedraw      =   -1  'True
  81.          BackColor       =   &H00000000&
  82.          ForeColor       =   &H80000008&
  83.          Height          =   855
  84.          Left            =   120
  85.          ScaleHeight     =   55
  86.          ScaleMode       =   3  'Pixel
  87.          ScaleWidth      =   95
  88.          TabIndex        =   31
  89.          Top             =   840
  90.          Width           =   1455
  91.       End
  92.       Begin VB.PictureBox PicColor 
  93.          Appearance      =   0  'Flat
  94.          AutoRedraw      =   -1  'True
  95.          BackColor       =   &H80000005&
  96.          ForeColor       =   &H80000008&
  97.          Height          =   855
  98.          Left            =   1680
  99.          ScaleHeight     =   55
  100.          ScaleMode       =   3  'Pixel
  101.          ScaleWidth      =   47
  102.          TabIndex        =   16
  103.          Top             =   840
  104.          Width           =   735
  105.       End
  106.       Begin VB.VScrollBar sB 
  107.          Height          =   1335
  108.          Left            =   3000
  109.          Max             =   255
  110.          TabIndex        =   15
  111.          Top             =   480
  112.          Width           =   255
  113.       End
  114.       Begin VB.VScrollBar sG 
  115.          Height          =   1335
  116.          Left            =   2760
  117.          Max             =   255
  118.          TabIndex        =   14
  119.          Top             =   480
  120.          Value           =   255
  121.          Width           =   255
  122.       End
  123.       Begin VB.VScrollBar sR 
  124.          Height          =   1335
  125.          Left            =   2520
  126.          Max             =   255
  127.          TabIndex        =   13
  128.          Top             =   480
  129.          Width           =   255
  130.       End
  131.       Begin VB.HScrollBar sThickness 
  132.          Height          =   255
  133.          Left            =   120
  134.          Max             =   12
  135.          Min             =   1
  136.          TabIndex        =   10
  137.          Top             =   480
  138.          Value           =   3
  139.          Width           =   1455
  140.       End
  141.       Begin VB.Frame frHT 
  142.          Caption         =   "Draw Type"
  143.          Height          =   615
  144.          Left            =   120
  145.          TabIndex        =   22
  146.          Top             =   1800
  147.          Width           =   3135
  148.          Begin VB.OptionButton oSticky 
  149.             Caption         =   "Sticky"
  150.             Height          =   255
  151.             Left            =   120
  152.             TabIndex        =   25
  153.             Top             =   240
  154.             Value           =   -1  'True
  155.             Width           =   975
  156.          End
  157.          Begin VB.OptionButton oFilledCircle 
  158.             Caption         =   "Filled Circle"
  159.             Height          =   255
  160.             Left            =   1080
  161.             TabIndex        =   24
  162.             Top             =   240
  163.             Width           =   1095
  164.          End
  165.          Begin VB.OptionButton oSmile 
  166.             Caption         =   "Smile"
  167.             Enabled         =   0   'False
  168.             Height          =   255
  169.             Left            =   2280
  170.             TabIndex        =   23
  171.             Top             =   240
  172.             Width           =   735
  173.          End
  174.       End
  175.       Begin VB.Label Label2 
  176.          Caption         =   "R G B"
  177.          Height          =   255
  178.          Left            =   2640
  179.          TabIndex        =   12
  180.          Top             =   240
  181.          Width           =   495
  182.       End
  183.       Begin VB.Label Label1 
  184.          Caption         =   "Thickness 1"
  185.          Height          =   255
  186.          Left            =   120
  187.          TabIndex        =   11
  188.          Top             =   240
  189.          Width           =   975
  190.       End
  191.    End
  192.    Begin VB.CommandButton cmdExit 
  193.       Caption         =   "EXIT"
  194.       BeginProperty Font 
  195.          Name            =   "MS Sans Serif"
  196.          Size            =   8.25
  197.          Charset         =   0
  198.          Weight          =   700
  199.          Underline       =   0   'False
  200.          Italic          =   0   'False
  201.          Strikethrough   =   0   'False
  202.       EndProperty
  203.       Height          =   375
  204.       Left            =   10080
  205.       TabIndex        =   21
  206.       Top             =   120
  207.       Width           =   855
  208.    End
  209.    Begin VB.Timer TimerM 
  210.       Enabled         =   0   'False
  211.       Interval        =   75
  212.       Left            =   10440
  213.       Top             =   2520
  214.    End
  215.    Begin VB.CommandButton SaveDoll 
  216.       Caption         =   "Save Doll"
  217.       BeginProperty Font 
  218.          Name            =   "MS Sans Serif"
  219.          Size            =   8.25
  220.          Charset         =   0
  221.          Weight          =   700
  222.          Underline       =   0   'False
  223.          Italic          =   0   'False
  224.          Strikethrough   =   0   'False
  225.       EndProperty
  226.       Height          =   375
  227.       Left            =   7560
  228.       TabIndex        =   17
  229.       Top             =   840
  230.       Width           =   1575
  231.    End
  232.    Begin VB.Frame fPoint 
  233.       Caption         =   "Point Options"
  234.       Height          =   735
  235.       Left            =   7560
  236.       TabIndex        =   5
  237.       Top             =   2880
  238.       Width           =   1575
  239.       Begin VB.CheckBox chUnMovable 
  240.          Caption         =   "UnMovable"
  241.          Height          =   255
  242.          Left            =   120
  243.          TabIndex        =   7
  244.          Top             =   240
  245.          Width           =   1335
  246.       End
  247.    End
  248.    Begin VB.CommandButton cmdClearAll 
  249.       Caption         =   "Clear All"
  250.       Height          =   375
  251.       Left            =   7560
  252.       TabIndex        =   4
  253.       Top             =   240
  254.       Width           =   1575
  255.    End
  256.    Begin VB.Frame Frame1 
  257.       Caption         =   "Add Entity"
  258.       Height          =   1215
  259.       Left            =   7560
  260.       TabIndex        =   1
  261.       Top             =   1440
  262.       Width           =   1575
  263.       Begin VB.OptionButton oMuscle 
  264.          Caption         =   "Muscle"
  265.          Height          =   255
  266.          Left            =   120
  267.          TabIndex        =   8
  268.          Top             =   720
  269.          Width           =   855
  270.       End
  271.       Begin VB.OptionButton oLink 
  272.          Caption         =   "Link"
  273.          Height          =   255
  274.          Left            =   120
  275.          TabIndex        =   3
  276.          Top             =   480
  277.          Width           =   855
  278.       End
  279.       Begin VB.OptionButton oPOINT 
  280.          Caption         =   "Point"
  281.          Height          =   255
  282.          Left            =   120
  283.          TabIndex        =   2
  284.          Top             =   240
  285.          Value           =   -1  'True
  286.          Width           =   855
  287.       End
  288.       Begin VB.Label Lmuscle 
  289.          Caption         =   "0"
  290.          Height          =   255
  291.          Left            =   960
  292.          TabIndex        =   20
  293.          Top             =   720
  294.          Width           =   495
  295.       End
  296.       Begin VB.Label Llink 
  297.          Caption         =   "0"
  298.          Height          =   255
  299.          Left            =   960
  300.          TabIndex        =   19
  301.          Top             =   480
  302.          Width           =   495
  303.       End
  304.       Begin VB.Label Lpoint 
  305.          Caption         =   "0"
  306.          Height          =   255
  307.          Left            =   960
  308.          TabIndex        =   18
  309.          Top             =   240
  310.          Width           =   495
  311.       End
  312.    End
  313.    Begin VB.PictureBox PIC 
  314.       Appearance      =   0  'Flat
  315.       AutoRedraw      =   -1  'True
  316.       BackColor       =   &H00004000&
  317.       DrawStyle       =   5  'Transparent
  318.       BeginProperty Font 
  319.          Name            =   "MS Sans Serif"
  320.          Size            =   8.25
  321.          Charset         =   0
  322.          Weight          =   700
  323.          Underline       =   0   'False
  324.          Italic          =   0   'False
  325.          Strikethrough   =   0   'False
  326.       EndProperty
  327.       ForeColor       =   &H80000008&
  328.       Height          =   7215
  329.       Left            =   120
  330.       ScaleHeight     =   479
  331.       ScaleMode       =   3  'Pixel
  332.       ScaleWidth      =   479
  333.       TabIndex        =   0
  334.       Top             =   240
  335.       Width           =   7215
  336.    End
  337.    Begin VB.Frame fMuscle 
  338.       Caption         =   "Muscle Options"
  339.       Height          =   495
  340.       Left            =   7560
  341.       TabIndex        =   9
  342.       Top             =   2880
  343.       Width           =   1575
  344.    End
  345.    Begin VB.Label Label5 
  346.       Caption         =   "Use Mouse to Interact"
  347.       BeginProperty Font 
  348.          Name            =   "MS Sans Serif"
  349.          Size            =   8.25
  350.          Charset         =   0
  351.          Weight          =   700
  352.          Underline       =   0   'False
  353.          Italic          =   0   'False
  354.          Strikethrough   =   0   'False
  355.       EndProperty
  356.       Height          =   375
  357.       Left            =   120
  358.       TabIndex        =   33
  359.       Top             =   7560
  360.       Visible         =   0   'False
  361.       Width           =   2895
  362.    End
  363.    Begin VB.Label Label4 
  364.       Caption         =   "Load/Save Scale"
  365.       Height          =   255
  366.       Left            =   7560
  367.       TabIndex        =   30
  368.       Top             =   7800
  369.       Width           =   1455
  370.    End
  371.    Begin VB.Label Label3 
  372.       Caption         =   "1"
  373.       Height          =   255
  374.       Left            =   9000
  375.       TabIndex        =   29
  376.       Top             =   7800
  377.       Width           =   495
  378.    End
  379. End
  380. Attribute VB_Name = "frmEditor"
  381. Attribute VB_GlobalNameSpace = False
  382. Attribute VB_Creatable = False
  383. Attribute VB_PredeclaredId = True
  384. Attribute VB_Exposed = False
  385. 'Author : Creator Roberto Mior
  386. '     reexre@gmail.com
  387. '
  388. 'If you use source code or part of it please cite the author
  389. 'You can use this code however you like providing the above credits remain intact
  390. '
  391. '
  392. '
  393. Option Explicit
  394.  
  395. Private DOLL       As New OBJphysic
  396. Private FPointSelected As Boolean
  397. Private Closest    As Integer
  398. Private Closest2   As Integer
  399. Private Color      As Long
  400. Private FLinkSelected As Boolean
  401. Private defStren   As Double
  402. Private x1         As Single
  403. Private y1         As Single
  404. Private x2         As Single
  405. Private y2         As Single
  406.  
  407.  
  408. Private InteractWith As Integer
  409. Private PtoMove    As Integer
  410. Private mouseX     As Single
  411. Private mouseY     As Single
  412.  
  413.  
  414. Private Sub Check1_Click()
  415.  
  416. End Sub
  417.  
  418. Private Sub chShowNum_Click()
  419.     DRAWDOLL
  420.  
  421. End Sub
  422.  
  423. Private Sub cmdClearAll_Click()
  424.  
  425.     RunTest.Value = Unchecked
  426.  
  427.     PIC.Cls
  428.  
  429.     DOLL.DestroyMe
  430.     FPointSelected = False
  431.     FLinkSelected = False
  432.     oPOINT = True
  433.     Lpoint = 0
  434.     Llink = 0
  435.     Lmuscle = 0
  436.  
  437. End Sub
  438.  
  439. Private Sub cmdExit_Click()
  440.     End
  441. End Sub
  442.  
  443. Private Sub cmdUNDO1_Click()
  444.     If oPOINT Then
  445.         If DOLL.Npoints > 0 Then DOLL.Npoints = DOLL.Npoints - 1
  446.     End If
  447.     If oLink Then
  448.         If DOLL.Nlinks > 0 Then DOLL.Nlinks = DOLL.Nlinks - 1
  449.     End If
  450.     If oMuscle Then
  451.         If DOLL.NMuscles > 0 Then DOLL.NMuscles = DOLL.NMuscles - 1
  452.     End If
  453.  
  454.     DRAWDOLL
  455.  
  456. End Sub
  457.  
  458. Private Sub File1_DblClick()
  459.     DOLL.DestroyMe
  460.     DOLL.OBJ_LOADandPlace File1, PIC.Width \ 2, PIC.Height \ 2, LoadScale / 100
  461.     DRAWDOLL
  462.     Lpoint = DOLL.Npoints
  463.     Llink = DOLL.Nlinks
  464.     Lmuscle = DOLL.NMuscles
  465.  
  466. End Sub
  467.  
  468. Private Sub Form_Activate()
  469.     SelectChange
  470.  
  471.  
  472.     defStren = 0.03 * 1.2
  473.     DOLL.GlobalMAXStrength = defStren
  474.     DOLL.CurrentMAXStrength = defStren
  475.     DOLL.MaxX = PIC.Width - 2
  476.     DOLL.MaxY = PIC.Height - 2
  477.  
  478.  
  479.     Gravity = 0.035
  480.     Doll_Air_Resistence = 0.994
  481.  
  482. End Sub
  483.  
  484. Private Sub Form_Load()
  485.     Me.Caption = Me.Caption & " V" & App.Major & "." & App.Minor
  486.  
  487.     File1.Path = App.Path
  488.     File1.Filename = "*.doll"
  489.  
  490.  
  491. End Sub
  492.  
  493. Private Sub LoadScale_Change()
  494.     Label3 = LoadScale / 100
  495.     If File1 <> "" Then
  496.         DOLL.OBJ_LOADandPlace File1, PIC.Width \ 2, PIC.Height \ 2, LoadScale / 100
  497.         DRAWDOLL
  498.     End If
  499. End Sub
  500.  
  501. Private Sub LoadScale_Scroll()
  502.     Label3 = LoadScale / 100
  503.     If File1 <> "" Then
  504.         DOLL.OBJ_LOADandPlace File1, PIC.Width \ 2, PIC.Height \ 2, LoadScale / 100
  505.         DRAWDOLL
  506.     End If
  507. End Sub
  508.  
  509. Private Sub oFilledCircle_Click()
  510.     If oSticky Then TmpDrawShape = sLine
  511.     If oFilledCircle Then TmpDrawShape = sFillCircle
  512.     If oSmile Then TmpDrawShape = sFace
  513. End Sub
  514.  
  515. Private Sub oMuscle_Click()
  516.     If DOLL.Nlinks < 2 Then oLink = True
  517.     SelectChange
  518. End Sub
  519.  
  520. Private Sub oSmile_Click()
  521.     If oSticky Then TmpDrawShape = sLine
  522.     If oFilledCircle Then TmpDrawShape = sFillCircle
  523.     If oSmile Then TmpDrawShape = sFace
  524. End Sub
  525.  
  526. Private Sub oSticky_Click()
  527.     If oSticky Then TmpDrawShape = sLine
  528.     If oFilledCircle Then TmpDrawShape = sFillCircle
  529.     If oSmile Then TmpDrawShape = sFace
  530. End Sub
  531.  
  532. Private Sub PIC_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  533.     InteractWith = 0
  534. End Sub
  535.  
  536. Private Sub RunTest_Click()
  537.     Dim I          As Long
  538.  
  539.     If RunTest.Value = Checked Then
  540.         For I = 1 To DOLL.Npoints
  541.             DOLL.PointVX(I) = 0
  542.             DOLL.PointVY(I) = 0
  543.         Next
  544.  
  545.         DOLL.OBJ_SAVE "zztmp.doll"
  546.         Timer1.Enabled = True
  547.         Label5.Visible = True
  548.     Else
  549.         Timer1.Enabled = False
  550.         DOLL.OBJ_LOADandPlace "zztmp.doll", PIC.Width \ 2, PIC.Height \ 2, 1    'LoadScale / 100
  551.         DRAWDOLL
  552.         Label5.Visible = False
  553.  
  554.     End If
  555. End Sub
  556.  
  557. Private Sub SaveDoll_Click()
  558.  
  559.     RunTest.Value = Unchecked
  560.  
  561.     Dim S          As String
  562.     S = "DollName.doll"
  563.     S = InputBox("Type Doll Name", , S)
  564.     If Right$(S, 5) <> ".doll" Then S = S & ".doll"
  565.  
  566.  
  567.     DOLL.OBJ_SAVE S
  568.     MsgBox S & " saved"
  569.  
  570.     DOLL.OBJ_LOADandPlace S, PIC.Width \ 2, PIC.Height \ 2
  571.     DRAWDOLL
  572.  
  573.     File1.Refresf,"C5)
  574.  Up(Button As Integer, Shift Asoll"
  575.     S = InputBox("Type Doll Name", , S)
  576.     If Right$(ger, Shift Asoll"
  577.   h Test.Valht \      TabIndex        =   29
  578.       Top2.doll"
  579.  2  DOLL.O 2_SAVE "z 2  Else
  580.  
  581.     If FiiiiiiiiiiiiiiiiiiiiDOLL.O 2_SAVE "z 2 rue
  582.     Else
  583.          4awShape = sFace
  584. End Sub
  585.  
  586. Private Sub oMuscle_Click()
  587.   sO4awShape = sFace2  DOLL
  588.     Else
  589.          4aw(im S             "1"
  590.       HeredId = True
  591. Attribut2eight              4awShape = sFace
  592. End Sub
  593.  
  594. Private Sub oMuscle_Click()
  595.   sO4awShape = sFace2  DOLL
  596.     ElXm
  597.  
  598. PrivaRC  File1.Refresf,"C5)
  599.  Upw(im S           H
  600.  
  601. Private In2S = S & ".p  As Single
  602. Private y2         As Sinea, PIC.Height \ 2, 1    pe = sFillCircle
  603. aa, PIC.Height \ 2, 1    pe = sFillCircle
  604. aa, PIC.Height \ 2, 1    pe = sFillCircle
  605. aa, PIC.Height \ 2, 1    pe = sFillCircle
  606. aa, PIC.Height \ 2, 1    pe = sFillCircle
  607. aa, PIC.Height \ 2, 1    pe = sFillCircle
  608. aa, PIC.Height \ 2, 1    pe = sFillCircle
  609. aarB  pe = sFillCircle
  610. aarB  pe = sFillCirclLDHC6D5RGLu_illCircle
  611. aarB  pe = sFillCircL  As SinllCircL NDillC        DRAWDOLL
  612.        cmdUNDO1_Click()
  613.     If o
  614.  
  615. End Sub
  616.  
  617. tetGst.V
  618.  
  619. tetGst.V
  620.  
  621. tetGst.V
  622.  
  623. tetGst.V
  624.  
  625. tetGst.V
  626. VRC  File1.Refresf,"C5)
  627.  Up=dDillC        DRAWDOLL
  628.  e, Y False
  629. AsrttVB@5)
  630.    DRAWDOLL
  631. 1Bhape = sFace
  632. (Button As Integer, Shift Asoll"
  633.      4awShape     Asoll"
  634.      4awShape   i en
  635.         If DOW8M2eight    sFace
  636. End Sub
  637.  
  638. Privaght e
  639.       File1.Refresf,  DOLL.OBJ_l3=tdbIndex       
  640.     File1.Refresf,"CPIC.HeigCPIC.HeigCPIC.HeigCPIC.HeigCPIC.Het   DOLL.PointVY(I)               2' 0s8svate y1 5  File1. / 100
  641. rse
  642. AsrttVB@5)
  643.    DRAWDOLL
  644. 1Bhapoen   As Double   4awShape   i en
  645. eundPlace S,sAs String
  646.     S = "DollName.doll"100
  647. rse
  648. Asrt  sAl"100
  649. rse
  650. Asrt  B54,  4awShape     Asoll"
  651.      4awShape   i en
  652.         If DOW8M2eight    sFace
  653. End Sub
  654. gH
  655. rcle
  656. aa, Ar