Several programs written using a separate Events Handler for EACH Window were working just fine
until I tried to introduce PB's DATEGADGET into a window which I find will not work correctly.
Set up as gadget in my Emuneration section as #Gadget_ViewDate so should have it's own unique ID.
Set up in any window ;-
DateGadget(#Gadget_ViewDate, 160, 290, 120, 25, "%dd/%mm/%yyyy", Date(), #PB_Date_CheckBox)
Clicking the gadget in the window will open the pop-up calendar but any selected date will not display.
Have overcome this by adding the following in the window events allowing selection from calendar
and displaying date correctly formatted.
Case #Gadget_ViewDate
SetGadgetText(#Gadget_ViewDate,"%dd/%mm/%yyyy")
However the displayed date will not allow editing as a normal DateGadget does.
Without resorting to Single Event Handler for a program is there any work around to allow date editing
using this method of coding.
Thanks Jumbuck
Date Gadget Not Working Correctly
Re: Date Gadget Not Working Correctly
Can you create a small code sample that can be compiled and executed to show the problem you are experiencing?
Re: Date Gadget Not Working Correctly
Good news, I have found the solution to your problem after examining the code you provided
Make this change in the file '_FillMoviesWindowData.pbi' :
You were setting the mask of the gadget to be the same as the date, which wouldn't allow any editing because when the date "01/03/2012" is used as a mask it doesn't allow any values to be entered (no %d, %m, or %y).
Make this change in the file '_FillMoviesWindowData.pbi' :
Code: Select all
;replace the first line for the second one
;SetGadgetText(#Gadget_ViewDate, \ViewDate) ;this sets the mask x)
SetGadgetState(#Gadget_ViewDate, ParseDate("%dd/%mm/%yyyy", \ViewDate))
- Fangbeast
- PureBasic Protozoa
- Posts: 4792
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: Date Gadget Not Working Correctly
D'oh!! I read his code and couldn't see it. Too tired I guess.Demivec wrote:Good news, I have found the solution to your problem after examining the code you provided
Make this change in the file '_FillMoviesWindowData.pbi' :You were setting the mask of the gadget to be the same as the date, which wouldn't allow any editing because when the date "01/03/2012" is used as a mask it doesn't allow any values to be entered (no %d, %m, or %y).Code: Select all
;replace the first line for the second one ;SetGadgetText(#Gadget_ViewDate, \ViewDate) ;this sets the mask x) SetGadgetState(#Gadget_ViewDate, ParseDate("%dd/%mm/%yyyy", \ViewDate))
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: Date Gadget Not Working Correctly
Thanks Demivec see PM sent today.
Jumbuck
Jumbuck