but didn't help. I must start deleting code to see what is causing the problem.
Code: Select all
PurifierGranularity(1,1,1,1)
XIncludeFile "ListExModule.pbi"
Global FontName.s = "Arial"
Global FontSize.a = 11
Enumeration
#Font_Custom
#Font_Custom_B
#MainWindow
#Books_cont
#Books_pnl_add
#Books_cont_add
#Books_pnl_search
#Books_Search_txt_id
#Books_Search_str_id
#Books_cont_search
#Books_frm_search_criteria
#Books_frm_search_results
#Books_btn_search
#Books_lst_results
EndEnumeration
Procedure SearchBooks()
Debug "****** procedure call ******"
ListEx::DebugList(#Books_lst_results)
Debug ListEx::CountItems(#Books_lst_results)
ListEx::ClearItems(#Books_lst_results)
ListEx::DebugList(#Books_lst_results)
Debug ListEx::CountItems(#Books_lst_results)
ListEx::DebugList(#Books_lst_results)
If ListEx::CountItems(#Books_lst_results) = 0
ListEx::AddItem(#Books_lst_results, 0, "" + #LF$ + "No results")
EndIf
EndProcedure
LoadFont(#Font_Custom, FontName, FontSize)
LoadFont(#Font_Custom_B, FontName, FontSize, #PB_Font_Bold)
If OpenWindow(#MainWindow, 0, 0, 800, 800, "Library", #PB_Window_ScreenCentered|#PB_Window_MinimizeGadget)
;-Books items
ContainerGadget(#Books_cont,-1,122,WindowWidth(#MainWindow)+2,WindowHeight(#MainWindow)-119,#PB_Container_Single)
ButtonGadget(#Books_pnl_search,10,10,200,35,"Find book")
ContainerGadget(#Books_cont_search,0,45,WindowWidth(#MainWindow),WindowHeight(#MainWindow)-168,#PB_Container_Flat)
FrameGadget(#Books_frm_search_criteria,10,1,200,WindowHeight(#MainWindow)-180,"Search criteria")
TextGadget(#Books_search_txt_id,20,80,180,20,"Book ID:")
StringGadget(#Books_Search_str_id,20,100,180,25,"")
ButtonGadget(#Books_btn_search,20,400,180,35,"Find book")
FrameGadget(#Books_frm_search_results,220,1,570,WindowHeight(#MainWindow)-180,"Results")
ListEx::Gadget(#Books_lst_results,230,23,550,WindowHeight(#MainWindow)-210, "id", 80, "", ListEx::#GridLines)
ListEx::AddColumn(#Books_lst_results,1,"title",230)
ListEx::AddColumn(#Books_lst_results,2,"writer",140)
ListEx::AddColumn(#Books_lst_results,3,"publisher",140)
ListEx::AddColumn(#Books_lst_results,4,"year",100)
ListEx::AddColumn(#Books_lst_results,5,"copies",100)
ListEx::AddColumn(#Books_lst_results,6,"ISBN",100)
ListEx::DisableReDraw(#Books_lst_results, #True)
ListEx::SetHeaderAttribute(#Books_lst_results, ListEx::#Align, ListEx::#Center)
ListEx::SetFont(#Books_lst_results, FontID(#Font_Custom))
ListEx::SetFont(#Books_lst_results, FontID(#Font_Custom_B), ListEx::#HeaderFont)
ListEx::DisableReDraw(#Books_lst_results, #False)
ListEx::SetRowsHeight(#Books_lst_results, 22)
ListEx::SetAutoResizeFlags(#Books_lst_results, ListEx::#ResizeHeight)
ListEx::SetColorTheme(#Books_lst_results, ListColorTheme)
CloseGadgetList()
Repeat
Select (WaitWindowEvent())
Case #PB_Event_CloseWindow
Done = #True
;-ButtonEx events
Case #PB_Event_Gadget
evnt = EventGadget()
Select evnt
Case #Books_btn_search
SearchBooks()
EndSelect
EndSelect
Until Done
EndIf
I tried your code. I always get 1. I use PB 5.71 b2, is this the problem?
I noticed the last three days that my code delays 2-4 seconds to run when pressing F5 (it ran instantly before). I thought it had to do with the graphics and code added but now it doesn't seem logical for the above 85 lines that I posted.