oBrw:bEdit := { |oRec| EditServizi( oRec ) }
@ 300,328 BUTTON "ADD" SIZE 100,40 PIXEL OF oDlg ACTION oBrw:EditSource()
when I add these commands on dialog it make error
@ 66,120 XIMAGE oRec:Image SOURCE IF(empty(oRec:Image),cDefaImage,oRec:Image);
SIZE 50, 50 OF oDlg
the code
- Code: Select all Expand view RUN
Function EditServizi( oRec )
local lAdd := ( oRec:RecNo == 0 )
local lSave := .F.
local oFont
local oBtn
local oDlg
local oBtnImage
local cFile :=""
local cDefaImage:="noImage.png"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, 15
DEFINE DIALOG oDlg SIZE 422, 326 PIXEL ; //FROM 100, 100 TO 426,522;
TITLE If( lAdd, "New Service", "Edit Service" ) FONT oFont
@ 12, 10 SAY "Code:" OF oDlg SIZE 19, 8 PIXEL
@ 10, 46 GET oRec:ID OF oDlg SIZE 55, 12 PIXEL PICTURE "@!" UPDATE
@ 26, 10 SAY "Name:" OF oDlg SIZE 15, 8 PIXEL
@ 24, 46 GET oRec:Name OF oDlg SIZE 105, 12 PIXEL UPDATE ;
VALID !Empty( oRec:Name )
@ 40, 10 SAY "Breve:" OF oDlg SIZE 15, 8 PIXEL
@ 38, 46 GET oRec:Breve OF oDlg SIZE 105, 12 PIXEL UPDATE
@ 54, 10 SAY "Prezzo:" OF oDlg SIZE 31, 8 PIXEL
@ 52, 46 GET oRec:Price OF oDlg SIZE 55, 12 PIXEL UPDATE RIGHT
@ 68, 10 SAY "Immagine:" OF oDlg SIZE 31, 8 PIXEL FONT oFont
@ 66, 46 GET oRec:Image OF oDlg SIZE 155, 12 PIXEL UPDATE
@ 68,10 BTNBMP oBtnImage PROMPT "Carica" ;
RESOURCE "BTN_PNG_IMAGE" FLAT ;
SIZE 45,18 LEFT PIXEL OF oDlg ;
ACTION ( oRec:Image:= GetImage( cFile ), oRec:Image:SetSource( oRec:Image ))
oBtnImage:ctooltip:="Carica un immagine"
/* @ 66,120 XIMAGE oRec:Image SOURCE IF(empty(oRec:Image),cDefaImage,oRec:Image);
SIZE 50, 50 OF oDlg
oRec:Image:bRClicked := NIL
oRec:Image:ltransparent:=.t.
oRec:Image:nUserControl :=0
*/
@ 82, 10 SAY "Unità disponibili:" OF oDlg SIZE 13, 8 PIXEL
@ 80, 46 GET oRec:unit OF oDlg SIZE 40, 12 PIXEL UPDATE
* @ 96, 10 SAY "Print A4:" OF oDlg SIZE 28, 8 PIXEL
@ 94, 46 CHECKBOX oRec:A4 PROMPT "Print A4" OF oDlg SIZE 105, 12 PIXEL UPDATE
* @ 110, 10 SAY "Print Pos:" OF oDlg SIZE 23, 8 PIXEL
@ 108, 46 CHECKBOX oRec:Pos PROMPT "Print Pos" OF oDlg SIZE 105, 12 PIXEL UPDATE
* @ 124, 10 SAY "Email:" OF oDlg SIZE 19, 8 PIXEL
* @ 122, 46 GET oRec:Email OF oDlg SIZE 105, 12 PIXEL UPDATE
@ 144, 121 BTNBMP oBtn PROMPT "Save" OF oDlg SIZE 42, 14 PIXEL FLAT ACTION (oDlg:End(), lSave := .T.) ;
WHEN oRec:Modified()
@ 144, 165 BTNBMP oBtn PROMPT "Cancel" OF oDlg SIZE 42, 14 PIXEL FLAT ACTION (oDlg:End())
oBtn:lCancel := .t.
ACTIVATE DIALOG oDlg CENTERED;
ON PAINT ( oDlg:Box( 10, 10, 278, 412 ) )
IF lSave
oRec:Save( .T. )
ENDIF
RETURN NIL
- Code: Select all Expand view RUN
- Application
===========
Path and name: C:\Work\Errori\Nages_ordine_tdatabase\test.Exe (32 bits)
Size: 3,879,936 bytes
Compiler version: Harbour 3.2.0dev (r1712141320)
FiveWin version: FWH 18.10
C compiler version: Borland/Embarcadero C++ 7.3 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 02/01/18, 11:43:54
Error description: Error BASE/33 Data type error: TDATAROW:IMAGE
Args:
[ 1] = O TDATAROW
Stack Calls
===========
Called from: => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TDATAROW:ERROR( 0 )
Called from: .\source\classes\DATAROW.PRG => TDATAROW:FIELDPUT( 491 )
Called from: .\source\classes\DATAROW.PRG => TDATAROW:_IMAGE( 2089 )
Called from: test.prg => EDITSERVIZI( 256 )
Called from: test.prg => (b)MAIN( 64 )
Called from: .\source\classes\DATAROW.PRG => TDATAROW:EDIT( 1606 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:EDIT( 10643 )
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE( 748 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:EDITSOURCE( 0 )
Called from: test.prg => (b)MAIN( 98 )
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK( 179 )
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1755 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3541 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 433 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1136 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: test.prg => MAIN( 121 )
How I can make to incremental oRec:ID ( id is 4 Cr) sample "0001"