Beispiele
Übersicht
Beispiele 1
Beispiele 2
Beispiele 3
Beispiele 5
Beispiele 6
Beispiele 7
Erweiterungen
 

StatusBar


#Include Once "window9.bi" Var hwnd = OpenWindow("StatusBar",30,30,300,200,WS_VISIBLE Or WS_SYSMENU) WindowColor(hwnd,BGR(220,220,230)) CenterWindow(hwnd) StatusBarGadget(11) SetStatusBarField(11,0, 80,Time) SetStatusBarField(11,1,160,Date) SetStatusBarField(11,2,-1,__FB_SIGNATURE__) SetGadgetColor(11,BGR(220,220,230),0,1) Dim As Integer Timer1 SetTimer(hwnd,Timer1,1000,NULL) Do Var event=WindowEvent() If event=EventClose Then KillTimer(hwnd,Timer1) End EndIf If event=EventTimer Then SetStatusBarField(11,0,80,Time) EndIf Loop

TIMERPROC


#include Once "window9.bi" enum gadgets sbar_r = 100 sbar_g sbar_b text_r text_g text_b text_c end enum Dim As Integer rot=&Hff, gruen=&Hff00, blau=&Hff0000, hg=BGR(200,200,255) Var win = OpenWindow("TESTCOLOR",10,10,370,140,WS_VISIBLE Or WS_SYSMENU) WindowColor(win, hg) CenterWindow(win) ScrollBarGadget(sbar_r ,10,10,200,20,0,255) SetGadgetColor(sbar_r,rot,1,3) ScrollBarGadget(sbar_g ,10,40,200,20,0,255) SetGadgetColor(sbar_g,gruen,1,3) ScrollBarGadget(sbar_b ,10,70,200,20,0,255) SetGadgetColor(sbar_b,blau,1,3) TextGadget(text_r ,220,10,30,20,Str(GetScrollGadgetPos(sbar_r)),SS_SUNKEN Or SS_CENTER) SetGadgetColor(text_r,hg,rot,3) TextGadget(text_g ,220,40,30,20,Str(GetScrollGadgetPos(sbar_g)),SS_SUNKEN Or SS_CENTER) SetGadgetColor(text_g,hg,gruen,3) TextGadget(text_b ,220,70,30,20,Str(GetScrollGadgetPos(sbar_b)),SS_SUNKEN Or SS_CENTER) SetGadgetColor(text_b,hg,blau,3) TextGadget(text_c,260,10,80,80,,SS_SUNKEN) SetGadgetColor(text_c,0,0,1) ' must be !!! ' type TIMERPROC as sub (byval as HWND, byval as UINT, byval as UINT, byval as DWORD) Sub TimerProc(byval hWin as HWND, byval p1 as UINT, byval p2 as UINT, byval p3 as DWORD) Static As Integer r,g,b var selR=GetScrollGadgetPos(sbar_r) var selG=GetScrollGadgetPos(sbar_g) var selB=GetScrollGadgetPos(sbar_b) If r<>selR Or g<>selG Or b<>selB Then r=selR : g=selG : b=selB SetGadgetText(text_r,Str(r)) SetGadgetText(text_g,Str(g)) SetGadgetText(text_b,Str(b)) SetGadgetColor(text_c,BGR(r,g,b),0,1) End If End Sub SetTimer(win,1,200,@TimerProc) var ev=0 Do ev = WaitEvent Loop Until ev=EventClose

Input / Output


#Include Once "window9.bi" 'Farben Dim As UInteger _ grau =BGR(200,200,240), _ d_rot=BGR(160,0,0), _ h_rot=BGR(255,0,0), _ hell =BGR(255,255,140) Dim As Integer i,tmp 'einfacher als SetRunOnlyExe() Dim As HANDLE mHandle = CreateMutex(0, 1, __DATE__&__TIME__) If GetLastError = ERROR_ALREADY_EXISTS Then MessageBox 0, "Programm läuft schon!", "Achtung:", MB_OK Or MB_ICONSTOP ReleaseMutex(mHandle) If mHandle Then CloseHandle(mHandle) End 0 EndIf Var hwnd = OpenWindow("Nr. 7",30,30,300,240,WS_VISIBLE Or WS_SYSMENU) CenterWindow(hwnd) WindowColor(hwnd, grau) GroupGadget(70,45,10,170,45,"Input") SetGadgetColor(70,grau,0,3) tmp=50 For i = 1 To 8 CheckBoxGadget(70+i,tmp,30,20,20,Str(i),BS_PUSHLIKE Or BS_AUTOCHECKBOX) tmp+=20 Next GroupGadget(80,45,60,170,45,"Output") SetGadgetColor(80,grau,0,3) tmp=50 For i = 1 To 8 TextGadget( 80+i,tmp,80,19,20,Str(i),SS_CENTER Or SS_SUNKEN) SetGadgetColor( 80+i,d_rot,0,3) tmp+=20 Next Do Var event=WaitEvent() If event=EventClose Then End If event=eventgadget Then tmp=EventNumber If tmp>70 And tmp<79 Then Select Case GetGadgetState(tmp) Case 0 : SetGadgetColor(tmp+10,d_rot,0,3) Case 1 : SetGadgetColor(tmp+10,h_rot,hell,3) End Select EndIf EndIf Loop

CheckBoxGadget


#Include Once "window9.bi" Var hwnd = OpenWindow("CheckBoxGadget",30,30,225,245,WS_VISIBLE Or WS_SYSMENU) CenterWindow(hwnd) WindowColor(hwnd, BGR(200,200,240)) Dim As Integer r,c,id = 100 For c = 10 To 200 Step 20 For r = 10 To 200 Step 20 CheckBoxGadget(id,r,c,20,20,"",BS_PUSHLIKE Or BS_AUTOCHECKBOX) id += 1 Next Next Do Var event=WaitEvent() If event=EventClose Then End If event=eventgadget Then id=EventNumber If id>99 And id<200 Then Select Case GetGadgetState(id) Case 0 : SetGadgetText(id,"") Case 1 : SetGadgetText(id,"X") End Select EndIf EndIf Loop