On Sat, 15 Jul 2006 10:17:54 +0200
Borut Maricic <[EMAIL PROTECTED]> wrote:

> I just want to check something - please help...
> 
> In the win32-case, in
> C:\Lazarus\lcl\interfaces\win32\win32wscontrols.pp
> one finds for example:
> 
> procedure PrepareCreateWindow(const AWinControl: TWinControl; var Params:
TCreateWindowExParams);
> begin
>   with Params do
>   begin
>     Flags := WS_CHILD or WS_CLIPSIBLINGS or WS_CLIPCHILDREN;
>     FlagsEx := 0;
>     Assert(False, 'Trace:Setting flags');
>     Window := HWND(Nil);
>     Buddy := HWND(Nil);
>     Assert(False, 'Trace:Setting window');
> 
>     if AWinControl.Parent <> nil then
>     begin
>       Parent := AWinControl.Parent.Handle;
>     end else
>       Parent := TWin32WidgetSet(WidgetSet).AppHandle;
> 
>     SubClassWndProc := @WindowProc;
>     WindowTitle := nil;
>     StrCaption := PChar(AWinControl.Caption);
>     WindowTitle := nil;
> ...
> ...
> 
> In there, in the line
>     StrCaption := PChar(AWinControl.Caption);
> Caption is a property of TControl, declared in
> C:\Lazarus\lcl\controls.pp
> 
> TControl.Caption uses read gettext and write settext,
> which are implemented for instance in
> C:\Lazarus\lcl\include\control.inc
> 
> Now, I must admit that I am getting lost there a bit.
> 
> My actual question: when Params.StrCaption is being assigned
> a value (above, in procedure PrepareCreateWindow) - is this
> value guaranteed to already be encoded in UTF8 (i.e. a
> transformation from the possible Codepage into UTF8 happens
> somewhere (where?) before) or it is still encoded in a Codepage,
> in cases where the application does not use UTF8 as "Codepage"?

Caption holds the value of the .lfm file, which will eventually be only
UTF-8. But at the moment it is not guaranteed and will hold the value in the
'codepage' the creator of the .lfm used.
It is planned that the interfaces translate strings on the fly and Caption
will be UTF-8. So the above will probably replaced with
     StrCaption := PChar(UTF8StringToWindowsString(AWinControl.Caption));
or something like that.

 
> A second question: do I understand it correctly, that if I
> am changing/experimenting with the interface part, there is
> no way whatsoever to avoid the necessity to always rebuild
> Lazarus, in order to test the changes (and so these changes
> are immediately active in the recompiled IDE)?

Wrong.
To play with the interface you only need to rebuild the interface. See
below.
Of course if you want to create a patch for us, then you should at least
rebuild the IDE once and check, that your changes didn't broke anything.


> What is the
> preferred/suggested way of debugging such things?

1. Create a project (small test application).
2. Setup shortcuts for 'build lazarus' and 'configure build lazarus'.
3. 'configure build lazarus' to only build the LCL.
4. Change some things
5. compile lazarus (this only rebuilds the LCL, which automatically rebuilds
the selected interface).
6. compile your project
7. run and debug program
8. On error, go back to 4. Otherwise to 9.
9. 'configure build lazarus' to build all.
10. test the IDE, on error go to 3. otherwise 11.
11. create a patch and send it.

 
> Many thanks to any core member for the patience in
> answering!


Mattias

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

Reply via email to