[Solved] Screen not updating
Posted
#1
(In Topic #954)
Enthusiast

I am sending messages to my user via a label called SysMessage but I am only getting the first one to show
when the form loads I get on screen
Code
labSystemMessage.Caption = "Starting End of Day" & gb.crlf & "Please wait..."
labSystemMessage.Refresh
Code
labSystemMessage.Caption = "Creating End of day Report - Cash In Drawer"
labSystemMessage.Refresh
frmClosePoS.Refresh
But the above message is not being shown (it acts like it is stuck on the first one)
If someone could tell me what I am doing wrong I would appreciate it as I am sending a lot of messages to my user on this form but none of them are being displayed.
This is the code behind the form
Code (gambas)
- ' Gambas class file
- labSystemMessage.Caption = "Starting End of Day" & gb.crlf & "Please wait..."
- labSystemMessage.Refresh
- .Delay = 1000
- .Start
- Sleep 1
- StartCloseFunction
- Case "Print"
- PrintReportOut
- 'SaveFigures
- EndOfDay
- Case "SaveOnly"
- 'SaveReport
- 'SaveFigures
- EndOfDay
- PrintReportOut
- 'SaveReport
- 'SaveFigures
- EndOfDay
- labSystemMessage.Caption = "Resetting PoS Figures to Zero"
- labSystemMessage.Refresh
- ZeroTenderValuesSave
- Sleep 1
- frmbackground.Workspace1.CloseAll
- MenuDisplay.ClearMenu
- frmbackground.Workspace1.Add(frmSignedOff, 0)
- labSystemMessage.Caption = "Creating End of day Report - Cash In Drawer"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- StartPrint
- labSystemMessage.Caption = "Creating End of day Report - Lottery Summary"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- LotterySummary
- labSystemMessage.Caption = "Creating End of day Report - Payout Summary"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- PrintPayoutSummary
- labSystemMessage.Caption = "Running End of Day on Payment Terminal"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- 'EndOfDayPaymentSense
- labSystemMessage.Caption = "Creating PoS Summary Report"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- PoSSummaryReport
- labSystemMessage.Caption = "Creating Safe Drop Summary Report"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- SafeDropSummary
- labSystemMessage.Caption = "Reloading PoS Figures"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- BootUp.LoadTenderValues
- Case "Print"
- labSystemMessage.Caption = "Printing End Of Day Report"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- PrinterFunctions.PrintEndOfSlip(0)
- SaveFigures
- Case "SaveOnly"
- labSystemMessage.Caption = "Saving End of Day Report"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- SaveFigures
- 'SaveReport
- labSystemMessage.Caption = "Saving End of Day Figure"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- SaveFigures
- labSystemMessage.Caption = "Printing End Of Day Report"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- PrinterFunctions.PrintEndOfSlip(0)
- labSystemMessage.Caption = "Saving End of Day Report"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- 'SaveReport
- labSystemMessage.Caption = "Saving End of Day Figure"
- labSystemMessage.Refresh
- frmClosePoS.Refresh
- SaveFigures
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "~"
- Global.PrinterData &= Global.LeftAlignText & global.BoldDoubleHeightFont & "Lottery Summary" & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- Global.PrinterData &= Global.CentreAlignText & global.NormalFont & "** THIS REPORT IS ONLY FOR THIS TERMINAL **" "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "~"
- totals = Global.NationLotteryPayout + Global.EuroMillionsPayout + Global.SetForLifePayout + Global.ThunderballPayout + Global.LottoHotPicksPayout + Global.ScrachCardPayout
- 'Private Sub EndOfDayPaymentSense()
- ' This makes the Payment Sense Terminal Run the end of day and banking and returns the report to this screen
- 'download the data and create a report here
- 'End
- LocalData &= global.CashierNamePrint & "|"
- LocalData &= Global.Normal_Cash & "|"
- LocalData &= Global.Normal_Cheque & "|"
- LocalData &= Global.Normal_Card & "|"
- LocalData &= Global.Normal_Coupon & "|"
- LocalData &= Global.Normal_GiftVoucher & "|"
- LocalData &= Global.Normal_GiftCard & "|"
- LocalData &= "0|"
- ' Global.Normal_OnAccount
- LocalData &= Global.refund_Cash & "|"
- LocalData &= Global.refund_Cheque & "|"
- LocalData &= Global.refund_Card & "|"
- LocalData &= Global.refund_Coupon & "|"
- LocalData &= Global.refund_GiftVoucher & "|"
- LocalData &= Global.refund_GiftCard & "|"
- LocalData &= "0|"
- 'Global.refund_OnAccount
- LocalData &= global.CustomerCount & "|"
- LocalData &= Global.NoSaleCount & "|"
- LocalData &= Global.TotalSaleVoids & "|"
- LocalData &= Global.NumberOfTotalSaleVoids & "|"
- LocalData &= Global.TotalSafeDrop & "|"
- LocalData &= global.SafeDropCount
- Global.PrinterData &= Global.LeftAlignText & global.BoldDoubleHeightFont & "PoS Summary" & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "~"
- Global.PrinterData &= Global.LeftAlignText & global.BoldDoubleHeightFont & "Sales" & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- Global.PrinterData &= Global.LeftAlignText & global.BoldNormalFont & "TENDER TYPE TOTAL" & "~"
- TotalSale = Global.Normal_Cash + Global.Normal_Card + Global.Normal_Coupon + Global.Normal_GiftCard + Global.Normal_GiftVoucher + Global.Normal_Cheque + Global.Normal_OnAccount
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "~"
- Global.PrinterData &= Global.LeftAlignText & global.BoldDoubleHeightFont & "Refunds" & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- Global.PrinterData &= Global.LeftAlignText & global.BoldNormalFont & "TENDER TYPE TOTAL" & "~"
- TotalRefund = Global.Refund_Cash + Global.Refund_Card + Global.Refund_Coupon + Global.Refund_GiftCard + Global.Refund_GiftVoucher + Global.Refund_Cheque + Global.Refund_OnAccount
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "~"
- Global.PrinterData &= Global.LeftAlignText & global.BoldDoubleHeightFont & "Float Summary" & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- TotalFloat = global.Floatin - global.FloatOut
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "~"
- Global.PrinterData &= Global.LeftAlignText & global.BoldDoubleHeightFont & "PoS Summary" & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- PrintTenderValue(" CUSTOMER COUNT", Global.CustomerCount & " ")
- PrintTenderValue(" NO SALE COUNT", Global.NoSaleCount & " ")
- PrintTenderValue(" TOTAL VOIDS COUNT", Global.NumberOfTotalSaleVoids & " ")
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "~"
- totals = TotalSale + Global.TotalSafeDrop - TotalRefund
- Global.PrinterData &= Global.LeftAlignText & global.BoldDoubleHeightFont & "Terminal Total" & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- Global.PrinterData &= Global.RightAlignText & global.BoldDoubleWidthHeightFont & Format((totals / 100), "£0.00") & "~"
- '2022/09/10,20:42,1105,Andrew,100.00
- Line Input #Global.hFile1, Linedata
- Global.LineMessages[0] 'Date
- Global.LineMessages[1] 'Time
- Global.LineMessages[2] 'Cashier
- Global.LineMessages[3] 'Cashier Name
- Global.LineMessages[4] ' Value Dropped
- 'Add to the print out so it can be porinted with the rest of the report
- Global.hFile1.Close
- 'Kill SafeDropDataFile
- ' Print a No Safe Drop done
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- Global.PrinterData &= Global.CentreAlignText & global.BoldDoubleWidthHeightFont & "END OF DAY" & "~"
- Global.PrinterData &= Global.CentreAlignText & global.BoldNormalFont & global.PrintDayOnReportFunction(Now) & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & "Cash in drawer" & "~"
- Global.PrinterData &= TempPrint
- Kill Global.PoSTenderFile
- ' This sets the system to load from the tenders.conf file
- TenderLocalFile["Tenders/Cash"] = "0"
- TenderLocalFile["Tenders/Card"] = "0"
- TenderLocalFile["Tenders/Coupon"] = "0"
- TenderLocalFile["Tenders/GiftCard"] = "0"
- TenderLocalFile["Tenders/GiftVoucher"] = "0"
- TenderLocalFile["Tenders/Cheque"] = "0"
- TenderLocalFile["Tenders/OnAccount"] = "0"
- 'Refund Values
- TenderLocalFile["Refunds/Cash"] = "0"
- TenderLocalFile["Refunds/Card"] = "0"
- TenderLocalFile["Refunds/Coupon"] = "0"
- TenderLocalFile["Refunds/GiftCard"] = "0"
- TenderLocalFile["Refunds/GiftVoucher"] = "0"
- TenderLocalFile["Refunds/Cheque"] = "0"
- TenderLocalFile["Refunds/OnAccount"] = "0"
- 'Float Settings
- TenderLocalFile["Float/FloatIn"] = "0"
- TenderLocalFile["Float/FloatOut"] = "0"
- 'Safe Drop Total
- TenderLocalFile["Safe Drop/Count"] = "0"
- TenderLocalFile["Safe Drop/TotalDropped"] = "0"
- 'Lottery Payouts
- TenderLocalFile["Lottery Payouts/NationLotteryPayout"] = "0"
- TenderLocalFile["Lottery Payouts/EuroMillionsPayout"] = "0"
- TenderLocalFile["Lottery Payouts/SetForLifePayout"] = "0"
- TenderLocalFile["Lottery Payouts/ThunderballPayout"] = "0"
- TenderLocalFile["Lottery Payouts/LottoHotPicksPayout"] = "0"
- TenderLocalFile["Lottery Payouts/ScrachCardPayout"] = "0"
- 'PoS Settings
- TenderLocalFile["PoS Settings/CustomerCount"] = "0"
- TenderLocalFile["PoS Settings/NoSaleCount"] = "0"
- TenderLocalFile["PoS Settings/NumberOfTotalSaleVoids"] = "0"
- TenderLocalFile["PoS Settings/TotalSaleVoids"] = "0"
- Global.PrinterData &= Global.LeftAlignText & global.BoldNormalFont & TenderName & Space(SPaceBetweenQtyTotal) & TenderValue & "~"
- Global.PrinterData &= Global.LeftAlignText & global.NormalFont & String(Global.PrinterWidth, "-") & "~"
- Global.PrinterData &= Global.RightAlignText & global.BoldDoubleHeightFont & PrintName & " " & TotalValue & " " & "~"
Posted
Guru

You may find it better to use "Wait 1" where you use "Sleep 1" or whatever the value..
Sleep completely halts your program but Wait will allow the event loop to catch up while it pauses.
I have fixed many an object refresh problem by adding a "Wait" or "Wait 0.1" or "Wait Next" instruction after updating it.
Posted
Guru

then all the objects can catch up and refresh in the "Wait" before StartPrint begins
You will find some functions hold up the event loop so using Wait you can let it catch up
Hope that makes sense
Posted
Enthusiast

Thanks for that I'll try it when I get to the computer
Also would it be better to keep the timer or would wait 3 wait 3 seconds and then start the process?
Posted
Guru

AndyGable said
BruceSteers
Thanks for that I'll try it when I get to the computer
Also would it be better to keep the timer or would wait 3 wait 3 seconds and then start the process?
Defo timer.
If you want to use methods automatically at program start then a timer is best as the Form_Open needs to complete to show your window.
instructions run in Form_Open happen "before" the window opens so if your GUI shows info for the process it will not be seen.
using a Timer allows the form to open and finish initializing before you begin a process..
Posted
Enthusiast

1 guest and 0 members have just viewed this.



