Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 85/613 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • Coding Practices which enable the compiler/optimizer to make a faster program.

    - by EvilTeach
    Many years ago, C compilers were not particularly smart. As a workaround K&R invented the register keyword, to hint to the compiler, that maybe it would be a good idea to keep this variable in an internal register. They also made the tertiary operator to help generate better code. As time passed, the compilers matured. They became very smart in that their flow analysis allowing them to make better decisions about what values to hold in registers than you could possibly do. The register keyword became unimportant. FORTRAN can be faster than C for some sorts of operations, due to alias issues. In theory with careful coding, one can get around this restriction to enable the optimizer to generate faster code. What coding practices are available that may enable the compiler/optimizer to generate faster code? Identifying the platform and compiler you use, would be appreciated. Why does the technique seem to work? Sample code is encouraged. Here is a related question [Edit] This question is not about the overall process to profile, and optimize. Assume that the program has been written correctly, compiled with full optimization, tested and put into production. There may be constructs in your code that prohibit the optimizer from doing the best job that it can. What can you do to refactor that will remove these prohibitions, and allow the optimizer to generate even faster code? [Edit] Offset related link

    Read the article

  • Chrome: Dynamically created <style> tag does not have content?

    - by Shizhidi
    Hello. I encountered a weird problem when trying to write a cross-browser script. Basically my header looks like this <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> </head> Then in the body tag: <p id="hey">Hey</p> <input type="button" value="attachStyle" name="attachStyle" onclick="attachStyle();"></input> <script> function attachStyle() { var strVar=""; strVar += "<style type='text\/css'>#hey {border:5px solid red;}<\/script>"; $("head").append(strVar); } </script> The button works in Firefox, but not in Chrome. When I looked at the html DOM elements in the developer tool, the style tag was inserted but without content, like this: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <style type='text/css'></script> </head> I'm curious as to what causes this? And how to create CSS style in a way that is cross-browser? Thanks!

    Read the article

  • How to change CSS style of nested list items?

    - by Yasir
    I have a style for styling <a> elements in list items in a #navigation container. This is working fine. #navigation li a { text-decoration:none; background:#bfe5ff; color:#045e9f; width:125px; height:35px; padding-top:11px; display:block; float:left; margin-left:2px; text-align:center; font-size:18px; font-weight:bold; } Now in some <li>s I am inserting <div>s. In these I am again using a list again, but it should be different in style or have no style. When I put in <li>s, their style matches the outer <li> elements, but it should not. I am trying to use this: #newnavigation li a { font-size:12px; margin-left:20px; } but it's not working - it applies the "outer" styles. This is my markup: <ul id="navigation"> <li><a href="index.html">Home</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> <li class="browse"> <a href="#">Browse</a> <div id="browsecontainer"> <h3>Browse By Category</h3> <li><a href="#"></a></li> </div> </li> </ul>

    Read the article

  • CSS gradient not rendering in Windows Phone 8 WebBrowser Control

    - by SRSHawk
    I am facing an issue where, the CSS3 background is not rendered in WebBrowser control in Windows Phone 8. But same HTML when opened in WebBrowser in Windows Phone 8, it renders the gradient The HTML I am using is: <html> <head> <meta name="viewport" content="width=320, user-scalable=no, minimum-scale=1, maximum-scale=1"/> </head> <body style="margin:0px;overflow:hidden;"> <div id="im_c" style="height:48px;width:100%25; background: -ms-linear-gradient( bottom, #432100 30%, #00AAAA 70%);"> <div style="margin:0 auto;width:320px;"> Test </div> </div> <style> body {margin:0px} </style> </body> In Windows Phone 8, I use the HTML as below: WebBroswer WebView = new WebBrowser(); WebView.Height = 100; WebView.Width = 400; WebView.NavigateToString(@"<html><head><meta name=""viewport"" content=""width=320, user-scalable=no, minimum-scale=1, maximum-scale=1""/></head><body style=""margin:0px;overflow:hidden;""> <div id=""im_c"" style=""height:48px;width:100%25; background: -ms-linear-gradient( bottom, #432100 30%, #00AAAA 70%);""> <div style=""margin:0 auto;width:320px;"">Test</div></div> <style> body {margin:0px} </style> </body></html>"); In this case, the CSS gradient is not visible. Am I missing something?

    Read the article

  • Modifying a gedit syntax highlighting file

    - by Oscar Saleta Reig
    I am trying to change a highlighting file from Gedit. I have modified the file /usr/share/gtksourceview-3.0/language-specs/fortran.lang because I want to change the cases in which the editor takes a statement as a comment. The problem I have is that when I choose the new highlighting scheme nothing highlights, it just remains as plain text. The file fortran.lang was opened with su permissions and I just copy-pasted everything into a new Gedit file and later saved it as fortran_enhanced.lang in the same folder. The changes I've done to the original file are these: Original fortran.lang file: <language id="fortran" _name="Fortran 95" version="2.0" _section="Sources"> <metadata> <property name="mimetypes">text/x-fortran</property> <property name="globs">*.f;*.f90;*.f95;*.for</property> <property name="line-comment-start">!</property> </metadata> <styles> <style id="comment" _name="Comment" map-to="def:comment"/> <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/> <style id="keyword" _name="Keyword" map-to="def:keyword"/> <style id="intrinsic" _name="Intrinsic function" map-to="def:builtin"/> <style id="boz-literal" _name="BOZ Literal" map-to="def:base-n-integer"/> <style id="decimal" _name="Decimal" map-to="def:decimal"/> <style id="type" _name="Data Type" map-to="def:type"/> </styles> <default-regex-options case-sensitive="false"/> <definitions> <!-- Note: contains an hack to avoid considering ^COMMON a comment --> <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check"> <start>!|(^[Cc](\b|[^OoAaYy]))</start> <include> <context ref="def:escape"/> <context ref="def:in-line-comment"/> </include> </context> (...) Modified fortran_enhanced.lang file: <!-- Note: changed language id and name --> <language id="fortran_enhanced" _name="Fortran 95 2.0" version="2.0" _section="Sources"> <metadata> <property name="mimetypes">text/x-fortran</property> <!-- Note: removed *.f and *.for from file extensions --> <property name="globs">*.f90;*.f95;</property> <property name="line-comment-start">!</property> </metadata> <styles> <style id="comment" _name="Comment" map-to="def:comment"/> <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/> <style id="keyword" _name="Keyword" map-to="def:keyword"/> <style id="intrinsic" _name="Intrinsic function" map-to="def:builtin"/> <style id="boz-literal" _name="BOZ Literal" map-to="def:base-n-integer"/> <style id="decimal" _name="Decimal" map-to="def:decimal"/> <style id="type" _name="Data Type" map-to="def:type"/> </styles> <default-regex-options case-sensitive="false"/> <definitions> <!-- Note: I want comments only beginning with !, not C --> <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check"> <start>!</start> <include> <context ref="def:escape"/> <context ref="def:in-line-comment"/> </include> </context> (...) I have read this question [ Custom gedit Syntax Highlighting for Dummies? ] and I tried to make the new fortran_enhanced.lang file readable with $ cd /usr/share/gtksourceview-3.0/language-specs $ sudo chmod 0644 fortran_enhanced.lang but it doesn't seem that made some difference. I have to say that I have never done a thing like this before and I don't even understand most of the language file, so I am open to every criticism, as I have been guided purely by intuition. Thank you in advanced!

    Read the article

  • In Linux, are there any plug-ins to let me do `<Win>`+`<Num>` style app switching (like Windows 7's superbar)?

    - by kizzx2
    Using Windows 7's superbar, I can select/launch the 2nd application group by <Win>+<2>. We have DockbarX in GNOME, which is nice (grouping the windows like Windows 7), but it doesn't enable the <Win>+<2> style keybaord shortcuts. Any suggestions? This is not restricted to making Linux like Windows. But I just find the <Win>+<2> style shortcut very useful. Are there similar ways in Linux to quickly switch between specific apps without pressing <Alt>+<Tab> many many times?

    Read the article

  • Can I cycle through instances of a style selected via the MS Word styles pane?

    - by Deditos
    Often when I have many co-authors on a MS Word document I find that some of them don't use the styles I've defined for the document, but have achieved similar formatting manually. This results in many styles listed as "in use", each with perhaps only a handful of instances. Word will highlight these instances for me, but then find myself browsing the entire document to check whether they need correcting or are special cases. This can be a particular pain for a long document and when these style fragments occur in the white space between words or paragraphs. Is there a way to cycle through the highlighted instances of a particular style rather than having to hunt for them visually?

    Read the article

  • How to properly use the .each() command in jQuery

    - by sadmicrowave
    I have a script that checks the class (integer) of a , runs a switch statement to change that integer value to text and appends the text to another in the same listitem tag. I use the .each() function because each listitem starts with class=_[user ID] -- each user can have up to 5 entries.. Enough explaining -- heres the code: <HTML> <li class='_44074'><div class='_12' style='width:380px;'><div style='width:60px; float:left;'>1st</div><div class='verify-type' style='float:left; width:160px;'></div><div style='float:left; width:120px;'>04/26/10 07:29 AM</div></div></li> <li class='_44074'><div class='_6' style='width:380px;'><div style='width:60px; float:left;'>2nd</div><div class='verify-type' style='float:left; width:160px;'></div><div style='float:left; width:120px;'>04/23/10 03:29 PM</div></div></li> <li class='_44074'><div class='_12' style='width:380px;'><div style='width:60px; float:left;'>3rd</div><div class='verify-type' style='float:left; width:160px;'></div><div style='float:left; width:120px;'>04/23/10 03:18 PM</div></div></li> <li class='_44074'><div class='_2' style='width:380px;'><div style='width:60px; float:left;'>4th</div><div class='verify-type' style='float:left; width:160px;'></div><div style='float:left; width:120px;'>04/23/10 02:28 PM</div></div></li> </HTML> when I use the .each() function to scan through each of the listitems begining with the entered user id it only finds the first value (in this case _12) and applies that to all the entries; instead of finding _12, _6, _12, _2 it finds _12, _12, _12, _12...here is the java: $("div#history-menu div#history-text li." + valueid).each(function(){ valueid = $("div#center-box input").val(); checkedvalue=""; checkedvalue = $("div#history-menu div#history-text li." + valueid + " div").attr('class'); switch(checkedvalue){ case '_2':lcCheckedMessage = "Shoes"; break; case '_4':lcCheckedMessage = "Shoe Straps"; break; case '_6':lcCheckedMessage = "Shoes & Shoe Straps"; break; case '_8':lcCheckedMessage = "Wrist Straps"; break; case '_10':lcCheckedMessage = "Shoes & Wrist Strap"; break; case '_12':lcCheckedMessage = "Shoe Straps & Wrist Strap"; break; }; $("div#history-menu div#history-text li." + valueid + " ." + checkedvalue + " .verify-type").text(lcCheckedMessage); });

    Read the article

  • A Look at the GridView's New Sorting Styles in ASP.NET 4.0

    Like every Web control in the ASP.NET toolbox, the GridView includes a variety of style-related properties, including CssClass, Font, ForeColor, BackColor, Width, Height, and so on. The GridView also includes style properties that apply to certain classes of rows in the grid, such as RowStyle, AlternatingRowStyle, HeaderStyle, and PagerStyle. Each of these meta-style properties offer the standard style properties (CssClass, Font, etc.) as subproperties. In ASP.NET 4.0, Microsoft added four new style properties to the GridView control: SortedAscendingHeaderStyle, SortedAscendingCellStyle, SortedDescendingHeaderStyle, and SortedDescendingCellStyle. These four properties are meta-style properties like RowStyle and HeaderStyle, but apply to column of cells rather than a row. These properties only apply when the GridView is sorted - if the grid's data is sorted in ascending order then the SortedAscendingHeaderStyle and SortedAscendingCellStyle properties define the styles for the column the data is sorted by. The SortedDescendingHeaderStyle and SortedDescendingCellStyle properties apply to the sorted column when the results are sorted in descending order. These four new properties make it easier to customize the appearance of the column by which the data is sorted. Using these properties along with a touch of Cascading Style Sheets (CSS) it is possible to add up and down arrows to the sorted column's header to indicate whether the data is sorted in ascending or descending order. Likewise, these properties can be used to shade the sorted column or make its text bold. This article shows how to use these four new properties to style the sorted column. Read on to learn more! Read More >

    Read the article

  • A Look at the GridView's New Sorting Styles in ASP.NET 4.0

    Like every Web control in the ASP.NET toolbox, the GridView includes a variety of style-related properties, including CssClass, Font, ForeColor, BackColor, Width, Height, and so on. The GridView also includes style properties that apply to certain classes of rows in the grid, such as RowStyle, AlternatingRowStyle, HeaderStyle, and PagerStyle. Each of these meta-style properties offer the standard style properties (CssClass, Font, etc.) as subproperties. In ASP.NET 4.0, Microsoft added four new style properties to the GridView control: SortedAscendingHeaderStyle, SortedAscendingCellStyle, SortedDescendingHeaderStyle, and SortedDescendingCellStyle. These four properties are meta-style properties like RowStyle and HeaderStyle, but apply to column of cells rather than a row. These properties only apply when the GridView is sorted - if the grid's data is sorted in ascending order then the SortedAscendingHeaderStyle and SortedAscendingCellStyle properties define the styles for the column the data is sorted by. The SortedDescendingHeaderStyle and SortedDescendingCellStyle properties apply to the sorted column when the results are sorted in descending order. These four new properties make it easier to customize the appearance of the column by which the data is sorted. Using these properties along with a touch of Cascading Style Sheets (CSS) it is possible to add up and down arrows to the sorted column's header to indicate whether the data is sorted in ascending or descending order. Likewise, these properties can be used to shade the sorted column or make its text bold. This article shows how to use these four new properties to style the sorted column. Read on to learn more! Read More >

    Read the article

  • This is something new

    - by shmoolca
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} I have created GUI with lots of my own controls. This control has style as a resource inside control resources. My performance profiler shows that InitializeComponent of this control is 7.5 times longer than control that has defined style in resources of application. It occurs because constructor is loading whole BAML each time constructor is called. Sounds logical for me :)

    Read the article

  • Integrating HTML into Silverlight Applications

    - by dwahlin
    Looking for a way to display HTML content within a Silverlight application? If you haven’t tried doing that before it can be challenging at first until you know a few tricks of the trade.  Being able to display HTML is especially handy when you’re required to display RSS feeds (with embedded HTML), SQL Server Reporting Services reports, PDF files (not actually HTML – but the techniques discussed will work), or other HTML content.  In this post I'll discuss three options for displaying HTML content in Silverlight applications and describe how my company is using these techniques in client applications. Displaying HTML Overlays If you need to display HTML over a Silverlight application (such as an RSS feed containing HTML data in it) you’ll need to set the Silverlight control’s windowless parameter to true. This can be done using the object tag as shown next: <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="ClientBin/HTMLAndSilverlight.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="4.0.50401.0" /> <param name="autoUpgrade" value="true" /> <param name="windowless" value="true" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration:none"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/> </a> </object> By setting the control to “windowless” you can overlay HTML objects by using absolute positioning and other CSS techniques. Keep in mind that on Windows machines the windowless setting can result in a performance hit when complex animations or HD video are running since the plug-in content is displayed directly by the browser window. It goes without saying that you should only set windowless to true when you really need the functionality it offers. For example, if I want to display my blog’s RSS content on top of a Silverlight application I could set windowless to true and create a user control that grabbed the content and output it using a DataList control: <style type="text/css"> a {text-decoration:none;font-weight:bold;font-size:14pt;} </style> <div style="margin-top:10px; margin-left:10px;margin-right:5px;"> <asp:DataList ID="RSSDataList" runat="server" DataSourceID="RSSDataSource"> <ItemTemplate> <a href='<%# XPath("link") %>'><%# XPath("title") %></a> <br /> <%# XPath("description") %> <br /> </ItemTemplate> </asp:DataList> <asp:XmlDataSource ID="RSSDataSource" DataFile="http://weblogs.asp.net/dwahlin/rss.aspx" XPath="rss/channel/item" CacheDuration="60" runat="server" /> </div> The user control can then be placed in the page hosting the Silverlight control as shown below. This example adds a Close button, additional content to display in the overlay window and the HTML generated from the user control. <div id="RSSDiv"> <div style="background-color:#484848;border:1px solid black;height:35px;width:100%;"> <img alt="Close Button" align="right" src="Images/Close.png" onclick="HideOverlay();" style="cursor:pointer;" /> </div> <div style="overflow:auto;width:800px;height:565px;"> <div style="float:left;width:100px;height:103px;margin-left:10px;margin-top:5px;"> <img src="http://weblogs.asp.net/blogs/dwahlin/dan2008.jpg" style="border:1px solid Gray" /> </div> <div style="float:left;width:300px;height:103px;margin-top:5px;"> <a href="http://weblogs.asp.net/dwahlin" style="margin-left:10px;font-size:20pt;">Dan Wahlin's Blog</a> </div> <br /><br /><br /> <div style="clear:both;margin-top:20px;"> <uc:BlogRoller ID="BlogRoller" runat="server" /> </div> </div> </div> Of course, we wouldn’t want the RSS HTML content to be shown until requested. Once it’s requested the absolute position of where it should show above the Silverlight control can be set using standard CSS styles. The following ID selector named #RSSDiv handles hiding the overlay div shown above and determines where it will be display on the screen. #RSSDiv { background-color:White; position:absolute; top:100px; left:300px; width:800px; height:600px; border:1px solid black; display:none; } Now that the HTML content to display above the Silverlight control is set, how can we show it as a user clicks a HyperlinkButton or other control in the application? Fortunately, Silverlight provides an excellent HTML bridge that allows direct access to content hosted within a page. The following code shows two JavaScript functions that can be called from Siverlight to handle showing or hiding HTML overlay content. The two functions rely on jQuery (http://www.jQuery.com) to make it easy to select HTML objects and manipulate their properties: function ShowOverlay() { rssDiv.css('display', 'block'); } function HideOverlay() { rssDiv.css('display', 'none'); } Calling the ShowOverlay function is as simple as adding the following code into the Silverlight application within a button’s Click event handler: private void OverlayHyperlinkButton_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Invoke("ShowOverlay"); } The result of setting the Silverlight control’s windowless parameter to true and showing the HTML overlay content is shown in the following screenshot:   Thinking Outside the Box to Show HTML Content Setting the windowless parameter to true may not be a viable option for some Silverlight applications or you may simply want to go about showing HTML content a different way. The next technique I’ll show takes advantage of simple HTML, CSS and JavaScript code to handle showing HTML content while a Silverlight application is running in the browser. Keep in mind that with Silverlight’s HTML bridge feature you can always pop-up HTML content in a new browser window using code similar to the following: System.Windows.Browser.HtmlPage.Window.Navigate( new Uri("http://silverlight.net"), "_blank"); For this example I’ll demonstrate how to hide the Silverlight application while maximizing a container div containing the HTML content to show. This allows HTML content to take up the full screen area of the browser without having to set windowless to true and when done right can make the user feel like they never left the Silverlight application. The following HTML shows several div elements that are used to display HTML within the same browser window as the Silverlight application: <div id="JobPlanDiv"> <div style="vertical-align:middle"> <img alt="Close Button" align="right" src="Images/Close.png" onclick="HideJobPlanIFrame();" style="cursor:pointer;" /> </div> <div id="JobPlan_IFrame_Container" style="height:95%;width:100%;margin-top:37px;"></div> </div> The JobPlanDiv element acts as a container for two other divs that handle showing a close button and hosting an iframe that will be added dynamically at runtime. JobPlanDiv isn’t visible when the Silverlight application loads due to the following ID selector added into the page: #JobPlanDiv { position:absolute; background-color:#484848; overflow:hidden; left:0; top:0; height:100%; width:100%; display:none; } When the HTML content needs to be shown or hidden the JavaScript functions shown next can be used: var jobPlanIFrameID = 'JobPlan_IFrame'; var slHost = null; var jobPlanContainer = null; var jobPlanIFrameContainer = null; var rssDiv = null; $(document).ready(function () { slHost = $('#silverlightControlHost'); jobPlanContainer = $('#JobPlanDiv'); jobPlanIFrameContainer = $('#JobPlan_IFrame_Container'); rssDiv = $('#RSSDiv'); }); function ShowJobPlanIFrame(url) { jobPlanContainer.css('display', 'block'); $('<iframe id="' + jobPlanIFrameID + '" src="' + url + '" style="height:100%;width:100%;" />') .appendTo(jobPlanIFrameContainer); slHost.css('width', '0%'); } function HideJobPlanIFrame() { jobPlanContainer.css('display', 'none'); $('#' + jobPlanIFrameID).remove(); slHost.css('width', '100%'); } ShowJobPlanIFrame() handles showing the JobPlanDiv div and adding an iframe into it dynamically. Once JobPlanDiv is shown, the Silverlight control host has its width set to a value of 0% to allow the control to stay alive while making it invisible to the user. I found that this technique works better across multiple browsers as opposed to manipulating the Silverlight control host div’s display or visibility properties. Now that you’ve seen the code to handle showing and hiding the HTML content area, let’s switch focus to the Silverlight application. As a user clicks on a link such as “View Report” the ShowJobPlanIFrame() JavaScript function needs to be called. The following code handles that task: private void ReportHyperlinkButton_Click(object sender, RoutedEventArgs e) { ShowBrowser(_BaseUrl + "/Report.aspx"); } public void ShowBrowser(string url) { HtmlPage.Window.Invoke("ShowJobPlanIFrame", url); } Any URL can be passed into the ShowBrowser() method which handles invoking the JavaScript function. This includes standard web pages or even PDF files. We’ve used this technique frequently with our SmartPrint control (http://www.smartwebcontrols.com) which converts Silverlight screens into PDF documents and displays them. Here’s an example of the content generated:   Silverlight 4’s WebBrowser Control Both techniques shown to this point work well when Silverlight is running in-browser but not so well when it’s running out-of-browser since there’s no host page that you can access using the HTML bridge. Fortunately, Silverlight 4 provides a WebBrowser control that can be used to perform the same functionality quite easily. We’re currently using it in client applications to display PDF documents, SSRS reports and standard HTML content. Using the WebBrowser control simplifies the application quite a bit since no JavaScript is required if the application only runs out-of-browser. Here’s a simple example of defining the WebBrowser control in XAML. I typically define it in MainPage.xaml when a Silverlight Navigation template is used to create the project so that I can re-use the functionality across multiple screens. <Grid x:Name="WebBrowserGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Collapsed"> <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Border Background="#484848" HorizontalAlignment="Stretch" Height="40"> <Image x:Name="WebBrowserImage" Width="100" Height="33" Cursor="Hand" HorizontalAlignment="Right" Source="/HTMLAndSilverlight;component/Assets/Images/Close.png" MouseLeftButtonDown="WebBrowserImage_MouseLeftButtonDown" /> </Border> <WebBrowser x:Name="JobPlanReportWebBrowser" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> </StackPanel> </Grid> Looking through the XAML you can see that a close image is defined along with the WebBrowser control. Because the URL that the WebBrowser should navigate to isn’t known at design time no value is assigned to the control’s Source property. If the XAML shown above is left “as is” you’ll find that any HTML content assigned to the WebBrowser doesn’t display properly. This is due to no height or width being set on the control. To handle this issue the following code is added into the XAML’s code-behind file to dynamically determine the height and width of the page and assign it to the WebBrowser. This is done by handling the SizeChanged event. void MainPage_SizeChanged(object sender, SizeChangedEventArgs e) { WebBrowserGrid.Height = JobPlanReportWebBrowser.Height = ActualHeight; WebBrowserGrid.Width = JobPlanReportWebBrowser.Width = ActualWidth; } When the user wants to view HTML content they click a button which executes the code shown in next: public void ShowBrowser(string url) { if (Application.Current.IsRunningOutOfBrowser) { JobPlanReportWebBrowser.NavigateToString("<html><body><iframe src='" + url + "' style='width:100%;height:97%;' /></body></html>"); WebBrowserGrid.Visibility = Visibility.Visible; } else { HtmlPage.Window.Invoke("ShowJobPlanIFrame", url); } } private void WebBrowserImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { WebBrowserGrid.Visibility = Visibility.Collapsed; }   Looking through the code you’ll see that it checks to see if the Silverlight application is running out-of-browser and then either displays the WebBrowser control or runs the JavaScript function discussed earlier. Although the WebBrowser control’s Source property could be assigned the URI of the page to navigate to, by assigning HTML content using the NavigateToString() method and adding an iframe, content can be shown from any site including cross-domain sites. This is especially handy when you need to grab a page from a reporting site that’s in a different domain than the Silverlight application. Here’s an example of viewing  PDF file inside of an out-of-browser application. The first image shows the application running out-of-browser before the user clicks a PDF HyperlinkButton.  The second image shows the PDF being displayed.   While there are certainly other techniques that can be used, the ones shown here have worked well for us in different applications and provide the ability to display HTML content in-browser or out-of-browser. Feel free to add a comment if you have another tip or trick you like to use when working with HTML content in Silverlight applications.   Download Code Sample   For more information about onsite, online and video training, mentoring and consulting solutions for .NET, SharePoint or Silverlight please visit http://www.thewahlingroup.com.

    Read the article

  • Is there any way to style optgroup using CSS on the iPad?

    - by AzzyDude
    Is there any way to style the HTML element 'optgroup' using CSS? It's specifically important the style appears on the mobile iOS browser for iPad. The HTML is: <optgroup label="Great Britain"> <option value="EUROPE_ENGLAND">England</option> <option value="EUROPE_SCOTLAND">Scotland</option> <option value="EUROPE_WALES">Wales</option> </optgroup> And the CSS is: optgroup { color: red; } I'm not even sure it's possible to style the iPad's optgroup by the way.

    Read the article

  • need to align part of list item to right of li - using CSS3 Jquery column-layout

    - by Brad
    Using this jquery script to acheive CSS3 3-columns, to display a list of members alphabetically. I need it to display this way, which is does: A D B E C F Here is what I am using http://www.csscripting.com/css-multi-column/example6.php? (using this js file http://www.csscripting.com/js/v1.0beta/css3-multi-column.js) To the right of each member, it has their phone extension, which I want to float to the right, so it easy to read. I tried putting the phone extension within a div and span and when I do that, it tends to screw up at the last item in each column, by placing the person's name correctly, but their extension is the very first item in the next column. Screenshot: http://cl.ly/fq4 of what it is doing HTML Code: <div class="Article3Col"> <ul> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> <li>Doe, John <div style="float:right;"> 8317 </div> </li> <li>Doe, Sally <div style="float:right;"> 8729 </div> </li> </ul> </div> CSS: .Article3Col { column-count:3; } Any help is appreciated.

    Read the article

  • Jquery Accordion and Fading

    - by Slick Willis
    I am trying to create a jquery accordion that fades the header of the accordion out when the page is loaded then fades it in when the mouse hovers. The accordion also opens when the mouse hovers. I am able to get all of this working, the problem I am having is when the accordion opens the header moves away and the mouse is no longer on it to keep it lit. I would like the links to keep the header lit as well as if the mouse is on the header itself. Below is the code that I wrote for it. <html> <head <script type='text/javascript' src='http://accidentalwords.squarespace.com/storage/jquery/jquery-1.4.2.min.js'></script> <script type='text/javascript' src='http://accidentalwords.squarespace.com/storage/jquery/jquery-custom-181/jquery-ui-1.8.1.custom.min.js'></script> </head> <body bgcolor="black"> <style = "css/text"> .links { font-family: "Georgia", "Verdana", serif; line-height: 30px; margin-left: 20px; margin-top: 5px; } .Title { font-family: "Geneva", "Verdana", serif; font-weight: bold; font-size: 2em; text-align: left; font-variant: small-caps; border-bottom: solid 2px #25FF00; padding-bottom:5px; margin-bottom: 10px; } </style> <script type="text/javascript"> $(document).ready(function(){ $(".Title").fadeTo(1,0.25); $(".Title").hover(function () { $(this).stop().fadeTo(250,1) .closest(".Title").find(".links").fadeTo(250,0.75); }, function() { $(this).stop().fadeTo(250,0.25); }); }); $(function() { $("#accordion").accordion({ event: "mouseover" }); }); </script> <p>&nbsp</p> <div id="accordion"> <div class="Title"><a href="#"STYLE="TEXT-DECORATION: NONE; color: #25FF00;">Reference</a></div> <div class="links"> <a href="http://docs.jquery.com/Main_Page" STYLE="TEXT-DECORATION: NONE; color: #25FF00;">Jquery Documentation/Help</a><br> <a href="http://stackoverflow.com/" STYLE="TEXT-DECORATION: NONE; color: #25FF00;">Stack Overflow</a><br> <a href="http://www.w3schools.com/" STYLE="TEXT-DECORATION: NONE; color: #25FF00;">w3schools.com</a><br> </div> <div class="Title"><a href="#"STYLE="TEXT-DECORATION: NONE; color: #FF7200;">Gaming</a></div> <div class="links"> <a href="http://docs.jquery.com/Main_Page" STYLE="TEXT-DECORATION: NONE; color: #FF7200;">Jquery Documentation/Help</a><br> <a href="http://stackoverflow.com/" STYLE="TEXT-DECORATION: NONE; color: #FF7200;">Stack Overflow</a><br> <a href="http://www.w3schools.com/" STYLE="TEXT-DECORATION: NONE; color: #FF7200;">w3schools.com</a><br></div> <div class="Title"><a href="#"STYLE="TEXT-DECORATION: NONE; color: #00DEFF;">Grub</a></div> <div class="links"> <a href="http://docs.jquery.com/Main_Page" STYLE="TEXT-DECORATION: NONE; color: #00DEFF;">Jquery Documentation/Help</a><br> <a href="http://stackoverflow.com/" STYLE="TEXT-DECORATION: NONE; color: #00DEFF;">Stack Overflow</a><br> <a href="http://www.w3schools.com/" STYLE="TEXT-DECORATION: NONE; color: #00DEFF;">w3schools.com</a><br> </div> <div class="Title"><a href="#"STYLE="TEXT-DECORATION: NONE; color: #F8FF00;">Drinks</a></div> <div class="links"> <a href="http://docs.jquery.com/Main_Page" STYLE="TEXT-DECORATION: NONE; color: #F9FF00;">Jquery Documentation/Help</a><br> <a href="http://stackoverflow.com/" STYLE="TEXT-DECORATION: NONE; color: #F8FF00;">Stack Overflow</a><br> <a href="http://www.w3schools.com/" STYLE="TEXT-DECORATION: NONE; color: #F8FF00;">w3schools.com</a><br> </div> </div> </body> </html>

    Read the article

  • How to select font with its style attribute value.

    - by Wazdesign
    I have the following html mark up. <p> lorem ipsum lorem ipsum <font style="background-color:yellow"> ipsum </font> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id enim in tellus sollicitudin viverra. Morbi nec ipsum ligula, non volutpat enim. In quis metus <font style="color:red"> Tincidunt lorem </font>blandit faucibus. Nam condimentum facilisis vestibulum. Nunc tristique est vel erat sagittis ac placerat orci varius.</p> I want to select only the font which has the "background-color:yellow" not any other <font> tag with any style

    Read the article

  • JQuery Cycle plugin - pageAnchorBuilder using radio buttons

    - by Josh
    Hi all, JQuery noobie here - i'm trying to make a pager using radio buttons with the JQuery Cycle pageAnchorBuilder. The transitions all seem to work ok, except but it is not possible to select a radio button. Any help much appreciated! Cheers Here is my JavaScript code: $('.products').cycle({ fx: 'scrollHorz', speed: 300, timeout: 0, pager: '#nav', pagerAnchorBuilder: function(idx, slide) { return '#nav input:eq(' +idx +')'; } }); HTML is here: <ul id="nav"> <li><input type="radio" name="style" id="style1" value="Style 1" /><label for="style1">Style 1</label></li> <li><input type="radio" name="style" id="style2" value="Style 2" /><label for="style2">Style 2</label></li> <li><input type="radio" name="style" id="style3" value="Style 3" /><label for="style3">Style 3</label></li> </ul>

    Read the article

  • Why can't I overwrite style specified in one gtkrc file?

    - by PP
    In my Gtk+ application i am having two gtkrc files. Which i have added using: gchar *rcfile; rcfile = g_build_filename( "user", "themes", "xyz", "gtk-2.0", "gtkrc", NULL); gtk_rc_parse( rcfile ); g_free( rcfile ); rcfile = g_build_filename( "my_rc_foler", "gtkrc", NULL); gtk_rc_add_default_file( rcfile ); g_free( rcfile ); I tried to overwrite some of the styles provided by default rc file. but i fails to do so. like i have over written GtkLable style as follows In My rc file: style "my-theme-label" { xthickness = 1 ythickness = 1 bg[NORMAL] = "#FFFFFF" bg[ACTIVE] = "#FFFFFF" bg[PRELIGHT] = "#FFFFFF" bg[SELECTED] = "#FFFFFF" bg[INSENSITIVE] = "#FFFFFF" fg[NORMAL] = "#FFFFFF" fg[INSENSITIVE] = "#FFFFFF" fg[PRELIGHT] = "#FFFFFF" fg[SELECTED] = "#FFFFFF" fg[ACTIVE] = "#FFFFFF" text[NORMAL] = "#FFFFFF" text[INSENSITIVE] = "#434346" text[PRELIGHT] = "#FFFFFF" text[SELECTED] = "#FFFFFF" text[ACTIVE] = "#FFFFFF" base[NORMAL] = "#000000" base[INSENSITIVE] = "#00FF00" base[PRELIGHT] = "#0000ff" base[SELECTED] = "#FF00FF" base[ACTIVE] = "#F39638" } class "GtkLabel" style "tc-theme-label" but still it does not show any effect on GtkLables that i am using in my app.

    Read the article

  • How to distinguish a NY "queens-style" street address from a ranged address, and an address with a u

    - by feroze
    I need to distinguish between a Queens style address, from a valid ranged address, and an address with a unit#. For eg: Queens style: 123-125 Some Street, NY Ranged Address: 6414-6418 37th Ln SE, Olympia, WA 98503 Address with unit#: 1990-A Gildersleeve Ave, Bronx, NY. In the case of #3, A is a unit# at street address 1990. THe unit# might be a number as well, for eg: 1990-12. A ranged address identifies a range of addresses on a street, and not a unique deliverable address. So, the question is, is there an easy way to identify the Queens style address from the other cases?

    Read the article

  • How do you change the style of cell in a JQuery.DataTable?

    - by Sephrial
    Hello fellow coders, I have a question about setting the style attributes for a data cell in the jQuery.DataTable. I was able to set the width for each column when initializing the dataTable using the following: oTable = $('#example').dataTable( { "aoColumns" : [ { sWidth: '40%' }, { sWidth: '60%' } ] } ); However, now I want to change the alignment for the second column like so: style="text-align: right;". I am adding rows dynamically: /* Global var for counter */ var giCount = 2; function fnClickAddRow() { oTable.fnAddData( [ 'col_1', 'col_2' ] ); giCount++; } Can you tell me how I can select the second cell of the added row after it's inserted? OR can you tell me how to set the style of the row before/during insertion? Any help would be greatly appreciated!

    Read the article

  • How to achieve the recessed text style as in Apple's Messages for Mac?

    - by Thruth
    I'd like to replicate the recessed text style of Messages/iMessage, or, the text "white-shadow" style on a light gray background. Please refer to an image here for the style I desire. As you can see, the texts are with "white-shadow" even on the light gray background. The bold texts do have subpixel rendering while the gray texts don't (by design?). I've tried setBackgroundStyle:NSBackgroundStyleRaised . However it was generating shadows darker than the background. setBackgroundStyle:NSBackgroundStyleLowered was worse that it even overrode my font colour setting. So, what is the right way to do this? Any tricks or just have to subclass NSTextFields ? Thanks.

    Read the article

  • Programming style: should you return early if a guard condition is not satisfied?

    - by John Topley
    One thing I've sometimes wondered is which is the better style out of the two shown below (if any)? Is it better to return immediately if a guard condition hasn't been satisfied, or should you only do the other stuff if the guard condition is satisfied? For the sake of argument, please assume that the guard condition is a simple test that returns a boolean, such as checking to see if an element is in a collection, rather than something that might affect the control flow by throwing an exception. // Style 1 public SomeType aMethod() { SomeType result = null; if (!guardCondition()) { return result; } doStuffToResult(result); doMoreStuffToResult(result); return result; } // Style 2 public SomeType aMethod() { SomeType result = null; if (guardCondition()) { doStuffToResult(result); doMoreStuffToResult(result); } return result; }

    Read the article

  • Does style="color: #FFF;" render as #F0F0F0 or #FFFFFF?

    - by Dolph Mathews
    When defining colors using "shorthand hexidecimal" (style="color: #FFF;"), is there a defined method for expanding the shorthand? (style="color: #F0F0F0;" or style="color: #FFFFFF;") Do all browsers use the same expansion method? Is this behavior by specification (if so, where is it defined)? Does the expansion method perhaps vary between CSS 1/2/3? I've observed that "most browsers" expand to #FFFFFF. Are there any other places where this shorthand notation is allowed, but the expansion method is different? I've always avoided using shorthand hex, because I've never known the answers to these questions...

    Read the article

  • How to style a standard GWT component (TabBar) differently?

    - by Mike Petterson
    I am using a TabBar and I want to style the component in different ways. So one time this style, another time that style. I thought this will work but it didn't: TabBar t = new TabBar(); t.addTab( "1" ); t.addTab( "2" ); t.addStyleName( MyResources.INSTANCE.css().slickTab() ); And: public interface MyCssResource extends CssResource { String slickTab(); } In the CSS .slickTab .gwt-TabBar .gwt-TabBarItem { background-color: #ff0000; font-weight: normal; } But the appearance don't change. What I am doing wrong?

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >