Help with button

Help with button

Postby acwoo1 » Thu Nov 26, 2009 1:29 am

Hi,

Why when I click on the button below, the button does not skip ? If I remove skinbuttons(), its ok.

#include "fivewin.ch"

function main()
Local oDlg
Local oNum
Local cNum

skinbuttons()

if (!file("TestNum.dbf"))
tmpdbf:= {}
AAdd(tmpdbf, {"Num", "C", 40, 0})
dbcreate("TestNum.dbf", tmpdbf)
dbusearea(.T., Nil, "TestNum", Nil, Nil, .F.)
Append Blank
Replace Num With "One"
Append Blank
Replace Num With "Two"
Append Blank
Replace Num With "Three"
Append Blank
Replace Num With "Four"
Append Blank
Replace Num With "Five"
EndIf

use TestNum new
goto top

cNum:= TestNum->Num

DEFINE DIALOG oDlg FROM 0, 0 TO 26, 79 ;
TITLE "Test"

@ 9.95, 15.5 BUTTON "&NEXT" OF oDlg SIZE 40, 12 ;
ACTION ( Nextlast(), ;
cNum:= TestNum->Num, oNum:Refresh())

@ 9.95, 8.5 BUTTON "&TOP" OF oDlg SIZE 40, 12 ;
ACTION ( Toplast(), ;
cNum:= TestNum->Num, oNum:Refresh())


@ 9.95, 22.5 BUTTON "&PREV" OF oDlg SIZE 40, 12 ;
ACTION ( Prevlast(), ;
cNum:= TestNum->Num, oNum:Refresh())


@ 9.95, 29.5 BUTTON "&BOTTOM" OF oDlg SIZE 40, 12 ;
ACTION ( Botlast(), ;
cNum:= TestNum->Num, oNum:Refresh())

@ 9.95, 36.5 BUTTON "&END" OF oDlg SIZE 40, 12 ACTION oDlg:End()

@ 0, 1 say "Number:"

@ 0, 10 say oNum VAR cNum OF oDlg SIZE 45, 11 COLOR CLR_GREEN

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL
***************************
STATIC Function Toplast()

GOTO TOP

return nil
***************************
STATIC Function Nextlast()

TestNum->(dbskip())
if eof()
msginfo("No More Record Found")
GO BOTTOM
endif

return nil
***************************
STATIC Function Prevlast()

TestNum->(dbskip(-1))
IF bof()
msginfo("No Previous Record Found")
GOTO TOP
endif

return nil
***************************
STATIC Function Botlast()

GO BOTTOM

return nil
***************************

Thanks

Regards

AC Woo
using fwh910+harbour+bcc55
acwoo1
 
Posts: 173
Joined: Tue Nov 10, 2009 10:56 am

Re: Help with button

Postby richard-service » Thu Nov 26, 2009 1:52 am

acwoo1 wrote:Hi,

Why when I click on the button below, the button does not skip ? If I remove skinbuttons(), its ok.

#include "fivewin.ch"

function main()
Local oDlg
Local oNum
Local cNum

skinbuttons()

if (!file("TestNum.dbf"))
tmpdbf:= {}
AAdd(tmpdbf, {"Num", "C", 40, 0})
dbcreate("TestNum.dbf", tmpdbf)
dbusearea(.T., Nil, "TestNum", Nil, Nil, .F.)
Append Blank
Replace Num With "One"
Append Blank
Replace Num With "Two"
Append Blank
Replace Num With "Three"
Append Blank
Replace Num With "Four"
Append Blank
Replace Num With "Five"
EndIf

use TestNum new
goto top

cNum:= TestNum->Num

DEFINE DIALOG oDlg FROM 0, 0 TO 26, 79 ;
TITLE "Test"

@ 9.95, 15.5 BUTTON "&NEXT" OF oDlg SIZE 40, 12 ;
ACTION ( Nextlast(), ;
cNum:= TestNum->Num, oNum:Refresh())

@ 9.95, 8.5 BUTTON "&TOP" OF oDlg SIZE 40, 12 ;
ACTION ( Toplast(), ;
cNum:= TestNum->Num, oNum:Refresh())


@ 9.95, 22.5 BUTTON "&PREV" OF oDlg SIZE 40, 12 ;
ACTION ( Prevlast(), ;
cNum:= TestNum->Num, oNum:Refresh())


@ 9.95, 29.5 BUTTON "&BOTTOM" OF oDlg SIZE 40, 12 ;
ACTION ( Botlast(), ;
cNum:= TestNum->Num, oNum:Refresh())

@ 9.95, 36.5 BUTTON "&END" OF oDlg SIZE 40, 12 ACTION oDlg:End()

@ 0, 1 say "Number:"

@ 0, 10 say oNum VAR cNum OF oDlg SIZE 45, 11 COLOR CLR_GREEN

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL
***************************
STATIC Function Toplast()

GOTO TOP

return nil
***************************
STATIC Function Nextlast()

TestNum->(dbskip())
if eof()
msginfo("No More Record Found")
GO BOTTOM
endif

return nil
***************************
STATIC Function Prevlast()

TestNum->(dbskip(-1))
IF bof()
msginfo("No Previous Record Found")
GOTO TOP
endif

return nil
***************************
STATIC Function Botlast()

GO BOTTOM

return nil
***************************

Thanks

Regards

AC Woo
using fwh910+harbour+bcc55

Hi
I test Antonio publish SkinButton demo EXE. I found if alwayse press button more times, focus or action not work like run loop.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 801
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Help with button

Postby Enrico Maria Giordano » Thu Nov 26, 2009 10:22 am

acwoo1 wrote:Why when I click on the button below, the button does not skip ? If I remove skinbuttons(), its ok.


Your sample works fine here.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8568
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Help with button

Postby acwoo1 » Thu Nov 26, 2009 11:43 am

Thanks for your help

When in "Next" button, and I click "Prev" button, the "Prev" is not processed. "Next" button flashes each time I click "Prev".

Thanks

Regards


AC Woo
fwh9.10+harbour+bcc55
acwoo1
 
Posts: 173
Joined: Tue Nov 10, 2009 10:56 am

Re: Help with button

Postby acwoo1 » Tue Jul 06, 2010 1:18 pm

Hi,

If I click the 'Next' slowly, it runs OK. But if I click 'Next' too fast and then I click 'Prev', the program hangs.

Any help appreciated

ACWOO
Using fwh10.6 + bcc582 + harbour2.1.0
acwoo1
 
Posts: 173
Joined: Tue Nov 10, 2009 10:56 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft and 46 guests