Please implement TsCategoryPanelGroup

Viewing 20 posts - 1 through 20 (of 21 total)
  • Author
    Posts
  • #34771
    Hamilton
    Participant

    Delphi 2009 introduced the cool new TCategoryPanelGroup that I'd love to see in my skinned AC apps. At the moment I've got a hack to do this manually but it looks nowhere near as pretty as it could. Any chance you could look into implementing TsCategoryPanelGroup and TsCategoryPanel controls in the (near) future?

    #46639
    Hamilton
    Participant

    I don't know if this will help but my current workaround uses something like the code below which I call in the form OnCreate event.

    One limitation of my implementation is that themes like Moonlight and Office12Style use the same colour for the highlight font color and the edit font color so the chevron hot tracking is not visible. Other themes like Garnet and Web look pretty good.

    A second limitation is that setting the colors causes the control to flicker. At startup its hard to see but if you change the theme at runtime it quite obvious. I tried wrapping the procedure LockWindowsUpdate but that didn't make any difference (which seems strange to me, I often use LockWindowsUpdate for loading docked forms etc with great results, not sure why this is different).

    procedure TfdPOSDesigner.ResetColour;

    begin

    cpgProperties.Color := sSkinManager1.GetActiveEditColor;

    cpgProperties.GradientBaseColor := sSkinManager1.GetActiveEditColor;

    cpgProperties.GradientColor := sSkinManager1.GetHighLightColor;

    cpgProperties.HeaderFont.Color := sSkinManager1.GetActiveEditFontColor;

    cpgProperties.ChevronColor := sSkinManager1.GetActiveEditFontColor;

    cpgProperties.ChevronHotColor := sSkinManager1.GetHighLightFontColor;

    CategoryPanel1.Color := sSkinManager1.GetGlobalColor;

    CategoryPanel1.Font.Color := sSkinManager1.GetGlobalFontColor;

    CategoryPanel2.Color := sSkinManager1.GetGlobalColor;

    CategoryPanel2.Font.Color := sSkinManager1.GetGlobalFontColor;

    CategoryPanel3.Color := sSkinManager1.GetGlobalColor;

    CategoryPanel3.Font.Color := sSkinManager1.GetGlobalFontColor;

    end;

    #46675
    Support
    Keymaster

    Hello

    When you calls the ResetColour procedure?

    Try it in the sSkinManager.OnAfterChange event.

    #46737
    Hamilton
    Participant

    Hi Serge,

    Thanks for the reply. I have tried ResetColour in a button OnClick event and the flicker still occurs so I'm fairly convinced that it is the way that the control is drawn rather than the time at which the colors are set that causes the flicker.

    I have reported this behaviour in the 'opinions and suggestions' section because I can't call this a bug – I'm trying to use the skin for something that it isn't designed for and thus I'm happy enough to live with the consequences. Having said that, if I could have a wish then what I'd ask for is either:

    1. A TsCategoryPanelGroup component 😛 This would be awesome! I wouldn't need any workaround and it would greatly reduce my risk of 'breaking' the UI if I update the skins and some color has changed.

    OR

    2a. Suggestions on how to implement the chevron hottrack color in a consistent manner across multiple skins (in other words, it is not straight-forward picking an arbitrary color because it won't work from one theme to the next). I've attached two screen grabs that show the TsCategoryPanelGroup themed manually using the code I've supplied previously; you'll notice with the Opus skin that the top chevron has changed color with the mouseover event but this doesn't work for the moonlight skin.

    AND

    2b. Suggestions on how to reduce the flicker using LockWindowsUpdate or some other mechanism.

    Final word: other than the flicker and the hottracking on the chevron this control looks really nice with any of the skins I've tested it with and if I had to I'd live with that.

    #46800
    Support
    Keymaster

    Which SkinSection is used for a title painting here?

    I think you can get a font color from this section and define this color for a painting of chevrons.

    I will think about the new TsCategoryPanelGroup component, but I can't promise a fast implementing.

    #46881
    Hamilton
    Participant

    Thanks Serge I can't ask for more than that 🙂 TCategoryPanelGroup is a cool new component that I can see myself using in a number of different applications and so far it is the only control that I've had to 'skin' manually. Cheers for considering this for future development.

    EDIT: In answer to your question, I'm not using any skin section, the only colors I'm using are those described in the OP. I see what you mean about using a skin section, I could do that its just that I feared that if I used that kind of approach I would end up with a color scheme that was difficult to maintain in an application that allowed the user to select the skin. In other words, if I made the control look nice for one skin then it may not work with others. TBH I didn't spend a lot of time looking into that however so it is somethign to keeep in mind if I have more time. However, at the end of the day it is not good to be setting the colors manually anyway and I'm hesitant to spend a lot of time on something that seems to me like it is developing the 'wrong' thing. I'd be better off writing a skinned component but that is something that would take more time than I have right now.

    #47508
    Beherit
    Participant

    When this component will be support? I tried to skin this component on my own but I have may problems (details on the screenshots, ex. scrool is not skined, RadioButtons/Buttons in TsPanel looks bad).

    [attachment=5453:2012-01-08_210757.png] [attachment=5454:2012-01-08_210815.png]

    #47512
    Beherit
    Participant

    Could someone answer my question?

    #47525
    Support
    Keymaster

    Hi

    This control is not ready still.

    Try to add this him into ThirdParty list as 'ScrollControl'. Scrolls and borders will be skinned in this case.

    #48448
    Hamilton
    Participant

    Hi Serge,

    This remains the one standard VCL control I use regularly that is not skinned; if you're looking for something to do in your spare time this would be a good project!

    I won't bump this thread again.. just couldn't resist doing it once, hope you don't mind too much.

    Regards,

    Hamilton

    #48494
    Support
    Keymaster

    Hello

    I think, you should try theTacFloatPanel component from AlphaExtra package.

    http://www.alphaskins.com/sfiles/acextra.zip

    #48505
    Hamilton
    Participant

    Hi Serge,

    It's exciting to see an ACExtras set – it makes me very keen to see what might be forthcoming in this area 🙂

    I only had time for a quick play with the control and my first impression is that it is a very good 'first stab'. The appearance of the headers and the skin effects mean that this control looks better than the VCL equivalent and some aspects of the operation of the control are better as well. There are a number of issues however, some of which may just be personal taste but I'll bring them all to your attention to assess:

    * There doesn't appear to be any way to change the height of the panels.

    * The chevron indicator in the TsCategoryPanelGroup is not present so there is no indicator that the panel can be collapsed/expanded, at least not in the same way that Windows uses the control and users would likely be familiar with.

    * There are a few too many lines for my taste. Overall I find the TsCategoryPanelGroup to be a little 'cleaner'

    * The scroll bar needs some work. It's too narrow and the indicator (grab bar) is too tall – which makes it harder for some users to click and if the scroll region isn't large then the indicator can end up being taller than the region. With some skins the indicator wasn't visible and with some form resizing it grew to fill the entire scroll bar and wouldn't scroll any more. Personally I'd like to see the scroll bar match the rest of the scroll bars in my app rather than introduce something that looks so different.

    * There are some issues with the focus. I don't know if you really need to make the control able to be focused, but if you do then you need to fix it as currently you can have the focus color on multiple groups at the same time.

    The attached image demonstrates a few of the issues outlined above. The image shows a TsMemo, TacFloatPanel and TCategoryPanel from left to right. Issues you might notice are:

    * Two panels have the orange focus color.

    * The scroll indicator on the TacFloatPanel doesn't indicate position.

    * 3 controls, 3 different types of scroll bar.. Not so nice.

    There may be more but gtg, I look forward to your response.

    Regards,

    Hamilton

    #48809
    guyinwonder
    Participant
    'Support' wrote:

    Hello

    I think, you should try theTacFloatPanel component from AlphaExtra package.

    http://www.alphaskins.com/sfiles/acextra.zip

    how to compile these extra under XE ?

    #48916
    Support
    Keymaster

    Hello

    guyinwonder, this package is updated now and two files for XE2 were added, you can try it again :

    http://www.alphaskin…les/acextra.zip

    Hamilton, sorry for a delay in this topic. ACExtra package was composed by using of components which made by AlphaSkins users.

    I'll check all issues from your previos message, maybe I can change something by myself.

    I have made a demonstration of the TCategoryPanel using, using your code from current topic and published a demo there :

    http://www.alphaskin…tegorypanel.zip

    I hope this program will be useful for someone.

    #48929
    Beherit
    Participant

    This package will be available for C++Builder too? I wan't to user TsCategoryPanelGroup but I programming only in C++ 🙁

    #48941
    Hamilton
    Participant

    Hi Serge,

    Nice demo 🙂

    I wrote a little class to handle the skinning, see code below. It needs a couple of improvements that I'm hoping you can help me with. If we can get it working properly you're welcome to use the code in acExtras if you think it might be useful to other ppl. It shouldn't be too hard to get this working properly and then it will be a useful template for ppl that are trying to get other non-standard controls skinned quickly (like the Jv controls that ppl have asked about recently for instance).

    For anyone new to this thread pls not the code is just setting colors on the control – there is no manual painting and thus no nice gradients, borders etc that you would expect with a fully skinned control but it is sufficient to create a control that doesn't look out-of-place in a skinned app.

    I've attached 2 separate files:

    1. aceCategoryPanelGroup should be added to ACExtra to be registered.

    2. Once aceCategoryPanelGroup is registered, the demo can be run to test the issues below.

    Issues:

    1. The scroll bar isn't skinned and I was wondering if you could tell me if there is a message I can send to make that happen? In other words, I think there should be a windows message or command that can be called in WndProc when WM_PAINT is received to tell the scrollbar to be skinned (but I don't know what that command is). I don't think it will be necessary to register TacCategoryPanelGroup as you have done in the demo with TCategoryPanelGroup but this would fix the problem if there isn't a better implementation.

    2. The chevron hot tracking does not work consistently. I think there may be a message other than WM_PAINT I need to capture but I'm not sure why! To repro, in the demo if you see the TCategoryPanelGroup that is not skinned (the middle one) I've made the chevron red when it is hot tracked. For this component, if you put the mouse over one of the top header and just click repeatedly then you'll notice that the chevron stays red. In contrast, the TacCategoryPanelGroup component loses the hot track color every second time the panel is collapsed then expanded and doesn't come back until it is expanded the next time (just keep clicking you'll see the hot track color comes and goes). I'm not sure why it doesn't just 'work' after the chevron hot color is set. There isn't a message sent for expansion/collapsing a panel so it may be something caused by the way I'm handling WM_PAINT?

    NOTE: The demo you created doesn't have hot tracking so you won't see this in the leftmost CategoryPanelGroup in the new demo because that is included to show the comparison with the old code.

    3. I had to workaround the font colors somewhat to achieve chevron hot tracking. The code I used is compatible with the current skins but may cause the chevron to be poorly coloured in future skins. I don't believe this is going to be much of an issue but I'm mentioning it so ppl are aware of it. At the core of the problem, most skins have the same colour for the HighlightFontColor regardless of whether the control has focus, so in order to show hot tracking I used the ActiveEditColor when the focus color was the same. The panel header uses the HightlightColor in the background so it seems likely that ActiveEditColor will always contrast against that (as indeed all skins do currently), but there is no guarantee because they are not a matched pair of colors.

    Regards,

    Hamilton

    #48997
    Hamilton
    Participant

    Hi,

    The attached file replaces the file of the same name in my previous post.

    * To get the scroll bar skinned you need to go into the SkinManager and add TacCategoryPanelGroup to the ThirdParty list with type ScrollControl. There is probably a nicer way of doing this by registering the control in code, hopefully someone can suggest how this is done.

    * I fixed the issue with the chevron hot color by using either GetHighLightFontColor(False), GetActiveEditFontColor or GetActiveEditColor to contrast GetHighLightFontColor(True) which is the default color for the header and chevron. I checked with all skins and it seems that the color combinations do not clash but ideally you'd want a color that guaranteed a contrast. If anyone has suggestions how this might be more safely implemented I'll look into that, but for now this works.

    So where does that leave us? If you register the aceCategoryPanelGroup control in acExtras or another package and add TacCategoryPanelGroup as a third party skinned control then you should have a control that will be automatically skinned without requiring any code on your forms. This may also form a useful template for other VCL and third party controls that need a skinned appearance without requiring a full implementation (which would have gradients, fancy borders, mouse and other animation effects, etc)

    Regards,

    Hamilton

    #49050
    Support
    Keymaster
    Quote:
    So where does that leave us? If you register the aceCategoryPanelGroup control in acExtras or another package and add TacCategoryPanelGroup as a third party skinned control then you should have a control that will be automatically skinned without requiring any code on your forms. This may also form a useful template for other VCL and third party controls that need a skinned appearance without requiring a full implementation (which would have gradients, fancy borders, mouse and other animation effects, etc)

    Thank you for the help! 🙂

    #59571
    guyinwonder
    Participant
    'Support' wrote:

    Thank you for the help! 🙂

    any chance thats these TsCategorypanelgroup become official on the component ?

    regards

    #59572
    guyinwonder
    Participant
    'Hamilton' wrote:

    Hi,

    The attached file replaces the file of the same name in my previous post.

    * To get the scroll bar skinned you need to go into the SkinManager and add TacCategoryPanelGroup to the ThirdParty list with type ScrollControl. There is probably a nicer way of doing this by registering the control in code, hopefully someone can suggest how this is done.

    * I fixed the issue with the chevron hot color by using either GetHighLightFontColor(False), GetActiveEditFontColor or GetActiveEditColor to contrast GetHighLightFontColor(True) which is the default color for the header and chevron. I checked with all skins and it seems that the color combinations do not clash but ideally you'd want a color that guaranteed a contrast. If anyone has suggestions how this might be more safely implemented I'll look into that, but for now this works.

    So where does that leave us? If you register the aceCategoryPanelGroup control in acExtras or another package and add TacCategoryPanelGroup as a third party skinned control then you should have a control that will be automatically skinned without requiring any code on your forms. This may also form a useful template for other VCL and third party controls that need a skinned appearance without requiring a full implementation (which would have gradients, fancy borders, mouse and other animation effects, etc)

    Regards,

    Hamilton

    I can not download the file .. could you please repost ?

Viewing 20 posts - 1 through 20 (of 21 total)
  • You must be logged in to reply to this topic.