Function InputWindow()

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

Post Reply
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Function InputWindow()

Post by Pablo César » Sun Feb 08, 2015 2:02 am

In Grid ColumnControls, we have following options:
  1. { 'CHECKBOX' }
  2. { 'CHECKBOX', 'Yes', 'No' }
  3. { 'COMBOBOX', {"Opt 1","Opt 2"} }
  4. { 'DATEPICKER', 'DROPDOWN' }
  5. { 'EDITBOX' }
  6. { 'SPINNER', 1, 20 }
  7. { 'TEXTBOX','CHARACTER' }
  8. { 'TEXTBOX','DATE' }
  9. { 'TEXTBOX','NUMERIC','99999999' }
  10. { 'TIMEPICKER', _TIMELONG24H / _TIMESHORT24H / _TIMELONG12H / _TIMESHORT12H }
Please let me know if I'm forgewtting any one.

I'm thinking to add more two controls at InputWindow() just to be compatible with Grid's ColumnControls:
[tr][td]Control to be created[/td][td]aInitValues[/b][/td][td]   [/td][td]aFormats[/b][/td][/tr]
[tr][td]Label[/td][td]""[/td][td][/td][td]Nil[/td][/tr]
[tr][td]TextBox "C"[/td][td]""[/td][td][/td][td]>= 32[/td][/tr]
[tr][td]TextBox "C" (PassWord)[/td][td]""[/td][td][/td][td]"PASSWORD"[/td][/tr]
[tr][td]TextBox "N" (New)[/td][td]9[/td][td][/td][td]9[/td][/tr]
[tr][td]TextBox "N"(INPUTMASK)[/td][td]9[/td][td][/td][td]Ex: "99.99"[/td][/tr]
[tr][td]ComboBox[/td][td]9[/td][td][/td][td]{}[/td][/tr]
[tr][td]TimePicker[/td][td]""[/td][td][/td][td]{_TIMELONG24H / _TIMESHORT24H / _TIMELONG12H / _TIMESHORT12H}[/td][/tr]
[tr][td]Spinner[/td][td]Ex: {1,20}[/td][td][/td][td]9[/td][/tr]
[tr][td]CheckBox[/td][td].T. or .F.[/td][td][/td][td][/td][/tr]
[tr][td]DatePicker[/td][td]CtoD() or Date()[/td][td][/td][td][/td][/tr]
[tr][td]EditBox[/td][td]""[/td][td][/td][td]> 32[/td][/tr]
[tr][td]EditBox[/td][td]Dbf Memo field[/td][td][/td][td][/td][/tr]
[tr][td]Grid[/td][td]{{}}[/td][td][/td][td]{{headers},{Widths}}[/td][/tr][/table]
I know in Spinner aInitValues and aFormats it's a little bit strange, but is the only combination available.
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
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Sun Feb 08, 2015 11:34 pm

New controls added TimePicker and Spinner already !
Screen1.png
Screen1.png (1.17 MiB) Viewed 2548 times
Spinners it will work with INCREMENT option.

Sources files and demo will be delivered with InputWindow2() upto an official version be released.

<Source code of DEMO5 was removed because there is a updated version ahead of this topic>

I hope you enjoyed ! :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Mon Feb 09, 2015 12:24 am

Bien Pablo, Buen trabajo!

Saludos

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Mon Feb 09, 2015 12:31 am

Gracias Javier por acompañar ! :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
bpd2000
Posts: 1090
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 199 times
Been thanked: 102 times

Post by bpd2000 » Mon Feb 09, 2015 4:32 am

err.PNG
err.PNG (17.42 KiB) Viewed 2520 times
Hi
verify error
BPD
Convert Dream into Reality through HMG

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Mon Feb 09, 2015 9:21 pm

Thank you Dave to test and announce the runtime error.

The dificulty it was at TimePicker when aFormats parameter is passed as array.
Array + String was the available way. I know there is not need to be an array to pass hour type.
But it was the posible way to differentiated with the pre-existed items (other controls) in InputWindow();

So now I transform from array to string and is okay now.
Attachments
InputWindow.rar
Source files
(6.54 KiB) Downloaded 122 times
Demo5.rar
Executable file
(1.13 MiB) Downloaded 107 times
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
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Tue Mar 03, 2015 7:15 pm

InputWindow is quite finnishing to edit Grid's records. I'm testing in several situations before release it.

One case is heating my head thinking case like as in C:\hmg.3.4.0\SAMPLES\Controls\Grid\GRID_03 demo.
The first column is with size equal to zero. Normally I have defined for this case like as default value for control widths.
An I wish to share with you to compose a common sense what to do in this cases.
I thought at begining to show (let's say TextBox) but be enabled=.F., but this definition I have already counted in ColumnWhen.
Then I ask to myself: What's finality of hiden column in Grids ?
To process something but can not edit, right ?
But also we do not wish to be displayed.
So I thought to define this column with hiden control, but it will take empty space on the screen.

See picture below to have an idea:
Screen1.png
Screen1.png (17.19 KiB) Viewed 2378 times
In this case label is empty and size was forced to default width.

What do you suggest ? Any ideas ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Tue Mar 03, 2015 8:40 pm

Hola Pablo César!

Yo sugiero que no aparezca en el InputWindows la columna 1, ya que por alguna razón se oculto!

Saludos

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Tue Mar 03, 2015 8:42 pm

Tenés razón Javier ! Lo voy hacer asi. Voy a cargarlo y ocultarlo. Es decir el control podrá contener algun valor que puede ser útil para ser procesado, pero al control lo voy a esconder.

Gracias Javier por tu interés y respuesta.

Un gran abrazo
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Tue Mar 03, 2015 9:29 pm

Pablo César wrote:InputWindow is quite finnishing to edit Grid's records. I'm testing in several situations before release it.

One case is heating my head thinking case like as in C:\hmg.3.4.0\SAMPLES\Controls\Grid\GRID_03 demo.
The first column is with size equal to zero. Normally I have defined for this case like as default value for control widths.
An I wish to share with you to compose a common sense what to do in this cases.
I thought at begining to show (let's say TextBox) but be enabled=.F., but this definition I have already counted in ColumnWhen.
Then I ask to myself: What's finality of hiden column in Grids ?
To process something but can not edit, right ?
But also we do not wish to be displayed.
So I thought to define this column with hiden control, but it will take empty space on the screen.

See picture below to have an idea:
Screen1.png
In this case label is empty and size was forced to default width.

What do you suggest ? Any ideas ?
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
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

Post Reply