English
Forum

Tasterfunktion with Rolltor link

 
Hi,

means now I already a little bit moreover be with my Program have I here yet The small problem whom keyboard means by Mousepressed with the Rolltor To link. means i will the Rolltor by keyboard (but only as long as it pressed becomes) high and runterfahren let, once one The Button loslässt should the goal but stand stay.
CompileMarkSeparation
Window 1,1 - 1024,768
cls
declare hBild1&,hBild2&,hBild3&,hBild4&,hBild5&,hBild6&,hBild7&,hBild8&\
,hBild9&,hBild10&,hBild11&,hBild12&,hBild13&,hBild14&,hBild15&,hBild16&

Proc BMP

    hBild1&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tagn0.BMP")
    hBild2&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tagn1.BMP")
    hBild3&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tart0.BMP")
    hBild4&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tart1.BMP")
    hBild5&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\nota1.BMP")
    hBild6&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\trt1.BMP")
    hBild7&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\trt0.BMP") ;Störungsleuchte ein
    hBild8&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tabl0.BMP")
    hBild9&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tge0.BMP")
    hBild10& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tgn1.BMP")
    hBild11& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\sertar1.BMP")
    hBild12& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\sertar0.BMP")
    hBild13& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\objekte\\druckzr.BMP")
    hBild14& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\objekte\\emotl1.BMP")
    hBild15& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\lichtschr.BMP")
    hBild16& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\objekte\\rolltor.BMP")

Endproc

Proc BMP1

    roundrect 600,130-500,300;30,30
    rectangle 1,290-200;0
    DrawSizedPic hBild1&,40,50 - 30,30;0
    DrawSizedPic hBild1&,40,210 - 30,30;0
    DrawSizedPic hBild1&,40,170 - 30,30;0
    DrawSizedPic hBild1&,40,250 - 30,30;0
    DrawSizedPic hBild3&,40,130 - 30,30;0
    DrawSizedPic hBild3&,40,10 - 30,30;0
    DrawSizedPic hBild5&,120,10 - 30,30;0
    DrawSizedPic hBild8&,120,50 - 30,30;0
    DrawSizedPic hBild6&,120,130 - 30,30;0
    DrawSizedPic hBild9&,120,170 - 30,30;0
    DrawSizedPic hBild10&,120,210 - 30,30;0
    DrawSizedPic hBild10&,225,125 - 30,30;0
    DrawSizedPic hBild10&,225,215 - 30,30;0
    DrawSizedPic hBild6&,225,305 - 30,30;0
    DrawSizedPic hBild12&,255,305 - 30,30;0
    DrawSizedPic hBild11&,255,215 - 30,30;0
    DrawSizedPic hBild12&,255,125 - 30,30;0
    DrawSizedPic hBild13&,420,305 - 30,30;0
    DrawSizedPic hBild14&,420,120 - 40,40;0
    DrawSizedPic hBild15&,390,350 - 30,30;0
    rem DrawSizedPic hBild16&,270,130 - 160,220;0
    DrawSizedPic hBild3&,510,140 - 30,30;0
    DrawSizedPic hBild1&,510,180 - 30,30;0
    DrawSizedPic hBild1&,510,220 - 30,30;0
    DrawSizedPic hBild1&,510,260 - 30,30;0

Endproc

Proc Texte

    Locate 2,2
    Print "Aus"
    Locate 5,2
    Print "Ein"
    Locate 8,5
    Print "Anlage"
    Locate 12,2
    Print "STOP"
    Locate 15,2
    Print "AUF"
    Locate 18,2
    Print "HALB"
    Locate 21,2
    Print "ZU"
    Locate 23,6
    Print "Tor"
    Locate 2,10
    Print "Notaus"
    Locate 5,10
    Print "verriegelt"

endproc

rem Ausführung der Prozeduren
BMP
BMP1
Texte

Proc Taster1

    While %mousepressed

        DrawSizedPic hBild2& ,40 , 50 - 30, 30; 0

    EndWhile

    DrawSizedPic hbild1& ,40 , 50 - 30, 30; 0

Endproc

Proc Rolltor

    mLoadBmp "D:\\Xprofan\\BMP\\Objekte\\rolltor.BMP"
    startPaint -1
    usepen 0,0,$FFFFFF
    line 0,181 - 127,181
    endPaint

endproc

Proc Torzu

    whileLoop 182,0,-1

        mCopyBmp 0,&loop - 127,182 > 290,140 ; 0
        sleep 30

    wend

endproc

Proc Torauf

    Taster1

    whileLoop 182

        mCopyBmp 0,&loop - 127,182 > 290,140 ; 0
        sleep 30

    wend

endproc

Rolltor
Torzu
Torauf

While 1

    waitinput

    if @Mouse (40,50 - 30,30)

        offset%=0
        Taster1

    Elseif @Mouse (40,50 - 30,90)

        offset%=50
        Taster1

    Elseif @Mouse (40,50 - 30,140)

        offset%=100
        Taster1

    Elseif @Mouse (10,0 - 30,190)

        offset%=150
        Taster1

    else

        @Mouse (10,160 - 30,190)
        Break

    Endif

Endwhile

Proc Rolltor

    mLoadBmp "D:\\Xprofan\\BMP\\Objekte\\rolltor.BMP"
    startPaint -1
    usepen 0,0,$FFFFFF
    line 0,181 - 127,181
    endPaint

endproc

Proc Torzu

    whileLoop 182,0,-1

        mCopyBmp 0,&loop - 127,182 > 100,100 ; 0
        sleep 30

    wend

endproc

Proc Torauf

    waitInput

    whileLoop 182

        mCopyBmp 0,&loop - 127,182 > 100,100 ; 0
        sleep 30

    wend

