Recent

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

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #105 on: February 13, 2012, 01:30:21 pm »
Felipe there is a way to access all properties of a control?

Because I'm trying to add new buttons in the same drawer.

I already added:

Code: [Select]
type
  TWin7ButtonStyle = (bsNone, bsArrowLeft, bsArrowRight);

  TCDButton = class(customdrawncontrols.TCDButton)
  public
    property Win7Style: TWin7ButtonStyle;
  end;   

To use in this way:

Code: [Select]
CDButton5.Win7Style := bsArrowLeft;
But in the drawer I can't acces the property =)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #106 on: February 13, 2012, 01:44:22 pm »
There is a separation to make the drawers independent from changes in the controls. To add more info do like this:

  TMyCDButton...
  protected
    procedure CreateControlStateEx; override;
    procedure PrepareControlStateEx; override; // <-- Check how controls in customdrawncontrols.pas do those overrides

  TMyCDButtonStateEx = class(TCDButtonStateEx) // TCDButtonStateEx comes from customdrawndrawers.pas
  public
    whatever extra info
  end;

And in the drawer you can use the is operator to check if the stateex is your extended version and then cast to it.

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #107 on: February 13, 2012, 07:25:13 pm »
Thankyou.

ok this will be useful to create a custom drawn bgrabutton.

since those special buttons do not use caption I chose not to make a new control and left them in extra1 =) changing from one style to other with caption (for now).

v.denis

  • Guest
Re: Custom Drawn Controls advances
« Reply #108 on: February 14, 2012, 12:50:02 pm »
First of all, customdrawn lcl is great beginning.

IMO when it will be mature enough, there just will be no
need it other widgetsets.

I hope to see lazarus drawn with it some day.
Close buttons on editor tabs, that's what I wanted under win :)

My question is:

Can controls be rendered with hardware support (where available) ?
I mean like FireMonkey in Delphi ? What's better way to implement it ?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #109 on: February 14, 2012, 01:12:43 pm »
Can controls be rendered with hardware support (where available) ?
I mean like FireMonkey in Delphi ? What's better way to implement it ?

The architecture was created thinking about this, but is not currently implemented. New backends would be required for this, for example a backend for OpenGL, OpenGL ES and/or DirectX.

v.denis

  • Guest
Re: Custom Drawn Controls advances
« Reply #110 on: February 14, 2012, 01:46:52 pm »
The architecture was created thinking about this, but is not currently implemented. New backends would be required for this, for example a backend for OpenGL, OpenGL ES and/or DirectX.
Can you please describe just brief steps how this can be done or link to wiki.
I'd like to try myself to create some h/w accelerated controls.
Need a point to start from.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #111 on: February 14, 2012, 01:49:54 pm »
Can you please describe just brief steps how this can be done or link to wiki.
I'd like to try myself to create some h/w accelerated controls.
Need a point to start from.

You have to read and familiarize yourself with the source code of LCL-CustomDrawn:

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/customdrawn/?root=lazarus

There is a define for each backend. You need to add a new backend and implement everything necessary.

Rustam Asmandiarov

  • New Member
  • *
  • Posts: 46
Re: Custom Drawn Controls advances
« Reply #112 on: March 23, 2012, 11:22:43 am »
Можно ли на форму с Custom Draw Widget рисовать openGL окно или нужно создавать свое окно?
Is it possible to form with Custom Draw Widget drawing openGL window or need to create its own window?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #113 on: March 23, 2012, 11:28:47 am »
Support for a sub-window with OpenGL support is possible but currently not implemented.

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #114 on: March 23, 2012, 02:48:46 pm »
Hi Felipe, how I can enable the debug VerboseCDPaintProfiler? And how I can read the output of that.

Code: [Select]
And here debug information defines:
VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #115 on: March 23, 2012, 02:56:29 pm »
Define it in the file lcl/interfaces/customdrawn/customdrawndefines.inc

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #116 on: March 25, 2012, 07:48:37 pm »
It's already defined, but how I can read the output of that?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #117 on: March 26, 2012, 03:22:19 pm »
In the console, like always. If you are in Windows uncheck the option "win32 graphical program" (or similar name) in the Project Options dialog

Fahmy Rofiq

  • Jr. Member
  • **
  • Posts: 83
Re: Custom Drawn Controls advances
« Reply #118 on: April 06, 2012, 05:58:36 pm »
Hello, I'm testing TCDPageControl, when I use nboShowCloseButton the close button placed incorrectly if TCDTabSheets caption length are not equal.
Any one realize this?
Lazarus Trunk + FPC Fixes 32bit
Windows 10 x64

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #119 on: April 07, 2012, 09:00:23 am »
Please create a bug report about this in our bug tracker. Even better if you could come up with a solution and attach a patch which fixes the issue ;)

 

TinyPortal © 2005-2018