Function InputWindow()
Moderator: Rathinagiri
- 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()
Also, pressing Esc key could be taken as 'Cancel'
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
Function InputWindow()
It would be a problem because InputWindow already have an array parameter for HotKeys.Rathinagiri wrote:Also, pressing Esc key could be taken as 'Cancel'
At common use of InputWindow it would be superimposed same action key...
Unless that a fourth parameter (for grids propose only) could it accepts aHotKeys in place (see option D listed below)
So it could be call InputWindow like these:
- 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: { { 0, VK_ESCAPE, {|| ThisWindow.Release() }, { { 0, VK_F1, {|| My_Help() } }
Remember that all these parameters listed here for InputWindow to Grids, are optional, not mandatory.abHotKey:={ { 0, VK_ESCAPE, {|| ThisWindow.Release() } }
ON DBLCLICK MyReplace(InputWindow(<cParentWindowName>,<cControlName>,<anWidths>,abHotKey))
or this:
ON DBLCLICK MyReplace(InputWindow(,,,abHotKey))
I'm talking to bring HotKey parameter as 4th one, just to make easier for users.
By itself InputIndow accepts aHotKey as 9th parameter already.
But it's making hard to do it like this: InputWindow(,,,,,,,, aHotKeys)
What's your opinion ? Better to re-stablish a fourth parameter as nineth for aHotKeys ? (valid for grids propose, of course)
There are three alignment types for grids:Rathinagiri wrote:Also, you can get the column justification definition using _HMG_SYSDATA [ 37 ] [nIdx] You can right align the textboxes wherever required.
- GRID_JTFY_LEFT
- GRID_JTFY_RIGHT
- GRID_JTFY_CENTER
But the question is when is setted to GRID_JTFY_CENTER in on column grid.
In TextBoxes we have not this ES_CENTER edit style.
So is it posible to use SendMessage with ES_CENTER ? (I thinks it's available at control definition only)
To use ES_CENTER in C:\MiniGUI\SAMPLES\Applications\WinErrors
See this attached file WinError: Let me know if you have any idea for GRID_JTFY_CENTER cases.TextBox, it's posible.
Best Regards,
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()
Just for clarifying about right alignment in DatePickers.Pablo César wrote:For TextBoxes and also DatePickers, right and left alignments are no problem.
When we pass RightAlign as TRUE. The drop-down month calendar will be right-aligned with the control. Like this:
Instead of left-aligned, which is the default, will be like this:
Anyway, it was implemented at InputWIndow too.
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,
ChangeLog - Version 1.12:
<Attached source code file was removed because there is a newer version released more ahead of this message in this same topic>
Rgds
ChangeLog - Version 1.12:
- 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.
<Attached source code file was removed because there is a newer version released more ahead of this message in this same topic>
Rgds
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()
Pablo,
Center justification is not required, I think. Only right align is enough.
Regarding aHotKeys, it is better to keep in 9th place and if omitted, by default, pressing Esc shall cancel the grid edit.
Center justification is not required, I think. Only right align is enough.
Regarding aHotKeys, it is better to keep in 9th place and if omitted, by default, pressing Esc shall cancel the grid edit.
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
Function InputWindow()
Hi Rathi, good morning
Then after be considered the 4th parameter as aHotKeys, the rest of parameters became easier to understand and use all the rest parameters too (of course as optional). So in this way, have been open two more ways for calling InputWIndow to Grids.
I also liked much to have it in my apps.
I've been waiting your return yesterday but you were out and I needed to keep going on... so I've done what I believed to be better.
I hope you understand that.
B.Rgds
If would it be required, TextBoxes should it have a new style option: ES_CENTERRathinagiri wrote:Center justification is not required, I think.
I've alredy implemented yesterday.Only right align is enough.
I've done by 4th and tell you why. Some parameters in IputWIndow when used to Grids are not useable ones.Regarding aHotKeys, it is better to keep in 9th place
Then after be considered the 4th parameter as aHotKeys, the rest of parameters became easier to understand and use all the rest parameters too (of course as optional). So in this way, have been open two more ways for calling InputWIndow to Grids.
Ok, I'll add this checking by default, good idea !..if omitted, by default, pressing Esc shall cancel the grid edit
I also liked much to have it in my apps.
I've been waiting your return yesterday but you were out and I needed to keep going on... so I've done what I believed to be better.
I hope you understand that.
B.Rgds
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()
ChangeLog - Version 1.13:
I hope you enjoy !
- Esc hotkey defined by default to cancel the grid edit
- Third item of "Expected new interesting features" in this message, regarding "Simulates same property of EditOption from grid to be applyied for others controls like as: TextBox and EditBox"
Just added a new function for working at any TEXT (similar grid control) in HMG library.
I hope you enjoy !
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()
Pablo,
I use columnwidth as 0 for hidden columns (for example, we can hide the itemcode from the user).
1. When I tried to use inputwindow2() with the last column as 0, nothing is shown for any field.
2. When I tried to use inputwindow2() with any other column as 0, that column data is also shown.
I use columnwidth as 0 for hidden columns (for example, we can hide the itemcode from the user).
1. When I tried to use inputwindow2() with the last column as 0, nothing is shown for any field.
2. When I tried to use inputwindow2() with any other column as 0, that column data is also shown.
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
Function InputWindow()
Hi Rathi,
I found what's happening when columnWidth is equal to 0 (zero).
Please note following line at InputWindow.prg:
If "GRID" $ cControlType .and. (GetProperty(cForm,cGrid,"ColumnWIDTH",nPos) = 0 .or. (i=1 .and. Len(_HMG_SYSDATA [ 14 ] [nIdx]) > 0))
and please replace for this:
If "GRID" $ cControlType .and. (GetProperty(cForm,cGrid,"ColumnWIDTH",i) = 0 .or. (i=1 .and. Len(_HMG_SYSDATA [ 14 ] [nIdx]) > 0))
Thank you for reporting.
I found what's happening when columnWidth is equal to 0 (zero).
Please note following line at InputWindow.prg:
If "GRID" $ cControlType .and. (GetProperty(cForm,cGrid,"ColumnWIDTH",nPos) = 0 .or. (i=1 .and. Len(_HMG_SYSDATA [ 14 ] [nIdx]) > 0))
and please replace for this:
If "GRID" $ cControlType .and. (GetProperty(cForm,cGrid,"ColumnWIDTH",i) = 0 .or. (i=1 .and. Len(_HMG_SYSDATA [ 14 ] [nIdx]) > 0))
Thank you for reporting.
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()
Rathi let me know one thing. What's your opinion about hidden control in InputWindow in these cases ?Rathinagiri wrote:I use columnwidth as 0 for hidden columns (for example, we can hide the itemcode from the user).
IMO, should it skip the column when ColumnWidth as 0.
Not be hidden and occupy more one place in InputWindow.
Because, users can defined one or more than one columnwidth as 0 then the displaying fields will let an empty space like this:
Columns 2 and 3 with ColumnWidth as 0 (zero). In this case are hidden at InputWindow.
I think if is hidden and not be editable better not taking place in InputWindow.
Aesthetically speaking is not good these empty spaces at editing (grids edition).
Is it Right for you in this way ?
What's your opinion in this ?
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