Forum Replies Created
-
AuthorPosts
-
LeandroParticipant
I think I found it!
I have noticed that sometimes the application consumes a large amount of GDI resources. I also noticed that the number of GDI objects (when I can simulate the issue) is still growing when I switch between pages of a TsPageControl (two new GDI objects at each page change).
The AQTime confirmed that the blame for the increase in the number of GDI objects is the below highlighted code:
Code:unit sSkinProvider;…
procedure TsSkinProvider.NewWndProc(var Message: TMessage);
….
WM_ERASEBKGND : if Form.Showing then begin
if (SkinData.CtrlSkinState and ACS_LOCKED = ACS_LOCKED) or FCommonData.FUpdating then Exit;
if not (csPaintCopy in Form.ControlState) and (Message.WParam Message.LParam {PerformEraseBackground, TntSpeedButtons}) then beginif not IsCached(FCommonData) {and (Form.Parent = nil) }or ((Form.FormStyle = fsMDIForm) and (Form.ActiveMDIChild nil) and (Form.ActiveMDIChild.WindowState = wsMaximized)) then begin
if (Form.FormStyle = fsMDIChild) and (FCommonData.FCacheBmp nil) then begin
GetClientRect(TsSkinProvider(MDISkinProvider).Form.Handle, cR);
if (PtInRect(cR, Form.BoundsRect.TopLeft) and PtInRect(cR, Form.BoundsRect.BottomRight)) then begin
FCommonData.FCacheBmp.Height := min(FCommonData.FCacheBmp.Height, CaptionHeight + SysBorderHeight(Form.Handle, BorderForm) + LinesCount * MenuHeight + 1);
FCommonData.BGChanged := True;
end
end;
if not InAero then AC_WMEraseBkGnd(TWMPaint(Message).DC) else begin
if (GetClipBox(TWMPaint(Message).DC, cR) = NULLREGION) or (WidthOf(cR) = 0) or (HeightOf(cR) = 0) then begin
——> DC := GetDC(Form.Handle); // it seems not be released by ReleaseDC function
end
else DC := TWMPaint(Message).DC;
AC_WMEraseBkGnd(DC);
end;So I included a call to ReleaseDC function and found that the increase in the number of GDI objects was really stopped.
Could you check this?
Thank you!
Leandro.
LeandroParticipantI don't use version 7 because it's a beta release.
I'll try out and let you know about outcomes.Have you some idea about official release date?
Thanks.
Leandro.
LeandroParticipantI found it!
uses
sThirdParty;…
ThirdPartySkipForms.Add('TMyForm');
LeandroParticipantThe problem was solved by disabling the scroll bars (grid.ScrollBars := ssNone).
The good new is that alpha skin keeps care about scroll bars even though it's disabled and, in this case, correctly!
Thanks.
LeandroParticipantQUOTE (Support @ May 15 2010, 09:24 AM) <{POST_SNAPBACK}>What component have a problem?
If this component is standard edit control, then you can try an other skinning rule when control is added to the ThirdParty list.
Choose 'Panel' type of skin, for example. Used SkinSection may be declared in the SkinProvider.OnSkinItem event.
And, maybe I can solve a problem with scrollbars?TCustomDBGridFooter. I tried “Panel” (component isn't treated), “ListView” (scroll bars never appear) and “Grid” (scroll bars sometimes don't appear) skinning rule. I don't know when or how this component became a part of my solution neither who was the supplier, but it became a very important component. It shows items to selection on lookup panels and sometimes (using alphaskin) scroll bars don't appear. I could notice that TCustomDBGridFooter treats heavily the scroll bars, but in fact with no alphaskin it's ok. I can't substitute this grid for now (unfortunately).
Maybe I could send you a demo application that simulates this behaviour. In this case, could you help me?
-
AuthorPosts