Search Results

Search found 2390 results on 96 pages for 'morten green hermansen'.

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

  • Android - Transforming widgets within transformed widgets and the resulting usability issues.

    - by Ben Rose
    Hello. I'm new to Android application development and I'm currently experimenting with various UI ideas. In the image below, you can see a vertically scrolling list of horizontally scrolling galleries (and also textviews as you can see). I'm also doing some matrix and camera transformations which I will come to in a minute. For the background of the list elements, I use green. Blue is the background of the galleries, and red is the background for the images. These are just for my benefit of learning. The galleries being used are extended classes where I overrode the drawChild method to perform a canvas scale operation in order for the image closest to the center (width) to be larger than the others. The list view going vertically, I overrode the drawChild method and used the camera rotations from lack of depth dimension in the canvas functionality. The items in the list are scaled down and rotated relative to their position's proximity to the center (height). I understood that scrolling and clicking would not necessarily follow along with the image transforms, but it appears as though the parent Gallery class's drawing is constrained to the original coordinates as well (see photo below). I would love to hear any insight any of you have regarding how I can change the coordinates of the galleries in what is rendered via gallery scroll and the touch responsiveness of said gallery. Images in the gallery are not same dimensions, so don't let that throw you in looking at the image below Thanks in advance! Ben link to image (could not embed) -- Update: I was using my test application UI and noticed that when I got the UI to the point of the linked image and then I touched the top portion of the next row in the list, the gallery updated to display the proper representation. So, I added a call to clearFocus() in the drawChild method and that resulted in more accurate drawing. It does seem a tad slower, and since I'm on the Incredible, I'm worried it is a bloated solution. In any event, I would still appreciate any thoughts you have regarding the best way to have the views display properly and how to translate the touch events in the gallery's new displayed area to its touchable coordinates so that scrolling on the actual images works when the gallery has moved. Thanks!

    Read the article

  • Make Div overlay ENTIRE page (not just viewport)??

    - by Polaris878
    Hello, So I have a problem that I think is quite common but I have yet to find a good solution for. I want to make an overlay div cover the ENTIRE page... NOT just the viewport. I don't understand why this is so hard to do... I've tried setting body, html heights to 100% etc but that isn't working. Here is what I have so far: <html> <head> <style type="text/css"> .OverLay { position: absolute; z-index: 3; opacity: 0.5; filter: alpha(opacity = 50); top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; background-color: Black; color: White;} body { height: 100%; } html { height: 100%; } </style> </head> <body> <div style="height: 100%; width: 100%; position: relative;"> <div style="height: 100px; width: 300px; background-color: Red;"> </div> <div style="height: 230px; width: 9000px; background-color: Green;"> </div> <div style="height: 900px; width: 200px; background-color: Blue;"></div> <div class="OverLay">TestTest!</div> </div> </body> </html> I'd also be open to a solution in JavaScript if one exists, but I'd much rather just be using some simple CSS.

    Read the article

  • Question about DBD::CSB Statement-Functions

    - by sid_com
    From the SQL::Statement::Functions documentation: Function syntax When using SQL::Statement/SQL::Parser directly to parse SQL, functions (either built-in or user-defined) may occur anywhere in a SQL statement that values, column names, table names, or predicates may occur. When using the modules through a DBD or in any other context in which the SQL is both parsed and executed, functions can occur in the same places except that they can not occur in the column selection clause of a SELECT statement that contains a FROM clause. # valid for both parsing and executing SELECT MyFunc(args); SELECT * FROM MyFunc(args); SELECT * FROM x WHERE MyFuncs(args); SELECT * FROM x WHERE y < MyFuncs(args); # valid only for parsing (won't work from a DBD) SELECT MyFunc(args) FROM x WHERE y; Reading this I would expect that the first SELECT-statement of my example shouldn't work and the second should but it is quite the contrary. #!/usr/bin/env perl use warnings; use strict; use 5.010; use DBI; open my $fh, '>', 'test.csv' or die $!; say $fh "id,name"; say $fh "1,Brown"; say $fh "2,Smith"; say $fh "7,Smith"; say $fh "8,Green"; close $fh; my $dbh = DBI->connect ( 'dbi:CSV:', undef, undef, { RaiseError => 1, f_ext => '.csv', }); my $table = 'test'; say "\nSELECT 1"; my $sth = $dbh->prepare ( "SELECT MAX( id ) FROM $table WHERE name LIKE 'Smith'" ); $sth->execute (); $sth->dump_results(); say "\nSELECT 2"; $sth = $dbh->prepare ( "SELECT * FROM $table WHERE id = MAX( id )" ); $sth->execute (); $sth->dump_results(); outputs: SELECT 1 '7' 1 rows SELECT 2 Unknown function 'MAX' at /usr/lib/perl5/site_perl/5.10.0/SQL/Parser.pm line 2893. DBD::CSV::db prepare failed: Unknown function 'MAX' at /usr/lib/perl5/site_perl/5.10.0/SQL/Parser.pm line 2894. [for Statement "SELECT * FROM test WHERE id = MAX( id )"] at ./so_3.pl line 30. DBD::CSV::db prepare failed: Unknown function 'MAX' at /usr/lib/perl5/site_perl/5.10.0/SQL/Parser.pm line 2894. [for Statement "SELECT * FROM test WHERE id = MAX( id )"] at ./so_3.pl line 30. Could someone explaine me this behavior?

    Read the article

  • Why is my Interface Builder wiring so bonkers and what can I do to straighten it out?

    - by editor
    I've been working on an iPhone application in XCode and Interface Builder of the Tab Bar project type. After getting a table view of topics (business sectors) working fine I realized that I would need to add a Navigation Control to allow the user to drill into a subtopics (subsectors) table. As a green Objective-C developer, that was confusing, but I managed to get it working by reading various documentation trying out a few different IB options. My current setup is a Tab Bar Controller with Tab 1 as a Navigation Controller and Tab 2 a plain view with a Table View placed into it. The wiring works: I can log when table rows are selected and I'm ready to push a new View Controller onto the stack so that I can display the subtopics Table View. My problem: For some reason the first tab's Table View is a delegate and dataSource of the second ta. It doesn't make sense to me and I can't figure out why that's the only setup that works. Here is the wiring: Navigation Controller (Sectors) is a delegate of Tab Bar Navigation Bar is a delegate of Navigation Controller (Sectors) View Contoller (Sectors) has a view of Table View Table View (in Navigation Controller (Sectors)) is a delegate of First View Controller (Companies) Table View (in Navigation Controller (Sectors)) is a dataSource outlet of First View Controller (Companies) First View Controller (Companies) First View Contoller (Sectors) has a view of Table View Table View (in First View Controller (Companies)) is not hooked up to a dataSource outlet and is not a delegate When I click the tab buttons and look at the Inspector I see that the first tab is correctly hooked up to my MainWindow.xib and the second tab has selected a nib called SecondView.xib. It's in the File's Owner of MainWindow.xib where I inherit UITableViewDataSource and UITableViewDelegate (and also UITabBarControllerDelegate) in the .h, and in the .m where I implement the delegate methods. Why does this setup only work when the Table View in my first tab (View Controller (Sectors)) is a delegate and dataSource of the second tab? I'm confused: why wouldn't it need to be hooked up to the Navigation Controller-enabled tab in which the Table View is seen (Navigation Controller (Sectors))? The Table View seen on the second tab has neither dataSource and is not a delegate. I'm having trouble getting a pushViewController to fire (self.navigationController is not nil but the new View Controller still doesn't load) and I suspect that I need to work out this IB wiring issue before I can troubleshoot why the Nav Controller won't push a new View Controller onto the stack. if(nil == self.navigationController) { NSLog(@"self.navigationController is nil."); } else { NSLog(@"self.navigationController is not nil."); SectorList *subsectorViewController = [[SectorList alloc] initWithNibName:@"SectorList" bundle:nil]; subsectorViewController.title = @"Subsectors"; [[self navigationController] pushViewController:subsectorViewController animated:YES]; [subsectorViewController release]; }

    Read the article

  • Correct table layout generation with CSS: unexpected cells shift

    - by MrG
    I'm trying to generate a dynamic table using CSS: <html> <head> <style> div.el1, div.el2 { color:white; width:70px;height:70px; border:0px; padding:0px; font-size: 10px; font-family: "Courier"; } div.el1 { background-color: green; } div.el2 { background-color: orange; } div.tablediv { display: table; border:0px; border-spacing:0px; border-collapse:separate; } div.celldiv { display: table-cell; } div.rowdiv { display: table-row; width:auto; } </style> </head> <body> <div class="tablediv"> <div class="rowdiv"> <div class="celldiv"> <div class="el1" id="x1y1">ABC</div> </div> <div class="celldiv"> <div class="el2" id="x1y2"></div> </div> </div> <div class="rowdiv"> <div class="celldiv"> <div class="el1" id="x2y1"></div> </div> <div class="celldiv"> <div class="el1" id="x2y2"></div> </div> </div> </div> </body> </html> The content of body is dynamically generated and should be displayed as a table. Unfortunately, each cell shifts down if it contains data: expected reality --- --- --- --- | | | | | | --- --- |ABC|--- | | | | | | --- --- --- --- | | | --- --- I'm grateful for any help. Many thanks!

    Read the article

  • EXC_BAD_ACCESS when scrolling table after json data is imported

    - by Michael Robinson
    Hello, I'm having a bear of a time trying to figure out why I'm getting a EXC_BAD ACCESS error. The console is giving me this eror: " -[CFArray objectAtIndex:]: message sent to deallocated instance 0x3b14110", I Can't figure it out...Thanks in advance. // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [rows count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell. NSDictionary *dict = [rows objectAtIndex: indexPath.row]; cell.textLabel.text = [dict objectForKey:@"name"]; cell.detailTextLabel.text = [dict objectForKey:@"age"]; return cell; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.0/255.0 green:207.0/255.0 blue:255.0/255.0 alpha:1.0]; self.title = NSLocalizedString(@"How Big Now", @"How Big Now"); NSURL *url = [NSURL URLWithString:@"http://10.0.1.8/~imac/iphone/jsontest.php"]; NSString *jsonreturn = [[NSString alloc] initWithContentsOfURL:url]; // NSLog(jsonreturn); // Look at the console and you can see what the restults are NSData *jsonData = [jsonreturn dataUsingEncoding:NSUTF32BigEndianStringEncoding]; NSError *error = nil; // In "real" code you should surround this with try and catch NSDictionary * dict = [[CJSONDeserializer deserializer] deserializeAsDictionary:jsonData error:&error]; if (dict) { rows = [dict objectForKey:@"member"]; } NSLog(@"Array: %@",rows); [jsonreturn release]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • CSS Rollovers: how to main "hit area" size when hidden image is larger than anchor area

    - by nukefusion
    I have a small problem and I don't think what I want to do can be achieved with just pure CSS, but I figured I'd ask anyway. Basically, I have one DIV which contains a hyperlinked element that is smaller in size to it's parent DIV. So in effect I have a square within a square with the inner square being the "hit area". When I mouse over this inner square I want the background of the outer square to change. I know it's not possible to change the parent DIV's background on a:hover, but I figured I could give the illusion of it happening by nesting a hidden image inside the anchor. This works great until I want to "roll off". The problem is that I want the image to disappear when I leave the area of the anchor tag, not the larger hidden image. Is this possible? For the benefit of everyone I've provided an example to demonstrate what I mean: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Test Rollover</title> <link href="main.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="d1"> <a href="#nogo"> <b id="b1"></b> <b id="b2"></b> </a> </div> </body> And the css: #b1 { width: 200px; height: 200px; top: 100px; left: 100px; background-color:aqua; position: absolute; } #b2 { width: 400px; height: 400px; background-color:lime; position: absolute; display: none; } #d1 { width: 400px; height: 400px; background-color:fuchsia; position: relative; } #d1 a:hover #b2 { display: block; } In this example I want the green outer square to disappear when I leave the bounds of the hidden inner blue square.

    Read the article

  • Getting RGB values for each pixel from a 24bpp Bitmap in C

    - by seven
    Hello, i want to read the RGB values for each pixel from a .bmp file , so i can convert the bmp into a format suitable for gba . so i need to get just the RGB for each pixel and then write this information to a file. i am trying to use the windows.h structures : typedef struct { char signature[2]; unsigned int fileSize; unsigned int reserved; unsigned int offset; }BmpHeader; typedef struct { unsigned int headerSize; unsigned int width; unsigned int height; unsigned short planeCount; unsigned short bitDepth; unsigned int compression; unsigned int compressedImageSize; unsigned int horizontalResolution; unsigned int verticalResolution; unsigned int numColors; unsigned int importantColors; }BmpImageInfo; typedef struct { unsigned char blue; unsigned char green; unsigned char red; unsigned char reserved; }Rgb; typedef struct { BmpHeader header; BmpImageInfo info; Rgb colors[256]; unsigned short image[1]; }BmpFile; but i only need RGB struct. So lets say i read "in.bmp": FILE *inFile, *outFile; inFile = fopen("C://in.bmp", "rb"); Rgb Palette[256]; for(i=0;i<256;i++) { fread(&Palette[i],sizeof(Rgb),1,inFile); } fclose(inFile); is this correct ? how do i write only the RGB information to a file ? can anyone please give me some information please . Thank you.

    Read the article

  • Can you set a gradient brush for a listboxitem background in silverlight?

    - by Michael
    I am looking for a way to set a gradientbrush as the background for a listbox item. I have a DataTemplate defined and have specified a gradient brush but it always appears as the listbox background (i.e. it never shows as a gradient brush). I have been able to set the background of the listbox itself, and I can set the listboxitem's background to a standard color using the "setter" object....but none of these are what I am after. I really want the background on each list item to be a gradient brush. Below is the datatemplate that I have constructed. <ListBox Name="MyListBox" Margin="12,67,12,169"> <ListBox.ItemTemplate> <DataTemplate> <Grid Height="51" VerticalAlignment="Bottom"> <Grid.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFC9F4D0"/> <GradientStop Color="#FF2AC12A" Offset="0.333"/> <GradientStop Color="#FF35DE35" Offset="1"/> </LinearGradientBrush> </Grid.Background> <Canvas > <dataInput:Label Width="227" Foreground="Yellow" Canvas.Left="158" Canvas.Top="8" Content="{Binding Place}"/> <dataInput:Label Width="146" Foreground="Yellow" Canvas.Left="8" Canvas.Top="8" Content="{Binding Date}"/> <dataInput:Label Content="{Binding People}" Width="346" FontSize="9.333" Foreground="Black" Canvas.Left="166" Canvas.Top="28"/> <!-- <dataInput:Label Width="45" Content="Accept" Foreground="White" Canvas.Left="8" Canvas.Top="28"/> <dataInput:Label Width="45" Content="Decline" Foreground="White" Canvas.Left="57" Canvas.Top="28"/> --> <dataInput:Label Content="SomeText" Width="101" FontSize="9.333" Foreground="White" Canvas.Left="389" Canvas.Top="10"/> <Image Height="21" Width="21" Canvas.Left="500" Canvas.Top="8" Source="Green Button.png"/> </Canvas> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> Any Thoughts?

    Read the article

  • Programmatically Setting ControlTemplate Item

    - by Robert
    I'm having trouble figuring out how to programmatically setting the "Stroke" of my arrow. I'm using these buttons in a menu bar and I want the one currently selected to have it's arrow change to green and all the others gray. <Style x:Key="FooterGrayButtonStyle" TargetType="{x:Type Button}"> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="MinHeight" Value="35" /> <Setter Property="FontSize" Value="16"/> <Setter Property="Margin" Value="0,5,10,5" /> <Setter Property="Foreground" Value="White" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Border x:Name="Bd" Background="#FF535A65" BorderBrush="Black" BorderThickness="1" CornerRadius="10"> <Path x:Name="arrow" Stretch="Fill" Stroke="#FFB1BB1C" StrokeThickness="5" HorizontalAlignment="Right" Margin="5" StrokeEndLineCap="Round" StrokeStartLineCap="Round" StrokeLineJoin="Miter" Width="13" Height="23" Data="M0,0 L1,1 0,2" /> </Border> <ContentPresenter HorizontalAlignment="Left" Margin="15,-2,30,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="Bd" Property="Background" Value="#FFB1BB1C" /> <Setter Property="Stroke" TargetName="arrow" Value="White"/> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Stroke" TargetName="arrow" Value="#FFB7B7B7"/> <Setter Property="Foreground" Value="#FFB7B7B7"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>

    Read the article

  • How can I scroll my custom view? I want to see the shapes drawn over the bounds of the screen

    - by antonio Musella
    I have a Custom view ... package nan.salsa.goal.customview; import android.R; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RectShape; import android.util.AttributeSet; import android.util.Log; import android.view.View; public class DayView extends View { private static String TAG="DayView"; private ShapeDrawable mDrawable; public DayView(Context context) { super(context); } public DayView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public DayView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } public void init() { int x = 10; int y = 10; mDrawable = new ShapeDrawable(new RectShape()); mDrawable.getPaint().setColor(Color.GREEN); mDrawable.setBounds(x, y, x + (width - (x * 2)), y + (height - (y*2))); mDrawable.draw(canvas); for (int i = 1; i < 30; i++) { boxDrawable = new ShapeDrawable(new RectShape()); boxDrawable.setBounds(x + x , y + (100 * i) , x + (width - ((x + x) * 2)), y + (100 * i) + 50); boxDrawable.getPaint().setColor(Color.RED); boxDrawable.draw(canvas); } } @Override protected void onDraw(Canvas canvas) { // TODO Auto-generated method stub super.onDraw(canvas); setBackgroundColor(R.color.black); mDrawable.draw(canvas); } } with this simple configuration file : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#E06F00"> <nan.salsa.goal.customview.DayView android:id="@+id/dayView" android:layout_height="match_parent" android:layout_width="fill_parent" /> </LinearLayout> In my view I want to scroll to see the shapes drawn over the bounds of the screen .. How I can do it? Regards, Antonio Musella

    Read the article

  • Exception showing a erroneous web page in a WPF frame

    - by H4mm3rHead
    I have a small application where i need to navigate to an url, I use this method to get the Frame: public override System.Windows.UIElement GetPage(System.Windows.UIElement container) { XmlDocument doc = new XmlDocument(); doc.Load(Location); string webSiteUrl = doc.SelectSingleNode("website").InnerText; Frame newFrame = new Frame(); if (!webSiteUrl.StartsWith("http://")) { webSiteUrl = "http://" + webSiteUrl; } newFrame.Source = new Uri(webSiteUrl); return newFrame; } My problem is now that the page im trying to show generates a error (or so i think), when i load the page in a browser it never fully loads, keeps saying "loading1 element" in the load bar and the green progress line (IE 8) keeps showing. When i attach my debugger i get this error: System.ArgumentException was unhandled Message="Parameter and value pair is not valid. Expected form is parameter=value." Source="WindowsBase" StackTrace: at MS.Internal.ContentType.ParseParameterAndValue(String parameterAndValue) at MS.Internal.ContentType..ctor(String contentType) at MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response) at System.Windows.Navigation.NavigationService.GetObjectFromResponse(WebRequest request, WebResponse response, Uri destinationUri, Object navState) at System.Windows.Navigation.NavigationService.HandleWebResponse(IAsyncResult ar) at System.Windows.Navigation.NavigationService.<>c__DisplayClassc.<HandleWebResponseOnRightDispatcher>b__8(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) ved System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Application.RunInternal(Window window) at GreenWebPlayerWPF.App.Main() i C:\Development\Hvarregaard\GWDS\GreenWeb\GreenWebPlayerWPF\obj\Debug\App.g.cs:linje 0 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: Anyone? Or any way to capture it and respond to it, tried a try/catch around my code, but its not caught - seems something deep inside the guts of the CLR is failing.

    Read the article

  • java double buffering problem

    - by russell
    Whats wrong with my applet code which does not render double buffering correctly.I am trying and trying.But failed to get a solution.Plz Plz someone tell me whats wrong with my code. import java.applet.* ; import java.awt.* ; import java.awt.event.* ; public class Ball extends Applet implements Runnable { // Initialisierung der Variablen int x_pos = 10; // x - Position des Balles int y_pos = 100; // y - Position des Balles int radius = 20; // Radius des Balles Image buffer=null; //Graphics graphic=null; int w,h; public void init() { Dimension d=getSize(); w=d.width; h=d.height; buffer=createImage(w,h); //graphic=buffer.getGraphics(); setBackground (Color.black); } public void start () { // Schaffen eines neuen Threads, in dem das Spiel l?uft Thread th = new Thread (this); // Starten des Threads th.start (); } public void stop() { } public void destroy() { } public void run () { // Erniedrigen der ThreadPriority um zeichnen zu erleichtern Thread.currentThread().setPriority(Thread.MIN_PRIORITY); // Solange true ist l?uft der Thread weiter while (true) { // Ver?ndern der x- Koordinate repaint(); x_pos++; y_pos++; //x2--; //y2--; // Neuzeichnen des Applets if(x_pos>410) x_pos=20; if(y_pos>410) y_pos=20; try { Thread.sleep (30); } catch (InterruptedException ex) { // do nothing } Thread.currentThread().setPriority(Thread.MAX_PRIORITY); } } public void paint (Graphics g) { Graphics screen=null; screen=g; g=buffer.getGraphics(); g.setColor(Color.red); g.fillOval(x_pos - radius, y_pos - radius, 2 * radius, 2 * radius); g.setColor(Color.green); screen.drawImage(buffer,0,0,this); } public void update(Graphics g) { paint(g); } } what change should i make.When offscreen image is drawn the previous image also remain in screen.How to erase the previous image from the screen??

    Read the article

  • MATLAB plot moving data points in seperate subplots simutaneously

    - by Nate B.
    I wish to visualize the movement of a data point throughout space across a period of time within MATLAB. However, the way I want my figure to display is such that only a single instant is plotted at any given time. That was easy, I simply created a for loop to update my 3D plot display for every set of coordinates (x,y,z) in my data. However, I wish to display 4 different viewing angles of this plot at all times. I am well aware of how to setup subplots within MATLAB, that is not the issue. My issue is getting all 4 of these subplots to execute simultaneously so that all 4 subplots are always displaying the same point in time. I would appreciate if anyone could suggest how to handle this issue. As requested, my code for a figure with a single plot is shown below: datan = DATA; %data in form of x,y,z,a,b,c by column for row# of time points tib=zeros(size(datan,1),12); tib(:,1:3) = datan(:,1:3); tib_ref=tib(1,1:3); for i=1:size(datan,1) tib(i,1:3)=tib(i,1:3)-tib_ref; end angle_to_dircos close all figure('Name','Directions (Individual Cycles)','NumberTitle','off') for cc=1:2 hold off for bb=1:10:size(tib,1); scatter3(tib(bb,1),tib(bb,2),tib(bb,3),'green','filled'); %z and y axes are flipped in polhemus system hold on p0 = [tib(bb,1),tib(bb,2),tib(bb,3)]; p1 = [tib(bb,1)+10*tib(bb,4),tib(bb,2)+10*tib(bb,5),tib(bb,3)+10*tib(bb,6)]; p2 = [tib(bb,1)+10*tib(bb,7),tib(bb,2)+10*tib(bb,8),tib(bb,3)+10*tib(bb,9)]; p3 = [-(tib(bb,1)+100*tib(bb,10)),-(tib(bb,2)+100*tib(bb,11)),-(tib(bb,3)+100*tib(bb,12))]; vectarrow(p0,p1,1,0,0) hold on vectarrow(p0,p2,0,1,0) hold on vectarrow(p0,p3,0,0,1) hold on az = 90; el = 0; view(az, el); xlim([-50,50]); ylim([-50,50]); zlim([-50,50]); xlabel('distance from center in X'); ylabel('distance from center in Y'); zlabel('distance from center in Z'); title('XYZ Scatter Plots of Tracker Position'); hold on plot3(0,0,0,'sk','markerfacecolor',[0,0,0]); p0 = [0,0,0]; p1 = [10,0,0]; p2 = [0,10,0]; p3 = [0,0,100]; vectarrow(p0,p1,1,0,0) hold on vectarrow(p0,p2,0,1,0) hold on vectarrow(p0,p3,1,0,1) drawnow; end end

    Read the article

  • CSS Margin problem

    - by amitairos
    I'm starting out in HTML and CSS. I have a div element on the page, which doesn't fill the whole page. In it- there's a ul element and some list items in it. I want to put the list 227px from the top of the div element, but I can't manage to accomplish this- it pushes it more. Also- between the list items I want a margin of 40 pixels, but it also does more. What's the problem? Here's my code: Html: <body> <div class="Hashta"> <div class="Menu"> <ul id="MenuItems"> <li><a href="#" >ONE</a></li> <li><a href="#" >TWO</a></li> <li><a href="#" >THREE</a></li> <li><a href="#" >FOUR</a></li> </ul> </div> </div> </body> CSS: body { background-color: Gray; } .Hashta{ width:874px; height:650px; background-color:black; margin: auto auto 50px auto; border-radius: 20px; border: 3px solid darkgray; moz-box-shadow: 2px 2px 10px black; webkit-box-shadow: 2px 2px 10px black; box-shadow: 2px 2px 10px black; } .Menu { margin-top: 227px; padding-right: 50px; float:right; } #MenuItems { list-style:none; } #MenuItems li { text-align:center; position:relative; padding: 4px 10px 4px 10px; margin-right:30px; margin-bottom: 40px; border:none; } #MenuItems li a{ width: 280px; height: 70px; background-color: green; color:White; font-family:Arial, Helvetica, sans-serif; font-size:24px; display:block; outline:0; text-decoration:none; text-shadow: 1px 1px 1px #000; line-height: 70px; } If you want to measure the pixels- you can install this: http://www.mioplanet.com/products/pixelruler/ (click to rotate) Thanks!

    Read the article

  • How to change button's image in visual c++ at run time?

    - by karikari
    After trying and error for many times, I decided to ask here. My objective is I wanted to change the feature of my IE toolbar button. The button is firstly setup by IE at IE startup using the function CRebarHandler::onSetRedraw and CRebarHandler::setButtonMenu2(). And then, I create a call from another cpp file, to call CRebarHandler::setButtonMenu2(). I intent to change just the button's image. I assigned the ID of the image correctly. But somehow it does not work. When I put other code inside this function,like a code for writing to file, it is proven work. Means, it is properly being called from the other file. But the thing is, the code for the button inside CRebarHandler::setButtonMenu2() seems does not work. Need help. Here is the code I am working on (I modify John Lister's button code): LRESULT CRebarHandler::onSetRedraw(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){ bHandled=false; if (m_ieVer==6){ if (!m_hWndToolbar) scanForToolbarSlow(); if (m_hWndToolbar){ findButton(m_hWndToolbar); if (m_buttonID>0) setButtonMenu(); } } return S_OK; } void CRebarHandler::setButtonMenu(){ HIMAGELIST hImageList = ImageList_Create(32, 32,ILC_COLOR16 | ILC_MASK,1, 0); HINSTANCE module = _AtlBaseModule.GetResourceInstance(); TBBUTTONINFO inf; inf.cbSize=sizeof(inf); inf.dwMask = TBIF_IMAGE; char psBuffer[128]; FILE *pPipe; float f = 0; pPipe = _popen("javaw -jar c:\\simmetrics.jar c:\\chtml.txt c:\\thtml.txt", "rt" ); char* p = fgets(psBuffer, 128, pPipe); std::istringstream iss(p); iss >> f; if (f > 0.9) { inf.iImage = 1; SendMessage(m_hWndToolbar, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); iss.clear(); f = 0; } else { inf.iImage = 2; SendMessage(m_hWndToolbar, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); iss.clear(); f = 0; } iss.clear(); f = 0; } void CRebarHandler::setButtonMenu2(){ TBBUTTONINFO inf; inf.cbSize=sizeof(inf); inf.dwMask = TBIF_IMAGE; inf.iImage = 1; //green SendMessage(NULL, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); }

    Read the article

  • Swapping two jQuery draggable list items not working properly (with jsFiddle example)

    - by Tony_Henrich
    The minimalist working example below swaps the two boxes when box 'one' is dragged and dropped on box 'two'. The problem is that when box 'one' is dropped, its style has 'top' & 'left' values causing it to be placed away from where it should drop. Its class includes 'ui-draggable-dragging'. It seems the top & left values are related to the amount the elements were dragged before the drop. And the dragging was 'interrupted' hence the residual 'ui-draggable-dragging' class? What am I missing to make the swap work seamlessly? full jsfiddle example here <html> <head> <script type="text/javascript" src="includes/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="includes/jquery-ui-1.8.2.custom.min.js"></script> <script type="text/javascript"> jQuery.fn.swapWith = function(to) { return this.each(function() { var copy_to = $(to).clone(true); var copy_from = $(this).clone(true); $(to).replaceWith(copy_from); $(this).replaceWith(copy_to); }); }; $(document).ready(function() { options = {revert: true}; $("li").draggable(options) $('#wrapper').droppable({ drop: function(event, ui) { $(ui.draggable).swapWith($('#two')); } }); }); </script> </head> <body> <form> <ul id="wrapper"> <li id='one'> <div style="width: 100px; height: 100px; border: 1px solid green"> one<br /></div> </li> <li id='two'> <div style="width: 110px; height: 110px; border: 1px solid red"> two<br /></div> </li> </ul> <br /> </form> </body> </html>

    Read the article

  • Unit Testing - Am I doing it right?

    - by baron
    Hi everyone, Basically I have been programing for a little while and after finishing my last project can fully understand how much easier it would have been if I'd have done TDD. I guess I'm still not doing it strictly as I am still writing code then writing a test for it, I don't quite get how the test becomes before the code if you don't know what structures and how your storing data etc... but anyway... Kind of hard to explain but basically lets say for example I have a Fruit objects with properties like id, color and cost. (All stored in textfile ignore completely any database logic etc) FruitID FruitName FruitColor FruitCost 1 Apple Red 1.2 2 Apple Green 1.4 3 Apple HalfHalf 1.5 This is all just for example. But lets say I have this is a collection of Fruit (it's a List<Fruit>) objects in this structure. And my logic will say to reorder the fruitids in the collection if a fruit is deleted (this is just how the solution needs to be). E.g. if 1 is deleted, object 2 takes fruit id 1, object 3 takes fruit id2. Now I want to test the code ive written which does the reordering, etc. How can I set this up to do the test? Here is where I've got so far. Basically I have fruitManager class with all the methods, like deletefruit, etc. It has the list usually but Ive changed hte method to test it so that it accepts a list, and the info on the fruit to delete, then returns the list. Unit-testing wise: Am I basically doing this the right way, or have I got the wrong idea? and then I test deleting different valued objects / datasets to ensure method is working properly. [Test] public void DeleteFruit() { var fruitList = CreateFruitList(); var fm = new FruitManager(); var resultList = fm.DeleteFruitTest("Apple", 2, fruitList); //Assert that fruitobject with x properties is not in list ? how } private static List<Fruit> CreateFruitList() { //Build test data var f01 = new Fruit {Name = "Apple",Id = 1, etc...}; var f02 = new Fruit {Name = "Apple",Id = 2, etc...}; var f03 = new Fruit {Name = "Apple",Id = 3, etc...}; var fruitList = new List<Fruit> {f01, f02, f03}; return fruitList; }

    Read the article

  • DataTriggered animation is triggered only in the first time

    - by Pavel
    I just wanted to create very simple example of DataTriggers and animation. Two checkboxes and Rectangle. Checking the first cb makes the rectangle fade away. (CodeBehind var is true) Checking the second cb makes the rectangle come back. (var is false) App is loading - the rectangle is showing (true) Firs cb is checked by default. I'm checking second cb - rect is dissapearing. It's OK. But when I then check the first cb rect isn't showing up. But checking the second cb still makes rect show up and fade away. here's my xaml and code behind: <StackPanel> <RadioButton IsChecked="True" Checked="RadioButton_Checked"></RadioButton> <RadioButton Checked="RadioButton_Checked_1"></RadioButton> <Rectangle Name="r1" Width="100" Height="300" Fill="Green"> <Rectangle.Style> <Style TargetType="Rectangle"> <Style.Triggers> <DataTrigger Binding="{Binding Active}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:1" /> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> </DataTrigger> <DataTrigger Binding="{Binding Active}" Value="False"> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:1" /> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> </DataTrigger> </Style.Triggers> </Style> </Rectangle.Style> </Rectangle> </StackPanel> public bool Active { get { return (bool) GetValue(ActiveProperty); } set { SetValue(ActiveProperty, value); } } public static readonly DependencyProperty ActiveProperty = DependencyProperty.Register("Active", typeof(bool), typeof(MainWindow), new UIPropertyMetadata(false)); private void RadioButton_Checked(object sender, RoutedEventArgs e) { Active = true; } private void RadioButton_Checked_1(object sender, RoutedEventArgs e) { Active = false; }

    Read the article

  • I'm having trouble traversing a newly appended DOM element with jQuery

    - by culov
    I have a form that I want to be used to add entries. Once an entry is added, the original form should be reset to prepare it for the next entry, and the saved form should be duplicated prior to resetting and appended onto a div for 'storedEntries.' This much is working (for the most part), but Im having trouble accessing the newly created form... I need to change the value attribute of the submit button from 'add' to 'edit' so properly communicate what clicking that button should do. heres my form: <div class="newTruck"> <form id="addNewTruck" class='updateschedule' action="javascript:sub(sTime.value, eTime.value, lat.value, lng.value, street.value);"> <b style="color:green;">Opening at: </b> <input id="sTime" name="sTime" title="Opening time" value="Click to set opening time" class="datetimepicker"/> <b style="color:red;">Closing at: </b> <input id="eTime" name= "eTime" title="Closing time" value="Click to set closing time" class="datetimepicker"/> <label for='street'>Address</label> <input type='text' name='street' id='street' class='text' autocomplete='off'/> <input id='submit' class='submit' style="cursor: pointer; cursor: hand;" type="submit" value='Add new stop'/> <div id='suggests' class='auto_complete' style='display:none'></div> <input type='hidden' name='lat' id='lat'/> <input type='hidden' name='lng' id='lng'/> ive tried using a hundred different selectors with jquery to no avail... heres my script as it stands: function cloneAndClear(){ var id = name+now; $j("#addNewTruck").clone(true).attr("id",id).appendTo(".scheduledTrucks"); $j('#'+id).filter('#submit').attr('value', 'Edit'); $j("#addNewTruck")[0].reset(); createPickers(); } the element is properly cloned and inserted into the div, but i cant find a way to access this element... the third line in the script never works. Another problem i am having is that the 'values' in the cloned form revert back to the value in the source of the html rather than what the user inputs. advice on how to solve either of these issues is greatly appreciated!

    Read the article

  • Tab Bar and Nav Controller: Where did I go wrong in my Interface Builder wiring?

    - by editor
    Even if you don't know how I've shot myself in the foot, a story which I've tried to lay out below, if you think I've done a good job showing the parameters of my problem I'd appreciate an upvote so that I might be able to grab some attention for my question. I've been working on an iPhone application in XCode and Interface Builder of the Tab Bar project type. After getting a table view of topics (business sectors) working fine I realized that I would need to add a Navigation Control to allow the user to drill into a subtopics (subsectors) table. As a green Objective-C developer, that was confusing, but I managed to get it working by reading various documentation trying out a few different IB options. My current setup is a Tab Bar Controller with Tab 1 as a Navigation Controller and Tab 2 a plain view with a Table View placed into it. The wiring works: I can log when table rows are selected and I'm ready to push a new View Controller onto the stack so that I can display the subtopics Table View. My problem: For some reason the first tab's Table View is a delegate and dataSource of the second ta. It doesn't make sense to me and I can't figure out why that's the only setup that works. Here is the wiring: Navigation Controller (Sectors) is a delegate of Tab Bar Navigation Bar is a delegate of Navigation Controller (Sectors) View Contoller (Sectors) has a view of Table View Table View (in Navigation Controller (Sectors)) is a delegate of First View Controller (Companies) Table View (in Navigation Controller (Sectors)) is a dataSource outlet of First View Controller (Companies) First View Controller (Companies) First View Contoller (Sectors) has a view of Table View Table View (in First View Controller (Companies)) is not hooked up to a dataSource outlet and is not a delegate When I click the tab buttons and look at the Inspector I see that the first tab is correctly hooked up to my MainWindow.xib and the second tab has selected a nib called SecondView.xib. It's in the File's Owner of MainWindow.xib where I inherit UITableViewDataSource and UITableViewDelegate (and also UITabBarControllerDelegate) in the .h, and in the .m where I implement the delegate methods. Why does this setup only work when the Table View in my first tab (View Controller (Sectors)) is a delegate and dataSource of the second tab? I'm confused: why wouldn't it need to be hooked up to the Navigation Controller-enabled tab in which the Table View is seen (Navigation Controller (Sectors))? The Table View seen on the second tab has neither dataSource and is not a delegate. I'm having trouble getting a pushViewController to fire (self.navigationController is not nil but the new View Controller still doesn't load) and I suspect that I need to work out this IB wiring issue before I can troubleshoot why the Nav Controller won't push a new View Controller onto the stack. if(nil == self.navigationController) { NSLog(@"self.navigationController is nil."); } else { NSLog(@"self.navigationController is not nil."); SectorList *subsectorViewController = [[SectorList alloc] initWithNibName:@"SectorList" bundle:nil]; subsectorViewController.title = @"Subsectors"; [[self navigationController] pushViewController:subsectorViewController animated:YES]; [subsectorViewController release]; }

    Read the article

  • ServeletException, Property <variable name> not found

    - by k9yosh
    What i'm trying to do is add a new variable to this previously created Managed Bean Hello.java and use it in my xhtml file binding to a text field. But it seems that it is not being found when i run it on the server. So it throws a "ServeletException" and says that the "property 'lname'(my variable) is not found". How do i solve this and why is this happening? This is my managed bean, package stack.tute.malinda.model; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class Hello { private String fname; private String message; private String lname; //trying to add this new variable and use it in my xhtml file in a text field. public String getLname() { return lname; } public void setLname(String lname) { this.lname = lname; } public String getName() { return fname; } public String createMessage() { message="Hello " + fname + ""+ lname +"!"; return null; } public void setName(String fname) { this.fname=fname; } public String getMessage() { return message; } } This is my xhtml code, <h:body> <fieldset style="padding: 1em; float:left; margin-right:0.5em; padding-top:0.2em; text-align:left; border:1px solid green; font-weight:bold;"> <legend>Personal Details</legend> <h:form> <h:outputLabel for="name" value="First Name :" required="true"/> <h:inputText id="name" value="#{hello.name}"/> <br/> //Trying to access that variable here. <h:outputLabel for="name1" value="Last Name :" required="true"/> <h:inputText id="name1" value="#{hello.lname}"/> <h:message for="name"/> <br/> <h:commandButton value="Say hello" action="#{hello.createMessage}"> <f:ajax execute="@form" render="@form"/> </h:commandButton> <br/> <h:outputText value="#{hello.message}"/> </h:form> </fieldset>

    Read the article

  • Not allowing characters after Space. Mysql Insert With PHP

    - by Jake
    Ok so I think this is easy but I dont know (I'm a novice to PHP and MySQL). I have a select that is getting data from a table in the database. I am simply taking whatever options the user selects and putting it into a separate table with a php mysql insert statement. But I am having a problem. When I hit submit, everything is submitted properly except for any select options that have spaces don't submit after the first space. For example if the option was COMPUTER REPAIR, all that would get sent is COMPUTER. I will post code if needed, and any help would be greatly appreciated. Thanks! Ok here is my select code: <?php include("./config.php"); $query="SELECT id,name FROM category_names ORDER BY name"; $result = mysql_query ($query); echo"<div style='overflow:auto;width:100%'><label>Categories (Pick three that describe your business)</label><br/><select name='select1'><option value='0'>Please Select A Category</option>"; // printing the list box select command while($catinfo=mysql_fetch_array($result)){//Array or records stored in $nt echo "<option>$catinfo[name]</option><br/> "; } echo"</select></div>"; ?> And here is my insert code ( Just to let you know its got everything not just the select!) ?php require("./config.php"); $companyname = mysql_real_escape_string(addslashes(trim($_REQUEST['name']))); $phone = mysql_real_escape_string(addslashes($_REQUEST['phone'])); $zipcode = mysql_real_escape_string(addslashes($_REQUEST['zipcode'])); $city = mysql_real_escape_string(addslashes($_REQUEST['city'])); $description = mysql_real_escape_string(addslashes($_REQUEST['description'])); $website = mysql_real_escape_string(addslashes($_REQUEST['website'])); $address = mysql_real_escape_string(addslashes($_REQUEST['address'])); $other = mysql_real_escape_string(addslashes($_REQUEST['other'])); $payment = mysql_real_escape_string(addslashes($_REQUEST['payment'])); $products = mysql_real_escape_string(addslashes($_REQUEST['products'])); $email = mysql_real_escape_string(addslashes($_REQUEST['email'])); $select1 = mysql_real_escape_string(addslashes($_REQUEST['select1'])); $select2 = mysql_real_escape_string(addslashes($_REQUEST['select2'])); $select3 = mysql_real_escape_string(addslashes($_REQUEST['select3'])); $save=$_POST['save']; if(!empty($save)){ $sql="INSERT INTO gj (name, phone, city, zipcode, description, dateadded, website, address1, other2, payment_options, Products, email,cat1,cat2,cat3) VALUES ('$companyname','$phone','$city','$zipcode','$description',curdate(),'$website','$address','$other','$payment','$products','$email','$select1','$select2','$select3')"; if (!mysql_query($sql,$link)) { die('Error: ' . mysql_error()); } echo "<br/><h2><font color='green' style='font-size:15px'>1 business added</font></h2>"; mysql_close($link); } ?>

    Read the article

  • How do I change the visual style of a listitem based on its bound value?

    - by Rodd
    I have a listbox (here's the xaml): <ListBox MinWidth="300" ItemsSource="{Binding Relationships, Mode=OneWay}" SelectedItem="{Binding SelectedRelationship, Mode=TwoWay}" SelectionMode="Single" HorizontalAlignment="Left" > <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <CheckBox IsChecked = "{Binding IsPrimary}" IsHitTestVisible="False" /> <StackPanel Orientation="Horizontal" Grid.Column="1"> <TextBlock Text="{Binding RelationshipType}" FontWeight="Bold" Margin="0,0,5,0" /> <TextBlock Text="{Binding Status}" FontStyle="Italic" /> </StackPanel> <TextBlock Text="{Binding UnitName}" Grid.Row="1" Grid.Column="1" /> <TextBlock Text="{Binding StartDate, Converter={StaticResource DateConverter}}" Grid.Row="2" Grid.Column="1"/> <TextBlock Text="{Binding RetireDate}" Grid.Row="3" Grid.Column="1" /> <TextBlock Text="{Binding EndDate}" Grid.Row="4" Grid.Column="1" /> <TextBlock Text="{Binding ReasonForLeaving}" Grid.Row="5" Grid.Column="1" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> What I want to do is have each item in the listbox have one of 3 backgrounds (green if the value of IsPrimary = true, Orange if the EndDate value is empty and grey if the EndDate value is not empty. Is there a way to template the listbox items so that they evaluate bound items to determine a view state or to have each listbox item bind to a value that I can set for each item in my viewmodel? Thanks for your help.

    Read the article

  • UITableViewCell separator line disappears on scroll

    - by iconso
    I'm trying to have a separator cell with a custom image. I did try something like that: In my cellForRowAtIndexPath: NSString *cellIdentifier = [NSString stringWithFormat:@"identifier"]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; } cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:19]; cell.textLabel.text = [self.menuItems objectAtIndex:indexPath.row]; cell.textLabel.textColor = [UIColor colorWithRed:128/255.0f green:129/255.0f blue:132/255.0f alpha:1.0f]; cell.backgroundColor = [UIColor whiteColor]; UIImageView *imagView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"reaL.png"]]; imagView.frame = CGRectMake(0, cellHeight, cellWidth, 1); [cell.contentView addSubview:imagView]; switch (indexPath.row) { case 0: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"img1.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"route.png"] scaledToSize:CGSizeMake(27, 27)]; break; case 1: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"img.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"money.png"] scaledToSize:CGSizeMake(27, 27)]; break; case 2: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"auto.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"cars.png"] scaledToSize:CGSizeMake(27, 27)]; break; case 3: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"impostazioni.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"impostazioni.png"] scaledToSize:CGSizeMake(27, 27)]; // cell.imageView.contentMode = UIViewContentModeScaleAspectFill; break; case 4: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"info.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"info.png"] scaledToSize:CGSizeMake(27, 27)]; break; default: break; } return cell; When I lunch the app everything is good, but when I scroll the the table, or when I select a cell the separator lines disappear. How I can have a permanent custom line separator?

    Read the article

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