endproc

Rolltor
 href='./../../references-fonction/XProfan/torzu/'>Torzu
Torauf
end

921 kB
Version:11
Kurzbeschreibung: Bitmaps for the Program
Hochgeladen:06/22/11
Downloadcounter88
Download
 
06/22/11  
 



in the Endeffekt must I hold know How I best The prozeduren means The keyboard and the goal together verknüpfe. whether I with the mouseclicked or @mouse etc. try should, it would beautiful if someone one small example basteln could
 
06/22/11  
 



simply so:
CompileMarkSeparation
cls
declare torhoehe&
var tor&=createText(%hWnd,"Tor",0,0,0,0)

while 1

    waitinput 10

    if external("user32","GetAsyncKeyState",1)

        case torhoehe&<100 : inc torhoehe&

    else

        case torhoehe& : dec torhoehe&

    endif

    setWindowPos tor&=10,10 - 100,torHoehe&;0

wend

 
06/22/11  
 




Jörg
Sellmeyer
If you now both Mouse buttons verwendest, functions it How desired:
CompileMarkSeparation
cls
declare torhoehe&
var tor&=createText(%hWnd,"Tor",0,0,0,0)

while 1

    waitinput 10

    if external("user32","GetAsyncKeyState",1)

        case torhoehe&<100 : inc torhoehe&

    Elseif external("user32","GetAsyncKeyState",2)

        case torhoehe& : dec torhoehe&

    endif

    setWindowPos tor&=10,10 - 100,torHoehe&;0

wend

 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/22/11  
 



Or IsKey:
CompileMarkSeparation
cls
declare torhoehe&
var tor&=createText(%hWnd,"Tor",0,0,0,0)

while 1

    waitinput 10
    torhoehe&=range(torhoehe&+iskey(1)*1+iskey(2)*-1,0,100)
    setWindowPos tor&=10,10 - 100,torHoehe&;0

06/22/11  
 




Jörg
Sellmeyer
here can yet something Rechenarbeit save:
CompileMarkSeparation
torhoehe&=range(torhoehe&+iskey(1)-iskey(2),0,100)
>

Why goes not with the Keycodes for "+"And "-"? with a and b geht's...
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/22/11  
 



Hi, hehe and thanks. ought to before before I the machine first the program on itself a little bit übersichtlicher style I must say have nevertheless with XProfan my difficulty, i'll me on the side another little with C# Visual studio keep busy, Perhaps lying me the simply More
 
06/23/11  
 



except the one so Formulare beautiful zusammenklicken can is everything else really only umständlicher as with XProfan. the goal and the Control would have z.B. in Timer auslagern must and so becomes z.B. from apparently "einfachem Handling" quick übler unzusammenhängender code.
 
06/23/11  
 



Oha, therefore blockier I there so hm hm Timer, time Help befragen^^ but thanks, nevertheless find I The nice context-function the command a la Excel very beautiful in VS C#, helps ungemein moreover but try now time whom Timer there with einzubinden in Profan and times look, will be probably the Prog then again new write, since the übersichtlichkeit because of the volume already not any more given is. I find Profan hold sometimes in the Syntax right komplex
 
06/23/11  
 



means around the whole time To verkleinern can I The downstairs procedure too through Loop to of/ one smaller summarize in the it itself over ands over again the Images bedient? without that I now How before each single Image new load?
CompileMarkSeparation
Proc BMP

    hBild1&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tagn0.BMP")
    hBild2&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tagn1.BMP")
    hBild3&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tart0.BMP")
    hBild4&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tart1.BMP")
    hBild5&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\nota1.BMP")
    hBild6&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\trt1.BMP")
    hBild7&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\trt0.BMP") ;Störungsleuchte ein
    hBild8&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tabl0.BMP")
    hBild9&  = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tge0.BMP")
    hBild10& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\tgn1.BMP")
    hBild11& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\sertar1.BMP")
    hBild12& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\sertar0.BMP")
    hBild13& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\objekte\\druckzr.BMP")
    hBild14& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\objekte\\emotl1.BMP")
    hBild15& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\Schalter\\lichtschr.BMP")
    hBild16& = @create ("HPic",-1,"D:\\Xprofan\\BMP\\objekte\\rolltor.BMP")

Endproc

 
06/23/11  
 




Jörg
Sellmeyer
i'd on your place only one or two Images use.
The integrally simple Variante would then so:
CompileMarkSeparation
Declare bmp$,hBmp&,stBmp&
bmp$ = "Tor.bmp"
hBmp& = Create("hPic",-1,bmp$)
cls
declare torhoehe&
var tor&=Create("Bitmap",%hWnd,hBmp&,0,0,0,0)

while 1

    waitinput 10
    torhoehe&=range(torhoehe&+iskey(1)*1+iskey(2)*-1,0,100)
    setWindowPos tor&=10,10 - 100,torHoehe&;0


3 kB
Hochgeladen:06/23/11
Downloadcounter58
Download
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/23/11  
 



OK everything clear, Yes the trouble is the we for a real Rolltor hold The panel copies having around the whole later on the PC by SPS fernsteuern to. therefore are because of the keyboard and Sensoren etc. The whole Images necessary.

and through my "spezielle" Übersichtlichkeit is not integrally sooo simply

but i'll me the same again look at, because with c# have I already in 5mins NEN Taschenrechner gebastelt over several modes.
power joke, XProfan is against it naturally komplexer,means find I at least....
 
06/23/11  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

9.189 Views

Untitledvor 0 min.
Ernst04/30/14
ho.schu03/08/13
RudiB.11/08/12
Pedro Miguel09/13/12
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie