Home > Archive > Programming with dBASE > March 2006 > button_onclick









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 button_onclick
Moses Hanna

2006-02-28, 8:25 pm

Hi
I have a form containing a custom calendar.cc ( I have added to it a button
called gotodaypb.)
withing an event I want this button's onclick event to execute:
I used
I so and so
form.gotodaypb_onclick()
endif
It soesn't work
I used
I so and so
cladd::gotodaypb_onc
lick
endif
It doesn't work.
Can some gentleman show me how to call this gotodaypb onclick or how to make
its event execute
Please
Thanks
Moses


Dan Bernard

2006-02-28, 8:25 pm

Have you tried:

class::gotodaypb_onc
lick()

"Moses Hanna" <mosesjhanna@hotmail.com> wrote in message
news:X7hQDGDPGHA.2016@news-server...
> Hi
> I have a form containing a custom calendar.cc ( I have added to it a
> button called gotodaypb.)
> withing an event I want this button's onclick event to execute:
> I used
> I so and so
> form.gotodaypb_onclick()
> endif
> It soesn't work
> I used
> I so and so
> cladd::gotodaypb_onc
lick
> endif
> It doesn't work.
> Can some gentleman show me how to call this gotodaypb onclick or how to
> make its event execute
> Please
> Thanks
> Moses
>



Marc VdB

2006-02-28, 8:25 pm

Hi Moses, see code below.

local f
f = new mosesclickForm()
f.Open()

class mosesclickForm of FORM
with (this)
metric = 6 // Pixel
height = 80 ; left = 371
top = 5 ; width = 161
endwith

this.calendar = new CONTAINER(this)
this.calendar.anchor = 6

this.calendar.pb1 = new PUSHBUTTON(this.calendar)
with (this.calendar.pb1)
onclick= {; ? "You clicked the first button"}
height = 24 ; left = 18
top = 8 ; width = 107
text = "First"
endwith

this.calendar.pb2 = new PUSHBUTTON(this.calendar)
with (this.calendar.pb2)
onclick= class::prog_click
height = 24 ; left = 18
top = 41 ; width = 107
text = "Second"
endwith

function prog_click
? "You clicked the second button, then programmatically"
this.parent.pb1.onclick()
** this is pb2
** this.parent is the calendar-container
** this.parent.pb1 is pb1 (of course <g> )
** this.parent.pb1.onclick is the function pointer to the onclick
method
** this.parent.pb1.onclick() --> Call (execute) the function
return
endclass

--
www.vdblogic.de/dbl
------


Moses Hanna

2006-02-28, 8:25 pm

Hi Marc, thanks for helping.
Please rebuild your example and put the pb2 outside the calendar container
and then call bp1 from pb2,
becausae I have a pb outside the calendar container and I want to cal the
gotodaypb_onclick( which is inside the calendar class ( container) from an
event or a pushbutton click which is within the class of the main form.
Thanks
Moses

"Marc VdB" <vdbsoft@web.de> wrote in message
news:cTEQ02GPGHA.1740@news-server...
> Hi Moses, see code below.
>
> local f
> f = new mosesclickForm()
> f.Open()
>
> class mosesclickForm of FORM
> with (this)
> metric = 6 // Pixel
> height = 80 ; left = 371
> top = 5 ; width = 161
> endwith
>
> this.calendar = new CONTAINER(this)
> this.calendar.anchor = 6
>
> this.calendar.pb1 = new PUSHBUTTON(this.calendar)
> with (this.calendar.pb1)
> onclick= {; ? "You clicked the first button"}
> height = 24 ; left = 18
> top = 8 ; width = 107
> text = "First"
> endwith
>
> this.calendar.pb2 = new PUSHBUTTON(this.calendar)
> with (this.calendar.pb2)
> onclick= class::prog_click
> height = 24 ; left = 18
> top = 41 ; width = 107
> text = "Second"
> endwith
>
> function prog_click
> ? "You clicked the second button, then programmatically"
> this.parent.pb1.onclick()
> ** this is pb2
> ** this.parent is the calendar-container
> ** this.parent.pb1 is pb1 (of course <g> )
> ** this.parent.pb1.onclick is the function pointer to the onclick
> method
> ** this.parent.pb1.onclick() --> Call (execute) the function
> return
> endclass
>
> --
> www.vdblogic.de/dbl
> ------
>
>



Moses Hanna

2006-02-28, 8:25 pm

Sorry Dan, it doesn't work

"Dan Bernard" <dan_bernard@hotmail.com> wrote in message
news:Jb3TJoGPGHA.1740@news-server...
> Have you tried:
>
> class::gotodaypb_onc
lick()
>
> "Moses Hanna" <mosesjhanna@hotmail.com> wrote in message
> news:X7hQDGDPGHA.2016@news-server...
>
>



Michael Nuwer [dBVIPS]

2006-03-05, 8:27 pm

Moses Hanna wrote:
> Hi Marc, thanks for helping.
> Please rebuild your example and put the pb2 outside the calendar container
> and then call bp1 from pb2,
> becausae I have a pb outside the calendar container and I want to cal the
> gotodaypb_onclick( which is inside the calendar class ( container) from an
> event or a pushbutton click which is within the class of the main form.
> Thanks
> Moses


If I understand correctly, this should do it:

form.calendar1.gotodaypb_onclick()












>
> "Marc VdB" <vdbsoft@web.de> wrote in message
> news:cTEQ02GPGHA.1740@news-server...
>
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com