Eingabefeld
Übersicht

FlorianBetreff: Eingabefeld |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Code: [AUSKLAPPEN] Type InputBoxTyp Field X1,X2 Field Y1,Y2 Field Tab Field Status Field Cursor Field CursorBreit Field MarkiertX1 Field MarkiertX2 Field Markiert Field Text$ Field MaxLang Field CursorFarbe Field TextFarbe[1] Field HTextFarbe[1] Field Ins End Type Const Aktiv=1 Const inaktiv=2 Type TSchalter Field Bezeichnung$ Field AlternativeBezeichnung$ Field BezeichnungFarbe Field transparent Field X,Y Field XZ,YZ Field X2,Y2 Field Image Field Sound Field Status Field Name$ Field Wert End Type Type TButton Field Name$ Field Image Field transparent Field ImageMaske Field LadenAbBild Field Breit,Hoch Field DateiName$ End Type Const Ordner_Konnte_Nicht_auslesen_Werden=2 Const COrdner=2 Const CDatei=1 Type DateiListeTyp Field Ordner$ Field Dateiname$ Field Erweiterung$ End Type Global Schalter.TSchalter Global Button.TButton Global DateiListe.DateiListeTyp Graphics 640,480,0,2 SetBuffer BackBuffer() SetFont LoadFont("Arial",24,False,False,False) SetFont LoadFont("Courier New",24,False,False,False) Global InputBox.InputBoxTyp Global Strg Global Alt Global Shift Global AltGr Global KeyTimer Global RepeatTime = 100 ;--> Repetierzeit Global TimeToRepeat = 500 ;--> Zeit bis zum Einsetzen des Repeatiervorgangs Global Key$ Global MausTaste[3] Global ClipBoard$="" InputBox=New InputBoxTyp InputBox\X1=50 InputBox\Y1=50 InputBox\X2=400 InputBox\Y2=24 InputBox\Text$="" InputBox\CursorFarbe=Farbe(0,0,0) InputBox\Cursor=1 InputBox\MaxLang=30 InputBox\Ins=True InputBox\TextFarbe[0]=Farbe(0,0,0) InputBox\HTextFarbe[0]=Farbe(255,255,255) InputBox\CursorBreit=2 InputBox\Tab=1 InputBox=New InputBoxTyp InputBox\X1=50 InputBox\Y1=150 InputBox\X2=400 InputBox\Y2=24 InputBox\Text$="" InputBox\CursorFarbe=Farbe(0,0,0) InputBox\Cursor=1 InputBox\MaxLang=30 InputBox\Ins=True InputBox\Tab=2 InputBox\TextFarbe[0]=Farbe(0,0,0) InputBox\HTextFarbe[0]=Farbe(255,255,255) InputBox\CursorBreit=2 InputBox\Status=Aktiv InputBox=New InputBoxTyp InputBox\X1=50 InputBox\Y1=250 InputBox\X2=400 InputBox\Y2=24 InputBox\Text$="" InputBox\Tab=3 InputBox\CursorFarbe=Farbe(0,0,0) InputBox\Cursor=1 InputBox\MaxLang=30 InputBox\Ins=True InputBox\TextFarbe[0]=Farbe(0,0,0) InputBox\HTextFarbe[0]=Farbe(255,255,255) InputBox\CursorBreit=2 ClsColor 92,92,92 Timer=CreateTimer(10) Repeat Cls Keyboad MausUpdate Key DrawInputBox Flip WaitTimer Timer Forever Function Key() For InputBox=Each InputBoxTyp If InputBox\Status=Aktiv Then If Asc(Key$)>31 Then If InputBox\Markiert=True Then InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+Mid$(InputBox\Text,InputBox\MarkiertX2+InputBox\MarkiertX1+1) InputBox\Markiert=False InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+Key$+Mid$(InputBox\Text,InputBox\MarkiertX1+1) InputBox\Cursor=InputBox\MarkiertX1+1 Else If InputBox\MaxLang>Len(InputBox\Text) Then If InputBox\Ins=True Then If InputBox\Cursor>Len(InputBox\Text) Then If InputBox\Cursor<InputBox\MaxLang Then InputBox\Text=InputBox\Text+String$(" ",InputBox\Cursor-Len(InputBox\Text)) InputBox\Text=Mid$(InputBox\Text,1,InputBox\Cursor)+Key$+Mid$(InputBox\Text,InputBox\Cursor+1) InputBox\Cursor=InputBox\Cursor+1 End If Else InputBox\Text=Mid$(InputBox\Text,1,InputBox\Cursor)+Key$+Mid$(InputBox\Text,InputBox\Cursor+1) InputBox\Cursor=InputBox\Cursor+1 End If Else If InputBox\Cursor>Len(InputBox\Text) Then If InputBox\Cursor<InputBox\MaxLang Then InputBox\Text=InputBox\Text+String$(" ",InputBox\Cursor-Len(InputBox\Text)) InputBox\Text=Mid$(InputBox\Text,1,InputBox\Cursor)+Key$+Mid$(InputBox\Text,InputBox\Cursor+2) InputBox\Cursor=InputBox\Cursor+1 End If Else InputBox\Text=Mid$(InputBox\Text,1,InputBox\Cursor)+Key$+Mid$(InputBox\Text,InputBox\Cursor+2) InputBox\Cursor=InputBox\Cursor+1 End If End If End If End If Else If Shift=False And Strg=False Then Select Asc(Key$) Case 1;Pos1 InputBox\Cursor=0 InputBox\Markiert=False Case 2;Ende InputBox\Cursor=Len(InputBox\Text) InputBox\Markiert=False Case 3;Einfügen InputBox\Ins=True-InputBox\Ins Case 4;Entf If InputBox\Markiert=True Then InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+Mid$(InputBox\Text,InputBox\MarkiertX2+InputBox\MarkiertX1+1) InputBox\Markiert=False Else If Len(InputBox\Text)>InputBox\Cursor Then If InputBox\Markiert=True Then InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+Mid$(InputBox\Text,InputBox\MarkiertX2+InputBox\MarkiertX1+1) InputBox\Markiert=False Else InputBox\Text=Mid$(InputBox\Text,1,InputBox\Cursor)+Mid$(InputBox\Text,InputBox\Cursor+2) End If End If End If Case 8;Del If InputBox\Markiert=True Then InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+Mid$(InputBox\Text,InputBox\MarkiertX2+InputBox\MarkiertX1+1) InputBox\Markiert=False Else If Len(InputBox\Text)>0 And InputBox\Cursor=>1 And Len(InputBox\Text)-InputBox\Cursor=>0 Then InputBox\Text=Mid$(InputBox\Text,1,InputBox\Cursor-1)+Mid$(InputBox\Text,InputBox\Cursor+1) InputBox\Cursor=InputBox\Cursor-1 ElseIf InputBox\Cursor=>1 Then InputBox\Cursor=InputBox\Cursor-1 End If End If Case 9 ;Tab TabNr=InputBox\Tab For InputBox=Each InputBoxTyp If TabNr<InputBox\Tab Then If InputBox\Tab<MaxTab Or MaxTab=0 Then MaxTab=InputBox\Tab End If End If If InputBox\Tab<TabNr Then If MinTab=0 Or MinTab>InputBox\Tab Then minTab=InputBox\Tab End If End If Next If MaxTab<>TabNr And MaxTab<>0 Then InputBoxNrNeu=MaxTab Else InputBoxNrNeu=minTab End If If InputBoxNrNeu>0 Then For InputBox=Each InputBoxTyp InputBoxZaehler=InputBoxZaehler+1 If InputBoxNrNeu=InputBoxZaehler Then InputBox\Status=Aktiv Else If InputBox\Status=Aktiv Then InputBox\Status=InAktiv End If End If Next End If Return Case 13;Enter TabNr=InputBox\Tab For InputBox=Each InputBoxTyp If TabNr<InputBox\Tab Then If InputBox\Tab<MaxTab Or MaxTab=0 Then MaxTab=InputBox\Tab End If End If If InputBox\Tab<TabNr Then If MinTab=0 Or MinTab>InputBox\Tab Then minTab=InputBox\Tab End If End If Next If MaxTab<>TabNr And MaxTab<>0 Then InputBoxNrNeu=MaxTab Else InputBoxNrNeu=minTab End If If InputBoxNrNeu>0 Then For InputBox=Each InputBoxTyp InputBoxZaehler=InputBoxZaehler+1 If InputBoxNrNeu=InputBoxZaehler Then InputBox\Status=Aktiv Else If InputBox\Status=Aktiv Then InputBox\Status=InAktiv End If End If Next End If Return Case 27;ESC Case 31;links If InputBox\Cursor>=1 Then InputBox\Cursor=InputBox\Cursor-1 End If InputBox\Markiert=False Case 30;rechts If InputBox\MaxLang>InputBox\Cursor Then InputBox\Cursor=InputBox\Cursor+1 End If InputBox\Markiert=False End Select ElseIf Shift=False And Strg=True Then If KeyDown(30) Then;Strg+A If Len(InputBox\Text)>0 Then InputBox\MarkiertX1=0 InputBox\MarkiertX2=Len(InputBox\Text) InputBox\Markiert=True End If End If If KeyDown(46) Then ;Strg+C If InputBox\Markiert=True Then ClipBoard$=Mid$(InputBox\Text,InputBox\MarkiertX1+1,InputBox\MarkiertX2) End If End If If KeyDown(47) Or KeyDown(210) Then ;Strg+V Strg+Einfg If Len(ClipBoard$)>0 Then If InputBox\Markiert=True Then InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+Mid$(InputBox\Text,InputBox\MarkiertX2+InputBox\MarkiertX1+1) InputBox\Markiert=False InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+ClipBoard$+Mid$(InputBox\Text,InputBox\MarkiertX1+1) InputBox\Cursor=InputBox\MarkiertX1+Len(ClipBoard$) ElseIf InputBox\Ins=True Then InputBox\Text=InputBox\Text+String$(" ",InputBox\Cursor-Len(InputBox\Text)) InputBox\Text=Mid$(InputBox\Text,1,InputBox\Cursor)+ClipBoard$+Mid$(InputBox\Text,InputBox\Cursor+1) InputBox\Cursor=InputBox\Cursor+Len(ClipBoard$) Else If InputBox\Cursor>Len(InputBox\Text) Then InputBox\Text=InputBox\Text+String$(" ",InputBox\Cursor-Len(InputBox\Text)) InputBox\Text=InputBox\Text+ClipBoard$ InputBox\Cursor=InputBox\Cursor+Len(ClipBoard$) Else InputBox\Text=Mid$(InputBox\Text,1,InputBox\Cursor)+ClipBoard$+Mid$(InputBox\Text,InputBox\Cursor+Len(ClipBoard$)) InputBox\Cursor=InputBox\Cursor+Len(ClipBoard$) End If End If End If End If If KeyDown(45) Then;Strg+X If InputBox\Markiert=True Then ClipBoard$=Mid$(InputBox\Text,InputBox\MarkiertX1+1,InputBox\MarkiertX2) InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+Mid$(InputBox\Text,InputBox\MarkiertX2+InputBox\MarkiertX1+1) InputBox\Markiert=False End If End If If KeyDown(203) Then ;Strg+links Leerzeichen=False InputBox\Markiert=False If InputBox\Cursor>Len(InputBox\Text) Then InputBox\Cursor=Len(InputBox\Text) End If If InputBox\Cursor>0 Then For Pos=InputBox\Cursor-1 To 1 Step -1 If Mid$(InputBox\Text,Pos,1)=" " Then Leerzeichen=True Else If Leerzeichen=True Then Exit End If End If Next End If InputBox\Cursor=Pos End If If KeyDown(205) Then ;Strg+rechts InputBox\Markiert=False If InputBox\Cursor>Len(InputBox\Text) Then InputBox\Cursor=Len(InputBox\Text) End If If InputBox\Cursor<Len(InputBox\Text) Then For Pos=InputBox\Cursor+1 To Len(InputBox\Text) If Mid$(InputBox\Text,Pos,1)=" " Then Leerzeichen=True Else If Leerzeichen=True Then Exit End If End If Next InputBox\Cursor=Pos-1 End If End If If KeyHit(21) Then End If ElseIf Shift=True And Strg=False Then If KeyDown(205) Then ;Shift+rechts If InputBox\Markiert=True Then If InputBox\MarkiertX1<InputBox\Cursor Then InputBox\MarkiertX1=InputBox\MarkiertX1+1 InputBox\MarkiertX2=InputBox\MarkiertX2-1 If InputBox\MarkiertX2=0 Then InputBox\Markiert=False Else If InputBox\MarkiertX1+InputBox\MarkiertX2<Len(InputBox\Text) Then InputBox\MarkiertX2=InputBox\MarkiertX2+1 End If End If Else If InputBox\Cursor=<Len(InputBox\Text) Then InputBox\Markiert=True InputBox\MarkiertX1=InputBox\Cursor InputBox\MarkiertX2=1 End If End If End If If KeyDown(203) Then ;Shift+links If InputBox\Markiert=True Then If InputBox\MarkiertX1=>InputBox\Cursor Then InputBox\MarkiertX2=InputBox\MarkiertX2-1 If InputBox\MarkiertX2=0 Then InputBox\Markiert=False Else If InputBox\MarkiertX1>0 Then InputBox\MarkiertX1=InputBox\MarkiertX1-1 InputBox\MarkiertX2=InputBox\MarkiertX2+1 End If End If Else If InputBox\Cursor=<Len(InputBox\Text) Then InputBox\Markiert=True InputBox\MarkiertX1=InputBox\Cursor-1 InputBox\MarkiertX2=1 End If End If End If If Asc(Key$)=1 And InputBox\Cursor>0 Then ;Shift+Pos1 If InputBox\Cursor<=Len(InputBox\Text) Then InputBox\Markiert=True InputBox\MarkiertX1=0 InputBox\MarkiertX2=InputBox\Cursor Else InputBox\Markiert=True InputBox\MarkiertX1=0 InputBox\MarkiertX2=Len(InputBox\Text) End If End If If Asc(Key$)=2 Then ;Shift+Ende If InputBox\Cursor<Len(InputBox\Text) Then InputBox\Markiert=True InputBox\MarkiertX1=InputBox\Cursor InputBox\MarkiertX2=Len(InputBox\Text)-InputBox\Cursor End If End If If KeyDown(4);Shift+Entf If InputBox\Markiert=True Then ClipBoard$=Mid$(InputBox\Text,InputBox\MarkiertX1+1,InputBox\MarkiertX2) InputBox\Text=Mid$(InputBox\Text,1,InputBox\MarkiertX1)+Mid$(InputBox\Text,InputBox\MarkiertX2+InputBox\MarkiertX1+1) InputBox\Markiert=False End If End If ElseIf Shift=True And Strg=True Then If KeyDown(203) Then ;Shift+Strg+links Leerzeichen=False If InputBox\Markiert=True Then If InputBox\MarkiertX1=>InputBox\Cursor Then MarkiertPos=InputBox\MarkiertX2+InputBox\MarkiertX1 For Pos=MarkiertPos-1 To 1 Step -1 If Mid$(InputBox\Text,Pos,1)=" " Then Leerzeichen=True Else If Leerzeichen=True Then Exit End If End If Next If Pos<=InputBox\Cursor Then InputBox\Markiert=False Else InputBox\MarkiertX2=Pos-InputBox\MarkiertX1 If InputBox\MarkiertX2=<0 Then InputBox\Markiert=False End If Else If InputBox\MarkiertX1>0 Then MarkiertPos=InputBox\MarkiertX1 For Pos=MarkiertPos-1 To 1 Step -1 If Mid$(InputBox\Text,Pos,1)=" " Then Leerzeichen=True Else If Leerzeichen=True Then Exit End If End If Next InputBox\MarkiertX1=Pos InputBox\MarkiertX2=MarkiertPos-Pos+InputBox\MarkiertX2 End If End If Else If Len(InputBox\Text)>0 And InputBox\Cursor>0 Then If InputBox\Cursor>Len(InputBox\Text) Then MarkiertPos=Len(InputBox\Text) Else MarkiertPos=InputBox\Cursor End If For Pos=MarkiertPos-1 To 1 Step -1 If Mid$(InputBox\Text,Pos,1)=" " Then Leerzeichen=True Else If Leerzeichen=True Then Exit End If End If Next InputBox\MarkiertX1=Pos InputBox\MarkiertX2=MarkiertPos-Pos InputBox\Markiert=True End If End If End If If KeyDown(205) Then ;rechts Leerzeichen=False If InputBox\Markiert=True Then If InputBox\MarkiertX1<InputBox\Cursor Then MarkiertPos=InputBox\MarkiertX1 For Pos=MarkiertPos+1 To Len(InputBox\Text) If Mid$(InputBox\Text,Pos,1)=" " Then Leerzeichen=True Else If Leerzeichen=True Then Exit End If End If Next InputBox\MarkiertX2=InputBox\MarkiertX2-(Pos-InputBox\MarkiertX1)+1 InputBox\MarkiertX1=Pos-1 If InputBox\MarkiertX2=<0 Then InputBox\Markiert=False Else MarkiertPos=InputBox\MarkiertX1+InputBox\MarkiertX2 If MarkiertPos<=Len(InputBox\Text) Then For Pos=MarkiertPos+1 To Len(InputBox\Text) If Mid$(InputBox\Text,Pos,1)=" " Then Leerzeichen=True Else If Leerzeichen=True Then Exit End If End If Next InputBox\MarkiertX2=Pos-InputBox\MarkiertX1-1 End If End If Else If InputBox\Cursor<=Len(InputBox\Text) Then For Pos=InputBox\Cursor+1 To Len(InputBox\Text) If Mid$(InputBox\Text,Pos,1)=" " Then Leerzeichen=True Else If Leerzeichen=True Then Exit End If End If Next InputBox\MarkiertX1=InputBox\Cursor InputBox\MarkiertX2=Pos-inputBox\Cursor-1 InputBox\Markiert=True End If End If End If End If End If End If Next End Function Function MausUpdate() MausTaste[1]=MouseHit(1)>0 MausTaste[2]=MouseHit(2)>0 MausTaste[3]=MouseHit(3)>0 MausX=MouseX() MausY=MouseY() InputBoxNr=0 If MausTaste[1]=True Then For InputBox=Each InputBoxTyp InputBoxNr=InputBoxNr+1 If InputBox\X1=<MausX And InputBox\X1+InputBox\X2=>MausX Then If InputBox\Y1=<MausY And InputBox\Y1+InputBox\Y2=>MausY Then InputBoxNrNeu=InputBoxNr Exit End If End If Next If InputBoxNrNeu>0 Then FlushKeys For InputBox=Each InputBoxTyp InputBoxZaehler=InputBoxZaehler+1 If InputBoxNrNeu=InputBoxZaehler Then InputBox\Status=Aktiv Else If InputBox\Status=Aktiv Then InputBox\Status=InAktiv End If End If Next FlushKeys End If End If End Function Function DrawInputBox() For InputBox=Each InputBoxTyp Color 0,0,0 Rect InputBox\X1-1,InputBox\Y1-1,InputBox\X2+2,InputBox\Y2+2,0 ColorI InputBox\HTextFarbe[0] Rect InputBox\X1,InputBox\Y1,InputBox\X2,InputBox\Y2 ColorI InputBox\TextFarbe[0] Text InputBox\X1,InputBox\Y1,InputBox\Text Select InputBox\Status Case Aktiv If InputBox\Markiert=True Then MarkiertX1=StringWidth(Mid$(InputBox\Text+String$(" ",InputBox\MarkiertX1-Len(InputBox\Text)),1,InputBox\MarkiertX1)) Color 0,0,255 Rect InputBox\X1+MarkiertX1,InputBox\Y1,StringWidth(Mid$(InputBox\Text+String$(" ",InputBox\MarkiertX1),InputBox\MarkiertX1+1,InputBox\MarkiertX2)),InputBox\Y2 Color 255,255,255 Text InputBox\X1+MarkiertX1,InputBox\Y1,Mid$(InputBox\Text,InputBox\MarkiertX1+1,InputBox\MarkiertX2) End If If InputBox\Markiert=False Then ColorI InputBox\CursorFarbe CursorX=InputBox\X1+StringWidth(Mid$(InputBox\Text,1,InputBox\Cursor)+String$(" ",InputBox\Cursor-Len(InputBox\Text))) If InputBox\Ins=True Then Rect CursorX,InputBox\Y1,InputBox\CursorBreit,InputBox\Y2 Else CursorX2=StringWidth(Mid$(InputBox\Text+String$(" ",InputBox\Cursor+1),InputBox\Cursor+1,1)) Rect CursorX,InputBox\Y1,CursorX2,InputBox\Y2,0 End If End If End Select Next End Function Function ColorI(I) Color (I And $FF0000)/$10000,(I And $FF00)/$100,I And $FF End Function Function Farbe(r,g,B) Return r*$10000 + g*$100 + b End Function Function Keyboad() Strg=False Alt=False Shift=False AltGr=False Key$="" If KeyDown(42)=True Or KeyDown(54)=True Then Shift=True If KeyDown(157)=True Or KeyDown(29)=True Then Strg=True If KeyDown(56)=True Then Alt=True If KeyDown(184)=True Then AltGr=True Key$=Chr$(GetKey()) If Key$=Chr$(127) Then key$="" If Key$=Chr$(0) Then If KeyTimer<MilliSecs() Then KeyTimer=MilliSecs()+RepeatTime ;--> Ziffernblock If KeyHit(82) Then Key$="0" ;0 If KeyHit(79) Then Key$="1" ;1 If KeyHit(80) Then Key$="2" ;2 If KeyHit(81) Then Key$="3" ;3 If KeyHit(75) Then Key$="4" ;4 If KeyHit(76) Then Key$="5" ;5 If KeyHit(77) Then Key$="6" ;6 If KeyHit(71) Then Key$="7" ;7 If KeyHit(72) Then Key$="8" ;8 If KeyHit(73) Then Key$="9" ;9 If KeyHit(181) Then Key$="/" ;/ If KeyHit(55) Then Key$="*" ;* If KeyHit(74) Then Key$="-" ;- If KeyHit(78) Then Key$="+" ;+ If KeyHit(83) Then Key$="," ;, If Strg=True Then If AltGr=True Then If KeyDown(11) Then Key$="}" ;} If KeyDown(3) Then Key$="²" ;² If KeyDown(4) Then Key$="³" ;³ If KeyDown(8) Then Key$="{" ;{ If KeyDown(9) Then Key$="[" ;[ If KeyDown(10) Then Key$="]" ;] If KeyDown(12) Then Key$="\" ;\ If KeyDown(16) Then Key$="@" ;@ If KeyDown(27) Then Key$="~" ;~ If KeyDown(86) Then Key$="|" ;| If KeyDown(18) Then Key$="€" ;Euro If KeyDown(50) Then Key$="µ" ;µ End If Else If Shift=True Then If KeyDown(11) Then Key$="=" ;= If KeyDown(2) Then Key$="!" ;! If KeyDown(3) Then Key$=Chr$(34) ;" If KeyDown(4) Then Key$="§" ;§ If KeyDown(5) Then Key$="$" ;$ If KeyDown(6) Then Key$="%" ;% If KeyDown(7) Then Key$="&" ;& If KeyDown(8) Then Key$="/" ;/ If KeyDown(9) Then Key$="(" ;( If KeyDown(10) Then Key$=")" ;) If KeyDown(30) Then Key$="A" ;A If KeyDown(48) Then Key$="B" ;B If KeyDown(46) Then Key$="C" ;C If KeyDown(32) Then Key$="D" ;D If KeyDown(18) Then Key$="E" ;E If KeyDown(33) Then Key$="F" ;F If KeyDown(34) Then Key$="G" ;G If KeyDown(35) Then Key$="H" ;H If KeyDown(23) Then Key$="I" ;I If KeyDown(36) Then Key$="J" ;J If KeyDown(37) Then Key$="K" ;K If KeyDown(38) Then Key$="L" ;L If KeyDown(50) Then Key$="M" ;M If KeyDown(49) Then Key$="N" ;N If KeyDown(24) Then Key$="O" ;O If KeyDown(25) Then Key$="P" ;P If KeyDown(16) Then Key$="Q" ;Q If KeyDown(19) Then Key$="R" ;R If KeyDown(31) Then Key$="S" ;S If KeyDown(20) Then Key$="T" ;T If KeyDown(22) Then Key$="U" ;U If KeyDown(47) Then Key$="V" ;V If KeyDown(17) Then Key$="W" ;W If KeyDown(45) Then Key$="X" ;X If KeyDown(44) Then Key$="Y" ;Y If KeyDown(21) Then Key$="Z" ;Z If KeyDown(40) Then Key$="Ä" ;Ä If KeyDown(39) Then Key$="Ö" ;Ö If KeyDown(26) Then Key$="Ü" ;Ü If KeyDown(12) Then Key$="?" ;? If KeyDown(13) Then Key$="`" ;` If KeyDown(86) Then Key$=">" ;> If KeyDown(51) Then Key$=";" ;; If KeyDown(52) Then Key$=":" ;: If KeyDown(53) Then Key$="_" ;_ If KeyDown(43) Then Key$="'" ;' If KeyDown(41) Then Key$="°" ;° If KeyDown(27) Then Key$="*" ;* Else ;--> Ziffernblock If KeyDown(82) Then Key$="0" ;0 If KeyDown(79) Then Key$="1" ;1 If KeyDown(80) Then Key$="2" ;2 If KeyDown(81) Then Key$="3" ;3 If KeyDown(75) Then Key$="4" ;4 If KeyDown(76) Then Key$="5" ;5 If KeyDown(77) Then Key$="6" ;6 If KeyDown(71) Then Key$="7" ;7 If KeyDown(72) Then Key$="8" ;8 If KeyDown(73) Then Key$="9" ;9 If KeyDown(181) Then Key$="/" ;/ If KeyDown(55) Then Key$="*" ;* If KeyDown(74) Then Key$="-" ;- If KeyDown(78) Then Key$="+" ;+ If KeyDown(83) Then Key$="," ;, If KeyDown(11) Then Key$="0" ;0 If KeyDown(2) Then Key$="1" ;1 If KeyDown(3) Then Key$="2" ;2 If KeyDown(4) Then Key$="3" ;3 If KeyDown(5) Then Key$="4" ;4 If KeyDown(6) Then Key$="5" ;5 If KeyDown(7) Then Key$="6" ;6 If KeyDown(8) Then Key$="7" ;7 If KeyDown(9) Then Key$="8" ;8 If KeyDown(10) Then Key$="9" ;9 If KeyDown(30) Then Key$="a" ;a If KeyDown(48) Then Key$="b" ;b If KeyDown(46) Then Key$="c" ;c If KeyDown(32) Then Key$="d" ;d If KeyDown(18) Then Key$="e" ;e If KeyDown(33) Then Key$="f" ;f If KeyDown(34) Then Key$="g" ;g If KeyDown(35) Then Key$="h" ;h If KeyDown(23) Then Key$="i" ;i If KeyDown(36) Then Key$="j" ;j If KeyDown(37) Then Key$="k" ;k If KeyDown(38) Then Key$="l" ;l If KeyDown(50) Then Key$="m" ;m If KeyDown(49) Then Key$="n" ;n If KeyDown(24) Then Key$="o" ;o If KeyDown(25) Then Key$="p" ;p If KeyDown(16) Then Key$="q" ;q If KeyDown(19) Then Key$="r" ;r If KeyDown(31) Then Key$="s" ;s If KeyDown(20) Then Key$="t" ;t If KeyDown(22) Then Key$="u" ;u If KeyDown(47) Then Key$="v" ;v If KeyDown(17) Then Key$="w" ;w If KeyDown(45) Then Key$="x" ;x If KeyDown(44) Then Key$="y" ;y If KeyDown(21) Then Key$="z" ;z If KeyDown(40) Then Key$="ä" ;ä If KeyDown(39) Then Key$="ö" ;ö If KeyDown(26) Then Key$="ü" ;ü If KeyDown(12) Then Key$="ß" ;ß If KeyDown(13) Then Key$="´" ;´ If KeyDown(86) Then Key$="<" ;< If KeyDown(51) Then Key$="," ;, If KeyDown(52) Then Key$="." ;. If KeyDown(53) Then Key$="-" ;- If KeyDown(43) Then Key$="#" ;# If KeyDown(41) Then Key$="^" ;^ If KeyDown(27) Then Key$="+" ;+ ;--> Cursortasten If KeyDown(28) Then Key$=Chr$(13) ;Enter If KeyDown(1) Then Key$=Chr$(27) ;ESC If KeyDown(15) Then Key$=Chr$(9) ;Tab If KeyDown(210) Then Key$=Chr$(3) ;Einfügen If KeyDown(207) Then Key$=Chr$(2) ;Ende If KeyDown(199) Then Key$=Chr$(1) ;Pos1 If KeyDown(200) Then Key$=Chr$(28) ;rauf If KeyDown(208) Then Key$=Chr$(9) ;runter If KeyDown(203) Then Key$=Chr$(31) ;links If KeyDown(205) Then Key$=Chr$(30) ;rechts If KeyDown(211) Then Key$=Chr$(4) ;Entf ;--> Steuertasten If KeyDown(57) Then Key$=" " ;Leertaste If KeyDown(14) Then Key$=Chr$(8) ;Del End If End If End If Else ;--> Verzögerungszeit bis zum Einsetzen des Tastaur-Repeat KeyTimer=MilliSecs()+TimeToRepeat End If End Function Function CreateSchalter(X,Y,ButtonName$,Bezeichnung$,SoundDatei$,Namne$,Wert,BezeichnungFarbe=255*255*255,AlternativeBezeichnung$="") If Len(AlternativeBezeichnung$)>0 Then If Len(Bezeichnung$)>0 Then AlternativeBezeichnung$=Bezeichnung$ Else If Len(ButtonName$)>0 Then AlternativeBezeichnung$=ButtonName$ Else Return False End If End If End If ButtonName$=Upper$(ButtonName$) For Button=Each TButton If ButtonName$=Upper$(Button\Name$) Then NewSchalter X,Y,Button\Image,Bezeichnung$,Button\transparent,LoadSound(SoundDatei$),Namne$,Wert,BezeichnungFarbe,AlternativeBezeichnung$ Return True End If Next SucheDateien SystemProperty$("APPDIR"),"Button|" For DateiListe=Each DateiListeTyp InputDatei=ReadFile(DateiListe\Ordner$+DateiListe\Dateiname$+"."+DateiListe\Erweiterung$) If InputDatei<>0 Then ButtonVergleichName$=ReadString(InputDatei) If Upper$(ButtonVergleichName$)=Upper$(ButtonName$) Then CloseFile InputDatei LoadButton DateiListe\Ordner$+DateiListe\Dateiname$+"."+DateiListe\Erweiterung$ NewSchalter X,Y,Button\Image,Bezeichnung$,Button\transparent,LoadSound(SoundDatei$),Namne$,Wert,BezeichnungFarbe,AlternativeBezeichnung$ Return True Else CloseFile InputDatei End If End If Next NewSchalter X,Y,0,Bezeichnung$,False,LoadSound(SoundDatei$),Namne$,Wert,BezeichnungFarbe,AlternativeBezeichnung$ End Function Function NewSchalter(X,Y,Image,Bezeichnung$,transparent,Sound,Namne$,Wert,BezeichnungFarbe=255*255*255,AlternativeBezeichnung$="") If Image=0 And Len(Bezeichnung$)=0 And Len(AlternativeBezeichnung$)=0 Then Return False End If Schalter=New TSchalter Schalter\Image=Image Schalter\Sound=Sound Schalter\Name$=Name$ Schalter\Wert=Wert Schalter\X=X Schalter\Y=Y Schalter\Bezeichnung$=Bezeichnung$ Schalter\BezeichnungFarbe=BezeichnungFarbe If Len(AlternativeBezeichnung$)=0 Then Schalter\AlternativeBezeichnung$=Schalter\Bezeichnung$ Else Schalter\AlternativeBezeichnung$=AlternativeBezeichnung$ End If If Image=0 Then Schalter\X2=StringWidth(Schalter\AlternativeBezeichnung$) Schalter\Y2=StringHeight(Schalter\AlternativeBezeichnung$) Else Schalter\X2=ImageWidth(Image) Schalter\y2=ImageHeight(Image) End If Schalter\XZ=Schalter\X2-(Schalter\X2/2)+X Schalter\YZ=Schalter\Y2-(Schalter\Y2/2)+Y Return True End Function Function Inst_Schalter(Schrift$,SchriftHoch,MausDateiname$,Breit,Hoch) MausImage=LoadAnimImage(MausDateiname$,Breit,Hoch,0,2) If MausImage<>"" Then MausDatei$=MausDateiname$ MausBreit =Breit MausHoch =Hoch End If SchalterSchrift=LoadFont(Schrift$,SchriftHoch) SchalterSchriftName$=Schrift$ SetFont SchalterSchrift End Function Function SaveButton(Buttonname$,DateiName$="") If Len(DateiName$)=0 Then DateiName$=Buttonname$ End If If Instr(DateiName$,".")=0 Then DateiName$=DateiName$+".Button" End If For Button=Each TButton If Upper$(ButtonName$)=Upper$(Button\Name$) Then OutputDatei=WriteFile(DateiName$) If OutputDatei=0 Then Return False End If WriteString OutputDatei,Button\Name$ WriteByte OutputDatei,Button\transparent WriteInt OutputDatei,Button\ImageMaske WriteShort OutputDatei,Button\Breit WriteShort OutputDatei,Button\Hoch For BildZahl=0 To 2 Buffer=ImageBuffer(Button\Image,BildZahl) LockBuffer Buffer For X=0 To Button\Breit-1 For Y=0 To Button\Hoch-1 WriteInt OutputDatei,ReadPixelFast(X,Y,Buffer) Next Next UnlockBuffer Buffer Next Return True End If Next Return False End Function Function LoadButton(DateiName$) InputDatei=ReadFile(DateiName$) If InputDatei=0 Then Return False End If ButtonName$=ReadString(InputDatei) Buttontransparent=ReadByte(InputDatei) ButtonImageMaske=ReadInt(InputDatei) ButtonBreit=ReadShort(InputDatei) ButtonHoch=ReadShort(InputDatei) For Button=Each TButton If Upper$(ButtonName$)=Upper$(Button\Name$) Then Return False End If Next Button=New TButton Button\Name$=ButtonName$ Button\transparent=ButtonImageMaske Button\ImageMaske=ButtonImageMaske Button\Breit=ButtonBreit Button\Hoch=ButtonHoch Button\Dateiname=DateiName$ Button\Image=CreateImage(ButtonBreit,ButtonHoch,3) For BildZahl=0 To 2 Buffer=ImageBuffer(Button\Image,BildZahl) LockBuffer Buffer For X=0 To Button\Breit-1 For Y=0 To Button\Hoch-1 WritePixelFast X,Y,ReadInt(InputDatei),Buffer Next Next UnlockBuffer Buffer Next MaskImage Button\Image,GetRed(Button\ImageMaske),GetGreen(Button\ImageMaske),GetBlue(Button\ImageMaske) CloseFile InputDatei Return True End Function Function CreateButton(DateiName$,Name$,Breit,Hoch,transparent=False,ImageMaske=0,LadenAbBild=0) Image=LoadAnimImage(DateiName$,Breit,Hoch,LadenAbBild,3) If Image=0 Then Return False Button=New TButton Button\Image=Image Button\Name$=Name$ Button\Breit=Breit Button\Hoch=Hoch Button\transparent=transparent Button\LadenAbBild=LadenAbBild Button\DateiName$=DateiName$ Button\ImageMaske=ImageMaske MaskImage Image,GetRed(ImageMaske),GetGreen(ImageMaske),GetBlue(ImageMaske) Return True End Function Function DeleteButton(ButtonName$) For Button=Each TButton If Upper$(ButtonName$)=Upper$(Button\Name$) Then For Schalter=Each TSchalter If Button\Image=Schalter\Image Then Delete Button Return True End If Next FreeImage Button\Image Delete Button Return True End If Next Return False End Function Function UpdateSchalter() MausUeberSchalter DrawSchalter DrawMaus End Function Function DeleteSchalter2(Name$) For Schalter=Each TSchalter If Upper(Schalter\Name$)=Upper$(Name$) Then If Schalter\Image<>0 Then FreeImage Schalter\Image If Schalter\Sound<>0 Then FreeImage Schalter\Sound Delete Schalter End If Next End Function Function DeleteSchalter(Wert) For Schalter=Each TSchalter If Schalter\Wert=Wert Then If Schalter\Image<>0 Then FreeImage Schalter\Image If Schalter\Sound<>0 Then FreeImage Schalter\Sound Delete Schalter End If Next End Function Function Reset_Schalter() If ChannelID_Schalter<>0 Then If ChannelPlaying(ChannelID_Schalter)=True Then Return False End If End If ChannelID_Schalter=0 AktionSchalterWert=0 AktionSchalterName$="" Return True End Function Function DrawSchalter() For Schalter=Each TSchalter If Schalter\Image<>0 Then If Schalter\transparent=True Then DrawImage Schalter\Image,Schalter\X,Schalter\Y,Schalter\Status Else DrawBlock Schalter\Image,Schalter\X,Schalter\Y,Schalter\Status End If If Len(Schalter\Bezeichnung$)>0 Then ColorI Schalter\BezeichnungFarbe Text Schalter\XZ,Schalter\YZ,Schalter\Bezeichnung$,True,True End If Else ColorI Schalter\BezeichnungFarbe Text Schalter\XZ,Schalter\YZ,Schalter\AlternativeBezeichnung$,True,True End If Next End Function Function MausUeberSchalter() MausImageNr=0 MausX=MouseX() Mausy=MouseY() MausUeberSchalterWert=0 MausUeberSchalterName$="" ;MausTaste=MouseDown(1) For Schalter=Each TSchalter If Schalter\Image<>0 Then If Schalter\transparent=True Then If ImagesCollide(MausImage,Mausx,MausY,0,Schalter\Image,Schalter\X,Schalter\Y,0) And AktionSchalterWert=0 Then MausImageNr=1 If MausTaste[1]=True Then Schalter\Status=2 AktionSchalterWert=Schalter\Wert AktionSchalterName$=Schalter\Name$ Else Schalter\Status=1 MausUeberSchalterWert=Schalter\Wert MausUeberSchalterName$=Schalter\Name$ End If Else If AktionSchalterWert<>Schalter\Wert Then Schalter\Status=0 End If End If Else If ImageRectCollide(MausImage,Mausx,MausY,0,Schalter\X,Schalter\Y,Schalter\X2,Schalter\Y2) And AktionSchalterWert=0 Then MausImageNr=1 If MausTaste[1]=True Then Schalter\Status=2 AktionSchalterWert=Schalter\Wert AktionSchalterName$=Schalter\Name$ Else Schalter\Status=1 MausUeberSchalterWert=Schalter\Wert MausUeberSchalterName$=Schalter\Name$ End If Else If AktionSchalterWert<>Schalter\Wert Then Schalter\Status=0 End If End If End If Else If ImageRectCollide(MausImage,Mausx,MausY,0,Schalter\X,Schalter\Y,Schalter\X2,Schalter\Y2) And AktionSchalterWert=0 Then MausImageNr=1 If MausTaste[1]=True Then Schalter\Status=2 AktionSchalterWert=Schalter\Wert AktionSchalterName$=Schalter\Name$ Else Schalter\Status=1 MausUeberSchalterWert=Schalter\Wert MausUeberSchalterName$=Schalter\Name$ End If Else If AktionSchalterWert<>Schalter\Wert Then Schalter\Status=0 End If End If End If If Schalter<>Null Then If Schalter\Status=2 Then If ChannelID_Schalter=0 Then If Schalter\Sound<>0 Then ChannelID_Schalter=PlaySound(Schalter\Sound) End If End If End If End If Next End Function Function DrawMaus() DrawImage MausImage,MouseX(),MouseY(),MausImageNr End Function Function SucheDateien(Ordner$,Erweiterung$) If Len(Erweiterung$)>0 Then If Right$(Erweiterung$,1)<>"|" Then Erweiterung$=Erweiterung$+"|" End If End If If Right$(Ordner$,1)<>"\" Then Ordner$=Ordner$+"\" End If LangErweiterung=Len(Erweiterung$) OrdnerNr=ReadDir(Ordner$) If OrdnerNr=0 Then Return Ordner_Konnte_Nicht_auslesen_Werden Datei$=NextFile$(OrdnerNr) While Datei$<>"" Select FileType((Ordner$+Datei$)) Case COrdner If Datei$<>"." And Datei$<>".." Then SucheDateien Ordner$+Datei$,Erweiterung$ End If Case CDatei DateiErweiterung$=Mid$(Datei$,Instr(Datei$+".",".")+1) DateiName$=Mid$(Datei$,1,Instr(Datei$+".",".")-1) If LangErweiterung>0 Then ErweiterungStimmt=False For PosErweiterung=1 To LangErweiterung Select Mid$(Erweiterung$,PosErweiterung,1) Case "|" If Upper$(TestErweiterung$)=Upper$(DateiErweiterung$) Then ErweiterungStimmt=True Exit End If TestErweiterung$="" Default TestErweiterung$=TestErweiterung$+Mid$(Erweiterung$,PosErweiterung,1) End Select Next TestErweiterung$="" If TestErweiterung$<>"" And Upper$(TestErweiterung$)=Upper$(DateiErweiterung$) Then ErweiterungStimmt=True End If End If If ErweiterungStimmt=True Or LangErweiterung=0 Then DateiListe= New DateiListeTyp DateiListe\Dateiname$=Dateiname$ DateiListe\Ordner$=Ordner$ DateiListe\Erweiterung$=DateiErweiterung$ End If End Select Datei$=NextFile$(OrdnerNr) Wend End Function Function Lower$(S$) Slen=Len(S) If Slen>0 Then For P=1 To Slen ASCII=Asc(Mid$(S$,P,1)) If Ascii>64 And Ascii<92 Then Ascii=Ascii+32 ElseIf Ascii=220 Then ;ü Ascii=252 ElseIf Ascii=196 Then ;ä Ascii=228 ElseIf Ascii=214 Then ;ö Ascii=246 End If R$=R$+Chr$(ASCII) Next Return R$ End If End Function Function Upper$(S$) Slen=Len(S) If Slen>0 Then For P=1 To Slen ASCII=Asc(Mid$(S$,P,1)) If Ascii>96 And Ascii<123 Then Ascii=Ascii-32 ElseIf Ascii=252 Then ;ü Ascii=220 ElseIf Ascii=228 Then ;ä Ascii=196 ElseIf Ascii=246 Then ;ö Ascii=214 End If R$=R$+Chr$(ASCII) Next Return R$ End If End Function Function GetRed(I) Return (I And $FF0000)/$10000 End Function Function GetGreen(I) Return (I And $FF00)/$100 End Function Function GetBlue(I) Return I And $FF End Function |
||
- Zuletzt bearbeitet von Florian am So, Sep 18, 2005 19:42, insgesamt einmal bearbeitet
![]() |
Spikespine |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ach du sch*** ![]() 1500 Zeilen für eine Konsole??? |
||
Athlon 64 3700+ | 1024 MB RAM | GeForce 7900 GT | Blitz2D, Blitz3D, BlitzPlus, BlitzMax |
Florian |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Zitat: 1500 Zeilen für eine Konsole??? Das soll keine Konsole sein, sondern eine riesen eingabe Funktion. Funktionen: Tab Pos1 Ende Einfg Entf Enter Pfeil nach links Pfeil nach rechts Strg+A Strg+V Strg+C Strg+X Strg+Einfg Strg+Pfeil nach links Strg+Pfeil nach rechts Shift+recht Pfeil nachs Shift+Pfeil nach links Shift+Pos1 Shift+Ende Shift+Entf Shift+Strg+Pfeil nach links Shift+Strg+Pfeil nach rechts |
||
![]() |
Artemis |
![]() Antworten mit Zitat ![]() |
---|---|---|
Trotzdem geht es kürzer!
Warum hast du eigentlich 3 Dieselben Topics erstellt? |
||
Florian |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Zitat: Warum hast du eigentlich 3 Dieselben Topics erstellt? Bei den ersten und zweiten Topics ließen sich nicht richtig erstellen, noch bearteiten. Beim dritten ging es aber. |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group