delphicanvaspngjvcl

TabBar whose style can be changed dynamically based on JvTabBar


I have tried many different libraries, but none came. None of them can not be specified without introducing his own style in Painter. I need to be able to quickly and dynamically change the style tab.

In response, I showed my developments.

If someone has similar developments - write them in response.


Solution

  • I decided to upgrade the simplest of them: TJvTabBar of JVCL (latest revision: 13415)

    Here is the result.

    Before (default)

    default style

    After

    mod

    description

    Style sources (All graphics imported from png files with transparency)

    sources

    Easy apply any personal style to any JvTabBar

    var tmp:TStrings;
    begin    
      tmp:=TStringList.Create;
      tmp.Values['TOP_background']:=                ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_background.png';
      tmp.Values['TOP_active_left_side']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_left_side.png';
      tmp.Values['TOP_active_right_side']:=         ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_right_side.png';
      tmp.Values['TOP_active_center']:=             ExtractFileDir(Application.ExeName)+'\skins\default\tabs-TOP_active_center.png';
    
      tmp.Values['BOTTOM_background']:=             ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_background.png';
      tmp.Values['BOTTOM_active_left_side']:=       ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_active_left_side.png';
      tmp.Values['BOTTOM_active_right_side']:=      ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_active_right_side.png';
      tmp.Values['BOTTOM_active_center']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-BOTTOM_active_center.png';
    
      tmp.Values['CLOSEBUTTON_normal']:=            ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_normal.png';
      tmp.Values['CLOSEBUTTON_selected']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_selected.png';
      tmp.Values['CLOSEBUTTON_disabled']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_disabled.png';
      tmp.Values['CLOSEBUTTON_closing']:=           ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_closing.png';
      tmp.Values['CLOSEBUTTON_modified']:=          ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_modified.png';
      tmp.Values['CLOSEBUTTON_closing_modified']:=  ExtractFileDir(Application.ExeName)+'\skins\default\tabs-CLOSEBUTTON_closing_modified.png';
    
      JvTabBar1.StyleImages:=tmp;
    
      tmp.Values['BOTTOM_background']:=             ExtractFileDir(Application.ExeName)+'\skins\default\MYMOD_tabs-BOTTOM_background.png';
    
      JvTabBar2.StyleImages:=tmp;
    

    Main changes

    My JvTabBar.pas mod You can download it here http://pastebin.com/JmbufHy0

    And example source style + JvTabBar.pas http://www.sendspace.com/file/shhuzr