Re: [lazarus] TMaskEdit new release

2007-11-23 Thread Marc Weustink

Guadagnini David wrote:


Yes, those actions are *not* handled by the LCL, it is the widgetset 
itself which handles the paste. Therefore, you won't see a call to 
SetText.
This is a problem for components similar to MaskEdit because no one can 
handle text input through alternative control + v.
Whether you know there is some procedure call after or before a paste 
command?


You don't. However, the widgetsetinterface should notice a control when 
something is pasted. I don't kbnow if all interfaces implement this atm.


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TMaskEdit new release

2007-11-23 Thread Marc Weustink

Guadagnini David wrote:




Again, that did you do ? Paste by doing calling paste, or paste by 
pressing ctrl-v (or choose paste form edit popup)


I tried past with ctrl+v, ctrl+ins and paste from edit popup but It's 
the same


Yes, those actions are *not* handled by the LCL, it is the widgetset 
itself which handles the paste. Therefore, you won't see a call to SetText.


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TMaskEdit new release

2007-11-23 Thread Guadagnini David




Again, that did you do ? Paste by doing calling paste, or paste by 
pressing ctrl-v (or choose paste form edit popup)


I tried past with ctrl+v, ctrl+ins and paste from edit popup but It's 
the same
begin:vcard
fn:David Guadagnini
n:Guadagnini;David
org:Biotecnica Instruments S.p.A.;RD
adr:;;Via Licenza 18;Roma;RM;00133;Italy
email;internet:[EMAIL PROTECTED]
title:Software architet
tel;work:+39064112616
x-mozilla-html:FALSE
version:2.1
end:vcard



Re: [lazarus] TMaskEdit new release

2007-11-23 Thread Marc Weustink

Guadagnini David wrote:
In attach You can found my TMaskEdit component with the changes proposed 
by Marc.


Note:
TComponent have a big bug (for me). The windows message WM_PASTE is not 
processed correctly.
In fact, if the override procedure RealSetText or WndProc by entering a 
simple Begin/End without other the text is still overridden if I execute 
a PAST command (note the text will be override only with past command, 
not with key press or with a normal TEXT := 'Mystring')



Again, that did you do ? Paste by doing calling paste, or paste by 
pressing ctrl-v (or choose paste form edit popup)


Marc


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TMaskEdit new release

2007-11-23 Thread Guadagnini David


Yes, those actions are *not* handled by the LCL, it is the widgetset 
itself which handles the paste. Therefore, you won't see a call to 
SetText.
This is a problem for components similar to MaskEdit because no one can 
handle text input through alternative control + v.
Whether you know there is some procedure call after or before a paste 
command?
begin:vcard
fn:David Guadagnini
n:Guadagnini;David
org:Biotecnica Instruments S.p.A.;RD
adr:;;Via Licenza 18;Roma;RM;00133;Italy
email;internet:[EMAIL PROTECTED]
title:Software architet
tel;work:+39064112616
x-mozilla-html:FALSE
version:2.1
end:vcard



Re: [lazarus] TMaskEdit

2007-11-22 Thread Marc Weustink

Guadagnini David wrote:
In attach You can found my TMaskEdit component that work well in Windows 


At first glance this looks like a clean implementation without copied 
code (can sombody this verify agains cppbuilder implementations)



Some remarks about the code:

Try to avoid Arguments and Methods prefixed with _
For Aguments there is no problem in prefixing them with A, for 
property getters there is nothing wrong with prefixing them with Get. In 
your case, GetIsMask makes perfectly clear that it reads the IsMasked 
property.


Variable names like X1, X2, XX1, XX2
Please name them after there use: GetSel(X1, X2) could also be coded 
like: GetSel(SelStart, SelLength) (or was it SelStop)

You see... with naming them it will be clear.

Why using the C approach for naming all kinds is Char_xxx (as char). 
Pascal has a perfect suitable type for this : enum.

No cludging winth #nn and mak sure they are unique etc.

in CanInsertChar, why do you use short stings and why assigning S := 
FMask instead of accessing Fmask.


Anyway, I think that after some cleanup, this will be usable code.

and in Linux but have a little bug: the message WM_PAST seems that is 
never invoked. I tried to override the procedure PasteFromClipboard of 
the component TCustomEdit but is the same. Some idea?



