Forum Replies Created
-
AuthorPosts
-
September 28, 2011 at 3:02 am in reply to: [SOLVED] Here is a strange thing… how can i solve it ? #46758HamiltonParticipant
Glad I could help 🙂 I'm not sure I understand your additional question but I think you'll just want to search for occurrences of FindFirst and FindNext throughout your project and change them all to SysUtils.FindFirst and SysUtils.FindNext. Best of luck.
HamiltonParticipantHey Wiseguy,
AlphaSkins does work with Application.MessageBox. The attached image shows this dialog with the Moonlight and iOS4 skins respectively. In your TsSkinManager component you may want to check that the SkinningRules.srStdDialogs option is turned on.
Regards,
Hamilton
September 26, 2011 at 1:57 am in reply to: [SOLVED] Here is a strange thing… how can i solve it ? #46749HamiltonParticipantHi Azrael,
You say the code raised an exception on 'selectdirectory' but that method is not called in your code. Regardless, I did try to run your code and apart from a couple of minor changes to get it working in a test environment everything seemed OK. Can you please try the following:
1. Create a new application
2. Add a tsbutton, align to bottom
3. Add a tsmemo, align to client
4. Add an OnClick event to the button and call the slightly modified StartSkinEngine procedure I've posted below. I made some slight changes to your code to get it to work in this scenario but nothing that affects the operation.
For me, the code ran successfully and caused the memo to be modified to contain the list of all skins in my skin folder and it set the skin to the one I'd requested.
If this doesn't work then there is something about your environment I'd guess. I didn't experiment what would happen if the skin folder had hidden files or folders but you could try something like searching for 'faAnyFile – faDirectory' insead of 'faAnyFile'. Also if you find your code works in the test app but doesn't in your project then something else to consider might be to change your file IO methods to explicitly call SysUtils, for example SysUtils.FindFirst, to avoid type mismatches with functions of the same name in other libraries (i've had this happen before, its obscure but maybe the wrong function is being called).
Anyway good luck I hope you get it sorted soon.
Procedure TForm1.StartSkinEngine;
var
skinnames: TStringList;
rec : TSearchRec;
themeName: string;
Begin
sSkinManager1.SkinDirectory := 'C:Delphi AddonsAlphaControlsSkins';
// sSkinManager1.SkinDirectory := ExtractFilePath(Application.ExeName) + 'mediaconfeditorskins';
SkinNames := TStringList.Create;
sSkinManager1.SkinName := sSkinManager1.GetSkinNames(SkinNames);
sMemo1.Lines.Clear;
if FindFirst(sSkinManager1.SkinDirectory+'*.*' , faAnyFile, Rec) = 0 then
begin
repeat
if ((Rec.Attr and faDirectory) <> faDirectory) then
begin
themeName := Trim(Copy(rec.Name,0,Length(rec.Name)-4));
sMemo1.Lines.Add(themeName);
end;
until FindNext(Rec) <> 0;
end;
sSkinManager1.SkinName := 'darkglass';
sSkinManager1.Active := True;
Application.ProcessMessages;
skinnames.Free;
end;
HamiltonParticipantHi Serge,
Thanks for the reply. I have tried ResetColour in a button OnClick event and the flicker still occurs so I'm fairly convinced that it is the way that the control is drawn rather than the time at which the colors are set that causes the flicker.
I have reported this behaviour in the 'opinions and suggestions' section because I can't call this a bug – I'm trying to use the skin for something that it isn't designed for and thus I'm happy enough to live with the consequences. Having said that, if I could have a wish then what I'd ask for is either:
1. A TsCategoryPanelGroup component 😛 This would be awesome! I wouldn't need any workaround and it would greatly reduce my risk of 'breaking' the UI if I update the skins and some color has changed.
OR
2a. Suggestions on how to implement the chevron hottrack color in a consistent manner across multiple skins (in other words, it is not straight-forward picking an arbitrary color because it won't work from one theme to the next). I've attached two screen grabs that show the TsCategoryPanelGroup themed manually using the code I've supplied previously; you'll notice with the Opus skin that the top chevron has changed color with the mouseover event but this doesn't work for the moonlight skin.
AND
2b. Suggestions on how to reduce the flicker using LockWindowsUpdate or some other mechanism.
Final word: other than the flicker and the hottracking on the chevron this control looks really nice with any of the skins I've tested it with and if I had to I'd live with that.
HamiltonParticipantScreenshot attached.
HamiltonParticipantThanks Serge changing the SkinSection to PANEL_LOW solved the problem 🙂
HamiltonParticipantHi Serge,
I'm sorry but I've given you some wrong information in my previous post, sorry I had some incorrect comments against the code for the grid and I had didn't realize it didn't worked as documented, and as a consequence your fix doesn't do what I want it to do.. Apologies, allow me to explain what I meant to say..
1) My #1 preference would be if the AC skinning of cxGrids from DevExpress included supplying the color for the banded rows. In the grid, this involves setting the DBGridListView.Styles.ContentOdd property. Currently the skinning of the grid does successfully skin the title bar and selected row (see below), and perhaps some other properties as well.
2) The AC skinning of cxGrids sets the color of the highlighted row but not the banded rows. I'm currently coding around this manually by including a cxStyleRepository in my project and setting the colors the selected row as follows:
cxStyle4 .Color := sSkinManager1.GetHighLightColor(False);
cxStyle4 .Font.Color := sSkinManager1.GetHighLightFontColor(False);
The other code I included that uses GetGlobalColor is *wrong*, I'm actually using the GlobalColor to show the selected row when the grid doesn't have focus, which isn't relevant to this post..
Anyway with all of the other themes I'm using in my project (including BlueGlass, Golden, iOS4, NextAlpha, Office2010 Blue, Opus and Web) the color of the selected row is different to the value returned by GetHighlightColor and thus I end up with a nicely banded grid with a distinct color for the selected row. With Moonlight, GetHighlightColor returns the same color as is used by the grid for the selected row, and you can't always see what row is selected.
TLDR: For the moonlight theme, GetHighLightColor returns the same color as the cxGrid uses for the selected row. All other themes that I've tested don't work like this. Any chance this could be changed? Or better yet, implement skinning of cxGrids at a lower level so I don't have to do it manually 😛
TIA and apologies once more for the incorrect info posted in the OP.
HamiltonParticipantI don't know if this will help but my current workaround uses something like the code below which I call in the form OnCreate event.
One limitation of my implementation is that themes like Moonlight and Office12Style use the same colour for the highlight font color and the edit font color so the chevron hot tracking is not visible. Other themes like Garnet and Web look pretty good.
A second limitation is that setting the colors causes the control to flicker. At startup its hard to see but if you change the theme at runtime it quite obvious. I tried wrapping the procedure LockWindowsUpdate but that didn't make any difference (which seems strange to me, I often use LockWindowsUpdate for loading docked forms etc with great results, not sure why this is different).
procedure TfdPOSDesigner.ResetColour;
begin
cpgProperties.Color := sSkinManager1.GetActiveEditColor;
cpgProperties.GradientBaseColor := sSkinManager1.GetActiveEditColor;
cpgProperties.GradientColor := sSkinManager1.GetHighLightColor;
cpgProperties.HeaderFont.Color := sSkinManager1.GetActiveEditFontColor;
cpgProperties.ChevronColor := sSkinManager1.GetActiveEditFontColor;
cpgProperties.ChevronHotColor := sSkinManager1.GetHighLightFontColor;
CategoryPanel1.Color := sSkinManager1.GetGlobalColor;
CategoryPanel1.Font.Color := sSkinManager1.GetGlobalFontColor;
CategoryPanel2.Color := sSkinManager1.GetGlobalColor;
CategoryPanel2.Font.Color := sSkinManager1.GetGlobalFontColor;
CategoryPanel3.Color := sSkinManager1.GetGlobalColor;
CategoryPanel3.Font.Color := sSkinManager1.GetGlobalFontColor;
end;
-
AuthorPosts