First sample : the Controls extension (and others)
' Init variablesTimer = "" ' Init WindowGraphicsWindow.Show()GraphicsWindow.BackgroundColor = GraphicsWindow.GetColorFromRGB(240,240,240)Controls.LoadTheme("Vista") ' Create animationMyImage = Controls.AddImage("AppIcon.png")ButtonClick() ' Create buttonMyButton = Controls.AddButton(150, 22, "Start/Stop")Controls.Move(MyButton, 5, 150)Controls.RegisterMouseUpEvent(MyButton, "ButtonClick") ' Create textboxMyTextBox = Controls.AddTextBox(175, 22, "")Controls.Move(MyTextBox, 165, 150)Controls.SetText(MyTextBox, "Some text")Controls.RegisterEvent(MyTextBox, "TextChangedEvent", "OnTextChange") ' Create checkboxMyCheckBox = Controls.AddCheckBox("Cliquez ici !")Controls.Move(MyCheckBox, 350, 155)Controls.SetChecked(MyCheckBox, "True") ' SubsCurrentMyImageRotation = 0To150 = "False"Sub RotateMyImage CurrentMyImageRotation = CurrentMyImageRotation + 1 If CurrentMyImageRotation = 360 Then CurrentMyImageRotation = 0 If To150 = "False" Then To150 = "True" Controls.MoveAsAnimation(MyImage, 0, 0, 1080) Else To150 = "False" Controls.MoveAsAnimation(MyImage, GraphicsWindow.Width-125, 0, 1080) EndIf EndIf Controls.SetRotationAngle(MyImage, CurrentMyImageRotation)EndSub Sub ButtonClick If Timer = "" Then Timer = SmallBasic.SetInterval("RotateMyImage", 3, -1) GraphicsWindow.AnimateShape(MyImage, GraphicsWindow.Width-125, 0, 1080) Else SmallBasic.AsyncStop(Timer) Timer = "" EndIfEndSub Take advantage of profession resume and you will obtain position you strive for Sub OnTextChange GraphicsWindow.ShowMessage(Controls.GetText(MyTextBox),"Text")EndSub
Second sample : XML
TextWindow.WriteLine("Test du système XML") Quote = Text.GetCharacter(34)Doc = Xml.LoadXMLFile("Data.XML")TextWindow.WriteLine("") ' First testBag2 = Xml.GetNode(Doc, "//bag[2]")TextWindow.WriteLine("The element : " + Bag2)TextWindow.WriteLine("Content of the element : " + Xml.GetOuterXML(Bag2))TextWindow.WriteLine("") ' Second testItemE = Xml.GetNode(Bag2, "./item[@name="+Quote+"e"+Quote+"]")TextWindow.WriteLine("The element : " + ItemE) Name = Xml.GetNodeValue(Xml.GetNode(ItemE, "@name"))TextWindow.WriteLine("Name of the element : " + Quote + Name + Quote) TextWindow.WriteLine("")
Sample 3 : Interop
Args[0] = "Bonjour "Builder = Interop.CreateObject("System.Text.StringBuilder",Args)ClearArgs() Args[0] = "Objet StringBuilder créé !"Args[1] = "My TestApp for Interop"Interop.CallSharedSub("System.Windows.Forms.MessageBox", "Show", Args)ClearArgs() TextWindow.Write("Entrez votre nom ici : ") Args[0] = TextWindow.Read()Interop.CallSub(Builder, "Append", Args)ClearArgs() Args[0] = "L'objet StringBuilder semble avoir fonctionné correctement"Args[1] = "My TestApp for Interop"Interop.CallSharedSub("System.Windows.Forms.MessageBox", "Show", Args)ClearArgs() TextWindow.WriteLine(Interop.ToString(Builder)) Sub ClearArgs Args = ""EndSub
Reliable custom term paper and professional assistance are your assistants 24/7!
Sample 4 : Drawings and curve generator
GraphicsWindow.Show()
GraphicsWindow.BackgroundColor = "#FFEEDD"
' Closed curve points
Arr1[0]["X"] = 10
Arr1[0]["Y"] = 10
Arr1[1]["X"] = 10
Arr1[1]["Y"] = 40
Arr1[2]["X"] = 40
Arr1[2]["Y"] = 40
Arr1[3]["X"] = 40
Arr1[3]["Y"] = 10
' Normal curve points
Arr2 = Arr1
Arr2[4]["X"] = 10
Arr2[4]["Y"] = 10
' Create the graphics
MyCurve = FCDrawings.CreateGraphics(50,50)
MyPicture = FCDrawings.CreateGraphics(50,50)
' Draw the curves
FCDrawings.DrawCurve(MyCurve, "Blue", 3, Arr2)
FCDrawings.DrawClosedCurve(MyPicture, "Red", 3, Arr1)
' Generate the images to use in the Graphics Window
MyCurve = FCDrawings.GenerateImage(MyCurve)
MyPicture = FCDrawings.GenerateImage(MyPicture)
Shapes.Move(Shapes.AddImage(MyPicture), 50, 0)
Shapes.Move(Shapes.AddImage(MyCurve), 0, 0)
GraphicsWindow.ShowMessage("THE END!",":)")
Needs a file called AppIcon.png in the same directory as the *.sb
GraphicsWindow.Show() G = Drawings.CreateGraphics("AppIcon.png") Drawings.DrawLine(g, "Red", 5, -10,-10,50,50) Pts[0]["X"] = (5)Pts[0]["Y"] = (5)Pts[1]["X"] = (25)Pts[1]["Y"] = (10)Pts[2]["X"] = (45)Pts[2]["Y"] = (40)Drawings.DrawCurve(g, "Green", 3, Pts) Drawings.DrawEllipse(g, "Blue", 3, 5, 5, 60, 75) Drawings.DrawRectangle(G, "Yellow", 3, 40, 40, 20, 20) I = Drawings.GeneratePartialImage(g, 5, 5, 60, 75)Drawings.ReleaseGraphics(g)GraphicsWindow.Title = IControls.AddImage(I) G = Drawings.CreateGraphics(I)Drawings.SaveGraphicsToFile(G, "Result.png")Drawings.ReleaseGraphics(g)
©2015 arhivinfo.ru Все права принадлежат авторам размещенных материалов.