problem with pushbutton

problem with pushbutton

Postby cdmmaui » Fri Jan 11, 2008 5:28 am

Hello,

I am having a problem with pushbutton. The user must click the button twice to perform the necessary action. Any ideas?

REDEFINE BUTTON ID 200 OF oDlg ACTION ( EditFl( .F., invoice->file ), _Lbx( oLbx2 ) )
REDEFINE BUTTON ID 201 OF oDlg ACTION _StmPrt( oLbx, nFlParty, invoice->( recno() ) )
REDEFINE BUTTON ID 202 OF oDlg ACTION (lQuit := .T., oDlg:End())
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Button-Class-change from BUTTON to BUTTONBMP

Postby ukoenig » Sat Jan 12, 2008 1:01 am

REDEFINE BUTTON ID 200 OF oDlg ACTION ( EditFl( .F., invoice->file ), _Lbx( oLbx2 ) )

Try this :
Ich changed all my buttons to Class < BUTTONBMP > like :

-----------------------------------------------------------

REDEFINE BUTTONBMP oBtn1 ID 200 OF oDlg ;
ACTION ( EditFl( .F., invoice->file ), _Lbx( oLbx2 ) ) ;
BITMAP "yourBitmap" PROMPT "Button Text" TEXTRIGHT

oBtn1:cTooltip "This is a Test" + CRLF "for ButtonBmp"

------------------------------------------------------------
( yourBitmap is a Ressourcen-Bitmap )
No changes of the button in the Ressource.
TEXTRIGHT = Bitmap = LEFT, TEXTLEFT = Bitmap = RIGHT

It looks great ( a normal Button with Bitmap and Tooltip )
That is all, what you have to do.
I hope it helps.

Greetings from Germany
U. König :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Antonio Linares » Sat Jan 12, 2008 7:19 am

Darrell,

Are you using FWH or FW++ ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby cdmmaui » Sat Jan 12, 2008 9:42 pm

Antonio,

I am using FWH lib dates of 12/2007
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby Antonio Linares » Sat Jan 12, 2008 10:34 pm

Darrell,

Could you please provide a small and self contained sample to reproduce the problem ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby cdmmaui » Sat Jan 12, 2008 10:37 pm

Here is the source.

DEFINE DIALOG oDlg RESOURCE "FRTLIST"

REDEFINE GET aGet[01] VAR cFile ID 101 OF oDlg PICTURE "@!" WHEN .F.
REDEFINE GET aGet[02] VAR nFlparty ID 102 OF oDlg PICTURE "9" ;
VALID ( lPass := _FlOk( nFlParty, @nShare, @nInvCnt, cGroupon, cFlkey, cMbl, oLbx2 ), aGet[03]:Refresh(), lPass )

REDEFINE GET aGet[03] VAR nShare ID 103 OF oDlg PICTURE "99.99" ;
VALID ( lPass := _FlOk2( nShare ), aGet[03]:Refresh(), lPass )

REDEFINE GET aGet[04] VAR cMbl ID 104 OF oDlg PICTURE "@!" WHEN .F.
REDEFINE GET aGet[05] VAR cHbl ID 105 OF oDlg PICTURE "@!" WHEN .F.
REDEFINE COMBOBOX aGet[06] VAR cFlRem ID 106 ITEMS aFlRem OF oDlg ;
VALID ( lPass := _FlOk3( cGroupon, cFlkey, cFlRem ), lPass )

SELECT invoice
SET ORDER TO TAG S7
GO TOP
SEEK cFlkey
SET FILTER TO ( invoice->flkey = cFlkey )

REDEFINE LISTBOX oLbx2 FIELDS invoice->type , ;
invoice->flkey , ;
invoice->invoice , ;
DTOC( invoice->invdate ) , ;
TRANSF( invoice->totamt, "9,999,999.99" ) , ;
TRANSF( invoice->totcst, "9,999,999.99" ) , ;
IF( invoice->flprt, "PRINTED","NOT-PRINTED") , ;
invoice->fluser , ;
invoice->fldate , ;
invoice->fltime ;
ID 6000 ;
HEADERS "Type", "F/L Key", "CR/DB No.", "Ref Date", "Revenue", "Outlay", "Status", "F/L User", "Date", "Time" ;
FIELDSIZES 75 , 125 , 125 , 85 , 100 , 100 , 100 , 100 , 85 , 85 ;
SELECT invoice->flkey FOR cFlkey ;
ON DBLCLICK ( EditFl( .F., invoice->file ), _Lbx( oLbx2 ) ) ;
ON CHANGE ( nShare := invoice->flper, aGet[03]:Refresh() ) ;
OF oDlg

REDEFINE BUTTON ID 200 OF oDlg ACTION ( EditFl( .F., invoice->file ), _Lbx( oLbx2 ) )
REDEFINE BUTTON ID 201 OF oDlg ACTION _StmPrt( oLbx, nFlParty, invoice->( recno() ) )
REDEFINE BUTTON ID 202 OF oDlg ACTION (lQuit := .T., oDlg:End())

ACTIVATE DIALOG oDlg CENTERED
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby James Bott » Sat Jan 12, 2008 11:55 pm

Darrell,

REDEFINE BUTTON ID 200 OF oDlg ACTION ( EditFl( .F., invoice->file ), _Lbx( oLbx2 ) )
REDEFINE BUTTON ID 201 OF oDlg ACTION _StmPrt( oLbx, nFlParty, invoice->( recno() ) )
REDEFINE BUTTON ID 202 OF oDlg ACTION (lQuit := .T., oDlg:End())

Can you post the EditFl() and _StmPrt() functions?

Does the ID 202 (quit) button also require two clicks?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby cdmmaui » Sun Jan 13, 2008 12:09 am

Hi James,

Yes, all buttons require two clicks. I placed Msginfo() at the beginning of each function and to make sure I had to click it twice. I do not think it is a problem with editfl() or _stmprt().

Thank you,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby James Bott » Sun Jan 13, 2008 12:16 am

If you comment out all the REDEFINEs except the buttons, do they still require two clicks?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby cdmmaui » Sun Jan 13, 2008 12:45 am

James,

Thank you for your advice. I found the problem, it was a problem the valid function. I have corrected and it is working now. Thank you for opening up my eyes
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby James Bott » Sun Jan 13, 2008 1:04 am

Darrell,

Great news.

I commonly resort to the 50% method. I take out half the code, then check again. If it is stll there then I have eliminated half the code. Then I eliminate half of the remaining half, etc., until I isolate the problem. This is much faster the eliminating one line at a time.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby cdmmaui » Sun Jan 13, 2008 1:15 am

James,

Thanks again. By the way, is there a function available to find out what user or computer has locked a specific record?
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby James Bott » Sun Jan 13, 2008 1:28 am

Darrell,

>By the way, is there a function available to find out what user or computer has locked a specific record?

Not to my knowledge.

There is a discussion about this here:
http://fivetechsoft.com/forums/viewtopi ... ght=locked

Consider using optimistic locking (edit, lock, save, unlock). This takes only a split second so it is unlikely that a locked record is going to be a problem.

If you are using pessimistic locking (lock, edit, save, unlock) then records can end up being locked for very long periods--even days when someone leaves work with a locked record.

There is another method that was used back in the DOS era (maybe still is). You add a field to each database for the username. When the record is locked the username is inserted into this field. That way you can read the username when the record is locked.

James

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 43 guests