Browse Source

Fix in bcdefaultthememanager.pas

lainz 9 years ago
parent
commit
50c0227104

+ 8 - 18
bcdefaultthememanager.pas

@@ -100,22 +100,24 @@ begin
   removeTempButton := False;
   removeTempButton := False;
   removeTempButtonFocus := False;
   removeTempButtonFocus := False;
 
 
-  if Assigned(FButton) then
+  if (Assigned(FButton)) and (FBCStyle = ssDefault) then
     tempButton := FButton
     tempButton := FButton
   else
   else
   begin
   begin
     tempButton := TBCButton.Create(Self);
     tempButton := TBCButton.Create(Self);
     tempButton.Name := 'BCDefaultThemeManager_tempButton';
     tempButton.Name := 'BCDefaultThemeManager_tempButton';
     removeTempButton := True;
     removeTempButton := True;
+    StyleButtonsSample(tempButton, FBCStyle);
   end;
   end;
 
 
-  if Assigned(FButtonFocus) then
+  if (Assigned(FButton)) and (FBCStyle = ssDefault) then
     tempButtonFocus := FButtonFocus
     tempButtonFocus := FButtonFocus
   else
   else
   begin
   begin
     tempButtonFocus := TBCButtonFocus.Create(Self);
     tempButtonFocus := TBCButtonFocus.Create(Self);
     tempButtonFocus.Name := 'BCDefaultThemeManager_tempButtonFocus';
     tempButtonFocus.Name := 'BCDefaultThemeManager_tempButtonFocus';
     removeTempButtonFocus := True;
     removeTempButtonFocus := True;
+    StyleButtonsFocusSample(tempButtonFocus, FBCStyle);
   end;
   end;
 
 
   { Controls }
   { Controls }
@@ -128,10 +130,7 @@ begin
           (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
           (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
           (tempButton.Name <> AControl.Controls[i].Name) then
           (tempButton.Name <> AControl.Controls[i].Name) then
         begin
         begin
-          if FBCStyle = ssDefault then
-            Assign(tempButton)
-          else
-            StyleButtonsSample(AControl.Controls[i], FBCStyle);
+          Assign(tempButton);
         end;
         end;
     { BCButtonFocus }
     { BCButtonFocus }
     if (AControl.Controls[i] is TBCButtonFocus) then
     if (AControl.Controls[i] is TBCButtonFocus) then
@@ -140,10 +139,7 @@ begin
           (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
           (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
           (tempButtonFocus.Name <> AControl.Controls[i].Name) then
           (tempButtonFocus.Name <> AControl.Controls[i].Name) then
         begin
         begin
-          if FBCStyle = ssDefault then
-            Assign(tempButtonFocus)
-          else
-            StyleButtonsFocusSample(AControl.Controls[i], FBCStyle);
+          Assign(tempButtonFocus);
         end;
         end;
     { Custom Drawn }
     { Custom Drawn }
     // implement it
     // implement it
@@ -158,10 +154,7 @@ begin
           (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
           (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
           (tempButton.Name <> TBCNumericKeyboard(AControl.Components[i]).ButtonStyle.Name) then
           (tempButton.Name <> TBCNumericKeyboard(AControl.Components[i]).ButtonStyle.Name) then
         begin
         begin
-          if FBCStyle = ssDefault then
-            ButtonStyle.Assign(tempButton)
-          else
-            StyleButtonsSample(ButtonStyle, FBCStyle);
+          ButtonStyle.Assign(tempButton);
           UpdateButtonStyle;
           UpdateButtonStyle;
         end;
         end;
     { BCRealNumericKeyboard }
     { BCRealNumericKeyboard }
@@ -171,10 +164,7 @@ begin
           (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
           (TBCDefaultThemeManager(ThemeManager).Name = Self.Name) and
           (tempButton.Name <> TBCRealNumericKeyboard(AControl.Components[i]).ButtonStyle.Name) then
           (tempButton.Name <> TBCRealNumericKeyboard(AControl.Components[i]).ButtonStyle.Name) then
         begin
         begin
-          if FBCStyle = ssDefault then
-            ButtonStyle.Assign(tempButton)
-          else
-            StyleButtonsSample(ButtonStyle, FBCStyle);
+          ButtonStyle.Assign(tempButton);
           UpdateButtonStyle;
           UpdateButtonStyle;
         end;
         end;
   end;
   end;

+ 0 - 1
test/test_bccontrols/test_bcthememanager/test.lpi

@@ -12,7 +12,6 @@
       <XPManifest>
       <XPManifest>
         <DpiAware Value="True"/>
         <DpiAware Value="True"/>
       </XPManifest>
       </XPManifest>
-      <Icon Value="0"/>
     </General>
     </General>
     <BuildModes Count="3">
     <BuildModes Count="3">
       <Item1 Name="Default" Default="True"/>
       <Item1 Name="Default" Default="True"/>

+ 1 - 1
test/test_bccontrols/test_bcthememanager/umain.lfm

@@ -1047,7 +1047,7 @@ object Form1: TForm1
     end
     end
   end
   end
   object BCDefaultThemeManager1: TBCDefaultThemeManager
   object BCDefaultThemeManager1: TBCDefaultThemeManager
-    BCStyle = ssFlashPlayer
+    BCStyle = ssDefault
     CDStyle = dsDefault
     CDStyle = dsDefault
     left = 240
     left = 240
     top = 168
     top = 168

+ 1 - 0
test/test_bccontrols/test_bcthememanager/umain.pas

@@ -61,6 +61,7 @@ end;
 procedure TForm1.FormCreate(Sender: TObject);
 procedure TForm1.FormCreate(Sender: TObject);
 begin
 begin
   BCSampleStyleStrList(ComboBox1.Items);
   BCSampleStyleStrList(ComboBox1.Items);
+  ComboBox1.ItemIndex := 0;
 end;
 end;
 
 
 procedure TForm1.ComboBox1Change(Sender: TObject);
 procedure TForm1.ComboBox1Change(Sender: TObject);