save point
This commit is contained in:
parent
7f1e46a368
commit
9792d5092b
9 changed files with 92 additions and 24 deletions
30
kratom.pb
30
kratom.pb
|
@ -4,8 +4,24 @@
|
|||
|
||||
UseSQLiteDatabase()
|
||||
XIncludeFile "kratomfrm1.pbf"
|
||||
XIncludeFile "splash.pbf"
|
||||
Declare updatelist() ; declare forward procedure
|
||||
|
||||
; A little positioning work
|
||||
|
||||
desktop = ExamineDesktops()
|
||||
screenWidth = DesktopWidth(0)
|
||||
screenHeight = DesktopHeight(0)
|
||||
|
||||
; Define the window dimensions
|
||||
windowWidth = 1140
|
||||
windowHeight = 630
|
||||
|
||||
; Calculate the center position
|
||||
xPos = (screenWidth - windowWidth) / 2
|
||||
yPos = (screenHeight - windowHeight) / 2
|
||||
|
||||
Opensplash();xPos,yPos)
|
||||
|
||||
; init code
|
||||
|
||||
|
@ -21,7 +37,7 @@ Openkrt1()
|
|||
|
||||
Procedure btn0click (EventType)
|
||||
;MessageRequester("INFO", "ADD CLICKED")
|
||||
DatabaseUpdate(0,"INSERT into kratom (name, type) Values ('"+Trim(GetGadgetText(String_0))+"', '"+Trim(GetGadgetText(String_1))+"' );")
|
||||
DatabaseUpdate(0,"INSERT into kratom (name, type, weight) Values ('"+Trim(GetGadgetText(String_0))+"', '"+Trim(GetGadgetText(String_1))+"','"+GetGadgetText(String_2)+"');")
|
||||
updatelist()
|
||||
EndProcedure
|
||||
|
||||
|
@ -55,8 +71,8 @@ Procedure dellist(EventType)
|
|||
EndProcedure
|
||||
|
||||
Procedure burn(EventType)
|
||||
|
||||
If DatabaseQuery(0, "SELECT * FROM kratom ORDER BY RANDOM() LIMIT 1")
|
||||
; TODO ADD BLACK MAGIC
|
||||
If DatabaseQuery(0, "SELECT * FROM kratom ORDER BY RANDOM() * weight DESC LIMIT 1")
|
||||
While NextDatabaseRow(0) ; Loop for each records
|
||||
;AddGadgetItem (ListView_0, -1, "Name " + GetDatabaseString(0,1) + " Type " + GetDatabaseString(0,2))
|
||||
MessageRequester("Burn you should","Today you get to burn "+GetDatabaseString(0,1))
|
||||
|
@ -71,7 +87,8 @@ EndProcedure
|
|||
updatelist()
|
||||
|
||||
;AddGadgetItem (ListView_0, -1, "Item " + Str(a) + " of the Listview")
|
||||
|
||||
Delay(2500)
|
||||
HideWindow(splash,#True)
|
||||
HideWindow(krt1,#False)
|
||||
|
||||
;AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview")
|
||||
|
@ -89,9 +106,8 @@ Repeat
|
|||
EndSelect
|
||||
|
||||
Until Event = #PB_Event_CloseWindow ; Quit on any window close
|
||||
; IDE Options = PureBasic 6.12 LTS (Windows - x64)
|
||||
; CursorPosition = 61
|
||||
; FirstLine = 36
|
||||
; IDE Options = PureBasic 6.12 LTS (Linux - x64)
|
||||
; CursorPosition = 23
|
||||
; Folding = -
|
||||
; EnableXP
|
||||
; DPIAware
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue