From 62d59b10e9a5ad070b602ec33f2f3b748678fc04 Mon Sep 17 00:00:00 2001 From: graemeg Date: Wed, 12 Nov 2008 13:40:29 +0000 Subject: * new fpgCharAt() function * Renamed EditXXX's DecimalSeparator and ThousandSeparatar properties to not conflict with the global variables in SysUtils. * Added EditCurrency, EditFloat and EditInteger to the UI Designer palette. I still have issues with TfpgChar type, so you have to use the 'unknow' memo in Object Inspector. * Minor changes in edits demo to compile again after the above changes. --- uidesigner/icons.inc | 313 +++++++++++++++++++++++++++++++++++++ uidesigner/images/editcurrency.bmp | Bin 0 -> 1710 bytes uidesigner/images/editfloat.bmp | Bin 0 -> 1710 bytes uidesigner/images/editinteger.bmp | Bin 0 -> 1710 bytes uidesigner/vfdformparser.pas | 18 +++ uidesigner/vfdprops.pas | 85 +++++++++- uidesigner/vfdwidgets.pas | 59 +++++++ 7 files changed, 470 insertions(+), 5 deletions(-) create mode 100644 uidesigner/images/editcurrency.bmp create mode 100644 uidesigner/images/editfloat.bmp create mode 100644 uidesigner/images/editinteger.bmp (limited to 'uidesigner') diff --git a/uidesigner/icons.inc b/uidesigner/icons.inc index 43b6f65f..e1b34eba 100644 --- a/uidesigner/icons.inc +++ b/uidesigner/icons.inc @@ -2190,3 +2190,316 @@ Const 255,255, 0,255,255, 0,255, 0, 0, 0); +Const + stdimg_vfd_editfloat : Array[0..1709] of byte = ( + 66, 77,174, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 23, 0, 0, 0, 23, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 120, 6, 0, 0,215, 13, 0, 0,215, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, + 0, 0,128,128,128,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, + 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255,200,208,212,255,255,255, 0, 0, + 0,128,128,128, 0, 0, 0,243,231,231,159, 63, 63,130, 5, 5,157, + 60, 60,243,231,231,255,255,255,128, 0, 0,128, 0, 0,255,255,255, + 222,190,190,147, 39, 39,130, 4, 4,157, 59, 59,238,222,222,255,255, + 255, 0, 0, 0,255,255,255,255,255,255,255,255,255,200,208,212,255, + 255,255, 0, 0, 0,128,128,128, 0, 0, 0,175, 96, 96,128, 0, 0, + 211,167,167,128, 0, 0,178,101,101,255,255,255,128, 0, 0,128, 0, + 0,255,255,255,154, 54, 54,131, 8, 8,219,183,183,128, 0, 0,159, + 63, 63,255,255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,142, 29, + 29,128, 0, 0,247,240,240,128, 0, 0,143, 31, 31,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,251,251, + 128, 0, 0,130, 5, 5,255,255,255, 0, 0, 0,255,255,255,255,255, + 255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, + 0, 0,129, 4, 4,128, 0, 0,254,253,253,128, 0, 0,130, 5, 5, + 255,255,255,255,255,255,255,255,255,255,255,255,152, 50, 50,203,152, + 152,228,202,202,128, 0, 0,147, 39, 39,255,255,255, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0, + 128,128,128, 0, 0, 0,130, 5, 5,128, 0, 0,254,253,253,128, 0, + 0,130, 5, 5,255,255,255,255,255,255,255,255,255,255,255,255,159, + 64, 64,128, 0, 0,134, 13, 13,138, 22, 22,221,188,188,255,255,255, + 0, 0, 0,255,255,255,255,255,255,255,255,255,200,208,212,255,255, + 255, 0, 0, 0,128,128,128, 0, 0, 0,143, 31, 31,128, 0, 0,246, + 238,238,128, 0, 0,143, 31, 31,255,255,255,255,255,255,255,255,255, + 255,255,255,186,118,118,128, 0, 0,199,144,144,255,255,255,255,255, + 255,255,255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255,200, + 208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,178,101,101, + 128, 0, 0,210,165,165,128, 0, 0,178,102,102,255,255,255,255,255, + 255,255,255,255,255,255,255,214,173,173,128, 0, 0,170, 85, 85,255, + 255,255,255,255,255,255,255,255, 0, 0, 0,255,255,255,255,255,255, + 255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, + 0,243,231,231,158, 61, 61,130, 6, 6,158, 62, 62,244,233,233,255, + 255,255,255,255,255,255,255,255,255,255,255,241,228,228,128, 0, 0, + 128, 0, 0,128, 0, 0,128, 0, 0,255,255,255, 0, 0, 0,255,255, + 255,255,255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128, + 128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0,255,255,255,200,208,212,255,255,255, + 0, 0, 0,128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,200,208, + 212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, + 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0, 0, 0); + +Const + stdimg_vfd_editinteger : Array[0..1709] of byte = ( + 66, 77,174, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 23, 0, 0, 0, 23, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 120, 6, 0, 0,215, 13, 0, 0,215, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, + 0, 0,128,128,128,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, + 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255,200,208,212,255,255,255, 0, 0, + 0,128,128,128, 0, 0, 0,255,255,255,255,255,255,135, 16, 16,128, + 0, 0,128, 0, 0,128, 0, 0,191,127,127,255,255,255,223,191,191, + 148, 41, 41,129, 4, 4,158, 60, 60,239,224,224,255,255,255,255,255, + 255, 0, 0, 0,255,255,255,255,255,255,255,255,255,200,208,212,255, + 255,255, 0, 0, 0,128,128,128, 0, 0, 0,255,255,255,255,255,255, + 163, 71, 71,165, 75, 75,250,246,246,255,255,255,255,255,255,255,255, + 255,155, 56, 56,132, 9, 9,220,185,185,128, 0, 0,159, 63, 63,255, + 255,255,255,255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,255,255, + 255,255,255,255,228,202,202,130, 6, 6,152, 50, 50,240,226,226,255, + 255,255,255,255,255,255,255,255,255,255,255,253,251,251,128, 0, 0, + 131, 6, 6,255,255,255,255,255,255, 0, 0, 0,255,255,255,255,255, + 255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, + 0, 0,255,255,255,255,255,255,255,255,255,213,172,172,128, 2, 2, + 140, 26, 26,239,224,224,255,255,255,255,255,255,255,255,255,230,205, + 205,128, 0, 0,158, 62, 62,255,255,255,255,255,255, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0, + 128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255, + 255,192,129,129,128, 0, 0,164, 73, 73,255,255,255,255,255,255,255, + 255,255,134, 14, 14,141, 27, 27,239,223,223,255,255,255,255,255,255, + 0, 0, 0,255,255,255,255,255,255,255,255,255,200,208,212,255,255, + 255, 0, 0, 0,128,128,128, 0, 0, 0,255,255,255,255,255,255,255, + 255,255,255,255,255,245,236,236,128, 0, 0,131, 7, 7,255,255,255, + 255,255,255,255,255,255,231,207,207,128, 0, 0,155, 55, 55,255,255, + 255,255,255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255,200, + 208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,255,255,255, + 255,255,255,152, 49, 49,131, 7, 7,227,200,200,128, 0, 0,149, 44, + 44,255,255,255,162, 70, 70,134, 13, 13,227,200,200,128, 0, 0,139, + 24, 24,255,255,255,255,255,255, 0, 0, 0,255,255,255,255,255,255, + 255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, + 0,255,255,255,255,255,255,219,183,183,150, 45, 45,130, 6, 6,149, + 44, 44,230,205,205,255,255,255,223,191,191,150, 45, 45,130, 5, 5, + 148, 41, 41,223,191,191,255,255,255,255,255,255, 0, 0, 0,255,255, + 255,255,255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128, + 128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0,255,255,255,200,208,212,255,255,255, + 0, 0, 0,128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,200,208, + 212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, + 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0, 0, 0); + +Const + stdimg_vfd_editcurrency : Array[0..1709] of byte = ( + 66, 77,174, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 23, 0, 0, 0, 23, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 120, 6, 0, 0,215, 13, 0, 0,215, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, + 0, 0,128,128,128,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,200,208,212,200,208, + 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200, + 208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212, + 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208, + 212,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, + 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,128, 0, + 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255, + 0, 0, 0, 0, 0, 0,255,255,255,200,208,212,255,255,255, 0, 0, + 0,128,128,128, 0, 0, 0,255,255,255,255,255,255,221,188,188,144, + 33, 33,128, 0, 0,144, 33, 33,223,192,192,255,255,255,223,191,191, + 148, 41, 41,129, 4, 4,158, 60, 60,239,224,224,255,255,255,255,255, + 255, 0, 0, 0,255,255,255,255,255,255,255,255,255,200,208,212,255, + 255,255, 0, 0, 0,128,128,128, 0, 0, 0,255,255,255,255,255,255, + 146, 37, 37,209,163,163,128, 0, 0,223,191,191,150, 45, 45,255,255, + 255,155, 56, 56,132, 9, 9,220,185,185,128, 0, 0,159, 63, 63,255, + 255,255,255,255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,255,255, + 255,255,255,255,255,255,255,255,255,255,128, 0, 0,231,208,208,131, + 8, 8,255,255,255,255,255,255,255,255,255,253,251,251,128, 0, 0, + 131, 6, 6,255,255,255,255,255,255, 0, 0, 0,255,255,255,255,255, + 255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, + 0, 0,255,255,255,255,255,255,252,250,250,187,119,119,128, 0, 0, + 131, 7, 7,157, 59, 59,255,255,255,255,255,255,255,255,255,230,205, + 205,128, 0, 0,158, 62, 62,255,255,255,255,255,255, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0, + 128,128,128, 0, 0, 0,255,255,255,255,255,255,180,105,105,128, 0, + 0,128, 0, 0,180,106,106,242,230,230,255,255,255,255,255,255,255, + 255,255,134, 14, 14,141, 27, 27,239,223,223,255,255,255,255,255,255, + 0, 0, 0,255,255,255,255,255,255,255,255,255,200,208,212,255,255, + 255, 0, 0, 0,128,128,128, 0, 0, 0,255,255,255,255,255,255,134, + 13, 13,209,163,163,128, 0, 0,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,231,207,207,128, 0, 0,155, 55, 55,255,255, + 255,255,255,255, 0, 0, 0,255,255,255,255,255,255,255,255,255,200, + 208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0,255,255,255, + 255,255,255,142, 29, 29,214,173,173,128, 0, 0,199,143,143,147, 39, + 39,255,255,255,162, 70, 70,134, 13, 13,227,200,200,128, 0, 0,139, + 24, 24,255,255,255,255,255,255, 0, 0, 0,255,255,255,255,255,255, + 255,255,255,200,208,212,255,255,255, 0, 0, 0,128,128,128, 0, 0, + 0,255,255,255,255,255,255,220,186,186,142, 30, 30,128, 0, 0,145, + 36, 36,225,195,195,255,255,255,223,191,191,150, 45, 45,130, 5, 5, + 148, 41, 41,223,191,191,255,255,255,255,255,255, 0, 0, 0,255,255, + 255,255,255,255,255,255,255,200,208,212,255,255,255, 0, 0, 0,128, + 128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, + 128, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255, + 255,255, 0, 0, 0, 0, 0, 0,255,255,255,200,208,212,255,255,255, + 0, 0, 0,128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,200,208, + 212,255,255,255, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,255,255,255, 0, 0, 0,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, 0, + 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0, 0, 0); + + diff --git a/uidesigner/images/editcurrency.bmp b/uidesigner/images/editcurrency.bmp new file mode 100644 index 00000000..7731154a Binary files /dev/null and b/uidesigner/images/editcurrency.bmp differ diff --git a/uidesigner/images/editfloat.bmp b/uidesigner/images/editfloat.bmp new file mode 100644 index 00000000..8cd3fec3 Binary files /dev/null and b/uidesigner/images/editfloat.bmp differ diff --git a/uidesigner/images/editinteger.bmp b/uidesigner/images/editinteger.bmp new file mode 100644 index 00000000..42aec49e Binary files /dev/null and b/uidesigner/images/editinteger.bmp differ diff --git a/uidesigner/vfdformparser.pas b/uidesigner/vfdformparser.pas index 2f41c308..172de33c 100644 --- a/uidesigner/vfdformparser.pas +++ b/uidesigner/vfdformparser.pas @@ -58,6 +58,7 @@ procedure SkipSpaces(var s: string); function CheckSymbol(var s: string; const sym: string): boolean; function GetIntValue(var s: string): integer; function GetBoolValue(var s: string): boolean; +function GetFloatValue(var s: string): extended; implementation @@ -157,6 +158,23 @@ begin Delete(s, 1, 5); end; +function GetFloatValue(var s: string): extended; +var + n: integer; + ns: string; +begin + SkipSpaces(s); + ns := ''; + n := 1; + while (n <= length(s)) and (s[n] in ['0'..'9', '-', '.']) do + begin + ns := ns + s[n]; + Inc(n); + end; + Result := StrToFloatDef(ns, 0.0); + Delete(s, 1, length(ns)); +end; + function GetStringValue(var s: string): string; var n: integer; diff --git a/uidesigner/vfdprops.pas b/uidesigner/vfdprops.pas index 93c2dff5..8d52c4d9 100644 --- a/uidesigner/vfdprops.pas +++ b/uidesigner/vfdprops.pas @@ -51,6 +51,15 @@ type end; + TPropertyFloat = class(TVFDWidgetProperty) + public + function ParseSourceLine(wg: TfpgWidget; const line: string): boolean; override; + function GetPropertySource(wg: TfpgWidget; const ident: string): string; override; + function GetValueText(wg: TfpgWidget): string; override; + function CreateEditor(AOwner: TComponent): TVFDPropertyEditor; override; + end; + + TPropertyEnum = class(TVFDWidgetProperty) public function ParseSourceLine(wg: TfpgWidget; const line: string): boolean; override; @@ -85,7 +94,7 @@ type end; - TGPEType = (gptInteger, gptString); + TGPEType = (gptInteger, gptString, gptFloat); TGeneralPropertyEditor = class(TVFDPropertyEditor) @@ -104,6 +113,8 @@ type procedure StoreIntValue(wg: TfpgWidget); procedure LoadStrValue(wg: TfpgWidget); procedure StoreStrValue(wg: TfpgWidget); + procedure LoadFloatValue(wg: TfpgWidget); + procedure StoreFloatValue(wg: TfpgWidget); end; @@ -340,9 +351,11 @@ procedure TGeneralPropertyEditor.LoadValue(wg: TfpgWidget); begin case etype of gptInteger: - LoadIntValue(wg); + LoadIntValue(wg); + gptFloat: + LoadFloatValue(wg); else - LoadStrValue(wg); + LoadStrValue(wg); end; FOrigValue := edit.Text; end; @@ -368,12 +381,32 @@ begin SetStrProp(wg, prop.Name, s); end; +procedure TGeneralPropertyEditor.LoadFloatValue(wg: TfpgWidget); +begin + edit.Text := FloatToStr(GetFloatProp(wg, prop.Name)); +end; + +procedure TGeneralPropertyEditor.StoreFloatValue(wg: TfpgWidget); +var + i: extended; +begin + try + i := StrToFloat(edit.Text); + SetFloatProp(wg, Prop.Name, i); + except + // error + end; +end; + procedure TGeneralPropertyEditor.StoreValue(wg: TfpgWidget); begin case etype of - gptInteger: StoreIntValue(wg); + gptInteger: + StoreIntValue(wg); + gptFloat: + StoreFloatValue(wg); else - StoreStrValue(wg); + StoreStrValue(wg); end; end; @@ -695,5 +728,47 @@ begin SetStrProp(wg, Name, s); end; +{ TPropertyFloat } + +function TPropertyFloat.ParseSourceLine(wg: TfpgWidget; const line: string): boolean; +var + s: string; + ival: extended; +begin + s := line; + Result := False; + if UpperCase(GetIdentifier(s)) <> UpperCase(Name) then + Exit; + + Result := CheckSymbol(s, ':='); + if Result then + begin + ival := GetFloatValue(s); + Result := CheckSymbol(s, ';'); + end + else + ival := 0.0; + + if Result then + SetFloatProp(wg, Name, ival); +end; + +function TPropertyFloat.GetPropertySource(wg: TfpgWidget; const ident: string): string; +begin + Result := ident + Name + ' := ' + FloatToStr(GetFloatProp(wg, Name)) + ';' + LineEnding +end; + +function TPropertyFloat.GetValueText(wg: TfpgWidget): string; +begin + Result := FloatToStr(GetFloatProp(wg, Name)); +end; + +function TPropertyFloat.CreateEditor(AOwner: TComponent): TVFDPropertyEditor; +begin + Result := TGeneralPropertyEditor.Create(AOwner, self); + with TGeneralPropertyEditor(Result) do + etype := gptFloat; +end; + end. diff --git a/uidesigner/vfdwidgets.pas b/uidesigner/vfdwidgets.pas index 1b20f755..692de9b6 100644 --- a/uidesigner/vfdwidgets.pas +++ b/uidesigner/vfdwidgets.pas @@ -248,6 +248,21 @@ begin sizeof(stdimg_vfd_tabsheet), 0, 0); + fpgImages.AddMaskedBMP( + 'vfd.editinteger', @stdimg_vfd_editinteger, + sizeof(stdimg_vfd_editinteger), + 0, 0); + + fpgImages.AddMaskedBMP( + 'vfd.editfloat', @stdimg_vfd_editfloat, + sizeof(stdimg_vfd_editfloat), + 0, 0); + + fpgImages.AddMaskedBMP( + 'vfd.editcurrency', @stdimg_vfd_editcurrency, + sizeof(stdimg_vfd_editcurrency), + 0, 0); + end; procedure AddWidgetPosProps(wgc: TVFDWidgetClass); @@ -522,6 +537,50 @@ begin RegisterVFDWidget(wc); + // Integer Edit + wc := TVFDWidgetClass.Create(TfpgEditInteger); + wc.NameBase := 'EditInteger'; + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); +// wc.AddProperty('CustomThousandSeparator', TPropertyString, 'Thousand separator character'); + wc.AddProperty('Value', TPropertyInteger, 'Initial value'); + wc.WidgetIconName := 'vfd.editinteger'; + RegisterVFDWidget(wc); + + // Float Edit + wc := TVFDWidgetClass.Create(TfpgEditFloat); + wc.NameBase := 'EditFloat'; + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); + wc.AddProperty('Value', TPropertyFloat, 'Initial value'); + wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); + wc.AddProperty('FixedDecimals', TPropertyBoolean, ''); + wc.Addproperty('Decimals', TPropertyInteger, ''); +// wc.AddProperty('CustomDecimalSeparator', TPropertyString, 'Decimal separator character'); +// wc.AddProperty('CustomThousandSeparator', TPropertyString, 'Thousand separator character'); + wc.WidgetIconName := 'vfd.editfloat'; + RegisterVFDWidget(wc); + + // Currency Edit + wc := TVFDWidgetClass.Create(TfpgEditCurrency); + wc.NameBase := 'EditCurrency'; + wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); + wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); + wc.AddProperty('Value', TPropertyFloat, 'Initial value'); + wc.AddProperty('ShowThousand', TPropertyBoolean, 'Show thousand separator'); + wc.Addproperty('Decimals', TPropertyInteger, ''); +// wc.AddProperty('CustomDecimalSeparator', TPropertyString, 'Decimal separator character'); +// wc.AddProperty('CustomThousandSeparator', TPropertyString, 'Thousand separator character'); + wc.WidgetIconName := 'vfd.editcurrency'; + RegisterVFDWidget(wc); + // Other - do not delete!!! this should be the last... wc := TVFDWidgetClass.Create(TOtherWidget); wc.NameBase := 'Custom'; -- cgit v1.2.3-70-g09d2