- This topic has 6 replies, 2 voices, and was last updated 12 years, 3 months ago by Hamilton.
-
AuthorPosts
-
August 18, 2012 at 7:59 am #35316guyinwonderParticipant
Does Anyone knows how to skin TWebBrowser ? Could some one share?
August 21, 2012 at 9:17 am #48798HamiltonParticipantI don't have a good reply for ya but no one else has jumped in so I thought I'd offer something! Anyway I wouldn't do component development for a one-off use myself, and would recommend doing something manual like the code below which does a similar thing for a TsCategoryPanel.
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;Basically what I'm suggesting is to use the skin color that you can get a handle to conveniently and using those to manually skin the component. You could implement the call to ResetColor in an inherited Create event or similar, or call it manually in your code in FormCreate or similar. Something like:
TMyWebBrowser = class(TWebBrowser)
private
procedure ResetColor;
public
constructor Create(Sender: TObject); override;
end;
TMyWebBrowser.Create(Sender: TObject);
begin
inherited;
ResetColor;
end;
end;
August 21, 2012 at 9:19 am #48799HamiltonParticipantThe code for ResetColor lost it's formatting when I copied it into this thread; please refer to the formatted code for the same function at http://www.alphaskin…?showtopic=6544 instead.
August 21, 2012 at 10:36 am #48800guyinwonderParticipant'Hamilton' wrote:The code for ResetColor lost it's formatting when I copied it into this thread; please refer to the formatted code for the same function at http://www.alphaskin…?showtopic=6544 instead.
ok will try that.. and get back to you when i got the result 😀
August 23, 2012 at 1:11 am #48810guyinwonderParticipant'Hamilton' wrote:The code for ResetColor lost it's formatting when I copied it into this thread; please refer to the formatted code for the same function at http://www.alphaskin…?showtopic=6544 instead.
I play around with it and still dont get it on how to implement your script by making the twebbrowser descendant.
by using the component it self the twebbrowser didnt exposed any color properties or font properties as this is an olecontrol .
all i need is the frame got skinned and the scroll bar too i have try by adding it to the thirdparty and stated it as scrollcontrol but no luck .
August 23, 2012 at 3:23 am #48811HamiltonParticipantI found this code that may help you. Didn't have time to test it sorry and it doesn't address the frame color; I'm hoping that if this works you'll be able to use it to decipher the rest of the puzzle. GL!
Code:with WebBrowser1 do
begin
OleObject.document.body.Style.scrollbarFaceColor := '#FF6699';
OleObject.Document.body.Style.scrollbarTrackColor := '#CCCC99';
OleObject.document.body.Style.scrollbarHighlightColor := '#99FF99';
OleObject.document.body.Style.scrollbar3DLightColor := '#6699CC';
OleObject.Document.body.Style.scrollbarShadowColor := '#6600FF';
OleObject.document.body.Style.scrollbarDarkShadowColor := '#00CC66';
OleObject.document.body.Style.scrollbarArrowColor := '#336699';
end;Another snippet, though it is probably bad practice to do this unless you have control over the pages being viewed:
Code:WebBrowser1.OleObject.Document.bgColor := '#000000';August 23, 2012 at 3:33 am #48812HamiltonParticipantThis link shows how to set the border. Again, I haven't tested it so GL!
-
AuthorPosts
- You must be logged in to reply to this topic.