Re: [lazarus] RecreateWnd
Paul Ishenin wrote: Giuliano Colla wrote: From a quick look to documentation, RecreateWnd is just a dangerous hack/workaround to overcome some Windows bugs/inadequacies. In Windows it's impossible to change some properties of a window, such as: * Changing the border style. * Changing the CharCase, HideSelection or OEMConvert property of an edit control. * Changing the Alignment or ScrollBars property of a memo control. * Changing the Sorted or Style property of a listbox control. * Changing the Sorted or Style property of a listbox control. * Changing the Alignment property of a listbox control. * Changing the Ctl3D appearance of a checkbox control. and the only thing that can be done is to destroy it, and then recreate it with new properties. It's just one of the 65000-plus known bugs of Windows. This is not only unneeded, but not even thought of in other OS's. Only in Redmond such a thing can be considered normal. Dont make quick decisions :) Some qt widgets also lack from inability to change few properties after their creation. For example QRubberBand cannot change its shape after creating. Some gtk properties also cannot be set after realizing of widget. For example you cannot ask gtk widget to create/remove gdk window after widget realizing. I expect carbon can have own examples. So in 2% of cases RecreateWnd is needed, That is exactly why I removed recreatewind form twincontrol. Most (if not all) widgetsets needs a recreate for the one or the other property (you cannot add columns to a listview in gtk for instance). However this recreating is not always for the same property. So recreate will work, but in most widgetsets it is unneeded. but indeed its add headache. For the LCL itself it doesn't since all logic to create a handle is already present. Marc _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] RecreateWnd
Hi! I am porting some Delphi component to Lazarus. Now I am looking for a replacement of RecreateWnd. Delphi help says: procedure RecreateWnd; Recreate underlying Windows screen object. Call RecreateWnd to recreate the control from scratch. RecreateWnd destroys the underlying Windows screen object. The next time the Handle property is referenced (when the object is repainted, for example), a new Windows screen object is created. Some changes in control properties are not implemented until this re-creation occurs. Is there a substitute in Win32/gtk-LCL? _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] RecreateWnd
Declaration ist RecreateWnd(Object) RecreateWnd(Self) is the same as RecreateWnd in Delphi. [EMAIL PROTECTED] schrieb: Hi! I am porting some Delphi component to Lazarus. Now I am looking for a replacement of RecreateWnd. Delphi help says: procedure RecreateWnd; Recreate underlying Windows screen object. Call RecreateWnd to recreate the control from scratch. RecreateWnd destroys the underlying Windows screen object. The next time the Handle property is referenced (when the object is repainted, for example), a new Windows screen object is created. Some changes in control properties are not implemented until this re-creation occurs. Is there a substitute in Win32/gtk-LCL? _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] RecreateWnd
On Feb 3, 2008 4:09 PM, [EMAIL PROTECTED] wrote: Is there a substitute in Win32/gtk-LCL? I think you should start by re-thinking why you need RecreateWnd in the first place. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] RecreateWnd
Thanks! I found also the explaination here: {-- RecreateWnd This function was originally member of TWincontrol. From a VCL point of view that made perfectly sense since the VCL knows when a win32 widget has to be recreated when properties have changed. The LCL however doesn't know, the widgetset does. To avoid old VCL behaviour and to provide a central function to the widgetset, it is moved here. MWE. --} procedure RecreateWnd(const AWinControl:TWinControl); ... Christian U. wrote: Declaration ist RecreateWnd(Object) RecreateWnd(Self) is the same as RecreateWnd in Delphi. [EMAIL PROTECTED] schrieb: Hi! I am porting some Delphi component to Lazarus. Now I am looking for a replacement of RecreateWnd. Delphi help says: procedure RecreateWnd; Recreate underlying Windows screen object. Call RecreateWnd to recreate the control from scratch. RecreateWnd destroys the underlying Windows screen object. The next time the Handle property is referenced (when the object is repainted, for example), a new Windows screen object is created. Some changes in control properties are not implemented until this re-creation occurs. Is there a substitute in Win32/gtk-LCL? _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
RE: [lazarus] RecreateWnd
Surely recreatewnd is just destroywnd followed by createwnd, both of which weem important to me. Sam -Original Message- From: Felipe Monteiro de Carvalho [EMAIL PROTECTED] Sent: 03 February 2008 16:18 To: lazarus@miraclec.com Subject: Re: [lazarus] RecreateWnd On Feb 3, 2008 4:09 PM, [EMAIL PROTECTED] wrote: Is there a substitute in Win32/gtk-LCL? I think you should start by re-thinking why you need RecreateWnd in the first place. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
RE: [lazarus] RecreateWnd
With my ported Delphi components, I call RecreateWnd(Self) only on Windows, ignoring this call via $IFDEF altogether with other widgetsets. Thanks. -Phil -Original Message- From: Sam Liddicott [mailto:[EMAIL PROTECTED] Sent: Sun 2/3/2008 12:04 PM To: lazarus@miraclec.com Subject: RE: [lazarus] RecreateWnd Surely recreatewnd is just destroywnd followed by createwnd, both of which weem important to me. Sam -Original Message- From: Felipe Monteiro de Carvalho [EMAIL PROTECTED] Sent: 03 February 2008 16:18 To: lazarus@miraclec.com Subject: Re: [lazarus] RecreateWnd On Feb 3, 2008 4:09 PM, [EMAIL PROTECTED] wrote: Is there a substitute in Win32/gtk-LCL? I think you should start by re-thinking why you need RecreateWnd in the first place. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives winmail.dat
RE: [lazarus] RecreateWnd
I would be interested in a reply to this. Under windows you need this to go along with createparams(); Otherwise you can try to get along with Get/SetWindowLong right? But what about on OSes other than windows? -Original Message- From: Felipe Monteiro de Carvalho [mailto:[EMAIL PROTECTED] Sent: Sunday, February 03, 2008 11:19 AM To: lazarus@miraclec.com Subject: Re: [lazarus] RecreateWnd On Feb 3, 2008 4:09 PM, [EMAIL PROTECTED] wrote: Is there a substitute in Win32/gtk-LCL? I think you should start by re-thinking why you need RecreateWnd in the first place. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] RecreateWnd
Giuliano Colla wrote: From a quick look to documentation, RecreateWnd is just a dangerous hack/workaround to overcome some Windows bugs/inadequacies. In Windows it's impossible to change some properties of a window, such as: * Changing the border style. * Changing the CharCase, HideSelection or OEMConvert property of an edit control. * Changing the Alignment or ScrollBars property of a memo control. * Changing the Sorted or Style property of a listbox control. * Changing the Sorted or Style property of a listbox control. * Changing the Alignment property of a listbox control. * Changing the Ctl3D appearance of a checkbox control. and the only thing that can be done is to destroy it, and then recreate it with new properties. It's just one of the 65000-plus known bugs of Windows. This is not only unneeded, but not even thought of in other OS's. Only in Redmond such a thing can be considered normal. Dont make quick decisions :) Some qt widgets also lack from inability to change few properties after their creation. For example QRubberBand cannot change its shape after creating. Some gtk properties also cannot be set after realizing of widget. For example you cannot ask gtk widget to create/remove gdk window after widget realizing. I expect carbon can have own examples. So in 2% of cases RecreateWnd is needed, but indeed its add headache. Best regards, Paul Ishenin. _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives