Examples | | | | - Page 1 - |
|  Micha12334 | Hello people, I tried time a simple App to Gewichtskontrolle, to Discussion and to view To edit. Schreib, What is badly, zerreißt it, what could one rather make. i know, what first thing comes: clinging enfernen,....ok comes yet. have everything on my tab Lenovo 2 and Samsung s6 tested. goes so to some extent... (Lenovo = A:5.01, s6= A:5.1.1)
//
// InfinityProfan Program
// Gewichtskontrolle v0.0.1
// created 2016-01-24
var grid =gui.grid(gui.hwnd,[2,5])
var Text1 = "Gewichts- \n control \n in (kg) on the: "
var altg = float(altg)
var neug = 0.00
var diff
var neug = float(neug)
var time1 = time(7)
var time2
var E
//var btnE = gui.button,[grid,2,5],"AUS",end
altg = file.read("gewicht.txt")
time2= file.read("datum.txt")
gui.background(grid,rgb(50,50,50))
gui.background([grid,1,2],rgb(90,90,90))
gui.background([grid,2,2],rgb(90,90,90))
gui.background([grid,1,3],rgb(130,130,130))
gui.background([grid,2,3],rgb(130,130,130))
gui.background([grid,1,4],rgb(150,150,150))
gui.background([grid,2,4],rgb(150,150,150))
gui.background([grid,1,5],rgb(130,130,130))
gui.background([grid,2,5],rgb(100,0,0))
gui.Text[grid,1,1] Text1
gui.Text[grid,2,1] time1
gui.Text[grid,1,2] "Gewicht on the \n"+time2
gui.Text[grid,2,2] altg
gui.Text[grid,1,3] " Neueingabe:"
gui.Text[grid,2,3] "HIER drücken" @proc1
gui.Text[grid,1,4] "Differenz:"
gui.Text[grid,2,5] "E n D E " @proc2
proc proc1
gui.background([grid,2,3],rgb(255,255,255))
msg.box zero,zero,"OKAY","",@new
endproc
proc new btn txt
if st(btn) == 1
if txt <> 0
neug = txt
diff = altg - neug
diff = round(diff,[3])
gui.Text[grid,2,4] diff
file.write("gewicht.txt",neug)
file.write("datum.txt",time1)
gui.Text[grid,1,5] "Neugewicht \n= "+neug +" kg"
msg.box, " weight is stored ",zero,["OKAY"],zero,go
endif
endif
endproc
proc go btn txt
if st(btn) == 1
proc2
endif
endproc
proc proc2
msg.box " ON WIEDERSEHEN ",zero,["OKAY"],zero,E
sleep 5000
end
endproc
|
 | | | | |
