Numeric Text Box
Moderator: Rathinagiri
Numeric Text Box
Anyone have any suggestion on how I can have a numeric textbox display as blank when the value is zero (instead of zero)?
Thanks
Thanks
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Numeric Text Box
Just see this sample:
Code: Select all
#include <hmg.ch>
Function Main
define window main at 0, 0 width 400 height 300 main
define textbox num1
row 10
col 10
width 100
value 0
numeric .t.
inputmask "999.99"
end textbox
define textbox num2
row 40
col 10
width 100
value 0
numeric .t.
inputmask "999.99"
end textbox
define button but1
row 70
col 10
caption 'Make empty'
action main.num2.value := ''
end button
end window
Main.Center
Main.Activate
Return
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.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Numeric Text Box
20 years ago ...Clipper 5.2e wrote:Picture Codes
------------------------------------------------------------------------------
- Get Picture Functions
--------------------------------------------------------------------------------
A C Allow only alpha characters
B N Display numbers left-justified
C N Display CR after positive numbers
D D,N Display dates in SET DATE format
E D,N Display dates with day and month inverted
independent of the current DATE SETting,
numerics with comma and period reverse
K All Delete default text if first key is not a cursor key
R C Insert non-template characters in the display but do not
save in the Get variable
S<n> C Allows horizontal scrolling within a Get. <n> is an integer
that specifies the width of the region
X N Display DB after negative numbers
Z N Display zero as blanks
( N Display negative numbers in parentheses with leading spaces
) N Display negative numbers in parentheses without leading spaces
! C Convert alphabetic character to upper case
Viva INTERNATIONAL HMG
Re: Numeric Text Box
I know about the picture options from 20+ years ago.
How do you simulate the picture options in HMG windows?
Thanks!
Mark
How do you simulate the picture options in HMG windows?
Thanks!
Mark
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Numeric Text Box
Hi Mark
Happy HMG'ing
My reminder isn't to you, to HMG developersMGOLDFARB wrote:I know about the picture options from 20+ years ago.
How do you simulate the picture options in HMG windows?
Thanks!
Mark
Happy HMG'ing
Viva INTERNATIONAL HMG
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Numeric Text Box
Good workaround, dear friend Rathinagiri ! I make another example based on your one:
Code: Select all
#include <hmg.ch>
Function Main()
define window main at 0, 0 width 400 height 300 main
define textbox num1
row 10
col 10
width 100
value 0
numeric .t.
inputmask "999.99"
ON LOSTFOCUS (If(This.Value=0.0,This.Value:='',))
end textbox
define textbox num2
row 40
col 10
width 100
value 0
numeric .t.
inputmask "999.99"
ON LOSTFOCUS (If(This.Value=0.0,This.Value:='',))
end textbox
end window
Main.Center
Main.Activate
Return Nil
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
Numeric Text Box
Hola amigo, are you trying to call back attention for this missing inputmask resource in HMG ? And suggesting to HMG's contributors for developing ?esgici wrote:My reminder isn't to you, to HMG developers
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
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Numeric Text Box
Hola Amigo PabloPablo César wrote:... are you trying to call back attention for this missing inputmask resource in HMG ? And suggesting to HMG's contributors for developing ?
Thanks to your attention
No criticizing nor faultfinding; only a humble observation and only a wish.
And I want to call attention of developers, no contributors
Me too I have same ideas, but you know :
- HMG doesn't accept contributions to the core of library,
- I not have capabilities nor desire to interfere to library,
- and I not have ability to solving problems by some hocus-pocus with some love-level interventions.
Anyway, If you have some ideas to solve this zero-suppressing problem I want learn it eagerly.
Saludos cordiales
Viva INTERNATIONAL HMG
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Numeric Text Box
Well our good friend Rathinaghiri appointed a simples solution.
To implement deep in HMG library, we should modified function _DefineMaskedTextbox at C:\hmg.3.1.1\SOURCE\h_textbox.prg, but as you said propbably is not be accepted "@Z" as INPUTMASK or FORMAT one.
To implement deep in HMG library, we should modified function _DefineMaskedTextbox at C:\hmg.3.1.1\SOURCE\h_textbox.prg, but as you said propbably is not be accepted "@Z" as INPUTMASK or FORMAT one.
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
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Numeric Text Box
Yes, agreed; it's a simple solution; until "@Z" will be accepted as INPUTMASK in TextBox control.Pablo César wrote:Well our good friend Rathinaghiri appointed a simples solution.
To implement deep in HMG library, we should modified function _DefineMaskedTextbox at C:\hmg.3.1.1\SOURCE\h_textbox.prg, but as you said propbably is not be accepted "@Z" as INPUTMASK or FORMAT one.
But I have some questions yet
There is a paradox in the
Code: Select all
If(This.Value=0.0,This.Value:='',)
Code: Select all
if valtype( This.Value ) = "N"
This.Value:='' is wrong;
elseif valtype( This.Value ) = "C"
If(This.Value=0.0 is wrong !
... and answer :
because whenever changed textbox value (by user or by program), ON CHANGE event re-triggered and program goes to endless loop
TIA
Viva INTERNATIONAL HMG