Recent

Author Topic: What about AlphaControls?  (Read 24147 times)

HeDiBo

  • New Member
  • *
  • Posts: 44
What about AlphaControls?
« on: September 30, 2012, 09:19:58 pm »
The Delphi community is blessed with a set of controls, called AlphaControls (created by Serge Goncharov from the Ukraine), that provide a very extensive set of controls and dialogs that can be themed by the user, without any additional programming.

I have started this topic to try to get a development going towards a set of controls that is similar to AlphaControls.

To give an idea what AlphaControls can do, the two images in the attachments are a sample of some of the controls, where the skin is the only thing that's changed, and it is changed by the user at run time.

AlphaControls only works in Windows. If you have a Windows system, you can try it out by downloading the demo program: http://www.alphaskins.com/sfiles/stable/askineditor.zip.

The BGRABitmap controls seems the logical way to start this.

Let's hear what you think about this.
Kind regards ;-}
Dick

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3858
  • I like bugs.
Re: What about AlphaControls?
« Reply #1 on: September 30, 2012, 09:39:50 pm »
I have started this topic to try to get a development going towards a set of controls that is similar to AlphaControls.

For an open source library the best way to affect its development is to provide code for it.

Regards,
Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux.

HeDiBo

  • New Member
  • *
  • Posts: 44
What about AlphaControls?
« Reply #2 on: September 30, 2012, 10:45:54 pm »
@Lainz:
The default button is in the new beta demo: http://www.alphaskins.com/sfiles/askineditor.zip
Kind regards ;-}
Dick

HeDiBo

  • New Member
  • *
  • Posts: 44
What about AlphaControls?
« Reply #3 on: September 30, 2012, 10:56:56 pm »
For an open source library the best way to affect its development is to provide code for it.
I wanted to show what could be done, if we would start a controls library, possibly based on BGRABitmap. As an example I showed what the commercial AlphaControls package looks like.

I would like to have that kind of library in an open source form. If you have a look at it, you will understand that such an effort cannot be done by one person. Hence this item. Is there any interest in constructing such a library?

For further development of BGRA controls, it may also function as a source of ideas how to do things.
Kind regards ;-}
Dick

lainz

  • Guest
Re: What about AlphaControls?
« Reply #4 on: September 30, 2012, 11:12:14 pm »
I have started this topic to try to get a development going towards a set of controls that is similar to AlphaControls.

For an open source library the best way to affect its development is to provide code for it.

Regards,
Juha

We already have BGRA Controls, SliceScaling, Custom Drawn Windows 7 Drawer.

As I said before, the way I think is better is Custom Drawn, create a proper drawer with SliceScaling (for BGRA or TBitmap or the library they want).

circular

  • Hero Member
  • *****
  • Posts: 3505
    • Personal webpage
Re: What about AlphaControls?
« Reply #5 on: October 01, 2012, 08:55:11 am »
For an open source library the best way to affect its development is to provide code for it.
I do not really agree, even if as a matter of fact it works like that, because most people don't have much spare time. It is interesting to talk about what we want to do.

Personally, I know things about drawing, blending and so on at a bitmap level. But I do not know anything about how window controls works. So I don't have any clue on how to do real transparency of all components.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 3505
    • Personal webpage
Re: What about AlphaControls?
« Reply #6 on: October 01, 2012, 08:56:59 am »
We already have BGRA Controls, SliceScaling, Custom Drawn Windows 7 Drawer.

As I said before, the way I think is better is Custom Drawn, create a proper drawer with SliceScaling (for BGRA or TBitmap or the library they want).
You are right, we can start with that. But then there are two things to add to custom drawn : progressive transition between states and fully transparent components.
Conscience is the debugger of the mind

Leledumbo

  • Hero Member
  • *****
  • Posts: 8273
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: What about AlphaControls?
« Reply #7 on: October 01, 2012, 09:59:24 am »
I think that's what LazSkin does...

circular

  • Hero Member
  • *****
  • Posts: 3505
    • Personal webpage
Re: What about AlphaControls?
« Reply #8 on: October 01, 2012, 11:09:12 am »
Yep, but LazSkin is commercial, doesn't handle alpha channel, and I'm not sure it handles progressive transitions.
Conscience is the debugger of the mind

lainz

  • Guest
Re: What about AlphaControls?
« Reply #9 on: October 01, 2012, 02:23:12 pm »
We already have BGRA Controls, SliceScaling, Custom Drawn Windows 7 Drawer.

As I said before, the way I think is better is Custom Drawn, create a proper drawer with SliceScaling (for BGRA or TBitmap or the library they want).
You are right, we can start with that. But then there are two things to add to custom drawn : progressive transition between states and fully transparent components.

Progressive transition can be done with Timers, at least I've seen some timers in the Custom Drawn controls, for the 'marquee' in Progress Bars, but is not implemented right now.