| | | | | - Page 1 - |
|  Micha12334 | - The problem with the Eingabebox exit by me on. I shoved it on my Android... i see with the whom Übereinanderlegen the Textcontrols not. diff lying on 2,4 and neug with 1,5. What is here wrong? the sleep I will to your suggestion Change. I thanks you for speedy response. such corrections are a large Help for me. Micha12333 |
| | | | |
| |  | @Micha:
with
msg.box " ON WIEDERSEHEN ",zero,["OKAY"],zero,E
understand I E not because e in Your example on no procaddr shows.
@Karl: should I sleep vlt. rather to dev.thread.sleep move out from the root?
msgbox sleep end
lead Yes only moreover, that 5 sec long no msgbox showing can and thereafter same terminates. |
| | | | |
| |  Micha12334 | Yes Karl, show me Please, How the goes. I teste this with a timer....
the "E" I had forgotten rauszuhauen. sometimes happens so what on the late evening..... |
| | | | |
| |  | HofK (23.02.2016)
strange:
The Eingabedialog Box with OKAY appear twice, the dialog "Gewicht is gespeichert" not.
must it, the proc1 missing The Auswertung the Parameter ctrl state -
only State==1 ought to tappt im dunkeln trigger.
state=0: draufgetatzt state=1: weggetatzt (on state 1 Verify for Click!) state=2: weggetatzt outside "Button" (User has differently decided) |
| | | | |
| |  HofK | the gui.Text with the Stati 0, 1, 2 was well not yet documents? sound but logical.
@Micha: gui.Text [grid,s,z] "irgendwas" created on the Gridzelle each one new Textcontrol. The commands supply too a handle the Controls back. the can/ought to one itself with want (is here given) in a variables z.B. hTxt remember. The Text self is first empty ("").
var hTxt=gui.Text [grid,2,4] ""
want one now Text the bestehende Textcontrol bring, then mus with gui.Text not the handle of an Gridzelle, separate the lever one existing Textcontrols indicated go. means here z.B. hTxt.
gui.Text hTxt "irgendwas anderes"
in your example could one see, as inputted numbers really übereinander "gezeichnet" go, there You in the course several Textcontrols on the identischen cell beget if one new Inputs power. too calm for special effects.
your "Fehler" have so did i self first made. [...] my Einwand was then, a extra commands gui.settext to have, the only on Textcontrols without Error Message durchgeht.
but How always - it has to- and detriments. David must weigh. |
| | | | |
| |  Micha12334 | right many Thanks on you, the help me moreover what about me Have dazugelernt! therefore publish so did i my small Test. 'Learn by doing' is the Motto for me. Micha12334 |
| | | | |
| |  Micha12334 | Hello people, have the Programmchen "Gewichtskontrolle" revised. I faith, so could one it release:
// InfinityProfan Program
// new-g v0.0.1
// created 2016-02-29
grid =gui.grid(gui.hwnd,[2,5])
Text1 = "Gewichts- \n control \n in (kg) on the: "
time
altg = 0
neug = 0.00
time1 = time(7)
altg = file.read("masse.txt")
time2= file.read("heute.txt")
gui.background(grid,rgb(0,0,100))
gui.background([grid,1,2],rgb(90,90,90))
gui.background([grid,2,2],rgb(90,90,90))
gui.background([grid,1,3],rgb(130,130,130))
gui.background([grid,2,3],rgb(130,130,130))
gui.background([grid,1,4],rgb(150,150,150))
gui.background([grid,2,4],rgb(150,150,150))
gui.background([grid,1,5],rgb(130,130,130))
gui.background([grid,2,5],rgb(0,0,100))
gui.Text [grid,1,1] Text1
gui.Text [grid,2,1] time1
gui.Text [grid,1,2] "Gewicht on the \n"+time2
gui.Text [grid,2,2] altg
gui.Text [grid,1,3] " Neueingabe:"
gui.Text [grid,2,3] "HIER drücken" @proc1
gui.Text [grid,1,4] "Differenz:"
gui.Text [grid,2,5] "E n D E " @proc2
proc proc1 ctrl state
global grid
if state==1
gui.background([grid,2,3],rgb(255,255,255))
msg.box zero,zero,"OKAY","",@new
endif
endproc
proc new btn txt
global grid,neug,altg,time1
if btn==1
if txt!=""
neug = txt
diff = altg - neug
diff = round(diff,[3])
gui.Text[grid,2,4] diff
if diff < 0
gui.background([grid,1,4],rgb(150,50,50))
gui.background([grid,2,4],rgb(150,50,50))
endif
if diff > 0
gui.background([grid,1,4],rgb(50,150,50))
gui.background([grid,2,4],rgb(50,150,50))
endif
file.write("masse.txt",neug)
file.write("heute.txt",time1)
gui.Text[grid,1,5] "Neugewicht \n= "+neug +" kg"
msg.box " weight is stored ",zero,["OKAY"],zero,@go
endif
endif
endproc
proc go btn
case btn==1 : proc2
endproc
proc proc2
end msg.box " ON WIEDERSEHEN ",zero,["bye"]
endproc
testing it self once and schaut to bugs and Optik-..... |
| | | | |
| |  | be already on the drüberstürzen -
quasi with toothbrush and Duschkopf in the hand. ^^
here one Vertipper sure: diff = round(diff,[3]) instead of round(diff,3)
hint: with function long a String To long force z.B. for: mywert=long(file.read("file")) or. mywert=long file.read "file"
Mist, must long ago go... to date evening! |
| | | | |
| | | | - Page 2 - |
| |  HofK | with proc proc2
end msg.box " ON WIEDERSEHEN ",zero,["bye"] endproc
would possible better:
msg.toast " ON WIEDERSEHEN " end |
| | | | |
| |  Micha12334 | Yes, with toast and box have already rumgespielt. Toast sees on the Samsung s6 rather from, lose itself but on my Tablet. there is Box rather. the lying sure on whom Größenverhältnissen zueinander.... |
| | | | |
| |  HofK | The difference becomes by me ( Galaxy note 2 in the Landscape) of dialog überdeckt and is then not visible. |
| | | | |
| |  Micha12334 | would it something bring, "screen.rotation.top" einzufügen? Perhaps could so did i whom dialog Change... |
| | | | |
|
AnswerTopic-Options | 15.004 Views |
Themeninformationenthis Topic has 3 subscriber: |