Skip to content

Commit 8286c6d

Browse files
Create USER_INTERFACE_GIRLS.pb
1 parent ae153a3 commit 8286c6d

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

USER_INTERFACE_GIRLS.pb

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
XIncludeFile "LEARNERS_ARRAY.pbi"
2+
NewList indexArray.i()
3+
4+
Enumeration
5+
;#Directory1
6+
#WINDOW_1
7+
#LISTVIEW_1
8+
;#LISTVIEW_2
9+
;#LISTVIEW_3
10+
#TEXT_GADGET_1
11+
;#TEXT_GADGET_2
12+
;#TEXT_GADGET_3
13+
#BUTTON_GADGET_1
14+
#BUTTON_GADGET_2
15+
EndEnumeration
16+
17+
#WINDOWS_FLAGS = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
18+
19+
;just change the "GIRLS" to "BOYS" to create boys selection interface
20+
;then change classNumberGirls to classNumberBoys
21+
;this is just like modular approach
22+
;where you just load certain modules
23+
24+
If OpenWindow(#WINDOW_1, 0, 0, 420, 120, "RANDOM SELECTION GIRLS", #WINDOWS_FLAGS)
25+
26+
TextGadget(#TEXT_GADGET_1,5,10,400,30,"RANDOM LEARNERS:")
27+
28+
;this will be for the next version of this program
29+
;TextGadget(#TEXT_GADGET_2,5,350,500,30,"SELECTED LEARNERS: ")
30+
ButtonGadget(#BUTTON_GADGET_1,230,0,85,40,"RUN!")
31+
32+
ButtonGadget(#BUTTON_GADGET_2,320,0,85,40,"CLEAR")
33+
ListViewGadget(#LISTVIEW_1, 10, 40, 400, 68)
34+
35+
SetGadgetFont(#WINDOW_1,FontID(LoadFont(#PB_Any,"Century Gothic", 12)))
36+
SetGadgetFont(#LISTVIEW_1,FontID(LoadFont(#PB_Any,"Century Gothic", 40)))
37+
SetGadgetFont(#TEXT_GADGET_1,FontID(LoadFont(#PB_Any,"Comic Sans MS", 16)))
38+
SetGadgetFont(#BUTTON_GADGET_1,FontID(LoadFont(#PB_Any,"Century Gothic", 18)))
39+
SetGadgetFont(#BUTTON_GADGET_2,FontID(LoadFont(#PB_Any,"Century Gothic", 18)))
40+
41+
For x.b = 0 To 24
42+
AddElement(indexArray())
43+
indexArray() = x
44+
Next
45+
46+
; ForEach indexArray()
47+
; Debug indexArray()
48+
; Next
49+
RandomizeList(indexArray())
50+
; ForEach indexArray()
51+
; Debug indexArray()
52+
; Next
53+
addToItself.i = 0
54+
DisableGadget(#BUTTON_GADGET_2,1)
55+
56+
Repeat
57+
58+
Event = WaitWindowEvent()
59+
60+
Select Event
61+
Case #PB_Event_Gadget
62+
Select EventGadget()
63+
Case #BUTTON_GADGET_1
64+
DisableGadget(#BUTTON_GADGET_1,1)
65+
DisableGadget(#BUTTON_GADGET_2,0)
66+
67+
If addToItself >= 25
68+
MessageRequester("ATTENTION: ", "Nothing left, program will exit.")
69+
Break
70+
71+
EndIf
72+
73+
;Debug addToItself
74+
SelectElement(indexArray(),addToItself)
75+
76+
;Debug Str(indexArray())
77+
AddGadgetItem(#LISTVIEW_1,0,classNumberGirls(indexArray()))
78+
SetGadgetState(#LISTVIEW_1,0)
79+
80+
addToItself.i = addToItself + 1
81+
;Debug addToItself
82+
Case #BUTTON_GADGET_2
83+
DisableGadget(#BUTTON_GADGET_1,0)
84+
RemoveGadgetItem(#LISTVIEW_1,0)
85+
DisableGadget(#BUTTON_GADGET_2,1)
86+
EndSelect
87+
88+
EndSelect
89+
Until Event = #PB_Event_CloseWindow
90+
EndIf

0 commit comments

Comments
 (0)