Forum | | | | KHR | Hello together
I Have time started with XProfan10 one prgramm To write, that I gladly to work benefit would like.
in the meantime runs one great part very well but with the first extensions be I quite us spin get.
here as example ein´Tool, that I To using gedenke: CompileMarkSeparation
proc Durchsatzkalkulator
Declare titel$, EditDialog%, ok%, cancel%,EditDialogEnde%
Declare Edit1&,Edit2&,Edit3&,Edit4&,Edit5&,Edit6&,Edit7&
titel$ = Durchsatzkalkulator für Freifall
EditDialog%= @Create(Dialog,%HWnd,Titel$,130,90,600,450)
startpaint EditDialog%
cls Farbe_Grau%
TextColor Farbe_Schwarz%, Farbe_grau%
UseFont Arial,17,0,1,0,0
drawtext 20, 19,Maximaldurchsatz
drawtext 260, 19,t/h
drawtext 20, 44,Nominaldurchsatz
drawtext 260, 44,t/h
drawtext 20, 69,Schüttgewicht
drawtext 260, 69,g/l
drawtext 20, 94,Rohrdurchmesser
drawtext 260, 94,t/h
drawtext 20,119,Fallhöhe
drawtext 260,119,m
drawtext 20,144,Fixgeschwindigkeit
drawtext 260,144,m/s
OK% = @Create(Button, EditDialog%,&Berechnen , 20, 350, 80,30)
CANCEL% = @Create(Button, EditDialog%,&Ende , 200, 350, 80,30)
@SetFocus(edit1&)
EditDialogEnde% = 0
NewStyle& = ~BS_RIGHT | ~BS_VCENTER
@Set(NumWidth,4)
@Set(Decimals,3)
Edit1& = @Create(Edit,EditDialog%, @str$(D_calc_Max_Durchsatz!) , 170 , 15 , 80 , 20)
Edit2& = @Create(Edit,EditDialog%, @str$(D_calc_Nom_Durchsatz!) , 170 , 40 , 80 , 20)
@Set(NumWidth,2)
@Set(Decimals,0)
Edit3& = @Create(Edit,EditDialog%, @str$(d_calc_Schuettgewicht&) , 170 , 65 , 80 , 20)
Edit4& = @Create(Edit,EditDialog%, @str$(D_calc_Durchmesser&) , 170 , 90 , 80 , 20)
@Set(Decimals,1)
Edit5& = @Create(Edit,EditDialog%, @str$(D_calc_Fallhoehe!) , 170 ,115 , 80 , 20)
Edit6& = @Create(Edit,EditDialog%, @str$(D_calc_Fixgeschw!) , 170 ,140 , 80 , 20)
WhileNot EditDialogEnde%
WaitInput
Case @Clicked(CANCEL%):EditDialogEnde% = 1
If @Clicked(OK%)
TextColor Farbe_Schwarz%, Farbe_grau%
UseFont Arial,17,0,1,0,0
D_calc_Max_Durchsatz! = @val(@GetText$(Edit1&))
D_calc_Nom_Durchsatz! = @val(@GetText$(Edit2&))
d_calc_Schuettgewicht& = @val(@GetText$(Edit3&))
D_calc_Durchmesser& = @val(@GetText$(Edit4&))
D_calc_Fallhoehe! = @val(@GetText$(Edit5&))
D_calc_Fixgeschw! = @val(@GetText$(Edit6&))
d_calc_Fallgeschwindigkeit! = 2*9.80665*D_calc_Fallhoehe!
d_calc_Fallgeschwindigkeit! = @sqrt(d_calc_Fallgeschwindigkeit!)
d_calc_rohrflaeche! = ((D_calc_Durchmesser&/1000 /2) ^2 )*@pi()
d_calc_Max_fuellung! = D_calc_Max_Durchsatz! * 9.80665
d_calc_Max_fuellung! = d_calc_Max_fuellung! / (d_calc_Fallgeschwindigkeit!* d_calc_rohrflaeche!
*(d_calc_Schuettgewicht&*1000))
d_calc_Max_fuellung! = d_calc_Fallgeschwindigkeit!*(D_calc_Durchmesser&/2000)^2*@Pi()*(d_calc_Schuettgewicht&*1000)
d_calc_Nom_fuellung! = D_calc_Nom_Durchsatz! * 1000000/3600 /d_calc_Max_fuellung! * 100
d_calc_Max_fuellung! = D_calc_Max_Durchsatz! * 1000000/3600 /d_calc_Max_fuellung! * 100
drawtext 310, 94 , Querschnitt
drawtext 470, 94 , m²
drawtext 310,119 , Geschwind.
drawtext 470,119 , m/s
@Set(NumWidth,2)
@Set(Decimals,2)
@Create(Text,EditDialog%,Nominal , 200 , 234 , 80 , 20 )
@Create(Text,EditDialog%,Maximal , 280 , 234 , 80 , 20 )
@Create(Text,EditDialog%,Rohrfüllung ( % ) , 20 , 234 , 160 , 20 )
@Create(Text,EditDialog%,m/s , 100 , 259 , 40 , 20 )
@Create(Text,EditDialog%,m/s , 100 , 284 , 40 , 20 )
TextColor Text_farbe_2%, Farbe_grau%
UseFont Arial,17,0,1,0,0
@Set(NumWidth,1)
@Set(Decimals,5)
drawtext 400, 94,@str$(d_calc_rohrflaeche!)
@Set(NumWidth,3)
@Set(Decimals,2)
drawtext 400,119,@str$(d_calc_Fallgeschwindigkeit!)
drawtext 210,259,@str$(d_calc_Nom_fuellung!)
drawtext 290,259,@str$(d_calc_Max_fuellung!)
drawtext 40,284,@str$(D_calc_Fixgeschw! )
drawtext 40,259,@str$(d_calc_Fallgeschwindigkeit!)
ElseIf @Clicked(CANCEL%)
EditDialogEnde% = 1
EndIf
EndWhile
endpaint
@DestroyWindow(EditDialog%)
endproc
Variablen Durchsatzkalkulator
Declare D_calc_Max_Durchsatz!
Declare D_calc_Nom_Durchsatz!
Declare D_calc_Durchmesser&
Declare D_calc_Fallhoehe!
Declare D_calc_Fixgeschw!
declare d_calc_Max_fuellung!
declare d_calc_Nom_fuellung!
declare d_calc_Fix_fuellung!
declare d_calc_Fallgeschwindigkeit!
declare d_calc_Schuettgewicht&
declare d_calc_rohrflaeche!
Declare Text_Farbe_1%
Declare Text_Farbe_2%
Declare Farbe_weiss%
Declare Farbe_schwarz%
Declare Farbe_grau%
Text_Farbe_1% = @RGB(0,176,0)
Text_Farbe_2% = @RGB(0,0,230)
Farbe_weiss% = @RGB(255,255,255)
Farbe_schwarz% = @RGB(0,0,0)
Farbe_grau% = @RGB(220,220,220)
D_calc_Max_Durchsatz! = 300
D_calc_Nom_Durchsatz! = 200
d_calc_Schuettgewicht& =1100
D_calc_Durchmesser& = 200
D_calc_Fallhoehe! = 2
D_calc_Fixgeschw! = 4.75
cls
Durchsatzkalkulator
OK OK, this is everything something ungeordnet and zusammengestückelt from Fragmenten from the Help and others Testprogrammen. I habs but from the large whole rausschneiden must and the code shows too yet right well different Versuchsstadien ( mixed between create(Text..) and drawtext,) and and and .... one verzeihe Please one Beginner!
my Problems are:
How I get by DrawText a spending on the rechten edge reported?
can I The Texts over ands over again with @Create(Text,..) in a Loop on the same Bildschirmposition teste spend or stapels itself then somewhere in the background The Text-items ?
what mach I, that not jedesmal The Backgroundcolor of my Dialogfensters on standard zurücksetzt, if it once in the background was.
Why vanish with this opportunity too same The DrawText-expenses? |
| | | Gruß Karl-Heinz WIN XP home/Pro / XPROFAN 11 / P2CPP ATMEL + BASCOM Fan | 03/16/08 ▲ |
| |
| | Rolf Koch | Have not any more plenty Time strain, only quick To Createtext: not new create, separate vorhandenes Textcontrol benefit and new Text reinschreiben: Settext handle&,New Text |
| | | | |
| | | @Karl: The Codesuche helps you here: [...] |
| | | | |
| | Frank Abbing | Hello Karl,
How I get by DrawText a spending on the rechten edge reported?
I have your code moreover time angepaßt: CompileMarkSeparation
proc Durchsatzkalkulator
Declare titel$, EditDialog%, ok%, cancel%,EditDialogEnde%
Declare Edit1&,Edit2&,Edit3&,Edit4&,Edit5&,Edit6&,Edit7&
Declare hdc&
titel$ = Durchsatzkalkulator für Freifall
EditDialog%= @Create(Dialog,%HWnd,Titel$,130,90,600,450)
startpaint EditDialog%
hdc&=%hdc
cls Farbe_Grau%
TextColor Farbe_Schwarz%, Farbe_grau%
UseFont Arial,17,0,1,0,0
SetTextAlign(hdc&,0)
drawtext 20, 19,Maximaldurchsatz
drawtext 20, 44,Nominaldurchsatz
drawtext 20, 69,Schüttgewicht
drawtext 20, 94,Rohrdurchmesser
drawtext 20,119,Fallhöhe
drawtext 20,144,Fixgeschwindigkeit
SetTextAlign(hdc&,2)
drawtext 290, 19,t/h
drawtext 290, 44,t/h
drawtext 290, 69,g/l
drawtext 290, 94,t/h
drawtext 290,119,m
drawtext 290,144,m/s
OK% = @Create(Button, EditDialog%,&Berechnen , 20, 350, 80,30)
CANCEL% = @Create(Button, EditDialog%,&Ende , 200, 350, 80,30)
@SetFocus(edit1&)
EditDialogEnde% = 0
NewStyle& = ~BS_RIGHT | ~BS_VCENTER
@Set(NumWidth,4)
@Set(Decimals,3)
Edit1& = @Create(Edit,EditDialog%, @str$(D_calc_Max_Durchsatz!) , 170 , 15 , 80 , 20)
Edit2& = @Create(Edit,EditDialog%, @str$(D_calc_Nom_Durchsatz!) , 170 , 40 , 80 , 20)
@Set(NumWidth,2)
@Set(Decimals,0)
Edit3& = @Create(Edit,EditDialog%, @str$(d_calc_Schuettgewicht&) , 170 , 65 , 80 , 20)
Edit4& = @Create(Edit,EditDialog%, @str$(D_calc_Durchmesser&) , 170 , 90 , 80 , 20)
@Set(Decimals,1)
Edit5& = @Create(Edit,EditDialog%, @str$(D_calc_Fallhoehe!) , 170 ,115 , 80 , 20)
Edit6& = @Create(Edit,EditDialog%, @str$(D_calc_Fixgeschw!) , 170 ,140 , 80 , 20)
WhileNot EditDialogEnde%
WaitInput
Case @Clicked(CANCEL%):EditDialogEnde% = 1
If @Clicked(OK%)
TextColor Farbe_Schwarz%, Farbe_grau%
UseFont Arial,17,0,1,0,0
D_calc_Max_Durchsatz! = @val(@GetText$(Edit1&))
D_calc_Nom_Durchsatz! = @val(@GetText$(Edit2&))
d_calc_Schuettgewicht& = @val(@GetText$(Edit3&))
D_calc_Durchmesser& = @val(@GetText$(Edit4&))
D_calc_Fallhoehe! = @val(@GetText$(Edit5&))
D_calc_Fixgeschw! = @val(@GetText$(Edit6&))
d_calc_Fallgeschwindigkeit! = 2*9.80665*D_calc_Fallhoehe!
d_calc_Fallgeschwindigkeit! = @sqrt(d_calc_Fallgeschwindigkeit!)
d_calc_rohrflaeche! = ((D_calc_Durchmesser&/1000 /2) ^2 )*@pi()
d_calc_Max_fuellung! = D_calc_Max_Durchsatz! * 9.80665
d_calc_Max_fuellung! = d_calc_Max_fuellung! / (d_calc_Fallgeschwindigkeit!* d_calc_rohrflaeche!
*(d_calc_Schuettgewicht&*1000))
d_calc_Max_fuellung! = d_calc_Fallgeschwindigkeit!*(D_calc_Durchmesser&/2000)^2*@Pi()*(d_calc_Schuettgewicht&*1000)
d_calc_Nom_fuellung! = D_calc_Nom_Durchsatz! * 1000000/3600 /d_calc_Max_fuellung! * 100
d_calc_Max_fuellung! = D_calc_Max_Durchsatz! * 1000000/3600 /d_calc_Max_fuellung! * 100
drawtext 310, 94 , Querschnitt
drawtext 470, 94 , m²
drawtext 310,119 , Geschwind.
drawtext 470,119 , m/s
@Set(NumWidth,2)
@Set(Decimals,2)
@Create(Text,EditDialog%,Nominal , 200 , 234 , 80 , 20 )
@Create(Text,EditDialog%,Maximal , 280 , 234 , 80 , 20 )
@Create(Text,EditDialog%,Rohrfüllung ( % ) , 20 , 234 , 160 , 20 )
@Create(Text,EditDialog%,m/s , 100 , 259 , 40 , 20 )
@Create(Text,EditDialog%,m/s , 100 , 284 , 40 , 20 )
TextColor Text_farbe_2%, Farbe_grau%
UseFont Arial,17,0,1,0,0
@Set(NumWidth,1)
@Set(Decimals,5)
drawtext 400, 94,@str$(d_calc_rohrflaeche!)
@Set(NumWidth,3)
@Set(Decimals,2)
drawtext 400,119,@str$(d_calc_Fallgeschwindigkeit!)
drawtext 210,259,@str$(d_calc_Nom_fuellung!)
drawtext 290,259,@str$(d_calc_Max_fuellung!)
drawtext 40,284,@str$(D_calc_Fixgeschw! )
drawtext 40,259,@str$(d_calc_Fallgeschwindigkeit!)
ElseIf @Clicked(CANCEL%)
EditDialogEnde% = 1
EndIf
EndWhile
endpaint
@DestroyWindow(EditDialog%)
endproc
DEF SetTextAlign(2) ! gdi32,SetTextAlign
Variablen Durchsatzkalkulator
Declare D_calc_Max_Durchsatz!
Declare D_calc_Nom_Durchsatz!
Declare D_calc_Durchmesser&
Declare D_calc_Fallhoehe!
Declare D_calc_Fixgeschw!
declare d_calc_Max_fuellung!
declare d_calc_Nom_fuellung!
declare d_calc_Fix_fuellung!
declare d_calc_Fallgeschwindigkeit!
declare d_calc_Schuettgewicht&
declare d_calc_rohrflaeche!
Declare Text_Farbe_1%
Declare Text_Farbe_2%
Declare Farbe_weiss%
Declare Farbe_schwarz%
Declare Farbe_grau%
Text_Farbe_1% = @RGB(0,176,0)
Text_Farbe_2% = @RGB(0,0,230)
Farbe_weiss% = @RGB(255,255,255)
Farbe_schwarz% = @RGB(0,0,0)
Farbe_grau% = @RGB(220,220,220)
D_calc_Max_Durchsatz! = 300
D_calc_Nom_Durchsatz! = 200
d_calc_Schuettgewicht& =1100
D_calc_Durchmesser& = 200
D_calc_Fallhoehe! = 2
D_calc_Fixgeschw! = 4.75
cls
Durchsatzkalkulator
can I The Texts over ands over again with @Create(Text,..) in a Loop on the same Bildschirmposition teste spend or stapels itself then somewhere in the background The Text-items ?
Yes, The stapeln itself then. You can using Controls but with DestroyWindow(controlhandle&) anytime enable. i'd but solid Controls using and not constantly new Generate.
what mach I, that not jedesmal The Backgroundcolor of my Dialogfensters on standard zurücksetzt, if it once in the background was.
The simplest Possibility is it, your Controls and Texts directly on the Mainwindow to drawing. and quite no Dialog-Window To using.
Why vanish with this opportunity too same The DrawText-expenses?
for the Neuzeichen on Dialogfenstern is the Programmer self zuständig. at that Mainwindow helps you XProfan. therefore my Tipp with the Mainwindow. |
| | | | |
| | Jörg Sellmeyer | i'd on your place too The DrawText-expenses with a Textcontrol (Create(Text,...)) manage. Erspart you the ständige Redraw. If you with Create(Text,...) one Textcontrol erstellst must You you the lever Save. then can You anytime whom Text Change: CompileMarkSeparation |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/16/08 ▲ |
| |
| | KHR | Hello together
thanks for Your Time and Your Answer,
now becomes me there already some klarer. from whom Codesnippets Have I me then too yet some zusammengesucht. Irgedwie Have I before always to whom incorrect Begriffen sought. one must with each tool hold bypass learn,
ok - usually work so did i with handles with create(TEXTS.... habs but at zusammenschustern overlooking and not dran virtual, that itself a of my ask with richtigem Use with the Language already Done has.
in the meantime sees the whole by me now already much better from |
| | | Gruß Karl-Heinz WIN XP home/Pro / XPROFAN 11 / P2CPP ATMEL + BASCOM Fan | 03/16/08 ▲ |
| |
|
AnswerThemeninformationenthis Topic has 5 subscriber: |