Edit Extended / Edit WorkArea - ABM / ABM2
Moderator: Rathinagiri
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Work Area not in Use - Edit Extend
Hello HMG friends,
thanks for new release,
I tested Edit Extend and I got an error
Please see attached files.
br Rado
thanks for new release,
I tested Edit Extend and I got an error
Please see attached files.
br Rado
[u]Moderator Notes[/u] (Pablo César) wrote:Your Topic was moved from HMG Unicode version because your message is not regarding HMG version.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Work Area not in Use
Hi Rado,
I have checked your source code and noted this line:
CLOSE SIF_DAVK
At procedure sifdavk() which need to let it as comment (disable this line):
// CLOSE SIF_DAVK
Otherwise you are closing database. But will need to close when exit application, so you will need to add this SIF_DAVK->( dbCloseArea() ) at Win_1 declaration in ON INTERACTIVECLOSE.
Also will be necessary to move USE SIF_DAVK at begining of Main and NET treatment (OPEN in SHARED mode).
I have checked your source code and noted this line:
CLOSE SIF_DAVK
At procedure sifdavk() which need to let it as comment (disable this line):
// CLOSE SIF_DAVK
Otherwise you are closing database. But will need to close when exit application, so you will need to add this SIF_DAVK->( dbCloseArea() ) at Win_1 declaration in ON INTERACTIVECLOSE.
Also will be necessary to move USE SIF_DAVK at begining of Main and NET treatment (OPEN in SHARED mode).
Code: Select all
#include "hmg.ch"
// #include "fileio.ch"
PROCEDURE Main
SET LANGUAGE TO SLOVENIAN
REQUEST HB_CODEPAGE_SLWIN
HB_CDPSELECT("SLWIN")
HMG_MESSAGES_UTF8_TO_ANSI("SLWIN")
USE SIF_DAVK SHARED
// msginfo(HMG_CharSetName()+" "+HMG_GetLanguage())
DEFINE WINDOW Win_1 AT 0,0 WIDTH 540 HEIGHT 460 MAIN ON INTERACTIVECLOSE SIF_DAVK->( dbCloseArea() )
ON KEY ESCAPE ACTION Win_1.Release
Define Button Button_4
Row 300
Col 80
Caption 'Test EDIT'
Action sifdavk()
End Button
END WINDOW
Win_1.Center
Win_1.Activate
RETURN
procedure sifdavk()
// Local variable declarations.----------------------------------------
LOCAL aFieldName := { "Šifra", "Naziv davka", "Tarifa", "Davek v %", "Mejni datum", ;
"Davek % pred sprem.", "Skupaj" }
LOCAL aVisTable := { .t., .t., .t., .t., .t., .t., .f. }
LOCAL aFieldEdit := { .t., .t., .t., .t., .t., .t., .f. }
LOCAL aOptions := Array( 3, 2 )
LOCAL bSave := {|aValues, lNew| sifdavksave( aValues, lNew, cArea ) }
LOCAL bSearch := {|| MsgInfo( "Your own search function" ) }
LOCAL bPrint := {|| MsgInfo( "Your own print function" ) }
aOptions[1,1] := "Možnost 1"
aOptions[1,2] := { || MsgInfo( "" ) }
aOptions[2,1] := "Možnost 1"
aOptions[2,2] := { || MsgInfo( "" ) }
aOptions[3,1] := "Opis programa"
aOptions[3,2] := { || MsgInfo( "" ) }
// USE SIF_DAVK
cArea="SIF_DAVK"
SIF_DAVK->( ordListAdd( "DAVK1.NTX", "Šifra davka" ) )
SIF_DAVK->( ordSetFocus( 1 ) )
EDIT EXTENDED ;
WORKAREA SIF_DAVK ;
TITLE "Davène skupine" ;
FIELDNAMES aFieldName ;
FIELDENABLED aFieldEdit ;
TABLEVIEW aVisTable ;
OPTIONS aOptions ;
ON SAVE bSave
// CLOSE SIF_DAVK
return
function sifdavksave( aValues, lNew, cArea )
LOCAL i := 1
IF Empty( aValues[1] ) // First name.
msgInfo( "Šifra davka mora biti vnešena !" )
return ( .f. )
ENDIF
IF lNew
sif_davk->( dbAppend() )
ENDIF
FOR i := 1 TO Len( aValues )
rlock()
sif_davk->( FieldPut( i, aValues[i] ) )
unlock
NEXT
return ( .t. )
FUNCTION HMG_MESSAGES_UTF8_TO_ANSI (cCPID)
LOCAL k, i, nIndex, cUTF8Str, cANSIStr
LOCAL aPos := {128, 129, 130, 131, 132, 133, 134, 136, 137, 331, 371}
FOR k = 1 TO HMG_LEN (aPos)
nIndex := aPos [k]
IF ValType (_HMG_SYSDATA [nIndex]) == "A"
FOR i = 1 TO HMG_LEN (_HMG_SYSDATA [nIndex])
cUTF8Str := _HMG_SYSDATA [nIndex] [i]
cANSIStr := HB_UTF8TOSTR (cUTF8Str, cCPID)
_HMG_SYSDATA [nIndex] [i] := cANSIStr
NEXT
ELSE
cUTF8Str := _HMG_SYSDATA [nIndex]
cANSIStr := HB_UTF8TOSTR (cUTF8Str, cCPID)
_HMG_SYSDATA [nIndex] := cANSIStr
ENDIF
NEXT
RETURN NIL
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
HMG 3.1.5 (Test)
Hello HMG friends,
thanks for new release. I already tested all functionalities.
I found an error in EDIT EXTEND function.
See in attached file.
br Rado
thanks for new release. I already tested all functionalities.
I found an error in EDIT EXTEND function.
See in attached file.
br Rado
- Attachments
-
- Capture.JPG (79.79 KiB) Viewed 5240 times
-
- EEDEMO.ZIP
- (1.14 MiB) Downloaded 231 times
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Re: Work Area not in Use
Hello Pablo,
thanks for quick solution.
Is there possible to have another two parameters in function EDIT EXTEND :
HEIGHT and WIDTH
EDIT EXTENDED ;
HEIGHT 300;
WIDTH 400 ;
WORKAREA SIF_DAVK ;
TITLE "Davčne skupine" ;
FIELDNAMES aFieldName ;
FIELDENABLED aFieldEdit ;
TABLEVIEW aVisTable ;
OPTIONS aOptions ;
ON SAVE bSave
br Rado
thanks for quick solution.
Is there possible to have another two parameters in function EDIT EXTEND :
HEIGHT and WIDTH
EDIT EXTENDED ;
HEIGHT 300;
WIDTH 400 ;
WORKAREA SIF_DAVK ;
TITLE "Davčne skupine" ;
FIELDNAMES aFieldName ;
FIELDENABLED aFieldEdit ;
TABLEVIEW aVisTable ;
OPTIONS aOptions ;
ON SAVE bSave
br Rado
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Re: Work Area not in Use
Hello Pablo,
now I have problem by save function in EDIT EXTENDED:
now I have problem by save function in EDIT EXTENDED:
- Attachments
-
- Capture.JPG (68.89 KiB) Viewed 5216 times
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Work Area not in Use
I understand your question. It is due missing part of scrolling window, as showing in this image: -------------radohabjan wrote:Is there possible to have another two parameters in function EDIT EXTEND :
HEIGHT and WIDTH
EDIT EXTENDED ;
HEIGHT 300;
WIDTH 400 ;
WORKAREA SIF_DAVK ;
TITLE "Davčne skupine" ;
FIELDNAMES aFieldName ;
FIELDENABLED aFieldEdit ;
TABLEVIEW aVisTable ;
OPTIONS aOptions ;
ON SAVE bSave
This as the error message shows it is not finding the cArea variable. So at begining of your prg add red lines as shows below:radohabjan wrote:now I have problem by save function in EDIT EXTENDED: "Variable does not exist: cArea"
Function Main
Private cArea
SET LANGUAGE TO SLOVENIAN
REQUEST HB_CODEPAGE_SLWIN
HB_CDPSELECT("SLWIN")
HMG_MESSAGES_UTF8_TO_ANSI("SLWIN")
USE SIF_DAVK SHARED
cArea="SIF_DAVK"
// msginfo(HMG_CharSetName()+" "+HMG_GetLanguage())
DEFINE WINDOW Win_1...//...
I will try to promote a change in windows EDIT EXTENDED to be displayed in full.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Work Area not in Use
For now to solve this problem:
You will need to correct in C:\hmg.3.1.5\SOURCE\EDITEX\h_edit_ex.prg file, lines:
Line 642, this: height _nAltoPantalla - 140 ;
replace for this: height _nAltoPantalla - 120 ;
AND
Line 951, this: nAlto := 15 + 65 + nAltoSplit + 15
replace for this: nAlto := 15 + 75 + nAltoSplit + 15
Save C:\hmg.3.1.5\SOURCE\EDITEX\h_edit_ex.prg file and click in C:\hmg.3.1.5\SOURCE\EDITEX\buildlib.bat (to rebuild the LIB). After this you can recompile your app.
You will need to correct in C:\hmg.3.1.5\SOURCE\EDITEX\h_edit_ex.prg file, lines:
Line 642, this: height _nAltoPantalla - 140 ;
replace for this: height _nAltoPantalla - 120 ;
AND
Line 951, this: nAlto := 15 + 65 + nAltoSplit + 15
replace for this: nAlto := 15 + 75 + nAltoSplit + 15
Save C:\hmg.3.1.5\SOURCE\EDITEX\h_edit_ex.prg file and click in C:\hmg.3.1.5\SOURCE\EDITEX\buildlib.bat (to rebuild the LIB). After this you can recompile your app.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
-
- Posts: 99
- Joined: Mon Nov 30, 2009 7:17 am
- Location: Slovenia
- Contact:
Re: Work Area not in Use
I mean more, that :
_nAltoPantalla := getDesktopHeight()
_nAnchoPantalla := getDesktopWidth()
would be parameters and not fixed value in h_edit_ex.prg
_nAltoPantalla := getDesktopHeight()
_nAnchoPantalla := getDesktopWidth()
would be parameters and not fixed value in h_edit_ex.prg
Re: Edit Extended
Hello,
Please how to add a "InputMask" to "EDIT.EXTENDED" for a character field.
Ex: Field => "CHARACTER" InputMask "9999999"
or aColx: = {"TEXTBOX", "CHARACTER", "9999999"}
Thank you in advance
Please how to add a "InputMask" to "EDIT.EXTENDED" for a character field.
Ex: Field => "CHARACTER" InputMask "9999999"
or aColx: = {"TEXTBOX", "CHARACTER", "9999999"}
Thank you in advance
L'Algerie vous salut
Y.TABET
Y.TABET