It is currently Fri May 24, 2013 1:06 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Date Gadget Not Working Correctly
PostPosted: Thu Apr 05, 2012 11:19 am 
Offline
User
User

Joined: Mon Nov 03, 2008 8:30 am
Posts: 55
Location: Australia
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


Top
 Profile  
 
 Post subject: Re: Date Gadget Not Working Correctly
PostPosted: Thu Apr 05, 2012 3:30 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2401
Location: Utah, USA
Can you create a small code sample that can be compiled and executed to show the problem you are experiencing?

_________________
Image


Top
 Profile  
 
 Post subject: Re: Date Gadget Not Working Correctly
PostPosted: Sun Apr 22, 2012 2:36 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2401
Location: Utah, USA
Good news, I have found the solution to your problem after examining the code you provided

Make this change in the file '_FillMoviesWindowData.pbi' :
Code:
;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))


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).

_________________
Image


Top
 Profile  
 
 Post subject: Re: Date Gadget Not Working Correctly
PostPosted: Sun Apr 22, 2012 3:29 am 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 3011
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' :
Code:
;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))


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).


D'oh!! I read his code and couldn't see it. Too tired I guess.

_________________
Resist FaceBorg or have your ass laminated!


Top
 Profile  
 
 Post subject: Re: Date Gadget Not Working Correctly
PostPosted: Sun Apr 22, 2012 10:20 am 
Offline
User
User

Joined: Mon Nov 03, 2008 8:30 am
Posts: 55
Location: Australia
Thanks Demivec see PM sent today.
Jumbuck


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Exabot [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye