Page 8 of 12

Re: Function InputWindow()

Posted: Sat Mar 07, 2015 3:41 am
by Javier Tovar
Excelente Pablo César,

Como dicen los japoneses "Usted ha hecho un gran trabajo!"

Muy útil para mi también!

Saludos

Function InputWindow()

Posted: Sat Mar 07, 2015 3:52 am
by Pablo César
:lol: :lol: :lol: Ahhh Javier ! Me hiciste reir... si no fuera el amor que tengo por lo que hago... me iria al Japón.... :lol: :lol:

Re: Function InputWindow()

Posted: Sat Mar 07, 2015 4:38 am
by Javier Tovar
Pablo César wrote::lol: :lol: :lol: Ahhh si no fuera el amor que tengo por lo que hago... me iria al Japón.... :lol: :lol:
+1

Function InputWindow()

Posted: Sat Mar 07, 2015 11:56 pm
by Pablo César
InputWIndow.prg has been upgraded. A little bug was found. Runtime error when at Demo4 and Grid_CheckBoxes demos when clicking in disable column (empty column, out of active grid).

And please, inform any bug if found any...

Thanks

Re: Function InputWindow()

Posted: Sun Mar 08, 2015 5:56 am
by bpd2000
HI Pablo César
Demo4.exe supplied by you working Ok, But when we compile form source code supplied, there error as per screen shot
err.png
err.png (10.32 KiB) Viewed 5350 times

Function InputWindow()

Posted: Sun Mar 08, 2015 12:33 pm
by Pablo César
bpd2000 wrote:Demo4.. // ..But when we compile form source code supplied, there error as per screen shot
Hi Dave,

Thanks to show your interest in it and report an error.
It's deficult to understand you by only display message without explaining or seeing the code for testing.
But I guess this happen in you HMG version (in your actual 3.4.0 version has not be patched, because no one was released yet) and in "About" column of your grid demo is being displayed with empties values.

Doesn't it ?
Screen5.png
Screen5.png (4.93 KiB) Viewed 5333 times
According your answer, please see below probabilities:
  1. The this error is probably regarding this:

    Code: Select all

            Case XRES[1] == 'EDITBOX'
                 If ":" $ xValue .and. File(xValue)
                    cValue:=hb_MemoRead(xValue)
                 ElseIf "\" $ xValue .and. File(GetCurrentFolder()+xValue)
                    cValue:=hb_MemoRead(GetCurrentFolder()+xValue)
                 ElseIf (!Empty(cDbf) .and. IsDataGridMemo( nIdx, nPos )) .or. xValue="<memo>"
                    aFields:=(_HMG_SYSDATA [ 40 ] [ nIdx ] [ 11 ])
                    cValue:=(&cDbf->&(aFields[nPos]))
                 Else
                    cValue:=xValue
                 Endif
                 Aadd(aValues,cValue)
                 Aadd(aFormats,64)
    This is one, is another one of my repeated request to HMGDT for allowing the EditBox at Grid for all types of Grids.
    I've been asking this: in this other topic (please read carefully) and if you agreed with that or believe important, please give your support in that topic.
    If this new implementation for grid will not approved. I mean to accept EditBox at any grids (for all type of grids), at least should it let grids in ColumnControls returning the cell contain string as it was definied at ITEMS. I said at least, just because we need this for workable EditBox in any Grids. Otherwise, InputWindow will be posible to edit texts thru EditBox for Grids when RowSource is defined, only. I repeat only ! :x

    This is an important demand. To let grids for cellvalue display when have been used EditBox in COLUMNCONTROLS !
     
  2. As I said, some runtime errors could happend due to unpatched version of HMG. Please read below in red:
    Temporary use and implementation:
    As we know InputWindow is not released yet with this improvements. So before InputWindow be upgraded in our HMG library, you will need to use it as follows:
    • Here in attached compressed file, there is an InputWindow.prg file which contains InputWindow2 function name. This name ends with "2", because the current InputWindow at HMG library is not upgraded yet (upto this moment at hmg 3.4.0 version).
    • To use this new InputWindow2() you will need to include InputWindow.prg in your compilling. You will do by editing your main prg and add #include "InputWindow.prg" at line after of #include <hmg.ch>
    • And remember to call the function like as InputWindow2() (with red "2") untill HMGDT will make this upgrade.
    • Some changing will be done, updating this package. But always will be excluded the previous version. Always keeping updated the package file.
    • Have been found some bugs in grid library in HMG. Those were been fixed by Claudio already. Probably will release a patch or a new HMG version. At meantime this not happen, some runtime errors could it be happen after your compilling. :?
