Browse Source

Added CustomDrawn theme selection in BCDefaultThemeManager

lainz 8 years ago
parent
commit
79607a209f
3 changed files with 61 additions and 7 deletions
  1. 58 4
      bcdefaultthememanager.pas
  2. 1 1
      bgracontrols.lpk
  3. 2 2
      update_bgracontrols_force.json

+ 58 - 4
bcdefaultthememanager.pas

@@ -7,7 +7,7 @@ interface
 uses
   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
   BCButton, BCButtonFocus, BCNumericKeyboard, BCThemeManager,
-  BCSamples, CustomDrawnDrawers, BCKeyboard;
+  BCSamples, CustomDrawnDrawers, BGRACustomDrawn, BCKeyboard;
 
 type
 
@@ -136,13 +136,67 @@ begin
     if (AControl.Controls[i] is TBCButtonFocus) then
       with TBCButtonFocus(AControl.Controls[i]) do
         if (Assigned(ThemeManager)) and
-          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
-          (tempButtonFocus.Name <> AControl.Controls[i].Name) then
+          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) then
         begin
           Assign(tempButtonFocus);
         end;
     { Custom Drawn }
-    // implement it
+    if (AControl.Controls[i] is TBCDButton) then
+      with TBCDButton(AControl.Controls[i]) do
+        if (Assigned(ThemeManager)) and
+          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
+          (tempButtonFocus.Name <> AControl.Controls[i].Name) then
+        begin
+          DrawStyle := CDStyle;
+        end;
+    if (AControl.Controls[i] is TBCDEdit) then
+      with TBCDEdit(AControl.Controls[i]) do
+        if (Assigned(ThemeManager)) and
+          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
+          (tempButtonFocus.Name <> AControl.Controls[i].Name) then
+        begin
+          DrawStyle := CDStyle;
+        end;
+    if (AControl.Controls[i] is TBCDStaticText) then
+      with TBCDStaticText(AControl.Controls[i]) do
+        if (Assigned(ThemeManager)) and
+          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
+          (tempButtonFocus.Name <> AControl.Controls[i].Name) then
+        begin
+          DrawStyle := CDStyle;
+        end;
+    if (AControl.Controls[i] is TBCDProgressBar) then
+      with TBCDProgressBar(AControl.Controls[i]) do
+        if (Assigned(ThemeManager)) and
+          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
+          (tempButtonFocus.Name <> AControl.Controls[i].Name) then
+        begin
+          DrawStyle := CDStyle;
+        end;
+    if (AControl.Controls[i] is TBCDSpinEdit) then
+      with TBCDSpinEdit(AControl.Controls[i]) do
+        if (Assigned(ThemeManager)) and
+          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
+          (tempButtonFocus.Name <> AControl.Controls[i].Name) then
+        begin
+          DrawStyle := CDStyle;
+        end;
+    if (AControl.Controls[i] is TBCDCheckBox) then
+      with TBCDCheckBox(AControl.Controls[i]) do
+        if (Assigned(ThemeManager)) and
+          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
+          (tempButtonFocus.Name <> AControl.Controls[i].Name) then
+        begin
+          DrawStyle := CDStyle;
+        end;
+    if (AControl.Controls[i] is TBCDRadioButton) then
+      with TBCDRadioButton(AControl.Controls[i]) do
+        if (Assigned(ThemeManager)) and
+          (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
+          (tempButtonFocus.Name <> AControl.Controls[i].Name) then
+        begin
+          DrawStyle := CDStyle;
+        end;
   end;
   { Components }
   for i := 0 to AControl.ComponentCount - 1 do

+ 1 - 1
bgracontrols.lpk

@@ -25,7 +25,7 @@
     </CompilerOptions>
     <Description Value="BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications."/>
     <License Value="Modified LGPL"/>
-    <Version Major="4" Minor="4"/>
+    <Version Major="4" Minor="4" Build="1"/>
     <Files Count="43">
       <Item1>
         <Filename Value="bcbasectrls.pas"/>

+ 2 - 2
update_bgracontrols_force.json

@@ -6,9 +6,9 @@
   "UpdatePackageFiles" : [
     {
       "ForceNotify" : true,
-      "InternalVersion" : 6,
+      "InternalVersion" : 7,
       "Name" : "bgracontrols.lpk",
-      "Version" : "4.4.0.0"
+      "Version" : "4.4.0.1"
     },
     {
       "ForceNotify" : false,