Browse Source

- New repository.
- LoadFromFile / SaveToFile for bcbutton.pas

lainz 11 years ago
commit
4f2ce5b5d5
100 changed files with 28004 additions and 0 deletions
  1. 481 0
      COPYING.LGPL.txt
  2. 24 0
      COPYING.modifiedLGPL.txt
  3. 2 0
      DataType.inc
  4. 406 0
      bcbasectrls.pas
  5. 1624 0
      bcbutton.pas
  6. 31 0
      bcbutton_icon.lrs
  7. 210 0
      bceffect.pas
  8. 776 0
      bcfilters.pas
  9. 239 0
      bcgamegrid.pas
  10. 63 0
      bcgamegrid_icon.lrs
  11. 1008 0
      bcimagebutton.pas
  12. 45 0
      bcimagebutton_icon.lrs
  13. 327 0
      bclabel.pas
  14. 26 0
      bclabel_icon.lrs
  15. 451 0
      bcpanel.pas
  16. 9 0
      bcpanel_icon.lrs
  17. 327 0
      bcrtti.pas
  18. 234 0
      bcstylesform.lfm
  19. 484 0
      bcstylesform.pas
  20. 472 0
      bctools.pas
  21. 821 0
      bctypes.pas
  22. 156 0
      bgracontrols.lpk
  23. 38 0
      bgracontrols.pas
  24. 222 0
      bgraflashprogressbar.pas
  25. 46 0
      bgraflashprogressbar_icon.lrs
  26. 252 0
      bgragraphiccontrol.pas
  27. 51 0
      bgragraphiccontrol_icon.lrs
  28. 135 0
      bgraimagelist.pas
  29. 40 0
      bgraimagelist_icon.lrs
  30. 2646 0
      bgraimagemanipulation.pas
  31. 13 0
      bgraimagemanipulation_icon.lrs
  32. 482 0
      bgraknob.pas
  33. 66 0
      bgraknob_icon.lrs
  34. 394 0
      bgrashape.pas
  35. 47 0
      bgrashape_icon.lrs
  36. 126 0
      bgraspeedbutton.pas
  37. 28 0
      bgraspeedbutton_icon.lrs
  38. 594 0
      bgraspriteanimation.pas
  39. 13 0
      bgraspriteanimation_icon.lrs
  40. 295 0
      bgravirtualscreen.pas
  41. 47 0
      bgravirtualscreen_icon.lrs
  42. 48 0
      readme.txt
  43. 193 0
      styles/facebook-dark.bcbtn
  44. 193 0
      styles/facebook.bcbtn
  45. 107 0
      styles/facebook.bcpnl
  46. 107 0
      styles/flashsetup-grey.bcpnl
  47. 107 0
      styles/flashsetup-red.bcpnl
  48. 203 0
      styles/flashsetup.bcbtn
  49. 193 0
      styles/google-menu.bcbtn
  50. 193 0
      styles/google-search.bcbtn
  51. 107 0
      styles/google.bcpnl
  52. 193 0
      styles/lainz.bcbtn
  53. 203 0
      styles/macosx-lion.bcbtn
  54. 173 0
      styles/mora.bcbtn
  55. 203 0
      styles/office2010.bcbtn
  56. 108 0
      styles/windows7-toolbar.bcpnl
  57. 203 0
      styles/windows7-toolbutton.bcbtn
  58. 203 0
      styles/windows7.bcbtn
  59. 134 0
      test/test_bccontrols/test_bcbutton/bcsample.lpi
  60. 21 0
      test/test_bccontrols/test_bcbutton/bcsample.lpr
  61. 3741 0
      test/test_bccontrols/test_bcbutton/unit1.lfm
  62. 80 0
      test/test_bccontrols/test_bcbutton/unit1.pas
  63. 843 0
      test/test_bccontrols/test_bccontrols/bcsamples.pas
  64. 142 0
      test/test_bccontrols/test_bccontrols/bctest.lpi
  65. 22 0
      test/test_bccontrols/test_bccontrols/bctest.lpr
  66. 1714 0
      test/test_bccontrols/test_bccontrols/ubctest.lfm
  67. 180 0
      test/test_bccontrols/test_bccontrols/ubctest.pas
  68. BIN
      test/test_bccontrols/test_bcfilters/Penguins.jpg
  69. 93 0
      test/test_bccontrols/test_bcfilters/test_bcfilters.lpi
  70. 21 0
      test/test_bccontrols/test_bcfilters/test_bcfilters.lpr
  71. 96 0
      test/test_bccontrols/test_bcfilters/unit1.lfm
  72. 122 0
      test/test_bccontrols/test_bcfilters/unit1.pas
  73. 134 0
      test/test_bccontrols/test_bcgamegrid/test_bcgamegrid.lpi
  74. 21 0
      test/test_bccontrols/test_bcgamegrid/test_bcgamegrid.lpr
  75. 39 0
      test/test_bccontrols/test_bcgamegrid/umain.lfm
  76. 9 0
      test/test_bccontrols/test_bcgamegrid/umain.lrs
  77. 213 0
      test/test_bccontrols/test_bcgamegrid/umain.pas
  78. BIN
      test/test_bccontrols/test_bcimagebutton/sample_1.png
  79. BIN
      test/test_bccontrols/test_bcimagebutton/sample_2.png
  80. BIN
      test/test_bccontrols/test_bcimagebutton/sample_3.png
  81. BIN
      test/test_bccontrols/test_bcimagebutton/sample_4.png
  82. BIN
      test/test_bccontrols/test_bcimagebutton/sample_5.png
  83. 134 0
      test/test_bccontrols/test_bcimagebutton/test.lpi
  84. 21 0
      test/test_bccontrols/test_bcimagebutton/test.lpr
  85. 90 0
      test/test_bccontrols/test_bcimagebutton/unit1.lfm
  86. 48 0
      test/test_bccontrols/test_bcimagebutton/unit1.pas
  87. BIN
      test/test_bccontrols/test_bcxbutton/Desert.jpg
  88. 134 0
      test/test_bccontrols/test_bcxbutton/test_bcxbutton.lpi
  89. 21 0
      test/test_bccontrols/test_bcxbutton/test_bcxbutton.lpr
  90. 75 0
      test/test_bccontrols/test_bcxbutton/utest.lfm
  91. 254 0
      test/test_bccontrols/test_bcxbutton/utest.pas
  92. BIN
      test/test_bgracontrols/test_bgraimagemanipulation/ProjectBGRAImageManipulationDemo.ico
  93. 465 0
      test/test_bgracontrols/test_bgraimagemanipulation/ProjectBGRAImageManipulationDemo.lpi
  94. 19 0
      test/test_bgracontrols/test_bgraimagemanipulation/ProjectBGRAImageManipulationDemo.lpr
  95. 2045 0
      test/test_bgracontrols/test_bgraimagemanipulation/unitbgraimagemanipulationdemo.lfm
  96. 218 0
      test/test_bgracontrols/test_bgraimagemanipulation/unitbgraimagemanipulationdemo.pas
  97. 93 0
      test/test_extra/effect_fading/fading.lpi
  98. 21 0
      test/test_extra/effect_fading/fading.lpr
  99. 104 0
      test/test_extra/effect_fading/unit1.lfm
  100. 149 0
      test/test_extra/effect_fading/unit1.pas

+ 481 - 0
COPYING.LGPL.txt

@@ -0,0 +1,481 @@
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!

+ 24 - 0
COPYING.modifiedLGPL.txt

@@ -0,0 +1,24 @@
+This is the file COPYING.modifiedLGPL, it applies to all units of the
+"BGRA Controls" library.
+
+These files are distributed under the Library GNU General Public License
+(see the file COPYING.LGPL) with the following modification:
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent modules,
+and to copy and distribute the resulting executable under terms of your choice,
+provided that you also meet, for each linked independent module, the terms
+and conditions of the license of that module. An independent module is a
+module which is not derived from or based on this library. If you modify this
+library, you may extend this exception to your version of the library, but
+you are not obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+
+
+If you didn't receive a copy of the file COPYING.LGPL, contact:
+      Free Software Foundation, Inc.,
+      675 Mass Ave
+      Cambridge, MA  02139
+      USA
+

+ 2 - 0
DataType.inc

@@ -0,0 +1,2 @@
+type
+  TCoord = packed record
    x1 : LongInt;
    y1 : LongInt;
    x2 : LongInt;
    y2 : LongInt;
  end;

  TRatio = packed record
    Horizontal : LongInt;
    Vertical : LongInt;
  end;

  TCardinalDirection = (NORTH, SOUTH, WEST, EAST);
  TDirection = set of TCardinalDirection;

  TSizeLimits = packed record
    minWidth  : LongInt;
    maxWidth  : LongInt;
    minHeight : LongInt;
    maxHeight : LongInt;
  end;


+ 406 - 0
bcbasectrls.pas

@@ -0,0 +1,406 @@
+{ Base framework classes
+
+  Copyright (C) 2012 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+unit BCBaseCtrls;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Controls, BGRABitmap, BGRABitmapTypes;
+
+type
+
+  TOnBCPropertyChange = procedure(ASender: TObject; AData: PtrInt) of object;
+
+  { TBCProperty
+    Base BC Property with OnChange event support
+  }
+
+  TBCProperty = class(TPersistent)
+  private
+    FOnChange: TOnBCPropertyChange;
+  protected
+    FControl: TControl;
+    procedure Change(AData: PtrInt = 0); virtual;
+  public
+    constructor Create(AControl: TControl); virtual;
+  public
+    property Control: TControl read FControl;
+    property OnChange: TOnBCPropertyChange read FOnChange write FOnChange;
+  end;
+
+  { TBGRABitmapEx
+    Some BGRABitmap descendant which can store custom data and has NeedRender flag
+  }
+
+  TBGRABitmapEx = class(TBGRABitmap)
+  private
+    FCustomData: PtrInt;
+    FNeedRender: Boolean;
+  protected
+    procedure Init; override;
+  public
+    property NeedRender: Boolean read FNeedRender write FNeedRender;
+    property CustomData: PtrInt read FCustomData write FCustomData;
+  end;
+
+  { TBCGraphicControl
+    BC graphic control with some basic functionality like begin/end update and
+    debug functions
+  }
+
+  TBCGraphicControl = class(TGraphicControl)
+  private
+    {$IFDEF DEBUG}
+    FPaintCount: Integer;
+    {$ENDIF}
+    FUpdateCount: Integer;
+  protected
+    procedure DoOnResize; override;
+  protected
+    {$IFDEF DEBUG}
+    function GetDebugText: String; virtual;
+    {$ENDIF}
+    procedure Paint; override; // do not override in descendants!
+    // All descendants should use DrawControl method instead of Paint.
+    // DrawControl is not called between BeginUpdate and EndUpdate
+    procedure DrawControl; virtual;
+    // This method is called when control should be rendered (when some
+    // general action occur which change "body" e.g. resize)
+    procedure RenderControl; virtual;
+  public
+    constructor Create(AOwner: TComponent); override;
+    // This disable DrawControl method
+    procedure BeginUpdate; virtual;
+    // This enable DrawControl method
+    procedure EndUpdate; virtual;
+    // Called on EndUpdate if FUpdateCount is 0
+    procedure UpdateControl; virtual;
+    // Check if BeginUpdate was called
+    function IsUpdating: Boolean;
+  end;
+
+  { TBCStyleDummyProperty
+    This is only dummy property type for access to style editor from
+    object inspector
+  }
+
+  TBCStyleDummyProperty = class(TBCProperty)
+
+  end;
+
+  { TBCStyleGraphicControl
+    All descendants of this class have support for saving and loading styles and
+    access to style editor from object inspector or component context menu
+  }
+
+  TBCStyleGraphicControl = class(TBCGraphicControl)
+  private
+    FAssignStyle: TBCStyleDummyProperty;
+  protected
+    function GetStyleExtension: String; virtual; abstract;
+    // Dummy property for access to style editor dialog
+    property AssignStyle: TBCStyleDummyProperty read FAssignStyle;
+  public
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+    property StyleExtension: String read GetStyleExtension;
+  end;
+
+  { TBCCustomControl
+    BC custom control with some basic functionality like begin/end update and
+    debug functions
+  }
+
+  TBCCustomControl = class(TCustomControl)
+  private
+    {$IFDEF DEBUG}
+    FPaintCount: Integer;
+    {$ENDIF}
+    FUpdateCount: Integer;
+  protected
+    procedure DoOnResize; override;
+  protected
+    {$IFDEF DEBUG}
+    function GetDebugText: String; virtual;
+    {$ENDIF}
+    procedure Paint; override; // do not override in descendants!
+    // All descendants should use DrawControl method instead of Paint.
+    // DrawControl is not called between BeginUpdate and EndUpdate
+    procedure DrawControl; virtual;
+    // This method is called when control should be rendered (when some
+    // general action occur which change "body" e.g. resize)
+    procedure RenderControl; virtual;
+  public
+    constructor Create(AOwner: TComponent); override;
+    // This disable DrawControl method
+    procedure BeginUpdate; virtual;
+    // This enable DrawControl method
+    procedure EndUpdate; virtual;
+    // Called on EndUpdate if FUpdateCount is 0
+    procedure UpdateControl; virtual;
+    // Check if BeginUpdate was called
+    function IsUpdating: Boolean;
+  end;
+
+  { TBCStyleCustomControl
+    All descendants of this class have support for saving and loading styles and
+    access to style editor from object inspector or component context menu
+  }
+
+  TBCStyleCustomControl = class(TBCCustomControl)
+  private
+    FAssignStyle: TBCStyleDummyProperty;
+  protected
+    function GetStyleExtension: String; virtual; abstract;
+    // Dummy property for access to style editor dialog
+    property AssignStyle: TBCStyleDummyProperty read FAssignStyle;
+  public
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+    property StyleExtension: String read GetStyleExtension;
+  end;
+
+procedure Register;
+
+implementation
+
+{$IFDEF DEBUG} uses Graphics; {$ENDIF}
+
+procedure Register;
+begin
+  RegisterNoIcon([TBCCustomControl]);
+end;
+
+{ TBCStyleCustomControl }
+
+constructor TBCStyleCustomControl.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+
+  FAssignStyle := TBCStyleDummyProperty.Create(Self);
+end;
+
+destructor TBCStyleCustomControl.Destroy;
+begin
+  FAssignStyle.Free;
+  inherited Destroy;
+end;
+
+{ TBCStyleGraphicControl }
+
+constructor TBCStyleGraphicControl.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+
+  FAssignStyle := TBCStyleDummyProperty.Create(Self);
+end;
+
+destructor TBCStyleGraphicControl.Destroy;
+begin
+  FAssignStyle.Free;
+  inherited Destroy;
+end;
+
+{ TBCCustomControl }
+
+procedure TBCCustomControl.DoOnResize;
+begin
+  inherited DoOnResize;
+  RenderControl;
+end;
+
+{$IFDEF DEBUG}
+function TBCCustomControl.GetDebugText: String;
+begin
+  Result := EmptyStr;
+end;
+{$ENDIF}
+
+procedure TBCCustomControl.Paint;
+begin
+  if (csCreating in FControlState) or IsUpdating then
+    Exit;
+
+  DrawControl;
+  {$IFDEF DEBUG}
+  FPaintCount += 1;
+  Canvas.Brush.Style := bsSolid;
+  Canvas.Brush.Color := clBlack;
+  Canvas.Font.Color := clWhite;
+  Canvas.TextOut(1,1,'P: '+IntToStr(FPaintCount)+' '+GetDebugText);
+  {$ENDIF}
+  inherited Paint;
+end;
+
+procedure TBCCustomControl.DrawControl;
+begin
+
+end;
+
+procedure TBCCustomControl.RenderControl;
+begin
+
+end;
+
+constructor TBCCustomControl.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  {$IFDEF DEBUG}
+  FPaintCount := 0;
+  {$ENDIF}
+end;
+
+procedure TBCCustomControl.BeginUpdate;
+begin
+  FUpdateCount += 1;
+end;
+
+procedure TBCCustomControl.EndUpdate;
+begin
+  if FUpdateCount > 0 then
+  begin
+    FUpdateCount -= 1;
+    if FUpdateCount=0 then
+      UpdateControl;
+  end;
+end;
+
+procedure TBCCustomControl.UpdateControl;
+begin
+  Self.Invalidate;
+end;
+
+function TBCCustomControl.IsUpdating: Boolean;
+begin
+  Result := FUpdateCount>0;
+end;
+
+{ TBCProperty }
+
+procedure TBCProperty.Change(AData: PtrInt);
+begin
+  if Assigned(FOnChange) then
+    FOnChange(Self,AData);
+end;
+
+constructor TBCProperty.Create(AControl: TControl);
+begin
+  FControl := AControl;
+
+  inherited Create;
+end;
+
+{ TBCGraphicControl }
+
+procedure TBCGraphicControl.DoOnResize;
+begin
+  inherited DoOnResize;
+  RenderControl;
+end;
+
+{$IFDEF DEBUG}
+function TBCGraphicControl.GetDebugText: String;
+begin
+  Result := EmptyStr;
+end;
+{$ENDIF}
+
+procedure TBCGraphicControl.Paint;
+begin
+  //inherited Paint;
+  if (csCreating in FControlState) or IsUpdating then
+    Exit;
+  DrawControl;
+  {$IFDEF DEBUG}
+  FPaintCount += 1;
+  Canvas.Brush.Style := bsSolid;
+  Canvas.Brush.Color := clBlack;
+  Canvas.Font.Color := clWhite;
+  Canvas.TextOut(1,1,'P: '+IntToStr(FPaintCount)+' '+GetDebugText);
+  {$ENDIF}
+end;
+
+procedure TBCGraphicControl.DrawControl;
+begin
+
+end;
+
+procedure TBCGraphicControl.RenderControl;
+begin
+
+end;
+
+constructor TBCGraphicControl.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  {$IFDEF DEBUG}
+  FPaintCount := 0;
+  {$ENDIF}
+end;
+
+procedure TBCGraphicControl.BeginUpdate;
+begin
+  FUpdateCount += 1;
+end;
+
+procedure TBCGraphicControl.EndUpdate;
+begin
+  if FUpdateCount > 0 then
+  begin
+    FUpdateCount -= 1;
+    if FUpdateCount=0 then
+      UpdateControl;
+  end;
+end;
+
+procedure TBCGraphicControl.UpdateControl;
+begin
+  Invalidate;
+end;
+
+function TBCGraphicControl.IsUpdating: Boolean;
+begin
+  Result := FUpdateCount>0;
+end;
+
+{ TBGRABitmapEx }
+
+procedure TBGRABitmapEx.Init;
+begin
+  inherited Init;
+  FNeedRender := True;
+  FCustomData := 0;
+end;
+
+end.
+

+ 1624 - 0
bcbutton.pas

@@ -0,0 +1,1624 @@
+{ Customizable component which using BGRABitmap for drawing. Control mostly rendered
+  using framework.
+
+  Functionality:
+  - Gradients
+  - Double gradients
+  - Rounding
+  - Drop down list
+  - Glyph
+  - States (normal, hover, clicked)
+  - Caption with shadow
+  - Full alpha and antialias support
+
+  Copyright (C) 2012 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+unit BCButton;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, LResources, Controls, Dialogs, BGRABitmap, BGRABitmapTypes,
+  ActnList, ImgList, Menus, // MORA
+  Buttons, Graphics, LCLType, types, BCTypes, Forms, BCBasectrls;
+
+{off $DEFINE DEBUG}
+
+type
+
+  TBCButtonState = class;
+  TBCButtonStyle = (bbtButton, bbtDropDown);
+  TOnAfterRenderBCButton = procedure(Sender: TObject; const ABGRA: TBGRABitmap;
+    AState: TBCButtonState; ARect: TRect) of object;
+  TBCButtonPropertyData = (pdNone, pdUpdateSize);
+
+  // MORA: DropDown styles
+  TBCButtonDropDownStyle = (
+    bdsSeparate,     // DropDown is a separate button (default)
+    bdsCommon        // DropDown is same as main button
+    ); //
+  TBCButtonDropDownPosition = (
+    bdpLeft,         // default
+    bdpBottom);
+
+  { TBCButtonState }
+
+  TBCButtonState = class(TBCProperty)
+  private
+    FBackground: TBCBackground;
+    FBorder: TBCBorder;
+    FFontEx: TBCFont;
+    procedure OnChangeFont(Sender: TObject; AData: PtrInt);
+    procedure OnChangeChildProperty(Sender: TObject; AData: PtrInt);
+    procedure SetBackground(AValue: TBCBackground);
+    procedure SetBorder(AValue: TBCBorder);
+    procedure SetFontEx(const AValue: TBCFont);
+  public
+    constructor Create(AControl: TControl); override;
+    destructor Destroy; override;
+
+    procedure Assign(Source: TPersistent); override;
+  published
+    property Background: TBCBackground read FBackground write SetBackground;
+    property Border: TBCBorder read FBorder write SetBorder;
+    property FontEx: TBCFont read FFontEx write SetFontEx;
+  end;
+
+  { TCustomBCButton }
+
+  TCustomBCButton = class(TBCStyleGraphicControl)
+  private
+    { Private declarations }
+    {$IFDEF DEBUG}
+    FRenderCount: Integer;
+    {$ENDIF}
+    FDropDownArrowSize: Integer;
+    FDropDownWidth: Integer;
+    FFlipArrow: boolean;
+    FActiveButt: TBCButtonStyle;
+    FBGRANormal, FBGRAHover, FBGRAClick: TBGRABitmapEx;
+    FRounding: TBCRounding;
+    FRoundingDropDown: TBCRounding;
+    FStateClicked: TBCButtonState;
+    FStateHover: TBCButtonState;
+    FStateNormal: TBCButtonState;
+    FDown: boolean;
+    FGlyph: TBitmap;
+    FGlyphMargin: integer;
+    FButtonState: TBCMouseState;
+    FDownButtonState: TBCMouseState;
+    FOnAfterRenderBCButton: TOnAfterRenderBCButton;
+    FOnButtonClick: TNotifyEvent;
+    FStaticButton: boolean;
+    FStyle: TBCButtonStyle;
+    FGlobalOpacity: byte;
+    FTextApplyGlobalOpacity: boolean;
+    AutoSizeExtraY: integer;
+    AutoSizeExtraX: integer;
+    // MORA
+    FClickOffest: Boolean;
+    FDropDownArrow: Boolean;
+    FDropDownMenu: TPopupMenu;
+    FDropDownMenuVisible: Boolean;
+    FDropDownPosition: TBCButtonDropDownPosition;
+    FDropDownStyle: TBCButtonDropDownStyle;
+    FImageChangeLink: TChangeLink;
+    FImageIndex: Integer;
+    FImages: TCustomImageList;
+    FSaveDropDownClosed: TNotifyEvent;
+    FShowCaption: Boolean;
+    procedure AssignDefaultStyle;
+    procedure CalculateGlyphSize(var NeededWidth, NeededHeight: integer);
+    procedure ConvertToGrayScale(ABGRA: TBGRABitmap);
+    procedure DropDownClosed(Sender: TObject);
+    procedure RenderAll(ANow: Boolean = False);
+    function GetButtonRect: TRect;
+    function GetDropDownWidth(AFull: boolean = True): integer;
+    function GetDropDownRect(AFull: Boolean = True): TRect;
+    procedure SeTBCButtonStateClicked(const AValue: TBCButtonState);
+    procedure SeTBCButtonStateHover(const AValue: TBCButtonState);
+    procedure SeTBCButtonStateNormal(const AValue: TBCButtonState);
+    procedure SetClickOffset(AValue: Boolean);
+    procedure SetDown(AValue: boolean);
+    procedure SetDropDownArrow(AValue: Boolean);
+    procedure SetDropDownArrowSize(AValue: Integer);
+    procedure SetDropDownPosition(AValue: TBCButtonDropDownPosition);
+    procedure SetDropDownWidth(AValue: Integer);
+    procedure SetFlipArrow(AValue: boolean);
+    procedure SetGlyph(const AValue: TBitmap);
+    procedure SetGlyphMargin(const AValue: integer);
+    procedure SetImageIndex(AValue: Integer);
+    procedure SetImages(AValue: TCustomImageList);
+    procedure SetRounding(AValue: TBCRounding);
+    procedure SetRoundingDropDown(AValue: TBCRounding);
+    procedure SetShowCaption(AValue: Boolean);
+    procedure SetStaticButton(const AValue: boolean);
+    procedure SetStyle(const AValue: TBCButtonStyle);
+    procedure SetGlobalOpacity(const AValue: byte);
+    procedure SetTextApplyGlobalOpacity(const AValue: boolean);
+    procedure UpdateSize;
+    procedure OnChangeGlyph(Sender: TObject);
+    procedure OnChangeState(Sender: TObject; AData: PtrInt);
+    procedure ImageListChange(ASender: TObject);
+  protected
+    { Protected declarations }
+    procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
+      WithThemeSpace: boolean); override;
+    class function GetControlClassDefaultSize: TSize; override;
+    procedure Click; override;
+    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
+      X, Y: integer); override;
+    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: integer); override;
+    procedure MouseEnter; override;
+    procedure MouseLeave; override;
+    procedure MouseMove(Shift: TShiftState; X, Y: integer); override;
+    procedure SetEnabled(Value: boolean); override;
+    procedure TextChanged; override;
+  protected
+    // MORA
+    procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
+    function GetActionLinkClass: TControlActionLinkClass; override;
+    procedure Notification(AComponent: TComponent; Operation: TOperation);
+      override;
+    procedure Render(ABGRA: TBGRABitmapEx; AState: TBCButtonState); virtual;
+    procedure RenderState(ABGRA: TBGRABitmapEx; AState: TBCButtonState;
+      const ARect: TRect; ARounding: TBCRounding); virtual;
+    property ClickOffset: Boolean read FClickOffest write SetClickOffset default False;
+    property DropDownArrow: Boolean read FDropDownArrow write SetDropDownArrow default False;
+    property DropDownMenu: TPopupMenu read FDropDownMenu write FDropDownMenu;
+    property DropDownStyle: TBCButtonDropDownStyle read FDropDownStyle write FDropDownStyle default bdsSeparate;
+    property DropDownPosition: TBCButtonDropDownPosition read FDropDownPosition write SetDropDownPosition default bdpLeft;
+    property Images: TCustomImageList read FImages write SetImages;
+    property ImageIndex: Integer read FImageIndex write SetImageIndex default -1;
+    property ShowCaption: Boolean read FShowCaption write SetShowCaption default True;
+  protected
+    {$IFDEF DEBUG}
+    function GetDebugText: String; override;
+    {$ENDIF}
+    function GetStyleExtension: String; override;
+    procedure DrawControl; override;
+    procedure RenderControl; override;
+  protected
+    property AutoSizeExtraVertical: integer read AutoSizeExtraY;
+    property AutoSizeExtraHorizontal: integer read AutoSizeExtraX;
+    property StateNormal: TBCButtonState read FStateNormal write SeTBCButtonStateNormal;
+    property StateHover: TBCButtonState read FStateHover write SeTBCButtonStateHover;
+    property StateClicked: TBCButtonState read FStateClicked write SeTBCButtonStateClicked;
+    property Down: boolean read FDown write SetDown default False;
+    property DropDownWidth: Integer read FDropDownWidth write SetDropDownWidth;
+    property DropDownArrowSize: Integer read FDropDownArrowSize write SetDropDownArrowSize;
+    property FlipArrow: boolean read FFlipArrow write SetFlipArrow default False;
+    property Glyph: TBitmap read FGlyph write SetGlyph;
+    property GlyphMargin: integer read FGlyphMargin write SetGlyphMargin default 5;
+    property Style: TBCButtonStyle read FStyle write SetStyle default bbtButton;
+    property StaticButton: boolean
+      read FStaticButton write SetStaticButton default False;
+    property GlobalOpacity: byte read FGlobalOpacity write SetGlobalOpacity;
+    property Rounding: TBCRounding read FRounding write SetRounding;
+    property RoundingDropDown: TBCRounding read FRoundingDropDown write SetRoundingDropDown;
+    property TextApplyGlobalOpacity: boolean
+      read FTextApplyGlobalOpacity write SetTextApplyGlobalOpacity;
+    property OnAfterRenderBCButton: TOnAfterRenderBCButton
+      read FOnAfterRenderBCButton write FOnAfterRenderBCButton;
+    property OnButtonClick: TNotifyEvent read FOnButtonClick write FOnButtonClick;
+  public
+    { Public declarations }
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+    procedure Assign(Source: TPersistent); override;
+    procedure SetSizeVariables(newDropDownWidth, newDropDownArrowSize,
+      newAutoSizeExtraVertical, newAutoSizeExtraHorizontal: integer);
+    procedure UpdateControl; override; // Called by EndUpdate
+  public
+    { Streaming }
+    procedure SaveToFile(AFileName: string);
+    procedure LoadFromFile(AFileName: string);
+    procedure OnFindClass(Reader: TReader; const AClassName: string;
+      var ComponentClass: TComponentClass);
+  end;
+
+  TBCButton = class(TCustomBCButton)
+  published
+    property Action;
+    property Align;
+    property Anchors;
+    property AssignStyle;
+    property AutoSize;
+    property StateClicked;
+    property StateHover;
+    property StateNormal;
+    property BorderSpacing;
+    property Caption;
+    property Color;
+    property Down;
+    property DropDownWidth;
+    property DropDownArrowSize;
+    property Enabled;
+    property FlipArrow;
+    property GlobalOpacity;
+    property Glyph;
+    property GlyphMargin;
+    property Hint;
+    property OnAfterRenderBCButton;
+    property OnButtonClick;
+    property OnClick;
+    property OnDblClick;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    property ParentColor;
+    property PopupMenu;
+    property Rounding;
+    property RoundingDropDown;
+    property StaticButton;
+    property ShowHint;
+    property Style;
+    property TextApplyGlobalOpacity;
+    property Visible;
+    // MORA
+    property ClickOffset;
+    property DropDownArrow;
+    property DropDownMenu;
+    property DropDownStyle;
+    property DropDownPosition;
+    property Images;
+    property ImageIndex;
+    property ShowCaption;
+  end;
+
+  { TBCButtonActionLink }
+
+  TBCButtonActionLink = class(TControlActionLink)
+  protected
+    procedure AssignClient(AClient: TObject); override;
+    procedure SetChecked(Value: Boolean); override;
+    procedure SetImageIndex(Value: Integer); override;
+  public
+    function IsCheckedLinked: Boolean; override;
+    function IsImageIndexLinked: Boolean; override;
+  end;
+
+procedure Register;
+
+implementation
+
+uses LCLIntf, Math, LCLProc, BGRAPolygon, BCTools, SysUtils, PropEdits, GraphPropEdits;
+
+type
+  TBCButtonImageIndexPropertyEditor = class(TImageIndexPropertyEditor)
+  protected
+    function GetImageList: TCustomImageList; override;
+  end;
+
+function TBCButtonImageIndexPropertyEditor.GetImageList: TCustomImageList;
+var
+  Component: TPersistent;
+begin
+  Component := GetComponent(0);
+  if Component is TCustomBCButton then
+    Result := TCustomBCButton(Component).Images
+  else
+    Result := nil
+end;
+
+procedure Register;
+begin
+  {$I bcbutton_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBCButton]);
+  RegisterPropertyEditor(TypeInfo(Integer), TBCButton,
+    'ImageIndex', TBCButtonImageIndexPropertyEditor);
+end;
+
+{ TBCButtonActionLink }
+
+procedure TBCButtonActionLink.AssignClient(AClient: TObject);
+begin
+  inherited AssignClient(AClient);
+  FClient := AClient as TCustomBCButton;
+end;
+
+procedure TBCButtonActionLink.SetChecked(Value: Boolean);
+begin
+  if IsCheckedLinked then
+    TCustomBCButton(FClient).Down := Value;
+end;
+
+procedure TBCButtonActionLink.SetImageIndex(Value: Integer);
+begin
+  if IsImageIndexLinked then
+    TCustomBCButton(FClient).ImageIndex := Value;
+end;
+
+function TBCButtonActionLink.IsCheckedLinked: Boolean;
+begin
+  Result := inherited IsCheckedLinked and
+    (TCustomBCButton(FClient).Down = (Action as TCustomAction).Checked);
+end;
+
+function TBCButtonActionLink.IsImageIndexLinked: Boolean;
+begin
+  Result := inherited IsImageIndexLinked and
+    (TCustomBCButton(FClient).ImageIndex = (Action as TCustomAction).ImageIndex);
+end;
+
+{ TBCButtonState }
+
+procedure TBCButtonState.SetFontEx(const AValue: TBCFont);
+begin
+  if FFontEx = AValue then
+    exit;
+  FFontEx.Assign(AValue);
+
+  Change;
+end;
+
+procedure TBCButtonState.OnChangeFont(Sender: TObject; AData: PtrInt);
+begin
+  Change(PtrInt(pdUpdateSize));
+end;
+
+procedure TBCButtonState.OnChangeChildProperty(Sender: TObject; AData: PtrInt);
+begin
+  Change(AData);
+end;
+
+procedure TBCButtonState.SetBackground(AValue: TBCBackground);
+begin
+  if FBackground = AValue then Exit;
+  FBackground.Assign(AValue);
+
+  Change;
+end;
+
+procedure TBCButtonState.SetBorder(AValue: TBCBorder);
+begin
+  if FBorder = AValue then Exit;
+  FBorder.Assign(AValue);
+
+  Change;
+end;
+
+constructor TBCButtonState.Create(AControl: TControl);
+begin
+  FBackground := TBCBackground.Create(AControl);
+  FBorder     := TBCBorder.Create(AControl);
+  FFontEx     := TBCFont.Create(AControl);
+
+  FBackground.OnChange := @OnChangeChildProperty;
+  FBorder.OnChange     := @OnChangeChildProperty;
+  FFontEx.OnChange     := @OnChangeFont;
+
+  inherited Create(AControl);
+end;
+
+destructor TBCButtonState.Destroy;
+begin
+  FBackground.Free;
+  FBorder.Free;
+  FFontEx.Free;
+  inherited Destroy;
+end;
+
+procedure TBCButtonState.Assign(Source: TPersistent);
+begin
+  if Source is TBCButtonState then
+  begin
+    FBackground.Assign(TBCButtonState(Source).FBackground);
+    FBorder.Assign(TBCButtonState(Source).FBorder);
+    FFontEx.Assign(TBCButtonState(Source).FFontEx);
+
+    Change(PtrInt(pdUpdateSize));
+  end
+  else
+    inherited Assign(Source);
+end;
+
+{ TCustomBCButton }
+
+procedure TCustomBCButton.AssignDefaultStyle;
+begin
+  FRounding.RoundX := 12;
+  FRounding.RoundY := 12;
+  // Normal
+  with StateNormal do
+  begin
+    Border.Style         := bboNone;
+    FontEx.Color         := RGBToColor(230,230,255);
+    FontEx.Style         := [fsBold];
+    FontEx.Shadow        := True;
+    FontEx.ShadowOffsetX := 1;
+    FontEx.ShadowOffsetY := 1;
+    FontEx.ShadowRadius  := 2;
+    Background.Gradient1EndPercent := 60;
+    Background.Style               := bbsGradient;
+    // Gradient1
+    with Background.Gradient1 do
+    begin
+      EndColor   := RGBToColor(64,64,128);
+      StartColor := RGBToColor(0,0,64);
+    end;
+    // Gradient2
+    with Background.Gradient2 do
+    begin
+      EndColor       := RGBToColor(0,0,64);
+      GradientType   := gtRadial;
+      Point1XPercent := 50;
+      Point1YPercent := 100;
+      Point2YPercent := 0;
+      StartColor     := RGBToColor(64,64,128);
+    end;
+  end;
+  // Hover
+  with StateHover do
+  begin
+    Border.Style         := bboNone;
+    FontEx.Color         := RGBToColor(255,255,255);
+    FontEx.Style         := [fsBold];
+    FontEx.Shadow        := True;
+    FontEx.ShadowOffsetX := 1;
+    FontEx.ShadowOffsetY := 1;
+    FontEx.ShadowRadius  := 2;
+    Background.Gradient1EndPercent := 100;
+    Background.Style               := bbsGradient;
+    // Gradient1
+    with Background.Gradient1 do
+    begin
+      EndColor       := RGBToColor(0,64,128);
+      GradientType   := gtRadial;
+      Point1XPercent := 50;
+      Point1YPercent := 100;
+      Point2YPercent := 0;
+      StartColor     := RGBToColor(0,128,255);
+    end;
+  end;
+  // Clicked
+  with StateClicked do
+  begin
+    Border.Style         := bboNone;
+    FontEx.Color         := RGBToColor(230,230,255);
+    FontEx.Style         := [fsBold];
+    FontEx.Shadow        := True;
+    FontEx.ShadowOffsetX := 1;
+    FontEx.ShadowOffsetY := 1;
+    FontEx.ShadowRadius  := 2;
+    Background.Gradient1EndPercent := 100;
+    Background.Style               := bbsGradient;
+    // Gradient1
+    with Background.Gradient1 do
+    begin
+      EndColor       := RGBToColor(0,0,64);
+      GradientType   := gtRadial;
+      Point1XPercent := 50;
+      Point1YPercent := 100;
+      Point2YPercent := 0;
+      StartColor     := RGBToColor(0,64,128);
+    end;
+  end;
+end;
+
+procedure TCustomBCButton.CalculateGlyphSize(var NeededWidth, NeededHeight: integer);
+begin
+  if Assigned(FGlyph) and not FGlyph.Empty then
+  begin
+    NeededWidth := FGlyph.Width;
+    NeededHeight := FGlyph.Height;
+  end else
+  if Assigned(FImages) then
+  begin
+    NeededWidth := FImages.Width;
+    NeededHeight := FImages.Height;
+  end else
+  begin
+    NeededHeight := 0;
+    NeededWidth := 0;
+  end;
+end;
+
+procedure TCustomBCButton.ConvertToGrayScale(ABGRA: TBGRABitmap);
+var
+  bounds: TRect;
+  px: PBGRAPixel;
+  xb, yb: integer;
+begin
+  bounds := ABGRA.GetImageBounds;
+  if (bounds.Right <= bounds.Left) or (bounds.Bottom <= Bounds.Top) then
+    exit;
+
+  for yb := bounds.Top to bounds.bottom - 1 do
+  begin
+    px := ABGRA.scanline[yb] + bounds.left;
+    for xb := bounds.left to bounds.right - 1 do
+    begin
+      px^ := BGRAToGrayscale(px^);
+      Inc(px);
+    end;
+  end;
+  ABGRA.InvalidateBitmap;
+end;
+
+procedure TCustomBCButton.RenderAll(ANow: Boolean);
+begin
+  if (csCreating in FControlState) or IsUpdating or (FBGRANormal=nil) then
+    Exit;
+
+  if ANow then
+  begin
+    Render(FBGRANormal, FStateNormal);
+    Render(FBGRAHover, FStateHover);
+    Render(FBGRAClick, FStateClicked);
+  end else
+  begin
+    FBGRANormal.NeedRender := True;
+    FBGRAHover.NeedRender := True;
+    FBGRAClick.NeedRender := True;
+  end;
+end;
+
+function TCustomBCButton.GetButtonRect: TRect;
+begin
+  Result := GetClientRect;
+  if FStyle=bbtDropDown then
+    case FDropDownPosition of
+      bdpBottom:
+        Dec(Result.Bottom, GetDropDownWidth(False));
+    else
+      // bdpLeft:
+      Dec(Result.Right, GetDropDownWidth(False));
+    end;
+end;
+
+function TCustomBCButton.GetDropDownWidth(AFull: boolean): integer;
+begin
+  Result := FDropDownWidth + (ifthen(AFull, 2, 1) * FStateNormal.FBorder.Width);
+end;
+
+function TCustomBCButton.GetDropDownRect(AFull: Boolean): TRect;
+begin
+  Result := GetClientRect;
+  case FDropDownPosition of
+    bdpBottom:
+      Result.Top := Result.Bottom - GetDropDownWidth(AFull);
+  else
+    // bdpLeft:
+    Result.Left := Result.Right - GetDropDownWidth(AFull);
+  end;
+end;
+
+procedure TCustomBCButton.Render(ABGRA: TBGRABitmapEx;
+  AState: TBCButtonState);
+var
+  r,r_a: TRect;
+
+  { TODO: Create customizable glyph position by creating TBCGlyph type
+          and method in BCTools which render it }
+  procedure _RenderGlyph;
+  var
+    w, h, t, l: Integer;
+    g: TBGRABitmap;
+    bitmap: TBitmap;
+  begin
+    // MORA: getting image to draw
+    if Assigned(FGlyph) and not FGlyph.Empty then
+      bitmap := FGlyph
+    else
+    if Assigned(FImages) and (FImageIndex > -1) and (FImageIndex < FImages.Count) then
+    begin
+      bitmap := TBitmap.Create;
+      FImages.GetBitmap(FImageIndex, bitmap)
+    end else
+      bitmap := nil;
+
+    if (bitmap<>nil) and (not bitmap.Empty) then
+    begin
+      if not FShowCaption then
+      begin
+        w := 0;
+        h := 0;
+      end else
+        CalculateTextSize(Caption,AState.FontEx,w,h);
+      l := r.Right - Round(((r.Right-r.Left) + w + bitmap.Width)/2);
+      t := r.Bottom - Round(((r.Bottom-r.Top) + bitmap.Height) / 2);
+      g := TBGRABitmap.Create(bitmap);
+      ABGRA.BlendImage(l,t,g,boLinearBlend);
+      g.Free;
+      Inc(r.Left,l+bitmap.Width+FGlyphMargin);
+    end;
+
+    if bitmap <> FGlyph then
+      bitmap.Free;
+  end;
+
+begin
+  if (csCreating in FControlState) or IsUpdating then
+    Exit;
+
+  ABGRA.NeedRender := False;
+
+  { Refreshing size }
+  ABGRA.SetSize(Width, Height);
+
+  { Calculating rect }
+  r   := GetButtonRect;
+  CalculateBorderRect(AState.Border,r);
+
+  if FStyle = bbtDropDown then
+  begin
+    r_a := GetDropDownRect;
+    CalculateBorderRect(AState.Border,r_a);
+  end;
+
+  { Clearing previous paint }
+  ABGRA.Fill(BGRAPixelTransparent);
+  { Basic body }
+  RenderState(ABGRA, AState, r, FRounding);
+  if FStyle = bbtDropDown then
+  begin
+    RenderState(ABGRA, AState, r_a, FRoundingDropDown);
+    // Click offset for arrow
+    if FClickOffest and (AState = FStateClicked) then
+    begin
+      Inc(r_a.Left,2);
+      Inc(r_a.Top,2);
+    end;
+
+    if FFlipArrow then
+      RenderArrow(TBGRABitmap(ABGRA),r_a,FDropDownArrowSize,badUp,AState.FontEx.Color)
+    else
+      RenderArrow(TBGRABitmap(ABGRA),r_a,FDropDownArrowSize,badDown,AState.FontEx.Color);
+  end;
+
+  // Click offset for text and glyph
+  if FClickOffest and (AState = FStateClicked) then
+  begin
+    Inc(r.Left,2);
+    Inc(r.Top,2);
+  end;
+
+  // DropDown arrow
+  if FDropDownArrow and (FStyle <> bbtDropDown) then
+  begin
+    r_a := r;
+    r_a.Left := r_a.Right - FDropDownWidth;
+    if FFlipArrow then
+      RenderArrow(TBGRABitmap(ABGRA),r_a,FDropDownArrowSize,badUp,AState.FontEx.Color)
+    else
+      RenderArrow(TBGRABitmap(ABGRA),r_a,FDropDownArrowSize,badDown,AState.FontEx.Color);
+    Dec(R.Right, FDropDownWidth);
+  end;
+
+  if FTextApplyGlobalOpacity then
+  begin
+    { Drawing text }
+    _RenderGlyph;
+    if FShowCaption then
+      RenderText(r,AState.FontEx,Self.Caption,TBGRABitmap(ABGRA));
+
+    { Set global opacity }
+    ABGRA.ApplyGlobalOpacity(FGlobalOpacity);
+  end
+  else
+  begin
+    { Set global opacity }
+    ABGRA.ApplyGlobalOpacity(FGlobalOpacity);
+    { Drawing text }
+    _RenderGlyph;
+    if FShowCaption then
+      RenderText(r,AState.FontEx,Self.Caption,TBGRABitmap(ABGRA));
+  end;
+
+  { Convert to gray if not enabled }
+  if not Enabled then
+    ConvertToGrayScale(ABGRA);
+
+  if Assigned(FOnAfterRenderBCButton) then
+    FOnAfterRenderBCButton(Self, ABGRA, AState, r);
+
+  {$IFDEF DEBUG}
+  FRenderCount += 1;
+  {$ENDIF}
+end;
+
+procedure TCustomBCButton.RenderState(ABGRA: TBGRABitmapEx;
+  AState: TBCButtonState; const ARect: TRect; ARounding: TBCRounding);
+begin
+  RenderBackground(ARect, AState.FBackground, TBGRABitmap(ABGRA), ARounding);
+  RenderBorder(ARect, AState.FBorder, TBGRABitmap(ABGRA), ARounding);
+end;
+
+procedure TCustomBCButton.OnChangeGlyph(Sender: TObject);
+begin
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.OnChangeState(Sender: TObject; AData: PtrInt);
+begin
+  RenderControl;
+  if TBCButtonPropertyData(AData)=pdUpdateSize then
+    UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.ImageListChange(ASender: TObject);
+begin
+  if ASender = Images then
+  begin
+    RenderControl;
+    Invalidate;
+  end;
+end;
+
+procedure TCustomBCButton.SeTBCButtonStateClicked(const AValue: TBCButtonState);
+begin
+  if FStateClicked = AValue then
+    exit;
+  FStateClicked.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SeTBCButtonStateHover(const AValue: TBCButtonState);
+begin
+  if FStateHover = AValue then
+    exit;
+  FStateHover.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SeTBCButtonStateNormal(const AValue: TBCButtonState);
+begin
+  if FStateNormal = AValue then
+    exit;
+  FStateNormal.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetClickOffset(AValue: Boolean);
+begin
+  if FClickOffest = AValue then Exit;
+  FClickOffest := AValue;
+  RenderControl;
+end;
+
+procedure TCustomBCButton.SetDown(AValue: boolean);
+begin
+  if FDown = AValue then
+    exit;
+  FDown := AValue;
+  if FDown
+  then FButtonState := msClicked
+  else FButtonState := msNone;
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetDropDownArrow(AValue: Boolean);
+begin
+  if FDropDownArrow = AValue then Exit;
+  FDropDownArrow := AValue;
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetDropDownArrowSize(AValue: Integer);
+begin
+  if FDropDownArrowSize = AValue then Exit;
+  FDropDownArrowSize := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetDropDownPosition(AValue: TBCButtonDropDownPosition
+  );
+begin
+  if FDropDownPosition = AValue then Exit;
+  FDropDownPosition := AValue;
+
+  if FStyle <> bbtDropDown then Exit;
+
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetDropDownWidth(AValue: Integer);
+begin
+  if FDropDownWidth = AValue then Exit;
+  FDropDownWidth := AValue;
+
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetFlipArrow(AValue: boolean);
+begin
+  if FFlipArrow = AValue then
+    Exit;
+  FFlipArrow := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetGlyph(const AValue: TBitmap);
+begin
+  if (FGlyph <> nil) and (FGlyph = AValue) then
+    exit;
+
+  FGlyph.Assign(AValue);
+
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetGlyphMargin(const AValue: integer);
+begin
+  if FGlyphMargin = AValue then
+    exit;
+  FGlyphMargin := AValue;
+
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetImageIndex(AValue: Integer);
+begin
+  if FImageIndex = AValue then Exit;
+  FImageIndex := AValue;
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetImages(AValue: TCustomImageList);
+begin
+  if FImages = AValue then Exit;
+  FImages := AValue;
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetRounding(AValue: TBCRounding);
+begin
+  if FRounding = AValue then Exit;
+  FRounding.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetRoundingDropDown(AValue: TBCRounding);
+begin
+  if FRoundingDropDown = AValue then Exit;
+  FRoundingDropDown.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetShowCaption(AValue: Boolean);
+begin
+  if FShowCaption = AValue then Exit;
+  FShowCaption := AValue;
+
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetStaticButton(const AValue: boolean);
+begin
+  if FStaticButton = AValue then
+    exit;
+  FStaticButton := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetStyle(const AValue: TBCButtonStyle);
+begin
+  if FStyle = AValue then
+    exit;
+  FStyle := AValue;
+
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.UpdateSize;
+begin
+  InvalidatePreferredSize;
+  AdjustSize;
+end;
+
+procedure TCustomBCButton.CalculatePreferredSize(
+  var PreferredWidth, PreferredHeight: integer; WithThemeSpace: boolean);
+var
+  AWidth: integer;
+  gh: integer = 0;
+  gw: integer = 0;
+begin
+  if (Parent = nil) or (not Parent.HandleAllocated) then
+    Exit;
+  if WidthIsAnchored then
+    AWidth := Width
+  else
+    AWidth := 10000;
+
+  PreferredWidth := 0;
+  PreferredHeight := 0;
+  if FShowCaption then
+    CalculateTextSize(Caption, FStateNormal.FontEx, PreferredWidth, PreferredHeight);
+
+  // Extra pixels for DropDown
+  if Style = bbtDropDown then
+    if FDropDownPosition in [bdpBottom] then
+      Inc(PreferredHeight, GetDropDownWidth)
+    else
+      Inc(PreferredWidth, GetDropDownWidth);
+
+  if (Style = bbtButton) and FDropDownArrow then
+      Inc(PreferredWidth, FDropDownArrowSize);// GetDropDownWidth);
+
+  CalculateGlyphSize(gw, gh);
+
+  //if (FGlyph <> nil) and (not FGlyph.Empty) then
+  if (gw > 0) and (gh > 0) then
+  begin
+    //if Caption = '' then
+    if PreferredWidth = 0 then
+    begin
+      Inc(PreferredWidth, gw{ - AutoSizeExtraY * 2});
+      Inc(PreferredHeight, gh);
+    end
+    else
+    begin
+      Inc(PreferredWidth, gw + FGlyphMargin);
+      if gh > PreferredHeight then
+        PreferredHeight := gh;
+    end;
+  end;
+
+  // Extra pixels for AutoSize
+  Inc(PreferredWidth, AutoSizeExtraX);
+  Inc(PreferredHeight, AutoSizeExtraY);
+end;
+
+class function TCustomBCButton.GetControlClassDefaultSize: TSize;
+begin
+  Result.CX := 123;
+  Result.CY := 33;
+end;
+
+procedure TCustomBCButton.Click;
+begin
+  if (FActiveButt = bbtDropDown) and Assigned(FOnButtonClick) then
+  begin
+    FOnButtonClick(Self);
+    Exit;
+  end;
+  inherited Click;
+end;
+
+procedure TCustomBCButton.DropDownClosed(Sender: TObject);
+begin
+  if Assigned(FSaveDropDownClosed) then
+    FSaveDropDownClosed(Sender);
+  if Assigned(FDropDownMenu) then
+    FDropDownMenu.OnClose := FSaveDropDownClosed;
+
+  // MORA: DropDownMenu is still visible if mouse is over control
+  FDropDownMenuVisible := PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos));
+end;
+
+procedure TCustomBCButton.MouseDown(Button: TMouseButton; Shift: TShiftState;
+  X, Y: integer);
+begin
+  inherited MouseDown(Button, Shift, X, Y);
+  if csDesigning in ComponentState then
+    exit;
+
+  if (Button = mbLeft) and Enabled {and (not (FButtonState = msClicked)) }then
+  begin
+    case FActiveButt of
+      bbtButton:
+        if not (FButtonState=msClicked) then
+        begin
+          FButtonState     := msClicked;
+          if FDropDownStyle = bdsCommon then
+            FDownButtonState := msClicked
+          else
+            FDownButtonState := msNone;
+          Invalidate;
+        end;
+      bbtDropDown:
+        if not (FDownButtonState=msClicked) then
+        begin
+          if FDropDownStyle = bdsCommon then
+            FButtonState     := msClicked
+          else
+            FButtonState     := msNone;
+          FDownButtonState := msClicked;
+          Invalidate;
+        end;
+    end;
+    // Old
+    {FButtonState := msClicked;
+    Invalidate;}
+
+    // MORA: Show DropDown menu
+    if FDropDownMenuVisible then
+      FDropDownMenuVisible := False // Prevent redropping
+    else
+    if ((FActiveButt = bbtDropDown) or (FStyle = bbtButton)) and (FDropDownMenu <> nil) and Enabled then
+      with ClientToScreen(Point(0, Height)) do
+      begin
+        // normal button
+        if FStyle = bbtButton then
+        begin
+          x := x + Width * Integer(FDropDownMenu.Alignment = paRight);
+          if FFlipArrow then
+            y -= Height;
+        end else
+        // dropdown button
+        begin
+          if FDropDownPosition = bdpBottom then
+          begin
+            x := x + Width * Integer(FDropDownMenu.Alignment = paRight);
+            if FFlipArrow then
+              y -= (FDropDownWidth + (FStateNormal.FBorder.Width * 2));
+          end else
+          begin
+            if FFlipArrow then
+              y -= Height;
+            if FDropDownStyle = bdsSeparate then
+              x := x + Width - (FDropDownWidth + (FStateNormal.FBorder.Width * 2)) * Integer(FDropDownMenu.Alignment <> paRight)
+            else
+              x := x + Width * Integer(FDropDownMenu.Alignment = paRight);
+          end
+        end;
+
+        FDropDownMenuVisible := True;
+        FSaveDropDownClosed := FDropDownMenu.OnClose;
+        FDropDownMenu.OnClose := @DropDownClosed;
+        FDropDownMenu.PopUp(x, y);
+      end;
+  end;
+end;
+
+procedure TCustomBCButton.MouseUp(Button: TMouseButton; Shift: TShiftState;
+  X, Y: integer);
+var
+  p: TPoint;
+begin
+  inherited MouseUp(Button, Shift, X, Y);
+  if csDesigning in ComponentState then
+    exit;
+
+  if (Button = mbLeft) and Enabled {and (FButtonState = msClicked)} then
+  begin
+    case FActiveButt of
+      bbtButton:
+        if FButtonState=msClicked then
+        begin
+          FButtonState     := msHover;
+          if FDropDownStyle = bdsCommon then
+            FDownButtonState := msHover
+          else
+            FDownButtonState := msNone;
+          Invalidate;
+        end;
+      bbtDropDown:
+        if FDownButtonState = msClicked then
+        begin
+          FDownButtonState := msHover;
+          if FDropDownStyle = bdsCommon then
+            FButtonState     := msHover
+          else
+            FButtonState     := msNone;
+          Invalidate;
+        end;
+    end;
+    // Old
+    {FButtonState := msHover;
+    Invalidate;}
+  end;
+
+  //if (FActiveButt = bbtDropDown) and (PopupMenu <> nil) and Enabled then
+  //begin
+  //  if FFlipArrow then
+  //    p := ClientToScreen(Point(Width - FDropDownWidth - (FStateNormal.FBorder.Width * 2),
+  //      {PopupMenu.Height} -1))
+  //  else
+  //    p := ClientToScreen(Point(Width - FDropDownWidth - (FStateNormal.FBorder.Width * 2), Height + 1));
+  //
+  //  PopupMenu.PopUp(p.x, p.y);
+  //end;
+end;
+
+procedure TCustomBCButton.MouseEnter;
+begin
+  if csDesigning in ComponentState then
+    exit;
+  case FActiveButt of
+    bbtButton:
+      begin
+        if FDown
+        then FButtonState := msClicked
+        else FButtonState := msHover;
+
+        if FDropDownStyle = bdsSeparate then
+          FDownButtonState  := msNone
+        else
+          FDownButtonState  := msHover
+      end;
+    bbtDropDown:
+      begin
+        if FDown
+        then FButtonState := msClicked
+        else
+        if FDropDownStyle = bdsSeparate then
+          FButtonState := msNone
+        else
+          FButtonState := msHover;
+        FDownButtonState  := msHover
+      end;
+  end;
+  Invalidate;
+  // Old
+  {FButtonState := msHover;
+  Invalidate;}
+  inherited MouseEnter;
+end;
+
+procedure TCustomBCButton.MouseLeave;
+begin
+  if csDesigning in ComponentState then
+    exit;
+  if FDown then
+  begin
+    FButtonState := msClicked;
+    FActiveButt := bbtButton;
+  end
+  else
+    FButtonState := msNone;
+  FDownButtonState  := msNone;
+  Invalidate;
+  inherited MouseLeave;
+end;
+
+procedure TCustomBCButton.MouseMove(Shift: TShiftState; X, Y: integer);
+
+  function IsOverDropDown: Boolean;
+  begin
+    with GetButtonRect do
+      case FDropDownPosition of
+        bdpBottom:
+          Result := Y > Bottom;
+      else
+        Result := X > GetButtonRect.Right;
+      end;
+  end;
+
+begin
+  inherited MouseMove(Shift, X, Y);
+
+  if FStyle=bbtButton then
+    FActiveButt := bbtButton
+  else
+  begin
+    // Calling invalidate only when active button changed. Otherwise, we leave
+    // this for LCL. This reduce paint call
+    if (FActiveButt=bbtButton) and IsOverDropDown then
+    begin
+      FActiveButt      := bbtDropDown;
+      if FDropDownStyle <> bdsCommon then // Don't need invalidating
+      begin
+        FDownButtonState := msHover;
+        if FDown
+        then FButtonState := msClicked
+        else FButtonState := msNone;
+        Invalidate;
+      end;
+    end else
+    if (FActiveButt=bbtDropDown) and not IsOverDropDown then
+    begin
+      FActiveButt      := bbtButton;
+      if FDropDownStyle <> bdsCommon then // Don't need invalidating
+      begin
+        if FDown
+        then FButtonState := msClicked
+        else FButtonState := msHover;
+        FDownButtonState := msNone;
+        Invalidate;
+      end;
+    end;
+  end;
+end;
+
+procedure TCustomBCButton.SetEnabled(Value: boolean);
+begin
+  inherited SetEnabled(Value);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.TextChanged;
+begin
+  inherited TextChanged;
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.ActionChange(Sender: TObject; CheckDefaults: Boolean);
+var
+  NewAction: TCustomAction;
+begin
+  inherited ActionChange(Sender, CheckDefaults);
+  if Sender is TCustomAction then
+  begin
+    NewAction := TCustomAction(Sender);
+    if (not CheckDefaults) or (not Down) then
+      Down := NewAction.Checked;
+    if (not CheckDefaults) or (ImageIndex<0) then
+      ImageIndex := NewAction.ImageIndex;
+  end;
+end;
+
+function TCustomBCButton.GetActionLinkClass: TControlActionLinkClass;
+begin
+  Result := TBCButtonActionLink;
+end;
+
+procedure TCustomBCButton.Notification(AComponent: TComponent;
+  Operation: TOperation);
+begin
+  inherited Notification(AComponent, Operation);
+  if (AComponent = FImages) and (Operation = opRemove) then
+    Images := nil;
+end;
+
+procedure TCustomBCButton.UpdateControl;
+begin
+  RenderControl;
+  inherited UpdateControl; // indalidate
+end;
+
+procedure TCustomBCButton.SaveToFile(AFileName: string);
+var
+  AStream: TMemoryStream;
+begin
+  AStream := TMemoryStream.Create;
+  try
+    WriteComponentAsTextToStream(AStream, Self);
+    AStream.SaveToFile(AFileName);
+  finally
+    AStream.Free;
+  end;
+end;
+
+procedure TCustomBCButton.LoadFromFile(AFileName: string);
+var
+  AStream: TMemoryStream;
+begin
+  AStream := TMemoryStream.Create;
+  try
+    AStream.LoadFromFile(AFileName);
+    ReadComponentFromTextStream(AStream, TComponent(Self), @OnFindClass);
+  finally
+    AStream.Free;
+  end;
+end;
+
+procedure TCustomBCButton.OnFindClass(Reader: TReader;
+  const AClassName: string; var ComponentClass: TComponentClass);
+begin
+  if CompareText(AClassName, 'TCustomBCButton') = 0 then
+    ComponentClass := TCustomBCButton
+  else if CompareText(AClassName, 'TBCButton') = 0 then
+    ComponentClass := TBCButton;
+end;
+
+{$IFDEF DEBUG}
+function TCustomBCButton.GetDebugText: String;
+begin
+  Result := 'R: '+IntToStr(FRenderCount);
+end;
+{$ENDIF}
+
+procedure TCustomBCButton.DrawControl;
+var
+  bgra: TBGRABitmapEx;
+begin
+
+  // If style is without dropdown button or state of each button
+  // is the same (possible only for msNone) or static button then
+  // we can draw whole BGRABitmap
+  if (FStyle=bbtButton) or (FButtonState=FDownButtonState) or FStaticButton
+  then
+  begin
+    // Main button
+    if FStaticButton then
+      bgra := FBGRANormal
+    else
+    if FDown then
+      bgra := FBGRAClick
+    else
+      case FButtonState of
+        msNone: bgra := FBGRANormal;
+        msHover: bgra := FBGRAHover;
+        msClicked: bgra := FBGRAClick;
+      end;
+    if bgra.NeedRender then
+      Render(bgra,TBCButtonState(bgra.CustomData));
+    bgra.Draw(Self.Canvas, 0, 0, False);
+  end
+  // Otherwise we must draw part of state for each button
+  else
+  begin
+    // The active button must be draw as last because right edge of button and
+    // left edge of dropdown are overlapping each other, so we must draw edge
+    // for current state of active button
+    case FActiveButt of
+      bbtButton:
+        begin
+          // Drop down button
+          case FDownButtonState of
+            msNone: bgra := FBGRANormal;
+            msHover: bgra := FBGRAHover;
+            msClicked: bgra := FBGRAClick;
+          end;
+          if bgra.NeedRender then
+            Render(bgra,TBCButtonState(bgra.CustomData));
+          bgra.DrawPart(GetDropDownRect,Self.Canvas,GetDropDownRect.Left,GetDropDownRect.Top,False);
+          // Main button
+          if FDown then
+            bgra := FBGRAClick
+          else
+            case FButtonState of
+              msNone: bgra := FBGRANormal;
+              msHover: bgra := FBGRAHover;
+              msClicked: bgra := FBGRAClick;
+            end;
+          if bgra.NeedRender then
+            Render(bgra,TBCButtonState(bgra.CustomData));
+          bgra.DrawPart(GetButtonRect, Self.Canvas, 0, 0, False);
+        end;
+      bbtDropDown:
+        begin
+          // Main button
+          if FDown then
+            bgra := FBGRAClick
+          else
+            case FButtonState of
+              msNone: bgra := FBGRANormal;
+              msHover: bgra := FBGRAHover;
+              msClicked: bgra := FBGRAClick;
+            end;
+          if bgra.NeedRender then
+            Render(bgra,TBCButtonState(bgra.CustomData));
+          bgra.DrawPart(GetButtonRect, Self.Canvas, 0, 0, False);
+          // Drop down button
+          case FDownButtonState of
+            msNone: bgra := FBGRANormal;
+            msHover: bgra := FBGRAHover;
+            msClicked: bgra := FBGRAClick;
+          end;
+          if bgra.NeedRender then
+            Render(bgra,TBCButtonState(bgra.CustomData));
+          bgra.DrawPart(GetDropDownRect,Self.Canvas,GetDropDownRect.Left,GetDropDownRect.Top,False);
+        end;
+    end;
+  end;
+end;
+
+procedure TCustomBCButton.RenderControl;
+begin
+  inherited RenderControl;
+  RenderAll;
+end;
+
+procedure TCustomBCButton.SetGlobalOpacity(const AValue: byte);
+begin
+  if FGlobalOpacity = AValue then
+    exit;
+  FGlobalOpacity := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCButton.SetTextApplyGlobalOpacity(const AValue: boolean);
+begin
+  if FTextApplyGlobalOpacity = AValue then
+    exit;
+  FTextApplyGlobalOpacity := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+constructor TCustomBCButton.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  {$IFDEF DEBUG}
+  FRenderCount := 0;
+  {$ENDIF}
+  DisableAutoSizing;
+  Include(FControlState, csCreating);
+  //{$IFDEF WINDOWS}
+  // default sizes under different dpi settings
+  //SetSizeVariables(ScaleX(8,96), ScaleX(16,96), ScaleY(8,96), ScaleX(24,96));
+  //{$ELSE}
+  // default sizes
+  SetSizeVariables(16, 8, 8, 24);
+  //{$ENDIF}
+  BeginUpdate;
+  try
+    with GetControlClassDefaultSize do
+      SetInitialBounds(0, 0, CX, CY);
+    ControlStyle := ControlStyle + [csAcceptsControls];
+    FBGRANormal := TBGRABitmapEx.Create(Width, Height, BGRAPixelTransparent);
+    FBGRAHover := TBGRABitmapEx.Create(Width, Height, BGRAPixelTransparent);
+    FBGRAClick := TBGRABitmapEx.Create(Width, Height, BGRAPixelTransparent);
+
+    ParentColor := False;
+    Color := clNone;
+
+    FStateNormal           := TBCButtonState.Create(Self);
+    FStateHover            := TBCButtonState.Create(Self);
+    FStateClicked          := TBCButtonState.Create(Self);
+    FStateNormal.OnChange  := @OnChangeState;
+    FStateHover.OnChange   := @OnChangeState;
+    FStateClicked.OnChange := @OnChangeState;
+
+    FRounding              := TBCRounding.Create(Self);
+    FRounding.OnChange     := @OnChangeState;
+
+    FRoundingDropDown      := TBCRounding.Create(Self);
+    FRoundingDropDown.OnChange := @OnChangeState;
+
+    { Connecting bitmaps with states property to easy call and access }
+    FBGRANormal.CustomData := PtrInt(FStateNormal);
+    FBGRAHover.CustomData  := PtrInt(FStateHover);
+    FBGRAClick.CustomData  := PtrInt(FStateClicked);
+
+    FButtonState := msNone;
+    FDownButtonState := msNone;
+    FFlipArrow := False;
+    FGlyph := TBitmap.Create;
+    FGlyph.OnChange := @OnChangeGlyph;
+    FGlyphMargin := 5;
+    FStyle := bbtButton;
+    FStaticButton := False;
+    FActiveButt := bbtButton;
+    FGlobalOpacity := 255;
+    FTextApplyGlobalOpacity := False;
+    //FStates := [];
+    FDown := False;
+
+    { Default style }
+    AssignDefaultStyle;
+
+    FImageChangeLink := TChangeLink.Create;
+    FImageChangeLink.OnChange := @ImageListChange;
+    FImageIndex := -1;
+
+    FShowCaption := True;
+  finally
+    Exclude(FControlState, csCreating);
+    EnableAutoSizing;
+    EndUpdate;
+  end;
+end;
+
+destructor TCustomBCButton.Destroy;
+begin
+  FImageChangeLink.Free;
+  FStateNormal.Free;
+  FStateHover.Free;
+  FStateClicked.Free;
+  FBGRANormal.Free;
+  FBGRAHover.Free;
+  FBGRAClick.Free;
+  FreeThenNil(FGlyph);
+  FRounding.Free;
+  FRoundingDropDown.Free;
+  inherited Destroy;
+end;
+
+procedure TCustomBCButton.Assign(Source: TPersistent);
+begin
+  if Source is TCustomBCButton then
+  begin
+    Glyph := TCustomBCButton(Source).Glyph;
+    FGlyphMargin := TCustomBCButton(Source).FGlyphMargin;
+    FStyle := TCustomBCButton(Source).FStyle;
+    FFlipArrow := TCustomBCButton(Source).FFlipArrow;
+    FStaticButton := TCustomBCButton(Source).FStaticButton;
+    FGlobalOpacity := TCustomBCButton(Source).FGlobalOpacity;
+    FTextApplyGlobalOpacity := TCustomBCButton(Source).FTextApplyGlobalOpacity;
+    FStateNormal.Assign(TCustomBCButton(Source).FStateNormal);
+    FStateHover.Assign(TCustomBCButton(Source).FStateHover);
+    FStateClicked.Assign(TCustomBCButton(Source).FStateClicked);
+    FDropDownArrowSize := TCustomBCButton(Source).FDropDownArrowSize;
+    FDropDownWidth := TCustomBCButton(Source).FDropDownWidth;
+    AutoSizeExtraX := TCustomBCButton(Source).AutoSizeExtraX;
+    AutoSizeExtraY := TCustomBCButton(Source).AutoSizeExtraY;
+    FDown := TCustomBCButton(Source).FDown;
+    FRounding.Assign(TCustomBCButton(Source).FRounding);
+    FRoundingDropDown.Assign(TCustomBCButton(Source).FRoundingDropDown);
+
+    RenderControl;
+    Invalidate;
+    UpdateSize;
+  end
+  else
+    inherited Assign(Source);
+end;
+
+procedure TCustomBCButton.SetSizeVariables(newDropDownWidth, newDropDownArrowSize,
+  newAutoSizeExtraVertical, newAutoSizeExtraHorizontal: integer);
+begin
+  FDropDownArrowSize := newDropDownArrowSize;
+  FDropDownWidth     := newDropDownWidth;
+  AutoSizeExtraY     := newAutoSizeExtraVertical;
+  AutoSizeExtraX     := newAutoSizeExtraHorizontal;
+
+  if csCreating in ControlState then
+    Exit;
+
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+function TCustomBCButton.GetStyleExtension: String;
+begin
+  Result := 'bcbtn';
+end;
+
+end.

+ 31 - 0
bcbutton_icon.lrs

@@ -0,0 +1,31 @@
+LazarusResources.Add('tbcbutton','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#2#139'IDATx^'#237'UMKUQ'#20']'#251#156#243#204#7#129#137'QA!'#4'Q'#163#168
+  +'h'#212#160#31#208'/'#136#192#240'Q'#208#208'FE'#10'j'#13#210'A$(AR'#8'ZH'
+  +#244#23'$h\'#163#160#6'FI5'#9'"'#164#30#154#239#189's'#207'G{'#159'{'#159#151
+  +#135#209' q'#16#184'`s'#246#217#251#222#181#246#199#133'K!'#4#16#17'v'#10#20
+  +'c'#196'NB'#177#253#223#2#244'y'#229'}|'#246#226#13#222'}'#252#6'e4"'#254'>'
+  +#178#224'='#144#158'!t"'#130'H%'#211'F'#225#202#133#179'8v'#228#16#204#212
+  +#243'W'#168#238#239#199#169's'#199#209#180#0#169'm,<F("8'#31#176#248'r'#25'7'
+  +'.'#246#193','#255#168'`'#186'v'#30#7'{'#21#164'8'#218#202'/'#241#4#165#242
+  +'|'#8#226#255#145#31#129#173#186#7#184#245#240'''V'#190#214'a'#26'6'#162#167
+  +#219#161#183'[!'#132#188#2#160#156'B`6'#165#187'J'#18#159#129't'#5#8'n'#203
+  +#148'b'#16#1#15'm'#12'|'#8')o'#132#192'zp@'#161#229'B)'#0'J'#21'U'#187#12#6
+  +'.'#215' Xx:'#15'0'#249' '#223#31#207#205'q'#158#197#203'V'#248#30'Y@'#161
+  +#170'u'#26#19#17#193'd'#158#131'b'#25#224'l'#217#186#247#14'Zk'#12'\'#173'av'
+  +'v'#14#2'!^X'#152#135#192'('#13#197#182#177#225#249'$!g'#203#199'G]'#128#11
+  +'QJ'#132#241'B'#30#1#199#167'sqS '#203#188#200'@'#208'hX'#180'Q'#175#231#254
+  +#218#154#197#208#208'5'#204#204'<'#130'@:'#137#16#129#184#185'''q'#140#4'dL'
+  +#205'V'#147'MZ'#166'B C'#129#148'k#sI '#145#223#159'z'#144#238'!'#148#31#135
+  +'s'#30#177#167#146#132' '#29#132#162#173#204':'#180'Z'#30#186#16#176#165#0
+  +#199'K'#191#177#209'b'#146#0'cT'#242#11'l'#238'"c'#129#224#9'9?'#193#200'h<'
+  +#223'l'#203'v'#8'DV'#21#140#141'N'#226#246#248#205#220#31#155#132#181'6'#145
+  +'OLLcd'#228'z'#138#181'A'#164#184's'''#11#22#206'|'#201'^.b'#200'w'#16#21#18
+  +#8'RE'#132'`x'#248'.'#156#188#232#0#163'5'#147#222#227#234#155',0'#137#204#6
+  +'h'#163#145#30'-8'#130#7#188#11'il&*'#5'c4'#236#175'&l'#217'A'#199#167'G'#28
+  +'#"'#206'7'#145#17#229#177#246#169#20#147#150'#'#228#209#138#12#200#152#180#7
+  +#179#175#210#192#147#165'O8'#176#247#176'tR,'#139#240'o'#136'I'#244#245#23
+  +#139#213#239#171#232#235'='#10'3~'#233'$'#238',.'#225#237#135'u'#217#20#182
+  +#11#18#163#136#209#193#211'8s'#162#159'v'#127'8'#187#2#219#199'o''+w'#167#205
+  +#252#27#230#0#0#0#0'IEND'#174'B`'#130
+]);

+ 210 - 0
bceffect.pas

@@ -0,0 +1,210 @@
+unit BCEffect;
+
+{$mode objfpc}{$H+}
+{$modeswitch advancedrecords}
+
+interface
+
+uses
+  Classes, SysUtils, LCLProc, BGRABitmapTypes;
+
+{-- Fading --}
+
+type
+  TFadingMode = (fmSuspended, fmFadeIn, fmFadeOut, fmFadeInCycle, fmFadeOutCycle, fmFadeInOut, fmFadeOutIn);
+
+const
+  FadingModeStr: array[TFadingMode] of string = ('Suspended', 'Fade In', 'Fade Out', 'Fade In Cycle','Fade Out Cycle', 'Fade In Out', 'Fade Out In');
+
+function StrToTFadingMode(const s: ansistring): TFadingMode;
+procedure FadingModeStrList(s: TStrings);
+
+type
+
+  { TFading }
+
+  TFading = record
+  private
+    FAlpha: byte;
+    FMode: TFadingMode;
+    FAlphaStep: byte;
+    FDuration: integer;
+    FPrevDate: TDateTime;
+    FElapsedMsAccumulator: integer;
+  public
+    procedure SetFAlpha(AValue: byte);
+    procedure SetFMode(AValue: TFadingMode);
+    procedure SetFAlphaStep(AValue: byte);
+    procedure SetFDuration(AValue: integer);
+  public
+    function Execute(AStepCount: integer= 1): byte; // execute and return new alpha
+    function Reset: byte;   // reset and return new alpha
+    procedure PutImage(ADestination: TBGRACustomBitmap; AX,AY: integer; ASource: TBGRACustomBitmap);
+    procedure FillRect(ADestination: TBGRACustomBitmap; ARect: TRect; AColor: TBGRAPixel);
+  public
+    property Alpha: byte read FAlpha write SetFAlpha;
+    property Mode: TFadingMode read FMode write SetFMode;
+    property Step: byte read FAlphaStep write SetFAlphaStep;
+    property Duration: integer read FDuration write SetFDuration;
+  end;
+
+{-- Fading --}
+
+implementation
+
+{-- Fading --}
+
+function StrToTFadingMode(const s: ansistring): TFadingMode;
+var
+  fm: TFadingMode;
+  ls: ansistring;
+begin
+  ls := UTF8LowerCase(s);
+  for fm := low(TFadingMode) to high(TFadingMode) do
+    if ls = UTF8LowerCase(FadingModeStr[fm]) then
+    begin
+      Result := fm;
+      break;
+    end;
+  Result := fm;
+end;
+
+procedure FadingModeStrList(s: TStrings);
+var
+  fm: TFadingMode;
+begin
+  for fm := low(TFadingMode) to high(TFadingMode) do
+    s.Add(FadingModeStr[fm]);
+end;
+
+{ TFading }
+
+procedure TFading.SetFAlpha(AValue: byte);
+begin
+  if FAlpha = AValue then
+    Exit;
+  FAlpha := AValue;
+end;
+
+procedure TFading.SetFMode(AValue: TFadingMode);
+begin
+  if FMode = AValue then
+    Exit;
+  FMode := AValue;
+  FPrevDate:= 0;
+end;
+
+procedure TFading.SetFAlphaStep(AValue: byte);
+begin
+  if FAlphaStep = AValue then
+    Exit
+  else
+    FAlphaStep := AValue;
+end;
+
+procedure TFading.SetFDuration(AValue: integer);
+begin
+  FDuration:= AValue;
+end;
+
+function TFading.Execute(AStepCount: integer= 1): byte;
+var curDate: TDateTime;
+  alphaStep: byte;
+  timeGrain: integer;
+begin
+  if FAlphaStep <= 0 then
+    alphaStep := 1
+  else
+    alphaStep := FAlphaStep;
+
+  if FDuration > 0 then
+  begin
+    curDate := Now;
+    if FPrevDate = 0 then
+    begin
+      FPrevDate := curDate;
+      FElapsedMsAccumulator := 0;
+      result := FAlpha;
+      exit;
+    end;
+
+    inc(FElapsedMsAccumulator, round((curDate-FPrevDate)*(24*60*60*1000)) );
+    timeGrain := round(FDuration*alphaStep/255);
+    if timeGrain <= 0 then timeGrain := 1;
+    AStepCount := FElapsedMsAccumulator div timeGrain;
+    FElapsedMsAccumulator:= FElapsedMsAccumulator mod timeGrain;
+    FPrevDate := curDate;
+  end;
+
+  if AStepCount < 0 then AStepCount := 0
+  else if AStepCount > 255 then AStepCount := 255;
+
+  case FMode of
+    fmFadeIn, fmFadeInOut, fmFadeInCycle:
+    begin
+      if (FAlpha = 255) and (FMode = fmFadeInCycle) then
+        FAlpha := 0
+      else
+      if FAlpha + alphaStep*AStepCount >= 255 then
+      begin
+        FAlpha := 255;
+        if FMode = fmFadeInOut then
+          FMode := fmFadeOutIn
+        else if FMode <> fmFadeInCycle then
+          FMode := fmSuspended;
+      end
+      else
+        FAlpha += alphaStep*AStepCount;
+    end;
+    fmFadeOut,fmFadeOutIn, fmFadeOutCycle:
+    begin
+      if (FAlpha = 0) and (FMode = fmFadeOutCycle) then
+        FAlpha := 255
+      else
+      if FAlpha - alphaStep*AStepCount <= 0 then
+      begin
+        FAlpha := 0;
+        if FMode = fmFadeOutIn then
+          FMode := fmFadeInOut
+        else if FMode <> fmFadeOutCycle then
+          FMode := fmSuspended;
+      end
+      else
+        FAlpha -= alphaStep*AStepCount;
+    end;
+  end;
+
+  Result := FAlpha;
+end;
+
+function TFading.Reset: byte;
+begin
+  case FMode of
+    fmFadeIn, fmFadeInOut:
+    begin
+      FAlpha := 0;
+    end;
+    fmFadeOut,fmFadeOutIn:
+    begin
+      FAlpha := 255;
+    end;
+  end;
+  Result := FAlpha;
+  FPrevDate := 0;
+end;
+
+procedure TFading.PutImage(ADestination: TBGRACustomBitmap; AX, AY: integer;
+  ASource: TBGRACustomBitmap);
+begin
+  ADestination.PutImage(AX,AY,ASource,dmDrawWithTransparency,Alpha);
+end;
+
+procedure TFading.FillRect(ADestination: TBGRACustomBitmap; ARect: TRect;
+  AColor: TBGRAPixel);
+begin
+  ADestination.FillRect(ARect, BGRA(AColor.red,AColor.green,AColor.blue,AColor.alpha*Alpha div 255),dmDrawWithTransparency);
+end;
+
+{-- Fading --}
+
+end.

+ 776 - 0
bcfilters.pas

@@ -0,0 +1,776 @@
+{
+// all pixels //
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels-1 downto 0 do
+  begin
+    p^.red := ;
+    p^.green := ;
+    p^.blue := ;
+    p^.alpha := ;
+    Inc(p);
+  end;
+
+// scan line //
+var
+  x, y: integer;
+  p: PBGRAPixel;
+begin
+  for y := 0 to Bitmap.Height - 1 do
+  begin
+    p := Bitmap.Scanline[y];
+    for x := 0 to Bitmap.Width - 1 do
+    begin
+      p^.red := ;
+      p^.green := ;
+      p^.blue := ;
+      p^.alpha := ;
+      Inc(p);
+    end;
+  end;
+  Bitmap.InvalidateBitmap;
+}
+
+unit bcfilters;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, StrUtils, LCLProc, Math, BGRABitmap, BGRABitmapTypes;
+
+type
+  TBCSimpleFilter = (bcsNone, bcsInvert, bcsGrayScale, bcsGrayScaleA,
+    bcsGrayScaleBGRA, bcsNoise,
+    bcsNoiseA, bcsNoiseBW, bcsNoiseBWA, bcsTVScanLinesH, bcsTVScanLinesV,
+    bcsCheckeredL, bcsCheckeredR, bcsBlackAndWhite, bcsInstagram1,
+    bcsInstagram2, bcsInstagram3, bcsInstagram4, bcsInstagram5, bcsInstagram6,
+    bcsPhotoNoise, bcsPolaroid, bcsMovement);
+
+const
+  BCSimpleFilterStr: array [TBCSimpleFilter] of string =
+    ('None', 'Invert', 'GrayScale', 'GrayScaleA', 'GrayScaleBGRA',
+    'Noise', 'NoiseA', 'NoiseBW', 'NoiseBWA', 'TVScanLinesH', 'TVScanLinesV',
+    'CheckeredL', 'CheckeredR', 'BlackAndWhite', 'Instagram1', 'Instagram2',
+    'Instagram3', 'Instagram4', 'Instagram5', 'Instagram6', 'PhotoNoise',
+    'Polaroid', 'Movement');
+
+function StrToTBCSimpleFilter(const s: ansistring): TBCSimpleFilter;
+procedure BCSimpleFilterStrList(s: TStrings);
+
+{ Invert colors, keep alpha }
+procedure Invert(Bitmap: TBGRABitmap);
+{ Invert colors, advanced options }
+procedure Invert(Bitmap: TBGRABitmap; touchR, touchG, touchB, touchA: boolean);
+
+{ GrayScale, keep alpha }
+procedure GrayScale(Bitmap: TBGRABitmap);
+{ GrayScale, keep alpha, pallete }
+procedure GrayScale(Bitmap: TBGRABitmap; pallete: byte);
+{ GrayScale, alpha 255}
+procedure GrayScaleA(Bitmap: TBGRABitmap);
+{ GrayScale, using BGRAToGrayScale }
+procedure GrayScaleBGRA(Bitmap: TBGRABitmap);
+
+{ Noise random color, keep alpha }
+procedure Noise(Bitmap: TBGRABitmap);
+{ Noise random color, advanced options }
+procedure Noise(Bitmap: TBGRABitmap; touchR, touchG, touchB, touchA: boolean);
+{ Noise random color, random alpha }
+procedure NoiseA(Bitmap: TBGRABitmap);
+
+{ Noise random color, set max posible values }
+procedure NoiseMax(Bitmap: TBGRABitmap; maxR, maxG, maxB, maxA: byte);
+{ Noise random color, set max posible values, advanced options }
+procedure NoiseMax(Bitmap: TBGRABitmap; maxR, maxG, maxB, maxA: byte;
+  touchR, touchG, touchB, touchA: boolean);
+
+{ Noise black and white, keep alpha }
+procedure NoiseBW(Bitmap: TBGRABitmap);
+{ Noise black and white, random alpha }
+procedure NoiseBWA(Bitmap: TBGRABitmap);
+
+{ TV Lines Horizontal }
+procedure TVScanLinesH(Bitmap: TBGRABitmap);
+{ TV Lines Vertical }
+procedure TVScanLinesV(Bitmap: TBGRABitmap);
+{ Checkered Left aligned }
+procedure CheckeredL(Bitmap: TBGRABitmap);
+{ Checkered Right aligned }
+procedure CheckeredR(Bitmap: TBGRABitmap);
+
+{ Black and White, middle 128 }
+procedure BlackAndWhite(Bitmap: TBGRABitmap);
+{ Black and White, custom middle }
+procedure BlackAndWhite(Bitmap: TBGRABitmap; middle: byte);
+
+{ Instagram Filters }
+// sepia
+procedure Instagram1(Bitmap: TBGRABitmap);
+// blue-green
+procedure Instagram2(Bitmap: TBGRABitmap);
+// purple
+procedure Instagram3(Bitmap: TBGRABitmap);
+// blue 3 channels
+procedure Instagram4(Bitmap: TBGRABitmap);
+// green 3 channels
+procedure Instagram5(Bitmap: TBGRABitmap);
+// red 3 channels
+procedure Instagram6(Bitmap: TBGRABitmap);
+// white rounded border
+procedure Polaroid(Bitmap: TBGRABitmap);
+// blured bw noise
+procedure PhotoNoise(Bitmap: TBGRABitmap);
+
+{ Pixel movement }
+procedure Movement(Bitmap: TBGRABitmap; randXmin: NativeInt = -5;
+  randXmax: NativeInt = 5; randYmin: NativeInt = -5; randYmax: NativeInt = 5);
+
+procedure Zoomy(Bitmap: TBGRABitmap; xMy,yMy: extended);
+
+{ Filters that only need Bitmap as parameter }
+procedure SimpleFilter(Bitmap: TBGRABitmap; Filter: TBCSimpleFilter);
+
+implementation
+
+function StrToTBCSimpleFilter(const s: ansistring): TBCSimpleFilter;
+var
+  sf: TBCSimpleFilter;
+  ls: ansistring;
+begin
+  Result := sf;
+  ls := UTF8LowerCase(s);
+  for sf := low(TBCSimpleFilter) to high(TBCSimpleFilter) do
+    if ls = UTF8LowerCase(BCSimpleFilterStr[sf]) then
+    begin
+      Result := sf;
+      break;
+    end;
+end;
+
+procedure BCSimpleFilterStrList(s: TStrings);
+var
+  sf: TBCSimpleFilter;
+begin
+  for sf := low(TBCSimpleFilter) to high(TBCSimpleFilter) do
+    s.Add(BCSimpleFilterStr[sf]);
+end;
+
+procedure Invert(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := not p^.red;
+    p^.green := not p^.green;
+    p^.blue := not p^.blue;
+    //p^.alpha := not p^.alpha;
+    Inc(p);
+  end;
+end;
+
+procedure Invert(Bitmap: TBGRABitmap; touchR, touchG, touchB, touchA: boolean);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    if touchR then
+      p^.red := not p^.red;
+    if touchG then
+      p^.green := not p^.green;
+    if touchB then
+      p^.blue := not p^.blue;
+    if touchA then
+      p^.alpha := not p^.alpha;
+    Inc(p);
+  end;
+end;
+
+procedure GrayScale(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+  c: byte;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    c := (p^.red + p^.green + p^.blue) div 3;
+    p^.red := c;
+    p^.green := c;
+    p^.blue := c;
+    //p^.alpha := 255;
+    Inc(p);
+  end;
+end;
+
+procedure GrayScale(Bitmap: TBGRABitmap; pallete: byte);
+var
+  i, j: integer;
+  p: PBGRAPixel;
+  c: byte;
+  gpallete: array of byte;
+begin
+  if pallete = 0 then
+    pallete := 1
+  else if pallete = 255 then
+  begin
+    GrayScale(Bitmap);
+    exit;
+  end;
+
+  SetLength(gpallete, pallete);
+
+  for i := 0 to High(gpallete) do
+  begin
+    gpallete[i] := (255 * i) div 255;
+  end;
+
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    c := (p^.red + p^.green + p^.blue) div 3;
+
+    for j := 0 to High(gpallete) do
+    begin
+      if (c >= gpallete[j]) and (c <= gpallete[j + 1]) then
+      begin
+        c := gpallete[j];
+        break;
+      end;
+    end;
+
+    p^.red := c;
+    p^.green := c;
+    p^.blue := c;
+    //p^.alpha := 255;
+    Inc(p);
+  end;
+end;
+
+procedure GrayScaleA(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+  c: byte;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    c := (p^.red + p^.green + p^.blue) div 3;
+    p^.red := c;
+    p^.green := c;
+    p^.blue := c;
+    p^.alpha := 255;
+    Inc(p);
+  end;
+end;
+
+procedure GrayScaleBGRA(Bitmap: TBGRABitmap);
+begin
+  Bitmap.InplaceGrayscale;
+{var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^ := BGRAToGrayscale(p^);
+    Inc(p);
+  end;}
+end;
+
+procedure Noise(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := Random(256);
+    p^.green := Random(256);
+    p^.blue := Random(256);
+    //p^.alpha := Random(256);
+    Inc(p);
+  end;
+end;
+
+procedure Noise(Bitmap: TBGRABitmap; touchR, touchG, touchB, touchA: boolean);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    if touchR then
+      p^.red := Random(256);
+    if touchG then
+      p^.green := Random(256);
+    if touchB then
+      p^.blue := Random(256);
+    if touchA then
+      p^.alpha := Random(256);
+    Inc(p);
+  end;
+end;
+
+procedure NoiseA(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := Random(256);
+    p^.green := Random(256);
+    p^.blue := Random(256);
+    p^.alpha := Random(256);
+    Inc(p);
+  end;
+end;
+
+procedure NoiseBW(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+  c: byte;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    c := Random(2);
+    p^.red := c + 255;
+    p^.green := c + 255;
+    p^.blue := c + 255;
+    //p^.alpha := Random(256);
+    Inc(p);
+  end;
+end;
+
+procedure NoiseBWA(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+  c: byte;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    c := Random(2);
+    p^.red := c + 255;
+    p^.green := c + 255;
+    p^.blue := c + 255;
+    p^.alpha := Random(256);
+    Inc(p);
+  end;
+end;
+
+procedure TVScanLinesH(Bitmap: TBGRABitmap);
+var
+  x, y: integer;
+  p: PBGRAPixel;
+begin
+  for y := 0 to Bitmap.Height - 1 do
+  begin
+    p := Bitmap.Scanline[y];
+    for x := 0 to Bitmap.Width - 1 do
+    begin
+      if Odd(y) then
+      begin
+        p^.red := 0;
+        p^.green := 0;
+        p^.blue := 0;
+        //p^.alpha := 255;
+      end;
+      Inc(p);
+    end;
+  end;
+  Bitmap.InvalidateBitmap;
+end;
+
+procedure TVScanLinesV(Bitmap: TBGRABitmap);
+var
+  x, y: integer;
+  p: PBGRAPixel;
+begin
+  for y := 0 to Bitmap.Height - 1 do
+  begin
+    p := Bitmap.Scanline[y];
+    for x := 0 to Bitmap.Width - 1 do
+    begin
+      if Odd(x) then
+      begin
+        p^.red := 0;
+        p^.green := 0;
+        p^.blue := 0;
+        //p^.alpha := 255;
+      end;
+      Inc(p);
+    end;
+  end;
+  Bitmap.InvalidateBitmap;
+end;
+
+procedure CheckeredL(Bitmap: TBGRABitmap);
+var
+  x, y: integer;
+  p: PBGRAPixel;
+begin
+  for y := 0 to Bitmap.Height - 1 do
+  begin
+    p := Bitmap.Scanline[y];
+    for x := 0 to Bitmap.Width - 1 do
+    begin
+      if Odd(y) and Odd(x) or not Odd(y) and not Odd(x) then
+      begin
+        p^.red := 0;
+        p^.green := 0;
+        p^.blue := 0;
+        p^.alpha := 255;
+      end;
+      Inc(p);
+    end;
+  end;
+  Bitmap.InvalidateBitmap;
+end;
+
+procedure CheckeredR(Bitmap: TBGRABitmap);
+var
+  x, y: integer;
+  p: PBGRAPixel;
+begin
+  for y := 0 to Bitmap.Height - 1 do
+  begin
+    p := Bitmap.Scanline[y];
+    for x := 0 to Bitmap.Width - 1 do
+    begin
+      if not Odd(y) and Odd(x) or Odd(y) and not Odd(x) then
+      begin
+        p^.red := 0;
+        p^.green := 0;
+        p^.blue := 0;
+        p^.alpha := 255;
+      end;
+      Inc(p);
+    end;
+  end;
+  Bitmap.InvalidateBitmap;
+end;
+
+procedure BlackAndWhite(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+  c: byte;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    c := (p^.red + p^.green + p^.blue) div 3;
+    if c >= 128 then
+      c := 255
+    else
+      c := 0;
+    p^.red := c;
+    p^.green := c;
+    p^.blue := c;
+    if p^.alpha > 0 then
+      p^.alpha := 255;
+    Inc(p);
+  end;
+end;
+
+procedure BlackAndWhite(Bitmap: TBGRABitmap; middle: byte);
+var
+  i: integer;
+  p: PBGRAPixel;
+  c: byte;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    c := (p^.red + p^.green + p^.blue) div 3;
+    if c >= middle then
+      c := 255
+    else
+      c := 0;
+    p^.red := c;
+    p^.green := c;
+    p^.blue := c;
+    if p^.alpha > 0 then
+      p^.alpha := 255;
+    Inc(p);
+  end;
+end;
+
+procedure Movement(Bitmap: TBGRABitmap; randXmin: NativeInt = -5;
+  randXmax: NativeInt = 5; randYmin: NativeInt = -5; randYmax: NativeInt = 5);
+var
+  x, y: integer;
+  p: PBGRAPixel;
+begin
+  for y := 0 to Bitmap.Height - 1 do
+  begin
+    p := Bitmap.Scanline[y];
+    for x := 0 to Bitmap.Width - 1 do
+    begin
+      p^ := Bitmap.GetPixel(x + RandomRange(randXmin, randXmax), y + RandomRange(
+        randYmin, randYmax));
+      Inc(p);
+    end;
+  end;
+  Bitmap.InvalidateBitmap;
+end;
+
+procedure Zoomy(Bitmap: TBGRABitmap; xMy,yMy: extended);
+var
+  x, y: integer;
+  p: PBGRAPixel;
+begin
+  for y := 0 to Bitmap.Height - 1 do
+  begin
+    p := Bitmap.Scanline[y];
+    for x := 0 to Bitmap.Width - 1 do
+    begin
+      p^{.red} := Bitmap.GetPixel(x*xMy,y*yMy);
+      {p^.green := 0;
+      p^.blue := 0;
+      p^.alpha := 255;}
+      Inc(p);
+    end;
+  end;
+  Bitmap.InvalidateBitmap;
+end;
+
+procedure SimpleFilter(Bitmap: TBGRABitmap; Filter: TBCSimpleFilter);
+begin
+  case Filter of
+    bcsInvert: Invert(Bitmap);
+    bcsGrayScale: GrayScale(Bitmap);
+    bcsGrayScaleA: GrayScaleA(Bitmap);
+    bcsGrayScaleBGRA: GrayScaleBGRA(Bitmap);
+    bcsNoise: Noise(Bitmap);
+    bcsNoiseA: NoiseA(Bitmap);
+    bcsNoiseBW: NoiseBW(Bitmap);
+    bcsNoiseBWA: NoiseBWA(Bitmap);
+    bcsTVScanLinesH: TVScanLinesH(Bitmap);
+    bcsTVScanLinesV: TVScanLinesV(Bitmap);
+    bcsCheckeredL: CheckeredL(Bitmap);
+    bcsCheckeredR: CheckeredR(Bitmap);
+    bcsBlackAndWhite: BlackAndWhite(Bitmap);
+    bcsInstagram1: Instagram1(Bitmap);
+    bcsInstagram2: Instagram2(Bitmap);
+    bcsInstagram3: Instagram3(Bitmap);
+    bcsInstagram4: Instagram4(Bitmap);
+    bcsInstagram5: Instagram5(Bitmap);
+    bcsInstagram6: Instagram6(Bitmap);
+    bcsPhotoNoise: PhotoNoise(Bitmap);
+    bcsPolaroid: Polaroid(Bitmap);
+    bcsMovement: Movement(Bitmap);
+  end;
+end;
+
+procedure NoiseMax(Bitmap: TBGRABitmap; maxR, maxG, maxB, maxA: byte);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := Random(maxR + 1);
+    p^.green := Random(maxG + 1);
+    p^.blue := Random(maxB + 1);
+    p^.alpha := Random(maxA + 1);
+    Inc(p);
+  end;
+end;
+
+procedure NoiseMax(Bitmap: TBGRABitmap; maxR, maxG, maxB, maxA: byte;
+  touchR, touchG, touchB, touchA: boolean);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    if touchR then
+      p^.red := Random(maxR + 1);
+    if touchG then
+      p^.green := Random(maxG + 1);
+    if touchB then
+      p^.blue := Random(maxB + 1);
+    if touchA then
+      p^.alpha := Random(maxA + 1);
+    Inc(p);
+  end;
+end;
+
+// 1
+procedure Instagram1(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := round(p^.red * 0.75);
+    p^.green := round(p^.red * 0.50);
+    p^.blue := round(p^.red * 0.25);
+    //p^.alpha := ;
+    Inc(p);
+  end;
+end;
+
+// 2
+procedure Instagram2(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := round(p^.red * 0.75);
+    p^.green := round(p^.green * 0.50);
+    p^.blue := round(p^.blue * 0.25);
+    //p^.alpha := ;
+    Inc(p);
+  end;
+end;
+
+// 3
+procedure Instagram3(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := p^.red;
+    p^.green := round(p^.green * 0.50);
+    p^.blue := round(p^.blue * 0.50);
+    //p^.alpha := ;
+    Inc(p);
+  end;
+end;
+
+// 4
+procedure Instagram4(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := p^.blue;
+    p^.green := p^.blue;
+    p^.blue := p^.blue;
+    //p^.alpha := ;
+    Inc(p);
+  end;
+end;
+
+// 5
+procedure Instagram5(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := p^.green;
+    p^.green := p^.green;
+    p^.blue := p^.green;
+    //p^.alpha := ;
+    Inc(p);
+  end;
+end;
+
+// 6
+procedure Instagram6(Bitmap: TBGRABitmap);
+var
+  i: integer;
+  p: PBGRAPixel;
+begin
+  p := Bitmap.Data;
+
+  for i := Bitmap.NBPixels - 1 downto 0 do
+  begin
+    p^.red := p^.red;
+    p^.green := p^.red;
+    p^.blue := p^.red;
+    //p^.alpha := ;
+    Inc(p);
+  end;
+end;
+
+procedure Polaroid(Bitmap: TBGRABitmap);
+var
+  tmp: TBGRABitmap;
+begin
+  tmp := TBGRABitmap.Create(Bitmap.Width, Bitmap.Height, BGRAWhite);
+  tmp.EraseRoundRectAntialias(
+    Round(Bitmap.Width * 0.05),
+    Round(Bitmap.Height * 0.05),
+    Bitmap.Width - Round(Bitmap.Width * 0.05),
+    Bitmap.Height - Round(Bitmap.Height * 0.05),
+    Round(Bitmap.Width * 0.05),
+    Round(Bitmap.Height * 0.05),
+    255, []);
+  Bitmap.BlendImage(0, 0, tmp, boLinearBlend);
+  tmp.Free;
+end;
+
+procedure PhotoNoise(Bitmap: TBGRABitmap);
+var
+  tmp: TBGRABitmap;
+begin
+  tmp := TBGRABitmap.Create(Bitmap.Width, Bitmap.Height);
+  NoiseBWA(tmp);
+  BGRAReplace(tmp, tmp.FilterBlurRadial(1, rbFast));
+  Bitmap.BlendImageOver(0, 0, tmp, boLinearBlend, 25);
+  tmp.Free;
+end;
+
+end.

+ 239 - 0
bcgamegrid.pas

@@ -0,0 +1,239 @@
+unit BCGameGrid;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
+  BCBaseCtrls, BGRABitmap, BGRABitmapTypes, LCLProc;
+
+type
+
+  TOnRenderControl = procedure(Sender: TObject; Bitmap: TBGRABitmap;
+    r: TRect; n, x, y: integer) of object;
+  TOnClickControl = procedure(Sender: TObject; n, x, y: integer) of object;
+
+  { TBCCustomGrid }
+
+  TBCCustomGrid = class(TBCGraphicControl)
+  private
+    FBGRA: TBGRABitmap;
+    FGridWidth: integer;
+    FGridHeight: integer;
+    FBlockWidth: integer;
+    FBlockHeight: integer;
+    FOnRenderControl: TOnRenderControl;
+    FOnClickControl: TOnClickControl;
+  private
+    procedure SetFBlockHeight(AValue: integer);
+    procedure SetFBlockWidth(AValue: integer);
+    procedure SetFGridHeight(AValue: integer);
+    procedure SetFGridWidth(AValue: integer);
+    { Private declarations }
+  protected
+    { Protected declarations }
+    procedure Click; override;
+    procedure DrawControl; override;
+    procedure RenderControl; override;
+  public
+    { Public declarations }
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+    procedure RenderAndDrawControl;
+    property GridWidth: integer read FGridWidth write SetFGridWidth;
+    property GridHeight: integer read FGridHeight write SetFGridHeight;
+    property BlockWidth: integer read FBlockWidth write SetFBlockWidth;
+    property BlockHeight: integer read FBlockHeight write SetFBlockHeight;
+    property OnRenderControl: TOnRenderControl
+      read FOnRenderControl write FOnRenderControl;
+    property OnClickControl: TOnClickControl read FOnClickControl write FOnClickControl;
+  published
+    { Published declarations }
+  end;
+
+  TBCGameGrid = class(TBCCustomGrid)
+  published
+    property GridWidth;
+    property GridHeight;
+    property BlockWidth;
+    property BlockHeight;
+    // Support 'n, x, y'
+    property OnRenderControl;
+    property OnClickControl;
+    // 'Classic' events, to be changed...
+    property OnMouseDown;
+    property OnMouseMove;
+    property OnMouseUp;
+    // Ok...
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseWheel;
+    property OnMouseWheelDown;
+    property OnMouseWheelUp;
+  end;
+
+procedure Register;
+
+implementation
+
+procedure Register;
+begin
+  {$I bcgamegrid_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBCGameGrid]);
+end;
+
+{ TBCCustomGrid }
+
+procedure TBCCustomGrid.SetFBlockHeight(AValue: integer);
+begin
+  if FBlockHeight = AValue then
+    Exit;
+  if AValue < 1 then
+    FBlockHeight := 1
+  else
+    FBlockHeight := AValue;
+
+  RenderAndDrawControl;
+end;
+
+procedure TBCCustomGrid.SetFBlockWidth(AValue: integer);
+begin
+  if FBlockWidth = AValue then
+    Exit;
+  if AValue < 1 then
+    FBlockWidth := 1
+  else
+    FBlockWidth := AValue;
+
+  RenderAndDrawControl;
+end;
+
+procedure TBCCustomGrid.SetFGridHeight(AValue: integer);
+begin
+  if FGridHeight = AValue then
+    Exit;
+  if AValue < 1 then
+    FGridHeight := 1
+  else
+    FGridHeight := AValue;
+
+  RenderAndDrawControl;
+end;
+
+procedure TBCCustomGrid.SetFGridWidth(AValue: integer);
+begin
+  if FGridWidth = AValue then
+    Exit;
+  if AValue < 1 then
+    FGridWidth := 1
+  else
+    FGridWidth := AValue;
+
+  RenderAndDrawControl;
+end;
+
+procedure TBCCustomGrid.Click;
+var
+  n, x, y: integer;
+  r: TRect;
+var
+  pos: TPoint;
+begin
+  if (BlockWidth <= 0) or (BlockHeight <= 0) or (GridWidth <= 0) or
+    (GridHeight <= 0) then
+    Exit;
+
+  pos := ScreenToClient(Mouse.CursorPos);
+
+  n := 0;
+
+  for y := 0 to GridHeight - 1 do
+  begin
+    for x := 0 to GridWidth - 1 do
+    begin
+      r.Left := BlockWidth * x;
+      r.Top := BlockHeight * y;
+      r.Right := r.Left + BlockWidth;
+      r.Bottom := r.Top + BlockHeight;
+
+      if (pos.x >= r.Left) and (pos.x <= r.Right) and (pos.y >= r.Top) and
+        (pos.y <= r.Bottom) then
+      begin
+        //DebugLn(['TControl.Click ',DbgSName(Self)]);
+        if Assigned(FOnClickControl) and (Action <> nil) and
+          (not CompareMethods(TMethod(Action.OnExecute), TMethod(FOnClickControl))) then
+          // the OnClick is set and differs from the Action => call the OnClick
+          FOnClickControl(Self, n, x, y)
+        else if (not (csDesigning in ComponentState)) and (ActionLink <> nil) then
+          ActionLink.Execute(Self)
+        else if Assigned(FOnClickControl) then
+          FOnClickControl(Self, n, x, y);
+      end;
+
+      Inc(n);
+    end;
+  end;
+end;
+
+procedure TBCCustomGrid.DrawControl;
+begin
+  if FBGRA <> nil then
+    FBGRA.Draw(Canvas, 0, 0, False);
+end;
+
+procedure TBCCustomGrid.RenderControl;
+var
+  n, x, y: integer;
+  r: TRect;
+begin
+  if (BlockWidth <= 0) or (BlockHeight <= 0) or (GridWidth <= 0) or
+    (GridHeight <= 0) then
+    Exit;
+
+  if FBGRA <> nil then
+    FreeAndNil(FBGRA);
+
+  FBGRA := TBGRABitmap.Create(Width, Height);
+
+  n := 0;
+
+  for y := 0 to GridHeight - 1 do
+  begin
+    for x := 0 to GridWidth - 1 do
+    begin
+      r.Left := BlockWidth * x;
+      r.Top := BlockHeight * y;
+      r.Right := r.Left + BlockWidth;
+      r.Bottom := r.Top + BlockHeight;
+
+      FBGRA.Rectangle(r, BGRA(127, 127, 127, 127), BGRA(255, 255, 255, 127),
+        dmDrawWithTransparency);
+
+      if Assigned(FOnRenderControl) then
+        FOnRenderControl(Self, FBGRA, r, n, x, y);
+
+      Inc(n);
+    end;
+  end;
+end;
+
+procedure TBCCustomGrid.RenderAndDrawControl;
+begin
+  RenderControl;
+  Invalidate;
+end;
+
+constructor TBCCustomGrid.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+end;
+
+destructor TBCCustomGrid.Destroy;
+begin
+  if FBGRA <> nil then
+    FreeAndNil(FBGRA);
+  inherited Destroy;
+end;
+
+end.

+ 63 - 0
bcgamegrid_icon.lrs

@@ -0,0 +1,63 @@
+LazarusResources.Add('TBCGameGrid','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#5'nIDATx'#218#133#149'kLSg'#24#199#207#233'9'#244#244#6#135#182#20'z'#129
+  +#210'r'#137#10#148#137'Np'#19'/'#219#216#230#188#196'%'#243#155#151'mq'#153
+  +#238#155#153's'#223#212'D'#220#135#197#153'%'#243#195't'#209#205'-N'#151'E'
+  +#150',C'#151'EM&C''j'#4'Z0'#11#21#6#5#214'ri'#161#210'r'#232'}'#255#183'-p'
+  +#172'ekr8'#237'9'#127#158#231'}'#159#247#247#127#30#154#194#199'Z'#245#188
+  +#133#147'+K'#159'L'#141';'#212#5'F'#155'wl'#216#174')*'#174#13#250'}.6'#135
+  +#227#19#137#4#21#141#132#252#170'|'#173#217'76'#234#208#20#154'lS'#19#255#216
+  +'ymQm'#192#239'u'#201#149'y<M'#211'T$4'#231'W'#242#26#243#244#164#219#161#214
+  +#25'm'#1#191#207'N'#235#140'V'#137'e'#197#170'fN'#166'X'#209#213'~'#245'x'
+  +#133'm'#237';N'#199#221#11#149#184#187']'#206'[u'#141'['#14'=v'#220#253#9#226
+  +#1#189#185'r'#19#190'_'#152#215#212'5n=:'#227#247':'#131'~'#175#7#235'L@3'
+  +#152#214'|'#219#184'u'#207#153#190#238'?'#143#209'Z'#189#153#13#9#129#213#225
+  +'9A'#8#135#132'!'#8#165#184#194#233';'#173'),^'#227#27#31#233#196'w'#1#23'+z'
+  +#23#150'r'#242'R'#169'L'#174'B`''~'#199#211#23#209#196'T'#188#166#26'1'#221
+  +'t'#190#206#200'X'#150#173'<'#142#213#182#143#185#156#191'R'#162#143'2O-]'
+  +#191'm'#239#141#155'-g_'#199#246#5'*'#227#131#213#190'Qd'#174'l'#28'~'#220's'
+  +#212#231'q'#197#230#159#235#140#22#198'TV'#149#140'I'#171'u&'#150#147'+'#182
+  +'a'#171#131#168'y'#215#211#9'42Ci'#229#129#161#190#238'sH'#16#200'L'#128'U'
+  +#174'T'#242'ZK4'#28'j'#245'z\'#209#197#4'V'#150'a'#217'd'#204#228#14#10#244
+  +'%'#251#189'c#'#221'S'#227#163#183'3'#18'H'#171#235'_:'#221#217'v'#245'`$'
+  +#252#236#14'P'#190'u'#234'"'#211'sS'#19#238#179#226#29#20#24'J'#153#252#2'}2'
+  +'&'#205#23#24'X'#157#193'|'#0'?'#236'H'#208'&'#14#160#200'U'#203'j'#26'^'#254
+  +#226'a['#235#135'Xe K'#130#13'HP'#139#255';'#227#27#27#137#138#18#176'H'#144
+  +#140'I'#231'i'#10#25#185#138#223#134'z'#174#243#12#245'}U^S'#191#203'i'#191
+  +'{'#177#194#214#176'{'#248#177#163#3#248'.'#151'H'#24'!'#26#9';'#161'Y'#223
+  +#239#232#248#190#220#214#176#171#191#231#222'E'#131'e'#217'~'#143#203'yGg('
+  +#213#162'$'#177#128#127#202'E4}]'#237#151#141'eU'#239#131#166#239#176#3'=c]'
+  +#190#234#4'*'#16#199#131'o'#192#255#26#172#230'>'#185#131#241'A'#224#246#217
+  +#189#27'-'#159#132'C'#179#147'*^[>'#255#142#220'+j'#215#190#155#195#201#185
+  +#225'>'#251'MB'#16'4Si'#205#131#250#166#157#159#2#229#243'4'#196'Lhn'#150'`:'
+  +#3#175#12#194'S'#12#193#12#23#19#139'FX'#152#233#197#233#9'wG'#142#148#19#18
+  +#20'%'#153#127#7'm'#140'JP'#150#28#153#156#15#11#193'G'#180#132'!'#207'!'#161
+  +'$'#137'x'#156#146#202#21#181#136#233#153#199#180'9'#141#233#181#12'L9`z'#29
+  +#152'n'#6'E'#179'Y0'#221'B0'#29#233#239'9'#226'u'#139#14#25#152#22#151'U%c'
+  +#146#4'l4<W'#135'l>'#24#173'?#'#129#140#147')7'#206'LO'#222#6'E'#207#28'2'
+  +#140'V'#14#163'i8'#185#170#243'iL-'#172#16'|'#146#140'I'#243'Z'#3'c]Q'#151
+  +#221'h'#185'0'#218'v'#24#237#10#140#22#254#15#163'9'#237'GQ'#247#133#29'h'
+  +#129'iIyu'#202'h'#188'V'#207#202#149#185'Y'#141#166#200#205#151#25'-'#203#14
+  +#12#254#213'u'#14#205'nI'#163'E'#230'f[}'#227#163#11'; '#237#7'g'#150'2'#26
+  +#193#180#208'd'#205'j4tI'#169#237#133'WO?'#188#245#203'A`'#186#164#209'P'#255
+  +#179#232#160#177#197#231'&'#6#240#164#140#134#182#202'j'#245'%'#31#160'C'#238
+  +#6#142#135#234#155#222':'#217'q'#227#202#225#134#166#157''''#129#217#15'Z'
+  +#180'mB'#14'J'#208#5#205#30'h'#14#139'4'#167#160#185#12'M5'#193#20#154'n'#145
+  +#230#20'4'#31#211'jd'#147#202#20';'#192#252'8J'#244#8'B'#14'W(}O'#192'T{'#137
+  +#185#168'T'#23'eE'#239'B(Q'#21'Jd'#196#217#181#165#17#157#239#166#17#156#205
+  +'k'#136#217'KZ'#5#140'Vw'#2#7'r''2''\'#139''''#226'4'#17#227#15#13#18#164#155
+  +#222#220#247#219#245#31#191#220#154#171'.'#8#226'9'#240#167'a'#149#4#230#11
+  +#157#192#12'!'#152#174#27#232#189#127#12'5'#143#146#183'HC'#163#156#146#178
+  +#170#213#228#144#255' '#135#204'D'#163'a'#130#148'7'#18#18#254#206'8d'#14#173
+  +'bc`'#218'K0'#13'f'#193#212#10#163'i9N'#209#137#153#177'x'#6'E%0o0'#25'3'#153
+  +#192#138#137#150#205'h$'#193#134#237'o_'#7#166#155#145'`I'#163#161'U'#28#17
+  +''''#0'ELIEM'#243#2#166#177#212#14#158'1'#26#193#20#3#235#127#141#134'{g&'
+  +#166#152#146')'#163#161'91'#232#156#199'1'#176#166'''F'#7#206#147'a'#157#26
+  +#250'%'#181'p'#167#27#164#156'{'#240#251#207#31#177'l'#206#4#180'f'#172#20'C'
+  +#191#24'C'#127#212'^T\'#241#30'J'#164#246#186#135'Z'#152#28'i'#12'%'#246#227
+  +#224#205#19#163#131#189#213#245#175'|'#14#194'.'#17#31#176#10#21#191'#='#172
+  +#207'g'#12#253#246'\^S'#134'EE'#179#13'}h'#246#165'5&B'#144'x'#232'C'#179#15
+  +#154#175'1'#212'M'#146#224#204't^H'#8'J'#211#8#138#135'~'#178's'#166#17#140
+  +'Q'#25'C?'#141'kLT'#181#184'H#'#203#211#232#130#255#2'BE1<'#194#178'[O'#0#0#0
+  +#0'IEND'#174'B`'#130
+]);

+ 1008 - 0
bcimagebutton.pas

@@ -0,0 +1,1008 @@
+unit BCImageButton;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Forms, Controls, Graphics, LResources, LMessages, ExtCtrls,
+  { BGRAControls }
+  BCBaseCtrls, BCEffect,
+  { BGRABitmap }
+  BGRABitmap, BGRABitmapTypes, BGRASliceScaling;
+
+{off $DEFINE DEBUG}
+
+function CalculateAspectRatioH(W1, H1, W2: integer): integer; //result H2
+function CalculateAspectRatioW(W1, H1, H2: integer): integer; //result W2
+function CalculateDestRect(ImageW, ImageH, DestW, DestH: integer;
+  Stretch, Proportional, Center: boolean): TRect;
+procedure AssignFontToBGRA(Source: TFont; Dest: TBGRABitmap);
+
+type
+  TBCGraphicButtonState = (gbsNormal, gbsHover, gbsActive, gbsDisabled);
+
+  TOnRenderControl = procedure(Sender: TObject; Bitmap: TBGRABitmap;
+    State: TBCGraphicButtonState) of object;
+
+type
+
+  { TBCGraphicButton }
+
+  TBCGraphicButton = class(TBCGraphicControl)
+  protected
+    FState: TBCGraphicButtonState;
+    FModalResult: TModalResult;
+  protected
+    procedure DoClick; virtual;
+    procedure DoMouseDown; virtual;
+    procedure DoMouseUp; virtual;
+    procedure DoMouseEnter; virtual;
+    procedure DoMouseLeave; virtual;
+  protected
+    procedure Click; override;
+    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
+      X, Y: integer); override;
+    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: integer); override;
+    procedure MouseEnter; override;
+    procedure MouseLeave; override;
+  public
+    property ModalResult: TModalResult
+      read FModalResult write FModalResult default mrNone;
+  end;
+
+  { TBCXButton }
+  TBCXButton = class(TBCGraphicButton)
+  private
+    FOnRenderControl: TOnRenderControl;
+    FBGRANormal, FBGRAHover, FBGRAActive, FBGRADisabled: TBGRABitmap;
+  protected
+    procedure DrawControl; override;
+    procedure RenderControl; override;
+  public
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+  published
+    property OnRenderControl: TOnRenderControl
+      read FOnRenderControl write FOnRenderControl;
+  end;
+
+  { TBCSliceScalingOptions }
+
+  TBCCustomSliceScalingOptions = class(TPersistent)
+  protected
+    FOwner: TControl;
+    FBitmap: TBGRABitmap;
+    FAutoDetectRepeat, FRepeatTop, FRepeatLeft, FRepeatMiddleHorizontal,
+    FRepeatMiddleVertical, FRepeatRight, FRepeatBottom: boolean;
+    FMarginTop, FMarginRight, FMarginBottom, FMarginLeft, FNumberOfItems: integer;
+    FDirection: TSliceScalingDirection;
+    FDrawMode: TDrawMode;
+    FResampleMode: TResampleMode;
+    FResampleFilter: TResampleFilter;
+  private
+    procedure SetFBitmap(AValue: TBGRABitmap);
+    procedure SetFMarginBottom(AValue: integer);
+    procedure SetFMarginLeft(AValue: integer);
+    procedure SetFMarginRight(AValue: integer);
+    procedure SetFMarginTop(AValue: integer);
+    procedure SetFAutoDetectRepeat(AValue: boolean);
+    procedure SetFDirection(AValue: TSliceScalingDirection);
+    procedure SetFDrawMode(AValue: TDrawMode);
+    procedure SetFNumberOfItems(AValue: integer);
+    procedure SetFRepeatBottom(AValue: boolean);
+    procedure SetFRepeatLeft(AValue: boolean);
+    procedure SetFRepeatMiddleHorizontal(AValue: boolean);
+    procedure SetFRepeatMiddleVertical(AValue: boolean);
+    procedure SetFRepeatRight(AValue: boolean);
+    procedure SetFRepeatTop(AValue: boolean);
+    procedure SetFResampleFilter(AValue: TResampleFilter);
+    procedure SetFResampleMode(AValue: TResampleMode);
+  public
+    constructor Create(AOwner: TControl);
+    destructor Destroy; override;
+  published
+    property Bitmap: TBGRABitmap read FBitmap write SetFBitmap;
+    property AutoDetectRepeat: boolean read FAutoDetectRepeat
+      write SetFAutoDetectRepeat default False;
+    property RepeatTop: boolean read FRepeatTop write SetFRepeatTop default False;
+    property RepeatLeft: boolean read FRepeatLeft write SetFRepeatLeft default False;
+    property RepeatMiddleHorizontal: boolean
+      read FRepeatMiddleHorizontal write SetFRepeatMiddleHorizontal default False;
+    property RepeatMiddleVertical: boolean read FRepeatMiddleVertical
+      write SetFRepeatMiddleVertical default False;
+    property RepeatRight: boolean read FRepeatRight write SetFRepeatRight default False;
+    property RepeatBottom: boolean
+      read FRepeatBottom write SetFRepeatBottom default False;
+    property MarginTop: integer read FMarginTop write SetFMarginTop default 0;
+    property MarginRight: integer read FMarginRight write SetFMarginRight default 0;
+    property MarginBottom: integer read FMarginBottom write SetFMarginBottom default 0;
+    property MarginLeft: integer read FMarginLeft write SetFMarginLeft default 0;
+    property NumberOfItems: integer
+      read FNumberOfItems write SetFNumberOfItems default 1;
+    property Direction: TSliceScalingDirection read FDirection write SetFDirection;
+    property DrawMode: TDrawMode read FDrawMode write SetFDrawMode default
+      dmDrawWithTransparency;
+    property ResampleMode: TResampleMode read FResampleMode
+      write SetFResampleMode default rmFineResample;
+    property ResampleFilter: TResampleFilter read FResampleFilter
+      write SetFResampleFilter default rfBestQuality;
+  end;
+
+  { TBCImageButtonSliceScalingOptions }
+
+  TBCImageButtonSliceScalingOptions = class(TBCCustomSliceScalingOptions)
+  private
+    procedure SetFCenter(AValue: boolean);
+    procedure SetFProportional(AValue: boolean);
+    procedure SetFStretch(AValue: boolean);
+  protected
+    FCenter, FStretch, FProportional: boolean;
+  published
+    property NumberOfItems: integer read FNumberOfItems default 4;
+    property Center: boolean read FCenter write SetFCenter default True;
+    property Stretch: boolean read FStretch write SetFStretch default True;
+    property Proportional: boolean
+      read FProportional write SetFProportional default False;
+  public
+    constructor Create(AOwner: TControl);
+  end;
+
+  { TBCCustomImageButton }
+
+  TBCCustomImageButton = class(TBCGraphicButton)
+  private
+    { Private declarations }
+    {$IFDEF DEBUG}
+    FDrawCount: integer;
+    FRenderCount: integer;
+    {$ENDIF}
+    FBitmapOptions: TBCImageButtonSliceScalingOptions;
+    FBGRAMultiSliceScaling: TBGRAMultiSliceScaling;
+    FBGRANormal, FBGRAHover, FBGRAActive, FBGRADisabled: TBGRABitmap;
+    FDestRect: TRect;
+    FTimer: TTimer;
+    FFade: TFading;
+    procedure SetFBitmapOptions(AValue: TBCImageButtonSliceScalingOptions);
+    procedure Fade(Sender: TObject);
+  protected
+    { Protected declarations }
+    procedure DrawControl; override;
+    procedure RenderControl; override;
+    procedure CMChanged(var Message: TLMessage); message CM_CHANGED; virtual;
+    {$IFDEF DEBUG}
+    function GetDebugText: string;
+    {$ENDIF}
+    procedure DoMouseDown; override;
+    procedure DoMouseUp; override;
+    procedure DoMouseEnter; override;
+    procedure DoMouseLeave; override;
+  public
+    { Public declarations }
+    property BitmapOptions: TBCImageButtonSliceScalingOptions
+      read FBitmapOptions write SetFBitmapOptions;
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+  published
+    { Published declarations }
+  end;
+
+  TBCImageButton = class(TBCCustomImageButton)
+  published
+    property Action;
+    property Align;
+    property Anchors;
+    //property Animation;
+    property AutoSize;
+    //property AutoSizeExtraHorizontal;
+    //property AutoSizeExtraVertical;
+    property BidiMode;
+    //property Bitmap;
+    //property BitmapFile;
+    property BitmapOptions;
+    property BorderSpacing;
+    property Caption;
+    //property Checked;
+    property Color;
+    property Constraints;
+    property DragCursor;
+    property DragKind;
+    property DragMode;
+    property Enabled;
+    property Font;
+    property ModalResult;
+    property OnChangeBounds;
+    property OnClick;
+    property OnContextPopup;
+    property OnDragDrop;
+    property OnDragOver;
+    property OnEndDrag;
+    property OnMouseDown;
+    property OnMouseMove;
+    property OnMouseUp;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseWheel;
+    property OnMouseWheelDown;
+    property OnMouseWheelUp;
+    //property OnPlaySound;
+    //property OnRedraw;
+    property OnResize;
+    property OnStartDrag;
+    property ParentBidiMode;
+    property ParentFont;
+    property ParentShowHint;
+    property PopupMenu;
+    //property Shadow;
+    property ShowHint;
+    //property Sound;
+    //property SoundClick;
+    //property SoundEnter;
+    //property TextVisible;
+    //property Toggle;
+    property Visible;
+  end;
+
+procedure Register;
+
+implementation
+
+procedure Register;
+begin
+  {$I bcimagebutton_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBCImageButton]);
+  RegisterComponents('BGRA Controls', [TBCXButton]);
+end;
+
+function CalculateAspectRatioH(W1, H1, W2: integer): integer;
+begin
+  Result := Round(H1 / W1 * W2);
+end;
+
+function CalculateAspectRatioW(W1, H1, H2: integer): integer;
+begin
+  Result := Round(W1 / H1 * H2);
+end;
+
+function CalculateDestRect(ImageW, ImageH, DestW, DestH: integer;
+  Stretch, Proportional, Center: boolean): TRect;
+var
+  w: integer;
+  h: integer;
+begin
+  // Stretch or Proportional when Image (Width or Height) is bigger than Destination
+  if Stretch or (Proportional and ((ImageW > DestW) or (ImageH > DestH))) then
+  begin
+    // Proportional when Image (Width or Height) is bigger than 0
+    if Proportional and (ImageW > 0) and (ImageH > 0) then
+    begin
+      w := DestW;
+      h := CalculateAspectRatioH(ImageW, ImageH, DestW);
+      if h > DestH then
+      begin
+        h := DestH;
+        w := CalculateAspectRatioW(ImageW, ImageH, DestH);
+      end;
+      ImageW := w;
+      ImageH := h;
+    end
+    // Stretch not Proportional or when Image (Width or Height) is 0
+    else
+    begin
+      ImageW := DestW;
+      ImageH := DestH;
+    end;
+  end;
+
+  Result := Rect(0, 0, ImageW, ImageH);
+
+  // Center: Destination (Width or Height) - Image divided by 2
+  if Center then
+  begin
+    Result.Left := Round((DestW - ImageW) div 2);
+    Result.Top := Round((DestH - ImageH) div 2);
+  end;
+end;
+
+procedure AssignFontToBGRA(Source: TFont; Dest: TBGRABitmap);
+begin
+  Dest.FontAntialias := True;
+
+  Dest.FontName := Source.Name;
+  Dest.FontStyle := Source.Style;
+  Dest.FontOrientation := Source.Orientation;
+
+  case Source.Quality of
+    fqNonAntialiased: Dest.FontQuality := fqSystem;
+    fqAntialiased: Dest.FontQuality := fqFineAntialiasing;
+    fqProof: Dest.FontQuality := fqFineClearTypeRGB;
+    fqDefault, fqDraft, fqCleartype, fqCleartypeNatural: Dest.FontQuality :=
+        fqSystemClearType;
+  end;
+
+  Dest.FontHeight := -Source.Height;
+end;
+
+{ TBCXButton }
+
+procedure TBCXButton.DrawControl;
+begin
+  if Enabled then
+    case FState of
+      gbsNormal: FBGRANormal.Draw(Canvas, 0, 0, False);
+      gbsHover: FBGRAHover.Draw(Canvas, 0, 0, False);
+      gbsActive: FBGRAActive.Draw(Canvas, 0, 0, False);
+    end
+  else
+    FBGRADisabled.Draw(Canvas, 0, 0, False);
+end;
+
+procedure TBCXButton.RenderControl;
+begin
+  { Free cache bitmaps }
+  if FBGRANormal <> nil then
+    FreeAndNil(FBGRANormal);
+  if FBGRAHover <> nil then
+    FreeAndNil(FBGRAHover);
+  if FBGRAActive <> nil then
+    FreeAndNil(FBGRAActive);
+  if FBGRADisabled <> nil then
+    FreeAndNil(FBGRADisabled);
+
+  { Create cache bitmaps }
+  FBGRANormal := TBGRABitmap.Create(Width, Height);
+  FBGRAHover := TBGRABitmap.Create(Width, Height);
+  FBGRAActive := TBGRABitmap.Create(Width, Height);
+  FBGRADisabled := TBGRABitmap.Create(Width, Height);
+
+  if Assigned(FOnRenderControl) then
+  begin
+    FOnRenderControl(Self, FBGRANormal, gbsNormal);
+    FOnRenderControl(Self, FBGRAHover, gbsHover);
+    FOnRenderControl(Self, FBGRAActive, gbsActive);
+    FOnRenderControl(Self, FBGRADisabled, gbsDisabled);
+  end;
+end;
+
+constructor TBCXButton.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+end;
+
+destructor TBCXButton.Destroy;
+begin
+  if FBGRANormal <> nil then
+    FreeAndNil(FBGRANormal);
+  if FBGRAHover <> nil then
+    FreeAndNil(FBGRAHover);
+  if FBGRAActive <> nil then
+    FreeAndNil(FBGRAActive);
+  if FBGRADisabled <> nil then
+    FreeAndNil(FBGRADisabled);
+  inherited Destroy;
+end;
+
+{ TBCImageButtonSliceScalingOptions }
+
+procedure TBCImageButtonSliceScalingOptions.SetFCenter(AValue: boolean);
+begin
+  if FCenter = AValue then
+    Exit;
+  FCenter := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCImageButtonSliceScalingOptions.SetFProportional(AValue: boolean);
+begin
+  if FProportional = AValue then
+    Exit;
+  FProportional := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCImageButtonSliceScalingOptions.SetFStretch(AValue: boolean);
+begin
+  if FStretch = AValue then
+    Exit;
+  FStretch := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+constructor TBCImageButtonSliceScalingOptions.Create(AOwner: TControl);
+begin
+  inherited Create(AOwner);
+  FNumberOfItems := 4;
+  FCenter := True;
+  FProportional := False;
+  FStretch := True;
+end;
+
+{ TBCCustomSliceScalingOptions }
+
+procedure TBCCustomSliceScalingOptions.SetFBitmap(AValue: TBGRABitmap);
+begin
+  if FBitmap = AValue then
+    Exit;
+  FBitmap := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFMarginBottom(AValue: integer);
+begin
+  if FMarginBottom = AValue then
+    Exit;
+  FMarginBottom := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFMarginLeft(AValue: integer);
+begin
+  if FMarginLeft = AValue then
+    Exit;
+  FMarginLeft := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFMarginRight(AValue: integer);
+begin
+  if FMarginRight = AValue then
+    Exit;
+  FMarginRight := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFMarginTop(AValue: integer);
+begin
+  if FMarginTop = AValue then
+    Exit;
+  FMarginTop := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFAutoDetectRepeat(AValue: boolean);
+begin
+  if FAutoDetectRepeat = AValue then
+    Exit;
+  FAutoDetectRepeat := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFDirection(AValue: TSliceScalingDirection);
+begin
+  if FDirection = AValue then
+    Exit;
+  FDirection := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFDrawMode(AValue: TDrawMode);
+begin
+  if FDrawMode = AValue then
+    Exit;
+  FDrawMode := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFNumberOfItems(AValue: integer);
+begin
+  if FNumberOfItems = AValue then
+    Exit;
+  FNumberOfItems := AValue;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFRepeatBottom(AValue: boolean);
+begin
+  if FRepeatBottom = AValue then
+    Exit;
+  FRepeatBottom := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFRepeatLeft(AValue: boolean);
+begin
+  if FRepeatLeft = AValue then
+    Exit;
+  FRepeatLeft := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFRepeatMiddleHorizontal(AValue: boolean);
+begin
+  if FRepeatMiddleHorizontal = AValue then
+    Exit;
+  FRepeatMiddleHorizontal := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFRepeatMiddleVertical(AValue: boolean);
+begin
+  if FRepeatMiddleVertical = AValue then
+    Exit;
+  FRepeatMiddleVertical := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFRepeatRight(AValue: boolean);
+begin
+  if FRepeatRight = AValue then
+    Exit;
+  FRepeatRight := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFRepeatTop(AValue: boolean);
+begin
+  if FRepeatTop = AValue then
+    Exit;
+  FRepeatTop := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFResampleFilter(AValue: TResampleFilter);
+begin
+  if FResampleFilter = AValue then
+    Exit;
+  FResampleFilter := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+procedure TBCCustomSliceScalingOptions.SetFResampleMode(AValue: TResampleMode);
+begin
+  if FResampleMode = AValue then
+    Exit;
+  FResampleMode := AValue;
+
+  FOwner.Perform(CM_CHANGED, 0, 0);
+  FOwner.Invalidate;
+end;
+
+constructor TBCCustomSliceScalingOptions.Create(AOwner: TControl);
+begin
+  FOwner := AOwner;
+  FBitmap := nil;
+  FAutoDetectRepeat := False;
+  FRepeatTop := False;
+  FRepeatLeft := False;
+  FRepeatMiddleHorizontal := False;
+  FRepeatMiddleVertical := False;
+  FRepeatRight := False;
+  FRepeatBottom := False;
+  FMarginTop := 0;
+  FMarginRight := 0;
+  FMarginBottom := 0;
+  FMarginLeft := 0;
+  FNumberOfItems := 1;
+  FDirection := sdVertical;
+  FDrawMode := dmDrawWithTransparency;
+  FResampleMode := rmFineResample;
+  FResampleFilter := rfBestQuality;
+  inherited Create;
+end;
+
+destructor TBCCustomSliceScalingOptions.Destroy;
+begin
+  if FBitmap <> nil then
+    FreeAndNil(FBitmap);
+  inherited Destroy;
+end;
+
+{ TBCGraphicButton }
+
+procedure TBCGraphicButton.DoClick;
+var
+  Form: TCustomForm;
+begin
+  if ModalResult <> mrNone then
+  begin
+    Form := GetParentForm(Self);
+    if Form <> nil then
+      Form.ModalResult := ModalResult;
+  end;
+end;
+
+procedure TBCGraphicButton.DoMouseDown;
+var
+  NewState: TBCGraphicButtonState;
+begin
+  NewState := gbsActive;
+
+  if NewState <> FState then
+  begin
+    FState := NewState;
+    Invalidate;
+  end;
+end;
+
+procedure TBCGraphicButton.DoMouseUp;
+var
+  NewState: TBCGraphicButtonState;
+  p: TPoint;
+begin
+  p := ScreenToClient(Mouse.CursorPos);
+
+  if (p.x >= 0) and (p.x <= Width) and (p.y >= 0) and (p.y <= Height) then
+    NewState := gbsHover
+  else
+    NewState := gbsNormal;
+
+  if NewState <> FState then
+  begin
+    FState := NewState;
+    Invalidate;
+  end;
+end;
+
+procedure TBCGraphicButton.DoMouseEnter;
+var
+  NewState: TBCGraphicButtonState;
+begin
+  if Enabled then
+    NewState := gbsHover
+  else
+  begin
+    FState := gbsNormal;
+    NewState := FState;
+  end;
+
+  if NewState <> FState then
+  begin
+    FState := NewState;
+    Invalidate;
+  end;
+end;
+
+procedure TBCGraphicButton.DoMouseLeave;
+var
+  NewState: TBCGraphicButtonState;
+begin
+  if Enabled then
+    NewState := gbsNormal
+  else
+  begin
+    FState := gbsNormal;
+    NewState := FState;
+  end;
+
+  if NewState <> FState then
+  begin
+    FState := NewState;
+    Invalidate;
+  end;
+end;
+
+procedure TBCGraphicButton.Click;
+begin
+  DoClick;
+  inherited Click;
+end;
+
+procedure TBCGraphicButton.MouseDown(Button: TMouseButton; Shift: TShiftState;
+  X, Y: integer);
+begin
+  inherited MouseDown(Button, Shift, X, Y);
+  if Button = mbLeft then
+    DoMouseDown;
+end;
+
+procedure TBCGraphicButton.MouseUp(Button: TMouseButton; Shift: TShiftState;
+  X, Y: integer);
+begin
+  inherited MouseUp(Button, Shift, X, Y);
+  DoMouseUp;
+end;
+
+procedure TBCGraphicButton.MouseEnter;
+begin
+  inherited MouseEnter;
+  DoMouseEnter;
+end;
+
+procedure TBCGraphicButton.MouseLeave;
+begin
+  inherited MouseLeave;
+  DoMouseLeave;
+end;
+
+{ TBCCustomImageButton }
+
+procedure TBCCustomImageButton.Fade(Sender: TObject);
+begin
+  if FFade.Mode <> fmSuspended then
+    Invalidate;
+end;
+
+procedure TBCCustomImageButton.SetFBitmapOptions(AValue:
+  TBCImageButtonSliceScalingOptions);
+begin
+  if FBitmapOptions = AValue then
+    Exit;
+  FBitmapOptions := AValue;
+end;
+
+procedure TBCCustomImageButton.DrawControl;
+var
+  temp: TBGRABitmap;
+begin
+  if Color <> clDefault then
+  begin
+    Canvas.Brush.Color := Color;
+    Canvas.FillRect(0, 0, Width, Height);
+  end;
+
+  if Enabled then
+  begin
+    case FState of
+      gbsNormal, gbsHover: FBGRANormal.Draw(Canvas, FDestRect.Left,
+          FDestRect.Top, False);
+      gbsActive: FBGRAActive.Draw(Canvas, FDestRect.Left, FDestRect.Top, False);
+    end;
+
+    temp := TBGRABitmap.Create(Width, Height);
+    FFade.Execute;
+    FFade.PutImage(temp, 0, 0, FBGRAHover);
+
+    temp.Draw(Canvas, FDestRect.Left, FDestRect.Top, False);
+    temp.Free;
+  end
+  else
+    FBGRADisabled.Draw(Canvas, FDestRect.Left, FDestRect.Top, False);
+
+  {$IFDEF DEBUG}
+  FDrawCount += 1;
+  {$ENDIF}
+
+  {$IFDEF DEBUG}
+  Canvas.Brush.Color := clWhite;
+  Canvas.TextOut(0, 0, GetDebugText);
+  {$ENDIF}
+end;
+
+procedure TBCCustomImageButton.RenderControl;
+
+  procedure DrawText(ABitmap: TBGRABitmap);
+  begin
+    AssignFontToBGRA(Font, ABitmap);
+    ABitmap.TextRect(Rect(0, 0, Width, Height), Caption, taCenter, tlCenter,
+      ColorToBGRA(ColorToRGB(Font.Color)));
+  end;
+
+{$IFDEF DEBUG}
+const
+  Debug = True;
+{$ELSE}
+const
+  Debug = False;
+{$ENDIF}
+var
+  i: integer;
+begin
+  { Free cache bitmaps }
+  if FBGRANormal <> nil then
+    FreeAndNil(FBGRANormal);
+  if FBGRAHover <> nil then
+    FreeAndNil(FBGRAHover);
+  if FBGRAActive <> nil then
+    FreeAndNil(FBGRAActive);
+  if FBGRADisabled <> nil then
+    FreeAndNil(FBGRADisabled);
+
+  { Create cache bitmaps }
+  FBGRANormal := TBGRABitmap.Create(Width, Height);
+  FBGRAHover := TBGRABitmap.Create(Width, Height);
+  FBGRAActive := TBGRABitmap.Create(Width, Height);
+  FBGRADisabled := TBGRABitmap.Create(Width, Height);
+
+  { Free FBGRAMultiSliceScaling }
+  if FBGRAMultiSliceScaling <> nil then
+    FreeAndNil(FBGRAMultiSliceScaling);
+
+  if (FBitmapOptions.Bitmap <> nil) then
+  begin
+    { Create FBGRAMultiSliceScaling }
+    FBGRAMultiSliceScaling := TBGRAMultiSliceScaling.Create(FBitmapOptions.Bitmap,
+      FBitmapOptions.MarginTop, FBitmapOptions.MarginRight,
+      FBitmapOptions.MarginBottom, FBitmapOptions.MarginLeft,
+      FBitmapOptions.NumberOfItems, FBitmapOptions.Direction);
+
+    { Set FBGRAMultiSliceScaling properties }
+    for i := 0 to High(FBGRAMultiSliceScaling.SliceScalingArray) do
+    begin
+      FBGRAMultiSliceScaling.SliceScalingArray[i].ResampleFilter :=
+        FBitmapOptions.ResampleFilter;
+      FBGRAMultiSliceScaling.SliceScalingArray[i].ResampleMode :=
+        FBitmapOptions.ResampleMode;
+      FBGRAMultiSliceScaling.SliceScalingArray[i].DrawMode := FBitmapOptions.DrawMode;
+      FBGRAMultiSliceScaling.SliceScalingArray[i].SliceRepeat[srpTop] :=
+        FBitmapOptions.RepeatTop;
+      FBGRAMultiSliceScaling.SliceScalingArray[i].SliceRepeat[srpBottom] :=
+        FBitmapOptions.RepeatBottom;
+      FBGRAMultiSliceScaling.SliceScalingArray[i].SliceRepeat[srpLeft] :=
+        FBitmapOptions.RepeatLeft;
+      FBGRAMultiSliceScaling.SliceScalingArray[i].SliceRepeat[srpRight] :=
+        FBitmapOptions.RepeatRight;
+      FBGRAMultiSliceScaling.SliceScalingArray[i].SliceRepeat[srpMiddleHorizontal] :=
+        FBitmapOptions.RepeatMiddleHorizontal;
+      FBGRAMultiSliceScaling.SliceScalingArray[i].SliceRepeat[srpMiddleVertical] :=
+        FBitmapOptions.RepeatMiddleVertical;
+      if FBitmapOptions.AutoDetectRepeat then
+        FBGRAMultiSliceScaling.SliceScalingArray[i].AutodetectRepeat;
+    end;
+
+    { Calculate FDestRect }
+    FDestRect := CalculateDestRect(
+      FBGRAMultiSliceScaling.SliceScalingArray[0].BitmapWidth,
+      FBGRAMultiSliceScaling.SliceScalingArray[0].BitmapHeight, Width,
+      Height, FBitmapOptions.Stretch, FBitmapOptions.Proportional,
+      FBitmapOptions.Center);
+
+    { Draw in cache bitmaps }
+    FBGRAMultiSliceScaling.Draw(0, FBGRANormal, 0, 0, FDestRect.Right,
+      FDestRect.Bottom, Debug);
+    FBGRAMultiSliceScaling.Draw(1, FBGRAHover, 0, 0, FDestRect.Right,
+      FDestRect.Bottom, Debug);
+    FBGRAMultiSliceScaling.Draw(2, FBGRAActive, 0, 0, FDestRect.Right,
+      FDestRect.Bottom, Debug);
+    FBGRAMultiSliceScaling.Draw(3, FBGRADisabled, 0, 0, FDestRect.Right,
+      FDestRect.Bottom, Debug);
+
+    { Draw Text }
+    DrawText(FBGRANormal);
+    DrawText(FBGRAHover);
+    DrawText(FBGRAActive);
+    DrawText(FBGRADisabled);
+  end
+  else
+  begin
+    { Calculate FDestRect }
+    FDestRect := Rect(0, 0, Width, Height);
+
+    { Draw default style in cache bitmaps }
+    FBGRANormal.Rectangle(0, 0, Width, Height, BGRABlack, BGRA(0, 0, 255),
+      dmSet);
+    FBGRAHover.Rectangle(0, 0, Width, Height, BGRABlack, BGRA(0, 255, 0),
+      dmSet);
+    FBGRAActive.Rectangle(0, 0, Width, Height, BGRABlack, BGRA(255, 0, 0),
+      dmSet);
+    FBGRADisabled.Rectangle(0, 0, Width, Height, BGRABlack, BGRA(100, 100, 100),
+      dmSet);
+
+    { Draw Text }
+    DrawText(FBGRANormal);
+    DrawText(FBGRAHover);
+    DrawText(FBGRAActive);
+    DrawText(FBGRADisabled);
+  end;
+
+  {$IFDEF DEBUG}
+  FRenderCount += 1;
+  {$ENDIF}
+end;
+
+procedure TBCCustomImageButton.CMChanged(var Message: TLMessage);
+begin
+  if csReadingState in ControlState then
+    Exit;
+  RenderControl;
+end;
+
+{$IFDEF DEBUG}
+function TBCCustomImageButton.GetDebugText: string;
+begin
+  Result := 'Render: ' + IntToStr(FRenderCount) + ' Draw: ' + IntToStr(FDrawCount);
+end;
+
+{$ENDIF}
+
+procedure TBCCustomImageButton.DoMouseDown;
+begin
+  FFade.Mode := fmFadeOut;
+  inherited DoMouseDown;
+end;
+
+procedure TBCCustomImageButton.DoMouseUp;
+begin
+  FFade.Mode := fmFadeIn;
+  inherited DoMouseUp;
+end;
+
+procedure TBCCustomImageButton.DoMouseEnter;
+begin
+  FFade.Mode := fmFadeIn;
+  inherited DoMouseEnter;
+end;
+
+procedure TBCCustomImageButton.DoMouseLeave;
+begin
+  FFade.Mode := fmFadeOut;
+  inherited DoMouseLeave;
+end;
+
+constructor TBCCustomImageButton.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  {$IFDEF DEBUG}
+  FDrawCount := 0;
+  FRenderCount := 0;
+  {$ENDIF}
+  DisableAutoSizing;
+  Include(FControlState, csCreating);
+  BeginUpdate;
+  try
+    with GetControlClassDefaultSize do
+      SetInitialBounds(0, 0, CX, CY);
+    ControlStyle := ControlStyle + [csAcceptsControls];
+
+    FBitmapOptions := TBCImageButtonSliceScalingOptions.Create(Self);
+    {FBitmapOptions.Bitmap := TBGRABitmap.Create(1,4,BGRAWhite);
+    FBitmapOptions.Bitmap.SetPixel(0,0,BGRA(255,0,0,255));
+    FBitmapOptions.Bitmap.SetPixel(0,1,BGRA(0,255,0,255));
+    FBitmapOptions.Bitmap.SetPixel(0,2,BGRA(0,0,255,255));
+    FBitmapOptions.Bitmap.SetPixel(0,3,BGRA(100,100,100,255));}
+
+    FFade.Step := 15;
+    FFade.Mode := fmFadeOut;
+    FTimer := TTimer.Create(Self);
+    FTimer.Interval := 15;
+    FTimer.OnTimer := @Fade;
+
+  finally
+    Exclude(FControlState, csCreating);
+    EnableAutoSizing;
+    EndUpdate;
+  end;
+end;
+
+destructor TBCCustomImageButton.Destroy;
+begin
+  FTimer.Free;
+  if FBGRAMultiSliceScaling <> nil then
+    FreeAndNil(FBGRAMultiSliceScaling);
+  if FBGRANormal <> nil then
+    FreeAndNil(FBGRANormal);
+  if FBGRAHover <> nil then
+    FreeAndNil(FBGRAHover);
+  if FBGRAActive <> nil then
+    FreeAndNil(FBGRAActive);
+  if FBGRADisabled <> nil then
+    FreeAndNil(FBGRADisabled);
+  FreeAndNil(FBitmapOptions);
+  inherited Destroy;
+end;
+
+end.

+ 45 - 0
bcimagebutton_icon.lrs

@@ -0,0 +1,45 @@
+LazarusResources.Add('TBCImageButton','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#3#212'IDATH'#199#181#149#221'O[u'#24#199'?'#231#156#190#157#190#208'RXi'
+  +#203'{'#202'Z'#9'/'#206#189#168#25#163#9#146'it!.'#203#178#168#201#18#189#240
+  +'O'#208'hb'#136'&'#220#152'e&z'#225'LL'#140#23'^'#26'/'#188#210#16'1"'#14'_'
+  +#182#17#154#12'7H)'#208#21':^'#10#5#218'rN'#219's'#188#128#20#25's'#163'#>W'
+  +#191'<'#249'='#191#207#239#247#252#158#231#251#8#237#31#127#173#243'?'#154'X'
+  +'n'#128#0#8#133#252#129#247#27#246'y'#138'E'#148#217'i'#178#177'('#202'b'#18
+  +'='#155#5'Q"'#240't'''#199#250#250#24'M,s'#194#227'd*'#147''''#173#228#203#3
+  +#8#186#142#182#145#198#232#241#226#242#213#162'e6'#217#154#143#19#174#171#230
+  +#189'7/QSS'#195'Pl'#129#31'&'#162'|p'#170#157'w'#127#252#147#199#229'W'#242
+  +#156'='#255#225'.A@'#176#200#8'&3'#130#209#136'h'#181'a'#170#241#147#148']'
+  +#196'R'#235#4#172'FN4'#213'b'#151'-t5'#251#137#167'3DS'#235'e'#166'HUQ'#23
+  +#147'8'#141#18'/t='#139' '#128#166#131#6#252#158#202#17'l'#146#232'n'#246#3
+  +'p'#249'x'#136#193#169#248'#_Q'#2'h'#217#12#155'7FQ'#150#151#16'd+'#29#225'.'
+  +'lz'#30'A'#23#144#205'&:'#235#189#156'l'#244'#'#138'B)8'#224#174#160#193#229
+  +'`vm'#227#241#0#209'`'#160#162#187#23#132#237#3#238#2#247#19'k'#244#181'6'
+  +#243'b'#168#129#166'J'#199#158#192#129'+'#215'x'#169#247#12#129#170#138#131#1
+  +'0'#153'KK'#217'h'#224#242'3A.u'#4'0'#10' I'#210#190'@'#155'M'#230#141#183
+  +#223#225#234#23'W'#136'X-,g'#183#30'^'#214#15'6Z>q'#143'/'#223'z'#149#163#222
+  +'j'#226'K+L'#173'ex'#165'3'#132'$n'#183#140#174#235#20#139'EDQd-'#189'A'#177
+  +'X'#196'd'#183#243#201#200'8'#131'S'#241'G'#127'rf'#236'/'#150#127#25'b'#190
+  +#175#155'o"Q'#254'^'#203'r'#237'|'#184't'#184#166'i'#220#153'K'#16']\'#161
+  +#209'i'#165#202'n'#195'j'#181'bF'#163#191#231'8'#231'B'#13'|'#246#235#24#211
+  +#233#236'~@z'#248''''#182#146#243#248'.'#190#198#192#173#24#0#239#135#143#209
+  +'PYQ'#186#245#245#153#5#250#135'n'#162#22'5'#4#1'j,&'#130'N'#153'V'#183#157
+  +#142'#Nj'#157#14':'#238'E'#184#27'['#198#216#249#252'. '#23#185#133#185#182
+  +#30'g'#184#183'Dnq;x'#249#169'F'#0'n'''#238'Sa'#146#248'~2'#142'Z'#212'vR'#5
+  +#201#156'J2'#167'2'#156'L#'#144#192'g5a'#168#14'bt'#4'v'#181'H'#200'e'#144'C'
+  +'mX'#2#193'='#185#187#208#218#136'A'#146'X'#221#204#240#209#207'c'#168#249#2
+  +#13'.'#199#127'V'#139#14#204'gU'#230#20'mG'#177'v'#0#186'l'#3#179'y'#175#2#10
+  +#2']'#13'^4M'#227#211#223'"$6s'#164'29^'#239'l'#193'n2'#30'^M'#139#171'+$'#19
+  +#9'Fc'#9#6#167#23#0#152'\Z'#197'-'#155#232#239'='#137#244#175'f'#163',-'#218
+  +'1%'#185#192#245'o'#191'c'#194#229'cuK'#5#160'P'#212'8SWM'#208'{'#132'z'#167
+  +#157#145#153'$'#154#174'?'#225'<'#208'4'#162#235'9'#166#215'6K'#174#241#149
+  +#13'n'#198#226'('#138#194#217#163#245'\=w'#154#10#179#233#201#0#146',c'#11
+  +#181#238'e'#234#240'yd'#150#201#153'9'#20'E'#225'T'#157#135#175'.'#246#208'^'
+  +#227'.'#31'`tWa'#169#171#223#231'_'#200#170#12#252'1'#201#141';S'#164'R)'#204
+  +#5#149#11'N'#9'qb'#28#10#133#131'I'#197#129#198#160#174#177'5~'#131#249#145
+  +'a'#10'['#10#130' b'#170#172#164'*'#220#131#165'%tx@'#201#10'yr'#209'I'#178
+  +#209')r'#137'8j:'#141#236#245#227'z'#238'4r '#8#162#248#144#129'S'#214'S'#140
+  +#200#161'6'#228'P'#219'N'#249')'#20#210')'#10#27#27#168's'#211'X'#252#245#135
+  +#4'<hf3'#6#143#15#131#199#183']'#24#192'?'#168'"z'#17#202'#'#7'8'#0#0#0#0'IE'
+  +'ND'#174'B`'#130
+]);

+ 327 - 0
bclabel.pas

@@ -0,0 +1,327 @@
+{ Equivalent of standard lazarus TLabel but using BGRA Controls framework for text
+  render.
+
+  Functionality:
+  - Customizable background (gradients etc.)
+  - Customizable border (rounding etc.)
+  - FontEx (shadow, word wrap, etc.)
+
+  Copyright (C) 2012 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+unit BCLabel;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
+  BCBasectrls, BGRABitmap, BGRABitmapTypes, BCTypes, types;
+
+type
+
+  { TCustomBCLabel }
+
+  TCustomBCLabel = class(TBCStyleGraphicControl)
+  private
+    { Private declarations }
+    {$IFDEF DEBUG}
+    FRenderCount: Integer;
+    {$ENDIF}
+    FBackground: TBCBackground;
+    FBGRA: TBGRABitmapEx;
+    FBorder: TBCBorder;
+    FFontEx: TBCFont;
+    FRounding: TBCRounding;
+    procedure Render;
+    procedure SetRounding(AValue: TBCRounding);
+    procedure UpdateSize;
+    procedure SetBackground(AValue: TBCBackground);
+    procedure SetBorder(AValue: TBCBorder);
+    procedure SetFontEx(AValue: TBCFont);
+    procedure OnChangeProperty(Sender: TObject; Data: PtrInt);
+    procedure OnChangeFont(Sender: TObject; AData: PtrInt);
+  protected
+    procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
+      WithThemeSpace: boolean); override;
+    class function GetControlClassDefaultSize: TSize; override;
+    procedure TextChanged; override;
+  protected
+    {$IFDEF DEBUG}
+    function GetDebugText: String; override;
+    {$ENDIF}
+    procedure DrawControl; override;
+    procedure RenderControl; override;
+    function GetStyleExtension: String; override;
+  protected
+    { Protected declarations }
+    property AutoSize default True;
+    property Background: TBCBackground read FBackground write SetBackground;
+    property Border: TBCBorder read FBorder write SetBorder;
+    property FontEx: TBCFont read FFontEx write SetFontEx;
+    property Rounding: TBCRounding read FRounding write SetRounding;
+  public
+    { Public declarations }
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+    procedure UpdateControl; override; // Called by EndUpdate
+  published
+    { Published declarations }
+  end;
+
+  { TBCLabel }
+
+  TBCLabel = class(TCustomBCLabel)
+  published
+    property Action;
+    property Align;
+    property Anchors;
+    property AssignStyle;
+    property AutoSize;
+    property Background;
+    property Border;
+    property BorderSpacing;
+    property Caption;
+    property Cursor;
+    property Enabled;
+    property FontEx;
+    property Height;
+    property HelpContext;
+    property HelpKeyword;
+    property HelpType;
+    property Hint;
+    property Left;
+    property PopupMenu;
+    property Rounding;
+    property ShowHint;
+    property Tag;
+    property Top;
+    property Visible;
+    property Width;
+  end;
+
+procedure Register;
+
+implementation
+
+uses BCTools;
+
+procedure Register;
+begin
+  {$I bclabel_icon.lrs}
+  RegisterComponents('BGRA Controls',[TBCLabel]);
+end;
+
+{ TCustomBCLabel }
+
+procedure TCustomBCLabel.Render;
+var r: TRect;
+begin
+  if (csCreating in FControlState) or IsUpdating then
+    Exit;
+
+  FBGRA.NeedRender := False;
+
+  FBGRA.SetSize(Width, Height);
+  FBGRA.Fill(BGRAPixelTransparent); // Clear;
+  r := FBGRA.ClipRect;
+  CalculateBorderRect(FBorder,r);
+
+  RenderBackground(FBGRA.ClipRect, FBackground, TBGRABitmap(FBGRA), FRounding);
+  RenderBorder(r, FBorder, TBGRABitmap(FBGRA), FRounding);
+  RenderText(FBGRA.ClipRect, FFontEx, Caption, TBGRABitmap(FBGRA));
+
+  {$IFDEF DEBUG}
+  FRenderCount += 1;
+  {$ENDIF}
+end;
+
+procedure TCustomBCLabel.SetRounding(AValue: TBCRounding);
+begin
+  if FRounding = AValue then Exit;
+  FRounding.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCLabel.UpdateSize;
+begin
+  InvalidatePreferredSize;
+  AdjustSize;
+end;
+
+procedure TCustomBCLabel.SetBackground(AValue: TBCBackground);
+begin
+  FBackground.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCLabel.SetBorder(AValue: TBCBorder);
+begin
+  FBorder.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCLabel.SetFontEx(AValue: TBCFont);
+begin
+  FFontEx.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCLabel.OnChangeProperty(Sender: TObject; Data: PtrInt);
+begin
+  RenderControl;
+  if (Sender = FBorder) and AutoSize then
+    UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCLabel.OnChangeFont(Sender: TObject; AData: PtrInt);
+begin
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+procedure TCustomBCLabel.CalculatePreferredSize(var PreferredWidth,
+  PreferredHeight: integer; WithThemeSpace: boolean);
+begin
+  if (Parent = nil) or (not Parent.HandleAllocated) then
+    Exit;
+
+  CalculateTextSize(Caption, FFontEx, PreferredWidth, PreferredHeight);
+
+  if AutoSize and (FBorder.Style<>bboNone) then
+  begin
+    Inc(PreferredHeight, 2 * FBorder.Width);
+    Inc(PreferredWidth, 2 * FBorder.Width);
+  end;
+end;
+
+class function TCustomBCLabel.GetControlClassDefaultSize: TSize;
+begin
+  Result.cx := 100;
+  Result.cy := 25;
+end;
+
+procedure TCustomBCLabel.TextChanged;
+begin
+  inherited TextChanged;
+  RenderControl;
+  UpdateSize;
+  Invalidate;
+end;
+
+{$IFDEF DEBUG}
+function TCustomBCLabel.GetDebugText: String;
+begin
+  Result := 'R: '+IntToStr(FRenderCount);
+end;
+{$ENDIF}
+
+procedure TCustomBCLabel.DrawControl;
+begin
+  inherited DrawControl;
+  if FBGRA.NeedRender then
+    Render;
+  FBGRA.Draw(Self.Canvas,0,0,False);
+end;
+
+procedure TCustomBCLabel.RenderControl;
+begin
+  inherited RenderControl;
+  if FBGRA<>nil then
+    FBGRA.NeedRender := True;
+end;
+
+function TCustomBCLabel.GetStyleExtension: String;
+begin
+  Result := 'bclbl';
+end;
+
+procedure TCustomBCLabel.UpdateControl;
+begin
+  RenderControl;
+  inherited UpdateControl; // invalidate
+end;
+
+constructor TCustomBCLabel.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  {$IFDEF DEBUG}
+  FRenderCount := 0;
+  {$ENDIF}
+  DisableAutoSizing;
+  Include(FControlState, csCreating);
+  BeginUpdate;
+  try
+    with GetControlClassDefaultSize do
+      SetInitialBounds(0, 0, CX, CY);
+    FBGRA := TBGRABitmapEx.Create(Width, Height);
+    FBackground         := TBCBackground.Create(Self);
+    FBorder             := TBCBorder.Create(Self);
+    FFontEx             := TBCFont.Create(Self);
+    ParentColor         := True;
+
+    FBackground.OnChange := @OnChangeProperty;
+    FBorder.OnChange     := @OnChangeProperty;
+    FFontEx.OnChange     := @OnChangeFont;
+
+    FBackground.Style   := bbsClear;
+    FBorder.Style       := bboNone;
+
+    FRounding           := TBCRounding.Create(Self);
+    FRounding.OnChange  := @OnChangeProperty;
+
+    AutoSize := True;
+  finally
+    EnableAutoSizing;
+    EndUpdate;
+    Exclude(FControlState, csCreating);
+  end;
+end;
+
+destructor TCustomBCLabel.Destroy;
+begin
+  FBGRA.Free;
+  FBackground.Free;
+  FBorder.Free;
+  FFontEx.Free;
+  FRounding.Free;
+  inherited Destroy;
+end;
+
+end.

+ 26 - 0
bclabel_icon.lrs

@@ -0,0 +1,26 @@
+LazarusResources.Add('tbclabel','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#1#252'IDATx'#218#188
+  +'V'#185'J'#4'A'#16#157#153#189'\'#239';3'#244#19#12#4'10'#20'4'#244#31'D'#12
+  +'M'#5#19#193'P'#252#0'A0^Q'#240'H'#12']a33'#141#12#252#0'AD'#231'l'#171#151
+  +'W'#242'h'#167#23#13#214#134'GU'#215#246#212#213'U'#213#27#26'c'#130'~'#174
+  +'('#232#243#10#137#134#142#172'l'#25#15#237'i "'#202'<+e'#133#5#201't'#239']'
+  +'U('#171#128#175#0#17'E'#226'*'#203'A'#25#190'('#141'*'#173#9#234'@'#141#12
+  +#27#199'kK3'#24'a'#148'E'#152#171#1#139#134#160')'#24#4#175'r'#227'xi?J@3BNJ'
+  +#213#137#238#249'*<'#182#202'G-'#22#183'o'#219#26'k'#251'he'#13#135#11#145
+  +#223'@'#182#4'Y'#10'c)'#25'R'#254';'#189'U'#164#197#26#24#22#140';'#249#156
+  +#166'4'#232#154'!e1'#192'|'#12#3#221#136'"'#24#24#176#6#246'N'#159#174#224
+  +#229#150#165#178'?'#22'2)'#152'R'#237#18'IKp!'#236#172'B'#246#29#193#131#224
+  +'Q'#240#12#135#173#222'j'#132#20'Y4'#174#239'_T'#143'5'#24'`?'#4'h'#218'v`'
+  +#232'D'#200#152#208'3'#200'W'#5#203'Nu'#134'ZEu\'#174'.'#151#231#20#213'='
+  +#231#172#147#145#24'Y'#224'>'#210#30#136'$'#29'-J'#195#190#242'"'#223'u:'#214
+  +#199'{'#27#205#30#202'4='#226#193#166#222#139#24':'#128#252#157#190'a'#254
+  +#131#248#20#213#214#17#29#243'l@+B'#215#27#194#141'I'#246'J'#209#29#194#145
+  +#13#251#173#208'u'#145#157#11'.'#233'|'#166#13'g'#203'i'#142'JtDo'#31#8#201#1
+  +#227'4'#152#219#205'\'#166#159'@'#172#17'$'#226#193#157'/'#143'h'#174#156#140
+  +')'#207#157#206#141#150'h'#20#214#195#9#148'e'#147#198#4#15';V'#154#147#247
+  +#238'TuGE'#166#163'"'#161#31'cR'#30#146#156'Q'#208#236'1%'#147#244#199#176
+  +#227'P'#211#146#183#160#160'K'#243#141#232#158#227':''E'#145#243#162#153#18
+  +#197#230'7'#245'_'#246#162#133#206#211#25#148#228#248'O'#202#255'e'#133#253
+  +#254#219#242'%'#192#0#156#239#22'X'#29#149'&P'#0#0#0#0'IEND'#174'B`'#130
+]);

+ 451 - 0
bcpanel.pas

@@ -0,0 +1,451 @@
+{ Equivalent of standard lazarus TPanel but using BGRA Controls framework for render
+
+  Functionality:
+  - Customizable background (gradient etc.)
+  - Customizable border (frame 3D or normal border, rounding etc)
+  - FontEx (shadow etc.)
+
+  Copyright (C) 2011 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+unit BCPanel;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
+  BGRABitmap, BCBaseCtrls, BGRABitmapTypes, BCTypes, Types;
+
+type
+  TOnAfterRenderBCPanel = procedure(Sender: TObject; const ABGRA: TBGRABitmap;
+    ARect: TRect) of object;
+  TBCPanelBorderStyle = (bpsBorder, bpsFrame3d);
+
+  { TCustomBCPanel }
+
+  TCustomBCPanel = class(TBCStyleCustomControl)
+  private
+    { Private declarations }
+    {$IFDEF DEBUG}
+    FRenderCount: Integer;
+    {$ENDIF}
+    FBackground: TBCBackground;
+    FBevelWidth: Integer;
+    FBGRA: TBGRABitmapEx;
+    FBevelInner, FBevelOuter : TBevelCut;
+    FBorder: TBCBorder;
+    FBorderBCStyle: TBCPanelBorderStyle;
+    FFontEx: TBCFont;
+    FOnAfterRenderBCPanel: TOnAfterRenderBCPanel;
+    FRounding: TBCRounding;
+    procedure SetBackground(AValue: TBCBackground);
+    procedure SetBevelInner(AValue: TBevelCut);
+    procedure SetBevelOuter(AValue: TBevelCut);
+    procedure SetBevelWidth(AValue: Integer);
+    procedure SetBorder(AValue: TBCBorder);
+    procedure SetBorderBCStyle(AValue: TBCPanelBorderStyle);
+    procedure SetFontEx(AValue: TBCFont);
+    procedure SetRounding(AValue: TBCRounding);
+    procedure Render;
+    procedure OnChangeProperty(Sender: TObject; AData: PtrInt);
+    procedure OnChangeFont(Sender: TObject; AData: PtrInt);
+  protected
+    { Protected declarations }
+    procedure AdjustClientRect(var aRect: TRect); override;
+    class function GetControlClassDefaultSize: TSize; override;
+    function GetDefaultDockCaption: String; override;
+    procedure SetEnabled(Value: boolean); override;
+    procedure TextChanged; override;
+  protected
+    function GetStyleExtension: String; override;
+    {$IFDEF DEBUG}
+    function GetDebugText: String; override;
+    {$ENDIF}
+    procedure DrawControl; override;
+    procedure RenderControl; override;
+  protected
+    property Background: TBCBackground read FBackground write SetBackground;
+    property BevelInner: TBevelCut read FBevelInner write SetBevelInner;
+    property BevelOuter: TBevelCut read FBevelOuter write SetBevelOuter;
+    property BevelWidth: Integer read FBevelWidth write SetBevelWidth;
+    property Border: TBCBorder read FBorder write SetBorder;
+    property BorderBCStyle: TBCPanelBorderStyle
+      read FBorderBCStyle write SetBorderBCStyle default bpsFrame3d;
+    property FontEx: TBCFont read FFontEx write SetFontEx;
+    property Rounding: TBCRounding read FRounding write SetRounding;
+  protected
+    { Events }
+    property OnAfterRenderBCPanel: TOnAfterRenderBCPanel
+      Read FOnAfterRenderBCPanel Write FOnAfterRenderBCPanel;
+  public
+    { Public declarations }
+    constructor Create(TheOwner: TComponent); override;
+    destructor Destroy; override;
+    procedure UpdateControl; override; // Called by EndUpdate
+  end;
+
+  { TBCPanel }
+
+  TBCPanel = class(TCustomBCPanel)
+  published
+    property Align;
+    property Anchors;
+    property AssignStyle;
+    property AutoSize;
+    property BorderSpacing;
+    property Background;
+    property BevelInner;
+    property BevelOuter;
+    property BevelWidth;
+    property Border;
+    property BorderBCStyle;
+    property Caption;
+    property ChildSizing;
+    property Constraints;
+    property DockSite;
+    property DragCursor;
+    property DragKind;
+    property DragMode;
+    property Enabled;
+    property FontEx;
+    property PopupMenu;
+    property Rounding;
+    property ShowHint;
+    property TabOrder;
+    property TabStop;
+    property UseDockManager default True;
+    property Visible;
+    property OnClick;
+    property OnContextPopup;
+    property OnDockDrop;
+    property OnDockOver;
+    property OnDblClick;
+    property OnDragDrop;
+    property OnDragOver;
+    property OnEndDock;
+    property OnEndDrag;
+    property OnEnter;
+    property OnExit;
+    property OnGetSiteInfo;
+    property OnGetDockCaption;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    property OnResize;
+    property OnStartDock;
+    property OnStartDrag;
+    property OnUnDock;
+    property OnAfterRenderBCPanel;
+  end;
+
+procedure Register;
+
+implementation
+
+uses BCTools;
+
+procedure Register;
+begin
+  {$I bcpanel_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBCPanel]);
+end;
+
+{ TCustomBCPanel }
+
+procedure TCustomBCPanel.DrawControl;
+begin
+  inherited DrawControl;
+  if FBGRA.NeedRender then
+    Render;
+  if Assigned (FRounding) then
+  begin
+    if (FRounding.RoundX<>0) and (FRounding.RoundY<>0) then
+      FBGRA.Draw(Self.Canvas, 0, 0, False)
+    else
+      FBGRA.Draw(Self.Canvas, 0, 0);
+  end
+  else
+    FBGRA.Draw(Self.Canvas, 0, 0);
+end;
+
+procedure TCustomBCPanel.RenderControl;
+begin
+  inherited RenderControl;
+  if FBGRA<>nil then
+    FBGRA.NeedRender := True;
+end;
+
+function TCustomBCPanel.GetStyleExtension: String;
+begin
+  Result := 'bcpnl';
+end;
+
+{$IFDEF DEBUG}
+function TCustomBCPanel.GetDebugText: String;
+begin
+  Result := 'R: '+IntToStr(FRenderCount);
+end;
+{$ENDIF}
+
+procedure TCustomBCPanel.Render;
+var r: TRect;
+begin
+  if (csCreating in FControlState) or IsUpdating then
+    Exit;
+
+  FBGRA.NeedRender := False;
+
+  FBGRA.SetSize(Width, Height);
+  FBGRA.Fill(BGRAPixelTransparent);
+  RenderBackground(FBGRA.ClipRect, FBackground, TBGRABitmap(FBGRA), FRounding);
+  r := FBGRA.ClipRect;
+
+  case FBorderBCStyle of
+  bpsBorder:
+    begin
+      CalculateBorderRect(FBorder,r);
+      RenderBorder(r,FBorder, TBGRABitmap(FBGRA), FRounding);
+    end;
+  bpsFrame3d:
+    begin
+      // if BevelOuter is set then draw a frame with BevelWidth
+      if (FBevelOuter <> bvNone) and (FBevelWidth > 0) then
+        FBGRA.CanvasBGRA.Frame3d(r, FBevelWidth, FBevelOuter,
+          BGRA(255, 255, 255, 180), BGRA(0, 0, 0, 160)); // Note: Frame3D inflates ARect
+
+      InflateRect(r, -FBevelWidth, -FBevelWidth);
+
+      // if BevelInner is set then skip the BorderWidth and draw a frame with BevelWidth
+      if (FBevelInner <> bvNone) and (FBevelWidth > 0) then
+        FBGRA.CanvasBGRA.Frame3d(r, FBevelWidth, FBevelInner,
+          BGRA(255, 255, 255, 160), BGRA(0, 0, 0, 160)); // Note: Frame3D inflates ARect
+    end;
+  end;
+
+  if Caption <> '' then
+    RenderText(r,FFontEx,Caption,TBGRABitmap(FBGRA));
+
+  if Assigned(FOnAfterRenderBCPanel) then
+    FOnAfterRenderBCPanel(Self, FBGRA, r);
+
+  {$IFDEF DEBUG}
+  FRenderCount += 1;
+  {$ENDIF}
+end;
+
+procedure TCustomBCPanel.OnChangeProperty(Sender: TObject; AData: PtrInt);
+begin
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.OnChangeFont(Sender: TObject; AData: PtrInt);
+begin
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.SetRounding(AValue: TBCRounding);
+begin
+  if FRounding = AValue then Exit;
+  FRounding.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.AdjustClientRect(var aRect: TRect);
+var BevelSize: Integer;
+begin
+  inherited AdjustClientRect(aRect);
+
+  BevelSize := BorderWidth;
+  if (BevelOuter <> bvNone) then
+    inc(BevelSize, BevelWidth);
+  if (BevelInner <> bvNone) then
+    inc(BevelSize, BevelWidth);
+
+  InflateRect(aRect, -BevelSize, -BevelSize);
+end;
+
+class function TCustomBCPanel.GetControlClassDefaultSize: TSize;
+begin
+  Result.CX := 170;
+  Result.CY := 50;
+end;
+
+function TCustomBCPanel.GetDefaultDockCaption: String;
+begin
+  Result := Caption;
+end;
+
+procedure TCustomBCPanel.SetBackground(AValue: TBCBackground);
+begin
+  if FBackground = AValue then Exit;
+  FBackground.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.SetBevelInner(AValue: TBevelCut);
+begin
+  if FBevelInner = AValue then Exit;
+  FBevelInner := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.SetBevelOuter(AValue: TBevelCut);
+begin
+  if FBevelOuter = AValue then Exit;
+  FBevelOuter := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.SetBevelWidth(AValue: Integer);
+begin
+  if FBevelWidth = AValue then Exit;
+  FBevelWidth := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.SetBorder(AValue: TBCBorder);
+begin
+  if FBorder = AValue then Exit;
+  FBorder.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.SetBorderBCStyle(AValue: TBCPanelBorderStyle);
+begin
+  if FBorderBCStyle = AValue then Exit;
+  FBorderBCStyle := AValue;
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.SetFontEx(AValue: TBCFont);
+begin
+  if FFontEx = AValue then Exit;
+  FFontEx.Assign(AValue);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.SetEnabled(Value: boolean);
+begin
+  inherited SetEnabled(Value);
+
+  RenderControl;
+  Invalidate;
+end;
+
+procedure TCustomBCPanel.TextChanged;
+begin
+  inherited TextChanged;
+
+  RenderControl;
+  Invalidate;
+end;
+
+constructor TCustomBCPanel.Create(TheOwner: TComponent);
+begin
+  inherited Create(TheOwner);
+  {$IFDEF DEBUG}
+  FRenderCount := 0;
+  {$ENDIF}
+  DisableAutoSizing;
+  Include(FControlState, csCreating);
+  BeginUpdate;
+  try
+    ControlStyle := ControlStyle + [csAcceptsControls, csCaptureMouse,
+      csClickEvents, csSetCaption, csDoubleClicks, csReplicatable,
+      csNoFocus, csAutoSize0x0]
+      - [csOpaque]; // we need the default background
+    //Self.DoubleBuffered := True;
+    with GetControlClassDefaultSize do
+      SetInitialBounds(0, 0, CX, CY);
+
+    FBGRA               := TBGRABitmapEx.Create;
+    FBorderBCStyle      := bpsFrame3d;
+    FBackground         := TBCBackground.Create(Self);
+    FBorder             := TBCBorder.Create(Self);
+    FFontEx             := TBCFont.Create(Self);
+    FBevelOuter         := bvRaised;
+    FBevelInner         := bvNone;
+    FBevelWidth         := 1;
+    ParentColor         := True;
+    UseDockManager      := True;
+
+    FBackground.OnChange := @OnChangeProperty;
+    FBorder.OnChange     := @OnChangeProperty;
+    FFontEx.OnChange     := @OnChangeFont;
+
+    FBackground.Style   := bbsColor;
+    FBackground.Color   := {$ifdef UseCLDefault}clDefault{$else}clBtnFace{$endif};
+    FBorder.Style       := bboNone;
+
+    FRounding           := TBCRounding.Create(Self);
+    FRounding.OnChange  := @OnChangeProperty;
+  finally
+    EnableAutoSizing;
+    EndUpdate;
+    Exclude(FControlState, csCreating);
+  end;
+end;
+
+destructor TCustomBCPanel.Destroy;
+begin
+  FBackground.Free;
+  FBorder.Free;
+  FFontEx.Free;
+  FBGRA.Free;
+  FRounding.Free;
+  inherited Destroy;
+end;
+
+procedure TCustomBCPanel.UpdateControl;
+begin
+  Render;
+  inherited UpdateControl; // invalidate
+end;
+
+end.

+ 9 - 0
bcpanel_icon.lrs

@@ -0,0 +1,9 @@
+LazarusResources.Add('tbcpanel','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#0'xIDATx^'#237#149'A'#10#132'0'#12'E'#127#134'^w'#214#230#8#174#167#23#26
+  +#157'k'#204#162'"x'#140'~Q'#232#166#184#146'F'#4#243' '#144#213#127#132'@"9g'
+  +#136#8#172#16#146#176'$'#148'F563'#245#253'[P '#185'W'#215'}'#216#130'-g'#252
+  +#14','#185#1#21')'#253'q'#150'yZP'#243#130#1#143#19#184#192#5'.pA88'#185'v'#2
+  +#213'h3Ays'#191'a'#228#213'O'#255#254'K^'#1#166'zsS'#138#185#218'6'#0#0#0#0
+  +'IEND'#174'B`'#130
+]);

+ 327 - 0
bcrtti.pas

@@ -0,0 +1,327 @@
+{ Useful tools for RTTI. Functions are used expecialy for save/load styles.
+  Styles has construction similar to INI files:
+
+  [Header]
+  Author=Krzysztof Dibowski
+  Description=My test style
+  ControlClass=TBCButton
+
+  [Properties]
+  State.Border.Width=2
+  .....
+
+  But instead of IniFiles unit, we have own functions for read and write styles.
+
+  ------------------------------------------------------------------------------
+  Copyright (C) 2012 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+unit BCRTTI;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes;
+
+type
+  PBCStyleHeader = ^TBCStyleHeader;
+  TBCStyleHeader = record
+    Author: String;
+    ControlClass: String;
+    Description: String;
+  end;
+
+// Function return data of specified section (header, properties, etc).
+// This is smart function, because it doesn't read whole file but read file
+// line by line and return only needed section. So it should fastest for reading
+// header info instead of TIniFile object which read, parse and index all file.
+function GetSectionData(const AFileName, ASectionName: String): TStrings;
+// Methods which read header from list or file and parse it into pascal record
+procedure GetStyleHeader(const AFileName: String; AOutHeader: PBCStyleHeader);
+// Function check if specified name is on ignored list
+function IsPropIgnored(const AName: String): Boolean;
+// Method load style saved by SaveStyle method
+procedure LoadStyle(AControl: TObject; const AFileName: String; ALogs: TStrings = nil);
+// Method save all (which are not on ignored list or readonly) public propertys to
+// the output string list. This method have support for property
+// tree (Propert1.Subpropert1.Color = 543467). Values are represented as "human readable"
+// (e.g. Align = alClient). Header info is save too.
+procedure SaveStyle(AControl: TObject; const AAuthor, ADescription: String;
+  ATargetList: TStrings);
+
+implementation
+
+uses typinfo, variants, sysutils, strutils;
+
+const
+  tIGNORED_PROPS: array[0..5] of string =
+    ('name','caption','left','top','height','width');
+  sSECTION_HEADER_NAME = 'HEADER';
+  sSECTION_PROP_NAME   = 'PROPERTIES';
+  sSECTION_HEADER = '['+sSECTION_HEADER_NAME+']';
+  sSECTION_PROP   = '['+sSECTION_PROP_NAME+']';
+
+function IsPropIgnored(const AName: String): Boolean;
+var
+  i: Integer;
+begin
+  Result := False;
+  for i := Low(tIGNORED_PROPS) to High(tIGNORED_PROPS) do
+    if SameText(tIGNORED_PROPS[i],Trim(AName)) then
+      Exit(True);
+end;
+
+procedure LoadStyle(AControl: TObject; const AFileName: String;
+  ALogs: TStrings = nil);
+var
+  i, iDot: Integer;
+  sPath, sVal: String;
+  obj: TObject;
+  sl: TStrings;
+const
+  sLOG_NO_PROP   = 'Can not find property "%s"';
+  sLOG_SET_ERR   = 'Can not set value "%s" to property "%s"';
+  sLOG_READ_ONLY = 'Property "%s" is read-only';
+
+  procedure _AddLog(const AText: String);
+  begin
+    if ALogs<>nil then
+      ALogs.Add(AText);
+  end;
+
+  function _ValidateProp(AObj: TObject; const APropName: String): Boolean;
+  begin
+    Result := True;
+    // If can't find property
+    if not IsPublishedProp(AObj,APropName) then
+    begin
+      _AddLog(Format(sLOG_NO_PROP,[APropName]));
+      Exit(False);
+    end;
+    // If read-only property
+    if (GetPropInfo(AObj,APropName)^.SetProc=nil) then
+    begin
+      _AddLog(Format(sLOG_READ_ONLY,[APropName]));
+      Exit(False);
+    end;
+  end;
+
+begin
+  if not FileExists(AFileName) then
+    Exit;
+
+  if ALogs<>nil then
+    ALogs.Clear;
+
+  sl := GetSectionData(AFileName, sSECTION_PROP_NAME);
+  try
+    for i:=0 to Pred(sl.Count) do
+    begin
+      // Full path with hierarchy tree
+      sPath := Trim(sl.Names[i]);
+      // "Human readable" value
+      sVal := Trim(sl.ValueFromIndex[i]);
+      iDot := Pos('.', sPath);
+      // If simple property then write it value
+      if iDot=0 then
+      begin
+        if not _ValidateProp(AControl,sPath) then
+          Continue;
+        // Writting property value
+        try
+          SetPropValue(AControl,sPath,sVal)
+        except
+          _AddLog(Format(sLOG_SET_ERR,[sVal, sPath]));
+        end
+      end
+      else
+      begin
+        //... else we must go down in hierarchy tree to the last
+        // object and then write value to property
+        obj := AControl;
+        while iDot>0 do
+        begin
+          if not _ValidateProp(obj,Copy(sPath,1,iDot-1)) then
+          begin
+            obj := nil;
+            Break;
+          end;
+
+          obj := GetObjectProp(obj,Copy(sPath,1,iDot-1));
+
+          Delete(sPath,1,iDot);
+          iDot := Pos('.', sPath);
+        end;
+
+        // If no dots, then this word is property name
+        if (obj<>nil) and (sPath<>'') and _ValidateProp(obj,sPath) then
+        begin
+          try
+            SetPropValue(obj,sPath,sVal)
+          except
+            _AddLog(Format(sLOG_SET_ERR,[sVal, sPath]));
+          end
+        end;
+      end;
+    end;
+  finally
+    sl.Free;
+  end;
+end;
+
+procedure SaveStyle(AControl: TObject; const AAuthor, ADescription: String;
+  ATargetList: TStrings);
+
+  procedure _SaveProp(AObj: TObject; APath: String = '');
+  var
+    iCount, i: Integer;
+    lst: TPropList;
+    s: String;
+  begin
+    if AObj=nil then Exit;
+
+    iCount := GetPropList(PTypeInfo(AObj.ClassInfo), tkProperties, @lst);
+    for i := 0 to Pred(iCount) do
+      { Notice:
+        - IsPublishedProp return true for ALL public properties, not only
+          for properties in Published section. For saving styles, we don't need
+          all public properties, but only published (visible in object inspector).
+          I don't know if this is a bug, I leave it. Maybe it will start
+          working in future ;)
+        - Second argument check if property should be ignored (but only from root tree),
+          because we can't save basic properties of control like Name, Top, Left etc.
+        - SetProc<>nil mean "not read only"
+      }
+      if IsPublishedProp(AObj,lst[i]^.Name) and
+         ((AControl<>AObj) or (not IsPropIgnored(lst[i]^.Name))) and
+         (lst[i]^.SetProc<>nil)
+      then
+      begin
+        // Building property tree
+        if APath=''
+        then s := lst[i]^.Name
+        else s := APath+'.'+lst[i]^.Name;
+
+        // If property has subproperty, then we start recurrence to
+        // build hierarchy tree.
+        if (lst[i]^.PropType^.Kind = tkClass) then
+          _SaveProp(GetObjectProp(AObj,lst[i]),s)
+        else
+        begin
+          // We are in bottom node, so we can save final property with value
+          s := s + ' = ' + String(GetPropValue(AObj,lst[i]^.Name,True));
+          ATargetList.Add(s);
+        end;
+      end;
+  end;
+begin
+  if ATargetList=nil then
+    Exit;
+  ATargetList.Clear;
+
+  ATargetList.Add(sSECTION_HEADER);
+  ATargetList.Add('Author='+AAuthor);
+  ATargetList.Add('Description='+ADescription);
+  ATargetList.Add('ControlClass='+AControl.ClassName);
+  ATargetList.Add('');
+  ATargetList.Add(sSECTION_PROP);
+  _SaveProp(AControl);
+end;
+
+function GetSectionData(const AFileName, ASectionName: String): TStrings;
+var
+  f: TextFile;
+  s: String;
+  sl: TStringList;
+  bReading: Boolean;
+begin
+  Result := TStringList.Create;
+  Result.Clear;
+
+  if (not FileExists(AFileName)) or (ASectionName='') then
+    Exit;
+
+  AssignFile(f,AFileName);
+  try
+    Reset(f);
+    bReading := False;
+    while not EOF(f) do
+    begin
+      ReadLn(f,s);
+      s := Trim(s);
+      if s='' then
+        Continue;
+
+      // If current line is section tag
+      if s[1]='[' then
+      begin
+        // If we currently reading section then we read it all and we must
+        // break because another section occur
+        if bReading then
+        begin
+          bReading := False;
+          Break;
+        end
+        else
+        // Otherwise if this is section we are looking for, then set flag
+        // to "start reading"
+        if SameText(ASectionName,TrimSet(s,['[',']'])) then
+          bReading := True;
+      end else
+      // Read section line
+      if bReading then
+        Result.Add(s);
+    end;
+  finally
+    CloseFile(f);
+  end;
+end;
+
+procedure GetStyleHeader(const AFileName: String; AOutHeader: PBCStyleHeader);
+var sl: TStrings;
+begin
+  if (AOutHeader=nil) or (not FileExists(AFileName)) then
+    Exit;
+
+  sl := GetSectionData(AFileName,sSECTION_HEADER_NAME);
+  try
+    // Header info (with format Author=Foo) should be at the top of file
+    with AOutHeader^ do
+    begin
+      Author       := sl.Values['Author'];
+      Description  := sl.Values['Description'];
+      ControlClass := sl.Values['ControlClass'];
+    end;
+  finally
+    sl.Free;
+  end;
+end;
+
+end.
+

+ 234 - 0
bcstylesform.lfm

@@ -0,0 +1,234 @@
+object BCfrmStyle: TBCfrmStyle
+  Left = 471
+  Height = 363
+  Top = 199
+  Width = 642
+  Caption = 'Style manager'
+  ClientHeight = 363
+  ClientWidth = 642
+  OnCloseQuery = FormCloseQuery
+  Position = poScreenCenter
+  LCLVersion = '1.1'
+  object pnlBottom: TPanel
+    Left = 0
+    Height = 37
+    Top = 326
+    Width = 642
+    Align = alBottom
+    AutoSize = True
+    ClientHeight = 37
+    ClientWidth = 642
+    TabOrder = 0
+    object BitBtn1: TBitBtn
+      Left = 565
+      Height = 29
+      Top = 4
+      Width = 73
+      Align = alRight
+      AutoSize = True
+      BorderSpacing.Around = 3
+      Cancel = True
+      DefaultCaption = True
+      Kind = bkCancel
+      ModalResult = 2
+      TabOrder = 0
+    end
+    object BitBtn2: TBitBtn
+      Left = 452
+      Height = 29
+      Top = 4
+      Width = 110
+      Align = alRight
+      AutoSize = True
+      BorderSpacing.Around = 3
+      Caption = 'Assign style'
+      Default = True
+      Glyph.Data = {
+        36040000424D3604000000000000360000002800000010000000100000000100
+        2000000000000004000064000000640000000000000000000000000000000000
+        0000000000000000000000000000000000003796697937976AF23696696D0000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000024926D0735966AA8369A6FF339B091FF36956BF43A97
+        6816000000000000000000000000000000000000000000000000000000000000
+        000000000000399C631236966CC739A079F441BDA3FF41C0A6FF3BA882F53596
+        6B94000000000000000000000000000000000000000000000000000000000000
+        000036946B2637976CE33FA985F94CC5ADFF43C3AAFF42C2AAFF4CC2A9FF3897
+        6DF6389768200000000000000000000000000000000000000000000000003595
+        6A4838986DF24BB899FD53CBB4FF49C8B0FF54CCB5FF4ECAB2FF4FCAB2FF48B2
+        91F937986DAD000000000000000000000000000000000000000035946B43399A
+        6FF557C7ADFF58D0BAFF53CEB8FF5ECEB8FF4AB495FC5ECFB9FF4FCDB6FF5ED0
+        BAFF3A9B70F535956A35000000000000000000000000000000003696695540A1
+        79F469D5C1FF60D4C0FF62CDB8FF3E9E75F436966BE251B798F960D5C1FF5CD4
+        BFFF57C0A5FE38996ECA00000000000000000000000000000000000000003899
+        6FB14FB392F962CAB2FF3A9A70F538976D6037926D1C39986DF66ED6C3FF5AD7
+        C3FF6FDBCAFF41A179F23794674A000000000000000000000000000000002E8B
+        740B38986DD537986DE838946B32000000000000000038976D8C54B696F672E0
+        CFFF66DDCBFF6ACEB6FF37996DDE55AA55030000000000000000000000000000
+        00000000000000000000000000000000000000000000308F701039996EF27BDC
+        C9FF67E0CEFF7FE5D6FF4AA985F235966C610000000000000000000000000000
+        000000000000000000000000000000000000000000000000000037986E7954B4
+        94F582E9DBFF70E6D5FF7AD9C6FF399A6FE82BAA550600000000000000000000
+        00000000000000000000000000000000000000000000000000003399660A3898
+        6DEC82E1CEFF76EADBFF8AEDE0FF57B595F537986C7400000000000000000000
+        0000000000000000000000000000000000000000000000000000000000003596
+        6C6150AF8BF291EEE2FF74EADBFF8CE5D6FF3A996FF33399660F000000000000
+        0000000000000000000000000000000000000000000000000000000000000080
+        80023A9970D981DAC7FF88EDE0FF9BF0E5FF5DB898F835956A6A000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        00003794674549A480F490E4D4FF5CB595F6399A6EE539956A24000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        000000000000389A6FAC39996EEF36966C6D3399660500000000
+      }
+      ModalResult = 1
+      TabOrder = 1
+    end
+  end
+  object gboxPreview: TGroupBox
+    Left = 454
+    Height = 320
+    Top = 3
+    Width = 185
+    Align = alRight
+    BorderSpacing.Around = 3
+    Caption = 'Preview'
+    ChildSizing.EnlargeHorizontal = crsHomogenousSpaceResize
+    ChildSizing.EnlargeVertical = crsHomogenousSpaceResize
+    ChildSizing.Layout = cclLeftToRightThenTopToBottom
+    ChildSizing.ControlsPerLine = 1
+    TabOrder = 1
+  end
+  object Splitter1: TSplitter
+    Left = 446
+    Height = 326
+    Top = 0
+    Width = 5
+    Align = alRight
+    ResizeAnchor = akRight
+  end
+  object gboxStyles: TGroupBox
+    Left = 3
+    Height = 320
+    Top = 3
+    Width = 440
+    Align = alClient
+    BorderSpacing.Around = 3
+    Caption = 'Styles'
+    ClientHeight = 301
+    ClientWidth = 436
+    TabOrder = 3
+    object memoLogs: TMemo
+      Left = 3
+      Height = 40
+      Top = 258
+      Width = 430
+      Align = alBottom
+      BorderSpacing.Around = 3
+      Font.Color = clRed
+      ParentFont = False
+      ReadOnly = True
+      ScrollBars = ssAutoVertical
+      TabOrder = 0
+      Visible = False
+    end
+    object sptrLog: TSplitter
+      Cursor = crVSplit
+      Left = 0
+      Height = 5
+      Top = 250
+      Width = 436
+      Align = alBottom
+      ResizeAnchor = akBottom
+      Visible = False
+    end
+    object ToolBar1: TToolBar
+      Left = 0
+      Height = 26
+      Top = 0
+      Width = 436
+      Caption = 'ToolBar1'
+      EdgeInner = esNone
+      EdgeOuter = esNone
+      ParentShowHint = False
+      ShowHint = True
+      TabOrder = 2
+      object btnDelete: TToolButton
+        Left = 1
+        Top = 0
+        Action = ActionDelete
+      end
+      object btnNewFromCtrl: TToolButton
+        Left = 24
+        Top = 0
+        Action = ActionNewFromCtrl
+      end
+      object ToolButton1: TToolButton
+        Left = 47
+        Top = 0
+        Width = 5
+        Caption = 'ToolButton1'
+        Style = tbsDivider
+      end
+      object btnNewFromFile: TToolButton
+        Left = 52
+        Top = 0
+        Action = ActionNewFromFile
+      end
+      object btnRefresh: TToolButton
+        Left = 75
+        Top = 0
+        Action = ActionRefresh
+      end
+    end
+    object lvFiles: TListView
+      Left = 3
+      Height = 218
+      Top = 29
+      Width = 430
+      Align = alClient
+      BorderSpacing.Around = 3
+      Columns = <      
+        item
+          Caption = 'File'
+          Width = 100
+        end      
+        item
+          AutoSize = True
+          Caption = 'Author'
+          Width = 57
+        end      
+        item
+          Caption = 'Description'
+          Width = 255
+        end>
+      TabOrder = 3
+      ViewStyle = vsReport
+      OnSelectItem = lvFilesSelectItem
+    end
+  end
+  object ActionList1: TActionList
+    left = 312
+    top = 96
+    object ActionNewFromCtrl: TAction
+      Hint = 'Create new style from selected control'
+      OnExecute = ActionNewFromCtrlExecute
+    end
+    object ActionDelete: TAction
+      Caption = 'ActionDelete'
+      Hint = 'Delete style and file (from package "style" folder)'
+      OnExecute = ActionDeleteExecute
+    end
+    object ActionNewFromFile: TAction
+      Caption = 'ActionNewFromFile'
+      Hint = 'Create new style from file'
+      OnExecute = ActionNewFromFileExecute
+    end
+    object ActionRefresh: TAction
+      Caption = 'ActionRefresh'
+      OnExecute = ActionRefreshExecute
+    end
+  end
+  object OpenDialog1: TOpenDialog
+    left = 312
+    top = 163
+  end
+end

+ 484 - 0
bcstylesform.pas

@@ -0,0 +1,484 @@
+{ Styles form manager
+
+  ------------------------------------------------------------------------------
+  Copyright (C) 2012 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+unit BCStylesForm;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
+  StdCtrls, ActnList, ComCtrls, Buttons, ComponentEditors, PropEdits,
+  bcbasectrls;
+
+type
+
+  { TBCfrmStyle }
+
+  TBCfrmStyle = class(TForm)
+    ActionRefresh: TAction;
+    ActionNewFromFile: TAction;
+    ActionDelete: TAction;
+    ActionNewFromCtrl: TAction;
+    ActionList1: TActionList;
+    BitBtn1: TBitBtn;
+    BitBtn2: TBitBtn;
+    gboxPreview: TGroupBox;
+    gboxStyles: TGroupBox;
+    lvFiles: TListView;
+    memoLogs: TMemo;
+    OpenDialog1: TOpenDialog;
+    pnlBottom: TPanel;
+    Splitter1: TSplitter;
+    sptrLog: TSplitter;
+    ToolBar1: TToolBar;
+    btnDelete: TToolButton;
+    btnNewFromCtrl: TToolButton;
+    ToolButton1: TToolButton;
+    btnNewFromFile: TToolButton;
+    btnRefresh: TToolButton;
+    procedure ActionDeleteExecute(Sender: TObject);
+    procedure ActionNewFromCtrlExecute(Sender: TObject);
+    procedure ActionNewFromFileExecute(Sender: TObject);
+    procedure ActionRefreshExecute(Sender: TObject);
+    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
+    procedure lvFilesSelectItem(Sender: TObject; Item: TListItem;
+      Selected: Boolean);
+  private
+    { private declarations }
+    FControl: TControl;
+    FPreviewControl: TControl;
+    FStyleExt: String;
+    procedure AddLog(const AText: String; AClear: Boolean = True);
+    procedure CreatePreviewControl;
+    function GetFileName: String;
+    function GetStylesDir: String;
+  public
+    { public declarations }
+    constructor Create(AControl: TControl; const AFileExt: String);
+
+    property FileName: String read GetFileName;
+  end;
+
+  { TBCStyleComponentEditor }
+
+  TBCStyleComponentEditor = class(TComponentEditor)
+  protected
+    procedure BeginUpdate;
+    procedure EndUpdate;
+    function GetStyleExtension: String;
+    procedure DoShowEditor;
+  public
+    procedure ExecuteVerb(Index: Integer); override;
+    function  GetVerb(Index: Integer): String; override;
+    function  GetVerbCount: Integer; override;
+  end;
+
+  { TBCSylePropertyEditor }
+
+  TBCSylePropertyEditor = class(TClassPropertyEditor)
+  private
+    procedure BeginUpdate;
+    procedure EndUpdate;
+    function GetStyleExtension: String;
+    procedure DoShowEditor;
+  public
+    procedure Edit; Override;
+    function  GetAttributes: TPropertyAttributes; Override;
+  end;
+
+implementation
+
+uses MacroIntf, BCRTTI, IDEImagesIntf;
+
+{ TBCSylePropertyEditor }
+
+procedure TBCSylePropertyEditor.BeginUpdate;
+begin
+  if GetComponent(0).InheritsFrom(TBCStyleGraphicControl) then
+    TBCStyleGraphicControl(GetComponent(0)).BeginUpdate
+  else
+  if GetComponent(0).InheritsFrom(TBCStyleCustomControl) then
+    TBCStyleCustomControl(GetComponent(0)).BeginUpdate;
+end;
+
+procedure TBCSylePropertyEditor.EndUpdate;
+begin
+  if GetComponent(0).InheritsFrom(TBCStyleGraphicControl) then
+    TBCStyleGraphicControl(GetComponent(0)).EndUpdate
+  else
+  if GetComponent(0).InheritsFrom(TBCStyleCustomControl) then
+    TBCStyleCustomControl(GetComponent(0)).EndUpdate;
+end;
+
+function TBCSylePropertyEditor.GetStyleExtension: String;
+begin
+  if GetComponent(0).InheritsFrom(TBCStyleGraphicControl) then
+    Result := TBCStyleGraphicControl(GetComponent(0)).StyleExtension
+  else
+  if GetComponent(0).InheritsFrom(TBCStyleCustomControl) then
+    Result := TBCStyleCustomControl(GetComponent(0)).StyleExtension
+  else
+    Result := '';
+end;
+
+procedure TBCSylePropertyEditor.DoShowEditor;
+var f: TBCfrmStyle;
+begin
+  if GetStyleExtension='' then
+  begin
+    MessageDlg('Empty ext', Format('Class %s has empty style extension',
+      [GetComponent(0).ClassName]),mtError,[mbOK],0);
+    Exit;
+  end;
+
+  f := TBCfrmStyle.Create(TControl(GetComponent(0)),GetStyleExtension);
+  try
+    if (f.ShowModal=mrOK) and FileExists(f.FileName) then
+    begin
+      try
+        BeginUpdate;
+        LoadStyle(GetComponent(0),f.FileName);
+      finally
+        EndUpdate;
+      end;
+    end;
+  finally
+    f.Free;
+  end;
+end;
+
+procedure TBCSylePropertyEditor.Edit;
+begin
+  DoShowEditor;
+end;
+
+function TBCSylePropertyEditor.GetAttributes: TPropertyAttributes;
+begin
+  Result := [paDialog, paReadOnly];
+end;
+
+{ TBCfrmStyle }
+
+procedure TBCfrmStyle.ActionNewFromCtrlExecute(Sender: TObject);
+var
+  sName: String;
+  sl: TStrings;
+begin
+  sName := 'My new style';
+  if InputQuery('Create new style', 'Style name', sName) then
+  begin
+    if Trim(sName)='' then
+      raise Exception.Create('Name can not be empty');
+    sName := IncludeTrailingBackslash(GetStylesDir) + sName+'.'+FStyleExt;
+    if FileExists(sName) then
+      raise Exception.Create('Style with this name already exists!');
+    sl := TStringList.Create;
+    try
+      SaveStyle(FControl,'Me','',sl);
+      sl.SaveToFile(sName);
+      ActionRefresh.Execute;
+    finally
+      sl.Free;
+    end;
+  end;
+end;
+
+procedure TBCfrmStyle.ActionNewFromFileExecute(Sender: TObject);
+begin
+  if OpenDialog1.Execute then
+  begin
+    if FileExists(IncludeTrailingBackslash(GetStylesDir)+ExtractFileName(OpenDialog1.FileName)) then
+      raise Exception.Create('This style already exists');
+    CopyFile(OpenDialog1.FileName,IncludeTrailingBackslash(GetStylesDir)+ExtractFileName(OpenDialog1.FileName));
+    ActionRefresh.Execute;
+  end;
+end;
+
+procedure TBCfrmStyle.ActionRefreshExecute(Sender: TObject);
+var
+  sl: TStrings;
+  i: Integer;
+  it: TListItem;
+  h: TBCStyleHeader;
+begin
+  sl := FindAllFiles(GetStylesDir,'*.'+FStyleExt,False);
+  try
+    lvFiles.ItemIndex := -1;
+    lvFiles.Selected := nil;
+    lvFiles.Clear;
+    if (sl<>nil) and (sl.Count>0) then
+    begin
+      lvFiles.BeginUpdate;
+      try
+        for i:=0 to Pred(sl.Count) do
+        begin
+          it := lvFiles.Items.Add;
+          it.Caption := ExtractFileName(sl.Strings[i]);
+          GetStyleHeader(sl.Strings[i],@h);
+          it.SubItems.Add(h.Author); // Author
+          it.SubItems.Add(h.Description); // Description
+        end;
+        lvFiles.ItemIndex := 0;
+        lvFiles.Selected := lvFiles.Items.Item[0];
+        // I noticed that OnSelect event is not called when we change
+        // selected index manually, so we must call it manually
+        lvFilesSelectItem(lvFiles,lvFiles.Selected,True);
+        ActionDelete.Enabled := True;
+      finally
+        lvFiles.EndUpdate;
+      end;
+    end else
+    begin
+      memoLogs.Clear;
+      memoLogs.Visible        := False;
+      sptrLog.Visible         := False;
+      FPreviewControl.Visible := False;
+      ActionDelete.Enabled    := False;
+    end;
+  finally
+    if sl<>nil then sl.Free;
+  end;
+end;
+
+procedure TBCfrmStyle.FormCloseQuery(Sender: TObject; var CanClose: boolean);
+begin
+  if (ModalResult=mrOK) and (lvFiles.ItemIndex=-1) then
+  begin
+    MessageDlg('Assign file', 'No style selected', mtError, [mbOK], 0);
+    CanClose := False;
+  end
+  else
+    CanClose := True;
+end;
+
+procedure TBCfrmStyle.ActionDeleteExecute(Sender: TObject);
+begin
+  if (lvFiles.SelCount=0) or
+     (MessageDlg('Deleting style', 'Do you really want to delete selected style? '+
+                 'This action delete file: '+IncludeTrailingBackslash(GetStylesDir)+lvFiles.Selected.Caption,
+                 mtConfirmation,mbYesNo,0)=mrNo)
+  then
+    Exit;
+
+  DeleteFile(IncludeTrailingBackslash(GetStylesDir)+lvFiles.Selected.Caption);
+  ActionRefresh.Execute;
+end;
+
+procedure TBCfrmStyle.lvFilesSelectItem(Sender: TObject; Item: TListItem;
+  Selected: Boolean);
+var
+  sl_logs: TStrings;
+  i: Integer;
+begin
+  if Selected and (Item<>nil) then
+  begin
+    memoLogs.Visible        := False;
+    sptrLog.Visible         := False;
+    memoLogs.Clear;
+    FPreviewControl.Visible := True;
+    ActionDelete.Enabled    := True;
+
+    sl_logs := TStringList.Create;
+    try
+      if not FileExists(IncludeTrailingBackslash(GetStylesDir)+Item.Caption) then
+        Exit;
+
+      LoadStyle(FPreviewControl,IncludeTrailingBackslash(GetStylesDir)+Item.Caption,
+        sl_logs);
+      // Because load style override it
+      FPreviewControl.Constraints.MinWidth := 100;
+      FPreviewControl.Constraints.MinHeight := 100;
+      // Logs
+      for i:=0 to Pred(sl_logs.Count) do
+        AddLog(sl_logs.Strings[i],False);
+    finally
+      sl_logs.Free;
+    end;
+  end;
+end;
+
+procedure TBCfrmStyle.AddLog(const AText: String; AClear: Boolean = True);
+begin
+  if AClear then memoLogs.Clear;
+  if not memoLogs.Visible then
+  begin
+    memoLogs.Visible := True;
+    sptrLog.Visible  := True;
+    sptrLog.Top      := memoLogs.Top - 1;
+  end;
+  memoLogs.Lines.Add(AText);
+end;
+
+function TBCfrmStyle.GetStylesDir: String;
+begin
+  Result := '$PkgDir(bgracontrols)';
+  IDEMacros.SubstituteMacros(Result);
+  Result := IncludeTrailingBackslash(Result)+'styles';
+end;
+
+procedure TBCfrmStyle.CreatePreviewControl;
+begin
+  FPreviewControl := TControlClass(FControl.ClassType).Create(Self);
+  FPreviewControl.Constraints.MinWidth := 100;
+  FPreviewControl.Constraints.MinHeight := 100;
+  FPreviewControl.Parent := gboxPreview;
+  FPreviewControl.Caption := FControl.Caption;
+  if Trim(FPreviewControl.Caption) = '' then
+    FPreviewControl.Caption := 'Demo';
+  FPreviewControl.Visible := False;
+end;
+
+function TBCfrmStyle.GetFileName: String;
+begin
+  if lvFiles.ItemIndex=-1 then
+    Result := ''
+  else
+    Result := IncludeTrailingBackslash(GetStylesDir)+lvFiles.Selected.Caption;
+end;
+
+constructor TBCfrmStyle.Create(AControl: TControl;
+  const AFileExt: String);
+
+  // It seems that method LoadImage load icon on each call. Others lazarus
+  // component editors doesn't check if icon exist but I will do. Small memory leak
+  // reduction :P
+  function _LoadImage(AIdx: Integer; const AName: String): Integer;
+  begin
+    Result := IDEImages.GetImageIndex(AIdx,AName);
+    if Result=-1 then
+      Result := IDEImages.LoadImage(AIdx,AName);
+  end;
+begin
+  inherited Create(Application);
+
+  FControl  := AControl;
+  FStyleExt := AFileExt;
+
+  CreatePreviewControl;
+  ActionRefresh.Execute;
+
+  ToolBar1.Images               := IDEImages.Images_16;
+  ActionList1.Images            := ToolBar1.Images;
+  ActionDelete.ImageIndex       := _LoadImage(16,'laz_delete');
+  ActionNewFromCtrl.ImageIndex  := _LoadImage(16,'laz_add');
+  ActionNewFromFile.ImageIndex  := _LoadImage(16,'laz_open');
+  ActionRefresh.ImageIndex      := _LoadImage(16,'laz_refresh');
+
+  ActionDelete.Enabled    := False;
+
+  OpenDialog1.Filter     := 'BC Style|*.'+FStyleExt;
+  OpenDialog1.DefaultExt := FStyleExt;
+  OpenDialog1.InitialDir := GetStylesDir;
+end;
+
+{$R *.lfm}
+
+{ TBCStyleComponentEditor }
+
+procedure TBCStyleComponentEditor.BeginUpdate;
+begin
+  if Component.InheritsFrom(TBCStyleGraphicControl) then
+    TBCStyleGraphicControl(Component).BeginUpdate
+  else
+  if Component.InheritsFrom(TBCStyleCustomControl) then
+    TBCStyleCustomControl(Component).BeginUpdate;
+end;
+
+procedure TBCStyleComponentEditor.EndUpdate;
+begin
+  if Component.InheritsFrom(TBCStyleGraphicControl) then
+    TBCStyleGraphicControl(Component).EndUpdate
+  else
+  if Component.InheritsFrom(TBCStyleCustomControl) then
+    TBCStyleCustomControl(Component).EndUpdate;
+end;
+
+function TBCStyleComponentEditor.GetStyleExtension: String;
+begin
+  if Component.InheritsFrom(TBCStyleGraphicControl) then
+    Result := TBCStyleGraphicControl(Component).StyleExtension
+  else
+  if Component.InheritsFrom(TBCStyleCustomControl) then
+    Result := TBCStyleCustomControl(Component).StyleExtension
+  else
+    Result := '';
+end;
+
+procedure TBCStyleComponentEditor.DoShowEditor;
+var f: TBCfrmStyle;
+begin
+  if GetStyleExtension='' then
+  begin
+    MessageDlg('Empty ext', Format('Class %s has empty style extension',
+      [Component.ClassName]),mtError,[mbOK],0);
+    Exit;
+  end;
+
+  f := TBCfrmStyle.Create(TControl(Component),GetStyleExtension);
+  try
+    if (f.ShowModal=mrOK) and FileExists(f.FileName) then
+    begin
+      try
+        BeginUpdate;
+        LoadStyle(Component,f.FileName);
+      finally
+        EndUpdate;
+      end;
+    end;
+  finally
+    f.Free;
+  end;
+end;
+
+procedure TBCStyleComponentEditor.ExecuteVerb(Index: Integer);
+begin
+  case Index of
+    0: DoShowEditor;
+  end;
+end;
+
+function TBCStyleComponentEditor.GetVerb(Index: Integer): String;
+begin
+  Result := 'Assign style';
+end;
+
+function TBCStyleComponentEditor.GetVerbCount: Integer;
+begin
+  Result := 1;
+end;
+
+initialization
+  RegisterComponentEditor([TBCStyleGraphicControl, TBCStyleCustomControl], TBCStyleComponentEditor);
+  RegisterPropertyEditor(ClassTypeInfo(TBCStyleDummyProperty),nil,'',TBCSylePropertyEditor);
+
+end.
+

+ 472 - 0
bctools.pas

@@ -0,0 +1,472 @@
+{ General framework methods for rendering background, borders, text, etc.
+
+  Copyright (C) 2012 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+
+unit BCTools;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Graphics, BGRABitmap, BGRABitmapTypes, bctypes,
+  Controls, BGRAGradientScanner;
+
+// This method prepare BGRABitmap for rendering BCFont type
+procedure AssignBCFont(AFont: TBCFont; out ATargetBGRA: TBGRABitmap);
+// Calculate text height and width (doesn't include wordwrap - just single line)
+procedure CalculateTextSize(const AText: String; AFont: TBCFont;
+  out ANewWidth, ANewHeight: integer);
+// As long as there are differences between the size of the font, this method is useless
+procedure CalculateTextRect(const AText: String; AFont: TBCFont; out ARect: TRect);
+// This method correct TRect to border width. As far as border width is bigger,
+// BGRA drawing rectangle with offset (half border width)
+procedure CalculateBorderRect(ABorder: TBCBorder; var ARect: TRect);
+// Create BGRA Gradient Scanner based on BCGradient properties
+function CreateGradient(AGradient: TBCGradient; ARect: TRect): TBGRAGradientScanner;
+// Render arrow (used by BCButton with DropDownMenu style)
+procedure RenderArrow(out ATargetBGRA: TBGRABitmap; const ARect: TRect;
+  ASize: Integer; ADirection: TBCArrowDirection; AColor: TColor = clBlack;
+  AOpacity: Byte = 255);
+// Render customizable backgroud (used e.g. by TBCButton, TBCPanel, TBCLabel)
+procedure RenderBackground(const ARect: TRect; const ABackground: TBCBackground;
+  out ATargetBGRA: TBGRABitmap; ARounding: TBCRounding = nil);
+// Render customizable border (used e.g. by TBCButton, TBCPanel, TBCLabel)
+procedure RenderBorder(const ARect: TRect; const ABorder: TBCBorder;
+  out ATargetBGRA: TBGRABitmap; ARounding: TBCRounding = nil);
+// Render BCFont (used e.g. by TBCButton, TBCPanel, TBCLabel)
+procedure RenderText(const ARect: TRect; const AFont: TBCFont;
+  const AText: String; out ATargetBGRA: TBGRABitmap);
+// Return LCL horizontal equivalent for BCAlignment
+function BCAlign2HAlign(AAlign: TBCAlignment): TAlignment;
+// Return LCL vertical equivalent for BCAlignment
+function BCAlign2VAlign(AAlign: TBCAlignment): TTextLayout;
+
+implementation
+
+uses Types, BGRAPolygon, BGRAFillInfo, BGRAText, math, LCLType, LCLIntf;
+
+procedure CalculateTextRect(const AText: String; AFont: TBCFont; out ARect: TRect);
+var
+  tmp: TBGRABitmap;
+  flags: LongInt;
+begin
+  tmp := TBGRABitmap.Create(0,0);
+  AssignBCFont(AFont,tmp);
+  flags := 0;
+  case AFont.TextAlignment of
+    bcaCenter, bcaCenterBottom, bcaCenterTop: flags := flags or DT_CENTER;
+    bcaRightCenter, bcaRightBottom, bcaRightTop: flags := flags or DT_RIGHT;
+  end;
+  case AFont.TextAlignment of
+    bcaLeftTop, bcaCenterTop, bcaRightTop: flags := flags or DT_TOP;
+    bcaLeftCenter, bcaCenter, bcaRightCenter: flags := flags or DT_VCENTER;
+    bcaLeftBottom, bcaCenterBottom, bcaRightBottom: flags := flags or DT_BOTTOM;
+  end;
+  if AFont.EndEllipsis then
+    flags := flags or DT_END_ELLIPSIS;
+  // This condition is from TCanvas.TextRect
+  if AFont.WordBreak then
+  begin
+    flags := flags or DT_WORDBREAK;
+    if AFont.EndEllipsis then
+      flags := flags and not DT_END_ELLIPSIS;
+  end;
+  if AFont.SingleLine then
+    flags := flags or DT_SINGLELINE;
+
+  flags := flags or DT_CALCRECT;
+
+  LCLIntf.DrawText(tmp.Canvas.Handle, PChar(AText), Length(AText), ARect, flags);
+
+  tmp.Free;
+end;
+
+procedure CalculateBorderRect(ABorder: TBCBorder; var ARect: TRect);
+begin
+  if ABorder = nil then Exit;
+  Inc(ARect.Left, Round(ABorder.Width / 2));
+  Inc(ARect.Top, Round(ABorder.Width / 2));
+  Dec(ARect.Right, Round(ABorder.Width / 2) + 1);
+  Dec(ARect.Bottom, Round(ABorder.Width / 2) + 1);
+end;
+
+function CreateGradient(AGradient: TBCGradient; ARect: TRect): TBGRAGradientScanner;
+begin
+  Result := TBGRAGradientScanner.Create(
+    ColorToBGRA(ColorToRGB(AGradient.StartColor), AGradient.StartColorOpacity),
+    ColorToBGRA(ColorToRGB(AGradient.EndColor), AGradient.EndColorOpacity),
+    AGradient.GradientType, PointF(ARect.Left + Round(
+    ((ARect.Right - ARect.Left) / 100) * AGradient.Point1XPercent),
+    ARect.Top + Round(((ARect.Bottom - ARect.Top) / 100) * AGradient.Point1YPercent)),
+    PointF(ARect.Left + Round(((ARect.Right - ARect.Left) / 100) *
+    AGradient.Point2XPercent), ARect.Top + Round(
+    ((ARect.Bottom - ARect.Top) / 100) * AGradient.Point2YPercent)),
+    AGradient.ColorCorrection, AGradient.Sinus);
+end;
+
+procedure RenderBorder(const ARect: TRect; const ABorder: TBCBorder; out
+  ATargetBGRA: TBGRABitmap; ARounding: TBCRounding = nil);
+var
+  fiLight: TFillBorderRoundRectInfo;
+  rx,ry: Byte;
+  ropt: TRoundRectangleOptions;
+begin
+  if ABorder.Style=bboNone then Exit;
+
+  if ARounding = nil then
+  begin
+    rx   := 0;
+    ry   := 0;
+    ropt := [];
+  end else
+  begin
+    rx   := ARounding.RoundX;
+    ry   := ARounding.RoundY;
+    ropt := ARounding.RoundOptions;
+  end;
+
+  ATargetBGRA.RoundRectAntialias(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom,
+    rx, ry, ColorToBGRA(ColorToRGB(ABorder.Color),ABorder.ColorOpacity),
+    ABorder.Width, ropt);
+
+  if ABorder.LightWidth > 0 then
+  begin
+    //compute light position
+    fiLight := TFillBorderRoundRectInfo.Create(
+      ARect.Left, ARect.Top, ARect.Right, ARect.Bottom, rx,
+      ry, ABorder.Width + ABorder.LightWidth, ropt);
+    //check if there is an inner position
+    if fiLight.InnerBorder <> nil then
+      with fiLight.InnerBorder do //fill with light
+        ATargetBGRA.RoundRectAntialias(topleft.x, topleft.y, bottomright.x,
+          bottomright.y, radiusx, radiusY,
+          ColorToBGRA(ColorToRGB(ABorder.LightColor), ABorder.LightOpacity),
+          ABorder.LightWidth, ropt);
+    fiLight.Free;
+  end;
+end;
+
+procedure RenderText(const ARect: TRect; const AFont: TBCFont;
+  const AText: String; out ATargetBGRA: TBGRABitmap);
+var
+  shd: TBGRABitmap;
+  hal: TAlignment;
+  val: TTextLayout;
+  st: TTextStyle;
+begin
+  AssignBCFont(AFont,ATargetBGRA);
+
+  hal := BCAlign2HAlign(AFont.TextAlignment);
+  val := BCAlign2VAlign(AFont.TextAlignment);
+
+  FillChar(st, SizeOf(st),0);
+
+  st.Wordbreak   := AFont.WordBreak;
+  st.Alignment   := hal;
+  st.Layout      := val;
+  st.SingleLine  := AFont.SingleLine;
+  st.EndEllipsis := AFont.EndEllipsis;
+
+  if AFont.Shadow then
+  begin
+    shd := TBGRABitmap.Create(ATargetBGRA.Width,ATargetBGRA.Height,BGRAPixelTransparent);
+    shd.FontName      := ATargetBGRA.FontName;
+    shd.FontStyle     := ATargetBGRA.FontStyle;
+    shd.FontQuality   := ATargetBGRA.FontQuality;
+    shd.FontHeight    := ATargetBGRA.FontHeight;
+    shd.TextRect(ARect, ARect.Left, ARect.Top, AText, st, ColorToBGRA(ColorToRGB(AFont.ShadowColor),
+      AFont.ShadowColorOpacity));
+    BGRAReplace(shd, shd.FilterBlurRadial(AFont.ShadowRadius, rbFast));
+    ATargetBGRA.BlendImage(AFont.ShadowOffsetX, AFont.ShadowOffsetY,
+      shd, boLinearBlend);
+    shd.Free;
+  end;
+
+  ATargetBGRA.TextRect(ARect,ARect.Left,ARect.Top,AText,st,ColorToBGRA(ColorToRGB(AFont.Color)));
+
+end;
+
+function BCAlign2HAlign(AAlign: TBCAlignment): TAlignment;
+begin
+  if AAlign in [bcaCenter, bcaCenterTop, bcaCenterBottom] then
+    Result := taCenter
+  else if AAlign in [bcaRightCenter, bcaRightTop, bcaRightBottom] then
+    Result := taRightJustify
+  else
+    Result := taLeftJustify;
+end;
+
+function BCAlign2VAlign(AAlign: TBCAlignment): TTextLayout;
+begin
+  if AAlign in [bcaCenter, bcaLeftCenter, bcaRightCenter] then
+    Result := tlCenter
+  else if AAlign in [bcaCenterBottom, bcaLeftBottom, bcaRightBottom] then
+    Result := tlBottom
+  else
+    Result := tlTop;
+end;
+
+procedure AssignBCFont(AFont: TBCFont; out ATargetBGRA: TBGRABitmap);
+var c: TBitmap;
+begin
+  // Canvas is need for calculate font height
+  c := TBitmap.Create;
+  c.Canvas.Font.Name := AFont.Name;
+  c.Canvas.Font.Style := AFont.Style;
+  case AFont.FontQuality of
+    fqSystem: c.Canvas.Font.Quality := fqNonAntialiased;
+    fqFineAntialiasing: c.Canvas.Font.Quality := fqAntialiased;
+    fqFineClearTypeRGB: c.Canvas.Font.Quality := fqProof;
+    fqSystemClearType: c.Canvas.Font.Quality := fqCleartype;
+  end;
+  // FontAntialias is only backward compability for FontQuality property.
+  // FontQuality is published in TBCFont so we don't need FontAntialias anymore.
+  //ATargetBGRA.FontAntialias := AFont.FontAntialias;
+  ATargetBGRA.FontStyle     := AFont.Style;
+
+  // If font quality is system, then we can leave default values. LCL will
+  // handle everything (when name is "default" or height 0)
+  if AFont.FontQuality in [fqSystem,fqSystemClearType] then
+  begin
+    ATargetBGRA.FontName   := AFont.Name;
+    ATargetBGRA.FontHeight := AFont.Height;
+  end
+  else
+  begin
+    // Getting real font name
+    if SameText(AFont.Name,'default')
+    then ATargetBGRA.FontName := GetFontData(c.Canvas.Font.Handle).Name
+    else ATargetBGRA.FontName := AFont.Name;
+
+    // Calculate default height, because when font quality is <> fqSystemXXX
+    // then if height is 0 then it is 0 for real
+    if (AFont.Height=0) then
+      ATargetBGRA.FontHeight := -c.Canvas.TextHeight('Bgra')
+    else
+      ATargetBGRA.FontHeight := AFont.Height;
+  end;
+  ATargetBGRA.FontQuality   := AFont.FontQuality;
+  c.Free;
+end;
+
+procedure CalculateTextSize(const AText: String; AFont: TBCFont; out ANewWidth,
+  ANewHeight: integer);
+var
+  s: TSize;
+  tmp: TBGRABitmap;
+begin
+  if (AText = '') or (AFont = nil) then
+  begin
+    ANewWidth := 0;
+    ANewHeight := 0;
+    Exit;
+  end;
+
+  {TODO: Check why BGRATextSize doesn't work. BGRABitmap call this method
+         and it work. Temporary I'm creating temp bitmap
+  }
+  {s := BGRAText.BGRATextSize(AFont,AFont.FontQuality,AText,FontAntialiasingLevel);
+  if (s.cy >= 24) and AFont.FontAntialias then
+    s := BGRAText.BGRATextSize(AFont,AFont.FontQuality,AText,4);}
+  tmp := TBGRABitmap.Create(0,0);
+  AssignBCFont(AFont, tmp);
+
+  s := tmp.TextSize(AText);
+  tmp.Free;
+
+  { shadow offset }
+  if AFont.Shadow then
+  begin
+    Inc(s.cx, 2 * Abs(AFont.ShadowOffsetX) + 2 * AFont.ShadowRadius);
+    Inc(s.cy, 2 * Abs(AFont.ShadowOffsetY) + 2 * AFont.ShadowRadius);
+  end;
+
+  ANewWidth := s.cx;
+  ANewHeight := s.cy;
+end;
+
+procedure RenderArrow(out ATargetBGRA: TBGRABitmap; const ARect: TRect;
+  ASize: Integer; ADirection: TBCArrowDirection; AColor: TColor; AOpacity: Byte);
+var
+  p: ArrayOfTPointF;
+  n: byte;
+  temp: TBGRABitmap;
+  w: Integer;
+begin
+  // We can't draw outside rect
+  w := Min(ASize, ARect.Right - ARect.Left);
+
+  { Poly }
+  SetLength(p, 3);
+
+  temp := TBGRABitmap.Create(w+1, w+1,BGRAPixelTransparent);
+
+  case ADirection of
+    badDown:
+      begin;
+        p[0].x := 0;
+        p[0].y := 0;
+
+        p[1].x := w;
+        p[1].y := 0;
+
+        p[2].x := Round(w/2);
+        p[2].y := w;
+      end;
+    badUp:
+      begin
+        p[0].x := Round(w/2);
+        p[0].y := 0;
+
+        p[1].x := 0;
+        p[1].y := w;
+
+        p[2].x := w;
+        p[2].y := w;
+      end;
+    badLeft:
+      begin
+        p[0].x := 0;
+        p[0].y := Round(w/2);
+
+        p[1].x := w;
+        p[1].y := 0;
+
+        p[2].x := w;
+        p[2].y := w;
+      end;
+    badRight:
+      begin
+        p[0].x := w;
+        p[0].y := Round(w/2);
+
+        p[1].x := 0;
+        p[1].y := 0;
+
+        p[2].x := 0;
+        p[2].y := w;
+      end;
+  end;
+
+  // Fill n times to get best quality
+  for n := 1 to 6 do
+    temp.FillPolyAntialias(p, ColorToBGRA(ColorToRGB(AColor),AOpacity));
+
+  ATargetBGRA.BlendImage(
+    ARect.Right-Round( ((ARect.Right-ARect.Left)/2) + (w/2) ),
+    ARect.Bottom-Round( ((ARect.Bottom-ARect.Top)/2) + (w/2) ),
+    temp,
+    boLinearBlend
+  );
+  temp.Free;
+end;
+
+procedure RenderBackground(const ARect: TRect; const ABackground: TBCBackground; out
+  ATargetBGRA: TBGRABitmap; ARounding: TBCRounding = nil);
+var
+  backcolor: TBGRAPixel;
+  multi: TBGRAMultishapeFiller;
+  back: TBGRABitmap;
+  grect1, grect2: TRect;
+  gra: TBGRAGradientScanner;
+  fiLight: TFillBorderRoundRectInfo;
+  rx,ry: Byte;
+  ropt: TRoundRectangleOptions;
+begin
+
+  if ARounding = nil then
+  begin
+    rx   := 0;
+    ry   := 0;
+    ropt := [];
+  end else
+  begin
+    rx   := ARounding.RoundX;
+    ry   := ARounding.RoundY;
+    ropt := ARounding.RoundOptions;
+  end;
+
+  { Background color }
+  case ABackground.Style of
+    bbsClear: backcolor := BGRAPixelTransparent;
+    // TODO: Why if I use some system colors like clBtnFace, clActiveCaption etc.
+    //       without ColorToRGB, I always get Black? Interface: QT
+    bbsColor: backcolor := ColorToBGRA(ColorToRGB(ABackground.Color), ABackground.ColorOpacity);
+  end;
+
+  case ABackground.Style of
+    bbsClear, bbsColor:
+      { Solid background color }
+      ATargetBGRA.FillRoundRectAntialias(ARect.Left, ARect.Top, ARect.Right,
+        ARect.Bottom, rx, ry, backcolor, ropt);
+    bbsGradient:
+    begin
+      { Using multishape filler to merge background gradient and border }
+      multi := TBGRAMultishapeFiller.Create;
+      multi.PolygonOrder := poFirstOnTop; { Border will replace background }
+
+      { Gradients }
+      back := TBGRABitmap.Create(ATargetBGRA.Width, ATargetBGRA.Height, BGRAPixelTransparent);
+      grect1 := ARect;
+      grect2 := ARect;
+      { Gradient 1 }
+      if ABackground.Gradient1EndPercent > 0 then
+      begin
+        grect1.Bottom := Round((grect1.Bottom / 100) * ABackground.Gradient1EndPercent);
+        gra := CreateGradient(ABackground.Gradient1, grect1);
+        back.FillRect(grect1.Left, grect1.Top, grect1.Right, grect1.Bottom,
+          gra, dmSet
+          );
+        gra.Free;
+      end;
+      { Gradient 2 }
+      if ABackground.Gradient1EndPercent < 100 then
+      begin
+        if grect1.Bottom < ARect.Bottom then
+          grect2.Top := grect1.Bottom - 1;
+        gra := CreateGradient(ABackground.Gradient2, grect2);
+        back.FillRect(grect2.Left, grect2.Top, grect2.Right, grect2.Bottom,
+          gra, dmSet
+          );
+        gra.Free;
+      end;
+
+      multi.AddRoundRectangle(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom,
+        rx, ry, back, ropt);
+
+      multi.Draw(ATargetBGRA);
+      multi.Free;
+      back.Free;
+    end;
+  end;
+end;
+
+end.
+

+ 821 - 0
bctypes.pas

@@ -0,0 +1,821 @@
+{ Common types for BGRA Controls package
+
+  Copyright (C) 2011 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+unit BCTypes;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, Controls, BGRABitmap, BGRABitmapTypes, Graphics, BCBasectrls;
+
+type
+  TBCMouseState  = (msNone, msHover, msClicked);
+  TBCAlignment = (bcaLeftTop, bcaLeftCenter, bcaLeftBottom,
+    bcaCenterTop, bcaCenter, bcaCenterBottom, bcaRightTop, bcaRightCenter,
+    bcaRightBottom);
+  TBCBackgroundStyle = (bbsClear, bbsColor, bbsGradient);
+  TBCBorderStyle = (bboNone, bboSolid);
+  TBCArrowDirection = (badLeft, badRight, badUp, badDown);
+  TBGRATextAlign   = (btaLeft, btaCenter, btaRight); // deprecated
+  TBGRATextVAlign  = (btvaTop, btvaCenter, btvaBottom); // deprecated
+  TBGRARedrawEvent = procedure(Sender: TObject; Bitmap: TBGRABitmap) of object;
+
+type
+  { TBCGradient }
+
+  TBCGradient = class(TBCProperty)
+  private
+    FColorCorrection: boolean;
+    FDrawMode:        TDrawMode;
+    FGradientType:    TGradientType;
+    FEndColor:        TColor;
+    FEndColorOpacity: byte;
+    FPoint1XPercent:  single;
+    FPoint1YPercent:  single;
+    FPoint2XPercent:  single;
+    FPoint2YPercent:  single;
+    FSinus:           boolean;
+    FStartColor:      TColor;
+    FStartColorOpacity: byte;
+    procedure SetColorCorrection(const AValue: boolean);
+    procedure SetDrawMode(const AValue: TDrawMode);
+    procedure SetEndColor(const AValue: TColor);
+    procedure SetEndColorOpacity(const AValue: byte);
+    procedure SetGradientType(const AValue: TGradientType);
+    procedure SetPoint1XPercent(const AValue: single);
+    procedure SetPoint1YPercent(const AValue: single);
+    procedure SetPoint2XPercent(const AValue: single);
+    procedure SetPoint2YPercent(const AValue: single);
+    procedure SetSinus(const AValue: boolean);
+    procedure SetStartColor(const AValue: TColor);
+    procedure SetStartColorOpacity(const AValue: byte);
+  public
+    constructor Create(AControl: TControl); override;
+
+    procedure Assign(Source: TPersistent); override;
+  published
+    property StartColor: TColor Read FStartColor Write SetStartColor;
+    property StartColorOpacity: byte Read FStartColorOpacity
+      Write SetStartColorOpacity;
+    property DrawMode: TDrawMode Read FDrawMode Write SetDrawMode;
+    property EndColor: TColor Read FEndColor Write SetEndColor;
+    property EndColorOpacity: byte Read FEndColorOpacity
+      Write SetEndColorOpacity;
+    property ColorCorrection: boolean Read FColorCorrection
+      Write SetColorCorrection;
+    property GradientType: TGradientType Read FGradientType
+      Write SetGradientType;
+    property Point1XPercent: single Read FPoint1XPercent Write SetPoint1XPercent;
+    property Point1YPercent: single Read FPoint1YPercent Write SetPoint1YPercent;
+    property Point2XPercent: single Read FPoint2XPercent Write SetPoint2XPercent;
+    property Point2YPercent: single Read FPoint2YPercent Write SetPoint2YPercent;
+    property Sinus: boolean Read FSinus Write SetSinus;
+  end;
+
+  { TBCFont }
+
+  TBCFont = class(TBCProperty)
+  private
+    FColor: TColor;
+    FEndEllipsis: Boolean;
+    FFontQuality: TBGRAFontQuality;
+    FHeight: Integer;
+    FName: String;
+    FShadow: Boolean;
+    FShadowColor: TColor;
+    FShadowColorOpacity: Byte;
+    FShadowOffsetX: ShortInt;
+    FShadowOffsetY: ShortInt;
+    FShadowRadius: Byte;
+    FSingleLine: Boolean;
+    FStyle: TFontStyles;
+    FTextAlignment: TBCAlignment;
+    FWordBreak: Boolean;
+    function IsNamStored: Boolean;
+    procedure SetColor(AValue: TColor);
+    procedure SetEndEllipsis(AValue: Boolean);
+    procedure SetFontQuality(AValue: TBGRAFontQuality);
+    procedure SetHeight(AValue: Integer);
+    procedure SetName(AValue: String);
+    procedure SetShadow(AValue: Boolean);
+    procedure SetShadowColor(AValue: TColor);
+    procedure SetShadowColorOpacity(AValue: Byte);
+    procedure SetShadowOffsetX(AValue: ShortInt);
+    procedure SetShadowOffsetY(AValue: ShortInt);
+    procedure SetShadowRadius(AValue: Byte);
+    procedure SetSingleLine(AValue: Boolean);
+    procedure SetStyle(AValue: TFontStyles);
+    procedure SetTextAlignment(AValue: TBCAlignment);
+    procedure SetWordBreak(AValue: Boolean);
+  public
+    constructor Create(AControl: TControl); override;
+    procedure Assign(Source: TPersistent); override;
+  published
+    property Color: TColor read FColor write SetColor;
+    property EndEllipsis: Boolean read FEndEllipsis write SetEndEllipsis;
+    property FontQuality: TBGRAFontQuality
+      read FFontQuality write SetFontQuality;
+    property Height: Integer read FHeight write SetHeight;
+    property Name: String read FName write SetName stored IsNamStored;
+    property SingleLine: Boolean read FSingleLine write SetSingleLine;
+    property Shadow: Boolean read FShadow write SetShadow;
+    property ShadowColor: TColor
+      read FShadowColor write SetShadowColor;
+    property ShadowColorOpacity: Byte read FShadowColorOpacity write SetShadowColorOpacity;
+    property ShadowRadius: Byte
+      read FShadowRadius write SetShadowRadius;
+    property ShadowOffsetX: ShortInt
+      read FShadowOffsetX write SetShadowOffsetX;
+    property ShadowOffsetY: ShortInt
+      read FShadowOffsetY write SetShadowOffsetY;
+    property Style: TFontStyles read FStyle write SetStyle;
+    property TextAlignment: TBCAlignment
+      read FTextAlignment write SetTextAlignment;
+    property WordBreak: Boolean read FWordBreak write SetWordBreak;
+  end;
+
+  { TBCBackground }
+
+  TBCBackground = class(TBCProperty)
+  private
+    FColor: TColor;
+    FColorOpacity: byte;
+    FGradient1: TBCGradient;
+    FGradient1EndPercent: single;
+    FGradient2: TBCGradient;
+    FStyle: TBCBackgroundStyle;
+    procedure OnChangeChildProperty(Sender: TObject; AData: PtrInt);
+    procedure SetColor(AValue: TColor);
+    procedure SetColorOpacity(AValue: byte);
+    procedure SetGradient1(AValue: TBCGradient);
+    procedure SetGradient1EndPercent(AValue: single);
+    procedure SetGradient2(AValue: TBCGradient);
+    procedure SetStyle(AValue: TBCBackgroundStyle);
+  public
+    constructor Create(AControl: TControl); override;
+    destructor Destroy; override;
+
+    procedure Assign(Source: TPersistent); override;
+  published
+    property Color: TColor read FColor write SetColor;
+    property ColorOpacity: byte read FColorOpacity write SetColorOpacity;
+    property Gradient1: TBCGradient read FGradient1 write SetGradient1;
+    property Gradient2: TBCGradient read FGradient2 write SetGradient2;
+    property Gradient1EndPercent: single read FGradient1EndPercent
+      write SetGradient1EndPercent;
+    property Style: TBCBackgroundStyle read FStyle write SetStyle;
+  end;
+
+  { TBCBorder }
+
+  TBCBorder = class(TBCProperty)
+  private
+    FColor: TColor;
+    FColorOpacity: byte;
+    FLightColor: TColor;
+    FLightOpacity: byte;
+    FLightWidth: integer;
+    FStyle: TBCBorderStyle;
+    FWidth: Integer;
+    procedure SetColor(AValue: TColor);
+    procedure SetColorOpacity(AValue: byte);
+    procedure SetLightColor(AValue: TColor);
+    procedure SetLightOpacity(AValue: byte);
+    procedure SetLightWidth(AValue: integer);
+    procedure SetStyle(AValue: TBCBorderStyle);
+    procedure SetWidth(AValue: Integer);
+  public
+    constructor Create(AControl: TControl); override;
+    procedure Assign(Source: TPersistent); override;
+  published
+    property Color: TColor read FColor write SetColor;
+    property ColorOpacity: byte read FColorOpacity
+      write SetColorOpacity;
+    property LightColor: TColor read FLightColor write SetLightColor;
+    property LightOpacity: byte read FLightOpacity write SetLightOpacity;
+    property LightWidth: integer read FLightWidth write SetLightWidth;
+    property Style: TBCBorderStyle read FStyle write SetStyle;
+    property Width: Integer read FWidth write SetWidth;
+  end;
+
+  { TBCRounding }
+
+  TBCRounding = class(TBCProperty)
+  private
+    FRoundOptions: TRoundRectangleOptions;
+    FRoundX: Byte;
+    FRoundY: Byte;
+    procedure SetRoundOptions(AValue: TRoundRectangleOptions);
+    procedure SetRoundX(AValue: Byte);
+    procedure SetRoundY(AValue: Byte);
+  public
+    constructor Create(AControl: TControl); override;
+    procedure Assign(Source: TPersistent); override;
+  published
+    property RoundX: Byte read FRoundX write SetRoundX;
+    property RoundY: Byte read FRoundY write SetRoundY;
+    property RoundOptions: TRoundRectangleOptions
+      read FRoundOptions write SetRoundOptions;
+  end;
+
+
+{const
+  DEF_START_COL      = $00EFE6D2;
+  DEF_END_COL        = $00C87511;
+  DEF_BORD_COL       = $00AB713B;
+  DEF_BORD_COL_HOVER = $00D7B697;
+  DEF_FONT_COLOR     = $0072412A; }
+
+implementation
+
+{ TBCRounding }
+
+procedure TBCRounding.SetRoundOptions(AValue: TRoundRectangleOptions);
+begin
+  if FRoundOptions = AValue then Exit;
+  FRoundOptions := AValue;
+
+  Change;
+end;
+
+procedure TBCRounding.SetRoundX(AValue: Byte);
+begin
+  if FRoundX = AValue then Exit;
+  FRoundX := AValue;
+
+  Change;
+end;
+
+procedure TBCRounding.SetRoundY(AValue: Byte);
+begin
+  if FRoundY = AValue then Exit;
+  FRoundY := AValue;
+
+  Change;
+end;
+
+constructor TBCRounding.Create(AControl: TControl);
+begin
+  inherited Create(AControl);
+
+  FRoundX := 1;
+  FRoundY := 1;
+  FRoundOptions := [];
+end;
+
+procedure TBCRounding.Assign(Source: TPersistent);
+begin
+  if Source is TBCRounding then
+  begin
+    FRoundX       := TBCRounding(Source).FRoundX;
+    FRoundY       := TBCRounding(Source).FRoundY;
+    FRoundOptions := TBCRounding(Source).FRoundOptions;
+  end
+  else
+    inherited Assign(Source);
+end;
+
+{ TBCGradient }
+
+procedure TBCGradient.SetColorCorrection(const AValue: boolean);
+begin
+  if FColorCorrection = AValue then
+    exit;
+  FColorCorrection := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetDrawMode(const AValue: TDrawMode);
+begin
+  if FDrawMode = AValue then
+    exit;
+  FDrawMode := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetEndColor(const AValue: TColor);
+begin
+  if FEndColor = AValue then
+    exit;
+  FEndColor := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetEndColorOpacity(const AValue: byte);
+begin
+  if FEndColorOpacity = AValue then
+    exit;
+  FEndColorOpacity := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetGradientType(const AValue: TGradientType);
+begin
+  if FGradientType = AValue then
+    exit;
+  FGradientType := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetPoint1XPercent(const AValue: single);
+begin
+  if FPoint1XPercent = AValue then
+    exit;
+  FPoint1XPercent := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetPoint1YPercent(const AValue: single);
+begin
+  if FPoint1YPercent = AValue then
+    exit;
+  FPoint1YPercent := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetPoint2XPercent(const AValue: single);
+begin
+  if FPoint2XPercent = AValue then
+    exit;
+  FPoint2XPercent := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetPoint2YPercent(const AValue: single);
+begin
+  if FPoint2YPercent = AValue then
+    exit;
+  FPoint2YPercent := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetSinus(const AValue: boolean);
+begin
+  if FSinus = AValue then
+    exit;
+  FSinus := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetStartColor(const AValue: TColor);
+begin
+  if FStartColor = AValue then
+    exit;
+  FStartColor := AValue;
+
+  Change;
+end;
+
+procedure TBCGradient.SetStartColorOpacity(const AValue: byte);
+begin
+  if FStartColorOpacity = AValue then
+    exit;
+  FStartColorOpacity := AValue;
+
+  Change;
+end;
+
+constructor TBCGradient.Create(AControl: TControl);
+begin
+  FStartColor := clWhite;
+  FStartColorOpacity := 255;
+  FDrawMode := dmSet;
+  FEndColor := clBlack;
+  FEndColorOpacity := 255;
+  FGradientType := gtLinear;
+  FColorCorrection := True;
+  FSinus := False;
+
+  FPoint1XPercent := 0;
+  FPoint1YPercent := 0;
+  FPoint2XPercent := 0;
+  FPoint2YPercent := 100;
+
+  inherited Create(AControl);
+end;
+
+procedure TBCGradient.Assign(Source: TPersistent);
+begin
+  if Source is TBCGradient then
+  begin
+    FStartColor := TBCGradient(Source).FStartColor;
+    FStartColorOpacity := TBCGradient(Source).FStartColorOpacity;
+    FDrawMode := TBCGradient(Source).FDrawMode;
+    FEndColor := TBCGradient(Source).FEndColor;
+    FEndColorOpacity := TBCGradient(Source).FEndColorOpacity;
+    FColorCorrection := TBCGradient(Source).FColorCorrection;
+    FGradientType := TBCGradient(Source).FGradientType;
+    FPoint1XPercent := TBCGradient(Source).FPoint1XPercent;
+    FPoint1YPercent := TBCGradient(Source).FPoint1YPercent;
+    FPoint2XPercent := TBCGradient(Source).FPoint2XPercent;
+    FPoint2YPercent := TBCGradient(Source).FPoint2YPercent;
+    FSinus := TBCGradient(Source).FSinus;
+
+    Change;
+  end
+  else
+    inherited Assign(Source);
+end;
+
+{ TBCFont }
+
+function TBCFont.IsNamStored: Boolean;
+begin
+  Result := DefFontData.Name <> Name;
+end;
+
+procedure TBCFont.SetColor(AValue: TColor);
+begin
+  if FColor = AValue then Exit;
+  FColor := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetEndEllipsis(AValue: Boolean);
+begin
+  if FEndEllipsis = AValue then Exit;
+  FEndEllipsis := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetFontQuality(AValue: TBGRAFontQuality);
+begin
+  if FFontQuality = AValue then Exit;
+  FFontQuality := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetHeight(AValue: Integer);
+begin
+  if FHeight = AValue then Exit;
+  FHeight := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetName(AValue: String);
+begin
+  if FName = AValue then Exit;
+  FName := AValue;
+  if FName='' then
+    FName := 'default';
+  Change;
+end;
+
+procedure TBCFont.SetShadow(AValue: Boolean);
+begin
+  if FShadow = AValue then Exit;
+  FShadow := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetShadowColor(AValue: TColor);
+begin
+  if FShadowColor = AValue then Exit;
+  FShadowColor := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetShadowColorOpacity(AValue: Byte);
+begin
+  if FShadowColorOpacity = AValue then Exit;
+  FShadowColorOpacity := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetShadowOffsetX(AValue: ShortInt);
+begin
+  if FShadowOffsetX = AValue then Exit;
+  FShadowOffsetX := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetShadowOffsetY(AValue: ShortInt);
+begin
+  if FShadowOffsetY = AValue then Exit;
+  FShadowOffsetY := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetShadowRadius(AValue: Byte);
+begin
+  if FShadowRadius = AValue then Exit;
+  FShadowRadius := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetSingleLine(AValue: Boolean);
+begin
+  if FSingleLine = AValue then Exit;
+  FSingleLine := AValue;
+
+  if FSingleLine then
+    FWordBreak := False;
+
+  Change;
+end;
+
+procedure TBCFont.SetStyle(AValue: TFontStyles);
+begin
+  if FStyle = AValue then Exit;
+  FStyle := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetTextAlignment(AValue: TBCAlignment);
+begin
+  if FTextAlignment = AValue then Exit;
+  FTextAlignment := AValue;
+
+  Change;
+end;
+
+procedure TBCFont.SetWordBreak(AValue: Boolean);
+begin
+  if FWordBreak = AValue then Exit;
+  FWordBreak := AValue;
+
+  if FWordBreak then
+    FSingleLine := False;
+
+  Change;
+end;
+
+constructor TBCFont.Create(AControl: TControl);
+begin
+  inherited Create(AControl);
+
+  // That is temporary. BGRABitmap draw some yellow background when fqSystemClearType.
+  // This problem is reported
+  {$IFDEF LCLGTK2}
+  FFontQuality        := fqFineAntialiasing;
+  {$ELSE}
+  FFontQuality        := fqSystemClearType;
+  {$ENDIF}
+  FShadow             := False;
+  FShadowColor        := clBlack;
+  FShadowColorOpacity := 255;
+  FShadowRadius       := 5;
+  FShadowOffsetX      := 5;
+  FShadowOffsetY      := 5;
+  FHeight             := 0;
+  FTextAlignment      := bcaCenter;
+  FStyle              := [];
+  FName               := DefFontData.Name;
+  FColor              := clDefault;
+  FWordBreak          := False;
+  FSingleLine         := True;
+  FEndEllipsis        := False;
+end;
+
+procedure TBCFont.Assign(Source: TPersistent);
+begin
+  if Source is TBCFont then
+  begin
+    FColor              := TBCFont(Source).FColor;
+    FEndEllipsis        := TBCFont(Source).FEndEllipsis;
+    FFontQuality        := TBCFont(Source).FFontQuality;
+    FHeight             := TBCFont(Source).FHeight;
+    FName               := TBCFont(Source).FName;
+    FSingleLine         := TBCFont(Source).FSingleLine;
+    FShadow             := TBCFont(Source).FShadow;
+    FShadowColor        := TBCFont(Source).FShadowColor;
+    FShadowColorOpacity := TBCFont(Source).FShadowColorOpacity;
+    FShadowRadius       := TBCFont(Source).FShadowRadius;
+    FShadowOffsetX      := TBCFont(Source).FShadowOffsetX;
+    FShadowOffsetY      := TBCFont(Source).FShadowOffsetY;
+    FStyle              := TBCFont(Source).FStyle;
+    FTextAlignment      := TBCFont(Source).FTextAlignment;
+    FWordBreak          := TBCFont(Source).FWordBreak;
+
+    Change;
+  end
+  else
+    inherited Assign(Source);
+end;
+
+{ TBCBackground }
+
+procedure TBCBackground.SetStyle(AValue: TBCBackgroundStyle);
+begin
+  if FStyle = AValue then Exit;
+  FStyle := AValue;
+
+  Change;
+end;
+
+constructor TBCBackground.Create(AControl: TControl);
+begin
+  FStyle := bbsColor;
+  FColorOpacity := 255;
+  FGradient1 := TBCGradient.Create(AControl);
+  FGradient2 := TBCGradient.Create(AControl);
+  FGradient1EndPercent := 35;
+
+  FGradient1.OnChange := @OnChangeChildProperty;
+  FGradient2.OnChange := @OnChangeChildProperty;
+  inherited Create(AControl);
+end;
+
+destructor TBCBackground.Destroy;
+begin
+  FGradient1.Free;
+  FGradient2.Free;
+  inherited Destroy;
+end;
+
+procedure TBCBackground.Assign(Source: TPersistent);
+begin
+  if Source is TBCBackground then
+  begin
+    FColor               := TBCBackground(Source).FColor;
+    FColorOpacity        := TBCBackground(Source).FColorOpacity;
+    FGradient1EndPercent := TBCBackground(Source).FGradient1EndPercent;
+    FStyle               := TBCBackground(Source).FStyle;
+    FGradient1.Assign(TBCBackground(Source).FGradient1);
+    FGradient2.Assign(TBCBackground(Source).FGradient2);
+  end
+  else
+    inherited Assign(Source);
+end;
+
+procedure TBCBackground.SetGradient1(AValue: TBCGradient);
+begin
+  if FGradient1 = AValue then Exit;
+  FGradient1 := AValue;
+
+  Change;
+end;
+
+procedure TBCBackground.OnChangeChildProperty(Sender: TObject; AData: PtrInt);
+begin
+  Change(AData);
+end;
+
+procedure TBCBackground.SetColor(AValue: TColor);
+begin
+  if FColor = AValue then Exit;
+  FColor := AValue;
+
+  Change;
+end;
+
+procedure TBCBackground.SetColorOpacity(AValue: byte);
+begin
+  if FColorOpacity = AValue then Exit;
+  FColorOpacity := AValue;
+
+  Change;
+end;
+
+procedure TBCBackground.SetGradient1EndPercent(AValue: single);
+begin
+  if FGradient1EndPercent = AValue then Exit;
+  FGradient1EndPercent := AValue;
+
+  Change;
+end;
+
+procedure TBCBackground.SetGradient2(AValue: TBCGradient);
+begin
+  if FGradient2 = AValue then Exit;
+  FGradient2 := AValue;
+
+  Change;
+end;
+
+{ TBCBorder }
+
+procedure TBCBorder.SetLightColor(AValue: TColor);
+begin
+  if FLightColor = AValue then Exit;
+  FLightColor := AValue;
+
+  Change;
+end;
+
+procedure TBCBorder.SetColor(AValue: TColor);
+begin
+  if FColor = AValue then Exit;
+  FColor := AValue;
+
+  Change;
+end;
+
+procedure TBCBorder.SetColorOpacity(AValue: byte);
+begin
+  if FColorOpacity = AValue then Exit;
+  FColorOpacity := AValue;
+
+  Change;
+end;
+
+procedure TBCBorder.SetLightOpacity(AValue: byte);
+begin
+  if FLightOpacity = AValue then Exit;
+  FLightOpacity := AValue;
+
+  Change;
+end;
+
+procedure TBCBorder.SetLightWidth(AValue: integer);
+begin
+  if FLightWidth = AValue then Exit;
+  FLightWidth := AValue;
+
+  Change;
+end;
+
+procedure TBCBorder.SetStyle(AValue: TBCBorderStyle);
+begin
+  if FStyle = AValue then Exit;
+  FStyle := AValue;
+
+  Change;
+end;
+
+procedure TBCBorder.SetWidth(AValue: Integer);
+begin
+  if FWidth = AValue then Exit;
+  FWidth := AValue;
+
+  Change;
+end;
+
+constructor TBCBorder.Create(AControl: TControl);
+begin
+  FColor := clBlack;
+  FColorOpacity := 255;
+  FLightWidth := 0;
+  FLightOpacity := 255;
+  FLightColor := clWhite;
+  FStyle := bboSolid;
+  FWidth := 1;
+  inherited Create(AControl);
+end;
+
+procedure TBCBorder.Assign(Source: TPersistent);
+begin
+  if Source is TBCBorder then
+  begin
+    FColor        := TBCBorder(Source).FColor;
+    FColorOpacity := TBCBorder(Source).FColorOpacity;
+    FLightColor   := TBCBorder(Source).FLightColor;
+    FLightOpacity := TBCBorder(Source).FLightOpacity;
+    FLightWidth   := TBCBorder(Source).FLightWidth;
+    FStyle        := TBCBorder(Source).FStyle;
+    FWidth        := TBCBorder(Source).FWidth;
+  end
+  else
+    inherited Assign(Source);
+end;
+
+end.

+ 156 - 0
bgracontrols.lpk

@@ -0,0 +1,156 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <Package Version="4">
+    <Name Value="bgracontrols"/>
+    <CompilerOptions>
+      <Version Value="11"/>
+      <SearchPaths>
+        <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)/$(FPCVer)"/>
+      </SearchPaths>
+      <CodeGeneration>
+        <SmartLinkUnit Value="True"/>
+        <Optimizations>
+          <VariablesInRegisters Value="True"/>
+          <OptimizationLevel Value="3"/>
+        </Optimizations>
+      </CodeGeneration>
+      <Linking>
+        <Debugging>
+          <GenerateDebugInfo Value="False"/>
+        </Debugging>
+      </Linking>
+      <Other>
+        <CompilerMessages>
+          <UseMsgFile Value="True"/>
+        </CompilerMessages>
+        <CompilerPath Value="$(CompPath)"/>
+      </Other>
+    </CompilerOptions>
+    <Version Major="3"/>
+    <Files Count="21">
+      <Item1>
+        <Filename Value="bcbasectrls.pas"/>
+        <UnitName Value="BCBaseCtrls"/>
+      </Item1>
+      <Item2>
+        <Filename Value="bcbutton.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BCButton"/>
+      </Item2>
+      <Item3>
+        <Filename Value="bceffect.pas"/>
+        <UnitName Value="bceffect"/>
+      </Item3>
+      <Item4>
+        <Filename Value="bcfilters.pas"/>
+        <UnitName Value="bcfilters"/>
+      </Item4>
+      <Item5>
+        <Filename Value="bcgamegrid.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BCGameGrid"/>
+      </Item5>
+      <Item6>
+        <Filename Value="bcimagebutton.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BCImageButton"/>
+      </Item6>
+      <Item7>
+        <Filename Value="bclabel.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BCLabel"/>
+      </Item7>
+      <Item8>
+        <Filename Value="bcpanel.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BCPanel"/>
+      </Item8>
+      <Item9>
+        <Filename Value="bcrtti.pas"/>
+        <UnitName Value="BCRTTI"/>
+      </Item9>
+      <Item10>
+        <Filename Value="bcstylesform.pas"/>
+        <UnitName Value="BCStylesForm"/>
+      </Item10>
+      <Item11>
+        <Filename Value="bctools.pas"/>
+        <UnitName Value="BCTools"/>
+      </Item11>
+      <Item12>
+        <Filename Value="bctypes.pas"/>
+        <AddToUsesPkgSection Value="False"/>
+        <UnitName Value="bctypes"/>
+      </Item12>
+      <Item13>
+        <Filename Value="bgraflashprogressbar.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRAFlashProgressBar"/>
+      </Item13>
+      <Item14>
+        <Filename Value="bgragraphiccontrol.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRAGraphicControl"/>
+      </Item14>
+      <Item15>
+        <Filename Value="bgraimagelist.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRAImageList"/>
+      </Item15>
+      <Item16>
+        <Filename Value="bgraimagemanipulation.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRAImageManipulation"/>
+      </Item16>
+      <Item17>
+        <Filename Value="bgraknob.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRAKnob"/>
+      </Item17>
+      <Item18>
+        <Filename Value="bgrashape.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRAShape"/>
+      </Item18>
+      <Item19>
+        <Filename Value="bgraspeedbutton.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRASpeedButton"/>
+      </Item19>
+      <Item20>
+        <Filename Value="bgraspriteanimation.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRASpriteAnimation"/>
+      </Item20>
+      <Item21>
+        <Filename Value="bgravirtualscreen.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BGRAVirtualScreen"/>
+      </Item21>
+    </Files>
+    <Type Value="RunAndDesignTime"/>
+    <RequiredPkgs Count="4">
+      <Item1>
+        <PackageName Value="FCL"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="IDEIntf"/>
+      </Item2>
+      <Item3>
+        <PackageName Value="LCL"/>
+      </Item3>
+      <Item4>
+        <PackageName Value="bgrabitmappack"/>
+      </Item4>
+    </RequiredPkgs>
+    <UsageOptions>
+      <UnitPath Value="$(PkgOutDir)"/>
+    </UsageOptions>
+    <PublishOptions>
+      <Version Value="2"/>
+    </PublishOptions>
+    <CustomOptions Items="ExternHelp" Version="2">
+      <_ExternHelp Items="Count"/>
+    </CustomOptions>
+  </Package>
+</CONFIG>

+ 38 - 0
bgracontrols.pas

@@ -0,0 +1,38 @@
+{ This file was automatically created by Lazarus. Do not edit!
+  This source is only used to compile and install the package.
+ }
+
+unit bgracontrols;
+
+interface
+
+uses
+  BCBaseCtrls, BCButton, BCEffect, bcfilters, BCGameGrid, BCImageButton, 
+  BCLabel, BCPanel, BCRTTI, BCStylesForm, BCTools, BGRAFlashProgressBar, 
+  BGRAGraphicControl, BGRAImageList, BGRAImageManipulation, BGRAKnob, 
+  BGRAShape, BGRASpeedButton, BGRASpriteAnimation, BGRAVirtualScreen, 
+  LazarusPackageIntf;
+
+implementation
+
+procedure Register;
+begin
+  RegisterUnit('BCButton', @BCButton.Register);
+  RegisterUnit('BCGameGrid', @BCGameGrid.Register);
+  RegisterUnit('BCImageButton', @BCImageButton.Register);
+  RegisterUnit('BCLabel', @BCLabel.Register);
+  RegisterUnit('BCPanel', @BCPanel.Register);
+  RegisterUnit('BGRAFlashProgressBar', @BGRAFlashProgressBar.Register);
+  RegisterUnit('BGRAGraphicControl', @BGRAGraphicControl.Register);
+  RegisterUnit('BGRAImageList', @BGRAImageList.Register);
+  RegisterUnit('BGRAImageManipulation', @BGRAImageManipulation.Register);
+  RegisterUnit('BGRAKnob', @BGRAKnob.Register);
+  RegisterUnit('BGRAShape', @BGRAShape.Register);
+  RegisterUnit('BGRASpeedButton', @BGRASpeedButton.Register);
+  RegisterUnit('BGRASpriteAnimation', @BGRASpriteAnimation.Register);
+  RegisterUnit('BGRAVirtualScreen', @BGRAVirtualScreen.Register);
+end;
+
+initialization
+  RegisterPackage('bgracontrols', @Register);
+end.

+ 222 - 0
bgraflashprogressbar.pas

@@ -0,0 +1,222 @@
+unit BGRAFlashProgressBar;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, LMessages, Forms, Controls, Graphics,
+  Dialogs, BGRABitmap;
+
+type
+
+  { TBGRAFlashProgressBar }
+
+  TBGRAFlashProgressBar = class(TGraphicControl)
+  private
+    FMaxValue: integer;
+    FMinValue: integer;
+    FValue:    integer;
+    FBmp:      TBGRABitmap;
+    FRandSeed: integer;
+    procedure SetMaxValue(const AValue: integer);
+    procedure SetMinValue(const AValue: integer);
+    procedure SetValue(const AValue: integer);
+    { Private declarations }
+  protected
+    { Protected declarations }
+    procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
+      WithThemeSpace: boolean); override;
+    procedure Paint; override;
+    procedure WMEraseBkgnd(var Message: TLMEraseBkgnd); message LM_ERASEBKGND;
+  public
+    { Public declarations }
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+  published
+    { Published declarations }
+    property Align;
+    property Anchors;
+    property MinValue: integer Read FMinValue Write SetMinValue;
+    property MaxValue: integer Read FMaxValue Write SetMaxValue;
+    property Value: integer Read FValue Write SetValue;
+    property OnClick;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    property Color;
+  end;
+
+procedure Register;
+
+implementation
+
+uses BGRABitmapTypes, BGRAGradients, Types;
+
+procedure Register;
+begin
+  {$I bgraflashprogressbar_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRAFlashProgressBar]);
+end;
+
+{ TBGRAFlashProgressBar }
+
+procedure TBGRAFlashProgressBar.SetMinValue(const AValue: integer);
+begin
+  if FMinValue = AValue then
+    exit;
+  FMinValue := AValue;
+  if FValue < FMinValue then
+    FValue := FMinValue;
+  if FMaxValue < FMinValue then
+    FMaxValue := FMinValue;
+  Invalidate;
+end;
+
+procedure TBGRAFlashProgressBar.SetValue(const AValue: integer);
+begin
+  if FValue = AValue then
+    exit;
+  FValue := AValue;
+  if FValue < FMinValue then
+    FValue := FMinValue;
+  if FValue > FMaxValue then
+    FValue := FMaxValue;
+  Invalidate;
+end;
+
+{$hints off}
+procedure TBGRAFlashProgressBar.CalculatePreferredSize(
+  var PreferredWidth, PreferredHeight: integer; WithThemeSpace: boolean);
+begin
+  PreferredWidth  := 379;
+  PreferredHeight := 33;
+end;
+
+{$hints on}
+
+procedure TBGRAFlashProgressBar.Paint;
+var
+  content: TRect;
+  xpos, y, tx, ty: integer;
+  grayValue: integer;
+
+  function ApplyLightness(c: TBGRAPixel; lightness: word): TBGRAPixel;
+  begin
+    Result := GammaCompression(SetLightness(GammaExpansion(c), lightness));
+  end;
+
+  procedure DrawBar(bounds: TRect);
+  var
+    lCol: TBGRAPixel;
+  begin
+    lCol := ColorToBGRA(ColorToRGB(Color));
+
+    DoubleGradientAlphaFill(FBmp, bounds,
+      ApplyLightness(lCol, 37000), ApplyLightness(lCol, 29000),
+      ApplyLightness(lCol, 26000), ApplyLightness(lCol, 18000),
+      gdVertical, gdVertical, gdVertical, 0.53);
+
+    InflateRect(bounds, -1, -1);
+
+    DoubleGradientAlphaFill(FBmp, bounds,
+      ApplyLightness(lCol, 28000), ApplyLightness(lCol, 22000),
+      ApplyLightness(lCol, 19000), ApplyLightness(lCol, 11000),
+      gdVertical, gdVertical, gdVertical, 0.53);
+  end;
+
+begin
+  tx := ClientWidth;
+  ty := ClientHeight;
+  if Assigned(FBmp) and ((FBmp.Width <> tx) or (FBmp.Height <> ty)) then
+    FreeAndNil(FBmp);
+
+  if not Assigned(FBmp) then
+    FBmp := TBGRABitmap.Create(tx, ty)
+  else
+    FBmp.FillTransparent;
+
+  FBmp.Rectangle(0, 0, tx, ty, BGRA(255, 255, 255, 6), dmSet);
+  if (tx > 2) and (ty > 2) then
+    FBmp.Rectangle(1, 1, tx - 1, ty - 1, BGRA(29, 29, 29), dmSet);
+
+  if (tx > 4) and (ty > 4) then
+  begin
+    content  := Rect(2, 2, tx - 2, ty - 2);
+    randseed := FRandSeed;
+    for y := content.Top to content.Bottom - 1 do
+    begin
+      if y = content.Top then
+        grayValue := 33
+      else
+      if y = content.Top + 1 then
+        grayValue := 43
+      else
+        grayValue := 47 + random(50 - 47 + 1);
+      FBmp.SetHorizLine(content.Left, y, content.Right - 1, BGRA(
+        grayValue, grayValue, grayValue));
+    end;
+    if tx >= 6 then
+      FBmp.DrawVertLine(content.Right - 1, content.Top, content.Bottom - 1,
+        BGRA(0, 0, 0, 32));
+    if FMaxValue > FMinValue then
+    begin
+      xpos := round((FValue - FMinValue) / (FMaxValue - FMinValue) *
+        (content.right - content.left)) + content.left;
+      if xpos > content.left then
+      begin
+        DrawBar(rect(content.left, content.top, xpos, content.bottom));
+        if xpos < content.right then
+        begin
+          FBmp.SetPixel(xpos, content.top, BGRA(62, 62, 62));
+          FBmp.SetVertLine(xpos, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+        end;
+      end;
+    end;
+  end;
+  FBmp.Draw(Canvas, 0, 0, False);
+end;
+
+{$hints off}
+procedure TBGRAFlashProgressBar.WMEraseBkgnd(var Message: TLMEraseBkgnd);
+begin
+  //do nothing
+end;
+
+{$hints on}
+
+constructor TBGRAFlashProgressBar.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  with GetControlClassDefaultSize do
+    SetInitialBounds(0, 0, CX, 33);
+  FMinValue := 0;
+  FMaxValue := 100;
+  FValue := 30;
+  FBmp := nil;
+  randomize;
+  FRandSeed := randseed;
+  Color := BGRAToColor(BGRA(102, 163, 226));
+end;
+
+destructor TBGRAFlashProgressBar.Destroy;
+begin
+  FreeAndNil(FBmp);
+  inherited Destroy;
+end;
+
+procedure TBGRAFlashProgressBar.SetMaxValue(const AValue: integer);
+begin
+  if FMaxValue = AValue then
+    exit;
+  FMaxValue := AValue;
+  if FValue > FMaxValue then
+    FValue := FMaxValue;
+  if FMinValue > FMaxValue then
+    FMinValue := FMaxValue;
+  Invalidate;
+end;
+
+end.

+ 46 - 0
bgraflashprogressbar_icon.lrs

@@ -0,0 +1,46 @@
+LazarusResources.Add('TBGRAFlashProgressBar','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#14#8#3#0#0#0#2'&,L'#0#0#0
+  +#1'sRGB'#0#174#206#28#233#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0#3#0'PLTE'
+  +#0#0#0'(((///0001112229Ro;Vu<Vr>Zz@^'#127';b'#142'=c'#144'?h'#150'Cc'#133'Il'
+  +#142'Ah'#147'Ai'#148'@i'#152'Cm'#158'Ko'#147'Nr'#152'Pv'#156'Do'#160'Gs'#166
+  +'Hu'#168'L{'#176'M}'#178'Sy'#161'Z'#130#166'U'#137#190'W'#139#191'X'#142#198
+  +'Z'#144#199'\'#148#205'^'#149#206'_'#153#212'a'#155#213'c'#158#220'd'#160#221
+  +'r'#175#232's'#176#232#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0'S'#191'z'#223#0#0#1#0'tRNS'#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#0'S'#247#7'%'#0#0#0#9'pHYs'#0#0#14#195#0#0#14#195#1#199'o'#168'd'#0#0#0#25
+  +'tEXtSoftware'#0'Paint.NET v3.5.87;'#128']'#0#0#0'mIDAT(Su'#208#231#14#194'0'
+  +#12'FQC'#211#1#221#3#232#222'-'#240#254#15#8'F'#250#164'DV9?s'#29'9'#10'}'
+  +#232#16#31#191'_'#208#157#12'<'#253#220#161'U'#154#197'a['#225'nig'#14#203#12
+  +'7#'#252'nL#'#20'"'#12'='#196'"45D"T%\'#197#171#30'9\'#140#160'xy'#22#130'+B'
+  +#224#131'#v'#164#9'x'#182#129#232#223'''~'#1#205#23#17#225#150#15#231'k'#0#0
+  +#0#0'IEND'#174'B`'#130
+]);

+ 252 - 0
bgragraphiccontrol.pas

@@ -0,0 +1,252 @@
+unit BGRAGraphicControl;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
+  ExtCtrls, BGRABitmap, BCTypes;
+
+type
+
+  { TBGRAGraphicControl }
+
+  TBGRAGraphicControl = class(TGraphicControl)
+  private
+    { Private declarations }
+    FBGRA:         TBGRABitmap;
+    FOnRedraw:     TBGRARedrawEvent;
+    FBevelInner, FBevelOuter: TPanelBevel;
+    FBevelWidth:   TBevelWidth;
+    FBorderWidth:  TBorderWidth;
+    FAlignment:    TAlignment;
+    FColorOpacity: byte;
+    procedure SetAlignment(const Value: TAlignment);
+    procedure SetBevelInner(const AValue: TPanelBevel);
+    procedure SetBevelOuter(const AValue: TPanelBevel);
+    procedure SetBevelWidth(const AValue: TBevelWidth);
+    procedure SetBorderWidth(const AValue: TBorderWidth);
+    procedure SetColorOpacity(const AValue: byte);
+  protected
+    { Protected declarations }
+    procedure Paint; override;
+    procedure Resize; override;
+    procedure BGRASetSize(AWidth, AHeight: integer);
+    procedure RedrawBitmapContent; virtual;
+    procedure SetColor(Value: TColor); override;
+    procedure SetEnabled(Value: boolean); override;
+    procedure TextChanged; override;
+  public
+    { Public declarations }
+    constructor Create(TheOwner: TComponent); override;
+    procedure RedrawBitmap;
+    procedure DiscardBitmap;
+    destructor Destroy; override;
+  published
+    { Published declarations }
+    property OnRedraw: TBGRARedrawEvent Read FOnRedraw Write FOnRedraw;
+    property Bitmap: TBGRABitmap Read FBGRA;
+    property BorderWidth: TBorderWidth Read FBorderWidth Write SetBorderWidth default 0;
+    property BevelInner: TPanelBevel Read FBevelInner Write SetBevelInner default bvNone;
+    property BevelOuter: TPanelBevel
+      Read FBevelOuter Write SetBevelOuter default bvRaised;
+    property BevelWidth: TBevelWidth Read FBevelWidth Write SetBevelWidth default 1;
+    property Color;
+    property ColorOpacity: byte Read FColorOpacity Write SetColorOpacity;
+    property Alignment: TAlignment Read FAlignment Write SetAlignment;
+    property OnClick;
+    property OnDblClick;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    property OnPaint;
+    property Caption;
+  end;
+
+procedure Register;
+
+implementation
+
+uses BGRABitmapTypes, Types;
+
+procedure Register;
+begin
+  {$I bgragraphiccontrol_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRAGraphicControl]);
+end;
+
+procedure TBGRAGraphicControl.SetAlignment(const Value: TAlignment);
+begin
+  if FAlignment = Value then
+    exit;
+  FAlignment := Value;
+  DiscardBitmap;
+end;
+
+procedure TBGRAGraphicControl.SetBevelInner(const AValue: TPanelBevel);
+begin
+  if FBevelInner = AValue then
+    exit;
+  FBevelInner := AValue;
+  DiscardBitmap;
+end;
+
+procedure TBGRAGraphicControl.SetBevelOuter(const AValue: TPanelBevel);
+begin
+  if FBevelOuter = AValue then
+    exit;
+  FBevelOuter := AValue;
+  DiscardBitmap;
+end;
+
+procedure TBGRAGraphicControl.SetBevelWidth(const AValue: TBevelWidth);
+begin
+  if FBevelWidth = AValue then
+    exit;
+  FBevelWidth := AValue;
+  DiscardBitmap;
+end;
+
+procedure TBGRAGraphicControl.SetBorderWidth(const AValue: TBorderWidth);
+begin
+  if FBorderWidth = AValue then
+    exit;
+  FBorderWidth := AValue;
+  DiscardBitmap;
+end;
+
+procedure TBGRAGraphicControl.SetColorOpacity(const AValue: byte);
+begin
+  if FColorOpacity = AValue then
+    exit;
+  FColorOpacity := AValue;
+  DiscardBitmap;
+end;
+
+procedure TBGRAGraphicControl.Paint;
+begin
+  BGRASetSize(Width, Height);
+  inherited Paint;
+  FBGRA.Draw(Canvas, 0, 0, False);
+end;
+
+procedure TBGRAGraphicControl.Resize;
+begin
+  inherited Resize;
+  DiscardBitmap;
+end;
+
+procedure TBGRAGraphicControl.BGRASetSize(AWidth, AHeight: integer);
+begin
+  if (FBGRA <> nil) and (AWidth <> FBGRA.Width) and (AHeight <> FBGRA.Height) then
+  begin
+    FBGRA.SetSize(AWidth, AHeight);
+    RedrawBitmapContent;
+  end;
+end;
+
+procedure TBGRAGraphicControl.RedrawBitmapContent;
+var
+  ARect: TRect;
+  TS: TTextStyle;
+begin
+  if (FBGRA <> nil) and (FBGRA.NbPixels <> 0) then
+  begin
+    FBGRA.Fill(ColorToBGRA(ColorToRGB(Color), FColorOpacity));
+
+    ARect := GetClientRect;
+
+    // if BevelOuter is set then draw a frame with BevelWidth
+    if (BevelOuter <> bvNone) and (BevelWidth > 0) then
+      FBGRA.CanvasBGRA.Frame3d(ARect, BevelWidth, BevelOuter,
+        BGRA(255, 255, 255, 200), BGRA(0, 0, 0, 160)); // Note: Frame3D inflates ARect
+
+    InflateRect(ARect, -BorderWidth, -BorderWidth);
+
+    // if BevelInner is set then skip the BorderWidth and draw a frame with BevelWidth
+    if (BevelInner <> bvNone) and (BevelWidth > 0) then
+      FBGRA.CanvasBGRA.Frame3d(ARect, BevelWidth, BevelInner,
+        BGRA(255, 255, 255, 160), BGRA(0, 0, 0, 160)); // Note: Frame3D inflates ARect
+
+    if Caption <> '' then
+    begin
+      FBGRA.CanvasBGRA.Font.Assign(Canvas.Font);
+      TS := Canvas.TextStyle;
+      TS.Alignment := Alignment;
+      TS.Layout := tlCenter;
+      TS.Opaque := False;
+      TS.Clipping := False;
+      TS.SystemFont := Canvas.Font.IsDefault;
+
+      FBGRA.CanvasBGRA.Font.Color := Color xor $FFFFFF;
+      FBGRA.CanvasBGRA.Font.Opacity := 255;
+
+      if not Enabled then
+        FBGRA.CanvasBGRA.Font.Style := [fsStrikeOut]
+      else
+        FBGRA.CanvasBGRA.Font.Style := [];
+
+      FBGRA.CanvasBGRA.TextRect(ARect, ARect.Left, ARect.Top, Caption, TS);
+    end;
+
+    if Assigned(FOnRedraw) then
+      FOnRedraw(self, FBGRA);
+  end;
+end;
+
+procedure TBGRAGraphicControl.SetColor(Value: TColor);
+begin
+  if Value <> Color then
+    DiscardBitmap;
+  inherited SetColor(Value);
+end;
+
+procedure TBGRAGraphicControl.SetEnabled(Value: boolean);
+begin
+  if Value <> Enabled then
+    DiscardBitmap;
+  inherited SetEnabled(Value);
+end;
+
+procedure TBGRAGraphicControl.TextChanged;
+begin
+  DiscardBitmap;
+end;
+
+constructor TBGRAGraphicControl.Create(TheOwner: TComponent);
+begin
+  inherited Create(TheOwner);
+  FBGRA := TBGRABitmap.Create;
+  FBevelWidth := 1;
+  FAlignment := taCenter;
+  Color := clWhite;
+  FColorOpacity := 128;
+  FBevelOuter := bvRaised;
+  FBevelInner := bvNone;
+end;
+
+procedure TBGRAGraphicControl.RedrawBitmap;
+begin
+  RedrawBitmapContent;
+  Repaint;
+end;
+
+procedure TBGRAGraphicControl.DiscardBitmap;
+begin
+  if (FBGRA <> nil) and (FBGRA.NbPixels <> 0) then
+  begin
+    FBGRA.SetSize(0, 0);
+    Invalidate;
+  end;
+end;
+
+destructor TBGRAGraphicControl.Destroy;
+begin
+  FBGRA.Free;
+  inherited Destroy;
+end;
+
+end.

+ 51 - 0
bgragraphiccontrol_icon.lrs

@@ -0,0 +1,51 @@
+LazarusResources.Add('TBGRAGraphicControl','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#3#0#0#0#215#169#205
+  +#202#0#0#0#1'sRGB'#0#174#206#28#233#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0
+  +#3#0'PLTE'#0#0#0#5#4#0#6#5#3#7#7#5'yyy7k'#190'vv'#146#128#128#128#137#137#137
+  +#183#184#189#186#188#183#187#187#185#189#190#184#150#181#231#186#188#201#190
+  +#192#187#194#195#187#192#192#192#194#192#193#192#193#198#197#196#204#194#193
+  +#209#200#200#208#201#204#213#223#223#219#239#239#237#244#244#254#249#250#242
+  +#251#251#255#250#252#249#251#252#255#252#251#255#255#255#248#255#255#251#253
+  +#254#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'2'#9#226#245#0#0#1#0'tRNS'#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#0'S'#247#7'%'#0#0#0#9'pHYs'#0#0#14#195#0#0#14#195#1
+  +#199'o'#168'd'#0#0#0#25'tEXtSoftware'#0'Paint.NET v3.5.87;'#128']'#0#0#0#198
+  +'IDAT(S}'#210'W'#2#194' '#16#4#208#137#202'bC'#5'['#176#203#253#239#168#3')'
+  +#166#186'I~'#230'%l('#248#140#20#254#128#244#139'o'#243#11'q'#205#18#239#141
+  +#147#30'0'#243'f'#222#3#165#156'3&'#155'tA'#25'^J'#25#215#6'0'#139#177#138
+  +#255#210#232#1#149#131#198'{'#251'Z'#183'A'#229',bX'#190#27#144#6#202#249' ,'
+  +#130#237'B'#204#229'|9'#133#31'@'#23#173'5'#228'q'#188#29'j'#128#213'I4'#156
+  +'l'#194#254'Y'#1#216'5'#18's'''#247#221'uU'#131#181'6'#18'sW'#172'h9'#15#16
+  +'l'#158'r'#174#149#247#245#204#17#223#182')''d'#211#10#152#131'U,'#190#248'Y'
+  +#181#186#8#197#232'%$'#141'= '#204';'#155#152'v'#16'Z'#15'm<'#1#131#7'b'#244
+  +#148'|'#1#173#245#207')'#178'J'#192#162#0#0#0#0'IEND'#174'B`'#130
+]);

+ 135 - 0
bgraimagelist.pas

@@ -0,0 +1,135 @@
+{ This component partialy solve problem with no alpha in lazarus GTK.
+  It is using BGRABitmap library for drawing icons.
+
+  Copyright (C) 2011 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+unit BGRAImageList;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
+  GraphType, BGRABitmap, BGRABitmapTypes, ImgList;
+
+{$IFDEF LCLgtk}
+  {$DEFINE BGRA_DRAW}
+{$ELSE}
+  {$IFDEF LCLgtk2}
+    {$DEFINE BGRA_DRAW}
+  {$ENDIF}
+{$ENDIF}
+
+type
+
+  { TBGRAImageList }
+
+  TBGRAImageList = class(TImageList)
+  private
+    { Private declarations }
+    {$IFDEF BGRA_DRAW}
+    FBGRA: TBGRABitmap;
+    FBmp:  TBitmap;
+    {$ENDIF}
+  protected
+    { Protected declarations }
+  public
+    { Public declarations }
+    {$IFDEF BGRA_DRAW}
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+
+    procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: integer;
+      ADrawingStyle: TDrawingStyle; AImageType: TImageType;
+      ADrawEffect: TGraphicsDrawEffect); override;
+    {$ENDIF}
+  published
+    { Published declarations }
+  end;
+
+procedure Register;
+
+implementation
+
+procedure Register;
+begin
+  {$I bgraimagelist_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRAImageList]);
+end;
+
+{$IFDEF BGRA_DRAW}
+{ TBGRAImageList }
+constructor TBGRAImageList.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  FBGRA := TBGRABitmap.Create;
+  FBmp  := TBitmap.Create;
+end;
+
+destructor TBGRAImageList.Destroy;
+begin
+  FBGRA.Free;
+  FBmp.Free;
+  inherited Destroy;
+end;
+
+{ Problem with no alpha is only on GTK so on Windows we use default drawing }
+procedure TBGRAImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: integer;
+  ADrawingStyle: TDrawingStyle; AImageType: TImageType;
+  ADrawEffect: TGraphicsDrawEffect);
+begin
+  //inherited; - We use TBGRABitmap drawing only
+
+  // This is required part from TImageList.Draw
+  if (AIndex < 0) or (AIndex >= Count) then
+    Exit;
+  ReferenceNeeded;
+
+  {*** BGRA Drawing *** }
+  case ADrawEffect of
+    gdeDisabled:
+    begin
+      GetBitmap(AIndex, FBmp, gdeNormal);
+      FBGRA.Assign(FBmp);
+      BGRAReplace(FBGRA, FBGRA.FilterGrayscale);
+    end;
+    else
+    begin
+      GetBitmap(AIndex, FBmp, ADrawEffect);
+      FBGRA.Assign(FBmp);
+    end;
+  end;
+  if ADrawingStyle in [dsFocus, dsSelected] then
+    FBGRA.ApplyGlobalOpacity(128);
+  FBGRA.Draw(ACanvas, AX, AY, False);
+end;
+
+{$ENDIF}
+
+end.

+ 40 - 0
bgraimagelist_icon.lrs

@@ -0,0 +1,40 @@
+LazarusResources.Add('tbgraimagelist','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#0#1'sRGB'#0#174#206#28#233#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167#147
+  +#0#0#3';IDATH'#199#181#149'Kh]U'#20#134#191'}'#206#217#247#230#220#147'Gs'
+  +#211#4#3#138'XK'#139'V""'#162#3'i'#5''''#14'j'#134#14#133#18#233'H'#208#162
+  +' '#5'['#144'8p'#172#14#147'4'#21':p'#20#218'RAp'#26#141'h'#197'4Xkc'#171#198
+  +#146#27'2h'#238#251#145#179#247'^'#14'N'#30#247#145'+'#10#201#130'='#217#172
+  +#253#255#252#255'zl%"'#28'd'#4#211#151#166'?'#2'.'#238#19#222#228#196#153#137
+  +#22',553%'#227#167#199#197#24#163#254#237'e7'#165#219#247'Zk'#174#223#184#14
+  +#160#0'&'#206'L$'#10#0#172#181#234#147'Og'#25';6'#178#31'*'#4#152#220'v%'#0
+  +'PJ1vl'#132#241#211#227#24'c'#216#7'%'#23'Z'#8#182#195'Z'#203'~)'#153#190'4-'
+  +#192'd'#11#193'A('#9#246'J'#182#214#242#249#236'5~\\F5'#25#155#164#9#226#4
+  +#145#228'8'#4'$'#193#16#4#17'x'#234#232'c'#156#127#251#13':,jV2'#255#195#175
+  +#28#25'{'#25#207#243#208#190'%'#12'-'#15#11'>'#198':'#140'u46-'#198'Z'#140'q'
+  +';w'#214':'#140'q,'#221#189#141'R'#170#147#160'YI'#224'+'#178#3#17#143'>'#210
+  +#224#245'S'#189'd'#251#179'|5'#127#159#239#23'#'#140'u'#212'7M'#2'h'#219#8
+  +#172#163'T'#242'wq'#186#249#233'y'#30'}Q'#154#23'N482'#250#10'JiN>_'#226#222
+  +#202'&'#181#186'"'#140'-'#214'm'#129#214#11'X?'#194'Z'#193':'#161#190#234#239
+  +'`'#6#221#10#229')E'#127'&M'#177#236#211'0'#171'h'#127#128#141'B'#137'(}'#136
+  +'t'#0#177#177'X''X'#19'S('#228#168#20#214#233'}'#252#20#198':<'#143#189#21'4'
+  +'+Q@o'#152'"'#183'>'#204'7'#11'w'#200#14'l'#242#251'J'#150#222'L'#10#231#4'k'
+  +#29#206#9#127#255#246#19#214#24#30#230#238#17#13'='#193#240#232'q'#254#12#252
+  +#214#26#236'e'#145#242#160'?J'#131'RT'#170#17#149#138#144#10'@GI'#190'u'#142
+  +#245#213#191#184#127'{'#129''''#159'9'#153#216'jJ'#12#15'F'#232#192'kU'#208
+  +'^d'#17#193#196'1'#181#226'z'#219#14'HZ'#210#137'P('#150'YZ'#248#26#173#211
+  +#196#181'<'#129'Nqxd'#148#205#210#26'&n'#224'm'#249#212#181#139#138#165'23W'
+  +#174#209'<'#8#206'9'#202#213#26#229'r'#141#192#139#201#4'1'#136#240'G'#238'&'
+  +#214#9'7'#175#220#192#161#24#234'O'#181'Z'#20#134#225#158#211#24#164#210#136
+  +'$'#131#23'['#139'1B'#160'{84'#216#147#228'9K'#189#146#167'\'#169#162#211#17
+  +'>U'#250#7'F'#208#129#219'%p'#206'}<wu'#238#195'v'#2#17#208'z'#151'8'#236#182
+  +'3'#14#143'`'#226#6#245'j'#145#231#158'>A'#186'''C_'#198''''#183#182#154#16
+  +#156'}'#235#236'E`rjf'#170#209#172#196#247'}'#134#178'C'#255'i'#177'mll'#144
+  +'J'#133#188#246#234'K'#12#246#133'h'#173'Y'#188'u'#11#165#18#139#4#136#157's'
+  +#204']'#157#219'y'#244#226#179'G'#249#249#206#221#174#160#138#206#255'I'#251
+  +#130's'#142#165'_'#150#182'`'#213#187'A'#211'.'#219')g'#24#134'|'#240#206#155
+  +#180#12'E3'#168#234'$'#16#17#190#253'n'#158#7#15'V'#200#231#243'('#197#23#239
+  +#157'{'#255#179#142'InW'#242#127'cyy'#153#181#220#218#151#151'g/'#159'O:{k'
+  +#237#30'Tx'#28'p'#252#3#229#200#208'l'#245#247'F'#133#0#0#0#0'IEND'#174'B`'
+  +#130
+]);

+ 2646 - 0
bgraimagemanipulation.pas

@@ -0,0 +1,2646 @@
+unit BGRAImageManipulation;
+
+{ ============================================================================
+  BGRAImageManipulation Unit
+
+  Copyright (C) 2011 - Emerson Cavalcanti <emersoncavalcanti at googlesites>
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+  ============================================================================
+  Description:
+
+  TBGRAImageManipulation is a component designed to make simple changes in an
+  image while maintaining the aspect ratio of the final image and allow it to
+  cut to reduce the unnecessary edges. The selected area is painted with a
+  different transparency level for easy viewing of what will be cut.
+
+  ============================================================================
+  History:
+
+  2011-05-03 - Emerson Cavalcanti
+             - Initial version
+
+  2011-06-01 - Emerson Cavalcanti
+             - Fixed aspect ratio when the image has a dimension smaller than
+               the size of the component.
+             - Fixed memory leak on temporary bitmaps.
+             - Fixed unecessary release of bitmap.
+             - Inserted Anchor and Align property on component.
+             - Implemented 'Keep aspect Ratio' property. Now you can select an
+               area without maintaining the aspect ratio.
+
+  2011-06-03 - Emerson Cavalcanti
+             - Improved selection when don't use aspect ratio.
+             - Improved response when resize component.
+             - Fixed memory leak on resample bitmap.
+
+  2011-06-04 - Circular
+             - Fixed divide by zero when calculate aspect ratio on
+               getImageRect.
+
+  2011-06-07 - Emerson Cavalcanti
+             - Improved function of aspect ratio including a variable to
+               provide the value directly in the component, instead of using
+               the dimensions of the component as the source of this value.
+             - Improved exhibition of anchors on selection.
+             - Improved mouse cursor.
+             - Included function to get the aspect ratio from image size.
+             - Included rotate Left and Right functions.
+
+  2013-10-13 - Massimo Magnano
+             - Add multi crop areas
+             - Add get Bitmap not resampled (original scale)
+
+  ============================================================================
+}
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, Contnrs, SysUtils, LResources, Forms, Controls, BGRABitmap, BGRABitmapTypes,
+  Graphics, Dialogs, LCLIntf, BGRAGradientScanner;
+
+{$INCLUDE DataType.inc}
+
+type
+  TBGRAImageManipulation = class;
+
+  { TCropArea }
+
+  TCropArea = class(TObject)
+  protected
+    fOwner   :TBGRAImageManipulation;
+  public
+    Area     :TRect;
+    Rotate   :double;
+    UserData :Integer;
+    Index    :Integer;
+
+    function getBitmap(OriginalRect: TRect): TBGRABitmap;
+    function getBitmapFullSize: TBGRABitmap;
+
+    constructor Create(AOwner: TBGRAImageManipulation; AArea: TRect;
+                       ARotate: double = 0;
+                       AUserData: Integer = 0);
+    destructor Destroy; override;
+
+  end;
+
+  { TCropAreaList }
+
+  TCropAreaList = class(TObjectList)
+  private
+    function getCropArea(aIndex: Integer): TCropArea;
+    procedure setCropArea(aIndex: Integer; const Value: TCropArea);
+
+  public
+    property items[aIndex: integer] : TCropArea read getCropArea write setCropArea; default;
+    function add(aCropArea: TCropArea): integer;
+  end;
+
+  TgetAllBitmapsCallback = procedure (Bitmap :TBGRABitmap; CropArea: TCropArea) of object;
+
+  { TBGRAImageManipulation }
+
+  TBGRAImageManipulation = class(TGraphicControl)
+  private
+    { Private declarations }
+
+    fAnchorSize:      byte;
+    fAnchorSelected:  TDirection;
+    fBorderSize:      byte;
+    fAspectRatio:     string;
+    fAspectX:         integer;
+    fAspectY:         integer;
+    fKeepAspectRatio: boolean;
+    fMinHeight:       integer;
+    fMinWidth:        integer;
+    fMouseCaught:     boolean;
+    fStartPoint:      TPoint;
+    fEndPoint:        TPoint;
+
+    fGCD:        integer;
+    fRatio:      TRatio;
+    fSizeLimits: TSizeLimits;
+
+    fImageBitmap, fResampledBitmap, fBackground, fVirtualScreen: TBGRABitmap;
+
+    fDeltaX, fDeltaY: integer;
+
+    function getAnchorSize: byte;
+    procedure setAnchorSize(const Value: byte);
+    function getEmpty: boolean;
+    procedure setBitmap(const Value: TBGRABitmap);
+    procedure setBorderSize(const Value: byte);
+    procedure setAspectRatio(const Value: string);
+    procedure setKeepAspectRatio(const Value: boolean);
+    procedure setMinHeight(const Value: integer);
+    procedure setMinWidth(const Value: integer);
+  protected
+    { Protected declarations }
+    rCropAreas :TCropAreaList;
+    rNewCropArea,
+    rSelectedCropArea :TCropArea;
+
+    function ApplyDimRestriction(Coords: TCoord; Direction: TDirection;
+      Bounds: TRect): TCoord;
+    function ApplyRatioToAxes(Coords: TCoord; Direction: TDirection;
+      Bounds: TRect;  ACropArea :TCropArea = Nil): TCoord;
+    procedure ApplyRatioToArea(ACropArea :TCropArea);
+    procedure CalcMaxSelection(ACropArea :TCropArea);
+    procedure findSizeLimits;
+    function getDirection(const Point1, Point2: TPoint): TDirection;
+    function getGCD(Nr1, Nr2: longint): longint;
+    function getLCM(Nr1, Nr2: longint): longint;
+    function getImageRect(Picture: TBGRABitmap): TRect;
+    function getWorkRect: TRect;
+    function isOverAnchor(APoint :TPoint; var AnchorSelected :TDirection; var ACursor :TCursor) :TCropArea;
+
+    procedure Paint; override;
+    procedure RepaintBackground;
+    procedure Resize; override;
+    procedure Render;
+
+    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
+      X, Y: integer); override;
+    procedure MouseMove(Shift: TShiftState; X, Y: integer); override;
+    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: integer); override;
+  public
+    { Public declarations }
+
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+    procedure Invalidate; override;
+    function getAspectRatioFromImage(const Value: TBGRABitmap): string;
+    function getBitmap(ACropArea :TCropArea = Nil) : TBGRABitmap;
+    function getBitmapFullSize(ACropArea :TCropArea = Nil) : TBGRABitmap;
+
+    procedure rotateLeft;
+    procedure rotateRight;
+
+    //Crop Areas Manipulation functions
+    function addCropArea(AArea : TRect; ARotate :double = 0; AUserData: Integer = 0) :TCropArea;
+    procedure delCropArea(ACropArea :TCropArea);
+    procedure clearCropAreas;
+    procedure getAllBitmaps(ACallBack :TgetAllBitmapsCallback);
+    procedure getAllBitmapsFullSize(ACallBack :TgetAllBitmapsCallback);
+
+    property SelectedCropArea :TCropArea read rSelectedCropArea;
+  published
+    { Published declarations }
+
+    property Align;
+    property Anchors;
+
+    property AnchorSize: byte Read getAnchorSize Write setAnchorSize default 5;
+    property Bitmap: TBGRABitmap Read fImageBitmap Write setBitmap;
+    property BorderSize: byte Read fBorderSize Write setBorderSize default 2;
+    property AspectRatio: string Read fAspectRatio Write setAspectRatio;
+    property KeepAspectRatio: boolean Read fKeepAspectRatio
+      Write setKeepAspectRatio default True;
+    property MinHeight: integer Read fMinHeight Write setMinHeight;
+    property MinWidth: integer Read fMinWidth Write setMinWidth;
+    property Empty: boolean Read getEmpty;
+  end;
+
+procedure Register;
+
+implementation
+
+uses Math, ExtCtrls;
+
+resourcestring
+  SAnchorSizeIsTooLarge =
+    'Anchor size is too large. %d is not within the valid range of %d..%d';
+  SAnchorSizeIsTooSmall =
+    'Anchor size is too small. %d is not within the valid range of %d..%d';
+  SAnchorSizeIsNotOdd = 'Anchor size is invalid. %d is not an odd number.';
+
+  SBorderSizeIsTooLarge =
+    'Border size is too large. %d is not within the valid range of %d..%d';
+  SBorderSizeIsTooSmall =
+    'Border size is too small. %d is not within the valid range of %d..%d';
+
+  SAspectRatioIsNotValid = 'Aspect ratio value is invalid. %s contain invalid number.';
+
+{ TCropArea }
+
+
+//Get Resampled Bitmap (Scaled to current scale)
+function TCropArea.getBitmap(OriginalRect :TRect): TBGRABitmap;
+var
+  ResampledBitmap: TBGRACustomBitmap;
+  CropBitmap:  TBGRABitmap;
+  FinalBitmap: TBGRABitmap;
+  xRatio, yRatio: double;
+  SourceRect, DestRect: TRect;
+
+begin
+  if not (fOwner.fImageBitmap.Empty) then
+  begin
+    try
+      // Calculate scale from original size and destination size
+      xRatio := fOwner.fImageBitmap.Width / (OriginalRect.Right - OriginalRect.Left);
+      yRatio := fOwner.fImageBitmap.Height / (OriginalRect.Bottom - OriginalRect.Top);
+
+      // Calculate source rectangle in original scale
+      with SourceRect do
+      begin
+        Left := Round(Area.Left * xRatio);
+        Right := Round(Area.Right * xRatio);
+        Top := Round(Area.Top * yRatio);
+        Bottom := Round(Area.Bottom * yRatio);
+      end;
+
+      // Calculate destination rectangle in original scale
+      with DestRect do
+      begin
+        Left := 0;
+        Right := SourceRect.Right - SourceRect.Left;
+        Top := 0;
+        Bottom := SourceRect.Bottom - SourceRect.Top;
+      end;
+
+      // Create a new bitmap for cropped region in original scale
+      CropBitmap := TBGRABitmap.Create(SourceRect.Right - SourceRect.Left,
+                                       SourceRect.Bottom - SourceRect.Top);
+
+      // Get the cropped image on selected region in original scale
+      CropBitmap.Canvas.CopyRect(DestRect, fOwner.fImageBitmap.Canvas, SourceRect);
+
+      // Create bitmap to put image on final scale
+      FinalBitmap := TBGRABitmap.Create(Area.Right - Area.Left, Area.Bottom - Area.Top);
+
+      // Resize the cropped image to final scale
+      try
+        ResampledBitmap := CropBitmap.Resample(Area.Right -
+          Area.Left, Area.Bottom - Area.Top, rmFineResample);
+        FinalBitmap.BlendImage(0, 0,
+          ResampledBitmap,
+          boLinearBlend);
+      finally
+        ResampledBitmap.Free
+      end;
+    finally
+      CropBitmap.Free;
+      Result := FinalBitmap;
+    end;
+  end
+  else Result := fOwner.fImageBitmap;
+end;
+
+//Get Original size Bitmap (not scaled to current scale)
+function TCropArea.getBitmapFullSize: TBGRABitmap;
+var
+  CropBitmap:  TBGRABitmap;
+  xRatio, yRatio: double;
+  SourceRect, DestRect: TRect;
+
+begin
+  if not (fOwner.fImageBitmap.Empty) then
+  begin
+    try
+      // Calculate scale from original size and destination size
+      xRatio := fOwner.fImageBitmap.Width / fOwner.fResampledBitmap.Width;
+      yRatio := fOwner.fImageBitmap.Height / fOwner.fResampledBitmap.Height;
+
+      // Calculate source rectangle in original scale
+      with SourceRect do
+      begin
+        Left := Round(Area.Left * xRatio);
+        Right := Round(Area.Right * xRatio);
+        Top := Round(Area.Top * yRatio);
+        Bottom := Round(Area.Bottom * yRatio);
+      end;
+
+      // Calculate destination rectangle in original scale
+      with DestRect do
+      begin
+        Left := 0;
+        Right := SourceRect.Right - SourceRect.Left;
+        Top := 0;
+        Bottom := SourceRect.Bottom - SourceRect.Top;
+      end;
+
+      // Create a new bitmap for cropped region in original scale
+      CropBitmap := TBGRABitmap.Create(DestRect.Right, DestRect.Bottom);
+
+      // Get the cropped image on selected region in original scale
+      CropBitmap.Canvas.CopyRect(DestRect, fOwner.fImageBitmap.Canvas, SourceRect);
+
+    finally
+      Result := CropBitmap;
+    end;
+  end
+  else Result := fOwner.fImageBitmap;
+end;
+
+constructor TCropArea.Create(AOwner: TBGRAImageManipulation; AArea :TRect;
+                             ARotate :double = 0;
+                             AUserData : Integer = 0);
+begin
+  inherited Create;
+  if (AOwner = Nil)
+  then raise Exception.Create('Owner TBGRAImageManipulation is Nil');
+  fOwner :=AOwner;
+  Area := AArea;
+  Rotate := ARotate;
+  UserData := AUserData;
+end;
+
+destructor TCropArea.Destroy;
+begin
+  inherited Destroy;
+end;
+
+{ TCropAreaList }
+
+function TCropAreaList.getCropArea(aIndex: Integer): TCropArea;
+begin
+     Result := inherited Items[aIndex] as TCropArea;
+end;
+
+procedure TCropAreaList.setCropArea(aIndex: Integer; const Value: TCropArea);
+begin
+     inherited Items[aIndex] := Value;
+end;
+
+function TCropAreaList.add(aCropArea: TCropArea): integer;
+var
+   newIndex :Integer;
+begin
+     newIndex := inherited Add(aCropArea);
+     aCropArea.Index := newIndex;
+     Result := newIndex;
+end;
+
+
+{ TBGRAImageManipulation }
+
+ { ============================================================================ }
+ { =====[ Auxiliary Functions ]================================================ }
+ { ============================================================================ }
+
+{ Applies the given size constraint on the coordinates along both axes }
+function TBGRAImageManipulation.ApplyDimRestriction(Coords: TCoord;
+  Direction: TDirection; Bounds: TRect): TCoord;
+var
+  newCoords: TCoord;
+  calcWidth, calcHeight: integer;
+  recalculateHeight: boolean;
+begin
+  // Gets coordinates
+  newCoords := Coords;
+  recalculateHeight := False;
+
+  // Calculated width
+  calcWidth  := abs(newCoords.x2 - newCoords.x1);
+  calcHeight := abs(newCoords.y2 - newCoords.y1);
+
+  // Checks if the width is smaller than the minimum value
+  if (Abs(calcWidth) < MinWidth) and (MinWidth < fImageBitmap.Width) then
+  begin
+    // Resizes the width based on the minimum value
+    calcWidth := MinWidth;
+
+    if (EAST in Direction) then
+    begin
+      // If the motion is in a positive direction, make sure we're not going out
+      // of bounds
+      if ((newCoords.x1 + calcWidth) > Bounds.Right) then
+      begin
+        // Moves the horizontal coordinates
+        newCoords.x1 := Bounds.Right - calcWidth;
+        newCoords.x2 := Bounds.Right;
+      end
+      else
+      begin
+        // Moves the last horizontal coordinate
+        newCoords.x2 := newCoords.x1 + calcWidth;
+      end;
+    end
+    else
+    begin
+      // If the motion is in a negative direction, make sure we're not going out
+      // of bounds
+      if ((newCoords.x1 - calcWidth) < Bounds.Left) then
+      begin
+        // Moves the horizontal coordinates
+        newCoords.x1 := Bounds.Left + calcWidth;
+        newCoords.x2 := Bounds.Left;
+      end
+      else
+      begin
+        // Moves the last horizontal coordinate
+        newCoords.x2 := newCoords.x1 - calcWidth;
+      end;
+    end;
+
+    if (fKeepAspectRatio) then
+    begin
+      // Resizes the height based on the minimum value
+      recalculateHeight := True;
+    end;
+  end;
+
+  // Checks if the height is smaller than the minimum value
+  if (((Abs(calcHeight) < MinHeight) and (MinHeight < fImageBitmap.Height)) or
+    recalculateHeight) then
+  begin
+    // Resizes the height based on the minimum value
+    calcHeight := MinHeight;
+
+    if (SOUTH in Direction) then
+    begin
+      // If the motion is in a positive direction, make sure we're not going out
+      // of bounds
+      if ((newCoords.y1 + calcHeight) > Bounds.Bottom) then
+      begin
+        // Moves the vertical coordinates
+        newCoords.y1 := Bounds.Bottom - calcHeight;
+        newCoords.y2 := Bounds.Bottom;
+      end
+      else
+      begin
+        // Moves the last horizontal coordinate
+        newCoords.y2 := newCoords.y1 + calcHeight;
+      end;
+    end
+    else
+    begin
+      // If the motion is in a negative direction, make sure we're not going out
+      // of bounds
+      if ((newCoords.y1 - calcHeight) < Bounds.Top) then
+      begin
+        // Moves the vertical coordinates
+        newCoords.y1 := Bounds.Top + calcHeight;
+        newCoords.y2 := Bounds.Top;
+      end
+      else
+      begin
+        // Moves the last horizontal coordinate
+        newCoords.y2 := newCoords.y1 - calcHeight;
+      end;
+    end;
+  end;
+
+  Result := newCoords;
+end;
+
+ { Applies the provided ratio to the coordinates based on direction and bounds  }
+ { on both axes.                                                                }
+function TBGRAImageManipulation.ApplyRatioToAxes(Coords: TCoord;
+  Direction: TDirection; Bounds: TRect; ACropArea :TCropArea = Nil): TCoord;
+var
+  newCoords: TCoord;
+  calcWidth, calcHeight: integer;
+  RecalculatesOtherAxis: boolean;
+begin
+  // Gets coordinates
+  newCoords := Coords;
+
+  // Check if movement is only vertical
+  if ((fAnchorSelected = [NORTH]) or (fAnchorSelected = [SOUTH])) then
+  begin
+    // Vertical movement: keep current width
+    if (fKeepAspectRatio) then
+    begin
+      // Calculate height
+      calcHeight := newCoords.y2 - newCoords.y1;
+
+      // Make sure we're not going out of bounds
+      if (SOUTH in Direction) then
+      begin
+        if ((newCoords.y1 + calcHeight) > Bounds.Bottom) then
+        begin
+          calcHeight := Bounds.Bottom - newCoords.y1; // Limite height dimension
+          newCoords.y2 := Bounds.Bottom;
+        end;
+      end
+      else
+      begin
+        if ((newCoords.y1 + calcHeight) < Bounds.Top) then
+        begin
+          calcHeight := -(newCoords.y1 - Bounds.Top); // Limite height dimension
+          newCoords.y2 := Bounds.Top;
+        end;
+      end;
+
+      // Calculate the new width based on the proportion of height
+      calcWidth := Trunc(abs(calcHeight) * (fRatio.Horizontal / fRatio.Vertical));
+
+      // Make sure we're not going out of bounds
+      if (fAnchorSelected = [NORTH]) then
+      begin
+        if ((newCoords.x1 - calcWidth) < Bounds.Left) then
+        begin
+          calcWidth := newCoords.x1 - Bounds.Left; // Limite width dimension
+          newCoords.x2 := Bounds.Left;
+          RecalculatesOtherAxis := True;
+        end;
+      end
+      else
+      begin
+        if ((newCoords.x1 + calcWidth) > Bounds.Right) then
+        begin
+          calcWidth := Bounds.Right - newCoords.x1; // Limite width dimension
+          newCoords.x2 := Bounds.Right;
+          RecalculatesOtherAxis := True;
+        end;
+      end;
+
+      // Apply calculated dimensions of width on height
+      if (RecalculatesOtherAxis) then
+      begin
+        if (calcHeight > 0) then
+          calcHeight := Trunc(calcWidth * (fRatio.Vertical / fRatio.Horizontal))
+        else
+          calcHeight := -Trunc(calcWidth * (fRatio.Vertical / fRatio.Horizontal));
+
+        newCoords.y2 := newCoords.y1 + calcHeight;
+      end;
+    end
+    else
+    begin
+      // Calculate height
+      calcHeight := newCoords.y2 - newCoords.y1;
+
+      // Make sure we're not going out of bounds
+      if (SOUTH in Direction) then
+      begin
+        if ((newCoords.y1 + calcHeight) > Bounds.Bottom) then
+        begin
+          calcHeight := Bounds.Bottom - newCoords.y1; // Limite height dimension
+          newCoords.y2 := Bounds.Bottom;
+        end;
+      end
+      else
+      begin
+        if ((newCoords.y1 + calcHeight) < Bounds.Top) then
+        begin
+          calcHeight := -(newCoords.y1 - Bounds.Top); // Limite height dimension
+          newCoords.y2 := Bounds.Top;
+        end;
+      end;
+
+      // Calculate width
+      if (ACropArea <> Nil)
+      then calcWidth := abs(ACropArea.Area.Right - ACropArea.Area.Left)
+      else calcWidth := 16; //Check
+    end;
+
+    if (fAnchorSelected = [NORTH]) then
+      newCoords.x2 := newCoords.x1 - calcWidth
+    else
+      newCoords.x2 := newCoords.x1 + calcWidth;
+  end
+  else
+  // Check if movement is only horizontal
+  if ((fAnchorSelected = [EAST]) or (fAnchorSelected = [WEST])) then
+  begin
+    // Horizontal movement: keep current height
+    if (fKeepAspectRatio) then
+    begin
+      // Calculate width
+      calcWidth := newCoords.x2 - newCoords.x1;
+
+      // Make sure we're not going out of bounds
+      if (EAST in Direction) then
+      begin
+        if ((newCoords.x1 + calcWidth) > Bounds.Right) then
+        begin
+          calcWidth := Bounds.Right - newCoords.x1; // Limite width dimension
+          newCoords.x2 := Bounds.Right;
+        end;
+      end;
+
+      if (WEST in Direction) then
+      begin
+        if ((newCoords.x1 + calcWidth) < Bounds.Left) then
+        begin
+          calcWidth := -(newCoords.x1 - Bounds.Left); // Limite width dimension
+          newCoords.x2 := Bounds.Left;
+        end;
+      end;
+
+      // Calculate the new height based on the proportion of width
+      calcHeight := Trunc(abs(calcWidth) * (fRatio.Vertical / fRatio.Horizontal));
+
+      // Make sure we're not going out of bounds
+      if (fAnchorSelected = [WEST]) then
+      begin
+        if ((newCoords.y1 - calcHeight) < Bounds.Top) then
+        begin
+          calcHeight := newCoords.y1 - Bounds.Top; // Limite height dimension
+          newCoords.y2 := Bounds.Top;
+          RecalculatesOtherAxis := True;
+        end;
+      end
+      else
+      begin
+        if ((newCoords.y1 + calcHeight) > Bounds.Bottom) then
+        begin
+          calcHeight := Bounds.Bottom - newCoords.y1; // Limite height dimension
+          newCoords.y2 := Bounds.Bottom;
+          RecalculatesOtherAxis := True;
+        end;
+      end;
+
+      // Apply calculated dimensions of height on width
+      if (RecalculatesOtherAxis) then
+      begin
+        if (calcWidth > 0) then
+          calcWidth := Trunc(calcHeight * (fRatio.Horizontal / fRatio.Vertical))
+        else
+          calcWidth := -Trunc(calcHeight * (fRatio.Horizontal / fRatio.Vertical));
+
+        newCoords.x2 := newCoords.x1 + calcWidth;
+      end;
+    end
+    else
+    begin
+      // Calculate width
+      calcWidth := newCoords.x2 - newCoords.x1;
+
+      // Make sure we're not going out of bounds
+      if (EAST in Direction) then
+      begin
+        if ((newCoords.x1 + calcWidth) > Bounds.Right) then
+        begin
+          calcWidth := Bounds.Right - newCoords.x1; // Limite width dimension
+          newCoords.x2 := Bounds.Right;
+        end;
+      end;
+
+      if (WEST in Direction) then
+      begin
+        if ((newCoords.x1 + calcWidth) < Bounds.Left) then
+        begin
+          calcWidth := -(newCoords.x1 - Bounds.Left); // Limite width dimension
+          newCoords.x2 := Bounds.Left;
+        end;
+      end;
+
+      // Calculate height
+      if (ACropArea <> Nil)
+      then calcHeight := abs(ACropArea.Area.Bottom - ACropArea.Area.Top)
+      else calcHeight := 16; //Check
+    end;
+
+    if (fAnchorSelected = [WEST]) then
+      newCoords.y2 := newCoords.y1 - calcHeight
+    else
+      newCoords.y2 := newCoords.y1 + calcHeight;
+  end
+  else
+  begin
+    // Diagonal movement
+    if (fKeepAspectRatio) then
+    begin
+      // Calculate width
+      calcWidth := newCoords.x2 - newCoords.x1;
+
+      // Make sure we're not going out of bounds
+      if (EAST in Direction) then
+      begin
+        if ((newCoords.x1 + calcWidth) > Bounds.Right) then
+        begin
+          calcWidth := Bounds.Right - newCoords.x1; // Limite width dimension
+          newCoords.x2 := Bounds.Right;
+        end;
+      end;
+
+      if (WEST in Direction) then
+      begin
+        if ((newCoords.x1 + calcWidth) < Bounds.Left) then
+        begin
+          calcWidth := -(newCoords.x1 - Bounds.Left); // Limite width dimension
+          newCoords.x2 := Bounds.Left;
+        end;
+      end;
+
+      // Calculate the new height based on the proportion of width
+      if ((newCoords.y2 - newCoords.y1) > 0) then
+        calcHeight := Trunc(abs(calcWidth) * (fRatio.Vertical / fRatio.Horizontal))
+      else
+        calcHeight := -Trunc(abs(calcWidth) * (fRatio.Vertical / fRatio.Horizontal));
+
+      // Make sure we're not going out of bounds
+      if (calcHeight > 0) then
+      begin
+        if (SOUTH in Direction) then
+        begin
+          if ((newCoords.y1 + calcHeight) > Bounds.Bottom) then
+          begin
+            calcHeight := Bounds.Bottom - newCoords.y1; // Limite height dimension
+            newCoords.y2 := Bounds.Bottom;
+            RecalculatesOtherAxis := True;
+          end;
+        end
+        else
+        begin
+          if ((newCoords.y1 - calcHeight) < Bounds.Top) then
+          begin
+            calcHeight := newCoords.y1 - Bounds.Top; // Limite height dimension
+            newCoords.y2 := Bounds.Top;
+            RecalculatesOtherAxis := True;
+          end;
+        end;
+      end
+      else
+      begin
+        if (SOUTH in Direction) then
+        begin
+          if ((newCoords.y1 - calcHeight) > Bounds.Bottom) then
+          begin
+            calcHeight := newCoords.y1 - Bounds.Bottom; // Limite height dimension
+            newCoords.y2 := Bounds.Bottom;
+            RecalculatesOtherAxis := True;
+          end;
+        end
+        else
+        begin
+          if ((newCoords.y1 + calcHeight) < Bounds.Top) then
+          begin
+            calcHeight := Bounds.Top - newCoords.y1; // Limite height dimension
+            newCoords.y2 := Bounds.Top;
+            RecalculatesOtherAxis := True;
+          end;
+        end;
+      end;
+
+      // Apply calculated dimensions of height on width
+      if (RecalculatesOtherAxis) then
+      begin
+        if (calcWidth > 0) then
+          calcWidth := Trunc(abs(calcHeight) * (fRatio.Horizontal / fRatio.Vertical))
+        else
+          calcWidth := -Trunc(abs(calcHeight) * (fRatio.Horizontal / fRatio.Vertical));
+
+        newCoords.x2 := newCoords.x1 + calcWidth;
+      end;
+    end
+    else
+    begin
+      // Calculate width
+      calcWidth := newCoords.x2 - newCoords.x1;
+
+      // Make sure we're not going out of bounds
+      if (EAST in Direction) then
+      begin
+        if ((newCoords.x1 + calcWidth) > Bounds.Right) then
+        begin
+          calcWidth := Bounds.Right - newCoords.x1; // Limite width dimension
+          newCoords.x2 := Bounds.Right;
+        end;
+      end;
+
+      if (WEST in Direction) then
+      begin
+        if ((newCoords.x1 + calcWidth) < Bounds.Left) then
+        begin
+          calcWidth := -(newCoords.x1 - Bounds.Left); // Limite width dimension
+          newCoords.x2 := Bounds.Left;
+        end;
+      end;
+
+      // Calculate height
+      calcHeight := newCoords.y2 - newCoords.y1;
+
+      // Make sure we're not going out of bounds
+      if (SOUTH in Direction) then
+      begin
+        if ((newCoords.y1 + calcHeight) > Bounds.Bottom) then
+        begin
+          calcHeight := Bounds.Bottom - newCoords.y1; // Limite height dimension
+          newCoords.y2 := Bounds.Bottom;
+        end;
+      end;
+
+      if (NORTH in Direction) then
+      begin
+        if ((newCoords.y1 + calcHeight) < Bounds.Top) then
+        begin
+          calcHeight := -(newCoords.y1 - Bounds.Top); // Limite height dimension
+          newCoords.y2 := Bounds.Top;
+        end;
+      end;
+    end;
+
+    newCoords.x2 := newCoords.x1 + calcWidth;
+    newCoords.y2 := newCoords.y1 + calcHeight;
+  end;
+
+  Result := newCoords;
+end;
+
+procedure TBGRAImageManipulation.ApplyRatioToArea(ACropArea :TCropArea);
+var
+   calcWidth, calcHeight :Integer;
+   CropAreaRect, Bounds  :TRect;
+
+begin
+  if (ACropArea <> Nil) then
+  begin
+       CropAreaRect :=ACropArea.Area;
+       Bounds := getImageRect(fResampledBitmap);
+
+      // Calculate width
+      calcWidth :=CropAreaRect.Right-CropAreaRect.Left;
+
+      // Make sure we're not going out of bounds with Widht
+      if ((CropAreaRect.Left+calcWidth)>Bounds.Right) then
+      begin
+          calcWidth :=Bounds.Right-CropAreaRect.Left; // Limite width dimension
+          CropAreaRect.Right :=Bounds.Right;
+      end;
+
+      // Calculate the new height based on the proportion of width
+      calcHeight := Trunc(abs(calcWidth)*(fRatio.Vertical/fRatio.Horizontal));
+
+      // Make sure we're not going out of bounds with Height
+      if ((CropAreaRect.Top+calcHeight) > Bounds.Bottom) then
+      begin
+           calcHeight :=Bounds.Bottom-CropAreaRect.Top;
+           calcWidth :=Trunc(abs(calcHeight)*(fRatio.Horizontal/fRatio.Vertical));
+      end;
+
+      CropAreaRect.Right :=CropAreaRect.Left+calcWidth;
+      CropAreaRect.Bottom :=CropAreaRect.Top+calcHeight;
+
+      ACropArea.Area :=CropAreaRect;
+  end;
+end;
+
+{ Calculate the maximun selection allowed                                      }
+procedure TBGRAImageManipulation.CalcMaxSelection(ACropArea :TCropArea);
+var
+  ImageRect: TRect;
+  newCoords: TCoord;
+  Direction: TDirection;
+  Bounds: TRect;
+begin
+  if (ACropArea <> Nil) then
+  begin
+       ImageRect := getImageRect(fImageBitmap);
+
+       // Initiates coord
+       with newCoords do
+       begin
+            x1 := 0;
+            y1 := 0;
+
+            x2 := ImageRect.Right - ImageRect.Left;
+            y2 := ImageRect.Bottom - ImageRect.Top;
+       end;
+
+       // Determine direction
+       Direction := getDirection(Point(newCoords.x1, newCoords.y1),
+                                 Point(newCoords.x2, newCoords.y2));
+
+       // Determines limite values
+       with newCoords do
+       begin
+            x1 := 0;
+            y1 := 0;
+            x2 := ImageRect.Right - ImageRect.Left;
+            y2 := ImageRect.Bottom - ImageRect.Top;
+       end;
+       Bounds := getImageRect(fResampledBitmap);
+
+       // Apply the ratio
+       newCoords := ApplyRatioToAxes(newCoords, Direction, Bounds);
+
+       // Determines minimum value on both axes
+       newCoords := ApplyDimRestriction(newCoords, Direction, Bounds);
+
+       ACropArea.Area := Rect(newCoords.x1, newCoords.y1, newCoords.x2, newCoords.y2);
+  end;
+end;
+
+{ Calculate the Aspect Ratio for size limits}
+procedure TBGRAImageManipulation.findSizeLimits;
+var
+  WorkRect: TRect;
+begin
+  // Find the working area of the component
+  WorkRect := getWorkRect;
+
+  with fSizeLimits do
+  begin
+    minWidth  := fAspectX;
+    maxWidth  := WorkRect.Right - WorkRect.Left;
+    minHeight := fAspectY;
+    maxHeight := WorkRect.Bottom - WorkRect.Top;
+  end;
+end;
+
+{ Get the direction of movement }
+function TBGRAImageManipulation.getDirection(const Point1, Point2: TPoint): TDirection;
+begin
+  Result := [];
+
+  if (Point1.X > Point2.X) then
+    Result := Result + [WEST];
+
+  if (Point1.X < Point2.X) then
+    Result := Result + [EAST];
+
+  if (Point1.Y > Point2.Y) then
+    Result := Result + [NORTH];
+
+  if (Point1.Y < Point2.Y) then
+    Result := Result + [SOUTH];
+end;
+
+{ Calculate the Greatest Common Divisor (GCD) using the algorithm of Euclides }
+function TBGRAImageManipulation.getGCD(Nr1, Nr2: longint): longint;
+begin
+  if Nr2 = 0 then
+    Result := Nr1
+  else
+    Result := getGCD(Nr2, Nr1 mod Nr2);
+end;
+
+{ Calculate the Lowest Common Multiple (LCM) using the algorithm of Euclides }
+function TBGRAImageManipulation.getLCM(Nr1, Nr2: longint): longint;
+begin
+  Result := (Nr1 * Nr2) div getGCD(Nr1, Nr2);
+end;
+
+{ Get image rectangle }
+function TBGRAImageManipulation.getImageRect(Picture: TBGRABitmap): TRect;
+var
+  calcWidth, calcHeight, finalWidth, finalHeight, imageWidth, imageHeight: integer;
+  WorkRect: TRect;
+begin
+  // Determine picture size
+  imageWidth  := Picture.Width;
+  imageHeight := Picture.Height;
+
+  // Determine Work rectangle to final size
+  WorkRect := getWorkRect;
+  finalWidth := WorkRect.Right - WorkRect.Left;
+  finalHeight := WorkRect.Bottom - WorkRect.Top;
+
+  // Recalculate image dimensions
+  calcHeight := (finalWidth * imageHeight) div imageWidth;
+  calcWidth  := finalWidth;
+
+  if (calcHeight > finalHeight) then
+  begin
+    calcHeight := finalHeight;
+    calcWidth  := (calcHeight * imageWidth) div imageHeight;
+  end;
+
+  with Result do
+  begin
+    Left := 0;
+    Top  := 0;
+    Right := calcWidth;
+    Bottom := calcHeight;
+  end;
+end;
+
+{ Get work area rectangle }
+function TBGRAImageManipulation.getWorkRect: TRect;
+var
+  // Number of units to remove from left, right, top, and bottom to get the
+  // work rectangle
+  Delta: integer;
+begin
+  // Start with the border size
+  Delta := fBorderSize;
+
+  // Get the coordinates of the control
+  if (fVirtualScreen <> nil) then
+    Result := Rect(0, 0, fVirtualScreen.Width, fVirtualScreen.Height)
+  else
+    Result := GetClientRect;
+
+  // Remove the non-work areas from our work rectangle
+  InflateRect(Result, -Delta, -Delta);
+end;
+
+{ Check if mouse is over any anchor }
+function TBGRAImageManipulation.isOverAnchor(APoint :TPoint; var AnchorSelected :TDirection; var ACursor :TCursor):TCropArea;
+var
+   rCropArea       :TCropArea;
+   rCropRect,
+   rCropRectI      :TRect;
+   i               :Integer;
+
+   function _isOverAnchor(APoint: TPoint; Corner: TPoint): boolean;
+   begin
+        Result := ((APoint.X >= (Corner.X - AnchorSize)) and
+               (APoint.X <= (Corner.X + AnchorSize)) and
+               (APoint.Y >= (Corner.Y - AnchorSize)) and
+               (APoint.Y <= (Corner.Y + AnchorSize)));
+   end;
+
+begin
+     AnchorSelected :=[];
+     ACursor :=crDefault;
+     Result :=Nil;
+     for i:=0 to rCropAreas.Count-1 do
+     begin
+          rCropArea :=rCropAreas[i];
+          rCropRectI :=rCropArea.Area;
+          InflateRect(rCropRectI, AnchorSize, AnchorSize);
+          if (PtInRect(rCropRectI, APoint)) then
+          begin
+               rCropRect :=rCropArea.Area;
+               // Verifies that is positioned on an anchor
+               // NW
+               if (_isOverAnchor(APoint, rCropRect.TopLeft)) then
+               begin
+                    AnchorSelected := [NORTH, WEST];
+                    ACursor := crSizeNW;
+                    Result :=rCropArea; break;
+               end;
+
+               // W
+               if (_isOverAnchor(APoint, Point(rCropRect.Left, rCropRect.Top +
+                  (rCropRect.Bottom - rCropRect.Top) div 2))) then
+               begin
+                    AnchorSelected := [WEST];
+                    ACursor := crSizeWE;
+                    Result :=rCropArea; break;
+               end;
+
+               // SW
+               if (_isOverAnchor(APoint, Point(rCropRect.Left, rCropRect.Bottom))) then
+               begin
+                    AnchorSelected := [SOUTH, WEST];
+                    ACursor := crSizeSW;
+                    Result :=rCropArea; break;
+               end;
+
+               // S
+               if (_isOverAnchor(APoint, Point(rCropRect.Left +
+               ((rCropRect.Right - rCropRect.Left) div 2), rCropRect.Bottom))) then
+               begin
+                    AnchorSelected := [SOUTH];
+                    ACursor := crSizeNS;
+                    Result :=rCropArea; break;
+               end;
+
+               // SE
+               if (_isOverAnchor(APoint, rCropRect.BottomRight)) then
+               begin
+                    AnchorSelected := [SOUTH, EAST];
+                    ACursor := crSizeSE;
+                    Result :=rCropArea; break;
+               end;
+
+               // E
+               if (_isOverAnchor(APoint, Point(rCropRect.Right, rCropRect.Top +
+                  ((rCropRect.Bottom - rCropRect.Top) div 2)))) then
+               begin
+                    AnchorSelected := [EAST];
+                    ACursor := crSizeWE;
+                    Result :=rCropArea; break;
+               end;
+
+               // NE
+               if (_isOverAnchor(APoint, Point(rCropRect.Right, rCropRect.Top))) then
+               begin
+                    AnchorSelected := [NORTH, EAST];
+                    ACursor := crSizeNE;
+                    Result :=rCropArea; break;
+               end;
+
+               // N
+               if (_isOverAnchor(APoint, Point(rCropRect.Left +
+                  ((rCropRect.Right - rCropRect.Left) div 2), rCropRect.Top))) then
+               begin
+                    AnchorSelected := [NORTH];
+                    ACursor := crSizeNS;
+                    Result :=rCropArea; break;
+               end;
+
+               // Verifies that is positioned on a cropping area
+               if (AnchorSelected = []) then
+               begin
+                    if ((APoint.X >= rCropRect.Left) and (APoint.X <= rCropRect.Right) and
+                    (APoint.Y >= rCropRect.Top) and (APoint.Y <= rCropRect.Bottom)) then
+                    begin
+                         AnchorSelected := [NORTH, SOUTH, EAST, WEST];
+                         ACursor := crSizeAll;
+                         Result :=rCropArea; break;
+                    end;
+               end;
+          end;
+     end;
+end;
+
+ { ============================================================================ }
+ { =====[ Component Definition ]=============================================== }
+ { ============================================================================ }
+
+constructor TBGRAImageManipulation.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+
+  // Set default component values
+  inherited Width := 320;
+  inherited Height := 240;
+
+  // Default property values
+  fAnchorSize := 5;
+  fAnchorSelected := [];
+  fBorderSize := 2;
+  fAspectRatio := '3:4';
+  fAspectX := 3;
+  fAspectY := 4;
+  fKeepAspectRatio := True;
+
+  // Default control values
+  ControlStyle := ControlStyle + [csReplicatable];
+  Cursor := crDefault;
+
+  // Calculate the ratio
+  fGCD := getGCD(fAspectX, fAspectY);
+
+
+  // Determine the ratio of scale per axle
+  with fRatio do
+  begin
+    Horizontal := fAspectX div fGCD;
+    Vertical := fAspectY div fGCD;
+  end;
+
+  // Find size limits
+  findSizeLimits;
+
+  // Create the Image Bitmap
+  fImageBitmap := TBGRABitmap.Create;
+
+  // Create the Resampled Bitmap
+  fResampledBitmap := TBGRABitmap.Create;
+
+  // Create the Background
+  fBackground := TBGRABitmap.Create(Width, Height);
+
+  // Create render surface
+  fVirtualScreen := TBGRABitmap.Create(Width, Height);
+
+  // Force Render Struct
+  RepaintBackground;
+  Render;
+
+  // Initialize crop area
+  fDeltaX := 0;
+  fDeltaY := 0;
+  rCropAreas :=TCropAreaList.Create(True);
+  rNewCropArea :=Nil;
+  rSelectedCropArea :=Nil;
+end;
+
+destructor TBGRAImageManipulation.Destroy;
+begin
+  fImageBitmap.Free;
+  fResampledBitmap.Free;
+  fBackground.Free;
+  fVirtualScreen.Free;
+  rCropAreas.Free;
+
+  inherited Destroy;
+end;
+
+procedure TBGRAImageManipulation.Invalidate;
+begin
+  inherited Invalidate;
+end;
+
+procedure TBGRAImageManipulation.Paint;
+begin
+  inherited Paint;
+  fVirtualScreen.Draw(Canvas, 0, 0, True);
+end;
+
+{ This function repaint the background only when necessary to avoid unnecessary
+  redraws. Contain a function called DrawCheckers that draws the Background like
+  checkers game. Also included was a function that draws 3D effects changed to
+  allow color changes. }
+procedure TBGRAImageManipulation.RepaintBackground;
+
+  procedure DrawCheckers(bmp: TBGRABitmap; ARect: TRect);
+  const
+    tx = 8;
+    ty = 8;
+  var
+    xb, yb, xdest, ydest, nbx, nby: integer;
+    oddColor, evenColor: TBGRAPixel;
+  begin
+    oddColor := BGRA(220, 220, 220);
+    evenColor := BGRA(255, 255, 255);
+    bmp.ClipRect := ARect;
+    xdest := ARect.Left;
+    nbx := ((ARect.Right - ARect.Left) + tx - 1) div tx;
+    nby := ((ARect.Bottom - ARect.Top) + ty - 1) div ty;
+    for xb := 0 to nbx - 1 do
+    begin
+      ydest := ARect.Top;
+      for yb := 0 to nby - 1 do
+      begin
+        if odd(xb + yb) then
+          bmp.FillRect(xdest, ydest, xdest + tx, ydest + ty, oddColor, dmSet)
+        else
+          bmp.FillRect(xdest, ydest, xdest + tx, ydest + ty, evenColor, dmSet);
+        Inc(ydest, ty);
+      end;
+      Inc(xdest, tx);
+    end;
+    bmp.NoClip;
+  end;
+
+var
+  Border: TRect;
+  Grad: TBGRAGradientScanner;
+begin
+  // Resize background
+  fBackground.SetSize(fVirtualScreen.Width, fVirtualScreen.Height);
+
+  // Draw the outer bevel
+  Border := Rect(0, 0, fVirtualScreen.Width, fVirtualScreen.Height);
+
+  // Draw the rectangle around image
+  if (fBorderSize > 2) then
+  begin
+    // Draw the border gradient
+    Grad := TBGRAGradientScanner.Create(BGRA(245, 245, 245),
+      BGRA(205, 204, 203), gtLinear, PointF(0, 0), PointF(0, fBackground.Height));
+    fBackground.FillRect(0, 0, fBackground.Width, fBorderSize - 2, Grad, dmSet);
+    fBackground.FillRect(0, fBorderSize - 2, fBorderSize - 2,
+      fBackground.Height - fBorderSize + 2, Grad, dmSet);
+    fBackground.FillRect(fBackground.Width - fBorderSize + 2, fBorderSize - 2,
+      fBackground.Width, fBackground.Height - fBorderSize + 2,
+      Grad, dmSet);
+    fBackground.FillRect(0, fBackground.Height - fBorderSize + 2,
+      fBackground.Width, fBackground.Height, Grad, dmSet);
+    Grad.Free;
+    InflateRect(Border, -(fBorderSize - 2), -(fBorderSize - 2));
+  end;
+
+  // Draw 3D border
+  fBackground.CanvasBGRA.Frame3D(Border, 1, bvLowered,
+    ColorToBGRA(ColorToRGB(clBtnHighlight)), ColorToBGRA(ColorToRGB(cl3DDkShadow)));
+  fBackground.CanvasBGRA.Frame3D(Border, 1, bvLowered,
+    ColorToBGRA(ColorToRGB(cl3DLight)), ColorToBGRA(ColorToRGB(clBtnShadow)));
+
+  DrawCheckers(fBackground, Border);
+end;
+
+{ Resize the component, recalculating the proportions }
+procedure TBGRAImageManipulation.Resize;
+
+  function min(const Value: integer; const MinValue: integer): integer;
+  begin
+    if (Value < MinValue) then
+      Result := MinValue
+    else
+      Result := Value;
+  end;
+
+var
+  OriginalRect, SourceRect, DestinationRect: TRect;
+  xRatio, yRatio:  double;
+  ResampledBitmap: TBGRACustomBitmap;
+  i              :Integer;
+  curCropArea    :TCropArea;
+  curCropAreaRect :TRect;
+
+begin
+  inherited Resize;
+
+  if (fVirtualScreen <> nil) then
+  begin
+    fVirtualScreen.SetSize(min(Self.Width, (fBorderSize * 2 + fAnchorSize + fMinWidth)),
+      min(Self.Height, (fBorderSize * 2 + fAnchorSize + fMinHeight)));
+    fVirtualScreen.InvalidateBitmap;
+
+    // Resample the image
+    if (not (fImageBitmap.Empty)) then
+    begin
+      // Get the resampled dimensions to scale image for draw in component
+      DestinationRect := getImageRect(fImageBitmap);
+
+      with OriginalRect do
+      begin
+          Left := 0;
+          Right := fResampledBitmap.Width;
+          Top := 0;
+          Bottom := fResampledBitmap.Height;
+      end;
+      for i:=0 to rCropAreas.Count-1 do
+      begin
+        curCropArea :=rCropAreas[i];
+        curCropAreaRect :=curCropArea.Area;
+
+        if ((abs(curCropAreaRect.Right - curCropAreaRect.Left) > 0) and
+          (abs(curCropAreaRect.Bottom - curCropAreaRect.Top) > 0)) then
+        begin
+
+           // Calculate source rectangle in original scale
+           xRatio := fImageBitmap.Width / (OriginalRect.Right - OriginalRect.Left);
+           yRatio := fImageBitmap.Height / (OriginalRect.Bottom - OriginalRect.Top);
+           with SourceRect do
+           begin
+             Left := Round(curCropAreaRect.Left * xRatio);
+             Right := Round(curCropAreaRect.Right * xRatio);
+             Top := Round(curCropAreaRect.Top * yRatio);
+             Bottom := Round(curCropAreaRect.Bottom * yRatio);
+           end;
+
+           // Calculate destination rectangle in new scale
+           xRatio := fImageBitmap.Width / (DestinationRect.Right - DestinationRect.Left);
+           yRatio := fImageBitmap.Height / (DestinationRect.Bottom - DestinationRect.Top);
+           with curCropArea.Area do
+           begin
+                Left := Round(SourceRect.Left / xRatio);
+                Right := Round(SourceRect.Right / xRatio);
+                Top := Round(SourceRect.Top / yRatio);
+                Bottom := Round(SourceRect.Bottom / yRatio);
+           end;
+        end
+        else
+            begin
+                 // A Null-size crop selection (delete it or assign max size?)
+                 //CalcMaxSelection(curCropArea);
+            end;
+      end;
+
+      // Recreate resampled bitmap
+      try
+        fResampledBitmap.Free;
+        fResampledBitmap := TBGRABitmap.Create(DestinationRect.Right -
+          DestinationRect.Left, DestinationRect.Bottom - DestinationRect.Top);
+        ResampledBitmap  := fImageBitmap.Resample(DestinationRect.Right -
+          DestinationRect.Left, DestinationRect.Bottom -
+          DestinationRect.Top, rmFineResample);
+        fResampledBitmap.BlendImage(0, 0,
+          ResampledBitmap,
+          boLinearBlend);
+      finally
+        ResampledBitmap.Free;
+      end;
+    end;
+
+    // Force Render Struct
+    RepaintBackground;
+    Render;
+  end;
+
+  Invalidate;
+end;
+
+{ Function responsible for rendering the content of the component, including
+  the selection border and anchors. The selected area is painted with a
+  different transparency level for easy viewing of what will be cut. }
+procedure TBGRAImageManipulation.Render;
+var
+  WorkRect: TRect;
+  Mask: TBGRABitmap;
+  BorderColor, SelectColor, FillColor: TBGRAPixel;
+  curCropArea :TCropArea;
+  curCropAreaRect :TRect;
+  curDeltaX,
+  curDeltaY       :Integer;
+  i               :Integer;
+
+begin
+  // This procedure render main feature of engine
+
+  // Render background
+  fVirtualScreen.BlendImage(0, 0,
+    fBackground,
+    boLinearBlend);
+
+  // Render the image
+  if (not (fImageBitmap.Empty)) then
+  begin
+    // Find the working area of the component
+    WorkRect := getWorkRect;
+
+    try
+      // Draw image
+      fVirtualScreen.BlendImage(WorkRect.Left, WorkRect.Top,
+        fResampledBitmap,
+        boLinearBlend);
+
+      // Render the selection background area
+      BorderColor := BGRAWhite;
+      FillColor := BGRA(0, 0, 0, 128);
+      Mask := TBGRABitmap.Create(WorkRect.Right - WorkRect.Left,
+        WorkRect.Bottom - WorkRect.Top, FillColor);
+
+      for i:=0 to rCropAreas.Count-1 do
+      begin
+        curCropArea :=rCropAreas[i];
+        curCropAreaRect :=curCropArea.Area;
+
+        if (curCropArea = rSelectedCropArea)
+        then begin
+                  BorderColor := BGRA(255, 0, 0, 255);
+                  curDeltaX := fDeltaX;
+                  curDeltaY := fDeltaY;
+             end
+        else begin
+                  if (curCropArea = rNewCropArea)
+                  then BorderColor := BGRA(255, 0, 255, 255)
+                  else BorderColor := BGRAWhite;
+                  curDeltaX :=0;
+                  curDeltaY :=0;
+             end;
+
+        Mask.EraseRectAntialias(curCropAreaRect.Left + curDeltaX, curCropAreaRect.Top + curDeltaY,
+          curCropAreaRect.Right + curDeltaX - 1,
+          curCropAreaRect.Bottom + curDeltaY - 1,
+          255);
+      // Draw a selection box
+      with Rect(curCropAreaRect.Left + curDeltaX, curCropAreaRect.Top + curDeltaY,
+          curCropAreaRect.Right + curDeltaX - 1, curCropAreaRect.Bottom + curDeltaY - 1) do
+        Mask.DrawPolyLineAntialias([Point(Left, Top), Point(Right, Top),
+          Point(Right, Bottom), Point(Left, Bottom), Point(Left, Top)],
+          BorderColor, BGRAPixelTransparent, 1, False);
+
+      // Draw anchors
+      BorderColor := BGRABlack;
+      SelectColor := BGRA(255, 255, 0, 255);
+      FillColor := BGRA(255, 255, 0, 128);
+
+      // NW
+      Mask.Rectangle(curCropAreaRect.Left + curDeltaX - fAnchorSize,
+        curCropAreaRect.Top + curDeltaY - fAnchorSize,
+        curCropAreaRect.Left + curDeltaX + fAnchorSize + 1,
+        curCropAreaRect.Top + curDeltaY + fAnchorSize + 1,
+        BorderColor, FillColor, dmSet);
+
+      // W
+      Mask.Rectangle(curCropAreaRect.Left + curDeltaX - fAnchorSize,
+        (curCropAreaRect.Top + curDeltaY + ((curCropAreaRect.Bottom - curCropAreaRect.Top) div 2)) -
+        fAnchorSize,
+        curCropAreaRect.Left + curDeltaX + fAnchorSize + 1,
+        (curCropAreaRect.Top + curDeltaY + ((curCropAreaRect.Bottom - curCropAreaRect.Top) div 2)) +
+        fAnchorSize + 1,
+        BorderColor, FillColor, dmSet);
+
+      // SW
+      Mask.Rectangle(curCropAreaRect.Left + curDeltaX - fAnchorSize,
+        curCropAreaRect.Bottom + curDeltaY - fAnchorSize - 1,
+        curCropAreaRect.Left + curDeltaX + fAnchorSize + 1,
+        curCropAreaRect.Bottom + curDeltaY + fAnchorSize,
+        BorderColor, FillColor, dmSet);
+
+      // S
+      if ((fAnchorSelected = [NORTH]) and (curCropAreaRect.Top < curCropAreaRect.Bottom) and
+        (fStartPoint.Y = curCropAreaRect.Top)) or ((fAnchorSelected = [NORTH]) and
+        (curCropAreaRect.Top > curCropAreaRect.Bottom) and (fStartPoint.Y = curCropAreaRect.Top)) or
+        ((fAnchorSelected = [SOUTH]) and (curCropAreaRect.Top < curCropAreaRect.Bottom) and
+        (fStartPoint.Y = curCropAreaRect.Top)) or ((fAnchorSelected = [SOUTH]) and
+        (curCropAreaRect.Top > curCropAreaRect.Bottom) and (fStartPoint.Y = curCropAreaRect.Top)) then
+        Mask.Rectangle((curCropAreaRect.Left + curDeltaX +
+          ((curCropAreaRect.Right - curCropAreaRect.Left) div 2)) - fAnchorSize,
+          curCropAreaRect.Bottom + curDeltaY - fAnchorSize - 1,
+          (curCropAreaRect.Left + curDeltaX +
+          ((curCropAreaRect.Right - curCropAreaRect.Left) div 2)) + fAnchorSize + 1,
+          curCropAreaRect.Bottom + curDeltaY + fAnchorSize,
+          BorderColor, SelectColor, dmSet)
+      else
+        Mask.Rectangle((curCropAreaRect.Left + curDeltaX +
+          ((curCropAreaRect.Right - curCropAreaRect.Left) div 2)) - fAnchorSize,
+          curCropAreaRect.Bottom + curDeltaY - fAnchorSize - 1,
+          (curCropAreaRect.Left + curDeltaX +
+          ((curCropAreaRect.Right - curCropAreaRect.Left) div 2)) + fAnchorSize + 1,
+          curCropAreaRect.Bottom + curDeltaY + fAnchorSize,
+          BorderColor, FillColor, dmSet);
+
+      // SE
+      if ((fAnchorSelected = [NORTH, WEST]) and
+        ((curCropAreaRect.Left > curCropAreaRect.Right) and (curCropAreaRect.Top > curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [NORTH, WEST]) and
+        ((curCropAreaRect.Left < curCropAreaRect.Right) and (curCropAreaRect.Top < curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [NORTH, WEST]) and
+        ((curCropAreaRect.Left > curCropAreaRect.Right) and (curCropAreaRect.Top < curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [NORTH, WEST]) and
+        ((curCropAreaRect.Left < curCropAreaRect.Right) and (curCropAreaRect.Top > curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [NORTH, EAST]) and
+        ((curCropAreaRect.Left < curCropAreaRect.Right) and (curCropAreaRect.Top > curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [NORTH, EAST]) and
+        ((curCropAreaRect.Left > curCropAreaRect.Right) and (curCropAreaRect.Top < curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [NORTH, EAST]) and
+        ((curCropAreaRect.Left < curCropAreaRect.Right) and (curCropAreaRect.Top < curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [NORTH, EAST]) and
+        ((curCropAreaRect.Left > curCropAreaRect.Right) and (curCropAreaRect.Top > curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [SOUTH, EAST]) and
+        ((curCropAreaRect.Left > curCropAreaRect.Right) and (curCropAreaRect.Top > curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [SOUTH, EAST]) and
+        ((curCropAreaRect.Left < curCropAreaRect.Right) and (curCropAreaRect.Top < curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [SOUTH, EAST]) and
+        ((curCropAreaRect.Left > curCropAreaRect.Right) and (curCropAreaRect.Top < curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [SOUTH, EAST]) and
+        ((curCropAreaRect.Left < curCropAreaRect.Right) and (curCropAreaRect.Top > curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [SOUTH, WEST]) and
+        ((curCropAreaRect.Left > curCropAreaRect.Right) and (curCropAreaRect.Top < curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [SOUTH, WEST]) and
+        ((curCropAreaRect.Left < curCropAreaRect.Right) and (curCropAreaRect.Top > curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [SOUTH, WEST]) and
+        ((curCropAreaRect.Left > curCropAreaRect.Right) and (curCropAreaRect.Top > curCropAreaRect.Bottom))) or
+        ((fAnchorSelected = [SOUTH, WEST]) and
+        ((curCropAreaRect.Left < curCropAreaRect.Right) and (curCropAreaRect.Top < curCropAreaRect.Bottom))) then
+        Mask.Rectangle(curCropAreaRect.Right + curDeltaX - fAnchorSize - 1,
+          curCropAreaRect.Bottom + curDeltaY - fAnchorSize - 1,
+          curCropAreaRect.Right + curDeltaX + fAnchorSize,
+          curCropAreaRect.Bottom + curDeltaY + fAnchorSize,
+          BorderColor, SelectColor, dmSet)
+      else
+        Mask.Rectangle(curCropAreaRect.Right + curDeltaX - fAnchorSize - 1,
+          curCropAreaRect.Bottom + curDeltaY - fAnchorSize - 1,
+          curCropAreaRect.Right + curDeltaX + fAnchorSize,
+          curCropAreaRect.Bottom + curDeltaY + fAnchorSize,
+          BorderColor, FillColor, dmSet);
+
+      // E
+      if ((fAnchorSelected = [EAST]) and (curCropAreaRect.Left < curCropAreaRect.Right) and
+        (fStartPoint.X = curCropAreaRect.Left)) or ((fAnchorSelected = [EAST]) and
+        (curCropAreaRect.Left > curCropAreaRect.Right) and (fStartPoint.X = curCropAreaRect.Left)) or
+        ((fAnchorSelected = [WEST]) and (curCropAreaRect.Left < curCropAreaRect.Right) and
+        (fStartPoint.X = curCropAreaRect.Left)) or ((fAnchorSelected = [WEST]) and
+        (curCropAreaRect.Left > curCropAreaRect.Right) and (fStartPoint.X = curCropAreaRect.Left)) then
+        Mask.Rectangle(curCropAreaRect.Right + curDeltaX - fAnchorSize - 1,
+          (curCropAreaRect.Top + curDeltaY + ((curCropAreaRect.Bottom - curCropAreaRect.Top) div 2)) -
+          fAnchorSize,
+          curCropAreaRect.Right + curDeltaX + fAnchorSize,
+          (curCropAreaRect.Top + curDeltaY + ((curCropAreaRect.Bottom - curCropAreaRect.Top) div 2)) +
+          fAnchorSize + 1,
+          BorderColor, SelectColor, dmSet)
+      else
+        Mask.Rectangle(curCropAreaRect.Right + curDeltaX - fAnchorSize - 1,
+          (curCropAreaRect.Top + curDeltaY + ((curCropAreaRect.Bottom - curCropAreaRect.Top) div 2)) -
+          fAnchorSize,
+          curCropAreaRect.Right + curDeltaX + fAnchorSize,
+          (curCropAreaRect.Top + curDeltaY + ((curCropAreaRect.Bottom - curCropAreaRect.Top) div 2)) +
+          fAnchorSize + 1,
+          BorderColor, FillColor, dmSet);
+
+      // NE
+      Mask.Rectangle(curCropAreaRect.Right + curDeltaX - fAnchorSize - 1,
+        curCropAreaRect.Top + curDeltaY - fAnchorSize,
+        curCropAreaRect.Right + curDeltaX + fAnchorSize,
+        curCropAreaRect.Top + curDeltaY + fAnchorSize + 1,
+        BorderColor, FillColor, dmSet);
+
+      // N
+      Mask.Rectangle((curCropAreaRect.Left + curDeltaX +
+        ((curCropAreaRect.Right - curCropAreaRect.Left) div 2)) - fAnchorSize,
+        curCropAreaRect.Top + curDeltaY - fAnchorSize,
+        (curCropAreaRect.Left + curDeltaX + ((curCropAreaRect.Right - curCropAreaRect.Left) div 2)) +
+        fAnchorSize + 1,
+        curCropAreaRect.Top + curDeltaY + fAnchorSize + 1,
+        BorderColor, FillColor, dmSet);
+
+      end;
+    finally
+      fVirtualScreen.BlendImage(WorkRect.Left, WorkRect.Top,
+        Mask,
+        boLinearBlend);
+      Mask.Free;
+    end;
+  end;
+end;
+
+
+ { ============================================================================ }
+ { =====[ Properties Manipulation ]============================================ }
+ { ============================================================================ }
+
+function TBGRAImageManipulation.getAnchorSize: byte;
+begin
+  Result := fAnchorSize * 2 + 1;
+end;
+
+procedure TBGRAImageManipulation.setAnchorSize(const Value: byte);
+const
+  MinSize = 3;
+  MaxSize = 9;
+begin
+  if (Value <> getAnchorSize) then
+  begin
+    if (Value < MinSize) then
+    begin
+      raise ERangeError.CreateFmt(SAnchorSizeIsTooSmall,
+        [Value, MinSize, MaxSize]);
+    end
+    else
+    begin
+      if (Value > MaxSize) then
+      begin
+        raise ERangeError.CreateFmt(SAnchorSizeIsTooLarge,
+          [Value, MinSize, MaxSize]);
+      end
+      else
+      begin
+        if ((Value mod 2) = 0) then
+        begin
+          raise EInvalidArgument.CreateFmt(SAnchorSizeIsNotOdd, [Value]);
+        end
+        else
+        begin
+          fAnchorSize := (Value div 2);
+          Render;
+          Refresh;
+        end;
+      end;
+    end;
+  end;
+end;
+
+function TBGRAImageManipulation.getEmpty: boolean;
+begin
+  Result := fImageBitmap.Empty;
+end;
+
+function TBGRAImageManipulation.getBitmap(ACropArea :TCropArea = Nil): TBGRABitmap;
+begin
+  Result := fImageBitmap;
+  if not (fImageBitmap.Empty) then
+  begin
+      if (ACropArea = Nil)
+        then ACropArea := Self.rSelectedCropArea;
+      if (ACropArea <> Nil)
+         then Result :=ACropArea.getBitmap(getImageRect(fImageBitmap));
+  end;
+end;
+
+function TBGRAImageManipulation.getBitmapFullSize(ACropArea :TCropArea = Nil): TBGRABitmap;
+begin
+  Result := fImageBitmap;
+  if not (fImageBitmap.Empty) then
+  begin
+      if (ACropArea = Nil)
+        then ACropArea := Self.rSelectedCropArea;
+      if (ACropArea <> Nil)
+         then Result :=ACropArea.getBitmapFullSize;
+  end;
+end;
+
+procedure TBGRAImageManipulation.setBitmap(const Value: TBGRABitmap);
+
+  function min(const Value: integer; const MinValue: integer): integer;
+  begin
+    if (Value < MinValue) then
+      Result := MinValue
+    else
+      Result := Value;
+  end;
+
+var
+  SourceRect, OriginalRect, DestinationRect: TRect;
+  ResampledBitmap: TBGRACustomBitmap;
+  xRatio, yRatio:  double;
+  curCropArea :TCropArea;
+  curCropAreaRect :TRect;
+  i               :Integer;
+
+begin
+  if (Value <> fImageBitmap) then
+  begin
+    try
+      // Clear actual image
+      fImageBitmap.Free;
+      fImageBitmap := TBGRABitmap.Create(Value.Width, Value.Height);
+
+      // Prevent empty image
+      if Value.Empty then
+        exit;
+
+      // Prevent null image
+      if (Value.Width = 0) or (Value.Height = 0) then
+        exit;
+
+      // Associate the new bitmap
+      fImageBitmap.Assign(Value);
+
+      // Get the resampled dimensions to scale image for draw in component
+      DestinationRect := getImageRect(fImageBitmap);
+
+      // Recreate resampled bitmap
+      try
+        fResampledBitmap.Free;
+        fResampledBitmap := TBGRABitmap.Create(DestinationRect.Right -
+          DestinationRect.Left, DestinationRect.Bottom - DestinationRect.Top);
+        ResampledBitmap  := fImageBitmap.Resample(DestinationRect.Right -
+          DestinationRect.Left, DestinationRect.Bottom -
+          DestinationRect.Top, rmFineResample);
+        fResampledBitmap.BlendImage(0, 0,
+          ResampledBitmap,
+          boLinearBlend);
+      finally
+        ResampledBitmap.Free;
+      end;
+
+      // Calculate scale from original size and destination size
+      with OriginalRect do
+      begin
+        Left := 0;
+        Right := fResampledBitmap.Width;
+        Top := 0;
+        Bottom := fResampledBitmap.Height;
+      end;
+      for i:=0 to rCropAreas.Count-1 do
+      begin
+        curCropArea :=rCropAreas[i];
+        curCropAreaRect :=curCropArea.Area;
+
+      // Resize crop area
+      if ((abs(curCropAreaRect.Right - curCropAreaRect.Left) > 0) and
+        (abs(curCropAreaRect.Bottom - curCropAreaRect.Top) > 0)) then
+      begin
+        // Calculate source rectangle in original scale
+        xRatio := fImageBitmap.Width / (OriginalRect.Right - OriginalRect.Left);
+        yRatio := fImageBitmap.Height / (OriginalRect.Bottom - OriginalRect.Top);
+        with SourceRect do
+        begin
+          Left := Round(curCropAreaRect.Left * xRatio);
+          Right := Round(curCropAreaRect.Right * xRatio);
+          Top := Round(curCropAreaRect.Top * yRatio);
+          Bottom := Round(curCropAreaRect.Bottom * yRatio);
+        end;
+
+        // Calculate destination rectangle in new scale
+        xRatio := fImageBitmap.Width / (DestinationRect.Right - DestinationRect.Left);
+        yRatio := fImageBitmap.Height / (DestinationRect.Bottom - DestinationRect.Top);
+        with curCropArea.Area do
+        begin
+          Left := Round(SourceRect.Left / xRatio);
+          Right := Round(SourceRect.Right / xRatio);
+          Top := Round(SourceRect.Top / yRatio);
+          Bottom := Round(SourceRect.Bottom / yRatio);
+        end;
+      end
+      else
+          begin
+               // A Null-size crop selection (delete it or assign max size?)
+               //CalcMaxSelection(curCropArea);
+          end;
+      end;
+    finally
+      // Force Render Struct
+      Render;
+      inherited Invalidate;
+    end;
+  end;
+end;
+
+procedure TBGRAImageManipulation.rotateLeft;
+var
+  SourceRect, OriginalRect, DestinationRect: TRect;
+  TempBitmap, ResampledBitmap: TBGRACustomBitmap;
+  xRatio, yRatio: double;
+  curCropArea :TCropArea;
+  curCropAreaRect :TRect;
+  i               :Integer;
+
+begin
+  try
+    // Prevent empty image
+    if fImageBitmap.Empty then
+      exit;
+
+    // Rotate bitmap
+    TempBitmap := fImageBitmap.RotateCCW;
+    fImageBitmap.Assign(TempBitmap);
+
+    // Get the resampled dimensions to scale image for draw in component
+    DestinationRect := getImageRect(fImageBitmap);
+
+    // Recreate resampled bitmap
+    try
+      fResampledBitmap.Free;
+      fResampledBitmap := TBGRABitmap.Create(DestinationRect.Right -
+        DestinationRect.Left, DestinationRect.Bottom - DestinationRect.Top);
+      ResampledBitmap  := fImageBitmap.Resample(DestinationRect.Right -
+        DestinationRect.Left, DestinationRect.Bottom - DestinationRect.Top,
+        rmFineResample);
+      fResampledBitmap.BlendImage(0, 0,
+        ResampledBitmap,
+        boLinearBlend);
+    finally
+      ResampledBitmap.Free;
+    end;
+
+    // Calculate scale from original size and destination size
+    with OriginalRect do
+    begin
+      Left := 0;
+      Right := fResampledBitmap.Width;
+      Top := 0;
+      Bottom := fResampledBitmap.Height;
+    end;
+    for i:=0 to rCropAreas.Count-1 do
+    begin
+      curCropArea :=rCropAreas[i];
+      curCropAreaRect :=curCropArea.Area;
+
+    // Resize crop area
+    if ((abs(curCropAreaRect.Right - curCropAreaRect.Left) > 0) and
+      (abs(curCropAreaRect.Bottom - curCropAreaRect.Top) > 0)) then
+    begin
+      // Calculate source rectangle in original scale
+      xRatio := fImageBitmap.Width / (OriginalRect.Right - OriginalRect.Left);
+      yRatio := fImageBitmap.Height / (OriginalRect.Bottom - OriginalRect.Top);
+      with SourceRect do
+      begin
+        Left := Round(curCropAreaRect.Left * xRatio);
+        Right := Round(curCropAreaRect.Right * xRatio);
+        Top := Round(curCropAreaRect.Top * yRatio);
+        Bottom := Round(curCropAreaRect.Bottom * yRatio);
+      end;
+
+      // Calculate destination rectangle in new scale
+      xRatio := fImageBitmap.Width / (DestinationRect.Right - DestinationRect.Left);
+      yRatio := fImageBitmap.Height / (DestinationRect.Bottom - DestinationRect.Top);
+      with curCropArea.Area do
+      begin
+        Left := Round(SourceRect.Left / xRatio);
+        Right := Round(SourceRect.Right / xRatio);
+        Top := Round(SourceRect.Top / yRatio);
+        Bottom := Round(SourceRect.Bottom / yRatio);
+      end;
+    end
+    else
+        begin
+             // A Null-size crop selection (delete it or assign max size?)
+             //CalcMaxSelection(curCropArea);
+        end;
+    end;
+  finally
+    // Force Render Struct
+    Render;
+    inherited Invalidate;
+    TempBitmap.Free;
+  end;
+end;
+
+procedure TBGRAImageManipulation.rotateRight;
+var
+  SourceRect, OriginalRect, DestinationRect: TRect;
+  TempBitmap, ResampledBitmap: TBGRACustomBitmap;
+  xRatio, yRatio: double;
+  curCropArea :TCropArea;
+  curCropAreaRect :TRect;
+  i               :Integer;
+
+begin
+  try
+    // Prevent empty image
+    if fImageBitmap.Empty then
+      exit;
+
+    // Rotate bitmap
+    TempBitmap := fImageBitmap.RotateCW;
+    fImageBitmap.Assign(TempBitmap);
+
+    // Get the resampled dimensions to scale image for draw in component
+    DestinationRect := getImageRect(fImageBitmap);
+
+    // Recreate resampled bitmap
+    try
+      fResampledBitmap.Free;
+      fResampledBitmap := TBGRABitmap.Create(DestinationRect.Right -
+        DestinationRect.Left, DestinationRect.Bottom - DestinationRect.Top);
+      ResampledBitmap  := fImageBitmap.Resample(DestinationRect.Right -
+        DestinationRect.Left, DestinationRect.Bottom - DestinationRect.Top,
+        rmFineResample);
+      fResampledBitmap.BlendImage(0, 0,
+        ResampledBitmap,
+        boLinearBlend);
+    finally
+      ResampledBitmap.Free;
+    end;
+
+    // Calculate scale from original size and destination size
+    with OriginalRect do
+    begin
+      Left := 0;
+      Right := fResampledBitmap.Width;
+      Top := 0;
+      Bottom := fResampledBitmap.Height;
+    end;
+    for i:=0 to rCropAreas.Count-1 do
+    begin
+      curCropArea :=rCropAreas[i];
+      curCropAreaRect :=curCropArea.Area;
+
+    // Resize crop area
+    if ((abs(curCropAreaRect.Right - curCropAreaRect.Left) > 0) and
+      (abs(curCropAreaRect.Bottom - curCropAreaRect.Top) > 0)) then
+    begin
+      // Calculate source rectangle in original scale
+      xRatio := fImageBitmap.Width / (OriginalRect.Right - OriginalRect.Left);
+      yRatio := fImageBitmap.Height / (OriginalRect.Bottom - OriginalRect.Top);
+      with SourceRect do
+      begin
+        Left := Round(curCropAreaRect.Left * xRatio);
+        Right := Round(curCropAreaRect.Right * xRatio);
+        Top := Round(curCropAreaRect.Top * yRatio);
+        Bottom := Round(curCropAreaRect.Bottom * yRatio);
+      end;
+
+      // Calculate destination rectangle in new scale
+      xRatio := fImageBitmap.Width / (DestinationRect.Right - DestinationRect.Left);
+      yRatio := fImageBitmap.Height / (DestinationRect.Bottom - DestinationRect.Top);
+      with curCropArea.Area do
+      begin
+        Left := Round(SourceRect.Left / xRatio);
+        Right := Round(SourceRect.Right / xRatio);
+        Top := Round(SourceRect.Top / yRatio);
+        Bottom := Round(SourceRect.Bottom / yRatio);
+      end;
+    end
+    else
+    begin
+      // Calculates maximum crop selection
+      CalcMaxSelection(curCropArea);
+    end;
+
+    end;
+  finally
+    // Force Render Struct
+    Render;
+    inherited Invalidate;
+    TempBitmap.Free;
+  end;
+end;
+
+function TBGRAImageManipulation.addCropArea(AArea: TRect; ARotate: double;
+  AUserData: Integer): TCropArea;
+Var
+   newCropArea :TCropArea;
+
+begin
+     try
+       newCropArea :=TCropArea.Create(Self, AArea, ARotate, AUserData);
+       rCropAreas.add(newCropArea);
+       Result :=newCropArea;
+     except
+       if (newCropArea <> Nil)
+       then newCropArea.Free;
+
+       Result :=Nil;
+     end;
+    Render;
+    Invalidate;
+end;
+
+procedure TBGRAImageManipulation.delCropArea(ACropArea: TCropArea);
+begin
+     if (ACropArea <> Nil)
+     then begin
+               rCropAreas.Delete(ACropArea.Index);
+               Render;
+               Invalidate;
+          end;
+end;
+
+procedure TBGRAImageManipulation.clearCropAreas;
+begin
+     rCropAreas.Clear;
+     Render;
+     Invalidate;
+end;
+
+procedure TBGRAImageManipulation.getAllBitmaps(ACallBack: TgetAllBitmapsCallback);
+Var
+   i            :Integer;
+   OriginalRect :TRect;
+   curCropArea  :TCropArea;
+
+begin
+     OriginalRect := getImageRect(fImageBitmap);
+     //Get Bitmap of each CropArea and pass it to CallBack
+     for i:=0 to rCropAreas.Count-1 do
+     begin
+          curCropArea :=rCropAreas[i];
+          ACallBack(curCropArea.getBitmap(OriginalRect), curCropArea);
+     end;
+end;
+
+procedure TBGRAImageManipulation.getAllBitmapsFullSize(ACallBack: TgetAllBitmapsCallback);
+Var
+   i            :Integer;
+   curCropArea  :TCropArea;
+
+begin
+     //Get Bitmap of each CropArea and pass it to CallBack
+     for i:=0 to rCropAreas.Count-1 do
+     begin
+          curCropArea :=rCropAreas[i];
+          ACallBack(curCropArea.getBitmapFullSize, curCropArea);
+     end;
+end;
+
+
+procedure TBGRAImageManipulation.setBorderSize(const Value: byte);
+const
+  MinSize = 2;
+  MaxSize = 10;
+begin
+  if (Value <> fBorderSize) then
+  begin
+    if (Value < MinSize) then
+    begin
+      raise ERangeError.CreateFmt(SBorderSizeIsTooSmall,
+        [Value, MinSize, MaxSize]);
+    end
+    else
+    begin
+      if (Value > MaxSize) then
+      begin
+        raise ERangeError.CreateFmt(SBorderSizeIsTooLarge,
+          [Value, MinSize, MaxSize]);
+      end
+      else
+      begin
+        fBorderSize := Value;
+
+        Resize;
+      end;
+    end;
+  end;
+end;
+
+procedure TBGRAImageManipulation.setKeepAspectRatio(const Value: boolean);
+Var
+   i           :Integer;
+   curCropArea :TCropArea;
+
+begin
+  if (Value <> fKeepAspectRatio) then
+  begin
+    fKeepAspectRatio := Value;
+    if (fKeepAspectRatio) then
+    begin
+      if (not (fImageBitmap.Empty)) then
+      begin
+        (* Assign Max to alla crops?
+        // Check if crop selection is not empty
+        if not ((fCropArea.Left = fCropArea.Right) and
+          (fCropArea.Top = fCropArea.Bottom)) then
+          CalcMaxSelection;
+        *)
+        for i:=0 to rCropAreas.Count-1 do
+        begin
+             Self.ApplyRatioToArea(rCropAreas[i]);
+        end;
+        Render;
+      end;
+    end;
+
+    Refresh;
+  end;
+end;
+
+function TBGRAImageManipulation.getAspectRatioFromImage(
+  const Value: TBGRABitmap): string;
+var
+  GCD: integer;
+begin
+  GCD := getGCD(Value.Width, Value.Height);
+
+  Result := IntToStr(Value.Width div GCD) + ':' + IntToStr(Value.Height div GCD);
+end;
+
+procedure TBGRAImageManipulation.setAspectRatio(const Value: string);
+const
+  ValidChars = ['0'..'9', ':'];
+var
+  Count, XValue, YValue: integer;
+  AspectRatioText: string;
+   i           :Integer;
+   curCropArea :TCropArea;
+
+begin
+  if (Value <> fAspectRatio) then
+  begin
+    // Check if value contain a valid string
+    if ((pos(':', Value) > 0) and (pos(':', Value) < Length(Value))) then
+    begin
+      // Check if value is valid
+      XValue := 0;
+      YValue := 0;
+      AspectRatioText := '';
+      for Count := 1 to Length(Value) do
+      begin
+        if (Value[Count] in ValidChars) then
+        begin
+          if ((Value[Count] = ':') and (Length(AspectRatioText) > 0) and
+            (XValue = 0)) then
+          begin
+            XValue := StrToInt(AspectRatioText);
+          end;
+
+          AspectRatioText := AspectRatioText + Value[Count];
+        end
+        else
+        begin
+          // Value contain invalid characters
+          raise EInvalidArgument.CreateFmt(SAspectRatioIsNotValid, [Value]);
+        end;
+      end;
+      YValue := StrToInt(Copy(AspectRatioText, Pos(':', AspectRatioText) + 1,
+        Length(AspectRatioText)));
+    end
+    else
+    begin
+      // Value contain invalid characters
+      raise EInvalidArgument.CreateFmt(SAspectRatioIsNotValid, [Value]);
+    end;
+
+    // Set new Aspect Ratio
+    fAspectRatio := AspectRatioText;
+    fAspectX := XValue;
+    fAspectY := YValue;
+
+    // Calculate the ratio
+    fGCD := getGCD(fAspectX, fAspectY);
+
+    // Determine the ratio of scale per axle
+    with fRatio do
+    begin
+      Horizontal := fAspectX div fGCD;
+      Vertical := fAspectY div fGCD;
+    end;
+
+    // Set minimun size
+    if ((fRatio.Horizontal < fAnchorSize + 10) or
+      (fRatio.Vertical < fAnchorSize + 10)) then
+    begin
+      fMinWidth  := fRatio.Horizontal * 10;
+      fMinHeight := fRatio.Vertical * 10;
+    end
+    else
+    begin
+      fMinWidth  := fRatio.Horizontal;
+      fMinHeight := fRatio.Vertical;
+    end;
+
+    if (not (fImageBitmap.Empty)) then
+    begin
+      (* Assign Max to alla crops?
+      // Check if crop selection is not empty
+      if not ((fCropArea.Left = fCropArea.Right) and
+        (fCropArea.Top = fCropArea.Bottom)) then
+        CalcMaxSelection;
+      Render;
+      *)
+      for i:=0 to rCropAreas.Count-1 do
+      begin
+           Self.ApplyRatioToArea(rCropAreas[i]);
+      end;
+
+    end;
+
+    Invalidate;
+  end;
+end;
+
+procedure TBGRAImageManipulation.setMinHeight(const Value: integer);
+begin
+  if (Value <> fMinHeight) then
+  begin
+    if (Value < fSizeLimits.minHeight) then
+    begin
+      fMinHeight := fSizeLimits.minHeight;
+    end
+    else
+    begin
+      if (Value > fSizeLimits.maxHeight) then
+      begin
+        fMinHeight := fSizeLimits.maxHeight;
+      end
+      else
+      begin
+        fMinHeight := Value;
+      end;
+    end;
+
+    if (fKeepAspectRatio) then
+    begin
+      // Recalculates the width value based on height
+      fMinWidth := Trunc(fMinHeight * (fRatio.Horizontal / fRatio.Vertical));
+    end;
+
+    Render;
+    Invalidate;
+  end;
+end;
+
+procedure TBGRAImageManipulation.setMinWidth(const Value: integer);
+begin
+  if (Value <> fMinWidth) then
+  begin
+    if (Value < fSizeLimits.minWidth) then
+    begin
+      fMinWidth := fSizeLimits.minWidth;
+    end
+    else
+    begin
+      if (Value > fSizeLimits.maxWidth) then
+      begin
+        fMinWidth := fSizeLimits.maxWidth;
+      end
+      else
+      begin
+        fMinWidth := Value;
+      end;
+    end;
+
+    if (fKeepAspectRatio) then
+    begin
+      // Recalculates the height value based on width
+      fMinHeight := Trunc(fMinWidth * (fRatio.Vertical / fRatio.Horizontal));
+    end;
+
+    Render;
+    Invalidate;
+  end;
+end;
+
+
+ { ============================================================================ }
+ { =====[ Event Control ]====================================================== }
+ { ============================================================================ }
+
+ //Controllare tutte e 3
+procedure TBGRAImageManipulation.MouseDown(Button: TMouseButton;
+  Shift: TShiftState; X, Y: integer);
+var
+  WorkRect: TRect;
+  overControl: boolean;
+  ACursor :TCursor;
+
+begin
+  // Call the inherited MouseDown() procedure
+  inherited MouseDown(Button, Shift, X, Y);
+
+  // Find the working area of the control
+  WorkRect := getWorkRect;
+
+  // See if the mouse is inside the pressable part of the control
+  overControl := ((X >= WorkRect.Left) and (X <= WorkRect.Right) and
+    (Y >= WorkRect.Top) and (Y <= WorkRect.Bottom));
+
+  // If over control
+  if ((overControl) and (Button = mbLeft) and (not (ssDouble in Shift))) then
+  begin
+    // If this was the left mouse button and nor double click
+    fMouseCaught := True;
+    fStartPoint  := Point(X - WorkRect.Left, Y - WorkRect.Top);
+
+    rSelectedCropArea :=Self.isOverAnchor(fStartPoint, fAnchorSelected, ACursor);
+
+    if (fAnchorSelected <> []) then
+    begin
+      // Resize the cropping area from cornes
+
+      // Get the coordinate corresponding to the opposite quadrant and
+      // set into fStartPoint
+      if ((fAnchorSelected = [NORTH]) or (fAnchorSelected = [WEST]) or
+        (fAnchorSelected = [NORTH, WEST])) then
+        fStartPoint := Point(rSelectedCropArea.Area.Right, rSelectedCropArea.Area.Bottom);
+
+      if (fAnchorSelected = [SOUTH, WEST]) then
+        fStartPoint := Point(rSelectedCropArea.Area.Right, rSelectedCropArea.Area.Top);
+
+      if ((fAnchorSelected = [SOUTH]) or (fAnchorSelected = [EAST]) or
+        (fAnchorSelected = [SOUTH, EAST])) then
+        fStartPoint := Point(rSelectedCropArea.Area.Left, rSelectedCropArea.Area.Top);
+
+      if (fAnchorSelected = [NORTH, EAST]) then
+        fStartPoint := Point(rSelectedCropArea.Area.Left, rSelectedCropArea.Area.Bottom);
+    end;
+  end;
+end;
+
+procedure TBGRAImageManipulation.MouseMove(Shift: TShiftState; X, Y: integer);
+var
+  needRepaint: boolean;
+  WorkRect: TRect;
+  newCoords: TCoord;
+  Direction: TDirection;
+  Bounds: TRect;
+  overControl: boolean;
+  overCropArea :TCropArea;
+  ACursor      :TCursor;
+
+begin
+  // Call the inherited MouseMove() procedure
+  inherited MouseMove(Shift, X, Y);
+
+  // Set default cursor
+  Cursor := crDefault;
+
+  // Assume we don't need to repaint the control
+  needRepaint := False;
+
+  // Find the working area of the component
+  WorkRect := GetWorkRect;
+
+  // See if the mouse is inside the pressable part of the control
+  overControl := ((X >= WorkRect.Left) and (X <= WorkRect.Right) and
+    (Y >= WorkRect.Top) and (Y <= WorkRect.Bottom));
+
+  // If image empty
+  if (fImageBitmap.Empty) then
+    exit;
+
+  // If the mouse was originally clicked on the control
+  if (fMouseCaught) then
+  begin
+    // If no anchor selected
+    if (fAnchorSelected = []) then
+    begin
+      // Starts a new selection of cropping area
+      try
+        Cursor := crCross;
+        fEndPoint := Point(X - WorkRect.Left, Y - WorkRect.Top);
+
+        // Copy coord
+        with newCoords do
+        begin
+          x1 := fStartPoint.X;
+          y1 := fStartPoint.Y;
+
+          x2 := fEndPoint.X;
+          y2 := fEndPoint.Y;
+        end;
+
+        // Determine direction
+        Direction := getDirection(fStartPoint, fEndPoint);
+
+        // Determines limite values
+        Bounds := getImageRect(fResampledBitmap);
+
+        // Apply the ratio, if necessary
+        newCoords := ApplyRatioToAxes(newCoords, Direction, Bounds, rNewCropArea);
+
+        // Determines minimum value on both axes
+        newCoords := ApplyDimRestriction(newCoords, Direction, Bounds);
+
+        if (rNewCropArea = Nil)
+        then rNewCropArea :=addCropArea(Rect(newCoords.x1, newCoords.y1, newCoords.x2, newCoords.y2))
+        else rNewCropArea.Area :=Rect(newCoords.x1, newCoords.y1, newCoords.x2, newCoords.y2);
+      finally
+        needRepaint := True;
+      end;
+    end
+    else
+    begin
+      // Get the actual point
+      fEndPoint := Point(X - WorkRect.Left, Y - WorkRect.Top);
+
+      // Check what the anchor was dragged
+      if (fAnchorSelected = [NORTH, SOUTH, EAST, WEST]) then
+      begin
+        Cursor := crSizeAll;
+
+        // Move the cropping area
+        try
+          // Gets the offset
+          fDeltaX := fEndPoint.X - fStartPoint.X;
+          fDeltaY := fEndPoint.Y - fStartPoint.Y;
+
+          // Determines limite values
+          Bounds := getImageRect(fResampledBitmap);
+
+          if ((rSelectedCropArea.Area.Left + fDeltaX) < Bounds.Left) then
+          begin
+            fDeltaX := fDeltaX + Abs(rSelectedCropArea.Area.Left + fDeltaX);
+          end;
+
+          if ((rSelectedCropArea.Area.Right + fDeltaX) > Bounds.Right) then
+          begin
+            fDeltaX := fDeltaX - Abs(rSelectedCropArea.Area.Right + fDeltaX) + Bounds.Right;
+          end;
+
+          if ((rSelectedCropArea.Area.Top + fDeltaY) < Bounds.Top) then
+          begin
+            fDeltaY := fDeltaY + Abs(rSelectedCropArea.Area.Top + fDeltaY);
+          end;
+
+          if ((rSelectedCropArea.Area.Bottom + fDeltaY) > Bounds.Bottom) then
+          begin
+            fDeltaY := fDeltaY - Abs(rSelectedCropArea.Area.Bottom + fDeltaY) + Bounds.Bottom;
+          end;
+        finally
+          needRepaint := True;
+        end;
+      end
+      else
+      begin
+        (* if ((fAnchorSelected = [NORTH]) or (fAnchorSelected = [SOUTH]) or
+            (fAnchorSelected = [EAST]) or (fAnchorSelected = [WEST]) or
+            (fAnchorSelected = [NORTH, WEST]) or (fAnchorSelected = [SOUTH, WEST]) or
+            (fAnchorSelected = [SOUTH, EAST]) or (fAnchorSelected = [NORTH, EAST])) then
+         begin*)
+              // Resize the cropping area
+              try
+                 if ((fAnchorSelected = [EAST]) or (fAnchorSelected = [WEST]))
+                 then Cursor := crSizeWE
+                 else if (NORTH in fAnchorSelected)
+                      then begin
+                                if (WEST in fAnchorSelected)
+                                then Cursor := crSizeNW
+                                else if (EAST in fAnchorSelected)
+                                     then Cursor := crSizeNE
+                                     else Cursor := crSizeNS;
+                           end
+                      else begin
+                                if (WEST in fAnchorSelected)
+                                then Cursor := crSizeSW
+                                else if (EAST in fAnchorSelected)
+                                     then Cursor := crSizeSE
+                                     else Cursor := crSizeNS;
+                           end;
+
+                 // Copy coord
+                 with newCoords do
+                 begin
+                      x1 := fStartPoint.X;
+                      y1 := fStartPoint.Y;
+
+                      if (fAnchorSelected = [NORTH]) then
+                      begin
+                           x2 := fEndPoint.X - Abs(rSelectedCropArea.Area.Right - rSelectedCropArea.Area.Left) div 2;
+                           y2 := fEndPoint.Y;
+                      end
+                      else
+                      if (fAnchorSelected = [SOUTH]) then
+                      begin
+                           x2 := fEndPoint.X + Abs(rSelectedCropArea.Area.Right - rSelectedCropArea.Area.Left) div 2;
+                           y2 := fEndPoint.Y;
+                      end
+                      else
+                      if (fAnchorSelected = [EAST]) then
+                      begin
+                           x2 := fEndPoint.X;
+                           y2 := fEndPoint.Y + Abs(rSelectedCropArea.Area.Bottom - rSelectedCropArea.Area.Top) div 2;
+                      end
+                      else
+                      if (fAnchorSelected = [WEST]) then
+                      begin
+                           x2 := fEndPoint.X;
+                           y2 := fEndPoint.Y - Abs(rSelectedCropArea.Area.Bottom - rSelectedCropArea.Area.Top) div 2;
+                      end
+                      else
+                      begin
+                           x2 := fEndPoint.X;
+                           y2 := fEndPoint.Y;
+                      end;
+                 end;
+
+                 // Determine direction
+                 Direction := getDirection(fStartPoint, fEndPoint);
+
+                 // Determines limite values
+                 Bounds := getImageRect(fResampledBitmap);
+
+                 // Apply the ratio, if necessary
+                 newCoords := ApplyRatioToAxes(newCoords, Direction, Bounds, rSelectedCropArea);
+
+                 // Determines minimum value on both axes
+                 newCoords := ApplyDimRestriction(newCoords, Direction, Bounds);
+
+                 rSelectedCropArea.Area := Rect(newCoords.x1, newCoords.y1, newCoords.x2, newCoords.y2);
+              finally
+                     needRepaint := True;
+              end;
+         //end;
+      end;
+    end;
+  end
+  else
+  begin
+    // If the mouse is just moving over the control, and wasn't originally click
+    // in the control
+    if (overControl) then
+    begin
+      // Mouse is inside the pressable part of the control
+      Cursor := crCross;
+      fAnchorSelected := [];
+      fEndPoint := Point(X - WorkRect.Left, Y - WorkRect.Top);
+
+      // Verifies that is positioned on an anchor
+      overCropArea :=Self.isOverAnchor(fEndPoint, fAnchorSelected, ACursor);
+      Cursor :=ACursor;
+    end;
+  end;
+
+  // If we need to repaint
+  if needRepaint then
+  begin
+    // Invalidate the control for repainting
+    Render;
+    Refresh;
+  end;
+end;
+
+procedure TBGRAImageManipulation.MouseUp(Button: TMouseButton;
+  Shift: TShiftState; X, Y: integer);
+var
+  needRepaint: boolean;
+  temp: integer;
+begin
+  // Call the inherited MouseUp() procedure
+  inherited MouseUp(Button, Shift, X, Y);
+
+  // Assume we don't need to repaint the control
+  needRepaint := False;
+
+  // If the mouse was originally clicked over the control
+  if (fMouseCaught) then
+  begin
+    // Show that the mouse is no longer caught
+    fMouseCaught := False;
+
+    // Check what the anchor was dragged
+    if (fAnchorSelected = [NORTH, SOUTH, EAST, WEST]) then
+    begin
+      // Move the cropping area
+      try
+        OffsetRect(rSelectedCropArea.Area, fDeltaX, fDeltaY);
+        fDeltaX := 0;
+        fDeltaY := 0;
+      finally
+        needRepaint := True;
+      end;
+    end
+    else
+    begin
+      // Ends a new selection of cropping area
+      if (rNewCropArea <> Nil) then
+      begin
+        rSelectedCropArea :=rNewCropArea;
+        rNewCropArea :=Nil;
+      end;
+
+      if (rSelectedCropArea.Area.Left > rSelectedCropArea.Area.Right) then
+      begin
+        // Swap left and right coordinates
+        temp := rSelectedCropArea.Area.Left;
+        rSelectedCropArea.Area.Left := rSelectedCropArea.Area.Right;
+        rSelectedCropArea.Area.Right := temp;
+      end;
+
+      if (rSelectedCropArea.Area.Top > rSelectedCropArea.Area.Bottom) then
+      begin
+        // Swap left and right coordinates
+        temp := rSelectedCropArea.Area.Top;
+        rSelectedCropArea.Area.Top := rSelectedCropArea.Area.Bottom;
+        rSelectedCropArea.Area.Bottom := temp;
+      end;
+
+      needRepaint := True;
+    end;
+
+    fAnchorSelected := [];
+  end;
+
+  // If we need to repaint
+  if needRepaint then
+  begin
+    // Invalidate the control for repainting
+    Render;
+    Refresh;
+  end;
+end;
+
+
+ { ============================================================================ }
+ { =====[ Register Function ]================================================== }
+ { ============================================================================ }
+
+procedure Register;
+begin
+  {$I BGRAImageManipulation_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRAImageManipulation]);
+end;
+
+end.

+ 13 - 0
bgraimagemanipulation_icon.lrs

@@ -0,0 +1,13 @@
+LazarusResources.Add('tbgraimagemanipulation','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#4#3#0#0#0#18'Y '#203#0
+  +#0#0#1'sRGB'#0#174#206#28#233#0#0#0'0PLTE'#0#0#0#128#0#0#0#128#0#128#128#0#0
+  +#0#128#128#0#128#0#128#128#128#128#128#192#192#192#255#0#0#0#255#0#255#255#0
+  +#0#0#255#255#0#255#0#255#255#255#255#255'{'#31#177#196#0#0#0#9'pHYs'#0#0#11
+  +#19#0#0#11#19#1#0#154#156#24#0#0#0#7'tIME'#7#219#5#3#20'9+'#215'o'#25#132#0#0
+  +#0'vIDAT'#24#211'c(G'#2#12#5#12'p'#192#207'P`'#12#7#246#232#28#6'cc'#3'fc '#5
+  +#230'|'#248#240#129#159#159#31#194#177#223#13#6#159#193#28#3#8#135#25'*'#179
+  +'z'#247#206#217'p'#153#213#187'g'#206#132#201#236'Z'#181's'#230#204#217#16#25
+  +#6#8#7'j'#244#170'Uk'#128#202'`F'#159'9s'#18'a'#192#153'3'#167#17'F'#131'9Xe'
+  +#144#156#131#226'P'#20'/'#224#246')'#18#167#254'?'#2#0#0#166'|s|'#14#171'jB'
+  +#0#0#0#0'IEND'#174'B`'#130
+]);

+ 482 - 0
bgraknob.pas

@@ -0,0 +1,482 @@
+unit BGRAKnob;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
+  BGRAGradients, BGRABitmap, BGRABitmapTypes;
+
+type
+  TBGRAKnobPositionType = (kptLineSquareCap, kptLineRoundCap, kptFilledCircle,
+    kptHollowCircle);
+  TBGRAKnobValueChangedEvent = procedure(Sender: TObject; Value: single) of object;
+
+  { TBGRAKnob }
+
+  TBGRAKnob = class(TGraphicControl)
+  private
+    { Private declarations }
+    FPhong: TPhongShading;
+    FCurveExponent: single;
+    FKnobBmp: TBGRABitmap;
+    FKnobColor: TColor;
+    FAngularPos: single;
+    FPositionColor: TColor;
+    FPositionMargin: single;
+    FPositionOpacity: byte;
+    FPositionType: TBGRAKnobPositionType;
+    FPositionWidth: single;
+    FSettingAngularPos: boolean;
+    FUsePhongLighting: boolean;
+    FMinValue, FMaxValue: single;
+    FOnKnobValueChange: TBGRAKnobValueChangedEvent;
+    FStartFromBottom: boolean;
+    procedure CreateKnobBmp;
+    function GetLightIntensity: integer;
+    function GetValue: single;
+    procedure SetCurveExponent(const AValue: single);
+    procedure SetLightIntensity(const AValue: integer);
+    procedure SetStartFromBottom(const AValue: boolean);
+    procedure SetValue(AValue: single);
+    procedure SetMaxValue(AValue: single);
+    procedure SetMinValue(AValue: single);
+    procedure SetPositionColor(const AValue: TColor);
+    procedure SetPositionMargin(AValue: single);
+    procedure SetPositionOpacity(const AValue: byte);
+    procedure SetPositionType(const AValue: TBGRAKnobPositionType);
+    procedure SetPositionWidth(const AValue: single);
+    procedure SetUsePhongLighting(const AValue: boolean);
+    procedure UpdateAngularPos(X, Y: integer);
+    procedure SetKnobColor(const AValue: TColor);
+  protected
+    { Protected declarations }
+    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
+      X, Y: integer); override;
+    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: integer); override;
+    procedure MouseMove(Shift: TShiftState; X, Y: integer); override;
+    procedure Paint; override;
+    procedure Resize; override;
+    function ValueCorrection(var AValue: single): boolean; virtual; overload;
+    function ValueCorrection: boolean; virtual; overload;
+  public
+    { Public declarations }
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+  published
+    { Published declarations }
+    property Anchors;
+    property CurveExponent: single read FCurveExponent write SetCurveExponent;
+    property KnobColor: TColor read FKnobColor write SetKnobColor;
+    property LightIntensity: integer read GetLightIntensity write SetLightIntensity;
+    property PositionColor: TColor read FPositionColor write SetPositionColor;
+    property PositionWidth: single read FPositionWidth write SetPositionWidth;
+    property PositionOpacity: byte read FPositionOpacity write SetPositionOpacity;
+    property PositionMargin: single read FPositionMargin write SetPositionMargin;
+    property PositionType: TBGRAKnobPositionType
+      read FPositionType write SetPositionType;
+    property UsePhongLighting: boolean read FUsePhongLighting write SetUsePhongLighting;
+    property MinValue: single read FMinValue write SetMinValue;
+    property MaxValue: single read FMaxValue write SetMaxValue;
+    property Value: single read GetValue write SetValue;
+    property OnValueChanged: TBGRAKnobValueChangedEvent
+      read FOnKnobValueChange write FOnKnobValueChange;
+    property StartFromBottom: boolean read FStartFromBottom write SetStartFromBottom;
+  end;
+
+
+procedure Register;
+
+implementation
+
+uses Math;
+
+procedure Register;
+begin
+  {$I bgraknob_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRAKnob]);
+end;
+
+{ TBGRAKnob }
+
+procedure TBGRAKnob.CreateKnobBmp;
+var
+  tx, ty: integer;
+  h: single;
+  d2: single;
+  v: TPointF;
+  p: PBGRAPixel;
+  center: TPointF;
+  yb: integer;
+  xb: integer;
+  mask: TBGRABitmap;
+  Map: TBGRABitmap;
+  BGRAKnobColor: TBGRAPixel;
+begin
+  tx := ClientWidth;
+  ty := ClientHeight;
+  if (tx = 0) or (ty = 0) then
+    exit;
+
+  FreeAndNil(FKnobBmp);
+
+  FKnobBmp := TBGRABitmap.Create(tx, ty);
+  center := PointF((tx - 1) / 2, (ty - 1) / 2);
+  BGRAKnobColor := ColorToBGRA(ColorToRGB(KnobColor));
+
+  if UsePhongLighting then
+  begin
+    //compute knob height map
+    Map := TBGRABitmap.Create(tx, ty);
+    for yb := 0 to ty - 1 do
+    begin
+      p := map.ScanLine[yb];
+      for xb := 0 to tx - 1 do
+      begin
+        //compute vector between center and current pixel
+        v := PointF(xb, yb) - center;
+        //scale down to unit circle (with 1 pixel margin for soft border)
+        v.x /= tx / 2 + 1;
+        v.y /= ty / 2 + 1;
+        //compute squared distance with scalar product
+        d2 := v * v;
+        //interpolate as quadratic curve and apply power function
+        if d2 > 1 then
+          h := 0
+        else
+          h := power(1 - d2, FCurveExponent);
+        p^ := MapHeightToBGRA(h, 255);
+        Inc(p);
+      end;
+    end;
+    //antialiased border
+    mask := TBGRABitmap.Create(tx, ty, BGRABlack);
+    Mask.FillEllipseAntialias(center.x, center.y, tx / 2, ty / 2, BGRAWhite);
+    map.ApplyMask(mask);
+    Mask.Free;
+
+    FPhong.Draw(FKnobBmp, Map, 30, 0, 0, BGRAKnobColor);
+    Map.Free;
+  end
+  else
+  begin
+    FKnobBmp.FillEllipseAntialias(center.x, center.y, tx / 2, ty / 2, BGRAKnobColor);
+  end;
+
+end;
+
+function TBGRAKnob.GetLightIntensity: integer;
+begin
+  Result := round(FPhong.LightSourceIntensity);
+end;
+
+function TBGRAKnob.GetValue: single;
+begin
+  Result := FAngularPos * 180 / Pi;
+  if Result < 0 then
+    Result += 360;
+  Result := 270 - Result;
+  if Result < 0 then
+    Result += 360;
+end;
+
+procedure TBGRAKnob.SetCurveExponent(const AValue: single);
+begin
+  if FCurveExponent = AValue then
+    exit;
+  FCurveExponent := AValue;
+  FreeAndNil(FKnobBmp);
+  Invalidate;
+end;
+
+procedure TBGRAKnob.SetKnobColor(const AValue: TColor);
+begin
+  if FKnobColor = AValue then
+    exit;
+  FKnobColor := AValue;
+  FreeAndNil(FKnobBmp);
+  Invalidate;
+end;
+
+procedure TBGRAKnob.SetLightIntensity(const AValue: integer);
+begin
+  if AValue <> FPhong.LightSourceIntensity then
+  begin
+    FPhong.LightSourceIntensity := AValue;
+    FreeAndNil(FKnobBmp);
+    Invalidate;
+  end;
+end;
+
+procedure TBGRAKnob.SetStartFromBottom(const AValue: boolean);
+begin
+  if FStartFromBottom = AValue then
+    exit;
+  FStartFromBottom := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAKnob.SetValue(AValue: single);
+var
+  NewAngularPos: single;
+begin
+  ValueCorrection(AValue);
+  NewAngularPos := 3 * Pi / 2 - AValue * Pi / 180;
+  if NewAngularPos > Pi then
+    NewAngularPos -= 2 * Pi;
+  if NewAngularPos < -Pi then
+    NewAngularPos += 2 * Pi;
+  if NewAngularPos <> FAngularPos then
+  begin
+    FAngularPos := NewAngularPos;
+    Invalidate;
+  end;
+end;
+
+procedure TBGRAKnob.SetMaxValue(AValue: single);
+begin
+  if AValue < 0 then
+    AValue := 0;
+  if AValue > 360 then
+    AValue := 360;
+  if FMaxValue = AValue then
+    exit;
+  FMaxValue := AValue;
+  if FMinValue > FMaxValue then
+    FMinValue := FMaxValue;
+  if ValueCorrection then
+    Invalidate;
+end;
+
+procedure TBGRAKnob.SetMinValue(AValue: single);
+begin
+  if AValue < 0 then
+    AValue := 0;
+  if AValue > 360 then
+    AValue := 360;
+  if FMinValue = AValue then
+    exit;
+  FMinValue := AValue;
+  if FMaxValue < FMinValue then
+    FMaxValue := FMinValue;
+  if ValueCorrection then
+    Invalidate;
+end;
+
+procedure TBGRAKnob.SetPositionColor(const AValue: TColor);
+begin
+  if FPositionColor = AValue then
+    exit;
+  FPositionColor := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAKnob.SetPositionMargin(AValue: single);
+begin
+  if FPositionMargin = AValue then
+    exit;
+  FPositionMargin := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAKnob.SetPositionOpacity(const AValue: byte);
+begin
+  if FPositionOpacity = AValue then
+    exit;
+  FPositionOpacity := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAKnob.SetPositionType(const AValue: TBGRAKnobPositionType);
+begin
+  if FPositionType = AValue then
+    exit;
+  FPositionType := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAKnob.SetPositionWidth(const AValue: single);
+begin
+  if FPositionWidth = AValue then
+    exit;
+  FPositionWidth := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAKnob.SetUsePhongLighting(const AValue: boolean);
+begin
+  if FUsePhongLighting = AValue then
+    exit;
+  FUsePhongLighting := AValue;
+  FreeAndNil(FKnobBmp);
+  Invalidate;
+end;
+
+procedure TBGRAKnob.UpdateAngularPos(X, Y: integer);
+var
+  FPreviousPos, Sign: single;
+begin
+  FPreviousPos := FAngularPos;
+  if FStartFromBottom then
+    Sign := 1
+  else
+    Sign := -1;
+  FAngularPos := ArcTan2((-Sign) * (Y - ClientHeight / 2) / ClientHeight,
+    Sign * (X - ClientWidth / 2) / ClientWidth);
+  ValueCorrection;
+  Invalidate;
+  if (FPreviousPos <> FAngularPos) and Assigned(FOnKnobValueChange) then
+    FOnKnobValueChange(Self, Value);
+end;
+
+procedure TBGRAKnob.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: integer);
+begin
+  inherited MouseDown(Button, Shift, X, Y);
+  if Button = mbLeft then
+  begin
+    FSettingAngularPos := True;
+    UpdateAngularPos(X, Y);
+  end;
+end;
+
+procedure TBGRAKnob.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: integer);
+begin
+  inherited MouseUp(Button, Shift, X, Y);
+  if Button = mbLeft then
+    FSettingAngularPos := False;
+end;
+
+procedure TBGRAKnob.MouseMove(Shift: TShiftState; X, Y: integer);
+begin
+  inherited MouseMove(Shift, X, Y);
+  if FSettingAngularPos then
+    UpdateAngularPos(X, Y);
+end;
+
+procedure TBGRAKnob.Paint;
+var
+  Bmp: TBGRABitmap;
+  Center, Pos: TPointF;
+  PosColor: TBGRAPixel;
+  PosLen: single;
+begin
+  if (ClientWidth = 0) or (ClientHeight = 0) then
+    exit;
+  if FKnobBmp = nil then
+  begin
+    CreateKnobBmp;
+    if FKnobBmp = nil then
+      Exit;
+  end;
+  Bmp := TBGRABitmap.Create(ClientWidth, ClientHeight);
+  Bmp.BlendImage(0, 0, FKnobBmp, boLinearBlend);
+
+  //draw current position
+  PosColor := ColorToBGRA(ColorToRGB(FPositionColor), FPositionOpacity);
+  Center := PointF(ClientWidth / 2, ClientHeight / 2);
+  Pos.X := Cos(FAngularPos) * (ClientWidth / 2);
+  Pos.Y := -Sin(FAngularPos) * (ClientHeight / 2);
+  if not FStartFromBottom then
+    Pos := -Pos;
+  PosLen := sqrt(Pos * Pos);
+
+  Pos := Pos * ((PosLen - PositionMargin - FPositionWidth) / PosLen);
+  Pos := Center + Pos;
+
+  case PositionType of
+    kptLineSquareCap:
+    begin
+      Bmp.LineCap := pecSquare;
+      Bmp.DrawLineAntialias(Center.X, Center.Y, Pos.X, Pos.Y, PosColor, FPositionWidth);
+    end;
+    kptLineRoundCap:
+    begin
+      Bmp.LineCap := pecRound;
+      Bmp.DrawLineAntialias(Center.X, Center.Y, Pos.X, Pos.Y, PosColor, FPositionWidth);
+    end;
+    kptFilledCircle:
+    begin
+      Bmp.FillEllipseAntialias(Pos.X, Pos.Y, FPositionWidth, FPositionWidth, PosColor);
+    end;
+    kptHollowCircle:
+    begin
+      Bmp.EllipseAntialias(Pos.X, Pos.Y, FPositionWidth * 2 / 3,
+        FPositionWidth * 2 / 3, PosColor, FPositionWidth / 3);
+    end;
+  end;
+
+  Bmp.Draw(Canvas, 0, 0, False);
+  Bmp.Free;
+end;
+
+procedure TBGRAKnob.Resize;
+begin
+  inherited Resize;
+  if (FKnobBmp <> nil) and ((ClientWidth <> FKnobBmp.Width) or
+    (ClientHeight <> FKnobBmp.Height)) then
+    FreeAndNil(FKnobBmp);
+end;
+
+function TBGRAKnob.ValueCorrection(var AValue: single): boolean;
+begin
+  if AValue < MinValue then
+  begin
+    AValue := MinValue;
+    Result := True;
+  end
+  else
+  if AValue > MaxValue then
+  begin
+    AValue := MaxValue;
+    Result := True;
+  end
+  else
+    Result := False;
+end;
+
+function TBGRAKnob.ValueCorrection: boolean;
+var
+  LValue: single;
+begin
+  LValue := Value;
+  Result := ValueCorrection(LValue);
+  if Result then
+    Value := LValue;
+end;
+
+constructor TBGRAKnob.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  with GetControlClassDefaultSize do
+    SetInitialBounds(0, 0, CX, CY);
+  FPhong := TPhongShading.Create;
+  FPhong.LightPositionZ := 100;
+  FPhong.LightSourceIntensity := 300;
+  FPhong.NegativeDiffusionFactor := 0.8;
+  FPhong.AmbientFactor := 0.5;
+  FPhong.DiffusionFactor := 0.6;
+  FKnobBmp := nil;
+  FCurveExponent := 0.2;
+  FKnobColor := clBtnFace;
+  FPositionColor := clBtnText;
+  FPositionOpacity := 192;
+  FPositionWidth := 4;
+  FPositionMargin := 4;
+  FPositionType := kptLineSquareCap;
+  FUsePhongLighting := True;
+  FOnKnobValueChange := nil;
+  FStartFromBottom := True;
+  FMinValue := 30;
+  FMaxValue := 330;
+end;
+
+destructor TBGRAKnob.Destroy;
+begin
+  FPhong.Free;
+  FKnobBmp.Free;
+  inherited Destroy;
+end;
+
+end.
+

+ 66 - 0
bgraknob_icon.lrs

@@ -0,0 +1,66 @@
+LazarusResources.Add('tbgraknob','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#3#0#0#0#215#169#205
+  +#202#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0#3#0'PLTE'#0#0#0#3#3#3#10#10#10
+  +#20#20#20#25#25#25#29#29#29'$$$...///555777999;;;AAAEEEGGGHHHLLLMMMOOOPPPQQQ'
+  +'RRRSSSTTTUUUWWWZZZ[[[^^^```aaacccdddeeeggghhhkkklllmmmnnnppptttuuuwwwxxxzzz'
+  +'{{{}}}'#127#127#127#128#128#128#130#130#130#131#131#131#133#133#133#134#134
+  +#134#138#138#138#139#139#139#141#141#141#143#143#143#144#144#144#146#146#146
+  +#147#147#147#150#150#150#151#151#151#152#152#152#153#153#153#154#154#154#157
+  +#157#157#158#158#158#160#160#160#161#161#161#162#162#162#163#163#163#164#164
+  +#164#165#165#165#166#166#166#168#168#168#170#170#170#171#171#171#172#172#172
+  +#173#173#173#174#174#174#175#175#175#176#176#176#178#178#178#179#179#179#180
+  +#180#180#181#181#181#182#182#182#183#183#183#184#184#184#185#185#185#186#186
+  +#186#187#187#187#188#188#188#189#189#189#190#190#190#191#191#191#192#192#192
+  +#193#193#193#194#194#194#195#195#195#196#196#196#198#198#198#200#200#200#202
+  +#202#202#203#203#203#206#206#206#207#207#207#208#208#208#209#209#209#210#210
+  +#210#211#211#211#212#212#212#214#214#214#215#215#215#216#216#216#217#217#217
+  +#218#218#218#219#219#219#221#221#221#222#222#222#223#223#223#224#224#224#226
+  +#226#226#227#227#227#228#228#228#229#229#229#230#230#230#231#231#231#233#233
+  +#233#234#234#234#235#235#235#236#236#236#237#237#237#238#238#238#239#239#239
+  +#240#240#240#241#241#241#242#242#242#243#243#243#244#244#244#245#245#245#246
+  +#246#246#247#247#247#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#13#216'Y'#199#0#0#1#0'tRNS'#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#0'S'#247#7
+  +'%'#0#0#0#9'pHYs'#0#0#14#194#0#0#14#194#1#21'(J'#128#0#0#0#25'tEXtSoftware'#0
+  +'Paint.NET v3.5.87;'#128']'#0#0#1#247'IDAT(Sc'#248#15#7#141#149'%'#8#206#127
+  +#6'('#187#189#189#165#177#182#162'87#'#7'*'#0#145'h'#237#234#234'jo'#174#171
+  +'*'#201#203'L'#142'J'#5#11#129'%:'#187#186'{z:['#26#170'J'#243'3S'#162#131
+  +#189'`'#18#157']='#189'}'#189']'#173#141#213#165'y '#9'o'#7#136#142'V'#160'x'
+  +#127#127'oW[CUInFR'#148#167#151#3'P'#15'P'#162#171#187#183#127#194#132#222
+  +#174#150#250#202#162#236#244'x#Q'#27';S'#144'D{WO_'#255#132#190#238#246#166
+  +#154#242#130#172'DmaaS['#19#13#136'Dooow'#7'PCqN'#130#170#168#148#173#179#149
+  +#161#26'P'#162#165#189#19#228#216#150#134#234#178#252'hEq9WOG'#11'='#229#255
+  +#12#141#141#205'-'#173'm-M'#245#213'e'#133#129#178#18'j'#190'>'#174#182#166
+  +#218#242'b'#12#149#181'u'#13#141#13#245'5'#149'e'#133'n'#210#146#250#193'~'
+  +#158'N'#150#134#234#210#252#12'%'#21'UU'#213'U'#149#229#197#249'Y'#154#146
+  +#230'a'#1#222'.'#182'f:J"<'#12#255#139'KJKK'#138#10'r'#178#210'#'#157#194#131
+  +'|'#220#236'-'#12'4d'#248'8'#24#254#231#230#229#231#229'fge'#164'%'#198#132#5
+  +#249#184';Z'#25'k)'#8'sI3'#252#207#200#204#204#204'HOM'#138#139#12#9#240'qw'
+  +#178'6'#213'U'#145#226'e'#3':7''9%%)!6*,'#216#207#219#205#209#218'LOMF'#128
+  +#157#9#20'$Q'#209#209'Q'#17#161#193#254'>'#158'.'#246'V'#166'z'#234#178#130
+  +#156#204#252' '#137#212#224#224#160#0'?'#31'OW''['#11'c]5Y!n'#22'FH|xy{y'#184
+  +'9;'#218'Z'#154#25'h'#169#200#8'r'#179#130#4#193#17#229#224'`gkeaj'#168#163
+  +#161' %'#192#201#194' '#1#147#248#239'ejb'#168#167#173#174'$#'#204#203#206#12
+  +'4'#7'.'#241#255#191#134#154#178#188#180#8#31#23#27#19'?$5'#192'R'#9#144')'
+  +#198#207#195'!'#13'O@'#0#182#212#24#10'6)'#250#216#0#0#0#0'IEND'#174'B`'#130
+]);

+ 394 - 0
bgrashape.pas

@@ -0,0 +1,394 @@
+unit BGRAShape;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
+  BGRABitmap, BGRABitmapTypes, BCTypes;
+
+type
+  TBGRAShapeType = (stRegularPolygon, stEllipse);
+
+  { TBGRAShape }
+
+  TBGRAShape = class(TGraphicControl)
+  private
+    { Private declarations }
+    FBorderColor: TColor;
+    FBorderOpacity: byte;
+    FBorderStyle: TPenStyle;
+    FBorderWidth: integer;
+    FBorderGradient: TBCGradient;
+    FUseBorderGradient: boolean;
+    FFillColor:  TColor;
+    FFillOpacity: byte;
+    FFillGradient: TBCGradient;
+    FUseFillGradient: boolean;
+    FRoundRadius: integer;
+    FBGRA:       TBGRABitmap;
+    FSideCount:  integer;
+    FRatioXY:    single;
+    FUseRatioXY: boolean;
+    FAngle:      single;
+    FShapeType:  TBGRAShapeType;
+    procedure SetAngle(const AValue: single);
+    procedure SetBorderColor(const AValue: TColor);
+    procedure SetBorderGradient(const AValue: TBCGradient);
+    procedure SetBorderOpacity(const AValue: byte);
+    procedure SetBorderStyle(const AValue: TPenStyle);
+    procedure SetBorderWidth(AValue: integer);
+    procedure SetFillColor(const AValue: TColor);
+    procedure SetFillGradient(const AValue: TBCGradient);
+    procedure SetFillOpacity(const AValue: byte);
+    procedure SetRatioXY(const AValue: single);
+    procedure SetRoundRadius(AValue: integer);
+    procedure SetShapeType(const AValue: TBGRAShapeType);
+    procedure SetSideCount(AValue: integer);
+    procedure SetUseBorderGradient(const AValue: boolean);
+    procedure SetUseFillGradient(const AValue: boolean);
+    procedure SetUseRatioXY(const AValue: boolean);
+  protected
+    { Protected declarations }
+    procedure Paint; override;
+    procedure Resize; override;
+  public
+    { Public declarations }
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+  published
+    { Published declarations }
+    property AutoSize;
+    property Align;
+    property Anchors;
+    property Angle: single Read FAngle Write SetAngle default 0;
+    property BorderWidth: integer Read FBorderWidth Write SetBorderWidth default 1;
+    property BorderOpacity: byte Read FBorderOpacity Write SetBorderOpacity default 255;
+    property BorderColor: TColor Read FBorderColor Write SetBorderColor;
+    property BorderGradient: TBCGradient Read FBorderGradient Write SetBorderGradient;
+    property BorderStyle: TPenStyle
+      Read FBorderStyle Write SetBorderStyle default psSolid;
+    property FillColor: TColor Read FFillColor Write SetFillColor;
+    property FillOpacity: byte Read FFillOpacity Write SetFillOpacity;
+    property FillGradient: TBCGradient Read FFillGradient Write SetFillGradient;
+    property SideCount: integer Read FSideCount Write SetSideCount default 4;
+    property RatioXY: single Read FRatioXY Write SetRatioXY default 1;
+    property UseRatioXY: boolean Read FUseRatioXY Write SetUseRatioXY default False;
+    property UseFillGradient: boolean Read FUseFillGradient
+      Write SetUseFillGradient default False;
+    property UseBorderGradient: boolean Read FUseBorderGradient
+      Write SetUseBorderGradient default False;
+    property ShapeType: TBGRAShapeType
+      Read FShapeType Write SetShapeType default stRegularPolygon;
+    property BorderSpacing;
+    property Caption;
+    property PopupMenu;
+    property RoundRadius: integer Read FRoundRadius Write SetRoundRadius default 0;
+    property Visible;
+
+    property OnClick;
+    property OnDblClick;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+  end;
+
+procedure Register;
+
+implementation
+
+uses BCTools;
+
+procedure Register;
+begin
+  {$I bgrashape_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRAShape]);
+end;
+
+{ TBGRAShape }
+
+procedure TBGRAShape.SetBorderColor(const AValue: TColor);
+begin
+  if FBorderColor = AValue then
+    exit;
+  FBorderColor := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetBorderGradient(const AValue: TBCGradient);
+begin
+  if FBorderGradient = AValue then
+    exit;
+  FBorderGradient.Assign(AValue);
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetAngle(const AValue: single);
+begin
+  if FAngle = AValue then
+    exit;
+  FAngle := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetBorderOpacity(const AValue: byte);
+begin
+  if FBorderOpacity = AValue then
+    exit;
+  FBorderOpacity := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetBorderStyle(const AValue: TPenStyle);
+begin
+  if FBorderStyle = AValue then
+    exit;
+  FBorderStyle := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetBorderWidth(AValue: integer);
+begin
+  if AValue < 0 then
+    AValue := 0;
+  if FBorderWidth = AValue then
+    exit;
+  FBorderWidth := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetFillColor(const AValue: TColor);
+begin
+  if FFillColor = AValue then
+    exit;
+  FFillColor := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetFillGradient(const AValue: TBCGradient);
+begin
+  if FFillGradient = AValue then
+    exit;
+  FFillGradient.Assign(AValue);
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetFillOpacity(const AValue: byte);
+begin
+  if FFillOpacity = AValue then
+    exit;
+  FFillOpacity := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetRatioXY(const AValue: single);
+begin
+  if FRatioXY = AValue then
+    exit;
+  FRatioXY := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetRoundRadius(AValue: integer);
+begin
+  if AValue < 0 then
+    AValue := 0;
+  if FRoundRadius = AValue then
+    exit;
+  FRoundRadius := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetShapeType(const AValue: TBGRAShapeType);
+begin
+  if FShapeType = AValue then
+    exit;
+  FShapeType := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetSideCount(AValue: integer);
+begin
+  if AValue < 3 then
+    AValue := 3;
+  if FSideCount = AValue then
+    exit;
+  FSideCount := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetUseBorderGradient(const AValue: boolean);
+begin
+  if FUseBorderGradient = AValue then
+    exit;
+  FUseBorderGradient := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetUseFillGradient(const AValue: boolean);
+begin
+  if FUseFillGradient = AValue then
+    exit;
+  FUseFillGradient := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.SetUseRatioXY(const AValue: boolean);
+begin
+  if FUseRatioXY = AValue then
+    exit;
+  FUseRatioXY := AValue;
+  Invalidate;
+end;
+
+procedure TBGRAShape.Paint;
+var
+  cx, cy, rx, ry, curRatio, a: single;
+  coords: array of TPointF;
+  minCoord, maxCoord: TPointF;
+  i: integer;
+  borderGrad, fillGrad: TBGRACustomScanner;
+begin
+  FBGRA.FillTransparent;
+  FBGRA.PenStyle := FBorderStyle;
+  with FBGRA.Canvas2D do
+  begin
+    lineJoin := 'round';
+    if FUseBorderGradient then
+    begin
+      borderGrad := CreateGradient(FBorderGradient, Classes.rect(0, 0, Width, Height));
+      strokeStyle(borderGrad);
+    end
+    else
+    begin
+      borderGrad := nil;
+      strokeStyle(ColorToBGRA(ColorToRGB(FBorderColor), FBorderOpacity));
+    end;
+    lineStyle(FBGRA.CustomPenStyle);
+    lineWidth := FBorderWidth;
+    if FUseFillGradient then
+    begin
+      fillGrad := CreateGradient(FFillGradient, Classes.rect(0, 0, Width, Height));
+      fillStyle(fillGrad);
+    end
+    else
+    begin
+      fillGrad := nil;
+      fillStyle(ColorToBGRA(ColorToRGB(FFillColor), FFillOpacity));
+    end;
+    cx := Width / 2;
+    cy := Height / 2;
+    rx := (Width - FBorderWidth) / 2;
+    ry := (Height - FBorderWidth) / 2;
+    if FUseRatioXY and (ry <> 0) and (FRatioXY <> 0) then
+    begin
+      curRatio := rx / ry;
+      if FRatioXY > curRatio then
+        ry := ry / (FRatioXY / curRatio)
+      else
+        rx := rx / (curRatio / FRatioXY);
+    end;
+    if FShapeType = stRegularPolygon then
+    begin
+      setlength(coords, FSideCount);
+      for i := 0 to high(coords) do
+      begin
+        a := (i / FSideCount + FAngle / 360) * 2 * Pi;
+        coords[i] := PointF(sin(a), -cos(a));
+      end;
+      minCoord := coords[0];
+      maxCoord := coords[0];
+      for i := 1 to high(coords) do
+      begin
+        if coords[i].x < minCoord.x then
+          minCoord.x := coords[i].x;
+        if coords[i].y < minCoord.y then
+          minCoord.y := coords[i].y;
+        if coords[i].x > maxCoord.x then
+          maxCoord.x := coords[i].x;
+        if coords[i].y > maxCoord.y then
+          maxCoord.y := coords[i].y;
+      end;
+      for i := 0 to high(coords) do
+      begin
+        with (coords[i] - minCoord) do
+          coords[i] := PointF((x / (maxCoord.x - minCoord.x) - 0.5) *
+            2 * rx + cx, (y / (maxCoord.y - minCoord.y) - 0.5) * 2 * ry + cy);
+      end;
+      beginPath;
+      for i := 0 to high(coords) do
+      begin
+        lineTo((coords[i] + coords[(i + 1) mod length(coords)]) * (1 / 2));
+        arcTo(coords[(i + 1) mod length(coords)], coords[(i + 2) mod
+          length(coords)], FRoundRadius);
+      end;
+      closePath;
+    end
+    else
+    begin
+      save;
+      translate(cx, cy);
+      scale(rx, ry);
+      beginPath;
+      arc(0, 0, 1, 0, 2 * Pi);
+      restore;
+    end;
+
+    fill;
+    if FBorderWidth <> 0 then
+      stroke;
+
+    fillStyle(BGRAWhite);
+    strokeStyle(BGRABlack);
+
+    fillGrad.Free;
+    borderGrad.Free;
+  end;
+  FBGRA.Draw(Self.Canvas, 0, 0, False);
+end;
+
+procedure TBGRAShape.Resize;
+begin
+  if FBGRA <> nil then
+    FBGRA.SetSize(Width, Height);
+  inherited Resize;
+end;
+
+constructor TBGRAShape.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  with GetControlClassDefaultSize do
+    SetInitialBounds(0, 0, CX, CY);
+  FBGRA := TBGRABitmap.Create(Width, Height, BGRAPixelTransparent);
+
+  FBorderColor := clWindowText;
+  FBorderOpacity := 255;
+  FBorderWidth := 1;
+  FBorderStyle := psSolid;
+  FBorderGradient := TBCGradient.Create(Self);
+  FBorderGradient.Point2XPercent := 100;
+  FBorderGradient.StartColor := clWhite;
+  FBorderGradient.EndColor := clBlack;
+
+  FFillColor := clWindow;
+  FFillOpacity := 255;
+  FFillGradient := TBCGradient.Create(Self);
+
+  FRoundRadius := 0;
+  FSideCount := 4;
+  FRatioXY := 1;
+  FUseRatioXY := False;
+end;
+
+destructor TBGRAShape.Destroy;
+begin
+  FBGRA.Free;
+  FFillGradient.Free;
+  FBorderGradient.Free;
+  inherited Destroy;
+end;
+
+end.

+ 47 - 0
bgrashape_icon.lrs

@@ -0,0 +1,47 @@
+LazarusResources.Add('TBGRAShape','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#3#0#0#0#215#169#205
+  +#202#0#0#0#1'sRGB'#0#174#206#28#233#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0
+  +#3#0'PLTE'#0#0#0'vv'#146'{{'#150'r'#155#223#255'ZZ'#255#255#128#197#197#207#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#20#23'['#234#0#0#1#0'tRNS'
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#0'S'#247#7'%'#0#0#0#9'pHYs'#0#0#14#195#0#0
+  +#14#195#1#199'o'#168'd'#0#0#0#25'tEXtSoftware'#0'Paint.NET v3.5.87;'#128']'#0
+  +#0#0#140'IDAT(S}'#145'K'#22#128' '#12#3#169'b'#239#127'cM'#128#150#136#159
+  +#236#204#188#169#5#202#249#145'"'#189#187'|'#8'p3!'#2#236'8l*'#19'8'#193'T&@'
+  +#175'J'#2#10#170'$h'#189'('#1#186' J'#7#216't'#128'\'#140#0#245#190#7#137#197
+  +#0#28'5'#19#195'`ck'#128#209#7#177'Z+HI'#129#211'Z'#0#170#1#164#0#194#174#229
+  +#23#196#191'9'#234'f'#200#207#23#144#235#250#2#226#128'~'#174#128'g'#220#248
+  +#18'O0'#30'.g'#181#3'jx'#153'L'#191#146#247'\,m'#22#228#229#177'La'#0#0#0#0
+  +'IEND'#174'B`'#130
+]);

+ 126 - 0
bgraspeedbutton.pas

@@ -0,0 +1,126 @@
+{ This component partialy solve problem with no alpha in lazarus GTK.
+  It is using BGRABitmap library for drawing icons.
+
+  Copyright (C) 2011 Krzysztof Dibowski dibowski at interia.pl
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version with the following modification:
+
+  As a special exception, the copyright holders of this library give you
+  permission to link this library with independent modules to produce an
+  executable, regardless of the license terms of these independent modules,and
+  to copy and distribute the resulting executable under terms of your choice,
+  provided that you also meet, for each linked independent module, the terms
+  and conditions of the license of that module. An independent module is a
+  module which is not derived from or based on this library. If you modify
+  this library, you may extend this exception to your version of the library,
+  but you are not obligated to do so. If you do not wish to do so, delete this
+  exception statement from your version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+}
+unit BGRASpeedButton;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons, BGRABitmap,
+  BGRABitmapTypes;
+
+{$IFDEF LCLgtk}
+  {$DEFINE BGRA_DRAW}
+{$ELSE}
+  {$IFDEF LCLgtk2}
+    {$DEFINE BGRA_DRAW}
+  {$ENDIF}
+{$ENDIF}
+
+type
+
+  { TBGRASpeedButton }
+
+  TBGRASpeedButton = class(TSpeedButton)
+  private
+    { Private declarations }
+    {$IFDEF BGRA_DRAW}
+    FBGRA: TBGRABitmap;
+    {$ENDIF}
+  protected
+    { Protected declarations }
+    {$IFDEF BGRA_DRAW}
+    function DrawGlyph(ACanvas: TCanvas; const AClient: TRect;
+      const AOffset: TPoint; AState: TButtonState; ATransparent: boolean;
+      BiDiFlags: longint): TRect; override;
+    {$ENDIF}
+  public
+    { Public declarations }
+    {$IFDEF BGRA_DRAW}
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+    {$ENDIF}
+  published
+    { Published declarations }
+  end;
+
+procedure Register;
+
+implementation
+
+procedure Register;
+begin
+  {$I bgraspeedbutton_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRASpeedButton]);
+end;
+
+{$IFDEF BGRA_DRAW}
+{ TBGRASpeedButton }
+
+function TBGRASpeedButton.DrawGlyph(ACanvas: TCanvas; const AClient: TRect;
+  const AOffset: TPoint; AState: TButtonState; ATransparent: boolean;
+  BiDiFlags: longint): TRect;
+begin
+  {*** We are using BGRABitmap drawing only ***}
+  {Result := inherited DrawGlyph(ACanvas, AClient, AOffset, AState,
+    ATransparent, BiDiFlags); }
+
+  if Glyph = nil then
+    Exit;
+  { It's not good solution assigning glyph on each draw call but FGlyph and SetGlyph is
+    in private section }
+  FBGRA.Assign(Glyph);
+
+  if Assigned(Glyph) then
+  begin
+    if (AState = bsDown) or (Down = True) then
+      FBGRA.Draw(ACanvas, AOffset.x + 1, AOffset.y + 1, False)
+    else
+      FBGRA.Draw(ACanvas, AOffset.x, AOffset.y, False);
+  end;
+end;
+
+constructor TBGRASpeedButton.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  FBGRA := TBGRABitmap.Create;
+end;
+
+destructor TBGRASpeedButton.Destroy;
+begin
+  FBGRA.Free;
+  inherited Destroy;
+end;
+
+{$ENDIF}
+
+end.

+ 28 - 0
bgraspeedbutton_icon.lrs

@@ -0,0 +1,28 @@
+LazarusResources.Add('tbgraspeedbutton','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#2'-IDATx^'#237#149'=hTM'#20#134#159#153'{'#215'$nD'#227'J'#20#133#128'd'
+  +#17';'#5#225#195#31#180#176#17#177#177#177#19#18#196#15#180#178#19#27'k-'#181
+  +#144#4'+Q'#180#208#198'VA'#172'l'#190#214#15#12'h'#240#15#196' A%'#174'{'#127
+  +#230#156'#'#187#23#214#187#235'^$'#136']'#30#24#238'a.'#188#239#249#153'a'
+  +#156#153#241'7'#241#252#134'5'#131#152#1#174#222#188'o'#255#191'Z'#194#199#17
+  +#134'1'#136#138#0#6'8'#202'x'#31#17#197#158'3'#199#247'q'#228#224'?n'#168#193
+  +#133'+wll'#203#20'{'#14#236'"'#201#192'y'#183#170'V'#4'Q'#238'>]`'#251'd'#195
+  +#154#205'i7h'#192#194#231#26#215'g'#15#179'u'#194'#'#2#174#208#239#198'E'#150
+  +#197#158'j'#17#151#17#133#177#17#184'4'#247#133#197#15'_i6'#135'T'#208#206
+  +#140#141#163#129#137'Q'#143#170#225#157'CU'#241#209':Vn'#140#224'O'#158#3'@'
+  +#31#206#179#225'|'#171#175'K"B'#20#199#136'*'#184#138#25#168'*'#153#128#168
+  +''''#13#138#195#3#158'0'#223'/'#14#176'2W'#255')'#242'o'#27#240#140#152''''
+  +#136#226#156#27'n'#144#139#161#157#149'C'#200#192'{'#195'n'#173#239#137#3#165
+  +#184'0s'#179#223#145#220#16'QFk'#158#160#134#195#134#27#136#24'j'#16#196#8
+  +#193#168#221#171#247'e'#13#244'U"'#167'['#16#140#2#215#155#15'U'#21#168#26
+  +#170'J'#146'&$'#169#146#157'Z'#166'L'#253'A'#163''''#222#234#252'K'#19#202
+  +#152#214#187#26'TU'#160#6#170#144'g'#129','#13#12'R'#167#7'I;e'#16#149'q'#10
+  +#253#138#10#130#24#162'F'#150'f$'#169#16#149#238#193#182'GS'#157#246't'#179
+  +#255'x'#236#29#228#129'A'#130'('#162'V=d'#17'-'#22#197#12#212#25'%'#186#226
+  +#239#143#190#129'\'#25#134#10'HP\'#213'15'#239#137#227#136#172#149#144#21#21
+  +'`fL?'#219#13#192#226#161#5'\'#150'b'#214#205#178#248'z'#15'fdy'#142#209#192
+  +#197'1'#170#21'3'#216'Tks'#251#241'k&'#199'w '#165#243#252'd'#243#18']^P'#137
+  +#153#242#223#219#140#229'O'#203'4&vR'#0#131#15#14#251#207'^'#179#231'/'#191
+  +#129#247#172#6#7'8g\'#158#217#203#197#153#19#142#2#214'^'#180'5'#131'?'#231#7
+  +#215'q'''#132#216'e'#202#159#0#0#0#0'IEND'#174'B`'#130
+]);

+ 594 - 0
bgraspriteanimation.pas

@@ -0,0 +1,594 @@
+unit BGRASpriteAnimation;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, Controls, Dialogs, ExtCtrls, Forms, Graphics, LCLIntF, LResources,
+  BGRABitmap, BGRABitmapTypes, BCTypes, BGRAAnimatedGif;
+
+type
+
+  TFlipMode     = (flNone, flHorizontal, flVertical, flBoth);
+  TRotationMode = (rtNone, rtClockWise, rtCounterClockWise);
+
+  { TBGRASpriteAnimation }
+
+  TBGRASpriteAnimation = class(TGraphicControl)
+  private
+    { Private declarations }
+    FAnimInvert:     boolean;
+    FAnimPosition:   cardinal;
+    FAnimRepeat:     cardinal;
+    FAnimRepeatLap:  cardinal;
+    FAnimSpeed:      cardinal;
+    FAnimStatic:     boolean;
+    FAnimTimer:      TTimer;
+    FAutoSize:       boolean;
+    FCenter:         boolean;
+    FOnLapChanged:   TNotifyEvent;
+    FOnLapChanging:  TNotifyEvent;
+    FOnPositionChanged: TNotifyEvent;
+    FOnPositionChanging: TNotifyEvent;
+    FOnRedrawAfter:  TBGRARedrawEvent;
+    FOnRedrawBefore: TBGRARedrawEvent;
+    FProportional:   boolean;
+    FSprite:         TBitmap;
+    FSpriteCount:    cardinal;
+    FSpriteFillOpacity: byte;
+    FSpriteFlipMode: TFlipMode;
+    FSpriteKeyColor: TColor;
+    FSpriteResampleFilter: TResampleFilter;
+    FSpriteResampleMode: TResampleMode;
+    FSpriteRotation: TRotationMode;
+    FStretch:        boolean;
+    FTile:           boolean;
+    function DoCalculateDestRect(AWidth, AHeight: integer): TRect;
+    function DoCalculatePosition(AValue: integer): integer;
+    function DoCalculateSize(AValue: cardinal): cardinal;
+    procedure DoAnimTimerOnTimer(Sender: TObject);
+    procedure DoSpriteDraw(ABitmap: TBGRABitmap);
+    procedure DoSpriteFillOpacity(ABitmap: TBGRABitmap);
+    procedure DoSpriteFlip(ABitmap: TBGRABitmap);
+    procedure DoSpriteKeyColor(ABitmap: TBGRABitmap);
+    procedure DoSpriteResampleFilter(ABitmap: TBGRABitmap);
+    procedure SetFAnimInvert(const AValue: boolean);
+    procedure SetFAnimPosition(const AValue: cardinal);
+    procedure SetFAnimRepeat(const AValue: cardinal);
+    procedure SetFAnimRepeatLap(const AValue: cardinal);
+    procedure SetFAnimSpeed(const AValue: cardinal);
+    procedure SetFAnimStatic(const AValue: boolean);
+    procedure SetFAutoSize(const AValue: boolean);
+    procedure SetFCenter(const AValue: boolean);
+    procedure SetFProportional(const AValue: boolean);
+    procedure SetFSprite(const AValue: TBitmap);
+    procedure SetFSpriteCount(const AValue: cardinal);
+    procedure SetFSpriteFillOpacity(const AValue: byte);
+    procedure SetFSpriteFlipMode(const AValue: TFlipMode);
+    procedure SetFSpriteKeyColor(const AValue: TColor);
+    procedure SetFSpriteResampleFilter(const AValue: TResampleFilter);
+    procedure SetFSpriteResampleMode(const AValue: TResampleMode);
+    procedure SetFSpriteRotation(const AValue: TRotationMode);
+    procedure SetFStretch(const AValue: boolean);
+    procedure SetFTile(const AValue: boolean);
+  protected
+    { Protected declarations }
+    procedure Paint; override;
+  public
+    { Public declarations }
+    function AnimatedGifToSprite(Filename: string): TBGRABitmap;
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
+  published
+    { Published declarations }
+    property AnimInvert: boolean Read FAnimInvert Write SetFAnimInvert;
+    property AnimPosition: cardinal Read FAnimPosition Write SetFAnimPosition;
+    property AnimRepeat: cardinal Read FAnimRepeat Write SetFAnimRepeat;
+    property AnimRepeatLap: cardinal Read FAnimRepeatLap Write SetFAnimRepeatLap;
+    property AnimSpeed: cardinal Read FAnimSpeed Write SetFAnimSpeed;
+    property AnimStatic: boolean Read FAnimStatic Write SetFAnimStatic;
+    property AutoSize: boolean Read FAutoSize Write SetFAutoSize; // to be implemented
+    property Center: boolean Read FCenter Write SetFCenter;
+    property Proportional: boolean Read FProportional Write SetFProportional;
+    property Sprite: TBitmap Read FSprite Write SetFSprite;
+    property SpriteCount: cardinal Read FSpriteCount Write SetFSpriteCount;
+    property SpriteFillOpacity: byte Read FSpriteFillOpacity Write SetFSpriteFillOpacity;
+    property SpriteFlipMode: TFlipMode Read FSpriteFlipMode Write SetFSpriteFlipMode;
+    property SpriteKeyColor: TColor Read FSpriteKeyColor Write SetFSpriteKeyColor;
+    property SpriteResampleFilter: TResampleFilter
+      Read FSpriteResampleFilter Write SetFSpriteResampleFilter;
+    property SpriteResampleMode: TResampleMode
+      Read FSpriteResampleMode Write SetFSpriteResampleMode;
+    property SpriteRotation: TRotationMode Read FSpriteRotation Write SetFSpriteRotation;
+    property Stretch: boolean Read FStretch Write SetFStretch;
+    property Tile: boolean Read FTile Write SetFTile;
+  published
+    property Align;
+    property Anchors;
+    property Caption;
+    property Enabled;
+    property OnClick;
+    property OnDblClick;
+    property OnLapChanged: TNotifyEvent Read FOnLapChanged Write FOnLapChanged;
+    property OnLapChanging: TNotifyEvent Read FOnLapChanging Write FOnLapChanging;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    property OnPositionChanged: TNotifyEvent
+      Read FOnPositionChanged Write FOnPositionChanged;
+    property OnPositionChanging: TNotifyEvent
+      Read FOnPositionChanging Write FOnPositionChanging;
+    property OnRedrawAfter: TBGRARedrawEvent Read FOnRedrawAfter Write FOnRedrawAfter;
+    property OnRedrawBefore: TBGRARedrawEvent Read FOnRedrawBefore Write FOnRedrawBefore;
+    property PopupMenu;
+    property Visible;
+  end;
+
+procedure Register;
+
+implementation
+
+procedure Register;
+begin
+  {$I bgraspriteanimation_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRASpriteAnimation]);
+end;
+
+{ TBGRASpriteAnimation }
+
+{ Animation Variables }
+
+procedure TBGRASpriteAnimation.SetFAnimInvert(const AValue: boolean);
+begin
+  if FAnimInvert = AValue then
+    Exit;
+  FAnimInvert := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFAnimPosition(const AValue: cardinal);
+begin
+  if FAnimPosition = AValue then
+    Exit;
+  if (AValue < 1) or (AValue > FSpriteCount) then
+    FAnimPosition := 1
+  else
+    FAnimPosition := AValue;
+
+  if Assigned(FOnPositionChanged) then
+    FOnPositionChanged(Self);
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFAnimRepeat(const AValue: cardinal);
+begin
+  if FAnimRepeat = AValue then
+    Exit;
+  FAnimRepeat := AValue;
+end;
+
+procedure TBGRASpriteAnimation.SetFAnimRepeatLap(const AValue: cardinal);
+begin
+  if (FAnimRepeatLap = AValue) then
+    Exit;
+  FAnimRepeatLap := AValue;
+
+  if (AValue = FAnimRepeat) and (AValue <> 0) then
+  begin
+    if csDesigning in ComponentState then
+      Exit;
+    SetFAnimStatic(True);
+  end;
+
+  if Assigned(FOnLapChanged) then
+    FOnLapChanged(Self);
+end;
+
+procedure TBGRASpriteAnimation.SetFAnimSpeed(const AValue: cardinal);
+begin
+  if FAnimSpeed = AValue then
+    Exit;
+  FAnimSpeed := AValue;
+  FAnimTimer.Interval := AValue;
+end;
+
+procedure TBGRASpriteAnimation.SetFAnimStatic(const AValue: boolean);
+begin
+  if FAnimStatic = AValue then
+    Exit;
+  FAnimStatic := AValue;
+
+  if csDesigning in ComponentState then
+    Exit;
+  FAnimTimer.Enabled := not AValue;
+end;
+
+{ Sprite Variables }
+
+procedure TBGRASpriteAnimation.SetFSprite(const AValue: TBitmap);
+begin
+  if (FSprite = AValue) or (AValue = nil) then
+    Exit;
+
+  FSprite := AValue;
+
+  Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFSpriteCount(const AValue: cardinal);
+begin
+  if (FSpriteCount = AValue) or (FSprite = nil) then
+    Exit;
+
+  if (AValue < 1) or (AValue > cardinal(FSprite.Width)) then
+    FSpriteCount := 1
+  else
+    FSpriteCount := AValue;
+
+  if AnimPosition > AValue then
+    SetFAnimPosition(1);
+
+  Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFSpriteFillOpacity(const AValue: byte);
+begin
+  if FSpriteFillOpacity = AValue then
+    Exit;
+  FSpriteFillOpacity := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFSpriteFlipMode(const AValue: TFlipMode);
+begin
+  if FSpriteFlipMode = AValue then
+    Exit;
+  FSpriteFlipMode := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFSpriteKeyColor(const AValue: TColor);
+begin
+  if FSpriteKeyColor = AValue then
+    Exit;
+  FSpriteKeyColor := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFSpriteResampleFilter(const AValue: TResampleFilter);
+begin
+  if FSpriteResampleFilter = AValue then
+    Exit;
+  FSpriteResampleFilter := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFSpriteResampleMode(const AValue: TResampleMode);
+begin
+  if FSpriteResampleMode = AValue then
+    Exit;
+  FSpriteResampleMode := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFSpriteRotation(const AValue: TRotationMode);
+begin
+  if FSpriteRotation = AValue then
+    Exit;
+  FSpriteRotation := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+{ General Variables }
+
+procedure TBGRASPriteAnimation.SetFAutoSize(const AValue: boolean);
+begin
+  if FAutoSize = AValue then
+    Exit;
+  FAutoSize := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFCenter(const AValue: boolean);
+begin
+  if FCenter = AValue then
+    Exit;
+  FCenter := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFProportional(const AValue: boolean);
+begin
+  if FProportional = AValue then
+    Exit;
+  FProportional := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFStretch(const AValue: boolean);
+begin
+  if FStretch = AValue then
+    Exit;
+  FStretch := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+procedure TBGRASpriteAnimation.SetFTile(const AValue: boolean);
+begin
+  if FTile = AValue then
+    Exit;
+  FTile := AValue;
+
+  if csDesigning in ComponentState then
+    Invalidate;
+end;
+
+{ Utils }
+
+function TBGRASpriteAnimation.DoCalculateDestRect(AWidth, AHeight: integer): TRect;
+var
+  PicWidth: integer;
+  PicHeight: integer;
+  ImgWidth: integer;
+  ImgHeight: integer;
+  w: integer;
+  h: integer;
+begin
+  PicWidth  := AWidth;
+  PicHeight := AHeight;
+  ImgWidth  := ClientWidth;
+  ImgHeight := ClientHeight;
+  if Stretch or (Proportional and ((PicWidth > ImgWidth) or
+    (PicHeight > ImgHeight))) then
+  begin
+    if Proportional and (PicWidth > 0) and (PicHeight > 0) then
+    begin
+      w := ImgWidth;
+      h := (PicHeight * w) div PicWidth;
+      if h > ImgHeight then
+      begin
+        h := ImgHeight;
+        w := (PicWidth * h) div PicHeight;
+      end;
+      PicWidth  := w;
+      PicHeight := h;
+    end
+    else
+    begin
+      PicWidth  := ImgWidth;
+      PicHeight := ImgHeight;
+    end;
+  end;
+
+  Result := Rect(0, 0, PicWidth, PicHeight);
+
+  if Center then
+    OffsetRect(Result, (ImgWidth - PicWidth) div 2, (ImgHeight - PicHeight) div 2);
+end;
+
+function TBGRASpriteAnimation.DoCalculatePosition(AValue: integer): integer;
+begin
+  if FAnimInvert then
+    Result := -AValue * (FSpriteCount - FAnimPosition)
+  else
+    Result := -AValue * (FAnimPosition - 1);
+end;
+
+function TBGRASpriteAnimation.DoCalculateSize(AValue: cardinal): cardinal;
+begin
+  Result := trunc(AValue div FSpriteCount);
+end;
+
+procedure TBGRASpriteAnimation.DoSpriteResampleFilter(ABitmap: TBGRABitmap);
+begin
+  ABitmap.ResampleFilter := FSpriteResampleFilter;
+end;
+
+procedure TBGRASpriteAnimation.DoSpriteFillOpacity(ABitmap: TBGRABitmap);
+begin
+  if FSpriteFillOpacity <> 255 then
+    ABitmap.ApplyGlobalOpacity(FSpriteFillOpacity);
+end;
+
+procedure TBGRASpriteAnimation.DoSpriteFlip(ABitmap: TBGRABitmap);
+begin
+  case FSpriteFlipMode of
+    flNone: Exit;
+    flHorizontal: ABitmap.HorizontalFlip;
+    flVertical: ABitmap.VerticalFlip;
+    flBoth:
+    begin
+      ABitmap.HorizontalFlip;
+      ABitmap.VerticalFlip;
+    end;
+  end;
+end;
+
+procedure TBGRASpriteAnimation.DoSpriteKeyColor(ABitmap: TBGRABitmap);
+begin
+  if FSpriteKeyColor <> clNone then
+    ABitmap.ReplaceColor(ColorToBGRA(ColorToRGB(FSpriteKeyColor), 255),
+      BGRAPixelTransparent);
+end;
+
+{ Main }
+
+procedure TBGRASpriteAnimation.Paint;
+
+  procedure DrawFrame;
+  begin
+    with inherited Canvas do
+    begin
+      Pen.Color := clBlack;
+      Pen.Style := psDash;
+      MoveTo(0, 0);
+      LineTo(Self.Width - 1, 0);
+      LineTo(Self.Width - 1, Self.Height - 1);
+      LineTo(0, Self.Height - 1);
+      LineTo(0, 0);
+    end;
+  end;
+
+var
+  TempSprite, TempSpriteBGRA: TBGRABitmap;
+  TempSpriteWidth, TempSpriteHeight, TempSpritePosition: integer;
+begin
+  if csDesigning in ComponentState then
+    DrawFrame;
+
+  if FSprite = nil then
+    Exit;
+
+  if (Width > 0) and (Height > 0) then
+  begin
+    TempSpriteWidth  := DoCalculateSize(FSprite.Width);
+    TempSpriteHeight := FSprite.Height;
+    TempSpritePosition := DoCalculatePosition(TempSpriteWidth);
+
+    TempSpriteBGRA := TBGRABitmap.Create(FSprite);
+    TempSprite := TBGRABitmap.Create(TempSpriteWidth, TempSpriteHeight);
+    TempSprite.BlendImage(TempSpritePosition, 0, TempSpriteBGRA, boLinearBlend);
+    TempSpriteBGRA.Free;
+
+    if Assigned(FOnRedrawBefore) then
+      FOnRedrawBefore(Self, TempSprite);
+
+    DoSpriteDraw(TempSprite);
+  end;
+end;
+
+function TBGRASpriteAnimation.AnimatedGifToSprite(Filename: string): TBGRABitmap;
+var
+  TempGif: TBGRAAnimatedGif;
+  TempBitmap: TBGRABitmap;
+  n: integer;
+begin
+  TempGif := TBGRAAnimatedGif.Create(Filename);
+  TempBitmap := TBGRABitmap.Create(TempGif.Width * TempGif.Count, TempGif.Height);
+
+  for n := 0 to TempGif.Count do
+  begin
+    TempGif.CurrentImage := n;
+    TempBitmap.BlendImage(TempGif.Width * n, 0, TempGif.MemBitmap, boLinearBlend);
+  end;
+  TempGif.Free;
+
+  Result := TempBitmap;
+end;
+
+procedure TBGRASpriteAnimation.DoSpriteDraw(ABitmap: TBGRABitmap);
+var
+  TempRect: TRect;
+begin
+  DoSpriteResampleFilter(ABitmap);
+  DoSpriteKeyColor(ABitmap);
+  DoSpriteFillOpacity(ABitmap);
+  DoSpriteFlip(ABitmap);
+
+  case FSpriteRotation of
+    rtClockWise: BGRAReplace(ABitmap, ABitmap.RotateCW);
+    rtCounterClockWise: BGRAReplace(ABitmap, ABitmap.RotateCCW);
+  end;
+
+  { TODO -oLainz : If there is no Sprite loaded and you set 'Tile' to true a division by cero error is shown }
+  if Tile then
+    BGRAReplace(ABitmap, ABitmap.GetPart(rect(0, 0, Width, Height)));
+
+  TempRect := DoCalculateDestRect(ABitmap.Width, ABitmap.Height);
+
+  if Assigned(FOnRedrawAfter) then
+    FOnRedrawAfter(Self, ABitmap);
+
+  if Stretch and (FSpriteResampleMode = rmFineResample) then
+    BGRAReplace(ABitmap, ABitmap.Resample(Width, Height, FSpriteResampleMode));
+
+  ABitmap.Draw(Canvas, TempRect, False);
+  ABitmap.Free;
+end;
+
+procedure TBGRASpriteAnimation.DoAnimTimerOnTimer(Sender: TObject);
+begin
+  Invalidate;
+
+  if Assigned(FOnPositionChanging) then
+    FOnPositionChanging(Self);
+  SetFAnimPosition(FAnimPosition + 1);
+
+  if FAnimPosition = FSpriteCount then
+  begin
+    if Assigned(FOnLapChanging) then
+      FOnLapChanging(Self);
+    SetFAnimRepeatLap(FAnimRepeatLap + 1);
+  end;
+end;
+
+{ Create / Destroy }
+
+constructor TBGRASpriteAnimation.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  with GetControlClassDefaultSize do
+    SetInitialBounds(0, 0, CX, CY);
+  FAnimInvert := False;
+  FAnimPosition := 1;
+  FAnimRepeat := 0;
+  FAnimRepeatLap := 0;
+  FAnimSpeed := 1000;
+  FAnimStatic := False;
+  FAnimTimer := TTimer.Create(Self);
+  FAnimTimer.Interval := FAnimSpeed;
+  FAnimTimer.OnTimer := @DoAnimTimerOnTimer;
+  FAutoSize := False;
+  FCenter := True;
+  FProportional := True;
+  FStretch := True;
+  FSprite := TBitmap.Create;
+  FSpriteCount := 1;
+  FSpriteFillOpacity := 255;
+  FSpriteFlipMode := flNone;
+  FSpriteKeyColor := clNone;
+  FSpriteResampleFilter := rfLinear;
+  FSpriteResampleMode := rmSimpleStretch;
+  FSpriteRotation := rtNone;
+  FTile := False;
+
+  if csDesigning in ComponentState then
+    FAnimTimer.Enabled := False;
+end;
+
+destructor TBGRASpriteAnimation.Destroy;
+begin
+  FAnimTimer.OnTimer := nil;
+  FAnimTimer.Free;
+  FSprite.Free;
+  inherited Destroy;
+end;
+
+end.

+ 13 - 0
bgraspriteanimation_icon.lrs

@@ -0,0 +1,13 @@
+LazarusResources.Add('tbgraspriteanimation','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+  +#0#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#0#191'IDATx'#218'b'
+  +#252#255#255'?'#131'Ox'#230'3'#6'2'#192#150#149#211#165#24'@'#6'x'#135'e<'
+  +#131#209'/'#223'~'#250#143#15'#'#171#5#209',0'#211#144']'#241#254#253#7#172
+  +'6'#10#10#10'`'#168'eBq'#14#20#252#253#247#15'+'#198#166#22#195#5' g'#253#249
+  +#243#23#171#11'@rD'#185#224#207#223#191'X1Q.'#0#1'iIq'#188#161#143#172#150#5
+  +#217'T'#144'DrV'#249'sb'#162#15'f'#8#134#11#230'L'#237#144#196#167'9%'#187
+  +#226'9'#254'0'#0#6#212#221#251#15#177'b'#6'h '#18#12#131#191#127#255#18#29#6
+  +'Xc'#225#215#175'?X1'#209#233#224#247#239'?D'#167#3#22'l!k'#160#171'At,0R'
+  +#154#27#25'a'#206'"'#23#0#4#24#0#224'<'#226#132#211#237'"U'#0#0#0#0'IEND'#174
+  +'B`'#130
+]);

+ 295 - 0
bgravirtualscreen.pas

@@ -0,0 +1,295 @@
+unit BGRAVirtualScreen;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
+  ExtCtrls, LMessages, BGRABitmap, BCTypes;
+
+type
+  { TCustomBGRAVirtualScreen }
+
+  TCustomBGRAVirtualScreen = class(TCustomPanel)
+  private
+    { Private declarations }
+    FBGRA:        TBGRABitmap;
+    FOnRedraw:    TBGRARedrawEvent;
+    FBevelInner, FBevelOuter: TPanelBevel;
+    FBevelWidth:  TBevelWidth;
+    FBorderWidth: TBorderWidth;
+    FAlignment:   TAlignment;
+    procedure SetAlignment(const Value: TAlignment);
+    procedure SetBevelInner(const AValue: TPanelBevel);
+    procedure SetBevelOuter(const AValue: TPanelBevel);
+    procedure SetBevelWidth(const AValue: TBevelWidth);
+    procedure SetBorderWidth(const AValue: TBorderWidth);
+  protected
+    { Protected declarations }
+    procedure Paint; override;
+    procedure Resize; override;
+    procedure BGRASetSize(AWidth, AHeight: integer);
+    procedure RedrawBitmapContent; virtual;
+    procedure SetColor(Value: TColor); override;
+    procedure WMEraseBkgnd(var Message: TLMEraseBkgnd); message LM_ERASEBKGND;
+    procedure SetEnabled(Value: boolean); override;
+  public
+    { Public declarations }
+    constructor Create(TheOwner: TComponent); override;
+    procedure RedrawBitmap;
+    procedure DiscardBitmap;
+    destructor Destroy; override;
+  public
+    property OnRedraw: TBGRARedrawEvent Read FOnRedraw Write FOnRedraw;
+    property Bitmap: TBGRABitmap Read FBGRA;
+    property BorderWidth: TBorderWidth Read FBorderWidth Write SetBorderWidth default 0;
+    property BevelInner: TPanelBevel Read FBevelInner Write SetBevelInner default bvNone;
+    property BevelOuter: TPanelBevel Read FBevelOuter Write SetBevelOuter default bvNone;
+    property BevelWidth: TBevelWidth Read FBevelWidth Write SetBevelWidth default 1;
+    property Alignment: TAlignment Read FAlignment Write SetAlignment;
+  end;
+
+  TBGRAVirtualScreen = class(TCustomBGRAVirtualScreen)
+  published
+    property OnRedraw;
+    property Bitmap;
+    // TPanel
+    property Align;
+    property Alignment;
+    property Anchors;
+    property AutoSize;
+    property BorderSpacing;
+    property BevelInner;
+    property BevelOuter;
+    property BevelWidth;
+    property BidiMode;
+    property BorderWidth;
+    property BorderStyle;
+    property Caption;
+    property ChildSizing;
+    property ClientHeight;
+    property ClientWidth;
+    property Color;
+    property Constraints;
+    property DockSite;
+    property DragCursor;
+    property DragKind;
+    property DragMode;
+    property Enabled;
+    property Font;
+    property FullRepaint;
+    property ParentBidiMode;
+    property ParentColor;
+    property ParentFont;
+    property ParentShowHint;
+    property PopupMenu;
+    property ShowHint;
+    property TabOrder;
+    property TabStop;
+    property UseDockManager default True;
+    property Visible;
+    property OnClick;
+    property OnContextPopup;
+    property OnDockDrop;
+    property OnDockOver;
+    property OnDblClick;
+    property OnDragDrop;
+    property OnDragOver;
+    property OnEndDock;
+    property OnEndDrag;
+    property OnEnter;
+    property OnExit;
+    property OnGetSiteInfo;
+    property OnGetDockCaption;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    property OnResize;
+    property OnStartDock;
+    property OnStartDrag;
+    property OnUnDock;
+  end;
+
+procedure Register;
+
+implementation
+
+uses BGRABitmapTypes, Types;
+
+procedure Register;
+begin
+  {$I bgravirtualscreen_icon.lrs}
+  RegisterComponents('BGRA Controls', [TBGRAVirtualScreen]);
+end;
+
+{ TCustomBGRAVirtualScreen }
+
+procedure TCustomBGRAVirtualScreen.SetAlignment(const Value: TAlignment);
+begin
+  if FAlignment = Value then
+    exit;
+  FAlignment := Value;
+  DiscardBitmap;
+end;
+
+procedure TCustomBGRAVirtualScreen.SetBevelInner(const AValue: TPanelBevel);
+begin
+  if FBevelInner = AValue then
+    exit;
+  FBevelInner := AValue;
+  DiscardBitmap;
+end;
+
+procedure TCustomBGRAVirtualScreen.SetBevelOuter(const AValue: TPanelBevel);
+begin
+  if FBevelOuter = AValue then
+    exit;
+  FBevelOuter := AValue;
+  DiscardBitmap;
+end;
+
+procedure TCustomBGRAVirtualScreen.SetBevelWidth(const AValue: TBevelWidth);
+begin
+  if FBevelWidth = AValue then
+    exit;
+  FBevelWidth := AValue;
+  DiscardBitmap;
+end;
+
+procedure TCustomBGRAVirtualScreen.SetBorderWidth(const AValue: TBorderWidth);
+begin
+  if FBorderWidth = AValue then
+    exit;
+  FBorderWidth := AValue;
+  DiscardBitmap;
+end;
+
+procedure TCustomBGRAVirtualScreen.Paint;
+begin
+  {$IFDEF WINDOWS}
+  // to avoid flickering in Windows running without themes (classic style)
+  DoubleBuffered := ControlCount <> 0;
+  {$ENDIF}
+  BGRASetSize(Width, Height);
+  FBGRA.Draw(Canvas, 0, 0);
+end;
+
+procedure TCustomBGRAVirtualScreen.Resize;
+begin
+  inherited Resize;
+  DiscardBitmap;
+end;
+
+procedure TCustomBGRAVirtualScreen.BGRASetSize(AWidth, AHeight: integer);
+begin
+  if (FBGRA <> nil) and (AWidth <> FBGRA.Width) and (AHeight <> FBGRA.Height) then
+  begin
+    FBGRA.SetSize(AWidth, AHeight);
+    RedrawBitmapContent;
+  end;
+end;
+
+procedure TCustomBGRAVirtualScreen.RedrawBitmapContent;
+var
+  ARect: TRect;
+  TS: TTextStyle;
+begin
+  if (FBGRA <> nil) and (FBGRA.NbPixels <> 0) then
+  begin
+    FBGRA.Fill(ColorToRGB(Color));
+
+    ARect := GetClientRect;
+
+    // if BevelOuter is set then draw a frame with BevelWidth
+    if (BevelOuter <> bvNone) and (BevelWidth > 0) then
+      FBGRA.CanvasBGRA.Frame3d(ARect, BevelWidth, BevelOuter,
+        BGRA(255, 255, 255, 200), BGRA(0, 0, 0, 160)); // Note: Frame3D inflates ARect
+
+    InflateRect(ARect, -BorderWidth, -BorderWidth);
+
+    // if BevelInner is set then skip the BorderWidth and draw a frame with BevelWidth
+    if (BevelInner <> bvNone) and (BevelWidth > 0) then
+      FBGRA.CanvasBGRA.Frame3d(ARect, BevelWidth, BevelInner,
+        BGRA(255, 255, 255, 160), BGRA(0, 0, 0, 160)); // Note: Frame3D inflates ARect
+
+    if Caption <> '' then
+    begin
+      FBGRA.CanvasBGRA.Font.Assign(Canvas.Font);
+      TS := Canvas.TextStyle;
+      TS.Alignment := Alignment;
+      TS.Layout := tlTop;
+      TS.Opaque := False;
+      TS.Clipping := False;
+      TS.SystemFont := Canvas.Font.IsDefault;
+
+      FBGRA.CanvasBGRA.Font.Color := Color xor $FFFFFF;
+
+      if not Enabled then
+        FBGRA.CanvasBGRA.Font.Style := [fsStrikeOut]
+      else
+        FBGRA.CanvasBGRA.Font.Style := [];
+
+      FBGRA.CanvasBGRA.TextRect(ARect, ARect.Left, ARect.Top, Caption, TS);
+    end;
+
+    if Assigned(FOnRedraw) then
+      FOnRedraw(self, FBGRA);
+  end;
+end;
+
+procedure TCustomBGRAVirtualScreen.SetColor(Value: TColor);
+begin
+  if Value <> Color then
+    DiscardBitmap;
+  inherited SetColor(Value);
+end;
+
+{$hints off}
+procedure TCustomBGRAVirtualScreen.WMEraseBkgnd(var Message: TLMEraseBkgnd);
+begin
+  //do nothing
+end;
+
+{$hints on}
+
+procedure TCustomBGRAVirtualScreen.SetEnabled(Value: boolean);
+begin
+  if Value <> Enabled then
+    DiscardBitmap;
+  inherited SetEnabled(Value);
+end;
+
+constructor TCustomBGRAVirtualScreen.Create(TheOwner: TComponent);
+begin
+  inherited Create(TheOwner);
+  FBGRA := TBGRABitmap.Create;
+  FBevelWidth := 1;
+  FAlignment := taLeftJustify;
+  Color := clWhite;
+end;
+
+procedure TCustomBGRAVirtualScreen.RedrawBitmap;
+begin
+  RedrawBitmapContent;
+  Repaint;
+end;
+
+procedure TCustomBGRAVirtualScreen.DiscardBitmap;
+begin
+  if (FBGRA <> nil) and (FBGRA.NbPixels <> 0) then
+  begin
+    FBGRA.SetSize(0, 0);
+    Invalidate;
+  end;
+end;
+
+destructor TCustomBGRAVirtualScreen.Destroy;
+begin
+  FBGRA.Free;
+  inherited Destroy;
+end;
+
+end.

+ 47 - 0
bgravirtualscreen_icon.lrs

@@ -0,0 +1,47 @@
+LazarusResources.Add('TBGRAVirtualScreen','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#3#0#0#0#215#169#205
+  +#202#0#0#0#1'sRGB'#0#174#206#28#233#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0
+  +#3#0'PLTE'#0#0#0'7k'#190'vv'#146#128#128#128#150#181#231#192#192#192#194#192
+  +#193#223#223#219#255#255#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+  +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#179#142
+  +#179#217#0#0#1#0'tRNS'#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+  +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#0'S'#247#7'%'#0#0#0
+  +#9'pHYs'#0#0#14#195#0#0#14#195#1#199'o'#168'd'#0#0#0#25'tEXtSoftware'#0'Pain'
+  +'t.NET v3.5.87;'#128']'#0#0#0#145'IDAT(S}'#146#1#14#133' '#12'C;`'#204#251'_'
+  +#216#223'150'#244'WM'#180#175#133'd'#130#243'C'#248#3#202'.'#166#217'(GR+'
+  +#253#2#246#168#241#173#245#13#136#208'n'#182#1'i'#188'Dr'#3#244#220#150#212
+  +#128#24#200'xo'#128#27#152#195#21#140#133#140#15#236#5#132#191#0#212#216#186
+  +'&'#0#173#131#12#127'j'#248#167#163#240'g'#160#170#142#194'O@'#237#246#151
+  +#165#152#214'+?5`'#10#234#25#241'=D'#28#204#247'Y1v'#20#250#233''''#6#168')'
+  +#239#221#1#240'z >O'#201#15#143#1#178'Ms O)'#0#0#0#0'IEND'#174'B`'#130
+]);

+ 48 - 0
readme.txt

@@ -0,0 +1,48 @@
+BGRAControls v3.0.0.0 alpha
+
+Site: https://sourceforge.net/p/bgra-controls/
+Wiki: http://wiki.lazarus.freepascal.org/BGRAControls
+Forum: http://forum.lazarus.freepascal.org/index.php/board,46.0.html
+
+== Overview ==
+
+License: Modified LGPL.
+
+As many people know, Lazarus GTK doesn't have full alpha support. I created a set of components which use TBGRABitmap for drawing icons, so it partially solves the problem with alpha in GTK. But this components set is not only a GTK patch but has more fancy components which are using the power of the BGRABitmap package.
+
+== Author: Dibo.== 
+Package founder and package mantainer.
+
+BC Controls
+- TBCButton
+- TBCLabel
+- TBCPanel
+
+BGRA Controls
+- TBGRAImageList
+- TBGRASpeedButton
+
+== Author: Circular.== 
+BGRABitmap creator, contributor and package mantainer.
+
+- TBGRAFlashProgressBar
+- TBGRAGraphicControl
+- TBGRAKnob
+- TBGRAShape
+- TBGRAVirtualScreen
+
+== Author: Lainz.== 
+Contributor and package mantainer.
+
+BC Controls
+- TBCImageButton
+- TBCGameGrid
+
+BGRA Controls
+- TBGRASpriteAnimation
+
+== Author: Emerson Cavalcanti.== 
+- TBGRAImageManipulation
+
+== Author: mora ==
+- Contributor to BCButton functionality.

+ 193 - 0
styles/facebook-dark.bcbtn

@@ -0,0 +1,193 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrowSize = 8
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+StateClicked.Background.Color = 16777215
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 13137169
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 15722194
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 35
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 15722194
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 13137169
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsColor
+StateClicked.Border.Color = 0
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 16777215
+StateClicked.Border.LightOpacity = 255
+StateClicked.Border.LightWidth = 0
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 8405546
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = fsBold
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 10577739
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 13137169
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 15722194
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 35
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 15722194
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 13137169
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsColor
+StateHover.Border.Color = 10577739
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 255
+StateHover.Border.LightWidth = 0
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 8405546
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = fsBold
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 9984315
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 13137169
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 15722194
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 35
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 15722194
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 13137169
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsColor
+StateNormal.Border.Color = 9984315
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 255
+StateNormal.Border.LightWidth = 0
+StateNormal.Border.Style = bboSolid
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 8405546
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = fsBold
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 193 - 0
styles/facebook.bcbtn

@@ -0,0 +1,193 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrowSize = 8
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+StateClicked.Background.Color = 16777215
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 13137169
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 15722194
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 35
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 15722194
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 13137169
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsColor
+StateClicked.Border.Color = 0
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 16777215
+StateClicked.Border.LightOpacity = 255
+StateClicked.Border.LightWidth = 0
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 0
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = fsBold
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 12027501
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 13137169
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 15722194
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 35
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 15722194
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 13137169
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsColor
+StateHover.Border.Color = 12027501
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 255
+StateHover.Border.LightWidth = 0
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 16777215
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = fsBold
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 11369058
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 13137169
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 15722194
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 35
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 15722194
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 13137169
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsColor
+StateNormal.Border.Color = 11369058
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 255
+StateNormal.Border.LightWidth = 0
+StateNormal.Border.Style = bboSolid
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 16777215
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = fsBold
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 107 - 0
styles/facebook.bcpnl

@@ -0,0 +1,107 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCPanel
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+Background.Color = 9984315
+Background.ColorOpacity = 255
+Background.Gradient1.ColorCorrection = 1
+Background.Gradient1.DrawMode = dmSet
+Background.Gradient1.EndColor = 13137169
+Background.Gradient1.EndColorOpacity = 255
+Background.Gradient1.GradientType = gtLinear
+Background.Gradient1.Point1XPercent = 0
+Background.Gradient1.Point1YPercent = 0
+Background.Gradient1.Point2XPercent = 0
+Background.Gradient1.Point2YPercent = 100
+Background.Gradient1.Sinus = 0
+Background.Gradient1.StartColor = 15722194
+Background.Gradient1.StartColorOpacity = 255
+Background.Gradient1EndPercent = 35
+Background.Gradient2.ColorCorrection = 1
+Background.Gradient2.DrawMode = dmSet
+Background.Gradient2.EndColor = 13137169
+Background.Gradient2.EndColorOpacity = 255
+Background.Gradient2.GradientType = gtLinear
+Background.Gradient2.Point1XPercent = 0
+Background.Gradient2.Point1YPercent = 0
+Background.Gradient2.Point2XPercent = 0
+Background.Gradient2.Point2YPercent = 100
+Background.Gradient2.Sinus = 0
+Background.Gradient2.StartColor = 15722194
+Background.Gradient2.StartColorOpacity = 255
+Background.Style = bbsColor
+BevelInner = bvNone
+BevelOuter = bvNone
+BevelWidth = 1
+Border.Color = 0
+Border.ColorOpacity = 255
+Border.LightColor = 16777215
+Border.LightOpacity = 255
+Border.LightWidth = 0
+Border.Style = bboNone
+Border.Width = 1
+BorderBCStyle = bpsBorder
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ChildSizing.ControlsPerLine = 0
+ChildSizing.EnlargeHorizontal = crsAnchorAligning
+ChildSizing.EnlargeVertical = crsAnchorAligning
+ChildSizing.HorizontalSpacing = 0
+ChildSizing.Layout = cclNone
+ChildSizing.LeftRightSpacing = 0
+ChildSizing.ShrinkHorizontal = crsAnchorAligning
+ChildSizing.ShrinkVertical = crsAnchorAligning
+ChildSizing.TopBottomSpacing = 0
+ChildSizing.VerticalSpacing = 0
+Constraints.MaxHeight = 0
+Constraints.MaxWidth = 0
+Constraints.MinHeight = 0
+Constraints.MinWidth = 0
+Cursor = 0
+DockSite = 0
+DragCursor = -12
+DragKind = dkDrag
+DragMode = dmManual
+Enabled = 1
+FontEx.Color = 536870912
+FontEx.EndEllipsis = 0
+FontEx.Height = 0
+FontEx.Name = default
+FontEx.Shadow = 0
+FontEx.ShadowColor = 0
+FontEx.ShadowColorOpacity = 255
+FontEx.ShadowOffsetX = 5
+FontEx.ShadowOffsetY = 5
+FontEx.ShadowRadius = 5
+FontEx.SingleLine = 1
+FontEx.Style = 
+FontEx.TextAlignment = bcaCenter
+FontEx.WordBreak = 0
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+ShowHint = 0
+TabOrder = 0
+TabStop = 0
+Tag = 0
+UseDockManager = 1
+Visible = 1

+ 107 - 0
styles/flashsetup-grey.bcpnl

@@ -0,0 +1,107 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCPanel
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+Background.Color = 5000268
+Background.ColorOpacity = 255
+Background.Gradient1.ColorCorrection = 1
+Background.Gradient1.DrawMode = dmSet
+Background.Gradient1.EndColor = 13137169
+Background.Gradient1.EndColorOpacity = 255
+Background.Gradient1.GradientType = gtLinear
+Background.Gradient1.Point1XPercent = 0
+Background.Gradient1.Point1YPercent = 0
+Background.Gradient1.Point2XPercent = 0
+Background.Gradient1.Point2YPercent = 100
+Background.Gradient1.Sinus = 0
+Background.Gradient1.StartColor = 15722194
+Background.Gradient1.StartColorOpacity = 255
+Background.Gradient1EndPercent = 35
+Background.Gradient2.ColorCorrection = 1
+Background.Gradient2.DrawMode = dmSet
+Background.Gradient2.EndColor = 13137169
+Background.Gradient2.EndColorOpacity = 255
+Background.Gradient2.GradientType = gtLinear
+Background.Gradient2.Point1XPercent = 0
+Background.Gradient2.Point1YPercent = 0
+Background.Gradient2.Point2XPercent = 0
+Background.Gradient2.Point2YPercent = 100
+Background.Gradient2.Sinus = 0
+Background.Gradient2.StartColor = 15722194
+Background.Gradient2.StartColorOpacity = 255
+Background.Style = bbsColor
+BevelInner = bvNone
+BevelOuter = bvNone
+BevelWidth = 1
+Border.Color = 0
+Border.ColorOpacity = 255
+Border.LightColor = 16777215
+Border.LightOpacity = 255
+Border.LightWidth = 0
+Border.Style = bboNone
+Border.Width = 1
+BorderBCStyle = bpsFrame3d
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ChildSizing.ControlsPerLine = 0
+ChildSizing.EnlargeHorizontal = crsAnchorAligning
+ChildSizing.EnlargeVertical = crsAnchorAligning
+ChildSizing.HorizontalSpacing = 0
+ChildSizing.Layout = cclNone
+ChildSizing.LeftRightSpacing = 0
+ChildSizing.ShrinkHorizontal = crsAnchorAligning
+ChildSizing.ShrinkVertical = crsAnchorAligning
+ChildSizing.TopBottomSpacing = 0
+ChildSizing.VerticalSpacing = 0
+Constraints.MaxHeight = 0
+Constraints.MaxWidth = 0
+Constraints.MinHeight = 0
+Constraints.MinWidth = 0
+Cursor = 0
+DockSite = 0
+DragCursor = -12
+DragKind = dkDrag
+DragMode = dmManual
+Enabled = 1
+FontEx.Color = 536870912
+FontEx.EndEllipsis = 0
+FontEx.Height = 0
+FontEx.Name = default
+FontEx.Shadow = 0
+FontEx.ShadowColor = 0
+FontEx.ShadowColorOpacity = 255
+FontEx.ShadowOffsetX = 5
+FontEx.ShadowOffsetY = 5
+FontEx.ShadowRadius = 5
+FontEx.SingleLine = 1
+FontEx.Style = 
+FontEx.TextAlignment = bcaCenter
+FontEx.WordBreak = 0
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+ShowHint = 0
+TabOrder = 0
+TabStop = 0
+Tag = 0
+UseDockManager = 1
+Visible = 1

+ 107 - 0
styles/flashsetup-red.bcpnl

@@ -0,0 +1,107 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCPanel
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+Background.Color = -2147483633
+Background.ColorOpacity = 255
+Background.Gradient1.ColorCorrection = 1
+Background.Gradient1.DrawMode = dmSet
+Background.Gradient1.EndColor = 1311598
+Background.Gradient1.EndColorOpacity = 255
+Background.Gradient1.GradientType = gtLinear
+Background.Gradient1.Point1XPercent = 0
+Background.Gradient1.Point1YPercent = 0
+Background.Gradient1.Point2XPercent = 0
+Background.Gradient1.Point2YPercent = 100
+Background.Gradient1.Sinus = 0
+Background.Gradient1.StartColor = 1512395
+Background.Gradient1.StartColorOpacity = 255
+Background.Gradient1EndPercent = 100
+Background.Gradient2.ColorCorrection = 1
+Background.Gradient2.DrawMode = dmSet
+Background.Gradient2.EndColor = 13137169
+Background.Gradient2.EndColorOpacity = 255
+Background.Gradient2.GradientType = gtLinear
+Background.Gradient2.Point1XPercent = 0
+Background.Gradient2.Point1YPercent = 0
+Background.Gradient2.Point2XPercent = 0
+Background.Gradient2.Point2YPercent = 100
+Background.Gradient2.Sinus = 0
+Background.Gradient2.StartColor = 15722194
+Background.Gradient2.StartColorOpacity = 255
+Background.Style = bbsGradient
+BevelInner = bvNone
+BevelOuter = bvNone
+BevelWidth = 1
+Border.Color = 0
+Border.ColorOpacity = 255
+Border.LightColor = 16777215
+Border.LightOpacity = 255
+Border.LightWidth = 0
+Border.Style = bboNone
+Border.Width = 1
+BorderBCStyle = bpsFrame3d
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ChildSizing.ControlsPerLine = 0
+ChildSizing.EnlargeHorizontal = crsAnchorAligning
+ChildSizing.EnlargeVertical = crsAnchorAligning
+ChildSizing.HorizontalSpacing = 0
+ChildSizing.Layout = cclNone
+ChildSizing.LeftRightSpacing = 0
+ChildSizing.ShrinkHorizontal = crsAnchorAligning
+ChildSizing.ShrinkVertical = crsAnchorAligning
+ChildSizing.TopBottomSpacing = 0
+ChildSizing.VerticalSpacing = 0
+Constraints.MaxHeight = 0
+Constraints.MaxWidth = 0
+Constraints.MinHeight = 0
+Constraints.MinWidth = 0
+Cursor = 0
+DockSite = 0
+DragCursor = -12
+DragKind = dkDrag
+DragMode = dmManual
+Enabled = 1
+FontEx.Color = 536870912
+FontEx.EndEllipsis = 0
+FontEx.Height = 0
+FontEx.Name = default
+FontEx.Shadow = 0
+FontEx.ShadowColor = 0
+FontEx.ShadowColorOpacity = 255
+FontEx.ShadowOffsetX = 5
+FontEx.ShadowOffsetY = 5
+FontEx.ShadowRadius = 5
+FontEx.SingleLine = 1
+FontEx.Style = 
+FontEx.TextAlignment = bcaCenter
+FontEx.WordBreak = 0
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+ShowHint = 0
+TabOrder = 0
+TabStop = 0
+Tag = 0
+UseDockManager = 1
+Visible = 1

+ 203 - 0
styles/flashsetup.bcbtn

@@ -0,0 +1,203 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ClickOffset = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrow = 0
+DropDownArrowSize = 8
+DropDownPosition = bdpLeft
+DropDownStyle = bdsSeparate
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ImageIndex = -1
+ParentColor = 0
+Rounding.RoundOptions = rrTopLeftSquare,rrTopRightSquare,rrBottomRightSquare,rrBottomLeftSquare
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+RoundingDropDown.RoundOptions = rrTopLeftSquare,rrTopRightSquare,rrBottomRightSquare,rrBottomLeftSquare
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+ShowCaption = 1
+ShowHint = 0
+StateClicked.Background.Color = 0
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 6052956
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 6052956
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 35
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 4079166
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 5987163
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsGradient
+StateClicked.Border.Color = 1579032
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 0
+StateClicked.Border.LightOpacity = 100
+StateClicked.Border.LightWidth = 1
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 16777215
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.FontQuality = fqSystemClearType
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 1
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 1
+StateClicked.FontEx.ShadowOffsetY = 1
+StateClicked.FontEx.ShadowRadius = 2
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = 
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 7763574
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 7763574
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 35
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 5329233
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 7697781
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 1579032
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 100
+StateHover.Border.LightWidth = 1
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 16777215
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.FontQuality = fqSystemClearType
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 1
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 1
+StateHover.FontEx.ShadowOffsetY = 1
+StateHover.FontEx.ShadowRadius = 2
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = 
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 6842472
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 6842472
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 35
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 4671303
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 6776679
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsGradient
+StateNormal.Border.Color = 1579032
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 100
+StateNormal.Border.LightWidth = 1
+StateNormal.Border.Style = bboSolid
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 16777215
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.FontQuality = fqSystemClearType
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 1
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 1
+StateNormal.FontEx.ShadowOffsetY = 1
+StateNormal.FontEx.ShadowRadius = 2
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = 
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 193 - 0
styles/google-menu.bcbtn

@@ -0,0 +1,193 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrowSize = 8
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+StateClicked.Background.Color = 0
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 15918559
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 16313059
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 100
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 15722194
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 13137169
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsGradient
+StateClicked.Border.Color = 11235643
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 16777215
+StateClicked.Border.LightOpacity = 255
+StateClicked.Border.LightWidth = 0
+StateClicked.Border.Style = bboNone
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 13395507
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = 
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 15918559
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 16313059
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 100
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 15722194
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 13137169
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 255
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 255
+StateHover.Border.LightWidth = 0
+StateHover.Border.Style = bboNone
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 13395507
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = 
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 13137169
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 15722194
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 35
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 15722194
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 13137169
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsClear
+StateNormal.Border.Color = 11235643
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 255
+StateNormal.Border.LightWidth = 0
+StateNormal.Border.Style = bboNone
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 13395507
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = 
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 193 - 0
styles/google-search.bcbtn

@@ -0,0 +1,193 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrowSize = 8
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+StateClicked.Background.Color = 13421772
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 13137169
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 15722194
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 35
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 15722194
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 13137169
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsColor
+StateClicked.Border.Color = 13421772
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 16777215
+StateClicked.Border.LightOpacity = 255
+StateClicked.Border.LightWidth = 0
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 0
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = 
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 14671839
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 15856113
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 100
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 15722194
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 13137169
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 13487565
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 255
+StateHover.Border.LightWidth = 0
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 0
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = 
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 14671839
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 15856113
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 100
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 15722194
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 13137169
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsGradient
+StateNormal.Border.Color = 13487565
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 255
+StateNormal.Border.LightWidth = 0
+StateNormal.Border.Style = bboSolid
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 0
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = 
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 107 - 0
styles/google.bcpnl

@@ -0,0 +1,107 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCPanel
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+Background.Color = -2147483633
+Background.ColorOpacity = 255
+Background.Gradient1.ColorCorrection = 1
+Background.Gradient1.DrawMode = dmSet
+Background.Gradient1.EndColor = 16119285
+Background.Gradient1.EndColorOpacity = 255
+Background.Gradient1.GradientType = gtLinear
+Background.Gradient1.Point1XPercent = 0
+Background.Gradient1.Point1YPercent = 0
+Background.Gradient1.Point2XPercent = 0
+Background.Gradient1.Point2YPercent = 100
+Background.Gradient1.Sinus = 0
+Background.Gradient1.StartColor = 16777215
+Background.Gradient1.StartColorOpacity = 255
+Background.Gradient1EndPercent = 100
+Background.Gradient2.ColorCorrection = 1
+Background.Gradient2.DrawMode = dmSet
+Background.Gradient2.EndColor = 13137169
+Background.Gradient2.EndColorOpacity = 255
+Background.Gradient2.GradientType = gtLinear
+Background.Gradient2.Point1XPercent = 0
+Background.Gradient2.Point1YPercent = 0
+Background.Gradient2.Point2XPercent = 0
+Background.Gradient2.Point2YPercent = 100
+Background.Gradient2.Sinus = 0
+Background.Gradient2.StartColor = 15722194
+Background.Gradient2.StartColorOpacity = 255
+Background.Style = bbsGradient
+BevelInner = bvNone
+BevelOuter = bvNone
+BevelWidth = 1
+Border.Color = 0
+Border.ColorOpacity = 255
+Border.LightColor = 16777215
+Border.LightOpacity = 255
+Border.LightWidth = 0
+Border.Style = bboNone
+Border.Width = 1
+BorderBCStyle = bpsBorder
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ChildSizing.ControlsPerLine = 0
+ChildSizing.EnlargeHorizontal = crsAnchorAligning
+ChildSizing.EnlargeVertical = crsAnchorAligning
+ChildSizing.HorizontalSpacing = 0
+ChildSizing.Layout = cclNone
+ChildSizing.LeftRightSpacing = 0
+ChildSizing.ShrinkHorizontal = crsAnchorAligning
+ChildSizing.ShrinkVertical = crsAnchorAligning
+ChildSizing.TopBottomSpacing = 0
+ChildSizing.VerticalSpacing = 0
+Constraints.MaxHeight = 0
+Constraints.MaxWidth = 0
+Constraints.MinHeight = 0
+Constraints.MinWidth = 0
+Cursor = 0
+DockSite = 0
+DragCursor = -12
+DragKind = dkDrag
+DragMode = dmManual
+Enabled = 1
+FontEx.Color = 536870912
+FontEx.EndEllipsis = 0
+FontEx.Height = 0
+FontEx.Name = default
+FontEx.Shadow = 0
+FontEx.ShadowColor = 0
+FontEx.ShadowColorOpacity = 255
+FontEx.ShadowOffsetX = 5
+FontEx.ShadowOffsetY = 5
+FontEx.ShadowRadius = 5
+FontEx.SingleLine = 1
+FontEx.Style = 
+FontEx.TextAlignment = bcaCenter
+FontEx.WordBreak = 0
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+ShowHint = 0
+TabOrder = 0
+TabStop = 0
+Tag = 0
+UseDockManager = 1
+Visible = 1

+ 193 - 0
styles/lainz.bcbtn

@@ -0,0 +1,193 @@
+[HEADER]
+Author=Lainz
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrowSize = 8
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 12
+Rounding.RoundY = 12
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+StateClicked.Background.Color = 0
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 4194304
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtRadial
+StateClicked.Background.Gradient1.Point1XPercent = 50
+StateClicked.Background.Gradient1.Point1YPercent = 100
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 0
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 8404992
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 100
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 15722194
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 13137169
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsGradient
+StateClicked.Border.Color = 11235643
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 16777215
+StateClicked.Border.LightOpacity = 255
+StateClicked.Border.LightWidth = 0
+StateClicked.Border.Style = bboNone
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 16770790
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 1
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 1
+StateClicked.FontEx.ShadowOffsetY = 1
+StateClicked.FontEx.ShadowRadius = 2
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = fsBold
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 8404992
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtRadial
+StateHover.Background.Gradient1.Point1XPercent = 50
+StateHover.Background.Gradient1.Point1YPercent = 100
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 0
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 16744448
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 100
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 15722194
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 13137169
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 255
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 255
+StateHover.Border.LightWidth = 0
+StateHover.Border.Style = bboNone
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 16777215
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 1
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 1
+StateHover.FontEx.ShadowOffsetY = 1
+StateHover.FontEx.ShadowRadius = 2
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = fsBold
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 8405056
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 4194304
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 60
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 4194304
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtRadial
+StateNormal.Background.Gradient2.Point1XPercent = 50
+StateNormal.Background.Gradient2.Point1YPercent = 100
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 0
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 8405056
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsGradient
+StateNormal.Border.Color = 11235643
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 255
+StateNormal.Border.LightWidth = 0
+StateNormal.Border.Style = bboNone
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 16770790
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 1
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 1
+StateNormal.FontEx.ShadowOffsetY = 1
+StateNormal.FontEx.ShadowRadius = 2
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = fsBold
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 203 - 0
styles/macosx-lion.bcbtn

@@ -0,0 +1,203 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 1
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ClickOffset = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrow = 0
+DropDownArrowSize = 8
+DropDownPosition = bdpLeft
+DropDownStyle = bdsSeparate
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ImageIndex = -1
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 3
+Rounding.RoundY = 3
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+ShowCaption = 1
+ShowHint = 0
+StateClicked.Background.Color = 0
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 15709297
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 15844240
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 55
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 15847059
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 15773025
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsGradient
+StateClicked.Border.Color = 9394006
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 8421504
+StateClicked.Border.LightOpacity = 100
+StateClicked.Border.LightWidth = 1
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 0
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.FontQuality = fqSystemClearType
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = 
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 16372129
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 16573900
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 50
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 16643535
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 16501391
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 9394006
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 200
+StateHover.Border.LightWidth = 1
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 0
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.FontQuality = fqSystemClearType
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = 
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 15987699
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 16777215
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 50
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 15722194
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 15527148
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsGradient
+StateNormal.Border.Color = 10132122
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 200
+StateNormal.Border.LightWidth = 1
+StateNormal.Border.Style = bboSolid
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 0
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.FontQuality = fqSystemClearType
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = 
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 173 - 0
styles/mora.bcbtn

@@ -0,0 +1,173 @@
+[HEADER]
+Author=MORA
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+Color = 536870911
+Cursor = 0
+DropDownArrowSize = 4
+DropDownWidth = 16
+GlobalOpacity = 255
+GlyphMargin = 4
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+ParentColor = 0
+StateClicked.Background.Color = 15981500
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 16312531
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 15981500
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 100
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 15981500
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 16113605
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsColor
+StateClicked.Border.Color = 15448451
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 16312531
+StateClicked.Border.LightOpacity = 255
+StateClicked.Border.LightWidth = 0
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 0
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.FontQuality = fqSystemClearType
+StateClicked.FontEx.Height = 11
+StateClicked.FontEx.Name = Verdana
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = 
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 16310217
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 16577773
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 100
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 16577773
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 16310217
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 15515276
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16577773
+StateHover.Border.LightOpacity = 255
+StateHover.Border.LightWidth = 1
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 0
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.FontQuality = fqSystemClearType
+StateHover.FontEx.Height = 11
+StateHover.FontEx.Name = Verdana
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = 
+StateHover.FontEx.TextAlignment = bcaCenter
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 15855597
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 16777215
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 100
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 15722194
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 13137169
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsGradient
+StateNormal.Border.Color = 13816015
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 255
+StateNormal.Border.LightWidth = 1
+StateNormal.Border.Style = bboSolid
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 0
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.Height = 11
+StateNormal.FontEx.Name = Verdana
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = 
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+TextApplyGlobalOpacity = 0

+ 203 - 0
styles/office2010.bcbtn

@@ -0,0 +1,203 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ClickOffset = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrow = 0
+DropDownArrowSize = 8
+DropDownPosition = bdpLeft
+DropDownStyle = bdsSeparate
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ImageIndex = -1
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 3
+Rounding.RoundY = 3
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+ShowCaption = 1
+ShowHint = 0
+StateClicked.Background.Color = 0
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 7067903
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 7726591
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 50
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 8515583
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 7067903
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsGradient
+StateClicked.Border.Color = 4170178
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 8421504
+StateClicked.Border.LightOpacity = 100
+StateClicked.Border.LightWidth = 1
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 0
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.FontQuality = fqSystemClearType
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = 
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 8840446
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 12448254
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 50
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 12908798
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 8840446
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 5362420
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 200
+StateHover.Border.LightWidth = 1
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 0
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.FontQuality = fqSystemClearType
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = 
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 15855597
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 16777215
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 100
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 15722194
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 13137169
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsGradient
+StateNormal.Border.Color = 13816015
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 255
+StateNormal.Border.LightWidth = 1
+StateNormal.Border.Style = bboSolid
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 0
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.FontQuality = fqSystemClearType
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = 
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 108 - 0
styles/windows7-toolbar.bcpnl

@@ -0,0 +1,108 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCPanel
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+Background.Color = -2147483633
+Background.ColorOpacity = 255
+Background.Gradient1.ColorCorrection = 1
+Background.Gradient1.DrawMode = dmSet
+Background.Gradient1.EndColor = 16445670
+Background.Gradient1.EndColorOpacity = 255
+Background.Gradient1.GradientType = gtLinear
+Background.Gradient1.Point1XPercent = 0
+Background.Gradient1.Point1YPercent = 0
+Background.Gradient1.Point2XPercent = 0
+Background.Gradient1.Point2YPercent = 100
+Background.Gradient1.Sinus = 0
+Background.Gradient1.StartColor = 16775925
+Background.Gradient1.StartColorOpacity = 255
+Background.Gradient1EndPercent = 50
+Background.Gradient2.ColorCorrection = 1
+Background.Gradient2.DrawMode = dmSet
+Background.Gradient2.EndColor = 16247261
+Background.Gradient2.EndColorOpacity = 255
+Background.Gradient2.GradientType = gtLinear
+Background.Gradient2.Point1XPercent = 0
+Background.Gradient2.Point1YPercent = 0
+Background.Gradient2.Point2XPercent = 0
+Background.Gradient2.Point2YPercent = 100
+Background.Gradient2.Sinus = 0
+Background.Gradient2.StartColor = 16049884
+Background.Gradient2.StartColorOpacity = 255
+Background.Style = bbsGradient
+BevelInner = bvNone
+BevelOuter = bvRaised
+BevelWidth = 1
+Border.Color = 12824480
+Border.ColorOpacity = 200
+Border.LightColor = 16777215
+Border.LightOpacity = 200
+Border.LightWidth = 1
+Border.Style = bboSolid
+Border.Width = 1
+BorderBCStyle = bpsBorder
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ChildSizing.ControlsPerLine = 0
+ChildSizing.EnlargeHorizontal = crsAnchorAligning
+ChildSizing.EnlargeVertical = crsAnchorAligning
+ChildSizing.HorizontalSpacing = 0
+ChildSizing.Layout = cclNone
+ChildSizing.LeftRightSpacing = 0
+ChildSizing.ShrinkHorizontal = crsAnchorAligning
+ChildSizing.ShrinkVertical = crsAnchorAligning
+ChildSizing.TopBottomSpacing = 0
+ChildSizing.VerticalSpacing = 0
+Constraints.MaxHeight = 0
+Constraints.MaxWidth = 0
+Constraints.MinHeight = 0
+Constraints.MinWidth = 0
+Cursor = 0
+DockSite = 0
+DragCursor = -12
+DragKind = dkDrag
+DragMode = dmManual
+Enabled = 1
+FontEx.Color = 536870912
+FontEx.EndEllipsis = 0
+FontEx.FontQuality = fqSystemClearType
+FontEx.Height = 0
+FontEx.Name = default
+FontEx.Shadow = 0
+FontEx.ShadowColor = 0
+FontEx.ShadowColorOpacity = 255
+FontEx.ShadowOffsetX = 5
+FontEx.ShadowOffsetY = 5
+FontEx.ShadowRadius = 5
+FontEx.SingleLine = 1
+FontEx.Style = 
+FontEx.TextAlignment = bcaCenter
+FontEx.WordBreak = 0
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+Rounding.RoundOptions = rrTopLeftSquare,rrTopRightSquare,rrBottomRightSquare,rrBottomLeftSquare
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+ShowHint = 0
+TabOrder = 0
+TabStop = 0
+Tag = 0
+UseDockManager = 1
+Visible = 1

+ 203 - 0
styles/windows7-toolbutton.bcbtn

@@ -0,0 +1,203 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ClickOffset = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrow = 0
+DropDownArrowSize = 8
+DropDownPosition = bdpLeft
+DropDownStyle = bdsSeparate
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ImageIndex = -1
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 2
+Rounding.RoundY = 2
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+ShowCaption = 1
+ShowHint = 0
+StateClicked.Background.Color = 0
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 15852760
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 16116962
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 50
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 15588559
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 15522767
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsGradient
+StateClicked.Border.Color = 14404283
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 12632256
+StateClicked.Border.LightOpacity = 100
+StateClicked.Border.LightWidth = 1
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 0
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.FontQuality = fqSystemClearType
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = 
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 16446189
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 16710648
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 50
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 15258305
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 16049367
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 14404283
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 200
+StateHover.Border.LightWidth = 1
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 0
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.FontQuality = fqSystemClearType
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = 
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 13137169
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 15722194
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 35
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 15722194
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 13137169
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsClear
+StateNormal.Border.Color = 11235643
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 255
+StateNormal.Border.LightWidth = 0
+StateNormal.Border.Style = bboNone
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 0
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.FontQuality = fqSystemClearType
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = 
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 203 - 0
styles/windows7.bcbtn

@@ -0,0 +1,203 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCButton
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 0
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ClickOffset = 0
+Color = 536870911
+Cursor = 0
+Down = 0
+DropDownArrow = 0
+DropDownArrowSize = 8
+DropDownPosition = bdpLeft
+DropDownStyle = bdsSeparate
+DropDownWidth = 16
+Enabled = 1
+FlipArrow = 0
+GlobalOpacity = 255
+GlyphMargin = 5
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ImageIndex = -1
+ParentColor = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 3
+Rounding.RoundY = 3
+RoundingDropDown.RoundOptions = 
+RoundingDropDown.RoundX = 1
+RoundingDropDown.RoundY = 1
+ShowCaption = 1
+ShowHint = 0
+StateClicked.Background.Color = 0
+StateClicked.Background.ColorOpacity = 255
+StateClicked.Background.Gradient1.ColorCorrection = 1
+StateClicked.Background.Gradient1.DrawMode = dmSet
+StateClicked.Background.Gradient1.EndColor = 16180676
+StateClicked.Background.Gradient1.EndColorOpacity = 255
+StateClicked.Background.Gradient1.GradientType = gtLinear
+StateClicked.Background.Gradient1.Point1XPercent = 0
+StateClicked.Background.Gradient1.Point1YPercent = 0
+StateClicked.Background.Gradient1.Point2XPercent = 0
+StateClicked.Background.Gradient1.Point2YPercent = 100
+StateClicked.Background.Gradient1.Sinus = 0
+StateClicked.Background.Gradient1.StartColor = 16577765
+StateClicked.Background.Gradient1.StartColorOpacity = 255
+StateClicked.Background.Gradient1EndPercent = 55
+StateClicked.Background.Gradient2.ColorCorrection = 1
+StateClicked.Background.Gradient2.DrawMode = dmSet
+StateClicked.Background.Gradient2.EndColor = 14398312
+StateClicked.Background.Gradient2.EndColorOpacity = 255
+StateClicked.Background.Gradient2.GradientType = gtLinear
+StateClicked.Background.Gradient2.Point1XPercent = 0
+StateClicked.Background.Gradient2.Point1YPercent = 0
+StateClicked.Background.Gradient2.Point2XPercent = 0
+StateClicked.Background.Gradient2.Point2YPercent = 100
+StateClicked.Background.Gradient2.Sinus = 0
+StateClicked.Background.Gradient2.StartColor = 15716760
+StateClicked.Background.Gradient2.StartColorOpacity = 255
+StateClicked.Background.Style = bbsGradient
+StateClicked.Border.Color = 9134636
+StateClicked.Border.ColorOpacity = 255
+StateClicked.Border.LightColor = 0
+StateClicked.Border.LightOpacity = 100
+StateClicked.Border.LightWidth = 1
+StateClicked.Border.Style = bboSolid
+StateClicked.Border.Width = 1
+StateClicked.FontEx.Color = 0
+StateClicked.FontEx.EndEllipsis = 0
+StateClicked.FontEx.FontQuality = fqSystemClearType
+StateClicked.FontEx.Height = 0
+StateClicked.FontEx.Name = default
+StateClicked.FontEx.Shadow = 0
+StateClicked.FontEx.ShadowColor = 0
+StateClicked.FontEx.ShadowColorOpacity = 255
+StateClicked.FontEx.ShadowOffsetX = 5
+StateClicked.FontEx.ShadowOffsetY = 5
+StateClicked.FontEx.ShadowRadius = 5
+StateClicked.FontEx.SingleLine = 1
+StateClicked.FontEx.Style = 
+StateClicked.FontEx.TextAlignment = bcaCenter
+StateClicked.FontEx.WordBreak = 0
+StateHover.Background.Color = 0
+StateHover.Background.ColorOpacity = 255
+StateHover.Background.Gradient1.ColorCorrection = 1
+StateHover.Background.Gradient1.DrawMode = dmSet
+StateHover.Background.Gradient1.EndColor = 16576729
+StateHover.Background.Gradient1.EndColorOpacity = 255
+StateHover.Background.Gradient1.GradientType = gtLinear
+StateHover.Background.Gradient1.Point1XPercent = 0
+StateHover.Background.Gradient1.Point1YPercent = 0
+StateHover.Background.Gradient1.Point2XPercent = 0
+StateHover.Background.Gradient1.Point2YPercent = 100
+StateHover.Background.Gradient1.Sinus = 0
+StateHover.Background.Gradient1.StartColor = 16643818
+StateHover.Background.Gradient1.StartColorOpacity = 255
+StateHover.Background.Gradient1EndPercent = 50
+StateHover.Background.Gradient2.ColorCorrection = 1
+StateHover.Background.Gradient2.DrawMode = dmSet
+StateHover.Background.Gradient2.EndColor = 16112039
+StateHover.Background.Gradient2.EndColorOpacity = 255
+StateHover.Background.Gradient2.GradientType = gtLinear
+StateHover.Background.Gradient2.Point1XPercent = 0
+StateHover.Background.Gradient2.Point1YPercent = 0
+StateHover.Background.Gradient2.Point2XPercent = 0
+StateHover.Background.Gradient2.Point2YPercent = 100
+StateHover.Background.Gradient2.Sinus = 0
+StateHover.Background.Gradient2.StartColor = 16639678
+StateHover.Background.Gradient2.StartColorOpacity = 255
+StateHover.Background.Style = bbsGradient
+StateHover.Border.Color = 11632444
+StateHover.Border.ColorOpacity = 255
+StateHover.Border.LightColor = 16777215
+StateHover.Border.LightOpacity = 200
+StateHover.Border.LightWidth = 1
+StateHover.Border.Style = bboSolid
+StateHover.Border.Width = 1
+StateHover.FontEx.Color = 0
+StateHover.FontEx.EndEllipsis = 0
+StateHover.FontEx.FontQuality = fqSystemClearType
+StateHover.FontEx.Height = 0
+StateHover.FontEx.Name = default
+StateHover.FontEx.Shadow = 0
+StateHover.FontEx.ShadowColor = 0
+StateHover.FontEx.ShadowColorOpacity = 255
+StateHover.FontEx.ShadowOffsetX = 5
+StateHover.FontEx.ShadowOffsetY = 5
+StateHover.FontEx.ShadowRadius = 5
+StateHover.FontEx.SingleLine = 1
+StateHover.FontEx.Style = 
+StateHover.FontEx.TextAlignment = bcaCenter
+StateHover.FontEx.WordBreak = 0
+StateNormal.Background.Color = 0
+StateNormal.Background.ColorOpacity = 255
+StateNormal.Background.Gradient1.ColorCorrection = 1
+StateNormal.Background.Gradient1.DrawMode = dmSet
+StateNormal.Background.Gradient1.EndColor = 15461355
+StateNormal.Background.Gradient1.EndColorOpacity = 255
+StateNormal.Background.Gradient1.GradientType = gtLinear
+StateNormal.Background.Gradient1.Point1XPercent = 0
+StateNormal.Background.Gradient1.Point1YPercent = 0
+StateNormal.Background.Gradient1.Point2XPercent = 0
+StateNormal.Background.Gradient1.Point2YPercent = 100
+StateNormal.Background.Gradient1.Sinus = 0
+StateNormal.Background.Gradient1.StartColor = 15921906
+StateNormal.Background.Gradient1.StartColorOpacity = 255
+StateNormal.Background.Gradient1EndPercent = 50
+StateNormal.Background.Gradient2.ColorCorrection = 1
+StateNormal.Background.Gradient2.DrawMode = dmSet
+StateNormal.Background.Gradient2.EndColor = 13619151
+StateNormal.Background.Gradient2.EndColorOpacity = 255
+StateNormal.Background.Gradient2.GradientType = gtLinear
+StateNormal.Background.Gradient2.Point1XPercent = 0
+StateNormal.Background.Gradient2.Point1YPercent = 0
+StateNormal.Background.Gradient2.Point2XPercent = 0
+StateNormal.Background.Gradient2.Point2YPercent = 100
+StateNormal.Background.Gradient2.Sinus = 0
+StateNormal.Background.Gradient2.StartColor = 14540253
+StateNormal.Background.Gradient2.StartColorOpacity = 255
+StateNormal.Background.Style = bbsGradient
+StateNormal.Border.Color = 7368816
+StateNormal.Border.ColorOpacity = 255
+StateNormal.Border.LightColor = 16777215
+StateNormal.Border.LightOpacity = 200
+StateNormal.Border.LightWidth = 1
+StateNormal.Border.Style = bboSolid
+StateNormal.Border.Width = 1
+StateNormal.FontEx.Color = 0
+StateNormal.FontEx.EndEllipsis = 0
+StateNormal.FontEx.FontQuality = fqSystemClearType
+StateNormal.FontEx.Height = 0
+StateNormal.FontEx.Name = default
+StateNormal.FontEx.Shadow = 0
+StateNormal.FontEx.ShadowColor = 0
+StateNormal.FontEx.ShadowColorOpacity = 255
+StateNormal.FontEx.ShadowOffsetX = 5
+StateNormal.FontEx.ShadowOffsetY = 5
+StateNormal.FontEx.ShadowRadius = 5
+StateNormal.FontEx.SingleLine = 1
+StateNormal.FontEx.Style = 
+StateNormal.FontEx.TextAlignment = bcaCenter
+StateNormal.FontEx.WordBreak = 0
+StaticButton = 0
+Style = bbtButton
+Tag = 0
+TextApplyGlobalOpacity = 0
+Visible = 1

+ 134 - 0
test/test_bccontrols/test_bcbutton/bcsample.lpi

@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="9"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="bcsample"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+    </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
+    <BuildModes Count="2">
+      <Item1 Name="Debug" Default="True"/>
+      <Item2 Name="Test">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <PathDelim Value="\"/>
+          <Target>
+            <Filename Value="bcsample"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <CodeGeneration>
+            <SmartLinkUnit Value="True"/>
+            <Optimizations>
+              <VariablesInRegisters Value="True"/>
+              <OptimizationLevel Value="3"/>
+            </Optimizations>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <GenerateDebugInfo Value="False"/>
+              <StripSymbols Value="True"/>
+            </Debugging>
+            <LinkSmart Value="True"/>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+          <Other>
+            <CompilerMessages>
+              <MsgFileName Value=""/>
+            </CompilerMessages>
+            <CompilerPath Value="$(CompPath)"/>
+          </Other>
+        </CompilerOptions>
+      </Item2>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+      </local>
+    </RunParams>
+    <RequiredPackages Count="2">
+      <Item1>
+        <PackageName Value="bgracontrols"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+    </RequiredPackages>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="bcsample.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="bcsample"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="unit1.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="Unit1"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="bcsample"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <UseHeaptrc Value="True"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <CompilerMessages>
+        <MsgFileName Value=""/>
+      </CompilerMessages>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 21 - 0
test/test_bccontrols/test_bcbutton/bcsample.lpr

@@ -0,0 +1,21 @@
+program bcsample;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, Unit1
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource := True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

+ 3741 - 0
test/test_bccontrols/test_bcbutton/unit1.lfm

@@ -0,0 +1,3741 @@
+object Form1: TForm1
+  Left = 383
+  Height = 477
+  Top = 165
+  Width = 588
+  Caption = 'Form1'
+  ClientHeight = 477
+  ClientWidth = 588
+  LCLVersion = '1.1'
+  object BCButton1: TBCButton
+    Left = 24
+    Height = 40
+    Top = 54
+    Width = 128
+    Action = Action1
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = True
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = False
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = True
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = False
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = True
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = False
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 8
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = []
+    RoundingDropDown.RoundX = 1
+    RoundingDropDown.RoundY = 1
+    RoundingDropDown.RoundOptions = []
+    TextApplyGlobalOpacity = False
+    Images = ImageList1
+    ImageIndex = 6
+  end
+  object BCButton2: TBCButton
+    Left = 24
+    Height = 40
+    Top = 184
+    Width = 264
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = True
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = False
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = True
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = False
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = True
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = False
+    Caption = 'Default DropDown area'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    PopupMenu = PopupMenu1
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = [rrTopRightSquare, rrBottomRightSquare]
+    RoundingDropDown.RoundX = 4
+    RoundingDropDown.RoundY = 4
+    RoundingDropDown.RoundOptions = [rrTopLeftSquare, rrBottomLeftSquare]
+    Style = bbtDropDown
+    TextApplyGlobalOpacity = False
+    DropDownMenu = PopupMenu1
+    Images = ImageList1
+    ImageIndex = 9
+  end
+  object BCButton3: TBCButton
+    Left = 24
+    Height = 40
+    Top = 136
+    Width = 128
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = True
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = False
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = True
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = False
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = True
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = False
+    Caption = 'DropDownArrow'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = []
+    RoundingDropDown.RoundX = 1
+    RoundingDropDown.RoundY = 1
+    RoundingDropDown.RoundOptions = []
+    TextApplyGlobalOpacity = False
+    DropDownArrow = True
+  end
+  object BCButton4: TBCButton
+    Left = 24
+    Height = 40
+    Top = 280
+    Width = 264
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = True
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = False
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = True
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = False
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = True
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = False
+    Caption = 'Flipped arrow and Right aligned Popup'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    PopupMenu = PopupMenu1
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = [rrTopRightSquare, rrBottomRightSquare]
+    RoundingDropDown.RoundX = 4
+    RoundingDropDown.RoundY = 4
+    RoundingDropDown.RoundOptions = [rrTopLeftSquare, rrBottomLeftSquare]
+    Style = bbtDropDown
+    TextApplyGlobalOpacity = False
+    DropDownMenu = PopupMenu3
+    Images = ImageList1
+    ImageIndex = 10
+  end
+  object BCButton5: TBCButton
+    Left = 296
+    Height = 88
+    Top = 184
+    Width = 136
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = False
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = True
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = False
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = True
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = False
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = True
+    Caption = 'DropDown part at the bottom'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    PopupMenu = PopupMenu1
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = [rrBottomRightSquare, rrBottomLeftSquare]
+    RoundingDropDown.RoundX = 4
+    RoundingDropDown.RoundY = 4
+    RoundingDropDown.RoundOptions = [rrTopLeftSquare, rrTopRightSquare]
+    Style = bbtDropDown
+    TextApplyGlobalOpacity = False
+    DropDownMenu = PopupMenu1
+    DropDownPosition = bdpBottom
+  end
+  object BCButton7: TBCButton
+    Left = 160
+    Height = 40
+    Top = 54
+    Width = 128
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = True
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = False
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = True
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = False
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = True
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = False
+    Caption = 'ImageIndex'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = []
+    RoundingDropDown.RoundX = 1
+    RoundingDropDown.RoundY = 1
+    RoundingDropDown.RoundOptions = []
+    TextApplyGlobalOpacity = False
+    Images = ImageList1
+    ImageIndex = 2
+  end
+  object BCButton8: TBCButton
+    Left = 160
+    Height = 40
+    Top = 136
+    Width = 128
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = True
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = False
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = True
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = False
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = True
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = False
+    Caption = 'DropDownMenu'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = []
+    RoundingDropDown.RoundX = 1
+    RoundingDropDown.RoundY = 1
+    RoundingDropDown.RoundOptions = []
+    TextApplyGlobalOpacity = False
+    DropDownArrow = True
+    DropDownMenu = PopupMenu1
+  end
+  object BCButton9: TBCButton
+    Left = 24
+    Height = 40
+    Top = 328
+    Width = 264
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = True
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = False
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = True
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = False
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = True
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = False
+    Caption = 'Common DropDown area'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    PopupMenu = PopupMenu1
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = [rrTopRightSquare, rrBottomRightSquare]
+    RoundingDropDown.RoundX = 4
+    RoundingDropDown.RoundY = 4
+    RoundingDropDown.RoundOptions = [rrTopLeftSquare, rrBottomLeftSquare]
+    Style = bbtDropDown
+    TextApplyGlobalOpacity = False
+    DropDownMenu = PopupMenu1
+    DropDownStyle = bdsCommon
+    Images = ImageList1
+    ImageIndex = 11
+  end
+  object BCButton6: TBCButton
+    Left = 24
+    Height = 40
+    Top = 232
+    Width = 264
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = True
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = False
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = True
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = False
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = True
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = False
+    Caption = 'Right aligned Popup'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    PopupMenu = PopupMenu1
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = [rrTopRightSquare, rrBottomRightSquare]
+    RoundingDropDown.RoundX = 4
+    RoundingDropDown.RoundY = 4
+    RoundingDropDown.RoundOptions = [rrTopLeftSquare, rrBottomLeftSquare]
+    Style = bbtDropDown
+    TextApplyGlobalOpacity = False
+    DropDownMenu = PopupMenu3
+    Images = ImageList1
+    ImageIndex = 12
+  end
+  object BCButton10: TBCButton
+    Left = 296
+    Height = 88
+    Top = 280
+    Width = 136
+    StateClicked.Background.Color = 15981500
+    StateClicked.Background.ColorOpacity = 255
+    StateClicked.Background.Gradient1.StartColor = 15981500
+    StateClicked.Background.Gradient1.StartColorOpacity = 255
+    StateClicked.Background.Gradient1.DrawMode = dmSet
+    StateClicked.Background.Gradient1.EndColor = 16312531
+    StateClicked.Background.Gradient1.EndColorOpacity = 255
+    StateClicked.Background.Gradient1.ColorCorrection = True
+    StateClicked.Background.Gradient1.GradientType = gtLinear
+    StateClicked.Background.Gradient1.Point1XPercent = 0
+    StateClicked.Background.Gradient1.Point1YPercent = 0
+    StateClicked.Background.Gradient1.Point2XPercent = 0
+    StateClicked.Background.Gradient1.Point2YPercent = 100
+    StateClicked.Background.Gradient1.Sinus = False
+    StateClicked.Background.Gradient2.StartColor = 16113605
+    StateClicked.Background.Gradient2.StartColorOpacity = 255
+    StateClicked.Background.Gradient2.DrawMode = dmSet
+    StateClicked.Background.Gradient2.EndColor = 15981500
+    StateClicked.Background.Gradient2.EndColorOpacity = 255
+    StateClicked.Background.Gradient2.ColorCorrection = True
+    StateClicked.Background.Gradient2.GradientType = gtLinear
+    StateClicked.Background.Gradient2.Point1XPercent = 0
+    StateClicked.Background.Gradient2.Point1YPercent = 0
+    StateClicked.Background.Gradient2.Point2XPercent = 0
+    StateClicked.Background.Gradient2.Point2YPercent = 100
+    StateClicked.Background.Gradient2.Sinus = False
+    StateClicked.Background.Gradient1EndPercent = 100
+    StateClicked.Background.Style = bbsColor
+    StateClicked.Border.Color = 15448451
+    StateClicked.Border.ColorOpacity = 255
+    StateClicked.Border.LightColor = 16312531
+    StateClicked.Border.LightOpacity = 255
+    StateClicked.Border.LightWidth = 0
+    StateClicked.Border.Style = bboSolid
+    StateClicked.Border.Width = 1
+    StateClicked.FontEx.Color = clBlack
+    StateClicked.FontEx.EndEllipsis = False
+    StateClicked.FontEx.FontQuality = fqSystemClearType
+    StateClicked.FontEx.Height = 11
+    StateClicked.FontEx.Name = 'Verdana'
+    StateClicked.FontEx.SingleLine = False
+    StateClicked.FontEx.Shadow = False
+    StateClicked.FontEx.ShadowColor = clBlack
+    StateClicked.FontEx.ShadowColorOpacity = 255
+    StateClicked.FontEx.ShadowRadius = 5
+    StateClicked.FontEx.ShadowOffsetX = 5
+    StateClicked.FontEx.ShadowOffsetY = 5
+    StateClicked.FontEx.Style = []
+    StateClicked.FontEx.TextAlignment = bcaCenter
+    StateClicked.FontEx.WordBreak = True
+    StateHover.Background.Color = clBlack
+    StateHover.Background.ColorOpacity = 255
+    StateHover.Background.Gradient1.StartColor = 16577773
+    StateHover.Background.Gradient1.StartColorOpacity = 255
+    StateHover.Background.Gradient1.DrawMode = dmSet
+    StateHover.Background.Gradient1.EndColor = 16310217
+    StateHover.Background.Gradient1.EndColorOpacity = 255
+    StateHover.Background.Gradient1.ColorCorrection = True
+    StateHover.Background.Gradient1.GradientType = gtLinear
+    StateHover.Background.Gradient1.Point1XPercent = 0
+    StateHover.Background.Gradient1.Point1YPercent = 0
+    StateHover.Background.Gradient1.Point2XPercent = 0
+    StateHover.Background.Gradient1.Point2YPercent = 100
+    StateHover.Background.Gradient1.Sinus = False
+    StateHover.Background.Gradient2.StartColor = 16310217
+    StateHover.Background.Gradient2.StartColorOpacity = 255
+    StateHover.Background.Gradient2.DrawMode = dmSet
+    StateHover.Background.Gradient2.EndColor = 16577773
+    StateHover.Background.Gradient2.EndColorOpacity = 255
+    StateHover.Background.Gradient2.ColorCorrection = True
+    StateHover.Background.Gradient2.GradientType = gtLinear
+    StateHover.Background.Gradient2.Point1XPercent = 0
+    StateHover.Background.Gradient2.Point1YPercent = 0
+    StateHover.Background.Gradient2.Point2XPercent = 0
+    StateHover.Background.Gradient2.Point2YPercent = 100
+    StateHover.Background.Gradient2.Sinus = False
+    StateHover.Background.Gradient1EndPercent = 100
+    StateHover.Background.Style = bbsGradient
+    StateHover.Border.Color = 15515276
+    StateHover.Border.ColorOpacity = 255
+    StateHover.Border.LightColor = 16577773
+    StateHover.Border.LightOpacity = 255
+    StateHover.Border.LightWidth = 1
+    StateHover.Border.Style = bboSolid
+    StateHover.Border.Width = 1
+    StateHover.FontEx.Color = clBlack
+    StateHover.FontEx.EndEllipsis = False
+    StateHover.FontEx.FontQuality = fqSystemClearType
+    StateHover.FontEx.Height = 11
+    StateHover.FontEx.Name = 'Verdana'
+    StateHover.FontEx.SingleLine = False
+    StateHover.FontEx.Shadow = False
+    StateHover.FontEx.ShadowColor = clBlack
+    StateHover.FontEx.ShadowColorOpacity = 255
+    StateHover.FontEx.ShadowRadius = 5
+    StateHover.FontEx.ShadowOffsetX = 5
+    StateHover.FontEx.ShadowOffsetY = 5
+    StateHover.FontEx.Style = []
+    StateHover.FontEx.TextAlignment = bcaCenter
+    StateHover.FontEx.WordBreak = True
+    StateNormal.Background.Color = clBlack
+    StateNormal.Background.ColorOpacity = 255
+    StateNormal.Background.Gradient1.StartColor = clWhite
+    StateNormal.Background.Gradient1.StartColorOpacity = 255
+    StateNormal.Background.Gradient1.DrawMode = dmSet
+    StateNormal.Background.Gradient1.EndColor = 15855597
+    StateNormal.Background.Gradient1.EndColorOpacity = 255
+    StateNormal.Background.Gradient1.ColorCorrection = True
+    StateNormal.Background.Gradient1.GradientType = gtLinear
+    StateNormal.Background.Gradient1.Point1XPercent = 0
+    StateNormal.Background.Gradient1.Point1YPercent = 0
+    StateNormal.Background.Gradient1.Point2XPercent = 0
+    StateNormal.Background.Gradient1.Point2YPercent = 100
+    StateNormal.Background.Gradient1.Sinus = False
+    StateNormal.Background.Gradient2.StartColor = 13137169
+    StateNormal.Background.Gradient2.StartColorOpacity = 255
+    StateNormal.Background.Gradient2.DrawMode = dmSet
+    StateNormal.Background.Gradient2.EndColor = 15722194
+    StateNormal.Background.Gradient2.EndColorOpacity = 255
+    StateNormal.Background.Gradient2.ColorCorrection = True
+    StateNormal.Background.Gradient2.GradientType = gtLinear
+    StateNormal.Background.Gradient2.Point1XPercent = 0
+    StateNormal.Background.Gradient2.Point1YPercent = 0
+    StateNormal.Background.Gradient2.Point2XPercent = 0
+    StateNormal.Background.Gradient2.Point2YPercent = 100
+    StateNormal.Background.Gradient2.Sinus = False
+    StateNormal.Background.Gradient1EndPercent = 100
+    StateNormal.Background.Style = bbsGradient
+    StateNormal.Border.Color = 13816015
+    StateNormal.Border.ColorOpacity = 255
+    StateNormal.Border.LightColor = clWhite
+    StateNormal.Border.LightOpacity = 255
+    StateNormal.Border.LightWidth = 1
+    StateNormal.Border.Style = bboSolid
+    StateNormal.Border.Width = 1
+    StateNormal.FontEx.Color = clBlack
+    StateNormal.FontEx.EndEllipsis = False
+    StateNormal.FontEx.FontQuality = fqSystemClearType
+    StateNormal.FontEx.Height = 11
+    StateNormal.FontEx.Name = 'Verdana'
+    StateNormal.FontEx.SingleLine = False
+    StateNormal.FontEx.Shadow = False
+    StateNormal.FontEx.ShadowColor = clBlack
+    StateNormal.FontEx.ShadowColorOpacity = 255
+    StateNormal.FontEx.ShadowRadius = 5
+    StateNormal.FontEx.ShadowOffsetX = 5
+    StateNormal.FontEx.ShadowOffsetY = 5
+    StateNormal.FontEx.Style = []
+    StateNormal.FontEx.TextAlignment = bcaCenter
+    StateNormal.FontEx.WordBreak = True
+    Caption = 'DropDown part at the bottom (Common)'
+    Color = clNone
+    DropDownWidth = 16
+    DropDownArrowSize = 4
+    GlobalOpacity = 255
+    GlyphMargin = 4
+    ParentColor = False
+    PopupMenu = PopupMenu1
+    Rounding.RoundX = 4
+    Rounding.RoundY = 4
+    Rounding.RoundOptions = [rrBottomRightSquare, rrBottomLeftSquare]
+    RoundingDropDown.RoundX = 4
+    RoundingDropDown.RoundY = 4
+    RoundingDropDown.RoundOptions = [rrTopLeftSquare, rrTopRightSquare]
+    Style = bbtDropDown
+    TextApplyGlobalOpacity = False
+    DropDownMenu = PopupMenu1
+    DropDownStyle = bdsCommon
+    DropDownPosition = bdpBottom
+  end
+  object CheckBox1: TCheckBox
+    Left = 301
+    Height = 24
+    Top = 66
+    Width = 116
+    Caption = 'Show Caption'
+    Checked = True
+    OnChange = CheckBox1Change
+    State = cbChecked
+    TabOrder = 0
+  end
+  object BCPanel1: TBCPanel
+    Left = 0
+    Height = 33
+    Top = 0
+    Width = 588
+    Align = alTop
+    Background.Color = clBtnFace
+    Background.ColorOpacity = 255
+    Background.Gradient1.StartColor = clWhite
+    Background.Gradient1.StartColorOpacity = 255
+    Background.Gradient1.DrawMode = dmSet
+    Background.Gradient1.EndColor = 15855597
+    Background.Gradient1.EndColorOpacity = 255
+    Background.Gradient1.ColorCorrection = True
+    Background.Gradient1.GradientType = gtLinear
+    Background.Gradient1.Point1XPercent = 0
+    Background.Gradient1.Point1YPercent = 0
+    Background.Gradient1.Point2XPercent = 0
+    Background.Gradient1.Point2YPercent = 100
+    Background.Gradient1.Sinus = False
+    Background.Gradient2.StartColor = clWhite
+    Background.Gradient2.StartColorOpacity = 255
+    Background.Gradient2.DrawMode = dmSet
+    Background.Gradient2.EndColor = clBlack
+    Background.Gradient2.EndColorOpacity = 255
+    Background.Gradient2.ColorCorrection = True
+    Background.Gradient2.GradientType = gtLinear
+    Background.Gradient2.Point1XPercent = 0
+    Background.Gradient2.Point1YPercent = 0
+    Background.Gradient2.Point2XPercent = 0
+    Background.Gradient2.Point2YPercent = 100
+    Background.Gradient2.Sinus = False
+    Background.Gradient1EndPercent = 100
+    Background.Style = bbsGradient
+    BevelInner = bvNone
+    BevelOuter = bvNone
+    BevelWidth = 1
+    Border.Color = clBlack
+    Border.ColorOpacity = 255
+    Border.LightColor = clWhite
+    Border.LightOpacity = 255
+    Border.LightWidth = 0
+    Border.Style = bboNone
+    Border.Width = 1
+    FontEx.Color = clDefault
+    FontEx.EndEllipsis = False
+    FontEx.FontQuality = fqSystemClearType
+    FontEx.Height = 0
+    FontEx.SingleLine = True
+    FontEx.Shadow = False
+    FontEx.ShadowColor = clBlack
+    FontEx.ShadowColorOpacity = 255
+    FontEx.ShadowRadius = 5
+    FontEx.ShadowOffsetX = 5
+    FontEx.ShadowOffsetY = 5
+    FontEx.Style = []
+    FontEx.TextAlignment = bcaCenter
+    FontEx.WordBreak = False
+    Rounding.RoundX = 1
+    Rounding.RoundY = 1
+    Rounding.RoundOptions = []
+    TabOrder = 1
+    object Shape1: TShape
+      Left = 0
+      Height = 1
+      Top = 32
+      Width = 588
+      Align = alBottom
+      Pen.Color = clBtnShadow
+    end
+    object BCButton11: TBCButton
+      Left = 2
+      Height = 28
+      Top = 2
+      Width = 40
+      Align = alLeft
+      AutoSize = True
+      StateClicked.Background.Color = 15981500
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 15981500
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 16312531
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 100
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = 16113605
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = 15981500
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsColor
+      StateClicked.Border.Color = 15448451
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = 16312531
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboSolid
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = clBlack
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 11
+      StateClicked.FontEx.Name = 'Verdana'
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16577773
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 16310217
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 100
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = 16310217
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = 16577773
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = 15515276
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = 16577773
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clBlack
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 11
+      StateHover.FontEx.Name = 'Verdana'
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = clWhite
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 15855597
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 13137169
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 15722194
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 100
+      StateNormal.Background.Style = bbsClear
+      StateNormal.Border.Color = 13816015
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = clBlack
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 11
+      StateNormal.FontEx.Name = 'Verdana'
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      BorderSpacing.Around = 2
+      Caption = 'Back'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      GlyphMargin = 4
+      ParentColor = False
+      Rounding.RoundX = 2
+      Rounding.RoundY = 2
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+      Images = ImageList1
+      ImageIndex = 1
+      ShowCaption = False
+    end
+    object BCButton12: TBCButton
+      Left = 44
+      Height = 28
+      Top = 2
+      Width = 40
+      Align = alLeft
+      AutoSize = True
+      StateClicked.Background.Color = 15981500
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 15981500
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 16312531
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 100
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = 16113605
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = 15981500
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsColor
+      StateClicked.Border.Color = 15448451
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = 16312531
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboSolid
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = clBlack
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 11
+      StateClicked.FontEx.Name = 'Verdana'
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16577773
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 16310217
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 100
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = 16310217
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = 16577773
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = 15515276
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = 16577773
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clBlack
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 11
+      StateHover.FontEx.Name = 'Verdana'
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = clWhite
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 15855597
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 13137169
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 15722194
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 100
+      StateNormal.Background.Style = bbsClear
+      StateNormal.Border.Color = 13816015
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = clBlack
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 11
+      StateNormal.FontEx.Name = 'Verdana'
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      BorderSpacing.Around = 2
+      Caption = 'Forward'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      GlyphMargin = 4
+      ParentColor = False
+      Rounding.RoundX = 2
+      Rounding.RoundY = 2
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+      Images = ImageList1
+      ImageIndex = 0
+      ShowCaption = False
+    end
+    object BCButton13: TBCButton
+      Left = 86
+      Height = 28
+      Top = 2
+      Width = 40
+      Align = alLeft
+      AutoSize = True
+      StateClicked.Background.Color = 15981500
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 15981500
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 16312531
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 100
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = 16113605
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = 15981500
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsColor
+      StateClicked.Border.Color = 15448451
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = 16312531
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboSolid
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = clBlack
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 11
+      StateClicked.FontEx.Name = 'Verdana'
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16577773
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 16310217
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 100
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = 16310217
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = 16577773
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = 15515276
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = 16577773
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clBlack
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 11
+      StateHover.FontEx.Name = 'Verdana'
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = clWhite
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 15855597
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 13137169
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 15722194
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 100
+      StateNormal.Background.Style = bbsClear
+      StateNormal.Border.Color = 13816015
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = clBlack
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 11
+      StateNormal.FontEx.Name = 'Verdana'
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      BorderSpacing.Around = 2
+      Caption = 'Refresh'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      GlyphMargin = 4
+      ParentColor = False
+      Rounding.RoundX = 2
+      Rounding.RoundY = 2
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+      Images = ImageList1
+      ImageIndex = 2
+      ShowCaption = False
+    end
+    object Bevel1: TBevel
+      Left = 128
+      Height = 28
+      Top = 2
+      Width = 2
+      Align = alLeft
+      BorderSpacing.Top = 2
+      BorderSpacing.Bottom = 2
+      Shape = bsLeftLine
+    end
+    object BCButton14: TBCButton
+      Left = 333
+      Height = 28
+      Top = 2
+      Width = 93
+      Align = alLeft
+      AutoSize = True
+      StateClicked.Background.Color = 15981500
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 15981500
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 16312531
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 100
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = 16113605
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = 15981500
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsColor
+      StateClicked.Border.Color = 15448451
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = 16312531
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboSolid
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = clBlack
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 11
+      StateClicked.FontEx.Name = 'Verdana'
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16577773
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 16310217
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 100
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = 16310217
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = 16577773
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = 15515276
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = 16577773
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clBlack
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 11
+      StateHover.FontEx.Name = 'Verdana'
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = clWhite
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 15855597
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 13137169
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 15722194
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 100
+      StateNormal.Background.Style = bbsClear
+      StateNormal.Border.Color = 13816015
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = clBlack
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 11
+      StateNormal.FontEx.Name = 'Verdana'
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      BorderSpacing.Around = 2
+      Caption = 'Zoom In'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      GlyphMargin = 4
+      ParentColor = False
+      Rounding.RoundX = 2
+      Rounding.RoundY = 2
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+      Images = ImageList1
+      ImageIndex = 4
+    end
+    object BCButton15: TBCButton
+      Left = 428
+      Height = 28
+      Top = 2
+      Width = 101
+      Align = alLeft
+      AutoSize = True
+      StateClicked.Background.Color = 15981500
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 15981500
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 16312531
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 100
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = 16113605
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = 15981500
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsColor
+      StateClicked.Border.Color = 15448451
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = 16312531
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboSolid
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = clBlack
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 11
+      StateClicked.FontEx.Name = 'Verdana'
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16577773
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 16310217
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 100
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = 16310217
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = 16577773
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = 15515276
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = 16577773
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clBlack
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 11
+      StateHover.FontEx.Name = 'Verdana'
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = clWhite
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 15855597
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 13137169
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 15722194
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 100
+      StateNormal.Background.Style = bbsClear
+      StateNormal.Border.Color = 13816015
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = clBlack
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 11
+      StateNormal.FontEx.Name = 'Verdana'
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      BorderSpacing.Around = 2
+      Caption = 'Zoom Out'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      GlyphMargin = 4
+      ParentColor = False
+      Rounding.RoundX = 2
+      Rounding.RoundY = 2
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+      Images = ImageList1
+      ImageIndex = 5
+    end
+    object BCButton16: TBCButton
+      Left = 250
+      Height = 28
+      Top = 2
+      Width = 81
+      Align = alLeft
+      AutoSize = True
+      StateClicked.Background.Color = 15981500
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 15981500
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 16312531
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 100
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = 16113605
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = 15981500
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsColor
+      StateClicked.Border.Color = 15448451
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = 16312531
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboSolid
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = clBlack
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 11
+      StateClicked.FontEx.Name = 'Verdana'
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16577773
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 16310217
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 100
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = 16310217
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = 16577773
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = 15515276
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = 16577773
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clBlack
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 11
+      StateHover.FontEx.Name = 'Verdana'
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = clWhite
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 15855597
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 13137169
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 15722194
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 100
+      StateNormal.Background.Style = bbsClear
+      StateNormal.Border.Color = 13816015
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = clBlack
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 11
+      StateNormal.FontEx.Name = 'Verdana'
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      BorderSpacing.Around = 2
+      Caption = 'Zoom'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 4
+      GlobalOpacity = 255
+      GlyphMargin = 4
+      ParentColor = False
+      Rounding.RoundX = 2
+      Rounding.RoundY = 2
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+      DropDownArrow = True
+      Images = ImageList1
+      ImageIndex = 3
+    end
+    object BCButton17: TBCButton
+      Left = 132
+      Height = 28
+      Top = 2
+      Width = 70
+      Align = alLeft
+      AutoSize = True
+      StateClicked.Background.Color = 15981500
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 15981500
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 16312531
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 100
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = 16113605
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = 15981500
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsColor
+      StateClicked.Border.Color = 15448451
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = 16312531
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboSolid
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = clBlack
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 11
+      StateClicked.FontEx.Name = 'Verdana'
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16577773
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 16310217
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 100
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = 16310217
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = 16577773
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = 15515276
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = 16577773
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clBlack
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 11
+      StateHover.FontEx.Name = 'Verdana'
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = clWhite
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 15855597
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 13137169
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 15722194
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 100
+      StateNormal.Background.Style = bbsClear
+      StateNormal.Border.Color = 13816015
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = clBlack
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 11
+      StateNormal.FontEx.Name = 'Verdana'
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      BorderSpacing.Around = 2
+      Caption = 'Print'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      GlyphMargin = 4
+      ParentColor = False
+      Rounding.RoundX = 2
+      Rounding.RoundY = 2
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+      Images = ImageList1
+      ImageIndex = 6
+    end
+    object Bevel2: TBevel
+      Left = 246
+      Height = 28
+      Top = 2
+      Width = 2
+      Align = alLeft
+      BorderSpacing.Top = 2
+      BorderSpacing.Bottom = 2
+      Shape = bsLeftLine
+    end
+    object BCButton18: TBCButton
+      Left = 204
+      Height = 28
+      Top = 2
+      Width = 40
+      Align = alLeft
+      AutoSize = True
+      StateClicked.Background.Color = 15981500
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 15981500
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 16312531
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 100
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = 16113605
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = 15981500
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsColor
+      StateClicked.Border.Color = 15448451
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = 16312531
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboSolid
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = clBlack
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 11
+      StateClicked.FontEx.Name = 'Verdana'
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16577773
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 16310217
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 100
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = 16310217
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = 16577773
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = 15515276
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = 16577773
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clBlack
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 11
+      StateHover.FontEx.Name = 'Verdana'
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = clWhite
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 15855597
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 13137169
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 15722194
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 100
+      StateNormal.Background.Style = bbsClear
+      StateNormal.Border.Color = 13816015
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = clBlack
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 11
+      StateNormal.FontEx.Name = 'Verdana'
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      BorderSpacing.Around = 2
+      Caption = 'Print Setup...'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      GlyphMargin = 4
+      ParentColor = False
+      Rounding.RoundX = 2
+      Rounding.RoundY = 2
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+      Images = ImageList1
+      ImageIndex = 7
+      ShowCaption = False
+    end
+  end
+  object ActionList1: TActionList
+    Images = ImageList1
+    left = 424
+    top = 136
+    object Action1: TAction
+      Caption = 'Action1'
+      DisableIfNoHandler = False
+      ImageIndex = 6
+    end
+    object Action2: TAction
+      Caption = 'Action2'
+      DisableIfNoHandler = False
+      ImageIndex = 9
+    end
+    object Action3: TAction
+      Caption = 'Action3'
+      DisableIfNoHandler = False
+      ImageIndex = 3
+    end
+  end
+  object ImageList1: TImageList
+    left = 456
+    top = 136
+    Bitmap = {
+      4C690D0000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FAF0EA00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E09870FFFCF0EA00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E09870FFE08860FFFBE9E000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E09870FFFFC0A0FFE18659FFF6E2D6FFFFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E09060FFFFC0A0FFFFB890FFD07840FFF6E2D6FFFFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E08860FFFFB890FFFFA870FFFF9860FFD07040FFF6E2D6FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E08050FFF0B080FFFF9860FFF07830FFD05820FFA05830FFECC8B6FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E07850FFF0A070FFF07830FFD05820FF904820FFE5C7B8FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E07840FFE08850FFD05820FF904820FFE5C7B8FFFFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E07040FFD07040FF904820FFEAD2C6FFFFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E06830FF904820FFE6D0C6FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E06830FFE5C7B8FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E5C5B8FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCF0EA00E08850FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FBE9E000E08860FFD08050FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00F6E2D6FFE08860FFFFC0A0FFD07850FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00F6E2D6FFE08860FFFFC0A0FFFF9870FFD07850FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00F6E2D6FFE08850FFFFC0A0FFFFB080FFFF8850FFC07040FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00F2DA
+      CEFFE08850FFFFC0A0FFFFB090FFFFA070FFFF8040FFB06840FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00E5C7B8FFE07040FFFFA060FFF08850FFF07030FFB06040FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00E5C7B8FFD06830FFF07030FFF06820FFA05830FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00EAD2C6FFD06030FFF06820FFA05030FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00E6D0C6FFD06830FF905030FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E5C7B8FF904820FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E5C5B8FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000A05030FFECDFD7FF000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000A05830FFA05830FFECDFD7FF0000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000C07040FFD07040FFD07040FFC06840FFC06840FFD07040FFB05830FFECDF
+      D7FF00000000000000000000000000000000000000000000000000000000C078
+      60FFE09070FFF0A880FFF0A880FFF0A070FFF09060FFF09060FFD07840FFA058
+      30FF000000000000000000000000000000000000000000000000E0B8A0FFE0A0
+      80FFE19668FFE09060FFE08860FFE08860FFE09060FFF0A880FFC06840FFF7D4
+      C6FF000000000000000000000000000000000000000000000000E0A890FFE090
+      70FFF0C3B4FF000000000000000000000000E08050FFE08860FFF7D8C6FF0000
+      0000000000000000000000000000000000000000000000000000E0A890FFE1BB
+      A5FF00000000000000000000000000000000E09870FFF6E2DAFF00000000E0B0
+      A0FF000000000000000000000000000000000000000000000000E0B0A0FF0000
+      0000F6E2DAFFE09870FF00000000000000000000000000000000E1BBA5FFE0A8
+      90FF00000000000000000000000000000000000000000000000000000000F7D8
+      C6FFE08860FFE08050FF000000000000000000000000F0C3B4FFE09070FFE0A8
+      90FF000000000000000000000000000000000000000000000000F7D4C6FFC068
+      40FFF0A880FFE09060FFE08860FFE08860FFE09060FFE19668FFE0A080FFE0B8
+      A0FF000000000000000000000000000000000000000000000000A05830FFD078
+      40FFF09060FFF09060FFF0A070FFF0A880FFF0A880FFE09070FFC07860FF0000
+      0000000000000000000000000000000000000000000000000000ECDFD7FFB058
+      30FFD07040FFC06840FFC06840FFD07040FFD07040FFC07040FF000000000000
+      000000000000000000000000000000000000000000000000000000000000ECDF
+      D7FFA05830FFA05830FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000ECDFD7FFA05030FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000000000000000002098C0FF20A0
+      C0FF20A0D0FF20A0D0FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000107090FF80D0
+      FFFF80D0FFFF20A0D0FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000106880FF80D0
+      FFFF2090B0FF2090B0FF00000000000000000000000000000000000000000000
+      000000000000000000000000000020A0D0FF20A0D0FF2090B0FF106880FF80D0
+      FFFF80D0FFFF20A0D0FF2098C0FF1080A0FF1088B0FF1078A0FF1080A0FF1070
+      90FF107890FF007090FF0000000020A0D0FF80D0FFFF2090B0FF006080FF70D0
+      FFFF2090B0FF2090B0FF60C0FFFF1080A0FF50B8FFFF1078A0FF40A8FFFF1070
+      90FF30A0F0FF005060FF0000000020A0C0FF80D0FFFF80D0FFFF006070FF70C8
+      FFFF70D0FFFF20A0C0FF60C0FFFF50B8FFFF50B0FFFF40A8FFFF30A0F0FF30A0
+      F0FF3098F0FF004050FF000000002098C0FF107090FF106880FF005870FF60C0
+      FFFF2088B0FF2088B0FF005870FF005060FF005060FF004860FF004860FF0040
+      50FF004050FF004050FF00000000000000000000000000000000005870FF60C0
+      FFFF60C0FFFF2098C0FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000005060FF50B8
+      FFFF1080A0FF1080A0FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000005060FF50B0
+      FFFF50B8FFFF1088B0FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000004860FF40A8
+      FFFF1078A0FF1078A0FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000004860FF30A0
+      F0FF40A8FFFF1080A0FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000004050FF30A0
+      F0FF107090FF107090FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000004050FF3098
+      F0FF30A0F0FF107890FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000004050FF0040
+      50FF005060FF007090FF00000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000FFFFFF00FFFFFF00F0EFEE00CDCAC6FFB1AC
+      A6FF968E86FF868686FFA6A69BFFC6C6BFFFEEEDEC00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E2E0DEFFB1ACA6FFB0B0B0FFE0D8
+      D0FFF0F0F0FFF0F0F0FFD0D8D0FFB0A8A0FFA6A19BFFDADADAFFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00F0EFEE00B1ACA6FFC0C0C0FFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFF8FFFFFFF8F0FFC0B0B0FF9B9B9BFFECEBEA00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00CDCAC6FFB0B0B0FFFFFFFFFFFFFFFFFFFFFF
+      FFFFA09080FFA09080FFFFF8F0FFFFF0E0FFFFE8E0FFA09090FFB8BCB8FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00B1ACA6FFE0D8D0FFFFFFFFFFFFFFFFFFFFFF
+      FFFFA09080FFA08870FFFFF0E0FFFFE8E0FFFFE0D0FFC0B0A0FF909090FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00968686FFF0F0F0FFFFFFFFFFA09080FFA090
+      80FFA08870FF908070FF907060FF806850FFF0D8C0FFE0C8B0FF686868FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00868686FFF0F0F0FFFFFFFFFFA08870FFA080
+      70FF907860FF907060FF806850FF806050FFF0D0C0FFE0C0B0FF686159FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00A6A69BFFD0D0D0FFFFF8FFFFFFF8F0FFFFF0
+      E0FF806850FF806050FFF0D8C0FFF0D0C0FFF0D0B0FFC0A890FF858B85FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00C6C3BFFFB0A8A0FFFFF8F0FFFFF0E0FFFFE8
+      E0FF806050FF806050FFF0D0C0FFF0D0B0FFF0D0B0FF908070FFA6AEAEFFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00EEEDEC009B9B9BFFB0B0A0FFFFE8E0FFFFE0
+      D0FFF0D8C0FFF0D0C0FFF0D0B0FFF0D0B0FFA09080FF7A807AFF608890FFCCD9
+      E0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00DADADAFF9B9690FFA09090FFC0B0
+      A0FFE0C8B0FFE0C0B0FFC0A890FF908070FF858585FF80C0D0FFA0D8F0FF6098
+      B0FFCCD9E0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00EAEBEA00B8B8B8FF9090
+      90FF686159FF596159FF858B85FF6E7A7AFF3080A0FF40B8E0FF90E0F0FF90E0
+      F0FF6098B0FFCCD9E0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00BDC7CCFF305060FF3088B0FF40B8E0FF90E0
+      F0FF90D0E0FF6090A0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00BDC7CCFF305060FF4088A0FF3090
+      B0FF304050FFD2DEE2FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00BDC7CCFF204860FF3030
+      40FFBDC2C7FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00F0EFEE00CDCAC6FFB1AC
+      A6FF968E86FF868686FFA6A69BFFC6C6BFFFEEEDEC00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E2E0DEFFB1ACA6FFB0B0B0FFE0D8
+      D0FFF0F0F0FFF0F0F0FFD0D8D0FFB0A8A0FFA6A19BFFDADADAFFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00F0EFEE00B1ACA6FFC0C0C0FFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFF8FFFFFFF8F0FFC0B0B0FF9B9B9BFFECEBEA00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00CDCAC6FFB0B0B0FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFF8FFFFFFF8F0FFFFF0E0FFFFE8E0FFA09090FFB8BCB8FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00B1ACA6FFE0D8D0FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFF8FFFFFFF8F0FFFFF0E0FFFFE8E0FFFFE0D0FFC0B0A0FF909090FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00968686FFF0F0F0FFFFFFFFFFA09080FFA090
+      80FFA08870FF908070FF907060FF806850FFF0D8C0FFE0C8B0FF686868FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00868686FFF0F0F0FFFFFFFFFFA08870FFA080
+      70FF907860FF907060FF806850FF806050FFF0D0C0FFE0C0B0FF686159FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00A6A69BFFD0D0D0FFFFF8FFFFFFF8F0FFFFF0
+      E0FFFFE8E0FFFFE0D0FFF0D8C0FFF0D0C0FFF0D0B0FFC0A890FF858B85FFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00C6C3BFFFB0A8A0FFFFF8F0FFFFF0E0FFFFE8
+      E0FFFFE0D0FFF0D8C0FFF0D0C0FFF0D0B0FFF0D0B0FF908070FFA6AEAEFFFFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00EEEDEC009B9B9BFFB0B0A0FFFFE8E0FFFFE0
+      D0FFF0D8C0FFF0D0C0FFF0D0B0FFF0D0B0FFA09080FF7A807AFF608890FFCCD9
+      E0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00DADADAFF9B9690FFA09090FFC0B0
+      A0FFE0C8B0FFE0C0B0FFC0A890FF908070FF858585FF80C0D0FFA0D8F0FF6098
+      B0FFCCD9E0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00EAEBEA00B8B8B8FF9090
+      90FF686159FF596159FF858B85FF6E7A7AFF3080A0FF40B8E0FF90E0F0FF90E0
+      F0FF6098B0FFCCD9E0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00BDC7CCFF305060FF3088B0FF40B8E0FF90E0
+      F0FF90D0E0FF6090A0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00BDC7CCFF305060FF4088A0FF3090
+      B0FF304050FFD2DEE2FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00BDC7CCFF204860FF3030
+      40FFBDC2C7FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B09080FFB09080FFB09080FFB09080FFB09080FFB09080FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B09080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF807060FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B09080FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFF807060FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00A6A6A6FF5058
+      50FFB09080FFFFFFFFFFFFFFFFFFFFF8FFFFFFF8FFFF807060FF505850FF9B97
+      9BFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00909090FF7068
+      70FFB09080FFFFFFFFFFFFFFFFFFFFF8FFFFFFF8FFFF807060FF707070FF8585
+      85FFFFFFFF00FFFFFF00FFFFFF00DBDBDBFFB0B0B0FFB0B0B0FF909090FF9090
+      90FF909090FF909090FF909090FF908890FF908890FF908890FF908880FF8088
+      80FF909090FF909090FFBEC2BEFFA098A0FFFFFFFFFFFFFFFFFF909090FFE0D8
+      E0FFE0D8E0FFE0D8E0FFE0D8E0FFE0D8E0FFE0D8E0FFE0D8E0FFE0D8E0FF8088
+      80FFF0F8F0FFF0F8F0FF706860FF909090FFF0F8F0FFF0F0F0FFA0A0A0FFD0D0
+      D0FFD0D0D0FFD0D0D0FFD0D0D0FFD0D0D0FFD0D0D0FFD0D0D0FFD0D0D0FF9098
+      90FFF0F0F0FFF0E8F0FF706860FF909090FFD0D0D0FFD0C8D0FF808880FFB0A8
+      B0FFB0A8B0FFB0A8B0FFB0A8B0FFFFA860FFFFA860FFFFA860FFB0B0B0FF8078
+      80FFC0C8C0FFC0C0C0FF706860FF908890FFC0B8C0FFD0C8D0FF808880FFB0A8
+      B0FFB0A8B0FFB0A8B0FFB0A8B0FFB0B0B0FFB0B0B0FFB0B0B0FFB0B0B0FF8078
+      80FFC0C8C0FFB0B0B0FF706860FF908890FF908890FF908890FF707070FF7070
+      70FF707070FF707070FF707070FF707070FF707070FF707070FF707070FF7070
+      70FF908890FF908080FF706860FF909090FFA0A0A0FF909890FF403840FF4038
+      40FF908870FFE0E8E0FFF0E0B0FFF0D8B0FFF0D8B0FF807060FF403840FF4038
+      40FFA0A0A0FFA0A0A0FF706860FF909090FF909890FFA0A0A0FF403840FF4038
+      40FFA09080FFFFFFFFFFFFE8D0FFE07850FFF0D8B0FF807060FF403840FF4038
+      40FF909090FF909090FF706860FFC8C4C8FF908890FF706060FF504850FF5050
+      50FFA09080FFFFFFFFFFF0D8B0FFF0D8B0FFF0D8B0FF807060FF505050FF5048
+      50FF706060FF706860FF9B9B9BFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00A09080FFFFFFFFFFFFFFFFFFFFF8FFFFFFF8FFFF807060FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00A08870FF907860FF807060FF807060FF807060FF807060FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00C0A8A0FFC0A8A0FFC0A8A0FFC0A8A0FFC0A8
+      A0FFC0A8A0FFC0A8A0FFC0A8A0FFE6DED6FFFFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00C0A8A0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC0A8A0FF604830FFE6DED6FFFFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00C0A8A0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC0A890FFD0C8C0FF604830FFE6DED6FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00C0A8A0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFA08870FFA08870FFA08870FFA08870FFA08870FFA088
+      70FFFFFFFF00FFFFFF00FFFFFF00C0A8A0FFFFFFFFFFB0A8A0FF605860FFB0B0
+      B0FFFFFFFFFFFFFFFFFFA08870FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8070
+      60FFFFFFFF00FFFFFF00FFFFFF00C0A8A0FFFFFFFFFF605860FFFFFFFFFF6058
+      60FFFFFFFFFF505850FFA08870FFFFFFFFFFFFFFFFFFFFF8FFFFFFF8FFFF8070
+      60FF505850FFFFFFFF00FFFFFF00C0A8A0FFFFFFFFFFB0B0B0FF605860FFC0B8
+      B0FFFFFFFFFF706870FFA08870FFFFFFFFFFFFFFFFFFFFF8FFFFFFF8FFFF8070
+      60FF707070FFFFFFFF00FFFFFF00C0A8A0FFFFFFFFFFFFFFFFFFFFFFFFFFC0B8
+      C0FF707070FF707070FF707070FF707070FF707070FF707070FF707070FF7070
+      70FF707070FF707070FFBEC2BEFFC0A890FFFFFFFFFFD0D0D0FF605860FF7070
+      70FFFFFFFFFF909090FFE0D8E0FFE0D8E0FFE0D8E0FFE0D8E0FFE0D8E0FFE0D8
+      E0FF808880FFFFF8FFFF706860FFB0A090FFFFFFFFFF605860FFFFFFFFFF7070
+      70FFF0F8F0FFA0A0A0FFD0D0D0FFD0D0D0FFD0D0D0FFD0D0D0FFD0D0D0FFD0D0
+      D0FF909890FFF0F0F0FF706860FFB0A090FFFFFFFFFFE0E0E0FF605860FF7070
+      70FFE0E8E0FF707070FFB0A8B0FFB0A8B0FFB0A8B0FFFFA860FFFFA860FFB0B0
+      B0FF707070FFD0D8D0FF706860FFB0A090FFFFFFFFFFFFFFFFFFFFF8FFFF7070
+      70FFE0E0E0FF707070FFB0A8B0FFB0A8B0FFB0A8B0FFB0B0B0FFB0B0B0FFB0B0
+      B0FF707070FFC0C8C0FF706860FFB0A090FFFFFFFFFFF0E8E0FFF0F0F0FF7070
+      70FF908890FF707070FF707070FF707070FF707070FF707070FF707070FF7070
+      70FF707070FF908080FF706860FFB0A090FF604830FF604830FF604830FF7070
+      70FFB0B0B0FF403840FFA08870FFFFFFFFFFF0E0B0FFF0D8B0FFF0D8B0FF8070
+      60FF403840FFC0B8C0FF706860FFFFFFFF00FFFFFF00FFFFFF00FFFFFF007070
+      70FF706060FF504850FFA08870FFFFFFFFFFFFFFFFFFFFF8FFFFFFF8FFFF8070
+      60FF504850FF706860FF707070FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF009A8471FF9A8471FF806D59FF806D59FF806D59FF806D
+      59FFFFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000
+      000000000000CE8889FED79091FFCD8182FFCD7B7CFF00000000000000000000
+      00000000000000000000000000000000000000000000F5AEAF37E8A0A0FADE8F
+      90FE00000000CC8386F1FFBBBCFFFCB6B7FFA0575AFF00000000DAAFAFFFA969
+      68FFAA696AFF000000000000000000000000F5ADAE19E49291FAFAB5B6FFFEB9
+      BAFFCA7979FDC37475FFFCB6B8FFF9B1B2FFC07A7BFFA26263FFB87374FFE593
+      93FFC37878FFA46465FF0000000000000000F4A9AA18BB4E4EFAF8B2B3FFFFBB
+      BCFFFDB9BAFFFCB7B8FFF9B1B2FFF4AAABFFEEA3A3FFE89999FFE59394FFE08C
+      8CFFBE7172FF7A4747B4000000000000000000000000E8999A18BB5F60FDFBB6
+      B7FFFDB7B8FFD78E8FFF8B4849FF884748FFD18687FFE49393FFE08C8CFFC375
+      75FF6A393AFF00000000000000006A343635DF8283D0D98788C4E09596F8FAB4
+      B6FFDB9293FFA16768E9CD8E8E6BCF8F8F6BA97675FFC07374FFDB8584FFCE78
+      78FFA86363FFAD7575FFA56E6DFF69333563DE8686FFFDC0C1FFFBB5B6FFF8B1
+      B2FF904949FFD998996B000000000000000000000000995758FFD67E7DFFD176
+      75FFC5696AFF9E5152FF804041FF6A333562DD8586FFFCB6B8FFF9B1B2FFF4AA
+      ABFF7D3D3DFFD495956B0000000000000000000000009B5758FFD17575FFCC6E
+      6DFFC76766FFC46161FF7D3D3EFF69333543B75A5BFFAC595AFFB45C5DFFEFA2
+      A3FFC17879FF885252E9C988886BC582836CB88482FFB86767FFCC6E6DFFC867
+      66FF8D3B3BFF703839FF6E3637FF000000000000000000000000B36A6CFDE597
+      98FFE59393FFC27475FFA46061FFA05C5DFFB96868FFCC6E6DFFC76766FFA553
+      53FF754545FF000000000000000000000000C17C7D65C47F80E4BC7575FFE593
+      93FFE08C8CFFDC8585FFD67D7DFFD17675FFCC6E6DFFC86766FFC36161FFBE5C
+      5BFF75393AFFD6B2ADE30000000000000000B5696A6CA65E5EFFE49393FFE08C
+      8CFFCB7C7CFFC57574FFD17575FFCC6E6EFFC86767FFA35353FFB45857FFC15D
+      5CFFBA5A59FF703738FF0000000000000000B268693E894849D4C17677FFC97B
+      7BFF5F2A2AEC692F30ECBB6667FFC86766FF904545FF4D2624FF733839FFA851
+      51FF763839FF00000000000000000000000000000000000000006C3738C77036
+      36E200000000401E1F978E4B4BFFC46160FF602D2DFF00000000B959587E682D
+      2EED8A4242710000000000000000000000000000000000000000000000000000
+      0000000000005E373776733838FF763B3CFF602E2FFF00000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00C0B8C0FFC0C0C0FFD0C8D0FFC0C0C0FFB0B8
+      B0FFB0B0B0FFB0B0B0FFA0A0A0FF808080FF606060FF404840FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00E0DEE0FF707070FFC0C8C0FFFFFFFFFFF0F8
+      F0FFF0F0F0FFD0D8D0FFB0A8B0FF606060FF404840FFD2D2D2FFFFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E6E4E6FF707070FFF0E8F0FFFFF8
+      FFFFF0E8E0FFD0D0D0FF707070FF404840FFC08860FFE09060FFE08860FFD080
+      50FFD07840FFD07040FFD06830FFFFFFFF00FFFFFF00DBDBDBFF808880FFF0F0
+      F0FFE0D8D0FF909890FF404840FFD0A080FFFFB090FFFFA880FFF0A070FFF098
+      70FFF09860FFF09860FFD06830FFFFFFFF00FFFFFF00FFFFFF00D4D7D4FF9090
+      90FFD0C8C0FF505850FFB08070FFE09870FFE09070FFE09060FFE08060FFD080
+      50FFD07840FFD07040FFD06830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF007070
+      70FF909890FF504850FFF0E8F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFF8FFFFE0E0E0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF007070
+      70FF707070FF404040FFB0B8B0FF909090FFA098A0FFE0E0E0FF101810FF3028
+      20FF706050FFD0D8D0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF007070
+      70FF505050FF100810FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF303030FFFFFF
+      FFFF909090FFD0C8D0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF007070
+      70FF404040FF000800FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFF606050FF8078
+      70FFA0A0A0FFC0C0C0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B0A090FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFFF0F0F0FFE0E8E0FFE0D8
+      E0FFD0D0D0FFB0B8B0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B0A090FFFFFFFFFFB0B0B0FF808880FFA0A0A0FFD0D0D0FF201810FF3028
+      20FF706050FFB0B0B0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B0A090FFFFF8FFFFF0F8F0FFF0F0F0FFE0E8E0FFE0D8E0FF303030FFFFFF
+      FFFF909090FFB0A8A0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B0A090FFF0F0F0FFF0E8F0FFE0E0E0FFE0D8D0FFD0D0D0FF606050FF8078
+      70FFA0A0A0FFA0A0A0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B0A090FFE0E8E0FFD0D8D0FFD0D0D0FFC0C0C0FFC0B8C0FFB0B0B0FFB0A8
+      A0FFA0A0A0FFA098A0FF604830FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00B0A090FF604830FF604830FF604830FF604830FF604830FF604830FF6048
+      30FF604830FF604830FF604830FFD0B0A0FFD0B0A0FFD0B0A0FFD0B0A0FFC0B0
+      A0FFC0B0A0FFC0A8A0FFC0A8A0FFC0A8A0FFC0A8A0FFB0A8A0FF90A0B0FF8098
+      B0FF7090A0FF7088A0FF6080A0FFD0B0A0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFF8FFFFFFF8F0FFFFF8F0FFFFF0F0FFFFF0F0FFFFE8E0FF8098B0FFFFFF
+      FFFFFFFFFFFFFFFFFFFF507890FFD0B0A0FFFFFFFFFFFFFFFFFFFFFFFFFFFFF8
+      FFFFFFF8F0FFFFF8F0FFFFF0F0FFFFF0F0FFFFE8E0FFFFE8E0FF7090A0FF0050
+      FFFFFFFFFFFF0050FFFF507090FFD0B0A0FFC0B0A0FFC0B0A0FFC0A8A0FFC0A8
+      A0FFC0A8A0FFC0A8A0FFB0A8A0FFB0A0A0FFB0A090FFB0A090FF7088A0FF6080
+      A0FF507890FF507090FF406890FFF0A080FFF0A080FFF0A080FFF0A080FFF0A0
+      80FFF09880FFF09870FFF09070FFF08860FFF08060FFF08050FFF07850FFF078
+      40FFFFFFFF00FFFFFF00FFFFFF00F0A080FFFFA880FFFFA880FFFFA880FFFFA8
+      80FFFFA880FFFFA880FFFFA880FFFFA880FFFFA070FFF0A070FFF0A070FFE070
+      40FFFFFFFF00FFFFFF00FFFFFF00F0A080FFF0A080FFF0A080FFF09880FFF098
+      70FFF09070FFF08860FFF08060FFF08050FFF07850FFF07840FFE07040FFE070
+      40FFFFFFFF00FFFFFF00FFFFFF00D0B0A0FFFFFFFFFFFFFFFFFFC0B0A0FFFFF8
+      F0FFFFF8F0FFC0A8A0FFFFF8F0FFFFF0F0FFC0A090FFFFF0E0FFFFE8E0FF9070
+      60FFFFFFFF00FFFFFF00FFFFFF00D0A8A0FFFFFFFFFFFFF8FFFFC0B0A0FFFFF8
+      F0FFFFF8F0FFC0A890FFFFF0F0FFFFF0E0FFC0A090FFFFE8E0FFFFE8E0FF9070
+      60FFFFFFFF00FFFFFF00FFFFFF00D0A890FFC0B0A0FFC0B0A0FF5080D0FF0060
+      FFFF0060FFFF5078D0FFC0A090FFC0A090FFC09890FFC09880FFC09880FF8068
+      50FFFFFFFF00FFFFFF00FFFFFF00C0A090FFFFF8F0FFFFF8F0FF0060FFFF50C0
+      FFFF50C0FFFF0060FFFFFFF0E0FFFFE8E0FFC09880FFFFE8E0FFFFE8D0FF8060
+      50FFFFFFFF00FFFFFF00FFFFFF00C0A090FFFFF8F0FFFFF8F0FF0060FFFF50C0
+      FFFF50C0FFFF0060FFFFFFE8E0FFFFE8E0FFC09880FFFFE8D0FFFFE0D0FF8060
+      50FFFFFFFF00FFFFFF00FFFFFF00C09890FFC0A8A0FFC0A890FF5078D0FF0060
+      FFFF0060FFFF5078D0FFC09880FFC09880FFC09080FFB09080FFB09070FF7058
+      40FFFFFFFF00FFFFFF00FFFFFF00B09080FFFFF8F0FFFFF0F0FFC0A090FFFFF0
+      E0FFFFE8E0FFC09880FFFFE8E0FFFFE8D0FFB09080FFFFE0D0FFFFE0D0FF7058
+      40FFFFFFFF00FFFFFF00FFFFFF00B09080FFFFF0F0FFFFF0E0FFC0A090FFFFE8
+      E0FFFFE8E0FFC09880FFFFE8D0FFFFE0D0FFB09070FFFFE0D0FFFFE0D0FF7050
+      40FFFFFFFF00FFFFFF00FFFFFF00B0887000A08070FFA08070FF907860FF9070
+      60FF907060FF806850FF806050FF806050FF705840FF705840FF705040FF7050
+      30FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00EFF0
+      EF008E8E8EFF90C0A0FF90C090FF80C090FF80B890FF80B890FF80B880FF80B0
+      80FF80B080FF70A870FF70A870FFFFFFFF00FFFFFF00FFFFFF00FFFFFF002028
+      20FFFFFFFFFF90C0A0FFC0E8C0FFC0E8C0FFC0E0C0FFB0E0C0FFB0D8B0FFA0D0
+      A0FF90C890FF80C080FF80B880FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00A4A4
+      A4FF808080FF80C090FFC0E0C0FF608860FF508860FF608860FF609060FF6090
+      60FF609860FF60A060FF60A860FFFFFFFF00FFFFFF00FFFFFF00FFFFFF002028
+      20FFFFFFFFFF80B890FFC0E0C0FF608860FF70A870FF80B080FF80B890FF90C8
+      90FFA0C8A0FF60A070FF609860FFFFFFFF00FFFFFF00FFFFFF00FFFFFF009690
+      96FF808080FF80B080FFB0E0C0FF608860FF80B880FF90C090FF90C8A0FFA0D0
+      A0FFA0D8B0FF60A870FF509850FFFFFFFF00FFFFFF00FFFFFF00FFFFFF002020
+      20FFFFFFFFFF70A880FFB0D8B0FF609860FF609860FF609860FF60A070FF60A0
+      70FF70A870FF70A870FF509050FFFFFFFF00FFFFFF00FFFFFF00FFFFFF009690
+      96FF807880FF70A070FFA0D8B0FF90C890FF80C890FF80C880FF80C080FF70C0
+      80FF70B870FF60A870FF508850FFFFFFFF00FFFFFF00FFFFFF00FFFFFF006060
+      60FFFFFFFFFF70A880FFA0D0A0FF80C890FF80C080FF80C080FF70C080FF70B8
+      70FF70B070FF609860FF408040FFFFFFFF00FFFFFF00ECECEC00909890FF9088
+      90FF808080FF709870FF90D0A0FF80C080FF80B880FF70B880FF70B870FF70B0
+      70FF60A060FF509060FF407040FFFFFFFF00F5F5F500909090FFF0F0F0FFF0F0
+      F0FFE0D8D0FF606060FF80B080FF70B070FF70B870FF70B070FF60A870FF60A0
+      60FF609060FF508850FF407040FFF4F4F400A09890FFF0F0F0FFFFFFFFFF4038
+      40FFFFF8F0FFC0B8B0FF605850FF70A870FF60A870FF60A060FF609860FF5090
+      60FF508050FF507850FF406040FFDBDFDBFFA0A0A0FFFFF8F0FFFFF8F0FF2028
+      20FF202020FFF0C8B0FF202020FF60A060FF509050FF508050FF407850FF4070
+      40FF407040FF306840FF306040FFDBDBDBFF808080FFD2CAC3FFFEF0F0FFFFE8
+      D0FFFFD0C0FFC0A890FF303030FF607860FF506850FF405850FF405040FF4048
+      40FF304030FF303830FF203020FFFFFFFF00BEBABEFF606060FFE0D0C0FFFECA
+      B4FFD0B0A0FF403840FFC2C0C2FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C2C2C2FF4A524AFF2028
+      20FF303830FFB6B3B0FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00E6EEF50090B8E0FF90B8E0FF90B8E0FF90B8
+      E0FF90B8E0FFDEE6F200FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF0090B8E0FFC0E8F0FFC0F0FFFFC0F0FFFFB0F0
+      FFFFA0E8FFFF90B8E0FFB6CEE6FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF0090B8E0FF90B8E0FF90B8E0FF90B8E0FF90B8
+      E0FF90B8E0FF80B8E0FF80B8E0FF80B8E0FF80B0E0FF80B0E0FF70B0E0FFC2D4
+      E6FFFFFFFF00FFFFFF00FFFFFF0090B0E0FFB0F0FFFFB0F0FFFFB0F0FFFFB0E8
+      FFFFB0E8FFFFB0E8FFFFA0E8FFFFA0E8FFFFA0E8FFFFA0E8FFFFA0E0FFFF6090
+      C0FFFFFFFF00FFFFFF00FFFFFF0080B0E0FFB0F0FFFFA0E8FFFF90D8F0FF90B8
+      E0FF90B8E0FF90B8E0FF90B8E0FF90B8E0FF80D0F0FF80E0F0FF70D8F0FF6090
+      C0FFFFFFFF00FFFFFF00FFFFFF0080B0D0FFB0E8FFFF90E8FFFF90B8E0FFC0E8
+      F0FFC0F0FFFFC0F0FFFFB0F0FFFFA0E8FFFF90B8E0FF80C0E0FF70D0F0FF6090
+      C0FFFFFFFF00FFFFFF00FFFFFF0080A8D0FFA0E8FFFF90E0FFFF90B8E0FF90B8
+      E0FF90B8E0FF90B8E0FF90B8E0FF90B8E0FF80B8E0FF80B8E0FF80B8E0FF80B0
+      E0FF80B0E0FF70B0E0FFC2D4E6FF80A0D0FFA0E8FFFF90E0FFFF90B0E0FFB0F0
+      FFFFB0F0FFFFB0F0FFFFB0E8FFFFB0E8FFFFB0E8FFFFA0E8FFFFA0E8FFFFA0E8
+      FFFFA0E8FFFFA0E0FFFF6090C0FF80A0D0FFA0E8FFFF90E0FFFF80B0E0FFB0F0
+      FFFFA0E8FFFF90E8FFFF90E8FFFF90E8FFFF90E0FFFF90E0FFFF90E0FFFF90E0
+      FFFF80E0F0FF70D8F0FF6090C0FF8098C0FFA0E0FFFF70D8F0FF80B0D0FFB0E8
+      FFFF90E8FFFF90E8FFFF90E0FFFF90E0FFFF90E0FFFF90E0FFFF80E0FFFF80E0
+      F0FF80D8F0FF70D0F0FF6090C0FF7AAACFFF7098C0FF7098C0FF80A8D0FFA0E8
+      FFFF90E0FFFF90E0FFFF90E0FFFF90E0FFFF80E0FFFF80E0F0FF80E0F0FF80E0
+      F0FF80D8F0FF70D0F0FF6090B0FFFFFFFF00FFFFFF00FFFFFF0080A0D0FFA0E8
+      FFFF90E0FFFF90E0FFFF90E0FFFF80E0F0FF80E0F0FF80E0F0FF80D8F0FF80D8
+      F0FF70D8F0FF60D0F0FF6090B0FFFFFFFF00FFFFFF00FFFFFF0080A0D0FFA0E8
+      FFFF90E0FFFF80E0FFFF80E0F0FF80E0F0FF80E0F0FF80D8F0FF80D8F0FF80D8
+      F0FF70D8F0FF60D0F0FF6090B0FFFFFFFF00FFFFFF00FFFFFF008098C0FFA0E0
+      FFFF70D8F0FF70D8F0FF70D0F0FF70D0F0FF70D0F0FF60D0F0FF60D0F0FF60D0
+      F0FF60D0F0FF60C8F0FF6088B0FFFFFFFF00FFFFFF00FFFFFF007AAACFFF7098
+      C0FF7098C0FF7098C0FF6098C0FF6098C0FF6090C0FF6090C0FF6090C0FF6090
+      C0FF6088B0FF6088B0FF85ACD3FF
+    }
+  end
+  object PopupMenu1: TPopupMenu
+    left = 304
+    top = 136
+    object MenuItem1: TMenuItem
+      Action = Action1
+    end
+    object MenuItem2: TMenuItem
+      Action = Action2
+    end
+  end
+  object PopupMenu2: TPopupMenu
+    Alignment = paCenter
+    left = 344
+    top = 136
+    object MenuItem3: TMenuItem
+      Action = Action1
+    end
+    object MenuItem4: TMenuItem
+      Action = Action2
+    end
+    object MenuItem5: TMenuItem
+      Caption = '-'
+    end
+    object MenuItem6: TMenuItem
+      Action = Action3
+    end
+  end
+  object PopupMenu3: TPopupMenu
+    Alignment = paRight
+    left = 384
+    top = 136
+    object MenuItem7: TMenuItem
+      Action = Action1
+    end
+    object MenuItem8: TMenuItem
+      Action = Action2
+    end
+    object MenuItem9: TMenuItem
+      Caption = '-'
+    end
+    object MenuItem10: TMenuItem
+      Action = Action3
+    end
+  end
+end

+ 80 - 0
test/test_bccontrols/test_bcbutton/unit1.pas

@@ -0,0 +1,80 @@
+unit Unit1;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ActnList,
+  Menus, StdCtrls, ExtCtrls, BCButton, BCPanel;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    Action1: TAction;
+    Action2: TAction;
+    Action3: TAction;
+    ActionList1: TActionList;
+    BCButton1: TBCButton;
+    BCButton10: TBCButton;
+    BCButton11: TBCButton;
+    BCButton12: TBCButton;
+    BCButton13: TBCButton;
+    BCButton14: TBCButton;
+    BCButton15: TBCButton;
+    BCButton16: TBCButton;
+    BCButton17: TBCButton;
+    BCButton18: TBCButton;
+    BCButton2: TBCButton;
+    BCButton3: TBCButton;
+    BCButton4: TBCButton;
+    BCButton5: TBCButton;
+    BCButton6: TBCButton;
+    BCButton7: TBCButton;
+    BCButton8: TBCButton;
+    BCButton9: TBCButton;
+    BCPanel1: TBCPanel;
+    Bevel1: TBevel;
+    Bevel2: TBevel;
+    CheckBox1: TCheckBox;
+    ImageList1: TImageList;
+    MenuItem1: TMenuItem;
+    MenuItem10: TMenuItem;
+    MenuItem2: TMenuItem;
+    MenuItem3: TMenuItem;
+    MenuItem4: TMenuItem;
+    MenuItem5: TMenuItem;
+    MenuItem6: TMenuItem;
+    MenuItem7: TMenuItem;
+    MenuItem8: TMenuItem;
+    MenuItem9: TMenuItem;
+    PopupMenu1: TPopupMenu;
+    PopupMenu2: TPopupMenu;
+    PopupMenu3: TPopupMenu;
+    Shape1: TShape;
+    procedure CheckBox1Change(Sender: TObject);
+  private
+    { private declarations }
+  public
+    { public declarations }
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.CheckBox1Change(Sender: TObject);
+begin
+  BCButton1.ShowCaption := CheckBox1.Checked;
+  BCButton7.ShowCaption := CheckBox1.Checked;
+end;
+
+end.
+

+ 843 - 0
test/test_bccontrols/test_bccontrols/bcsamples.pas

@@ -0,0 +1,843 @@
+unit bcsamples;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, Controls, Graphics,
+  StdCtrls, LCLProc, LCLType,
+  BCButton, BCTypes,
+  BGRABitmap, BGRABitmapTypes, BGRAGradients;
+
+const
+  {Accent Colors}
+  acMagenta = TColor($009700FF);
+  acPurple = TColor($00FF00A2);
+  acTeal = TColor($00A9AB00);
+  acLime = TColor($0026BF8C);
+  acBrown = TColor($000050A0);
+  acPink = TColor($00B871E6);
+  acOrange = TColor($000996F0);
+  acBlue = TColor($00E2A11B);
+  acRed = TColor($000014E5);
+  acGreen = TColor($00339933);
+  {Facebook Colors}
+  fbBlue = TColor($00AA785F);
+  fbGreen = TColor($004BA567);
+  fbGray = TColor($00F8F8F8);
+  {Windows 8 Color Scheme - Background}
+  clScheme1_Background = TColor($00252525);
+  clScheme2_Background = TColor($00252525);
+  clScheme3_Background = TColor($00252525);
+  clScheme4_Background = TColor($00252525);
+  clScheme5_Background = TColor($0000172E);
+  clScheme6_Background = TColor($0000004E);
+  clScheme7_Background = TColor($0038004E);
+  clScheme8_Background = TColor($004E002D);
+  clScheme9_Background = TColor($0068001F);
+  clScheme10_Background = TColor($004E1E00);
+  clScheme11_Background = TColor($00604D00);
+  clScheme12_Background = TColor($00004A00);
+  clScheme13_Background = TColor($002A9915);
+  clScheme14_Background = TColor($00196CE5);
+  clScheme15_Background = TColor($001B1BB8);
+  clScheme16_Background = TColor($006C1BB8);
+  clScheme17_Background = TColor($00B81B69);
+  clScheme18_Background = TColor($00B8581B);
+  clScheme19_Background = TColor($00E39C56);
+  clScheme20_Background = TColor($00AAAA00);
+  clScheme21_Background = TColor($001FBA83);
+  clScheme22_Background = TColor($00099DD3);
+  clScheme23_Background = TColor($00B764E0);
+  clScheme24_Background = TColor($00696969);
+  clScheme25_Background = TColor($00696969);
+  {Windows 8 Color Scheme - Selection}
+  clScheme1_Selection = TColor($0000B3F4);
+  clScheme2_Selection = TColor($0000BA78);
+  clScheme3_Selection = TColor($00EC7326);
+  clScheme4_Selection = TColor($003D11AE);
+  clScheme5_Selection = TColor($00002F63);
+  clScheme6_Selection = TColor($00001EB0);
+  clScheme7_Selection = TColor($004F00C1);
+  clScheme8_Selection = TColor($00AC0072);
+  clScheme9_Selection = TColor($00B41746);
+  clScheme10_Selection = TColor($00C16A00);
+  clScheme11_Selection = TColor($00878200);
+  clScheme12_Selection = TColor($00009919);
+  clScheme13_Selection = TColor($003FC100);
+  clScheme14_Selection = TColor($001D98FF);
+  clScheme15_Selection = TColor($00122EFF);
+  clScheme16_Selection = TColor($00771DFF);
+  clScheme17_Selection = TColor($00FF40AA);
+  clScheme18_Selection = TColor($00FFAE1F);
+  clScheme19_Selection = TColor($00FFC556);
+  clScheme20_Selection = TColor($00CCD800);
+  clScheme21_Selection = TColor($0000D191);
+  clScheme22_Selection = TColor($0000B7E1);
+  clScheme23_Selection = TColor($00BC76FF);
+  clScheme24_Selection = TColor($00A4A400);
+  clScheme25_Selection = TColor($00237DFF);
+
+type
+  TBCSampleStyle = (ssDefault, ssWindows7, ssWindows7ToolBar, ssOffice2010,
+    ssFlashPlayer, ssMacOSXLion, ssWindows8_1, ssWindows8_2, ssWindows8_3,
+    ssWindows8_4, ssWindows8_5, ssWindows8_6, ssWindows8_7, ssWindows8_8,
+    ssWindows8_9, ssWindows8_10, ssWindows8_11, ssWindows8_12, ssWindows8_13,
+    ssWindows8_14, ssWindows8_15, ssWindows8_16, ssWindows8_17, ssWindows8_18,
+    ssWindows8_19, ssWindows8_20, ssWindows8_21, ssWindows8_22, ssWindows8_23,
+    ssWindows8_24, ssWindows8_25);
+
+  TBCSampleDrawing = (sdDefault, sdFlashPlayerBody, sdFlashPlayerButtonPanel,
+    sdWindows7Toolbar, sdiOSBar, sdiOSToolBar, sdiOSBackground,
+    sdWindows8_1, sdWindows8_2, sdWindows8_3,
+    sdWindows8_4, sdWindows8_5, sdWindows8_6, sdWindows8_7, sdWindows8_8,
+    sdWindows8_9, sdWindows8_10, sdWindows8_11, sdWindows8_12, sdWindows8_13,
+    sdWindows8_14, sdWindows8_15, sdWindows8_16, sdWindows8_17, sdWindows8_18,
+    sdWindows8_19, sdWindows8_20, sdWindows8_21, sdWindows8_22, sdWindows8_23,
+    sdWindows8_24, sdWindows8_25);
+
+const
+  BCSampleStyleStr: array[TBCSampleStyle] of string =
+    ('Default', 'Windows 7', 'Windows 7 ToolBar', 'Office 2010',
+    'Flash Player', 'Mac OSX Lion', 'Windows 8 Scheme 1', 'Windows 8 Scheme 2',
+    'Windows 8 Scheme 3', 'Windows 8 Scheme 4', 'Windows 8 Scheme 5'
+    , 'Windows 8 Scheme 6', 'Windows 8 Scheme 7', 'Windows 8 Scheme 8'
+    , 'Windows 8 Scheme 9', 'Windows 8 Scheme 10', 'Windows 8 Scheme 11'
+    , 'Windows 8 Scheme 12', 'Windows 8 Scheme 13', 'Windows 8 Scheme 14'
+    , 'Windows 8 Scheme 15', 'Windows 8 Scheme 16', 'Windows 8 Scheme 17'
+    , 'Windows 8 Scheme 18', 'Windows 8 Scheme 19', 'Windows 8 Scheme 20'
+    , 'Windows 8 Scheme 21', 'Windows 8 Scheme 22', 'Windows 8 Scheme 23'
+    , 'Windows 8 Scheme 24', 'Windows 8 Scheme 25');
+
+  BCSampleDrawingStr: array[TBCSampleDrawing] of string =
+    ('Default', 'Flash Player Body', 'Flash Player Button Panel',
+    'Windows 7 ToolBar', 'iOS Bar', 'iOS ToolBar', 'iOS Background',
+    'Windows 8 Scheme 1', 'Windows 8 Scheme 2',
+    'Windows 8 Scheme 3', 'Windows 8 Scheme 4', 'Windows 8 Scheme 5'
+    , 'Windows 8 Scheme 6', 'Windows 8 Scheme 7', 'Windows 8 Scheme 8'
+    , 'Windows 8 Scheme 9', 'Windows 8 Scheme 10', 'Windows 8 Scheme 11'
+    , 'Windows 8 Scheme 12', 'Windows 8 Scheme 13', 'Windows 8 Scheme 14'
+    , 'Windows 8 Scheme 15', 'Windows 8 Scheme 16', 'Windows 8 Scheme 17'
+    , 'Windows 8 Scheme 18', 'Windows 8 Scheme 19', 'Windows 8 Scheme 20'
+    , 'Windows 8 Scheme 21', 'Windows 8 Scheme 22', 'Windows 8 Scheme 23'
+    , 'Windows 8 Scheme 24', 'Windows 8 Scheme 25');
+
+function StrToTBCSampleStyle(const s: ansistring): TBCSampleStyle;
+procedure BCSampleStyleStrList(s: TStrings);
+
+function StrToTBCSampleDrawing(const s: ansistring): TBCSampleDrawing;
+procedure BCSampleDrawingStrList(s: TStrings);
+
+procedure StyleButtons(AControl: TControl; AButton: TBCButton);
+procedure StyleButtonsSample(AControl: TControl; AStyle: TBCSampleStyle);
+
+procedure DrawSample(ABitmap: TBGRABitmap; Element: TBCSampleDrawing;
+  Align: TAlign = alNone);
+function DrawSample(AWidth, AHeight: integer; Element: TBCSampleDrawing;
+  Align: TAlign = alNone): TBGRABitmap;
+procedure DrawItem(Control: TWinControl; Index: integer; ARect: TRect;
+  State: TOwnerDrawState; Style: TBCSampleDrawing);
+
+{ Buttons }
+procedure BCButtonWindows7(AButton: TBCButton);
+procedure BCButtonWindows7ToolBar(AButton: TBCButton);
+procedure BCButtonOffice2010(AButton: TBCButton);
+procedure BCButtonFlashPlayer(AButton: TBCButton);
+procedure BCButtonMacOSXLion(AButton: TBCButton);
+procedure BCButtonWindows8(AButton: TBCButton; cl1, cl2: TColor);
+
+{ Drawings }
+procedure DrawFlashPlayerBody(ABitmap: TBGRABitmap);
+procedure DrawFlashPlayerButtonPanel(ABitmap: TBGRABitmap);
+procedure DrawWindows7ToolBar(ABitmap: TBGRABitmap; ADir: TAlign;
+  Smooth: boolean = False);
+procedure DrawiOSBar(ABitmap: TBGRABitmap);
+procedure DrawiOSToolBar(ABitmap: TBGRABitmap; Shadow: boolean = True);
+procedure DrawiOSBackground(ABitmap: TBGRABitmap);
+procedure DrawWindows8Background(ABitmap: TBGRABitmap; cl1, cl2: TColor);
+
+implementation
+
+function StrToTBCSampleStyle(const s: ansistring): TBCSampleStyle;
+var
+  ss: TBCSampleStyle;
+  ls: ansistring;
+begin
+  Result := ssDefault;
+  ls := UTF8LowerCase(s);
+  for ss := low(TBCSampleStyle) to high(TBCSampleStyle) do
+    if ls = UTF8LowerCase(BCSampleStyleStr[ss]) then
+    begin
+      Result := ss;
+      break;
+    end;
+end;
+
+procedure BCSampleStyleStrList(s: TStrings);
+var
+  ss: TBCSampleStyle;
+begin
+  for ss := low(TBCSampleStyle) to high(TBCSampleStyle) do
+    s.Add(BCSampleStyleStr[ss]);
+end;
+
+procedure StyleButtons(AControl: TControl; AButton: TBCButton);
+var
+  i: integer;
+  WinControl: TWinControl;
+begin
+  if AControl is TBCButton then
+    with AControl as TBCButton do
+    begin
+      // Those are recomended properties to keep unchanged
+      AButton.Glyph := Glyph;
+      AButton.GlyphMargin := GlyphMargin;
+      AButton.StaticButton := StaticButton;
+      AButton.Down := Down;
+      AButton.Style := Style;
+      Assign(AButton);
+    end;
+  if AControl is TWinControl then
+  begin
+    WinControl := TWinControl(AControl);
+    if WinControl.ControlCount = 0 then
+      exit;
+    for i := 0 to WinControl.ControlCount - 1 do
+      StyleButtons(WinControl.Controls[i], AButton);
+  end;
+end;
+
+procedure StyleButtonsSample(AControl: TControl; AStyle: TBCSampleStyle);
+var
+  temp: TBCButton;
+begin
+  temp := TBCButton.Create(nil);
+  case AStyle of
+    ssWindows7: BCButtonWindows7(temp);
+    ssWindows7ToolBar: BCButtonWindows7ToolBar(temp);
+    ssOffice2010: BCButtonOffice2010(temp);
+    ssFlashPlayer: BCButtonFlashPlayer(temp);
+    ssMacOSXLion: BCButtonMacOSXLion(temp);
+    ssWindows8_1: BCButtonWindows8(temp, clScheme1_Background, clScheme1_Selection);
+    ssWindows8_2: BCButtonWindows8(temp, clScheme2_Background, clScheme2_Selection);
+    ssWindows8_3: BCButtonWindows8(temp, clScheme3_Background, clScheme3_Selection);
+    ssWindows8_4: BCButtonWindows8(temp, clScheme4_Background, clScheme4_Selection);
+    ssWindows8_5: BCButtonWindows8(temp, clScheme5_Background, clScheme5_Selection);
+    ssWindows8_6: BCButtonWindows8(temp, clScheme6_Background, clScheme6_Selection);
+    ssWindows8_7: BCButtonWindows8(temp, clScheme7_Background, clScheme7_Selection);
+    ssWindows8_8: BCButtonWindows8(temp, clScheme8_Background, clScheme8_Selection);
+    ssWindows8_9: BCButtonWindows8(temp, clScheme9_Background, clScheme9_Selection);
+    ssWindows8_10: BCButtonWindows8(temp, clScheme10_Background, clScheme10_Selection);
+    ssWindows8_11: BCButtonWindows8(temp, clScheme11_Background, clScheme11_Selection);
+    ssWindows8_12: BCButtonWindows8(temp, clScheme12_Background, clScheme12_Selection);
+    ssWindows8_13: BCButtonWindows8(temp, clScheme13_Background, clScheme13_Selection);
+    ssWindows8_14: BCButtonWindows8(temp, clScheme14_Background, clScheme14_Selection);
+    ssWindows8_15: BCButtonWindows8(temp, clScheme15_Background, clScheme15_Selection);
+    ssWindows8_16: BCButtonWindows8(temp, clScheme16_Background, clScheme16_Selection);
+    ssWindows8_17: BCButtonWindows8(temp, clScheme17_Background, clScheme17_Selection);
+    ssWindows8_18: BCButtonWindows8(temp, clScheme18_Background, clScheme18_Selection);
+    ssWindows8_19: BCButtonWindows8(temp, clScheme19_Background, clScheme19_Selection);
+    ssWindows8_20: BCButtonWindows8(temp, clScheme20_Background, clScheme20_Selection);
+    ssWindows8_21: BCButtonWindows8(temp, clScheme21_Background, clScheme21_Selection);
+    ssWindows8_22: BCButtonWindows8(temp, clScheme22_Background, clScheme22_Selection);
+    ssWindows8_23: BCButtonWindows8(temp, clScheme23_Background, clScheme23_Selection);
+    ssWindows8_24: BCButtonWindows8(temp, clScheme24_Background, clScheme24_Selection);
+    ssWindows8_25: BCButtonWindows8(temp, clScheme25_Background, clScheme25_Selection);
+  end;
+  StyleButtons(AControl, temp);
+  temp.Free;
+end;
+
+procedure DrawItem(Control: TWinControl; Index: integer; ARect: TRect;
+  State: TOwnerDrawState; Style: TBCSampleDrawing);
+var
+  temp: TBGRABitmap;
+  str: string;
+begin
+  if Control is TListBox then
+    str := TListBox(Control).Items[Index]
+  else if Control is TComboBox then
+    str := TComboBox(Control).Items[Index];
+
+  temp := TBGRABitmap.Create(ARect.Right - ARect.Left, ARect.Bottom -
+    ARect.Top, Control.Color);
+
+  temp.FontAntialias := True;
+  temp.FontHeight := 0;
+  temp.FontQuality := fqSystemClearType;
+
+  if odSelected in State then
+    DrawSample(temp, Style, alNone);
+
+  temp.TextOut(2, 0, str, BGRABlack);
+
+  if Control is TListBox then
+    temp.Draw(TListBox(Control).Canvas, ARect, False)
+  else if Control is TComboBox then
+    temp.Draw(TComboBox(Control).Canvas, ARect, False);
+
+  temp.Free;
+end;
+
+procedure BCButtonWindows7(AButton: TBCButton);
+begin
+  AButton.Rounding.RoundX := 3;
+  AButton.Rounding.RoundY := 3;
+  AButton.RoundingDropDown.Assign(AButton.Rounding);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1EndPercent := 50;
+    Background.Gradient2.Point1XPercent := 0;
+    Background.Gradient2.Point1YPercent := 0;
+    Background.Gradient2.Point2YPercent := 100;
+    Background.Gradient2.GradientType := gtLinear;
+    Border.Color := RGBToColor(112, 112, 112);
+    Border.LightWidth := 1;
+    Border.LightOpacity := 175;
+    Border.Style := bboSolid;
+    FontEx.Color := clBlack;
+    FontEx.Shadow := False;
+    FontEx.Style := [];
+  end;
+
+  AButton.StateHover.Assign(AButton.StateNormal);
+  AButton.StateClicked.Assign(AButton.StateNormal);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(242, 242, 242);
+    Background.Gradient1.EndColor := RGBToColor(235, 235, 235);
+    Background.Gradient2.StartColor := RGBToColor(221, 221, 221);
+    Background.Gradient2.EndColor := RGBToColor(207, 207, 207);
+  end;
+
+  with AButton.StateHover do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(234, 246, 253);
+    Background.Gradient1.EndColor := RGBToColor(217, 240, 252);
+    Background.Gradient2.StartColor := RGBToColor(190, 230, 253);
+    Background.Gradient2.EndColor := RGBToColor(167, 217, 245);
+    Border.Color := RGBToColor(60, 127, 177);
+  end;
+
+  with AButton.StateClicked do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(229, 244, 252);
+    Background.Gradient1.EndColor := RGBToColor(196, 229, 246);
+    Background.Gradient2.StartColor := RGBToColor(152, 209, 239);
+    Background.Gradient2.EndColor := RGBToColor(104, 179, 219);
+    Background.Gradient1EndPercent := 55;
+    Border.Color := RGBToColor(44, 98, 139);
+    Border.LightOpacity := 100;
+    Border.LightColor := clBlack;
+  end;
+end;
+
+procedure BCButtonWindows7ToolBar(AButton: TBCButton);
+begin
+  AButton.Rounding.RoundX := 2;
+  AButton.Rounding.RoundY := 2;
+  AButton.RoundingDropDown.Assign(AButton.Rounding);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1EndPercent := 50;
+    Background.Gradient2.Point1XPercent := 0;
+    Background.Gradient2.Point1YPercent := 0;
+    Background.Gradient2.Point2YPercent := 100;
+    Background.Gradient2.GradientType := gtLinear;
+    Border.Color := RGBToColor(187, 202, 219);
+    Border.LightWidth := 1;
+    Border.LightOpacity := 200;
+    Border.Style := bboSolid;
+    FontEx.Color := RGBToColor(30, 57, 91);
+    FontEx.Shadow := False;
+    FontEx.Style := [];
+  end;
+
+  AButton.StateHover.Assign(AButton.StateNormal);
+  AButton.StateClicked.Assign(AButton.StateNormal);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(245, 250, 255);
+    Background.Gradient1.EndColor := RGBToColor(230, 240, 250);
+    Background.Gradient2.StartColor := RGBToColor(220, 230, 244);
+    Background.Gradient2.EndColor := RGBToColor(221, 233, 247);
+  end;
+
+  with AButton.StateHover do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(248, 251, 254);
+    Background.Gradient1.EndColor := RGBToColor(237, 242, 250);
+    Background.Gradient2.StartColor := RGBToColor(215, 228, 244);
+    Background.Gradient2.EndColor := RGBToColor(193, 210, 232);
+  end;
+
+  with AButton.StateClicked do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(226, 236, 245);
+    Background.Gradient1.EndColor := RGBToColor(216, 228, 241);
+    Background.Gradient2.StartColor := RGBToColor(207, 219, 236);
+    Background.Gradient2.EndColor := RGBToColor(207, 220, 237);
+  end;
+end;
+
+procedure BCButtonOffice2010(AButton: TBCButton);
+begin
+  AButton.Rounding.RoundX := 3;
+  AButton.Rounding.RoundY := 3;
+  AButton.RoundingDropDown.Assign(AButton.Rounding);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1EndPercent := 50;
+    Background.Gradient2.Point1XPercent := 0;
+    Background.Gradient2.Point1YPercent := 0;
+    Background.Gradient2.Point2YPercent := 100;
+    Background.Gradient2.GradientType := gtLinear;
+    Border.Color := RGBToColor(207, 208, 210);
+    Border.LightWidth := 1;
+    Border.LightOpacity := 175;
+    Border.Style := bboSolid;
+    FontEx.Color := clBlack;
+    FontEx.Shadow := False;
+    FontEx.Style := [];
+  end;
+
+  AButton.StateHover.Assign(AButton.StateNormal);
+  AButton.StateClicked.Assign(AButton.StateNormal);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(255, 255, 255);
+    Background.Gradient1.EndColor := RGBToColor(237, 239, 241);
+    Background.Gradient1EndPercent := 100;
+  end;
+
+  with AButton.StateHover do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(254, 241, 189);
+    Background.Gradient1.EndColor := RGBToColor(254, 228, 134);
+    Background.Gradient2.StartColor := RGBToColor(254, 228, 134);
+    Background.Gradient2.EndColor := RGBToColor(254, 248, 196);
+    Border.Color := RGBToColor(244, 210, 81);
+  end;
+
+  with AButton.StateClicked do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(255, 229, 117);
+    Background.Gradient1.EndColor := RGBToColor(255, 216, 107);
+    Background.Gradient2.StartColor := RGBToColor(255, 216, 107);
+    Background.Gradient2.EndColor := RGBToColor(255, 239, 129);
+    Border.Color := RGBToColor(194, 161, 63);
+    Border.LightWidth := 0;
+  end;
+end;
+
+procedure BCButtonFlashPlayer(AButton: TBCButton);
+begin
+  AButton.Rounding.RoundX := 1;
+  AButton.Rounding.RoundY := 1;
+  AButton.RoundingDropDown.Assign(AButton.Rounding);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1EndPercent := 50;
+    Background.Gradient2.Point1XPercent := 0;
+    Background.Gradient2.Point1YPercent := 0;
+    Background.Gradient2.Point2YPercent := 100;
+    Background.Gradient2.GradientType := gtLinear;
+    Border.Color := RGBToColor(24, 24, 24);
+    Border.LightWidth := 1;
+    Border.LightOpacity := 20;
+    Border.Style := bboSolid;
+    FontEx.Color := clWhite;
+    FontEx.Shadow := True;
+    FontEx.ShadowRadius := 1;
+    FontEx.ShadowOffsetX := 1;
+    FontEx.ShadowOffsetY := 1;
+    FontEx.Style := [];
+  end;
+
+  AButton.StateHover.Assign(AButton.StateNormal);
+  AButton.StateClicked.Assign(AButton.StateNormal);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(104, 104, 104);
+    Background.Gradient1.EndColor := RGBToColor(104, 104, 104);
+    Background.Gradient2.StartColor := RGBToColor(103, 103, 103);
+    Background.Gradient2.EndColor := RGBToColor(71, 71, 71);
+  end;
+
+  with AButton.StateHover do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(118, 118, 118);
+    Background.Gradient1.EndColor := RGBToColor(118, 118, 118);
+    Background.Gradient2.StartColor := RGBToColor(117, 117, 117);
+    Background.Gradient2.EndColor := RGBToColor(81, 81, 81);
+    Border.Color := RGBToColor(24, 24, 24);
+  end;
+
+  with AButton.StateClicked do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(92, 92, 92);
+    Background.Gradient1.EndColor := RGBToColor(92, 92, 92);
+    Background.Gradient2.StartColor := RGBToColor(91, 91, 91);
+    Background.Gradient2.EndColor := RGBToColor(62, 62, 62);
+    Background.Gradient1EndPercent := 55;
+    Border.Color := RGBToColor(24, 24, 24);
+  end;
+end;
+
+procedure BCButtonMacOSXLion(AButton: TBCButton);
+begin
+  AButton.Rounding.RoundX := 3;
+  AButton.Rounding.RoundY := 3;
+  AButton.RoundingDropDown.Assign(AButton.Rounding);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1EndPercent := 50;
+    Background.Gradient2.Point1XPercent := 0;
+    Background.Gradient2.Point1YPercent := 0;
+    Background.Gradient2.Point2YPercent := 100;
+    Background.Gradient2.GradientType := gtLinear;
+    Border.Color := RGBToColor(154, 154, 154);
+    Border.LightWidth := 1;
+    Border.LightOpacity := 175;
+    Border.Style := bboSolid;
+    FontEx.Color := clBlack;
+    FontEx.Shadow := False;
+    FontEx.Style := [];
+  end;
+
+  AButton.StateHover.Assign(AButton.StateNormal);
+  AButton.StateClicked.Assign(AButton.StateNormal);
+
+  with AButton.StateNormal do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(255, 255, 255);
+    Background.Gradient1.EndColor := RGBToColor(243, 243, 243);
+    Background.Gradient2.StartColor := RGBToColor(236, 236, 236);
+    Background.Gradient2.EndColor := RGBToColor(235, 235, 235);
+  end;
+
+  with AButton.StateHover do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(204, 229, 252);
+    Background.Gradient1.EndColor := RGBToColor(161, 209, 249);
+    Background.Gradient2.StartColor := RGBToColor(143, 202, 251);
+    Background.Gradient2.EndColor := RGBToColor(207, 245, 253);
+    Border.Color := RGBToColor(86, 87, 143);
+  end;
+
+  with AButton.StateClicked do
+  begin
+    Background.Gradient1.StartColor := RGBToColor(144, 195, 241);
+    Background.Gradient1.EndColor := RGBToColor(113, 180, 239);
+    Background.Gradient2.StartColor := RGBToColor(97, 173, 240);
+    Background.Gradient2.EndColor := RGBToColor(147, 206, 241);
+    Background.Gradient1EndPercent := 55;
+    Border.Color := RGBToColor(86, 87, 143);
+    Border.LightWidth := 0;
+  end;
+end;
+
+procedure BCButtonWindows8(AButton: TBCButton; cl1, cl2: TColor);
+begin
+  AButton.Rounding.RoundX := 1;
+  AButton.Rounding.RoundY := 1;
+  AButton.RoundingDropDown.Assign(AButton.Rounding);
+
+  with AButton.StateNormal do
+  begin
+    Background.Style := bbsColor;
+    Background.Color := cl1;
+    Border.Style := bboSolid;
+    Border.Width := 1;
+    Border.Color := cl1;
+    Border.LightWidth := 0;
+    Border.LightOpacity := 255;
+    Border.Style := bboSolid;
+    FontEx.Color := clWhite;
+    FontEx.Shadow := False;
+    FontEx.Style := [];
+  end;
+
+  AButton.StateHover.Assign(AButton.StateNormal);
+  AButton.StateClicked.Assign(AButton.StateNormal);
+
+  with AButton.StateHover do
+  begin
+    Background.Color := cl2;
+    Border.Color := cl2;
+  end;
+
+  with AButton.StateClicked do
+  begin
+    Background.Color := cl2;
+    Border.Color := cl2;
+  end;
+end;
+
+procedure DrawFlashPlayerBody(ABitmap: TBGRABitmap);
+begin
+  with ABitmap do
+  begin
+    GradientFill(0, 0, Width, Height, BGRA(203, 19, 23, 255), BGRA(110, 3, 20, 255),
+      gtLinear, PointF(0, 0), PointF(0, Height), dmSet);
+    Rectangle(0, 0, Width, Height + 1, BGRA(0, 0, 0, 215), dmDrawWithTransparency);
+  end;
+end;
+
+procedure DrawFlashPlayerButtonPanel(ABitmap: TBGRABitmap);
+begin
+  with ABitmap do
+  begin
+    DrawHorizLine(0, 0, Width, BGRA(30, 30, 30, 255));
+    DrawHorizLine(0, Height - 1, Width, BGRA(62, 62, 62, 255));
+    Rectangle(0, 1, Width, Height - 1, BGRA(91, 91, 91, 255),
+      BGRA(76, 76, 76, 255), dmSet);
+  end;
+end;
+
+procedure DrawWindows7ToolBar(ABitmap: TBGRABitmap; ADir: TAlign;
+  Smooth: boolean = False);
+var
+  tempBmp: TBGRABitmap;
+begin
+  if Smooth then
+    tempBmp := DoubleGradientAlphaFill(Rect(0, 0, ABitmap.Width, ABitmap.Height),
+      BGRA(245, 249, 255, 255), BGRA(222, 232, 245, 255), BGRA(220, 230, 245, 255),
+      BGRA(222, 230, 245, 255), gdVertical, gdVertical, gdVertical, 0.50)
+  else
+    tempBmp := DoubleGradientAlphaFill(Rect(0, 0, ABitmap.Width, ABitmap.Height),
+      BGRA(245, 250, 255, 255), BGRA(230, 240, 250, 255), BGRA(220, 230, 244, 255),
+      BGRA(221, 233, 247, 255), gdVertical, gdVertical, gdVertical, 0.50);
+
+  ABitmap.BlendImage(0, 0, tempBmp, boLinearBlend);
+  tempBmp.Free;
+
+  case ADir of
+    alLeft: with ABitmap do
+      begin
+        if not Smooth then
+          Rectangle(0, 0, Width - 2, Height, BGRA(255, 255, 255, 100),
+            dmDrawWithTransparency);
+        SetVertLine(Width - 1, 0, Height - 1, BGRA(160, 175, 195, 255));
+        SetVertLine(Width - 2, 0, Height - 1, BGRA(205, 218, 234, 255));
+      end;
+    alTop: with ABitmap do
+      begin
+        if not Smooth then
+          Rectangle(0, 0, Width, Height - 2, BGRA(255, 255, 255, 100),
+            dmDrawWithTransparency);
+        SetHorizLine(0, Height - 1, Width - 1, BGRA(160, 175, 195, 255));
+        SetHorizLine(0, Height - 2, Width - 1, BGRA(205, 218, 234, 255));
+      end;
+    alRight: with ABitmap do
+      begin
+        if not Smooth then
+          Rectangle(2, 0, Width, Height, BGRA(255, 255, 255, 100),
+            dmDrawWithTransparency);
+        SetVertLine(0, 0, Height, BGRA(160, 175, 195, 255));
+        SetVertLine(1, 0, Height, BGRA(205, 218, 234, 255));
+      end;
+    alBottom: with ABitmap do
+      begin
+        if not Smooth then
+          Rectangle(0, 2, Width, Height, BGRA(255, 255, 255, 100),
+            dmDrawWithTransparency);
+        SetHorizLine(0, 0, Width - 1, BGRA(160, 175, 195, 255));
+        SetHorizLine(0, 1, Width - 1, BGRA(205, 218, 234, 255));
+      end;
+    alClient, alCustom, alNone: with ABitmap do
+      begin
+        if not Smooth then
+          Rectangle(0, 0, Width, Height, BGRA(255, 255, 255, 100),
+            dmDrawWithTransparency);
+      end;
+  end;
+end;
+
+function StrToTBCSampleDrawing(const s: ansistring): TBCSampleDrawing;
+var
+  ss: TBCSampleDrawing;
+  ls: ansistring;
+begin
+  Result := sdDefault;
+  ls := UTF8LowerCase(s);
+  for ss := low(TBCSampleDrawing) to high(TBCSampleDrawing) do
+    if ls = UTF8LowerCase(BCSampleDrawingStr[ss]) then
+    begin
+      Result := ss;
+      break;
+    end;
+end;
+
+procedure BCSampleDrawingStrList(s: TStrings);
+var
+  ss: TBCSampleDrawing;
+begin
+  for ss := low(TBCSampleDrawing) to high(TBCSampleDrawing) do
+    s.Add(BCSampleDrawingStr[ss]);
+end;
+
+procedure DrawSample(ABitmap: TBGRABitmap; Element: TBCSampleDrawing;
+  Align: TAlign = alNone);
+begin
+  case Element of
+    sdFlashPlayerBody: DrawFlashPlayerBody(ABitmap);
+    sdFlashPlayerButtonPanel: DrawFlashPlayerButtonPanel(ABitmap);
+    sdWindows7Toolbar: DrawWindows7ToolBar(ABitmap, Align);
+    sdiOSBar: DrawiOSBar(ABitmap);
+    sdiOSToolBar: DrawiOSToolBar(ABitmap, False);
+    sdiOSBackground: DrawiOSBackground(ABitmap);
+    sdWindows8_1: DrawWindows8Background(ABitmap, clScheme1_Background,
+        clScheme1_Selection);
+    sdWindows8_2: DrawWindows8Background(ABitmap, clScheme2_Background,
+        clScheme2_Selection);
+    sdWindows8_3: DrawWindows8Background(ABitmap, clScheme3_Background,
+        clScheme3_Selection);
+    sdWindows8_4: DrawWindows8Background(ABitmap, clScheme4_Background,
+        clScheme4_Selection);
+    sdWindows8_5: DrawWindows8Background(ABitmap, clScheme5_Background,
+        clScheme5_Selection);
+    sdWindows8_6: DrawWindows8Background(ABitmap, clScheme6_Background,
+        clScheme6_Selection);
+    sdWindows8_7: DrawWindows8Background(ABitmap, clScheme7_Background,
+        clScheme7_Selection);
+    sdWindows8_8: DrawWindows8Background(ABitmap, clScheme8_Background,
+        clScheme8_Selection);
+    sdWindows8_9: DrawWindows8Background(ABitmap, clScheme9_Background,
+        clScheme9_Selection);
+    sdWindows8_10: DrawWindows8Background(ABitmap, clScheme10_Background,
+        clScheme10_Selection);
+    sdWindows8_11: DrawWindows8Background(ABitmap, clScheme11_Background,
+        clScheme11_Selection);
+    sdWindows8_12: DrawWindows8Background(ABitmap, clScheme12_Background,
+        clScheme12_Selection);
+    sdWindows8_13: DrawWindows8Background(ABitmap, clScheme13_Background,
+        clScheme13_Selection);
+    sdWindows8_14: DrawWindows8Background(ABitmap, clScheme14_Background,
+        clScheme14_Selection);
+    sdWindows8_15: DrawWindows8Background(ABitmap, clScheme15_Background,
+        clScheme15_Selection);
+    sdWindows8_16: DrawWindows8Background(ABitmap, clScheme16_Background,
+        clScheme16_Selection);
+    sdWindows8_17: DrawWindows8Background(ABitmap, clScheme17_Background,
+        clScheme17_Selection);
+    sdWindows8_18: DrawWindows8Background(ABitmap, clScheme18_Background,
+        clScheme18_Selection);
+    sdWindows8_19: DrawWindows8Background(ABitmap, clScheme19_Background,
+        clScheme19_Selection);
+    sdWindows8_20: DrawWindows8Background(ABitmap, clScheme20_Background,
+        clScheme20_Selection);
+    sdWindows8_21: DrawWindows8Background(ABitmap, clScheme21_Background,
+        clScheme21_Selection);
+    sdWindows8_22: DrawWindows8Background(ABitmap, clScheme22_Background,
+        clScheme22_Selection);
+    sdWindows8_23: DrawWindows8Background(ABitmap, clScheme23_Background,
+        clScheme23_Selection);
+    sdWindows8_24: DrawWindows8Background(ABitmap, clScheme24_Background,
+        clScheme24_Selection);
+    sdWindows8_25: DrawWindows8Background(ABitmap, clScheme25_Background,
+        clScheme25_Selection);
+  end;
+end;
+
+function DrawSample(AWidth, AHeight: integer; Element: TBCSampleDrawing;
+  Align: TAlign = alNone): TBGRABitmap;
+var
+  ABitmap: TBGRABitmap;
+begin
+  ABitmap := TBGRABitmap.Create(AWidth, AHeight);
+  DrawSample(ABitmap, Element, Align);
+  Result := ABitmap;
+end;
+
+procedure DrawiOSBar(ABitmap: TBGRABitmap);
+begin
+  ABitmap.GradientFill(0, 0, ABitmap.Width, ABitmap.Height - 4,
+    BGRA(238, 245, 248, 255), BGRA(196, 204, 208, 255), gtLinear,
+    PointF(0, 0), PointF(0, ABitmap.Height - 4), dmSet);
+  with ABitmap do
+  begin
+    // Bottom Bevel
+    SetHorizLine(0, Height - 4, Width - 1, BGRA(190, 198, 202, 255));
+    SetHorizLine(0, Height - 3, Width - 1, BGRA(201, 209, 213, 255));
+    SetHorizLine(0, Height - 2, Width - 1, BGRA(134, 142, 147, 255));
+    SetHorizLine(0, Height - 1, Width - 1, BGRA(177, 180, 182, 255));
+  end;
+end;
+
+procedure DrawiOSToolBar(ABitmap: TBGRABitmap; Shadow: boolean = True);
+begin
+  if Shadow then
+  begin
+    DoubleGradientAlphaFill(ABitmap, Rect(0, 3, ABitmap.Width, ABitmap.Height - 6),
+      BGRA(172, 185, 201), BGRA(134, 153, 178, 255),
+      BGRA(125, 147, 175, 255), BGRA(110, 132, 162, 255),
+      gdVertical, gdVertical, gdVertical, 0.5);
+    with ABitmap do
+    begin
+      // Top Bevel
+      SetHorizLine(0, 0, Width - 1, BGRA(201, 210, 221, 255));
+      SetHorizLine(0, 1, Width - 1, BGRA(173, 184, 200, 255));
+      SetHorizLine(0, 2, Width - 1, BGRA(179, 190, 205, 255));
+      // Bottom Bevel
+      SetHorizLine(0, Height - 6, Width - 1, BGRA(107, 129, 158, 255));
+      SetHorizLine(0, Height - 5, Width - 1, BGRA(116, 139, 170, 255));
+      SetHorizLine(0, Height - 4, Width - 1, BGRA(48, 54, 62, 255));
+      // Bottom Shadow
+      SetHorizLine(0, Height - 3, Width - 1, BGRA(0, 0, 0, 75));
+      SetHorizLine(0, Height - 2, Width - 1, BGRA(255, 255, 255, 50));
+      SetHorizLine(0, Height - 1, Width - 1, BGRA(0, 0, 0, 10));
+    end;
+  end
+  else
+  begin
+    DoubleGradientAlphaFill(ABitmap, Rect(0, 3, ABitmap.Width, ABitmap.Height - 3),
+      BGRA(172, 185, 201), BGRA(134, 153, 178, 255),
+      BGRA(125, 147, 175, 255), BGRA(110, 132, 162, 255),
+      gdVertical, gdVertical, gdVertical, 0.5);
+    with ABitmap do
+    begin
+      // Top Bevel
+      SetHorizLine(0, 0, Width - 1, BGRA(201, 210, 221, 255));
+      SetHorizLine(0, 1, Width - 1, BGRA(173, 184, 200, 255));
+      SetHorizLine(0, 2, Width - 1, BGRA(179, 190, 205, 255));
+      // Bottom Bevel
+      SetHorizLine(0, Height - 3, Width - 1, BGRA(107, 129, 158, 255));
+      SetHorizLine(0, Height - 2, Width - 1, BGRA(116, 139, 170, 255));
+      SetHorizLine(0, Height - 1, Width - 1, BGRA(48, 54, 62, 255));
+    end;
+  end;
+end;
+
+procedure DrawiOSBackground(ABitmap: TBGRABitmap);
+var
+  temp: TBGRABitmap;
+begin
+  temp := TBGRABitmap.Create(16, 1, BGRA(197, 204, 211));
+  with temp do
+  begin
+    SetPixel(7, 0, BGRA(203, 210, 217));
+    SetPixel(14, 0, BGRA(204, 211, 218));
+    BGRAReplace(temp, temp.FilterBlurRadial(1, rbFast));
+    BGRAReplace(temp, temp.FilterSharpen);
+  end;
+  ABitmap.Fill(temp);
+  temp.Free;
+end;
+
+procedure DrawWindows8Background(ABitmap: TBGRABitmap; cl1, cl2: TColor);
+begin
+  ABitmap.Fill(cl2);
+end;
+
+end.

+ 142 - 0
test/test_bccontrols/test_bccontrols/bctest.lpi

@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="9"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="BGRA Controls Test"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
+    </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
+    <BuildModes Count="2">
+      <Item1 Name="Debug" Default="True"/>
+      <Item2 Name="Test">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <PathDelim Value="\"/>
+          <Target>
+            <Filename Value="bctest"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <CodeGeneration>
+            <SmartLinkUnit Value="True"/>
+            <Optimizations>
+              <VariablesInRegisters Value="True"/>
+              <OptimizationLevel Value="3"/>
+            </Optimizations>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <GenerateDebugInfo Value="False"/>
+              <StripSymbols Value="True"/>
+            </Debugging>
+            <LinkSmart Value="True"/>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+          <Other>
+            <CompilerMessages>
+              <MsgFileName Value=""/>
+            </CompilerMessages>
+            <CompilerPath Value="$(CompPath)"/>
+          </Other>
+        </CompilerOptions>
+      </Item2>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+      </local>
+    </RunParams>
+    <RequiredPackages Count="2">
+      <Item1>
+        <PackageName Value="bgracontrols"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+    </RequiredPackages>
+    <Units Count="3">
+      <Unit0>
+        <Filename Value="bctest.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="bctest"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="ubctest.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="ubctest"/>
+      </Unit1>
+      <Unit2>
+        <Filename Value="bcsamples.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="bcsamples"/>
+      </Unit2>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="bctest"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <UseHeaptrc Value="True"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <CompilerMessages>
+        <MsgFileName Value=""/>
+      </CompilerMessages>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 22 - 0
test/test_bccontrols/test_bccontrols/bctest.lpr

@@ -0,0 +1,22 @@
+program bctest;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, ubctest, bcsamples
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  Application.Title:='BGRA Controls Test';
+  RequireDerivedFormResource := True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

+ 1714 - 0
test/test_bccontrols/test_bccontrols/ubctest.lfm

@@ -0,0 +1,1714 @@
+object Form1: TForm1
+  Left = 311
+  Height = 332
+  Top = 105
+  Width = 615
+  Caption = 'BGRA Controls Test'
+  ClientHeight = 332
+  ClientWidth = 615
+  OnCreate = FormCreate
+  LCLVersion = '1.1'
+  object BCPanel1: TBCPanel
+    Left = 0
+    Height = 332
+    Top = 0
+    Width = 615
+    Align = alClient
+    Background.Color = clWhite
+    Background.ColorOpacity = 255
+    Background.Gradient1.StartColor = clWhite
+    Background.Gradient1.StartColorOpacity = 255
+    Background.Gradient1.DrawMode = dmSet
+    Background.Gradient1.EndColor = clBlack
+    Background.Gradient1.EndColorOpacity = 255
+    Background.Gradient1.ColorCorrection = True
+    Background.Gradient1.GradientType = gtLinear
+    Background.Gradient1.Point1XPercent = 0
+    Background.Gradient1.Point1YPercent = 0
+    Background.Gradient1.Point2XPercent = 0
+    Background.Gradient1.Point2YPercent = 100
+    Background.Gradient1.Sinus = False
+    Background.Gradient2.StartColor = clWhite
+    Background.Gradient2.StartColorOpacity = 255
+    Background.Gradient2.DrawMode = dmSet
+    Background.Gradient2.EndColor = clBlack
+    Background.Gradient2.EndColorOpacity = 255
+    Background.Gradient2.ColorCorrection = True
+    Background.Gradient2.GradientType = gtLinear
+    Background.Gradient2.Point1XPercent = 0
+    Background.Gradient2.Point1YPercent = 0
+    Background.Gradient2.Point2XPercent = 0
+    Background.Gradient2.Point2YPercent = 100
+    Background.Gradient2.Sinus = False
+    Background.Gradient1EndPercent = 35
+    Background.Style = bbsColor
+    BevelInner = bvNone
+    BevelOuter = bvRaised
+    BevelWidth = 1
+    Border.Color = clBlack
+    Border.ColorOpacity = 255
+    Border.LightColor = clWhite
+    Border.LightOpacity = 255
+    Border.LightWidth = 0
+    Border.Style = bboSolid
+    Border.Width = 0
+    BorderBCStyle = bpsBorder
+    Caption = 'BCPanel1'
+    FontEx.Color = clDefault
+    FontEx.EndEllipsis = False
+    FontEx.FontQuality = fqSystemClearType
+    FontEx.Height = 0
+    FontEx.SingleLine = True
+    FontEx.Shadow = False
+    FontEx.ShadowColor = clBlack
+    FontEx.ShadowColorOpacity = 255
+    FontEx.ShadowRadius = 5
+    FontEx.ShadowOffsetX = 5
+    FontEx.ShadowOffsetY = 5
+    FontEx.Style = []
+    FontEx.TextAlignment = bcaCenter
+    FontEx.WordBreak = False
+    Rounding.RoundX = 1
+    Rounding.RoundY = 1
+    Rounding.RoundOptions = []
+    TabOrder = 0
+    object BCLabel1: TBCLabel
+      Left = 8
+      Height = 40
+      Top = 192
+      Width = 117
+      Background.Color = clBlack
+      Background.ColorOpacity = 255
+      Background.Gradient1.StartColor = clWhite
+      Background.Gradient1.StartColorOpacity = 255
+      Background.Gradient1.DrawMode = dmSet
+      Background.Gradient1.EndColor = clBlack
+      Background.Gradient1.EndColorOpacity = 255
+      Background.Gradient1.ColorCorrection = True
+      Background.Gradient1.GradientType = gtLinear
+      Background.Gradient1.Point1XPercent = 0
+      Background.Gradient1.Point1YPercent = 0
+      Background.Gradient1.Point2XPercent = 0
+      Background.Gradient1.Point2YPercent = 100
+      Background.Gradient1.Sinus = False
+      Background.Gradient2.StartColor = clWhite
+      Background.Gradient2.StartColorOpacity = 255
+      Background.Gradient2.DrawMode = dmSet
+      Background.Gradient2.EndColor = clBlack
+      Background.Gradient2.EndColorOpacity = 255
+      Background.Gradient2.ColorCorrection = True
+      Background.Gradient2.GradientType = gtLinear
+      Background.Gradient2.Point1XPercent = 0
+      Background.Gradient2.Point1YPercent = 0
+      Background.Gradient2.Point2XPercent = 0
+      Background.Gradient2.Point2YPercent = 100
+      Background.Gradient2.Sinus = False
+      Background.Gradient1EndPercent = 35
+      Background.Style = bbsClear
+      Border.Color = clBlack
+      Border.ColorOpacity = 255
+      Border.LightColor = clWhite
+      Border.LightOpacity = 255
+      Border.LightWidth = 0
+      Border.Style = bboNone
+      Border.Width = 1
+      Caption = 'BGRA Controls'
+      FontEx.Color = clDefault
+      FontEx.EndEllipsis = False
+      FontEx.FontQuality = fqSystemClearType
+      FontEx.Height = 0
+      FontEx.SingleLine = True
+      FontEx.Shadow = True
+      FontEx.ShadowColor = clBlack
+      FontEx.ShadowColorOpacity = 255
+      FontEx.ShadowRadius = 5
+      FontEx.ShadowOffsetX = 5
+      FontEx.ShadowOffsetY = 5
+      FontEx.Style = []
+      FontEx.TextAlignment = bcaCenter
+      FontEx.WordBreak = False
+      Rounding.RoundX = 1
+      Rounding.RoundY = 1
+      Rounding.RoundOptions = []
+    end
+    object BCButton4: TBCButton
+      Left = 8
+      Height = 33
+      Top = 88
+      Width = 112
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Caption = 'BCButton1'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      Enabled = False
+      FlipArrow = False
+      GlobalOpacity = 255
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object BCButton3: TBCButton
+      Left = 8
+      Height = 33
+      Top = 128
+      Width = 112
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Caption = 'BCButton1'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      Enabled = False
+      FlipArrow = False
+      GlobalOpacity = 255
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      Style = bbtDropDown
+      TextApplyGlobalOpacity = False
+    end
+    object BCButton2: TBCButton
+      Left = 8
+      Height = 33
+      Top = 48
+      Width = 112
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Caption = 'BCButton1'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      FlipArrow = False
+      GlobalOpacity = 255
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      Style = bbtDropDown
+      TextApplyGlobalOpacity = False
+    end
+    object BCButton1: TBCButton
+      Left = 8
+      Height = 33
+      Top = 8
+      Width = 112
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Caption = 'BCButton1'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      FlipArrow = False
+      GlobalOpacity = 255
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object ListBox1: TListBox
+      Left = 128
+      Height = 184
+      Top = 48
+      Width = 464
+      BorderStyle = bsNone
+      Color = clWhite
+      ItemHeight = 0
+      OnDrawItem = ListDrawItem
+      OnSelectionChange = ListBox1SelectionChange
+      Style = lbOwnerDrawFixed
+      TabOrder = 0
+    end
+    object ComboBox1: TComboBox
+      Left = 128
+      Height = 26
+      Top = 8
+      Width = 464
+      Color = clWhite
+      ItemHeight = 20
+      OnDrawItem = ListDrawItem
+      Style = csOwnerDrawFixed
+      TabOrder = 1
+    end
+    object Shape4: TBGRAShape
+      Left = 80
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape5: TBGRAShape
+      Left = 104
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape6: TBGRAShape
+      Left = 128
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape7: TBGRAShape
+      Left = 152
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape8: TBGRAShape
+      Left = 176
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape9: TBGRAShape
+      Left = 200
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape10: TBGRAShape
+      Left = 224
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape11: TBGRAShape
+      Left = 248
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape12: TBGRAShape
+      Left = 272
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape13: TBGRAShape
+      Left = 296
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape14: TBGRAShape
+      Left = 320
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape15: TBGRAShape
+      Left = 344
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape16: TBGRAShape
+      Left = 368
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape17: TBGRAShape
+      Left = 392
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape18: TBGRAShape
+      Left = 416
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape19: TBGRAShape
+      Left = 440
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape20: TBGRAShape
+      Left = 464
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape21: TBGRAShape
+      Left = 488
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape22: TBGRAShape
+      Left = 512
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape23: TBGRAShape
+      Left = 536
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape24: TBGRAShape
+      Left = 560
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape25: TBGRAShape
+      Left = 584
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseDown = Shape2MouseUp
+    end
+    object Shape26: TBGRAShape
+      Left = 24
+      Height = 40
+      Top = 280
+      Width = 552
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+    end
+    object Shape1: TBGRAShape
+      Left = 8
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseUp = Shape2MouseUp
+    end
+    object Shape2: TBGRAShape
+      Left = 32
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseUp = Shape2MouseUp
+    end
+    object Shape3: TBGRAShape
+      Left = 56
+      Height = 24
+      Top = 240
+      Width = 24
+      BorderColor = clWindowText
+      BorderGradient.StartColor = clWhite
+      BorderGradient.StartColorOpacity = 255
+      BorderGradient.DrawMode = dmSet
+      BorderGradient.EndColor = clBlack
+      BorderGradient.EndColorOpacity = 255
+      BorderGradient.ColorCorrection = True
+      BorderGradient.GradientType = gtLinear
+      BorderGradient.Point1XPercent = 0
+      BorderGradient.Point1YPercent = 0
+      BorderGradient.Point2XPercent = 100
+      BorderGradient.Point2YPercent = 100
+      BorderGradient.Sinus = False
+      FillColor = clWindow
+      FillOpacity = 255
+      FillGradient.StartColor = clWhite
+      FillGradient.StartColorOpacity = 255
+      FillGradient.DrawMode = dmSet
+      FillGradient.EndColor = clBlack
+      FillGradient.EndColorOpacity = 255
+      FillGradient.ColorCorrection = True
+      FillGradient.GradientType = gtLinear
+      FillGradient.Point1XPercent = 0
+      FillGradient.Point1YPercent = 0
+      FillGradient.Point2XPercent = 0
+      FillGradient.Point2YPercent = 100
+      FillGradient.Sinus = False
+      OnMouseUp = Shape2MouseUp
+    end
+  end
+end

+ 180 - 0
test/test_bccontrols/test_bccontrols/ubctest.pas

@@ -0,0 +1,180 @@
+unit ubctest;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, Forms, Controls,
+  StdCtrls, types, LCLType, ExtCtrls,
+  BCButton, BCLabel, BCPanel, BGRAShape, BCSamples;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    BCButton1: TBCButton;
+    BCButton2: TBCButton;
+    BCButton3: TBCButton;
+    BCButton4: TBCButton;
+    BCLabel1: TBCLabel;
+    BCPanel1: TBCPanel;
+    ComboBox1: TComboBox;
+    ListBox1: TListBox;
+    Shape1: TBGRAShape;
+    Shape10: TBGRAShape;
+    Shape11: TBGRAShape;
+    Shape12: TBGRAShape;
+    Shape13: TBGRAShape;
+    Shape14: TBGRAShape;
+    Shape15: TBGRAShape;
+    Shape16: TBGRAShape;
+    Shape17: TBGRAShape;
+    Shape18: TBGRAShape;
+    Shape19: TBGRAShape;
+    Shape2: TBGRAShape;
+    Shape20: TBGRAShape;
+    Shape21: TBGRAShape;
+    Shape22: TBGRAShape;
+    Shape23: TBGRAShape;
+    Shape24: TBGRAShape;
+    Shape25: TBGRAShape;
+    Shape26: TBGRAShape;
+    Shape3: TBGRAShape;
+    Shape4: TBGRAShape;
+    Shape5: TBGRAShape;
+    Shape6: TBGRAShape;
+    Shape7: TBGRAShape;
+    Shape8: TBGRAShape;
+    Shape9: TBGRAShape;
+    procedure FormCreate(Sender: TObject);
+    procedure ListDrawItem(Control: TWinControl; Index: integer;
+      ARect: TRect; State: TOwnerDrawState);
+    procedure ListBox1SelectionChange(Sender: TObject; User: boolean);
+    procedure Shape23MouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure Shape2MouseUp(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+  private
+    { private declarations }
+  public
+    { public declarations }
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  Shape1.FillColor := clScheme1_Background;
+  Shape1.BorderColor := clScheme1_Selection;
+
+  Shape2.FillColor := clScheme2_Background;
+  Shape2.BorderColor := clScheme2_Selection;
+
+  Shape3.FillColor := clScheme3_Background;
+  Shape3.BorderColor := clScheme3_Selection;
+
+  Shape4.FillColor := clScheme4_Background;
+  Shape4.BorderColor := clScheme4_Selection;
+
+  Shape5.FillColor := clScheme5_Background;
+  Shape5.BorderColor := clScheme5_Selection;
+
+  Shape6.FillColor := clScheme6_Background;
+  Shape6.BorderColor := clScheme6_Selection;
+
+  Shape7.FillColor := clScheme7_Background;
+  Shape7.BorderColor := clScheme7_Selection;
+
+  Shape8.FillColor := clScheme8_Background;
+  Shape8.BorderColor := clScheme8_Selection;
+
+  Shape9.FillColor := clScheme9_Background;
+  Shape9.BorderColor := clScheme9_Selection;
+
+  Shape10.FillColor := clScheme10_Background;
+  Shape10.BorderColor := clScheme10_Selection;
+
+  Shape11.FillColor := clScheme11_Background;
+  Shape11.BorderColor := clScheme11_Selection;
+
+  Shape12.FillColor := clScheme12_Background;
+  Shape12.BorderColor := clScheme12_Selection;
+
+  Shape13.FillColor := clScheme13_Background;
+  Shape13.BorderColor := clScheme13_Selection;
+
+  Shape14.FillColor := clScheme14_Background;
+  Shape14.BorderColor := clScheme14_Selection;
+
+  Shape15.FillColor := clScheme15_Background;
+  Shape15.BorderColor := clScheme15_Selection;
+
+  Shape16.FillColor := clScheme16_Background;
+  Shape16.BorderColor := clScheme16_Selection;
+
+  Shape17.FillColor := clScheme17_Background;
+  Shape17.BorderColor := clScheme17_Selection;
+
+  Shape18.FillColor := clScheme18_Background;
+  Shape18.BorderColor := clScheme18_Selection;
+
+  Shape19.FillColor := clScheme19_Background;
+  Shape19.BorderColor := clScheme19_Selection;
+
+  Shape20.FillColor := clScheme20_Background;
+  Shape20.BorderColor := clScheme20_Selection;
+
+  Shape21.FillColor := clScheme21_Background;
+  Shape21.BorderColor := clScheme21_Selection;
+
+  Shape22.FillColor := clScheme22_Background;
+  Shape22.BorderColor := clScheme22_Selection;
+
+  Shape23.FillColor := clScheme23_Background;
+  Shape23.BorderColor := clScheme23_Selection;
+
+  Shape24.FillColor := clScheme24_Background;
+  Shape24.BorderColor := clScheme24_Selection;
+
+  Shape25.FillColor := clScheme25_Background;
+  Shape25.BorderColor := clScheme25_Selection;
+
+
+  BCSampleStyleStrList(ListBox1.Items);
+  BCSampleDrawingStrList(ComboBox1.Items);
+end;
+
+procedure TForm1.ListDrawItem(Control: TWinControl; Index: integer;
+  ARect: TRect; State: TOwnerDrawState);
+begin
+  DrawItem(Control, Index, ARect, State, StrToTBCSampleDrawing(ComboBox1.Caption));
+end;
+
+procedure TForm1.ListBox1SelectionChange(Sender: TObject; User: boolean);
+begin
+  StyleButtonsSample(Self, StrToTBCSampleStyle(ListBox1.GetSelectedText));
+end;
+
+procedure TForm1.Shape23MouseDown(Sender: TObject; Button: TMouseButton;
+  Shift: TShiftState; X, Y: Integer);
+begin
+
+end;
+
+procedure TForm1.Shape2MouseUp(Sender: TObject; Button: TMouseButton;
+  Shift: TShiftState; X, Y: Integer);
+begin
+  BCPanel1.Background.Color := TBGRAShape(Sender).FillColor;
+  Shape26.FillColor := TBGRAShape(Sender).BorderColor;
+end;
+
+end.

BIN
test/test_bccontrols/test_bcfilters/Penguins.jpg


+ 93 - 0
test/test_bccontrols/test_bcfilters/test_bcfilters.lpi

@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="9"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="test_bcfilters"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+    </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
+    <BuildModes Count="1">
+      <Item1 Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+      </local>
+    </RunParams>
+    <RequiredPackages Count="2">
+      <Item1>
+        <PackageName Value="bgracontrols"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+    </RequiredPackages>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="test_bcfilters.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="test_bcfilters"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="unit1.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="Unit1"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="test_bcfilters"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <CompilerMessages>
+        <MsgFileName Value=""/>
+      </CompilerMessages>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 21 - 0
test/test_bccontrols/test_bcfilters/test_bcfilters.lpr

@@ -0,0 +1,21 @@
+program test_bcfilters;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, Unit1
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource := True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

+ 96 - 0
test/test_bccontrols/test_bcfilters/unit1.lfm

@@ -0,0 +1,96 @@
+object Form1: TForm1
+  Left = 203
+  Height = 408
+  Top = 139
+  Width = 1045
+  Caption = 'BCFilters'
+  ClientHeight = 408
+  ClientWidth = 1045
+  OnCloseQuery = FormCloseQuery
+  OnCreate = FormCreate
+  OnDestroy = FormDestroy
+  LCLVersion = '1.1'
+  object vs1: TBGRAVirtualScreen
+    Left = 8
+    Height = 320
+    Top = 8
+    Width = 320
+    OnRedraw = vs1Redraw
+    Alignment = taLeftJustify
+    Color = clWhite
+    ParentColor = False
+    TabOrder = 0
+  end
+  object ListBox1: TListBox
+    Left = 344
+    Height = 320
+    Top = 8
+    Width = 160
+    ExtendedSelect = False
+    ItemHeight = 0
+    OnSelectionChange = ListBox1SelectionChange
+    TabOrder = 1
+  end
+  object ListBox2: TListBox
+    Left = 512
+    Height = 320
+    Top = 8
+    Width = 160
+    ExtendedSelect = False
+    ItemHeight = 0
+    OnSelectionChange = ListBox1SelectionChange
+    TabOrder = 2
+  end
+  object ListBox3: TListBox
+    Left = 680
+    Height = 320
+    Top = 8
+    Width = 160
+    ExtendedSelect = False
+    ItemHeight = 0
+    OnSelectionChange = ListBox1SelectionChange
+    TabOrder = 3
+  end
+  object ListBox4: TListBox
+    Left = 848
+    Height = 320
+    Top = 8
+    Width = 160
+    ExtendedSelect = False
+    ItemHeight = 0
+    OnSelectionChange = ListBox1SelectionChange
+    TabOrder = 4
+  end
+  object fs1: TFloatSpinEdit
+    Left = 8
+    Height = 28
+    Top = 336
+    Width = 322
+    DecimalPlaces = 5
+    Increment = 0.0001
+    MaxValue = 1
+    MinValue = 0
+    OnChange = fs1Change
+    TabOrder = 5
+    Value = 1
+  end
+  object fs2: TFloatSpinEdit
+    Left = 8
+    Height = 28
+    Top = 368
+    Width = 322
+    DecimalPlaces = 5
+    Increment = 0.0001
+    MaxValue = 1
+    MinValue = 0
+    OnChange = fs1Change
+    TabOrder = 6
+    Value = 0.98
+  end
+  object Timer1: TTimer
+    Interval = 100
+    OnTimer = Timer1Timer
+    left = 264
+    top = 72
+  end
+end

+ 122 - 0
test/test_bccontrols/test_bcfilters/unit1.pas

@@ -0,0 +1,122 @@
+unit Unit1;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
+  ComCtrls, Spin, ExtCtrls, BCFilters, BGRAVirtualScreen, BGRABitmap,
+  BGRABitmapTypes, BCTypes, BGRATextFX, Math, BCEffect;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    fs1: TFloatSpinEdit;
+    fs2: TFloatSpinEdit;
+    ListBox1: TListBox;
+    ListBox2: TListBox;
+    ListBox3: TListBox;
+    ListBox4: TListBox;
+    Timer1: TTimer;
+    vs1: TBGRAVirtualScreen;
+    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
+    procedure FormCreate(Sender: TObject);
+    procedure FormDestroy(Sender: TObject);
+    procedure fs1Change(Sender: TObject);
+    procedure ListBox1SelectionChange(Sender: TObject; User: boolean);
+    procedure Timer1Timer(Sender: TObject);
+    procedure vs1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
+  private
+    { private declarations }
+  public
+    { public declarations }
+    Fade: TFading;
+    Image: TBGRABitmap;
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  Image := TBGRABitmap.Create('Penguins.jpg');
+
+  BCSimpleFilterStrList(ListBox1.Items);
+  BCSimpleFilterStrList(ListBox2.Items);
+  BCSimpleFilterStrList(ListBox3.Items);
+  BCSimpleFilterStrList(ListBox4.Items);
+  ListBox1.Selected[9] := True;
+  ListBox2.Selected[21] := True;
+  ListBox3.Selected[15] := True;
+  ListBox4.Selected[20] := True;
+
+  Fade.Mode := fmFadeOut;
+  Fade.Step := 15;
+  Fade.Reset;
+end;
+
+procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
+begin
+  Timer1.Enabled := False;
+end;
+
+procedure TForm1.FormDestroy(Sender: TObject);
+begin
+  Image.Free;
+end;
+
+procedure TForm1.fs1Change(Sender: TObject);
+begin
+  vs1.RedrawBitmap;
+end;
+
+procedure TForm1.ListBox1SelectionChange(Sender: TObject; User: boolean);
+begin
+  vs1.RedrawBitmap;
+end;
+
+procedure TForm1.Timer1Timer(Sender: TObject);
+begin
+  //fs1.Value := fs1.Value + 0.0002;
+  fs2.Value := fs2.Value + 0.0002;
+  if (fs2.Value = 1) {and (fs1.Value = 1)} then
+    Timer1.Enabled:=False;
+end;
+
+procedure TForm1.vs1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
+var
+  tmp: TBGRABitmap;
+begin
+  Bitmap.BlendImage(0, 0, Image, boLinearBlend);
+
+  { Weird thing }
+  Zoomy(Bitmap,fs1.Value,fs2.Value);
+
+  tmp := TextShadow(vs1.Width, vs1.Height, 'Penguin TELEPORT project', 20, BGRA(255,255,255,200), BGRABlack, 1, 1, 2) as TBGRABitmap;
+  Bitmap.BlendImage(RandomRange(0,1), RandomRange(vs1.Height div 2 - 40,vs1.Height div 2 - 38), tmp, boLinearBlend);
+  tmp.Free;
+
+  { Apply filter 1 }
+  SimpleFilter(Bitmap, StrToTBCSimpleFilter(ListBox1.GetSelectedText));
+  { Apply filter 2 }
+  SimpleFilter(Bitmap, StrToTBCSimpleFilter(ListBox2.GetSelectedText));
+  { Apply filter 3 }
+  SimpleFilter(Bitmap, StrToTBCSimpleFilter(ListBox3.GetSelectedText));
+  { Apply filter 4 }
+  SimpleFilter(Bitmap, StrToTBCSimpleFilter(ListBox4.GetSelectedText));
+
+  // Fade Out the black rectangle
+  Bitmap.FillRect(0, 0, vs1.Width, vs1.Height, BGRA(0, 0, 0, Fade.Execute), dmFastBlend);
+end;
+
+end.
+

+ 134 - 0
test/test_bccontrols/test_bcgamegrid/test_bcgamegrid.lpi

@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="9"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="test_bcgamegrid"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+    </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
+    <BuildModes Count="2">
+      <Item1 Name="Debug" Default="True"/>
+      <Item2 Name="Test">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <PathDelim Value="\"/>
+          <Target>
+            <Filename Value="test_bcgamegrid"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <CodeGeneration>
+            <SmartLinkUnit Value="True"/>
+            <Optimizations>
+              <VariablesInRegisters Value="True"/>
+              <OptimizationLevel Value="3"/>
+            </Optimizations>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <GenerateDebugInfo Value="False"/>
+              <StripSymbols Value="True"/>
+            </Debugging>
+            <LinkSmart Value="True"/>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+          <Other>
+            <CompilerMessages>
+              <MsgFileName Value=""/>
+            </CompilerMessages>
+            <CompilerPath Value="$(CompPath)"/>
+          </Other>
+        </CompilerOptions>
+      </Item2>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+      </local>
+    </RunParams>
+    <RequiredPackages Count="2">
+      <Item1>
+        <PackageName Value="bgracontrols"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+    </RequiredPackages>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="test_bcgamegrid.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="test_bcgamegrid"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="umain.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="umain"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="test_bcgamegrid"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <UseHeaptrc Value="True"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <CompilerMessages>
+        <MsgFileName Value=""/>
+      </CompilerMessages>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 21 - 0
test/test_bccontrols/test_bcgamegrid/test_bcgamegrid.lpr

@@ -0,0 +1,21 @@
+program test_bcgamegrid;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, umain
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource := True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

+ 39 - 0
test/test_bccontrols/test_bcgamegrid/umain.lfm

@@ -0,0 +1,39 @@
+object Form1: TForm1
+  Left = 348
+  Height = 516
+  Top = 49
+  Width = 614
+  Caption = 'Form1'
+  ClientHeight = 516
+  ClientWidth = 614
+  OnCloseQuery = FormCloseQuery
+  OnCreate = FormCreate
+  OnKeyDown = FormKeyDown
+  LCLVersion = '1.1'
+  object BCGameGrid2: TBCGameGrid
+    Left = 6
+    Height = 508
+    Top = 8
+    Width = 608
+    GridWidth = 6
+    GridHeight = 6
+    BlockWidth = 60
+    BlockHeight = 50
+    OnRenderControl = BCGameGrid2RenderControl
+    OnClickControl = BCGameGrid2ClickControl
+    OnMouseDown = BCGameGrid2MouseDown
+    OnMouseMove = BCGameGrid2MouseMove
+    OnMouseUp = BCGameGrid2MouseUp
+    OnMouseEnter = BCGameGrid2MouseEnter
+    OnMouseLeave = BCGameGrid2MouseLeave
+    OnMouseWheel = BCGameGrid2MouseWheel
+    OnMouseWheelDown = BCGameGrid2MouseWheelDown
+    OnMouseWheelUp = BCGameGrid2MouseWheelUp
+  end
+  object Timer1: TTimer
+    Interval = 33
+    OnTimer = Timer1Timer
+    left = 40
+    top = 24
+  end
+end

+ 9 - 0
test/test_bccontrols/test_bcgamegrid/umain.lrs

@@ -0,0 +1,9 @@
+{ This is an automatically generated lazarus resource file }
+
+LazarusResources.Add('TForm1','FORMDATA',[
+  'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'G'#1#6'Height'#3#203#1#3'Top'#2'{'#5'Widt'
+  +'h'#3#212#2#7'Caption'#6#5'Form1'#12'ClientHeight'#3#203#1#11'ClientWidth'#3
+  +#212#2#10'LCLVersion'#6#3'1.1'#0#11'TBCGameGrid'#11'BCGameGrid1'#4'Left'#2#0
+  +#6'Height'#3#192#1#3'Top'#2#0#5'Width'#3#200#2#9'GridWidth'#2'('#10'GridHeig'
+  +'ht'#2'('#10'BlockWidth'#2#10#11'BlockHeight'#2#10#0#0#0
+]);

+ 213 - 0
test/test_bccontrols/test_bcgamegrid/umain.pas

@@ -0,0 +1,213 @@
+unit umain;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, Forms, Graphics, SysUtils, BCGameGrid, BGRABitmap,
+  BGRABitmapTypes, types, Controls, Dialogs, ExtCtrls, LCLType, BCEffect;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    BCGameGrid2: TBCGameGrid;
+    Timer1: TTimer;
+    procedure BCGameGrid2ClickControl(Sender: TObject; n, x, y: integer);
+    procedure BCGameGrid2MouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: integer);
+    procedure BCGameGrid2MouseEnter(Sender: TObject);
+    procedure BCGameGrid2MouseLeave(Sender: TObject);
+    procedure BCGameGrid2MouseMove(Sender: TObject; Shift: TShiftState;
+      X, Y: integer);
+    procedure BCGameGrid2MouseUp(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: integer);
+    procedure BCGameGrid2MouseWheel(Sender: TObject; Shift: TShiftState;
+      WheelDelta: integer; MousePos: TPoint; var Handled: boolean);
+    procedure BCGameGrid2MouseWheelDown(Sender: TObject; Shift: TShiftState;
+      MousePos: TPoint; var Handled: boolean);
+    procedure BCGameGrid2MouseWheelUp(Sender: TObject; Shift: TShiftState;
+      MousePos: TPoint; var Handled: boolean);
+    procedure BCGameGrid2RenderControl(Sender: TObject; Bitmap: TBGRABitmap;
+      r: TRect; n, x, y: integer);
+    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
+    procedure FormCreate(Sender: TObject);
+    procedure FormHide(Sender: TObject);
+    procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
+    procedure Timer1Timer(Sender: TObject);
+  private
+    procedure SetFSelected(AValue: integer);
+    { private declarations }
+  public
+    { public declarations }
+    FSelected: integer;
+    Fade: TFading;
+    property Selected: integer read FSelected write SetFSelected;
+  end;
+
+var
+  Form1: TForm1;
+
+const
+  L1 = VK_LEFT;
+  R1 = VK_RIGHT;
+  U1 = VK_UP;
+  D1 = VK_DOWN;
+  L2 = VK_A;
+  R2 = VK_D;
+  U2 = VK_W;
+  D2 = VK_S;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.BCGameGrid2RenderControl(Sender: TObject; Bitmap: TBGRABitmap;
+  r: TRect; n, x, y: integer);
+var
+  cr, cg, cb, ca: byte;
+  bmp: TBGRABitmap;
+begin
+  cr := Random(100);
+  cg := Random(100);
+  cb := Random(255);
+  ca := Random(100);
+
+  // selected
+
+  if Selected = n then
+  begin
+    ca := 255;
+    Bitmap.FillRect(r, BGRA(0, 0, 255, Fade.Execute), dmSet);
+  end
+
+  // colors
+
+  else
+  begin
+    Bitmap.FillRect(r, BGRA(cr, cg, cb, ca), dmSet);
+    Bitmap.Rectangle(r, BGRA(100, 100, 100, ca), dmDrawWithTransparency);
+  end;
+
+  // text
+
+  Bitmap.TextRect(r, concat('n', IntToStr(n), ',x', IntToStr(x), ',y', IntToStr(y)),
+    taCenter, tlCenter, BGRA(0, 0, 0, ca));
+
+  // crazy effect
+
+  if n = BCGameGrid2.GridWidth * BCGameGrid2.GridHeight -1 then { remove this if you want to see the original thing... }
+  if Odd(n) then { this is for improve speed... }
+  begin
+    bmp := Bitmap.FilterBlurRadial(1, rbFast) as TBGRABitmap;
+    Bitmap.BlendImage(Random(4), Random(4), bmp, boLinearBlend);
+    bmp.Free;
+  end;
+
+end;
+
+procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
+begin
+  Timer1.Enabled := False;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  Fade.Mode := fmFadeInOut;
+  Fade.Step := 17;
+  Fade.Reset;
+end;
+
+procedure TForm1.FormHide(Sender: TObject);
+begin
+
+end;
+
+procedure TForm1.FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
+
+begin
+  if (Key = L1) or (Key = L2) then
+    Selected := Selected - 1
+  else if (Key = R1) or (Key = R2) then
+    Selected := Selected + 1
+  else if (Key = U1) or (Key = U2) then
+    Selected := Selected - BCGameGrid2.GridWidth
+  else if (Key = D1) or (Key = D2) then
+    Selected := Selected + BCGameGrid2.GridWidth;
+end;
+
+procedure TForm1.Timer1Timer(Sender: TObject);
+begin
+  BCGameGrid2.RenderAndDrawControl;
+end;
+
+procedure TForm1.SetFSelected(AValue: integer);
+begin
+  if FSelected = AValue then
+    Exit;
+  FSelected := AValue;
+end;
+
+procedure TForm1.BCGameGrid2ClickControl(Sender: TObject; n, x, y: integer);
+begin
+  Selected := n;
+end;
+
+procedure TForm1.BCGameGrid2MouseDown(Sender: TObject; Button: TMouseButton;
+  Shift: TShiftState; X, Y: integer);
+begin
+  {if Button = mbLeft then
+    ...}
+end;
+
+procedure TForm1.BCGameGrid2MouseEnter(Sender: TObject);
+begin
+  //ShowMessage('Enter');
+end;
+
+procedure TForm1.BCGameGrid2MouseLeave(Sender: TObject);
+begin
+  //ShowMessage('Leave');
+end;
+
+procedure TForm1.BCGameGrid2MouseMove(Sender: TObject; Shift: TShiftState;
+  X, Y: integer);
+begin
+  {if ssLeft in Shift then
+    ...}
+end;
+
+procedure TForm1.BCGameGrid2MouseUp(Sender: TObject; Button: TMouseButton;
+  Shift: TShiftState; X, Y: integer);
+begin
+  {if ssLeft in Shift then
+    ...}
+end;
+
+procedure TForm1.BCGameGrid2MouseWheel(Sender: TObject; Shift: TShiftState;
+  WheelDelta: integer; MousePos: TPoint; var Handled: boolean);
+begin
+  //ShowMessage('Wheeeeel!');
+end;
+
+procedure TForm1.BCGameGrid2MouseWheelDown(Sender: TObject; Shift: TShiftState;
+  MousePos: TPoint; var Handled: boolean);
+begin
+  { Decrease grid }
+  BCGameGrid2.GridWidth := BCGameGrid2.GridWidth - 1;
+  BCGameGrid2.GridHeight := BCGameGrid2.GridHeight - 1;
+end;
+
+procedure TForm1.BCGameGrid2MouseWheelUp(Sender: TObject; Shift: TShiftState;
+  MousePos: TPoint; var Handled: boolean);
+begin
+  { Increase grid }
+  BCGameGrid2.GridWidth := BCGameGrid2.GridWidth + 1;
+  BCGameGrid2.GridHeight := BCGameGrid2.GridHeight + 1;
+end;
+
+end.

BIN
test/test_bccontrols/test_bcimagebutton/sample_1.png


BIN
test/test_bccontrols/test_bcimagebutton/sample_2.png


BIN
test/test_bccontrols/test_bcimagebutton/sample_3.png


BIN
test/test_bccontrols/test_bcimagebutton/sample_4.png


BIN
test/test_bccontrols/test_bcimagebutton/sample_5.png


+ 134 - 0
test/test_bccontrols/test_bcimagebutton/test.lpi

@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="9"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="test"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+    </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
+    <BuildModes Count="2">
+      <Item1 Name="Debug" Default="True"/>
+      <Item2 Name="Test">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <PathDelim Value="\"/>
+          <Target>
+            <Filename Value="test"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <CodeGeneration>
+            <SmartLinkUnit Value="True"/>
+            <Optimizations>
+              <VariablesInRegisters Value="True"/>
+              <OptimizationLevel Value="3"/>
+            </Optimizations>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <GenerateDebugInfo Value="False"/>
+              <StripSymbols Value="True"/>
+            </Debugging>
+            <LinkSmart Value="True"/>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+          <Other>
+            <CompilerMessages>
+              <MsgFileName Value=""/>
+            </CompilerMessages>
+            <CompilerPath Value="$(CompPath)"/>
+          </Other>
+        </CompilerOptions>
+      </Item2>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+      </local>
+    </RunParams>
+    <RequiredPackages Count="2">
+      <Item1>
+        <PackageName Value="bgracontrols"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+    </RequiredPackages>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="test.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="test"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="unit1.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="Unit1"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="test"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <UseHeaptrc Value="True"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <CompilerMessages>
+        <MsgFileName Value=""/>
+      </CompilerMessages>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 21 - 0
test/test_bccontrols/test_bcimagebutton/test.lpr

@@ -0,0 +1,21 @@
+program test;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, Unit1
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource := True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

+ 90 - 0
test/test_bccontrols/test_bcimagebutton/unit1.lfm

@@ -0,0 +1,90 @@
+object Form1: TForm1
+  Left = 214
+  Height = 402
+  Top = 122
+  Width = 330
+  Caption = 'Form1'
+  ClientHeight = 402
+  ClientWidth = 330
+  Color = clWhite
+  OnCreate = FormCreate
+  LCLVersion = '1.1'
+  object BCImageButton1: TBCImageButton
+    Left = 32
+    Height = 55
+    Top = 16
+    Width = 274
+    Anchors = [akTop, akLeft, akRight]
+    BitmapOptions.AutoDetectRepeat = True
+    BitmapOptions.MarginTop = 4
+    BitmapOptions.MarginRight = 4
+    BitmapOptions.MarginBottom = 2
+    BitmapOptions.MarginLeft = 2
+    BitmapOptions.Direction = sdVertical
+    Caption = 'BCImageButton1'
+  end
+  object BCImageButton2: TBCImageButton
+    Left = 32
+    Height = 55
+    Top = 79
+    Width = 274
+    Anchors = [akTop, akLeft, akRight]
+    BitmapOptions.Direction = sdVertical
+    BitmapOptions.Proportional = True
+  end
+  object BCImageButton3: TBCImageButton
+    Left = 32
+    Height = 55
+    Top = 143
+    Width = 274
+    Anchors = [akTop, akLeft, akRight]
+    BitmapOptions.AutoDetectRepeat = True
+    BitmapOptions.RepeatMiddleHorizontal = True
+    BitmapOptions.RepeatMiddleVertical = True
+    BitmapOptions.MarginTop = 2
+    BitmapOptions.MarginRight = 2
+    BitmapOptions.MarginBottom = 2
+    BitmapOptions.MarginLeft = 2
+    BitmapOptions.Direction = sdVertical
+    BitmapOptions.ResampleMode = rmSimpleStretch
+    Caption = 'BCImageButton3'
+  end
+  object BCImageButton4: TBCImageButton
+    Left = 32
+    Height = 55
+    Top = 206
+    Width = 274
+    Anchors = [akTop, akLeft, akRight]
+    BitmapOptions.AutoDetectRepeat = True
+    BitmapOptions.MarginTop = 5
+    BitmapOptions.MarginRight = 5
+    BitmapOptions.MarginBottom = 5
+    BitmapOptions.MarginLeft = 5
+    BitmapOptions.Direction = sdVertical
+    BitmapOptions.ResampleMode = rmSimpleStretch
+    Caption = 'BCImageButton4'
+  end
+  object BCImageButton5: TBCImageButton
+    Left = 32
+    Height = 55
+    Top = 270
+    Width = 274
+    Anchors = [akTop, akLeft, akRight]
+    BitmapOptions.AutoDetectRepeat = True
+    BitmapOptions.MarginTop = 4
+    BitmapOptions.MarginRight = 4
+    BitmapOptions.MarginBottom = 4
+    BitmapOptions.MarginLeft = 4
+    BitmapOptions.Direction = sdVertical
+    Caption = 'BCImageButton5'
+  end
+  object BCImageButton6: TBCImageButton
+    Left = 32
+    Height = 55
+    Top = 334
+    Width = 274
+    Anchors = [akTop, akLeft, akRight]
+    BitmapOptions.Direction = sdVertical
+    Caption = 'BCImageButton6'
+  end
+end

+ 48 - 0
test/test_bccontrols/test_bcimagebutton/unit1.pas

@@ -0,0 +1,48 @@
+unit Unit1;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Forms, Graphics,
+  BCImageButton, BGRABitmap;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    BCImageButton1: TBCImageButton;
+    BCImageButton2: TBCImageButton;
+    BCImageButton3: TBCImageButton;
+    BCImageButton4: TBCImageButton;
+    BCImageButton5: TBCImageButton;
+    BCImageButton6: TBCImageButton;
+    procedure FormCreate(Sender: TObject);
+  private
+    { private declarations }
+  public
+    { public declarations }
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  BCImageButton1.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_1.png');
+  BCImageButton2.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_2.png');
+  BCImageButton3.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_3.png');
+  BCImageButton4.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_4.png');
+  BCImageButton5.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_5.png');
+end;
+
+end.
+

BIN
test/test_bccontrols/test_bcxbutton/Desert.jpg


+ 134 - 0
test/test_bccontrols/test_bcxbutton/test_bcxbutton.lpi

@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="9"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="test_bcxbutton"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+    </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
+    <BuildModes Count="2">
+      <Item1 Name="Debug" Default="True"/>
+      <Item2 Name="Test">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <PathDelim Value="\"/>
+          <Target>
+            <Filename Value="test_bcxbutton"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <CodeGeneration>
+            <SmartLinkUnit Value="True"/>
+            <Optimizations>
+              <VariablesInRegisters Value="True"/>
+              <OptimizationLevel Value="3"/>
+            </Optimizations>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <GenerateDebugInfo Value="False"/>
+              <StripSymbols Value="True"/>
+            </Debugging>
+            <LinkSmart Value="True"/>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+          <Other>
+            <CompilerMessages>
+              <MsgFileName Value=""/>
+            </CompilerMessages>
+            <CompilerPath Value="$(CompPath)"/>
+          </Other>
+        </CompilerOptions>
+      </Item2>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+      </local>
+    </RunParams>
+    <RequiredPackages Count="2">
+      <Item1>
+        <PackageName Value="bgracontrols"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+    </RequiredPackages>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="test_bcxbutton.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="test_bcxbutton"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="utest.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="utest"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="test_bcxbutton"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <UseHeaptrc Value="True"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <CompilerMessages>
+        <MsgFileName Value=""/>
+      </CompilerMessages>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 21 - 0
test/test_bccontrols/test_bcxbutton/test_bcxbutton.lpr

@@ -0,0 +1,21 @@
+program test_bcxbutton;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, utest
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource := True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

+ 75 - 0
test/test_bccontrols/test_bcxbutton/utest.lfm

@@ -0,0 +1,75 @@
+object Form1: TForm1
+  Left = 353
+  Height = 377
+  Top = 169
+  Width = 491
+  Caption = 'BCXButton'
+  ClientHeight = 377
+  ClientWidth = 491
+  OnCreate = FormCreate
+  OnDestroy = FormDestroy
+  LCLVersion = '1.1'
+  object vs1: TBGRAVirtualScreen
+    Left = 0
+    Height = 377
+    Top = 0
+    Width = 491
+    OnRedraw = vs1Redraw
+    Align = alClient
+    Alignment = taLeftJustify
+    ClientHeight = 377
+    ClientWidth = 491
+    Color = clWhite
+    ParentColor = False
+    TabOrder = 0
+    object BCXButton2: TBCXButton
+      Left = 16
+      Height = 52
+      Top = 160
+      Width = 424
+      OnRenderControl = BCXButton1RenderControl
+    end
+    object BCXButton1: TBCXButton
+      Left = 16
+      Height = 40
+      Top = 8
+      Width = 136
+      OnRenderControl = BCXButton1RenderControl
+    end
+    object BCXButton3: TBCXButton
+      Left = 16
+      Height = 40
+      Top = 56
+      Width = 136
+      OnRenderControl = BCXButton3RenderControl
+    end
+    object BCXButton4: TBCXButton
+      Left = 16
+      Height = 40
+      Top = 104
+      Width = 136
+      OnRenderControl = BCXButton3RenderControl
+    end
+    object BCXButton5: TBCXButton
+      Left = 160
+      Height = 136
+      Top = 8
+      Width = 136
+      OnRenderControl = BCXButton1RenderControl
+    end
+    object BCXButton6: TBCXButton
+      Left = 304
+      Height = 136
+      Top = 8
+      Width = 136
+      OnRenderControl = BCXButton1RenderControl
+    end
+    object BCXButton7: TBCXButton
+      Left = 16
+      Height = 88
+      Top = 232
+      Width = 424
+      OnRenderControl = BCXButton1RenderControl
+    end
+  end
+end

+ 254 - 0
test/test_bccontrols/test_bcxbutton/utest.pas

@@ -0,0 +1,254 @@
+unit utest;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
+  BCImageButton, BGRAVirtualScreen, BGRABitmap, BGRABitmapTypes, BCTypes,
+  BCFilters, BGRATextFX, Types;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    BCXButton1: TBCXButton;
+    BCXButton2: TBCXButton;
+    BCXButton3: TBCXButton;
+    BCXButton4: TBCXButton;
+    BCXButton5: TBCXButton;
+    BCXButton6: TBCXButton;
+    BCXButton7: TBCXButton;
+    vs1: TBGRAVirtualScreen;
+    procedure BCXButton1RenderControl(Sender: TObject; Bitmap: TBGRABitmap;
+      State: TBCGraphicButtonState);
+    procedure BCXButton3RenderControl(Sender: TObject; Bitmap: TBGRABitmap;
+      State: TBCGraphicButtonState);
+    procedure vs1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
+    procedure FormCreate(Sender: TObject);
+    procedure FormDestroy(Sender: TObject);
+  private
+    { private declarations }
+  public
+    { public declarations }
+    Image: TBGRABitmap;
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+uses
+  Themes, LCLType;
+
+{$R *.lfm}
+
+{ Button }
+
+procedure DrawBasicXButton(Sender: TObject; Bitmap: TBGRABitmap;
+  State: TBCGraphicButtonState);
+begin
+  case State of
+    gbsNormal: Bitmap.Fill(BGRA(255, 0, 0, 100));
+    gbsHover: Bitmap.Fill(BGRA(0, 255, 0, 100));
+    gbsActive: Bitmap.Fill(BGRA(0, 0, 255, 100));
+    gbsDisabled: Bitmap.Fill(BGRA(0, 0, 0, 100));
+  end;
+end;
+
+procedure DrawGlassXButton(Sender: TObject; Bitmap, Background: TBGRABitmap;
+  State: TBCGraphicButtonState);
+var
+  tmp: TBGRABitmap;
+  r: TRect;
+begin
+  { Rect to copy backround }
+  with TBCXButton(Sender) do
+    r := Rect(Left, Top, Left + Width, Top + Height);
+  { Copy background }
+  tmp := Background.GetPart(r) as TBGRABitmap;
+  { Apply blur }
+  BGRAReplace(tmp, tmp.FilterBlurRadial(25, rbFast));
+  { Blend }
+  Bitmap.BlendImageOver(0, 0, tmp, boLinearBlend);
+  tmp.Free;
+  { Rect to draw borders }
+  r := Rect(0, 0, Bitmap.Width, Bitmap.Height);
+  { Draw borders }
+  case State of
+    gbsNormal:
+    begin
+      Bitmap.Rectangle(r, BGRA(0, 0, 0, 100), BGRA(255, 255, 255, 10),
+        dmDrawWithTransparency);
+      r := Rect(r.Left + 1, r.Top + 1, r.Right - 1, r.Bottom - 1);
+      Bitmap.Rectangle(r, BGRA(255, 255, 255, 100), BGRAPixelTransparent,
+        dmDrawWithTransparency);
+    end;
+    gbsHover:
+    begin
+      Bitmap.Rectangle(r, BGRA(0, 0, 0, 100), BGRA(255, 255, 255, 50),
+        dmDrawWithTransparency);
+      r := Rect(r.Left + 1, r.Top + 1, r.Right - 1, r.Bottom - 1);
+      Bitmap.Rectangle(r, BGRA(255, 255, 255, 100), BGRAPixelTransparent,
+        dmDrawWithTransparency);
+    end;
+    gbsActive:
+    begin
+      Bitmap.Rectangle(r, BGRA(0, 0, 0, 100), BGRA(100, 100, 100, 50),
+        dmDrawWithTransparency);
+      r := Rect(r.Left + 1, r.Top + 1, r.Right - 1, r.Bottom - 1);
+      Bitmap.Rectangle(r, BGRA(255, 255, 255, 50), BGRAPixelTransparent,
+        dmDrawWithTransparency);
+    end;
+    gbsDisabled:
+    begin
+      Bitmap.Rectangle(r, BGRA(0, 0, 0, 100), BGRA(100, 100, 100, 50),
+        dmDrawWithTransparency);
+      r := Rect(r.Left + 1, r.Top + 1, r.Right - 1, r.Bottom - 1);
+      Bitmap.Rectangle(r, BGRA(100, 100, 100, 100), BGRAPixelTransparent,
+        dmDrawWithTransparency);
+    end;
+  end;
+end;
+
+procedure DrawXButtonText(Sender: TObject; Bitmap: TBGRABitmap; State: TBCGraphicButtonState; Text: String);
+var
+  tmp: TBGRABitmap;
+  op: byte;
+begin
+  if State = gbsDisabled then
+    op := 100
+  else
+    op := 255;
+
+  tmp := TextShadow(Bitmap.Width, Bitmap.Height, Text, 18, BGRA(255, 255, 255, op),
+  BGRABlack, 1, 1, 2) as TBGRABitmap;
+
+  Bitmap.BlendImageOver(0, 0, tmp, boLinearBlend);
+  tmp.Free;
+end;
+
+{ TForm1 }
+
+procedure TForm1.BCXButton1RenderControl(Sender: TObject; Bitmap: TBGRABitmap;
+  State: TBCGraphicButtonState);
+var
+  str: string;
+begin
+  { Style }
+  DrawGlassXButton(Sender, Bitmap, Image, State);
+  //DrawBasicXButton(Sender, Bitmap, State);
+
+  { Strings }
+  str := TControl(Sender).Name;
+  if str = BCXButton1.Name then
+    str := 'Button1'
+  else
+    str := 'BCXButton';
+
+  { Text }
+  DrawXButtonText(Sender, Bitmap, State, str);
+end;
+
+function SaveAlphaRect(ABitmap: TBGRABitmap; ARect: TRect): Pointer;
+var width,height,count,y: Integer;
+  pAlphaData: PByte;
+  pSrc: PBGRAPixel;
+begin
+  IntersectRect(ARect,ARect,Classes.Rect(0,0,ABitmap.Width,ABitmap.Height));
+  width := ARect.Right-ARect.Left;
+  height := ARect.Bottom-ARect.Top;
+  if (width <= 0) or (height <= 0) then result := nil;
+  getmem(result, sizeof(longint)*2 + sizeof(byte)*width*height);
+  PLongint(result)^ := width;
+  (PLongint(result)+1)^ := height;
+  pAlphaData := pbyte(plongint(result)+2);
+  for y := ARect.Top to ARect.Bottom-1 do
+  begin
+    pSrc := ABitmap.ScanLine[y]+ARect.Left;
+    count := width;
+    while count > 0 do
+    begin
+      pAlphaData^ := pSrc^.alpha;
+      inc(pAlphaData);
+      inc(pSrc);
+      dec(count);
+    end;
+  end;
+end;
+
+procedure RestoreAlphaRectAndFree(ABitmap: TBGRABitmap; AX,AY: integer; ASavedAlphaRect: Pointer);
+var width,height,count,y: Integer;
+  pAlphaData: PByte;
+  pSrc: PBGRAPixel;
+begin
+  if ASavedAlphaRect = nil then exit;
+  if AX < 0 then AX := 0;
+  if AY < 0 then AY := 0;
+  width := PLongint(ASavedAlphaRect)^;
+  height := (PLongint(ASavedAlphaRect)+1)^;
+  pAlphaData := pbyte(plongint(ASavedAlphaRect)+2);
+  for y := AY to AY+height-1 do
+  begin
+    pSrc := ABitmap.ScanLine[y]+AX;
+    count := width;
+    while count > 0 do
+    begin
+      pSrc^.alpha := pAlphaData^;
+      inc(pAlphaData);
+      inc(pSrc);
+      dec(count);
+    end;
+  end;
+  freemem(ASavedAlphaRect);
+end;
+
+procedure TForm1.BCXButton3RenderControl(Sender: TObject; Bitmap: TBGRABitmap;
+  State: TBCGraphicButtonState);
+var
+  Details: TThemedElementDetails;
+  PaintRect: TRect;
+  AlphaRect: Pointer;
+begin
+  PaintRect := Rect(0, 0, Bitmap.Width, Bitmap.Height);
+
+  case State of
+    gbsNormal: Details := ThemeServices.GetElementDetails(tbPushButtonNormal);
+    gbsHover: Details := ThemeServices.GetElementDetails(tbPushButtonHot);
+    gbsActive: Details := ThemeServices.GetElementDetails(tbPushButtonPressed);
+    gbsDisabled: Details := ThemeServices.GetElementDetails(tbPushButtonDisabled);
+  end;
+
+  ThemeServices.DrawElement(Bitmap.Canvas.Handle, Details, PaintRect, nil);
+  Bitmap.Canvas.Changed;
+
+  PaintRect := ThemeServices.ContentRect(Bitmap.Canvas.Handle, Details, PaintRect);
+  AlphaRect := SaveAlphaRect(Bitmap, PaintRect);
+  ThemeServices.DrawText(Bitmap.Canvas, Details, 'Test caption', PaintRect,
+    DT_CENTER or DT_VCENTER or DT_SINGLELINE, 0);
+  RestoreAlphaRectAndFree(Bitmap, PaintRect.Left,PaintRect.Top, AlphaRect);
+end;
+
+{ Image }
+
+procedure TForm1.vs1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
+begin
+  Bitmap.BlendImageOver(0, 0, Image, boLinearBlend);
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  BCXButton2.Enabled := False;
+  BCXButton4.Enabled := False;
+  Image := TBGRABitmap.Create('Desert.jpg');
+end;
+
+procedure TForm1.FormDestroy(Sender: TObject);
+begin
+  Image.Free;
+end;
+
+end.

BIN
test/test_bgracontrols/test_bgraimagemanipulation/ProjectBGRAImageManipulationDemo.ico


+ 465 - 0
test/test_bgracontrols/test_bgraimagemanipulation/ProjectBGRAImageManipulationDemo.lpi

@@ -0,0 +1,465 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="9"/>
+    <General>
+      <MainUnit Value="0"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
+      <Icon Value="0"/>
+      <ActiveWindowIndexAtStart Value="0"/>
+    </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <UseVersionInfo Value="True"/>
+      <MinorVersionNr Value="2"/>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
+    <BuildModes Count="2" Active="Test">
+      <Item1 Name="Debug" Default="True"/>
+      <Item2 Name="Test">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <Target>
+            <Filename Value="ProjectBGRAImageManipulationDemo"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <CodeGeneration>
+            <SmartLinkUnit Value="True"/>
+            <Optimizations>
+              <VariablesInRegisters Value="True"/>
+              <OptimizationLevel Value="3"/>
+            </Optimizations>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <GenerateDebugInfo Value="False"/>
+              <StripSymbols Value="True"/>
+            </Debugging>
+            <LinkSmart Value="True"/>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+          <Other>
+            <CompilerMessages>
+              <UseMsgFile Value="True"/>
+            </CompilerMessages>
+            <CompilerPath Value="$(CompPath)"/>
+          </Other>
+        </CompilerOptions>
+      </Item2>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+        <LaunchingApplication PathPlusParams="/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+      </local>
+    </RunParams>
+    <RequiredPackages Count="2">
+      <Item1>
+        <PackageName Value="bgracontrols"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+    </RequiredPackages>
+    <Units Count="37">
+      <Unit0>
+        <Filename Value="ProjectBGRAImageManipulationDemo.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="ProjectBGRAImageManipulationDemo"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="1" Y="14"/>
+        <UsageCount Value="228"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="unitbgraimagemanipulationdemo.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="FormBGRAImageManipulationDemo"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="UnitBGRAImageManipulationDemo"/>
+        <IsVisibleTab Value="True"/>
+        <EditorIndex Value="0"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="25"/>
+        <CursorPos X="25" Y="36"/>
+        <UsageCount Value="228"/>
+        <Loaded Value="True"/>
+        <LoadedDesigner Value="True"/>
+      </Unit1>
+      <Unit2>
+        <Filename Value="../library/Graph64/Screen64.pas"/>
+        <UnitName Value="Screen64"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="82"/>
+        <CursorPos X="3" Y="115"/>
+        <UsageCount Value="1"/>
+      </Unit2>
+      <Unit3>
+        <Filename Value="../bgraimagemanipulation.pas"/>
+        <UnitName Value="BGRAImageManipulation"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="969"/>
+        <CursorPos X="3" Y="1004"/>
+        <ExtraEditorCount Value="1"/>
+        <ExtraEditor1>
+          <WindowIndex Value="0"/>
+          <TopLine Value="1"/>
+          <CursorPos X="34" Y="1097"/>
+        </ExtraEditor1>
+        <UsageCount Value="64"/>
+        <Bookmarks Count="5">
+          <Item0 X="1" Y="1323" ID="4"/>
+          <Item1 X="1" Y="1057" ID="5"/>
+          <Item2 X="11" Y="196" ID="1"/>
+          <Item3 X="4" Y="1065" ID="2"/>
+          <Item4 X="3" Y="305" ID="3"/>
+        </Bookmarks>
+      </Unit3>
+      <Unit4>
+        <Filename Value="../../../codetools/codetoolsstrconsts.pas"/>
+        <UnitName Value="CodeToolsStrConsts"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="261"/>
+        <CursorPos X="1" Y="296"/>
+        <UsageCount Value="1"/>
+      </Unit4>
+      <Unit5>
+        <Filename Value="../../../ajctrls/ajtooledit.pas"/>
+        <UnitName Value="ajtooledit"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="710"/>
+        <CursorPos X="3" Y="717"/>
+        <UsageCount Value="2"/>
+      </Unit5>
+      <Unit6>
+        <Filename Value="../../../../lcl/comctrls.pp"/>
+        <UnitName Value="ComCtrls"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="3046"/>
+        <CursorPos X="8" Y="3064"/>
+        <UsageCount Value="2"/>
+      </Unit6>
+      <Unit7>
+        <Filename Value="../../../../lcl/include/lcl_defines.inc"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="1" Y="1"/>
+        <UsageCount Value="2"/>
+      </Unit7>
+      <Unit8>
+        <Filename Value="../../../../lcl/include/trackbar.inc"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="296"/>
+        <CursorPos X="16" Y="324"/>
+        <UsageCount Value="2"/>
+      </Unit8>
+      <Unit9>
+        <Filename Value="../../../../lcl/widgetset/wscomctrls.pp"/>
+        <UnitName Value="WSComCtrls"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="554"/>
+        <CursorPos X="14" Y="561"/>
+        <UsageCount Value="2"/>
+      </Unit9>
+      <Unit10>
+        <Filename Value="../../../bgrabitmap/bgradefaultbitmap.pas"/>
+        <UnitName Value="BGRADefaultBitmap"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="2978"/>
+        <CursorPos X="46" Y="2994"/>
+        <UsageCount Value="2"/>
+      </Unit10>
+      <Unit11>
+        <Filename Value="unitbgraimagemanipulationdemo.lfm"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="2" Y="1"/>
+        <UsageCount Value="10"/>
+        <DefaultSyntaxHighlighter Value="LFM"/>
+      </Unit11>
+      <Unit12>
+        <Filename Value="../bgraimagemanipulation_icon.lrs"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="1" Y="1"/>
+        <UsageCount Value="2"/>
+      </Unit12>
+      <Unit13>
+        <Filename Value="../../bgraimagemanipulation.pas"/>
+        <UnitName Value="BGRAImageManipulation"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="290"/>
+        <CursorPos X="39" Y="304"/>
+        <UsageCount Value="18"/>
+        <Bookmarks Count="3">
+          <Item0 X="8" Y="912" ID="1"/>
+          <Item1 X="23" Y="1134" ID="2"/>
+          <Item2 X="1" Y="358" ID="8"/>
+        </Bookmarks>
+      </Unit13>
+      <Unit14>
+        <Filename Value="/windows/Projects/Components/ImageManipulation/ImageManipulation.pas"/>
+        <UnitName Value="ImageManipulation"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1039"/>
+        <CursorPos X="35" Y="1068"/>
+        <UsageCount Value="14"/>
+        <Bookmarks Count="3">
+          <Item0 X="9" Y="852" ID="2"/>
+          <Item1 X="12" Y="1203" ID="4"/>
+          <Item2 X="3" Y="450" ID="1"/>
+        </Bookmarks>
+      </Unit14>
+      <Unit15>
+        <Filename Value="../../../lcl/controls.pp"/>
+        <UnitName Value="Controls"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1404"/>
+        <CursorPos X="25" Y="1048"/>
+        <UsageCount Value="9"/>
+      </Unit15>
+      <Unit16>
+        <Filename Value="../bgraimagelist.pas"/>
+        <UnitName Value="BGRAImageList"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="63" Y="4"/>
+        <UsageCount Value="10"/>
+      </Unit16>
+      <Unit17>
+        <Filename Value="../../bgrabitmap/bgradefaultbitmap.pas"/>
+        <UnitName Value="BGRADefaultBitmap"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1421"/>
+        <CursorPos X="13" Y="1450"/>
+        <UsageCount Value="9"/>
+      </Unit17>
+      <Unit18>
+        <Filename Value="../../../../../../../emerson/Projects/Morey/AccessControlServer/trunk/projectaccesscontrolserver.lpr"/>
+        <UnitName Value="projectaccesscontrolserver"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="18" Y="1"/>
+        <UsageCount Value="5"/>
+      </Unit18>
+      <Unit19>
+        <Filename Value="../../../../../../../emerson/Projects/Morey/AccessControlServer/trunk/library/synaser/synafpc.pas"/>
+        <UnitName Value="synafpc"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="96"/>
+        <CursorPos X="18" Y="44"/>
+        <UsageCount Value="2"/>
+      </Unit19>
+      <Unit20>
+        <Filename Value="../../../../../../../emerson/Projects/Morey/AccessControlServer/trunk/library/synaser/synaser.pas"/>
+        <UnitName Value="synaser"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="2145"/>
+        <CursorPos X="21" Y="2176"/>
+        <UsageCount Value="2"/>
+      </Unit20>
+      <Unit21>
+        <Filename Value="../bgraimagebuttontest/umain.pas"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="umain"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="1" Y="1"/>
+        <UsageCount Value="3"/>
+      </Unit21>
+      <Unit22>
+        <Filename Value="../../../lcl/include/control.inc"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="2986"/>
+        <CursorPos X="13" Y="3026"/>
+        <UsageCount Value="9"/>
+        <Bookmarks Count="1">
+          <Item0 X="8" Y="2938" ID="6"/>
+        </Bookmarks>
+      </Unit22>
+      <Unit23>
+        <Filename Value="../bgraimagemanipulationdemo.old/unitbgraimagemanipulationdemo.pas"/>
+        <ComponentName Value="FormBGRAImageManipulationDemo"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="UnitBGRAImageManipulationDemo"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="101"/>
+        <CursorPos X="3" Y="106"/>
+        <UsageCount Value="2"/>
+      </Unit23>
+      <Unit24>
+        <Filename Value="../bgrapanel.pas"/>
+        <UnitName Value="BGRAPanel"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="29"/>
+        <CursorPos X="23" Y="45"/>
+        <UsageCount Value="9"/>
+      </Unit24>
+      <Unit25>
+        <Filename Value="../../../lcl/extctrls.pp"/>
+        <UnitName Value="ExtCtrls"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="1" Y="1"/>
+        <UsageCount Value="9"/>
+      </Unit25>
+      <Unit26>
+        <Filename Value="../../../lcl/lclclasses.pp"/>
+        <UnitName Value="LCLClasses"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="34"/>
+        <CursorPos X="36" Y="52"/>
+        <UsageCount Value="3"/>
+      </Unit26>
+      <Unit27>
+        <Filename Value="../../../lcl/include/controlcanvas.inc"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="2" Y="5"/>
+        <UsageCount Value="9"/>
+      </Unit27>
+      <Unit28>
+        <Filename Value="../../bgracontrols.old/bgraimagemanipulation.pas"/>
+        <UnitName Value="BGRAImageManipulation"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="963"/>
+        <CursorPos X="1" Y="992"/>
+        <UsageCount Value="8"/>
+      </Unit28>
+      <Unit29>
+        <Filename Value="../../bgrabitmap/bgragtkbitmap.pas"/>
+        <UnitName Value="BGRAGtkBitmap"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="84"/>
+        <CursorPos X="1" Y="102"/>
+        <UsageCount Value="2"/>
+      </Unit29>
+      <Unit30>
+        <Filename Value="../../../lcl/comctrls.pp"/>
+        <UnitName Value="ComCtrls"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1832"/>
+        <CursorPos X="1" Y="1851"/>
+        <UsageCount Value="25"/>
+      </Unit30>
+      <Unit31>
+        <Filename Value="../bgratrackbar.pas"/>
+        <UnitName Value="BGRATrackBar"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="41"/>
+        <CursorPos X="34" Y="52"/>
+        <UsageCount Value="47"/>
+      </Unit31>
+      <Unit32>
+        <Filename Value="../../../lcl/include/trackbar.inc"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="48"/>
+        <CursorPos X="1" Y="64"/>
+        <UsageCount Value="47"/>
+      </Unit32>
+      <Unit33>
+        <Filename Value="../../../lcl/widgetset/wscomctrls.pp"/>
+        <UnitName Value="WSComCtrls"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="163"/>
+        <CursorPos X="26" Y="194"/>
+        <UsageCount Value="3"/>
+      </Unit33>
+      <Unit34>
+        <Filename Value="../../../lcl/widgetset/wscontrols.pp"/>
+        <UnitName Value="WSControls"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="82"/>
+        <CursorPos X="3" Y="89"/>
+        <UsageCount Value="3"/>
+      </Unit34>
+      <Unit35>
+        <Filename Value="../../../lcl/widgetset/wslclclasses.pp"/>
+        <UnitName Value="WSLCLClasses"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="44"/>
+        <CursorPos X="3" Y="62"/>
+        <UsageCount Value="3"/>
+      </Unit35>
+      <Unit36>
+        <Filename Value="../bgrabutton.pas"/>
+        <UnitName Value="BGRAButton"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="1"/>
+        <CursorPos X="1" Y="1"/>
+        <UsageCount Value="34"/>
+      </Unit36>
+    </Units>
+    <JumpHistory Count="2" HistoryIndex="1">
+      <Position1>
+        <Filename Value="unitbgraimagemanipulationdemo.pas"/>
+        <Caret Line="154" Column="50" TopLine="140"/>
+      </Position1>
+      <Position2>
+        <Filename Value="unitbgraimagemanipulationdemo.pas"/>
+        <Caret Line="155" Column="50" TopLine="141"/>
+      </Position2>
+    </JumpHistory>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="ProjectBGRAImageManipulationDemo"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <UseHeaptrc Value="True"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <CompilerMessages>
+        <UseMsgFile Value="True"/>
+      </CompilerMessages>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 19 - 0
test/test_bgracontrols/test_bgraimagemanipulation/ProjectBGRAImageManipulationDemo.lpr

@@ -0,0 +1,19 @@
+program ProjectBGRAImageManipulationDemo;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, UnitBGRAImageManipulationDemo, bgracontrols;
+
+{$R *.res}
+
+begin
+  Application.Initialize;
+  Application.CreateForm(TFormBGRAImageManipulationDemo, FormBGRAImageManipulationDemo);
+  Application.Run;
+end.
+

+ 2045 - 0
test/test_bgracontrols/test_bgraimagemanipulation/unitbgraimagemanipulationdemo.lfm

@@ -0,0 +1,2045 @@
+object FormBGRAImageManipulationDemo: TFormBGRAImageManipulationDemo
+  Left = 503
+  Height = 420
+  Top = 160
+  Width = 540
+  Caption = 'Demonstration of TBGRAImageManipulation'
+  ClientHeight = 420
+  ClientWidth = 540
+  ShowHint = True
+  LCLVersion = '1.0.8.0'
+  object Background: TBCPanel
+    Left = 320
+    Height = 420
+    Top = 0
+    Width = 220
+    Align = alRight
+    Background.Color = clSilver
+    Background.ColorOpacity = 255
+    Background.Gradient1.StartColor = clWhite
+    Background.Gradient1.StartColorOpacity = 255
+    Background.Gradient1.DrawMode = dmSet
+    Background.Gradient1.EndColor = clBlack
+    Background.Gradient1.EndColorOpacity = 255
+    Background.Gradient1.ColorCorrection = True
+    Background.Gradient1.GradientType = gtLinear
+    Background.Gradient1.Point1XPercent = 0
+    Background.Gradient1.Point1YPercent = 0
+    Background.Gradient1.Point2XPercent = 0
+    Background.Gradient1.Point2YPercent = 100
+    Background.Gradient1.Sinus = False
+    Background.Gradient2.StartColor = clWhite
+    Background.Gradient2.StartColorOpacity = 255
+    Background.Gradient2.DrawMode = dmSet
+    Background.Gradient2.EndColor = clBlack
+    Background.Gradient2.EndColorOpacity = 255
+    Background.Gradient2.ColorCorrection = True
+    Background.Gradient2.GradientType = gtLinear
+    Background.Gradient2.Point1XPercent = 0
+    Background.Gradient2.Point1YPercent = 0
+    Background.Gradient2.Point2XPercent = 0
+    Background.Gradient2.Point2YPercent = 100
+    Background.Gradient2.Sinus = False
+    Background.Gradient1EndPercent = 35
+    Background.Style = bbsColor
+    BevelInner = bvNone
+    BevelOuter = bvRaised
+    BevelWidth = 1
+    Border.Color = clBlack
+    Border.ColorOpacity = 255
+    Border.LightColor = clWhite
+    Border.LightOpacity = 255
+    Border.LightWidth = 0
+    Border.Style = bboNone
+    Border.Width = 1
+    FontEx.Color = clDefault
+    FontEx.EndEllipsis = False
+    FontEx.FontQuality = fqSystemClearType
+    FontEx.Height = 0
+    FontEx.SingleLine = True
+    FontEx.Shadow = False
+    FontEx.ShadowColor = clBlack
+    FontEx.ShadowColorOpacity = 255
+    FontEx.ShadowRadius = 5
+    FontEx.ShadowOffsetX = 5
+    FontEx.ShadowOffsetY = 5
+    FontEx.Style = []
+    FontEx.TextAlignment = bcaCenter
+    FontEx.WordBreak = False
+    Rounding.RoundX = 1
+    Rounding.RoundY = 1
+    Rounding.RoundOptions = []
+    TabOrder = 0
+    object RateCompression: TTrackBar
+      Left = 20
+      Height = 45
+      Top = 227
+      Width = 180
+      Max = 100
+      Position = 80
+      TabOrder = 0
+    end
+    object KeepAspectRatio: TCheckBox
+      Left = 20
+      Height = 26
+      Top = 104
+      Width = 124
+      Caption = 'Keep aspect ratio'
+      Checked = True
+      Color = clWhite
+      Font.Color = clWhite
+      Font.Style = [fsBold]
+      OnClick = KeepAspectRatioClick
+      ParentColor = False
+      ParentFont = False
+      State = cbChecked
+      TabOrder = 1
+    end
+    object lbOptions: TLabel
+      Left = 10
+      Height = 15
+      Top = 72
+      Width = 48
+      Caption = 'Options:'
+      Color = clBlack
+      Font.Color = clWhite
+      Font.Style = [fsBold]
+      ParentColor = False
+      ParentFont = False
+      Transparent = False
+    end
+    object lbCompression: TLabel
+      Left = 20
+      Height = 15
+      Top = 208
+      Width = 118
+      Caption = 'Compression adjust:'
+      Font.Color = clWhite
+      Font.Style = [fsBold]
+      ParentColor = False
+      ParentFont = False
+    end
+    object edAspectRatio: TEdit
+      Left = 118
+      Height = 20
+      Top = 132
+      Width = 44
+      TabOrder = 2
+      Text = '3:4'
+    end
+    object lbAspectRatio: TLabel
+      Left = 20
+      Height = 15
+      Top = 136
+      Width = 76
+      Caption = 'Aspect Ratio:'
+      Color = clBlack
+      Font.Color = clWhite
+      Font.Style = [fsBold]
+      ParentColor = False
+      ParentFont = False
+      Transparent = False
+    end
+    object btnOpenPicture: TBCButton
+      Left = 10
+      Height = 40
+      Top = 8
+      Width = 200
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Caption = 'Open picture...'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      Glyph.Data = {
+        36090000424D3609000000000000360000002800000018000000180000000100
+        2000000000000009000064000000640000000000000000000000000000000000
+        0000000000010000000100000001000000010000000100000001000000010000
+        0001000000010000000100000001000000010000000100000001000000010000
+        0001000000010000000100000001000000010000000000000000000000000000
+        0002000000060000000B0000000D0000000D0000000D0000000D0000000D0000
+        000D0000000D0000000D0000000D0000000D0000000D0000000D0000000D0000
+        000D0000000D0000000D0000000B000000060000000200000000000000010000
+        00070000001A0000004000000053000000530000005300000053000000530000
+        0053000000530000005300000053000000530000005300000053000000530000
+        00530000005300000053000000420000001A0000000700000001000000020000
+        000E222A2A683E4949F33E4A4AFF3E4A4AFF3E4A4AFF3E4A4AFF3E4A4AFF3E4A
+        4AFF3E4A4AFF3E4A4AFF3E4A4AFF3E4A4AFF3E4A4AFF3E4A4AFF3E4A4AFF3E4A
+        4AFF3E4A4AFF3E4A4AFF394444E40A0E0E4B0000000E00000002000000011A26
+        2614425050EA798C8CFF98ACACFF99ACACFF9BADADFF9CAEAEFF9DAFAFFF9FB0
+        B0FFA0B1B1FFA1B1B1FF9FB1B1FF9EB0B0FF9DAEAEFF9AABABFF99AAAAFF97A9
+        A9FF94A6A6FF92A4A4FF627070FC404B4BC40000000B0000000100000000444F
+        4F5A707D7CF4B4C3C1FFAABBB9FFAABAB8FFA9B9B7FFA8B8B6FFA8B8B6FFA8B7
+        B6FFA7B7B5FFA7B7B5FFA6B6B4FFA5B5B3FFA5B4B2FFA5B4B2FFA4B3B2FFA3B3
+        B1FFA3B3B1FFA2B2B0FFA1B0AEFF52605FF4444F4F4400000000000000005160
+        60ADA7B2B2FFACBBBAFFA0B0B0FF9FB0AFFF9FB0AFFF9EAFAEFF9DADACFF9DAD
+        ACFF9CACACFF9BACABFF9AABAAFF9AABAAFF9AAAA9FF99A9A8FF99A9A8FF98A8
+        A8FF98A8A7FF97A7A6FF97A7A6FF829190FF52605FCA00000000000000005464
+        63EFACB8B8FFBEC9C9FFBEC9C9FFBDC9C8FFBCC8C8FFBCC8C8FFBBC7C6FFB0BE
+        BDFF9AAAAAFF90A2A2FF8FA2A1FF8EA1A0FF8EA1A0FF8EA09FFF8D9F9FFF8C9F
+        9EFF8C9F9EFF8C9E9DFF8C9E9DFF9FAEADFF5D6D6CF3515E5E39000000005A6D
+        6B94576968F5556765FF556765FF556765FF556765FF556765FF647674FF8E9F
+        9FFFB4C0C0FFBBC5C5FFBBC5C5FFBAC5C5FFBAC5C5FFB9C4C4FFB9C4C4FFB9C4
+        C4FFB9C4C4FFB8C3C3FFB8C3C3FFB8C2C2FF8E9E9EFE5B6D6AC2000000000000
+        000000000000424F4FFB556666FF566767FF566767FF4C4F4DFFCACECDFF8391
+        8FFF5F716FFF5B6D6BFF5B6D6BFF5B6D6BFF5B6D6BFF5B6D6BFF5B6D6BFF5B6D
+        6BFF5B6D6BFF5B6D6BFF5B6D6BFF5B6D6BFF5B6D6BFE617472AE000000000000
+        000000000000455252FB556666FF566767FF566767FFA6ADAAFFFFFFFFFF858A
+        88FF449DD8FF9FF3FDFFBCF7FFFFBCF7FFFF9EF2FDFF429DD8FF020607FF52A5
+        DBFF667072FF626664FF939795FFADB0AFFF888C8BF800000000000000000000
+        000000000000485655FB566666FF566767FF566767FFADB3B0FFFFFFFFFF8B90
+        8EFF539DCEFF81CCE8FFACF4FDFFA7F3FDFF76C8E6FF4180AAFF0E1012FF4790
+        BEFF63A6D3FF7FB6DBFFBABCBBFFFFFFFFFF949A97FF00000000000000000000
+        0000000000004B5958FB566767FF566767FF566767FFB3BAB6FFFFFFFFFF9196
+        94FF5B9AC4FF629EC6FF6AA2C9FF70A7CBFF73A6C9FF41494DFF5C8BAAFF2B39
+        42FF5693BDFF74A9CDFFB5B8B7FFFFFFFFFF9AA09DFF00000000000000000000
+        0000000000004D5D5CFB566767FF566767FF566767FFB9C0BCFFFFFFFFFF989C
+        9BFF6498BAFF679ABBFF6D9EBEFF6F9CB8FF617887FF5F6F78FF84ADC8FF81A5
+        BCFF5C6A74FF77A5C2FFAEB1B0FFFFFFFFFFA0A6A4FF00000000000000000000
+        00000000000050615FFB5B6D6CFF5B6D6CFF5B6D6CFFBFC6C3FFFFFFFFFF9EA2
+        A1FF6F99B3FF6F99B3FF719AB4FF749CB4FF6F8C9EFF5E6C73FF7793A3FF7E9B
+        ACFF6F7F8AFF7C94A4FFB5B8B7FFFFFFFFFFA6ADAAFF00000000000000000000
+        000000000000536563FB6B7D7CFF647776FF647776FFC5CCC9FFFFFFFFFFA5A9
+        A7FF7A9AAEFF7A9AAEFF7896A9FF5E6C76FF6D8390FF83A0B3FF829DADFF88A5
+        B7FF88A2B3FF8BA6B8FFB0B3B2FFFFFFFFFFACB3B0FF00000000000000000000
+        000000000000576967FB819391FF6D8280FF6D8280FFCBD3CFFFFFFFFFFFACAF
+        AEFF869DAAFF869DAAFF869DAAFF869DAAFF869DAAFF869DAAFF889FACFF8BA1
+        AEFF8DA2AFFF8DA3B0FFB1B5B3FFFFFFFFFFB3B9B6FF00000000000000000000
+        0000000000005A6D6AFB94A5A3FF768C8AFF768C8AFFCED6D2FFFFFFFFFFB6B9
+        B8FFAFB2B1FFAFB2B1FFAFB2B1FFAFB2B1FFAFB2B1FFAFB2B1FFAFB2B1FFAFB2
+        B1FFAFB2B1FFB0B3B2FFB6B9B7FFFFFFFFFFB9C0BCFF00000000000000000000
+        0000000000005D706EFBA4B4B2FF7C9390FF7C9390FFCED6D2FFFEFEFEFFFFFF
+        FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFDFDFFBFC6C3FF00000000000000000000
+        000000000000607472F2A5B5B3FFA7B7B5FFA5B5B3FFC3CDCAFFCED6D2FFCED6
+        D2FFCED6D2FFCED6D2FFCED6D2FFCED6D2FFCED6D2FFCED6D2FFCED6D2FFCDD5
+        D1FFCBD3CFFFCAD1CEFFC8D0CCFFC6CECAFFC6CDCABC00000000000000000000
+        0000000000006377736F657876F8647875FF647875FF647875FF647875FF6478
+        75FF647875EE6476735400000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000
+      }
+      OnClick = btnOpenPictureClick
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object btnSavePicture: TBCButton
+      Left = 10
+      Height = 40
+      Top = 368
+      Width = 200
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Caption = 'Save Selected picture...'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      Glyph.Data = {
+        36090000424D3609000000000000360000002800000018000000180000000100
+        2000000000000009000064000000640000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        000000000000000000001618170E171717AA525554FF666A68FF636765FF6267
+        65FF606462FF626764FF585D5AFF080808FF0D0D0DFF0506069D000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        00000000000000000000232524B04E504FFF626664FFE6ECEAFFBFC4C1FF9397
+        95FFC7CECBFFD9DFDCFF646866FF636765FE787B79FE0B0C0BFF000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        000000000000000000002C2E2DFF656867FE6F7371FEDAE1DEFF8F9592FF494D
+        4BFFC4CCC8FFCAD0CDFF6E7270FF565A58FF717573FE0F1010FF000000000000
+        00040000002E0000002E0000002E0000002E0000002E0000002E0000002E0000
+        002E0000002E0000002E303231FF656967FF7C817FFFD8DFDCFF959C98FF5F62
+        61FFD0D7D4FFD1D7D3FF7D8280FF545755FF727673FF131414FF00000000959C
+        9A9D959A98FF949A98FF939997FF929895FF919794FF909693FF8F9492FF8E93
+        91FF8D9290FF8C918FFF353736FF676B69FF7D8380FFBBC1BEFFC5CAC8FFCCD0
+        CEFFBEC2C0FFB9BEBBFF868A88FF646765FF6D706DFF181918FF000000009BA1
+        9EFFFDFDFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFF3A3C3BFF6D716FFF4E5250FF505553FF4F5452FF4D52
+        4FFF4C504EFF4B4E4CFF494C4AFF494B48FF616360FF1C1E1DFF00000000A0A6
+        A3FFFFFFFFFF959A99FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
+        88FF858A88FF858A88FF3E403FFF656866FFE4E5E5FFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFFFFFFFFFFE3E4E3FF545653FF212221FF00000000A4AA
+        A7FFFFFFFFFF838885FF36342EFF36342EFF36342EFF36342EFF36342EFF3634
+        2EFF36342EFF36342EFF424544FF656967FFEBEBEBFFECECECFFEEEDEDFFEEED
+        EDFFEEEDEDFFEEEDEDFFECECECFFEAEAEAFF555653FF252726FF00000000A8AE
+        ABFFFFFFFFFF858A88FF3FA8F0FF8DE8FCFFAEF5FEFFBDF7FFFFBDF7FFFFB6F7
+        FEFF9DF3FEFF45BEF4FF474A48FF666967FFE9EAE9FFF5F6F6FFF6F7F7FFF6F7
+        F7FFF6F7F7FFF6F7F7FFF5F6F6FFE8E8E8FF545653FF2A2B2BFF00000000ACB2
+        AFFFFFFFFFFF858A88FF43A2E2FF63C2EEFFA1F4FEFFB4F6FEFFB7F7FEFFA6F4
+        FEFF83E2F9FF44B0E7FF4B4F4CFF656865FFEAEBEBFFE1E2E2FFE3E3E4FFE3E3
+        E4FFE3E3E4FFE3E3E4FFE1E2E2FFEAEAEAFF555652FF2E302FFF00000000B0B6
+        B3FFFFFFFFFF8A8F8DFF51A2D7FF56A4D8FF85D3EFFFA4F2FCFFA4F2FDFF87DE
+        F4FF52B0DDFF4BA1D8FF4F5250FF7C7F7DFFE0D2C4FFEBDCCDFFEBDCCDFFEBDC
+        CDFFECDCCDFFECDCCDFFEBDCCDFFDFD1C3FF686967FF333433FF00000000B3BA
+        B7FFFFFFFFFF909492FF589ECCFF5EA1CEFF63A4CFFF68A7D1FF6FACD4FF71AD
+        D5FF6FABD3FF6097BCFF3D4242FF4C5253FF9F6B41FFAA6E3EFFAA6E3EFFAA6E
+        3EFFAA6E3EFFAA6E3EFFAA6E3EFF9C683EFF32393AFF3032309C00000000B7BE
+        BBFFFFFFFFFF959A98FF609BC2FF659FC4FF6AA2C6FF6FA5C8FF74A8CAFF76A5
+        C3FF7194ABFF677C89FF697A85FF87B3D1FF7DAECDFF6892ADFF3F5462FF5F9A
+        C1FF5F9AC1FF5F9AC1FF999D9BFFFFFFFFFFA0A6A4FF0000000000000000BBC2
+        BFFFFFFFFFFF9B9F9DFF6999B9FF6C9BBBFF719FBDFF74A1BFFF7AA5C1FF7EA7
+        C3FF728D9FFF85ABC4FF6C7982FF8EB2CAFF90B4CCFF8DACC0FF778188FF89AC
+        C2FF81A9C4FF74A1BFFF9CA09EFFFFFFFFFFA4ABA8FF0000000000000000BFC7
+        C3FFFFFFFFFFA1A5A3FF739AB3FF739AB3FF779CB4FF7B9FB7FF7FA2B9FF83A5
+        BAFF86A7BBFF7A909EFF6C757BFF7F93A0FF92B0C3FF8DA7B7FF7E8C95FF8292
+        9CFF8AA1AFFF92B0C4FFB4B7B6FFFFFFFFFFA7AEABFF0000000000000000C3CB
+        C7FFFFFFFFFFA6AAA9FF7C9BADFF7C9BADFF7C9BADFF7F9DAFFF819EAEFF7D94
+        A1FF72818AFF7E909BFF8FA9B9FF8699A4FF94ADBCFF95AEBDFF96AEBDFF8FA3
+        B0FF95ADBCFF95AEBDFFB6B9B8FFFFFFFFFFABB2AFFF0000000000000000C7CF
+        CBFFFFFFFFFFACB0AEFF869CA9FF869CA9FF869CA9FF869CA9FF81939EFF7682
+        89FF8697A1FF90A4B0FF93A6B2FF94A7B2FF96A9B4FF97AAB5FF98ABB6FF98AB
+        B6FF98ABB6FF98ABB6FFB8BBB9FFFFFFFFFFB0B6B3FF0000000000000000CBD2
+        CFFFFFFFFFFFB2B5B4FF909EA6FF909EA6FF909EA6FF909EA6FF909EA6FF909E
+        A6FF93A1A8FF95A3AAFF96A4ABFF98A6ADFF9AA7AEFF9BA8AFFF9CA9AFFF9CA9
+        B0FF9CA9B0FF9CA9AFFFBABCBBFFFFFFFFFFB4BAB7FF0000000000000000CFD6
+        D2FFFFFFFFFFBEC1C0FFB6B9B8FFB6B9B8FFB6B9B8FFB6B9B8FFB6B9B8FFB6B9
+        B8FFB6B9B8FFB6B9B8FFB7BAB9FFB8BBBAFFB9BCBBFFBABCBBFFBBBDBCFFBBBD
+        BCFFBBBDBCFFBBBDBCFFC1C3C3FFFFFFFFFFB8BFBBFF0000000000000000CFD7
+        D3FFFDFDFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFDFDFFBCC2BFFF0000000000000000CFD7
+        D299CED6D2FFCFD7D3FFCFD7D3FFCFD7D3FFCFD7D3FFCFD7D3FFCFD7D3FFCED6
+        D2FFCDD5D1FFCCD4D0FFCBD2CFFFCAD1CDFFC8D0CCFFC7CFCBFFC6CECAFFC5CD
+        C9FFC4CCC8FFC3CAC7FFC2C9C6FFC0C7C4FFC0C6C59900000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000
+      }
+      OnClick = btnSavePictureClick
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object btnSetAspectRatio: TBCButton
+      Left = 170
+      Height = 28
+      Hint = 'Apply new aspect ratio'
+      Top = 132
+      Width = 40
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      Glyph.Data = {
+        36090000424D3609000000000000360000002800000018000000180000000100
+        2000000000000009000064000000640000000000000000000000FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00000000040000000D000000170000001C000000170000000D0000
+        0004FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF0000000013000000270000003B23252567575B5ADB232323670000003B0000
+        002700000013FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00000000070000001B363A364B646966EB999E9BFF5F6563EB3336334B0000
+        001B00000007FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF006C736C286B726FE7BABEBDFFDCDFDEFFB8BCBAFF646966E76066
+        6628FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF0073797328727774E7BEC2C1FFD8DCDAFFC2C8C6FFD7DAD9FFBBBEBDFF666B
+        68E760666628FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF007979
+        7928777D7BE7C2C6C4FFDCDFDEFFC9CFCDFFE9ECEBFFC7CCCAFFD8DCDBFFBCBF
+        BEFF676C6AE766666628FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF007C837C237D82
+        7FE7C6CAC8FFDFE2E1FFCFD2D1FFF6F6F6FFFAFAFAFFF5F6F6FFCACFCDFFDADE
+        DDFFBEC2C1FF696E6BE762696922FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00808583A5D2D4
+        D4FFE2E5E4FFD2D7D5FFF6F7F7FFE9EBEAFF787D7BFFE9EAE9FFF5F6F6FFCCD2
+        D0FFDCE0DEFFB7BCBAFF676D6B94FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00858B88E4FDFD
+        FDFFE9EBEAFFF7F8F8FFEBECEBFF7D827FE7767C7950797E7CE7E9EAEAFFF5F6
+        F6FFD8DBDAFFE2E4E4FF6C716EE4FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00878C8A97D4D7
+        D5FFFAFAFAFFE5E6E6FF828886E780808028FFFFFF00798079287B7F7EE7E4E6
+        E5FFFDFDFDFFD5D7D6FF70737292FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008A958A18888D
+        8C92868C88E4858A869480878722FFFFFF00FFFFFF00FFFFFF007C7C7C23797D
+        7CA5777B79E4757A769775757518FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF008F978F20919794A98D9390F58E9491A9878F8720FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00979D9AA9CDD0CEFDE4E6E6FFB1B5B4FC8F9492A9FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00979D9BF5FDFDFDFFF3F4F4FFEFF0F0FF909693F5FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00A7AFAF20AEB4B1A9A9B0ADF5A9AFAEA99FA7A720FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF009EA3A0A9DBDEDDFDFDFDFDFFDADDDBFD979B98A9FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00B2BAB7A9D9DBDBFDE8EAEAFFC3C7C5FCABB1AEA9FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF009F9F9F209EA4A3A99AA09EF59BA09EA997979720FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00B4BAB7F5FDFDFDFFF3F4F4FFF1F2F2FFACB3B0F5FFFFFF00A7AF
+        A720A7AEACA9A4AAA8F5A4ABA7A99FA79F20FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00BAC0BDA9E5E7E6FDFDFDFDFFE3E6E5FDB2B8B5A9FFFFFF00AEB4
+        B1A9D7D9D9FDE7E9E9FFBFC4C2FCA6ACA9A9FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00B7BFB720BAC0BDA9B6BDBAF5B7BDBAA9AFB7B720FFFFFF00AFB6
+        B3F5FDFDFDFFF3F4F4FFF1F2F1FFA7ADABF5FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B5BB
+        B8A9E3E5E4FDFDFDFDFFE2E4E3FDACB2AFA9FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B7B7
+        B720B5BDBAA9B2B8B6F5B2B8B5A9AFAFAF20FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
+      }
+      OnClick = btnSetAspectRatioClick
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object btnGetAspectRatioFromImage: TBCButton
+      Left = 20
+      Height = 30
+      Hint = 'Get aspect ratio from image'
+      Top = 168
+      Width = 30
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      Glyph.Data = {
+        36090000424D3609000000000000360000002800000018000000180000000100
+        2000000000000009000064000000640000000000000000000000FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00000000010000000300000003000000030000000300000003000000030000
+        0003000000030000000300000003000000030000000300000003000000030000
+        0001FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF0000000007000000110000001C0000001F0000001F0000001F0000001F0000
+        001F0000001F0000001F0000001F0000001F0000001F0000001D000000120000
+        0007FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000
+        0001000000100000002C6B6E6D9D868B89FA858A88FF858A88FF858A88FF858A
+        88FF858A88FF858A88FF858A88FF858A88FF868B89FA6B6E6D9D000000300000
+        000F00000001FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF000000000700000011878C8AFADEE3E1FFEAEEECFFEAEEECFFEAEEECFFEAEE
+        ECFFEAEEECFFEAEEECFFEAEEECFFEAEEECFFDEE3E1FF878C8AFA000000120000
+        0007FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF000000000100000003858A88FFEDF0EFFFDBE0DEFFDBE0DEFFDBE0DEFFDBE0
+        DEFFDBE0DEFFDBE0DEFFDBE0DEFFDBE0DEFFEDF0EFFF858A88FF000000030000
+        0001FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00858A88FFF0F2F1FFE0E5E3FFE0E5E3FFE0E5E3FFE0E5
+        E3FFE0E5E3FFE0E5E3FFE0E5E3FFE0E5E3FFF0F2F1FF858A88FFFFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00858A88FFF2F4F4FFE5E9E8FFE5E9E8FFE5E9E8FFE5E9
+        E8FFE5E9E8FFE5E9E8FFE5E9E8FFE5E9E8FFF2F4F4FF858A88FFFFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00858A88FFF5F6F6FFEBEDEDFFEBEDEDFFEBEDEDFFEBED
+        EDFFEBEDEDFFEBEDEDFFEBEDEDFFEBEDEDFFF5F6F6FF858A88FFFFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00858A88FFF6F7F7FFECEEEEFFECEEEEFFECEEEEFFECEE
+        EEFFECEEEEFFECEEEEFF874A20FF874A20FF874A20FF874A20FF874A20FF874A
+        20F0874B1F6AFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00858A88FFDFE2E1FFC1C9C5FFC5CDC9FFC8D0CCFFCBD3
+        CFFFCBD3CFFFC8D0CCFF874A20FFDEBD9EFFDEBD9EFFDEBD9EFFDEBD9EFFD0AB
+        8AFF874A20DFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00878C8AF9DADFDDFFE0E4E2FFE2E6E4FFE4E8E6FFE5E9
+        E7FFE5E9E7FFE4E8E6FF874A20FFDEBD9EFFD9B797FFA06B44FF874A20FF874A
+        20F8864A206EFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF008B8F8D7B878C8AF8858A88FF858A88FF858A88FF858A
+        88FF858A88FF858A88FF874A20FFDEBD9EFFA06B44FFD9B797FFA06B44FF884A
+        209E80800002FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00874A20FFDEBD9EFF874A20FFA06B44FFD9B797FFA06B
+        44FF884A209E80800002FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00874A20F8D0AB8AFF874A20F0884A209EA06B44FFD9B7
+        97FFA06B44FF884A209E80000002FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00864A206E874A20DF874B1F6A80800002884A209EA06B
+        44FFD9B797FFA36F48E3864A206EFF000001FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080800002884A
+        209EA36F48E3DBBA99FAA57048A4864B213DFFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000
+        0002864A206EA57048A4BD8F66AA945C304595552B0CFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FF000001864B213D945C30458C4D2614FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF0095552B0CFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
+      }
+      OnClick = btnGetAspectRatioFromImageClick
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object btnRotateLeft: TBCButton
+      Left = 64
+      Height = 30
+      Hint = 'Rotate Left'
+      Top = 168
+      Width = 30
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      Glyph.Data = {
+        36090000424D3609000000000000360000002800000018000000180000000100
+        2000000000000009000064000000640000000000000000000000FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+        00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+        00FF000000FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFFB1C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF6464A2FFFFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFFB1C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF6464A2FFFFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFFB1C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF6464A2FFFFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFFB1C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF6464A2FFFFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFFB1C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+        00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+        00FF000000FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF7F0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF000066FFFF0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF320066FFFFFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF7F0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF000066FFFF0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF320066FFFFFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF7F0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF000066FFFF0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF320066FFFFFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF7F0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF000066FFFF0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF320066FFFFFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF7F0066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF000066FFFFFFFFFF7F0066FFFFFFFFFF7F0066FFFFFFFF
+        FF7F0066FFFFFFFFFF7F0066FFFFFFFFFF7F0066FFFFFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
+      }
+      OnClick = btnRotateLeftClick
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object btnRotateRight: TBCButton
+      Left = 100
+      Height = 30
+      Hint = 'Rotate Right'
+      Top = 168
+      Width = 30
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      Glyph.Data = {
+        36090000424D3609000000000000360000002800000018000000180000000100
+        2000000000000009000064000000640000000000000000000000FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+        00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+        00FF000000FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82FFFFFFB1FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF8264A2FFFFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82FFFFFFB1FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF8264A2FFFFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82FFFFFFB1FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF8264A2FFFFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82FFFFFFB1FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF8264A2FFFFFFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FFC4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DCFF82C4DC
+        FF82C4DCFF82C4DCFF82FFFFFFB1FFFFFF64FFFFFF64FFFFFF64FFFFFF64FFFF
+        FF64FFFFFF64FFFFFF64FFFFFF64FFFFFF64000000FFFFFFFF00FFFFFF00FFFF
+        FF00000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+        00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+        00FF000000FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFF
+        FF00FFFFFF7F0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF000066FFFF0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FFFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF7F0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF000066FFFF0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FFFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF7F0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF000066FFFF0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FFFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF7F0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF000066FFFF0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF320066FFFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF7F0066FF320066FF320066FF320066FF320066FF320066FF320066
+        FF320066FF320066FF32FFFFFF7FFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF000066FFFFFFFFFF7F0066FFFFFFFFFF7F0066FFFFFFFFFF7F0066FFFFFFFF
+        FF7F0066FFFFFFFFFF7F0066FFFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
+      }
+      OnClick = btnRotateRightClick
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object btnShape: TBCButton
+      Left = 10
+      Height = 48
+      Top = 224
+      Width = 200
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      StaticButton = True
+      TextApplyGlobalOpacity = False
+    end
+    object btnSavePictureAll: TBCButton
+      Left = 10
+      Height = 40
+      Top = 320
+      Width = 200
+      StateClicked.Background.Color = clBlack
+      StateClicked.Background.ColorOpacity = 255
+      StateClicked.Background.Gradient1.StartColor = 8404992
+      StateClicked.Background.Gradient1.StartColorOpacity = 255
+      StateClicked.Background.Gradient1.DrawMode = dmSet
+      StateClicked.Background.Gradient1.EndColor = 4194304
+      StateClicked.Background.Gradient1.EndColorOpacity = 255
+      StateClicked.Background.Gradient1.ColorCorrection = True
+      StateClicked.Background.Gradient1.GradientType = gtRadial
+      StateClicked.Background.Gradient1.Point1XPercent = 50
+      StateClicked.Background.Gradient1.Point1YPercent = 100
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 0
+      StateClicked.Background.Gradient1.Sinus = False
+      StateClicked.Background.Gradient2.StartColor = clWhite
+      StateClicked.Background.Gradient2.StartColorOpacity = 255
+      StateClicked.Background.Gradient2.DrawMode = dmSet
+      StateClicked.Background.Gradient2.EndColor = clBlack
+      StateClicked.Background.Gradient2.EndColorOpacity = 255
+      StateClicked.Background.Gradient2.ColorCorrection = True
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient2.Sinus = False
+      StateClicked.Background.Gradient1EndPercent = 100
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBlack
+      StateClicked.Border.ColorOpacity = 255
+      StateClicked.Border.LightColor = clWhite
+      StateClicked.Border.LightOpacity = 255
+      StateClicked.Border.LightWidth = 0
+      StateClicked.Border.Style = bboNone
+      StateClicked.Border.Width = 1
+      StateClicked.FontEx.Color = 16770790
+      StateClicked.FontEx.EndEllipsis = False
+      StateClicked.FontEx.FontQuality = fqSystemClearType
+      StateClicked.FontEx.Height = 0
+      StateClicked.FontEx.SingleLine = True
+      StateClicked.FontEx.Shadow = True
+      StateClicked.FontEx.ShadowColor = clBlack
+      StateClicked.FontEx.ShadowColorOpacity = 255
+      StateClicked.FontEx.ShadowRadius = 2
+      StateClicked.FontEx.ShadowOffsetX = 1
+      StateClicked.FontEx.ShadowOffsetY = 1
+      StateClicked.FontEx.Style = [fsBold]
+      StateClicked.FontEx.TextAlignment = bcaCenter
+      StateClicked.FontEx.WordBreak = False
+      StateHover.Background.Color = clBlack
+      StateHover.Background.ColorOpacity = 255
+      StateHover.Background.Gradient1.StartColor = 16744448
+      StateHover.Background.Gradient1.StartColorOpacity = 255
+      StateHover.Background.Gradient1.DrawMode = dmSet
+      StateHover.Background.Gradient1.EndColor = 8404992
+      StateHover.Background.Gradient1.EndColorOpacity = 255
+      StateHover.Background.Gradient1.ColorCorrection = True
+      StateHover.Background.Gradient1.GradientType = gtRadial
+      StateHover.Background.Gradient1.Point1XPercent = 50
+      StateHover.Background.Gradient1.Point1YPercent = 100
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 0
+      StateHover.Background.Gradient1.Sinus = False
+      StateHover.Background.Gradient2.StartColor = clWhite
+      StateHover.Background.Gradient2.StartColorOpacity = 255
+      StateHover.Background.Gradient2.DrawMode = dmSet
+      StateHover.Background.Gradient2.EndColor = clBlack
+      StateHover.Background.Gradient2.EndColorOpacity = 255
+      StateHover.Background.Gradient2.ColorCorrection = True
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient2.Sinus = False
+      StateHover.Background.Gradient1EndPercent = 100
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBlack
+      StateHover.Border.ColorOpacity = 255
+      StateHover.Border.LightColor = clWhite
+      StateHover.Border.LightOpacity = 255
+      StateHover.Border.LightWidth = 0
+      StateHover.Border.Style = bboNone
+      StateHover.Border.Width = 1
+      StateHover.FontEx.Color = clWhite
+      StateHover.FontEx.EndEllipsis = False
+      StateHover.FontEx.FontQuality = fqSystemClearType
+      StateHover.FontEx.Height = 0
+      StateHover.FontEx.SingleLine = True
+      StateHover.FontEx.Shadow = True
+      StateHover.FontEx.ShadowColor = clBlack
+      StateHover.FontEx.ShadowColorOpacity = 255
+      StateHover.FontEx.ShadowRadius = 2
+      StateHover.FontEx.ShadowOffsetX = 1
+      StateHover.FontEx.ShadowOffsetY = 1
+      StateHover.FontEx.Style = [fsBold]
+      StateHover.FontEx.TextAlignment = bcaCenter
+      StateHover.FontEx.WordBreak = False
+      StateNormal.Background.Color = clBlack
+      StateNormal.Background.ColorOpacity = 255
+      StateNormal.Background.Gradient1.StartColor = 4194304
+      StateNormal.Background.Gradient1.StartColorOpacity = 255
+      StateNormal.Background.Gradient1.DrawMode = dmSet
+      StateNormal.Background.Gradient1.EndColor = 8405056
+      StateNormal.Background.Gradient1.EndColorOpacity = 255
+      StateNormal.Background.Gradient1.ColorCorrection = True
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 100
+      StateNormal.Background.Gradient1.Sinus = False
+      StateNormal.Background.Gradient2.StartColor = 8405056
+      StateNormal.Background.Gradient2.StartColorOpacity = 255
+      StateNormal.Background.Gradient2.DrawMode = dmSet
+      StateNormal.Background.Gradient2.EndColor = 4194304
+      StateNormal.Background.Gradient2.EndColorOpacity = 255
+      StateNormal.Background.Gradient2.ColorCorrection = True
+      StateNormal.Background.Gradient2.GradientType = gtRadial
+      StateNormal.Background.Gradient2.Point1XPercent = 50
+      StateNormal.Background.Gradient2.Point1YPercent = 100
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 0
+      StateNormal.Background.Gradient2.Sinus = False
+      StateNormal.Background.Gradient1EndPercent = 60
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBlack
+      StateNormal.Border.ColorOpacity = 255
+      StateNormal.Border.LightColor = clWhite
+      StateNormal.Border.LightOpacity = 255
+      StateNormal.Border.LightWidth = 0
+      StateNormal.Border.Style = bboNone
+      StateNormal.Border.Width = 1
+      StateNormal.FontEx.Color = 16770790
+      StateNormal.FontEx.EndEllipsis = False
+      StateNormal.FontEx.FontQuality = fqSystemClearType
+      StateNormal.FontEx.Height = 0
+      StateNormal.FontEx.SingleLine = True
+      StateNormal.FontEx.Shadow = True
+      StateNormal.FontEx.ShadowColor = clBlack
+      StateNormal.FontEx.ShadowColorOpacity = 255
+      StateNormal.FontEx.ShadowRadius = 2
+      StateNormal.FontEx.ShadowOffsetX = 1
+      StateNormal.FontEx.ShadowOffsetY = 1
+      StateNormal.FontEx.Style = [fsBold]
+      StateNormal.FontEx.TextAlignment = bcaCenter
+      StateNormal.FontEx.WordBreak = False
+      Caption = 'Save All pictures...'
+      Color = clNone
+      DropDownWidth = 16
+      DropDownArrowSize = 8
+      GlobalOpacity = 255
+      Glyph.Data = {
+        36090000424D3609000000000000360000002800000018000000180000000100
+        2000000000000009000064000000640000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        000000000000000000001618170E171717AA525554FF666A68FF636765FF6267
+        65FF606462FF626764FF585D5AFF080808FF0D0D0DFF0506069D000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        00000000000000000000232524B04E504FFF626664FFE6ECEAFFBFC4C1FF9397
+        95FFC7CECBFFD9DFDCFF646866FF636765FE787B79FE0B0C0BFF000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        000000000000000000002C2E2DFF656867FE6F7371FEDAE1DEFF8F9592FF494D
+        4BFFC4CCC8FFCAD0CDFF6E7270FF565A58FF717573FE0F1010FF000000000000
+        00040000002E0000002E0000002E0000002E0000002E0000002E0000002E0000
+        002E0000002E0000002E303231FF656967FF7C817FFFD8DFDCFF959C98FF5F62
+        61FFD0D7D4FFD1D7D3FF7D8280FF545755FF727673FF131414FF00000000959C
+        9A9D959A98FF949A98FF939997FF929895FF919794FF909693FF8F9492FF8E93
+        91FF8D9290FF8C918FFF353736FF676B69FF7D8380FFBBC1BEFFC5CAC8FFCCD0
+        CEFFBEC2C0FFB9BEBBFF868A88FF646765FF6D706DFF181918FF000000009BA1
+        9EFFFDFDFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFF3A3C3BFF6D716FFF4E5250FF505553FF4F5452FF4D52
+        4FFF4C504EFF4B4E4CFF494C4AFF494B48FF616360FF1C1E1DFF00000000A0A6
+        A3FFFFFFFFFF959A99FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
+        88FF858A88FF858A88FF3E403FFF656866FFE4E5E5FFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFFFFFFFFFFE3E4E3FF545653FF212221FF00000000A4AA
+        A7FFFFFFFFFF838885FF36342EFF36342EFF36342EFF36342EFF36342EFF3634
+        2EFF36342EFF36342EFF424544FF656967FFEBEBEBFFECECECFFEEEDEDFFEEED
+        EDFFEEEDEDFFEEEDEDFFECECECFFEAEAEAFF555653FF252726FF00000000A8AE
+        ABFFFFFFFFFF858A88FF3FA8F0FF8DE8FCFFAEF5FEFFBDF7FFFFBDF7FFFFB6F7
+        FEFF9DF3FEFF45BEF4FF474A48FF666967FFE9EAE9FFF5F6F6FFF6F7F7FFF6F7
+        F7FFF6F7F7FFF6F7F7FFF5F6F6FFE8E8E8FF545653FF2A2B2BFF00000000ACB2
+        AFFFFFFFFFFF858A88FF43A2E2FF63C2EEFFA1F4FEFFB4F6FEFFB7F7FEFFA6F4
+        FEFF83E2F9FF44B0E7FF4B4F4CFF656865FFEAEBEBFFE1E2E2FFE3E3E4FFE3E3
+        E4FFE3E3E4FFE3E3E4FFE1E2E2FFEAEAEAFF555652FF2E302FFF00000000B0B6
+        B3FFFFFFFFFF8A8F8DFF51A2D7FF56A4D8FF85D3EFFFA4F2FCFFA4F2FDFF87DE
+        F4FF52B0DDFF4BA1D8FF4F5250FF7C7F7DFFE0D2C4FFEBDCCDFFEBDCCDFFEBDC
+        CDFFECDCCDFFECDCCDFFEBDCCDFFDFD1C3FF686967FF333433FF00000000B3BA
+        B7FFFFFFFFFF909492FF589ECCFF5EA1CEFF63A4CFFF68A7D1FF6FACD4FF71AD
+        D5FF6FABD3FF6097BCFF3D4242FF4C5253FF9F6B41FFAA6E3EFFAA6E3EFFAA6E
+        3EFFAA6E3EFFAA6E3EFFAA6E3EFF9C683EFF32393AFF3032309C00000000B7BE
+        BBFFFFFFFFFF959A98FF609BC2FF659FC4FF6AA2C6FF6FA5C8FF74A8CAFF76A5
+        C3FF7194ABFF677C89FF697A85FF87B3D1FF7DAECDFF6892ADFF3F5462FF5F9A
+        C1FF5F9AC1FF5F9AC1FF999D9BFFFFFFFFFFA0A6A4FF0000000000000000BBC2
+        BFFFFFFFFFFF9B9F9DFF6999B9FF6C9BBBFF719FBDFF74A1BFFF7AA5C1FF7EA7
+        C3FF728D9FFF85ABC4FF6C7982FF8EB2CAFF90B4CCFF8DACC0FF778188FF89AC
+        C2FF81A9C4FF74A1BFFF9CA09EFFFFFFFFFFA4ABA8FF0000000000000000BFC7
+        C3FFFFFFFFFFA1A5A3FF739AB3FF739AB3FF779CB4FF7B9FB7FF7FA2B9FF83A5
+        BAFF86A7BBFF7A909EFF6C757BFF7F93A0FF92B0C3FF8DA7B7FF7E8C95FF8292
+        9CFF8AA1AFFF92B0C4FFB4B7B6FFFFFFFFFFA7AEABFF0000000000000000C3CB
+        C7FFFFFFFFFFA6AAA9FF7C9BADFF7C9BADFF7C9BADFF7F9DAFFF819EAEFF7D94
+        A1FF72818AFF7E909BFF8FA9B9FF8699A4FF94ADBCFF95AEBDFF96AEBDFF8FA3
+        B0FF95ADBCFF95AEBDFFB6B9B8FFFFFFFFFFABB2AFFF0000000000000000C7CF
+        CBFFFFFFFFFFACB0AEFF869CA9FF869CA9FF869CA9FF869CA9FF81939EFF7682
+        89FF8697A1FF90A4B0FF93A6B2FF94A7B2FF96A9B4FF97AAB5FF98ABB6FF98AB
+        B6FF98ABB6FF98ABB6FFB8BBB9FFFFFFFFFFB0B6B3FF0000000000000000CBD2
+        CFFFFFFFFFFFB2B5B4FF909EA6FF909EA6FF909EA6FF909EA6FF909EA6FF909E
+        A6FF93A1A8FF95A3AAFF96A4ABFF98A6ADFF9AA7AEFF9BA8AFFF9CA9AFFF9CA9
+        B0FF9CA9B0FF9CA9AFFFBABCBBFFFFFFFFFFB4BAB7FF0000000000000000CFD6
+        D2FFFFFFFFFFBEC1C0FFB6B9B8FFB6B9B8FFB6B9B8FFB6B9B8FFB6B9B8FFB6B9
+        B8FFB6B9B8FFB6B9B8FFB7BAB9FFB8BBBAFFB9BCBBFFBABCBBFFBBBDBCFFBBBD
+        BCFFBBBDBCFFBBBDBCFFC1C3C3FFFFFFFFFFB8BFBBFF0000000000000000CFD7
+        D3FFFDFDFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+        FFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFDFDFFBCC2BFFF0000000000000000CFD7
+        D299CED6D2FFCFD7D3FFCFD7D3FFCFD7D3FFCFD7D3FFCFD7D3FFCFD7D3FFCED6
+        D2FFCDD5D1FFCCD4D0FFCBD2CFFFCAD1CDFFC8D0CCFFC7CFCBFFC6CECAFFC5CD
+        C9FFC4CCC8FFC3CAC7FFC2C9C6FFC0C7C4FFC0C6C59900000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000000000000000
+        0000000000000000000000000000000000000000000000000000
+      }
+      OnClick = btnSavePictureAllClick
+      ParentColor = False
+      Rounding.RoundX = 12
+      Rounding.RoundY = 12
+      Rounding.RoundOptions = []
+      RoundingDropDown.RoundX = 1
+      RoundingDropDown.RoundY = 1
+      RoundingDropDown.RoundOptions = []
+      TextApplyGlobalOpacity = False
+    end
+    object chkFullSize: TCheckBox
+      Left = 24
+      Height = 26
+      Top = 288
+      Width = 167
+      Caption = 'Save Original Size picture'
+      TabOrder = 3
+    end
+  end
+  object BGRAImageManipulation: TBGRAImageManipulation
+    Left = 0
+    Height = 420
+    Top = 0
+    Width = 320
+    Align = alClient
+    AnchorSize = 9
+    BorderSize = 10
+    AspectRatio = '3:4'
+    MinHeight = 40
+    MinWidth = 30
+  end
+  object OpenPictureDialog: TOpenPictureDialog
+    Title = 'Open an existing image'
+    left = 64
+    top = 16
+  end
+  object SavePictureDialog: TSavePictureDialog
+    Title = 'Save image as'
+    left = 192
+    top = 16
+  end
+  object SelectDirectoryDialog1: TSelectDirectoryDialog
+    left = 198
+    top = 74
+  end
+end

+ 218 - 0
test/test_bgracontrols/test_bgraimagemanipulation/unitbgraimagemanipulationdemo.pas

@@ -0,0 +1,218 @@
+unit UnitBGRAImageManipulationDemo;
+
+{ ============================================================================
+  BGRAImageManipulation Demon Unit
+
+  Copyright (C) 2011 - Emerson Cavalcanti
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or (at your
+  option) any later version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+  for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+  ============================================================================
+  Description:
+
+  TFormBGRAImageManipulationDemo is a sample form to use the component
+  TBGRAImageManipulation.
+
+  ============================================================================
+  History:
+
+  2011-05-06 - Emerson Cavalcanti
+             - Initial version
+
+  2011-06-01 - Emerson Cavalcanti
+             - Relayout of form.
+             - Add control to toggle the option 'Keep Aspect Ratio' in
+               component
+
+  2011-06-18 - Emerson Cavalcanti
+             - Relayout of form for expand component on resize.
+             - Add control to rotate image
+
+  2013-10-13 - Massimo Magnano
+             - Add multi crop demo
+
+  ============================================================================
+}
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
+  Buttons, ExtDlgs, ComCtrls, ExtCtrls, BGRAImageManipulation, BGRABitmap,
+  BGRABitmapTypes, BCPanel, BCButton{, BGRATrackBar};
+
+type
+
+  { TFormBGRAImageManipulationDemo }
+
+  TFormBGRAImageManipulationDemo = class(TForm)
+    Background:        TBCPanel;
+    btnSavePictureAll: TBCButton;
+    btnShape:          TBCButton;
+    btnOpenPicture:    TBCButton;
+    BGRAImageManipulation: TBGRAImageManipulation;
+    btnGetAspectRatioFromImage: TBCButton;
+    btnSavePicture:    TBCButton;
+    btnSetAspectRatio: TBCButton;
+    btnRotateLeft:     TBCButton;
+    btnRotateRight:    TBCButton;
+    chkFullSize: TCheckBox;
+    edAspectRatio:     TEdit;
+    KeepAspectRatio:   TCheckBox;
+    lbAspectRatio:     TLabel;
+    lbOptions:         TLabel;
+    lbCompression:     TLabel;
+    OpenPictureDialog: TOpenPictureDialog;
+    SavePictureDialog: TSavePictureDialog;
+    RateCompression:   TTrackBar;
+    SelectDirectoryDialog1: TSelectDirectoryDialog;
+    procedure btnGetAspectRatioFromImageClick(Sender: TObject);
+    procedure btnOpenPictureClick(Sender: TObject);
+    procedure btnRotateLeftClick(Sender: TObject);
+    procedure btnRotateRightClick(Sender: TObject);
+    procedure btnSavePictureAllClick(Sender: TObject);
+    procedure btnSavePictureClick(Sender: TObject);
+    procedure btnSetAspectRatioClick(Sender: TObject);
+    procedure KeepAspectRatioClick(Sender: TObject);
+  private
+    { private declarations }
+    procedure SaveCallBack(Bitmap :TBGRABitmap; CropArea: TCropArea);
+  public
+    { public declarations }
+  end;
+
+var
+  FormBGRAImageManipulationDemo: TFormBGRAImageManipulationDemo;
+
+implementation
+
+{$R *.lfm}
+
+{ TFormBGRAImageManipulationDemo }
+
+procedure TFormBGRAImageManipulationDemo.btnOpenPictureClick(Sender: TObject);
+var
+  Bitmap: TBGRABitmap;
+begin
+  // To put a new image in the component, you will simply need execute open
+  // picture dialog to locate an image...
+  if OpenPictureDialog.Execute then
+  begin
+    // ...and create a new TBGRABitmap and load to it
+    Bitmap := TBGRABitmap.Create;
+    Bitmap.LoadFromFile(OpenPictureDialog.FileName);
+    // Finally, associate the image into component
+    BGRAImageManipulation.Bitmap := Bitmap;
+    Bitmap.Free;
+    BGRAImageManipulation.addCropArea(Rect(0,0,100,100));
+  end;
+end;
+
+procedure TFormBGRAImageManipulationDemo.btnRotateLeftClick(Sender: TObject);
+begin
+  BGRAImageManipulation.rotateLeft;
+end;
+
+procedure TFormBGRAImageManipulationDemo.btnRotateRightClick(Sender: TObject);
+begin
+  BGRAImageManipulation.rotateRight;
+end;
+
+procedure TFormBGRAImageManipulationDemo.btnGetAspectRatioFromImageClick(
+  Sender: TObject);
+begin
+  if not (BGRAImageManipulation.Empty) then
+  begin
+    edAspectRatio.Text := BGRAImageManipulation.getAspectRatioFromImage(
+      BGRAImageManipulation.Bitmap);
+  end;
+end;
+
+procedure TFormBGRAImageManipulationDemo.btnSavePictureClick(Sender: TObject);
+var
+  JpegImage: TJpegImage;
+begin
+  // This example save image compress in JPEG format
+
+  // Execute our Save Picture Dialog
+  SavePictureDialog.Filter := 'JPEG Image File (*.jpg, *.jpeg)';
+  if SavePictureDialog.Execute then
+  begin
+    try
+      // Compress
+      JpegImage := TJpegImage.Create;
+      if (chkFullSize.Checked)
+      then JpegImage.Assign(BGRAImageManipulation.getBitmapFullSize)
+      else JpegImage.Assign(BGRAImageManipulation.getBitmap);
+      JpegImage.CompressionQuality := RateCompression.Position;
+
+      // And save to file
+      JpegImage.SaveToFile(SavePictureDialog.FileName);
+    finally
+      JpegImage.Free;
+    end;
+  end;
+end;
+
+procedure TFormBGRAImageManipulationDemo.SaveCallBack(Bitmap :TBGRABitmap; CropArea: TCropArea);
+var
+  JpegImage: TJpegImage;
+begin
+    try
+      // Compress
+      JpegImage := TJpegImage.Create;
+      JpegImage.Assign(Bitmap);
+      JpegImage.CompressionQuality := RateCompression.Position;
+
+      // And save to file
+      JpegImage.SaveToFile(SelectDirectoryDialog1.FileName+'/'+IntToStr(CropArea.Index));
+    finally
+      JpegImage.Free;
+    end;
+end;
+
+procedure TFormBGRAImageManipulationDemo.btnSavePictureAllClick(Sender: TObject);
+begin
+     if SelectDirectoryDialog1.Execute
+     then begin
+                if (chkFullSize.Checked)
+                then Self.BGRAImageManipulation.getAllBitmapsFullSize(@SaveCallBack)
+                else Self.BGRAImageManipulation.getAllBitmaps(@SaveCallBack);
+          end;
+end;
+
+
+procedure TFormBGRAImageManipulationDemo.btnSetAspectRatioClick(Sender: TObject);
+begin
+  try
+    BGRAImageManipulation.AspectRatio := edAspectRatio.Text;
+  except
+    on E: Exception do
+    begin
+      ShowMessage('This aspect ratio is invalid');
+    end;
+  end;
+end;
+
+procedure TFormBGRAImageManipulationDemo.KeepAspectRatioClick(Sender: TObject);
+begin
+  BGRAImageManipulation.KeepAspectRatio := KeepAspectRatio.Checked;
+  edAspectRatio.Enabled := KeepAspectRatio.Checked;
+  btnSetAspectRatio.Enabled := KeepAspectRatio.Checked;
+end;
+
+end.

+ 93 - 0
test/test_extra/effect_fading/fading.lpi

@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="9"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="fading"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+    </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
+    <BuildModes Count="1">
+      <Item1 Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+      </local>
+    </RunParams>
+    <RequiredPackages Count="2">
+      <Item1>
+        <PackageName Value="bgracontrols"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LCL"/>
+      </Item2>
+    </RequiredPackages>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="fading.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="fading"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="unit1.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="Unit1"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="fading"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <CompilerMessages>
+        <MsgFileName Value=""/>
+      </CompilerMessages>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 21 - 0
test/test_extra/effect_fading/fading.lpr

@@ -0,0 +1,21 @@
+program fading;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, Unit1
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource := True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

+ 104 - 0
test/test_extra/effect_fading/unit1.lfm

@@ -0,0 +1,104 @@
+object Form1: TForm1
+  Left = 353
+  Height = 240
+  Top = 169
+  Width = 501
+  Caption = 'Fading'
+  ClientHeight = 240
+  ClientWidth = 501
+  OnCloseQuery = FormCloseQuery
+  OnCreate = FormCreate
+  OnDestroy = FormDestroy
+  LCLVersion = '1.1'
+  object bgImage: TBGRAGraphicControl
+    Left = 15
+    Height = 108
+    Top = 16
+    Width = 185
+    OnRedraw = bgImageRedraw
+    Color = clWhite
+    ColorOpacity = 128
+    Alignment = taCenter
+    Caption = 'bgImage'
+  end
+  object cbFadingMode: TComboBox
+    Left = 208
+    Height = 23
+    Top = 16
+    Width = 180
+    ItemHeight = 15
+    OnChange = cbFadingModeChange
+    Style = csDropDownList
+    TabOrder = 0
+  end
+  object seFadingStep: TSpinEdit
+    Left = 208
+    Height = 23
+    Top = 45
+    Width = 114
+    MaxValue = 255
+    MinValue = 1
+    OnChange = seFadingStepChange
+    TabOrder = 1
+    Value = 5
+  end
+  object seTimerInterval: TSpinEdit
+    Left = 208
+    Height = 23
+    Top = 73
+    Width = 114
+    MaxValue = 1000
+    MinValue = 1
+    OnChange = seTimerIntervalChange
+    TabOrder = 2
+    Value = 16
+  end
+  object Label1: TLabel
+    Left = 336
+    Height = 15
+    Top = 49
+    Width = 62
+    Caption = 'Fading Step'
+    ParentColor = False
+  end
+  object Label2: TLabel
+    Left = 336
+    Height = 15
+    Top = 77
+    Width = 73
+    Caption = 'Timer Interval'
+    ParentColor = False
+  end
+  object Label3: TLabel
+    Left = 15
+    Height = 15
+    Top = 144
+    Width = 31
+    Caption = 'Alpha'
+    ParentColor = False
+  end
+  object seDuration: TSpinEdit
+    Left = 208
+    Height = 23
+    Top = 101
+    Width = 114
+    Increment = 100
+    MaxValue = 10000
+    OnChange = seDurationChange
+    TabOrder = 3
+  end
+  object Label4: TLabel
+    Left = 336
+    Height = 15
+    Top = 105
+    Width = 73
+    Caption = 'Duration (ms)'
+    ParentColor = False
+  end
+  object Timer1: TTimer
+    Interval = 33
+    OnTimer = Timer1Timer
+    left = 16
+    top = 16
+  end
+end

+ 149 - 0
test/test_extra/effect_fading/unit1.pas

@@ -0,0 +1,149 @@
+unit Unit1;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
+  StdCtrls, BGRAGraphicControl, BGRABitmap, BGRABitmapTypes, BCFilters, Spin, BCEffect;
+
+type
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    bgImage: TBGRAGraphicControl;
+    cbFadingMode: TComboBox;
+    Label1: TLabel;
+    Label2: TLabel;
+    Label3: TLabel;
+    Label4: TLabel;
+    seFadingStep: TSpinEdit;
+    seTimerInterval: TSpinEdit;
+    seDuration: TSpinEdit;
+    Timer1: TTimer;
+    procedure bgImageRedraw(Sender: TObject; Bitmap: TBGRABitmap);
+    procedure cbFadingModeChange(Sender: TObject);
+    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
+    procedure FormCreate(Sender: TObject);
+    procedure FormDestroy(Sender: TObject);
+    procedure seDurationChange(Sender: TObject);
+    procedure seFadingStepChange(Sender: TObject);
+    procedure seTimerIntervalChange(Sender: TObject);
+    procedure Timer1Timer(Sender: TObject);
+  private
+    { private declarations }
+  public
+    { public declarations }
+    Fade: TFading;
+    {$ifdef Windows}
+    FadeForm: TFading;
+    {$endif}
+    Image: TBGRABitmap;
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.bgImageRedraw(Sender: TObject; Bitmap: TBGRABitmap);
+begin
+  // set black background
+  Bitmap.Fill(BGRABlack);
+  // draw image with fading alpha
+  Bitmap.BlendImageOver(0, 0, Image, boLinearBlend, Fade.Alpha);
+end;
+
+procedure TForm1.cbFadingModeChange(Sender: TObject);
+begin
+  // set fading mode
+  Fade.Mode := StrToTFadingMode(cbFadingMode.Caption);
+  // reset
+  Fade.Reset;
+end;
+
+procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
+begin
+  {$ifdef Windows}
+  if (FadeForm.Alpha > 0) then
+  begin
+    FadeForm.Mode := fmFadeOut;
+    CanClose := False;
+  end
+  else
+    CanClose := True;
+  {$endif}
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  // add items to combo box
+  FadingModeStrList(cbFadingMode.Items);
+  // load step from spin edit
+  Fade.Step := seFadingStep.Value;
+  // load interval from spin edit
+  Timer1.Interval := seTimerInterval.Value;
+
+  // create test image
+  Image := TBGRABitmap.Create(bgImage.Width, bgImage.Height);
+  NoiseBWA(Image);
+
+  // fade form Windows
+  {$ifdef Windows}
+  Self.DoubleBuffered := True;
+  Self.AlphaBlend := True;
+  Self.AlphaBlendValue := 0;
+  FadeForm.Mode := fmFadeIn;
+  FadeForm.Duration := 300;
+  {$endif}
+end;
+
+procedure TForm1.FormDestroy(Sender: TObject);
+begin
+  // free test image
+  Image.Free;
+end;
+
+procedure TForm1.seDurationChange(Sender: TObject);
+begin
+  Fade.Duration := seDuration.Value;
+end;
+
+procedure TForm1.seFadingStepChange(Sender: TObject);
+begin
+  // set fading step
+  Fade.Step := seFadingStep.Value;
+end;
+
+procedure TForm1.seTimerIntervalChange(Sender: TObject);
+begin
+  // change timer interval
+  Timer1.Interval := seTimerInterval.Value;
+end;
+
+procedure TForm1.Timer1Timer(Sender: TObject);
+begin
+  Timer1.Enabled:= false; //avoid freezing application
+
+  { calculate fading  // display alpha }
+  Label3.Caption := concat('FadingAlpha: ', IntToStr(Fade.Execute));
+
+  // update bitmap
+  bgImage.RedrawBitmap;
+
+  {$ifdef Windows}
+  if FadeForm.Mode <> fmSuspended then
+    Self.AlphaBlendValue := FadeForm.Execute;
+
+  if (FadeForm.Mode = fmSuspended) and (FadeForm.Alpha = 0) then
+    Close;
+  {$endif}
+  Timer1.Enabled:= true;
+end;
+
+end.

Some files were not shown because too many files changed in this diff