I would like to see an enhanced GRID in HMG for EditBox control. But if is not usable for the rest of users... what to do ?
Then you can not use EDITBOX at arrays in Grids, because this grid does not support EditBox... :shock:

Re: Function InputWindow()

Posted: Mon Mar 09, 2015 6:17 am
by Rathinagiri
Pablo,

Please make a change near line #59. When you move around the grid using keyboard and press enter it doesn't show the correct record for edition.

Code: Select all

            xGridValue := GetProperty(cForm,cGrid,"VALUE")
            if ValType( xGridValue ) == 'A' // cell navigation on
               nGridRow:= xGridValue[ 1 ]
            else
               nGridRow := xGridValue
            endif
//            nGridRow:=GetProperty(cForm,cGrid,"CellRowClicked") // doesn't work when grid row is changed by keyboard
Also, you can get the column justification definition using _HMG_SYSDATA [ 37 ] [nIdx] You can right align the textboxes wherever required.

Function InputWindow()

Posted: Mon Mar 09, 2015 12:00 pm
by Pablo César
Rathinagiri wrote:When you move around the grid using keyboard and press enter it doesn't show the correct record for edition.

Also, you can get the column justification definition using _HMG_SYSDATA [ 37 ] [nIdx] You can right align the textboxes wherever required.
Hi Rathi,

Thank you for your appointments. Regarding position when keyboards arrow be used. I will try to find a way. I didn't noted this and I believe this is an old and common question in grids.
Discuss asomething about this in the forum: http://hmgforum.com/viewtopic.php?p=7182#p7182

Forcolumn justification, duly noted. I'll include that.

Thank you ! :D

Re: Function InputWindow()

Posted: Mon Mar 09, 2015 1:15 pm
by Rathinagiri
I had given the modified code in the above post. You can replace the same for getting the correct row number whether selected by keyboard or mouse.

Function InputWindow()

Posted: Mon Mar 09, 2015 1:23 pm
by Pablo César
Thank you Rathi,

I saw and it's already. I've have made mistake considerating by CellColClicked only.
I have corrected already previously when you have fixed it too.

The right way it's by Value, as you have appointed. But there are exceptions to be considered.

See the right code we would it be considered:

Code: Select all

aGridValue:=GetProperty(cForm,cGrid,"Value")
If cControlType="MULTIGRID"
   If Len(aGridValue)=1
      nGridRow:=aGridValue[1]
      cTitle:="Record #"+AllTrim(Str(nGridRow))+" edition"
   Else
      nGridRow:=1
      cTxt:=""
      AEval( aGridValue, { | Arr,n | cTxt += AllTrim(Str(Arr))+If(n=Len(aGridValue),"",",") } )
      cTitle:="Records #"+cTxt+" edition"
   Endif
   nGridCol:=1
Else
   If ValType(aGridValue)="A"
      nGridRow:=aGridValue[1]
      nGridCol:=aGridValue[2]
   Else
      nGridRow:=aGridValue
      nGridCol:=1
   Endif
   cTitle:="Record #"+AllTrim(Str(nGridRow))+" edition"
Endif
If nGridCol=0 // In case click out of active columns
     Return {}
Endif
Exceptions are when is multiselect option and also need to differentiate when is with CELLNAVIGATION too.

Anyway I will make test again with ALL grids options located at SAMPLES and I will post the final version later.

Thank you for support ! :D