Well we know that Fully Transparent are only the Graphic Controls descendants.

BTW if we can copy the rect above the control, then draw to the control and then the control specific drawing we can simulate the alpha, at least for the controls that can't be inherited from Graphic Controls.

I say:
- Panel
-- Button

Copy the button area from panel, draw in button and then draw the button things.

lainz

  • Guest
Re: What about AlphaControls?
« Reply #10 on: October 01, 2012, 02:51:56 pm »
I think we can try first to finish a complete drawer without alpha, just a single Windows theme.

Here you can get the resources in PNG
http://dl.dropbox.com/u/2434440/luna_aero_aerolite.7z

If you want to pick specific .msstyles PNG images you'll need ResourceHacker http://www.angusj.com/resourcehacker/

PD: the msstyles are placed in C:\Windows\Resources\Themes

Then try to fix / improve the Custom Drawn controls, those aren't finished.

Then add the alpha.

It's just an idea.

HeDiBo

  • New Member
  • *
  • Posts: 44
Re: What about AlphaControls?
« Reply #11 on: October 01, 2012, 02:58:46 pm »
But then there are two things to add to custom drawn : progressive transition between states and fully transparent components.
The point of my new topic is that controls may be constructed in any way you want, but as long as they're not subject to a theming vehicle, they're not complete.

AlphaControls starts with a SkinManager and one or more SkinProviders. The SkinManager among others is the repository for the internal skins (you can have external skins too) and the place to define the actual skin in use (there are more than 80 of them). The SkinProvider takes care of the actual drawing. One of its tasks is to take over WndProc to handle both the standard messages and the custom messages for the controls it governs. Furthermore it provides for a lot of drawing functions that the governed controls can call.

With such a setup, the Lazarus "Custom Drawn Controls" do not qualify as a basis for the controls in this library, because they carry the DrawStyle property. That should be part of the SkinManager.

AlphaControls does allow any of its controls to mimic another one. So, each visible control has a property SkinSection. That can be set to the name of another control. Setting the SkinSection of a button to 'TABTOP'  will show the button the way a tab looks if on top of a tabsheet. By setting the SkinSection of a panel to 'CHECKBOX', the panel becomes totally transparent.

According to their website, LazSkins is limited to a Windows version and the last update is from April 2010 (i.e. it is not actively maintained). LazSkins only works by skinning standard controls. That is a simplistic approach to skinning. Satisfactory results can only be obtained with controls that use the skinning capabilities to their advantage. However, AlphaSkins can skin standard controls too. And even then, the LazSkins controls do not look very good. The attachment shows a button in LazSkins and a standard Windows button in AlphaControls, both skinned with the Office 7 skin.

Remember, this is not an advertisement for AlphaControls. Just a mind stimulus by showing what could be done.
« Last Edit: October 01, 2012, 07:47:30 pm by HeDiBo »
Kind regards ;-}
Dick

lainz

  • Guest
Re: What about AlphaControls?
« Reply #12 on: October 01, 2012, 03:04:08 pm »
Well if Custom Drawn donesn't fit I've no idea =)

I've seen that in the newest demo you can switch from default OS theme and Skinned.

HeDiBo

  • New Member
  • *
  • Posts: 44
Re: What about AlphaControls?
« Reply #13 on: October 01, 2012, 03:12:24 pm »
Well if Custom Drawn donesn't fit I've no idea =)
Custom drawn makes the mistake of adding the DrawStyle property. With that it is no longer possible to make it a themed control. You could use Custom Drawn as a basis by inheriting new controls from it and hiding the DrawStyle property in the process. A bit confusing :-\
I've seen that in the newest demo you can switch from default OS theme and Skinned.
Which demo do you mean? AlphaControls?
Kind regards ;-}
Dick

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: What about AlphaControls?
« Reply #14 on: October 01, 2012, 03:18:32 pm »
BTW if we can copy the rect above the control, then draw to the control and then the control specific drawing we can simulate the alpha, at least for the controls that can't be inherited from Graphic Controls.

I say:
- Panel
-- Button

Copy the button area from panel, draw in button and then draw the button things.
I don't know how this works in LCL Canvas, but I tried same trick in fpGUI to simulate alpha in trackbar background, but it worked very slow. For example: Trackbar size 1200 x 50, copy canvas fragment from parent (panel) to trackbar canvas took 4-5 seconds on each repaint :/ .

I think that Lazarus development should more focus on improving drawing quality, especially solve problem with alpha in TCustomControl and implement full alpha in GTK interface (for now, workaround is BGRA Bitmap library for drawing). We are living in an age where the visual effect of interface is very important for users (CSS, HTML5, etc) and Lazarus square controls with one color background are not impressing ;) . Solution for creating modern looking controls supposed to be Custom Drawn Controls, but they inherited from TCustomControl, so again problem with transparency and irregular shapes

 

TinyPortal © 2005-2018