|
Home > Archive > Programming with dBASE > February 2006 > Problem with DatePicker.cc
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem with DatePicker.cc
|
|
| Bosco Wilson 2006-02-07, 8:23 pm |
| I am trying to use DatePicker in the duflp, but am getting caught up with
it. I have it on page 4 of my form (using a tab box). The problem is that
when I open the form, the calender.bmp is showing on the form (on page 1).
Anybody figured out a workaround for this problem?
Thank You.
Bosco
| |
| Michael Nuwer [dBVIPS] 2006-02-08, 3:23 am |
| Bosco Wilson wrote:
> I am trying to use DatePicker in the duflp, but am getting caught up with
> it. I have it on page 4 of my form (using a tab box). The problem is that
> when I open the form, the calender.bmp is showing on the form (on page 1).
> Anybody figured out a workaround for this problem?
Could you create a demonstration of the problem? The form below is not
behaving as you describe; I'm not sure what your problem would be.
** END HEADER -- do not remove this line
//
// Generated on 02/07/2006
//
parameter bModal
local f
f = new testForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class testForm of FORM
set procedure to :duflp:DatePicker.cc additive
set procedure to :duflp:FORMCNTL.CC additive
with (this)
metric = 6 // Pixels
height = 352.0
left = 371.0
top = 0.0
width = 460.0
text = ""
pageno = 4
endwith
this.KMCUSTTABBOX1 = new KMCUSTTABBOX(this)
with (this.KMCUSTTABBOX1)
height = 22.0
left = 0.0
top = 330.0
width = 460.0
dataSource = 'ARRAY {"Pg 1","Pg 2","Pg 3","Pg 4"}'
endwith
this.SBDATEPICKER1 = new SBDATEPICKER(this)
with (this.SBDATEPICKER1)
height = 22.0
left = 112.0
top = 88.0
width = 154.0
pageno = 4
endwith
endclass
| |
| Alan Fitch 2006-02-08, 7:23 am |
| I get the bitmap on page 1 the first time the form is run but switching to another page and then back to 1 the bitmap disappears.
Alan Fitch
| |
| Michael Nuwer [dBVIPS] 2006-02-08, 7:23 am |
| Alan,
Did you get this result using the form I posted? I am not seeing a
bitmap on page 1. This is odd. I'll have to look at which OS and dBASE
version I'm using.
Thanks for testing this.
Michael Nuwer
Alan Fitch wrote:
> I get the bitmap on page 1 the first time the form is run but switching to another page and then back to 1 the bitmap disappears.
>
>
> Alan Fitch
| |
| Bosco Wilson 2006-02-08, 9:23 am |
| Mike -
I also see the bmp on the first page using your example. Like Alan said,
when switching pages, then back to 1, the bmp is not displayed anymore. I
tried doing something like this on my form with no success:
form_onopen
form.pageno := 4
form.pageno :=1
return
No luck though. Is there a way to programatically switch the page on the
screen?
By the way, I'm using XP Home Edition SP2 with Dbase 2.6
Thanks for the help.
Bosco
"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:hNwj8PKLGHA.676@news-server...[color=darkred]
> Alan,
>
> Did you get this result using the form I posted? I am not seeing a bitmap
> on page 1. This is odd. I'll have to look at which OS and dBASE version
> I'm using.
>
> Thanks for testing this.
> Michael Nuwer
>
>
> Alan Fitch wrote:
| |
| Marc VdB 2006-02-08, 1:23 pm |
| Hi Bosco, a quick and dirty workarounf, is to change the formatbutton-method
in the datepicker.cc to the following :
function formatButton
this.parent.pageno = this.pageno
this.pb = new pushbutton(this.parent)
this.pb.owner = this
with (this.pb)
group = true
Top = this.top + 2
Left = this.left+this.width - 40
Height = this.height - 3
Width = 22
Text = ""
OnClick = CLASS::PBDatePicker_
OnClick
UpBitmap = "filename:2 Calendar.bmp"
tabStop = false
endwith
this.parent.pageno = 1
return
You can try it with Michael's demoform.
However, i don't know if you will see any flickering, if your form has a lot
of other controls...
HTH, MArc
--
www.vdblogic.de/dbl
------
| |
| Michael Nuwer [dBVIPS] 2006-02-09, 7:23 am |
|
Hi Bosco,
I tested on three systems (WinNT/Plus2.21, Win2000/Plus2.5, and
XP/Plus2.6) and was unable to see this problem. There must be something
different between my systems and those are seeing this problem, but I
don't know what that would be. Did you try Marc's suggestion? Did it help?
Another suggestion is to try calling the repaint function in your form's
onOpen event handler.
function Repaint
parameter oForm
if type( "oForm" ) == "U" or empty( oForm )
oForm = form
endif
if type( "UpdateWindow" ) # "FP"
extern CLOGICAL UpdateWindow( CHANDLE ) USER32
endif
RETURN UpdateWindow( oForm.hWnd )
Michael Nuwer
Bosco Wilson wrote:
> Mike -
>
> I also see the bmp on the first page using your example. Like Alan said,
> when switching pages, then back to 1, the bmp is not displayed anymore. I
> tried doing something like this on my form with no success:
>
> form_onopen
> form.pageno := 4
> form.pageno :=1
> return
>
> No luck though. Is there a way to programatically switch the page on the
> screen?
> By the way, I'm using XP Home Edition SP2 with Dbase 2.6
| |
| Michael Nuwer [dBVIPS] 2006-02-09, 7:23 am |
| Marc VdB wrote:
> Hi Bosco, a quick and dirty workarounf, is to change the formatbutton-method
> in the datepicker.cc to the following :
Hi Marc,
Do you have any idea what might be causing this problem? I'm not seeing
it on three different test system. What would be different between our
systems? Language drivers, that shouldn't affect images... Plus.ini?
Paths with spaces (I have no spaces)?
Michael
| |
| Mervyn Bick 2006-02-09, 7:23 am |
| On Thu, 09 Feb 2006 13:28:53 +0200, Michael Nuwer [dBVIPS]
<nuwermj@nospam.please.yahoo.com> wrote:
> Marc VdB wrote:
>
> Hi Marc,
>
> Do you have any idea what might be causing this problem? I'm not seeing
> it on three different test system. What would be different between our
> systems? Language drivers, that shouldn't affect images... Plus.ini?
> Paths with spaces (I have no spaces)?
>
> Michael
Michael,
Using your original test program and then changing to Marc's revised
formatbuttom method both give me the same results. XP Pro, SP2 and dBase
Plus 2.6
When the program first runs the little icon that brings up the Date
Selector shows on the first page. A screen print is at
http://img.photobucket.com/albums/v..._datepicker.jpg
The icon is active and if a date is selected it shows in the entryfield on
page 4.
Once any other page has been selected the icon no longer shows when one
returns to page 1.
Mervyn
| |
| Bosco Wilson 2006-02-09, 11:23 am |
| I tried Marc's code, but lost the .bmp completely. Been busy at work and
havn't had much time to play with it though. I will try the repaint and see
if it works. Thank you very much for the help.
Bosco
"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:3dawp0WLGHA.592@news-server...[color=darkred]
>
> Hi Bosco,
>
> I tested on three systems (WinNT/Plus2.21, Win2000/Plus2.5, and
> XP/Plus2.6) and was unable to see this problem. There must be something
> different between my systems and those are seeing this problem, but I
> don't know what that would be. Did you try Marc's suggestion? Did it help?
>
> Another suggestion is to try calling the repaint function in your form's
> onOpen event handler.
>
> function Repaint
> parameter oForm
> if type( "oForm" ) == "U" or empty( oForm )
> oForm = form
> endif
> if type( "UpdateWindow" ) # "FP"
> extern CLOGICAL UpdateWindow( CHANDLE ) USER32
> endif
> RETURN UpdateWindow( oForm.hWnd )
>
> Michael Nuwer
>
>
> Bosco Wilson wrote:
| |
| Marc VdB 2006-02-09, 11:23 am |
| Sorry guys, i posted the wrong code,
there is a line missing: just before the endwith, add the line
pageno = this.pageno
HTH, Marc
--
www.vdblogic.de/dbl
------
| |
| Marc VdB 2006-02-09, 11:23 am |
| Hi Michael,
> Do you have any idea what might be causing this problem? I'm not seeing it
> on three different test system. What would be different between our
> systems? Language drivers, that shouldn't affect images... Plus.ini? Paths
> with spaces (I have no spaces)?
I don't know. No spaces in my directories neither.
Don't know what in the ini could provoke this behaviour...
Marc
--
www.vdblogic.de/dbl
------
| |
| Mervyn Bick 2006-02-09, 1:23 pm |
| On Thu, 09 Feb 2006 18:58:26 +0200, Marc VdB <vdbsoft@web.de> wrote:
> Sorry guys, i posted the wrong code,
>
> there is a line missing: just before the endwith, add the line
>
> pageno = this.pageno
Nope. That didn't do it. Exactly the same behaviour as before.
Mervyn
| |
| Marc VdB 2006-02-09, 1:23 pm |
| Hi Mervyn,
there are two formatbutton methods in the cc, make sure you choose the one
for the sbdatepicker.
On my machine (XP SP2 dBPlus2.6 btw) i see the same behaviour, as you and
bosco, but with the changed method, it works as it should ...
CU, Marc
--
www.vdblogic.de/dbl
------
| |
| Mervyn Bick 2006-02-10, 3:23 am |
| On Thu, 09 Feb 2006 20:45:43 +0200, Marc VdB <vdbsoft@web.de> wrote:
> Hi Mervyn,
>
> there are two formatbutton methods in the cc, make sure you choose the
> one
> for the sbdatepicker.
Ah! Now if I had tried to get my head round the code in datepicker.cc
instead of just using it I might just have realised that. <g>
> On my machine (XP SP2 dBPlus2.6 btw) i see the same behaviour, as you and
> bosco, but with the changed method, it works as it should ...
It now works properly for me as well.
Mervyn
|
|
|
|
|