Recent

Author Topic: Custom Drawn Controls advances  (Read 161650 times)

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #75 on: December 28, 2011, 09:17:27 pm »
Try rev 34475, I did a slightly different approach for the fix.

I'ts working.

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #76 on: December 28, 2011, 11:07:00 pm »
I've found the memory leak is in TCDButton destroy. There is a bitmap that need to be free. I've added a patch.

I've uploaded BitmapThemeUtils 0.0.0.5. Try it with TBitmap or TBGRABitmap (usefull to load from png files with alpha) but not required.

https://sourceforge.net/projects/bmpthemeutils/files/?

There is a nice thing in the CheckBox, you can use a 'v' tickmark or the hidden and never used in Windows 'x' tickmark.  :o

Just change the line 159 in customdrawn_win7.pas

from
Code: [Select]
    number := 4;to
Code: [Select]
    number := 16;   
Try the controls with the mouse and keyboard, everything works fine.. but there are a lot improvements to do of course.

See image attached  ;)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #77 on: December 29, 2011, 12:20:43 am »
thanks, I applied the memleak fix and added a new dsWindow7 style to the enum in rev34481

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #78 on: December 29, 2011, 08:52:09 pm »
Thankyou.

There is another memory leak in TCDTrackBar but I can't find where..

In the git of bitmapthemeutils I've added ProgressBar code and images, both bmp and png. The bmp ones has an unwanted white line, the png are ok.

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #79 on: January 02, 2012, 05:47:18 pm »
Here is the patch for TCDPositionedControl memory leak.

PD: I've seen that there are more memory leak, maybe some of the others are for the same reason.
« Last Edit: January 02, 2012, 05:51:05 pm by lainz »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #80 on: January 03, 2012, 01:38:39 am »
Thanks, applied in rev34545.

> maybe some of the others are for the same reason.

No, this was the only occurence of this particular error.

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #81 on: January 03, 2012, 10:02:28 pm »
No, this was the only occurence of this particular error.

I see.

Here is another memory leak fix. Now the heaptrc show me 0 unfreed memory blocks in the project 'cd_test_all'

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #82 on: January 04, 2012, 12:31:37 am »
Thanks, applied in rev 34569

Gintas

  • Jr. Member
  • **
  • Posts: 71
    • Developer's Diary
Re: Custom Drawn Controls advances
« Reply #83 on: January 12, 2012, 10:54:57 pm »
A custom drawn TMenu would be nice. I will take a look into these components code.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2330
Re: Custom Drawn Controls advances
« Reply #84 on: January 18, 2012, 07:42:37 pm »
Hi!
 
After install customdrawn.lpk it doesn't appeared on Component Pallete.

I tried svn for new a revision...

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/customdrawn  ... I get  "404 Not Found"...

Someone can help? Thank you!

PS. I am using Release candidate 2 of Lazarus 0.9.30.2 (DATE 2011-11-04 * FPC 2.4.4 * SVN Revison 33306 * i386-win32/win64) on Win64 Seven.
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #85 on: January 18, 2012, 09:39:53 pm »
customdrawn is for Lazarus 0.9.31+ only, not 0.9.30.2

Downloading some pieces is not recommended. Download instead the entire lazarus trunk svn:

http://wiki.lazarus.freepascal.org/index.php/Getting_Lazarus

jmpessoa

  • Hero Member
  • *****
  • Posts: 2330
Re: Custom Drawn Controls advances
« Reply #86 on: January 19, 2012, 05:11:39 pm »
Ok Felipe.

I installed the

Lazarus-0.9.31-34252-fpc-2.5.1-20111230-win64.exe from "Daily Snapshots"

and now it's there in the Component Palette.

Thanks.
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #87 on: January 23, 2012, 03:16:44 am »
Felipe, there is a way to set all controls property DrawStyle?

of course this doesn't works because the property is published in the descendant controls
Code: [Select]
var
  i: integer;
begin
  for i := 0 to ControlCount - 1 do
    TCDControl(Controls[i]).DrawStyle:= dsWindows7;

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #88 on: January 23, 2012, 07:37:21 am »
in customdrawndrawers.pas:

  TCDDrawStyle = (
    // The default is given by the DefaultStyle global variable
    // Don't implement anything for this drawer
    dsDefault = 0,
    .....

var
  DefaultStyle: TCDDrawStyle = dsCommon; // For now default to the most complete one, later per platform

If you change DefaultStyle it will affect all controls with dsDefault style, which is the initial one.

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #89 on: January 24, 2012, 12:29:37 am »
Thanks.

Here is attached a fix to cd checkbox:
- Now if you set the state from code or from the object inspector the control set that state and not other.
- Checkboxes that don't has enabled 'AllowGrayed' and you set state as cbGrayed it will be always cbCheched (because if you set it to cbGrayed the control will not work).

See it working in the image.

Edit: please add 'Enabled' property in most CDControls it's working fine, not in the default drawer but as you can see in the image works =)
« Last Edit: January 24, 2012, 12:32:12 am by lainz »

 

TinyPortal © 2005-2018