GRID - COLUMNCONTROLS

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

GRID - COLUMNCONTROLS

Post by Pablo César »

Hi HDT (HMG Development Team),

Is it posible to add a new property for SPINNERs at GRID when is defined at COLUMNCONTROLS ?
Screen1.png
Screen1.png (41.58 KiB) Viewed 5229 times
For COLUMNCONTROLS:

We use to declare like this: aCtrl_06 := { 'SPINNER', 1, 20 }
The suggested is to accept fourth parameter, like this: aCtrl_06 := { 'SPINNER', 1, 20, 5 }
This is to make INCREMENT at spinning in Grids, it could be important and optional too.

For this propose, shall it be implemented at _HMG_PARSEGRIDCONTROLS function too (around line # 1352).

I would like to receive any return (if yes or not) in order to make facilities at InputWindow(), otherwise this option will be fixed to increment always be +1. :?

Thank you for you attention.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: GRID - COLUMNCONTROLS

Post by bpd2000 »

Pablo César wrote:Hi HDT (HMG Development Team),

Is it posible to add a new property for SPINNERs at GRID when is defined at COLUMNCONTROLS ?
+1
BPD
Convert Dream into Reality through HMG
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: GRID - COLUMNCONTROLS

Post by Javier Tovar »

+1
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: GRID - COLUMNCONTROLS

Post by serge_girard »

+1
There's nothing you can do that can't be done...
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: GRID - COLUMNCONTROLS

Post by Rathinagiri »

Sure, we can do that Pablo.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

GRID - COLUMNCONTROLS

Post by Pablo César »

Thank you guys :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

GRID - COLUMNCONTROLS

Post by Pablo César »

Hi HDT (HMG Development Team) again,

Is it posible to add another new property for TEXTBOX at GRID when is defined at COLUMNCONTROLS ?

For COLUMNCONTROLS:

We use to declare like this:
  • aCtrl_07 := { 'TEXTBOX','CHARACTER' }
  • aCtrl_08 := { 'TEXTBOX','DATE' }
  • aCtrl_09 := { 'TEXTBOX','NUMERIC','99999999' }
The suggested is to accept the string "PASSWORD" at second parameter, option as CTYPE normally used to define if is NUMERIC, CHARACTER or DATE, then the TEXTBOX will act as PASSWORD new property:
Screen1.png
Screen1.png (65.73 KiB) Viewed 5089 times
Then we could make like this: aCtrl_10 := { 'TEXTBOX', "PASSWORD" }
This is new implementation will allow to put passwords at specific column of GRID and this is optional too.

For this propose, need to only correct at _HMG_GRIDINPLACEEDIT function in h_grid.prg (around line # 1072).
Screen2.png
Screen2.png (48.6 KiB) Viewed 5089 times
I rebuilded lib and realized a test in C:\hmg.3.4.0\SAMPLES\Controls\Grid\GRID_25\demo.prg, changing textbox:
Screen3.png
Screen3.png (34.99 KiB) Viewed 5089 times
The results was partial, for editing is displaying well as password:
Screen4.png
Screen4.png (10.94 KiB) Viewed 5089 times
But for navigating is not displaying as a password. I'll be need a help from HDT, probably Dr. Claudio could offer a solution. At least could be displayed something like this: <Password> (not showing its value).
Screen5.png
Screen5.png (12.37 KiB) Viewed 5089 times
I attached executable file for your appreciation:
GRID_25.rar
Executable file
(1.12 MiB) Downloaded 321 times
I would like to know if this new property could be applied to HMG library if there is a way for different displaying at Grid
probably using lTrueData ? :roll:

If we got solution for this then I make facilities to InputWindow() in this new type. :D

Thank you for you attention more one time,
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

GRID - COLUMNCONTROLS

Post by Pablo César »

Hi friends,

Actually EDITBOX for ColumnControl only works for Grid in ROWSOURCE (with database) !! :o

And even not been a grid for ROWSOURCE doesn't accept any value ! :shock:

To HDT: In order to work EDITBOX at any type, is it posible to fix _SetItem and _GetItem at h_controlmisc.prg as follows ?
Screen1.png
Screen1.png (88.37 KiB) Viewed 5031 times
This will allow to use EditBox when is also not RowSource.

Taking this opportunity to ask for more this feature also:

When EditBox at Grid, we could define independent files to be edited.
In the column we could put the file names (with path or not for current folder).
Then the system will make a previous checking, it can be interpreted if this strings are being compose a file name or simple string to be edited.

In the source code proposed, we change following at h_grid.prg:
  • New parameter for _HMG_GRIDINPLACEEDITOK procedure.
    PROCEDURE _HMG_GRIDINPLACEEDITOK( IDX, CI, RI, AEC, ALABELS, CTYPE, CINPUTMASK, CFORMAT, CVA, aReturnValues, cValCell )
  • Replace this code:

    Code: Select all

    	IF _HMG_SYSDATA [ 40 ] [ idx ] [ 9 ] == .F.
    
    		_SetItem ( , , ri , aTemp , idx )
    
    	ENDIF
    For this one:

    Code: Select all

    	IF _HMG_SYSDATA [ 40 ] [ idx ] [ 9 ] == .F.  // Pablo on February, 2015
    	   If AEC == 'EDITBOX'
              If ":" $ cValCell .and. File(cValCell)
                  cTextFile:=cValCell
              ElseIf "\" $ cValCell .and. File(GetCurrentFolder()+cValCell)
                 cTextFile:=GetCurrentFolder()+cValCell
              ElseIf V="<memo>" .or. IsDataGridMemo ( Idx, ci )
                 cTextFile:=GetDataGridCellData ( idx , .t. )
              Else
                 cTextFile:=""
              Endif
    	   If Empty(cTextFile)
    	      _SetItem ( , , ri , aTemp , idx )
    	   Else
    	      hb_MemoWrit(cTextFile,aTemp[ci])
    	   Endif
    	ENDIF
You can use this code to make tests (before and after changing HMG library):

Code: Select all

/*
 * HMG Data-Bound Grid Demo
 * (c) 2010 Roberto Lopez
 *
 * Revised by Pablo César Arrascaeta
 * Added EditBox in static cell and files for edition
 *
*/

#include <hmg.ch>

Function Main()
Local cCurrent_Folder:="\Current.txt"
Local cSub_Folder:=GetCurrentFolder()+"\SubFolder\SubFolder.txt"
Local cOther_Folder:="C:\TEMP_TEST\Other.txt"

CreateFolder(GetCurrentFolder()+"\SubFolder")
CreateFolder("C:\TEMP_TEST")

hb_MemoWrit(cCurrent_Folder,"EDIT TEXT 2")
hb_MemoWrit(cSub_Folder,"EDIT TEXT 3")
hb_MemoWrit(cOther_Folder,"EDIT TEXT 4")

SET CELLNAVIGATIONMODE EXCEL

DEFINE WINDOW SAMPLE at 0, 0 width 420 height 200 title 'Sample Cell Navigation Downwards...' main
    define grid grid_1
       row 10
       col 10
       width 380
       height 150
       widths { 100, 100, 120 }
       headers { 'Sl.No.', 'Name', "Editor" }
       cellnavigation .t.
       columnwhen { {|| .t. }, {|| .t. } }
       columncontrols { { 'TEXTBOX', 'NUMERIC', '999' }, { 'TEXTBOX', 'CHARACTER' }, {"EDITBOX"} }
       allowedit .t.
       items { { 1, 'A', "EDIT TEXT 1" }, { 2, 'B', cCurrent_Folder }, { 3, 'C', cSub_Folder }, { 4, 'D', cOther_Folder }, { 5, 'E', "EDIT TEXT 5" }, { 6, 'F', "EDIT TEXT 6" }, { 7, 'G', "EDIT TEXT 7" }, { 8, 'H', "EDIT TEXT 8" }, { 9, 'I', "EDIT TEXT 9" } }
    end grid         
END WINDOW
SAMPLE.center
SAMPLE.activate
RETURN
This demo is working in static cell and also three different ways to define file name for edition.
Screen3.png
Screen3.png (13.99 KiB) Viewed 5013 times
See that files must be define stating with "\" or "C:\"...
Please remember to remove C:\TEMP_TEST folder and SubFolder where this demo will be executed.

Source file for HMG library is attached:
h_grid.rar
Source file (HMG library)
(17.88 KiB) Downloaded 238 times
Executable file for demo (New features):
demo.rar
Executable file (Builded with 3.4.0 and new h_grid.prg)
(1.12 MiB) Downloaded 282 times
Executable file for demo (Old version, 3.3.1):
demo (Builded with olde versions).rar
Executable file (Builded with 3.3.1)
(1.04 MiB) Downloaded 265 times
Screen2.png
Screen2.png (242.13 KiB) Viewed 5030 times
I hope you enjoy it ! :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID - COLUMNCONTROLS

Post by srvet_claudio »

Pablo César wrote:Hi HDT (HMG Development Team),

Is it posible to add a new property for SPINNERs at GRID when is defined at COLUMNCONTROLS ?
Screen1.png
For COLUMNCONTROLS:

We use to declare like this: aCtrl_06 := { 'SPINNER', 1, 20 }
The suggested is to accept fourth parameter, like this: aCtrl_06 := { 'SPINNER', 1, 20, 5 }
This is to make INCREMENT at spinning in Grids, it could be important and optional too.

For this propose, shall it be implemented at _HMG_PARSEGRIDCONTROLS function too (around line # 1352).

I would like to receive any return (if yes or not) in order to make facilities at InputWindow(), otherwise this option will be fixed to increment always be +1. :?

Thank you for you attention.
Done!
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: GRID - COLUMNCONTROLS

Post by serge_girard »

Thanks to All !

Serge
There's nothing you can do that can't be done...
Post Reply