[lazarus] Patches: TPaintBox fix and some other minor enhancements
Hi all, these are some fixes as follows: 1 2) The only really important and no-brainer: fix TPaintBox not triggering OnPaint. 3) Add some (ugly, I admit) casts to work-around some badly translated Winapi headers in FPC 2.0.4 and remove the associated warnings. I've verified that the 2 functions affected receive CONST arguments according to WinSDK. 4) One I'm almost sure will get rejected: Add methods for handling boolean value, by means of a wrapper around 'integer' methods. To make things worse I couldn't resist renaming the parameters from 'Default' to 'DefaultValue'... 5) Fix a single method, TApplication.CreateForm(), for which the Reference parameter should be 'out', not 'var', and the compiler hint was annoying me ;-) Best regards, Flávio Index: H:/projetos/lazarus/lcl/extctrls.pp === --- H:/projetos/lazarus/lcl/extctrls.pp (revision 10613) +++ H:/projetos/lazarus/lcl/extctrls.pp (working copy) @@ -471,8 +471,6 @@ { TPaintBox } TPaintBox = class(TGraphicControl) - private -FOnPaint: TNotifyEvent; protected procedure Paint; override; public Index: H:/projetos/lazarus/lcl/include/paintbox.inc === --- H:/projetos/lazarus/lcl/include/paintbox.inc (revision 10613) +++ H:/projetos/lazarus/lcl/include/paintbox.inc (working copy) @@ -38,7 +38,7 @@ end; exit; end; - if Assigned(FOnPaint) then begin + if Assigned(OnPaint) then begin Canvas.Font := Font; Canvas.Brush.Color := Color; inherited Paint; Index: H:/projetos/lazarus/lcl/interfaces/win32/win32winapi.inc === --- H:/projetos/lazarus/lcl/interfaces/win32/win32winapi.inc (revision 10613) +++ H:/projetos/lazarus/lcl/interfaces/win32/win32winapi.inc (working copy) @@ -,12 +,8 @@ End; function TWin32WidgetSet.DrawFocusRect(DC: HDC; const Rect: TRect): boolean; -var - lRect: Windows.RECT; begin - {$message warn TWin32WidgetSet.DrawFocusRect TODO: optimize Rect copying} - lRect:=Rect; - Result:= Windows.DrawFocusRect(DC, lRect); + Result:= Windows.DrawFocusRect(DC, PRect(@Rect)^); end; {-- @@ -1434,12 +1430,8 @@ function TWin32WidgetSet.FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH) : integer; -var - lRect: Windows.RECT; begin - {$message warn TWin32WidgetSet.FrameRect TODO: optimize ARect copying} - lRect := ARect; - Result := Windows.FrameRect(DC, lRect, hBr); + Result := Windows.FrameRect(DC, PRect(@ARect)^, hBr); end; {-- Index: H:/projetos/lazarus/lcl/propertystorage.pas === --- H:/projetos/lazarus/lcl/propertystorage.pas (revision 10613) +++ H:/projetos/lazarus/lcl/propertystorage.pas (working copy) @@ -137,8 +137,8 @@ procedure RestoreProperties; virtual; Procedure GetPropertyList(List: TStrings); virtual; abstract; procedure FinishPropertyList(List: TStrings); virtual; -function DoReadInteger(const Section, Ident : String; Default: Integer): Integer; Virtual; -function DoReadString(const Section, Ident, Default: string): string; Virtual; Abstract; +function DoReadInteger(const Section, Ident : String; DefaultValue: Integer): Integer; Virtual; +function DoReadString(const Section, Ident, DefaultValue: string): string; Virtual; Abstract; procedure DoWriteString(const Section, Ident, Value: string); Virtual; Abstract; procedure DoWriteInteger(const Section, Ident : String; Value: Integer); Virtual; Procedure DoEraseSections(const ARootSection : String);virtual;abstract; @@ -150,14 +150,16 @@ // Public Read/Write methods procedure StorageNeeded(ReadOnly: Boolean);Virtual; procedure FreeStorage; Virtual; -function ReadString(const Ident, Default: string): string; -function ReadInteger(const Ident: string; Default: Longint): Longint; +function ReadBoolean(const Ident: string; DefaultValue: Boolean): Boolean; +function ReadString(const Ident, DefaultValue: string): string; +function ReadInteger(const Ident: string; DefaultValue: Longint): Longint; procedure ReadRect(const Ident: string; out ARect: TRect; const Default: TRect); procedure ReadStrings(const Ident: string; const List: TStrings; const DefaultList: TStrings = nil); procedure WriteString(const Ident, Value: string); procedure WriteInteger(const Ident: string; Value: Longint); +procedure WriteBoolean(const Ident: string; Value: Boolean); procedure WriteRect(const Ident: string; const Value: TRect); procedure WriteStrings(const Ident: string; const List: TStrings); procedure EraseSections; @@ -657,9 +659,9 @@ end;
Re: [lazarus] Help wanted: New design for lazarus snapshot pages
Vincent Snijders wrote: Tiziano_mk schreef: Could you explain how this page is generated? A fill in the file name and link in the attached html page with sed in a bash script. But the generating is not the hard part, the look and the design and the corresponding html is the part which I cannot do myself. ok, here is my homework :-) you will find a link in the bottom of my home page: http://digilander.libero.it/tizzziano please note: a) quick and dirty draft, just to see the structure b) one single page, no frames c) no scripts, just plain HTML send comments and further requirements, tiziano _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Help wanted: New design for lazarus snapshot pages
Vincent Snijders wrote: Tiziano_mk schreef: Could you explain how this page is generated? A fill in the file name and link in the attached html page with sed in a bash script. But the generating is not the hard part, the look and the design and the corresponding html is the part which I cannot do myself. ok, here is my homework :-) you will find a link in the bottom of my home page: http://digilander.libero.it/tizzziano please note: a) quick and dirty draft, just to see the structure b) one single page, no frames c) no scripts, just plain HTML send comments and further requirements, tiziano _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Help wanted: New design for lazarus snapshot pages
Darius Blaszijk schreef: Here it is. Please disregard the makeup of the page itself. Eye candy will come later. I will put a table later as item in the treeview, so we can distribute the items better on the screen. Please comment I think this is more or less what I want, provided that it does degrade nicely for browser not supporting javascript. One thing I noticed is that each line has two plus symbols, I think that is a bug somewhere. To the others who responded in this thread. Thanks for thinking with me, I appreciate it. For now I will continue with Darius's proposal. Vincent _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Problem to add a component at design time
I am creating a package that has a design time component. It originally used the Resize method to paint the window. After the component is dropped an error is given and the component is not added to the form. I tried to change from Resize to DoOnResize without success. See callstack below: ERROR in LCL: TWinControl.CreateWnd: no parent :TATBinHex Creating gdb catchable error: $0040EE88 RAISEGDBEXCEPTION, line 779 of LCLProc.pas $0048B418 TWINCONTROL__CREATEWND, line 5173 of ./include/wincontrol.inc $0048B0FF TWINCONTROL__CREATEHANDLE, line 5113 of ./include/wincontrol.inc $0048BF48 TWINCONTROL__HANDLENEEDED, line 5469 of ./include/wincontrol.inc $0048A419 TWINCONTROL__GETHANDLE, line 4463 of ./include/wincontrol.inc $009A1D1F TATBINHEX__HIDESCROLLBAR, line 1280 of ATBinHex.pas $009A0660 TATBINHEX__REDRAW, line 1026 of ATBinHex.pas $009A22D1 TATBINHEX__DOONRESIZE, line 1427 of ATBinHex.pas $00492718 TCONTROL__RESIZE, line 2560 of ./include/control.inc $009A20A5 TATBINHEX__RESIZE, line 1369 of ATBinHex.pas //TABINHEX.Resize does nothing $0048E699 TCONTROL__CHANGEBOUNDS, line 406 of ./include/control.inc $00492ADE TCONTROL__SETBOUNDS, line 2662 of ./include/control.inc $0048C796 TWINCONTROL__SETBOUNDS, line 5724 of ./include/wincontrol.inc $00495F27 TCONTROL__SETINITIALBOUNDS, line 3915 of ./include/control.inc $004AB0B2 TCUSTOMPANEL__CREATE, line 44 of ./include/custompanel.inc $0099FDC0 TATBINHEX__CREATE, line 797 of ATBinHex.pas $00596C2B TCUSTOMFORMEDITOR__CREATECOMPONENT, line 1348 of CustomFormEditor.pp $0058F856 ADDCOMPONENT, line 1469 of E:/repositories/lazarus/designer/Designer.pp Since TControl.Resize checks the ComponentState before calling DoOnResize, i think that would resolve the problem but is not true. It seems that csLoading is not in component state at that time. So the question is there's a way to check if a TComponent is being Created? What the ComponentState just after the call to the constructor? Thanks in advance Luiz _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] how to add a package via commandline
[..] 1. Add files to packager/globallinks/ for glscene and indy (easy). 2. Setup the ~/.lazarus/staticpackages.inc (easy) Not really, because there is not only the added package, but also the auto-compiled dependent packages and the packages compiled during make bigide. 3. Setup the ~/.lazarus/idemake.cfg (this is the difficult part) 1. is needed, so the IDE can find the non lazarus .lpk files. 2. is needed for static packages. There is some progress in dynamic packages for windows and linux, but I don't know when it will be complete enough. So we have to live with static packages for now. 3. These are the compiler parameters, mainly the ppu search paths. If you have a fixed list, you can copy it and adjust the paths. If you want a generic solution, extend lazbuild. I gave up on extending lazbuild, because I just didn't have the time to understand how the IDE creates those files (staticpackages.inc, idemake.cfg, miscellaneousoptions.xml ..). It seems to be highly entangled in the IDE/GUI (e.g. doing stuff in application.OnIdle) Then finally try to create a lazarus rpm containing these additional components. For now, I managed to build a lazarus rpm, which at least contains everything I need: After installing this rpm, I can use lazbuild to compile my GUI/Indy/GLScene apps without starting the IDE at all. When starting the IDE, I can simply select the desired packages from Availabel packages and rebuild the IDE .. Details/spec-file on request .. regards, Burkhard _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives