Quizas un parametro .T. ó .F. por si en algun momento se requiere modificar alguno de los valores ocultos...Hola Pablo César!
Yo sugiero que no aparezca en el InputWindows la columna 1, ya que por alguna razón se oculto!
Function InputWindow()
Moderator: Rathinagiri
Re: Function InputWindow()
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Function InputWindow()
This is way:andyglezl wrote:Quizas un parametro .T. ó .F. por si en algun momento se requiere modificar alguno de los valores ocultos...Hola Pablo César!
Yo sugiero que no aparezca en el InputWindows la columna 1, ya que por alguna razón se oculto!
Code: Select all
i := GetControlIndex (cGridName, cParentName)
if HMG_LEN (_HMG_SYSDATA [ 14 ] [i]) > 0
// the first column is an image index
else
// not exist the first column "hide" with images index
endif
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Function InputWindow()
Thank you Claudio to make us remind this. I was beginning to understand at C:\hmg.3.4.0\SAMPLES\Controls\Grid\GRID_05 demo and seeing this specific column for images (at older versions).srvet_claudio wrote:This is a defect in the implementation of GRID that I left it to maintain compatibility with older versions.
In old versions when displays images in the grid control the first column is used for display it and only in this column.
The correct way is display the image in the side of text in any column and not in a separate column.
Code: Select all
- <ParentWindowName>.<GridControlName>.Image ( lTransparent ) := { "image1.png", "image2.bmp", ... } - <ParentWindowName>.<GridControlName>.ImageIndex ( nRow , nCol ) [ := | -->] nIndex
I've checked how can be diferantiated from old to new version for storing image index, it's thru:
HMG_LEN( _HMG_SYSDATA [ 14 ] ) > 0 // aImage
Any way I will keep hiden this kind of field in editing for grids.
[line][/line]
I was understanding the image of grid logic and answering this message at the same time you have alread posted the verification way.
Thank you Claudio, very much appreciated !Claudio wrote:This is way:
Code: Select all
i := GetControlIndex (cGridName, cParentName) if HMG_LEN (_HMG_SYSDATA [ 14 ] [i]) > 0 // the first column is an image index else // not exist the first column "hide" with images index endif
Hi Andrés thank you for you interest and opinion.andyglezl wrote:Quizas un parametro .T. ó .F. por si en algun momento se requiere modificar alguno de los valores ocultos...
I have tried to make all this identification automactically, just to make easier for user.
But I believe this could it be handle manually thru UDF (user function, named: My_UDF as parameter) and can set any property inside of this function that it will acts internally into InputWindow.
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
Function InputWindow()
More one question Claudio about images in grids.
Please confirm my understanding, these image adding ways:
<ParentWindowName>.<GridControlName>.Image ( lTransparent ) := { "image1.png", "image2.bmp", ... } -> New way
and
This last is old way
Please confirm my understanding, these image adding ways:
<ParentWindowName>.<GridControlName>.Image ( lTransparent ) := { "image1.png", "image2.bmp", ... } -> New way
and
This last is old way
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
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Function InputWindow()
Yes, the last image is the old version and the first the new way.Pablo César wrote:More one question Claudio about images in grids.
Please confirm my understanding, these image adding ways:
<ParentWindowName>.<GridControlName>.Image ( lTransparent ) := { "image1.png", "image2.bmp", ... } -> New way
and
This last is old way
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Function InputWindow()
Thank you Claudio !
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
Function InputWindow()
Hi all,
In case of MultiGrid (MultiSelect) for editing thru InputWindow, IMO all fields must be empty unless that selected would it be just one item. i.e. If select item is just one item only, then can it be with respective value otherwise must be empty values at control in edition (textbox, combobox, datepicker, etc.).
Because what's reason for multi records be edited ?
Probably can be helpful to change specific field (when not empty control left) with same content to be replaced to same field (same column) for all selected items. Otherwise why to be edited ?
Any ideas ?
In case of MultiGrid (MultiSelect) for editing thru InputWindow, IMO all fields must be empty unless that selected would it be just one item. i.e. If select item is just one item only, then can it be with respective value otherwise must be empty values at control in edition (textbox, combobox, datepicker, etc.).
Because what's reason for multi records be edited ?
Probably can be helpful to change specific field (when not empty control left) with same content to be replaced to same field (same column) for all selected items. Otherwise why to be edited ?
Any ideas ?
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
Function InputWindow()
InputWindow for in-place-edit in Grids
Finally I got satisfactory results with more than 45 Grids tests (all Grids demos at SAMPLES and some more) as promissed to Rathi (his great idea) with an alternative to in-place-edit feature in Grids, using InputWindow with a minimum implementation efforts to users and without any degradation or slowness on the Grid.
Some considerations:
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:
I've consulted to colleagues of this community in public, to reach and see their each point-of-views from the users and HMGDT.
I hope you make the most advantage of this editing tool and you be kind to report your doubts or any failure that may occur with InputWindow use.
General Notes:
Here in attached is one example (source codes and executable file): Hereunder in attached, another demo (source codes, data files and executable file): This demo is running with modified HMG library to support EditBox in Grid for any instance. Is not working with current library.
I wish to give an special thanks to Rathinagiri for this great idea and the genious of Claudio that gives all support for HMG improvements, to all others colleagues that have been participating and contributing with ideas and own opinion.
To all thank you !
Best regards to all and enjoy it !
Some considerations:
- InputWindow will not replace any data in the grid.
The main idea is to pass to edit all fields in the grids thru InputWindow and returning results in array to be handled by the programmer as be wished to entire responsability. - InputWindow Implementation at grid I indicate to do it thru ON DBLCLICK grid event.
- InputWindow can be implemented at grid by these different ways:
- InputWindow() (without any parameter). It will detect by itself all grid properties.
- InputWindow(<cParentWindowName>,<cControlName>) (both parameters as regular character type variables).
- InputWindow(<cParentWindowName>,<cControlName>,<anWidths>) (two character variables and one numeric array). This array will contain the total of columns with its width's size of each.
- InputWindow(<cParentWindowName>,<cControlName>,<anWidths>,<aHotKeys>) (two character variables, one numeric array and one composite array). This last array could contains the all parameters for Hot Key.
For example:Code: Select all
abEscape:={ 0, VK_ESCAPE, {|| ThisWindow.Release() } abF1:={ 0, VK_F1, {|| My_Help() } ON DBLCLICK InputWindow(<cParentWindowName>,<cControlName>,<anWidths>,{abEscape,abF1}) // or like this: ON DBLCLICK InputWindow(,,,{abEscape, abF1})
- InputWindow(<cParentWindowName>,<cControlName>,<anWidths>,<aHotKeys>, nRow, nCol, aBackColor, aToolTips, aHotKeys, aStyles, bCode )
This is the complete parameter sequence. The aHotKeys and aStyles parameters will be overwritten for grids propose.
- This parameter instructions are valid for InputWindow to Grids only.
- All these parameters listed here for InputWindow to Grids, are optional, not mandatory.[/color]
- EDIT property at your grid must be removed. In order to let InputWindow to take it placed.
- For replacement of contain of array in return from InputWindow. Is suggested to make your own function.
Like this example: ON DBLCLICK MyReplace(InputWindow2()). It would be more convenient to creat your own function to process all data obtained from InputWindow and be repassed to the grid.
- TextBox for PASSWORD. Actually our Grid in HMG is not prepared to handle password type field (ES_PASSWORD). So if we put { 'TEXTBOX', "PASSWORD" } in ColumnControls, grid is not gonna display any data (will be empty). But when call InputWindow will be prepared to edit in TextBox for PASSWORD with special characters ( like this: "•" ), but it can not get any data from the grid... (due HMG grid restrictions).
- ToolTips for each column is not posible yet at our grid. This could be useful to apply individual ToolTip for each column/field.
- EditBox in our grid will be accept only for memos fields (from dbf).
On the other hand, InputWindow is prepared to work with all kind of fields with text to be edited.
It could be with memos fields (from dbf), strings or text files (with path, with full path or no path at current folder).
Some restrictions were asked to to HMGDT for approval and implementation be disregarded concerning Editbox
( Let's wait their decision )
- DatePicker with two options: DROPDOWN or UPDOWN
- TimePicker with different options: _TIMELONG24H / _TIMESHORT24H / _TIMELONG12H / _TIMESHORT12H
- Spinner with:
- Two parameters: nRANGEMIN and nRANGEMAX
- Three parameters: nRANGEMIN, nRANGEMAX and nINCREMENT (this last is new)
- ColumnWhen make exceptions edtions. Preventing edition by enabling controls becoming in gray when attend the condition. This could be done by following ways:
- By using This.xxx. Example: { This.CellValue == .T., This.CellValue > CToD("01/01/2000") }
- By using a simple array containing logical value for each column. Example: { .T.,.T.,.F.,.T. }
- By using a function with more elaborate features. Example: { CheckValid(This.CellValue),CheckAge(This.CellValue) }
Anyway is good to test all the logical compose. Try first with EDIT at grid to check results before.
- Hiden fields (not displayed and not editable) can happen with:
- For retrocompatibility, it has been reserved the first column where index list be used for images display at grid.
New way to display images at grid have been implement at grid. What's the most indicated use.
Please check Image ( lTransparent ), ImageIndex ( nRow , nCol ), ImageList and also HeaderImageIndex for the right usage. - Sometimes we want to hide a particular column. Could be one o more, which can be useful for data processing but not be editable column/field. In these cases, you just put value 0 (zero) at the respective column in <anWidths> of grid.
- For retrocompatibility, it has been reserved the first column where index list be used for images display at grid.
- Implement a new composite field CheckBoxItem for selectable items. Which is not a separated field but count when be cheked/filled. This is always the first field in edition. No label was applied, due of many languages for internalization.
- When is double-clicked at any column of grid ( even for not CellNavigation ), will be started at correlative field thru SetFocus. This is useful to go direct to the most ineterest field to be edited
- Allows fields edition even for MultiSelect records in grid. Will be act in two differents ways:
- When is double-clicked in just only one row/item, all values will bring to be edited.
- When more than one are selected items, will open an empty values.
This is useful when we wish to be replaced specific field for many records.
- Label were been optimized by it width size. Taking the maximum length of header's string.
- When anWidths parameter have not be informed at InputWindow calling, this will take the exact width of each column automactically.
- InputWindow will take the same sequence of columns at grid. Even if grid was with sorted order column, will take the corresponding column.
- When is resized width colum at grid and entered to InputWindow, this will also resize control correlative of that column. Useful for column with EditBox extending the width of column.
- Will need to implement for ColumnValid. (Sorry, this is not posible to be implemented)
- Programmer module which will allow for redimensioning controls. Useful for example, when programmer starts elaborate InputWindow size of controls. Then it would save at specific file storing size of each control to attend specific grid. This could be done by HMG_ChangeWindowStyle (topic in discuss)
- Simulates same property of EditOption from grid to be applyied for others controls like as: TextBox and EditBox. But probably this will demand some implementation in HMG library.
- Fixed when using keyboard and press enter: row and col of grid were not real.
- Added column justification to the right making TextBoxes and DatePicker to be aligned to the right.
- Allowed 4th parameter for aHotKeys definitions, in place of 9th parameter.
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.
You can watch this video
I've consulted to colleagues of this community in public, to reach and see their each point-of-views from the users and HMGDT.
I hope you make the most advantage of this editing tool and you be kind to report your doubts or any failure that may occur with InputWindow use.
General Notes:
- New Items in red color to differentiate from previous text.
- Attached source code file was removed because there is a newer version released more ahead of this message in this topic.
Here in attached is one example (source codes and executable file): Hereunder in attached, another demo (source codes, data files and executable file): This demo is running with modified HMG library to support EditBox in Grid for any instance. Is not working with current library.
I wish to give an special thanks to Rathinagiri for this great idea and the genious of Claudio that gives all support for HMG improvements, to all others colleagues that have been participating and contributing with ideas and own opinion.
To all thank you !
Best regards to all and enjoy it !
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
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Function InputWindow()
Great work Pablo.
It is really useful for me and I am sure it took a lot of time to make. Thanks a lot.
It is really useful for me and I am sure it took a lot of time to make. Thanks a lot.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Function InputWindow()
Thank you, my friend !Rathinagiri wrote:Great work Pablo.
It is really useful for me and I am sure it took a lot of time to make. Thanks a lot.
This is a result of your great idea.
Thanks to you Rathinagiri (again).
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