Dropdown fuer BB von ??? |
Ich hab kein bock mehr alles zu erklaeren, vor dem Reset war ich da anspruchsvoller egal hier der code: [code:1:dc8ab840a0]Graphics 800,600,16,2 Dim activedrop%(100),choosedrop%(100) Dim dropcontents$(100,100),anz%(100) Global mouse1% load_dropdowns(1,"sfkl#asdfjudzuj#sdtghgfhsh#dzujc",4) load_dropdowns(2,"sfkl#asdfjudzuj#sdtghgfhsh#dzujc",4) While Not KeyHit(1) mouse1=MouseHit(1) dropdown(1,100,200,200,255,255,255,0,0,255,200,200,200) dropdown(2) Flip Cls Wend End Function load_dropdowns(id%,content$,an%) choosedrop(id%)=1 anz%(id%)=an% For i = 1 To an% If Instr(content$,"#") dropcontents$(id%,i)=Left(content$,Instr(content$,"#")-1) content$ = Right(content$,Len(content$)-Instr(content$,"#")-1) Else dropcontents$(id%,i)=content$ End If Next End Function Function dropdown(id%,x%=0,y%=0,width%=100,bgrndr%=60,bgrndg%=60,bgrndb%=60,colorr%=200,colorg%=200,colorb%=200,downcr%=0,downcg%=0,downcb%=0) Color bgrndr%,bgrndg%,bgrndb% Rect x%,y%,width%-FontHeight()-2,FontHeight()+2,1 Rect x%+width-FontHeight(),y%,FontHeight(),FontHeight()+2,1 Color colorr%,colorg%,colorb% Rect x%,y%,width%-FontHeight()-2,FontHeight()+2,0 Rect x%+width%-FontHeight(),y%,FontHeight(),FontHeight()+2,0 Line x%+width%-FontHeight()/4*3,y%+FontHeight()/4+2,x%+width%-FontHeight()/2-1,y%+FontHeight()/4*3+1 Line x%+width%-FontHeight()/4-2,y%+FontHeight()/4+2,x%+width%-FontHeight()/2-1,y%+FontHeight()/4*3+1 Text x%+1,y%+1,dropcontents$(id%,choosedrop(id%)) If MouseX()<x%+width% And MouseX()>x%+width%-FontHeight() And MouseY()>y% And MouseY()<y%+FontHeight() And mouse1 Then activedrop%(id%)=1-activedrop%(id%) If activedrop%(id%) Color bgrndr%,bgrndg%,bgrndb% Rect x%,y%+FontHeight()+4,width%-FontHeight()-2,anz(id%)*(FontHeight()+2),1 Color colorr%,colorg%,colorb% Rect x%,y%+FontHeight()+4,width%-FontHeight()-2,anz(id%)*(FontHeight()+2),0 For i = 1 To anz(id%) If MouseX()<x%+width%-FontHeight() And MouseX()>x% And MouseY()>y%+i*(FontHeight()+2)+2 And MouseY()<y%+i*(FontHeight()+2)+2+FontHeight() Color downcr%,downcg%,downcb% Rect x%+1,y%+i*(FontHeight()+2)+3,width%-FontHeight()-4,FontHeight() If mouse1% Then choosedrop(id%) = i : activedrop(id%)=0 End If Color colorr%,colorg%,colorb% Text x%,y%+i*(FontHeight()+2)+2,dropcontents(id%,i) Next End If End Function[/code:1:dc8ab840a0] |
von ??? |
Ich dachte, sowas heißt Combobox, mehr ,wollen wir! Buttons, Textfelder usw. |
von ??? |
Gute GUI! Aber ich glaube das haben viele Spiele, schau mal im Projektforum! Mache noch listboxen oder treeboxen, usw. Die Auswahl ist groß´! |