Pasting is handled by the widget itself. unlike in windows, I think a 
paste isn't redirected yout



marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TMaskEdit

2007-11-22 Thread Marc Weustink

Guadagnini David wrote:



Try to avoid Arguments and Methods prefixed with _
For Aguments there is no problem in prefixing them with A, for 
property getters there is nothing wrong with prefixing them with Get. 
In your case, GetIsMask makes perfectly clear that it reads the 
IsMasked property.



Ok!

Variable names like X1, X2, XX1, XX2
Please name them after there use: GetSel(X1, X2) could also be coded 
like: GetSel(SelStart, SelLength) (or was it SelStop)

You see... with naming them it will be clear.


Ok!
Question... SelStart and SelStop are present in TCustomEdit controls?


I mean them as variable names. If they are present as properties use 
StartSel/StopSel for instance.


Why using the C approach for naming all kinds is Char_xxx (as char). 
Pascal has a perfect suitable type for this : enum.

No cludging winth #nn and mak sure they are unique etc.


For me it is easier to administer. But if you want I change it


They are clearer, and can be checked better if they are in range for 
instance. (who will check if #42 is valid in your case)


What do you mean by administer ? declaring like:
  TmyEnum = (Enumone, enumTwo...);
is imo easier than:
  TmyEnum_EnumOne = 1;
  TmyEnum_EnumOne = 2;
  ...

if you man the FMask array ? Delcalre it like FMask: array of TmyEnum;

in CanInsertChar, why do you use short stings and why assigning S := 
FMask instead of accessing Fmask.


Because in Delphi if I use String can not access to a single char with 
S[] and I must trasform String in ShortString or in PChar or in Array Of 
Char


???
Don't know about your version of delphi, but all the versions I know 
(D1..D7), you can access SomeString[i] as character


Pasting is handled by the widget itself. unlike in windows, I think a 
paste isn't redirected yout




The strange thing is that the procedure PasteFromClipboard not be invoked


Paste from clipboard is an action. The developer tells the control to 
get the contents of the clipboard (like it was pasted by the user)


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TMaskEdit

2007-11-22 Thread Guadagnini David



Try to avoid Arguments and Methods prefixed with _
For Aguments there is no problem in prefixing them with A, for 
property getters there is nothing wrong with prefixing them with Get. 
In your case, GetIsMask makes perfectly clear that it reads the 
IsMasked property.



Ok!

Variable names like X1, X2, XX1, XX2
Please name them after there use: GetSel(X1, X2) could also be coded 
like: GetSel(SelStart, SelLength) (or was it SelStop)

You see... with naming them it will be clear.


Ok!
Question... SelStart and SelStop are present in TCustomEdit controls?
Why using the C approach for naming all kinds is Char_xxx (as char). 
Pascal has a perfect suitable type for this : enum.

No cludging winth #nn and mak sure they are unique etc.


For me it is easier to administer. But if you want I change it
in CanInsertChar, why do you use short stings and why assigning S := 
FMask instead of accessing Fmask.


Because in Delphi if I use String can not access to a single char with 
S[] and I must trasform String in ShortString or in PChar or in Array Of 
Char




Pasting is handled by the widget itself. unlike in windows, I think a 
paste isn't redirected yout




The strange thing is that the procedure PasteFromClipboard not be invoked

begin:vcard
fn:David Guadagnini
n:Guadagnini;David
org:Biotecnica Instruments S.p.A.;RD
adr:;;Via Licenza 18;Roma;RM;00133;Italy
email;internet:[EMAIL PROTECTED]
title:Software architet
tel;work:+39064112616
x-mozilla-html:FALSE
version:2.1
end:vcard



Re: [lazarus] TMaskEdit first version

2007-10-29 Thread Graeme Geldenhuys
On 29/10/2007, Marc Weustink [EMAIL PROTECTED] wrote:
 Guadagnini David wrote:
  In attach You can found the first version of the control TMaskEdit.
  For make it I used the delphi 5 source code.

 PLEASE, PLEASE, PLEASE

 Don't use copyrighted material when submitting code.


At least this time he made it easy by mentioning that be broke the law! ;-)


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives