problem with pushbutton
- cdmmaui
- Posts: 653
- Joined: Fri Oct 28, 2005 9:53 am
- Location: The Woodlands - Dallas - Scottsdale - London
- Contact:
problem with pushbutton
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())
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())
Button-Class-change from BUTTON to BUTTONBMP
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
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
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- cdmmaui
- Posts: 653
- Joined: Fri Oct 28, 2005 9:53 am
- Location: The Woodlands - Dallas - Scottsdale - London
- Contact:
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
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
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
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
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
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
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
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
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
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
>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