Search Results

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

Page 58/613 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • Asp controls Id generation inside repeater

    - by toraan
    I define some controls inside repeater itemtemplate, the problem is with the Id that are generated automatically. This is my page: <asp:Repeater ID="rptThreads" runat="server" onitemcreated="rptThreads_ItemCreated"> <HeaderTemplate> <table cellpadding="0px" cellspacing="0"> </HeaderTemplate> <ItemTemplate> <tr style="height:50px"> <td> <asp:PlaceHolder ID="plcItemTitle" runat="server"> <asp:Panel id="titleContainer" runat="server" style="position:absolute;"> <asp:HyperLink ID="lnkTitle" runat="server" style="float:left;padding-right:10px;" Text='<%# Container.DataItem%>'/> <asp:Panel id="pnlEditButtons" runat="server" Visible="false" style="vertical-align:middle;z-index:100;display:none;float:left;" > <asp:ImageButton ID="imgbtn1" runat="server" ImageUrl="~/Images/misc/edit.png" /> <asp:ImageButton ID="imgbtn2" runat="server" ImageUrl="~/Images/misc/Rename.png" /> </asp:Panel> </asp:Panel> </asp:PlaceHolder> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> Now I will try to describe the problem: code-behind: protected void Page_Load(object sender, EventArgs e) { int [] array = {1,2,3,4,5}; rptThreads.DataSource = array; rptThreads.DataBind(); } protected void rptThreads_ItemCreated(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Panel editButtonsPanel = e.Item.FindControl("pnlEditButtons") as Panel; editButtonsPanel.Visible = true; Panel containerPanel = e.Item.FindControl("titleContainer") as Panel; //Point of Interest!!!! containerPanel.Attributes.Add("onmouseover", "ShowEditButtons('" + editButtonsPanel.ClientID + "');"); } } If I run the page as is, the generated html will be the following (I show only the first 2 items): <table cellpadding="0px" cellspacing="0"> <tr style="height:50px"> <td> <div id="titleContainer" onmouseover="ShowEditButtons('pnlEditButtons');" style="position:absolute;"> <a id="lnkTitle" style="float:left;padding-right:10px;">1</a> <div id="pnlEditButtons" style="vertical-align:middle;z-index:100;display:none;float:left;"> <input type="image" name="imgbtn1" id="imgbtn1" src="Images/misc/edit.png" style="border-width:0px;" /> <input type="image" name="imgbtn2" id="imgbtn2" src="Images/misc/Rename.png" style="border-width:0px;" /> </div> </div> </td> </tr> <tr style="height:50px"> <td> <div id="titleContainer" onmouseover="ShowEditButtons('pnlEditButtons');" style="position:absolute;"> <a id="lnkTitle" style="float:left;padding-right:10px;">2</a> <div id="pnlEditButtons" style="vertical-align:middle;z-index:100;display:none;float:left;"> <input type="image" name="imgbtn1" id="imgbtn1" src="Images/misc/edit.png" style="border-width:0px;" /> <input type="image" name="imgbtn2" id="imgbtn2" src="Images/misc/Rename.png" style="border-width:0px;" /> </div> </div> </td> </tr> As you can see all divs get the SAME ID, THIS I DONT WANT!!! But If I omit this line form the ItemCreated event: containerPanel.Attributes.Add("onmouseover", "ShowEditButtons('" + editButtonsPanel.ClientID + "');"); The generated HTML will be the following: <table cellpadding="0px" cellspacing="0"> <tr style="height:50px"> <td> <div id="rptThreads_ctl01_titleContainer" style="position:absolute;"> <a id="rptThreads_ctl01_lnkTitle" style="float:left;padding-right:10px;">1</a> <div id="rptThreads_ctl01_pnlEditButtons" style="vertical-align:middle;z-index:100;display:none;float:left;"> <input type="image" name="rptThreads$ctl01$imgbtn1" id="rptThreads_ctl01_imgbtn1" src="Images/misc/edit.png" style="border-width:0px;" /> <input type="image" name="rptThreads$ctl01$imgbtn2" id="rptThreads_ctl01_imgbtn2" src="Images/misc/Rename.png" style="border-width:0px;" /> </div> </div> </td> </tr> <tr style="height:50px"> <td> <div id="rptThreads_ctl02_titleContainer" style="position:absolute;"> <a id="rptThreads_ctl02_lnkTitle" style="float:left;padding-right:10px;">2</a> <div id="rptThreads_ctl02_pnlEditButtons" style="vertical-align:middle;z-index:100;display:none;float:left;"> <input type="image" name="rptThreads$ctl02$imgbtn1" id="rptThreads_ctl02_imgbtn1" src="Images/misc/edit.png" style="border-width:0px;" /> <input type="image" name="rptThreads$ctl02$imgbtn2" id="rptThreads_ctl02_imgbtn2" src="Images/misc/Rename.png" style="border-width:0px;" /> </div> </div> </td> </tr> All divs get unique IDs, and this I do want My questions are: 1)why it happens? why this line of code messup the ids? 2)how can have the unique ID's and assign javascript in codebehind? I can add this on aspx (it will wotk and I will get unique ids): onmouseover='<%# "javascript:ShowEditButtons(\""+ Container.FindControl("pnlEditButtons").ClientID+ "\");" %>' But I must do it in codebehind because I need to set the javascript only if server validate some things.

    Read the article

  • Google+ Platform Office Hours: A Movember of Metro-style Apps!

    Google+ Platform Office Hours: A Movember of Metro-style Apps! This week join Google+ Developer Relations team members Joanna Smith, Jonathan Beri, Silvano Luciani, and Gus Class for a special Movember GDL. We'll share updates for Google+, demonstrate Google+ Metro style apps integration in C#, and answer any questions you ask in the event and live YouTube comments. From: GoogleDevelopers Views: 0 0 ratings Time: 30:00 More in Science & Technology

    Read the article

  • What is this style of navigation sidebar called and is there an open source Javascript library for it? [migrated]

    - by Lucas Meijer
    I'd like to build a sidebar navigation for an online book much like apple did here: http://developer.apple.com/library/ios/navigation/ (note it has collapsable entries) and to my surprise I'm having a hard time finding a good off the shelve javascript startingpoint to build from. What is this style of navigation sidebar called? Are there any open source Javascript libraries that provide this style of navigation?

    Read the article

  • WPF problem modify style of images in multiple Button Templates

    - by user556415
    I'm trying to create a control panel for a video camera, the panel has buttons for up, down, left and right etc. Each camera function up, down, left and right is represented by three images (see code below) for the left side, middle and right side. The control panel is circular so the corner images kind of overlap (its complicated to explain this without a visual). When I click on up for example I have to hide the initial three images (leftside, middle and right side) and display another three images for left , middle and right that indicate that the button is pressed. I am achieving this by having a grid inside a button template. The problem I have is that for the corner images for the control there are really four images that represent this. For example for the top left corner the four images would be represent 1. Top not clicked. 2. Top Clicked and 3. Left Not clicked and 4. Left Clicked. My problem is if I need to make the images contained within the Top button have precedence when the top control is clicked or the images in the left button have precedence when the left button is clicked. So it's like I want to modify the left button's image visible property when the top button is clicked and vise versa. This is really difficult to explain so I apologize if it makes little sense but I can email the source code on request if anyone is interested in my predicament. <Grid> <Canvas> <!--<StackPanel>--> <Button Name="TopSide" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Height="34" Width="102" Canvas.Left="97" Canvas.Top="60" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid Width="100"> <Canvas> <Image Name="TopRightNormal" Source="Resources/topright_off.jpg" Height="34" Width="34" Canvas.Left="66"></Image> <Image Name="TopRightDown" Source="Resources/topright_down.jpg" Height="34" Width="34" Canvas.Left="66" Visibility="Hidden" ></Image> <Image Name="TopNormal" Source="Resources/topcenter_off.jpg" Height="34" Width="34" Canvas.Left="34" /> <Image Name="TopPressed" Source="Resources/topcenter_down.jpg" Height="34" Width="34" Canvas.Left="34" Visibility="Hidden" /> <Image Name="TopDisabled" Source="Resources/topcenter_off.jpg" Height="34" Width="34" Canvas.Left="34" Visibility="Hidden" /> <Image Name="TopLeftNormal" Source="Resources/topleft_off.jpg" Height="34" Width="34" Canvas.Left="2" ></Image> <Image Name="TopLeftDown" Opacity="0" Source="Resources/topleft_down.jpg" Height="34" Width="34" Canvas.Left="2" Visibility="Hidden" ></Image> </Canvas> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="TopNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopPressed" Property="Visibility" Value="Visible" /> <Setter TargetName="TopRightNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopRightDown" Property="Visibility" Value="Visible" /> <Setter TargetName="TopLeftNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopLeftDown" Property="Visibility" Value="Visible" /> <Setter TargetName="TopLeftDown" Property="Opacity" Value="100" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="TopNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopDisabled" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!--</StackPanel>--> <!--<StackPanel>--> <Button Name="LeftSide" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Canvas.Left="100" Canvas.Top="60" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MouseDown="Button_MouseDown_1"> <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid Width="34" Height="100"> <Canvas> <Image Name="TopLeftNormal" Source="Resources/topleft_off.jpg" Height="34" Width="34" Canvas.Left="0"></Image> <Image Name="TopLeftDown" Opacity="0" Source="Resources/topleft_leftdown.jpg" Height="34" Width="34" Canvas.Left="0" Visibility="Hidden" ></Image> <Image Name="Normal" Source="Resources/leftcenter_off.jpg" Height="34" Width="34" Canvas.Top="32" Canvas.Left="0"/> <Image Name="Pressed" Source="Resources/leftcenter_down.jpg" Visibility="Hidden" Canvas.Top="32" Height="34" Width="34" /> <Image Name="Disabled" Source="Resources/leftcenter_off.jpg" Visibility="Hidden" Height="34" Width="34" Canvas.Top="32" /> </Canvas> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="Normal" Property="Visibility" Value="Hidden" /> <Setter TargetName="Pressed" Property="Visibility" Value="Visible" /> <Setter TargetName="TopLeftNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopLeftNormal" Property="Opacity" Value="0" /> <Setter TargetName="TopLeftDown" Property="Visibility" Value="Visible" /> <Setter TargetName="TopLeftDown" Property="Opacity" Value="100" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Normal" Property="Visibility" Value="Hidden" /> <Setter TargetName="Disabled" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!--</StackPanel>--> <!--<StackPanel>--> <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Height="34" Width="34" Canvas.Left="165" Canvas.Top="92" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MouseDown="Button_MouseDown_2" > <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Image Name="Normal" Source="Resources/rightcenter_off.jpg" /> <Image Name="Pressed" Source="Resources/rightcenter_down.jpg" Visibility="Hidden" /> <Image Name="Disabled" Source="Resources/rightcenter_off.jpg" Visibility="Hidden" /> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="Normal" Property="Visibility" Value="Hidden" /> <Setter TargetName="Pressed" Property="Visibility" Value="Visible" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Normal" Property="Visibility" Value="Hidden" /> <Setter TargetName="Disabled" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!--</StackPanel>--> <!--<StackPanel>--> <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Height="34" Width="34" Canvas.Left="133" Canvas.Top="124" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Image Name="BottomNormal" Source="Resources/bottomcenter_off.jpg" /> <Image Name="BottomPressed" Source="Resources/bottomcenter_down.jpg" Visibility="Hidden" /> <Image Name="BottomDisabled" Source="Resources/bottomcenter_off.jpg" Visibility="Hidden" /> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="BottomNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="BottomPressed" Property="Visibility" Value="Visible" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="BottomNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="BottomDisabled" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!--</StackPanel>--> <Image Source="Resources/bottomright_off.jpg" Height="34" Width="34" Canvas.Left="165" Canvas.Top="124"></Image> <Image Source="Resources/bottomleft_off.jpg" Height="34" Width="34" Canvas.Left="100" Canvas.Top="124"></Image> <!--<ToggleButton Style="{StaticResource MyToggleButtonStyle}" Height="34" Width="34" Margin="150,100"/>--> </Canvas> </Grid>

    Read the article

  • Why does applying this gradient style break my silverlight app ?

    - by Robotsushi
    I am having some issues with applying a gradient to a RadButton. I have a gradient definition in my styles resource dictionairy like so : <LinearGradientBrush x:Key="GridView_HeaderBackground" EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FF5B5B5B" Offset="1"/> <GradientStop Color="#FF868686"/> <GradientStop Color="#FF4F4F4F" Offset="0.42"/> <GradientStop Color="#FF0E0E0E" Offset="0.43"/> </LinearGradientBrush> When i apply this gradient directly to the background of a RadButton everything works. Here is the button and the template definition: Button <telerik:RadButton Margin="5,10,5,0" Click="RadButton_Click" Tag="30" Content="30 Days" Style="{StaticResource SliderButton}" Background="{StaticResource GridView_HeaderBackground}" /> Template: <!-- Style Template for Slider RadButton --> <Style x:Key="SliderButton" TargetType="telerik:RadButton"> <Setter Property="Height" Value="30" /> <Setter Property="Foreground" Value="#FFFFFF" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Margin" Value="5,2" /> </Style> However when applying this gradient in the resource dictionary, my application will not load it simply gets to the silverlight loading screen and then never proceeds Here is the button and template which breaks my app. Button: <telerik:RadButton Margin="5,10,5,0" Click="RadButton_Click" Tag="30" Content="30 Days" Style="{StaticResource SliderButton}" /> Template: <!-- Style Template for Slider RadButton --> <Style x:Key="SliderButton" TargetType="telerik:RadButton"> <Setter Property="Background" Value="{StaticResource GridView_HeaderBackground}" /> <Setter Property="Height" Value="30" /> <Setter Property="Foreground" Value="#FFFFFF" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Margin" Value="5,2" /> </Style> When i observe the js error console in google chrome i notice the following error is produced: "Cannot find a resource with the name/key ResourceWrapper"

    Read the article

  • Overlap problem with Android ListView selector

    - by virsir
    I am trying to style my ListView with two 9-patch background images (16px * 9px), one dark image for default state and another green image for selected and pressed state. It works except for just one problem that when I select or press one list item, it seems that the selected item overlap the next one a little bit as I can see some pixels of the green background image is on the top of next item. How to fix that?

    Read the article

  • Integrate StyleCop in NAnt buildscript

    - by stmax
    Is there a way to integrate StyleCop in a NAnt script such that the build fails if there are too many style violations? There doesn't seem to be a NAnt task for StyleCop, but we've found StyleCopCmd. However this only seems to generate an XML file as output that we'd have to parse. Is there some easier solution?

    Read the article

  • How can I use a custom TabItem control when databinding a TabControl in WPF?

    - by Russ
    I have a custom control that is derived from TabItem, and I want to databind that custom TabItem to a stock TabControl. I would rather avoid creating a new TabControl just for this rare case. This is what I have and I'm not having any luck getting the correct control to be loaded. In this case I want to use my ClosableTabItem control instead of the stock TabItem control. <TabControl x:Name="tabCases" IsSynchronizedWithCurrentItem="True" Controls:ClosableTabItem.TabClose="TabClosed" > <TabControl.ItemTemplate> <DataTemplate DataType="{x:Type Controls:ClosableTabItem}" > <TextBlock Text="{Binding Path=Id}" /> </DataTemplate> </TabControl.ItemTemplate> <TabControl.ContentTemplate> <DataTemplate DataType="{x:Type Entities:Case}"> <CallLog:CaseReadOnlyDisplay DataContext="{Binding}" /> </DataTemplate> </TabControl.ContentTemplate> </TabControl> EDIT: This is what I ended up with, rather than trying to bind a custom control. The "CloseCommand" im getting from a previous question. <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}" > <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabItem}"> <Border Name="Border" Background="LightGray" BorderBrush="Black" BorderThickness="1" CornerRadius="25,0,0,0" SnapsToDevicePixels="True"> <StackPanel Orientation="Horizontal"> <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" Margin="20,1,5,1"/> <Button Command="{Binding Path=CloseCommand}" Cursor="Hand" DockPanel.Dock="Right" Focusable="False" Margin="1,1,5,1" Background="Transparent" BorderThickness="0"> <Image Source="/Russound.Windows;component/Resources/Delete.png" Height="10" /> </Button> </StackPanel> </Border> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="FontWeight" Value="Bold" /> <Setter TargetName="Border" Property="Background" Value="LightBlue" /> <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" /> <Setter TargetName="Border" Property="BorderBrush" Value="DarkBlue" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>

    Read the article

  • Using Objective-C Blocks

    - by Sean
    Today I was experimenting with Objective-C's blocks so I thought I'd be clever and add to NSArray a few functional-style collection methods that I've seen in other languages: @interface NSArray (FunWithBlocks) - (NSArray *)collect:(id (^)(id obj))block; - (NSArray *)select:(BOOL (^)(id obj))block; - (NSArray *)flattenedArray; @end The collect: method takes a block which is called for each item in the array and expected to return the results of some operation using that item. The result is the collection of all of those results. (If the block returns nil, nothing is added to the result set.) The select: method will return a new array with only the items from the original that, when passed as an argument to the block, the block returned YES. And finally, the flattenedArray method iterates over the array's items. If an item is an array, it recursively calls flattenedArray on it and adds the results to the result set. If the item isn't an array, it adds the item to the result set. The result set is returned when everything is finished. So now that I had some infrastructure, I needed a test case. I decided to find all package files in the system's application directories. This is what I came up with: NSArray *packagePaths = [[[NSSearchPathForDirectoriesInDomains(NSAllApplicationsDirectory, NSAllDomainsMask, YES) collect:^(id path) { return (id)[[[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil] collect:^(id file) { return (id)[path stringByAppendingPathComponent:file]; }]; }] flattenedArray] select:^(id fullPath) { return [[NSWorkspace sharedWorkspace] isFilePackageAtPath:fullPath]; }]; Yep - that's all one line and it's horrid. I tried a few approaches at adding newlines and indentation to try to clean it up, but it still feels like the actual algorithm is lost in all the noise. I don't know if it's just a syntax thing or my relative in-experience with using a functional style that's the problem, though. For comparison, I decided to do it "the old fashioned way" and just use loops: NSMutableArray *packagePaths = [NSMutableArray new]; for (NSString *searchPath in NSSearchPathForDirectoriesInDomains(NSAllApplicationsDirectory, NSAllDomainsMask, YES)) { for (NSString *file in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:searchPath error:nil]) { NSString *packagePath = [searchPath stringByAppendingPathComponent:file]; if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:packagePath]) { [packagePaths addObject:packagePath]; } } } IMO this version was easier to write and is more readable to boot. I suppose it's possible this was somehow a bad example, but it seems like a legitimate way to use blocks to me. (Am I wrong?) Am I missing something about how to write or structure Objective-C code with blocks that would clean this up and make it clearer than (or even just as clear as) the looped version?

    Read the article

  • Why doesn't Python require exactly four spaces per indentation level?

    - by knorv
    Whitespace is signification in Python in that code blocks are defined by their indentation. Furthermore, Guido van Rossum recommends using four spaces per indentation level (see PEP 8: Style Guide for Python Code). What was the reasoning behind not requiring exactly four spaces per indentation level as well? Are there any technical reasons? It seems like all the arguments that can be made for making whitespace define code blocks can also be used to argument for setting an exact whitespace length for one indentation level (say four spaces).

    Read the article

  • Automaticly Change VisualState in Silverlight

    - by Matt
    If you create a simple button and then choose Edit Template - Edit a Copy, Blend will automatically generate a style area, along with all the button states (MouseEnter, MouseLeave, Pressed, etc). No where in the generated code does it say that on a "MouseOver" event, change the state to "MouseOver", but it still manages to work! How does a standard button do it? Is there some sort of AutoEventWireUp going on?

    Read the article

  • C++ Class Access Specifier Verbosity

    - by PolyTex
    A "traditional" C++ class (just some random declarations) might resemble the following: class Foo { public: Foo(); explicit Foo(const std::string&); ~Foo(); enum FooState { Idle, Busy, Unknown }; FooState GetState() const; bool GetBar() const; void SetBaz(int); private: struct FooPartialImpl; void HelperFunction1(); void HelperFunction2(); void HelperFunction3(); FooPartialImpl* m_impl; // smart ptr FooState m_state; bool m_bar; int m_baz; }; I always found this type of access level specification ugly and difficult to follow if the original programmer didn't organize his "access regions" neatly. Taking a look at the same snippet in a Java/C# style, we get: class Foo { public: Foo(); public: explicit Foo(const std::string&); public: ~Foo(); public: enum FooState { Idle, Busy, Unknown }; public: FooState GetState() const; public: bool GetBar() const; public: void SetBaz(int); private: struct FooPartialImpl; private: void HelperFunction1(); private: void HelperFunction2(); private: void HelperFunction3(); private: FooPartialImpl* m_impl; // smart ptr private: FooState m_state; private: bool m_bar; private: int m_baz; }; In my opinion, this is much easier to read in a header because the access specifier is right next to the target, and not a bunch of lines away. I found this especially true when working with header-only template code that wasn't separated into the usual "*.hpp/*.inl" pair. In that scenario, the size of the function implementations overpowered this small but important information. My question is simple and stems from the fact that I've never seen anyone else actively do this in their C++ code. Assuming that I don't have a "Class View" capable IDE, are there any obvious drawbacks to using this level of verbosity? Any other style recommendations are welcome!

    Read the article

  • Css For Gridview paging

    - by arunendra
    Hi My question is, can I control the style of the paging element separately of top and bottom, I have set the paging to appear in both top and bottom of the gridview, and I want to see that the top pagination is little high up in the page, to do that I used the cssClass and set margin-top:20px and made the position: absolute, this does change the position of the top paging area and set it rightly for me, but the bottom pagination has also come up as a result and now sits inside the grid data!! Is there any way to solve this? Thanks and regards Arunendra

    Read the article

  • Javascript CSS visability.

    - by Alex
    It seems that javascript only can ready inline css if i want to check if element is display:hidden getting it with: el.style.display But how to check if display:none is placed inside external CSS file?

    Read the article

  • Code formatting for initializing lists

    - by Roman
    I've just found in my java project this code snippet: List<IssueType> selectedIssueTypes = new ArrayList<IssueType>(); for (Object item : selectedItems) selectedIssueTypes.add((IssueType) item); How do you think, can this style be used?

    Read the article

  • ruby/ruby on rails memory leak detection

    - by Josh Moore
    I wrote a small web app using ruby on rails, its main purpose is to upload, store, and display results from xml(files can be up to several MB) files. After running for about 2 months I noticed that the mongrel process was using about 4GB of memory. I did some research on debugging ruby memory leaks and could not find much. So I have two questions. Are there any good tools that can be used to find memory leaks in Ruby/rails? What type of coding patterns cause memory leaks in ruby?

    Read the article

  • Parse HTML file to grab all ID and Classes for a CSS file

    - by iamfriendly
    Hey all, A short while ago, I'm fairly certain I came across an application (or perhaps a plugin for Coda - the IDE I use) which quickly parses a html document and then spits out all of the elements with IDs and Classes for me to use in a CSS file. Having fully 'got into' zen coding - using the wonderful TEA plugin for Coda, I'm now hot on the heels of this app/plugin again. I've tried and failed miserably at hunting through Google, but have come up completely empty handed. Does anyone know of anything which can do this? Happy New Year everyone!

    Read the article

  • How does NSValue do its magic?

    - by Paperflyer
    I have an MVC application. The model has a property that is a struct NSSize. It is writable like this: - (void)setSize:(NSSize)aSize; The view sets this NSSize using key-value-coding. However, you can not key-value-code a struct, so I wrapped it in an NSValue-object like this: [theView setValue:[NSValue valueWithSize:mySize] forKey:@"theModel.size"]; To my understanding, this should not work since the accessor expects a struct and not an NSValue. But it works perfectly. Magically. How is this possible?

    Read the article

  • Textmate tab and de-tab selected block

    - by Derek Organ
    Recently switched to Textmate on Mac for coding. On PC when ever I want to tab in or out a block of code I just highlight and press tab or shift+tab to move it in our out. It's very useful when you are adding an extra loop or conditional statement to a block of code to keep everything tidy and neatly indented. On Textmate however when I try this it just replaces my selected text with a tab. So is there a way to do tab and de-tab lines of code in textmate?

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >