Numeric Text Box
Posted: Wed Feb 27, 2013 7:52 pm
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
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://mail.hmgforum.com/
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
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
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
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
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
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 ?
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.
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 !