Post Reply 
Request: Toolbar commands
03-18-2015, 08:48 PM
Post: #1
Request: Toolbar commands
Request: Toolbar
Hello, sorry for my bad English

For the team hpprime, is required a toolbar to create good programs with GUI

an example code of series ti68k calcs

[Image: AnimationOfPolyhedrons.png]

Code:
animTbar()
Prgm
  © animTbar(): Animations Toolbar
  Local chspolvl, chsplvl1
  Loop
    putbar({},0)
    Toolbar
      Title "Polyhedron"
        Item "Regular Polyhedron",regpollb
        © regular, convex polyhedron with congruent faces of regular polygons
        Item "Other important polyhedra",othrpolb
      Title "Paramts"
        Item "Set parameters page1/2",wparamlb
        Item "Parameters page2/2",wparm2lb
        Item "Parameters 3",wparm3lb
        Item "Default values",dftparlb
      Title "MakeImag",makeimlb
      Title "Animation",startalb
      Title "Delete Images"
        Item "All",delalllb
        Item "Current",delcrrlb
      Title "Quit"
        Item "Exit without del images",quit2lb
        Item "Delete All Images",quit1lb
        Item "Stop",haltlb
      Title "About",aboutlb
    EndTBar
    Cycle © to Loop

    Lbl regpollb:
    If polytype <= 2 Then
      polytype→chspolvl
    EndIf
    PopUp {"Tetrahedron. 4 Faces","Hexahedron (Cube). 6 Faces","Octahedron. 8 Faces","Dodecahedron 12 Faces", "Icosahedron. 20 Faces"},chspolvl
    If chspolvl = 1 Then
      0→chspolv
      Dialog
        Text "Tetrahedron is one kind of pyramid"
        Text "composed of 4 triangular faces."
      EndDlog
      poltype(1)
    Else
      If chspolvl = 2 Then
        0→chspolv
        Dialog
          Text "A cube is a hexahedron with all"
          Text "its faces square and three squares"
          Text "around each vertex."
        EndDlog
        poltype(2)
      Else
        If chspolvl >= 3 and chspolvl <= 5 Then
          0→chspolvl
          Dialog
            Text "Algorithms still not created,"
            Text "will be included in future releases."
          EndDlog
        EndIf
      EndIf
    EndIf
    Cycle © to Loop

    Lbl othrpolb
    If polytype >= 6 Then
      polytype-5→chspolvl
    EndIf

    PopUp {"Square Pyramid. 5 Faces","Triangular Prism. 6 Faces"},chspolvl
    If chspolvl = 1 Then
      0→chspolv
      Dialog
        Text "Square Pyramid is a pyramid, "
        Text "having a square base"
      EndDlog
      poltype(6)
    Else
      If chspolvl = 2 Then
        0→chspolv
        Dialog
          Text "1"
          Text "1"
        EndDlog
        poltype(7)
      EndIf
    EndIf
    Cycle © to Loop

    Lbl wparamlb:wparamts()
    Cycle © to Loop

    Lbl wparm2lb:wparamt2()
    wparm2lb
    Cycle © to Loop

    Lbl wparm3lb:wparamt3()
    wparm3lb
    Cycle © to Loop

    Lbl dftparlb:dftvalue()
    Cycle

    Lbl makeimlb:makepict(nimages,highpoly,dcrhigvl,hidedgvl,rotatnvl,axesflag,vert​exfl,polytype)
    Cycle © to Loop

    Lbl startalb:exeanimt(nimages,anidelay,maxcycle,rotatnvl)
    Cycle © to Loop

    Lbl delalllb:delpics(nimages,1)
    Cycle © to Loop

    Lbl delcrrlb:delpics(nimages,2)
    Cycle © to Loop

    Lbl aboutlb:aniintro()
    Cycle © to Loop

    Lbl quit1lb:exitprgm(nimages,1)
    Exit © to EndLoop

    Lbl quit2lb:exitprgm(nimages,0)
    Exit © to EndLoop

    Lbl haltlb:Stop
    Exit © to EndLoop

  EndLoop
EndPrgm

Survey is important to have a block of statements for this purpose?

+1
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)